Sessions testing (#3285)
This commit is contained in:
parent
a85cba6118
commit
65633c903a
2 changed files with 63 additions and 14 deletions
|
@ -1,38 +1,80 @@
|
|||
import LoginPage from "../support/pages/LoginPage";
|
||||
import SidebarPage from "../support/pages/admin_console/SidebarPage";
|
||||
import SessionsPage from "../support/pages/admin_console/manage/sessions/SessionsPage";
|
||||
import CommonPage from "../support/pages/CommonPage";
|
||||
import ListingPage from "../support/pages/admin_console/ListingPage";
|
||||
import GroupPage from "../support/pages/admin_console/manage/groups/GroupPage";
|
||||
import { keycloakBefore } from "../support/util/keycloak_hooks";
|
||||
|
||||
const loginPage = new LoginPage();
|
||||
const sidebarPage = new SidebarPage();
|
||||
const sessionsPage = new SessionsPage();
|
||||
const commonPage = new CommonPage();
|
||||
const listingPage = new ListingPage();
|
||||
const groupPage = new GroupPage();
|
||||
|
||||
describe("Sessions test", () => {
|
||||
const admin = "admin";
|
||||
const client = "security-admin-console";
|
||||
beforeEach(() => {
|
||||
keycloakBefore();
|
||||
loginPage.logIn();
|
||||
sidebarPage.goToSessions();
|
||||
});
|
||||
|
||||
it("Set revocation notBefore", () => {
|
||||
sessionsPage.setToNow();
|
||||
describe("Sessions list view", () => {
|
||||
it("check item values", () => {
|
||||
commonPage
|
||||
.tableUtils()
|
||||
.checkRowItemExists(admin)
|
||||
.checkRowItemExists(client);
|
||||
});
|
||||
|
||||
it("go to item accessed clients link", () => {
|
||||
commonPage.tableUtils().clickRowItemLink(client);
|
||||
});
|
||||
});
|
||||
|
||||
it("Check if notBefore saved", () => {
|
||||
sessionsPage.checkNotBeforeValueExists();
|
||||
describe("Search", () => {
|
||||
it("search existing session", () => {
|
||||
listingPage.searchItem(admin, false);
|
||||
listingPage.itemExist(admin, true);
|
||||
groupPage.assertNoSearchResultsMessageExist(false);
|
||||
});
|
||||
|
||||
it("search non-existant session", () => {
|
||||
listingPage.searchItem("non-existant-session", false);
|
||||
groupPage.assertNoSearchResultsMessageExist(true);
|
||||
});
|
||||
});
|
||||
|
||||
it("Clear revocation notBefore", () => {
|
||||
sessionsPage.clearNotBefore();
|
||||
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();
|
||||
commonPage.masthead().checkNotificationMessage("No push sent");
|
||||
});
|
||||
});
|
||||
|
||||
it("Check if notBefore cleared", () => {
|
||||
sessionsPage.checkNotBeforeCleared();
|
||||
});
|
||||
|
||||
it("logout all sessions", () => {
|
||||
sessionsPage.logoutAllSessions();
|
||||
|
||||
cy.get("#kc-page-title").contains("Sign in to your account");
|
||||
describe("logout all sessions", () => {
|
||||
it("logout all sessions", () => {
|
||||
sessionsPage.logoutAllSessions();
|
||||
cy.get("#kc-page-title").contains("Sign in to your account");
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
|
@ -10,6 +10,7 @@ export default class SessionsPage {
|
|||
setToNowButton = "set-to-now-button";
|
||||
actionDropdown = "action-dropdown";
|
||||
clearNotBeforeButton = "clear-not-before-button";
|
||||
pushButton = "modal-test-connection-button";
|
||||
notBeforeInput = "not-before-input";
|
||||
logoutAll = "logout-all";
|
||||
logoutAllConfirm = "confirm";
|
||||
|
@ -43,4 +44,10 @@ export default class SessionsPage {
|
|||
cy.findByTestId(this.logoutAll).should("exist").click();
|
||||
cy.findByTestId(this.logoutAllConfirm).should("exist").click();
|
||||
}
|
||||
|
||||
pushRevocation() {
|
||||
cy.findByTestId(this.actionDropdown).should("exist").click();
|
||||
cy.findByTestId(this.revocationActionItem).should("exist").click();
|
||||
cy.findByTestId(this.pushButton).should("exist").click();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue