added wait to make tests pass regularly (#24576)

Co-authored-by: Agnieszka Gancarczyk <agancarc@redhat.com>
This commit is contained in:
agagancarczyk 2023-11-06 14:53:21 +00:00 committed by GitHub
parent 7ca00975d4
commit 0076f357f9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 0 deletions

View file

@ -37,6 +37,7 @@ describe("User profile disabled", () => {
afterEach(() => { afterEach(() => {
sidebarPage.goToRealmSettings(); sidebarPage.goToRealmSettings();
realmSettingsPage.goToLoginTab(); realmSettingsPage.goToLoginTab();
cy.wait(1000);
cy.findByTestId("email-as-username-switch").uncheck({ force: true }); cy.findByTestId("email-as-username-switch").uncheck({ force: true });
cy.findByTestId("edit-username-switch").uncheck({ force: true }); cy.findByTestId("edit-username-switch").uncheck({ force: true });
}); });

View file

@ -50,6 +50,7 @@ describe("User profile tabs", () => {
sidebarPage.goToRealmSettings(); sidebarPage.goToRealmSettings();
sidebarPage.waitForPageLoad(); sidebarPage.waitForPageLoad();
realmSettingsPage.goToLoginTab(); realmSettingsPage.goToLoginTab();
cy.wait(1000);
cy.findByTestId("email-as-username-switch").uncheck({ force: true }); cy.findByTestId("email-as-username-switch").uncheck({ force: true });
cy.findByTestId("edit-username-switch").uncheck({ force: true }); cy.findByTestId("edit-username-switch").uncheck({ force: true });
}); });
@ -164,6 +165,7 @@ describe("User profile tabs", () => {
); );
sidebarPage.goToRealmSettings(); sidebarPage.goToRealmSettings();
realmSettingsPage.goToLoginTab(); realmSettingsPage.goToLoginTab();
cy.wait(1000);
cy.findByTestId("email-as-username-switch").should("have.value", "off"); cy.findByTestId("email-as-username-switch").should("have.value", "off");
cy.findByTestId("edit-username-switch").should("have.value", "off"); cy.findByTestId("edit-username-switch").should("have.value", "off");
// Create user // Create user
@ -197,6 +199,7 @@ describe("User profile tabs", () => {
); );
sidebarPage.goToRealmSettings(); sidebarPage.goToRealmSettings();
realmSettingsPage.goToLoginTab(); realmSettingsPage.goToLoginTab();
cy.wait(1000);
cy.findByTestId("email-as-username-switch").check({ force: true }); cy.findByTestId("email-as-username-switch").check({ force: true });
cy.findByTestId("email-as-username-switch").should("have.value", "on"); cy.findByTestId("email-as-username-switch").should("have.value", "on");
cy.findByTestId("edit-username-switch").should("have.value", "off"); cy.findByTestId("edit-username-switch").should("have.value", "off");
@ -239,6 +242,7 @@ describe("User profile tabs", () => {
); );
sidebarPage.goToRealmSettings(); sidebarPage.goToRealmSettings();
realmSettingsPage.goToLoginTab(); realmSettingsPage.goToLoginTab();
cy.wait(1000);
cy.findByTestId("email-as-username-switch").should("have.value", "off"); cy.findByTestId("email-as-username-switch").should("have.value", "off");
cy.findByTestId("edit-username-switch").should("have.value", "off"); cy.findByTestId("edit-username-switch").should("have.value", "off");
// Create user // Create user