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-07 11:38:36 +00:00
|
|
|
describe("Events tests", function () {
|
2021-09-03 10:50:45 +00:00
|
|
|
describe("Search user events", function () {
|
2021-08-20 09:13:47 +00:00
|
|
|
beforeEach(function () {
|
|
|
|
keycloakBefore();
|
|
|
|
loginPage.logIn();
|
|
|
|
sidebarPage.goToEvents();
|
|
|
|
});
|
|
|
|
|
|
|
|
it("Check search dropdown display", () => {
|
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", () => {
|
2021-08-20 09:13:47 +00:00
|
|
|
sidebarPage.goToRealmSettings();
|
|
|
|
cy.getId("rs-realm-events-tab").click();
|
|
|
|
|
2021-09-03 10:50:45 +00:00
|
|
|
realmSettingsPage
|
|
|
|
.toggleSwitch(realmSettingsPage.enableEvents)
|
|
|
|
.save(realmSettingsPage.eventsUserSave);
|
|
|
|
|
|
|
|
masthead.signOut();
|
|
|
|
loginPage.logIn();
|
|
|
|
|
|
|
|
sidebarPage.goToEvents();
|
|
|
|
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();
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
describe("Search admin events", function () {
|
|
|
|
beforeEach(function () {
|
|
|
|
keycloakBefore();
|
|
|
|
loginPage.logIn();
|
|
|
|
sidebarPage.goToEvents();
|
|
|
|
cy.getId("admin-events-tab").click();
|
|
|
|
});
|
|
|
|
|
|
|
|
it("Check admin events search form fields display", () => {
|
|
|
|
adminEventsTab.shouldHaveFormFields();
|
|
|
|
});
|
|
|
|
|
|
|
|
it("Check `search admin events` button disabled by default", () => {
|
|
|
|
adminEventsTab.shouldHaveSearchBtnDisabled();
|
|
|
|
});
|
|
|
|
|
|
|
|
it("Check admin events search and removal work", () => {
|
|
|
|
sidebarPage.goToRealmSettings();
|
|
|
|
cy.getId("rs-realm-events-tab").click();
|
|
|
|
cy.getId("rs-admin-events-tab").click();
|
|
|
|
|
|
|
|
realmSettingsPage
|
|
|
|
.toggleSwitch(realmSettingsPage.enableAdminEvents)
|
|
|
|
.save(realmSettingsPage.eventsAdminSave);
|
|
|
|
|
|
|
|
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
|
|
|
|
|
|
|
describe("Check more button opens auth and representation dialogs", function () {
|
|
|
|
beforeEach(function () {
|
|
|
|
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", () => {
|
|
|
|
adminEventsTab.shouldCheckRepDialogOpensAndIsNotEmpty();
|
|
|
|
});
|
|
|
|
});
|
2021-08-20 09:13:47 +00:00
|
|
|
});
|