From 893bd2af715ad27b437568106ea2d36df4acc3c8 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Thu, 5 Jun 2025 16:29:15 +0200 Subject: [PATCH] Bug 40067: Improve waits and intercepts Signed-off-by: Jonathan Druart Signed-off-by: Lucas Gass (cherry picked from commit 688b5961c90bb79d44c37aed399a1a9739b1facb) Signed-off-by: Paul Derscheid --- t/cypress/integration/Toolbar_spec.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/t/cypress/integration/Toolbar_spec.ts b/t/cypress/integration/Toolbar_spec.ts index ce2abf908a..e7aaf19ec8 100644 --- a/t/cypress/integration/Toolbar_spec.ts +++ b/t/cypress/integration/Toolbar_spec.ts @@ -15,18 +15,21 @@ describe("Sticky toolbar", () => { "X-Base-Total-Count": "1", "X-Total-Count": "1", }, - }); - cy.visit("/cgi-bin/koha/acquisition/vendors"); + }).as("get-vendors"); cy.intercept( "GET", new RegExp("/api/v1/acquisitions/vendors/(?!config$).+"), vendor ).as("get-vendor"); + cy.visit("/cgi-bin/koha/acquisition/vendors"); + cy.wait("@get-vendors"); + const name_link = cy.get( "#vendors_list table tbody tr:first td:first a" ); name_link.click(); + cy.wait("@get-vendor"); cy.get("#toolbar a").contains("Receive shipments").click(); cy.get("h1").contains("Receive shipment from vendor " + vendor.name); });