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>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
This commit is contained in:
Jonathan Druart 2024-03-19 09:29:13 +01:00 committed by Katrin Fischer
parent c6fa96eeca
commit 7e05bda48e
No known key found for this signature in database
GPG Key ID: 0EF6E2C03357A834
1 changed files with 2 additions and 2 deletions

View File

@ -128,7 +128,7 @@ describe("CSRF", () => {
cy.visit("/cgi-bin/koha/admin/branches.pl");
cy.get("select[name='libraries_length']").select("-1");
cy.get("#delete_library_" + branchcode).click();
cy.get("#delete_library_" + branchcode).click({ force: true });
// Remove CSRF Token
cy.get("form[method='post']")
@ -157,7 +157,7 @@ describe("CSRF", () => {
cy.visit("/cgi-bin/koha/admin/branches.pl");
cy.get("select[name='libraries_length']").select("-1");
cy.get("#delete_library_" + branchcode).click();
cy.get("#delete_library_" + branchcode).click({ force: true });
cy.contains("Yes, delete").click();