diff --git a/tests/cypress/integration/step_definitions/common/the_url_for_link_with_text_should_contain.js b/tests/cypress/integration/step_definitions/common/the_url_for_link_with_text_should_contain.js index 00c81eb69b..39a8a3bf48 100644 --- a/tests/cypress/integration/step_definitions/common/the_url_for_link_with_text_should_contain.js +++ b/tests/cypress/integration/step_definitions/common/the_url_for_link_with_text_should_contain.js @@ -3,8 +3,6 @@ import { Then } from "@badeball/cypress-cucumber-preprocessor"; Then( `the URL for the link with text {string} should contain {string}`, (linkText, urlText) => { - cy.get(`a:contains("${linkText}")`) - .should("have.attr", "href") - .and("include", urlText); + cy.get(`a[href*="${urlText}"]:contains("${linkText}")`).should("exist"); } );