From 401b17bc06332c29207869bc794401a48e621e02 Mon Sep 17 00:00:00 2001 From: Pedro Amorim Date: Wed, 15 Mar 2023 14:23:37 -0100 Subject: [PATCH] Bug 33235: Fix cypress tests Some inconsistencies leftovers from 32495 and 32997 were causing cypress tests to fail, this fixes them. * Apply patch * Run cypress tests and verify all pass Signed-off-by: Jonathan Druart Signed-off-by: Tomas Cohen Arazi (cherry picked from commit 16e6d937632301e233d5b90b6588940eb2226636) Signed-off-by: Matt Blenkinsop --- t/cypress/integration/Agreements_spec.ts | 5 ++--- t/cypress/integration/Licenses_spec.ts | 1 - t/cypress/integration/Packages_spec.ts | 1 - t/cypress/integration/Titles_spec.ts | 1 - 4 files changed, 2 insertions(+), 6 deletions(-) diff --git a/t/cypress/integration/Agreements_spec.ts b/t/cypress/integration/Agreements_spec.ts index b983545954..8dd209ee8d 100644 --- a/t/cypress/integration/Agreements_spec.ts +++ b/t/cypress/integration/Agreements_spec.ts @@ -187,7 +187,7 @@ describe("Agreement CRUD operations", () => { cy.get("#agreements_add").contains("Submit").click(); cy.get("input:invalid,textarea:invalid,select:invalid").should( "have.length", - 3 + 2 ); cy.get("#agreement_name").type(agreement.name); cy.get("#agreement_description").type(agreement.description); @@ -515,7 +515,7 @@ describe("Agreement CRUD operations", () => { statusCode: 500, error: "Something went wrong", }); - cy.contains("Accept").click(); + cy.contains("Yes, delete").click(); cy.get("main div[class='dialog alert']").contains( "Something went wrong: Error: Internal Server Error" ); @@ -563,7 +563,6 @@ describe("Agreement CRUD operations", () => { cy.get('#agreements_show .action_links .fa-trash').click(); cy.get(".dialog.alert.confirmation h1").contains("remove this agreement"); cy.contains("Yes, delete").click(); - cy.get("main div[class='dialog message']").contains("Agreement").contains("deleted"); //Make sure we return to list after deleting from show cy.get("#agreements_list table tbody tr:first") diff --git a/t/cypress/integration/Licenses_spec.ts b/t/cypress/integration/Licenses_spec.ts index 628417aa18..8879151828 100644 --- a/t/cypress/integration/Licenses_spec.ts +++ b/t/cypress/integration/Licenses_spec.ts @@ -309,7 +309,6 @@ describe("License CRUD operations", () => { cy.get('#licenses_show .action_links .fa-trash').click(); cy.get(".dialog.alert.confirmation h1").contains("remove this license"); cy.contains("Yes, delete").click(); - cy.get("main div[class='dialog message']").contains("License").contains("deleted"); //Make sure we return to list after deleting from show cy.get("#licenses_list table tbody tr:first") diff --git a/t/cypress/integration/Packages_spec.ts b/t/cypress/integration/Packages_spec.ts index 2fd7da3511..f5f6be5c4e 100644 --- a/t/cypress/integration/Packages_spec.ts +++ b/t/cypress/integration/Packages_spec.ts @@ -353,7 +353,6 @@ describe("Package CRUD operations", () => { cy.get('#packages_show .action_links .fa-trash').click(); cy.get(".dialog.alert.confirmation h1").contains("remove this package"); cy.contains("Yes, delete").click(); - cy.get("main div[class='dialog message']").contains("Local package").contains("deleted"); //Make sure we return to list after deleting from show cy.get("#packages_list table tbody tr:first") diff --git a/t/cypress/integration/Titles_spec.ts b/t/cypress/integration/Titles_spec.ts index c2deebdd44..5e9f16d038 100644 --- a/t/cypress/integration/Titles_spec.ts +++ b/t/cypress/integration/Titles_spec.ts @@ -498,7 +498,6 @@ describe("Title CRUD operations", () => { cy.get('#eholdings_title_show .action_links .fa-trash').click(); cy.get(".dialog.alert.confirmation h1").contains("remove this title"); cy.contains("Yes, delete").click(); - cy.get("main div[class='dialog message']").contains("Local title").contains("deleted"); //Make sure we return to list after deleting from show cy.get("#titles_list table tbody tr:first") -- 2.39.5