[Bug 33370] New: Agreements_spec.ts is failing randomly
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33370 Bug ID: 33370 Summary: Agreements_spec.ts is failing randomly Change sponsored?: --- Product: Koha Version: unspecified Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: Test Suite Assignee: chris@bigballofwax.co.nz Reporter: jonathan.druart+koha@gmail.com QA Contact: testopia@bugs.koha-community.org On Koha_Master/2446 koha_1 | <testcase name="Agreement CRUD operations Add agreement" time="0.0000" classname="Add agreement"> koha_1 | <failure message="Timed out retrying after 4000ms: Expected to find element: `main div[class='dialog alert']`, but never found it." type="AssertionError"><![CDATA[AssertionError: Timed out retrying after 4000ms: Expected to find element: `main div[class='dialog alert']`, but never found it. koha_1 | at Context.eval (http://kohadev-intra.mydnsname.org:8081/__cypress/tests?p=t/cypress/integration/Agreements_spec.ts:352:12)]]></failure> koha_1 | </testcase> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33370 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |pedro.amorim@ptfs-europe.co | |m -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33370 --- Comment #1 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- I did recreate locally, using run_all_tests.pl (so from the CLI) <testcase name="Agreement CRUD operations Add agreement" time="0.0000" classname="Add agreement"> <failure message="Timed out retrying after 4000ms: Expected to find element: `main div[class='dialog alert']`, but never found it." type="AssertionError"><![CDATA[AssertionError: Timed out retrying after 4000ms: Expected to find element: `main div[class='dialog alert']`, but never found it. at Context.eval (http://kohadev-intra.mydnsname.org:8081/__cypress/tests?p=t/cypress/integration/Agreements_spec.ts:352:12)]]></failure> </testcase> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33370 --- Comment #2 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- And I saw another one using Cypress UI Timed out retrying after 4050ms: cy.click() failed because this element: <a href="/cgi-bin/koha/erm/agreements/add" class="btn btn-default">...</a> is being covered by another element: <div class="modal_centered" data-v-018a4733="">...</div> Fix this problem, or use {force: true} to disable error checking.Learn more t/cypress/integration/Agreements_spec.ts:181:38 179 | // Click the button in the toolbar 180 | cy.visit("/cgi-bin/koha/erm/agreements");
181 | cy.contains("New agreement").click();
-- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33370 --- Comment #3 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- This is what I am seeing: https://snipboard.io/Ts2hq8.jpg -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33370 --- Comment #4 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- Timed out retrying after 4050ms: cy.click() failed because this element: <a href="/cgi-bin/koha/erm/agreements" class="">...</a> is being covered by another element: <div class="modal_centered" data-v-018a4733="">...</div> Fix this problem, or use {force: true} to disable error checking.Learn more t/cypress/integration/Agreements_spec.ts:141:55 139 | }); 140 | cy.visit("/cgi-bin/koha/erm/erm.pl");
141 | cy.get("#navmenulist").contains("Agreements").click(); | ^ 142 | cy.get("main div[class='dialog alert']").contains( 143 | /Something went wrong/ 144 | );
-- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33370 --- Comment #5 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- It certainly happens because the main "loading" modal is on top of everything, we haven't retrieved the vendors and AVs and so the modal is still on top when we are trying to continue the tests. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33370 --- Comment #6 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- Created attachment 149001 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=149001&action=edit Bug 33370: Intercept and wait for avs and vendors GETs -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33370 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |In Discussion CC| |agustinmoyano@theke.io, | |paul.derscheid@lmscloud.de, | |tomascohen@gmail.com --- Comment #7 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- I think this patch is fixing the problem, but it feels weird to have to add the wait statement to after all our visit calls. Is there another better way? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33370 --- Comment #8 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- Maybe we could overload cy.visit to not have to add the wait statement all over the tests (?) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33370 --- Comment #9 from Pedro Amorim <pedro.amorim@ptfs-europe.com> --- This seems like a decent solution to the problem. (In reply to Jonathan Druart from comment #8)
Maybe we could overload cy.visit to not have to add the wait statement all over the tests (?)
What do you mean by overload cy.visit? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33370 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|In Discussion |ASSIGNED Assignee|chris@bigballofwax.co.nz |jonathan.druart+koha@gmail. | |com --- Comment #10 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- (In reply to Pedro Amorim from comment #9)
This seems like a decent solution to the problem.
(In reply to Jonathan Druart from comment #8)
Maybe we could overload cy.visit to not have to add the wait statement all over the tests (?)
What do you mean by overload cy.visit?
https://docs.cypress.io/api/cypress-api/custom-commands#Overwrite-Existing-C... But actually it might be better to create our own visit command instead. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33370 --- Comment #11 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- Created attachment 149119 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=149119&action=edit Bug 33370: Create a new visit_and_wait command It seems easier and cleaner to have our own visit_and_wait command that will intercept the 2 queries (for avs and vendors) and then do the wait. This is needed for the first hit to erm module. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33370 --- Comment #12 from Paul Derscheid <paul.derscheid@lmscloud.de> --- This looks much cleaner. Good choice. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33370 --- Comment #13 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- Note that the command is named "visit_and_wait", but it is actually ERM specific, it should be put in a "erm" subdirectory or renamed. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33370 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|Agreements_spec.ts is |Cypress tests are failing |failing randomly |randomly -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33370 --- Comment #14 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- Titles is failing consistently with <testcase name="Title CRUD operations Add title" time="0.0000" classname="Add title"> <failure message="Timed out retrying after 4000ms: Expected to find element: `main div[class='dialog alert']`, but never found it." type="AssertionError"><![CDATA[AssertionError: Timed out retrying after 4000ms: Expected to find element: `main div[class='dialog alert']`, but never found it. when run from the command line. But passes when run from the Cypress UI. I think it has something to do with the size of the window (the alert appears at the top, and is not visible when we submit the form). -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33370 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on| |33400 --- Comment #15 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- (In reply to Jonathan Druart from comment #14)
Titles is failing consistently with
<testcase name="Title CRUD operations Add title" time="0.0000" classname="Add title"> <failure message="Timed out retrying after 4000ms: Expected to find element: `main div[class='dialog alert']`, but never found it." type="AssertionError"><![CDATA[AssertionError: Timed out retrying after 4000ms: Expected to find element: `main div[class='dialog alert']`, but never found it.
when run from the command line. But passes when run from the Cypress UI. I think it has something to do with the size of the window (the alert appears at the top, and is not visible when we submit the form).
Moved to bug 33400. Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33400 [Bug 33400] Titles_spec.ts is failing because alert is not visible -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33370 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |33402 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33402 [Bug 33402] ERM Cypress tests needs to be moved to their own directory -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33370 --- Comment #16 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- Wondering if this actually needed if we have bug 33408, and specifically this change in Main.vue: - <div v-if="ERMModule"> + <div v-if="initialized"> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33370 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |RESOLVED Resolution|--- |DUPLICATE --- Comment #17 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- (In reply to Jonathan Druart from comment #16)
Wondering if this actually needed if we have bug 33408, and specifically this change in Main.vue:
- <div v-if="ERMModule"> + <div v-if="initialized">
Giving this one a try and closing this one for now. *** This bug has been marked as a duplicate of bug 33408 *** -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33370 Bug 33370 depends on bug 33400, which changed state. Bug 33400 Summary: Titles_spec.ts is failing because alert is not visible https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33400 What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |RESOLVED Resolution|--- |INVALID -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org