6e8ec947b5
* admin events: wip * admin events: wip * admin events: wip * admin events: finalised admin search * admin events: fixed user event search test * admin events: added cypress tests * admin events: added cypress tests * admin events: added cypress tests for admin events search * admin events: added auth prefix on the params * admin events: improved search tests * admin events: attempted fixing search tests * admin events: fixed cypress events search tests * admin events: fixed user events search test * admin events: fixed user and admin events search test * admin events: fixed admin events search test Co-authored-by: Agnieszka Gancarczyk <agancarc@redhat.com>
66 lines
2.6 KiB
TypeScript
66 lines
2.6 KiB
TypeScript
export default class AdminEventsTab {
|
|
searchAdminEventDrpDwn = ".pf-c-dropdown__toggle";
|
|
searchAdminEventDrpDwnBtn = "adminEventsSearchSelectorToggle";
|
|
searchForm = ".pf-c-dropdown__menu";
|
|
resourceTypesDrpDwnFld = "resource-types-searchField";
|
|
operationTypesDrpDwnFld = "operation-types-searchField";
|
|
resourcePathInputFld = "resourcePath-searchField";
|
|
userInputFld = "user-searchField";
|
|
realmInputFld = "realm-searchField";
|
|
ipAddressInputFld = "ipAddress-searchField";
|
|
dateFromInputFld = "dateFrom-searchField";
|
|
dateToInputFld = "dateTo-searchField";
|
|
searchEventsBtn = "search-events-btn";
|
|
|
|
operationTypesList = ".pf-c-form-control";
|
|
operationTypesOption = ".pf-c-select__menu-item";
|
|
operationTypesInputFld = ".pf-c-form-control.pf-c-select__toggle-typeahead";
|
|
operationTypesBtn = ".pf-c-button.pf-c-select__toggle-button.pf-m-plain";
|
|
adminEventsTabTitle = ".pf-c-title";
|
|
|
|
shouldHaveFormFields() {
|
|
cy.getId(this.searchAdminEventDrpDwnBtn).click();
|
|
cy.get(this.searchForm).contains("Resource types");
|
|
cy.get(this.searchForm).contains("Operation types");
|
|
cy.get(this.searchForm).contains("Resource path");
|
|
cy.get(this.searchForm).contains("User");
|
|
cy.get(this.searchForm).contains("Realm");
|
|
cy.get(this.searchForm).contains("IP address");
|
|
cy.get(this.searchForm).contains("Date(from)");
|
|
cy.get(this.searchForm).contains("Date(to)");
|
|
cy.get(this.searchForm).contains("Search admin events");
|
|
}
|
|
|
|
shouldHaveSearchBtnDisabled() {
|
|
cy.getId(this.searchAdminEventDrpDwnBtn).click();
|
|
cy.getId(this.searchEventsBtn).should("have.attr", "disabled");
|
|
}
|
|
|
|
shouldDoAdminEventsSearchAndRemoveChips() {
|
|
cy.getId(this.searchAdminEventDrpDwnBtn).click();
|
|
cy.getId(this.resourcePathInputFld).type("events/config");
|
|
|
|
cy.intercept("/auth/admin/realms/master/admin-events*").as("eventsFetch");
|
|
cy.getId(this.searchEventsBtn).click();
|
|
cy.wait("@eventsFetch");
|
|
|
|
cy.get("table").contains("td", "events/config").should("be.visible");
|
|
|
|
cy.get("[id^=remove_group]").click();
|
|
cy.wait("@eventsFetch");
|
|
cy.get("table").should("be.visible").contains("td", "UPDATE");
|
|
}
|
|
|
|
shouldHaveSearchBtnEnabled() {
|
|
cy.getId(this.searchAdminEventDrpDwnBtn).click();
|
|
cy.getId(this.ipAddressInputFld).type("11111");
|
|
cy.getId(this.searchEventsBtn).should("not.have.attr", "disabled");
|
|
}
|
|
|
|
shouldDoNoResultsSearch() {
|
|
cy.getId(this.searchAdminEventDrpDwnBtn).click();
|
|
cy.getId(this.resourcePathInputFld).type("events/test");
|
|
cy.getId(this.searchEventsBtn).click();
|
|
cy.get(this.adminEventsTabTitle).contains("No events logged");
|
|
}
|
|
}
|