Bug 33282 - Cypress tests are failing
Summary: Cypress tests are failing
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Test Suite (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Pedro Amorim
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-03-20 18:22 UTC by Pedro Amorim
Modified: 2023-12-28 20:42 UTC (History)
4 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
23.05.00,22.11.04


Attachments
Bug 33282: Rename Dialog.spec.ts to Dialog_spec.ts (633 bytes, patch)
2023-03-20 18:25 UTC, Pedro Amorim
Details | Diff | Splinter Review
Bug 33282: Remove redundant intercept (928 bytes, patch)
2023-03-20 18:25 UTC, Pedro Amorim
Details | Diff | Splinter Review
Bug 33282: Move get_title to index.js to be invoked by different specs (6.54 KB, patch)
2023-03-20 18:25 UTC, Pedro Amorim
Details | Diff | Splinter Review
Bug 33282: Feed an array of titles so that no dialog message appears, including but not limited to the one we're testing for (1.36 KB, patch)
2023-03-20 18:26 UTC, Pedro Amorim
Details | Diff | Splinter Review
Bug 33282: Rename Dialog.spec.ts to Dialog_spec.ts (706 bytes, patch)
2023-03-22 10:37 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 33282: Remove useless intercept (1.11 KB, patch)
2023-03-22 10:37 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 33282: Move get_title to index.js to be invoked by different specs (6.61 KB, patch)
2023-03-22 10:37 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 33282: Feed an array of titles so that no dialog message appears, including but not limited to the one we're testing for (1.43 KB, patch)
2023-03-22 10:37 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 33282: Feed an array of titles so that no dialog message appears (1.43 KB, patch)
2023-03-24 08:13 UTC, Jonathan Druart
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Pedro Amorim 2023-03-20 18:22:33 UTC

    
Comment 1 Pedro Amorim 2023-03-20 18:25:54 UTC
Created attachment 148427 [details] [review]
Bug 33282: Rename Dialog.spec.ts to Dialog_spec.ts
Comment 2 Pedro Amorim 2023-03-20 18:25:56 UTC
Created attachment 148428 [details] [review]
Bug 33282: Remove redundant intercept
Comment 3 Pedro Amorim 2023-03-20 18:25:59 UTC
Created attachment 148429 [details] [review]
Bug 33282: Move get_title to index.js to be invoked by different specs
Comment 4 Pedro Amorim 2023-03-20 18:26:01 UTC
Created attachment 148430 [details] [review]
Bug 33282: Feed an array of titles so that no dialog message appears, including but not limited to the one we're testing for
Comment 5 Pedro Amorim 2023-03-20 18:29:04 UTC
This is not done yet, there's something weird happening with Packages_specs.ts.
It doesn't fail running cypress open, but sometimes fails running cypress through CLI (headless), it's hard to pinpoint because it doesn't always fail.

I think it's something to do with the loading dialog modal.
Following the tests in the browser, the "Loading..." dialog modal is always present, and it seems to sometimes block a click() in Packages_specs.ts.
Instead of just adding {force:true} to the click(), I'm trying to figure out why "Loading..." modal never stops showing with Cypress on the browser, but haven't figured it out yet.
Comment 6 Jonathan Druart 2023-03-22 10:30:12 UTC
(In reply to Pedro Amorim from comment #5)
> This is not done yet, there's something weird happening with
> Packages_specs.ts.
> It doesn't fail running cypress open, but sometimes fails running cypress
> through CLI (headless), it's hard to pinpoint because it doesn't always fail.
> 
> I think it's something to do with the loading dialog modal.
> Following the tests in the browser, the "Loading..." dialog modal is always
> present, and it seems to sometimes block a click() in Packages_specs.ts.
> Instead of just adding {force:true} to the click(), I'm trying to figure out
> why "Loading..." modal never stops showing with Cypress on the browser, but
> haven't figured it out yet.

Weird!

I've noticed a JS/DT error: 
"(alert) Something went wrong when loading the table. 200: OK."

This is not expected. But it appears even when the tests pass.
Comment 7 Jonathan Druart 2023-03-22 10:37:23 UTC
Created attachment 148509 [details] [review]
Bug 33282: Rename Dialog.spec.ts to Dialog_spec.ts

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 8 Jonathan Druart 2023-03-22 10:37:25 UTC
Created attachment 148510 [details] [review]
Bug 33282: Remove useless intercept

JD amended patch: replace "redundant" with "useless". It's not the same
intercept, but we don't need the one removed by this patch.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 9 Jonathan Druart 2023-03-22 10:37:28 UTC
Created attachment 148511 [details] [review]
Bug 33282: Move get_title to index.js to be invoked by different specs

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 10 Jonathan Druart 2023-03-22 10:37:31 UTC
Created attachment 148512 [details] [review]
Bug 33282: Feed an array of titles so that no dialog message appears, including but not limited to the one we're testing for

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 11 Jonathan Druart 2023-03-22 10:38:35 UTC
I've got the failure once (using cypress open), then no more.

I think we should move forward with these patches, and fix the random failure separately.
Comment 12 Jonathan Druart 2023-03-24 08:13:29 UTC
Created attachment 148631 [details] [review]
Bug 33282: Feed an array of titles so that no dialog message appears

Including but not limited to the one we're testing for

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 13 Jonathan Druart 2023-03-24 08:19:35 UTC
Pushed to master for 23.05. We want jenkins happy to start the hackfest :)
Comment 14 Martin Renvoize 2023-03-24 10:32:27 UTC
Final follow-up pushed to 22.11.x for 22.11.04
Comment 15 Martin Renvoize 2023-03-24 10:32:47 UTC
oop.. wrong bug!.. ignore that.. this one is still in the queue
Comment 16 Martin Renvoize 2023-03-24 10:36:03 UTC
Many hands makes light work, thankyou everyone!

Pushed to 22.11.x for the next release
Comment 17 Lucas Gass 2023-04-24 16:54:10 UTC
Not needed in 22.05.x, no backport.