From 0076f357f915ebc252360a5d3e9ea0a624b5514c Mon Sep 17 00:00:00 2001 From: agagancarczyk <4890675+agagancarczyk@users.noreply.github.com> Date: Mon, 6 Nov 2023 14:53:21 +0000 Subject: [PATCH] added wait to make tests pass regularly (#24576) Co-authored-by: Agnieszka Gancarczyk --- .../cypress/e2e/realm_settings_user_profile_disabled.spec.ts | 1 + .../cypress/e2e/realm_settings_user_profile_enabled.spec.ts | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/js/apps/admin-ui/cypress/e2e/realm_settings_user_profile_disabled.spec.ts b/js/apps/admin-ui/cypress/e2e/realm_settings_user_profile_disabled.spec.ts index e209e1f0aa..27d1f0482e 100644 --- a/js/apps/admin-ui/cypress/e2e/realm_settings_user_profile_disabled.spec.ts +++ b/js/apps/admin-ui/cypress/e2e/realm_settings_user_profile_disabled.spec.ts @@ -37,6 +37,7 @@ describe("User profile disabled", () => { afterEach(() => { sidebarPage.goToRealmSettings(); realmSettingsPage.goToLoginTab(); + cy.wait(1000); cy.findByTestId("email-as-username-switch").uncheck({ force: true }); cy.findByTestId("edit-username-switch").uncheck({ force: true }); }); diff --git a/js/apps/admin-ui/cypress/e2e/realm_settings_user_profile_enabled.spec.ts b/js/apps/admin-ui/cypress/e2e/realm_settings_user_profile_enabled.spec.ts index 8db687cd3e..7017751cf7 100644 --- a/js/apps/admin-ui/cypress/e2e/realm_settings_user_profile_enabled.spec.ts +++ b/js/apps/admin-ui/cypress/e2e/realm_settings_user_profile_enabled.spec.ts @@ -50,6 +50,7 @@ describe("User profile tabs", () => { sidebarPage.goToRealmSettings(); sidebarPage.waitForPageLoad(); realmSettingsPage.goToLoginTab(); + cy.wait(1000); cy.findByTestId("email-as-username-switch").uncheck({ force: true }); cy.findByTestId("edit-username-switch").uncheck({ force: true }); }); @@ -164,6 +165,7 @@ describe("User profile tabs", () => { ); sidebarPage.goToRealmSettings(); realmSettingsPage.goToLoginTab(); + cy.wait(1000); cy.findByTestId("email-as-username-switch").should("have.value", "off"); cy.findByTestId("edit-username-switch").should("have.value", "off"); // Create user @@ -197,6 +199,7 @@ describe("User profile tabs", () => { ); sidebarPage.goToRealmSettings(); realmSettingsPage.goToLoginTab(); + cy.wait(1000); cy.findByTestId("email-as-username-switch").check({ force: true }); cy.findByTestId("email-as-username-switch").should("have.value", "on"); cy.findByTestId("edit-username-switch").should("have.value", "off"); @@ -239,6 +242,7 @@ describe("User profile tabs", () => { ); sidebarPage.goToRealmSettings(); realmSettingsPage.goToLoginTab(); + cy.wait(1000); cy.findByTestId("email-as-username-switch").should("have.value", "off"); cy.findByTestId("edit-username-switch").should("have.value", "off"); // Create user