2021-07-14 10:14:03 +00:00
|
|
|
import LoginPage from "../support/pages/LoginPage";
|
2022-12-07 15:28:28 +00:00
|
|
|
import SidebarPage from "../support/pages/admin-ui/SidebarPage";
|
|
|
|
import SessionsPage from "../support/pages/admin-ui/manage/sessions/SessionsPage";
|
2022-09-12 13:30:12 +00:00
|
|
|
import CommonPage from "../support/pages/CommonPage";
|
2022-12-07 15:28:28 +00:00
|
|
|
import ListingPage from "../support/pages/admin-ui/ListingPage";
|
|
|
|
import GroupPage from "../support/pages/admin-ui/manage/groups/GroupPage";
|
2022-01-07 07:27:58 +00:00
|
|
|
import { keycloakBefore } from "../support/util/keycloak_hooks";
|
2021-07-14 10:14:03 +00:00
|
|
|
|
|
|
|
const loginPage = new LoginPage();
|
|
|
|
const sidebarPage = new SidebarPage();
|
|
|
|
const sessionsPage = new SessionsPage();
|
2022-09-12 13:30:12 +00:00
|
|
|
const commonPage = new CommonPage();
|
|
|
|
const listingPage = new ListingPage();
|
|
|
|
const groupPage = new GroupPage();
|
2021-07-14 10:14:03 +00:00
|
|
|
|
2021-10-04 06:03:19 +00:00
|
|
|
describe("Sessions test", () => {
|
2022-09-12 13:30:12 +00:00
|
|
|
const admin = "admin";
|
|
|
|
const client = "security-admin-console";
|
2022-02-22 13:30:18 +00:00
|
|
|
beforeEach(() => {
|
|
|
|
keycloakBefore();
|
|
|
|
loginPage.logIn();
|
|
|
|
sidebarPage.goToSessions();
|
|
|
|
});
|
2021-08-16 19:25:36 +00:00
|
|
|
|
2022-09-12 13:30:12 +00:00
|
|
|
describe("Sessions list view", () => {
|
|
|
|
it("check item values", () => {
|
2022-10-25 08:57:22 +00:00
|
|
|
listingPage.searchItem(client, false);
|
2022-09-12 13:30:12 +00:00
|
|
|
commonPage
|
|
|
|
.tableUtils()
|
|
|
|
.checkRowItemExists(admin)
|
|
|
|
.checkRowItemExists(client);
|
|
|
|
});
|
2021-08-16 19:25:36 +00:00
|
|
|
|
2022-09-12 13:30:12 +00:00
|
|
|
it("go to item accessed clients link", () => {
|
2022-10-25 08:57:22 +00:00
|
|
|
listingPage.searchItem(client, false);
|
2022-09-12 13:30:12 +00:00
|
|
|
commonPage.tableUtils().clickRowItemLink(client);
|
|
|
|
});
|
2022-02-22 13:30:18 +00:00
|
|
|
});
|
2021-08-16 19:25:36 +00:00
|
|
|
|
2022-09-12 13:30:12 +00:00
|
|
|
describe("Search", () => {
|
|
|
|
it("search existing session", () => {
|
|
|
|
listingPage.searchItem(admin, false);
|
|
|
|
listingPage.itemExist(admin, true);
|
|
|
|
groupPage.assertNoSearchResultsMessageExist(false);
|
|
|
|
});
|
2021-08-16 19:25:36 +00:00
|
|
|
|
2022-09-12 13:30:12 +00:00
|
|
|
it("search non-existant session", () => {
|
|
|
|
listingPage.searchItem("non-existant-session", false);
|
|
|
|
groupPage.assertNoSearchResultsMessageExist(true);
|
|
|
|
});
|
2022-02-22 13:30:18 +00:00
|
|
|
});
|
2021-08-16 19:25:36 +00:00
|
|
|
|
2022-09-12 13:30:12 +00:00
|
|
|
describe("revocation", () => {
|
|
|
|
it("Clear revocation notBefore", () => {
|
|
|
|
sessionsPage.clearNotBefore();
|
|
|
|
});
|
|
|
|
|
|
|
|
it("Check if notBefore cleared", () => {
|
|
|
|
sessionsPage.checkNotBeforeCleared();
|
|
|
|
});
|
|
|
|
|
|
|
|
it("Set revocation notBefore", () => {
|
|
|
|
sessionsPage.setToNow();
|
|
|
|
});
|
|
|
|
|
|
|
|
it("Check if notBefore saved", () => {
|
|
|
|
sessionsPage.checkNotBeforeValueExists();
|
|
|
|
});
|
|
|
|
|
|
|
|
it("Push when URI not configured", () => {
|
|
|
|
sessionsPage.pushRevocation();
|
2022-09-15 10:55:57 +00:00
|
|
|
commonPage
|
|
|
|
.masthead()
|
|
|
|
.checkNotificationMessage(
|
|
|
|
"No push sent. No admin URI configured or no registered cluster nodes available"
|
|
|
|
);
|
2022-09-12 13:30:12 +00:00
|
|
|
});
|
|
|
|
});
|
2021-07-14 10:14:03 +00:00
|
|
|
});
|