From 6f0a3491819cba652e5bda779e00752677b97a7b Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Tue, 19 Mar 2024 09:29:13 +0100 Subject: [PATCH] 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 --- t/cypress/integration/Auth/csrf.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/t/cypress/integration/Auth/csrf.ts b/t/cypress/integration/Auth/csrf.ts index 704218d3a6f..a8ec6c6f581 100644 --- a/t/cypress/integration/Auth/csrf.ts +++ b/t/cypress/integration/Auth/csrf.ts @@ -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(); -- 2.34.1