2021-12-06 10:50:29 +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";
|
2022-01-24 14:17:55 +00:00
|
|
|
import {
|
|
|
|
keycloakBefore,
|
|
|
|
keycloakBeforeEach,
|
|
|
|
} from "../support/util/keycloak_hooks";
|
2021-12-06 10:50:29 +00:00
|
|
|
import AdminClient from "../support/util/AdminClient";
|
|
|
|
|
|
|
|
const loginPage = new LoginPage();
|
|
|
|
const sidebarPage = new SidebarPage();
|
|
|
|
|
|
|
|
describe("Realm settings client profiles tab tests", () => {
|
|
|
|
const realmName = "Realm_" + (Math.random() + 1).toString(36).substring(7);
|
2022-01-24 14:17:55 +00:00
|
|
|
const realmSettingsPage = new RealmSettingsPage(realmName);
|
2021-12-06 10:50:29 +00:00
|
|
|
|
|
|
|
beforeEach(() => {
|
2022-01-24 14:17:55 +00:00
|
|
|
keycloakBeforeEach();
|
|
|
|
sidebarPage.goToRealm(realmName);
|
2021-12-06 10:50:29 +00:00
|
|
|
sidebarPage.goToRealmSettings();
|
|
|
|
cy.findByTestId("rs-clientPolicies-tab").click();
|
|
|
|
cy.findByTestId("rs-policies-clientProfiles-tab").click();
|
|
|
|
});
|
|
|
|
|
2022-01-24 14:17:55 +00:00
|
|
|
before(() => {
|
|
|
|
keycloakBefore();
|
|
|
|
new AdminClient().createRealm(realmName);
|
|
|
|
loginPage.logIn();
|
2021-12-06 10:50:29 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
after(async () => {
|
|
|
|
await new AdminClient().deleteRealm(realmName);
|
|
|
|
});
|
|
|
|
|
|
|
|
it("Go to client policies profiles tab", () => {
|
|
|
|
realmSettingsPage.shouldDisplayProfilesTab();
|
|
|
|
});
|
|
|
|
|
|
|
|
it("Check new client form is displaying", () => {
|
|
|
|
realmSettingsPage.shouldDisplayNewClientProfileForm();
|
|
|
|
});
|
|
|
|
|
|
|
|
it("Complete new client form and cancel", () => {
|
|
|
|
realmSettingsPage.shouldCompleteAndCancelCreateNewClientProfile();
|
|
|
|
});
|
|
|
|
|
|
|
|
it("Complete new client form and submit", () => {
|
|
|
|
realmSettingsPage.shouldCompleteAndCreateNewClientProfile();
|
|
|
|
});
|
|
|
|
|
|
|
|
it("Should perform client profile search by profile name", () => {
|
|
|
|
realmSettingsPage.shouldSearchClientProfile();
|
|
|
|
});
|
|
|
|
|
|
|
|
it("Check cancelling the client profile deletion", () => {
|
|
|
|
realmSettingsPage.shouldDisplayDeleteClientProfileDialog();
|
|
|
|
});
|
|
|
|
|
|
|
|
it("Check deleting the client profile", () => {
|
|
|
|
realmSettingsPage.shouldDeleteClientProfileDialog();
|
|
|
|
});
|
|
|
|
|
|
|
|
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();
|
|
|
|
cy.findByTestId("rs-policies-clientProfiles-tab").click();
|
|
|
|
realmSettingsPage.shouldCompleteAndCreateNewClientProfile();
|
|
|
|
realmSettingsPage.shouldNotCreateDuplicateClientProfile();
|
|
|
|
});
|
|
|
|
|
|
|
|
it("Should edit client profile", () => {
|
|
|
|
realmSettingsPage.shouldEditClientProfile();
|
|
|
|
});
|
|
|
|
|
|
|
|
it("Should check that edited client profile is now listed", () => {
|
|
|
|
sidebarPage.goToRealmSettings();
|
|
|
|
cy.findByTestId("rs-clientPolicies-tab").click();
|
|
|
|
cy.findByTestId("rs-policies-clientProfiles-tab").click();
|
|
|
|
realmSettingsPage.shouldCheckEditedClientProfileListed();
|
|
|
|
});
|
|
|
|
|
|
|
|
it("Should show error when client profile left blank", () => {
|
|
|
|
realmSettingsPage.shouldShowErrorWhenNameBlank();
|
|
|
|
});
|
|
|
|
|
|
|
|
it("Should revert back to the previous profile name", () => {
|
|
|
|
realmSettingsPage.shouldReloadClientProfileEdits();
|
|
|
|
});
|
|
|
|
|
|
|
|
it("Should not have executors configured by default", () => {
|
|
|
|
realmSettingsPage.shouldNotHaveExecutorsConfigured();
|
|
|
|
});
|
|
|
|
|
|
|
|
it("Should cancel adding a new executor to a client profile", () => {
|
|
|
|
realmSettingsPage.shouldCancelAddingExecutor();
|
|
|
|
});
|
|
|
|
|
|
|
|
it("Should add a new executor to a client profile", () => {
|
|
|
|
realmSettingsPage.shouldAddExecutor();
|
|
|
|
});
|
|
|
|
|
|
|
|
it("Should cancel deleting executor from a client profile", () => {
|
|
|
|
realmSettingsPage.shouldCancelDeletingExecutor();
|
|
|
|
});
|
|
|
|
|
|
|
|
it("Should cancel editing executor", () => {
|
|
|
|
realmSettingsPage.shouldCancelEditingExecutor();
|
|
|
|
});
|
|
|
|
|
|
|
|
it("Should edit executor", () => {
|
|
|
|
realmSettingsPage.shouldEditExecutor();
|
|
|
|
});
|
|
|
|
|
|
|
|
it("Should delete executor from a client profile", () => {
|
|
|
|
realmSettingsPage.shouldDeleteExecutor();
|
|
|
|
});
|
|
|
|
|
|
|
|
it("Should delete edited client profile", () => {
|
|
|
|
realmSettingsPage.shouldDeleteEditedProfile();
|
|
|
|
});
|
|
|
|
});
|