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";
|
|
|
|
import { keycloakBefore } from "../support/util/keycloak_before";
|
2021-05-06 05:31:40 +00:00
|
|
|
import AdminClient from "../support/util/AdminClient";
|
2021-04-19 11:41:07 +00:00
|
|
|
|
|
|
|
describe("Realm settings test", () => {
|
|
|
|
const loginPage = new LoginPage();
|
|
|
|
const sidebarPage = new SidebarPage();
|
|
|
|
const realmSettingsPage = new RealmSettingsPage();
|
|
|
|
|
2021-05-06 05:31:40 +00:00
|
|
|
describe("Realm settings", () => {
|
|
|
|
const realmName = "Realm_" + (Math.random() + 1).toString(36).substring(7);
|
|
|
|
|
|
|
|
beforeEach(() => {
|
2021-04-19 11:41:07 +00:00
|
|
|
keycloakBefore();
|
|
|
|
loginPage.logIn();
|
2021-05-06 05:31:40 +00:00
|
|
|
sidebarPage.goToRealm(realmName);
|
|
|
|
});
|
|
|
|
|
|
|
|
before(async () => {
|
|
|
|
await new AdminClient().createRealm(realmName);
|
|
|
|
});
|
|
|
|
|
|
|
|
after(async () => {
|
|
|
|
await new AdminClient().deleteRealm(realmName);
|
2021-04-19 11:41:07 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
it("Go to general tab", function () {
|
|
|
|
sidebarPage.goToRealmSettings();
|
2021-05-03 20:00:12 +00:00
|
|
|
realmSettingsPage.toggleSwitch(realmSettingsPage.managedAccessSwitch);
|
|
|
|
realmSettingsPage.save(realmSettingsPage.generalSaveBtn);
|
|
|
|
realmSettingsPage.toggleSwitch(realmSettingsPage.managedAccessSwitch);
|
|
|
|
realmSettingsPage.save(realmSettingsPage.generalSaveBtn);
|
2021-04-19 11:41:07 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
it("Go to login tab", function () {
|
|
|
|
sidebarPage.goToRealmSettings();
|
|
|
|
cy.getId("rs-login-tab").click();
|
2021-05-03 20:00:12 +00:00
|
|
|
realmSettingsPage.toggleSwitch(realmSettingsPage.userRegSwitch);
|
|
|
|
realmSettingsPage.toggleSwitch(realmSettingsPage.forgotPwdSwitch);
|
|
|
|
realmSettingsPage.toggleSwitch(realmSettingsPage.rememberMeSwitch);
|
|
|
|
realmSettingsPage.toggleSwitch(realmSettingsPage.verifyEmailSwitch);
|
|
|
|
});
|
|
|
|
|
|
|
|
it("Go to email tab", function () {
|
|
|
|
sidebarPage.goToRealmSettings();
|
|
|
|
cy.getId("rs-email-tab").click();
|
|
|
|
|
|
|
|
realmSettingsPage.addSenderEmail("example@example.com");
|
|
|
|
|
|
|
|
cy.wait(100);
|
|
|
|
|
|
|
|
realmSettingsPage.toggleCheck(realmSettingsPage.enableSslCheck);
|
|
|
|
realmSettingsPage.toggleCheck(realmSettingsPage.enableStartTlsCheck);
|
|
|
|
|
|
|
|
realmSettingsPage.save(realmSettingsPage.emailSaveBtn);
|
2021-04-19 11:41:07 +00:00
|
|
|
});
|
2021-04-29 17:39:19 +00:00
|
|
|
|
|
|
|
it("Go to themes tab", function () {
|
|
|
|
sidebarPage.goToRealmSettings();
|
|
|
|
cy.getId("rs-themes-tab").click();
|
|
|
|
realmSettingsPage.selectLoginThemeType("keycloak");
|
|
|
|
realmSettingsPage.selectAccountThemeType("keycloak");
|
2021-05-03 20:00:12 +00:00
|
|
|
realmSettingsPage.selectAdminThemeType("base");
|
2021-04-29 17:39:19 +00:00
|
|
|
realmSettingsPage.selectEmailThemeType("base");
|
|
|
|
|
|
|
|
realmSettingsPage.saveThemes();
|
|
|
|
});
|
2021-04-19 11:41:07 +00:00
|
|
|
});
|
|
|
|
});
|