2021-08-20 09:13:47 +00:00
|
|
|
import LoginPage from "../support/pages/LoginPage";
|
|
|
|
import SidebarPage from "../support/pages/admin_console/SidebarPage";
|
2021-09-03 10:50:45 +00:00
|
|
|
import UserEventsTab from "../support/pages/admin_console/manage/events/UserEventsTab";
|
|
|
|
import AdminEventsTab from "../support/pages/admin_console/manage/events/AdminEventsTab";
|
2021-08-20 09:13:47 +00:00
|
|
|
import RealmSettingsPage from "../support/pages/admin_console/manage/realm_settings/RealmSettingsPage";
|
|
|
|
import Masthead from "../support/pages/admin_console/Masthead";
|
|
|
|
import { keycloakBefore } from "../support/util/keycloak_before";
|
|
|
|
|
|
|
|
const loginPage = new LoginPage();
|
|
|
|
const sidebarPage = new SidebarPage();
|
2021-09-03 10:50:45 +00:00
|
|
|
const userEventsTab = new UserEventsTab();
|
|
|
|
const adminEventsTab = new AdminEventsTab();
|
2021-08-20 09:13:47 +00:00
|
|
|
const realmSettingsPage = new RealmSettingsPage();
|
|
|
|
const masthead = new Masthead();
|
|
|
|
|
2021-09-15 09:45:56 +00:00
|
|
|
describe("Events tests", () => {
|
|
|
|
describe("Search user events", () => {
|
|
|
|
beforeEach(() => {
|
2021-08-20 09:13:47 +00:00
|
|
|
keycloakBefore();
|
|
|
|
loginPage.logIn();
|
|
|
|
sidebarPage.goToEvents();
|
|
|
|
});
|
|
|
|
|
|
|
|
it("Check search dropdown display", () => {
|
2021-09-15 09:45:56 +00:00
|
|
|
sidebarPage.goToRealmSettings();
|
|
|
|
cy.getId("rs-realm-events-tab").click();
|
|
|
|
|
|
|
|
realmSettingsPage
|
|
|
|
.toggleSwitch(realmSettingsPage.enableEvents)
|
|
|
|
.save(realmSettingsPage.eventsUserSave);
|
|
|
|
|
|
|
|
masthead.signOut();
|
|
|
|
loginPage.logIn();
|
|
|
|
|
|
|
|
sidebarPage.goToEvents();
|
|
|
|
|
2021-09-03 10:50:45 +00:00
|
|
|
userEventsTab.shouldDisplay();
|
2021-08-20 09:13:47 +00:00
|
|
|
});
|
|
|
|
|
2021-09-03 10:50:45 +00:00
|
|
|
it("Check user events search form fields display", () => {
|
|
|
|
userEventsTab.shouldHaveFormFields();
|
2021-08-20 09:13:47 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
it("Check event type dropdown options exist", () => {
|
2021-09-03 10:50:45 +00:00
|
|
|
userEventsTab.shouldHaveEventTypeOptions();
|
2021-08-20 09:13:47 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
it("Check `search events` button disabled by default", () => {
|
2021-09-03 10:50:45 +00:00
|
|
|
userEventsTab.shouldHaveSearchBtnDisabled();
|
2021-08-20 09:13:47 +00:00
|
|
|
});
|
|
|
|
|
2021-09-03 10:50:45 +00:00
|
|
|
it("Check user events search and removal work", () => {
|
|
|
|
userEventsTab.shouldDoSearchAndRemoveChips();
|
|
|
|
});
|
|
|
|
|
|
|
|
it("Check for no events logged", () => {
|
|
|
|
userEventsTab.shouldDoNoResultsSearch();
|
2021-08-20 09:13:47 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
it("Check `search events` button enabled", () => {
|
2021-09-03 10:50:45 +00:00
|
|
|
userEventsTab.shouldHaveSearchBtnEnabled();
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
2021-09-15 09:45:56 +00:00
|
|
|
describe("Search admin events", () => {
|
|
|
|
beforeEach(() => {
|
2021-09-03 10:50:45 +00:00
|
|
|
keycloakBefore();
|
|
|
|
loginPage.logIn();
|
|
|
|
sidebarPage.goToEvents();
|
|
|
|
cy.getId("admin-events-tab").click();
|
|
|
|
});
|
|
|
|
|
|
|
|
it("Check admin events search form fields display", () => {
|
|
|
|
sidebarPage.goToRealmSettings();
|
|
|
|
cy.getId("rs-realm-events-tab").click();
|
|
|
|
cy.getId("rs-admin-events-tab").click();
|
|
|
|
|
|
|
|
realmSettingsPage
|
|
|
|
.toggleSwitch(realmSettingsPage.enableAdminEvents)
|
|
|
|
.save(realmSettingsPage.eventsAdminSave);
|
|
|
|
|
2021-09-15 09:45:56 +00:00
|
|
|
sidebarPage.goToEvents();
|
|
|
|
cy.getId("admin-events-tab").click();
|
|
|
|
sidebarPage.waitForPageLoad();
|
|
|
|
adminEventsTab.shouldHaveFormFields();
|
|
|
|
});
|
|
|
|
|
|
|
|
it("Check `search admin events` button disabled by default", () => {
|
|
|
|
adminEventsTab.shouldHaveSearchBtnDisabled();
|
|
|
|
});
|
|
|
|
|
|
|
|
it("Check admin events search and removal work", () => {
|
2021-09-03 10:50:45 +00:00
|
|
|
sidebarPage.goToEvents();
|
|
|
|
cy.getId("admin-events-tab").click();
|
|
|
|
adminEventsTab.shouldDoAdminEventsSearchAndRemoveChips();
|
|
|
|
});
|
|
|
|
|
|
|
|
it("Check for no events logged", () => {
|
|
|
|
adminEventsTab.shouldDoNoResultsSearch();
|
|
|
|
});
|
|
|
|
|
|
|
|
it("Check `search admin events` button enabled", () => {
|
|
|
|
adminEventsTab.shouldHaveSearchBtnEnabled();
|
2021-08-20 09:13:47 +00:00
|
|
|
});
|
|
|
|
});
|
2021-09-07 11:38:36 +00:00
|
|
|
|
2021-09-15 09:45:56 +00:00
|
|
|
describe("Check more button opens auth and representation dialogs", () => {
|
|
|
|
beforeEach(() => {
|
2021-09-07 11:38:36 +00:00
|
|
|
keycloakBefore();
|
|
|
|
loginPage.logIn();
|
|
|
|
sidebarPage.goToEvents();
|
|
|
|
cy.getId("admin-events-tab").click();
|
|
|
|
});
|
|
|
|
|
|
|
|
it("Check auth dialog opens and is not empty", () => {
|
|
|
|
adminEventsTab.shouldCheckAuthDialogOpensAndIsNotEmpty();
|
|
|
|
});
|
|
|
|
|
|
|
|
it("Check representation dialog opens and is not empty", () => {
|
2021-09-15 09:45:56 +00:00
|
|
|
sidebarPage.waitForPageLoad();
|
2021-09-07 11:38:36 +00:00
|
|
|
adminEventsTab.shouldCheckRepDialogOpensAndIsNotEmpty();
|
|
|
|
});
|
|
|
|
});
|
2021-08-20 09:13:47 +00:00
|
|
|
});
|