try and fix group tests again (#619)

This commit is contained in:
Erik Jan de Wit 2021-05-20 17:38:10 +02:00 committed by GitHub
parent 586375b5f4
commit 0b56f6b1ed
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 11 additions and 2 deletions

View file

@ -23,8 +23,8 @@ describe("Group test", () => {
let groupName = "group"; let groupName = "group";
const clickGroup = (itemName: string) => { const clickGroup = (itemName: string) => {
const membersUrl = `/auth/admin/realms/master/groups/*/members`; const groupUrl = "/auth/admin/realms/master/groups/*/members*";
cy.intercept(membersUrl).as("groupFetch"); cy.intercept(groupUrl).as("groupFetch");
cy.get("table").contains(itemName).click(); cy.get("table").contains(itemName).click();
cy.wait(["@groupFetch"]); cy.wait(["@groupFetch"]);
@ -88,8 +88,10 @@ describe("Group test", () => {
moveGroupModal.clickMove(); moveGroupModal.clickMove();
masthead.checkNotificationMessage("Group moved"); masthead.checkNotificationMessage("Group moved");
cy.get(".pf-c-spinner__tail-ball").should("not.exist");
listingPage.itemExist(groupName, false); listingPage.itemExist(groupName, false);
clickGroup(targetGroupName); clickGroup(targetGroupName);
cy.get(".pf-c-spinner__tail-ball").should("not.exist");
listingPage.itemExist(groupName); listingPage.itemExist(groupName);
sidebarPage.goToGroups(); sidebarPage.goToGroups();
listingPage.deleteItem(targetGroupName); listingPage.deleteItem(targetGroupName);

View file

@ -15,7 +15,12 @@ export default class GroupModal {
} }
clickCreate() { clickCreate() {
cy.intercept("/auth/admin/realms/master/groups/*/members").as(
"groupCreate"
);
cy.getId(this.createButton).click(); cy.getId(this.createButton).click();
cy.wait(["@groupCreate"]);
return this; return this;
} }

View file

@ -18,7 +18,9 @@ export default class MoveGroupModal {
} }
clickMove() { clickMove() {
cy.intercept("/auth/admin/realms/master/groups/*/members").as("groupMove");
cy.getId(this.moveButton).click(); cy.getId(this.moveButton).click();
cy.wait(["@groupMove"]);
return this; return this;
} }
} }