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();
|
2021-09-17 13:23:34 +00:00
|
|
|
cy.findByTestId("rs-realm-events-tab").click();
|
2021-11-11 12:18:50 +00:00
|
|
|
cy.findByTestId("rs-events-tab").click();
|
2021-09-15 09:45:56 +00:00
|
|
|
|
|
|
|
realmSettingsPage
|
|
|
|
.toggleSwitch(realmSettingsPage.enableEvents)
|
2021-11-11 12:18:50 +00:00
|
|
|
.save(realmSettingsPage.modalConfirm);
|
2021-09-15 09:45:56 +00:00
|
|
|
|
|
|
|
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();
|
2021-09-17 13:23:34 +00:00
|
|
|
cy.findByTestId("admin-events-tab").click();
|
2021-09-03 10:50:45 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
it("Check admin events search form fields display", () => {
|
|
|
|
sidebarPage.goToRealmSettings();
|
2021-09-17 13:23:34 +00:00
|
|
|
cy.findByTestId("rs-realm-events-tab").click();
|
|
|
|
cy.findByTestId("rs-admin-events-tab").click();
|
2021-09-03 10:50:45 +00:00
|
|
|
|
|
|
|
realmSettingsPage
|
|
|
|
.toggleSwitch(realmSettingsPage.enableAdminEvents)
|
2021-11-11 12:18:50 +00:00
|
|
|
.save(realmSettingsPage.modalConfirm);
|
2021-09-03 10:50:45 +00:00
|
|
|
|
2021-09-15 09:45:56 +00:00
|
|
|
sidebarPage.goToEvents();
|
2021-09-17 13:23:34 +00:00
|
|
|
cy.findByTestId("admin-events-tab").click();
|
2021-09-15 09:45:56 +00:00
|
|
|
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();
|
2021-09-17 13:23:34 +00:00
|
|
|
cy.findByTestId("admin-events-tab").click();
|
2021-09-03 10:50:45 +00:00
|
|
|
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();
|
2021-09-17 13:23:34 +00:00
|
|
|
cy.findByTestId("admin-events-tab").click();
|
2021-09-07 11:38:36 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
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
|
|
|
});
|