Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chrome only #99

Open
wants to merge 17 commits into
base: develop
Choose a base branch
from
Open

chrome only #99

wants to merge 17 commits into from

Conversation

shashwatahalder01
Copy link
Owner

@shashwatahalder01 shashwatahalder01 commented Jan 7, 2025

All Submissions:

  • My code follow the WordPress' coding standards
  • My code satisfies feature requirements
  • My code is tested
  • My code passes the PHPCS tests
  • My code has proper inline documentation
  • I've included related pull request(s) (optional)
  • I've included developer documentation (optional)
  • I've added proper labels to this pull request

Changes proposed in this Pull Request:

Related Pull Request(s)

  • Full PR Link

Closes

  • Closes #

How to test the changes in this Pull Request:

  • Steps or issue link

Changelog entry

Title

Detailed Description of the pull request. What was previous behaviour
and what will be changed in this PR.

Before Changes

Describe the issue before changes with screenshots(s).

After Changes

Describe the issue after changes with screenshot(s).

Feature Video (optional)

Link of detailed video if this PR is for a feature.

PR Self Review Checklist:

  • Code is not following code style guidelines
  • Bad naming: make sure you would understand your code if you read it a few months from now.
  • KISS: Keep it simple, Sweetie (not stupid!).
  • DRY: Don't Repeat Yourself.
  • Code that is not readable: too many nested 'if's are a bad sign.
  • Performance issues
  • Complicated constructions that need refactoring or comments: code should almost always be self-explanatory.
  • Grammar errors.

FOR PR REVIEWER ONLY:

As a reviewer, your feedback should be focused on the idea, not the person. Seek to understand, be respectful, and focus on constructive dialog.

As a contributor, your responsibility is to learn from suggestions and iterate your pull request should it be needed based on feedback. Seek to collaborate and produce the best possible contribution to the greater whole.

  • Correct — Does the change do what it’s supposed to? ie: code 100% fulfilling the requirements?
  • Secure — Would a nefarious party find some way to exploit this change? ie: everything is sanitized/escaped appropriately for any SQL or XSS injection possibilities?
  • Readable — Will your future self be able to understand this change months down the road?
  • Elegant — Does the change fit aesthetically within the overall style and architecture?

Summary by CodeRabbit

  • Tests
    • Modified E2E and API test workflow configuration, including the removal of several setup steps.
    • Commented out test dependencies in Playwright configuration for the e2e_tests project.
    • Updated admin login test to run in focused mode (only this test will execute).
    • Altered Playwright installation command to install dependencies for all supported browsers instead of just Chromium.
    • Added steps for publishing HTML reports to GitHub Pages and echoing test results.

Copy link

coderabbitai bot commented Jan 7, 2025

Warning

Rate limit exceeded

@shashwatahalder01 has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 33 minutes and 29 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between 41c2361 and 2b21959.

📒 Files selected for processing (1)
  • .github/workflows/e2e_api_tests.yml (4 hunks)

Walkthrough

The pull request introduces modifications to the end-to-end (E2E) and API testing workflow. Changes span across four files: the GitHub Actions workflow configuration, Playwright test configuration, an admin login test specification, and the package.json scripts. The primary alterations involve simplifying the testing setup by removing specific environment preparation steps and dependencies, broadening the browser installation command, and focusing on a single admin login test case. These changes significantly alter the functional flow of the testing process.

Changes

File Change Summary
.github/workflows/e2e_api_tests.yml Removed multiple test setup steps, commented out E2E and API test execution, modified test dependency installation, and added steps for publishing HTML reports.
tests/pw/e2e.config.ts Commented out the dependencies configuration for e2e_tests project, removing conditional setup dependency.
tests/pw/tests/e2e/admin.spec.ts Changed 'admin can login' test to test.only, ensuring only this specific test runs in the suite and modified its implementation.
tests/pw/package.json Updated the pw:browser-with-deps script to install dependencies for all supported browsers instead of just Chromium.

Poem

🐰 In the realm of tests, a rabbit hops light,
Workflows trimmed, configurations tight
One login test to rule them all
E2E magic, standing tall
Simplicity reigns with playful might! 🧪


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR. (Beta)
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 4

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 466f28a and 23392e7.

