diff --git a/e2e-tests/cypress/tests/cypress/e2e/models/Toasts.ts b/e2e-tests/cypress/tests/cypress/e2e/models/Toasts.ts index b2198bc8d..aabd0a45e 100644 --- a/e2e-tests/cypress/tests/cypress/e2e/models/Toasts.ts +++ b/e2e-tests/cypress/tests/cypress/e2e/models/Toasts.ts @@ -2,6 +2,9 @@ export class Toasts { // selectors + toastSlot = ".b-toaster-slot"; + toastTypeSuccess = ".b-toast-success"; + toastTypeError = ".b-toast-danger"; toastTitle = ".gdd-toaster-title"; toastMessage = ".gdd-toaster-body"; } diff --git a/e2e-tests/cypress/tests/cypress/support/step_definitions/common_steps.ts b/e2e-tests/cypress/tests/cypress/support/step_definitions/common_steps.ts index 439974cda..f45358f3c 100644 --- a/e2e-tests/cypress/tests/cypress/support/step_definitions/common_steps.ts +++ b/e2e-tests/cypress/tests/cypress/support/step_definitions/common_steps.ts @@ -25,11 +25,11 @@ Then("the user is logged in with username {string}", (username: string) => { Then("the user cannot login", () => { const toast = new Toasts(); - cy.get(toast.toastTitle).should("contain.text", "Error!"); - cy.get(toast.toastMessage).should( - "contain.text", - "No user with this credentials." - ); + cy.get(toast.toastSlot).within(() => { + cy.get(toast.toastTypeError); + cy.get(toast.toastTitle).should("be.visible"); + cy.get(toast.toastMessage).should("be.visible"); + }); }); // diff --git a/e2e-tests/cypress/tests/cypress/support/step_definitions/user_profile_change_password_steps.ts b/e2e-tests/cypress/tests/cypress/support/step_definitions/user_profile_change_password_steps.ts index cbe851f02..5396b66bb 100644 --- a/e2e-tests/cypress/tests/cypress/support/step_definitions/user_profile_change_password_steps.ts +++ b/e2e-tests/cypress/tests/cypress/support/step_definitions/user_profile_change_password_steps.ts @@ -24,9 +24,9 @@ And("the user submits the password form", () => { When("the user is presented a {string} message", (type: string) => { const toast = new Toasts(); - cy.get(toast.toastTitle).should("contain.text", "Success"); - cy.get(toast.toastMessage).should( - "contain.text", - "Your password has been changed." - ); + cy.get(toast.toastSlot).within(() => { + cy.get(toast.toastTypeSuccess); + cy.get(toast.toastTitle).should("be.visible"); + cy.get(toast.toastMessage).should("be.visible"); + }); });