diff --git a/t/cypress/integration/ERM/Agreements_spec.ts b/t/cypress/integration/ERM/Agreements_spec.ts index 1d6dd91a25..6bbcb2cdf3 100644 --- a/t/cypress/integration/ERM/Agreements_spec.ts +++ b/t/cypress/integration/ERM/Agreements_spec.ts @@ -534,13 +534,14 @@ describe("Agreement CRUD operations", () => { "get-agreement" ); cy.visit("/cgi-bin/koha/erm/agreements"); - let name_link = cy.get( - "#agreements_list table tbody tr:first td:first a" - ); - name_link.should( - "have.text", - agreement.name + " (#" + agreement.agreement_id + ")" - ); + let id_cell = cy.get("#agreements_list table tbody tr:first td:first"); + id_cell.contains(agreement.agreement_id); + + let name_link = cy + .get("#agreements_list table tbody tr:first td") + .eq(1) + .find("a"); + name_link.should("have.text", agreement.name); name_link.click(); cy.wait("@get-agreement"); cy.wait(500); // Cypress is too fast! Vue hasn't populated the form yet! @@ -618,14 +619,14 @@ describe("Agreement CRUD operations", () => { cy.intercept("GET", "/api/v1/erm/agreements/*", agreement).as( "get-agreement" ); - cy.visit("/cgi-bin/koha/erm/agreements"); - let name_link = cy.get( - "#agreements_list table tbody tr:first td:first a" - ); - name_link.should( - "have.text", - agreement.name + " (#" + agreement.agreement_id + ")" - ); + let id_cell = cy.get("#agreements_list table tbody tr:first td:first"); + id_cell.contains(agreement.agreement_id); + + let name_link = cy + .get("#agreements_list table tbody tr:first td") + .eq(1) + .find("a"); + name_link.should("have.text", agreement.name); name_link.click(); cy.wait("@get-agreement"); cy.wait(500); // Cypress is too fast! Vue hasn't populated the form yet! diff --git a/t/cypress/integration/ERM/Licenses_spec.ts b/t/cypress/integration/ERM/Licenses_spec.ts index 361dfa94bf..170d28e3ee 100644 --- a/t/cypress/integration/ERM/Licenses_spec.ts +++ b/t/cypress/integration/ERM/Licenses_spec.ts @@ -246,13 +246,14 @@ describe("License CRUD operations", () => { "get-license" ); cy.visit("/cgi-bin/koha/erm/licenses"); - let name_link = cy.get( - "#licenses_list table tbody tr:first td:first a" - ); - name_link.should( - "have.text", - license.name + " (#" + license.license_id + ")" - ); + let id_cell = cy.get("#licenses_list table tbody tr:first td:first"); + id_cell.contains(license.license_id); + + let name_link = cy + .get("#licenses_list table tbody tr:first td") + .eq(1) + .find("a"); + name_link.should("have.text", license.name); name_link.click(); cy.wait("@get-license"); cy.wait(500); // Cypress is too fast! Vue hasn't populated the form yet! @@ -323,13 +324,14 @@ describe("License CRUD operations", () => { "get-license" ); cy.visit("/cgi-bin/koha/erm/licenses"); - let name_link = cy.get( - "#licenses_list table tbody tr:first td:first a" - ); - name_link.should( - "have.text", - license.name + " (#" + license.license_id + ")" - ); + let id_cell = cy.get("#licenses_list table tbody tr:first td:first"); + id_cell.contains(license.license_id); + + let name_link = cy + .get("#licenses_list table tbody tr:first td") + .eq(1) + .find("a"); + name_link.should("have.text", license.name); name_link.click(); cy.wait("@get-license"); cy.wait(500); // Cypress is too fast! Vue hasn't populated the form yet!