Page MenuHomePhabricator

Flaky Cypress test: wbui2025 entityId datatypes (item, property): mobile view - property datatype: allows adding property statement to empty item, displays statement and supports full editing workflow
Open, Needs TriagePublic

Description

Seen in this build for this change:

  1) wbui2025 entityId datatypes (item, property)
       mobile view - property datatype
         allows adding property statement to empty item, displays statement and supports full editing workflow:
     CypressError: Timed out retrying after 20050ms: `cy.click()` failed because this element is not visible:

`<li class="cdx-menu__no-results cdx-menu-item" role="option"></li>`

This element `<li.cdx-menu__no-results.cdx-menu-item>` is not visible because its parent `<div.cdx-menu>` has CSS property: `display: none`

Fix this problem, or use `{force: true}` to disable error checking.

https://on.cypress.io/element-cannot-be-interacted-with
      at runVisibilityCheck (http://127.0.0.1:9413/__cypress/runner/cypress_runner.js:148378:58)
      at Object.isStrictlyVisible (http://127.0.0.1:9413/__cypress/runner/cypress_runner.js:148392:10)
      at runAllChecks (http://127.0.0.1:9413/__cypress/runner/cypress_runner.js:114743:26)
      at retryActionability (http://127.0.0.1:9413/__cypress/runner/cypress_runner.js:114811:16)
      at tryCatcher (http://127.0.0.1:9413/__cypress/runner/cypress_runner.js:1777:23)
      at Promise.attempt.Promise.try (http://127.0.0.1:9413/__cypress/runner/cypress_runner.js:4285:29)
      at whenStable (http://127.0.0.1:9413/__cypress/runner/cypress_runner.js:147205:68)
      at <unknown> (http://127.0.0.1:9413/__cypress/runner/cypress_runner.js:147146:14)
      at tryCatcher (http://127.0.0.1:9413/__cypress/runner/cypress_runner.js:1777:23)
      at Promise._settlePromiseFromHandler (http://127.0.0.1:9413/__cypress/runner/cypress_runner.js:1489:31)
      at Promise._settlePromise (http://127.0.0.1:9413/__cypress/runner/cypress_runner.js:1546:18)
      at Promise._settlePromise0 (http://127.0.0.1:9413/__cypress/runner/cypress_runner.js:1591:10)
      at Promise._settlePromises (http://127.0.0.1:9413/__cypress/runner/cypress_runner.js:1671:18)
      at Promise._fulfill (http://127.0.0.1:9413/__cypress/runner/cypress_runner.js:1615:18)
      at <unknown> (http://127.0.0.1:9413/__cypress/runner/cypress_runner.js:5420:46)

Screenshot:

image.png (720×1 px, 206 KB)

Event Timeline

Same test failed in this build with a different error:

wbui2025 entityId datatypes (item, property)
  mobile view - item datatype
    ✓ allows adding item statement to empty item, displays statement and supports full editing workflow (29655ms)
  mobile view - property datatype
    1) allows adding property statement to empty item, displays statement and supports full editing workflow


1 passing (1m)
1 failing

1) wbui2025 entityId datatypes (item, property)
     mobile view - property datatype
       allows adding property statement to empty item, displays statement and supports full editing workflow:
   AssertionError: Timed out retrying after 20000ms: Expected to find element: `[data-v-app] .wikibase-wbui2025-edit-link`, but never found it.
    at __webpack_modules__../cypress/support/pageObjects/ItemViewPage.ts.ItemViewPage.editLinks (webpack://wikibase/./cypress/support/pageObjects/ItemViewPage.ts:49:12)
    at Context.eval (webpack://wikibase/./cypress/e2e/wbui2025/editEntityDatatypes.cy.ts:114:17)

Screenshot:

image.png (720×1 px, 214 KB)

There are edit links in that screenshot, but perhaps the Vue app failed to hydrate and so the [data-v-app] part of the selector failed to match anything?

Also failed here (blocking vendor: drop PHP 8.1 support) with the same error as in the task description.

Edit: Same in:

Pulling into our board as a high-priority CI issue.


My feeling is that both this and T411278 (another frequent CI issue in the past few days) could be due to overall resource usage / exhaustion in CI (as also suggested in T411278#11419465); this then could cause search updates on the wiki to fall behind, resulting in an empty entity selector. I think one straightforward option to increase stability would be to change most of the entity lookup tests to search by entity ID instead, which should be more reliable (thanks to EntityIdSearchHelper).

Weird result: when I run the test locally, sometimes the first two characters typed into the lookup get lost:

Screenshot From 2025-12-03 11-05-29.png (297×580 px, 16 KB)

Screenshot From 2025-12-03 11-05-00.png (297×580 px, 15 KB)

Change #1214468 had a related patch set uploaded (by Lucas Werkmeister (WMDE); author: Lucas Werkmeister (WMDE)):

[mediawiki/extensions/Wikibase@master] Search for some browser test entities by ID

https://gerrit.wikimedia.org/r/1214468

Also, apparently the entity search calls aren’t debounced at all? So searching for linked-property-0.33714683744760543-Iñtërnâtiônàlizætiøn, one keystroke at a time, makes some 63 wbsearchentities requests practically simultaneously /o\

I think it stands to reason that this might overwhelm the test wiki for a bit…

Change #1214476 had a related patch set uploaded (by Lucas Werkmeister (WMDE); author: Lucas Werkmeister (WMDE)):

[mediawiki/extensions/Wikibase@master] Try to make browser test entity selection more robust

https://gerrit.wikimedia.org/r/1214476

Change #1214479 had a related patch set uploaded (by Lucas Werkmeister (WMDE); author: Lucas Werkmeister (WMDE)):

[mediawiki/extensions/Wikibase@master] WIP: Use mw.util.debounce() in property lookup

https://gerrit.wikimedia.org/r/1214479

Change #1214476 merged by jenkins-bot:

[mediawiki/extensions/Wikibase@master] Try to make browser test entity selection more robust

https://gerrit.wikimedia.org/r/1214476

Change #1214468 merged by jenkins-bot:

[mediawiki/extensions/Wikibase@master] Search for some browser test entities by ID

https://gerrit.wikimedia.org/r/1214468

Still happening :( in this gate-and-submit build for this change.

Let’s see if that change and its successor itself – debouncing entity search – helps more.

Change #1214479 merged by jenkins-bot:

[mediawiki/extensions/Wikibase@master] Debounce item and property searches

https://gerrit.wikimedia.org/r/1214479

My feeling is that it helped somewhat, but it didn’t resolve the error completely – I just got it in this build:

  1) wbui2025 entityId datatypes (item, property)
       mobile view - property datatype
         allows adding property statement to empty item, displays statement and supports full editing workflow:
     CypressError: Timed out retrying after 20050ms: `cy.click()` failed because this element is not visible:

`<li class="cdx-menu__no-results cdx-menu-item" role="option"></li>`

This element `<li.cdx-menu__no-results.cdx-menu-item>` is not visible because its parent `<div.cdx-menu>` has CSS property: `display: none`

Fix this problem, or use `{force: true}` to disable error checking.

https://on.cypress.io/element-cannot-be-interacted-with

image.png (720×1 px, 188 KB)

To me this looks like the “first few characters get lost” issue again – the input should look like “linked-property-…”, but the screenshot just shows “ed-property-…”.

Edit: Same situation in

Given that this test is still quite flaky (see my edits to the previous comment – and that’s not an exhaustive list), I don’t think the task should be considered done. I think it belongs either in the Wikidata-Omega backlog or directly into the Wikidata-Omega (The Board) “Ready for Development” column.

Change #1229614 had a related patch set uploaded (by Lucas Werkmeister (WMDE); author: Lucas Werkmeister (WMDE)):

[mediawiki/extensions/Wikibase@master] Try to make browser test entity selection even more robust

https://gerrit.wikimedia.org/r/1229614

^ another piecemeal change that might help things a little bit… I suggest we merge it (assuming CI is green) and see how it shakes out.

If Cypress .type() keeps being this unreliable, I’m tempted to follow this suggestion and replace it with .invoke( 'val', theValue ) to set the value via the DOM. After all, I don’t think most of our tests are interested in keyboard input behavior in particular.

Change #1229614 merged by jenkins-bot:

[mediawiki/extensions/Wikibase@master] Try to make browser test entity selection even more robust

https://gerrit.wikimedia.org/r/1229614

I don’t remember seeing this issue again since the above improvement was merged, FWIW. (T416160 is another issue in our Cypress tests, but looks quite unrelated to me.)