[Bug 36355] New: Auth/csrf.ts is failing if many libraries in the DB
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36355 Bug ID: 36355 Summary: Auth/csrf.ts is failing if many libraries in the DB Change sponsored?: --- Product: Koha Version: unspecified Hardware: All OS: All Status: NEW Severity: minor Priority: P5 - low Component: Test Suite Assignee: chris@bigballofwax.co.nz Reporter: jonathan.druart@gmail.com QA Contact: testopia@bugs.koha-community.org The test is selecting "All" in the length dropdown list of DT, but the query takes more than the timeout delay (10sec) and we never see the "Delete" button. We could fix this failure but actually it is catching another problem: we should not have that many libraries in the DB. Koha_Master/2813 koha_1 | Running: Auth/csrf.ts (3 of 15) koha_1 | <?xml version="1.0" encoding="UTF-8"?> koha_1 | <testsuites name="Mocha Tests" time="41.862" tests="6" failures="2"> koha_1 | <testsuite name="Root Suite" timestamp="2024-03-18T11:18:40" tests="0" file="t/cypress/integration/Auth/csrf.ts" time="0.000" failures="0"> koha_1 | </testsuite> koha_1 | <testsuite name="CSRF" timestamp="2024-03-18T11:18:40" tests="6" time="41.845" failures="2"> koha_1 | <testcase name="CSRF Add using POST without csrf" time="3.693" classname="Add using POST without csrf"> koha_1 | </testcase> koha_1 | <testcase name="CSRF Add using POST with invalid csrf" time="3.749" classname="Add using POST with invalid csrf"> koha_1 | </testcase> koha_1 | <testcase name="CSRF Add using GET" time="1.737" classname="Add using GET"> koha_1 | </testcase> koha_1 | <testcase name="CSRF Add" time="5.895" classname="Add"> koha_1 | </testcase> koha_1 | <testcase name="CSRF Delete without CSRF" time="0.000" classname="Delete without CSRF"> koha_1 | <failure message="Timed out retrying after 10050ms: `cy.click()` failed because the center of this element is hidden from view: koha_1 | koha_1 | `<button type="submit" id="delete_library_TEST_LIB" class="btn btn-default btn-xs" role="button">...</button>` koha_1 | koha_1 | Fix this problem, or use `{force: true}` to disable error checking. koha_1 | koha_1 | https://on.cypress.io/element-cannot-be-interacted-with" type="CypressError"><![CDATA[CypressError: Timed out retrying after 10050ms: `cy.click()` failed because the center of this element is hidden from view: koha_1 | koha_1 | `<button type="submit" id="delete_library_TEST_LIB" class="btn btn-default btn-xs" role="button">...</button>` koha_1 | koha_1 | Fix this problem, or use `{force: true}` to disable error checking. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36355 --- Comment #1 from Jonathan Druart <jonathan.druart@gmail.com> --- We could improve the tests and for instance filter the table to only fetch the libraries we expect to be displayed, but as it's actually catching a bug from somewhere else I don't think we should focus on this now. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36355 Jonathan Druart <jonathan.druart@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=36356 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36355 Jonathan Druart <jonathan.druart@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also|https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=36356 | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36355 Jonathan Druart <jonathan.druart@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|Auth/csrf.ts is failing if |Auth/csrf.ts is failing if |many libraries in the DB |library with long info the | |DB -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36355 Jonathan Druart <jonathan.druart@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36355 --- Comment #2 from Jonathan Druart <jonathan.druart@gmail.com> --- Created attachment 163382 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=163382&action=edit Bug 36355: Prevent csrf.ts to fail if DB has libraries with long name If one library has a long name the "Delete" button will not appear on the screen and the cypress test will fail Timed out retrying after 10050ms: `cy.click()` failed because the center of this element is hidden from view We can either increase the size of the screen or force the click even if the button is not visible. Test plan: Edit a library and set info with long name, address, etc. Run the cypress test: yarn cypress run --spec t/cypress/integration/Auth/csrf.ts Note the failure, you can watch the video and notice that the delete button is not on the screen (t/cypress/videos/csrf.ts.mp4) Apply the patch, try again => Succes -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36355 --- Comment #3 from Jonathan Druart <jonathan.druart@gmail.com> --- (In reply to Jonathan Druart from comment #1)
We could improve the tests and for instance filter the table to only fetch the libraries we expect to be displayed, but as it's actually catching a bug from somewhere else I don't think we should focus on this now.
Not correct, it's actually not failing because of the number of libraries. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36355 Jonathan Druart <jonathan.druart@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|chris@bigballofwax.co.nz |jonathan.druart@gmail.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36355 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |martin.renvoize@ptfs-europe | |.com QA Contact|testopia@bugs.koha-communit |martin.renvoize@ptfs-europe |y.org |.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36355 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #163382|0 |1 is obsolete| | --- Comment #4 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 163519 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=163519&action=edit Bug 36355: Prevent csrf.ts to fail if DB has libraries with long name If one library has a long name the "Delete" button will not appear on the screen and the cypress test will fail Timed out retrying after 10050ms: `cy.click()` failed because the center of this element is hidden from view We can either increase the size of the screen or force the click even if the button is not visible. Test plan: Edit a library and set info with long name, address, etc. Run the cypress test: yarn cypress run --spec t/cypress/integration/Auth/csrf.ts Note the failure, you can watch the video and notice that the delete button is not on the screen (t/cypress/videos/csrf.ts.mp4) Apply the patch, try again => Succes Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36355 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off --- Comment #5 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- This makes sense to me now I've worked through it.. I was slightly torn as to whether we should 'fix' testbuilder to create shorter library names.. but I think it's actually useful to catch these things. The fix here works as intended and makes sense to me. Passing QA straight. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36355 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36355 Jonathan Druart <jonathan.druart@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|Auth/csrf.ts is failing if |Auth/csrf.ts is failing if |library with long info the |library with long info in |DB |the DB -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36355 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)| |24.05.00 released in| | Status|Passed QA |Pushed to master -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36355 --- Comment #6 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Pushed for 24.05! Well done everyone, thank you! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36355 Fridolin Somers <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on| |36177 CC| |fridolin.somers@biblibre.co | |m Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36177 [Bug 36177] We need integration tests to cover CSRF checks -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36355 Fridolin Somers <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Resolution|--- |FIXED Status|Pushed to master |RESOLVED --- Comment #7 from Fridolin Somers <fridolin.somers@biblibre.com> --- Depends on Bug 36177 not in 23.11.x -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org