Merge pull request #644 from edewit/cypress-client-scope
makes client scope test more reliable
This commit is contained in:
commit
1e2de8d570
3 changed files with 21 additions and 25 deletions
|
@ -50,6 +50,7 @@ describe("Client Scopes test", function () {
|
|||
masthead.checkNotificationMessage("Client scope created");
|
||||
|
||||
sidebarPage.goToClientScopes();
|
||||
cy.get(".pf-c-spinner__tail-ball").should("not.exist");
|
||||
|
||||
// Delete
|
||||
listingPage.itemExist(itemId).deleteItem(itemId);
|
||||
|
@ -59,8 +60,7 @@ describe("Client Scopes test", function () {
|
|||
|
||||
masthead.checkNotificationMessage("The client scope has been deleted");
|
||||
|
||||
listingPage // It is not refreshing after delete
|
||||
.itemExist(itemId, false);
|
||||
listingPage.itemExist(itemId, false);
|
||||
});
|
||||
});
|
||||
|
||||
|
|
|
@ -1,26 +1,15 @@
|
|||
export default class ListingPage {
|
||||
searchInput: string;
|
||||
itemsRows: string;
|
||||
itemRowDrpDwn: string;
|
||||
exportBtn: string;
|
||||
deleteBtn: string;
|
||||
searchBtn: string;
|
||||
createBtn: string;
|
||||
importBtn: string;
|
||||
|
||||
constructor() {
|
||||
this.searchInput = '.pf-c-toolbar__item [type="search"]:visible';
|
||||
this.itemsRows = "table";
|
||||
this.itemRowDrpDwn = ".pf-c-dropdown > button";
|
||||
this.exportBtn = '[role="menuitem"]:nth-child(1)';
|
||||
this.deleteBtn = '[role="menuitem"]:nth-child(2)';
|
||||
this.searchBtn =
|
||||
private searchInput = '.pf-c-toolbar__item [type="search"]:visible';
|
||||
private itemsRows = "table";
|
||||
private itemRowDrpDwn = ".pf-c-dropdown__toggle";
|
||||
public exportBtn = '[role="menuitem"]:nth-child(1)';
|
||||
public deleteBtn = '[role="menuitem"]:nth-child(2)';
|
||||
private searchBtn =
|
||||
".pf-c-page__main .pf-c-toolbar__content-section button.pf-m-control:visible";
|
||||
this.createBtn =
|
||||
private createBtn =
|
||||
".pf-c-page__main .pf-c-toolbar__content-section button.pf-m-primary:visible";
|
||||
this.importBtn =
|
||||
private importBtn =
|
||||
".pf-c-page__main .pf-c-toolbar__content-section button.pf-m-link";
|
||||
}
|
||||
|
||||
goToCreateItem() {
|
||||
cy.get(this.createBtn).click();
|
||||
|
|
|
@ -83,7 +83,14 @@ export const ClientScopesSection = () => {
|
|||
onConfirm: async () => {
|
||||
try {
|
||||
for (const scope of selectedScopes) {
|
||||
try {
|
||||
await removeScope(adminClient, scope);
|
||||
} catch (error) {
|
||||
console.warn(
|
||||
"could not remove scope",
|
||||
error.response?.data?.errorMessage || error
|
||||
);
|
||||
}
|
||||
await adminClient.clientScopes.del({ id: scope.id! });
|
||||
}
|
||||
addAlert(t("deletedSuccess"), AlertVariant.success);
|
||||
|
|
Loading…
Reference in a new issue