From fab4a60f2862543998c2ec4d5fcd1bd4262ae8c6 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Mon, 9 Sep 2024 10:20:36 +0200 Subject: [PATCH] Bug 35402: Fix cypress tests Signed-off-by: Katrin Fischer --- t/cypress/integration/Admin/RecordSources_spec.ts | 2 +- t/cypress/integration/ERM/Agreements_spec.ts | 6 +++--- t/cypress/integration/ERM/DataProviders_spec.ts | 6 +++--- t/cypress/integration/ERM/Dialog_spec.ts | 6 ++++-- t/cypress/integration/ERM/Licenses_spec.ts | 12 +++++++++--- t/cypress/integration/ERM/Packages_spec.ts | 12 +++++++++--- t/cypress/integration/ERM/Searchbar_spec.ts | 10 +++++----- t/cypress/integration/ERM/Titles_spec.ts | 6 +++--- 8 files changed, 37 insertions(+), 23 deletions(-) diff --git a/t/cypress/integration/Admin/RecordSources_spec.ts b/t/cypress/integration/Admin/RecordSources_spec.ts index 8a4278e499..298eb18612 100644 --- a/t/cypress/integration/Admin/RecordSources_spec.ts +++ b/t/cypress/integration/Admin/RecordSources_spec.ts @@ -161,7 +161,7 @@ describe("Record sources CRUD tests", () => { cy.get("#record_sources_list table tbody tr:nth-child(2n+2)") .contains("Delete") .click(); - cy.get(".dialog.alert.confirmation h1").contains( + cy.get(".alert-warning.confirmation h1").contains( "Are you sure you want to delete this record source?" ); cy.contains("Source 2"); diff --git a/t/cypress/integration/ERM/Agreements_spec.ts b/t/cypress/integration/ERM/Agreements_spec.ts index cc720f6a31..626bbb8f08 100644 --- a/t/cypress/integration/ERM/Agreements_spec.ts +++ b/t/cypress/integration/ERM/Agreements_spec.ts @@ -575,7 +575,7 @@ describe("Agreement CRUD operations", () => { cy.get("#agreements_list table tbody tr:first") .contains("Delete") .click(); - cy.get(".dialog.alert.confirmation h1").contains( + cy.get(".alert-warning.confirmation h1").contains( "remove this agreement" ); cy.contains(agreement.name); @@ -597,7 +597,7 @@ describe("Agreement CRUD operations", () => { cy.get("#agreements_list table tbody tr:first") .contains("Delete") .click(); - cy.get(".dialog.alert.confirmation h1").contains( + cy.get(".alert-warning.confirmation h1").contains( "remove this agreement" ); cy.contains("Yes, delete").click(); @@ -634,7 +634,7 @@ describe("Agreement CRUD operations", () => { ); cy.get("#agreements_show #toolbar").contains("Delete").click(); - cy.get(".dialog.alert.confirmation h1").contains( + cy.get(".alert-warning.confirmation h1").contains( "remove this agreement" ); cy.contains("Yes, delete").click(); diff --git a/t/cypress/integration/ERM/DataProviders_spec.ts b/t/cypress/integration/ERM/DataProviders_spec.ts index 3f4c3ac92b..d0c2078ac2 100644 --- a/t/cypress/integration/ERM/DataProviders_spec.ts +++ b/t/cypress/integration/ERM/DataProviders_spec.ts @@ -319,7 +319,7 @@ describe("Data provider CRUD operations", () => { cy.get("#usage_data_providers_list table tbody tr:first") .contains("Delete") .click(); - cy.get(".dialog.alert.confirmation h1").contains( + cy.get(".alert-warning.confirmation h1").contains( "remove this data provider" ); cy.contains(dataProvider.name); @@ -342,7 +342,7 @@ describe("Data provider CRUD operations", () => { // cy.get("#usage_data_providers_list table tbody tr:first") // .contains("Delete") // .click(); - // cy.get(".dialog.alert.confirmation h1").contains( + // cy.get(".alert-warning.confirmation h1").contains( // "remove this data provider" // ); cy.contains("Yes, delete").click(); @@ -386,7 +386,7 @@ describe("Data provider CRUD operations", () => { cy.get("#usage_data_providers_show #toolbar") .contains("Delete") .click(); - cy.get(".dialog.alert.confirmation h1").contains( + cy.get(".alert-warning.confirmation h1").contains( "remove this data provider" ); cy.contains("Yes, delete").click(); diff --git a/t/cypress/integration/ERM/Dialog_spec.ts b/t/cypress/integration/ERM/Dialog_spec.ts index 8638bc3040..89e0ef8285 100644 --- a/t/cypress/integration/ERM/Dialog_spec.ts +++ b/t/cypress/integration/ERM/Dialog_spec.ts @@ -156,7 +156,7 @@ describe("Dialog operations", () => { .contains("Delete") .click(); cy.contains("No, do not delete").click(); - cy.get(".dialog.alert.confirmation h1").should("not.exist"); + cy.get(".alert-warning.confirmation h1").should("not.exist"); cy.get("main div[class='alert alert-info']").contains( "Package updated" ); @@ -169,7 +169,9 @@ describe("Dialog operations", () => { cy.get("#packages_list table tbody tr:first") .contains("Delete") .click(); - cy.get(".dialog.alert.confirmation h1").contains("remove this package"); + cy.get(".alert-warning.confirmation h1").contains( + "remove this package" + ); cy.contains("Yes, delete").click(); cy.get("main div[class='alert alert-info']") .contains("Local package") diff --git a/t/cypress/integration/ERM/Licenses_spec.ts b/t/cypress/integration/ERM/Licenses_spec.ts index a2176146c2..ae189b640e 100644 --- a/t/cypress/integration/ERM/Licenses_spec.ts +++ b/t/cypress/integration/ERM/Licenses_spec.ts @@ -304,7 +304,9 @@ describe("License CRUD operations", () => { cy.get("#licenses_list table tbody tr:first") .contains("Delete") .click(); - cy.get(".dialog.alert.confirmation h1").contains("remove this license"); + cy.get(".alert-warning.confirmation h1").contains( + "remove this license" + ); cy.contains(license.name); // Accept the confirmation dialog, get 500 @@ -324,7 +326,9 @@ describe("License CRUD operations", () => { cy.get("#licenses_list table tbody tr:first") .contains("Delete") .click(); - cy.get(".dialog.alert.confirmation h1").contains("remove this license"); + cy.get(".alert-warning.confirmation h1").contains( + "remove this license" + ); cy.contains("Yes, delete").click(); cy.get("main div[class='alert alert-info']") .contains("License") @@ -357,7 +361,9 @@ describe("License CRUD operations", () => { cy.get("#licenses_show h2").contains("License #" + license.license_id); cy.get("#licenses_show #toolbar").contains("Delete").click(); - cy.get(".dialog.alert.confirmation h1").contains("remove this license"); + cy.get(".alert-warning.confirmation h1").contains( + "remove this license" + ); cy.contains("Yes, delete").click(); //Make sure we return to list after deleting from show diff --git a/t/cypress/integration/ERM/Packages_spec.ts b/t/cypress/integration/ERM/Packages_spec.ts index ecf78b0566..746b5b3bd1 100644 --- a/t/cypress/integration/ERM/Packages_spec.ts +++ b/t/cypress/integration/ERM/Packages_spec.ts @@ -299,7 +299,9 @@ describe("Package CRUD operations", () => { cy.get("#packages_list table tbody tr:first") .contains("Delete") .click(); - cy.get(".dialog.alert.confirmation h1").contains("remove this package"); + cy.get(".alert-warning.confirmation h1").contains( + "remove this package" + ); cy.contains(erm_package.name); // Accept the confirmation dialog, get 500 @@ -319,7 +321,9 @@ describe("Package CRUD operations", () => { cy.get("#packages_list table tbody tr:first") .contains("Delete") .click(); - cy.get(".dialog.alert.confirmation h1").contains("remove this package"); + cy.get(".alert-warning.confirmation h1").contains( + "remove this package" + ); cy.contains("Yes, delete").click(); cy.get("main div[class='alert alert-info']") .contains("Local package") @@ -356,7 +360,9 @@ describe("Package CRUD operations", () => { ); cy.get("#packages_show #toolbar").contains("Delete").click(); - cy.get(".dialog.alert.confirmation h1").contains("remove this package"); + cy.get(".alert-warning.confirmation h1").contains( + "remove this package" + ); cy.contains("Yes, delete").click(); //Make sure we return to list after deleting from show diff --git a/t/cypress/integration/ERM/Searchbar_spec.ts b/t/cypress/integration/ERM/Searchbar_spec.ts index 0023c0292d..f2c12f8996 100644 --- a/t/cypress/integration/ERM/Searchbar_spec.ts +++ b/t/cypress/integration/ERM/Searchbar_spec.ts @@ -13,24 +13,24 @@ describe("Searchbar header changes", () => { it("Default option is agreements", () => { cy.visit("/cgi-bin/koha/erm/erm.pl"); - cy.get("#agreement_search-tab").parent().should("have.class", "active"); + cy.get("#agreement_search-tab").should("have.class", "active"); cy.visit("/cgi-bin/koha/erm/agreements"); - cy.get("#agreement_search-tab").parent().should("have.class", "active"); + cy.get("#agreement_search-tab").should("have.class", "active"); }); it("Should change to licenses when in licenses", () => { cy.visit("/cgi-bin/koha/erm/licenses"); - cy.get("#license_search-tab").parent().should("have.class", "active"); + cy.get("#license_search-tab").should("have.class", "active"); }); it("Should change to packages when in local packages", () => { cy.visit("/cgi-bin/koha/erm/eholdings/local/packages"); - cy.get("#package_search-tab").parent().should("have.class", "active"); + cy.get("#package_search-tab").should("have.class", "active"); }); it("Should change to titles when in local titles", () => { cy.visit("/cgi-bin/koha/erm/eholdings/local/titles"); - cy.get("#title_search-tab").parent().should("have.class", "active"); + cy.get("#title_search-tab").should("have.class", "active"); }); }); diff --git a/t/cypress/integration/ERM/Titles_spec.ts b/t/cypress/integration/ERM/Titles_spec.ts index 2ff2240b1a..6d19e87a9d 100644 --- a/t/cypress/integration/ERM/Titles_spec.ts +++ b/t/cypress/integration/ERM/Titles_spec.ts @@ -452,7 +452,7 @@ describe("Title CRUD operations", () => { cy.visit("/cgi-bin/koha/erm/eholdings/local/titles"); cy.get("#titles_list table tbody tr:first").contains("Delete").click(); - cy.get(".dialog.alert.confirmation h1").contains("remove this title"); + cy.get(".alert-warning.confirmation h1").contains("remove this title"); cy.contains(erm_title.publication_title); // Accept the confirmation dialog, get 500 @@ -470,7 +470,7 @@ describe("Title CRUD operations", () => { body: null, }); cy.get("#titles_list table tbody tr:first").contains("Delete").click(); - cy.get(".dialog.alert.confirmation h1").contains("remove this title"); + cy.get(".alert-warning.confirmation h1").contains("remove this title"); cy.contains("Yes, delete").click(); cy.get("main div[class='alert alert-info']") .contains("Local title") @@ -515,7 +515,7 @@ describe("Title CRUD operations", () => { ); cy.get("#eholdings_title_show #toolbar").contains("Delete").click(); - cy.get(".dialog.alert.confirmation h1").contains("remove this title"); + cy.get(".alert-warning.confirmation h1").contains("remove this title"); cy.contains("Yes, delete").click(); //Make sure we return to list after deleting from show -- 2.39.5