Bug 40051 - cy.wait(delay) should not be used in Cypress tests
Summary: cy.wait(delay) should not be used in Cypress tests
Status: Pushed to main
Alias: None
Product: Koha
Classification: Unclassified
Component: Test Suite (show other bugs)
Version: unspecified
Hardware: All All
: P5 - low normal
Assignee: Jonathan Druart
QA Contact: Testopia
URL:
Keywords:
Depends on: 40046
Blocks:
  Show dependency treegraph
 
Reported: 2025-06-02 11:49 UTC by Jonathan Druart
Modified: 2025-08-01 19:24 UTC (History)
1 user (show)

See Also:
GIT URL:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
25.11.00
Circulation function:


Attachments
Bug 40051: Remove cy.wait(delay) from cypress tests (23.37 KB, patch)
2025-06-02 11:54 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 40051: Remove cy.wait(delay) from cypress tests (23.73 KB, patch)
2025-07-07 12:07 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 40051: Remove cy.wait(delay) from cypress tests (23.68 KB, patch)
2025-07-07 12:11 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 40051: Remove cy.wait(delay) from cypress tests (23.74 KB, patch)
2025-07-08 14:31 UTC, Pedro Amorim
Details | Diff | Splinter Review
Bug 40051: Remove 'only' from KohaTable_spec.ts (1.05 KB, patch)
2025-07-08 14:31 UTC, Pedro Amorim
Details | Diff | Splinter Review
Bug 40051: Remove cy.wait(delay) from cypress tests (23.42 KB, patch)
2025-08-01 12:37 UTC, Nick Clemens (kidclamp)
Details | Diff | Splinter Review
Bug 40051: Remove 'only' from KohaTable_spec.ts (1.10 KB, patch)
2025-08-01 12:37 UTC, Nick Clemens (kidclamp)
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Jonathan Druart 2025-06-02 11:49:22 UTC
It can cause random failures. We should rely on the existence of something, Cypress will retry if the test fails.
Comment 1 Jonathan Druart 2025-06-02 11:54:02 UTC
Created attachment 182905 [details] [review]
Bug 40051: Remove cy.wait(delay) from cypress tests

We should not use cy.wait(delay), it's a poor pattern and can cause
random failures.

Test plan:
All cypress tests should still pass after this patchset.

Note that t/cypress/integration/ERM/Titles_spec.ts is currently failing.
Comment 2 Jonathan Druart 2025-06-02 11:55:18 UTC
I've asked Pedro to have a look at Titles_spec.ts.
Comment 3 Jonathan Druart 2025-07-07 12:07:01 UTC
Created attachment 183835 [details] [review]
Bug 40051: Remove cy.wait(delay) from cypress tests

We should not use cy.wait(delay), it's a poor pattern and can cause
random failures.

Test plan:
All cypress tests should still pass after this patchset.

Note that t/cypress/integration/ERM/Titles_spec.ts is currently failing.
Comment 4 Jonathan Druart 2025-07-07 12:11:30 UTC
Created attachment 183836 [details] [review]
Bug 40051: Remove cy.wait(delay) from cypress tests

We should not use cy.wait(delay), it's a poor pattern and can cause
random failures.

Test plan:
All cypress tests should still pass after this patchset.
Comment 5 Jonathan Druart 2025-07-07 12:12:11 UTC
All tests passing now (on top of "Bug 38899: Fix Cypress tests" not pushed yet).
Comment 6 Pedro Amorim 2025-07-08 14:31:21 UTC
Created attachment 183863 [details] [review]
Bug 40051: Remove cy.wait(delay) from cypress tests

We should not use cy.wait(delay), it's a poor pattern and can cause
random failures.

Test plan:
All cypress tests should still pass after this patchset.

Signed-off-by: Pedro Amorim <pedro.amorim@openfifth.co.uk>
Comment 7 Pedro Amorim 2025-07-08 14:31:23 UTC
Created attachment 183864 [details] [review]
Bug 40051: Remove 'only' from KohaTable_spec.ts

Signed-off-by: Pedro Amorim <pedro.amorim@openfifth.co.uk>
Comment 8 Pedro Amorim 2025-07-08 14:33:39 UTC
InfiniteScrollSelect_spec.ts failed for me the first time:
  1) Infinite scroll
       Should correctly display labels:
     CypressError: Timed out retrying after 10000ms: `cy.wait()` timed out waiting `10000ms` for the 1st request to the route: `getPageTwo`. No request ever occurred.

But it doesn't seem related to this patchset and I wasn't able to get it to fail again.


Also not related to this patchset, but ManageMarcImport_spec.ts still fails for me consistently (3/3):

  1) loads the manage MARC import page
       upload a MARC record:
     AssertionError: Timed out retrying after 10000ms: Expected to find content: 'View batch' but never did.
Comment 9 Nick Clemens (kidclamp) 2025-08-01 12:37:48 UTC
Created attachment 184999 [details] [review]
Bug 40051: Remove cy.wait(delay) from cypress tests

We should not use cy.wait(delay), it's a poor pattern and can cause
random failures.

Test plan:
All cypress tests should still pass after this patchset.

Signed-off-by: Pedro Amorim <pedro.amorim@openfifth.co.uk>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Comment 10 Nick Clemens (kidclamp) 2025-08-01 12:37:51 UTC
Created attachment 185000 [details] [review]
Bug 40051: Remove 'only' from KohaTable_spec.ts

Signed-off-by: Pedro Amorim <pedro.amorim@openfifth.co.uk>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Comment 11 Lucas Gass (lukeg) 2025-08-01 19:24:52 UTC
Nice work everyone!

Pushed to main for 25.11