added wait for backend request

This commit is contained in:
Erik Jan de Wit 2021-03-02 10:12:40 +01:00
parent 5d5160bddc
commit fbc81395d1
2 changed files with 9 additions and 3 deletions

View file

@ -34,7 +34,7 @@ describe("Group test", () => {
masthead.checkNotificationMessage("Group created");
sidebarPage.goToGroups();
listingPage.searchItem(groupName).itemExist(groupName);
listingPage.searchItem(groupName, false).itemExist(groupName);
// Delete
listingPage.deleteItem(groupName);

View file

@ -34,10 +34,16 @@ export default class ListingPage {
return this;
}
searchItem(searchValue: string) {
searchItem(searchValue: string, wait = true) {
if (wait) {
const searchUrl = `/admin/realms/master/*${searchValue}*`;
cy.intercept(searchUrl).as("searchClients");
}
cy.get(this.searchInput).type(searchValue);
cy.get(this.searchBtn).click();
if (wait) {
cy.wait(["@searchClients"]);
}
return this;
}