2021-04-19 11:41:07 +00:00
|
|
|
import SidebarPage from "../support/pages/admin_console/SidebarPage";
|
|
|
|
import LoginPage from "../support/pages/LoginPage";
|
|
|
|
import RealmSettingsPage from "../support/pages/admin_console/manage/realm_settings/RealmSettingsPage";
|
2021-06-08 05:29:56 +00:00
|
|
|
import Masthead from "../support/pages/admin_console/Masthead";
|
|
|
|
import ModalUtils from "../support/util/ModalUtils";
|
2021-04-19 11:41:07 +00:00
|
|
|
import { keycloakBefore } from "../support/util/keycloak_before";
|
2021-05-06 05:31:40 +00:00
|
|
|
import AdminClient from "../support/util/AdminClient";
|
2021-06-08 05:29:56 +00:00
|
|
|
import ListingPage from "../support/pages/admin_console/ListingPage";
|
2021-04-19 11:41:07 +00:00
|
|
|
|
2021-06-03 18:31:47 +00:00
|
|
|
const loginPage = new LoginPage();
|
|
|
|
const sidebarPage = new SidebarPage();
|
2021-06-08 05:29:56 +00:00
|
|
|
const masthead = new Masthead();
|
|
|
|
const modalUtils = new ModalUtils();
|
2021-06-03 18:31:47 +00:00
|
|
|
const realmSettingsPage = new RealmSettingsPage();
|
|
|
|
|
2021-09-24 10:46:01 +00:00
|
|
|
describe("Realm settings tests", () => {
|
|
|
|
describe("Realm settings tabs tests", () => {
|
|
|
|
const realmName = "Realm_" + (Math.random() + 1).toString(36).substring(7);
|
|
|
|
|
|
|
|
beforeEach(() => {
|
|
|
|
keycloakBefore();
|
|
|
|
loginPage.logIn();
|
|
|
|
sidebarPage.goToRealm(realmName);
|
|
|
|
});
|
2021-06-03 18:31:47 +00:00
|
|
|
|
2021-09-24 10:46:01 +00:00
|
|
|
before(async () => {
|
|
|
|
await new AdminClient().createRealm(realmName);
|
|
|
|
});
|
2021-06-03 18:31:47 +00:00
|
|
|
|
2021-09-24 10:46:01 +00:00
|
|
|
after(async () => {
|
|
|
|
await new AdminClient().deleteRealm(realmName);
|
|
|
|
});
|
2021-06-03 18:31:47 +00:00
|
|
|
|
2021-09-24 10:46:01 +00:00
|
|
|
const goToKeys = () => {
|
|
|
|
const keysUrl = `/auth/admin/realms/${realmName}/keys`;
|
|
|
|
cy.intercept(keysUrl).as("keysFetch");
|
|
|
|
cy.findByTestId("rs-keys-tab").click();
|
|
|
|
cy.findByTestId("rs-keys-list-tab").click();
|
|
|
|
cy.wait(["@keysFetch"]);
|
2021-06-08 15:45:37 +00:00
|
|
|
|
2021-09-24 10:46:01 +00:00
|
|
|
return this;
|
|
|
|
};
|
2021-06-08 15:45:37 +00:00
|
|
|
|
2021-09-24 10:46:01 +00:00
|
|
|
const goToDetails = () => {
|
|
|
|
const keysUrl = `/auth/admin/realms/${realmName}/keys`;
|
|
|
|
cy.intercept(keysUrl).as("keysFetch");
|
2021-07-12 18:19:50 +00:00
|
|
|
|
2021-09-24 10:46:01 +00:00
|
|
|
cy.findByTestId("rs-keys-tab").click();
|
|
|
|
cy.findByTestId("rs-providers-tab").click();
|
|
|
|
cy.findAllByTestId("provider-name-link")
|
|
|
|
.contains("test_aes-generated")
|
|
|
|
.click();
|
2021-07-16 08:22:08 +00:00
|
|
|
|
2021-09-24 10:46:01 +00:00
|
|
|
sidebarPage.goToRealmSettings();
|
2021-07-16 08:22:08 +00:00
|
|
|
|
2021-09-24 10:46:01 +00:00
|
|
|
cy.findByTestId("rs-keys-tab").click();
|
|
|
|
cy.findByTestId("rs-providers-tab").click();
|
|
|
|
cy.findAllByTestId("provider-name-link")
|
|
|
|
.contains("test_hmac-generated")
|
|
|
|
.click();
|
2021-07-19 18:35:06 +00:00
|
|
|
|
2021-09-24 10:46:01 +00:00
|
|
|
sidebarPage.goToRealmSettings();
|
2021-07-19 18:35:06 +00:00
|
|
|
|
2021-09-24 10:46:01 +00:00
|
|
|
cy.findByTestId("rs-keys-tab").click();
|
|
|
|
cy.findByTestId("rs-providers-tab").click();
|
|
|
|
cy.findAllByTestId("provider-name-link").contains("test_rsa").click();
|
2021-07-16 08:22:08 +00:00
|
|
|
|
2021-09-24 10:46:01 +00:00
|
|
|
sidebarPage.goToRealmSettings();
|
2021-07-19 15:07:19 +00:00
|
|
|
|
2021-09-24 10:46:01 +00:00
|
|
|
cy.findByTestId("rs-keys-tab").click();
|
|
|
|
cy.findByTestId("rs-providers-tab").click();
|
|
|
|
cy.findAllByTestId("provider-name-link")
|
|
|
|
.contains("test_rsa-generated")
|
|
|
|
.click();
|
2021-07-19 15:07:19 +00:00
|
|
|
|
2021-09-24 10:46:01 +00:00
|
|
|
cy.wait(["@keysFetch"]);
|
2021-07-12 18:19:50 +00:00
|
|
|
|
2021-09-24 10:46:01 +00:00
|
|
|
return this;
|
|
|
|
};
|
2021-07-12 18:19:50 +00:00
|
|
|
|
2021-09-24 10:46:01 +00:00
|
|
|
/*const deleteProvider = (providerName: string) => {
|
2021-07-26 09:21:56 +00:00
|
|
|
const url = `/auth/admin/realms/${realmName}/users/*`;
|
|
|
|
cy.intercept(url).as("reload");
|
2021-09-17 13:23:34 +00:00
|
|
|
cy.findByTestId("provider-name")
|
2021-07-19 13:58:35 +00:00
|
|
|
.contains(providerName)
|
2021-07-26 09:21:56 +00:00
|
|
|
.parentsUntil(".pf-c-data-list__item-row")
|
|
|
|
.find(".pf-c-dropdown__toggle")
|
2021-07-19 13:58:35 +00:00
|
|
|
.click()
|
2021-09-17 13:23:34 +00:00
|
|
|
.findByTestId(realmSettingsPage.deleteAction)
|
2021-07-19 13:58:35 +00:00
|
|
|
.click();
|
2021-09-17 13:23:34 +00:00
|
|
|
cy.findByTestId(realmSettingsPage.modalConfirm).click();
|
2021-07-19 13:58:35 +00:00
|
|
|
|
2021-07-26 09:21:56 +00:00
|
|
|
cy.wait(["@reload"]);
|
2021-07-19 13:58:35 +00:00
|
|
|
return this;
|
2021-09-01 13:45:46 +00:00
|
|
|
};*/
|
2021-07-19 13:58:35 +00:00
|
|
|
|
2021-09-24 10:46:01 +00:00
|
|
|
const addBundle = () => {
|
|
|
|
const localizationUrl = `/auth/admin/realms/${realmName}/localization/en`;
|
|
|
|
cy.intercept(localizationUrl).as("localizationFetch");
|
2021-07-01 06:48:30 +00:00
|
|
|
|
2021-09-24 10:46:01 +00:00
|
|
|
realmSettingsPage.addKeyValuePair(
|
|
|
|
"key_" + (Math.random() + 1).toString(36).substring(7),
|
|
|
|
"value_" + (Math.random() + 1).toString(36).substring(7)
|
|
|
|
);
|
2021-07-01 06:48:30 +00:00
|
|
|
|
2021-09-24 10:46:01 +00:00
|
|
|
cy.wait(["@localizationFetch"]);
|
2021-07-09 14:23:49 +00:00
|
|
|
|
2021-09-24 10:46:01 +00:00
|
|
|
return this;
|
|
|
|
};
|
2021-07-01 06:48:30 +00:00
|
|
|
|
2021-10-04 06:03:19 +00:00
|
|
|
it("Go to general tab", () => {
|
2021-09-24 10:46:01 +00:00
|
|
|
sidebarPage.goToRealmSettings();
|
|
|
|
realmSettingsPage.toggleSwitch(realmSettingsPage.managedAccessSwitch);
|
|
|
|
realmSettingsPage.save(realmSettingsPage.generalSaveBtn);
|
|
|
|
masthead.checkNotificationMessage("Realm successfully updated");
|
|
|
|
realmSettingsPage.toggleSwitch(realmSettingsPage.managedAccessSwitch);
|
|
|
|
realmSettingsPage.save(realmSettingsPage.generalSaveBtn);
|
|
|
|
masthead.checkNotificationMessage("Realm successfully updated");
|
|
|
|
});
|
2021-06-03 18:31:47 +00:00
|
|
|
|
2021-09-24 10:46:01 +00:00
|
|
|
it("Go to login tab", () => {
|
|
|
|
sidebarPage.goToRealmSettings();
|
|
|
|
cy.findByTestId("rs-login-tab").click();
|
|
|
|
realmSettingsPage.toggleSwitch(realmSettingsPage.userRegSwitch);
|
|
|
|
realmSettingsPage.toggleSwitch(realmSettingsPage.forgotPwdSwitch);
|
|
|
|
realmSettingsPage.toggleSwitch(realmSettingsPage.rememberMeSwitch);
|
|
|
|
});
|
2021-06-03 18:31:47 +00:00
|
|
|
|
2021-09-27 17:15:36 +00:00
|
|
|
it("Check login tab values", () => {
|
|
|
|
sidebarPage.goToRealmSettings();
|
|
|
|
cy.findByTestId("rs-login-tab").click();
|
|
|
|
|
|
|
|
cy.get("#kc-user-reg-switch-off").should("be.visible");
|
|
|
|
cy.get("#kc-forgot-pw-switch-off").should("be.visible");
|
|
|
|
cy.get("#kc-remember-me-switch-off").should("not.be.visible");
|
|
|
|
});
|
|
|
|
|
2021-09-24 10:46:01 +00:00
|
|
|
it("Go to email tab", () => {
|
|
|
|
sidebarPage.goToRealmSettings();
|
|
|
|
cy.findByTestId("rs-email-tab").click();
|
2021-06-03 18:31:47 +00:00
|
|
|
|
2021-09-24 10:46:01 +00:00
|
|
|
realmSettingsPage.addSenderEmail("example@example.com");
|
2021-06-03 18:31:47 +00:00
|
|
|
|
2021-09-24 10:46:01 +00:00
|
|
|
realmSettingsPage.toggleCheck(realmSettingsPage.enableSslCheck);
|
|
|
|
realmSettingsPage.toggleCheck(realmSettingsPage.enableStartTlsCheck);
|
2021-06-03 18:31:47 +00:00
|
|
|
|
2021-09-24 10:46:01 +00:00
|
|
|
realmSettingsPage.save(realmSettingsPage.emailSaveBtn);
|
2021-06-22 12:48:12 +00:00
|
|
|
|
2021-09-24 10:46:01 +00:00
|
|
|
realmSettingsPage.fillHostField("localhost");
|
|
|
|
cy.findByTestId(realmSettingsPage.testConnectionButton).click();
|
2021-06-22 12:48:12 +00:00
|
|
|
|
2021-09-24 10:46:01 +00:00
|
|
|
realmSettingsPage.fillEmailField(
|
|
|
|
"example" +
|
|
|
|
(Math.random() + 1).toString(36).substring(7) +
|
|
|
|
"@example.com"
|
|
|
|
);
|
2021-06-22 19:42:38 +00:00
|
|
|
|
2021-09-24 10:46:01 +00:00
|
|
|
cy.findByTestId(realmSettingsPage.modalTestConnectionButton).click();
|
2021-06-22 19:42:38 +00:00
|
|
|
|
2021-09-24 10:46:01 +00:00
|
|
|
masthead.checkNotificationMessage("Error! Failed to send email.");
|
|
|
|
});
|
2021-06-03 18:31:47 +00:00
|
|
|
|
2021-09-24 10:46:01 +00:00
|
|
|
it("Go to themes tab", () => {
|
|
|
|
sidebarPage.goToRealmSettings();
|
|
|
|
cy.intercept(`/auth/admin/realms/${realmName}/keys`).as("load");
|
2021-07-09 14:23:49 +00:00
|
|
|
|
2021-09-24 10:46:01 +00:00
|
|
|
cy.findByTestId("rs-themes-tab").click();
|
|
|
|
cy.wait(["@load"]);
|
2021-07-09 14:23:49 +00:00
|
|
|
|
2021-09-24 10:46:01 +00:00
|
|
|
realmSettingsPage.selectLoginThemeType("keycloak");
|
|
|
|
realmSettingsPage.selectAccountThemeType("keycloak");
|
|
|
|
realmSettingsPage.selectAdminThemeType("base");
|
|
|
|
realmSettingsPage.selectEmailThemeType("base");
|
2021-06-03 18:31:47 +00:00
|
|
|
|
2021-09-24 10:46:01 +00:00
|
|
|
realmSettingsPage.saveThemes();
|
|
|
|
});
|
2021-06-03 18:31:47 +00:00
|
|
|
|
2021-09-24 10:46:01 +00:00
|
|
|
describe("Events tab", () => {
|
|
|
|
const listingPage = new ListingPage();
|
2021-06-08 05:29:56 +00:00
|
|
|
|
2021-09-24 10:46:01 +00:00
|
|
|
it("Enable user events", () => {
|
|
|
|
cy.intercept("GET", `/auth/admin/realms/${realmName}/keys`).as("load");
|
|
|
|
sidebarPage.goToRealmSettings();
|
|
|
|
cy.findByTestId("rs-realm-events-tab").click();
|
|
|
|
cy.wait(["@load"]);
|
2021-06-08 05:29:56 +00:00
|
|
|
|
2021-09-24 10:46:01 +00:00
|
|
|
realmSettingsPage
|
|
|
|
.toggleSwitch(realmSettingsPage.enableEvents)
|
|
|
|
.save(realmSettingsPage.eventsUserSave);
|
|
|
|
masthead.checkNotificationMessage("Successfully saved configuration");
|
2021-06-08 05:29:56 +00:00
|
|
|
|
2021-09-24 10:46:01 +00:00
|
|
|
realmSettingsPage.clearEvents("user");
|
2021-06-08 05:29:56 +00:00
|
|
|
|
2021-09-24 10:46:01 +00:00
|
|
|
modalUtils
|
|
|
|
.checkModalMessage(
|
|
|
|
"If you clear all events of this realm, all records will be permanently cleared in the database"
|
|
|
|
)
|
|
|
|
.confirmModal();
|
2021-06-08 05:29:56 +00:00
|
|
|
|
2021-09-24 10:46:01 +00:00
|
|
|
masthead.checkNotificationMessage("The user events have been cleared");
|
2021-06-08 05:29:56 +00:00
|
|
|
|
2021-09-24 10:46:01 +00:00
|
|
|
const events = ["Client info", "Client info error"];
|
2021-06-08 05:29:56 +00:00
|
|
|
|
2021-09-24 10:46:01 +00:00
|
|
|
cy.intercept("GET", `/auth/admin/realms/${realmName}/events/config`).as(
|
|
|
|
"fetchConfig"
|
|
|
|
);
|
|
|
|
realmSettingsPage.addUserEvents(events).clickAdd();
|
|
|
|
masthead.checkNotificationMessage("Successfully saved configuration");
|
|
|
|
cy.wait(["@fetchConfig"]);
|
|
|
|
sidebarPage.waitForPageLoad();
|
|
|
|
|
|
|
|
for (const event of events) {
|
|
|
|
listingPage.searchItem(event, false).itemExist(event);
|
|
|
|
}
|
|
|
|
});
|
2021-06-08 05:29:56 +00:00
|
|
|
});
|
|
|
|
|
2021-09-24 10:46:01 +00:00
|
|
|
it("Go to keys tab", () => {
|
|
|
|
sidebarPage.goToRealmSettings();
|
2021-06-03 18:31:47 +00:00
|
|
|
|
2021-09-24 10:46:01 +00:00
|
|
|
cy.findByTestId("rs-keys-tab").click();
|
|
|
|
});
|
2021-06-03 18:31:47 +00:00
|
|
|
|
2021-09-24 10:46:01 +00:00
|
|
|
it("add Providers", () => {
|
|
|
|
sidebarPage.goToRealmSettings();
|
2021-06-03 18:31:47 +00:00
|
|
|
|
2021-09-24 10:46:01 +00:00
|
|
|
cy.findByTestId("rs-keys-tab").click();
|
2021-06-03 18:31:47 +00:00
|
|
|
|
2021-09-24 10:46:01 +00:00
|
|
|
cy.findByTestId("rs-providers-tab").click();
|
2021-06-03 18:31:47 +00:00
|
|
|
|
2021-09-24 10:46:01 +00:00
|
|
|
realmSettingsPage.toggleAddProviderDropdown();
|
2021-06-03 18:31:47 +00:00
|
|
|
|
2021-09-24 10:46:01 +00:00
|
|
|
cy.findByTestId("option-aes-generated").click();
|
|
|
|
realmSettingsPage.enterConsoleDisplayName("test_aes-generated");
|
|
|
|
realmSettingsPage.addProvider();
|
2021-06-03 18:31:47 +00:00
|
|
|
|
2021-09-24 10:46:01 +00:00
|
|
|
realmSettingsPage.toggleAddProviderDropdown();
|
2021-06-03 18:31:47 +00:00
|
|
|
|
2021-09-24 10:46:01 +00:00
|
|
|
cy.findByTestId("option-ecdsa-generated").click();
|
|
|
|
realmSettingsPage.enterConsoleDisplayName("test_ecdsa-generated");
|
|
|
|
realmSettingsPage.addProvider();
|
2021-06-03 18:31:47 +00:00
|
|
|
|
2021-09-24 10:46:01 +00:00
|
|
|
realmSettingsPage.toggleAddProviderDropdown();
|
2021-06-03 18:31:47 +00:00
|
|
|
|
2021-09-24 10:46:01 +00:00
|
|
|
cy.findByTestId("option-hmac-generated").click();
|
|
|
|
realmSettingsPage.enterConsoleDisplayName("test_hmac-generated");
|
|
|
|
realmSettingsPage.addProvider();
|
2021-06-03 18:31:47 +00:00
|
|
|
|
2021-09-24 10:46:01 +00:00
|
|
|
realmSettingsPage.toggleAddProviderDropdown();
|
2021-06-03 18:31:47 +00:00
|
|
|
|
2021-09-24 10:46:01 +00:00
|
|
|
cy.findByTestId("option-rsa-generated").click();
|
|
|
|
realmSettingsPage.enterConsoleDisplayName("test_rsa-generated");
|
|
|
|
realmSettingsPage.addProvider();
|
|
|
|
});
|
2021-06-08 15:45:37 +00:00
|
|
|
|
2021-09-24 10:46:01 +00:00
|
|
|
it("go to details", () => {
|
|
|
|
sidebarPage.goToRealmSettings();
|
|
|
|
goToDetails();
|
|
|
|
});
|
2021-07-12 18:19:50 +00:00
|
|
|
|
2021-09-24 10:46:01 +00:00
|
|
|
/*it("delete providers", () => {
|
2021-10-12 15:03:56 +00:00
|
|
|
sidebarPage.goToRealmSettings();
|
|
|
|
const url = `/auth/admin/realms/${realmName}/keys`;
|
|
|
|
cy.intercept(url).as("load");
|
2021-07-26 09:21:56 +00:00
|
|
|
|
2021-10-12 15:03:56 +00:00
|
|
|
cy.findByTestId("rs-keys-tab").click();
|
|
|
|
cy.findByTestId("rs-providers-tab").click();
|
2021-07-19 13:58:35 +00:00
|
|
|
|
2021-10-12 15:03:56 +00:00
|
|
|
cy.wait("@load");
|
2021-07-23 10:58:39 +00:00
|
|
|
|
2021-10-12 15:03:56 +00:00
|
|
|
deleteProvider("test_aes-generated");
|
|
|
|
deleteProvider("test_ecdsa-generated");
|
|
|
|
deleteProvider("test_hmac-generated");
|
|
|
|
deleteProvider("test_rsa-generated");
|
|
|
|
});*/
|
2021-09-24 10:46:01 +00:00
|
|
|
it("Test keys", () => {
|
|
|
|
sidebarPage.goToRealmSettings();
|
|
|
|
goToKeys();
|
2021-06-08 15:45:37 +00:00
|
|
|
|
2021-09-24 10:46:01 +00:00
|
|
|
realmSettingsPage.testSelectFilter();
|
|
|
|
});
|
2021-07-01 06:48:30 +00:00
|
|
|
|
2021-09-24 10:46:01 +00:00
|
|
|
it("add locale", () => {
|
|
|
|
sidebarPage.goToRealmSettings();
|
2021-07-01 06:48:30 +00:00
|
|
|
|
2021-09-24 10:46:01 +00:00
|
|
|
cy.findByTestId("rs-localization-tab").click();
|
2021-07-01 06:48:30 +00:00
|
|
|
|
2021-09-24 10:46:01 +00:00
|
|
|
addBundle();
|
2021-07-01 06:48:30 +00:00
|
|
|
|
2021-09-24 10:46:01 +00:00
|
|
|
masthead.checkNotificationMessage(
|
|
|
|
"Success! The localization text has been created."
|
|
|
|
);
|
|
|
|
});
|
2021-07-09 14:23:49 +00:00
|
|
|
|
2021-09-24 10:46:01 +00:00
|
|
|
it("Realm header settings", () => {
|
|
|
|
sidebarPage.goToRealmSettings();
|
|
|
|
cy.get("#pf-tab-securityDefences-securityDefences").click();
|
|
|
|
cy.findByTestId("headers-form-tab-save").should("be.disabled");
|
|
|
|
cy.get("#xFrameOptions").clear().type("DENY");
|
|
|
|
cy.findByTestId("headers-form-tab-save").should("be.enabled").click();
|
2021-07-15 14:25:22 +00:00
|
|
|
|
2021-09-24 10:46:01 +00:00
|
|
|
masthead.checkNotificationMessage("Realm successfully updated");
|
|
|
|
});
|
2021-07-15 14:25:22 +00:00
|
|
|
|
2021-09-24 10:46:01 +00:00
|
|
|
it("Brute force detection", () => {
|
|
|
|
sidebarPage.goToRealmSettings();
|
|
|
|
cy.get("#pf-tab-securityDefences-securityDefences").click();
|
|
|
|
cy.get("#pf-tab-20-bruteForce").click();
|
2021-09-23 07:48:23 +00:00
|
|
|
|
2021-09-24 10:46:01 +00:00
|
|
|
cy.findByTestId("brute-force-tab-save").should("be.disabled");
|
2021-09-23 07:48:23 +00:00
|
|
|
|
2021-09-24 10:46:01 +00:00
|
|
|
cy.get("#bruteForceProtected").click({ force: true });
|
|
|
|
cy.findByTestId("waitIncrementSeconds").type("1");
|
|
|
|
cy.findByTestId("maxFailureWaitSeconds").type("1");
|
|
|
|
cy.findByTestId("maxDeltaTimeSeconds").type("1");
|
|
|
|
cy.findByTestId("minimumQuickLoginWaitSeconds").type("1");
|
2021-09-23 07:48:23 +00:00
|
|
|
|
2021-09-24 10:46:01 +00:00
|
|
|
cy.findByTestId("brute-force-tab-save").should("be.enabled").click();
|
|
|
|
masthead.checkNotificationMessage("Realm successfully updated");
|
|
|
|
});
|
2021-09-23 07:48:23 +00:00
|
|
|
|
2021-09-24 10:46:01 +00:00
|
|
|
it("add session data", () => {
|
|
|
|
sidebarPage.goToRealmSettings();
|
2021-07-15 14:25:22 +00:00
|
|
|
|
2021-09-24 10:46:01 +00:00
|
|
|
cy.findByTestId("rs-sessions-tab").click();
|
2021-07-15 14:25:22 +00:00
|
|
|
|
2021-09-24 10:46:01 +00:00
|
|
|
realmSettingsPage.populateSessionsPage();
|
|
|
|
realmSettingsPage.save("sessions-tab-save");
|
2021-07-15 14:25:22 +00:00
|
|
|
|
2021-09-24 10:46:01 +00:00
|
|
|
masthead.checkNotificationMessage("Realm successfully updated");
|
|
|
|
});
|
2021-07-15 14:25:22 +00:00
|
|
|
|
2021-09-24 10:46:01 +00:00
|
|
|
it("check that sessions data was saved", () => {
|
|
|
|
sidebarPage.goToAuthentication();
|
|
|
|
sidebarPage.goToRealmSettings();
|
2021-07-15 14:25:22 +00:00
|
|
|
|
2021-09-24 10:46:01 +00:00
|
|
|
cy.findByTestId("rs-sessions-tab").click();
|
2021-08-09 19:28:24 +00:00
|
|
|
|
2021-09-24 10:46:01 +00:00
|
|
|
cy.findByTestId(realmSettingsPage.ssoSessionIdleInput).should(
|
|
|
|
"have.value",
|
|
|
|
1
|
|
|
|
);
|
|
|
|
cy.findByTestId(realmSettingsPage.ssoSessionMaxInput).should(
|
|
|
|
"have.value",
|
|
|
|
2
|
|
|
|
);
|
|
|
|
cy.findByTestId(realmSettingsPage.ssoSessionIdleRememberMeInput).should(
|
|
|
|
"have.value",
|
|
|
|
3
|
|
|
|
);
|
|
|
|
cy.findByTestId(realmSettingsPage.ssoSessionMaxRememberMeInput).should(
|
|
|
|
"have.value",
|
|
|
|
4
|
|
|
|
);
|
2021-08-09 19:28:24 +00:00
|
|
|
|
2021-09-24 10:46:01 +00:00
|
|
|
cy.findByTestId(realmSettingsPage.clientSessionIdleInput).should(
|
|
|
|
"have.value",
|
|
|
|
5
|
|
|
|
);
|
|
|
|
cy.findByTestId(realmSettingsPage.clientSessionMaxInput).should(
|
|
|
|
"have.value",
|
|
|
|
6
|
|
|
|
);
|
|
|
|
|
|
|
|
cy.findByTestId(realmSettingsPage.offlineSessionIdleInput).should(
|
|
|
|
"have.value",
|
|
|
|
7
|
|
|
|
);
|
|
|
|
cy.findByTestId(realmSettingsPage.offlineSessionMaxSwitch).should(
|
|
|
|
"have.value",
|
|
|
|
"on"
|
|
|
|
);
|
2021-08-09 19:28:24 +00:00
|
|
|
|
2021-09-24 10:46:01 +00:00
|
|
|
cy.findByTestId(realmSettingsPage.loginTimeoutInput).should(
|
|
|
|
"have.value",
|
|
|
|
9
|
|
|
|
);
|
|
|
|
cy.findByTestId(realmSettingsPage.loginActionTimeoutInput).should(
|
|
|
|
"have.value",
|
|
|
|
10
|
|
|
|
);
|
|
|
|
});
|
2021-08-09 19:28:24 +00:00
|
|
|
|
2021-09-24 10:46:01 +00:00
|
|
|
it("add token data", () => {
|
|
|
|
sidebarPage.goToRealmSettings();
|
|
|
|
|
|
|
|
cy.findByTestId("rs-tokens-tab").click();
|
|
|
|
|
|
|
|
realmSettingsPage.populateTokensPage();
|
|
|
|
realmSettingsPage.save("tokens-tab-save");
|
|
|
|
|
|
|
|
masthead.checkNotificationMessage("Realm successfully updated");
|
|
|
|
});
|
|
|
|
|
|
|
|
it("check that token data was saved", () => {
|
|
|
|
sidebarPage.goToRealmSettings();
|
|
|
|
|
|
|
|
cy.findByTestId("rs-tokens-tab").click();
|
|
|
|
|
|
|
|
cy.findByTestId(realmSettingsPage.accessTokenLifespanInput).should(
|
|
|
|
"have.value",
|
|
|
|
1
|
|
|
|
);
|
|
|
|
cy.findByTestId(
|
|
|
|
realmSettingsPage.accessTokenLifespanImplicitInput
|
|
|
|
).should("have.value", 2);
|
|
|
|
cy.findByTestId(realmSettingsPage.clientLoginTimeoutInput).should(
|
|
|
|
"have.value",
|
|
|
|
3
|
|
|
|
);
|
|
|
|
cy.findByTestId(
|
|
|
|
realmSettingsPage.userInitiatedActionLifespanInput
|
|
|
|
).should("have.value", 4);
|
|
|
|
|
|
|
|
cy.findByTestId(realmSettingsPage.defaultAdminInitatedInput).should(
|
|
|
|
"have.value",
|
|
|
|
5
|
|
|
|
);
|
|
|
|
cy.findByTestId(realmSettingsPage.emailVerificationInput).should(
|
|
|
|
"have.value",
|
|
|
|
6
|
|
|
|
);
|
|
|
|
|
|
|
|
cy.findByTestId(realmSettingsPage.idpEmailVerificationInput).should(
|
|
|
|
"have.value",
|
|
|
|
7
|
|
|
|
);
|
|
|
|
cy.findByTestId(realmSettingsPage.forgotPasswordInput).should(
|
|
|
|
"have.value",
|
|
|
|
8
|
|
|
|
);
|
|
|
|
|
|
|
|
cy.findByTestId(realmSettingsPage.executeActionsInput).should(
|
|
|
|
"have.value",
|
|
|
|
9
|
|
|
|
);
|
|
|
|
});
|
2021-08-09 19:28:24 +00:00
|
|
|
});
|
|
|
|
|
2021-09-24 10:46:01 +00:00
|
|
|
describe("Realm settings client profiles tab tests", () => {
|
|
|
|
beforeEach(() => {
|
|
|
|
keycloakBefore();
|
|
|
|
loginPage.logIn();
|
|
|
|
sidebarPage.goToRealmSettings();
|
|
|
|
cy.findByTestId("rs-clientPolicies-tab").click();
|
2021-10-12 15:03:56 +00:00
|
|
|
cy.findByTestId("rs-policies-clientProfiles-tab").click();
|
2021-09-24 10:46:01 +00:00
|
|
|
});
|
|
|
|
|
2021-10-04 06:03:19 +00:00
|
|
|
it("Go to client policies profiles tab", () => {
|
2021-09-24 10:46:01 +00:00
|
|
|
realmSettingsPage.shouldDisplayProfilesTab();
|
|
|
|
});
|
2021-08-09 19:28:24 +00:00
|
|
|
|
2021-10-04 06:03:19 +00:00
|
|
|
it("Check new client form is displaying", () => {
|
2021-09-24 10:46:01 +00:00
|
|
|
realmSettingsPage.shouldDisplayNewClientProfileForm();
|
|
|
|
});
|
|
|
|
|
2021-10-04 06:03:19 +00:00
|
|
|
it("Complete new client form and cancel", () => {
|
2021-09-24 10:46:01 +00:00
|
|
|
realmSettingsPage.shouldCompleteAndCancelCreateNewClientProfile();
|
|
|
|
});
|
|
|
|
|
2021-10-04 06:03:19 +00:00
|
|
|
it("Complete new client form and submit", () => {
|
2021-09-24 10:46:01 +00:00
|
|
|
realmSettingsPage.shouldCompleteAndCreateNewClientProfile();
|
|
|
|
});
|
|
|
|
|
2021-10-05 08:08:05 +00:00
|
|
|
it("Should perform client profile search by profile name", () => {
|
|
|
|
realmSettingsPage.shouldSearchClientProfile();
|
|
|
|
});
|
|
|
|
|
2021-10-04 06:03:19 +00:00
|
|
|
it("Check cancelling the client profile deletion", () => {
|
2021-09-24 10:46:01 +00:00
|
|
|
realmSettingsPage.shouldDisplayDeleteClientProfileDialog();
|
|
|
|
});
|
|
|
|
|
2021-10-04 06:03:19 +00:00
|
|
|
it("Check deleting the client profile", () => {
|
2021-09-24 10:46:01 +00:00
|
|
|
realmSettingsPage.shouldDeleteClientProfileDialog();
|
|
|
|
});
|
2021-10-04 13:39:54 +00:00
|
|
|
|
|
|
|
it("Check navigating between Form View and JSON editor", () => {
|
|
|
|
realmSettingsPage.shouldNavigateBetweenFormAndJSONView();
|
|
|
|
});
|
|
|
|
|
|
|
|
it("Check saving changed JSON profiles", () => {
|
|
|
|
realmSettingsPage.shouldSaveChangedJSONProfiles();
|
|
|
|
realmSettingsPage.shouldDeleteClientProfileDialog();
|
|
|
|
});
|
|
|
|
|
|
|
|
it("Should not create duplicate client profile", () => {
|
|
|
|
sidebarPage.goToRealmSettings();
|
|
|
|
cy.findByTestId("rs-clientPolicies-tab").click();
|
2021-10-12 15:03:56 +00:00
|
|
|
cy.findByTestId("rs-policies-clientProfiles-tab").click();
|
2021-10-04 13:39:54 +00:00
|
|
|
realmSettingsPage.shouldCompleteAndCreateNewClientProfile();
|
|
|
|
realmSettingsPage.shouldNotCreateDuplicateClientProfile();
|
|
|
|
});
|
|
|
|
|
|
|
|
it("Check deleting newly created client profile from create view via dropdown", () => {
|
|
|
|
realmSettingsPage.shouldRemoveClientFromCreateView();
|
|
|
|
});
|
|
|
|
|
|
|
|
it("Check reloading JSON profiles", () => {
|
|
|
|
realmSettingsPage.shouldReloadJSONProfiles();
|
|
|
|
});
|
2021-08-09 19:28:24 +00:00
|
|
|
});
|
2021-04-19 11:41:07 +00:00
|
|
|
});
|