Fix failing e2e tests - #8238
Merged
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR aims to get the project’s end-to-end (E2E) test suite passing again by making test execution more deterministic (navigation waits), adjusting plugin installation behavior for CI/local fixtures, and temporarily quarantining several failing suites/tests.
Changes:
- Prefer installing a plugin from a local ZIP fixture (when present) before falling back to WordPress.org installation.
- Add
waitForNavigation()coordination around admin/onboarding link clicks to reduce timing-related failures. - Skip multiple E2E suites/tests and expand the list of disabled Axe accessibility rules for block editor pages.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/e2e/utils/amp-settings-utils.js | Install plugin from a local ZIP fixture when available. |
| tests/e2e/specs/core-themes/twentythirteen.js | Skips the Twenty Thirteen core-theme E2E suite. |
| tests/e2e/specs/amp-onboarding/exit-links.js | Converts imports to ESM and adds navigation waits; skips one test. |
| tests/e2e/specs/admin/site-scan-panel.js | Skips two site-scan assertions related to theme/plugin incompatibilities. |
| tests/e2e/specs/admin/other-settings.js | Skips the Other settings E2E suite. |
| tests/e2e/specs/admin/after-plugin-activation.js | Skips the suite and changes plugin activate/deactivate helpers to wait on navigation. |
| tests/e2e/config/bootstrap.js | Disables an additional Axe rule for block editor accessibility checks. |
Suppressed comments (4)
tests/e2e/specs/amp-onboarding/exit-links.js:63
page.waitForNavigation()without a timeout can hang the entire e2e run if the click does not trigger a navigation (or the navigation is delayed). Consider passing an explicit timeout to keep failures bounded and consistent with other admin-panel specs.
await Promise.all([
page.waitForNavigation(),
expect(page).toClick('a', { text: 'Finish' }),
]);
tests/e2e/specs/admin/after-plugin-activation.js:20
- Switching to
waitForNavigation()is good for avoiding race conditions, but it no longer waits for the post-deactivation UI state (e.g. the "Activate" link) to appear. Without a follow-up selector wait, subsequent assertions can race the plugin list update and become flaky.
await Promise.all([
page.waitForNavigation(),
page.click(`tr[data-slug="${slug}"] .deactivate a`),
]);
}
tests/e2e/specs/admin/after-plugin-activation.js:27
- Similar to deactivation: after
waitForNavigation()completes, the plugin list may not yet be in the expected post-activation state. Waiting for the "Deactivate" link makes the helper deterministic and avoids flake.
await Promise.all([
page.waitForNavigation(),
page.click(`tr[data-slug="${slug}"] .activate a`),
]);
}
tests/e2e/specs/admin/site-scan-panel.js:171
- This test is now disabled with
it.skip, which removes coverage for the combined theme+plugin incompatibility reporting path. Please add a reason + tracking issue link (or update the assertions) so the skip doesn’t become permanent silently.
// eslint-disable-next-line jest/no-disabled-tests
it.skip('lists Hestia theme and E2E Tests Demo Plugin for causing AMP incompatibilities', async () => {
await activateTheme('hestia');
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
203
to
205
| disabledRules: [ | ||
| 'aria-allowed-attr', | ||
| 'aria-allowed-role', |
Comment on lines
+11
to
13
| // eslint-disable-next-line jest/no-disabled-tests | ||
| describe.skip('After plugin activation', () => { | ||
| const timeout = 30000; |
Comment on lines
+13
to
15
| // eslint-disable-next-line jest/no-disabled-tests | ||
| describe.skip('Other settings', () => { | ||
| beforeEach(async () => { |
Comment on lines
+127
to
129
| // eslint-disable-next-line jest/no-disabled-tests | ||
| it.skip('lists Hestia theme as causing AMP incompatibility', async () => { | ||
| await activateTheme('hestia'); |
Comment on lines
+19
to
+22
| await Promise.all([ | ||
| page.waitForNavigation(), | ||
| expect(page).toClick('a', { text: 'Close' }), | ||
| ]); |
Comment on lines
+29
to
31
| // eslint-disable-next-line jest/no-disabled-tests | ||
| it.skip('returns to previous page when clicking close', async () => { | ||
| await visitAdminPage('admin.php', 'page=amp-options'); |
Comment on lines
+22
to
24
| // eslint-disable-next-line jest/no-disabled-tests | ||
| describe.skip('Twenty Thirteen theme on AMP', () => { | ||
| beforeAll(async () => { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #
Checklist