tests(e2e): improve activation test flakiness on ci#13
Merged
justlevine merged 1 commit intomainfrom Mar 20, 2026
Merged
Conversation
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.
What
Fix race condition in E2E activation test (
tests/e2e/settings/activation.spec.ts) that caused flaky failures in CI environments.Why
The test used
Promise.all([page.waitForURL(/plugins.php/), click()])which created a race condition:/plugins.php/matches the current URL (we're already on plugins.php)waitForURLresolves immediately, before navigation completesPromise.allresolves before the DOM updatesRelated Issue(s):
How
Replaced
Promise.allpattern with sequential execution:Promise.all([waitForURL(), click()])for both activate and deactivate actionsawait page.waitForLoadState('domcontentloaded')after each click to ensure DOM has updatedWhy this works:
click()already auto-waits for the element to be clickablewaitForLoadState('domcontentloaded')waits for the page to parse the new HTMLexpect().toBeVisible()assertion has auto-retry built-inTesting Instructions
npm run wp-env startnpm cinpm run test:e2e -- --grep "should activate and deactivate"Additional Info
PR description authored by AI, as well as what recommended the suggestion.