Skip to content

fix(e2e): arm the rotation request waiter instead of chaining it onto expect() - #785

Closed
rubenvdlinde wants to merge 1 commit into
developmentfrom
fix/e2e-arm-the-request-waiter-before-the-click
Closed

fix(e2e): arm the rotation request waiter instead of chaining it onto expect()#785
rubenvdlinde wants to merge 1 commit into
developmentfrom
fix/e2e-arm-the-request-waiter-before-the-click

Conversation

@rubenvdlinde

Copy link
Copy Markdown
Contributor

The only E2E failure on learniq development:

TypeError: expect(...).toBeVisible(...).waitForRequest is not a function
  at nextcloud-app.spec.ts:229

toBeVisible() resolves a Promise and waitForRequest is a Page method, so the chain could never work. The test threw before it clicked anything — which is why it read as a broken rotation feature rather than a broken test.

Rewritten to the idiom this same file already uses correctly twenty lines earlier: assign page.waitForRequest(...) to a variable, then interact, then await it.

The waiter is armed before the click deliberately: a request started by the click cannot be caught by a waiter created afterwards, so the ordering is the point of the pattern rather than a style choice.

… expect()

The only E2E failure on learniq development:

  TypeError: expect(...).toBeVisible(...).waitForRequest is not a function
    at nextcloud-app.spec.ts:229

`toBeVisible()` resolves a Promise and `waitForRequest` is a PAGE method, so
the chain could never work. The test threw before it clicked anything, which
is why it read as a broken rotation feature rather than a broken test.

Rewritten to the idiom this same file already uses correctly twenty lines
earlier: assign `page.waitForRequest(...)` to a variable, THEN interact, THEN
await it.

🔑 The waiter is armed BEFORE the click deliberately. A request started by the
click cannot be caught by a waiter created afterwards, so the ordering is the
point of the pattern rather than a style choice.
@github-actions

github-actions Bot commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Quality Report — ConductionNL/learniq @ 2443992

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:56 UTC

Download the full PDF report from the workflow artifacts.

@rubenvdlinde

Copy link
Copy Markdown
Contributor Author

Superseded, closing.

Another session landed the identical fix on development while this was open: same diagnosis (expect().toBeVisible() resolves a Promise, waitForRequest is a Page method), same correction (arm the waiter before the click, await it after), down to the same reasoning about why the ordering matters. The only difference is the variable name, rotationRequest rather than rotation.

Verified on development: the waiter is armed before rotateBtn.click() and awaited after, and no .toBeVisible() in the file has anything chained onto it any more.

There is nothing here that development does not already have.

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