Bug 33282

Summary: Cypress tests are failing
Product: Koha Reporter: Pedro Amorim <pedro.amorim>
Component: Test SuiteAssignee: Pedro Amorim <pedro.amorim>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: enhancement    
Priority: P5 - low CC: jonathan.druart, lucas, martin.renvoize, tomascohen
Version: Main   
Hardware: All   
OS: All   
See Also: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32898
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33235
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
Bug 33282: Remove redundant intercept
Bug 33282: Move get_title to index.js to be invoked by different specs
Bug 33282: Feed an array of titles so that no dialog message appears, including but not limited to the one we're testing for
Bug 33282: Rename Dialog.spec.ts to Dialog_spec.ts
Bug 33282: Remove useless intercept
Bug 33282: Move get_title to index.js to be invoked by different specs
Bug 33282: Feed an array of titles so that no dialog message appears, including but not limited to the one we're testing for
Bug 33282: Feed an array of titles so that no dialog message appears

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.