Wait for network requests to finish in events test (#3767)

This commit is contained in:
Jon Koops 2022-11-14 19:37:00 +01:00 committed by GitHub
parent ba3f1accd0
commit f1828b0b45
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 2 deletions

View file

@ -277,8 +277,6 @@ describe("Events tests", () => {
.save() .save()
.clearAdminEvents(); .clearAdminEvents();
cy.wait(5000);
sidebarPage.goToEvents(); sidebarPage.goToEvents();
eventsPage.goToAdminEventsTab(); eventsPage.goToAdminEventsTab();
adminEventsTab.assertNoSearchResultsExist(true); adminEventsTab.assertNoSearchResultsExist(true);

View file

@ -13,7 +13,9 @@ export default class AdminEventsSettingsTab extends PageObject {
clearAdminEvents() { clearAdminEvents() {
cy.get(this.clearAdminEventsBtn).click(); cy.get(this.clearAdminEventsBtn).click();
modal.checkModalTitle("Clear events"); modal.checkModalTitle("Clear events");
cy.intercept("/admin/realms/master/admin-events").as("clearEvents");
modal.confirmModal(); modal.confirmModal();
cy.wait("@clearEvents");
masthead.checkNotificationMessage("The admin events have been cleared"); masthead.checkNotificationMessage("The admin events have been cleared");
return this; return this;
} }
@ -35,7 +37,9 @@ export default class AdminEventsSettingsTab extends PageObject {
} }
save() { save() {
cy.intercept("/admin/realms/master").as("saveRealm");
cy.get(this.saveBtn).click(); cy.get(this.saveBtn).click();
cy.wait("@saveRealm");
return this; return this;
} }
} }