📒 Files selected for processing (3)
  • .github/workflows/e2e_api_tests.yml (2 hunks)
  • tests/pw/e2e.config.ts (1 hunks)
  • tests/pw/tests/e2e/admin.spec.ts (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: e2e_api tests
🔇 Additional comments (1)
.github/workflows/e2e_api_tests.yml (1)

99-104: Verify Chrome-only test coverage is sufficient.

Running only Chrome tests without cross-browser testing could miss browser-specific issues. Consider maintaining a minimal set of tests for other browsers.

@@ -146,7 +146,7 @@ export default defineConfig({
name: 'e2e_tests',
testMatch: /.*\.spec\.ts/,
/* whether not to run setup tests before running actual tests */
dependencies: NO_SETUP ? [] : ['e2e_setup'],
// dependencies: NO_SETUP ? [] : ['e2e_setup'],
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codebase verification

⚠️ Potential issue

Keep the e2e_setup dependency to maintain test reliability

The e2e_setup dependency is part of a carefully designed test initialization chain:

  • The setup files (_env.setup.ts, _site.setup.ts, etc.) contain crucial environment initialization
  • Other test projects maintain their setup dependencies using NO_SETUP flag
  • Breaking this chain by commenting out the dependency could lead to inconsistent test environments
🔗 Analysis chain

Verify test dependencies before removing setup phase.

Commenting out the e2e_setup dependency could lead to test failures if the environment is not properly initialized. Consider keeping the dependency and using the existing NO_SETUP environment variable instead.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check if any tests depend on environment setup
# Look for setup-dependent operations in test files

# Search for environment-dependent operations
rg -l "beforeAll|beforeEach" tests/e2e/

Length of output: 92


Script:

#!/bin/bash
# First, find test files to understand the directory structure
fd -e ts -e js test

# Then look for setup patterns in the test files
rg -l "beforeAll|beforeEach|setup" tests/pw/

# Check the content of the config file for context
cat tests/pw/e2e.config.ts

Length of output: 12654

@@ -3,7 +3,7 @@ import { LoginPage } from '@pages/loginPage';
import { data } from '@utils/testData';

test.describe('Admin functionality test', () => {
test('admin can login', { tag: ['@lite', '@admin'] }, async ({ page }) => {
test.only('admin can login', { tag: ['@lite', '@admin'] }, async ({ page }) => {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Remove .only to enable all tests.

Using test.only will skip other important tests in the suite, including the logout test. This appears to be a debugging artifact and should be removed before merging.

-    test.only('admin can login', { tag: ['@lite', '@admin'] }, async ({ page }) => {
+    test('admin can login', { tag: ['@lite', '@admin'] }, async ({ page }) => {
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
test.only('admin can login', { tag: ['@lite', '@admin'] }, async ({ page }) => {
test('admin can login', { tag: ['@lite', '@admin'] }, async ({ page }) => {

Comment on lines 167 to 233
# Prepare test summary
- name: Prepare test summary
id: prepare-test-summary
uses: actions/github-script@v7
if: always() && steps.clone-dokan-lite.outcome == 'success'
with:
result-encoding: string
script: |
const script = require("./tests/pw/utils/gitTestSummary.ts")
return await script({github, context, core})

# # Find PR comment
# - name: Find PR comment by github-actions[bot]
# id: find-comment
# if: github.event_name == 'pull_request'
# uses: peter-evans/find-comment@v3
# # Prepare test summary
# - name: Prepare test summary
# id: prepare-test-summary
# uses: actions/github-script@v7
# if: always() && steps.clone-dokan-lite.outcome == 'success'
# with:
# issue-number: ${{ github.event.pull_request.number }}
# comment-author: 'github-actions[bot]'
# body-includes: Tests Summary

# # Post test summary as PR comment
# - name: Create or update PR comment
# if: github.event_name == 'pull_request'
# uses: peter-evans/create-or-update-comment@v4
# with:
# comment-id: ${{ steps.find-comment.outputs.comment-id }}
# issue-number: ${{ github.event.pull_request.number }}
# body: ${{ steps.prepare-test-summary.outputs.result }}
# reactions: hooray
# edit-mode: replace

# Backup Database
- name: Backup Database
if: always() && steps.wp-env.outcome == 'success'
working-directory: tests/pw
run: |
npm run wp-env run tests-cli wp db export wp-data/db.sql
# result-encoding: string
# script: |
# const script = require("./tests/pw/utils/gitTestSummary.ts")
# return await script({github, context, core})

# # # Find PR comment
# # - name: Find PR comment by github-actions[bot]
# # id: find-comment
# # if: github.event_name == 'pull_request'
# # uses: peter-evans/find-comment@v3
# # with:
# # issue-number: ${{ github.event.pull_request.number }}
# # comment-author: 'github-actions[bot]'
# # body-includes: Tests Summary

# # # Post test summary as PR comment
# # - name: Create or update PR comment
# # if: github.event_name == 'pull_request'
# # uses: peter-evans/create-or-update-comment@v4
# # with:
# # comment-id: ${{ steps.find-comment.outputs.comment-id }}
# # issue-number: ${{ github.event.pull_request.number }}
# # body: ${{ steps.prepare-test-summary.outputs.result }}
# # reactions: hooray
# # edit-mode: replace

# # Backup Database
# - name: Backup Database
# if: always() && steps.wp-env.outcome == 'success'
# working-directory: tests/pw
# run: |
# npm run wp-env run tests-cli wp db export wp-data/db.sql

# Upload artifacts
- name: Archive test artifacts (screenshots, HTML snapshots, Reports)
if: always() && steps.debug-log.outcome == 'success'
uses: actions/upload-artifact@v4
with:
name: test-artifact
path: |
tests/pw/wp-data
tests/pw/playwright
tests/pw/playwright-report
if-no-files-found: ignore
retention-days: 30
# # Upload artifacts
# - name: Archive test artifacts (screenshots, HTML snapshots, Reports)
# if: always() && steps.debug-log.outcome == 'success'
# uses: actions/upload-artifact@v4
# with:
# name: test-artifact
# path: |
# tests/pw/wp-data
# tests/pw/playwright
# tests/pw/playwright-report
# if-no-files-found: ignore
# retention-days: 30
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Maintain test coverage and reporting.

Removing test coverage collection, API tests, and artifacts upload significantly reduces visibility into test results and makes debugging harder. Consider:

  1. Keeping coverage reporting for Chrome tests
  2. Maintaining API tests as they are browser-independent
  3. Preserving test artifacts for debugging

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

♻️ Duplicate comments (3)
.github/workflows/e2e_api_tests.yml (3)

106-145: ⚠️ Potential issue

Restore critical setup steps

The removal of essential setup steps could lead to test instability and slower execution:

  1. Debug logging is crucial for troubleshooting test failures
  2. Browser binary caching improves workflow performance
  3. OS dependencies are required for browser automation

168-173: ⚠️ Potential issue

Restore test coverage collection

Test coverage reporting is essential for maintaining code quality and identifying untested code paths.


175-182: ⚠️ Potential issue

Restore API test execution

API tests should not be disabled as they:

  1. Are browser-independent and unaffected by Chrome-only changes
  2. Provide critical coverage of backend functionality
🧹 Nitpick comments (1)
.github/workflows/e2e_api_tests.yml (1)

Line range hint 1-234: Scope of changes exceeds Chrome-only modifications

The changes in this workflow file go far beyond the stated PR objective of "chrome only" modifications. The removal of critical testing infrastructure (coverage, API tests, artifacts, reporting) will significantly impact:

  1. Test reliability and debugging capabilities
  2. Code quality visibility
  3. PR review effectiveness

Please limit changes to Chrome-specific modifications and maintain the existing testing infrastructure.

Consider creating a Chrome-specific job instead of modifying the existing infrastructure:

jobs:
  chrome_tests:
    name: chrome_only_tests
    runs-on: ubuntu-latest
    steps:
      # Chrome-specific steps here
      - name: Install Chrome
        run: npx playwright install chromium
      # Rest of the steps...
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 23392e7 and 788b7de.

📒 Files selected for processing (1)
  • .github/workflows/e2e_api_tests.yml (2 hunks)

Comment on lines 99 to 105
# Install test dependencies
# npm run pw:chrome-only 8s
- name: Install browsers
working-directory: tests/pw
run: |
mkdir -p wp-data && touch wp-data/debug.log
pw:browser-with-deps

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Fix browser installation configuration

The browser installation step has several issues:

  1. The command pw:browser-with-deps appears to be malformed (line 104)
  2. Chrome-specific configuration is missing despite PR objectives
  3. Browser binary caching has been removed, which may slow down workflow execution

Apply this fix:

 # Install browsers
 - name: Install browsers
   working-directory: tests/pw
   run: |
-    pw:browser-with-deps
+    npx playwright install chromium
+    npx playwright install-deps chromium
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
# Install test dependencies
# npm run pw:chrome-only 8s
- name: Install browsers
working-directory: tests/pw
run: |
mkdir -p wp-data && touch wp-data/debug.log
pw:browser-with-deps
# Install test dependencies
# npm run pw:chrome-only 8s
- name: Install browsers
working-directory: tests/pw
run: |
npx playwright install chromium
npx playwright install-deps chromium

Comment on lines 184 to 234
# # Prepare test summary
# - name: Prepare test summary
# id: prepare-test-summary
# uses: actions/github-script@v7
# if: always() && steps.clone-dokan-lite.outcome == 'success'
# with:
# comment-id: ${{ steps.find-comment.outputs.comment-id }}
# issue-number: ${{ github.event.pull_request.number }}
# body: ${{ steps.prepare-test-summary.outputs.result }}
# reactions: hooray
# edit-mode: replace

# Backup Database
- name: Backup Database
if: always() && steps.wp-env.outcome == 'success'
working-directory: tests/pw
run: |
npm run wp-env run tests-cli wp db export wp-data/db.sql
# result-encoding: string
# script: |
# const script = require("./tests/pw/utils/gitTestSummary.ts")
# return await script({github, context, core})

# # # Find PR comment
# # - name: Find PR comment by github-actions[bot]
# # id: find-comment
# # if: github.event_name == 'pull_request'
# # uses: peter-evans/find-comment@v3
# # with:
# # issue-number: ${{ github.event.pull_request.number }}
# # comment-author: 'github-actions[bot]'
# # body-includes: Tests Summary

# # # Post test summary as PR comment
# # - name: Create or update PR comment
# # if: github.event_name == 'pull_request'
# # uses: peter-evans/create-or-update-comment@v4
# # with:
# # comment-id: ${{ steps.find-comment.outputs.comment-id }}
# # issue-number: ${{ github.event.pull_request.number }}
# # body: ${{ steps.prepare-test-summary.outputs.result }}
# # reactions: hooray
# # edit-mode: replace

# # Backup Database
# - name: Backup Database
# if: always() && steps.wp-env.outcome == 'success'
# working-directory: tests/pw
# run: |
# npm run wp-env run tests-cli wp db export wp-data/db.sql

# Upload artifacts
- name: Archive test artifacts (screenshots, HTML snapshots, Reports)
if: always() && steps.debug-log.outcome == 'success'
uses: actions/upload-artifact@v4
with:
name: test-artifact
path: |
tests/pw/wp-data
tests/pw/playwright
tests/pw/playwright-report
if-no-files-found: ignore
retention-days: 30
# # Upload artifacts
# - name: Archive test artifacts (screenshots, HTML snapshots, Reports)
# if: always() && steps.debug-log.outcome == 'success'
# uses: actions/upload-artifact@v4
# with:
# name: test-artifact
# path: |
# tests/pw/wp-data
# tests/pw/playwright
# tests/pw/playwright-report
# if-no-files-found: ignore
# retention-days: 30
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codebase verification

⚠️ Potential issue

Restore test results reporting and artifacts - Critical for Test Visibility

The commented-out reporting features in e2e_api_tests.yml represent the only test result reporting mechanism in the entire workflow setup. Removing these would:

  • Eliminate all visibility into test execution results
  • Remove the only source of debugging artifacts (screenshots, logs)
  • Break the established test reporting pipeline that tracks API and E2E test results
🔗 Analysis chain

Restore test results reporting and artifacts

Removing test results reporting and artifacts severely impacts the ability to:

  1. Debug test failures through screenshots and logs
  2. Track test execution results in PR comments
  3. Maintain database backups for issue reproduction

These features are critical for maintaining test quality and should not be removed, regardless of Chrome-only changes.

Run this script to check if similar workflows maintain these features:

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check if other test workflows maintain result reporting
# Look for patterns indicating test reporting in other workflow files
rg -l 'upload-artifact|create-or-update-comment|test.*summary' .github/workflows/

Length of output: 119


Script:

#!/bin/bash
# Find all workflow files with test-related content
echo "=== Workflow files with test-related content ==="
rg -l 'test|playwright|jest|phpunit|wp-env' .github/workflows/

echo -e "\n=== Alternative reporting mechanisms ==="
# Look for alternative reporting mechanisms
rg -i '(report|summary|result|artifact)' .github/workflows/ -A 3 -B 3

Length of output: 5260

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

♻️ Duplicate comments (2)
.github/workflows/e2e_api_tests.yml (2)

99-144: ⚠️ Potential issue

Restore critical browser setup steps

Commenting out browser installation and caching steps will cause test failures. These steps are essential for:

  1. Installing browser binaries
  2. Setting up OS dependencies
  3. Optimizing CI performance through caching

Restore these steps with Chrome-specific configuration:

-            # # Install browsers
-            # - name: Install browsers
-            #   working-directory: tests/pw
-            #   run: |
-            #       npm run pw:browser-with-deps
+            # Install browsers
+            - name: Install browsers
+              working-directory: tests/pw
+              run: |
+                  npm run pw:chrome-only

+            # Get Playwright version
+            - name: Get installed Playwright version
+              id: playwright-version
+              working-directory: tests/pw
+              run: |
+                  echo "PLAYWRIGHT_VERSION=$(npm ls @playwright/test --json | jq --raw-output '.dependencies["@playwright/test"].version')" >> $GITHUB_ENV

+            # Cache browser binaries
+            - name: Cache playwright binaries
+              id: playwright-cache
+              uses: actions/cache@v4
+              with:
+                  path: ~/.cache/ms-playwright
+                  key: ${{ runner.os }}-playwright-${{ env.PLAYWRIGHT_VERSION }}
+                  restore-keys: |
+                      ${{ runner.os }}-playwright-

+            # Install OS dependencies if cache missed
+            - name: Install Playwright OS dependencies
+              if: steps.playwright-cache.outputs.cache-hit != 'true'
+              working-directory: tests/pw
+              run: |
+                  npm run pw:deps-only

171-237: ⚠️ Potential issue

Critical: Restore test reporting and artifacts

Removing test coverage collection, reporting, and artifacts upload significantly impacts:

  1. Visibility into test results
  2. Ability to debug test failures
  3. Historical test data for tracking regressions

These features are essential regardless of browser choice. Restore them with the following modifications:

-            # # Run e2e coverage
-            # - name: 🧪 Run e2e coverage
+            # Run e2e coverage
+            - name: 🧪 Run e2e coverage
+              if: always() && (steps.e2e-test.outcome == 'success' || steps.e2e-test.outcome == 'failure')
+              working-directory: tests/pw
+              run: |
+                  npm run test:e2e:coverage

+            # Prepare test summary
+            - name: Prepare test summary
+              id: prepare-test-summary
+              uses: actions/github-script@v7
+              if: always() && steps.clone-dokan-lite.outcome == 'success'
+              with:
+                  result-encoding: string
+                  script: |
+                      const script = require("./tests/pw/utils/gitTestSummary.ts")
+                      return await script({github, context, core})

+            # Upload artifacts
+            - name: Archive test artifacts
+              if: always()
+              uses: actions/upload-artifact@v4
+              with:
+                  name: test-artifact
+                  path: |
+                      tests/pw/playwright
+                      tests/pw/playwright-report
+                  if-no-files-found: ignore
+                  retention-days: 30
🧹 Nitpick comments (1)
.github/workflows/e2e_api_tests.yml (1)

72-72: Remove trailing spaces

Line 72 contains trailing spaces which should be removed to maintain consistent formatting.

-        
+
🧰 Tools
🪛 yamllint (1.35.1)

[error] 72-72: trailing spaces

(trailing-spaces)

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 788b7de and 9efcccb.

📒 Files selected for processing (2)
  • .github/workflows/e2e_api_tests.yml (3 hunks)
  • tests/pw/package.json (1 hunks)
🧰 Additional context used
🪛 yamllint (1.35.1)
.github/workflows/e2e_api_tests.yml

[error] 72-72: trailing spaces

(trailing-spaces)

⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: e2e_api tests

@@ -7,7 +7,7 @@
"nid": "npm install --include=dev",
"nip": "npm install --omit=dev",
"pw:chrome-only": "playwright install chromium",
"pw:browser-with-deps": "playwright install --with-deps chromium",
"pw:browser-with-deps": "playwright install --with-deps",
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Align browser installation with Chrome-only objective

The current change installs all browsers, which contradicts the PR's "chrome only" objective and increases CI time unnecessarily.

Apply this fix to install only Chrome:

-        "pw:browser-with-deps": "playwright install --with-deps",
+        "pw:browser-with-deps": "playwright install --with-deps chromium"
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
"pw:browser-with-deps": "playwright install --with-deps",
"pw:browser-with-deps": "playwright install --with-deps chromium",

Comment on lines 165 to 169
docker run --rm \
-v ${{ github.workspace }}:/workspace \
-w /workspace \
mcr.microsoft.com/playwright:v1.39.0 \
npm run test:e2e
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codebase verification

Update Docker image to match Playwright version

The Docker image mcr.microsoft.com/playwright:v1.39.0 is significantly outdated compared to the project's Playwright version (v1.49). This mismatch may cause compatibility issues and browser installation problems. Please update the Docker image version to match the project's Playwright version.

  • Update .github/workflows/e2e_api_tests.yml to use mcr.microsoft.com/playwright:v1.49.0
  • Alternatively, pin the project's @playwright/test version to match the Docker image if downgrading is preferred
🔗 Analysis chain

Verify Docker image compatibility

The switch to using Docker for test execution needs verification:

  1. The specified Playwright version (v1.39.0) is outdated
  2. The Docker setup might affect browser installation and caching
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Check latest Playwright Docker image version
curl -s https://registry.hub.docker.com/v2/repositories/mcr.microsoft.com/playwright/tags | jq -r '.results[].name' | grep -v latest | head -n 1

# Verify if the repository uses a specific Playwright version
grep '"@playwright/test"' tests/pw/package.json

Length of output: 290


Script:

#!/bin/bash
# Check latest Playwright Docker image version with correct registry
curl -s https://mcr.microsoft.com/v2/playwright/tags/list | jq .

# Look for browser installation or configuration files
fd -e config.ts -e config.js -p tests/pw
rg -l "browser.launch|browserType.launch" tests/pw

Length of output: 69836


Script:

#!/bin/bash
# Look for Playwright config and browser setup files
fd -e ts -e js -e json -p tests/pw | rg -l "playwright|browser"

# Check if there are any browser installation scripts
rg -l "install.*browser|browser.*install" tests/pw

Length of output: 148


Script:

#!/bin/bash
# Check package.json content for browser setup
cat tests/pw/package.json

# Look for any browser-related npm scripts
rg -A 5 -B 5 '"scripts"' tests/pw/package.json

Length of output: 4126

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

♻️ Duplicate comments (3)
.github/workflows/e2e_api_tests.yml (3)

99-104: ⚠️ Potential issue

Browser installation step should not be removed

The browser installation step is critical for test execution. While the PR aims for Chrome-only testing, the installation step should be modified rather than removed.

Apply this fix:

-            # # Install test dependencies
-            # - name: Install browsers
-            #   working-directory: tests/pw
-            #   run: |
-            #       npm run pw:browser-with-deps
+            # Install Chrome browser
+            - name: Install Chrome browser
+              working-directory: tests/pw
+              run: |
+                  npx playwright install chromium
+                  npx playwright install-deps chromium

173-188: ⚠️ Potential issue

Restore API tests and coverage collection

The removal of API tests and coverage collection significantly reduces test quality:

  1. API tests are browser-independent and should be retained
  2. Coverage metrics are essential for detecting regressions

These features should be restored as they are independent of the Chrome-only changes.


189-239: ⚠️ Potential issue

Critical: Restore test reporting and artifacts

The removal of test reporting, database backups, and artifacts upload severely impacts the ability to:

  1. Track test results
  2. Debug test failures
  3. Maintain test history

These features are essential for maintaining test quality and should be restored, regardless of Chrome-only changes.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 9efcccb and 78bfc5c.

📒 Files selected for processing (1)
  • .github/workflows/e2e_api_tests.yml (2 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: e2e_api tests
🔇 Additional comments (1)
.github/workflows/e2e_api_tests.yml (1)

165-170: Verify Docker configuration and network connectivity

While using Docker provides isolation, ensure:

  1. The container has access to the WordPress environment (--network host)
  2. File permissions are correctly handled for test artifacts
  3. Browser installation works within the container

Run this script to verify the Docker setup:

✅ Verification successful

Docker configuration is properly set

The Docker setup in the workflow is correctly configured with:

  • Official Playwright Docker image with pre-installed browsers
  • Host network mode for proper connectivity
  • Correct volume mounting and working directory
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Verify Docker configuration
echo "=== Testing Docker network access ==="
docker run --rm --network host mcr.microsoft.com/playwright:v1.49.1-noble curl -s http://localhost:9999

echo "=== Verifying Playwright installation in container ==="
docker run --rm mcr.microsoft.com/playwright:v1.49.1-noble playwright --version

Length of output: 585


Script:

#!/bin/bash
# Check for similar Docker configurations in other workflow files
echo "=== Checking other workflow files ==="
fd -e yml -e yaml . .github/workflows --exec cat {}

echo "=== Checking for documentation ==="
fd -g "README*" -g "CONTRIBUTING*" -g "DEVELOPMENT*" . -x cat {}

Length of output: 49071

Comment on lines 105 to 144
# # Create wp debuglog file
# - name: Create wp debuglog file
# id: debug-log
# working-directory: tests/pw
# run: |
# mkdir -p wp-data && touch wp-data/debug.log


# # Get Playwright version
# - name: Get installed Playwright version
# id: playwright-version
# working-directory: tests/pw
# run: |
# echo "PLAYWRIGHT_VERSION=$(npm ls @playwright/test --json | jq --raw-output '.dependencies["@playwright/test"].version')" >> $GITHUB_ENV

# # Cache browser binaries, cache key is based on Playwright version and OS
# - name: Cache playwright binaries
# id: playwright-cache
# uses: actions/cache@v4
# with:
# path: |
# ~/.cache/ms-playwright
# key: ${{ runner.os }}-playwright-${{ env.PLAYWRIGHT_VERSION }}
# restore-keys: |
# ${{ runner.os }}-playwright-

# # Install browser binaries & OS dependencies if cache missed
# - name: Install Playwright browser binaries & OS dependencies
# id: pw-install
# if: steps.playwright-cache.outputs.cache-hit != 'true'
# working-directory: tests/pw
# run: |
# npm run pw:browser-with-deps

# # Install only the OS dependencies if cache hit not needed
# - name: Install Playwright OS dependencies
# if: steps.playwright-cache.outputs.cache-hit == 'true'
# working-directory: tests/pw
# run: |
# npm run pw:deps-only
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Critical setup and debugging steps should be restored

Removing debug logs, caching, and OS dependencies setup will:

  1. Make test failures harder to debug
  2. Slow down workflow execution
  3. Risk inconsistent test environments

These steps should be restored with Chrome-specific configurations rather than removed entirely. The caching mechanism is particularly important for workflow efficiency.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

♻️ Duplicate comments (2)
.github/workflows/e2e_api_tests.yml (2)

99-104: ⚠️ Potential issue

Fix browser installation for Chrome-only testing

The browser installation step needs to be restored with Chrome-specific configuration to align with the PR objectives.

Apply this fix:

-# # Install test dependencies
-# - name: Install browsers
-#   working-directory: tests/pw
-#   run: |
-#       npm run pw:browser-with-deps
+# Install Chrome browser
+- name: Install Chrome browser
+  working-directory: tests/pw
+  run: |
+      npx playwright install chromium
+      npx playwright install-deps chromium

113-145: ⚠️ Potential issue

Restore caching for Chrome browser binaries

Removing caching and OS dependencies setup will significantly impact workflow performance and stability. These steps should be restored with Chrome-specific configurations.

Apply this fix:

+# Get Playwright version
+- name: Get installed Playwright version
+  id: playwright-version
+  working-directory: tests/pw
+  run: |
+      echo "PLAYWRIGHT_VERSION=$(npm ls @playwright/test --json | jq --raw-output '.dependencies["@playwright/test"].version')" >> $GITHUB_ENV

+# Cache Chrome browser binaries
+- name: Cache playwright binaries
+  id: playwright-cache
+  uses: actions/cache@v4
+  with:
+      path: |
+          ~/.cache/ms-playwright
+      key: ${{ runner.os }}-playwright-chromium-${{ env.PLAYWRIGHT_VERSION }}
+      restore-keys: |
+          ${{ runner.os }}-playwright-chromium-

+# Install Chrome binary & OS dependencies if cache missed
+- name: Install Chrome binary & OS dependencies
+  id: pw-install
+  if: steps.playwright-cache.outputs.cache-hit != 'true'
+  working-directory: tests/pw
+  run: |
+      npx playwright install chromium
+      npx playwright install-deps chromium
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 78bfc5c and 85fa341.

📒 Files selected for processing (1)
  • .github/workflows/e2e_api_tests.yml (4 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: e2e_api tests
🔇 Additional comments (1)
.github/workflows/e2e_api_tests.yml (1)

Line range hint 205-244: Restore test results reporting

The removal of test reporting features significantly impacts test visibility and debugging capabilities. These should be restored even for Chrome-only testing:

  1. Test summary generation
  2. PR comment updates
  3. API test results (if applicable)

Uncomment and restore the test reporting section while updating it for Chrome-specific results:

-# # Run api tests
-# - name: 🧪 Run api tests
-#   id: api-test
-#   if: always() && steps.wp-env.outcome == 'success' && ( github.event_name != 'workflow_dispatch'  || ( github.event_name == 'workflow_dispatch' && (github.event.inputs.testsuite == 'API' || github.event.inputs.testsuite == 'All')))
-#   timeout-minutes: 5
-#   working-directory: tests/pw
-#   run: |
-#       npm run test:api

 # Prepare test summary
 - name: Prepare test summary
   id: prepare-test-summary
   uses: actions/github-script@v7
   if: always() && steps.clone-dokan-lite.outcome == 'success'
   with:
       result-encoding: string
       script: |
           const script = require("./tests/pw/utils/gitTestSummary.ts")
           return await script({github, context, core})

+# Find PR comment
+- name: Find PR comment by github-actions[bot]
+  id: find-comment
+  if: github.event_name == 'pull_request'
+  uses: peter-evans/find-comment@v3
+  with:
+      issue-number: ${{ github.event.pull_request.number }}
+      comment-author: 'github-actions[bot]'
+      body-includes: Tests Summary

+# Post test summary as PR comment
+- name: Create or update PR comment
+  if: github.event_name == 'pull_request'
+  uses: peter-evans/create-or-update-comment@v4
+  with:
+      comment-id: ${{ steps.find-comment.outputs.comment-id }}
+      issue-number: ${{ github.event.pull_request.number }}
+      body: ${{ steps.prepare-test-summary.outputs.result }}
+      reactions: hooray
+      edit-mode: replace

Comment on lines 165 to 196
docker run --rm \
--network host \
-v ${{ github.workspace }}:/workspace \
-w /workspace/tests/pw \
-e ADMIN=${{ secrets.ADMIN }} \
-e ADMIN_PASSWORD=${{ secrets.ADMIN_PASSWORD }} \
-e VENDOR=${{ secrets.VENDOR }} \
-e VENDOR2=${{ secrets.VENDOR2 }} \
-e CUSTOMER=${{ secrets.CUSTOMER }} \
-e CUSTOMER2=${{ secrets.CUSTOMER2 }} \
-e USER_PASSWORD=${{ secrets.USER_PASSWORD }} \
-e GMAP=${{ secrets.GMAP }} \
-e MAPBOX=${{ secrets.MAPBOX }} \
-e BASE_URL=http://localhost:9999 \
-e CI=true \
-e FORCE_COLOR=1 \
-e DB_HOST_NAME=localhost \
-e DB_USER_NAME=root \
-e DB_USER_PASSWORD=password \
-e DB_PORT=9998 \
-e DATABASE=tests-wordpress \
-e DB_PREFIX=wp \
-e PR_NUMBER=${{ github.event.number }} \
-e SHA=${{ github.event.pull_request.head.sha }} \
-e SYSTEM_INFO=./tests/pw/playwright/systemInfo.json \
-e API_TEST_RESULT=./tests/pw/playwright-report/api/summary-report/results.json \
-e E2E_TEST_RESULT=./tests/pw/playwright-report/e2e/summary-report/results.json \
-e API_COVERAGE=./tests/pw/playwright-report/api/coverage-report/coverage.json \
-e E2E_COVERAGE=./tests/pw/playwright-report/e2e/coverage-report/coverage.json \
mcr.microsoft.com/playwright:v1.49.1-noble \
npm run test:e2e

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Improve Docker configuration and security

While the Docker setup is functional, there are several improvements needed:

  1. Using --network host exposes all host ports to the container
  2. Sensitive environment variables are passed directly
  3. The Docker image version should be pinned to match the project's Playwright version

Apply these improvements:

 docker run --rm \
-    --network host \
+    --network bridge \
+    -p 9999:9999 \
+    -p 9998:9998 \
     -v ${{ github.workspace }}:/workspace \
     -w /workspace/tests/pw \
-    -e ADMIN=${{ secrets.ADMIN }} \
-    -e ADMIN_PASSWORD=${{ secrets.ADMIN_PASSWORD }} \
+    --env-file .env.test \
     mcr.microsoft.com/playwright:v1.49.1-noble \
     npm run test:e2e

Create a .env.test file to securely manage test environment variables.

Committable suggestion skipped: line range outside the PR's diff.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

♻️ Duplicate comments (3)
.github/workflows/e2e_api_tests.yml (3)

102-107: ⚠️ Potential issue

Fix browser installation configuration.

The browser installation step is malformed and needs to be Chrome-specific.

Apply this fix:

+- name: Install Chrome browser
+  working-directory: tests/pw
+  run: |
+    npx playwright install chromium
+    npx playwright install-deps chromium

109-113: ⚠️ Potential issue

Restore debugging and caching infrastructure.

Removing debug logs, version detection, and caching mechanisms will:

  1. Make test failures harder to debug
  2. Significantly slow down workflow execution
  3. Increase resource usage

These infrastructure components should be restored with Chrome-specific configurations rather than removed entirely.

Also applies to: 116-140


172-238: ⚠️ Potential issue

Critical: Restore test results reporting and artifacts.

Removing test coverage collection, reporting, and artifacts upload will:

  1. Eliminate visibility into test execution results
  2. Remove debugging capabilities
  3. Break the established test reporting pipeline

These features are critical for maintaining test quality and should be restored with Chrome-specific configurations rather than removed entirely.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 85fa341 and 72873fe.

📒 Files selected for processing (2)
  • .github/workflows/e2e_api_tests.yml (2 hunks)
  • tests/pw/tests/e2e/admin.spec.ts (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • tests/pw/tests/e2e/admin.spec.ts
🔇 Additional comments (1)
.github/workflows/e2e_api_tests.yml (1)

72-74: ⚠️ Potential issue

Update Docker configuration for security and compatibility.

The Docker container configuration needs improvement:

  1. The image version should be pinned to match the project's Playwright version
  2. Running as user 1001 might cause permission issues
  3. Network isolation is not properly configured

Apply this diff:

container:
-    image: mcr.microsoft.com/playwright:v1.49.1-noble
-    options: --user 1001
+    image: mcr.microsoft.com/playwright:v1.49.1-noble@sha256:<hash>
+    options: --user 1001 --network-alias tests --cap-drop ALL

Likely invalid or redundant comment.

Comment on lines 81 to 85
# - name: Use desired version of NodeJS
# uses: actions/setup-node@v4
# with:
# node-version: 20
# cache: npm
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Restore build steps with Chrome-specific configuration.

Removing Node.js setup and build steps will break the workflow. These steps are essential even for Chrome-only testing.

Restore these steps with Chrome-specific configuration:

+- name: Use desired version of NodeJS
+  uses: actions/setup-node@v4
+  with:
+    node-version: 20
+    cache: npm
+
+- name: Install and build (Chrome-specific)
+  run: |
+    npm ci --ignore-scripts
+    npm run build:chrome

Also applies to: 87-94

Comment on lines +161 to +169

# Run e2e tests
- name: 🧪 Run e2e tests
id: e2e-test
if: success() && (github.event_name != 'workflow_dispatch' || ( github.event_name == 'workflow_dispatch' && (github.event.inputs.testsuite == 'E2E' || github.event.inputs.testsuite == 'All')))
timeout-minutes: 40
working-directory: tests/pw
run: |
npm run test:e2e
npm run test:e2e
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Improve E2E test execution configuration.

The E2E test execution step lacks proper configuration and error handling.

Enhance the test execution step:

 - name: 🧪 Run e2e tests
   id: e2e-test
   if: success() && (github.event_name != 'workflow_dispatch' || ( github.event_name == 'workflow_dispatch' && (github.event.inputs.testsuite == 'E2E' || github.event.inputs.testsuite == 'All')))
   timeout-minutes: 40
   working-directory: tests/pw
   run: |
-    npm run test:e2e
+    npm run test:e2e:chrome || exit 1
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
# Run e2e tests
- name: 🧪 Run e2e tests
id: e2e-test
if: success() && (github.event_name != 'workflow_dispatch' || ( github.event_name == 'workflow_dispatch' && (github.event.inputs.testsuite == 'E2E' || github.event.inputs.testsuite == 'All')))
timeout-minutes: 40
working-directory: tests/pw
run: |
npm run test:e2e
npm run test:e2e
# Run e2e tests
- name: 🧪 Run e2e tests
id: e2e-test
if: success() && (github.event_name != 'workflow_dispatch' || ( github.event_name == 'workflow_dispatch' && (github.event.inputs.testsuite == 'E2E' || github.event.inputs.testsuite == 'All')))
timeout-minutes: 40
working-directory: tests/pw
run: |
npm run test:e2e:chrome || exit 1

Comment on lines +149 to +160
# # Start wordpress environment
# - name: Start WordPress Env
# id: wp-env
# uses: nick-fields/retry@v3
# with:
# timeout_minutes: 4
# max_attempts: 2
# retry_on: error
# command: |
# cd tests/pw
# npm run start:env

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

WordPress environment setup is required.

The WordPress environment setup is critical for E2E testing, even with Chrome-only changes.

Restore the WordPress setup with proper retry mechanism:

+- name: Start WordPress Env
+  id: wp-env
+  uses: nick-fields/retry@v3
+  with:
+    timeout_minutes: 4
+    max_attempts: 2
+    retry_on: error
+    command: |
+      cd tests/pw
+      npm run start:env:chrome

Committable suggestion skipped: line range outside the PR's diff.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

♻️ Duplicate comments (2)
.github/workflows/e2e_api_tests.yml (2)

143-154: ⚠️ Potential issue

WordPress environment setup is critical.

The WordPress environment setup cannot be removed as it's essential for E2E testing, even with Chrome-only changes.


181-195: ⚠️ Potential issue

Restore test reporting for better visibility.

Removing test coverage collection, API tests, and artifacts upload significantly reduces visibility into test results and makes debugging harder.

Also applies to: 198-227

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 72873fe and 41c2361.

📒 Files selected for processing (1)
  • .github/workflows/e2e_api_tests.yml (4 hunks)
🧰 Additional context used
🪛 actionlint (1.7.4)
.github/workflows/e2e_api_tests.yml

250-250: property "generate-html-report" is not defined in object type {clone-dokan-lite: {conclusion: string; outcome: string; outputs: {commit: string; ref: string}}; debug-log: {conclusion: string; outcome: string; outputs: {string => string}}; e2e-test: {conclusion: string; outcome: string; outputs: {string => string}}; playwright-cache: {conclusion: string; outcome: string; outputs: {cache-hit: string}}; playwright-version: {conclusion: string; outcome: string; outputs: {string => string}}; pw-install: {conclusion: string; outcome: string; outputs: {string => string}}}

(expression)

🔇 Additional comments (2)
.github/workflows/e2e_api_tests.yml (2)

87-94: ⚠️ Potential issue

Build steps are required even for Chrome-only testing.

Removing the build steps will break the workflow as these steps are essential for setting up the testing environment.

-            # - name: Composer install and build (Dokan-lite)
-            #   run: |
-            #       composer i --no-dev -o || composer update --no-dev -o
-
-            # - name: Npm install and build (Dokan-lite)
-            #   run: |
-            #       npm ci || npm i
-            #       npm run build
+            - name: Composer install and build (Dokan-lite)
+              run: |
+                  composer i --no-dev -o || composer update --no-dev -o
+
+            - name: Npm install and build (Dokan-lite)
+              run: |
+                  npm ci || npm i
+                  npm run build:chrome

Likely invalid or redundant comment.


72-74: 🛠️ Refactor suggestion

Docker configuration needs improvement.

While removing the container setup aligns with Chrome-only testing, the current configuration can be improved for better security and version consistency.

-        # container:
-        #     image: mcr.microsoft.com/playwright:v1.49.1-noble
-        #     options: --user 1001
+        container:
+            image: mcr.microsoft.com/playwright:v1.49.1-noble
+            options: --user 1001 --security-opt=no-new-privileges

Likely invalid or redundant comment.

Comment on lines +156 to +169
# # Run e2e tests
# - name: 🧪 Run e2e tests
# id: e2e-test
# if: success() && (github.event_name != 'workflow_dispatch' || ( github.event_name == 'workflow_dispatch' && (github.event.inputs.testsuite == 'E2E' || github.event.inputs.testsuite == 'All')))
# timeout-minutes: 40
# working-directory: tests/pw
# run: |
# docker run --rm \
# --network host \
# -v ${{ github.workspace }}:/workspace \
# -w /workspace/tests/pw \
# mcr.microsoft.com/playwright:v1.49.1-noble \
# npm run test:e2e

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

E2E test execution needs proper configuration.

The current implementation lacks proper error handling and browser-specific configuration.

             - name: 🧪 Run e2e tests
               id: e2e-test
               if: success() && (github.event_name != 'workflow_dispatch' || ( github.event_name == 'workflow_dispatch' && (github.event.inputs.testsuite == 'E2E' || github.event.inputs.testsuite == 'All')))
               timeout-minutes: 40
               working-directory: tests/pw
               run: |
-                npm run test:e2e
+                BROWSER=chromium npm run test:e2e || exit 1

Also applies to: 170-178

Comment on lines 249 to 260
- name: Publish HTML report to GH Pages
if: always() && steps.generate-html-report.outcome == 'success'
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_branch: gh-pages
publish_dir: ./tests/pw/all-reports/html-report
destination_dir: ${{ github.event.pull_request.number || github.sha }}
keep_files: true
user_name: 'github-actions[bot]' # This will be the username that gets stamped in the repo commit
user_email: 'github-actions[bot]@users.noreply.github.com' # This will be the user email that gets stamped in the repo com

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Fix HTML report publishing configuration.

The step references an undefined step ID 'generate-html-report' which will cause the workflow to fail.

             - name: Publish HTML report to GH Pages
-              if: always() && steps.generate-html-report.outcome == 'success'
+              if: always() && steps.e2e-test.outcome != 'skipped'
               uses: peaceiris/actions-gh-pages@v4
               with:
                   github_token: ${{ secrets.GITHUB_TOKEN }}
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
- name: Publish HTML report to GH Pages
if: always() && steps.generate-html-report.outcome == 'success'
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_branch: gh-pages
publish_dir: ./tests/pw/all-reports/html-report
destination_dir: ${{ github.event.pull_request.number || github.sha }}
keep_files: true
user_name: 'github-actions[bot]' # This will be the username that gets stamped in the repo commit
user_email: 'github-actions[bot]@users.noreply.github.com' # This will be the user email that gets stamped in the repo com
- name: Publish HTML report to GH Pages
if: always() && steps.e2e-test.outcome != 'skipped'
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_branch: gh-pages
publish_dir: ./tests/pw/all-reports/html-report
destination_dir: ${{ github.event.pull_request.number || github.sha }}
keep_files: true
user_name: 'github-actions[bot]' # This will be the username that gets stamped in the repo commit
user_email: 'github-actions[bot]@users.noreply.github.com' # This will be the user email that gets stamped in the repo com
🧰 Tools
🪛 actionlint (1.7.4)

250-250: property "generate-html-report" is not defined in object type {clone-dokan-lite: {conclusion: string; outcome: string; outputs: {commit: string; ref: string}}; debug-log: {conclusion: string; outcome: string; outputs: {string => string}}; e2e-test: {conclusion: string; outcome: string; outputs: {string => string}}; playwright-cache: {conclusion: string; outcome: string; outputs: {cache-hit: string}}; playwright-version: {conclusion: string; outcome: string; outputs: {string => string}}; pw-install: {conclusion: string; outcome: string; outputs: {string => string}}}

(expression)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant