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 LoginPage from "../support/pages/LoginPage";
|
||||||
import SidebarPage from "../support/pages/admin_console/SidebarPage";
|
import SidebarPage from "../support/pages/admin_console/SidebarPage";
|
||||||
import SessionsPage from "../support/pages/admin_console/manage/sessions/SessionsPage";
|
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";
|
import { keycloakBefore } from "../support/util/keycloak_hooks";
|
||||||
|
|
||||||
const loginPage = new LoginPage();
|
const loginPage = new LoginPage();
|
||||||
const sidebarPage = new SidebarPage();
|
const sidebarPage = new SidebarPage();
|
||||||
const sessionsPage = new SessionsPage();
|
const sessionsPage = new SessionsPage();
|
||||||
|
const commonPage = new CommonPage();
|
||||||
|
const listingPage = new ListingPage();
|
||||||
|
const groupPage = new GroupPage();
|
||||||
|
|
||||||
describe("Sessions test", () => {
|
describe("Sessions test", () => {
|
||||||
|
const admin = "admin";
|
||||||
|
const client = "security-admin-console";
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
keycloakBefore();
|
keycloakBefore();
|
||||||
loginPage.logIn();
|
loginPage.logIn();
|
||||||
sidebarPage.goToSessions();
|
sidebarPage.goToSessions();
|
||||||
});
|
});
|
||||||
|
|
||||||
it("Set revocation notBefore", () => {
|
describe("Sessions list view", () => {
|
||||||
sessionsPage.setToNow();
|
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", () => {
|
describe("Search", () => {
|
||||||
sessionsPage.checkNotBeforeValueExists();
|
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", () => {
|
describe("revocation", () => {
|
||||||
sessionsPage.clearNotBefore();
|
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", () => {
|
describe("logout all sessions", () => {
|
||||||
sessionsPage.checkNotBeforeCleared();
|
it("logout all sessions", () => {
|
||||||
});
|
sessionsPage.logoutAllSessions();
|
||||||
|
cy.get("#kc-page-title").contains("Sign in to your account");
|
||||||
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";
|
setToNowButton = "set-to-now-button";
|
||||||
actionDropdown = "action-dropdown";
|
actionDropdown = "action-dropdown";
|
||||||
clearNotBeforeButton = "clear-not-before-button";
|
clearNotBeforeButton = "clear-not-before-button";
|
||||||
|
pushButton = "modal-test-connection-button";
|
||||||
notBeforeInput = "not-before-input";
|
notBeforeInput = "not-before-input";
|
||||||
logoutAll = "logout-all";
|
logoutAll = "logout-all";
|
||||||
logoutAllConfirm = "confirm";
|
logoutAllConfirm = "confirm";
|
||||||
|
@ -43,4 +44,10 @@ export default class SessionsPage {
|
||||||
cy.findByTestId(this.logoutAll).should("exist").click();
|
cy.findByTestId(this.logoutAll).should("exist").click();
|
||||||
cy.findByTestId(this.logoutAllConfirm).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