From 3fb41717c0a3c818335d22374478e3e08c250e1e Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Tue, 30 Jan 2024 14:30:31 +0100 Subject: [PATCH] Bug 35940: (bug 35477 follow-up) Fix cypress tests AssertionError: Timed out retrying after 10000ms: Expected to find element: `main div[class='dialog message']`, but never found it. We moved from message to alert. Signed-off-by: Katrin Fischer (cherry picked from commit f1b32b5316f6b204d6451a1902a0e510fa498f90) Signed-off-by: Fridolin Somers --- t/cypress/integration/Preservation/Trains.ts | 11 ++++++++++- t/cypress/integration/Preservation/WaitingList.ts | 4 ++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/t/cypress/integration/Preservation/Trains.ts b/t/cypress/integration/Preservation/Trains.ts index 6dda1f78a3..253864b61f 100644 --- a/t/cypress/integration/Preservation/Trains.ts +++ b/t/cypress/integration/Preservation/Trains.ts @@ -629,13 +629,22 @@ describe("Trains", () => { { item_id: 1 }, { item_id: 2 }, ]); + cy.get("#waiting-list").contains("Add to waiting list").click(); - cy.get("#barcode_list").type("bc_1\nbc_2\nbc_3"); + cy.get("#barcode_list").type("bc_1\nbc_2"); cy.contains("Submit").click(); cy.wait("@get-items"); cy.get("main div[class='dialog message']").contains( "2 new items added." ); + + cy.get("#waiting-list").contains("Add to waiting list").click(); + cy.get("#barcode_list").type("bc_1\nbc_2\nbc_3"); + cy.contains("Submit").click(); + cy.wait("@get-items"); + cy.get("main div[class='dialog alert modal']").contains( + "2 new items added. 1 items not found." + ); cy.contains("Add last 2 items to a train").click(); cy.get("#train_id .vs__search").type(train.name + "{enter}"); cy.intercept("GET", "/api/v1/items*", { diff --git a/t/cypress/integration/Preservation/WaitingList.ts b/t/cypress/integration/Preservation/WaitingList.ts index 3c12003b37..1b397f7af0 100644 --- a/t/cypress/integration/Preservation/WaitingList.ts +++ b/t/cypress/integration/Preservation/WaitingList.ts @@ -97,8 +97,8 @@ describe("WaitingList", () => { cy.get("#barcode_list").type("bc_1\nbc_2\nbc_3"); cy.contains("Submit").click(); cy.wait("@get-items"); - cy.get("main div[class='dialog message']").contains( - "2 new items added." + cy.get("main div[class='dialog alert modal']").contains( + "2 new items added. 1 items not found." ); }); -- 2.39.5