Skip to content

Boost: Re-enable Module E2E tests #44141

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

Draft
wants to merge 60 commits into
base: trunk
Choose a base branch
from

Conversation

LiamSarsfield
Copy link
Contributor

@LiamSarsfield LiamSarsfield commented Jun 30, 2025

Note

Merge this PR after #44140 is merged.

Addresses HOG-193: Enable Module E2E tests

Proposed changes:

This PR re-enables projects/plugins/boost/tests/e2e/specs/modules tests e2e test suite that was temporarily disabled in commit 0eb34d93ca7522549dcec7ea35c09d4f39ef5406 due to flakiness:

Re-enabled test suites:

Test suites still disabled (to be addressed in separate PRs):

  • Jetpack Boost - Page Cache (specs/page-cache)
  • Jetpack Boost - Image CDN (specs/image-cdn)
  • Jetpack Boost - Image Guide (specs/image-guide)

Jetpack product discussion

N/A

Does this pull request change what data or activity we track or use?

No

Other information:

  • Have you written new tests for your changes, if applicable?
  • Have you checked the E2E test CI results, and verified that your changes do not break them?
  • Have you tested your changes on WordPress.com, if applicable (if so, you'll see a generated comment below with a script to run)?

Testing instructions:

From the projects/plugins/boost/tests/e2e directory:

Via ngrok (Recommended, but requires a subscription)

Replace $tunnel_url with your actual ngrok URL

  1. Install E2E test dependencies:

    pnpm install
  2. Start the Docker environment and tunnel:

    pnpm run env:up && TUNNEL_URL=$tunnel_url pnpm run tunnel:up
  3. Start your ngrok tunnel

    ngrok http --url=$tunnel_url http://localhost:8889/
  4. Run the specific re-enabled test suites:

     TUNNEL_URL=$tunnel_url pnpm run test:run specs/modules

Via localtunnel (Not recommended as it may be slow)

  1. Install E2E test dependencies:

    pnpm install
  2. Start the Docker environment and tunnel:

    pnpm run env:up && pnpm run tunnel:up
  3. Run the specific re-enabled test suites:

    pnpm run test:run specs/modules

Expected behavior:

  • All Common/Base tests should pass without skipping or timeout errors
  • Tests should pass consistently when run multiple times

Verification steps:

  1. Check that tests are running in CI:

    • The re-enabled test suites should appear in the E2E test matrix
    • CI should execute "Jetpack Boost - Modules"
  2. Test stability:

    • Run each test suite 3-5 times to ensure consistency
    • No intermittent failures or timing-related issues should occur

- Introduced a new plugin `e2e-critical-css-force-errors` to simulate errors in Critical CSS Advanced Recommendations.
- Updated e2e tests to activate the new plugin during the Critical CSS module tests.
- Added the new plugin to the Docker configuration for proper testing environment setup.
… the 'Regenerate' button. This improves the test coverage for user interactions within the Critical CSS advanced recommendations.
…per activation/deactivation of the e2e-critical-css-force-errors plugin in tests. This enhances the reliability of the Critical CSS module tests.
…s and ensure visibility of critical CSS meta information. This streamlines the test flow and focuses on essential assertions.
- Updated test common.test.js structure to use `test.describe` and `test.beforeAll` for better organization and readability.
- Enhanced the deactivation test to ensure proper cleanup of Critical CSS and dismissed recommendations.
@github-actions github-actions bot added [Plugin] Boost A feature to speed up the site and improve performance. [Status] In Progress [Tests] Includes Tests Actions GitHub actions used to automate some of the work around releases and repository management E2E Tests labels Jun 30, 2025
@LiamSarsfield LiamSarsfield marked this pull request as ready for review July 1, 2025 19:57
@LiamSarsfield LiamSarsfield marked this pull request as draft July 1, 2025 20:30
Base automatically changed from fix/boost/common-e2e-tests-hog-192 to trunk July 2, 2025 13:17
@LiamSarsfield LiamSarsfield added the I don't care about code coverage for this PR Use this label to ignore the check for insufficient code coveage. label Jul 2, 2025
Updated the method for checking module state from isModuleEnabled to waitForModuleState, which now waits for the toggle switch to become visible and checks for the expected class state. Adjusted related tests to utilize the new method for improved reliability and clarity.
Updat the toggleModule method to accept an expected state parameter, allowing for more precise control during module state changes. Adjusted related tests to reflect this change, ensuring they now verify the module state against the expected outcome.
Modified test cases to pass the expected state parameter when toggling modules in JetpackBoostPage. This change enhances clarity and ensures that the tests accurately reflect the intended module states. Removed an unused module from the test setup for better maintainability.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Actions GitHub actions used to automate some of the work around releases and repository management E2E Tests I don't care about code coverage for this PR Use this label to ignore the check for insufficient code coveage. [Plugin] Boost A feature to speed up the site and improve performance. [Status] In Progress [Tests] Includes Tests [Type] Janitorial
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants