better waits for realm role tests (#897)
* better waits for realm role tests * possible fix for delete
This commit is contained in:
parent
d1d99f7ee0
commit
5dde8ee523
3 changed files with 17 additions and 21 deletions
|
@ -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);
|
||||
|
|
|
@ -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");
|
||||
|
|
|
@ -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");
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue