Koha-clms/t/cypress/integration
Jonathan Druart 7ae55e2274
Bug 40043: Try to prevent Agreements_spec.ts to fail randomly
One test is failing with:
"""
https://on.cypress.io/element-has-detached-from-dom" type="CypressError"><![CDATA[CypressError: Timed out retrying after 10050ms: `cy.click()` failed because the page updated while this command was executing. Cypress tried to locate elements based on this query:

> <a.show>

We initially found matching element(s), but while waiting for them to become actionable, they disappeared from the page. Common situations why this happens:
  - Your JS framework re-rendered asynchronously
  - Your app code reacted to an event firing and removed the element

You can typically solve this by breaking up a chain. For example, rewrite:

> `cy.get('button').click().click()`

to

> `cy.get('button').as('btn').click()`
> `cy.get('@btn').click()`

https://on.cypress.io/element-has-detached-from-dom
    at retryActionability (http://localhost:8081/__cypress/runner/cypress_runner.js:112246:74)
    at tryCatcher (http://localhost:8081/__cypress/runner/cypress_runner.js:1807:23)
    at Promise.attempt.Promise.try (http://localhost:8081/__cypress/runner/cypress_runner.js:4315:29)
    at whenStable (http://localhost:8081/__cypress/runner/cypress_runner.js:143192:68)
    at <unknown> (http://localhost:8081/__cypress/runner/cypress_runner.js:143133:14)
    at tryCatcher (http://localhost:8081/__cypress/runner/cypress_runner.js:1807:23)
    at Promise._settlePromiseFromHandler (http://localhost:8081/__cypress/runner/cypress_runner.js:1519:31)
    at Promise._settlePromise (http://localhost:8081/__cypress/runner/cypress_runner.js:1576:18)
    at Promise._settlePromise0 (http://localhost:8081/__cypress/runner/cypress_runner.js:1621:10)
    at Promise._settlePromises (http://localhost:8081/__cypress/runner/cypress_runner.js:1701:18)
    at Promise._fulfill (http://localhost:8081/__cypress/runner/cypress_runner.js:1645:18)
    at <unknown> (http://localhost:8081/__cypress/runner/cypress_runner.js:5450:46)
From Your Spec Code:
    at Context.eval (webpack://koha/./t/cypress/integration/ERM/Agreements_spec.ts:630:18)]]></failure>
    </testcase>
  </testsuite>
"""

My guess is that it happens because we don't wait for the /agreements
response.

Test plan:
Test should still pass, we will see how Jenkins behave after it's
pushed.

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit cebc45ad03)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-07-24 10:23:28 +02:00
..
Acquisitions Bug 38899: Fix cypress tests 2025-06-22 23:48:46 +02:00
Admin Revert "Bug 37917: Add some wait time to RecordSources_spec.ts for the intercepted request responses" 2024-10-11 11:13:48 +02:00
Auth Bug 40170: Replace cypress-mysql with mysql2 - Cypress tests 2025-07-10 22:47:37 +02:00
ERM Bug 40043: Try to prevent Agreements_spec.ts to fail randomly 2025-07-24 10:23:28 +02:00
Islands Bug 40170: Replace cypress-mysql with mysql2 - Cypress tests 2025-07-10 22:47:37 +02:00
KohaTable Bug 40344: Fix KohaTable_spec.ts 2025-07-24 10:23:27 +02:00
Preservation Bug 37930: Extend new AV logic to the Preservation module 2025-04-25 08:46:57 +02:00
Tools Bug 40046: Use xml and auto-select it 2025-07-10 22:47:30 +02:00
t Bug 40169: mockData - Do not replace _id if passed 2025-07-24 10:23:23 +02:00
AdditionalFields_spec.ts Bug 37577: (QA follow-up) Tidy 2024-11-08 16:09:19 +01:00
InfiniteScrollSelect_spec.ts Bug 37620: Fix Total-Count headers 2024-08-27 12:14:21 +02:00
Toolbar_spec.ts Bug 38899: Add a cypress test 2025-06-22 23:48:43 +02:00
flatpickr_spec.ts Revert "Bug 37493: [DONT PUSH] Test only - Force test fail" 2024-09-02 17:21:50 +02:00