keycloak-scim/cypress/integration/events_test.spec.ts
agagancarczyk 2b45a83109
Event listeners (#1533)
* fixed a breadcrum for edit profile

* edit executor - wip

* edit executor - wip

* edit executor - wip

* edit executor - wip

* edit executor - wip

* edit executor - wip

* edit executor - wip

* edit executor - wip

* edit executor - wip

* edit executor - wip

* edit executor - wip

* edit executor - wip

* executor details - wip

* fixed executors list

* fixed multivaluedList and List components

* fixed displaying default vals for global profile executors, fixed unclicking executors without congigs for global profiles

* added edit executor

* improved edit executor

* added tests for editing executors

* renamed obj

* skipping client policies tests as unstable

* feedback fixes

* fix multiValuedlist defaults - wip

* fixed defaultValues for multiValuedList

* resolved and fixed conflict for test

* added event listeners

* added event listeners

* added success and error mssgs for event listeners saving

* added tests for event listeners

* added tests for event listeners

* improved error mssg

* fixed events tests as LOGIN type no longer available

* uncommented test, but using .skip

Co-authored-by: Agnieszka Gancarczyk <agancarc@redhat.com>
2021-11-11 12:18:50 +00:00

125 lines
3.9 KiB
TypeScript

import LoginPage from "../support/pages/LoginPage";
import SidebarPage from "../support/pages/admin_console/SidebarPage";
import UserEventsTab from "../support/pages/admin_console/manage/events/UserEventsTab";
import AdminEventsTab from "../support/pages/admin_console/manage/events/AdminEventsTab";
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();
const userEventsTab = new UserEventsTab();
const adminEventsTab = new AdminEventsTab();
const realmSettingsPage = new RealmSettingsPage();
const masthead = new Masthead();
describe("Events tests", () => {
describe("Search user events", () => {
beforeEach(() => {
keycloakBefore();
loginPage.logIn();
sidebarPage.goToEvents();
});
it("Check search dropdown display", () => {
sidebarPage.goToRealmSettings();
cy.findByTestId("rs-realm-events-tab").click();
cy.findByTestId("rs-events-tab").click();
realmSettingsPage
.toggleSwitch(realmSettingsPage.enableEvents)
.save(realmSettingsPage.modalConfirm);
masthead.signOut();
loginPage.logIn();
sidebarPage.goToEvents();
userEventsTab.shouldDisplay();
});
it("Check user events search form fields display", () => {
userEventsTab.shouldHaveFormFields();
});
it("Check event type dropdown options exist", () => {
userEventsTab.shouldHaveEventTypeOptions();
});
it("Check `search events` button disabled by default", () => {
userEventsTab.shouldHaveSearchBtnDisabled();
});
it("Check user events search and removal work", () => {
userEventsTab.shouldDoSearchAndRemoveChips();
});
it("Check for no events logged", () => {
userEventsTab.shouldDoNoResultsSearch();
});
it("Check `search events` button enabled", () => {
userEventsTab.shouldHaveSearchBtnEnabled();
});
});
describe("Search admin events", () => {
beforeEach(() => {
keycloakBefore();
loginPage.logIn();
sidebarPage.goToEvents();
cy.findByTestId("admin-events-tab").click();
});
it("Check admin events search form fields display", () => {
sidebarPage.goToRealmSettings();
cy.findByTestId("rs-realm-events-tab").click();
cy.findByTestId("rs-admin-events-tab").click();
realmSettingsPage
.toggleSwitch(realmSettingsPage.enableAdminEvents)
.save(realmSettingsPage.modalConfirm);
sidebarPage.goToEvents();
cy.findByTestId("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", () => {
sidebarPage.goToEvents();
cy.findByTestId("admin-events-tab").click();
adminEventsTab.shouldDoAdminEventsSearchAndRemoveChips();
});
it("Check for no events logged", () => {
adminEventsTab.shouldDoNoResultsSearch();
});
it("Check `search admin events` button enabled", () => {
adminEventsTab.shouldHaveSearchBtnEnabled();
});
});
describe("Check more button opens auth and representation dialogs", () => {
beforeEach(() => {
keycloakBefore();
loginPage.logIn();
sidebarPage.goToEvents();
cy.findByTestId("admin-events-tab").click();
});
it("Check auth dialog opens and is not empty", () => {
adminEventsTab.shouldCheckAuthDialogOpensAndIsNotEmpty();
});
it("Check representation dialog opens and is not empty", () => {
sidebarPage.waitForPageLoad();
adminEventsTab.shouldCheckRepDialogOpensAndIsNotEmpty();
});
});
});