fix(e2e): arm waitForRequest before the click, not chained onto expect - #786
Merged
rubenvdlinde merged 1 commit intoSep 1, 2026
Merged
Conversation
The signing-key rotation test died at:
TypeError: expect(...).toBeVisible(...).waitForRequest is not a function
page.waitForRequest had been chained onto the assertion:
await expect(rotateBtn)
.toBeVisible()
.waitForRequest(...)
expect().toBeVisible() resolves to undefined, not to the page, so the chain
threw and the test died before ever clicking Rotate. It was never testing the
rotation it is named for.
waitForRequest also has to be armed BEFORE the action that triggers the
request, or it waits for one that has already gone. So the promise is created
first, the click follows, and the promise is awaited after.
Verified by running it against a live instance rather than by reading:
`playwright test -g rotating-the-signing-key` now reports 1 passed. Before,
`playwright test --list` could not even collect the file.
Contributor
Quality Report — ConductionNL/learniq @
|
| Check | PHP | Vue | Security | License | Tests |
|---|---|---|---|---|---|
| lint | ✅ | ||||
| phpcs | ✅ | ||||
| phpmd | ✅ | ||||
| psalm | ✅ | ||||
| phpstan | ✅ | ||||
| phpmetrics | ✅ | ||||
| eslint | ✅ | ||||
| stylelint | ✅ | ||||
| build | ✅ | ||||
| check-specs | ✅ | ||||
| format | ✅ | ||||
| check-l10n-js | ✅ | ||||
| check-schema-l10n | ✅ | ||||
| composer | ✅ | ✅ 104/104 | |||
| npm | ✅ | ✅ 637/637 | |||
| app:check-code | ⏭️ | ||||
| info.xml | ✅ | ||||
| REUSE | ❌ | ||||
| PHPUnit | ✅ | ||||
| Newman | ⏭️ | ||||
| Playwright | ⏭️ deferred — runs on the promotion into beta/main, not on a pull request into development | ||||
| Hydra gates | ✅ |
Quality workflow — 2026-09-01 12:57 UTC
Download the full PDF report from the workflow artifacts.
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.
The signing-key rotation test died at load with:
page.waitForRequesthad been chained onto the assertion:expect().toBeVisible()resolves to undefined, not to the page. So the chain threw and the test died before ever clicking Rotate — it was never testing the rotation it is named for.Two things wrong, not one
waitForRequesthas to be armed before the action that triggers the request, or it waits for one that has already gone. So the promise is created first, the click follows, and the promise is awaited after.Verification
Measured against a live instance rather than read:
playwright test --listplaywright test -g rotating-the-signing-keylint--listis the check that matters here: a chained-method TypeError is invisible to eslint and prettier, and only surfaces when Playwright actually loads the module.