diff --git a/cypress/integration/realm_roles_test.spec.ts b/cypress/integration/realm_roles_test.spec.ts index 115915aad1..f6fba46d4d 100644 --- a/cypress/integration/realm_roles_test.spec.ts +++ b/cypress/integration/realm_roles_test.spec.ts @@ -37,7 +37,7 @@ describe("Realm roles test", function () { ); }); - /*it("Realm role CRUD test", function () { + it("Realm role CRUD test", function () { itemId += "_" + (Math.random() + 1).toString(36).substring(7); // Create @@ -51,19 +51,17 @@ describe("Realm roles test", function () { listingPage.searchItem(itemId).itemExist(itemId); - cy.wait(100); + const fetchUrl = "/auth/admin/realms/master/roles?first=0&max=11"; + cy.intercept(fetchUrl).as("fetch"); - // Delete listingPage.deleteItem(itemId); - cy.wait(500); - + cy.wait(["@fetch"]); modalUtils.checkModalTitle("Delete role?").confirmModal(); - masthead.checkNotificationMessage("The role has been deleted"); listingPage.itemExist(itemId, false); - });*/ + }); it("Associated roles test", function () { itemId += "_" + (Math.random() + 1).toString(36).substring(7); diff --git a/cypress/integration/realm_settings_test.spec.ts b/cypress/integration/realm_settings_test.spec.ts index ac90a624d7..24d0656aac 100644 --- a/cypress/integration/realm_settings_test.spec.ts +++ b/cypress/integration/realm_settings_test.spec.ts @@ -72,9 +72,6 @@ describe("Realm settings", () => { }; const deleteProvider = (providerName: string) => { - const keysUrl = `/auth/admin/realms/${realmName}/keys`; - cy.intercept(keysUrl).as("keysFetch"); - cy.getId("provider-name-link") .contains(providerName) .parent() @@ -82,12 +79,12 @@ describe("Realm settings", () => { .click() .getId(realmSettingsPage.deleteAction) .click(); - cy.wait(500).getId(realmSettingsPage.modalConfirm).click(); + cy.getId(realmSettingsPage.modalConfirm).click(); return this; }; - const addBundle = () => { + /*const addBundle = () => { const localizationUrl = `/auth/admin/realms/${realmName}/localization/en`; cy.intercept(localizationUrl).as("localizationFetch"); @@ -99,7 +96,7 @@ describe("Realm settings", () => { cy.wait(["@localizationFetch"]); return this; - }; + };*/ it("Go to general tab", function () { sidebarPage.goToRealmSettings(); @@ -245,9 +242,10 @@ describe("Realm settings", () => { it("delete providers", () => { sidebarPage.goToRealmSettings(); cy.getId("rs-keys-tab").click(); - cy.getId("rs-providers-tab").click(); + cy.get(".pf-c-spinner__tail-ball").should("not.exist"); + deleteProvider("test_aes-generated"); deleteProvider("test_ecdsa-generated"); deleteProvider("test_hmac-generated"); diff --git a/cypress/support/pages/admin_console/manage/realm_roles/AssociatedRolesPage.ts b/cypress/support/pages/admin_console/manage/realm_roles/AssociatedRolesPage.ts index 22e2cf90a8..333bba3f22 100644 --- a/cypress/support/pages/admin_console/manage/realm_roles/AssociatedRolesPage.ts +++ b/cypress/support/pages/admin_console/manage/realm_roles/AssociatedRolesPage.ts @@ -25,10 +25,12 @@ export default class AssociatedRolesPage { addAssociatedRealmRole() { cy.get(this.actionDropdown).last().click(); + const load = "/auth/admin/realms/master/clients"; + cy.intercept(load).as("load"); + cy.get(this.addRolesDropdownItem).click(); - cy.wait(100); - + cy.wait(["@load"]); cy.get(this.checkbox).eq(2).check(); cy.get(this.addAssociatedRolesModalButton).contains("Add").click(); @@ -37,7 +39,7 @@ export default class AssociatedRolesPage { cy.get(this.compositeRoleBadge).should("contain.text", "Composite"); - cy.wait(2500); + cy.wait(["@load"]); return this; } @@ -45,19 +47,17 @@ export default class AssociatedRolesPage { addAssociatedClientRole() { cy.get(this.addRoleToolbarButton).click(); - cy.wait(100); - cy.get(this.filterTypeDropdown).click(); cy.get(this.filterTypeDropdownItem).click(); - cy.wait(2500); + cy.get(".pf-c-spinner__tail-ball").should("not.exist"); cy.get(this.checkbox).eq(12).check({ force: true }); cy.get(this.addAssociatedRolesModalButton).contains("Add").click(); - cy.wait(5000); + cy.get(".pf-c-spinner__tail-ball").should("not.exist"); cy.contains("Users in role").click().get(this.usersPage).should("exist"); }