diff --git a/.github/actions/cypress-cache/action.yml b/.github/actions/cypress-cache/action.yml deleted file mode 100644 index 994192cfb0d..00000000000 --- a/.github/actions/cypress-cache/action.yml +++ /dev/null @@ -1,20 +0,0 @@ -name: Cache Cypress -description: Caches Cypress binary to speed up the build. - -runs: - using: composite - steps: - - id: cache-key - name: Cache key based on Cypress version - shell: bash - run: echo "key=cypress-binary-$(jq -r '.devDependencies.cypress' js/apps/admin-ui/package.json)" >> $GITHUB_OUTPUT - - - uses: actions/cache@v4 - name: Cache Cypress binary - with: - # See: https://docs.cypress.io/app/references/advanced-installation#Binary-cache - path: | - ~/.cache/Cypress - /AppData/Local/Cypress/Cache - ~/Library/Caches/Cypress - key: ${{ runner.os }}-${{ steps.cache-key.outputs.key }} diff --git a/.github/actions/pnpm-setup/action.yml b/.github/actions/pnpm-setup/action.yml index 350298a9139..a94fb68a148 100644 --- a/.github/actions/pnpm-setup/action.yml +++ b/.github/actions/pnpm-setup/action.yml @@ -23,17 +23,7 @@ runs: - name: PNPM store cache uses: ./.github/actions/pnpm-store-cache - - name: Cypress binary cache - uses: ./.github/actions/cypress-cache - - name: Install dependencies shell: bash run: pnpm install --prefer-offline --frozen-lockfile working-directory: js - - # This step is only needed to ensure that the Cypress binary is installed. - # If the binary was retrieved from the cache, this step is a no-op. - - name: Install Cypress dependencies - shell: bash - working-directory: js/apps/admin-ui - run: pnpm exec cypress install diff --git a/.github/workflows/js-ci.yml b/.github/workflows/js-ci.yml index 415fcdab895..43206630eee 100644 --- a/.github/workflows/js-ci.yml +++ b/.github/workflows/js-ci.yml @@ -132,9 +132,6 @@ jobs: - run: pnpm --fail-if-no-match --filter ${{ env.WORKSPACE }} build working-directory: js - - run: pnpm --fail-if-no-match --filter ${{ env.WORKSPACE }} cy:check-types - working-directory: js - account-ui-e2e: name: Account UI E2E needs: @@ -170,7 +167,7 @@ jobs: working-directory: js - name: Run Playwright tests - run: pnpm --fail-if-no-match --filter ${{ env.WORKSPACE }} test + run: pnpm --fail-if-no-match --filter ${{ env.WORKSPACE }} test:integration working-directory: js - name: Upload Playwright report @@ -216,7 +213,6 @@ jobs: WORKSPACE: keycloak-admin-ui strategy: matrix: - container: [1, 2, 3, 4, 5] browser: [chrome, firefox] exclude: # Only test with Firefox on scheduled runs @@ -225,18 +221,6 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Install Google Chrome - if: matrix.browser == 'chrome' - uses: browser-actions/setup-chrome@v1 - with: - chrome-version: stable - - - name: Install Firefox - if: matrix.browser == 'firefox' - uses: browser-actions/setup-firefox@v1 - with: - firefox-version: latest - - uses: ./.github/actions/pnpm-setup - name: Compile Admin Client @@ -261,21 +245,21 @@ jobs: KC_BOOTSTRAP_ADMIN_CLIENT_ID: temporary-admin-service KC_BOOTSTRAP_ADMIN_CLIENT_SECRET: temporary-admin-service - - name: Start LDAP server - run: pnpm --fail-if-no-match --filter ${{ env.WORKSPACE }} cy:ldap-server & + - name: Install Playwright browsers + run: pnpm --fail-if-no-match --filter ${{ env.WORKSPACE }} exec playwright install --with-deps working-directory: js - - name: Run Cypress - uses: cypress-io/github-action@v6 + - name: Run Playwright tests + run: pnpm --fail-if-no-match --filter ${{ env.WORKSPACE }} test:integration + working-directory: js + + - name: Upload Playwright report + uses: actions/upload-artifact@v4 + if: always() with: - install: false - browser: ${{ matrix.browser }} - wait-on: http://localhost:8080 - working-directory: js/apps/admin-ui - env: - SPLIT: ${{ strategy.job-total }} - SPLIT_INDEX: ${{ strategy.job-index }} - SPLIT_RANDOM_SEED: ${{ needs.generate-test-seed.outputs.seed }} + name: admin-ui-playwright-report + path: js/apps/admin-ui/playwright-report + retention-days: 30 - name: Upload server logs if: always() @@ -284,15 +268,6 @@ jobs: name: admin-ui-server-log-${{ matrix.container }}-${{ matrix.browser }} path: ~/server.log - - name: Upload Cypress videos - uses: actions/upload-artifact@v4 - if: always() && github.repository != 'keycloak/keycloak-private' - with: - name: cypress-videos-${{ matrix.container }}-${{ matrix.browser }} - path: js/apps/admin-ui/cypress/videos - if-no-files-found: ignore - retention-days: 10 - check: name: Status Check - Keycloak JavaScript CI if: always() diff --git a/js/apps/admin-ui/CONTRIBUTING.md b/js/apps/admin-ui/CONTRIBUTING.md index ad7bd56c167..3a97089d6d8 100644 --- a/js/apps/admin-ui/CONTRIBUTING.md +++ b/js/apps/admin-ui/CONTRIBUTING.md @@ -1,6 +1,6 @@ # Keycloak Admin UI -This project is the next generation of the Keycloak Administration UI. It is written with React and [PatternFly 4](https://www.patternfly.org/v4/) and uses [Vite](https://vitejs.dev/guide/) and [Cypress](https://docs.cypress.io/guides/overview/why-cypress). +This project is the next generation of the Keycloak Administration UI. It is written with React and [PatternFly 4](https://www.patternfly.org/v4/) and uses [Vite](https://vitejs.dev/guide/) and [Playwright](hhttps://playwright.dev/). ## Development @@ -46,9 +46,9 @@ Every time you create a commit it should be automatically linted and formatted f pnpm lint ``` -## Integration testing with Cypress +## Integration testing with Playwright -This repository contains integration tests developed with the [Cypress framework](https://www.cypress.io/). +This repository contains integration tests developed with the [Playwright framework](https://playwright.dev/). ### Prerequisites @@ -56,21 +56,10 @@ Ensure the Keycloak and development server are running as [outlined previously]( ### Running the tests -You can run the tests using the interactive graphical user interface using the following command: - -```bash -pnpm cy:open -``` +You can run the tests using the interactive graphical user [Visual Studio Code plugin](https://marketplace.visualstudio.com/items?itemName=ms-playwright.playwright) Alternatively the tests can also run headless as follows: ``` -pnpm cy:run +pnpm test:integration ``` - -For more information about the Cypress command-line interface consult [the documentation](https://docs.cypress.io/guides/guides/command-line). - -### Project Structure - -You can find information about the project structure in the [official Cypress documentation](https://docs.cypress.io/guides/core-concepts/writing-and-organizing-tests#Folder-structure). -Read more about [how to write tests](./cypress/WRITING_TESTS.md) diff --git a/js/apps/admin-ui/cypress.config.ts b/js/apps/admin-ui/cypress.config.ts deleted file mode 100644 index bb8452c28ee..00000000000 --- a/js/apps/admin-ui/cypress.config.ts +++ /dev/null @@ -1,78 +0,0 @@ -import { defineConfig } from "cypress"; -import cypressSplit from "cypress-split"; -import fs from "node:fs"; -import { isAsyncFunction } from "node:util/types"; - -const isCI = process.env.CI === "true"; -const retryCount = parseInt(process.env.RETRY_COUNT || "0"); - -export default defineConfig({ - video: isCI, - projectId: "j4yhox", - chromeWebSecurity: false, - viewportWidth: 1920, - viewportHeight: 1200, - defaultCommandTimeout: 30000, - numTestsKeptInMemory: 30, - experimentalMemoryManagement: true, - - retries: { - runMode: retryCount, - }, - - e2e: { - baseUrl: "http://localhost:8080", - slowTestThreshold: 30000, - specPattern: "cypress/e2e/**/*.{js,jsx,ts,tsx}", - setupNodeEvents(on, config) { - on("before:browser:launch", (browser, launchOptions) => { - if (browser.family === "firefox") { - // launchOptions.preferences is a map of preference names to values - // login is not working in firefox when testing_localhost_is_secure_when_hijacked is false - launchOptions.preferences[ - "network.proxy.testing_localhost_is_secure_when_hijacked" - ] = true; - } - - return launchOptions; - }); - // after:spec collides with cypressSplit function below and is overridden there - - function afterSpecRemoveSuccessfulVideos(spec, results) { - if (results?.video) { - // Do we have failures for any retry attempts? - const failures = results.tests.some((test) => - test.attempts.some((attempt) => attempt.state === "failed"), - ); - - if (!failures) { - // delete the video if the spec passed and no tests retried - fs.rmSync(results.video, { force: true }); - } - } - } - - function chainedOn(event, callback) { - if (event === "after:spec") { - if (isAsyncFunction(callback)) { - on(event, async (spec, results) => { - afterSpecRemoveSuccessfulVideos(spec, results); - await callback(spec, results); - }); - } else { - on(event, (spec, results) => { - afterSpecRemoveSuccessfulVideos(spec, results); - callback(spec, results); - }); - } - } else { - on(event, callback); - } - } - - cypressSplit(chainedOn, config); - - return config; - }, - }, -}); diff --git a/js/apps/admin-ui/cypress/WRITING_TESTS.md b/js/apps/admin-ui/cypress/WRITING_TESTS.md deleted file mode 100644 index d62adc1fa53..00000000000 --- a/js/apps/admin-ui/cypress/WRITING_TESTS.md +++ /dev/null @@ -1,87 +0,0 @@ -## How to write tests - -### Create PageObjects for the page screens to reuse the methods - -Don't do this: -```typescript -cy.findByTestId("rs-keys-tab").click(); -cy.findByTestId("rs-providers-tab").click(); -cy.findAllByTestId("provider-name-link") - .contains("test_hmac-generated") - .click(); -``` - -Instead use a page object as it is a lot easier to get the intended functionality of the test: -```typescript -realmSettings.goToProvidersTab(); -realmSettings.fillOutForm({ name: "test" }).save(); -``` - -#### Clean code -Write locators in the PageObject layer and in object variables when possible to avoid hardcoding. -Set type of element at the end of the variable name (e.g. saveBtn, nameInput, userDrpDwn…) -Avoid adding “click” to name methods, methods should be named as an action “goToX”, “openX”, “createX”, etc. -Consistent naming (e.g goToTab methods, somewhere named goToTab, other goToXTab) - - -### Test structure - -We have `keycloakBefore` that will navigate to the main page, control request errors and wait for the load to finish. -You can then have multiple test or create a new `describe` block to setup some data for your test. - -```typescript -describe("Realm roles test", () => { - before(() => { - keycloakBefore(); - loginPage.logIn(); - }); - - beforeEach(() => { - sidebarPage.goToRealmRoles(); - }); -``` - -Example of `describe` to setup data for that test: - -```typescript -import adminClient from "../support/util/AdminClient"; - -describe("Edit role details", () => { - before(() => { - adminClient.createRealmRole({ - name: editRoleName, - description, - }); - }); - - after(() => { - adminClient.deleteRealmRole(editRoleName); - }); - - it("Should edit realm role details", () => { - // ... -``` - -### Waiting for results - -Sometimes you will get the following error: -> Cypress failed because the element has been detached from the DOM - -This is because the DOM has been updated in between selectors. You can remedy this by waiting on REST calls. -You can see the rest calls in the cypress IDE. - -```typescript - cy.intercept("/admin/realms/master/").as("search"); - - // ... pressing a button that will perform the search - - cy.wait(["@search"]); // wait for the call named search -``` - -If there were no calls and you still get this error, try using `{force: true}`, but try not to use it everywhere. For example, there could be an unexpected open modal blocking the element, so even the user wouldn’t be able to use that element. - -### Some more reading: - -* [Moises document](https://docs.google.com/document/d/11sm1IpEvVLHO59JEVmwgNOUD0zoP4YMvInIU4v5iVNk/edit) -* [Cypress blog do not get too detached](https://www.cypress.io/blog/2020/07/22/do-not-get-too-detached/) -* [See the clients_test.spec as an example](./cypress/e2e/clients_test.spec.ts) \ No newline at end of file diff --git a/js/apps/admin-ui/cypress/e2e/authentication_policies.spec.ts b/js/apps/admin-ui/cypress/e2e/authentication_policies.spec.ts deleted file mode 100644 index 89028fedd52..00000000000 --- a/js/apps/admin-ui/cypress/e2e/authentication_policies.spec.ts +++ /dev/null @@ -1,77 +0,0 @@ -import { keycloakBefore } from "../support/util/keycloak_hooks"; -import Masthead from "../support/pages/admin-ui/Masthead"; -import LoginPage from "../support/pages/LoginPage"; -import SidebarPage from "../support/pages/admin-ui/SidebarPage"; -import OTPPolicies from "../support/pages/admin-ui/manage/authentication/OTPPolicies"; -import WebAuthnPolicies from "../support/pages/admin-ui/manage/authentication/WebAuthnPolicies"; - -describe("Policies", () => { - const masthead = new Masthead(); - const loginPage = new LoginPage(); - const sidebarPage = new SidebarPage(); - - describe("OTP policies tab", () => { - const otpPoliciesPage = new OTPPolicies(); - - beforeEach(() => { - loginPage.logIn(); - keycloakBefore(); - sidebarPage.goToAuthentication(); - otpPoliciesPage.goToTab(); - }); - - it("should change to hotp", () => { - otpPoliciesPage.checkSupportedApplications( - "FreeOTP", - "Google Authenticator", - "Microsoft Authenticator", - ); - otpPoliciesPage.setPolicyType("hotp").increaseInitialCounter().save(); - masthead.checkNotificationMessage("OTP policy successfully updated"); - otpPoliciesPage.checkSupportedApplications( - "FreeOTP", - "Google Authenticator", - ); - }); - }); - - describe("Webauthn policies tabs", () => { - const webauthnPage = new WebAuthnPolicies(); - - beforeEach(() => { - loginPage.logIn(); - keycloakBefore(); - sidebarPage.goToAuthentication(); - }); - - it("should fill webauthn settings", () => { - webauthnPage.goToTab(); - webauthnPage.fillSelects({ - webAuthnPolicyAttestationConveyancePreference: "Indirect", - webAuthnPolicyRequireResidentKey: "Yes", - webAuthnPolicyUserVerificationRequirement: "Preferred", - }); - webauthnPage.webAuthnPolicyCreateTimeout(30).save(); - masthead.checkNotificationMessage( - "Updated webauthn policies successfully", - ); - }); - - it("should fill webauthn passwordless settings", () => { - webauthnPage.goToPasswordlessTab(); - webauthnPage - .fillSelects( - { - webAuthnPolicyAttestationConveyancePreference: "Indirect", - webAuthnPolicyRequireResidentKey: "Yes", - webAuthnPolicyUserVerificationRequirement: "Preferred", - }, - true, - ) - .save(); - masthead.checkNotificationMessage( - "Updated webauthn policies successfully", - ); - }); - }); -}); diff --git a/js/apps/admin-ui/cypress/e2e/authentication_policies_ciba.spec.ts b/js/apps/admin-ui/cypress/e2e/authentication_policies_ciba.spec.ts deleted file mode 100644 index e6f84969c55..00000000000 --- a/js/apps/admin-ui/cypress/e2e/authentication_policies_ciba.spec.ts +++ /dev/null @@ -1,85 +0,0 @@ -import Form from "../support/forms/Form"; -import FormValidation from "../support/forms/FormValidation"; -import Select from "../support/forms/Select"; -import CIBAPolicyPage from "../support/pages/admin-ui/manage/authentication/CIBAPolicyPage"; -import SidebarPage from "../support/pages/admin-ui/SidebarPage"; -import LoginPage from "../support/pages/LoginPage"; -import adminClient from "../support/util/AdminClient"; -import { keycloakBefore } from "../support/util/keycloak_hooks"; - -const loginPage = new LoginPage(); -const sidebarPage = new SidebarPage(); - -describe("Authentication - Policies - CIBA", () => { - const realmName = crypto.randomUUID(); - - before(() => adminClient.createRealm(realmName)); - - after(() => adminClient.deleteRealm(realmName)); - - beforeEach(() => { - loginPage.logIn(); - keycloakBefore(); - sidebarPage.goToRealm(realmName); - sidebarPage.goToAuthentication(); - CIBAPolicyPage.goToTab(); - }); - - it("displays the initial state", () => { - Select.assertSelectedItem( - CIBAPolicyPage.getBackchannelTokenDeliveryModeSelect(), - "Poll", - ); - CIBAPolicyPage.getExpiresInput().should("have.value", "120"); - CIBAPolicyPage.getIntervalInput().should("have.value", "5"); - Form.assertSaveButtonDisabled(); - }); - - it("validates the fields", () => { - // Required fields. - CIBAPolicyPage.getExpiresInput().clear(); - CIBAPolicyPage.getIntervalInput().clear(); - - FormValidation.assertRequired(CIBAPolicyPage.getExpiresInput()); - FormValidation.assertRequired(CIBAPolicyPage.getIntervalInput()); - Form.assertSaveButtonDisabled(); - - // Fields with minimum value. - CIBAPolicyPage.getExpiresInput().type("9"); - CIBAPolicyPage.getIntervalInput().type("-1"); - - FormValidation.assertMinValue(CIBAPolicyPage.getExpiresInput(), 10); - FormValidation.assertMinValue(CIBAPolicyPage.getIntervalInput(), 0); - Form.assertSaveButtonDisabled(); - - // Fields with maximum value. - CIBAPolicyPage.getExpiresInput().clear().type("601"); - CIBAPolicyPage.getIntervalInput().clear().type("601"); - - FormValidation.assertMaxValue(CIBAPolicyPage.getExpiresInput(), 600); - FormValidation.assertMaxValue(CIBAPolicyPage.getIntervalInput(), 600); - Form.assertSaveButtonDisabled(); - }); - - it("saves the form", () => { - // Select new values for fields. - Select.selectItem( - CIBAPolicyPage.getBackchannelTokenDeliveryModeSelect(), - "Ping", - ); - CIBAPolicyPage.getExpiresInput().clear().type("140"); - CIBAPolicyPage.getIntervalInput().clear().type("20"); - - // Save form. - Form.clickSaveButton(); - CIBAPolicyPage.assertSaveSuccess(); - - // Assert values are saved. - Select.assertSelectedItem( - CIBAPolicyPage.getBackchannelTokenDeliveryModeSelect(), - "Ping", - ); - CIBAPolicyPage.getExpiresInput().should("have.value", "140"); - CIBAPolicyPage.getIntervalInput().should("have.value", "20"); - }); -}); diff --git a/js/apps/admin-ui/cypress/e2e/authentication_test.spec.ts b/js/apps/admin-ui/cypress/e2e/authentication_test.spec.ts deleted file mode 100644 index bb7b5c3cc42..00000000000 --- a/js/apps/admin-ui/cypress/e2e/authentication_test.spec.ts +++ /dev/null @@ -1,386 +0,0 @@ -import { keycloakBefore } from "../support/util/keycloak_hooks"; -import LoginPage from "../support/pages/LoginPage"; -import SidebarPage from "../support/pages/admin-ui/SidebarPage"; -import Masthead from "../support/pages/admin-ui/Masthead"; -import ListingPage from "../support/pages/admin-ui/ListingPage"; -import DuplicateFlowModal from "../support/pages/admin-ui/manage/authentication/DuplicateFlowModal"; -import FlowDetails from "../support/pages/admin-ui/manage/authentication/FlowDetail"; -import RequiredActions from "../support/pages/admin-ui/manage/authentication/RequiredActions"; -import adminClient from "../support/util/AdminClient"; -import PasswordPolicies from "../support/pages/admin-ui/manage/authentication/PasswordPolicies"; -import ModalUtils from "../support/util/ModalUtils"; -import CommonPage from "../support/pages/CommonPage"; -import BindFlowModal from "../support/pages/admin-ui/manage/authentication/BindFlowModal"; -import OTPPolicies from "../support/pages/admin-ui/manage/authentication/OTPPolicies"; -import WebAuthnPolicies from "../support/pages/admin-ui/manage/authentication/WebAuthnPolicies"; -import CIBAPolicyPage from "../support/pages/admin-ui/manage/authentication/CIBAPolicyPage"; -import FlowDiagram from "../support/pages/admin-ui/manage/authentication/FlowDiagram"; - -const loginPage = new LoginPage(); -const masthead = new Masthead(); -const sidebarPage = new SidebarPage(); -const commonPage = new CommonPage(); -const listingPage = new ListingPage(); -const realmName = "test" + crypto.randomUUID(); - -describe("Authentication test", () => { - const detailPage = new FlowDetails(); - const diagramView = new FlowDiagram(); - const duplicateFlowModal = new DuplicateFlowModal(); - const modalUtil = new ModalUtils(); - - before(() => adminClient.createRealm(realmName)); - - after(() => adminClient.deleteRealm(realmName)); - - beforeEach(() => { - loginPage.logIn(); - keycloakBefore(); - sidebarPage.goToRealm(realmName); - sidebarPage.goToAuthentication(); - }); - - it("authentication empty search test", () => { - commonPage.tableToolbarUtils().searchItem("", false); - commonPage.tableUtils().checkIfExists(true); - }); - - it("authentication search flow", () => { - const itemId = "Browser"; - commonPage.tableToolbarUtils().searchItem(itemId, false); - commonPage.tableUtils().checkRowItemExists(itemId); - }); - - it("should create duplicate of existing flow", () => { - listingPage.clickRowDetails("Browser").clickDetailMenu("Duplicate"); - duplicateFlowModal.fill("Copy of browser"); - - masthead.checkNotificationMessage("Flow successfully duplicated"); - detailPage.flowExists("Copy of browser"); - }); - - it("Should fail duplicate with empty flow name", () => { - listingPage.clickRowDetails("Browser").clickDetailMenu("Duplicate"); - duplicateFlowModal.fill().shouldShowError("Required field"); - modalUtil.cancelModal(); - }); - - it("Should fail duplicate with duplicated name", () => { - listingPage.clickRowDetails("Browser").clickDetailMenu("Duplicate"); - duplicateFlowModal.fill("browser"); - masthead.checkNotificationMessage( - "Could not duplicate flow: New flow alias name already exists", - ); - }); - - it("Should show the details of a flow as a table", () => { - listingPage.goToItemDetails("Copy of browser"); - - detailPage.executionExists("Cookie"); - }); - - // as of 03/28/24, drag and drop is not working - it.skip("Should move kerberos down", () => { - listingPage.goToItemDetails("Copy of browser"); - - const fromRow = "Kerberos"; - detailPage.expectPriorityChange(fromRow, () => { - detailPage.moveRowTo( - fromRow, - `[data-testid="Identity Provider Redirector"]`, - ); - }); - }); - - it("Should edit flow details", () => { - const name = "Copy of browser"; - listingPage.goToItemDetails(name); - const commonPage = new CommonPage(); - - commonPage - .actionToolbarUtils() - .clickActionToggleButton() - .clickDropdownItem("Edit info"); - - duplicateFlowModal.fill(name, "Other description"); - masthead.checkNotificationMessage("Flow successfully updated"); - }); - - it("Should change requirement of cookie", () => { - listingPage.goToItemDetails("Copy of browser"); - - detailPage.changeRequirement("Cookie", "Required"); - - masthead.checkNotificationMessage("Flow successfully updated"); - }); - - it("Should switch to diagram mode", () => { - listingPage.goToItemDetails("Copy of browser"); - - detailPage.goToDiagram(); - - diagramView.exists(); - }); - - it("Should add a execution", () => { - listingPage.goToItemDetails("Copy of browser"); - detailPage.addExecution( - "Copy of browser forms", - "reset-credentials-choose-user", - ); - - masthead.checkNotificationMessage("Flow successfully updated"); - detailPage.executionExists("Choose User"); - }); - - it("should add a condition", () => { - listingPage.goToItemDetails("Copy of browser"); - detailPage.addCondition( - "Copy of browser Browser - Conditional OTP", - "conditional-user-role", - ); - - masthead.checkNotificationMessage("Flow successfully updated"); - }); - - it("Should add a sub-flow", () => { - const flowName = "SubFlow"; - listingPage.goToItemDetails("Copy of browser"); - detailPage.addSubFlow( - "Copy of browser Browser - Conditional OTP", - flowName, - ); - - masthead.checkNotificationMessage("Flow successfully updated"); - detailPage.flowExists(flowName); - }); - - it("Should remove an execution", () => { - listingPage.goToItemDetails("Copy of browser"); - detailPage.executionExists("Cookie").clickRowDelete("Cookie"); - modalUtil.confirmModal(); - detailPage.executionExists("Cookie", false); - }); - - it("Should set as default in action menu", () => { - const bindFlow = new BindFlowModal(); - listingPage.clickRowDetails("Copy of browser").clickDetailMenu("Bind flow"); - bindFlow.fill("Direct grant flow").save(); - masthead.checkNotificationMessage("Flow successfully updated"); - }); - - const flowName = "Empty Flow"; - - it("should create flow from scratch", () => { - listingPage.goToCreateItem(); - detailPage.fillCreateForm( - flowName, - "Some nice description about what this flow does so that we can use it later", - "Client flow", - ); - masthead.checkNotificationMessage("Flow created"); - detailPage.addSubFlowToEmpty(flowName, "EmptySubFlow"); - - masthead.checkNotificationMessage("Flow successfully updated"); - - detailPage.flowExists(flowName); - }); - - it("Should delete a flow from action menu", () => { - listingPage.clickRowDetails(flowName).clickDetailMenu("Delete"); - modalUtil.confirmModal(); - masthead.checkNotificationMessage("Flow successfully deleted"); - }); - - it("add webauthn authentication to browserflow", () => { - const flowName = "WebAuthn Browser"; - listingPage.clickRowDetails("Browser").clickDetailMenu("Duplicate"); - duplicateFlowModal.fill(flowName); - - detailPage.clickRowDelete("WebAuthn Browser Browser - Conditional OTP"); - modalUtil.confirmModal(); - - commonPage - .actionToolbarUtils() - .clickActionToggleButton() - .clickDropdownItem("Bind flow"); - - new BindFlowModal().fill("Direct grant flow").save(); - masthead.checkNotificationMessage("Flow successfully updated"); - }); - - it("Should display the default browser flow diagram", () => { - sidebarPage.goToRealm("master"); - sidebarPage.goToAuthentication(); - listingPage.goToItemDetails("browser"); - - detailPage.goToDiagram(); - - diagramView.exists(); - - diagramView.edgesExist([ - { from: "Start", to: "Cookie" }, - { from: "Cookie", to: "End" }, - { from: "Cookie", to: "Identity Provider Redirector" }, - { from: "Identity Provider Redirector", to: "End" }, - { from: "Identity Provider Redirector", to: "Username Password Form" }, - { from: "Username Password Form", to: "Condition - user configured" }, - { from: "Condition - user configured", to: "OTP Form" }, - { from: "Condition - user configured", to: "End" }, - { from: "OTP Form", to: "End" }, - ]); - }); -}); - -describe("Required actions", () => { - const requiredActionsPage = new RequiredActions(); - - before(() => adminClient.createRealm(realmName)); - - beforeEach(() => { - loginPage.logIn(); - keycloakBefore(); - sidebarPage.goToRealm(realmName); - sidebarPage.goToAuthentication(); - requiredActionsPage.goToTab(); - }); - - after(() => adminClient.deleteRealm(realmName)); - - it("should enable delete account", () => { - const action = "Delete Account"; - requiredActionsPage.switchAction(action); - masthead.checkNotificationMessage("Updated required action successfully"); - requiredActionsPage.isChecked(action); - }); - - it("should register an unregistered action", () => { - const action = "Verify Profile"; - requiredActionsPage.isChecked(action).isDefaultEnabled(action); - requiredActionsPage.switchAction(action); - masthead.checkNotificationMessage("Updated required action successfully"); - requiredActionsPage.switchAction(action); - masthead.checkNotificationMessage("Updated required action successfully"); - requiredActionsPage.isChecked(action).isDefaultEnabled(action); - }); - - it("should set action as default", () => { - const action = "Configure OTP"; - requiredActionsPage.setAsDefault(action); - masthead.checkNotificationMessage("Updated required action successfully"); - requiredActionsPage.isDefaultChecked(action); - }); - - it("should reorder required actions", () => { - const action = "Terms and Conditions"; - requiredActionsPage.moveRowTo(action, "Update Profile"); - masthead.checkNotificationMessage("Updated required action successfully"); - }); -}); - -describe("Password policies tab", () => { - const passwordPoliciesPage = new PasswordPolicies(); - - beforeEach(() => { - loginPage.logIn(); - keycloakBefore(); - sidebarPage.goToAuthentication(); - passwordPoliciesPage.goToTab(); - }); - - it("should add password policies", () => { - passwordPoliciesPage - .shouldShowEmptyState() - .addPolicy("Not Recently Used") - .save(); - masthead.checkNotificationMessage("Password policies successfully updated"); - }); - - it("should remove password policies", () => { - passwordPoliciesPage.removePolicy("remove-passwordHistory").save(); - masthead.checkNotificationMessage("Password policies successfully updated"); - passwordPoliciesPage.shouldShowEmptyState(); - }); -}); - -describe("Accessibility tests for authentication", () => { - const realmName = "a11y-realm"; - const flowName = "SubFlow"; - const requiredActionsPage = new RequiredActions(); - const passwordPoliciesPage = new PasswordPolicies(); - const otpPoliciesPage = new OTPPolicies(); - const webAuthnPolicies = new WebAuthnPolicies(); - const detailPage = new FlowDetails(); - - before(() => adminClient.createRealm(realmName)); - - after(() => adminClient.deleteRealm(realmName)); - - beforeEach(() => { - loginPage.logIn(); - keycloakBefore(); - sidebarPage.goToRealm(realmName); - sidebarPage.goToAuthentication(); - cy.injectAxe(); - }); - - it("Check a11y violations on load/ authentication tab/ flows sub tab", () => { - cy.checkA11y(); - }); - - it("Check a11y violations on load/ authentication tab/ flows sub tab/ creating flow form", () => { - listingPage.goToCreateItem(); - cy.checkA11y(); - cy.findByTestId("cancel").click(); - }); - - it("Check a11y violations on load/ authentication tab/ flows sub tab/ creating flow", () => { - listingPage.goToCreateItem(); - detailPage.fillCreateForm( - flowName, - "Some nice description about what this flow does", - "Client flow", - ); - cy.checkA11y(); - }); - - it("Check a11y violations on load/ authentication tab/ flows sub tab/ creating flow form", () => { - listingPage.goToItemDetails("reset credentials"); - cy.checkA11y(); - }); - - it("Check a11y violations on load/ authentication tab/ required actions sub tab", () => { - requiredActionsPage.goToTab(); - cy.checkA11y(); - }); - - it("Check a11y violations on load/ policies tab/ password policy sub tab", () => { - passwordPoliciesPage.goToTab(); - cy.checkA11y(); - }); - - it("Check a11y violations on load/ authentication tab/ policies sub tab/ adding policy", () => { - passwordPoliciesPage.goToTab().addPolicy("Not Recently Used"); - cy.checkA11y(); - }); - - it("Check a11y violations on load/ policies tab/ otp policy sub tab", () => { - otpPoliciesPage.goToTab(); - cy.checkA11y(); - }); - - it("Check a11y violations on load/ policies tab/ WebAuthn Policies sub tab", () => { - webAuthnPolicies.goToTab(); - cy.checkA11y(); - }); - - it("Check a11y violations on load/ policies tab/ WebAuthn Passwordless Policies sub tab", () => { - webAuthnPolicies.goToPasswordlessTab(); - cy.checkA11y(); - }); - - it("Check a11y violations on load/ policies tab/ CIBA Policy sub tab", () => { - CIBAPolicyPage.goToTab(); - cy.checkA11y(); - }); -}); diff --git a/js/apps/admin-ui/cypress/e2e/client_advanced.spec.ts b/js/apps/admin-ui/cypress/e2e/client_advanced.spec.ts deleted file mode 100644 index 4a954ab89ff..00000000000 --- a/js/apps/admin-ui/cypress/e2e/client_advanced.spec.ts +++ /dev/null @@ -1,149 +0,0 @@ -import ClientDetailsPage from "../support/pages/admin-ui/manage/clients/client_details/ClientDetailsPage"; -import AdvancedTab from "../support/pages/admin-ui/manage/clients/client_details/tabs/AdvancedTab"; -import CreateClientPage from "../support/pages/admin-ui/manage/clients/CreateClientPage"; -import RealmSettingsPage from "../support/pages/admin-ui/manage/realm_settings/RealmSettingsPage"; -import CommonPage from "../support/pages/CommonPage"; -import LoginPage from "../support/pages/LoginPage"; -import adminClient from "../support/util/AdminClient"; -import { keycloakBefore } from "../support/util/keycloak_hooks"; - -const advancedTab = new AdvancedTab(); -const realmSettings = new RealmSettingsPage(); -const createClientPage = new CreateClientPage(); -const clientDetailsPage = new ClientDetailsPage(); -const commonPage = new CommonPage(); -const loginPage = new LoginPage(); - -describe("Advanced tab test", () => { - const realmName = `clients-realm-${crypto.randomUUID()}`; - let client: string; - - before(() => adminClient.createRealm(realmName)); - - beforeEach(() => { - loginPage.logIn(); - keycloakBefore(); - commonPage.sidebar().goToRealm(realmName); - commonPage.sidebar().goToClients(); - client = "client_" + crypto.randomUUID(); - commonPage.tableToolbarUtils().createClient(); - createClientPage - .selectClientType("OpenID Connect") - .fillClientData(client) - .continue(); - - commonPage.sidebar().waitForPageLoad(); - - createClientPage.continue().save(); - commonPage - .masthead() - .checkNotificationMessage("Client created successfully"); - clientDetailsPage.goToAdvancedTab(); - }); - - after(() => adminClient.deleteRealm(realmName)); - - it("Clustering", () => { - advancedTab.expandClusterNode(); - - advancedTab.checkEmptyClusterNode(); - - advancedTab.registerNodeManually().fillHost("localhost").saveHost(); - advancedTab.checkTestClusterAvailability(true); - commonPage.masthead().checkNotificationMessage("Node successfully added"); - advancedTab.deleteClusterNode(); - commonPage.modalUtils().confirmModal(); - commonPage.masthead().checkNotificationMessage("Node successfully removed"); - advancedTab.checkEmptyClusterNode(); - }); - - it("Fine grain OpenID connect configuration", () => { - const algorithm = "ES384"; - advancedTab.selectAccessTokenSignatureAlgorithm(algorithm).saveFineGrain(); - - advancedTab.selectAccessTokenSignatureAlgorithm("HS384").revertFineGrain(); - advancedTab.checkAccessTokenSignatureAlgorithm(algorithm); - }); - - it("OIDC Compatibility Modes configuration", () => { - advancedTab.clickAllCompatibilitySwitch(); - advancedTab.saveCompatibility(); - advancedTab.jumpToCompatability(); - advancedTab.clickExcludeSessionStateSwitch(); - advancedTab.clickUseRefreshTokenForClientCredentialsGrantSwitch(); - advancedTab.revertCompatibility(); - }); - - it("Client Offline Session Max", () => { - configureOfflineSessionMaxInRealmSettings(true); - - cy.findByTestId("token-lifespan-clientOfflineSessionMax").should("exist"); - - configureOfflineSessionMaxInRealmSettings(false); - - cy.findByTestId("token-lifespan-clientOfflineSessionMax").should( - "not.exist", - ); - - function configureOfflineSessionMaxInRealmSettings(enabled: boolean) { - commonPage.sidebar().goToRealmSettings(); - realmSettings.goToSessionsTab(); - realmSettings.setOfflineSessionMaxSwitch(enabled); - realmSettings.saveSessions(); - - commonPage.sidebar().goToClients(); - commonPage.tableToolbarUtils().searchItem(client); - commonPage.tableUtils().clickRowItemLink(client); - clientDetailsPage.goToAdvancedTab(); - } - }); - - it("Advanced settings", () => { - advancedTab.jumpToAdvanced(); - - advancedTab.clickAdvancedSwitches(); - advancedTab.jumpToAdvanced(); - advancedTab.selectKeyForCodeExchangeInput("S256"); - - advancedTab.saveAdvanced(); - advancedTab.jumpToAdvanced(); - advancedTab.checkAdvancedSwitchesOn(); - advancedTab.checkKeyForCodeExchangeInput("S256"); - - advancedTab.selectKeyForCodeExchangeInput("plain"); - advancedTab.checkKeyForCodeExchangeInput("plain"); - - advancedTab.jumpToAdvanced(); - advancedTab.clickAdvancedSwitches(); - - advancedTab.revertAdvanced(); - advancedTab.jumpToAdvanced(); - advancedTab.checkKeyForCodeExchangeInput("S256"); - //uncomment when revert button reverts all switches - //and ACR to LoA Mapping + Default ACR Values - //advancedTab.checkAdvancedSwitchesOn(); - }); - - it("Authentication flow override", () => { - advancedTab.jumpToAuthFlow(); - advancedTab.selectBrowserFlowInput("browser"); - advancedTab.selectDirectGrantInput("docker auth"); - advancedTab.checkBrowserFlowInput("browser"); - advancedTab.checkDirectGrantInput("docker auth"); - - advancedTab.revertAuthFlowOverride(); - advancedTab.jumpToAuthFlow(); - advancedTab.checkBrowserFlowInput("Choose..."); - advancedTab.checkDirectGrantInput("Choose..."); - advancedTab.selectBrowserFlowInput("browser"); - advancedTab.selectDirectGrantInput("docker auth"); - - advancedTab.saveAuthFlowOverride(); - advancedTab.selectBrowserFlowInput("first broker login"); - advancedTab.selectDirectGrantInput("first broker login"); - advancedTab.revertAuthFlowOverride(); - //revert doesn't work after saving. - //advancedTab.CheckBrowserFlowInput("browser"); - //advancedTab.CheckDirectGrantInput("docker auth"); - }); -}); diff --git a/js/apps/admin-ui/cypress/e2e/client_authorization_test.spec.ts b/js/apps/admin-ui/cypress/e2e/client_authorization_test.spec.ts deleted file mode 100644 index f9aa30eea09..00000000000 --- a/js/apps/admin-ui/cypress/e2e/client_authorization_test.spec.ts +++ /dev/null @@ -1,285 +0,0 @@ -import { keycloakBefore } from "../support/util/keycloak_hooks"; -import adminClient from "../support/util/AdminClient"; -import LoginPage from "../support/pages/LoginPage"; -import ListingPage from "../support/pages/admin-ui/ListingPage"; -import Masthead from "../support/pages/admin-ui/Masthead"; -import SidebarPage from "../support/pages/admin-ui/SidebarPage"; -import AuthorizationTab from "../support/pages/admin-ui/manage/clients/client_details/tabs/AuthorizationTab"; -import ModalUtils from "../support/util/ModalUtils"; -import ClientDetailsPage from "../support/pages/admin-ui/manage/clients/client_details/ClientDetailsPage"; -import PoliciesTab from "../support/pages/admin-ui/manage/clients/client_details/tabs/authorization_subtabs/PoliciesTab"; -import PermissionsTab from "../support/pages/admin-ui/manage/clients/client_details/tabs/authorization_subtabs/PermissionsTab"; -import CreateResourcePage from "../support/pages/admin-ui/manage/clients/client_details/CreateResourcePage"; - -describe("Client authentication subtab", () => { - const loginPage = new LoginPage(); - const listingPage = new ListingPage(); - const masthead = new Masthead(); - const sidebarPage = new SidebarPage(); - const authenticationTab = new AuthorizationTab(); - const clientDetailsPage = new ClientDetailsPage(); - const policiesSubTab = new PoliciesTab(); - const permissionsSubTab = new PermissionsTab(); - const clientId = "client-authentication-" + crypto.randomUUID(); - - before(() => - adminClient.createClient({ - protocol: "openid-connect", - clientId, - publicClient: false, - authorizationServicesEnabled: true, - serviceAccountsEnabled: true, - standardFlowEnabled: true, - }), - ); - - after(() => { - adminClient.deleteClient(clientId); - }); - - beforeEach(() => { - loginPage.logIn(); - keycloakBefore(); - sidebarPage.goToClients(); - listingPage.searchItem(clientId).goToItemDetails(clientId); - clientDetailsPage.goToAuthorizationTab(); - }); - - it("Should update the resource server settings", () => { - policiesSubTab.setPolicy("DISABLED").formUtils().save(); - masthead.checkNotificationMessage("Resource successfully updated", true); - }); - - it("Should create a resource", () => { - const resourcesSubtab = authenticationTab.goToResourcesSubTab(); - listingPage.assertDefaultResource(); - resourcesSubtab - .createResource() - .fillResourceForm({ - name: "Resource", - displayName: "The display name", - type: "type", - uris: ["one", "two"], - }) - .formUtils() - .save(); - masthead.checkNotificationMessage("Resource created successfully", true); - sidebarPage.waitForPageLoad(); - authenticationTab.formUtils().cancel(); - }); - - it("Edit a resource", () => { - authenticationTab.goToResourcesSubTab(); - listingPage.goToItemDetails("Resource"); - - new CreateResourcePage() - .fillResourceForm({ - displayName: "updated", - }) - .formUtils() - .save(); - - masthead.checkNotificationMessage("Resource successfully updated"); - sidebarPage.waitForPageLoad(); - authenticationTab.formUtils().cancel(); - }); - - it("Should create a scope", () => { - authenticationTab - .goToScopesSubTab() - .createAuthorizationScope() - .fillScopeForm({ - name: "The scope", - displayName: "Display something", - iconUri: "res://something", - }) - .formUtils() - .save(); - - masthead.checkNotificationMessage( - "Authorization scope created successfully", - true, - ); - authenticationTab.goToScopesSubTab(); - listingPage.itemExist("The scope"); - }); - - it("Should create a policy", () => { - authenticationTab.goToPoliciesSubTab(); - cy.intercept( - "GET", - "/admin/realms/master/clients/*/authz/resource-server/policy/regex/*", - ).as("get"); - policiesSubTab - .createPolicy("regex") - .fillBasePolicyForm({ - name: "Regex policy", - description: "Policy for regex", - targetClaim: "I don't know", - pattern: ".*?", - }) - .formUtils() - .save(); - - cy.wait(["@get"]); - masthead.checkNotificationMessage("Successfully created the policy", true); - - sidebarPage.waitForPageLoad(); - authenticationTab.formUtils().cancel(); - }); - - it("Should delete a policy", () => { - authenticationTab.goToPoliciesSubTab(); - listingPage.deleteItem("Regex policy"); - new ModalUtils().confirmModal(); - - masthead.checkNotificationMessage("The Policy successfully deleted", true); - }); - - it("Should create a client policy", () => { - authenticationTab.goToPoliciesSubTab(); - cy.intercept( - "GET", - "/admin/realms/master/clients/*/authz/resource-server/policy/client/*", - ).as("get"); - policiesSubTab - .createPolicy("client") - .fillBasePolicyForm({ - name: "Client policy", - description: "Extra client field", - }) - .inputClient("master-realm") - .formUtils() - .save(); - cy.wait(["@get"]); - masthead.checkNotificationMessage("Successfully created the policy", true); - - sidebarPage.waitForPageLoad(); - authenticationTab.formUtils().cancel(); - }); - - it("Should create a permission", () => { - authenticationTab.goToPermissionsSubTab(); - - permissionsSubTab.createPermission("resource").fillPermissionForm({ - name: "Permission name", - description: "Something describing this permission", - }); - permissionsSubTab.selectResource("Default Resource").formUtils().save(); - cy.intercept( - "/admin/realms/master/clients/*/authz/resource-server/resource?first=0&max=10&permission=false", - ).as("load"); - masthead.checkNotificationMessage( - "Successfully created the permission", - true, - ); - authenticationTab.formUtils().cancel(); - }); - - it.skip("Should copy auth details", () => { - const exportTab = authenticationTab.goToExportSubTab(); - sidebarPage.waitForPageLoad(); - exportTab.copy(); - masthead.checkNotificationMessage("Authorization details copied.", true); - }); - - it("Should export auth details", () => { - const exportTab = authenticationTab.goToExportSubTab(); - sidebarPage.waitForPageLoad(); - exportTab.export(); - - masthead.checkNotificationMessage( - "Successfully exported authorization details.", - true, - ); - }); - - describe("Client authorization tab access for view-realm-authorization", () => { - const clientId = "realm-view-authz-client-" + crypto.randomUUID(); - - beforeEach(async () => { - const [, testUser] = await Promise.all([ - adminClient.createRealm("realm-view-authz"), - adminClient.createUser({ - // Create user in master realm - username: "test-view-authz-user", - enabled: true, - credentials: [{ type: "password", value: "password" }], - }), - ]); - - await Promise.all([ - adminClient.addClientRoleToUser( - testUser.id!, - "realm-view-authz-realm", - ["view-realm", "view-users", "view-authorization", "view-clients"], - ), - adminClient.createClient({ - realm: "realm-view-authz", - clientId, - authorizationServicesEnabled: true, - serviceAccountsEnabled: true, - standardFlowEnabled: true, - }), - ]); - }); - - after(() => - Promise.all([ - adminClient.deleteClient(clientId), - adminClient.deleteUser("test-view-authz-user"), - adminClient.deleteRealm("realm-view-authz"), - ]), - ); - - it("Should view autorization tab", () => { - sidebarPage.waitForPageLoad(); - masthead.signOut(); - - sidebarPage.waitForPageLoad(); - loginPage.logIn("test-view-authz-user", "password"); - keycloakBefore(); - - sidebarPage.waitForPageLoad().goToRealm("realm-view-authz"); - - cy.reload(); - - sidebarPage.waitForPageLoad().goToClients(); - - listingPage - .searchItem(clientId, true, "realm-view-authz") - .goToItemDetails(clientId); - clientDetailsPage.goToAuthorizationTab(); - - authenticationTab.goToResourcesSubTab(); - sidebarPage.waitForPageLoad(); - listingPage.goToItemDetails("Resource"); - sidebarPage.waitForPageLoad(); - cy.go("back"); - - authenticationTab.goToScopesSubTab(); - sidebarPage.waitForPageLoad(); - authenticationTab.goToPoliciesSubTab(); - sidebarPage.waitForPageLoad(); - authenticationTab.goToPermissionsSubTab(); - sidebarPage.waitForPageLoad(); - authenticationTab.goToEvaluateSubTab(); - sidebarPage.waitForPageLoad(); - }); - }); - - describe("Accessibility tests for client authorization", () => { - beforeEach(() => { - loginPage.logIn(); - keycloakBefore(); - sidebarPage.goToClients(); - listingPage.searchItem(clientId).goToItemDetails(clientId); - clientDetailsPage.goToAuthorizationTab(); - cy.injectAxe(); - }); - - it("Check a11y violations on load/ client authorization", () => { - cy.checkA11y(); - }); - }); -}); diff --git a/js/apps/admin-ui/cypress/e2e/client_initial_access.spec.ts b/js/apps/admin-ui/cypress/e2e/client_initial_access.spec.ts deleted file mode 100644 index c14288c415e..00000000000 --- a/js/apps/admin-ui/cypress/e2e/client_initial_access.spec.ts +++ /dev/null @@ -1,86 +0,0 @@ -import InitialAccessTokenTab from "../support/pages/admin-ui/manage/clients/tabs/InitialAccessTokenTab"; -import CommonPage from "../support/pages/CommonPage"; -import LoginPage from "../support/pages/LoginPage"; -import { keycloakBefore } from "../support/util/keycloak_hooks"; - -const commonPage = new CommonPage(); -const loginPage = new LoginPage(); - -describe("Client initial access tokens", () => { - beforeEach(() => { - loginPage.logIn(); - keycloakBefore(); - commonPage.sidebar().goToClients(); - }); - - it("Initial access token can't be created with 0 days and count", () => { - const initialAccessTokenTab = new InitialAccessTokenTab(); - initialAccessTokenTab - .goToInitialAccessTokenTab() - .shouldBeEmpty() - .goToCreateFromEmptyList() - .fillNewTokenData(0, 0) - .checkExpirationGreaterThanZeroError() - .checkCountValue(1) - .checkSaveButtonIsDisabled(); - }); - - it("Initial access token", () => { - const initialAccessTokenTab = new InitialAccessTokenTab(); - initialAccessTokenTab - .goToInitialAccessTokenTab() - .shouldBeEmpty() - .goToCreateFromEmptyList() - .fillNewTokenData(1, 3) - .save(); - - commonPage - .modalUtils() - .checkModalTitle("Initial access token details") - .closeModal(); - - commonPage - .masthead() - .checkNotificationMessage("New initial access token has been created"); - - initialAccessTokenTab.shouldNotBeEmpty(); - - commonPage.tableToolbarUtils().searchItem("John Doe", false); - commonPage.emptyState().checkIfExists(true); - commonPage.tableToolbarUtils().searchItem("", false); - - initialAccessTokenTab.getFirstId((id) => { - commonPage - .tableUtils() - .checkRowItemValueByItemName(id, 4, "4") - .checkRowItemValueByItemName(id, 5, "4") - .checkRowItemExists(id); - }); - - commonPage.tableToolbarUtils().clickPrimaryButton("Create"); - initialAccessTokenTab.fillNewTokenData(1, 3).save(); - - commonPage.modalUtils().closeModal(); - - initialAccessTokenTab.getFirstId((id) => { - commonPage.tableUtils().selectRowItemAction(id, "Delete"); - commonPage.sidebar().waitForPageLoad(); - commonPage - .modalUtils() - .checkModalTitle("Delete initial access token?") - .confirmModal(); - }); - - commonPage - .masthead() - .checkNotificationMessage("Initial access token deleted successfully"); - initialAccessTokenTab.shouldNotBeEmpty(); - - initialAccessTokenTab.getFirstId((id) => { - commonPage.tableUtils().selectRowItemAction(id, "Delete"); - commonPage.sidebar().waitForPageLoad(); - commonPage.modalUtils().confirmModal(); - }); - initialAccessTokenTab.shouldBeEmpty(); - }); -}); diff --git a/js/apps/admin-ui/cypress/e2e/client_registration_policies.spec.ts b/js/apps/admin-ui/cypress/e2e/client_registration_policies.spec.ts deleted file mode 100644 index 6adbf2199dd..00000000000 --- a/js/apps/admin-ui/cypress/e2e/client_registration_policies.spec.ts +++ /dev/null @@ -1,144 +0,0 @@ -import ListingPage from "../support/pages/admin-ui/ListingPage"; -import { ClientRegistrationPage } from "../support/pages/admin-ui/manage/clients/ClientRegistrationPage"; -import Masthead from "../support/pages/admin-ui/Masthead"; -import SidebarPage from "../support/pages/admin-ui/SidebarPage"; -import LoginPage from "../support/pages/LoginPage"; -import { keycloakBefore } from "../support/util/keycloak_hooks"; - -const loginPage = new LoginPage(); -const listingPage = new ListingPage(); -const masthead = new Masthead(); -const sidebarPage = new SidebarPage(); -const clientRegistrationPage = new ClientRegistrationPage(); - -describe("Client registration policies tab", () => { - beforeEach(() => { - loginPage.logIn(); - keycloakBefore(); - sidebarPage.goToClients(); - clientRegistrationPage.goToClientRegistrationTab(); - sidebarPage.waitForPageLoad(); - }); - - describe("Anonymous client policies subtab", () => { - it("check anonymous clients list is not empty", () => { - cy.findByTestId("clientRegistration-anonymous") - .find("tr") - .should("have.length.gt", 0); - }); - - it("add anonymous client registration policy", () => { - clientRegistrationPage - .createAnonymousPolicy() - .selectRow("max-clients") - .fillPolicyForm({ - name: "newAnonymPolicy1", - }) - .formUtils() - .save(); - - masthead.checkNotificationMessage( - "New client policy created successfully", - ); - clientRegistrationPage.formUtils().cancel(); - listingPage.itemExist("newAnonymPolicy1"); - }); - - it("edit anonymous client registration policy", () => { - const policy = "newAnonymPolicy1"; - clientRegistrationPage.findAndSelectInAnonymousPoliciesTable(policy); - cy.findByTestId("name").clear(); - clientRegistrationPage - .fillPolicyForm({ - name: "policy2", - }) - .formUtils() - .save(); - - masthead.checkNotificationMessage("Client policy updated successfully"); - clientRegistrationPage.formUtils().cancel(); - listingPage.itemExist("policy2"); - }); - - it("delete anonymous client registration policy", () => { - const policy = "policy2"; - listingPage.deleteItem(policy); - cy.findByTestId("confirm").click(); - - masthead.checkNotificationMessage( - "Client registration policy deleted successfully", - ); - }); - }); - - describe("Authenticated client policies subtab", () => { - beforeEach(() => { - clientRegistrationPage.goToAuthenticatedSubTab(); - sidebarPage.waitForPageLoad(); - }); - - it("check authenticated clients list is not empty", () => { - cy.findByTestId("clientRegistration-authenticated") - .find("tr") - .should("have.length.gt", 0); - }); - - it("add authenticated client registration policy", () => { - clientRegistrationPage - .createAuthenticatedPolicy() - .selectRow("scope") - .fillPolicyForm({ - name: "newAuthPolicy1", - }) - .formUtils() - .save(); - - masthead.checkNotificationMessage( - "New client policy created successfully", - ); - clientRegistrationPage.formUtils().cancel(); - listingPage.itemExist("newAuthPolicy1"); - }); - - it("edit authenticated client registration policy", () => { - const policy = "newAuthPolicy1"; - clientRegistrationPage.findAndSelectInAuthenticatedPoliciesTable(policy); - cy.findByTestId("name").clear(); - clientRegistrationPage - .fillPolicyForm({ - name: "policy3", - }) - .formUtils() - .save(); - - masthead.checkNotificationMessage("Client policy updated successfully"); - clientRegistrationPage.formUtils().cancel(); - listingPage.itemExist("policy3"); - }); - - it("delete authenticated client registration policy", () => { - const policy = "policy3"; - listingPage.deleteItem(policy); - cy.findByTestId("confirm").click(); - - masthead.checkNotificationMessage( - "Client registration policy deleted successfully", - ); - }); - }); -}); - -describe("Accessibility tests for client registration policies", () => { - beforeEach(() => { - loginPage.logIn(); - keycloakBefore(); - sidebarPage.goToClients(); - clientRegistrationPage.goToClientRegistrationTab(); - sidebarPage.waitForPageLoad(); - cy.injectAxe(); - }); - - it("Check a11y violations on load/ client registration policies", () => { - cy.checkA11y(); - }); -}); diff --git a/js/apps/admin-ui/cypress/e2e/client_scope.spec.ts b/js/apps/admin-ui/cypress/e2e/client_scope.spec.ts deleted file mode 100644 index 26a4ec042fd..00000000000 --- a/js/apps/admin-ui/cypress/e2e/client_scope.spec.ts +++ /dev/null @@ -1,309 +0,0 @@ -import ListingPage, { - Filter, - FilterAssignedType, -} from "../support/pages/admin-ui/ListingPage"; -import ClientDetailsPage from "../support/pages/admin-ui/manage/clients/client_details/ClientDetailsPage"; -import CommonPage from "../support/pages/CommonPage"; -import LoginPage from "../support/pages/LoginPage"; -import adminClient from "../support/util/AdminClient"; -import { keycloakBefore } from "../support/util/keycloak_hooks"; - -const loginPage = new LoginPage(); -const clientDetailsPage = new ClientDetailsPage(); -const commonPage = new CommonPage(); -const listingPage = new ListingPage(); - -describe("Client details - Client scopes subtab", () => { - const clientId = "client-scopes-subtab-test"; - const clientScopeName = "client-scope-test"; - const clientScopeNameDefaultType = "client-scope-test-default-type"; - const clientScopeNameOptionalType = "client-scope-test-optional-type"; - const clientScope = { - name: clientScopeName, - description: "", - protocol: "openid-connect", - attributes: { - "include.in.token.scope": "true", - "display.on.consent.screen": "true", - "gui.order": "1", - "consent.screen.text": "", - }, - }; - const msgScopeMappingRemoved = "Scope mapping successfully removed"; - - const realmName = `clients-realm-${crypto.randomUUID()}`; - - before(async () => { - await adminClient.createRealm(realmName); - await adminClient.inRealm(realmName, () => - adminClient.createClient({ - clientId, - protocol: "openid-connect", - publicClient: false, - }), - ); - for (let i = 0; i < 5; i++) { - clientScope.name = clientScopeName + i; - await adminClient.inRealm(realmName, () => - adminClient.createClientScope(clientScope), - ); - await adminClient.inRealm(realmName, () => - adminClient.addDefaultClientScopeInClient( - clientScopeName + i, - clientId, - ), - ); - } - clientScope.name = clientScopeNameDefaultType; - await adminClient.inRealm(realmName, () => - adminClient.createClientScope(clientScope), - ); - clientScope.name = clientScopeNameOptionalType; - await adminClient.inRealm(realmName, () => - adminClient.createClientScope(clientScope), - ); - }); - - beforeEach(() => { - loginPage.logIn(); - keycloakBefore(); - commonPage.sidebar().goToRealm(realmName); - commonPage.sidebar().goToClients(); - commonPage.tableToolbarUtils().searchItem(clientId); - cy.intercept(`/admin/realms/${realmName}/clients/*`).as("fetchClient"); - commonPage.tableUtils().clickRowItemLink(clientId); - cy.wait("@fetchClient"); - clientDetailsPage.goToClientScopesTab(); - }); - - after(() => adminClient.deleteRealm(realmName)); - - it("Should list client scopes", () => { - commonPage - .tableUtils() - .checkRowItemsGreaterThan(1) - .checkRowItemExists(clientScopeName + 0); - }); - - it("Should search existing client scope by name", () => { - commonPage.tableToolbarUtils().searchItem(clientScopeName + 0, false); - commonPage - .tableUtils() - .checkRowItemExists(clientScopeName + 0) - .checkRowItemsEqualTo(1); - }); - - it("Should search non-existent client scope by name", () => { - commonPage.tableToolbarUtils().searchItem("non-existent-item", false); - commonPage.tableUtils().checkIfExists(false); - commonPage.emptyState().checkIfExists(true); - }); - - it("Should search existing client scope by assigned type", () => { - commonPage - .tableToolbarUtils() - .selectSearchType(Filter.Name, Filter.AssignedType) - .selectSecondarySearchType(FilterAssignedType.Default); - commonPage - .tableUtils() - .checkRowItemExists(FilterAssignedType.Default) - .checkRowItemExists(FilterAssignedType.Optional, false); - commonPage - .tableToolbarUtils() - .selectSecondarySearchType(FilterAssignedType.Optional); - commonPage - .tableUtils() - .checkRowItemExists(FilterAssignedType.Default, false) - .checkRowItemExists(FilterAssignedType.Optional); - commonPage - .tableToolbarUtils() - .selectSecondarySearchType(FilterAssignedType.AllTypes); - commonPage - .tableUtils() - .checkRowItemExists(FilterAssignedType.Default) - .checkRowItemExists(FilterAssignedType.Optional); - }); - - const newItemsWithExpectedAssignedTypes = [ - [clientScopeNameOptionalType, FilterAssignedType.Optional], - [clientScopeNameDefaultType, FilterAssignedType.Default], - ]; - newItemsWithExpectedAssignedTypes.forEach(($type) => { - const [itemName, assignedType] = $type; - it(`Should add client scope ${itemName} with ${assignedType} assigned type`, () => { - commonPage.tableToolbarUtils().addClientScope(); - commonPage - .modalUtils() - .checkModalTitle("Add client scopes to " + clientId); - commonPage.tableUtils().selectRowItemCheckbox(itemName); - commonPage.modalUtils().confirmModalWithItem(assignedType); - commonPage.masthead().checkNotificationMessage("Scope mapping updated"); - commonPage.tableToolbarUtils().searchItem(itemName, false); - commonPage - .tableUtils() - .checkRowItemExists(itemName) - .checkRowItemExists(assignedType); - }); - }); - - const expectedItemAssignedTypes = [ - FilterAssignedType.Optional, - FilterAssignedType.Default, - ]; - expectedItemAssignedTypes.forEach(($assignedType) => { - const itemName = clientScopeName + 0; - it(`Should change item ${itemName} AssignedType to ${$assignedType} from search bar`, () => { - commonPage.tableToolbarUtils().searchItem(itemName, false); - commonPage.tableUtils().selectRowItemCheckbox(itemName); - commonPage.tableToolbarUtils().changeTypeTo($assignedType); - commonPage.masthead().checkNotificationMessage("Scope mapping updated"); - commonPage.tableToolbarUtils().searchItem(itemName, false); - commonPage.tableUtils().checkRowItemExists($assignedType); - }); - }); - - it("Should show items on next page are more than 11", () => { - commonPage.sidebar().waitForPageLoad(); - commonPage.tableToolbarUtils().clickNextPageButton(); - commonPage.tableUtils().checkRowItemsGreaterThan(1); - }); - - it("Should remove client scope from item bar", () => { - const itemName = clientScopeName + 0; - commonPage.tableToolbarUtils().searchItem(itemName, false); - commonPage.tableUtils().selectRowItemAction(itemName, "Remove"); - commonPage.modalUtils().confirmModal(); - commonPage.masthead().checkNotificationMessage(msgScopeMappingRemoved); - commonPage.tableToolbarUtils().searchItem(itemName, false); - listingPage.assertNoResults(); - }); - - it("Should remove multiple client scopes from search bar", () => { - const itemName1 = clientScopeName + 1; - const itemName2 = clientScopeName + 2; - cy.intercept(`/admin/realms/${realmName}/client-scopes`).as("load"); - commonPage.tableToolbarUtils().clickSearchButton(); - cy.wait("@load"); - cy.wait(1000); - commonPage.tableToolbarUtils().checkActionItemIsEnabled("Remove", false); - commonPage.tableToolbarUtils().searchItem(clientScopeName, false); - commonPage - .tableUtils() - .selectRowItemCheckbox(itemName1) - .selectRowItemCheckbox(itemName2); - cy.intercept(`/admin/realms/${realmName}/client-scopes`).as("load"); - commonPage.tableToolbarUtils().clickSearchButton(); - cy.wait("@load"); - cy.wait(1000); - commonPage.tableToolbarUtils().clickActionItem("Remove"); - commonPage.masthead().checkNotificationMessage(msgScopeMappingRemoved); - commonPage.tableToolbarUtils().searchItem(clientScopeName, false); - commonPage - .tableUtils() - .checkRowItemExists(itemName1, false) - .checkRowItemExists(itemName2, false); - commonPage.tableToolbarUtils().clickSearchButton(); - }); - - it("Should show initial items after filtering", () => { - commonPage - .tableToolbarUtils() - .selectSearchType(Filter.Name, Filter.AssignedType) - .selectSecondarySearchType(FilterAssignedType.Optional) - .selectSearchType(Filter.AssignedType, Filter.Name); - commonPage - .tableUtils() - .checkRowItemExists(FilterAssignedType.Default, false) - .checkRowItemExists(FilterAssignedType.Optional); - }); - - describe("Client scopes evaluate subtab", () => { - const clientName = "testClient"; - - beforeEach(() => { - loginPage.logIn(); - keycloakBefore(); - commonPage.sidebar().goToRealm(realmName); - commonPage.sidebar().goToClients(); - }); - - before(async () => { - await adminClient.inRealm(realmName, () => - adminClient.createClient({ - protocol: "openid-connect", - clientId: clientName, - publicClient: false, - }), - ); - await adminClient.inRealm(realmName, () => - adminClient.createUser({ - username: "admin-a", - enabled: true, - }), - ); - }); - - after(async () => { - await adminClient.inRealm(realmName, () => - adminClient.deleteClient(clientName), - ); - }); - - it("check effective protocol mappers list is not empty and find effective protocol mapper locale", () => { - commonPage.tableToolbarUtils().searchItem(clientName); - commonPage.tableUtils().clickRowItemLink(clientName); - - clientDetailsPage.goToClientScopesEvaluateTab(); - - cy.findByTestId("effective-protocol-mappers") - .find("tr") - .should("have.length.gt", 0); - }); - - it("check role scope mappings list list is not empty and find role scope mapping admin", () => { - commonPage.tableToolbarUtils().searchItem(clientName); - commonPage.tableUtils().clickRowItemLink(clientName); - - clientDetailsPage.goToClientScopesEvaluateTab(); - clientDetailsPage.goToClientScopesEvaluateEffectiveRoleScopeMappingsTab(); - - cy.findByTestId("effective-role-scope-mappings") - .find("tr") - .should("have.length.gt", 0); - }); - - it("check generated id token and user info", () => { - commonPage.tableToolbarUtils().searchItem(clientName); - commonPage.tableUtils().clickRowItemLink(clientName); - - clientDetailsPage.goToClientScopesEvaluateTab(); - cy.get("div#generatedAccessToken").contains("No generated access token"); - - clientDetailsPage.goToClientScopesEvaluateGeneratedIdTokenTab(); - cy.get("div#generatedIdToken").contains("No generated id token"); - - clientDetailsPage.goToClientScopesEvaluateGeneratedUserInfoTab(); - cy.get("div#generatedUserInfo").contains("No generated user info"); - - cy.get("[data-testid='user'] input").type("admin-a"); - cy.get(".pf-v5-c-menu__item-text").click(); - - clientDetailsPage.goToClientScopesEvaluateGeneratedAccessTokenTab(); - cy.get("div#generatedAccessToken").contains( - '"preferred_username": "admin-a"', - ); - cy.get("div#generatedAccessToken").contains('"scope": "'); - - clientDetailsPage.goToClientScopesEvaluateGeneratedIdTokenTab(); - cy.get("div#generatedIdToken").contains( - '"preferred_username": "admin-a"', - ); - - clientDetailsPage.goToClientScopesEvaluateGeneratedUserInfoTab(); - cy.get("div#generatedIdToken").contains( - '"preferred_username": "admin-a"', - ); - cy.get("div#generatedIdToken").contains('"sid"'); - }); - }); -}); diff --git a/js/apps/admin-ui/cypress/e2e/client_scopes_test.spec.ts b/js/apps/admin-ui/cypress/e2e/client_scopes_test.spec.ts deleted file mode 100644 index c3a50d3b02a..00000000000 --- a/js/apps/admin-ui/cypress/e2e/client_scopes_test.spec.ts +++ /dev/null @@ -1,493 +0,0 @@ -import LoginPage from "../support/pages/LoginPage"; -import Masthead from "../support/pages/admin-ui/Masthead"; -import ListingPage, { - Filter, - FilterAssignedType, - FilterProtocol, -} from "../support/pages/admin-ui/ListingPage"; -import SidebarPage from "../support/pages/admin-ui/SidebarPage"; -import CreateClientScopePage from "../support/pages/admin-ui/manage/client_scopes/CreateClientScopePage"; -import { keycloakBefore } from "../support/util/keycloak_hooks"; -import RoleMappingTab from "../support/pages/admin-ui/manage/RoleMappingTab"; -import ModalUtils from "../support/util/ModalUtils"; -import adminClient from "../support/util/AdminClient"; -import ClientScopeDetailsPage from "../support/pages/admin-ui/manage/client_scopes/client_scope_details/ClientScopeDetailsPage"; -import CommonPage from "../support/pages/CommonPage"; -import MappersTab from "../support/pages/admin-ui/manage/client_scopes/client_scope_details/tabs/MappersTab"; -import MapperDetailsPage, { - ClaimJsonType, -} from "../support/pages/admin-ui/manage/client_scopes/client_scope_details/tabs/mappers/MapperDetailsPage"; -import DedicatedScopesMappersTab from "../support/pages/admin-ui/manage/clients/client_details/DedicatedScopesMappersTab"; -import ClientDetailsPage from "../support/pages/admin-ui/manage/clients/client_details/ClientDetailsPage"; - -let itemId = "client_scope_crud"; -const loginPage = new LoginPage(); -const masthead = new Masthead(); -const sidebarPage = new SidebarPage(); - -const commonPage = new CommonPage(); -const listingPage = new ListingPage(); -const createClientScopePage = new CreateClientScopePage(); -const modalUtils = new ModalUtils(); -const dedicatedScopesMappersTab = new DedicatedScopesMappersTab(); -const clientDetailsPage = new ClientDetailsPage(); - -describe("Client Scopes test", () => { - const modalMessageDeleteConfirmation = - "Are you sure you want to delete this client scope?"; - const notificationMessageDeletionConfirmation = - "The client scope has been deleted"; - const clientScopeName = "client-scope-test"; - const openIDConnectItemText = "OpenID Connect"; - const clientScope = { - name: clientScopeName, - description: "", - protocol: "openid-connect", - attributes: { - "include.in.token.scope": "true", - "display.on.consent.screen": "true", - "gui.order": "1", - "consent.screen.text": "", - }, - }; - - before(async () => { - for (let i = 0; i < 5; i++) { - clientScope.name = clientScopeName + i; - await adminClient.createClientScope(clientScope); - } - }); - - after(async () => { - for (let i = 0; i < 5; i++) { - if (await adminClient.existsClientScope(clientScopeName + i)) { - await adminClient.deleteClientScope(clientScopeName + i); - } - } - }); - - describe("Client Scope filter list items", () => { - beforeEach(() => { - loginPage.logIn(); - keycloakBefore(); - sidebarPage.goToClientScopes(); - }); - - it("should filter item by name", () => { - const itemName = clientScopeName + 0; - - listingPage - .checkEmptySearch() - .searchItem(itemName, false) - .itemsEqualTo(1) - .itemExist(itemName, true); - }); - - it("should filter items by Assigned type All types", () => { - listingPage - .selectClientScopeFilter(Filter.AssignedType) - .selectSecondaryFilterAssignedType(FilterAssignedType.AllTypes) - .itemExist(FilterAssignedType.Default, true) - .itemExist(FilterAssignedType.Optional, true) - .itemExist(FilterAssignedType.None, true); - }); - - it("should filter items by Assigned type Default", () => { - listingPage - .selectClientScopeFilter(Filter.AssignedType) - .selectSecondaryFilterAssignedType(FilterAssignedType.Default) - .itemExist(FilterAssignedType.Default, true) - .itemExist(FilterAssignedType.Optional, false) - .itemExist(FilterAssignedType.None, false); - }); - - it("should filter items by Assigned type Optional", () => { - listingPage - .selectClientScopeFilter(Filter.AssignedType) - .selectSecondaryFilterAssignedType(FilterAssignedType.Optional) - .itemExist(FilterAssignedType.Default, false) - .itemExist(FilterAssignedType.Optional, true) - .itemExist(FilterAssignedType.None, false); - }); - - it("should filter items by Protocol All", () => { - listingPage - .selectClientScopeFilter(Filter.Protocol) - .selectSecondaryFilterProtocol(FilterProtocol.All); - sidebarPage.waitForPageLoad(); - listingPage - .showNextPageTableItems() - .itemExist(FilterProtocol.SAML, true) - .itemExist(openIDConnectItemText, true); //using FilterProtocol.OpenID will fail, text does not match. - }); - - it("should filter items by Protocol SAML", () => { - listingPage - .selectClientScopeFilter(Filter.Protocol) - .selectSecondaryFilterProtocol(FilterProtocol.SAML) - .itemExist(FilterProtocol.SAML, true) - .itemExist(openIDConnectItemText, false); //using FilterProtocol.OpenID will fail, text does not match. - }); - - it("should filter items by Protocol OpenID", () => { - listingPage - .selectClientScopeFilter(Filter.Protocol) - .selectSecondaryFilterProtocol(FilterProtocol.OpenID) - .itemExist(FilterProtocol.SAML, false) - .itemExist(openIDConnectItemText, true); //using FilterProtocol.OpenID will fail, text does not match. - }); - - it("should show items on next page are more than 11", () => { - listingPage.showNextPageTableItems(); - listingPage.itemsGreaterThan(1); - }); - }); - - describe("Client Scope modify list items", () => { - const itemName = clientScopeName + 0; - - beforeEach(() => { - loginPage.logIn(); - keycloakBefore(); - sidebarPage.goToClientScopes(); - }); - - it("should modify selected item type to Default from search bar", () => { - listingPage - .clickItemCheckbox(itemName) - .changeTypeToOfSelectedItems(FilterAssignedType.Default); - listingPage.itemContainValue(itemName, 2, FilterAssignedType.Default); - }); - - it("should modify selected item type to Optional from search bar", () => { - listingPage - .clickItemCheckbox(itemName) - .changeTypeToOfSelectedItems(FilterAssignedType.Optional); - listingPage.itemContainValue(itemName, 2, FilterAssignedType.Optional); - }); - - const expectedItemAssignedTypes = [ - FilterAssignedType.Default, - FilterAssignedType.Optional, - FilterAssignedType.None, - ]; - expectedItemAssignedTypes.forEach(($assignedType) => { - const itemName = clientScopeName + 0; - it(`should modify item ${itemName} AssignedType to ${$assignedType} from item bar`, () => { - listingPage - .searchItem(clientScopeName, false) - .clickRowSelectItem(itemName, $assignedType); - cy.wait(2000); - listingPage.searchItem(itemName, false).itemExist($assignedType); - }); - }); - - it("should not allow to modify item AssignedType from search bar when no item selected", () => { - const itemName = clientScopeName + 0; - listingPage - .searchItem(itemName, false) - .checkInSearchBarChangeTypeToButtonIsDisabled() - .clickSearchBarActionButton() - .checkDropdownItemIsDisabled("Delete") - .clickItemCheckbox(itemName) - .checkInSearchBarChangeTypeToButtonIsDisabled(false) - .clickSearchBarActionButton() - .checkDropdownItemIsDisabled("Delete", false) - .clickItemCheckbox(itemName) - .checkInSearchBarChangeTypeToButtonIsDisabled() - .clickSearchBarActionButton() - .checkDropdownItemIsDisabled("Delete"); - }); - - //TODO: blocked by https://github.com/keycloak/keycloak-admin-ui/issues/1952 - //it("should export item from item bar", () => { - - //}); - }); - - describe("Client Scope delete list items ", () => { - beforeEach(() => { - loginPage.logIn(); - keycloakBefore(); - sidebarPage.goToClientScopes(); - }); - - it("should delete item from item bar", () => { - listingPage - .checkInSearchBarChangeTypeToButtonIsDisabled() - .clickItemCheckbox(clientScopeName + 0) - .deleteItem(clientScopeName + 0); - modalUtils - .checkModalMessage(modalMessageDeleteConfirmation) - .confirmModal(); - masthead.checkNotificationMessage( - notificationMessageDeletionConfirmation, - ); - listingPage.checkInSearchBarChangeTypeToButtonIsDisabled(); - }); - - it("should delete selected item from search bar", () => { - listingPage - .checkInSearchBarChangeTypeToButtonIsDisabled() - .clickItemCheckbox(clientScopeName + 1) - .clickSearchBarActionButton() - .clickSearchBarActionItem("Delete"); - modalUtils - .checkModalMessage(modalMessageDeleteConfirmation) - .confirmModal(); - masthead.checkNotificationMessage( - notificationMessageDeletionConfirmation, - ); - listingPage.checkInSearchBarChangeTypeToButtonIsDisabled(); - }); - - it("should delete multiple selected items from search bar", () => { - listingPage - .checkInSearchBarChangeTypeToButtonIsDisabled() - .clickItemCheckbox(clientScopeName + 2) - .clickItemCheckbox(clientScopeName + 3) - .clickItemCheckbox(clientScopeName + 4) - .clickSearchBarActionButton() - .clickSearchBarActionItem("Delete"); - modalUtils - .checkModalMessage(modalMessageDeleteConfirmation) - .confirmModal(); - masthead.checkNotificationMessage( - notificationMessageDeletionConfirmation, - ); - listingPage.checkInSearchBarChangeTypeToButtonIsDisabled(); - }); - }); - - describe("Client Scope creation", () => { - beforeEach(() => { - loginPage.logIn(); - keycloakBefore(); - sidebarPage.goToClientScopes(); - }); - - it("should fail creating client scope", () => { - sidebarPage.waitForPageLoad(); - listingPage.goToCreateItem(); - - createClientScopePage.save_is_disabled(true); - createClientScopePage.fillClientScopeData("address").save(); - - masthead.checkNotificationMessage( - "Could not create client scope: 'Client Scope address already exists'", - ); - - createClientScopePage.fillClientScopeData(""); - createClientScopePage.save_is_disabled(true); - }); - - it("hides 'consent text' field when 'display consent' switch is disabled", () => { - sidebarPage.waitForPageLoad(); - listingPage.goToCreateItem(); - - createClientScopePage - .getSwitchDisplayOnConsentScreenInput() - .should("be.checked"); - - createClientScopePage.getConsentScreenTextInput().should("exist"); - - createClientScopePage.switchDisplayOnConsentScreen(); - - createClientScopePage - .getSwitchDisplayOnConsentScreenInput() - .should("not.be.checked"); - - createClientScopePage.getConsentScreenTextInput().should("not.exist"); - }); - - it("Client scope CRUD test", () => { - itemId += "_" + crypto.randomUUID(); - - // Create - listingPage.itemExist(itemId, false).goToCreateItem(); - - createClientScopePage.fillClientScopeData(itemId).save(); - - masthead.checkNotificationMessage("Client scope created"); - - sidebarPage.goToClientScopes(); - sidebarPage.waitForPageLoad(); - - // Delete - listingPage - .searchItem(itemId, false) - .itemExist(itemId) - .deleteItem(itemId); - - modalUtils - .checkModalMessage(modalMessageDeleteConfirmation) - .confirmModal(); - - masthead.checkNotificationMessage("The client scope has been deleted"); - - listingPage.itemExist(itemId, false); - }); - }); - - describe("Scope tab test", () => { - const scopeTab = new RoleMappingTab("client-scope"); - const scopeName = "address"; - - beforeEach(() => { - loginPage.logIn(); - keycloakBefore(); - sidebarPage.goToClientScopes(); - }); - - it("Assign and unassign role", () => { - const role = "admin"; - const roleType = "roles"; - listingPage.searchItem(scopeName, false).goToItemDetails(scopeName); - scopeTab - .goToScopeTab() - .assignRole() - .changeRoleTypeFilter(roleType) - .selectRow(role) - .assign(); - masthead.checkNotificationMessage("Role mapping updated"); - scopeTab.checkRoles([role]); - scopeTab.hideInheritedRoles().selectRow(role).unAssign(); - modalUtils.checkModalTitle("Remove role?").confirmModal(); - scopeTab.checkRoles([]); - }); - }); - - describe("Mappers tab test", () => { - const clientScopeDetailsPage = new ClientScopeDetailsPage(); - const mappersTab = new MappersTab(); - const mapperDetailsTab = new MapperDetailsPage(); - const scopeName = "address"; - - beforeEach(() => { - loginPage.logIn(); - keycloakBefore(); - sidebarPage.goToClientScopes(); - }); - - it("CRUD mappers", () => { - const predefinedMapperName = "Predefined Mapper test"; - const predefinedMapper = "Allowed Web Origins"; - const mappers1 = ["birthdate"]; - const mappers2 = ["email verified", "email", "family name"]; - - listingPage.searchItem(scopeName, false).goToItemDetails(scopeName); - clientScopeDetailsPage - .goToMappersTab() - .addPredefinedMappers(mappers1) - .addPredefinedMappers(mappers2); - - listingPage.searchItem(mappers1[0], false).goToItemDetails(mappers1[0]); - - mapperDetailsTab - .fillUserAttribute(mappers1[0] + "1") - .fillTokenClaimName(mappers1[0] + "2") - .changeClaimJsonType(ClaimJsonType.Long); - - commonPage.formUtils().save(); - commonPage - .masthead() - .checkNotificationMessage("Mapping successfully updated"); - - sidebarPage.goToClientScopes(); - listingPage.searchItem(scopeName, false).goToItemDetails(scopeName); - - clientScopeDetailsPage.goToMappersTab(); - - listingPage.searchItem(mappers1[0], false).goToItemDetails(mappers1[0]); - - mapperDetailsTab - .checkUserAttribute(mappers1[0] + "1") - .checkTokenClaimName(mappers1[0] + "2") - .checkClaimJsonType(ClaimJsonType.Long); - - commonPage.formUtils().cancel(); - - mappersTab - .removeMappers(mappers1.concat(mappers2)) - .addMappersByConfiguration(predefinedMapper, predefinedMapperName); - - sidebarPage.goToClientScopes(); - listingPage.searchItem(scopeName, false).goToItemDetails(scopeName); - clientScopeDetailsPage.goToMappersTab(); - - commonPage.tableUtils().checkRowItemExists(predefinedMapperName, true); - - mappersTab.removeMappers([predefinedMapperName]); - }); - }); - - describe("Accessibility tests for client scopes", () => { - beforeEach(() => { - loginPage.logIn(); - keycloakBefore(); - sidebarPage.goToClientScopes(); - cy.injectAxe(); - }); - - const scopeName = "a11y_" + crypto.randomUUID(); - - after(async () => { - await adminClient.deleteClientScope(scopeName); - }); - - it("Check a11y violations on load/ client scopes", () => { - cy.checkA11y(); - }); - - it("Check a11y violations on empty client scope", () => { - listingPage.goToCreateItem(); - cy.checkA11y(); - }); - - it("Check a11y violations on client scope details", () => { - const clientScopeDetailsPage = new ClientScopeDetailsPage(); - const mappersTab = new MappersTab(); - const predefinedMapperName = "Predefined Mapper test"; - const predefinedMapper = "Allowed Web Origins"; - const scopeTab = new RoleMappingTab("client-scope"); - const role = "admin"; - const roleType = "roles"; - - listingPage.goToCreateItem(); - createClientScopePage.fillClientScopeData(scopeName).save(); - cy.checkA11y(); - - clientScopeDetailsPage.goToMappersTab(); - cy.checkA11y(); - - dedicatedScopesMappersTab.addPredefinedMapper(); - cy.checkA11y(); - clientDetailsPage.modalUtils().table().clickHeaderItem(1, "input"); - cy.findByTestId("confirm").click(); - cy.checkA11y(); - - mappersTab.addMappersByConfiguration( - predefinedMapper, - predefinedMapperName, - ); - cy.checkA11y(); - - sidebarPage.goToClientScopes(); - listingPage.searchItem(scopeName, false).goToItemDetails(scopeName); - clientScopeDetailsPage.goToScopesTab(); - cy.checkA11y(); - - cy.findByTestId("no-roles-for-this-client-scope-empty-action").click(); - cy.checkA11y(); - cy.findByTestId("cancel").click(); - - scopeTab - .goToScopeTab() - .assignRole() - .changeRoleTypeFilter(roleType) - .selectRow(role) - .assign(); - cy.checkA11y(); - }); - }); -}); diff --git a/js/apps/admin-ui/cypress/e2e/clients_role.spec.ts b/js/apps/admin-ui/cypress/e2e/clients_role.spec.ts deleted file mode 100644 index 0c5ba9551da..00000000000 --- a/js/apps/admin-ui/cypress/e2e/clients_role.spec.ts +++ /dev/null @@ -1,220 +0,0 @@ -import AttributesTab from "../support/pages/admin-ui/manage/AttributesTab"; -import ClientRolesTab from "../support/pages/admin-ui/manage/clients/ClientRolesTab"; -import AssociatedRolesPage from "../support/pages/admin-ui/manage/realm_roles/AssociatedRolesPage"; -import createRealmRolePage from "../support/pages/admin-ui/manage/realm_roles/CreateRealmRolePage"; -import CommonPage from "../support/pages/CommonPage"; -import LoginPage from "../support/pages/LoginPage"; -import adminClient from "../support/util/AdminClient"; -import { keycloakBefore } from "../support/util/keycloak_hooks"; - -const associatedRolesPage = new AssociatedRolesPage(); -const attributesTab = new AttributesTab(); -const commonPage = new CommonPage(); -const loginPage = new LoginPage(); - -describe("Roles tab test", () => { - const realmName = `clients-realm-${crypto.randomUUID()}`; - const itemId = `client_crud${crypto.randomUUID()}`; - - const rolesTab = new ClientRolesTab(); - const client = "client_" + crypto.randomUUID(); - const createRealmRoleName = `create-realm-${crypto.randomUUID()}`; - - before(async () => { - await adminClient.createRealm(realmName); - await adminClient.inRealm(realmName, () => - adminClient.createClient({ - clientId: client, - protocol: "openid-connect", - publicClient: false, - }), - ); - await adminClient.inRealm(realmName, () => - adminClient.createRealmRole({ - name: createRealmRoleName, - }), - ); - }); - - beforeEach(() => { - loginPage.logIn(); - keycloakBefore(); - commonPage.sidebar().goToRealm(realmName); - commonPage.sidebar().goToClients(); - commonPage.tableToolbarUtils().searchItem(client); - commonPage.tableUtils().clickRowItemLink(client); - rolesTab.goToRolesTab(); - }); - - after(() => adminClient.deleteRealm(realmName)); - - it("Should fail to create client role with empty name", () => { - rolesTab.goToCreateRoleFromEmptyState(); - createRealmRolePage.fillRealmRoleData("").save(); - createRealmRolePage.checkRealmRoleNameRequiredMessage(); - }); - - it("Should create client role", () => { - rolesTab.goToCreateRoleFromEmptyState(); - createRealmRolePage.fillRealmRoleData(itemId).save(); - commonPage.masthead().checkNotificationMessage("Role created", true); - }); - - it("Should update client role description", () => { - const updateDescription = "updated description"; - commonPage.tableToolbarUtils().searchItem(itemId, false); - commonPage.tableUtils().clickRowItemLink(itemId); - createRealmRolePage.updateDescription(updateDescription).save(); - commonPage - .masthead() - .checkNotificationMessage("The role has been saved", true); - createRealmRolePage.checkDescription(updateDescription); - }); - - it("Should add attribute to client role", () => { - commonPage.tableUtils().clickRowItemLink(itemId); - rolesTab.goToAttributesTab(); - attributesTab - .addAttribute("crud_attribute_key", "crud_attribute_value") - .save(); - attributesTab.assertRowItemsEqualTo(1); - commonPage - .masthead() - .checkNotificationMessage("The role has been saved", true); - }); - - it("Should delete attribute from client role", () => { - commonPage.tableUtils().clickRowItemLink(itemId); - rolesTab.goToAttributesTab(); - attributesTab.deleteAttribute(0); - attributesTab.assertEmpty(); - commonPage - .masthead() - .checkNotificationMessage("The role has been saved", true); - }); - - it("Should create client role to be deleted", () => { - rolesTab.goToCreateRoleFromToolbar(); - createRealmRolePage.fillRealmRoleData("client_role_to_be_deleted").save(); - commonPage.masthead().checkNotificationMessage("Role created", true); - }); - - it("Should fail to create duplicate client role", () => { - rolesTab.goToCreateRoleFromToolbar(); - createRealmRolePage.fillRealmRoleData(itemId).save(); - commonPage - .masthead() - .checkNotificationMessage( - `Could not create role: Role with name ${itemId} already exists`, - true, - ); - }); - - it("Should search existing client role", () => { - commonPage.tableToolbarUtils().searchItem(itemId, false); - commonPage.tableUtils().checkRowItemExists(itemId); - }); - - it("Should search non-existing role test", () => { - commonPage.tableToolbarUtils().searchItem("role_DNE", false); - commonPage.emptyState().checkIfExists(true); - }); - - it("roles empty search test", () => { - commonPage.tableToolbarUtils().searchItem("", false); - commonPage.tableUtils().checkIfExists(true); - }); - - it("Add associated roles test", () => { - commonPage.tableToolbarUtils().searchItem(itemId, false); - commonPage.tableUtils().clickRowItemLink(itemId); - - // Add associated realm role - associatedRolesPage.addAssociatedRealmRole(createRealmRoleName); - commonPage - .masthead() - .checkNotificationMessage("Associated roles have been added", true); - - // Add associated client role - associatedRolesPage.addAssociatedRoleFromSearchBar("manage-account", true); - commonPage - .masthead() - .checkNotificationMessage("Associated roles have been added", true); - - rolesTab.goToAssociatedRolesTab(); - - // Add associated client role - associatedRolesPage.addAssociatedRoleFromSearchBar("manage-consent", true); - commonPage - .masthead() - .checkNotificationMessage("Associated roles have been added", true); - }); - - it("Should hide inherited roles test", () => { - commonPage.tableToolbarUtils().searchItem(itemId, false); - commonPage.tableUtils().clickRowItemLink(itemId); - rolesTab.goToAssociatedRolesTab().hideInheritedRoles(); - }); - - it("Should delete associated roles test", () => { - commonPage.tableToolbarUtils().searchItem(itemId, false); - commonPage.tableUtils().clickRowItemLink(itemId); - rolesTab.goToAssociatedRolesTab(); - commonPage - .tableUtils() - .selectRowItemAction(createRealmRoleName, "Unassign"); - commonPage.sidebar().waitForPageLoad(); - commonPage.modalUtils().checkModalTitle("Remove role?").confirmModal(); - commonPage.sidebar().waitForPageLoad(); - - commonPage - .masthead() - .checkNotificationMessage("Role mapping updated", true); - - commonPage.tableUtils().selectRowItemAction("manage-consent", "Unassign"); - commonPage.sidebar().waitForPageLoad(); - commonPage.modalUtils().checkModalTitle("Remove role?").confirmModal(); - }); - - it("Should delete associated role from search bar test", () => { - commonPage.tableToolbarUtils().searchItem(itemId, false); - commonPage.tableUtils().clickRowItemLink(itemId); - commonPage.sidebar().waitForPageLoad(); - rolesTab.goToAssociatedRolesTab(); - - cy.get("td") - .contains("manage-account") - .parent() - .within(() => { - cy.get("input").click(); - }); - - associatedRolesPage.removeAssociatedRoles(); - - commonPage.sidebar().waitForPageLoad(); - commonPage.modalUtils().checkModalTitle("Remove role?").confirmModal(); - commonPage.sidebar().waitForPageLoad(); - - commonPage - .masthead() - .checkNotificationMessage("Role mapping updated", true); - }); - - it("Should delete client role test", () => { - commonPage.tableUtils().selectRowItemAction(itemId, "Delete"); - commonPage.sidebar().waitForPageLoad(); - commonPage.modalUtils().checkModalTitle("Delete role?").confirmModal(); - }); - - it("Should delete client role from role details test", () => { - commonPage - .tableToolbarUtils() - .searchItem("client_role_to_be_deleted", false); - commonPage.tableUtils().clickRowItemLink("client_role_to_be_deleted"); - createRealmRolePage.clickActionMenu("Delete this role"); - commonPage.modalUtils().confirmModal(); - commonPage - .masthead() - .checkNotificationMessage("The role has been deleted", true); - }); -}); diff --git a/js/apps/admin-ui/cypress/e2e/clients_saml_advanced.spec.ts b/js/apps/admin-ui/cypress/e2e/clients_saml_advanced.spec.ts deleted file mode 100644 index 252d5fa8d13..00000000000 --- a/js/apps/admin-ui/cypress/e2e/clients_saml_advanced.spec.ts +++ /dev/null @@ -1,59 +0,0 @@ -import LoginPage from "../support/pages/LoginPage"; -import Masthead from "../support/pages/admin-ui/Masthead"; -import ListingPage from "../support/pages/admin-ui/ListingPage"; -import SidebarPage from "../support/pages/admin-ui/SidebarPage"; -import adminClient from "../support/util/AdminClient"; -import { keycloakBefore } from "../support/util/keycloak_hooks"; -import { AdvancedSamlTab } from "../support/pages/admin-ui/manage/clients/client_details/tabs/AdvancedSamlTab"; -import ClientDetailsPage from "../support/pages/admin-ui/manage/clients/client_details/ClientDetailsPage"; - -const loginPage = new LoginPage(); -const masthead = new Masthead(); -const sidebarPage = new SidebarPage(); -const listingPage = new ListingPage(); -const advancedTab = new AdvancedSamlTab(); - -describe("Clients Saml advanced tab", () => { - describe("Fine Grain SAML Endpoint Configuration", () => { - const clientName = "advanced-tab"; - - before(() => { - adminClient.createClient({ - protocol: "saml", - clientId: clientName, - publicClient: false, - }); - }); - - after(() => { - adminClient.deleteClient(clientName); - }); - - beforeEach(() => { - loginPage.logIn(); - keycloakBefore(); - sidebarPage.goToClients(); - listingPage.searchItem(clientName).goToItemDetails(clientName); - new ClientDetailsPage().goToAdvancedTab(); - }); - - it("Should Terms of service URL", () => { - const termsOfServiceUrl = "http://some.url/terms-of-service.html"; - advancedTab.termsOfServiceUrl(termsOfServiceUrl).saveFineGrain(); - masthead.checkNotificationMessage("Client successfully updated"); - - advancedTab - .termsOfServiceUrl("http://not.saveing.this/") - .revertFineGrain(); - advancedTab.checkTermsOfServiceUrl(termsOfServiceUrl); - }); - - it("Invalid terms of service URL", () => { - advancedTab.termsOfServiceUrl("not a url").saveFineGrain(); - - masthead.checkNotificationMessage( - "Client could not be updated: invalid_input", - ); - }); - }); -}); diff --git a/js/apps/admin-ui/cypress/e2e/clients_saml_test.spec.ts b/js/apps/admin-ui/cypress/e2e/clients_saml_test.spec.ts deleted file mode 100644 index 346843b7b9a..00000000000 --- a/js/apps/admin-ui/cypress/e2e/clients_saml_test.spec.ts +++ /dev/null @@ -1,192 +0,0 @@ -import LoginPage from "../support/pages/LoginPage"; -import Masthead from "../support/pages/admin-ui/Masthead"; -import ListingPage from "../support/pages/admin-ui/ListingPage"; -import SidebarPage from "../support/pages/admin-ui/SidebarPage"; -import ModalUtils from "../support/util/ModalUtils"; -import adminClient from "../support/util/AdminClient"; -import { keycloakBefore } from "../support/util/keycloak_hooks"; -import SettingsTab from "../support/pages/admin-ui/manage/clients/client_details/tabs/SettingsTab"; - -const loginPage = new LoginPage(); -const masthead = new Masthead(); -const sidebarPage = new SidebarPage(); -const listingPage = new ListingPage(); -const modalUtils = new ModalUtils(); - -describe("Clients SAML tests", () => { - describe("SAML test", () => { - const samlClientName = "saml"; - - before(() => { - adminClient.createClient({ - protocol: "saml", - clientId: samlClientName, - publicClient: false, - }); - }); - - after(() => { - adminClient.deleteClient(samlClientName); - }); - - beforeEach(() => { - loginPage.logIn(); - keycloakBefore(); - sidebarPage.goToClients(); - listingPage.searchItem(samlClientName).goToItemDetails(samlClientName); - }); - - it("should display the saml sections on details screen", () => { - cy.get(".pf-v5-c-jump-links__list").should(($ul) => { - expect($ul) - .to.contain("SAML capabilities") - .to.contain("Signature and Encryption"); - }); - }); - - it("should save force name id format", () => { - cy.get(".pf-v5-c-jump-links__list").contains("SAML capabilities").click(); - - cy.findByTestId("attributes.saml🍺force🍺post🍺binding").click({ - force: true, - }); - cy.findByTestId("settings-save").click(); - masthead.checkNotificationMessage("Client successfully updated"); - }); - }); - - describe("SAML keys tab", () => { - const clientId = "saml-keys"; - - before(() => { - adminClient.createClient({ - clientId, - protocol: "saml", - }); - }); - - after(() => { - adminClient.deleteClient(clientId); - }); - - beforeEach(() => { - loginPage.logIn(); - keycloakBefore(); - sidebarPage.goToClients(); - listingPage.searchItem(clientId).goToItemDetails(clientId); - cy.findByTestId("keysTab").click(); - }); - - it("should doesn't disable signature when cancel", () => { - cy.findByTestId("clientSignature").click({ force: true }); - - modalUtils - .checkModalTitle('Disable "Client signature required"') - .cancelModal(); - - cy.findAllByTestId("certificate").should("have.length", 1); - }); - - it("should disable client signature", () => { - cy.intercept( - "admin/realms/master/clients/*/certificates/saml.signing", - ).as("load"); - cy.findByTestId("clientSignature").click({ force: true }); - - modalUtils - .checkModalTitle('Disable "Client signature required"') - .confirmModal(); - - masthead.checkNotificationMessage("Client successfully updated"); - cy.findAllByTestId("certificate").should("have.length", 0); - }); - - it("should enable Encryption keys config", () => { - cy.findByTestId("encryptAssertions").click({ force: true }); - - cy.findByTestId("generate").click(); - masthead.checkNotificationMessage( - "New key pair and certificate generated successfully", - ); - - modalUtils.confirmModal(); - cy.findAllByTestId("certificate").should("have.length", 1); - }); - }); - - describe("SAML settings tab", () => { - const clientId = "saml-settings"; - const settingsTab = new SettingsTab(); - - before(() => { - adminClient.createClient({ - clientId, - protocol: "saml", - }); - }); - - after(() => { - adminClient.deleteClient(clientId); - }); - - beforeEach(() => { - loginPage.logIn(); - keycloakBefore(); - sidebarPage.goToClients(); - listingPage.searchItem(clientId).goToItemDetails(clientId); - }); - - it("should check SAML capabilities", () => { - cy.get(".pf-v5-c-jump-links__list").contains("SAML capabilities").click(); - - settingsTab.assertNameIdFormatDropdown(); - settingsTab.assertSAMLCapabilitiesSwitches(); - }); - - it("should check signature and encryption", () => { - cy.get(".pf-v5-c-jump-links__list") - .contains("Signature and Encryption") - .click(); - - settingsTab.assertSignatureAlgorithmDropdown(); - settingsTab.assertSignatureKeyNameDropdown(); - settingsTab.assertCanonicalizationDropdown(); - - settingsTab.assertSignatureEncryptionSwitches(); - }); - - it("should check access settings", () => { - cy.get(".pf-v5-c-jump-links__list").contains("Access settings").click(); - - const validUrl = - "http://localhost:8180/realms/master/protocol/" + - clientId + - "/clients/"; - const invalidUrlError = "Client could not be updated: invalid_input"; - - cy.findByTestId("rootUrl").type("Invalid URL"); - settingsTab.clickSaveBtn(); - masthead.checkNotificationMessage(invalidUrlError); - cy.findByTestId("rootUrl").clear(); - - cy.findByTestId("baseUrl").type("Invalid URL"); - settingsTab.clickSaveBtn(); - masthead.checkNotificationMessage(invalidUrlError); - cy.findByTestId("baseUrl").clear(); - - cy.findByTestId("rootUrl").type(validUrl); - cy.findByTestId("baseUrl").type(validUrl); - settingsTab.clickSaveBtn(); - masthead.checkNotificationMessage("Client successfully updated"); - - settingsTab.assertAccessSettings(); - }); - - it("should check login settings", () => { - cy.get(".pf-v5-c-jump-links__list").contains("Login settings").click(); - - settingsTab.assertLoginThemeDropdown(); - settingsTab.assertLoginSettings(); - }); - }); -}); diff --git a/js/apps/admin-ui/cypress/e2e/clients_test.spec.ts b/js/apps/admin-ui/cypress/e2e/clients_test.spec.ts deleted file mode 100644 index ce4a88c02ac..00000000000 --- a/js/apps/admin-ui/cypress/e2e/clients_test.spec.ts +++ /dev/null @@ -1,617 +0,0 @@ -import LoginPage from "../support/pages/LoginPage"; -import ListingPage from "../support/pages/admin-ui/ListingPage"; -import CreateClientPage from "../support/pages/admin-ui/manage/clients/CreateClientPage"; -import adminClient from "../support/util/AdminClient"; -import { keycloakBefore } from "../support/util/keycloak_hooks"; -import RoleMappingTab from "../support/pages/admin-ui/manage/RoleMappingTab"; -import ClientRolesTab from "../support/pages/admin-ui/manage/clients/ClientRolesTab"; -import ClientDetailsPage, { - ClientsDetailsTab, -} from "../support/pages/admin-ui/manage/clients/client_details/ClientDetailsPage"; -import CommonPage from "../support/pages/CommonPage"; -import DedicatedScopesMappersTab from "../support/pages/admin-ui/manage/clients/client_details/DedicatedScopesMappersTab"; -import { ClientRegistrationPage } from "../support/pages/admin-ui/manage/clients/ClientRegistrationPage"; - -let itemId = "client_crud"; -const loginPage = new LoginPage(); -const createClientPage = new CreateClientPage(); -const clientDetailsPage = new ClientDetailsPage(); -const commonPage = new CommonPage(); -const listingPage = new ListingPage(); -const dedicatedScopesMappersTab = new DedicatedScopesMappersTab(); - -describe("Clients test", () => { - const realmName = `clients-realm-${crypto.randomUUID()}`; - - before(() => adminClient.createRealm(realmName)); - - after(() => adminClient.deleteRealm(realmName)); - - describe("Client creation", () => { - beforeEach(() => { - loginPage.logIn(); - keycloakBefore(); - commonPage.sidebar().goToRealm(realmName); - commonPage.sidebar().goToClients(); - }); - - it("Should cancel creating client", () => { - commonPage.tableToolbarUtils().createClient(); - - createClientPage.continue().checkClientIdRequiredMessage(); - - createClientPage - .fillClientData("") - .selectClientType("OpenID Connect") - .cancel(); - - cy.url().should("not.include", "/add-client"); - }); - - it("Should check settings elements", () => { - commonPage.tableToolbarUtils().clickPrimaryButton(); - const clientId = "Test settings"; - - createClientPage - .fillClientData(clientId) - .continue() - .checkCapabilityConfigElements() - .continue() - .save(); - - commonPage - .masthead() - .checkNotificationMessage("Client created successfully"); - commonPage.sidebar().waitForPageLoad(); - - createClientPage - .checkCapabilityConfigElements() - .checkAccessSettingsElements() - .checkLoginSettingsElements() - .checkLogoutSettingsElements() - .deleteClientFromActionDropdown(); - - commonPage.modalUtils().confirmModal(); - commonPage.tableUtils().checkRowItemExists(clientId, false); - }); - - it("Should navigate to previous using 'back' button", () => { - commonPage.tableToolbarUtils().createClient(); - - createClientPage.continue().checkClientIdRequiredMessage(); - - createClientPage - .fillClientData("test_client") - .selectClientType("OpenID Connect") - .continue() - .back() - .checkGeneralSettingsStepActive(); - }); - - it("Should fail creating client", () => { - commonPage.tableToolbarUtils().createClient(); - - createClientPage.continue().checkClientIdRequiredMessage(); - - createClientPage - .fillClientData("") - .selectClientType("OpenID Connect") - .continue() - .checkClientIdRequiredMessage(); - - createClientPage.fillClientData("account").continue().continue().save(); - - // The error should inform about duplicated name/id - commonPage - .masthead() - .checkNotificationMessage( - "Could not create client: 'Client account already exists'", - ); - }); - - it("Client CRUD test", () => { - itemId += "_" + crypto.randomUUID(); - - // Create - commonPage.tableUtils().checkRowItemExists(itemId, false); - commonPage.tableToolbarUtils().clickPrimaryButton(); - createClientPage.cancel(); - commonPage.tableUtils().checkRowItemExists(itemId, false); - commonPage.tableToolbarUtils().clickPrimaryButton(); - - createClientPage - .selectClientType("OpenID Connect") - .fillClientData(itemId) - .continue() - .switchClientAuthentication() - .clickDirectAccess() - .clickImplicitFlow() - .clickOAuthDeviceAuthorizationGrant() - .clickOidcCibaGrant() - .clickServiceAccountRoles() - .clickStandardFlow() - .continue() - .save(); - - commonPage - .masthead() - .checkNotificationMessage("Client created successfully"); - - commonPage.sidebar().goToClients(); - - commonPage.tableToolbarUtils().searchItem("John Doe", false); - commonPage.emptyState().checkIfExists(true); - commonPage.tableToolbarUtils().searchItem(""); - commonPage.tableUtils().checkRowItemExists("account"); - commonPage.tableToolbarUtils().searchItem(itemId); - commonPage.tableUtils().checkRowItemExists(itemId); - - // Delete - commonPage.tableUtils().selectRowItemAction(itemId, "Delete"); - commonPage.sidebar().waitForPageLoad(); - commonPage - .modalUtils() - .checkModalTitle(`Delete ${itemId} ?`) - .confirmModal(); - commonPage - .masthead() - .checkNotificationMessage("The client has been deleted"); - commonPage.tableUtils().checkRowItemExists(itemId, false); - }); - - it("Should fail to create imported client with empty ID", () => { - commonPage.sidebar().goToClients(); - cy.findByTestId("importClient").click(); - cy.findByTestId("clientId").click(); - cy.findByText("Save").click(); - cy.findByText("Required field"); - }); - - const identicalClientId = "identical"; - - it("Should fail to create client with same ID", () => { - commonPage.sidebar().goToClients(); - commonPage.tableToolbarUtils().createClient(); - - createClientPage - .fillClientData(identicalClientId) - .continue() - .continue() - .save(); - - commonPage.masthead().closeAllAlertMessages(); - commonPage.sidebar().goToClients(); - cy.findByTestId("importClient").click(); - cy.findByTestId("realm-file").selectFile( - "cypress/fixtures/partial-import-test-data/import-identical-client.json", - { - action: "drag-drop", - }, - ); - - cy.wait(1000); - //cy.findByTestId("realm-file").contains('"clientId": "identical"') - cy.findByTestId("clientId").click(); - cy.findByText("Save").click(); - commonPage - .masthead() - .checkNotificationMessage( - "Could not import client: Client identical already exists", - true, - ); - }); - - it("should delete 'identical' client id", () => { - commonPage.sidebar().goToClients(); - cy.wrap(null).then(() => - adminClient.inRealm(realmName, () => - adminClient.deleteClient(identicalClientId), - ), - ); - }); - }); - - describe("Service account tab test", () => { - const serviceAccountTab = new RoleMappingTab("user"); - const serviceAccountName = `service-account-client${crypto.randomUUID()}`; - const createRealmRoleName = `create-realm-${crypto.randomUUID()}`; - const createRealmRoleType = `roles`; - - before(async () => { - await adminClient.inRealm(realmName, () => - adminClient.createClient({ - protocol: "openid-connect", - clientId: serviceAccountName, - publicClient: false, - authorizationServicesEnabled: true, - serviceAccountsEnabled: true, - standardFlowEnabled: true, - }), - ); - await adminClient.inRealm(realmName, () => - adminClient.createRealmRole({ - name: createRealmRoleName, - }), - ); - }); - - beforeEach(() => { - loginPage.logIn(); - keycloakBefore(); - commonPage.sidebar().goToRealm(realmName); - commonPage.sidebar().goToClients(); - }); - - after(async () => { - await adminClient.inRealm(realmName, () => - adminClient.deleteClient(serviceAccountName), - ); - await adminClient.inRealm(realmName, () => - adminClient.deleteRealmRole(createRealmRoleName), - ); - }); - - it("List", () => { - commonPage.tableToolbarUtils().searchItem(serviceAccountName); - commonPage.tableUtils().clickRowItemLink(serviceAccountName); - serviceAccountTab - .goToServiceAccountTab() - .checkRoles(["offline_access", "uma_authorization"], false) - .checkRoles([`default-roles-${realmName}`, "uma_protection"]) - .unhideInheritedRoles(); - - commonPage.sidebar().waitForPageLoad(); - - serviceAccountTab - .checkRoles([ - `default-roles-${realmName}`, - "offline_access", - "uma_authorization", - "uma_protection", - ]) - .hideInheritedRoles(); - - commonPage.sidebar().waitForPageLoad(); - - serviceAccountTab - .checkRoles(["offline_access", "uma_authorization"], false) - .checkRoles([`default-roles-${realmName}`, "uma_protection"]); - - listingPage - .searchItem("testing", false) - .checkEmptyList() - .searchItem("", false); - - serviceAccountTab - .checkRoles(["offline_access", "uma_authorization"], false) - .checkRoles([`default-roles-${realmName}`, "uma_protection"]); - }); - - it("Assign", () => { - commonPage.tableUtils().clickRowItemLink(serviceAccountName); - serviceAccountTab - .goToServiceAccountTab() - .assignRole(false) - .changeRoleTypeFilter(createRealmRoleType) - .selectRow(createRealmRoleName, true) - .assign(); - commonPage.masthead().checkNotificationMessage("Role mapping updated"); - - serviceAccountTab.selectRow(createRealmRoleName).unAssign(); - - commonPage.sidebar().waitForPageLoad(); - commonPage.modalUtils().checkModalTitle("Remove role?").confirmModal(); - commonPage.masthead().checkNotificationMessage("Role mapping updated"); - - //cy.intercept(`/admin/realms/${realmName}/users`).as("assignRoles"); - serviceAccountTab - .checkRoles([createRealmRoleName], false) - .assignRole(false); - - //cy.wait("@assignRoles"); - commonPage.sidebar().waitForPageLoad(); - - serviceAccountTab - .changeRoleTypeFilter("roles") - .selectRow("offline_access", true) - .selectRow(createRealmRoleName, true) - .assign(); - - commonPage.masthead().checkNotificationMessage("Role mapping updated"); - commonPage.sidebar().waitForPageLoad(); - - serviceAccountTab.unhideInheritedRoles(); - - commonPage.sidebar().waitForPageLoad(); - - serviceAccountTab.hideInheritedRoles(); - - serviceAccountTab.selectRow("offline_access").unAssign(); - - commonPage.modalUtils().confirmModal(); - - serviceAccountTab - .checkRoles(["admin", "offline_access"], false) - .checkRoles([createRealmRoleName]); - - listingPage.clickRowDetails(createRealmRoleName); - serviceAccountTab.unAssignFromDropdown(); - - commonPage.modalUtils().confirmModal(); - - commonPage.sidebar().waitForPageLoad(); - - serviceAccountTab.unhideInheritedRoles(); - - serviceAccountTab - .checkRoles([createRealmRoleName], false) - .checkRoles([ - `default-roles-${realmName}`, - "offline_access", - "uma_authorization", - "uma_protection", - ]); - }); - }); - - describe("Mapping tab", () => { - const mappingClient = "mapping-client"; - - beforeEach(() => { - loginPage.logIn(); - keycloakBefore(); - commonPage.sidebar().goToRealm(realmName); - commonPage.sidebar().goToClients(); - commonPage.tableToolbarUtils().searchItem(mappingClient); - commonPage.tableUtils().clickRowItemLink(mappingClient); - }); - - before(() => - adminClient.inRealm(realmName, () => - adminClient.createClient({ - protocol: "openid-connect", - clientId: mappingClient, - publicClient: false, - }), - ), - ); - - after(() => - adminClient.inRealm(realmName, () => - adminClient.deleteClient(mappingClient), - ), - ); - - it("Add mapping to openid client", () => { - clientDetailsPage - .goToClientScopesTab() - .clickDedicatedScope(mappingClient); - dedicatedScopesMappersTab.addPredefinedMapper(); - clientDetailsPage.modalUtils().table().clickHeaderItem(1, "input"); - clientDetailsPage.modalUtils().confirmModal(); - clientDetailsPage - .masthead() - .checkNotificationMessage("Mapping successfully created"); - }); - }); - - describe("Keys tab test", () => { - const keysName = "keys-client"; - - before( - async () => - await adminClient.inRealm(realmName, () => - adminClient.createClient({ - protocol: "openid-connect", - clientId: keysName, - publicClient: false, - }), - ), - ); - - beforeEach(() => { - loginPage.logIn(); - keycloakBefore(); - commonPage.sidebar().goToRealm(realmName); - commonPage.sidebar().goToClients(); - commonPage.tableToolbarUtils().searchItem(keysName); - commonPage.tableUtils().clickRowItemLink(keysName); - }); - - after(() => - adminClient.inRealm(realmName, () => adminClient.deleteClient(keysName)), - ); - - it("Generate new keys", () => { - const keysTab = clientDetailsPage.goToKeysTab(); - keysTab.clickGenerate(); - keysTab.fillGenerateModal("JKS", "keyname", "123", "1234").clickConfirm(); - - commonPage - .masthead() - .checkNotificationMessage( - "New key pair and certificate generated successfully", - ); - }); - }); - - describe("Realm client", () => { - const clientName = `${realmName}-realm`; - - beforeEach(() => { - loginPage.logIn(); - keycloakBefore(); - // Stay in master realm, do not switch to ${realmName} realm - commonPage.sidebar().goToClients(); - commonPage.tableToolbarUtils().searchItem(clientName); - commonPage.tableUtils().clickRowItemLink(clientName); - }); - - it("Displays the correct tabs", () => { - clientDetailsPage.goToSettingsTab(); - clientDetailsPage - .tabUtils() - .checkTabExists(ClientsDetailsTab.Settings, true) - .checkTabExists(ClientsDetailsTab.Roles, true) - .checkTabExists(ClientsDetailsTab.Sessions, true) - .checkTabExists(ClientsDetailsTab.Permissions, true) - .checkTabExists(ClientsDetailsTab.Advanced, true) - .checkTabExists(ClientsDetailsTab.UserEvents, true) - .checkNumberOfTabsIsEqual(6); - }); - - it("Hides the delete action", () => { - commonPage - .actionToolbarUtils() - .clickActionToggleButton() - .checkActionItemExists("Delete", false); - }); - }); - - describe("Bearer only", () => { - const clientId = "bearer-only"; - - before( - async () => - await adminClient.inRealm(realmName, () => - adminClient.createClient({ - clientId, - protocol: "openid-connect", - publicClient: false, - bearerOnly: true, - }), - ), - ); - - beforeEach(() => { - loginPage.logIn(); - keycloakBefore(); - - commonPage.sidebar().goToRealm(realmName); - commonPage.sidebar().goToClients(); - cy.intercept(`/admin/realms/${realmName}/clients/*`).as("fetchClient"); - commonPage.tableToolbarUtils().searchItem(clientId); - commonPage.tableUtils().clickRowItemLink(clientId); - cy.wait("@fetchClient"); - }); - - after(() => - adminClient.inRealm(realmName, () => adminClient.deleteClient(clientId)), - ); - - it("Shows an explainer text for bearer only clients", () => { - commonPage - .actionToolbarUtils() - .bearerOnlyExplainerLabelElement.trigger("mouseenter"); - commonPage - .actionToolbarUtils() - .bearerOnlyExplainerTooltipElement.should("exist"); - }); - - it("Hides the capability config section", () => { - cy.findByTestId("capability-config-form").should("not.exist"); - cy.findByTestId("jump-link-capability-config").should("not.exist"); - }); - }); - - describe("Generated home URLs for built-in clients", () => { - beforeEach(() => { - loginPage.logIn(); - keycloakBefore(); - commonPage.sidebar().goToRealm(realmName); - commonPage.sidebar().goToClients(); - }); - - it("Check account-console Home URL", () => { - cy.findByTestId("client-home-url-account-console").contains("/account/"); - }); - - it("Check security-admin-console Home URL", () => { - cy.findByTestId("client-home-url-security-admin-console").contains( - "/console/", - ); - }); - }); - - describe("Accessibility tests for clients", () => { - const clientId = "a11y-client"; - - beforeEach(() => { - loginPage.logIn(); - keycloakBefore(); - commonPage.sidebar().goToRealm(realmName); - commonPage.sidebar().goToClients(); - cy.injectAxe(); - }); - - it("Check a11y violations on load/ clients list tab", () => { - cy.checkA11y(); - }); - - it("Check a11y violations on create client page", () => { - commonPage.sidebar().goToClients(); - commonPage.tableToolbarUtils().createClient(); - createClientPage.fillClientData(clientId); - cy.checkA11y(); - - createClientPage.continue(); - cy.checkA11y(); - - createClientPage.continue(); - cy.checkA11y(); - }); - - it("Check a11y violations on client details page", () => { - const rolesTab = new ClientRolesTab(); - - commonPage.sidebar().goToClients(); - commonPage.tableToolbarUtils().createClient(); - createClientPage.fillClientData(clientId).continue().continue().save(); - cy.checkA11y(); - - rolesTab.goToRolesTab(); - cy.checkA11y(); - - clientDetailsPage.goToClientScopesTab(); - cy.checkA11y(); - - clientDetailsPage.goToClientScopesEvaluateTab(); - cy.checkA11y(); - - clientDetailsPage.goToClientScopesEvaluateEffectiveRoleScopeMappingsTab(); - cy.checkA11y(); - - clientDetailsPage.goToClientScopesEvaluateGeneratedAccessTokenTab(); - cy.checkA11y(); - - clientDetailsPage.goToClientScopesEvaluateGeneratedIdTokenTab(); - cy.checkA11y(); - - clientDetailsPage.goToClientScopesEvaluateGeneratedUserInfoTab(); - cy.checkA11y(); - - clientDetailsPage.goToAdvancedTab(); - cy.checkA11y(); - }); - - it("Check a11y violations in delete dialog", () => { - commonPage.tableToolbarUtils().searchItem(clientId, false); - commonPage.tableUtils().selectRowItemAction(clientId, "Delete"); - cy.checkA11y(); - cy.findAllByTestId("confirm").click(); - }); - - it("Check a11y violations on client registration/ anonymous access policies tab", () => { - const clientRegistration = new ClientRegistrationPage(); - clientRegistration.goToClientRegistrationTab(); - cy.checkA11y(); - }); - - it("Check a11y violations on client registration/ authenticated access policies tab", () => { - const clientRegistration = new ClientRegistrationPage(); - clientRegistration.goToClientRegistrationTab(); - cy.findByTestId("authenticated").click(); - cy.checkA11y(); - }); - }); -}); diff --git a/js/apps/admin-ui/cypress/e2e/events_test.spec.ts b/js/apps/admin-ui/cypress/e2e/events_test.spec.ts deleted file mode 100644 index 40344a2e24c..00000000000 --- a/js/apps/admin-ui/cypress/e2e/events_test.spec.ts +++ /dev/null @@ -1,502 +0,0 @@ -import LoginPage from "../support/pages/LoginPage"; -import SidebarPage from "../support/pages/admin-ui/SidebarPage"; -import UserEventsTab, { - UserEventSearchData, -} from "../support/pages/admin-ui/manage/events/tabs/UserEventsTab"; -import AdminEventsTab from "../support/pages/admin-ui/manage/events/tabs/AdminEventsTab"; -import RealmSettingsPage from "../support/pages/admin-ui/manage/realm_settings/RealmSettingsPage"; -import Masthead from "../support/pages/admin-ui/Masthead"; -import { keycloakBefore } from "../support/util/keycloak_hooks"; -import EventsPage, { - EventsTab, -} from "../support/pages/admin-ui/manage/events/EventsPage"; -import ListingPage from "../support/pages/admin-ui/ListingPage"; -import adminClient from "../support/util/AdminClient"; - -const loginPage = new LoginPage(); -const sidebarPage = new SidebarPage(); -const userEventsTab = new UserEventsTab(); -const eventsPage = new EventsPage(); -const adminEventsTab = new AdminEventsTab(); -const realmSettingsPage = new RealmSettingsPage(); -const masthead = new Masthead(); -const listingPage = new ListingPage(); - -const dateFrom = new Date(); -dateFrom.setDate(dateFrom.getDate() - 100); -const dateFromFormatted = `${dateFrom.getFullYear()}-${dateFrom.getMonth()}-${dateFrom.getDay()}`; -const dateTo = new Date(); -dateTo.setDate(dateTo.getDate() + 100); -const dateToFormatted = `${dateTo.getFullYear()}-${dateTo.getMonth()}-${dateTo.getDay()}`; - -describe.skip("Events tests", () => { - const eventsTestUser = { - eventsTestUserId: "", - userRepresentation: { - username: "events-test" + crypto.randomUUID(), - enabled: true, - credentials: [{ value: "events-test" }], - }, - }; - const eventsTestUserClientId = "admin-cli"; - - before(async () => { - const result = await adminClient.createUser( - eventsTestUser.userRepresentation, - ); - eventsTestUser.eventsTestUserId = result.id!; - }); - - after(() => - adminClient.deleteUser(eventsTestUser.userRepresentation.username), - ); - - describe("User events list", () => { - beforeEach(() => { - loginPage.logIn(); - keycloakBefore(); - sidebarPage.goToEvents(); - }); - - it("Show empty when no save events", () => { - sidebarPage.goToRealmSettings(); - realmSettingsPage - .goToEventsTab() - .goToUserEventsSettingsSubTab() - .enableSaveEventsSwitch() - .save() - .clearUserEvents(); - - cy.wait(5000); - - sidebarPage.goToEvents(); - eventsPage.goToUserEventsTab(); - userEventsTab.assertNoSearchResultsExist(true); - }); - - it("Expand item to see more information", () => { - listingPage.expandRow(0).assertExpandedRowContainText(0, "code_id"); - }); - }); - - describe("Search user events list", () => { - const eventTypes = [ - "LOGOUT", - "CODE_TO_TOKEN", - "CODE_TO_TOKEN_ERROR", - "LOGIN_ERROR", - "LOGIN", - ]; - - beforeEach(() => { - loginPage.logIn(); - keycloakBefore(); - sidebarPage.goToEvents(); - }); - - it("Check search dropdown display", () => { - sidebarPage.goToRealmSettings(); - realmSettingsPage - .goToEventsTab() - .goToUserEventsSettingsSubTab() - .disableSaveEventsSwitch() - .save(); - - cy.wait(5000); - - masthead.signOut(); - loginPage.logIn(); - cy.visit("/"); - - sidebarPage.goToEvents(); - eventsPage.tabUtils().checkIsCurrentTab(EventsTab.UserEvents); - userEventsTab.assertSearchUserEventDropdownMenuExist(true); - }); - - it("Check user events search form fields display", () => { - userEventsTab - .openSearchUserEventDropdownMenu() - .assertUserSearchDropdownMenuHasLabels(); - }); - - it("Check event type dropdown options exist", () => { - userEventsTab - .openSearchUserEventDropdownMenu() - .openEventTypeSelectMenu() - .clickEventTypeSelectItem(eventTypes[0]) - .clickEventTypeSelectItem(eventTypes[1]) - .clickEventTypeSelectItem(eventTypes[2]) - .clickEventTypeSelectItem(eventTypes[3]) - .closeEventTypeSelectMenu(); - }); - - it("Check `search events` button disabled by default", () => { - userEventsTab - .openSearchUserEventDropdownMenu() - .assertSearchEventBtnIsEnabled(false); - }); - - it("Check user events search and removal work", () => { - userEventsTab - .searchUserEventByEventType([eventTypes[0]]) - .assertEventTypeChipGroupItemExist(eventTypes[0], true) - .assertEventTypeChipGroupItemExist(eventTypes[1], false) - .assertEventTypeChipGroupItemExist(eventTypes[2], false) - .assertEventTypeChipGroupItemExist(eventTypes[3], false) - .assertNoSearchResultsExist(true) - .removeEventTypeChipGroupItem(eventTypes[0]) - .assertEventTypeChipGroupExist(false); - }); - - it("Check for no events logged", () => { - userEventsTab - .searchUserEventByUserId("test") - .assertNoSearchResultsExist(true); - }); - - it("Check `search events` button enabled", () => { - userEventsTab - .openSearchUserEventDropdownMenu() - .assertSearchEventBtnIsEnabled(false) - .typeUserId("11111") - .assertSearchEventBtnIsEnabled(true); - }); - - it("Search by user ID", () => { - sidebarPage.goToRealmSettings(); - realmSettingsPage - .goToEventsTab() - .goToUserEventsSettingsSubTab() - .enableSaveEventsSwitch() - .save(); - sidebarPage.goToEvents(); - cy.wrap(null).then(() => - adminClient.loginUser( - eventsTestUser.userRepresentation.username, - eventsTestUser.userRepresentation.credentials[0].value, - eventsTestUserClientId, - ), - ); - userEventsTab - .searchUserEventByUserId(eventsTestUser.eventsTestUserId) - .assertUserIdChipGroupExist(true) - .assertEventTypeChipGroupExist(false) - .assertClientChipGroupExist(false) - .assertDateFromChipGroupExist(false) - .assertDateToChipGroupExist(false); - listingPage.itemsGreaterThan(0); - }); - - it("Search by event type", () => { - userEventsTab - .searchUserEventByEventType([eventTypes[4]]) - .assertUserIdChipGroupExist(false) - .assertEventTypeChipGroupExist(true) - .assertClientChipGroupExist(false) - .assertDateFromChipGroupExist(false) - .assertDateToChipGroupExist(false); - listingPage.itemsGreaterThan(0); - }); - - it("Search by client", () => { - userEventsTab - .searchUserEventByClient(eventsTestUserClientId) - .assertUserIdChipGroupExist(false) - .assertEventTypeChipGroupExist(false) - .assertClientChipGroupExist(true) - .assertDateFromChipGroupExist(false) - .assertDateToChipGroupExist(false); - listingPage.itemsGreaterThan(0); - }); - - it("Search by date from", () => { - userEventsTab - .searchUserEventByDateFrom(dateFromFormatted) - .assertUserIdChipGroupExist(false) - .assertEventTypeChipGroupExist(false) - .assertClientChipGroupExist(false) - .assertDateFromChipGroupExist(true) - .assertDateToChipGroupExist(false); - listingPage.itemsGreaterThan(0); - }); - - it("Search by dato to", () => { - userEventsTab - .searchUserEventByDateTo(dateToFormatted) - .assertUserIdChipGroupExist(false) - .assertEventTypeChipGroupExist(false) - .assertClientChipGroupExist(false) - .assertDateFromChipGroupExist(false) - .assertDateToChipGroupExist(true); - listingPage.itemsGreaterThan(0); - }); - - it("Search by Ip Adress to", () => { - userEventsTab - .assertIpAddressChipGroupExist(true) - .assertUserIdChipGroupExist(false) - .assertEventTypeChipGroupExist(false) - .assertClientChipGroupExist(false) - .assertDateFromChipGroupExist(false) - .assertDateToChipGroupExist(false); - listingPage.itemsGreaterThan(0); - }); - - it("Search by all elements", () => { - const searchData = new UserEventSearchData(); - searchData.client = eventsTestUserClientId; - searchData.userId = eventsTestUser.eventsTestUserId; - searchData.eventType = [eventTypes[4]]; - searchData.dateFrom = dateFromFormatted; - searchData.dateTo = dateToFormatted; - userEventsTab - .searchUserEvent(searchData) - .assertUserIdChipGroupExist(true) - .assertEventTypeChipGroupExist(true) - .assertClientChipGroupExist(true) - .assertDateFromChipGroupExist(true) - .assertDateToChipGroupExist(true); - listingPage.itemsGreaterThan(0); - }); - - it("Check `search user events` button enabled", () => { - userEventsTab - .openSearchUserEventDropdownMenu() - .typeIpAddress("11111") - .assertSearchEventBtnIsEnabled(true); - }); - }); - - describe("Admin events list", () => { - const realmName = crypto.randomUUID(); - - before(() => adminClient.createRealm(realmName)); - - after(() => adminClient.deleteRealm(realmName)); - - beforeEach(() => { - loginPage.logIn(); - keycloakBefore(); - sidebarPage.goToRealm(realmName); - sidebarPage.goToEvents(); - eventsPage.goToAdminEventsTab(); - }); - - it("Show events", () => { - sidebarPage.goToRealmSettings(); - realmSettingsPage - .goToEventsTab() - .goToAdminEventsSettingsSubTab() - .enableSaveEvents() - .save(); - sidebarPage.goToEvents(); - eventsPage.goToAdminEventsTab(); - listingPage.itemsGreaterThan(0); - }); - - it("Show empty when no save events", () => { - sidebarPage.goToRealmSettings(); - realmSettingsPage - .goToEventsTab() - .goToAdminEventsSettingsSubTab() - .disableSaveEvents() - .save({ waitForRealm: false, waitForConfig: true }) - .clearAdminEvents(); - - sidebarPage.goToEvents(); - eventsPage.goToAdminEventsTab(); - adminEventsTab.assertNoSearchResultsExist(true); - }); - }); - - describe("Search admin events list", () => { - const resourceTypes = ["REALM"]; - const operationTypes = ["UPDATE"]; - - beforeEach(() => { - loginPage.logIn(); - keycloakBefore(); - sidebarPage.goToEvents(); - eventsPage.goToAdminEventsTab(); - }); - - it("Search by resource types", () => { - sidebarPage.goToRealmSettings(); - realmSettingsPage - .goToEventsTab() - .goToAdminEventsSettingsSubTab() - .enableSaveEvents() - .save({ waitForRealm: false, waitForConfig: true }); - sidebarPage.goToEvents(); - eventsPage.goToAdminEventsTab(); - adminEventsTab - .searchAdminEventByResourceTypes([resourceTypes[0]]) - .assertResourceTypesChipGroupExist(true); - listingPage.itemsGreaterThan(0); - }); - - it("Search by operation types", () => { - adminEventsTab - .searchAdminEventByOperationTypes([operationTypes[0]]) - .assertOperationTypesChipGroupExist(true); - listingPage.itemsGreaterThan(0); - }); - - it("Search by resource path", () => { - adminEventsTab - .searchAdminEventByResourcePath("test") - .assertResourcePathChipGroupExist(true); - }); - - it("Search by realm", () => { - adminEventsTab - .searchAdminEventByRealm("master") - .assertRealmChipGroupExist(true); - }); - - it("Search by client", () => { - adminEventsTab - .searchAdminEventByClient("admin-cli") - .assertClientChipGroupExist(true); - }); - - it("Search by user ID", () => { - adminEventsTab - .searchAdminEventByUser("test") - .assertUserChipGroupExist(true); - }); - - it("Search by IP address", () => { - adminEventsTab - .searchAdminEventByIpAddress("test") - .assertIpAddressChipGroupExist(true); - }); - - it("Search by date from", () => { - adminEventsTab - .searchAdminEventByDateTo(dateToFormatted) - .assertDateToChipGroupExist(true); - }); - - it("Search by date to", () => { - adminEventsTab - .searchAdminEventByDateFrom(dateFromFormatted) - .assertDateFromChipGroupExist(true); - }); - }); - - describe("Search admin events", () => { - beforeEach(() => { - loginPage.logIn(); - keycloakBefore(); - sidebarPage.goToEvents(); - eventsPage.goToAdminEventsTab(); - }); - - it("Check admin events search form fields display", () => { - sidebarPage.goToRealmSettings(); - realmSettingsPage - .goToEventsTab() - .goToAdminEventsSettingsSubTab() - .disableSaveEvents() - .save({ waitForRealm: false, waitForConfig: true }); - sidebarPage.goToEvents(); - eventsPage.goToAdminEventsTab(); - adminEventsTab - .openSearchAdminEventDropdownMenu() - .assertAdminSearchDropdownMenuHasLabels(); - }); - - it("Check `search admin events` button disabled by default", () => { - adminEventsTab - .openSearchAdminEventDropdownMenu() - .assertSearchAdminBtnEnabled(false); - }); - - it("Check admin events search and removal work", () => { - sidebarPage.goToEvents(); - eventsPage - .goToAdminEventsTab() - .searchAdminEventByResourcePath("events/config") - .assertResourcePathChipGroupItemExist("events/config", true) - .removeResourcePathChipGroup(); - listingPage.itemContainValue("UPDATE", 3, "UPDATE"); - }); - - it("Check for no events logged", () => { - adminEventsTab - .searchAdminEventByResourcePath("events/test") - .assertNoSearchResultsExist(true); - }); - - it("Check `search admin events` button enabled", () => { - adminEventsTab - .openSearchAdminEventDropdownMenu() - .typeIpAddress("11111") - .assertSearchAdminBtnEnabled(true); - }); - }); - - describe("Check more button opens auth and representation dialogs", () => { - beforeEach(() => { - loginPage.logIn(); - keycloakBefore(); - sidebarPage.goToEvents(); - eventsPage.goToAdminEventsTab(); - }); - - it("Check auth dialog opens and is not empty", () => { - listingPage.clickRowDetails("UPDATE").clickDetailMenu("Auth"); - adminEventsTab.assertAuthDialogIsNotEmpty(); - }); - - it("Check representation dialog opens and is not empty", () => { - listingPage.clickRowDetails("UPDATE").clickDetailMenu("Representation"); - adminEventsTab.assertRepresentationDialogIsNotEmpty(); - }); - }); - - describe("Accessibility tests for events", () => { - beforeEach(() => { - loginPage.logIn(); - keycloakBefore(); - sidebarPage.goToEvents(); - cy.injectAxe(); - }); - - it("Check a11y violations on load/ user events tab", () => { - cy.checkA11y(); - }); - - it("Check a11y violations in user events search form", () => { - userEventsTab.openSearchUserEventDropdownMenu(); - cy.checkA11y(); - }); - - it("Check a11y violations on admin events tab", () => { - eventsPage.goToAdminEventsTab(); - cy.checkA11y(); - }); - - it("Check a11y violations in admin events search form", () => { - sidebarPage.goToEvents(); - eventsPage.goToAdminEventsTab(); - adminEventsTab.openSearchAdminEventDropdownMenu(); - cy.checkA11y(); - }); - - it("Check a11y violations in Auth dialog", () => { - sidebarPage.goToEvents(); - eventsPage.goToAdminEventsTab(); - listingPage.clickRowDetails("CREATE").clickDetailMenu("Auth"); - cy.checkA11y(); - }); - - it("Check a11y violations in Representation dialog", () => { - sidebarPage.goToEvents(); - eventsPage.goToAdminEventsTab(); - listingPage.clickRowDetails("CREATE").clickDetailMenu("Representation"); - cy.checkA11y(); - }); - }); -}); diff --git a/js/apps/admin-ui/cypress/e2e/group_test.spec.ts b/js/apps/admin-ui/cypress/e2e/group_test.spec.ts deleted file mode 100644 index fb3d21dbe2d..00000000000 --- a/js/apps/admin-ui/cypress/e2e/group_test.spec.ts +++ /dev/null @@ -1,539 +0,0 @@ -import GroupModal from "../support/pages/admin-ui/manage/groups/GroupModal"; -import GroupDetailPage from "../support/pages/admin-ui/manage/groups/group_details/GroupDetailPage"; -import AttributesTab from "../support/pages/admin-ui/manage/AttributesTab"; -import { SearchGroupPage } from "../support/pages/admin-ui/manage/groups/SearchGroupPage"; -import SidebarPage from "../support/pages/admin-ui/SidebarPage"; -import LoginPage from "../support/pages/LoginPage"; -import { keycloakBefore } from "../support/util/keycloak_hooks"; -import GroupPage from "../support/pages/admin-ui/manage/groups/GroupPage"; -import ChildGroupsTab from "../support/pages/admin-ui/manage/groups/group_details/tabs/ChildGroupsTab"; -import MembersTab from "../support/pages/admin-ui/manage/groups/group_details/tabs/MembersTab"; -import adminClient from "../support/util/AdminClient"; -import { range } from "lodash-es"; -import RoleMappingTab from "../support/pages/admin-ui/manage/RoleMappingTab"; -import CommonPage from "../support/pages/CommonPage"; - -describe("Group test", () => { - const loginPage = new LoginPage(); - const sidebarPage = new SidebarPage(); - const groupModal = new GroupModal(); - const searchGroupPage = new SearchGroupPage(); - const attributesTab = new AttributesTab(); - const groupPage = new GroupPage(); - const groupDetailPage = new GroupDetailPage(); - const childGroupsTab = new ChildGroupsTab(); - const membersTab = new MembersTab(); - const commonPage = new CommonPage(); - - const groupNamePrefix = "group_"; - let groupName: string; - const groupNames: string[] = []; - const predefinedGroups = ["level", "level1", "level2", "level3"]; - const emptyGroup = "empty-group"; - let users: { id: string; username: string }[] = []; - const username = "test-user"; - - const duplicatedGroupErrorMessage = { - mainGroup: "Could not create group Top level group named '", - childGroup: "Could not create group Sibling group named '", - }; - - before(async () => { - users = await Promise.all( - range(5).map((index) => { - const user = adminClient - .createUser({ - username: username + index, - enabled: true, - }) - .then((user) => { - return { id: user.id!, username: username + index }; - }); - return user; - }), - ); - }); - - after( - async () => - await Promise.all([ - adminClient.deleteGroups(), - ...range(5).map((index) => adminClient.deleteUser(username + index)), - ]), - ); - - beforeEach(() => { - loginPage.logIn(); - keycloakBefore(); - sidebarPage.goToGroups(); - groupName = groupNamePrefix + crypto.randomUUID(); - groupNames.push(groupName); - }); - - describe("List", () => { - it("Create group from empty option", () => { - groupPage - .assertNoGroupsInThisRealmEmptyStateMessageExist(true) - .createGroup(groupName, true) - .assertNotificationGroupCreated() - .searchGroup(groupName, true) - .assertGroupItemExist(groupName, true); - }); - - it("Create group from search bar", () => { - groupPage - .assertNoGroupsInThisRealmEmptyStateMessageExist(false) - .createGroup(groupName, false) - .assertNotificationGroupCreated() - .searchGroup(groupName, true) - .assertGroupItemExist(groupName, true); - }); - - it("Fail to create group with empty name", () => { - groupPage - .assertNoGroupsInThisRealmEmptyStateMessageExist(false) - .createGroup(" ", false) - .assertNotificationCouldNotCreateGroupWithEmptyName(); - groupModal.closeModal(); - }); - - it("Fail to create group with duplicated name", () => { - groupPage - .assertNoGroupsInThisRealmEmptyStateMessageExist(false) - .createGroup(groupName, false) - .createGroup(groupName, false) - .assertNotificationCouldNotCreateGroupWithDuplicatedName( - groupName, - duplicatedGroupErrorMessage.mainGroup, - ); - groupModal.closeModal(); - groupPage.searchGroup(groupName).assertGroupItemsEqual(1); - }); - - it("Empty search", () => { - groupPage.searchGroup(" ").assertNoSearchResultsMessageExist(true); - }); - - it("Search group that exists", () => { - groupPage - .searchGroup(groupNames[0]) - .assertGroupItemExist(groupNames[0], true); - }); - - it("Search group that does not exists", () => { - groupPage - .searchGroup("not-existent-group") - .assertNoSearchResultsMessageExist(true); - }); - - it("Duplicate group from item bar", () => { - groupPage - .duplicateGroupItem(groupNames[0]) - .assertNotificationGroupDuplicated(); - }); - - it("Delete group from item bar", () => { - groupPage - .searchGroup(groupNames[0], true) - .deleteGroupItem(groupNames[0]) - .assertNotificationGroupDeleted() - .searchGroup(groupNames[0], true) - .assertNoSearchResultsMessageExist(true); - }); - - it("Delete group from search bar", () => { - groupPage - .selectGroupItemCheckbox([groupNames[1]]) - .deleteSelectedGroups() - .assertNotificationGroupDeleted() - .searchGroup(groupNames[1]) - .assertNoSearchResultsMessageExist(true); - }); - - it("Delete groups from search bar", () => { - cy.wrap(null).then(() => - adminClient.createGroup("group_multiple_deletion_test"), - ); - cy.reload(); - groupPage - .selectGroupItemCheckboxAllRows() - .deleteSelectedGroups() - .assertNotificationGroupsDeleted() - .assertNoGroupsInThisRealmEmptyStateMessageExist(true); - }); - }); - - describe("Search group under current group", () => { - before(async () => { - const createdGroups = await adminClient.createSubGroups(predefinedGroups); - await Promise.all([ - range(5).map((index) => { - adminClient.addUserToGroup( - users[index].id!, - createdGroups[index % 3].id, - ); - }), - ]); - }); - - it("Search child group in group", () => { - groupPage - .goToGroupChildGroupsTab(predefinedGroups[0]) - .searchGroup(predefinedGroups[1]) - .assertGroupItemExist(predefinedGroups[1], true); - }); - - it("Search non existing child group in group", () => { - groupPage - .goToGroupChildGroupsTab(predefinedGroups[0]) - .searchGroup("non-existent-sub-group") - .assertNoSearchResultsMessageExist(true); - }); - - it("Empty search in group", () => { - groupPage - .goToGroupChildGroupsTab(predefinedGroups[0]) - .searchGroup(" ") - .assertNoSearchResultsMessageExist(true); - }); - }); - - describe("Group Actions", () => { - const groupNameDeleteHeaderAction = "group_test_delete_header_action"; - - before(async () => { - await adminClient.createGroup(groupNameDeleteHeaderAction); - }); - - after(async () => { - await adminClient.deleteGroups(); - }); - - describe("Search globally", () => { - it("Navigate to parent group details", () => { - searchGroupPage - .searchGroup(predefinedGroups[0]) - .goToGroupChildGroupsTab(predefinedGroups[0]) - .assertGroupItemExist(predefinedGroups[1], true); - }); - }); - - it("Rename group", () => { - groupPage.goToGroupChildGroupsTab(predefinedGroups[0]); - groupDetailPage - .renameGroup("new_group_name") - .assertNotificationGroupUpdated() - .assertHeaderGroupNameEqual("new_group_name") - .renameGroup(predefinedGroups[0]) - .assertNotificationGroupUpdated() - .assertHeaderGroupNameEqual(predefinedGroups[0]); - }); - - it("Delete group from group details", () => { - groupPage.goToGroupChildGroupsTab(groupNameDeleteHeaderAction); - groupDetailPage - .headerActionDeleteGroup() - .assertNotificationGroupDeleted() - .assertGroupItemExist(groupNameDeleteHeaderAction, false); - }); - }); - - describe("Child Groups", () => { - before(async () => { - await adminClient.createGroup(predefinedGroups[0]); - }); - - after(async () => { - await adminClient.deleteGroups(); - }); - - beforeEach(() => { - groupPage.goToGroupChildGroupsTab(predefinedGroups[0]); - }); - - it("Check empty state", () => { - childGroupsTab.assertNoGroupsInThisSubGroupEmptyStateMessageExist(true); - }); - - it("Create group from empty state", () => { - childGroupsTab - .createGroup(predefinedGroups[1], true) - .assertNotificationGroupCreated(); - }); - - it("Create group from search bar", () => { - childGroupsTab - .createGroup(predefinedGroups[2], false) - .assertNotificationGroupCreated(); - }); - - it("Fail to create group with empty name", () => { - childGroupsTab - .createGroup(" ", false) - .assertNotificationCouldNotCreateGroupWithEmptyName(); - }); - - // https://github.com/keycloak/keycloak-admin-ui/issues/2726 - it("Fail to create group with duplicated name", () => { - childGroupsTab - .createGroup(predefinedGroups[2], false) - .assertNotificationCouldNotCreateGroupWithDuplicatedName( - predefinedGroups[2], - duplicatedGroupErrorMessage.childGroup, - ); - }); - - it("Move group from item bar", () => { - childGroupsTab - .moveGroupItemAction(predefinedGroups[1], [ - predefinedGroups[0], - predefinedGroups[2], - ]) - .goToGroupChildGroupsTab(predefinedGroups[2]) - .assertGroupItemExist(predefinedGroups[1], true); - }); - - it("Search group", () => { - childGroupsTab - .searchGroup(predefinedGroups[2]) - .assertGroupItemExist(predefinedGroups[2], true); - }); - - it("Show child group in groups", () => { - childGroupsTab - .goToGroupChildGroupsTab(predefinedGroups[2]) - .goToGroupChildGroupsTab(predefinedGroups[1]) - .assertNoGroupsInThisSubGroupEmptyStateMessageExist(true); - }); - - it("Delete group from search bar", () => { - childGroupsTab - .goToGroupChildGroupsTab(predefinedGroups[2]) - .selectGroupItemCheckbox([predefinedGroups[1]]) - .deleteSelectedGroups() - .assertNotificationGroupDeleted(); - }); - - it("Delete group from item bar", () => { - childGroupsTab - .deleteGroupItem(predefinedGroups[2]) - .assertNotificationGroupDeleted() - .assertNoGroupsInThisSubGroupEmptyStateMessageExist(true); - }); - }); - - describe("Members", () => { - before(async () => { - const createdGroups = await adminClient.createSubGroups(predefinedGroups); - await Promise.all([ - range(5).map((index) => { - adminClient.addUserToGroup( - users[index].id!, - createdGroups[index % 3].id, - ); - }), - adminClient.createGroup(emptyGroup), - adminClient.createUser({ username: "new", enabled: true }), - ]); - }); - - after(() => adminClient.deleteUser("new")); - - beforeEach(() => { - groupPage.goToGroupChildGroupsTab(predefinedGroups[0]); - childGroupsTab.goToMembersTab(); - }); - - it("Add member from search bar", () => { - membersTab - .addMember(["new"], false) - .assertNotificationUserAddedToTheGroup(1); - }); - - it("Show members with sub-group users", () => { - membersTab - .assertUserItemExist(users[0].username, true) - .assertUserItemExist("new", true) - .assertUserItemExist(users[3].username, true) - .clickCheckboxIncludeSubGroupUsers() - .assertUserItemExist("new", true) - .assertUserItemExist(users[0].username, true) - .assertUserItemExist(users[1].username, true) - .assertUserItemExist(users[2].username, true) - .assertUserItemExist(users[3].username, true) - .assertUserItemExist(users[4].username, true) - .goToChildGroupsTab() - .goToGroupChildGroupsTab(predefinedGroups[1]) - .goToMembersTab() - .assertUserItemExist(users[1].username, true) - .assertUserItemExist(users[4].username, true) - .goToChildGroupsTab() - .goToGroupChildGroupsTab(predefinedGroups[2]) - .goToMembersTab() - .assertUserItemExist(users[2].username, true); - }); - - it("Add member from empty state", () => { - sidebarPage.goToGroups(); - groupPage.goToGroupChildGroupsTab(emptyGroup); - childGroupsTab.goToMembersTab(); - membersTab - .addMember([users[0].username, users[1].username], true) - .assertNotificationUserAddedToTheGroup(2); - }); - - it("Leave group from search bar", () => { - sidebarPage.goToGroups(); - groupPage.goToGroupChildGroupsTab(emptyGroup); - childGroupsTab.goToMembersTab(); - membersTab - .selectUserItemCheckbox([users[0].username]) - .leaveGroupSelectedUsers() - .assertNotificationUserLeftTheGroup(1) - .assertUserItemExist(users[0].username, false); - }); - - it("Leave group from item bar", () => { - sidebarPage.goToGroups(); - groupPage.goToGroupChildGroupsTab(emptyGroup); - childGroupsTab.goToMembersTab(); - membersTab - .leaveGroupUserItem(users[1].username) - .assertNotificationUserLeftTheGroup(1) - .assertNoUsersFoundEmptyStateMessageExist(true); - }); - - it("Show memberships from item bar", () => { - sidebarPage.goToGroups(); - groupPage.goToGroupChildGroupsTab(predefinedGroups[0]); - childGroupsTab.goToMembersTab(); - membersTab - .showGroupMembershipsItem(users[3].username) - .assertGroupItemExist(predefinedGroups[0], true) - .cancelShowGroupMembershipsModal(); - }); - }); - - describe("Breadcrumbs", () => { - it("Navigate to parent group", () => { - groupPage - .goToGroupChildGroupsTab(predefinedGroups[0]) - .goToGroupChildGroupsTab(predefinedGroups[1]) - .goToGroupChildGroupsTab(predefinedGroups[2]) - .goToGroupChildGroupsTab(predefinedGroups[3]); - cy.reload(); - groupPage.clickBreadcrumbItem(predefinedGroups[2]); - groupDetailPage.assertHeaderGroupNameEqual(predefinedGroups[2]); - groupPage.clickBreadcrumbItem(predefinedGroups[1]); - groupDetailPage.assertHeaderGroupNameEqual(predefinedGroups[1]); - groupPage.clickBreadcrumbItem(predefinedGroups[0]); - groupDetailPage.assertHeaderGroupNameEqual(predefinedGroups[0]); - groupPage - .clickBreadcrumbItem("Groups") - .assertGroupItemExist(predefinedGroups[0], true); - }); - }); - - describe("Attributes", () => { - beforeEach(() => { - groupPage.goToGroupChildGroupsTab(predefinedGroups[0]); - groupDetailPage.goToAttributesTab(); - }); - - it("Add attribute", () => { - attributesTab.addAttribute("key", "value").save(); - groupPage.assertNotificationGroupUpdated(); - }); - - it("Remove attribute", () => { - attributesTab.deleteAttribute(0); - attributesTab.assertEmpty(); - groupPage.assertNotificationGroupUpdated(); - }); - - it("Revert changes", () => { - attributesTab - .addAttribute("key", "value") - .addAnAttributeButton() - .revert() - .assertEmpty(); - }); - }); - - describe("'Move to' function", () => { - it("Move group to other group", () => { - groupPage - .moveGroupItemAction(predefinedGroups[0], [emptyGroup]) - .goToGroupChildGroupsTab(emptyGroup) - .assertGroupItemExist(predefinedGroups[0], true); - }); - - it("Move group to root", () => { - groupPage - .goToGroupChildGroupsTab(emptyGroup) - .moveGroupItemAction(predefinedGroups[0], ["root"]); - sidebarPage.goToGroups(); - groupPage.assertGroupItemExist(predefinedGroups[0], true); - }); - }); - - describe("Role mappings", () => { - const roleMappingTab = new RoleMappingTab("group"); - - beforeEach(() => { - groupPage.goToGroupChildGroupsTab(predefinedGroups[0]); - groupDetailPage.goToRoleMappingTab(); - }); - - it("Check empty state", () => { - commonPage.emptyState().checkIfExists(true); - }); - - it("Assign roles from empty state", () => { - roleMappingTab.assignRole(); - roleMappingTab - .changeRoleTypeFilter("roles") - .selectRow("default-roles-") - .assign(); - }); - - it("Show and search roles", () => { - groupDetailPage.checkDefaultRole(); - }); - - it("Check hide inherited roles option", () => { - roleMappingTab.unhideInheritedRoles(); - roleMappingTab.hideInheritedRoles(); - }); - - it("Remove roles", () => { - roleMappingTab.selectRow("default-roles"); - roleMappingTab.unAssign(); - groupDetailPage.deleteRole(); - }); - }); - - describe("Permissions", () => { - beforeEach(() => { - groupPage.goToGroupChildGroupsTab(predefinedGroups[0]); - groupDetailPage.goToPermissionsTab(); - }); - - it("enable/disable permissions", () => { - groupDetailPage.enablePermissionSwitch(); - }); - }); - - describe("Accessibility tests for groups", () => { - beforeEach(() => { - loginPage.logIn(); - keycloakBefore(); - sidebarPage.goToGroups(); - cy.injectAxe(); - }); - - it("Check a11y violations on load/ groups", () => { - cy.checkA11y(); - }); - }); -}); diff --git a/js/apps/admin-ui/cypress/e2e/i18n_test.spec.ts b/js/apps/admin-ui/cypress/e2e/i18n_test.spec.ts deleted file mode 100644 index 9d07d96d3bc..00000000000 --- a/js/apps/admin-ui/cypress/e2e/i18n_test.spec.ts +++ /dev/null @@ -1,179 +0,0 @@ -import RealmRepresentation from "@keycloak/keycloak-admin-client/lib/defs/realmRepresentation"; -import LoginPage from "../support/pages/LoginPage"; -import SidebarPage from "../support/pages/admin-ui/SidebarPage"; -import ProviderPage from "../support/pages/admin-ui/manage/providers/ProviderPage"; -import adminClient from "../support/util/AdminClient"; -import { keycloakBefore } from "../support/util/keycloak_hooks"; - -const loginPage = new LoginPage(); -const sidebarPage = new SidebarPage(); - -const providersPage = new ProviderPage(); - -const usernameI18nTest = "user_i18n_test"; -let usernameI18nId: string; - -let originalMasterRealm: RealmRepresentation; - -describe("i18n tests", () => { - before(() => { - cy.wrap(null).then(async () => { - const realm = (await adminClient.getRealm("master"))!; - originalMasterRealm = realm; - realm.supportedLocales = ["en", "de", "de-CH", "fo"]; - realm.internationalizationEnabled = true; - await adminClient.updateRealm("master", realm); - - const { id: userId } = await adminClient.createUser({ - username: usernameI18nTest, - enabled: true, - credentials: [ - { type: "password", temporary: false, value: usernameI18nTest }, - ], - }); - usernameI18nId = userId!; - - await adminClient.addRealmRoleToUser(usernameI18nId, "admin"); - }); - }); - - after(async () => { - await adminClient.deleteUser(usernameI18nTest); - - if (originalMasterRealm) { - await adminClient.updateRealm("master", originalMasterRealm); - } - }); - - afterEach(async () => { - await adminClient.removeAllLocalizationTexts(); - }); - - const realmLocalizationEn = "realmSettings en"; - const themeLocalizationEn = "Realm settings"; - const realmLocalizationDe = "realmSettings de"; - const themeLocalizationDe = "Realm-Einstellungen"; - const realmLocalizationDeCh = "realmSettings de-CH"; - - it("should use THEME localization for fallback (en) when language without theme localization is requested and no realm localization exists", () => { - updateUserLocale("fo"); - - goToUserFederationPage(); - - sidebarPage.checkRealmSettingsLinkContainsText(themeLocalizationEn); - }); - - it("should use THEME localization for language when language with theme localization is requested and no realm localization exists", () => { - updateUserLocale("de"); - - goToUserFederationPage(); - - sidebarPage.checkRealmSettingsLinkContainsText(themeLocalizationDe); - }); - - it("should use REALM localization for fallback (en) when language without theme localization is requested and realm localization exists for fallback (en)", () => { - addCommonRealmSettingsLocalizationText("en", realmLocalizationEn); - updateUserLocale("fo"); - - goToUserFederationPage(); - - sidebarPage.checkRealmSettingsLinkContainsText(realmLocalizationEn); - }); - - it("should use THEME localization for language when language with theme localization is requested and realm localization exists for fallback (en) only", () => { - addCommonRealmSettingsLocalizationText("en", realmLocalizationEn); - updateUserLocale("de"); - - goToUserFederationPage(); - - sidebarPage.checkRealmSettingsLinkContainsText(themeLocalizationDe); - }); - - it("should use REALM localization for language when language is requested and realm localization exists for language", () => { - addCommonRealmSettingsLocalizationText("de", realmLocalizationDe); - updateUserLocale("de"); - - goToUserFederationPage(); - - sidebarPage.checkRealmSettingsLinkContainsText(realmLocalizationDe); - }); - - // TODO: currently skipped due to https://github.com/keycloak/keycloak/issues/20412 - it.skip("should use REALM localization for region when region is requested and realm localization exists for region", () => { - addCommonRealmSettingsLocalizationText("de-CH", realmLocalizationDeCh); - updateUserLocale("de-CH"); - - goToUserFederationPage(); - - sidebarPage.checkRealmSettingsLinkContainsText(realmLocalizationDeCh); - }); - - it("should use REALM localization for language when language is requested and realm localization exists for fallback (en), language, region", () => { - addCommonRealmSettingsLocalizationText("en", realmLocalizationEn); - addCommonRealmSettingsLocalizationText("de", realmLocalizationDe); - addCommonRealmSettingsLocalizationText("de-CH", realmLocalizationDeCh); - updateUserLocale("de"); - - goToUserFederationPage(); - - sidebarPage.checkRealmSettingsLinkContainsText(realmLocalizationDe); - }); - - it("should use REALM localization for language when region is requested and realm localization exists for fallback (en), language", () => { - addCommonRealmSettingsLocalizationText("en", realmLocalizationEn); - addCommonRealmSettingsLocalizationText("de", realmLocalizationDe); - updateUserLocale("de-CH"); - - goToUserFederationPage(); - - sidebarPage.checkRealmSettingsLinkContainsText(realmLocalizationDe); - }); - - it("should apply plurals and interpolation for THEME localization", () => { - updateUserLocale("en"); - - goToUserFederationPage(); - - providersPage.assertCardContainsText("ldap", "Add Ldap providers"); - }); - - it("should apply plurals and interpolation for REALM localization", () => { - addLocalization( - "en", - "addProvider_other", - "addProvider_other en: {{provider}}", - ); - updateUserLocale("en"); - - goToUserFederationPage(); - - providersPage.assertCardContainsText("ldap", "addProvider_other en: Ldap"); - }); - - function goToUserFederationPage() { - loginPage.logIn(usernameI18nTest, usernameI18nTest); - keycloakBefore(); - sidebarPage.goToUserFederation(); - } - - function updateUserLocale(locale: string) { - cy.wrap(null).then(() => - adminClient.updateUser(usernameI18nId, { - attributes: { locale: locale }, - }), - ); - } - - function addCommonRealmSettingsLocalizationText( - locale: string, - value: string, - ) { - addLocalization(locale, "realmSettings", value); - } - - function addLocalization(locale: string, key: string, value: string) { - cy.wrap(null).then(() => - adminClient.addLocalizationText(locale, key, value), - ); - } -}); diff --git a/js/apps/admin-ui/cypress/e2e/identity_providers_oidc_test.spec.ts b/js/apps/admin-ui/cypress/e2e/identity_providers_oidc_test.spec.ts deleted file mode 100644 index a593a96a103..00000000000 --- a/js/apps/admin-ui/cypress/e2e/identity_providers_oidc_test.spec.ts +++ /dev/null @@ -1,157 +0,0 @@ -import { SERVER_URL } from "../support/constants"; -import LoginPage from "../support/pages/LoginPage"; -import ListingPage from "../support/pages/admin-ui/ListingPage"; -import Masthead from "../support/pages/admin-ui/Masthead"; -import SidebarPage from "../support/pages/admin-ui/SidebarPage"; -import AddMapperPage from "../support/pages/admin-ui/manage/identity_providers/AddMapperPage"; -import CreateProviderPage from "../support/pages/admin-ui/manage/identity_providers/CreateProviderPage"; -import ProviderBaseAdvancedSettingsPage, { - ClientAssertionSigningAlg, - ClientAuthentication, - PromptSelect, -} from "../support/pages/admin-ui/manage/identity_providers/ProviderBaseAdvancedSettingsPage"; -import ProviderBaseGeneralSettingsPage from "../support/pages/admin-ui/manage/identity_providers/ProviderBaseGeneralSettingsPage"; -import ModalUtils from "../support/util/ModalUtils"; -import { keycloakBefore } from "../support/util/keycloak_hooks"; - -describe("OIDC identity provider test", () => { - const loginPage = new LoginPage(); - const sidebarPage = new SidebarPage(); - const masthead = new Masthead(); - const listingPage = new ListingPage(); - const createProviderPage = new CreateProviderPage(); - const addMapperPage = new AddMapperPage(); - - const createSuccessMsg = "Identity provider successfully created"; - const createMapperSuccessMsg = "Mapper created successfully."; - - const deletePrompt = "Delete provider?"; - const deleteSuccessMsg = "Provider successfully deleted."; - - const discoveryUrl = `${SERVER_URL}/realms/master/.well-known/openid-configuration`; - const authorizationUrl = `${SERVER_URL}/realms/master/protocol/openid-connect/auth`; - - describe("OIDC Identity provider creation", () => { - const oidcProviderName = "oidc"; - const secret = "123"; - - beforeEach(() => { - loginPage.logIn(); - keycloakBefore(); - sidebarPage.goToIdentityProviders(); - }); - - it("should create an OIDC provider using discovery url", () => { - createProviderPage - .checkVisible(oidcProviderName) - .clickCard(oidcProviderName); - - // createProviderPage.checkAddButtonDisabled(); - - createProviderPage - .fillDiscoveryUrl(discoveryUrl) - .shouldBeSuccessful() - .fillDisplayName(oidcProviderName) - .fill(oidcProviderName, secret) - .clickAdd(); - masthead.checkNotificationMessage(createSuccessMsg, true); - createProviderPage.shouldHaveAuthorizationUrl(authorizationUrl); - }); - - it("should test all settings", () => { - const providerBaseGeneralSettingsPage = - new ProviderBaseGeneralSettingsPage(); - const providerBaseAdvancedSettingsPage = - new ProviderBaseAdvancedSettingsPage(); - - sidebarPage.goToIdentityProviders(); - listingPage.goToItemDetails(oidcProviderName); - //general settings - cy.findByTestId("displayName").click().type("OIDC"); - cy.findByTestId("jump-link-general-settings").click(); - providerBaseGeneralSettingsPage.typeDisplayOrder("1"); - createProviderPage.clickSave(); - masthead.checkNotificationMessage("Provider successfully updated", true); - - //OIDC Settings and save/revert buttons - providerBaseAdvancedSettingsPage.assertOIDCUrl("authorization"); - providerBaseAdvancedSettingsPage.assertOIDCUrl("token"); - //OIDC Switches - providerBaseAdvancedSettingsPage.assertOIDCSignatureSwitch(); - providerBaseAdvancedSettingsPage.assertOIDCPKCESwitch(); - //Client Authentication - providerBaseAdvancedSettingsPage.assertOIDCClientAuthentication( - ClientAuthentication.basicAuth, - ); - providerBaseAdvancedSettingsPage.assertOIDCClientAuthentication( - ClientAuthentication.post, - ); - providerBaseAdvancedSettingsPage.assertOIDCClientAuthentication( - ClientAuthentication.jwt, - ); - providerBaseAdvancedSettingsPage.assertOIDCClientAuthentication( - ClientAuthentication.jwtPrivKey, - ); - //Client assertion signature algorithm - Object.entries(ClientAssertionSigningAlg).forEach(([, value]) => { - providerBaseAdvancedSettingsPage.assertOIDCClientAuthSignAlg(value); - }); - //Client assertion audience - providerBaseAdvancedSettingsPage.typeClientAssertionAudience( - "http://localhost:8180", - ); - providerBaseAdvancedSettingsPage.assertClientAssertionAudienceInputEqual( - "http://localhost:8180", - ); - //JWT X509 Headers - providerBaseAdvancedSettingsPage.assertOIDCJWTX509HeadersSwitch(); - //OIDC Advanced Settings - providerBaseAdvancedSettingsPage.assertOIDCSettingsAdvancedSwitches(); - providerBaseAdvancedSettingsPage.selectPromptOption(PromptSelect.none); - providerBaseAdvancedSettingsPage.selectPromptOption(PromptSelect.consent); - providerBaseAdvancedSettingsPage.selectPromptOption(PromptSelect.login); - providerBaseAdvancedSettingsPage.selectPromptOption(PromptSelect.select); - providerBaseAdvancedSettingsPage.selectPromptOption( - PromptSelect.unspecified, - ); - //Advanced Settings - providerBaseAdvancedSettingsPage.assertAdvancedSettings(); - }); - - it("should add OIDC mapper of type Attribute Importer", () => { - sidebarPage.goToIdentityProviders(); - listingPage.goToItemDetails(oidcProviderName); - addMapperPage.goToMappersTab(); - addMapperPage.emptyStateAddMapper(); - addMapperPage.addOIDCAttrImporterMapper("OIDC Attribute Importer"); - masthead.checkNotificationMessage(createMapperSuccessMsg, true); - }); - - it("should add OIDC mapper of type Claim To Role", () => { - sidebarPage.goToIdentityProviders(); - listingPage.goToItemDetails(oidcProviderName); - addMapperPage.goToMappersTab(); - addMapperPage.addMapper(); - addMapperPage.addOIDCClaimToRoleMapper("OIDC Claim to Role"); - masthead.checkNotificationMessage(createMapperSuccessMsg, true); - }); - - it("should cancel the addition of the OIDC mapper", () => { - sidebarPage.goToIdentityProviders(); - listingPage.goToItemDetails(oidcProviderName); - addMapperPage.goToMappersTab(); - addMapperPage.addMapper(); - addMapperPage.cancelNewMapper(); - addMapperPage.shouldGoToMappersTab(); - }); - - it("clean up providers", () => { - const modalUtils = new ModalUtils(); - - sidebarPage.goToIdentityProviders(); - listingPage.itemExist(oidcProviderName).deleteItem(oidcProviderName); - modalUtils.checkModalTitle(deletePrompt).confirmModal(); - masthead.checkNotificationMessage(deleteSuccessMsg, true); - }); - }); -}); diff --git a/js/apps/admin-ui/cypress/e2e/identity_providers_saml_test.spec.ts b/js/apps/admin-ui/cypress/e2e/identity_providers_saml_test.spec.ts deleted file mode 100644 index 32b935f5f49..00000000000 --- a/js/apps/admin-ui/cypress/e2e/identity_providers_saml_test.spec.ts +++ /dev/null @@ -1,189 +0,0 @@ -import { SERVER_URL } from "../support/constants"; -import LoginPage from "../support/pages/LoginPage"; -import ListingPage from "../support/pages/admin-ui/ListingPage"; -import Masthead from "../support/pages/admin-ui/Masthead"; -import SidebarPage from "../support/pages/admin-ui/SidebarPage"; -import AddMapperPage from "../support/pages/admin-ui/manage/identity_providers/AddMapperPage"; -import CreateProviderPage from "../support/pages/admin-ui/manage/identity_providers/CreateProviderPage"; -import ProviderSAMLSettings from "../support/pages/admin-ui/manage/identity_providers/social/ProviderSAMLSettings"; -import ModalUtils from "../support/util/ModalUtils"; -import { keycloakBefore } from "../support/util/keycloak_hooks"; - -describe("SAML identity provider test", () => { - const loginPage = new LoginPage(); - const sidebarPage = new SidebarPage(); - const masthead = new Masthead(); - const listingPage = new ListingPage(); - const createProviderPage = new CreateProviderPage(); - const addMapperPage = new AddMapperPage(); - - const createSuccessMsg = "Identity provider successfully created"; - const saveSuccessMsg = "Provider successfully updated"; - - const createMapperSuccessMsg = "Mapper created successfully."; - const saveMapperSuccessMsg = "Mapper saved successfully."; - - const deletePrompt = "Delete provider?"; - const deleteSuccessMsg = "Provider successfully deleted."; - - const classRefName = "acClassRef-1"; - const declRefName = "acDeclRef-1"; - - const samlDiscoveryUrl = `${SERVER_URL}/realms/master/protocol/saml/descriptor`; - const samlDisplayName = "saml"; - - describe("SAML identity provider creation", () => { - const samlProviderName = "saml"; - - beforeEach(() => { - loginPage.logIn(); - keycloakBefore(); - sidebarPage.goToIdentityProviders(); - }); - - it("should create a SAML provider using entity descriptor", () => { - createProviderPage - .checkVisible(samlProviderName) - .clickCard(samlProviderName); - // createProviderPage.checkAddButtonDisabled(); - createProviderPage - .fillDisplayName(samlDisplayName) - .fillDiscoveryUrl(samlDiscoveryUrl) - .shouldBeSuccessful() - .clickAdd(); - masthead.checkNotificationMessage(createSuccessMsg, true); - }); - - it("should add auth constraints to existing SAML provider", () => { - sidebarPage.goToIdentityProviders(); - listingPage.goToItemDetails(samlProviderName); - createProviderPage - .fillAuthnContextClassRefs(classRefName) - .clickClassRefsAdd() - .fillAuthnContextDeclRefs(declRefName) - .clickDeclRefsAdd() - .clickSave(); - masthead.checkNotificationMessage(saveSuccessMsg, true); - }); - - it("should add SAML mapper of type Advanced Attribute to Role", () => { - sidebarPage.goToIdentityProviders(); - listingPage.goToItemDetails(samlProviderName); - addMapperPage.goToMappersTab(); - addMapperPage.emptyStateAddMapper(); - addMapperPage.addAdvancedAttrToRoleMapper("SAML mapper"); - masthead.checkNotificationMessage(createMapperSuccessMsg, true); - }); - - it("should add SAML mapper of type Username Template Importer", () => { - sidebarPage.goToIdentityProviders(); - listingPage.goToItemDetails(samlProviderName); - addMapperPage.goToMappersTab(); - addMapperPage.addMapper(); - addMapperPage.addUsernameTemplateImporterMapper( - "SAML Username Template Importer Mapper", - ); - masthead.checkNotificationMessage(createMapperSuccessMsg, true); - }); - - it("should add SAML mapper of type Hardcoded User Session Attribute", () => { - sidebarPage.goToIdentityProviders(); - listingPage.goToItemDetails(samlProviderName); - addMapperPage.goToMappersTab(); - addMapperPage.addMapper(); - addMapperPage.addHardcodedUserSessionAttrMapper( - "Hardcoded User Session Attribute", - ); - masthead.checkNotificationMessage(createMapperSuccessMsg, true); - }); - - it("should add SAML mapper of type Attribute Importer", () => { - sidebarPage.goToIdentityProviders(); - listingPage.goToItemDetails(samlProviderName); - addMapperPage.goToMappersTab(); - addMapperPage.addMapper(); - addMapperPage.addSAMLAttrImporterMapper("Attribute Importer"); - masthead.checkNotificationMessage(createMapperSuccessMsg, true); - }); - - it("should add SAML mapper of type Hardcoded Role", () => { - sidebarPage.goToIdentityProviders(); - listingPage.goToItemDetails(samlProviderName); - addMapperPage.goToMappersTab(); - addMapperPage.addMapper(); - addMapperPage.addHardcodedRoleMapper("Hardcoded Role"); - masthead.checkNotificationMessage(createMapperSuccessMsg, true); - }); - - it("should add SAML mapper of type Hardcoded Attribute", () => { - sidebarPage.goToIdentityProviders(); - listingPage.goToItemDetails(samlProviderName); - addMapperPage.goToMappersTab(); - addMapperPage.addMapper(); - addMapperPage.addHardcodedAttrMapper("Hardcoded Attribute"); - masthead.checkNotificationMessage(createMapperSuccessMsg, true); - }); - - it("should add SAML mapper of type SAML Attribute To Role", () => { - sidebarPage.goToIdentityProviders(); - listingPage.goToItemDetails(samlProviderName); - addMapperPage.goToMappersTab(); - addMapperPage.addMapper(); - addMapperPage.addSAMLAttributeToRoleMapper("SAML Attribute To Role"); - masthead.checkNotificationMessage(createMapperSuccessMsg, true); - }); - - it("should edit Username Template Importer mapper", () => { - sidebarPage.goToIdentityProviders(); - listingPage.goToItemDetails(samlProviderName); - addMapperPage.goToMappersTab(); - listingPage.goToItemDetails("SAML Username Template Importer Mapper"); - addMapperPage.editUsernameTemplateImporterMapper(); - masthead.checkNotificationMessage(saveMapperSuccessMsg, true); - }); - - it("should edit SAML mapper", () => { - sidebarPage.goToIdentityProviders(); - listingPage.goToItemDetails(samlProviderName); - addMapperPage.goToMappersTab(); - listingPage.goToItemDetails("SAML mapper"); - addMapperPage.editSAMLorOIDCMapper(); - masthead.checkNotificationMessage(saveMapperSuccessMsg, true); - }); - - it("should edit SAML settings", () => { - const providerSAMLSettings = new ProviderSAMLSettings(); - - sidebarPage.goToIdentityProviders(); - listingPage.goToItemDetails(samlProviderName); - providerSAMLSettings.disableProviderSwitch(); - sidebarPage.goToIdentityProviders(); - cy.findByText("Disabled"); - listingPage.goToItemDetails(samlProviderName); - providerSAMLSettings.enableProviderSwitch(); - - cy.get(".pf-v5-c-jump-links__list").contains("SAML settings").click(); - providerSAMLSettings.assertIdAndURLFields(); - providerSAMLSettings.assertNameIdPolicyFormat(); - providerSAMLSettings.assertPrincipalType(); - providerSAMLSettings.assertSAMLSwitches(); - providerSAMLSettings.assertSignatureAlgorithm(); - providerSAMLSettings.assertValidateSignatures(); - providerSAMLSettings.assertTextFields(); - - cy.get(".pf-v5-c-jump-links__list") - .contains("Requested AuthnContext Constraints") - .click(); - providerSAMLSettings.assertAuthnContext(); - }); - - it("clean up providers", () => { - const modalUtils = new ModalUtils(); - - sidebarPage.goToIdentityProviders(); - listingPage.itemExist(samlProviderName).deleteItem(samlProviderName); - modalUtils.checkModalTitle(deletePrompt).confirmModal(); - masthead.checkNotificationMessage(deleteSuccessMsg, true); - }); - }); -}); diff --git a/js/apps/admin-ui/cypress/e2e/identity_providers_test.spec.ts b/js/apps/admin-ui/cypress/e2e/identity_providers_test.spec.ts deleted file mode 100644 index d7d1679c2e3..00000000000 --- a/js/apps/admin-ui/cypress/e2e/identity_providers_test.spec.ts +++ /dev/null @@ -1,408 +0,0 @@ -import Masthead from "../support/pages/admin-ui/Masthead"; -import SidebarPage from "../support/pages/admin-ui/SidebarPage"; -import LoginPage from "../support/pages/LoginPage"; -import { keycloakBefore } from "../support/util/keycloak_hooks"; -import ListingPage from "../support/pages/admin-ui/ListingPage"; - -import CreateProviderPage from "../support/pages/admin-ui/manage/identity_providers/CreateProviderPage"; -import ModalUtils from "../support/util/ModalUtils"; -import OrderDialog from "../support/pages/admin-ui/manage/identity_providers/OrderDialog"; -import AddMapperPage from "../support/pages/admin-ui/manage/identity_providers/AddMapperPage"; -import ProviderFacebookGeneralSettings from "../support/pages/admin-ui/manage/identity_providers/social/ProviderFacebookGeneralSettings"; -import ProviderBaseGeneralSettingsPage from "../support/pages/admin-ui/manage/identity_providers/ProviderBaseGeneralSettingsPage"; -import ProviderBaseAdvancedSettingsPage from "../support/pages/admin-ui/manage/identity_providers/ProviderBaseAdvancedSettingsPage"; -import ProviderGithubGeneralSettings from "../support/pages/admin-ui/manage/identity_providers/social/ProviderGithubGeneralSettings"; -import ProviderGoogleGeneralSettings from "../support/pages/admin-ui/manage/identity_providers/social/ProviderGoogleGeneralSettings"; -import ProviderMicrosoftGeneralSettings from "../support/pages/admin-ui/manage/identity_providers/social/ProviderMicrosoftGeneralSettings"; -import ProviderOpenshiftGeneralSettings from "../support/pages/admin-ui/manage/identity_providers/social/ProviderOpenshiftGeneralSettings"; -import ProviderPaypalGeneralSettings from "../support/pages/admin-ui/manage/identity_providers/social/ProviderPaypalGeneralSettings"; -import ProviderStackoverflowGeneralSettings from "../support/pages/admin-ui/manage/identity_providers/social/ProviderStackoverflowGeneralSettings"; -import adminClient from "../support/util/AdminClient"; -import GroupPage from "../support/pages/admin-ui/manage/groups/GroupPage"; -import CommonPage from "../support/pages/CommonPage"; - -describe("Identity provider test", () => { - const loginPage = new LoginPage(); - const sidebarPage = new SidebarPage(); - const masthead = new Masthead(); - const listingPage = new ListingPage(); - const createProviderPage = new CreateProviderPage(); - const addMapperPage = new AddMapperPage(); - const groupPage = new GroupPage(); - const commonPage = new CommonPage(); - - const createSuccessMsg = "Identity provider successfully created"; - const createFailMsg = - "Could not create the identity provider: Identity Provider github already exists"; - const createMapperSuccessMsg = "Mapper created successfully."; - - const changeSuccessMsg = - "Successfully changed display order of identity providers"; - const deletePrompt = "Delete provider?"; - const deleteSuccessMsg = "Provider successfully deleted."; - - beforeEach(() => { - loginPage.logIn(); - keycloakBefore(); - sidebarPage.goToIdentityProviders(); - }); - - const socialLoginIdentityProvidersWithCustomFiels = { - Facebook: new ProviderFacebookGeneralSettings(), - Github: new ProviderGithubGeneralSettings(), - Google: new ProviderGoogleGeneralSettings(), - Microsoft: new ProviderMicrosoftGeneralSettings(), - "Openshift-v3": new ProviderOpenshiftGeneralSettings(), - "Openshift-v4": new ProviderOpenshiftGeneralSettings(), - Paypal: new ProviderPaypalGeneralSettings(), - Stackoverflow: new ProviderStackoverflowGeneralSettings(), - }; - function getSocialIdpClassInstance(idpTestName: string) { - let instance = new ProviderBaseGeneralSettingsPage(); - Object.entries(socialLoginIdentityProvidersWithCustomFiels).find( - ([key, value]) => { - if (key === idpTestName) { - instance = value; - return true; - } - return false; - }, - ); - return instance; - } - - describe("Identity provider creation", () => { - const identityProviderName = "github"; - - describe("Custom fields tests", () => { - const socialLoginIdentityProviders = [ - { testName: "Bitbucket", displayName: "BitBucket", alias: "bitbucket" }, - { testName: "Facebook", displayName: "Facebook", alias: "facebook" }, - { testName: "Github", displayName: "GitHub", alias: "github" }, - { testName: "Gitlab", displayName: "Gitlab", alias: "gitlab" }, - { testName: "Google", displayName: "Google", alias: "google" }, - { testName: "Instagram", displayName: "Instagram", alias: "instagram" }, - { - testName: "LinkedIn", - displayName: "LinkedIn", - alias: "linkedin-openid-connect", - }, - { testName: "Microsoft", displayName: "Microsoft", alias: "microsoft" }, - { - testName: "Openshift-v4", - displayName: "Openshift v4", - alias: "openshift-v4", - }, - { testName: "Paypal", displayName: "PayPal", alias: "paypal" }, - { - testName: "Stackoverflow", - displayName: "StackOverflow", - alias: "stackoverflow", - }, - { testName: "Twitter", displayName: "Twitter", alias: "twitter" }, - ]; - - after(async () => { - await Promise.all( - socialLoginIdentityProviders.map((idp) => - adminClient.deleteIdentityProvider(idp.alias), - ), - ); - }); - - socialLoginIdentityProviders.forEach(($idp, linkedIdpsCount) => { - it(`should create social login provider ${$idp.testName} with custom fields`, () => { - if (linkedIdpsCount == 0) { - createProviderPage.clickCard($idp.alias); - } else { - createProviderPage.clickCreateDropdown().clickItem($idp.alias); - } - const instance = getSocialIdpClassInstance($idp.testName); - instance - .typeClientId("1") - .typeClientId("") - .typeClientSecret("1") - .typeClientSecret("") - .assertRequiredFieldsErrorsExist() - .fillData($idp.testName) - .clickAdd() - .assertNotificationIdpCreated() - .assertFilledDataEqual($idp.testName); - }); - }); - }); - - it("should create github provider", () => { - createProviderPage.checkGitHubCardVisible().clickGitHubCard(); - - createProviderPage.checkAddButtonDisabled(); - createProviderPage.fill(identityProviderName).checkAddButtonDisabled(); - createProviderPage.fill(identityProviderName, "123").clickAdd(); - masthead.checkNotificationMessage(createSuccessMsg, true); - - sidebarPage.goToIdentityProviders(); - listingPage.itemExist(identityProviderName); - }); - - it("fail to make duplicate github provider", () => { - createProviderPage - .clickCreateDropdown() - .clickItem("github") - .fill("github2", "123") - .clickAdd(); - masthead.checkNotificationMessage(createFailMsg, true); - }); - - it("should create facebook provider", () => { - createProviderPage - .clickCreateDropdown() - .clickItem("facebook") - .fill("facebook", "123") - .clickAdd(); - masthead.checkNotificationMessage(createSuccessMsg, true); - }); - - it("search for existing provider by name", () => { - sidebarPage.goToIdentityProviders(); - listingPage.searchItem(identityProviderName, false); - listingPage.itemExist(identityProviderName, true); - }); - - it("search for non-existing provider by name", () => { - sidebarPage.goToIdentityProviders(); - listingPage.searchItem("not-existing-provider", false); - groupPage.assertNoSearchResultsMessageExist(true); - }); - - it("create and delete provider by item details", () => { - createProviderPage - .clickCreateDropdown() - .clickItem("linkedin-openid-connect") - .fill("linkedin-openid-connect", "123") - .clickAdd(); - masthead.checkNotificationMessage(createSuccessMsg, true); - - commonPage - .actionToolbarUtils() - .clickActionToggleButton() - .clickDropdownItem("Delete"); - - const modalUtils = new ModalUtils(); - modalUtils.checkModalTitle(deletePrompt).confirmModal(); - masthead.checkNotificationMessage(deleteSuccessMsg, true); - }); - - it.skip("should change order of providers", () => { - const orderDialog = new OrderDialog(); - const providers = [identityProviderName, "facebook", "bitbucket"]; - - sidebarPage.goToIdentityProviders(); - listingPage.itemExist("facebook"); - - sidebarPage.goToIdentityProviders(); - listingPage.itemExist(identityProviderName); - - createProviderPage - .clickCreateDropdown() - .clickItem("bitbucket") - .fill("bitbucket", "123") - .clickAdd(); - masthead.checkNotificationMessage(createSuccessMsg, true); - - cy.wait(2000); - - sidebarPage.goToIdentityProviders(); - listingPage.itemExist(identityProviderName); - - orderDialog.openDialog().checkOrder(providers); - orderDialog.moveRowTo("facebook", identityProviderName); - - orderDialog.checkOrder(["bitbucket", identityProviderName, "facebook"]); - - orderDialog.clickSave(); - masthead.checkNotificationMessage(changeSuccessMsg); - }); - - it("should delete provider", () => { - const modalUtils = new ModalUtils(); - listingPage.deleteItem(identityProviderName); - modalUtils.checkModalTitle(deletePrompt).confirmModal(); - masthead.checkNotificationMessage(deleteSuccessMsg, true); - }); - - it("should add facebook social mapper", () => { - sidebarPage.goToIdentityProviders(); - listingPage.goToItemDetails("facebook"); - addMapperPage.goToMappersTab(); - addMapperPage.emptyStateAddMapper(); - addMapperPage.fillSocialMapper("facebook mapper"); - // addMapperPage.saveNewMapper(); - masthead.checkNotificationMessage(createMapperSuccessMsg, true); - }); - - it("should add Social mapper of type Attribute Importer", () => { - sidebarPage.goToIdentityProviders(); - listingPage.goToItemDetails("facebook"); - addMapperPage.goToMappersTab(); - addMapperPage.addMapper(); - addMapperPage.fillSocialMapper("facebook attribute importer"); - masthead.checkNotificationMessage(createMapperSuccessMsg, true); - }); - - it("should edit facebook mapper", () => { - sidebarPage.goToIdentityProviders(); - listingPage.goToItemDetails("facebook"); - addMapperPage.goToMappersTab(); - listingPage.goToItemDetails("facebook attribute importer"); - addMapperPage.editSocialMapper(); - }); - - it("should delete facebook mapper", () => { - sidebarPage.goToIdentityProviders(); - listingPage.goToItemDetails("facebook"); - addMapperPage.goToMappersTab(); - listingPage.deleteItem("facebook attribute importer"); - cy.findByTestId("confirm").click(); - }); - - it("clean up providers", () => { - const modalUtils = new ModalUtils(); - - // TODO: Re-enable this code when the 'should change order of providers' is no longer skipped. - // sidebarPage.goToIdentityProviders(); - // listingPage.itemExist("bitbucket").deleteItem("bitbucket"); - // modalUtils.checkModalTitle(deletePrompt).confirmModal(); - // masthead.checkNotificationMessage(deleteSuccessMsg, true); - - sidebarPage.goToIdentityProviders(); - listingPage.itemExist("facebook").deleteItem("facebook"); - modalUtils.checkModalTitle(deletePrompt).confirmModal(); - masthead.checkNotificationMessage(deleteSuccessMsg, true); - }); - }); - - describe("should check provider details", () => { - const identityProviderName = "github"; - const githubSettings = new ProviderGithubGeneralSettings(); - const advancedSettings = new ProviderBaseAdvancedSettingsPage(); - - it("creating github provider", () => { - createProviderPage.checkGitHubCardVisible().clickGitHubCard(); - - createProviderPage.checkAddButtonDisabled(); - createProviderPage - .fill(identityProviderName) - .fill(identityProviderName, "123") - .clickAdd(); - masthead.checkNotificationMessage(createSuccessMsg, true); - - sidebarPage.goToIdentityProviders(); - listingPage.itemExist(identityProviderName); - }); - - it("should check general settings", () => { - sidebarPage.goToIdentityProviders(); - listingPage.goToItemDetails("github"); - - githubSettings.fillData("github"); - cy.findByTestId("idp-details-save").click(); - }); - - it("should check input switches and inputs", () => { - sidebarPage.goToIdentityProviders(); - listingPage.goToItemDetails("github"); - - advancedSettings.typeScopesInput("openid"); - advancedSettings.assertScopesInputEqual("openid"); - - advancedSettings.assertStoreTokensSwitchTurnedOn(false); - advancedSettings.assertAcceptsPromptNoneForwardFromClientSwitchTurnedOn( - false, - ); - advancedSettings.assertDisableUserInfoSwitchTurnedOn(false); - advancedSettings.assertTrustEmailSwitchTurnedOn(false); - advancedSettings.assertAccountLinkingOnlySwitchTurnedOn(false); - advancedSettings.assertHideOnLoginPageSwitchTurnedOn(false); - - advancedSettings.clickStoreTokensSwitch(); - advancedSettings.clickAcceptsPromptNoneForwardFromClientSwitch(); - advancedSettings.clickDisableUserInfoSwitch(); - advancedSettings.clickTrustEmailSwitch(); - advancedSettings.clickAccountLinkingOnlySwitch(); - advancedSettings.clickHideOnLoginPageSwitch(); - advancedSettings.assertDoNotImportUsersSwitchTurnedOn(false); - advancedSettings.assertSyncModeShown(true); - advancedSettings.clickdoNotStoreUsersSwitch(); - advancedSettings.assertDoNotImportUsersSwitchTurnedOn(true); - advancedSettings.assertSyncModeShown(false); - advancedSettings.clickdoNotStoreUsersSwitch(); - advancedSettings.assertDoNotImportUsersSwitchTurnedOn(false); - advancedSettings.assertSyncModeShown(true); - - advancedSettings.clickEssentialClaimSwitch(); - advancedSettings.typeClaimNameInput("claim-name"); - advancedSettings.typeClaimValueInput("claim-value"); - - advancedSettings.ensureAdvancedSettingsAreVisible(); - advancedSettings.assertStoreTokensSwitchTurnedOn(true); - advancedSettings.assertAcceptsPromptNoneForwardFromClientSwitchTurnedOn( - true, - ); - advancedSettings.assertDisableUserInfoSwitchTurnedOn(true); - advancedSettings.assertTrustEmailSwitchTurnedOn(true); - advancedSettings.assertAccountLinkingOnlySwitchTurnedOn(true); - advancedSettings.assertHideOnLoginPageSwitchTurnedOn(true); - advancedSettings.assertEssentialClaimSwitchTurnedOn(true); - advancedSettings.assertClaimInputEqual("claim-name"); - advancedSettings.assertClaimValueInputEqual("claim-value"); - - cy.findByTestId("idp-details-save").click(); - masthead.checkNotificationMessage("Provider successfully updated"); - }); - - it("should revert and save options", () => { - sidebarPage.goToIdentityProviders(); - listingPage.goToItemDetails("github"); - - cy.findByTestId("jump-link-advanced-settings").click(); - advancedSettings.assertStoreTokensSwitchTurnedOn(true); - advancedSettings.assertAcceptsPromptNoneForwardFromClientSwitchTurnedOn( - true, - ); - advancedSettings.clickStoreTokensSwitch(); - advancedSettings.clickAcceptsPromptNoneForwardFromClientSwitch(); - advancedSettings.ensureAdvancedSettingsAreVisible(); - advancedSettings.assertStoreTokensSwitchTurnedOn(false); - advancedSettings.assertAcceptsPromptNoneForwardFromClientSwitchTurnedOn( - false, - ); - cy.findByTestId("idp-details-revert").click(); - advancedSettings.assertStoreTokensSwitchTurnedOn(true); - advancedSettings.assertAcceptsPromptNoneForwardFromClientSwitchTurnedOn( - true, - ); - }); - - it("should delete providers", () => { - const modalUtils = new ModalUtils(); - sidebarPage.goToIdentityProviders(); - - listingPage.itemExist("github").deleteItem("github"); - modalUtils.checkModalTitle(deletePrompt).confirmModal(); - masthead.checkNotificationMessage(deleteSuccessMsg, true); - }); - }); - - describe("Accessibility tests for identity providers", () => { - beforeEach(() => { - loginPage.logIn(); - keycloakBefore(); - sidebarPage.goToIdentityProviders(); - cy.injectAxe(); - }); - - it("Check a11y violations on load/ identity providers", () => { - cy.checkA11y(); - }); - }); -}); diff --git a/js/apps/admin-ui/cypress/e2e/masthead_test.spec.ts b/js/apps/admin-ui/cypress/e2e/masthead_test.spec.ts deleted file mode 100644 index 112d36622b5..00000000000 --- a/js/apps/admin-ui/cypress/e2e/masthead_test.spec.ts +++ /dev/null @@ -1,139 +0,0 @@ -import LoginPage from "../support/pages/LoginPage"; -import SidebarPage from "../support/pages/admin-ui/SidebarPage"; -import Masthead from "../support/pages/admin-ui/Masthead"; -import { keycloakBefore } from "../support/util/keycloak_hooks"; -import adminClient from "../support/util/AdminClient"; - -const loginPage = new LoginPage(); -const masthead = new Masthead(); -const sidebarPage = new SidebarPage(); -const helpLabel = ".pf-v5-c-form__group-label-help"; - -describe("Masthead tests", () => { - beforeEach(() => { - loginPage.logIn(); - keycloakBefore(); - }); - - describe("Desktop view", () => { - it("Go to account console and back to admin console", () => { - sidebarPage.waitForPageLoad(); - masthead.accountManagement(); - cy.url().should("contain", "/realms/master/account"); - }); - - it("Sign out reachs to log in screen", () => { - sidebarPage.waitForPageLoad(); - masthead.signOut(); - sidebarPage.waitForPageLoad(); - loginPage.isLogInPage(); - }); - - it("Go to realm info", () => { - sidebarPage.goToClients(); - masthead.toggleUsernameDropdown().clickRealmInfo(); - cy.get(".pf-v5-l-grid").should("contain.text", "Welcome"); - }); - - it("Should go to documentation page", () => { - masthead.clickGlobalHelp(); - masthead - .getDocumentationLink() - .invoke("attr", "href") - .then((href) => { - if (!href) return; - - masthead.clickDocumentationLink(); - cy.origin(href, () => { - cy.get("#header").should( - "contain.text", - "Server Administration Guide", - ); - }); - }); - }); - - it("Enable/disable help mode in desktop mode", () => { - masthead.assertIsDesktopView(); - cy.findByTestId("infoTab").click(); - cy.get(helpLabel).should("exist"); - masthead.toggleGlobalHelp(); - masthead.clickGlobalHelp(); - cy.get(helpLabel).should("not.exist"); - masthead.toggleGlobalHelp(); - cy.get(helpLabel).should("exist"); - }); - }); - - describe("Login works for unprivileged users", () => { - const realmName = `test-realm-${crypto.randomUUID()}`; - const username = `test-user-${crypto.randomUUID()}`; - - before(async () => { - await adminClient.createRealm(realmName, { enabled: true }); - - await adminClient.inRealm(realmName, () => - adminClient.createUser({ - username, - enabled: true, - emailVerified: true, - credentials: [{ type: "password", value: "test" }], - firstName: "Test", - lastName: "User", - email: "test@keycloak.org", - }), - ); - }); - - after(() => adminClient.deleteRealm(realmName)); - - it("Login without privileges to see admin console", () => { - sidebarPage.waitForPageLoad(); - masthead.signOut(); - - cy.visit(`/admin/${realmName}/console`); - - cy.get('[role="progressbar"]').should("not.exist"); - cy.get("#username").type(username); - cy.get("#password").type("test"); - - cy.get("#kc-login").click(); - - sidebarPage.waitForPageLoad(); - masthead.signOut(); - sidebarPage.waitForPageLoad(); - loginPage.isLogInPage(); - }); - }); - - describe("Mobile view", () => { - it("Mobile menu is shown when in mobile view", () => { - cy.viewport("samsung-s10"); - masthead.assertIsMobileView(); - }); - - it("Enable/disable help mode in mobile view", () => { - cy.viewport("samsung-s10"); - masthead - .assertIsMobileView() - .toggleUsernameDropdown() - .toggleMobileViewHelp(); - masthead.toggleMobileViewHelp(); - cy.findByTestId("helpIcon").should("exist"); - }); - }); - - describe("Accessibility tests for masthead", () => { - beforeEach(() => { - loginPage.logIn(); - keycloakBefore(); - sidebarPage.waitForPageLoad(); - masthead.accountManagement(); - cy.injectAxe(); - }); - - it("Check a11y violations on load/ masthead", () => { - cy.checkA11y(); - }); - }); -}); diff --git a/js/apps/admin-ui/cypress/e2e/organization.spec.ts b/js/apps/admin-ui/cypress/e2e/organization.spec.ts deleted file mode 100644 index e30853e0b52..00000000000 --- a/js/apps/admin-ui/cypress/e2e/organization.spec.ts +++ /dev/null @@ -1,148 +0,0 @@ -import Form from "../support/forms/Form"; -import LoginPage from "../support/pages/LoginPage"; -import ListingPage from "../support/pages/admin-ui/ListingPage"; -import IdentityProviderTab from "../support/pages/admin-ui/manage/organization/IdentityProviderTab"; -import MembersTab from "../support/pages/admin-ui/manage/organization/MemberTab"; -import OrganizationPage from "../support/pages/admin-ui/manage/organization/OrganizationPage"; -import adminClient from "../support/util/AdminClient"; -import { keycloakBefore } from "../support/util/keycloak_hooks"; -import RealmSettingsPage from "../support/pages/admin-ui/manage/realm_settings/RealmSettingsPage"; -import SidebarPage from "../support/pages/admin-ui/SidebarPage"; - -const loginPage = new LoginPage(); -const listingPage = new ListingPage(); -const page = new OrganizationPage(); -const realmSettingsPage = new RealmSettingsPage(); -const sidebarPage = new SidebarPage(); - -describe.skip("Organization CRUD", () => { - beforeEach(() => { - loginPage.logIn(); - keycloakBefore(); - sidebarPage.goToRealmSettings(); - realmSettingsPage.setSwitch("organizationsEnabled", true); - realmSettingsPage.saveGeneral(); - }); - - it("should create new organization", () => { - page.goToTab(); - page.goToCreate(); - Form.assertSaveButtonDisabled(); - page.fillCreatePage({ name: "orgName" }); - Form.assertSaveButtonEnabled(); - page.fillCreatePage({ - name: "orgName", - domain: ["ame.org", "test.nl"], - description: "some description", - }); - Form.clickSaveButton(); - page.assertSaveSuccess(); - }); - - it("should modify existing organization", () => { - cy.wrap(null).then(() => - adminClient.createOrganization({ - name: "editName", - domains: [{ name: "go.org", verified: false }], - }), - ); - page.goToTab(); - - listingPage.goToItemDetails("editName"); - const newValue = "newName"; - page.fillNameField(newValue).should("have.value", newValue); - Form.clickSaveButton(); - page.assertSaveSuccess(); - page.goToTab(); - listingPage.itemExist(newValue); - }); - - it("should delete from list", () => { - page.goToTab(); - listingPage.deleteItem("orgName"); - page.modalUtils().confirmModal(); - page.assertDeleteSuccess(); - }); - - it.skip("should delete from details page", () => { - page.goToTab(); - listingPage.goToItemDetails("newName"); - - page - .actionToolbarUtils() - .clickActionToggleButton() - .clickDropdownItem("Delete"); - page.modalUtils().confirmModal(); - - page.assertDeleteSuccess(); - }); -}); - -describe.skip("Members", () => { - const membersTab = new MembersTab(); - - before(() => { - adminClient.createOrganization({ - name: "member", - domains: [{ name: "o.com", verified: false }], - }); - adminClient.createUser({ username: "realm-user", enabled: true }); - }); - - after(() => { - adminClient.deleteOrganization("member"); - adminClient.deleteUser("realm-user"); - }); - - beforeEach(() => { - loginPage.logIn(); - keycloakBefore(); - page.goToTab(); - }); - - it("should add member", () => { - listingPage.goToItemDetails("member"); - membersTab.goToTab(); - membersTab.clickAddRealmUser(); - membersTab.modalUtils().assertModalVisible(true); - membersTab.modalUtils().table().selectRowItemCheckbox("realm-user"); - membersTab.modalUtils().add(); - membersTab.assertMemberAddedSuccess(); - membersTab.tableUtils().checkRowItemExists("realm-user"); - }); -}); - -describe.skip("Identity providers", () => { - const idpTab = new IdentityProviderTab(); - before(() => { - adminClient.createOrganization({ - name: "idp", - domains: [{ name: "o.com", verified: false }], - }); - adminClient.createIdentityProvider("BitBucket", "bitbucket"); - }); - after(() => { - adminClient.deleteOrganization("idp"); - adminClient.deleteIdentityProvider("bitbucket"); - }); - - beforeEach(() => { - loginPage.logIn(); - keycloakBefore(); - page.goToTab(); - }); - - it("should add idp", () => { - listingPage.goToItemDetails("idp"); - idpTab.goToTab(); - idpTab.emptyState().checkIfExists(true); - idpTab.emptyState().clickPrimaryBtn(); - - idpTab.fillForm({ name: "bitbucket", domain: "o.com", public: true }); - idpTab.modalUtils().confirmModal(); - - idpTab.assertAddedSuccess(); - - idpTab.tableUtils().checkRowItemExists("bitbucket"); - }); -}); diff --git a/js/apps/admin-ui/cypress/e2e/partial_export_test.spec.ts b/js/apps/admin-ui/cypress/e2e/partial_export_test.spec.ts deleted file mode 100644 index eb0292efaa0..00000000000 --- a/js/apps/admin-ui/cypress/e2e/partial_export_test.spec.ts +++ /dev/null @@ -1,59 +0,0 @@ -import PartialExportModal from "../support/pages/admin-ui/configure/realm_settings/PartialExportModal"; -import RealmSettings from "../support/pages/admin-ui/configure/realm_settings/RealmSettings"; -import SidebarPage from "../support/pages/admin-ui/SidebarPage"; -import LoginPage from "../support/pages/LoginPage"; -import adminClient from "../support/util/AdminClient"; -import { keycloakBefore } from "../support/util/keycloak_hooks"; - -describe("Partial realm export", () => { - const REALM_NAME = "Partial-export-test-realm"; - - before(() => adminClient.createRealm(REALM_NAME)); - - after(() => adminClient.deleteRealm(REALM_NAME)); - - const loginPage = new LoginPage(); - const sidebarPage = new SidebarPage(); - const modal = new PartialExportModal(); - const realmSettings = new RealmSettings(); - - beforeEach(() => { - loginPage.logIn(); - keycloakBefore(); - sidebarPage.goToRealm(REALM_NAME).goToRealmSettings(); - realmSettings.clickActionMenu(); - modal.open(); - }); - - it("Closes the dialog", () => { - modal.cancelButton().click(); - modal.exportButton().should("not.exist"); - }); - - it("Shows a warning message", () => { - modal.warningMessage().should("not.exist"); - - modal.includeGroupsAndRolesSwitch().click({ force: true }); - modal.warningMessage().should("exist"); - modal.includeGroupsAndRolesSwitch().click({ force: true }); - modal.warningMessage().should("not.exist"); - - modal.includeClientsSwitch().click({ force: true }); - modal.warningMessage().should("exist"); - modal.includeClientsSwitch().click({ force: true }); - modal.warningMessage().should("not.exist"); - }); - - it("Exports the realm", () => { - modal.includeGroupsAndRolesSwitch().click({ force: true }); - modal.includeClientsSwitch().click({ force: true }); - cy.intercept("POST", `/admin/realms/${REALM_NAME}/partial-export*`).as( - "export", - ); - modal.exportButton().click(); - cy.wait("@export"); - - cy.readFile(Cypress.config("downloadsFolder") + "/realm-export.json"); - modal.exportButton().should("not.exist"); - }); -}); diff --git a/js/apps/admin-ui/cypress/e2e/partial_import_test.spec.ts b/js/apps/admin-ui/cypress/e2e/partial_import_test.spec.ts deleted file mode 100644 index d0e37e5a352..00000000000 --- a/js/apps/admin-ui/cypress/e2e/partial_import_test.spec.ts +++ /dev/null @@ -1,130 +0,0 @@ -import SidebarPage from "../support/pages/admin-ui/SidebarPage"; -import LoginPage from "../support/pages/LoginPage"; -import PartialImportModal from "../support/pages/admin-ui/configure/realm_settings/PartialImportModal"; -import RealmSettings from "../support/pages/admin-ui/configure/realm_settings/RealmSettings"; -import { keycloakBefore } from "../support/util/keycloak_hooks"; -import adminClient from "../support/util/AdminClient"; - -describe("Partial import test", () => { - const TEST_REALM = "Partial-import-test-realm"; - const TEST_REALM_2 = "Partial-import-test-realm-2"; - const loginPage = new LoginPage(); - const sidebarPage = new SidebarPage(); - const modal = new PartialImportModal(); - const realmSettings = new RealmSettings(); - - beforeEach(() => { - loginPage.logIn(); - keycloakBefore(); - sidebarPage.goToRealm(TEST_REALM); - sidebarPage.goToRealmSettings(); - realmSettings.clickActionMenu(); - }); - - before(() => - Promise.all([ - adminClient.createRealm(TEST_REALM), - adminClient.createRealm(TEST_REALM_2), - ]), - ); - - after(async () => { - await Promise.all([ - adminClient.deleteRealm(TEST_REALM), - adminClient.deleteRealm(TEST_REALM_2), - ]); - }); - - it("Opens and closes partial import dialog", () => { - modal.open(); - modal.importButton().should("be.disabled"); - modal.cancelButton().click(); - modal.importButton().should("not.exist"); - }); - - it("Import button only enabled if JSON has something to import", () => { - modal.open(); - modal.textArea().type("{}", { force: true }); - modal.importButton().should("be.disabled"); - modal.cancelButton().click(); - }); - - it("Displays user options after multi-realm import", () => { - modal.open(); - modal.typeResourceFile("multi-realm.json"); - - // Import button should be disabled if no checkboxes selected - modal.importButton().should("be.disabled"); - modal.usersCheckbox().click(); - modal.importButton().should("be.enabled"); - modal.groupsCheckbox().click(); - modal.importButton().should("be.enabled"); - modal.groupsCheckbox().click(); - modal.usersCheckbox().click(); - modal.importButton().should("be.disabled"); - - // verify resource counts - modal.userCount().contains("1 Users"); - modal.groupCount().contains("1 Groups"); - modal.clientCount().contains("1 Clients"); - modal.idpCount().contains("1 Identity providers"); - modal.realmRolesCount().contains("2 Realm roles"); - modal.clientRolesCount().contains("1 Client roles"); - - // import button should disable when switching realms - modal.usersCheckbox().click(); - modal.importButton().should("be.enabled"); - modal.selectRealm("realm2"); - modal.importButton().should("be.disabled"); - - modal.clientCount().contains("2 Clients"); - - modal.clientsCheckbox().click(); - modal.importButton().click(); - - cy.contains("2 records added"); - cy.contains("customer-portal"); - cy.contains("customer-portal2"); - modal.closeButton().click(); - }); - - it("Displays user options after realmless import and does the import", () => { - sidebarPage.goToRealm(TEST_REALM_2); - sidebarPage.goToRealmSettings(); - realmSettings.clickActionMenu(); - modal.open(); - - modal.typeResourceFile("client-only.json"); - - modal.realmSelector().should("not.exist"); - - modal.clientCount().contains("1 Clients"); - - modal.usersCheckbox().should("not.exist"); - modal.groupsCheckbox().should("not.exist"); - modal.idpCheckbox().should("not.exist"); - modal.realmRolesCheckbox().should("not.exist"); - modal.clientRolesCheckbox().should("not.exist"); - - modal.clientsCheckbox().click(); - modal.importButton().click(); - - cy.contains("One record added"); - cy.contains("customer-portal3"); - modal.closeButton().click(); - }); - - it("Should clear the input with the button", () => { - modal.open(); - - //clear button should be disabled if there is nothing in the dialog - modal.clearButton().should("be.disabled"); - modal.textArea().should("have.text", ""); - modal.textArea().type("{}", { force: true }); - modal.textArea().should("have.text", "{}"); - modal.clearButton().should("not.be.disabled"); - modal.clearButton().click(); - modal.clickClearConfirmButton(); - modal.textArea().should("have.text", ""); - }); -}); diff --git a/js/apps/admin-ui/cypress/e2e/realm_roles_test.spec.ts b/js/apps/admin-ui/cypress/e2e/realm_roles_test.spec.ts deleted file mode 100644 index 59b1251db31..00000000000 --- a/js/apps/admin-ui/cypress/e2e/realm_roles_test.spec.ts +++ /dev/null @@ -1,332 +0,0 @@ -import LoginPage from "../support/pages/LoginPage"; -import Masthead from "../support/pages/admin-ui/Masthead"; -import ModalUtils from "../support/util/ModalUtils"; -import ListingPage from "../support/pages/admin-ui/ListingPage"; -import SidebarPage from "../support/pages/admin-ui/SidebarPage"; -import createRealmRolePage from "../support/pages/admin-ui/manage/realm_roles/CreateRealmRolePage"; -import AssociatedRolesPage from "../support/pages/admin-ui/manage/realm_roles/AssociatedRolesPage"; -import { keycloakBefore } from "../support/util/keycloak_hooks"; -import adminClient from "../support/util/AdminClient"; -import ClientRolesTab from "../support/pages/admin-ui/manage/clients/ClientRolesTab"; -import KeyValueInput from "../support/pages/admin-ui/manage/KeyValueInput"; - -let itemId = "realm_role_crud"; -const loginPage = new LoginPage(); -const masthead = new Masthead(); -const modalUtils = new ModalUtils(); -const sidebarPage = new SidebarPage(); -const listingPage = new ListingPage(); -const associatedRolesPage = new AssociatedRolesPage(); -const rolesTab = new ClientRolesTab(); - -describe("Realm roles test", () => { - beforeEach(() => { - loginPage.logIn(); - keycloakBefore(); - sidebarPage.goToRealmRoles(); - }); - - it("should fail creating realm role", () => { - listingPage.goToCreateItem(); - createRealmRolePage.save().checkRealmRoleNameRequiredMessage(); - createRealmRolePage.fillRealmRoleData("admin").save(); - - // The error should inform about duplicated name/id (THIS MESSAGE DOES NOT HAVE QUOTES AS THE OTHERS) - masthead.checkNotificationMessage( - "Could not create role: Role with name admin already exists", - true, - ); - }); - - it("shouldn't create a realm role based with only whitespace name", () => { - listingPage.goToCreateItem(); - createRealmRolePage - .fillRealmRoleData(" ") - .checkRealmRoleNameRequiredMessage(); - }); - - it("Realm role CRUD test", () => { - itemId += "_" + crypto.randomUUID(); - - // Create - listingPage.itemExist(itemId, false).goToCreateItem(); - createRealmRolePage.fillRealmRoleData(itemId).save(); - masthead.checkNotificationMessage("Role created", true); - sidebarPage.goToRealmRoles(); - - const fetchUrl = "/admin/realms/master/roles?first=0&max=11"; - cy.intercept(fetchUrl).as("fetch"); - - listingPage.deleteItem(itemId); - - cy.wait(["@fetch"]); - modalUtils.checkModalTitle("Delete role?").confirmModal(); - masthead.checkNotificationMessage("The role has been deleted", true); - - listingPage.itemExist(itemId, false); - - itemId = "realm_role_crud"; - }); - - it("should delete role from details action", () => { - itemId += "_" + crypto.randomUUID(); - listingPage.goToCreateItem(); - createRealmRolePage.fillRealmRoleData(itemId).save(); - masthead.checkNotificationMessage("Role created", true); - createRealmRolePage.clickActionMenu("Delete this role"); - modalUtils.confirmModal(); - masthead.checkNotificationMessage("The role has been deleted", true); - itemId = "realm_role_crud"; - }); - - it("should not be able to delete default role", () => { - const defaultRole = "default-roles-master"; - listingPage.itemExist(defaultRole).deleteItem(defaultRole); - masthead.checkNotificationMessage( - "You cannot delete a default role.", - true, - ); - }); - - it("Add associated roles test", () => { - itemId += "_" + crypto.randomUUID(); - - // Create - listingPage.itemExist(itemId, false).goToCreateItem(); - createRealmRolePage.fillRealmRoleData(itemId).save(); - masthead.checkNotificationMessage("Role created", true); - - // Add associated realm role from action dropdown - associatedRolesPage.addAssociatedRealmRole("create-realm"); - masthead.checkNotificationMessage("Associated roles have been added", true); - - // Add associated realm role from search bar - associatedRolesPage.addAssociatedRoleFromSearchBar("offline_access"); - masthead.checkNotificationMessage("Associated roles have been added", true); - - rolesTab.goToAssociatedRolesTab(); - - // Add associated client role from search bar - associatedRolesPage.addAssociatedRoleFromSearchBar("manage-account", true); - masthead.checkNotificationMessage("Associated roles have been added", true); - - rolesTab.goToAssociatedRolesTab(); - - // Add associated client role - associatedRolesPage.addAssociatedRoleFromSearchBar("manage-consent", true); - masthead.checkNotificationMessage("Associated roles have been added", true); - - rolesTab.goToAssociatedRolesTab(); - - // Add associated client role - associatedRolesPage.addAssociatedRoleFromSearchBar( - "manage-account-links", - true, - ); - masthead.checkNotificationMessage("Associated roles have been added", true); - }); - - it("should search existing associated role by name and go to it", () => { - listingPage - .searchItem("create-realm", false) - .itemExist("create-realm") - .goToItemDetails("create-realm"); - - cy.findByTestId("view-header").should("contain.text", "create-realm"); - cy.findByTestId("cancel").click(); - }); - - it("should go to default-roles-master link role name and check assign roles table is not empty", () => { - listingPage.goToItemDetails("default-roles-master"); - - rolesTab.goToDefaultGroupsTab(); - cy.findByTestId("assigned-roles").find("tr").should("have.length.gt", 0); - cy.findByTestId("empty-state").contains("No default groups"); - - rolesTab.goToDefaultRolesTab(); - cy.findByTestId("assigned-roles").find("tr").should("have.length.gt", 0); - }); - - it("Should search non-existent associated role by name", () => { - const itemName = "non-existent-associated-role"; - listingPage.searchItem(itemName, false); - listingPage.assertNoResults(); - }); - - it("Should hide inherited roles test", () => { - listingPage.searchItem(itemId, false).goToItemDetails(itemId); - rolesTab.goToAssociatedRolesTab(); - rolesTab.hideInheritedRoles(); - }); - - it("Should fail to remove role when all unchecked from search bar", () => { - listingPage.searchItem(itemId, false).goToItemDetails(itemId); - rolesTab.goToAssociatedRolesTab(); - associatedRolesPage.isRemoveAssociatedRolesBtnDisabled(); - }); - - it("Should delete single non-inherited role item", () => { - listingPage.searchItem(itemId, false).goToItemDetails(itemId); - rolesTab.goToAssociatedRolesTab(); - listingPage.removeItem("create-realm"); - sidebarPage.waitForPageLoad(); - modalUtils.checkModalTitle("Remove role?").confirmModal(); - sidebarPage.waitForPageLoad(); - - masthead.checkNotificationMessage("Role mapping updated", true); - }); - - it("Should delete all roles from search bar", () => { - listingPage.searchItem(itemId, false).goToItemDetails(itemId); - sidebarPage.waitForPageLoad(); - rolesTab.goToAssociatedRolesTab(); - - cy.get('input[name="check-all"]').check(); - - associatedRolesPage.removeAssociatedRoles(); - - sidebarPage.waitForPageLoad(); - modalUtils.checkModalTitle("Remove role?").confirmModal(); - sidebarPage.waitForPageLoad(); - - masthead.checkNotificationMessage("Role mapping updated", true); - }); - - it("Should delete associated roles from list test", () => { - itemId = "realm_role_crud"; - itemId += "_" + crypto.randomUUID(); - - // Create - listingPage.itemExist(itemId, false).goToCreateItem(); - createRealmRolePage.fillRealmRoleData(itemId).save(); - masthead.checkNotificationMessage("Role created", true); - - // Add associated realm role from action dropdown - associatedRolesPage.addAssociatedRealmRole("create-realm"); - masthead.checkNotificationMessage("Associated roles have been added", true); - - // Add associated realm role from search bar - associatedRolesPage.addAssociatedRoleFromSearchBar("offline_access"); - masthead.checkNotificationMessage("Associated roles have been added", true); - - rolesTab.goToAssociatedRolesTab(); - - // delete associated roles from list - listingPage.removeItem("create-realm"); - sidebarPage.waitForPageLoad(); - modalUtils.checkModalTitle("Remove role?").confirmModal(); - sidebarPage.waitForPageLoad(); - - masthead.checkNotificationMessage("Role mapping updated", true); - listingPage.removeItem("offline_access"); - sidebarPage.waitForPageLoad(); - modalUtils.checkModalTitle("Remove role?").confirmModal(); - sidebarPage.waitForPageLoad(); - - masthead.checkNotificationMessage("Role mapping updated", true); - }); - - describe("edit role details", () => { - const editRoleName = "going to edit"; - const description = "some description"; - const updateDescription = "updated description"; - - before(() => - adminClient.createRealmRole({ - name: editRoleName, - description, - }), - ); - - after(() => adminClient.deleteRealmRole(editRoleName)); - - it("should edit realm role details", () => { - listingPage.itemExist(editRoleName).goToItemDetails(editRoleName); - createRealmRolePage.checkNameDisabled().checkDescription(description); - createRealmRolePage.updateDescription(updateDescription).save(); - masthead.checkNotificationMessage("The role has been saved", true); - createRealmRolePage.checkDescription(updateDescription); - }); - - const keyValue = new KeyValueInput("attributes"); - - it("should add attribute", () => { - listingPage.itemExist(editRoleName).goToItemDetails(editRoleName); - - createRealmRolePage.goToAttributesTab(); - keyValue.fillKeyValue({ key: "one", value: "1" }).validateRows(1); - keyValue.save(); - masthead.checkNotificationMessage("The role has been saved", true); - keyValue.validateRows(1); - }); - - it("should add attribute multiple", () => { - listingPage.itemExist(editRoleName).goToItemDetails(editRoleName); - - createRealmRolePage.goToAttributesTab(); - keyValue - .fillKeyValue({ key: "two", value: "2" }) - .fillKeyValue({ key: "three", value: "3" }) - .save() - .validateRows(3); - }); - - it("should delete attribute", () => { - listingPage.itemExist(editRoleName).goToItemDetails(editRoleName); - createRealmRolePage.goToAttributesTab(); - - keyValue.deleteRow(1).save().validateRows(2); - }); - }); - - describe("Accessibility tests for realm roles", () => { - beforeEach(() => { - loginPage.logIn(); - keycloakBefore(); - sidebarPage.goToRealmRoles(); - cy.injectAxe(); - }); - - const role = "a11y-role" + crypto.randomUUID(); - const defaultRolesMaster = "default-roles-master"; - - it("Check a11y violations on load/ realm roles", () => { - cy.checkA11y(); - }); - - it("Check a11y violations on default-roles-master default tab and default roles tabs", () => { - listingPage.goToItemDetails(defaultRolesMaster); - cy.checkA11y(); - - rolesTab.goToDefaultGroupsTab(); - cy.checkA11y(); - }); - - it("Check a11y violations on empty create role form", () => { - rolesTab.goToCreateRoleFromToolbar(); - cy.checkA11y(); - }); - - it("Check a11y violations on role details", () => { - const permissionSwitch = "permissionSwitch"; - rolesTab.goToCreateRoleFromToolbar(); - createRealmRolePage.fillRealmRoleData(role).save(); - cy.checkA11y(); - - rolesTab.goToAttributesTab(); - cy.checkA11y(); - - rolesTab.goToUsersInRoleTab(); - cy.checkA11y(); - - rolesTab.goToPermissionsTab(); - cy.findByTestId(permissionSwitch).parent().click(); - cy.checkA11y(); - - sidebarPage.goToRealmRoles(); - listingPage.deleteItem(role); - cy.checkA11y(); - cy.findByTestId("confirm").click(); - }); - }); -}); diff --git a/js/apps/admin-ui/cypress/e2e/realm_settings_client_policies_test.spec.ts b/js/apps/admin-ui/cypress/e2e/realm_settings_client_policies_test.spec.ts deleted file mode 100644 index d3aa37a9c2f..00000000000 --- a/js/apps/admin-ui/cypress/e2e/realm_settings_client_policies_test.spec.ts +++ /dev/null @@ -1,186 +0,0 @@ -import SidebarPage from "../support/pages/admin-ui/SidebarPage"; -import LoginPage from "../support/pages/LoginPage"; -import RealmSettingsPage from "../support/pages/admin-ui/manage/realm_settings/RealmSettingsPage"; -import { keycloakBefore } from "../support/util/keycloak_hooks"; -import adminClient from "../support/util/AdminClient"; -import ModalUtils from "../support/util/ModalUtils"; -import Masthead from "../support/pages/admin-ui/Masthead"; - -const loginPage = new LoginPage(); -const sidebarPage = new SidebarPage(); -const modalUtils = new ModalUtils(); -const masthead = new Masthead(); - -describe("Realm settings client policies tab tests", () => { - const realmName = "Realm_" + crypto.randomUUID(); - const realmSettingsPage = new RealmSettingsPage(realmName); - - beforeEach(() => { - loginPage.logIn(); - keycloakBefore(); - sidebarPage - .waitForPageLoad() - .goToRealm(realmName) - .goToRealmSettings() - .waitForPageLoad(); - realmSettingsPage.goToClientPoliciesTab().goToClientPoliciesList(); - }); - - before(() => adminClient.createRealm(realmName)); - - after(() => { - adminClient.deleteRealm(realmName); - }); - - it("Complete new client form and cancel", () => { - realmSettingsPage - .checkDisplayPoliciesTab() - .createNewClientPolicyFromEmptyState("Test", "Test Description", true) - .checkNewClientPolicyForm() - .cancelNewClientPolicyCreation() - .checkEmptyPolicyList(); - }); - - it("Complete new client form and submit", () => { - const url = `/admin/realms/${realmName}/client-policies/policies`; - cy.intercept("PUT", url).as("save"); - - realmSettingsPage.createNewClientPolicyFromEmptyState( - "Test", - "Test Description", - ); - masthead.checkNotificationMessage("New policy created"); - cy.wait("@save"); - }); - - it("Should perform client profile search by profile name", () => { - realmSettingsPage.searchClientPolicy("Test"); - }); - - it("Should not have conditions configured by default", () => { - realmSettingsPage.shouldNotHaveConditionsConfigured(); - }); - - it("Should cancel adding a new condition to a client profile", () => { - realmSettingsPage.shouldCancelAddingCondition(); - }); - - it("Should add a new client-roles condition to a client profile", () => { - realmSettingsPage.shouldAddClientRolesCondition(); - }); - - it("Should add a new client-scopes condition to a client profile", () => { - realmSettingsPage.shouldAddClientScopesCondition(); - }); - - it("Should edit the client-roles condition of a client profile", () => { - realmSettingsPage.shouldEditClientRolesCondition(); - }); - - it("Should edit the client-scopes condition of a client profile", () => { - realmSettingsPage.shouldEditClientScopesCondition(); - }); - - it("Should cancel deleting condition from a client profile", () => { - realmSettingsPage.deleteClientRolesCondition(); - sidebarPage.waitForPageLoad(); - modalUtils - .checkModalTitle("Delete condition?") - .checkModalMessage( - "This action will permanently delete client-roles. This cannot be undone.", - ) - .checkConfirmButtonText("Delete") - .cancelButtonContains("Cancel") - .cancelModal(); - realmSettingsPage.checkConditionsListContains("client-roles"); - }); - - it("Should delete client-roles condition from a client profile", () => { - realmSettingsPage.deleteClientRolesCondition(); - sidebarPage.waitForPageLoad(); - modalUtils.confirmModal(); - realmSettingsPage.checkConditionsListContains("client-scopes"); - }); - - it("Should delete client-scopes condition from a client profile", () => { - realmSettingsPage.shouldDeleteClientScopesCondition(); - }); - - it("Check cancelling the client policy deletion", () => { - realmSettingsPage.deleteClientPolicyItemFromTable("Test"); - modalUtils - .checkModalMessage( - "This action will permanently delete the policy Test. This cannot be undone.", - ) - .cancelModal(); - realmSettingsPage.checkElementInList("Test"); - }); - - it("Check deleting the client policy", () => { - realmSettingsPage.deleteClientPolicyItemFromTable("Test"); - - modalUtils.confirmModal(); - masthead.checkNotificationMessage("Client policy deleted"); - realmSettingsPage.checkEmptyPolicyList(); - }); - - it("Check navigating between Form View and JSON editor", () => { - realmSettingsPage.shouldNavigateBetweenFormAndJSONViewPolicies(); - }); - - it("Should not create duplicate client profile", () => { - const url = `admin/realms/${realmName}/client-policies/policies`; - cy.intercept("PUT", url).as("save"); - - realmSettingsPage.createNewClientPolicyFromEmptyState( - "Test", - "Test Description", - ); - masthead.checkNotificationMessage("New policy created"); - cy.wait("@save"); - - sidebarPage.goToRealmSettings(); - - realmSettingsPage.goToClientPoliciesTab().goToClientPoliciesList(); - - realmSettingsPage.createNewClientPolicyFromList( - "Test", - "Test Again Description", - true, - ); - - realmSettingsPage.shouldShowErrorWhenDuplicate(); - sidebarPage.goToRealmSettings(); - - realmSettingsPage - .goToClientPoliciesTab() - .goToClientPoliciesList() - .deleteClientPolicyItemFromTable("Test"); - - modalUtils.confirmModal(); - cy.wait("@save"); - masthead.checkNotificationMessage("Client policy deleted"); - realmSettingsPage.checkEmptyPolicyList(); - }); - - it("Check deleting newly created client policy from create view via dropdown", () => { - const url = `admin/realms/${realmName}/client-policies/policies`; - cy.intercept("PUT", url).as("save"); - realmSettingsPage.createNewClientPolicyFromEmptyState( - "Test again", - "Test Again Description", - ); - masthead.checkNotificationMessage("New policy created"); - sidebarPage.waitForPageLoad(); - cy.wait("@save"); - realmSettingsPage.deleteClientPolicyFromDetails(); - modalUtils.confirmModal(); - masthead.checkNotificationMessage("Client policy deleted"); - sidebarPage.waitForPageLoad(); - realmSettingsPage.checkEmptyPolicyList(); - }); - - it("Check reloading JSON policies", () => { - realmSettingsPage.shouldReloadJSONPolicies(); - }); -}); diff --git a/js/apps/admin-ui/cypress/e2e/realm_settings_client_profiles_test.spec.ts b/js/apps/admin-ui/cypress/e2e/realm_settings_client_profiles_test.spec.ts deleted file mode 100644 index 3e9dc5979a8..00000000000 --- a/js/apps/admin-ui/cypress/e2e/realm_settings_client_profiles_test.spec.ts +++ /dev/null @@ -1,184 +0,0 @@ -import SidebarPage from "../support/pages/admin-ui/SidebarPage"; -import LoginPage from "../support/pages/LoginPage"; -import RealmSettingsPage from "../support/pages/admin-ui/manage/realm_settings/RealmSettingsPage"; -import { keycloakBefore } from "../support/util/keycloak_hooks"; -import adminClient from "../support/util/AdminClient"; -import ModalUtils from "../support/util/ModalUtils"; -import Masthead from "../support/pages/admin-ui/Masthead"; - -const loginPage = new LoginPage(); -const sidebarPage = new SidebarPage(); -const modalUtils = new ModalUtils(); -const masthead = new Masthead(); - -describe("Realm settings client profiles tab tests", () => { - const profileName = "Test"; - const editedProfileName = "Edit"; - const realmName = "Realm_" + crypto.randomUUID(); - const realmSettingsPage = new RealmSettingsPage(realmName); - - beforeEach(() => { - loginPage.logIn(); - keycloakBefore(); - sidebarPage.waitForPageLoad().goToRealm(realmName).goToRealmSettings(); - realmSettingsPage.goToClientPoliciesTab().goToClientProfilesList(); - }); - - before(() => adminClient.createRealm(realmName)); - - after(() => 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 - .createClientProfile(profileName, "Test Description") - .cancelClientProfileCreation() - .checkElementNotInList(profileName); - }); - - it("Complete new client form and submit", () => { - const url = `admin/realms/${realmName}/client-policies/profiles`; - cy.intercept("PUT", url).as("save"); - realmSettingsPage - .createClientProfile(profileName, "Test Description") - .saveClientProfileCreation(); - cy.wait("@save"); - masthead.checkNotificationMessage("New client profile created"); - }); - - it("Should perform client profile search by profile name", () => { - realmSettingsPage.searchClientProfile(profileName); - }); - - it("Should search non-existent client profile", () => { - realmSettingsPage.searchNonExistingClientProfile("nonExistentProfile"); - cy.findByTestId("empty-state").should("be.visible"); - }); - - it("Should navigate to client profile", () => { - realmSettingsPage.searchClientProfile(profileName); - realmSettingsPage.goToClientProfileByNameLink(profileName); - cy.findByTestId("view-header").should("have.text", profileName); - }); - - it("Check navigating between Form View and JSON editor", () => { - realmSettingsPage.shouldNavigateBetweenFormAndJSONView(); - }); - - it("Check saving changed JSON profiles", () => { - realmSettingsPage.shouldSaveChangedJSONProfiles(); - realmSettingsPage.deleteClientPolicyItemFromTable(profileName); - modalUtils.confirmModal(); - masthead.checkNotificationMessage("Client profile deleted"); - realmSettingsPage.checkElementNotInList(profileName); - }); - - it("Should not create duplicate client profile", () => { - const url = `admin/realms/${realmName}/client-policies/profiles`; - cy.intercept("PUT", url).as("save"); - realmSettingsPage - .createClientProfile(profileName, "Test Description") - .saveClientProfileCreation(); - cy.wait("@save"); - - sidebarPage.goToRealmSettings(); - realmSettingsPage.goToClientPoliciesTab().goToClientProfilesList(); - - sidebarPage.waitForPageLoad(); - realmSettingsPage - .createClientProfile(profileName, "Test Description") - .saveClientProfileCreation(); - cy.wait("@save"); - masthead.checkNotificationMessage( - "Could not create client profile: 'proposed client profile name duplicated.'", - ); - }); - - it("Should edit client profile", () => { - realmSettingsPage.shouldEditClientProfile(); - }); - - it("Should check that edited client profile is now listed", () => { - sidebarPage.goToRealmSettings(); - realmSettingsPage - .goToClientPoliciesTab() - .goToClientProfilesList() - .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.openProfileDetails(editedProfileName).editExecutor(4000); - sidebarPage.waitForPageLoad(); - realmSettingsPage - .cancelEditingExecutor() - .checkExecutorNotInList() - .editExecutor() - .checkAvailablePeriodExecutor(3600); - }); - - it("Should edit executor", () => { - realmSettingsPage - .openProfileDetails(editedProfileName) - .editExecutor(4000) - .saveExecutor(); - masthead.checkNotificationMessage("Executor updated successfully"); - realmSettingsPage.editExecutor(); - // TODO: UNCOMMENT LINE WHEN ISSUE 2037 IS FIXED - //.checkAvailablePeriodExecutor(4000); - }); - - it("Should delete executor from a client profile", () => { - realmSettingsPage.shouldDeleteExecutor(); - }); - - it("Check cancelling the client profile deletion", () => { - realmSettingsPage.deleteClientPolicyItemFromTable(editedProfileName); - modalUtils - .checkModalMessage( - "This action will permanently delete the profile " + - editedProfileName + - ". This cannot be undone.", - ) - .cancelModal(); - realmSettingsPage.checkElementInList(editedProfileName); - }); - - it("Check deleting the client profile", () => { - realmSettingsPage.deleteClientPolicyItemFromTable(editedProfileName); - modalUtils.confirmModal(); - masthead.checkNotificationMessage("Client profile deleted"); - sidebarPage.waitForPageLoad(); - realmSettingsPage.checkElementNotInList(editedProfileName); - }); -}); diff --git a/js/apps/admin-ui/cypress/e2e/realm_settings_events_test.spec.ts b/js/apps/admin-ui/cypress/e2e/realm_settings_events_test.spec.ts deleted file mode 100644 index f8b2b3b93f3..00000000000 --- a/js/apps/admin-ui/cypress/e2e/realm_settings_events_test.spec.ts +++ /dev/null @@ -1,418 +0,0 @@ -import SidebarPage from "../support/pages/admin-ui/SidebarPage"; -import LoginPage from "../support/pages/LoginPage"; -import RealmSettingsPage from "../support/pages/admin-ui/manage/realm_settings/RealmSettingsPage"; -import Masthead from "../support/pages/admin-ui/Masthead"; -import ModalUtils from "../support/util/ModalUtils"; -import { keycloakBefore } from "../support/util/keycloak_hooks"; -import ListingPage from "../support/pages/admin-ui/ListingPage"; -import adminClient from "../support/util/AdminClient"; -import KeysTab from "../support/pages/admin-ui/manage/realm_settings/KeysTab"; - -const loginPage = new LoginPage(); -const sidebarPage = new SidebarPage(); -const masthead = new Masthead(); -const modalUtils = new ModalUtils(); -const realmSettingsPage = new RealmSettingsPage(); -const keysTab = new KeysTab(); - -describe("Realm settings events tab tests", () => { - const realmName = "Realm_" + crypto.randomUUID(); - const listingPage = new ListingPage(); - - beforeEach(() => { - loginPage.logIn(); - keycloakBefore(); - sidebarPage.goToRealm(realmName); - }); - - before(async () => { - await adminClient.createRealm(realmName); - }); - - after(async () => { - await adminClient.deleteRealm(realmName); - }); - - const goToDetails = () => { - const keysUrl = `/admin/realms/${realmName}/keys`; - cy.intercept(keysUrl).as("keysFetch"); - - keysTab.goToKeysTab(); - cy.findByTestId("rs-providers-tab").click(); - cy.findAllByTestId("provider-name-link") - .contains("test_aes-generated") - .click(); - - sidebarPage.goToRealmSettings(); - - keysTab.goToKeysTab(); - cy.findByTestId("rs-providers-tab").click(); - cy.findAllByTestId("provider-name-link") - .contains("test_hmac-generated") - .click(); - - sidebarPage.goToRealmSettings(); - - keysTab.goToKeysTab(); - cy.findByTestId("rs-providers-tab").click(); - cy.findAllByTestId("provider-name-link").contains("test_rsa").click(); - - sidebarPage.goToRealmSettings(); - - keysTab.goToKeysTab(); - cy.findByTestId("rs-providers-tab").click(); - cy.findAllByTestId("provider-name-link") - .contains("test_rsa-generated") - .click(); - - sidebarPage.goToRealmSettings(); - - keysTab.goToKeysTab(); - cy.findByTestId("rs-providers-tab").click(); - cy.findAllByTestId("provider-name-link") - .contains("test_rsa-enc-generated") - .click(); - - cy.wait(["@keysFetch"]); - - return this; - }; - - const goToKeys = () => { - const keysUrl = `/admin/realms/${realmName}/keys`; - cy.intercept(keysUrl).as("keysFetch"); - keysTab.goToKeysTab(); - cy.findByTestId("rs-keys-list-tab").click(); - cy.wait(["@keysFetch"]); - - return this; - }; - - it("Enable user events", () => { - cy.intercept("GET", `/admin/realms/${realmName}/events/config`).as("load"); - sidebarPage.goToRealmSettings(); - cy.findByTestId("rs-realm-events-tab").click(); - cy.findByTestId("rs-events-tab").click(); - cy.wait("@load"); - realmSettingsPage - .toggleSwitch(realmSettingsPage.enableEvents, false) - .save(realmSettingsPage.eventsUserSave); - masthead.checkNotificationMessage("Successfully saved configuration"); - realmSettingsPage.clearEvents("user"); - modalUtils - .checkModalMessage( - "If you clear all events of this realm, all records will be permanently cleared in the database", - ) - .confirmModal(); - masthead.checkNotificationMessage("The user events have been cleared"); - const events = ["Client info", "Client info error"]; - cy.intercept("GET", `/admin/realms/${realmName}/events/config`).as( - "fetchConfig", - ); - realmSettingsPage.addUserEvents(events).clickAdd(); - masthead.checkNotificationMessage("Successfully saved configuration"); - cy.wait(["@fetchConfig"]); - sidebarPage.waitForPageLoad(); - cy.wait(1000); - for (const event of events) { - listingPage.searchItem(event, false).itemExist(event); - } - }); - - it("Go to keys tab", () => { - sidebarPage.goToRealmSettings(); - - keysTab.goToKeysTab(); - }); - - it("add Providers", () => { - sidebarPage.goToRealmSettings(); - - keysTab.goToKeysTab(); - - cy.findByTestId("rs-providers-tab").click(); - - realmSettingsPage.toggleAddProviderDropdown(); - - cy.findByTestId("option-aes-generated").click(); - realmSettingsPage.enterUIDisplayName("test_aes-generated"); - realmSettingsPage.addProvider(); - - realmSettingsPage.toggleAddProviderDropdown(); - - cy.findByTestId("option-ecdsa-generated").click(); - realmSettingsPage.enterUIDisplayName("test_ecdsa-generated"); - realmSettingsPage.toggleSwitch("active", false); - realmSettingsPage.toggleSwitch("ecGenerateCertificate", false); - realmSettingsPage.addProvider(); - - realmSettingsPage.toggleAddProviderDropdown(); - - cy.findByTestId("option-hmac-generated").click(); - realmSettingsPage.enterUIDisplayName("test_hmac-generated"); - realmSettingsPage.toggleSwitch("enabled", false); - realmSettingsPage.addProvider(); - - realmSettingsPage.toggleAddProviderDropdown(); - - cy.findByTestId("option-rsa-generated").click(); - realmSettingsPage.enterUIDisplayName("test_rsa-generated"); - realmSettingsPage.addProvider(); - - realmSettingsPage.toggleAddProviderDropdown(); - - cy.findByTestId("option-rsa-enc-generated").click(); - realmSettingsPage.enterUIDisplayName("test_rsa-enc-generated"); - realmSettingsPage.addProvider(); - }); - - it("search providers", () => { - sidebarPage.goToRealmSettings(); - - keysTab.goToKeysTab(); - - cy.findByTestId("rs-providers-tab").click(); - - // search providers - cy.findByTestId("provider-search-input").type("rsa{enter}"); - listingPage.checkTableLength(4, "kc-draggable-table"); - cy.findByTestId("provider-search-input").clear().type("{enter}"); - }); - - it("go to details", () => { - sidebarPage.goToRealmSettings(); - goToDetails(); - }); - - it("Test keys", () => { - sidebarPage.goToRealmSettings(); - goToKeys(); - - realmSettingsPage.testSelectFilter(); - }); - - it.skip("Should search active keys", () => { - sidebarPage.goToRealmSettings(); - goToKeys(); - - realmSettingsPage.switchToActiveFilter(); - listingPage.searchItem("rs", false); - listingPage.checkTableLength(3, "kc-keys-list"); - }); - - it("Should search passive keys", () => { - sidebarPage.goToRealmSettings(); - goToKeys(); - - realmSettingsPage.switchToPassiveFilter(); - listingPage.searchItem("ec", false); - listingPage.checkTableLength(1, "kc-keys-list"); - }); - - it("Should search disabled keys", () => { - sidebarPage.goToRealmSettings(); - goToKeys(); - - realmSettingsPage.switchToDisabledFilter(); - listingPage.searchItem("hs", false); - listingPage.checkTableLength(1, "kc-keys-list"); - }); - - it("delete provider", () => { - sidebarPage.goToRealmSettings(); - - keysTab.goToKeysTab(); - - cy.findByTestId("rs-providers-tab").click(); - - realmSettingsPage.deleteProvider("test_aes-generated"); - }); - - it("list keys", () => { - sidebarPage.goToRealmSettings(); - keysTab.goToKeysTab(); - realmSettingsPage.checkKeyPublic(); - }); - - it("Realm header settings", () => { - sidebarPage.goToRealmSettings(); - cy.findByTestId("rs-security-defenses-tab").click(); - cy.findByTestId("browserSecurityHeaders.xFrameOptions").clear(); - cy.findByTestId("browserSecurityHeaders.xFrameOptions").type("DENY"); - cy.findByTestId("headers-form-tab-save").should("be.enabled").click(); - - masthead.checkNotificationMessage("Realm successfully updated"); - }); - - it("Brute force detection", () => { - sidebarPage.goToRealmSettings(); - cy.findAllByTestId("rs-security-defenses-tab").click(); - cy.get("#pf-tab-20-bruteForce").click(); - - cy.get("#kc-brute-force-mode").click(); - cy.findByTestId("select-brute-force-mode") - .contains("Lockout temporarily") - .click(); - cy.findByTestId("waitIncrementSeconds").type("1"); - cy.findByTestId("maxFailureWaitSeconds").type("1"); - cy.findByTestId("maxDeltaTimeSeconds").type("1"); - cy.findByTestId("minimumQuickLoginWaitSeconds").type("1"); - - cy.findByTestId("brute-force-tab-save").should("be.enabled").click(); - masthead.checkNotificationMessage("Realm successfully updated"); - }); - - it("add session data", () => { - sidebarPage.goToRealmSettings(); - - cy.findByTestId("rs-sessions-tab").click(); - - realmSettingsPage.populateSessionsPage(); - realmSettingsPage.save("sessions-tab-save"); - - masthead.checkNotificationMessage("Realm successfully updated"); - }); - - it("check that sessions data was saved", () => { - sidebarPage.goToAuthentication(); - sidebarPage.goToRealmSettings(); - - cy.findByTestId("rs-sessions-tab").click(); - - 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, - ); - - 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", - ); - - cy.findByTestId(realmSettingsPage.loginTimeoutInput).should( - "have.value", - 9, - ); - cy.findByTestId(realmSettingsPage.loginActionTimeoutInput).should( - "have.value", - 10, - ); - }); - - 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.parRequestUriLifespanInput).should( - "have.value", - 2, - ); - 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, - ); - }); -}); - -describe("Realm settings events tab tests", () => { - beforeEach(() => { - loginPage.logIn(); - keycloakBefore(); - sidebarPage.goToRealmSettings(); - cy.findByTestId("rs-realm-events-tab").click(); - cy.findByTestId("rs-event-listeners-tab").click(); - }); - - it("Should display event listeners form", () => { - realmSettingsPage.shouldDisplayEventListenersForm(); - }); - - it("Should revert saving event listener", () => { - realmSettingsPage.shouldRevertSavingEventListener(); - }); - - it("Should save event listener", () => { - realmSettingsPage.shouldSaveEventListener(); - }); - - it("Should remove event from event listener", () => { - realmSettingsPage.shouldRemoveEventFromEventListener(); - }); - - it("Should remove all events from event listener and re-save original", () => { - realmSettingsPage.shouldRemoveAllEventListeners(); - realmSettingsPage.shouldReSaveEventListener(); - }); -}); diff --git a/js/apps/admin-ui/cypress/e2e/realm_settings_general_tab_test.spec.ts b/js/apps/admin-ui/cypress/e2e/realm_settings_general_tab_test.spec.ts deleted file mode 100644 index 72b4aa63bcb..00000000000 --- a/js/apps/admin-ui/cypress/e2e/realm_settings_general_tab_test.spec.ts +++ /dev/null @@ -1,184 +0,0 @@ -import { SERVER_URL } from "../support/constants"; -import LoginPage from "../support/pages/LoginPage"; -import Masthead from "../support/pages/admin-ui/Masthead"; -import SidebarPage from "../support/pages/admin-ui/SidebarPage"; -import RealmSettingsPage from "../support/pages/admin-ui/manage/realm_settings/RealmSettingsPage"; -import adminClient from "../support/util/AdminClient"; -import { keycloakBefore } from "../support/util/keycloak_hooks"; - -const loginPage = new LoginPage(); -const sidebarPage = new SidebarPage(); -const masthead = new Masthead(); -const realmSettingsPage = new RealmSettingsPage(); - -describe("Realm settings general tab tests", () => { - const realmName = "Realm_" + crypto.randomUUID(); - - beforeEach(() => { - loginPage.logIn(); - keycloakBefore(); - sidebarPage.goToRealm(realmName); - }); - - before(async () => { - await adminClient.createRealm(realmName); - }); - - after(async () => { - await adminClient.deleteRealm(realmName); - }); - - it("Test all general tab switches", () => { - sidebarPage.goToRealmSettings(); - realmSettingsPage.toggleSwitch( - realmSettingsPage.managedAccessSwitch, - false, - ); - realmSettingsPage.save(realmSettingsPage.generalSaveBtn); - masthead.checkNotificationMessage("Realm successfully updated", true); - realmSettingsPage.toggleSwitch( - realmSettingsPage.managedAccessSwitch, - false, - ); - realmSettingsPage.save(realmSettingsPage.generalSaveBtn); - masthead.checkNotificationMessage("Realm successfully updated", true); - }); - - it("Test realm enable/disable switch", () => { - sidebarPage.goToRealmSettings(); - - // Enable realm - realmSettingsPage.toggleSwitch(`${realmName}-switch`); - masthead.checkNotificationMessage("Realm successfully updated", true); - realmSettingsPage.assertSwitch(`${realmName}-switch`, true); - - // Disable realm - realmSettingsPage.toggleSwitch(`${realmName}-switch`, false); - realmSettingsPage.disableRealm(); - masthead.checkNotificationMessage("Realm successfully updated", true); - }); - - it("Fail to set Realm ID to empty", () => { - sidebarPage.goToRealmSettings(); - realmSettingsPage.clearRealmId(); - realmSettingsPage.saveGeneral(); - cy.findByTestId("realm-id-error").should("have.text", "Required field"); - }); - - it("Modify Display name", () => { - sidebarPage.goToRealmSettings(); - realmSettingsPage.fillDisplayName("display_name"); - realmSettingsPage.save(realmSettingsPage.generalSaveBtn); - masthead.checkNotificationMessage("Realm successfully updated", true); - }); - - it("Check Display name value", () => { - sidebarPage.goToRealmSettings(); - realmSettingsPage.getDisplayName("display_name"); - }); - - it("Modify front end URL", () => { - sidebarPage.goToRealmSettings(); - realmSettingsPage.fillFrontendURL("www.example.com"); - - // TODO: Fix internal server error 500 when front-end URL is saved - // realmSettingsPage.save(realmSettingsPage.generalSaveBtn); - // masthead.checkNotificationMessage("Realm successfully updated", true); - - realmSettingsPage.getFrontendURL("www.example.com"); - realmSettingsPage.clearFrontendURL(); - }); - - it("Select SSL all requests", () => { - sidebarPage.goToRealmSettings(); - realmSettingsPage.fillRequireSSL("All requests"); - realmSettingsPage.save(realmSettingsPage.generalSaveBtn); - masthead.checkNotificationMessage("Realm successfully updated", true); - }); - - it("Verify SSL all requests displays", () => { - sidebarPage.goToRealmSettings(); - realmSettingsPage.getRequireSSL("All requests"); - }); - - it("Select SSL external requests", () => { - sidebarPage.goToRealmSettings(); - realmSettingsPage.fillRequireSSL("External requests"); - realmSettingsPage.save(realmSettingsPage.generalSaveBtn); - masthead.checkNotificationMessage("Realm successfully updated", true); - }); - - it("Verify SSL external requests displays", () => { - sidebarPage.goToRealmSettings(); - realmSettingsPage.getRequireSSL("External requests"); - }); - - it("Select SSL None", () => { - sidebarPage.goToRealmSettings(); - realmSettingsPage.fillRequireSSL("None"); - realmSettingsPage.save(realmSettingsPage.generalSaveBtn); - masthead.checkNotificationMessage("Realm successfully updated", true); - }); - - it("Verify SSL None displays", () => { - sidebarPage.goToRealmSettings(); - realmSettingsPage.getRequireSSL("None"); - }); - - it("Check Access Endpoints OpenID Endpoint Configuration link", () => { - sidebarPage.goToRealmSettings(); - - // Check link exists - cy.get("a") - .contains("OpenID Endpoint Configuration") - .should( - "have.attr", - "href", - `${SERVER_URL}/realms/${realmName}/.well-known/openid-configuration`, - ) - .should("have.attr", "target", "_blank") - .should("have.attr", "rel", "noreferrer noopener"); - }); - - it("Access Endpoints OpenID Endpoint Configuration link", () => { - sidebarPage.goToRealmSettings(); - // Check the link is live - cy.get("a") - .contains("OpenID Endpoint Configuration") - .then((link) => { - cy.request(link.prop("href")).its("status").should("eq", 200); - }); - }); - - it("Check if Access Endpoints SAML 2.0 Identity Provider Metadata link exists", () => { - sidebarPage.goToRealmSettings(); - cy.get("a") - .contains("SAML 2.0 Identity Provider Metadata") - .should( - "have.attr", - "href", - `${SERVER_URL}/realms/${realmName}/protocol/saml/descriptor`, - ) - .should("have.attr", "target", "_blank") - .should("have.attr", "rel", "noreferrer noopener"); - }); - - it("Access Endpoints SAML 2.0 Identity Provider Metadata link", () => { - sidebarPage.goToRealmSettings(); - - // Check the link is live - cy.get("a") - .contains("SAML 2.0 Identity Provider Metadata ") - .then((link) => { - cy.request(link.prop("href")).its("status").should("eq", 200); - }); - }); - - it("Verify 'Revert' button works", () => { - sidebarPage.goToRealmSettings(); - - realmSettingsPage.fillDisplayName("should_be_reverted"); - realmSettingsPage.revert(realmSettingsPage.generalRevertBtn); - realmSettingsPage.getDisplayName("display_name"); - }); -}); diff --git a/js/apps/admin-ui/cypress/e2e/realm_settings_tabs_test.spec.ts b/js/apps/admin-ui/cypress/e2e/realm_settings_tabs_test.spec.ts deleted file mode 100644 index 996fac077e8..00000000000 --- a/js/apps/admin-ui/cypress/e2e/realm_settings_tabs_test.spec.ts +++ /dev/null @@ -1,433 +0,0 @@ -import FormValidation from "../support/forms/FormValidation"; -import LoginPage from "../support/pages/LoginPage"; -import Masthead from "../support/pages/admin-ui/Masthead"; -import SidebarPage from "../support/pages/admin-ui/SidebarPage"; -import KeysTab from "../support/pages/admin-ui/manage/realm_settings/KeysTab"; -import RealmSettingsPage from "../support/pages/admin-ui/manage/realm_settings/RealmSettingsPage"; -import UserRegistration from "../support/pages/admin-ui/manage/realm_settings/UserRegistration"; -import adminClient from "../support/util/AdminClient"; -import ModalUtils from "../support/util/ModalUtils"; -import { keycloakBefore } from "../support/util/keycloak_hooks"; - -const loginPage = new LoginPage(); -const sidebarPage = new SidebarPage(); -const masthead = new Masthead(); -const realmSettingsPage = new RealmSettingsPage(); -const userRegistration = new UserRegistration(); -const keysTab = new KeysTab(); -const modalUtils = new ModalUtils(); - -describe("Realm settings tabs tests", () => { - const realmName = "Realm_" + crypto.randomUUID(); - - beforeEach(() => { - loginPage.logIn(); - keycloakBefore(); - sidebarPage.goToRealm(realmName); - }); - - before(async () => { - await adminClient.createRealm(realmName); - }); - - after(async () => { - await adminClient.deleteRealm(realmName); - }); - - const addBundle = () => { - realmSettingsPage.addKeyValuePair("123", "abc"); - - return this; - }; - - it("shows the 'user profile' tab", () => { - sidebarPage.goToRealmSettings(); - cy.findByTestId(realmSettingsPage.userProfileTab).should("exist"); - }); - - // Clicking multiple toggles in succession causes quick re-renderings of the screen - // and there will be a noticeable flicker during the test. - // Sometimes, this will screw up the test and cause Cypress to hang. - // Clicking to another section each time fixes the problem. - function reloadRealm() { - sidebarPage.goToClientScopes(); - sidebarPage.goToRealmSettings(); - realmSettingsPage.goToLoginTab(); - } - - function testToggle(realmSwitch: string, expectedValue: string) { - realmSettingsPage.toggleSwitch(realmSwitch); - reloadRealm(); - cy.findByTestId(realmSwitch).should("have.value", expectedValue); - } - - it("Go to login tab", () => { - sidebarPage.goToRealmSettings(); - realmSettingsPage.goToLoginTab(); - - testToggle(realmSettingsPage.userRegSwitch, "on"); - testToggle(realmSettingsPage.forgotPwdSwitch, "on"); - testToggle(realmSettingsPage.rememberMeSwitch, "on"); - testToggle(realmSettingsPage.loginWithEmailSwitch, "off"); - testToggle(realmSettingsPage.duplicateEmailsSwitch, "on"); - - // Check other values - cy.findByTestId(realmSettingsPage.emailAsUsernameSwitch).should( - "have.value", - "off", - ); - - cy.findByTestId(realmSettingsPage.verifyEmailSwitch).should( - "have.value", - "off", - ); - }); - - it("Go to email tab", () => { - // Configure an e-mail address so we can test the connection settings. - cy.wrap(null).then(async () => { - const adminUser = await adminClient.getAdminUser(); - - await adminClient.updateUser(adminUser.id!, { - email: "admin@example.com", - }); - }); - - sidebarPage.goToRealmSettings(); - realmSettingsPage.goToEmailTab(); - //required fields not filled in or not filled properly - realmSettingsPage.addSenderEmail("not a valid email"); - realmSettingsPage.fillFromDisplayName("displayName"); - realmSettingsPage.fillReplyToEmail("replyTo@email.com"); - realmSettingsPage.fillPort("10"); - cy.findByTestId("email-tab-save").click(); - - FormValidation.assertMessage( - realmSettingsPage.getFromInput(), - "You must enter a valid email.", - ); - FormValidation.assertRequired(realmSettingsPage.getHostInput()); - - cy.findByTestId("email-tab-revert").click(); - cy.findByTestId("smtpServer.from").should("be.empty"); - cy.findByTestId("smtpServer.fromDisplayName").should("be.empty"); - cy.findByTestId("smtpServer.port").should("be.empty"); - - realmSettingsPage.addSenderEmail("example@example.com"); - realmSettingsPage.toggleCheck(realmSettingsPage.enableSslCheck); - realmSettingsPage.toggleCheck(realmSettingsPage.enableStartTlsCheck); - realmSettingsPage.fillHostField("localhost"); - - cy.findByTestId(realmSettingsPage.testConnectionButton).click(); - - masthead.checkNotificationMessage("Error! Failed to send email", true); - }); - - it("Go to themes tab", () => { - sidebarPage.goToRealmSettings(); - cy.findByTestId("rs-themes-tab").click(); - - realmSettingsPage.selectLoginThemeType("keycloak"); - realmSettingsPage.selectAccountThemeType("keycloak"); - realmSettingsPage.selectEmailThemeType("base"); - - realmSettingsPage.saveThemes(); - }); - - describe("Go to security defenses tab", () => { - it("Realm header settings- update single input", () => { - sidebarPage.goToRealmSettings(); - realmSettingsPage.goToSecurityDefensesTab(); - cy.findByTestId("browserSecurityHeaders.xFrameOptions").clear(); - cy.findByTestId("browserSecurityHeaders.xFrameOptions").type("DENY"); - realmSettingsPage.saveSecurityDefensesHeaders(); - masthead.checkNotificationMessage("Realm successfully updated"); - }); - - it("Realm header settings- update all inputs", () => { - sidebarPage.goToRealmSettings(); - realmSettingsPage.goToSecurityDefensesTab(); - cy.findByTestId("browserSecurityHeaders.xFrameOptions").clear(); - cy.findByTestId("browserSecurityHeaders.xFrameOptions").type( - "SAMEORIGIN", - ); - cy.findByTestId("browserSecurityHeaders.contentSecurityPolicy").clear(); - cy.findByTestId("browserSecurityHeaders.contentSecurityPolicy").type( - "default-src 'self'", - ); - cy.findByTestId("browserSecurityHeaders.strictTransportSecurity").clear(); - cy.findByTestId("browserSecurityHeaders.strictTransportSecurity").type( - "max-age=31536000", - ); - cy.findByTestId("browserSecurityHeaders.xContentTypeOptions").clear(); - cy.findByTestId("browserSecurityHeaders.xContentTypeOptions").type( - "nosniff", - ); - cy.findByTestId("browserSecurityHeaders.xRobotsTag").clear(); - cy.findByTestId("browserSecurityHeaders.xRobotsTag").type("none"); - cy.findByTestId("browserSecurityHeaders.strictTransportSecurity").clear(); - cy.findByTestId("browserSecurityHeaders.strictTransportSecurity").type( - "max-age=31537000", - ); - cy.findByTestId("browserSecurityHeaders.referrerPolicy").clear(); - cy.findByTestId("browserSecurityHeaders.referrerPolicy").type("referrer"); - realmSettingsPage.saveSecurityDefensesHeaders(); - masthead.checkNotificationMessage("Realm successfully updated"); - }); - - it("Brute force detection- update values", () => { - sidebarPage.goToRealmSettings(); - realmSettingsPage.goToSecurityDefensesTab(); - realmSettingsPage.goToSecurityDefensesBruteForceTab(); - cy.get("#kc-brute-force-mode").click(); - cy.findByTestId("select-brute-force-mode") - .contains("Lockout temporarily") - .click(); - cy.findByTestId("waitIncrementSeconds").type("1"); - cy.findByTestId("maxFailureWaitSeconds").type("1"); - cy.findByTestId("maxDeltaTimeSeconds").type("1"); - cy.findByTestId("minimumQuickLoginWaitSeconds").type("1"); - realmSettingsPage.saveSecurityDefensesBruteForce(); - masthead.checkNotificationMessage("Realm successfully updated"); - }); - }); - - describe("Go to localization tab", () => { - it("Locales tab - Add locale", () => { - sidebarPage.goToRealmSettings(); - realmSettingsPage.goToLocalizationTab(); - realmSettingsPage.goToLocalizationLocalesSubTab(); - - cy.findByTestId("internationalizationEnabled").click({ force: true }); - - cy.get(realmSettingsPage.supportedLocalesTypeahead) - .click() - .get(".pf-v5-c-menu__list-item") - .contains("Danish") - .click({ force: true }); - cy.findByTestId("internationalizationEnabled").click({ force: true }); - - cy.intercept("GET", `/admin/realms/${realmName}/localization/en*`).as( - "load", - ); - - cy.findByTestId("localization-tab-save").click(); - cy.wait("@load"); - - masthead.checkNotificationMessage("Realm successfully updated"); - }); - - it("Realm Overrides - Add and delete bundle", () => { - sidebarPage.goToRealmSettings(); - realmSettingsPage.goToLocalizationTab(); - realmSettingsPage.goToLocalizationRealmOverridesSubTab(); - - addBundle(); - - masthead.checkNotificationMessage( - "Success! The translation has been added.", - ); - - cy.findByTestId("editable-rows-table") - .contains("td", "123") - .should("be.visible"); - - cy.get(".pf-v5-c-table__action button").click(); - cy.contains("button", "Delete").click(); - cy.findByTestId("confirm").click(); - masthead.checkNotificationMessage("Successfully removed translation(s)."); - }); - - it("Realm Overrides - Search for and delete bundle", () => { - sidebarPage.goToRealmSettings(); - realmSettingsPage.goToLocalizationTab(); - realmSettingsPage.goToLocalizationRealmOverridesSubTab(); - - addBundle(); - - cy.get('input[aria-label="Search"]').type("123"); - - cy.findByTestId("editable-rows-table") - .contains("td", "123") - .should("be.visible"); - - cy.findByTestId("selectAll").click(); - cy.get('[data-testid="toolbar-deleteBtn"]').click(); - cy.findByTestId("delete-selected-TranslationBtn").click(); - cy.findByTestId("confirm").click(); - masthead.checkNotificationMessage("Successfully removed translation(s)."); - }); - - it("Realm Overrides - Edit and cancel edit message bundle", () => { - sidebarPage.goToRealmSettings(); - realmSettingsPage.goToLocalizationTab(); - realmSettingsPage.goToLocalizationRealmOverridesSubTab(); - - addBundle(); - - cy.findByTestId("editTranslationBtn-0").click(); - cy.findByTestId("editTranslationCancelBtn-0").click(); - - cy.findByTestId("editTranslationBtn-0").click(); - cy.findByTestId("editTranslationValueInput-0") - .click() - .clear() - .type("def"); - cy.findByTestId("editTranslationAcceptBtn-0").click(); - - cy.findByTestId("editable-rows-table") - .contains("td", "def") - .should("be.visible"); - - cy.get(".pf-v5-c-table__action button").click(); - cy.contains("button", "Delete").click(); - cy.findByTestId("confirm").click(); - - masthead.checkNotificationMessage("Successfully removed translation(s)."); - }); - - it("Effective Message Bundles - Check before search message", () => { - sidebarPage.goToRealmSettings(); - realmSettingsPage.goToLocalizationTab(); - realmSettingsPage.goToLocalizationEffectiveMessageBundlesSubTab(); - cy.contains("h1", "Search for effective messages"); - }); - }); - - describe("Accessibility tests for realm settings", () => { - beforeEach(() => { - loginPage.logIn(); - keycloakBefore(); - sidebarPage.goToRealmSettings(); - cy.injectAxe(); - }); - - it("Check a11y violations on load/ realm settings/ general tab", () => { - cy.checkA11y(); - }); - - it("Check a11y violations on login tab", () => { - realmSettingsPage.goToLoginTab(); - cy.checkA11y(); - }); - - it("Check a11y violations on email tab", () => { - realmSettingsPage.goToEmailTab(); - cy.checkA11y(); - }); - - it("Check a11y violations on themes tab", () => { - realmSettingsPage.goToThemesTab(); - cy.checkA11y(); - }); - - it("Check a11y violations on keys tab/ keys list sub tab", () => { - keysTab.goToKeysTab(); - cy.checkA11y(); - }); - - it("Check a11y violations on keys tab/ providers sub tab", () => { - keysTab.goToProvidersTab(); - cy.checkA11y(); - }); - - it("Check a11y violations on keys tab/ providers sub tab / adding provider", () => { - keysTab.goToProvidersTab(); - cy.findByTestId("addProviderDropdown").click(); - cy.checkA11y(); - modalUtils.closeModal(); - }); - - it("Check a11y violations on events tab/ event listeners sub tab", () => { - realmSettingsPage.goToEventsTab(); - cy.checkA11y(); - }); - - it("Check a11y violations on events tab/ user events settings sub tab", () => { - realmSettingsPage.goToEventsTab().goToUserEventsSettingsSubTab(); - cy.checkA11y(); - }); - - it("Check a11y violations on events tab/ admin events settings sub tab", () => { - realmSettingsPage.goToEventsTab().goToAdminEventsSettingsSubTab(); - cy.checkA11y(); - }); - - it("Check a11y violations on localization locales sub tab", () => { - realmSettingsPage.goToLocalizationTab(); - realmSettingsPage.goToLocalizationLocalesSubTab(); - cy.checkA11y(); - }); - - it("Check a11y violations on localization realm overrides sub tab", () => { - realmSettingsPage.goToLocalizationTab(); - realmSettingsPage.goToLocalizationRealmOverridesSubTab(); - cy.checkA11y(); - }); - - it("Check a11y violations on localization realm overrides sub tab/ adding message bundle", () => { - realmSettingsPage.goToLocalizationTab(); - realmSettingsPage.goToLocalizationRealmOverridesSubTab(); - cy.findByTestId("add-translationBtn").click(); - cy.checkA11y(); - modalUtils.cancelModal(); - }); - - it("Check a11y violations on localization effective message bundles sub tab", () => { - realmSettingsPage.goToLocalizationTab(); - realmSettingsPage.goToLocalizationEffectiveMessageBundlesSubTab(); - cy.checkA11y(); - }); - - it("Check a11y violations on security defenses tab", () => { - realmSettingsPage.goToSecurityDefensesTab(); - cy.checkA11y(); - }); - - it("Check a11y violations on sessions tab", () => { - realmSettingsPage.goToSessionsTab(); - cy.checkA11y(); - }); - - it("Check a11y violations on tokens tab", () => { - realmSettingsPage.goToTokensTab(); - cy.checkA11y(); - }); - - it("Check a11y violations on client policies tab/ profiles sub tab", () => { - realmSettingsPage.goToClientPoliciesTab().goToClientProfilesList(); - cy.checkA11y(); - }); - - it("Check a11y violations on client policies tab/ creating profile", () => { - realmSettingsPage.goToClientPoliciesTab().goToClientProfilesList(); - cy.findByTestId("createProfile").click(); - cy.checkA11y(); - cy.findByTestId("cancelCreateProfile").click(); - }); - - it("Check a11y violations on client policies tab/ policies sub tab", () => { - realmSettingsPage.goToClientPoliciesTab().goToClientPoliciesList(); - cy.checkA11y(); - }); - - it("Check a11y violations on client policies tab/ creating policy", () => { - realmSettingsPage.goToClientPoliciesTab().goToClientPoliciesList(); - cy.findByTestId("no-client-policies-empty-action").click(); - cy.checkA11y(); - cy.findByTestId("cancelCreatePolicy").click(); - }); - - it("Check a11y violations on user registration tab/ default roles sub tab", () => { - userRegistration.goToTab(); - cy.checkA11y(); - }); - - it("Check a11y violations on user registration tab/ default roles sub tab/ assigning role", () => { - userRegistration.goToTab(); - cy.findByTestId("assignRole").click(); - cy.checkA11y(); - modalUtils.cancelModal(); - }); - }); -}); diff --git a/js/apps/admin-ui/cypress/e2e/realm_settings_user_profile_enabled.spec.ts b/js/apps/admin-ui/cypress/e2e/realm_settings_user_profile_enabled.spec.ts deleted file mode 100644 index ed237e0de1f..00000000000 --- a/js/apps/admin-ui/cypress/e2e/realm_settings_user_profile_enabled.spec.ts +++ /dev/null @@ -1,421 +0,0 @@ -import ListingPage from "../support/pages/admin-ui/ListingPage"; -import UserProfile from "../support/pages/admin-ui/manage/realm_settings/UserProfile"; -import Masthead from "../support/pages/admin-ui/Masthead"; -import SidebarPage from "../support/pages/admin-ui/SidebarPage"; -import LoginPage from "../support/pages/LoginPage"; -import adminClient from "../support/util/AdminClient"; -import { keycloakBefore } from "../support/util/keycloak_hooks"; -import ModalUtils from "../support/util/ModalUtils"; -import RealmSettingsPage from "../support/pages/admin-ui/manage/realm_settings/RealmSettingsPage"; -import CreateUserPage from "../support/pages/admin-ui/manage/users/CreateUserPage"; - -const loginPage = new LoginPage(); -const sidebarPage = new SidebarPage(); -const userProfileTab = new UserProfile(); -const listingPage = new ListingPage(); -const modalUtils = new ModalUtils(); -const masthead = new Masthead(); -const realmSettingsPage = new RealmSettingsPage(); -const createUserPage = new CreateUserPage(); - -// Selectors -const getUserProfileTab = () => userProfileTab.goToTab(); -const getAttributesTab = () => userProfileTab.goToAttributesTab(); -const getAttributesGroupTab = () => userProfileTab.goToAttributesGroupTab(); - -const usernameAttributeName = "username"; -const emailAttributeName = "email"; - -describe("User profile tabs", () => { - const realmName = "Realm_" + crypto.randomUUID(); - const attributeName = "Test"; - const attributeDisplayName = "Test display name"; - - before(() => adminClient.createRealm(realmName)); - - after(() => adminClient.deleteRealm(realmName)); - - beforeEach(() => { - loginPage.logIn(); - keycloakBefore(); - sidebarPage.goToRealm(realmName); - sidebarPage.goToRealmSettings(); - }); - - describe("Attributes sub tab tests", () => { - it("Goes to create attribute page", () => { - getUserProfileTab(); - getAttributesTab(); - userProfileTab.clickOnCreateAttributeButton(); - }); - - it("Completes new attribute form and performs cancel", () => { - getUserProfileTab(); - getAttributesTab(); - userProfileTab - .clickOnCreateAttributeButton() - .setAttributeNames(attributeName, attributeDisplayName) - .cancelAttributeCreation() - .checkElementNotInList(attributeName); - }); - - it("Completes new attribute form and performs submit", () => { - getUserProfileTab(); - getAttributesTab(); - userProfileTab - .clickOnCreateAttributeButton() - .setAttributeNames(attributeName, attributeDisplayName) - .saveAttributeCreation() - .assertNotificationSaved(); - }); - - it("Modifies existing attribute and performs save", () => { - const attrName = "ModifyTest"; - getUserProfileTab(); - createAttributeDefinition(attrName); - - userProfileTab - .selectElementInList(attrName) - .editAttribute("Edited display name") - .saveAttributeCreation() - .assertNotificationSaved(); - }); - - it("Adds and removes validator to/from existing attribute and performs save", () => { - getUserProfileTab(); - - userProfileTab - .selectElementInList(attributeName) - .cancelAddingValidator(emailAttributeName); - userProfileTab.addValidator(emailAttributeName); - cy.get('tbody [data-label="Validator name"]').contains( - emailAttributeName, - ); - - userProfileTab.cancelRemovingValidator(); - userProfileTab.removeValidator(); - cy.get(".kc-emptyValidators").contains("No validators."); - }); - }); - - describe("Attribute groups sub tab tests", () => { - const group = "Test" + crypto.randomUUID(); - - before(() => adminClient.addGroupToProfile(realmName, group)); - - it("Deletes an attributes group", () => { - getUserProfileTab(); - getAttributesGroupTab(); - listingPage.deleteItem(group); - modalUtils.confirmModal(); - listingPage.itemExist(group, false); - }); - }); - - describe("Check attributes are displayed and editable on user create/edit", () => { - it("Checks that not required attribute is not present when user is created with email as username and edit username set to disabled", () => { - const attrName = "newAttribute1"; - - getUserProfileTab(); - createAttributeDefinition(attrName, (attrConfigurer) => - attrConfigurer.setNoAttributePermissions(), - ); - - sidebarPage.goToRealmSettings(); - realmSettingsPage.goToLoginTab(); - cy.wait(1000); - realmSettingsPage - .assertSwitch(realmSettingsPage.emailAsUsernameSwitch, false) - .assertSwitch(realmSettingsPage.editUsernameSwitch, false); - - // Create user - sidebarPage.goToUsers(); - cy.wait(1000); - createUserPage - .goToCreateUser() - .assertAttributeFieldExists(attrName, false) - .setUsername(`testuser7-${crypto.randomUUID()}`) - .create() - .assertNotificationCreated() - .assertAttributeFieldExists(attrName, false); - - sidebarPage.goToRealmSettings(); - getUserProfileTab(); - getAttributesTab(); - listingPage.deleteItem(attrName); - modalUtils.confirmModal(); - masthead.checkNotificationMessage("Attribute deleted"); - }); - - it("Checks that not required attribute is not present when user is created/edited with email as username enabled", () => { - const attrName = "newAttribute2"; - - getUserProfileTab(); - createAttributeDefinition(attrName, (attrConfigurer) => - attrConfigurer.setNoAttributePermissions(), - ); - - sidebarPage.goToRealmSettings(); - realmSettingsPage.goToLoginTab(); - cy.wait(1000); - realmSettingsPage - .setSwitch(realmSettingsPage.emailAsUsernameSwitch, true) - .assertSwitch(realmSettingsPage.emailAsUsernameSwitch, true) - .assertSwitch(realmSettingsPage.editUsernameSwitch, false); - - // Create user - sidebarPage.goToUsers(); - createUserPage - .goToCreateUser() - .setAttributeValue( - emailAttributeName, - `testuser8-${crypto.randomUUID()}@gmail.com`, - ) - .assertAttributeFieldExists(attrName, false) - .create() - .assertNotificationCreated(); - - // Edit user - createUserPage - .assertAttributeFieldExists(attrName, false) - .setAttributeValue( - emailAttributeName, - `testuser9-${crypto.randomUUID()}@gmail.com`, - ) - .update() - .assertNotificationUpdated(); - - deleteAttributeDefinition(attrName); - }); - - it("Checks that not required attribute with permissions to view/edit is present when user is created", () => { - const attrName = "newAttribute3"; - - getUserProfileTab(); - createAttributeDefinition(attrName, (attrConfigurer) => - attrConfigurer.setAllAttributePermissions(), - ); - - sidebarPage.goToRealmSettings(); - realmSettingsPage.goToLoginTab(); - cy.wait(1000); - realmSettingsPage - .setSwitch(realmSettingsPage.emailAsUsernameSwitch, false) - .assertSwitch(realmSettingsPage.emailAsUsernameSwitch, false) - .setSwitch(realmSettingsPage.editUsernameSwitch, false) - .assertSwitch(realmSettingsPage.editUsernameSwitch, false); - - // Create user - sidebarPage.goToUsers(); - createUserPage - .goToCreateUser() - .assertAttributeFieldExists(attrName, true) - .setUsername(`testuser10-${crypto.randomUUID()}`) - .create() - .assertNotificationCreated() - .assertAttributeFieldExists(attrName, true); - - deleteAttributeDefinition(attrName); - }); - - it("Checks that required attribute with permissions to view/edit is present and required when user is created", () => { - const attrName = "newAttribute4"; - - getUserProfileTab(); - createAttributeDefinition(attrName, (attrConfigurer) => - attrConfigurer.setAllAttributePermissions().setAttributeRequired(), - ); - - // Create user - sidebarPage.goToUsers(); - createUserPage - .goToCreateUser() - .assertAttributeLabel(attrName, attrName) - .setUsername(`testuser11-${crypto.randomUUID()}`) - .create() - .assertValidationErrorRequired(attrName); - - createUserPage - .setAttributeValue(attrName, "MyAttribute") - .create() - .assertNotificationCreated(); - - deleteAttributeDefinition(attrName); - }); - - it("Checks that required attribute with permissions to view/edit is accepted when user is created", () => { - const attrName = "newAttribute5"; - - getUserProfileTab(); - createAttributeDefinition(attrName, (attrConfigurer) => - attrConfigurer.setAllAttributePermissions().setAttributeRequired(), - ); - - // Create user - sidebarPage.goToUsers(); - createUserPage - .goToCreateUser() - .assertAttributeLabel(attrName, attrName) - .setUsername(`testuser12-${crypto.randomUUID()}`) - .setAttributeValue(attrName, "MyAttribute") - .create() - .assertNotificationCreated(); - - deleteAttributeDefinition(attrName); - }); - - it("Checks that attribute group is visible when user with existing attribute is created", () => { - const group = "personalInfo"; - - getUserProfileTab(); - getAttributesGroupTab() - .clickOnCreatesAttributesGroupButton() - .createAttributeGroup(group, group) - .saveAttributesGroupCreation() - .assertNotificationUpdated(); - - getAttributesTab(); - userProfileTab - .selectElementInList(usernameAttributeName) - .setAttributeGroup(group) - .saveAttributeCreation() - .assertNotificationSaved(); - - // Create user - sidebarPage.goToUsers(); - createUserPage - .goToCreateUser() - .assertGroupDisplayName(group, group) - .setUsername(`testuser14-${crypto.randomUUID()}`) - .create() - .assertNotificationCreated(); - - sidebarPage.goToRealmSettings(); - getUserProfileTab(); - getAttributesTab(); - userProfileTab - .selectElementInList(usernameAttributeName) - .resetAttributeGroup() - .saveAttributeCreation() - .assertNotificationSaved(); - }); - - it("Checks that attribute group is visible when user with a new attribute is created", () => { - const group = "contact"; - const attrName = "address"; - - getUserProfileTab(); - getAttributesGroupTab() - .clickOnCreatesAttributesGroupButton() - .createAttributeGroup(group, group) - .saveAttributesGroupCreation() - .assertNotificationUpdated(); - - createAttributeDefinition(attrName, (attrConfigurer) => - attrConfigurer.setAllAttributePermissions(), - ); - - userProfileTab - .selectElementInList(attrName) - .setAttributeGroup(group) - .saveAttributeCreation() - .assertNotificationSaved(); - - // Create user - sidebarPage.goToUsers(); - const initialAttrValue = "MyNewAddress1"; - createUserPage - .goToCreateUser() - .assertGroupDisplayName(group, group) - .assertAttributeLabel(attrName, attrName) - .setUsername(`testuser13-${crypto.randomUUID()}`) - .setAttributeValue(attrName, initialAttrValue) - .create() - .assertNotificationCreated() - .assertAttributeValue(attrName, initialAttrValue); - - // Edit attribute - const newAttrValue = "MyNewAddress2"; - createUserPage - .setAttributeValue(attrName, newAttrValue) - .update() - .assertNotificationUpdated() - .assertAttributeValue(attrName, newAttrValue); - - sidebarPage.goToRealmSettings(); - getUserProfileTab(); - getAttributesTab(); - userProfileTab - .selectElementInList(attrName) - .resetAttributeGroup() - .saveAttributeCreation() - .assertNotificationSaved(); - - deleteAttributeDefinition(attrName); - }); - - it("Checks that attribute with select-annotation is displayed and editable when user is created/edited", () => { - const userName = `select-test-user-${crypto.randomUUID()}`; - const attrName = "select-test-attr"; - const opt1 = "opt1"; - const opt2 = "opt2"; - const supportedOptions = [opt1, opt2]; - - getUserProfileTab(); - createAttributeDefinition(attrName, (attrConfigurer) => - attrConfigurer - .setAllAttributePermissions() - .clickAddValidator() - .selectValidatorType("options") - .setListFieldValues("options", supportedOptions) - .clickSave(), - ); - - // Create user - sidebarPage.goToUsers(); - createUserPage - .goToCreateUser() - .assertAttributeLabel(attrName, attrName) - .assertAttributeSelect(attrName, supportedOptions, "Select an option") - .setUsername(userName) - .setAttributeValueOnSelect(attrName, opt1) - .create() - .assertNotificationCreated() - .assertAttributeLabel(attrName, attrName) - .assertAttributeSelect(attrName, supportedOptions, opt1); - - // Edit attribute - createUserPage - .setAttributeValueOnSelect(attrName, opt2) - .update() - .assertNotificationUpdated() - .assertAttributeLabel(attrName, attrName) - .assertAttributeSelect(attrName, supportedOptions, opt2); - }); - }); - - function deleteAttributeDefinition(attrName: string) { - sidebarPage.goToRealmSettings(); - getUserProfileTab(); - getAttributesTab(); - listingPage.deleteItem(attrName); - modalUtils.confirmModal(); - masthead.checkNotificationMessage("Attribute deleted"); - } - - function createAttributeDefinition( - attrName: string, - attrConfigurer?: (attrConfigurer: UserProfile) => void, - ) { - userProfileTab - .goToAttributesTab() - .clickOnCreateAttributeButton() - .setAttributeNames(attrName, attrName); - - if (attrConfigurer) { - attrConfigurer(userProfileTab); - } - - userProfileTab.saveAttributeCreation().assertNotificationSaved(); - } -}); diff --git a/js/apps/admin-ui/cypress/e2e/realm_test.spec.ts b/js/apps/admin-ui/cypress/e2e/realm_test.spec.ts deleted file mode 100644 index 0a637816ad9..00000000000 --- a/js/apps/admin-ui/cypress/e2e/realm_test.spec.ts +++ /dev/null @@ -1,131 +0,0 @@ -import LoginPage from "../support/pages/LoginPage"; -import SidebarPage from "../support/pages/admin-ui/SidebarPage"; -import CreateRealmPage from "../support/pages/admin-ui/CreateRealmPage"; -import Masthead from "../support/pages/admin-ui/Masthead"; -import adminClient from "../support/util/AdminClient"; -import { keycloakBefore } from "../support/util/keycloak_hooks"; -import RealmSettings from "../support/pages/admin-ui/configure/realm_settings/RealmSettings"; -import ModalUtils from "../support/util/ModalUtils"; -import CommonPage from "../support/pages/CommonPage"; - -const masthead = new Masthead(); -const loginPage = new LoginPage(); -const sidebarPage = new SidebarPage(); -const createRealmPage = new CreateRealmPage(); -const realmSettings = new RealmSettings(); -const modalUtils = new ModalUtils(); -const commonPage = new CommonPage(); - -const testRealmName = "Test-realm-" + crypto.randomUUID(); -const newRealmName = "New-Test-realm-" + crypto.randomUUID(); -const editedRealmName = "Edited-Test-realm-" + crypto.randomUUID(); -const testDisabledName = "Test-Disabled"; -const specialCharsName = "%22-" + crypto.randomUUID(); - -describe("Realm tests", () => { - beforeEach(() => { - loginPage.logIn(); - keycloakBefore(); - }); - - after(() => - Promise.all( - [testRealmName, newRealmName, editedRealmName, specialCharsName].map( - (realm) => adminClient.deleteRealm(realm), - ), - ), - ); - - it("should fail creating duplicated or empty name realm", () => { - sidebarPage.goToCreateRealm(); - - createRealmPage.createRealm(false).verifyRealmNameFieldInvalid(); - - createRealmPage.fillRealmName("master").createRealm(); - - masthead.checkNotificationMessage( - "Could not create realm Conflict detected. See logs for details", - ); - - createRealmPage.cancelRealmCreation(); - }); - - it("should create Test realm", () => { - sidebarPage.goToCreateRealm(); - - // Test and clear resource field - createRealmPage.fillCodeEditor(); - createRealmPage.clearTextField(); - - createRealmPage.fillRealmName(testRealmName).createRealm(); - - masthead.checkNotificationMessage("Realm created successfully"); - }); - - it("CRUD test of Disabled realm", () => { - sidebarPage.goToCreateRealm(); - sidebarPage.waitForPageLoad(); - - createRealmPage.fillRealmName(testDisabledName).createRealm(); - - masthead.checkNotificationMessage("Realm created successfully"); - - cy.reload(); - sidebarPage.goToRealm(testDisabledName).goToRealmSettings(); - - createRealmPage.disableRealm(); - modalUtils.confirmModal(); - - masthead.checkNotificationMessage("Realm successfully updated"); - - sidebarPage.goToRealm(testDisabledName).goToRealmSettings(); - realmSettings.clickActionMenu(); - cy.findByText("Delete").click(); - modalUtils.cancelModal(); - - cy.reload(); - sidebarPage.waitForPageLoad(); - sidebarPage.goToRealm(testDisabledName).goToRealmSettings(); - realmSettings.clickActionMenu(); - cy.findByText("Delete").click(); - modalUtils.confirmModal(); - masthead.checkNotificationMessage("The realm has been deleted"); - - // Show current realms - sidebarPage.realmExists("Test-Disabled", false); - }); - - it("should create realm from new a realm", () => { - sidebarPage.goToCreateRealm(); - createRealmPage.fillRealmName(newRealmName).createRealm(); - - masthead.checkNotificationMessage("Realm created successfully"); - - sidebarPage.goToCreateRealm(); - createRealmPage.fillRealmName(editedRealmName).createRealm(); - - masthead.checkNotificationMessage("Realm created successfully"); - - // Show current realms - sidebarPage.showCurrentRealms(4); - }); - - it("should change to Test realm", () => { - sidebarPage.goToRealm(editedRealmName); - sidebarPage.getCurrentRealm().should("eq", editedRealmName); - - sidebarPage - .goToRealm(testRealmName) - .getCurrentRealm() - .should("eq", testRealmName); - }); - - it("should create realm with special characters", () => { - sidebarPage.goToCreateRealm(); - createRealmPage.fillRealmName(specialCharsName).createRealm(); - - sidebarPage.goToRealm(specialCharsName); - sidebarPage.goToClients(); - commonPage.tableUtils().checkRowItemExists("account"); - }); -}); diff --git a/js/apps/admin-ui/cypress/e2e/realm_user_registration.spec.ts b/js/apps/admin-ui/cypress/e2e/realm_user_registration.spec.ts deleted file mode 100644 index 7624e945848..00000000000 --- a/js/apps/admin-ui/cypress/e2e/realm_user_registration.spec.ts +++ /dev/null @@ -1,70 +0,0 @@ -import ListingPage from "../support/pages/admin-ui/ListingPage"; -import ClientRolesTab from "../support/pages/admin-ui/manage/clients/ClientRolesTab"; -import UserRegistration, { - GroupPickerDialog, -} from "../support/pages/admin-ui/manage/realm_settings/UserRegistration"; -import Masthead from "../support/pages/admin-ui/Masthead"; -import SidebarPage from "../support/pages/admin-ui/SidebarPage"; -import LoginPage from "../support/pages/LoginPage"; -import adminClient from "../support/util/AdminClient"; -import { keycloakBefore } from "../support/util/keycloak_hooks"; -import ModalUtils from "../support/util/ModalUtils"; - -describe("Realm settings - User registration tab", () => { - const loginPage = new LoginPage(); - const sidebarPage = new SidebarPage(); - const modalUtils = new ModalUtils(); - const masthead = new Masthead(); - - const listingPage = new ListingPage(); - const groupPicker = new GroupPickerDialog(); - const userRegistration = new UserRegistration(); - const rolesTab = new ClientRolesTab(); - - const groupName = "The default group"; - - before(() => adminClient.createGroup(groupName)); - - beforeEach(() => { - loginPage.logIn(); - keycloakBefore(); - sidebarPage.goToRealmSettings(); - userRegistration.goToTab(); - }); - - after(() => adminClient.deleteGroups()); - - it("Add admin role", () => { - const role = "admin"; - const roleType = "roles"; - userRegistration.addRole(); - sidebarPage.waitForPageLoad(); - userRegistration.changeRoleTypeFilter(roleType).selectRow(role).assign(); - masthead.checkNotificationMessage("Associated roles have been added"); - listingPage.searchItem(role, false).itemExist(role); - - sidebarPage.goToRealmRoles(); - listingPage.goToItemDetails("admin"); - rolesTab.goToUsersInRoleTab(); - cy.findByTestId("users-in-role-table").contains("admin"); - }); - - it("Remove admin role", () => { - const role = "admin"; - listingPage.markItemRow(role).removeMarkedItems("Unassign"); - sidebarPage.waitForPageLoad(); - modalUtils - .checkModalTitle("Remove role?") - .checkModalMessage("Are you sure you want to remove this role?") - .checkConfirmButtonText("Remove") - .confirmModal(); - masthead.checkNotificationMessage("Role mapping updated"); - }); - - it("Add default group", () => { - userRegistration.goToDefaultGroupTab().addDefaultGroup(); - groupPicker.checkTitle("Add default groups").clickRow(groupName).clickAdd(); - masthead.checkNotificationMessage("New group added to the default groups"); - listingPage.itemExist(groupName); - }); -}); diff --git a/js/apps/admin-ui/cypress/e2e/sessions_test.spec.ts b/js/apps/admin-ui/cypress/e2e/sessions_test.spec.ts deleted file mode 100644 index c0e98f507ef..00000000000 --- a/js/apps/admin-ui/cypress/e2e/sessions_test.spec.ts +++ /dev/null @@ -1,165 +0,0 @@ -import LoginPage from "../support/pages/LoginPage"; -import SidebarPage from "../support/pages/admin-ui/SidebarPage"; -import SessionsPage from "../support/pages/admin-ui/manage/sessions/SessionsPage"; -import CommonPage from "../support/pages/CommonPage"; -import ListingPage from "../support/pages/admin-ui/ListingPage"; -import { keycloakBefore } from "../support/util/keycloak_hooks"; -import PageObject from "../support/pages/admin-ui/components/PageObject"; -import adminClient from "../support/util/AdminClient"; - -const loginPage = new LoginPage(); -const sidebarPage = new SidebarPage(); -const sessionsPage = new SessionsPage(); -const commonPage = new CommonPage(); -const listingPage = new ListingPage(); -const page = new PageObject(); - -describe("Sessions test", () => { - const admin = "admin"; - const client = "security-admin-console"; - - beforeEach(() => { - loginPage.logIn(); - keycloakBefore(); - sidebarPage.goToSessions(); - }); - - describe("Sessions list view", () => { - it("check item values", () => { - listingPage.searchItem(client, false); - commonPage - .tableUtils() - .checkRowItemExists(admin) - .checkRowItemExists(client) - .assertRowItemActionExist(admin, "Sign out"); - }); - - it("go to item accessed clients link", () => { - listingPage.searchItem(client, false); - commonPage.tableUtils().clickRowItemLink(client); - }); - }); - - describe("Offline sessions", () => { - const clientId = "offline-client-" + crypto.randomUUID(); - const username = "user-" + crypto.randomUUID(); - - beforeEach(async () => { - await Promise.all([ - adminClient.createClient({ - protocol: "openid-connect", - clientId, - publicClient: false, - directAccessGrantsEnabled: true, - clientAuthenticatorType: "client-secret", - secret: "secret", - standardFlowEnabled: true, - }), - adminClient.createUser({ - // Create user in master realm - username: username, - enabled: true, - credentials: [{ type: "password", value: "password" }], - }), - ]); - - await adminClient.auth({ - username, - password: "password", - grantType: "password", - clientId, - clientSecret: "secret", - scopes: ["openid", "offline_access"], - }); - }); - - after(() => - Promise.all([ - adminClient.deleteClient(clientId), - adminClient.deleteUser(username), - ]), - ); - - it("check offline token", () => { - sidebarPage.waitForPageLoad(); - - listingPage.searchItem(clientId, false); - sidebarPage.waitForPageLoad(); - - // Now check that offline session exists (online one has been logged off above) - // and that it is possible to revoke it - commonPage - .tableUtils() - .checkRowItemExists(username) - .selectRowItemAction(username, "Revoke"); - }); - }); - - describe("Search", () => { - it("search existing session", () => { - listingPage.searchItem(admin, false); - listingPage.itemExist(admin, true); - page.assertEmptyStateExist(false); - }); - - it("search non-existant session", () => { - listingPage.searchItem("non-existant-session", false); - page.assertEmptyStateExist(true); - }); - }); - - //TODO seems these tests are not stable on CI - describe.skip("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. No admin URI configured or no registered cluster nodes available", - ); - }); - }); - - describe("Accessibility tests for sessions", () => { - beforeEach(() => { - loginPage.logIn(); - keycloakBefore(); - sidebarPage.goToSessions(); - cy.injectAxe(); - }); - - it("Check a11y violations on load/ sessions", () => { - cy.checkA11y(); - }); - - it("Check a11y violations on revocation dialog", () => { - cy.findByTestId("action-dropdown").click(); - cy.findByTestId("revocation").click(); - cy.checkA11y(); - cy.findByTestId("cancel").click(); - }); - - it("Check a11y violations on sign out all active sessions dialog", () => { - cy.findByTestId("action-dropdown").click(); - cy.findByTestId("logout-all").click(); - cy.checkA11y(); - cy.findByTestId("cancel").click(); - }); - }); -}); diff --git a/js/apps/admin-ui/cypress/e2e/user_fed_kerberos_test.spec.ts b/js/apps/admin-ui/cypress/e2e/user_fed_kerberos_test.spec.ts deleted file mode 100644 index 75b3620f0c4..00000000000 --- a/js/apps/admin-ui/cypress/e2e/user_fed_kerberos_test.spec.ts +++ /dev/null @@ -1,251 +0,0 @@ -import LoginPage from "../support/pages/LoginPage"; -import SidebarPage from "../support/pages/admin-ui/SidebarPage"; -import ProviderPage from "../support/pages/admin-ui/manage/providers/ProviderPage"; -import Masthead from "../support/pages/admin-ui/Masthead"; -import ModalUtils from "../support/util/ModalUtils"; -import { keycloakBefore } from "../support/util/keycloak_hooks"; -import PriorityDialog from "../support/pages/admin-ui/manage/providers/PriorityDialog"; - -const loginPage = new LoginPage(); -const masthead = new Masthead(); -const sidebarPage = new SidebarPage(); -const providersPage = new ProviderPage(); -const modalUtils = new ModalUtils(); - -const provider = "kerberos"; -const initCapProvider = provider.charAt(0).toUpperCase() + provider.slice(1); - -const kerberosName = "my-kerberos"; -const kerberosRealm = "my-realm"; -const kerberosPrincipal = "my-principal"; -const kerberosKeytab = "my-keytab"; - -const firstKerberosName = `${kerberosName}-1`; -const firstKerberosRealm = `${kerberosRealm}-1`; -const firstKerberosPrincipal = `${kerberosPrincipal}-1`; -const firstKerberosKeytab = `${kerberosKeytab}-1`; - -const secondKerberosName = `${kerberosName}-2`; -const secondKerberosRealm = `${kerberosRealm}-2`; -const secondKerberosPrincipal = `${kerberosPrincipal}-2`; -const secondKerberosKeytab = `${kerberosKeytab}-2`; - -const defaultPolicy = "DEFAULT"; -const weeklyPolicy = "EVICT_WEEKLY"; -const dailyPolicy = "EVICT_DAILY"; -const lifespanPolicy = "MAX_LIFESPAN"; -const noCachePolicy = "NO_CACHE"; - -const defaultKerberosDay = "Sunday"; -const defaultKerberosHour = "00"; -const defaultKerberosMinute = "00"; -const newKerberosDay = "Wednesday"; -const newKerberosHour = "15"; -const newKerberosMinute = "55"; -const maxLifespan = 5; - -const addProviderMenu = "Add new provider"; -const createdSuccessMessage = "User federation provider successfully created"; -const savedSuccessMessage = "User federation provider successfully saved"; -const deletedSuccessMessage = "The user federation provider has been deleted."; -const deleteModalTitle = "Delete user federation provider?"; -const disableModalTitle = "Disable user federation provider?"; -const changeSuccessMsg = - "Successfully changed the priority order of user federation providers"; - -describe("User Fed Kerberos tests", () => { - beforeEach(() => { - loginPage.logIn(); - keycloakBefore(); - sidebarPage.goToUserFederation(); - }); - - it("Should create Kerberos provider from empty state", () => { - // if tests don't start at empty state, e.g. user has providers configured locally, - // create a new card from the card view instead - cy.get("body").then(($body) => { - if ($body.find(`[data-testid=kerberos-card]`).length > 0) { - providersPage.clickNewCard(provider); - } else { - providersPage.clickMenuCommand(addProviderMenu, initCapProvider); - } - }); - providersPage.fillKerberosRequiredData( - firstKerberosName, - firstKerberosRealm, - firstKerberosPrincipal, - firstKerberosKeytab, - ); - providersPage.save(provider); - - masthead.checkNotificationMessage(createdSuccessMessage); - sidebarPage.goToUserFederation(); - }); - - it("Should enable debug, password authentication, and first login", () => { - providersPage.clickExistingCard(firstKerberosName); - providersPage.toggleSwitch(providersPage.debugSwitch); - providersPage.toggleSwitch(providersPage.passwordAuthSwitch); - providersPage.toggleSwitch(providersPage.firstLoginSwitch); - - providersPage.save(provider); - masthead.checkNotificationMessage(savedSuccessMessage); - - sidebarPage.goToUserFederation(); - providersPage.clickExistingCard(firstKerberosName); - - providersPage.verifyToggle(providersPage.debugSwitch, "on"); - providersPage.verifyToggle(providersPage.passwordAuthSwitch, "on"); - providersPage.verifyToggle(providersPage.firstLoginSwitch, "on"); - }); - - it("Should set cache policy to evict_daily", () => { - providersPage.clickExistingCard(firstKerberosName); - providersPage.selectCacheType(dailyPolicy); - providersPage.changeCacheTime("hour", newKerberosHour); - providersPage.changeCacheTime("minute", newKerberosMinute); - providersPage.save(provider); - - masthead.checkNotificationMessage(savedSuccessMessage); - sidebarPage.goToUserFederation(); - providersPage.clickExistingCard(firstKerberosName); - - expect(cy.contains(dailyPolicy).should("exist")); - expect(cy.contains(defaultPolicy).should("not.exist")); - }); - - it("Should set cache policy to default", () => { - providersPage.clickExistingCard(firstKerberosName); - providersPage.selectCacheType(defaultPolicy); - providersPage.save(provider); - - masthead.checkNotificationMessage(savedSuccessMessage); - sidebarPage.goToUserFederation(); - providersPage.clickExistingCard(firstKerberosName); - - expect(cy.contains(defaultPolicy).should("exist")); - expect(cy.contains(dailyPolicy).should("not.exist")); - }); - - it("Should set cache policy to evict_weekly", () => { - providersPage.clickExistingCard(firstKerberosName); - providersPage.selectCacheType(weeklyPolicy); - providersPage.changeCacheTime("day", newKerberosDay); - providersPage.changeCacheTime("hour", newKerberosHour); - providersPage.changeCacheTime("minute", newKerberosMinute); - providersPage.save(provider); - - masthead.checkNotificationMessage(savedSuccessMessage); - sidebarPage.goToUserFederation(); - providersPage.clickExistingCard(firstKerberosName); - - expect(cy.contains(weeklyPolicy).should("exist")); - expect(cy.contains(defaultPolicy).should("not.exist")); - }); - - it("Should set cache policy to max_lifespan", () => { - providersPage.clickExistingCard(firstKerberosName); - providersPage.selectCacheType(lifespanPolicy); - providersPage.fillMaxLifespanData(maxLifespan); - providersPage.save(provider); - - masthead.checkNotificationMessage(savedSuccessMessage); - sidebarPage.goToUserFederation(); - providersPage.clickExistingCard(firstKerberosName); - - expect(cy.contains(lifespanPolicy).should("exist")); - expect(cy.contains(weeklyPolicy).should("not.exist")); - }); - - it("Should set cache policy to no_cache", () => { - providersPage.clickExistingCard(firstKerberosName); - providersPage.selectCacheType(noCachePolicy); - providersPage.save(provider); - - masthead.checkNotificationMessage(savedSuccessMessage); - sidebarPage.goToUserFederation(); - providersPage.clickExistingCard(firstKerberosName); - - expect(cy.contains(noCachePolicy).should("exist")); - expect(cy.contains(lifespanPolicy).should("not.exist")); - }); - - it("Should edit existing Kerberos provider and cancel", () => { - providersPage.clickExistingCard(firstKerberosName); - providersPage.selectCacheType(weeklyPolicy); - - providersPage.changeCacheTime("day", defaultKerberosDay); - providersPage.changeCacheTime("hour", defaultKerberosHour); - providersPage.changeCacheTime("minute", defaultKerberosMinute); - - providersPage.cancel(provider); - - providersPage.clickExistingCard(firstKerberosName); - providersPage.selectCacheType(weeklyPolicy); - - providersPage.verifyChangedHourInput(newKerberosHour, defaultKerberosHour); - sidebarPage.goToUserFederation(); - }); - - it("Should disable an existing Kerberos provider", () => { - providersPage.clickExistingCard(firstKerberosName); - providersPage.disableEnabledSwitch(initCapProvider); - - modalUtils.checkModalTitle(disableModalTitle).confirmModal(); - - masthead.checkNotificationMessage(savedSuccessMessage); - sidebarPage.goToUserFederation(); - - expect(cy.contains("Disabled").should("exist")); - }); - - it("Should enable an existing previously-disabled Kerberos provider", () => { - providersPage.clickExistingCard(firstKerberosName); - providersPage.enableEnabledSwitch(initCapProvider); - - masthead.checkNotificationMessage(savedSuccessMessage); - - sidebarPage.goToUserFederation(); - expect(cy.contains("Enabled").should("exist")); - }); - - it("Should create new Kerberos provider using the New Provider dropdown", () => { - providersPage.clickMenuCommand(addProviderMenu, initCapProvider); - - providersPage.fillKerberosRequiredData( - secondKerberosName, - secondKerberosRealm, - secondKerberosPrincipal, - secondKerberosKeytab, - ); - providersPage.save(provider); - - masthead.checkNotificationMessage(createdSuccessMessage); - sidebarPage.goToUserFederation(); - }); - - it.skip("Should change the priority order of Kerberos providers", () => { - const priorityDialog = new PriorityDialog(); - const providers = [firstKerberosName, secondKerberosName]; - - sidebarPage.goToUserFederation(); - providersPage.clickMenuCommand(addProviderMenu, initCapProvider); - - sidebarPage.goToUserFederation(); - priorityDialog.openDialog().checkOrder(providers); - priorityDialog.clickSave(); - masthead.checkNotificationMessage(changeSuccessMsg, true); - }); - - it("Should delete a Kerberos provider from card view using the card's menu", () => { - providersPage.deleteCardFromCard(secondKerberosName); - modalUtils.checkModalTitle(deleteModalTitle).confirmModal(); - masthead.checkNotificationMessage(deletedSuccessMessage); - }); - - it("Should delete a Kerberos provider using the Settings view's Action menu", () => { - providersPage.deleteCardFromMenu(firstKerberosName); - modalUtils.checkModalTitle(deleteModalTitle).confirmModal(); - masthead.checkNotificationMessage(deletedSuccessMessage); - }); -}); diff --git a/js/apps/admin-ui/cypress/e2e/user_fed_ldap_hardcoded_mapper_test.spec.ts b/js/apps/admin-ui/cypress/e2e/user_fed_ldap_hardcoded_mapper_test.spec.ts deleted file mode 100644 index c73d27c1d30..00000000000 --- a/js/apps/admin-ui/cypress/e2e/user_fed_ldap_hardcoded_mapper_test.spec.ts +++ /dev/null @@ -1,237 +0,0 @@ -import LoginPage from "../support/pages/LoginPage"; -import SidebarPage from "../support/pages/admin-ui/SidebarPage"; -import ListingPage from "../support/pages/admin-ui/ListingPage"; -import GroupModal from "../support/pages/admin-ui/manage/groups/GroupModal"; -import ProviderPage from "../support/pages/admin-ui/manage/providers/ProviderPage"; -import CreateClientPage from "../support/pages/admin-ui/manage/clients/CreateClientPage"; -import Masthead from "../support/pages/admin-ui/Masthead"; -import ModalUtils from "../support/util/ModalUtils"; -import { keycloakBefore } from "../support/util/keycloak_hooks"; -import GroupPage from "../support/pages/admin-ui/manage/groups/GroupPage"; - -const loginPage = new LoginPage(); -const masthead = new Masthead(); -const sidebarPage = new SidebarPage(); -const listingPage = new ListingPage(); -const groupModal = new GroupModal(); -const createClientPage = new CreateClientPage(); -const groupPage = new GroupPage(); - -const providersPage = new ProviderPage(); -const modalUtils = new ModalUtils(); - -const provider = "ldap"; -const allCapProvider = provider.toUpperCase(); - -const ldapName = "ldap-mappers-testing"; -const ldapVendor = "Active Directory"; - -// connection and authentication settings -const connectionUrlValid = "ldap://localhost:3004"; -const bindTypeSimple = "simple"; -const truststoreSpiAlways = "Always"; -const connectionTimeoutTwoSecs = "2000"; -const bindDnCnDc = "cn=user,dc=test"; -const bindCredsValid = "user"; - -// ldap searching and updating -const editModeReadOnly = "READ_ONLY"; -const firstUsersDn = "user-dn-1"; -const firstUserLdapAtt = "uid"; -const firstRdnLdapAtt = "uid"; -const firstUuidLdapAtt = "entryUUID"; -const firstUserObjClasses = "inetOrgPerson, organizationalPerson"; - -const addProviderMenu = "Add new provider"; -const providerCreatedSuccess = "User federation provider successfully created"; -const mapperCreatedSuccess = "Mapping successfully created"; -const providerDeleteSuccess = "The user federation provider has been deleted."; -const providerDeleteTitle = "Delete user federation provider?"; -const mapperDeletedSuccess = "Mapping successfully deleted"; -const mapperDeleteTitle = "Delete mapping?"; -const groupDeleteTitle = "Delete group?"; -const groupCreatedSuccess = "Group created"; -const groupDeletedSuccess = "Group deleted"; -const clientCreatedSuccess = "Client created successfully"; -const clientDeletedSuccess = "The client has been deleted"; -const roleCreatedSuccess = "Role created"; -const groupName = "aa-uf-mappers-group"; -const clientName = "aa-uf-mappers-client"; -const roleName = "aa-uf-mappers-role"; - -// mapperType variables -const hcAttMapper = "hardcoded-attribute-mapper"; -const hcLdapGroupMapper = "hardcoded-ldap-group-mapper"; -const hcLdapAttMapper = "hardcoded-ldap-attribute-mapper"; -const roleLdapMapper = "role-ldap-mapper"; -const hcLdapRoleMapper = "hardcoded-ldap-role-mapper"; - -// Used by "Delete default mappers" test -const creationDateMapper = "creation date"; -const emailMapper = "email"; -const lastNameMapper = "last name"; -const modifyDateMapper = "modify date"; - -describe("User Fed LDAP mapper tests", () => { - beforeEach(() => { - loginPage.logIn(); - keycloakBefore(); - sidebarPage.goToUserFederation(); - }); - - it("Create LDAP provider from empty state", () => { - // if tests don't start at empty state, e.g. user has providers configured locally, - // create a new card from the card view instead - cy.get("body").then(($body) => { - if ($body.find(`[data-testid=ldap-card]`).length > 0) { - providersPage.clickNewCard(provider); - } else { - providersPage.clickMenuCommand(addProviderMenu, allCapProvider); - } - }); - providersPage.fillLdapGeneralData(ldapName, ldapVendor); - providersPage.fillLdapConnectionData( - connectionUrlValid, - bindTypeSimple, - truststoreSpiAlways, - connectionTimeoutTwoSecs, - bindDnCnDc, - bindCredsValid, - ); - providersPage.toggleSwitch(providersPage.enableStartTls); - providersPage.toggleSwitch(providersPage.connectionPooling); - - providersPage.fillLdapSearchingData( - editModeReadOnly, - firstUsersDn, - firstUserLdapAtt, - firstRdnLdapAtt, - firstUuidLdapAtt, - firstUserObjClasses, - ); - providersPage.save(provider); - masthead.checkNotificationMessage(providerCreatedSuccess); - sidebarPage.goToUserFederation(); - }); - - // create a new group - it("Create group", () => { - sidebarPage.goToGroups(); - groupPage.openCreateGroupModal(true); - groupModal.setGroupNameInput(groupName).create(); - masthead.checkNotificationMessage(groupCreatedSuccess); - }); - - // create a new client and then new role for that client - it("Create client and role", () => { - sidebarPage.goToClients(); - listingPage.goToCreateItem(); - createClientPage - .selectClientType("OpenID Connect") - .fillClientData(clientName) - .continue() - .continue() - .save(); - - masthead.checkNotificationMessage(clientCreatedSuccess); - - providersPage.createRole(roleName); - masthead.checkNotificationMessage(roleCreatedSuccess); - - sidebarPage.goToClients(); - listingPage.searchItem(clientName).itemExist(clientName); - }); - - // delete four default mappers - it("Delete default mappers", () => { - providersPage.clickExistingCard(ldapName); - providersPage.goToMappers(); - - listingPage.itemExist(creationDateMapper).deleteItem(creationDateMapper); - modalUtils.checkModalTitle(mapperDeleteTitle).confirmModal(); - masthead.checkNotificationMessage(mapperDeletedSuccess, true); - listingPage.itemExist(creationDateMapper, false); - - listingPage.itemExist(emailMapper).deleteItem(emailMapper); - modalUtils.checkModalTitle(mapperDeleteTitle).confirmModal(); - masthead.checkNotificationMessage(mapperDeletedSuccess, true); - listingPage.itemExist(emailMapper, false); - - listingPage.itemExist(lastNameMapper).deleteItem(lastNameMapper); - modalUtils.checkModalTitle(mapperDeleteTitle).confirmModal(); - masthead.checkNotificationMessage(mapperDeletedSuccess, true); - listingPage.itemExist(lastNameMapper, false); - - listingPage.itemExist(modifyDateMapper).deleteItem(modifyDateMapper); - modalUtils.checkModalTitle(mapperDeleteTitle).confirmModal(); - masthead.checkNotificationMessage(mapperDeletedSuccess, true); - listingPage.itemExist(modifyDateMapper, false); - }); - - // create one of each hardcoded mapper type - it("Create hardcoded attribute mapper", () => { - providersPage.clickExistingCard(ldapName); - providersPage.goToMappers(); - providersPage.createNewMapper(hcAttMapper); - providersPage.save("ldap-mapper"); - masthead.checkNotificationMessage(mapperCreatedSuccess); - listingPage.itemExist(hcAttMapper, true); - }); - - it("Create hardcoded ldap group mapper", () => { - providersPage.clickExistingCard(ldapName); - providersPage.goToMappers(); - providersPage.createNewMapper(hcLdapGroupMapper); - providersPage.save("ldap-mapper"); - masthead.checkNotificationMessage(mapperCreatedSuccess); - listingPage.itemExist(hcLdapGroupMapper, true); - }); - - it("Create hardcoded ldap attribute mapper", () => { - providersPage.clickExistingCard(ldapName); - providersPage.goToMappers(); - providersPage.createNewMapper(hcLdapAttMapper); - providersPage.save("ldap-mapper"); - masthead.checkNotificationMessage(mapperCreatedSuccess); - listingPage.itemExist(hcLdapAttMapper, true); - }); - - it("Create hardcoded ldap role mapper", () => { - providersPage.clickExistingCard(ldapName); - providersPage.goToMappers(); - providersPage.createNewMapper(hcLdapRoleMapper); - providersPage.save("ldap-mapper"); - masthead.checkNotificationMessage(mapperCreatedSuccess); - listingPage.itemExist(hcLdapRoleMapper, true); - }); - - it("Create role ldap mapper", () => { - providersPage.clickExistingCard(ldapName); - providersPage.goToMappers(); - providersPage.createNewMapper(roleLdapMapper); - providersPage.save("ldap-mapper"); - masthead.checkNotificationMessage(mapperCreatedSuccess); - listingPage.itemExist(roleLdapMapper, true); - }); - - // *** test cleanup *** - it("Cleanup - delete LDAP provider", () => { - providersPage.deleteCardFromMenu(ldapName); - modalUtils.checkModalTitle(providerDeleteTitle).confirmModal(); - masthead.checkNotificationMessage(providerDeleteSuccess); - }); - - it("Cleanup - delete group", () => { - sidebarPage.goToGroups(); - listingPage.deleteItem(groupName); - modalUtils.checkModalTitle(groupDeleteTitle).confirmModal(); - masthead.checkNotificationMessage(groupDeletedSuccess); - }); - - it("Cleanup - delete client", () => { - sidebarPage.goToClients(); - listingPage.deleteItem(clientName); - modalUtils.checkModalTitle(`Delete ${clientName} ?`).confirmModal(); - masthead.checkNotificationMessage(clientDeletedSuccess); - }); -}); diff --git a/js/apps/admin-ui/cypress/e2e/user_fed_ldap_mapper_test.spec.ts b/js/apps/admin-ui/cypress/e2e/user_fed_ldap_mapper_test.spec.ts deleted file mode 100644 index 737c4323351..00000000000 --- a/js/apps/admin-ui/cypress/e2e/user_fed_ldap_mapper_test.spec.ts +++ /dev/null @@ -1,276 +0,0 @@ -import LoginPage from "../support/pages/LoginPage"; -import SidebarPage from "../support/pages/admin-ui/SidebarPage"; -import ListingPage from "../support/pages/admin-ui/ListingPage"; -import ProviderPage from "../support/pages/admin-ui/manage/providers/ProviderPage"; -import Masthead from "../support/pages/admin-ui/Masthead"; -import ModalUtils from "../support/util/ModalUtils"; -import { keycloakBefore } from "../support/util/keycloak_hooks"; - -const loginPage = new LoginPage(); -const masthead = new Masthead(); -const sidebarPage = new SidebarPage(); -const listingPage = new ListingPage(); - -const providersPage = new ProviderPage(); -const modalUtils = new ModalUtils(); - -const provider = "ldap"; -const allCapProvider = provider.toUpperCase(); - -const ldapName = "ldap-mappers-testing"; -const ldapVendor = "Active Directory"; - -// connection and authentication settings -const connectionUrlValid = "ldap://localhost:3004"; -const bindTypeSimple = "simple"; -const truststoreSpiAlways = "Always"; -const connectionTimeoutTwoSecs = "2000"; -const bindDnCnDc = "cn=user,dc=test"; -const bindCredsValid = "user"; - -// ldap searching and updating -const editModeReadOnly = "READ_ONLY"; -const firstUsersDn = "user-dn-1"; -const firstUserLdapAtt = "uid"; -const firstRdnLdapAtt = "uid"; -const firstUuidLdapAtt = "entryUUID"; -const firstUserObjClasses = "inetOrgPerson, organizationalPerson"; - -const addProviderMenu = "Add new provider"; -const providerCreatedSuccess = "User federation provider successfully created"; -const mapperCreatedSuccess = "Mapping successfully created"; -const mapperUpdatedSuccess = "Mapping successfully updated"; -const providerDeleteSuccess = "The user federation provider has been deleted."; -const providerDeleteTitle = "Delete user federation provider?"; -const mapperDeletedSuccess = "Mapping successfully deleted"; -const mapperDeleteTitle = "Delete mapping?"; - -// mapperType variables -const msadUserAcctMapper = "msad-user-account-control-mapper"; -const msadLdsUserAcctMapper = "msad-lds-user-account-control-mapper"; -const userAttLdapMapper = "user-attribute-ldap-mapper"; -const fullNameLdapMapper = "full-name-ldap-mapper"; -const groupLdapMapper = "group-ldap-mapper"; -const certLdapMapper = "certificate-ldap-mapper"; - -const mapperNames = [ - `${msadUserAcctMapper}-test`, - `${msadLdsUserAcctMapper}-test`, - `${userAttLdapMapper}-test`, - `${fullNameLdapMapper}-test`, - `${groupLdapMapper}-test`, -]; -const multiMapperNames = mapperNames.slice(2); -const singleMapperName = mapperNames.slice(4); -const uniqueSearchTerm = "group"; -const multipleSearchTerm = "ldap"; -const nonexistingSearchTerm = "redhat"; - -// Used by "Delete default mappers" test -const creationDateMapper = "creation date"; -const emailMapper = "email"; -const lastNameMapper = "last name"; -const modifyDateMapper = "modify date"; -const usernameMapper = "username"; -const firstNameMapper = "first name"; -const MsadAccountControlsMapper = "MSAD account controls"; - -describe("User Fed LDAP mapper tests", () => { - beforeEach(() => { - loginPage.logIn(); - keycloakBefore(); - sidebarPage.goToUserFederation(); - }); - - it("Create LDAP provider from empty state", () => { - // if tests don't start at empty state, e.g. user has providers configured locally, - // create a new card from the card view instead - cy.get("body").then(($body) => { - if ($body.find(`[data-testid=ldap-card]`).length > 0) { - providersPage.clickNewCard(provider); - } else { - providersPage.clickMenuCommand(addProviderMenu, allCapProvider); - } - }); - providersPage.fillLdapGeneralData(ldapName, ldapVendor); - providersPage.fillLdapConnectionData( - connectionUrlValid, - bindTypeSimple, - truststoreSpiAlways, - connectionTimeoutTwoSecs, - bindDnCnDc, - bindCredsValid, - ); - providersPage.toggleSwitch(providersPage.enableStartTls); - providersPage.toggleSwitch(providersPage.connectionPooling); - - providersPage.fillLdapSearchingData( - editModeReadOnly, - firstUsersDn, - firstUserLdapAtt, - firstRdnLdapAtt, - firstUuidLdapAtt, - firstUserObjClasses, - ); - providersPage.save(provider); - masthead.checkNotificationMessage(providerCreatedSuccess); - sidebarPage.goToUserFederation(); - }); - - // delete default mappers - it("Delete default mappers", () => { - providersPage.clickExistingCard(ldapName); - providersPage.goToMappers(); - - listingPage.itemExist(creationDateMapper).deleteItem(creationDateMapper); - modalUtils.checkModalTitle(mapperDeleteTitle).confirmModal(); - masthead.checkNotificationMessage(mapperDeletedSuccess, true); - listingPage.itemExist(creationDateMapper, false); - - listingPage.itemExist(emailMapper).deleteItem(emailMapper); - modalUtils.checkModalTitle(mapperDeleteTitle).confirmModal(); - masthead.checkNotificationMessage(mapperDeletedSuccess, true); - listingPage.itemExist(emailMapper, false); - - listingPage.itemExist(lastNameMapper).deleteItem(lastNameMapper); - modalUtils.checkModalTitle(mapperDeleteTitle).confirmModal(); - masthead.checkNotificationMessage(mapperDeletedSuccess, true); - listingPage.itemExist(lastNameMapper, false); - - listingPage.itemExist(modifyDateMapper).deleteItem(modifyDateMapper); - modalUtils.checkModalTitle(mapperDeleteTitle).confirmModal(); - masthead.checkNotificationMessage(mapperDeletedSuccess, true); - listingPage.itemExist(modifyDateMapper, false); - - listingPage.itemExist(usernameMapper).deleteItem(usernameMapper); - modalUtils.checkModalTitle(mapperDeleteTitle).confirmModal(); - masthead.checkNotificationMessage(mapperDeletedSuccess, true); - listingPage.itemExist(usernameMapper, false); - - listingPage.itemExist(firstNameMapper).deleteItem(firstNameMapper); - modalUtils.checkModalTitle(mapperDeleteTitle).confirmModal(); - masthead.checkNotificationMessage(mapperDeletedSuccess, true); - listingPage.itemExist(firstNameMapper, false); - - listingPage - .itemExist(MsadAccountControlsMapper) - .deleteItem(MsadAccountControlsMapper); - modalUtils.checkModalTitle(mapperDeleteTitle).confirmModal(); - masthead.checkNotificationMessage(mapperDeletedSuccess, true); - }); - - // mapper CRUD tests - // create mapper - it("Create certificate ldap mapper", () => { - providersPage.clickExistingCard(ldapName); - providersPage.goToMappers(); - providersPage.createNewMapper(certLdapMapper); - providersPage.save("ldap-mapper"); - masthead.checkNotificationMessage(mapperCreatedSuccess); - listingPage.itemExist(certLdapMapper, true); - }); - - // update mapper - it("Update certificate ldap mapper", () => { - providersPage.clickExistingCard(ldapName); - providersPage.goToMappers(); - - listingPage.goToItemDetails(`${certLdapMapper}-test`); - providersPage.updateMapper(certLdapMapper); - - providersPage.save("ldap-mapper"); - masthead.checkNotificationMessage(mapperUpdatedSuccess); - }); - - // delete mapper - it("Delete certificate ldap mapper", () => { - providersPage.clickExistingCard(ldapName); - providersPage.goToMappers(); - - listingPage.deleteItem(`${certLdapMapper}-test`); - modalUtils.checkModalTitle(mapperDeleteTitle).confirmModal(); - masthead.checkNotificationMessage(mapperDeletedSuccess); - }); - - // create one of each non-hardcoded mapper type except - // certificate ldap mapper which was already tested in CRUD section - it("Create user account control mapper", () => { - providersPage.clickExistingCard(ldapName); - providersPage.goToMappers(); - providersPage.createNewMapper(msadUserAcctMapper); - providersPage.save("ldap-mapper"); - masthead.checkNotificationMessage(mapperCreatedSuccess); - listingPage.itemExist(msadUserAcctMapper, true); - }); - - it("Create msad lds user account control mapper", () => { - providersPage.clickExistingCard(ldapName); - providersPage.goToMappers(); - providersPage.createNewMapper(msadLdsUserAcctMapper); - providersPage.save("ldap-mapper"); - masthead.checkNotificationMessage(mapperCreatedSuccess); - listingPage.itemExist(msadLdsUserAcctMapper, true); - }); - - it("Create user attribute ldap mapper", () => { - providersPage.clickExistingCard(ldapName); - providersPage.goToMappers(); - providersPage.createNewMapper(userAttLdapMapper); - providersPage.save("ldap-mapper"); - masthead.checkNotificationMessage(mapperCreatedSuccess); - listingPage.itemExist(userAttLdapMapper, true); - }); - - it("Create full name ldap mapper", () => { - providersPage.clickExistingCard(ldapName); - providersPage.goToMappers(); - providersPage.createNewMapper(fullNameLdapMapper); - providersPage.save("ldap-mapper"); - masthead.checkNotificationMessage(mapperCreatedSuccess); - listingPage.itemExist(fullNameLdapMapper, true); - }); - - it("Create group ldap mapper", () => { - providersPage.clickExistingCard(ldapName); - providersPage.goToMappers(); - providersPage.createNewMapper(groupLdapMapper); - providersPage.save("ldap-mapper"); - masthead.checkNotificationMessage(mapperCreatedSuccess); - listingPage.itemExist(groupLdapMapper, true); - }); - - it("Should return one search result for mapper with unique string", () => { - providersPage.clickExistingCard(ldapName); - providersPage.goToMappers(); - listingPage.searchItem(uniqueSearchTerm, false); - singleMapperName.map((mapperName) => listingPage.itemExist(mapperName)); - }); - - it("Should return multiple search results for mappers that share common string", () => { - providersPage.clickExistingCard(ldapName); - providersPage.goToMappers(); - listingPage.searchItem(multipleSearchTerm, false); - multiMapperNames.map((mapperName) => listingPage.itemExist(mapperName)); - }); - - it("Should return all mappers in search results when no string is specified", () => { - providersPage.clickExistingCard(ldapName); - providersPage.goToMappers(); - listingPage.searchItem("", false); - mapperNames.map((mapperName) => listingPage.itemExist(mapperName)); - }); - - it("Should return no search results for string that does not exist in any mappers", () => { - providersPage.clickExistingCard(ldapName); - providersPage.goToMappers(); - listingPage.searchItem(nonexistingSearchTerm, false); - listingPage.assertNoResults(); - }); - - // *** test cleanup *** - it("Cleanup - delete LDAP provider", () => { - providersPage.deleteCardFromMenu(ldapName); - modalUtils.checkModalTitle(providerDeleteTitle).confirmModal(); - masthead.checkNotificationMessage(providerDeleteSuccess); - }); -}); diff --git a/js/apps/admin-ui/cypress/e2e/user_fed_ldap_test.spec.ts b/js/apps/admin-ui/cypress/e2e/user_fed_ldap_test.spec.ts deleted file mode 100644 index f013c40b957..00000000000 --- a/js/apps/admin-ui/cypress/e2e/user_fed_ldap_test.spec.ts +++ /dev/null @@ -1,576 +0,0 @@ -import LoginPage from "../support/pages/LoginPage"; -import SidebarPage from "../support/pages/admin-ui/SidebarPage"; -import ProviderPage from "../support/pages/admin-ui/manage/providers/ProviderPage"; -import Masthead from "../support/pages/admin-ui/Masthead"; -import ModalUtils from "../support/util/ModalUtils"; -import { keycloakBefore } from "../support/util/keycloak_hooks"; -import adminClient from "../support/util/AdminClient"; - -const loginPage = new LoginPage(); -const masthead = new Masthead(); -const sidebarPage = new SidebarPage(); -const providersPage = new ProviderPage(); -const modalUtils = new ModalUtils(); - -const provider = "ldap"; -const allCapProvider = provider.toUpperCase(); - -const firstLdapName = "my-ldap"; -const firstLdapVendor = "Active Directory"; -const secondLdapName = `${firstLdapName}-2`; -const secondLdapVendor = "Other"; -const updatedLdapName = `${firstLdapName}-updated`; - -// connection and authentication settings -const connectionUrlValid = "ldap://localhost:3004"; -const bindTypeSimple = "simple"; -const truststoreSpiAlways = "Always"; -const connectionTimeoutTwoSecs = "2000"; -const bindDnCnDc = "cn=user,dc=test"; -const bindCredsValid = "user"; - -const connectionUrlInvalid = "ldap://nowhere.com"; -const bindTypeNone = "none"; -const truststoreSpiNever = "Never"; -const bindDnCnOnly = "cn=read-only-admin"; -const bindCredsInvalid = "not-my-password"; - -// kerberos integration settings -const kerberosRealm = "FOO.ORG"; -const serverPrincipal = "HTTP/host.foo.org@FOO.ORG"; -const keyTab = "/etc/krb5.keytab"; - -// ldap synchronization settings -const batchSize = "100"; -const fullSyncPeriod = "604800"; -const userSyncPeriod = "86400"; - -// ldap searching and updating -const editModeReadOnly = "READ_ONLY"; -const editModeWritable = "WRITABLE"; -const editModeUnsynced = "UNSYNCED"; - -const firstUsersDn = "user-dn-1"; -const firstUserLdapAtt = "uid"; -const firstRdnLdapAtt = "uid"; -const firstUuidLdapAtt = "entryUUID"; -const firstUserObjClasses = "inetOrgPerson, organizationalPerson"; -const firstUserLdapFilter = "(first-filter)"; -const firstReadTimeout = "5000"; - -const searchScopeOneLevel = "One Level"; -const searchScopeSubtree = "Subtree"; - -const secondUsersDn = "user-dn-2"; -const secondUserLdapAtt = "cn"; -const secondRdnLdapAtt = "cn"; -const secondUuidLdapAtt = "objectGUID"; -const secondUserObjClasses = "person, organizationalPerson, user"; -const secondUserLdapFilter = "(second-filter)"; -const secondReadTimeout = "5000"; - -const defaultPolicy = "DEFAULT"; -const weeklyPolicy = "EVICT_WEEKLY"; -const dailyPolicy = "EVICT_DAILY"; -const lifespanPolicy = "MAX_LIFESPAN"; -const noCachePolicy = "NO_CACHE"; -const defaultLdapDay = "Sunday"; -const defaultLdapHour = "00"; -const defaultLdapMinute = "00"; -const newLdapDay = "Wednesday"; -const newLdapHour = "15"; -const newLdapMinute = "55"; -const maxLifespan = 5; - -const addProviderMenu = "Add new provider"; -const createdSuccessMessage = "User federation provider successfully created"; -const savedSuccessMessage = "User federation provider successfully saved"; -const deletedSuccessMessage = "The user federation provider has been deleted."; -const deleteModalTitle = "Delete user federation provider?"; -const disableModalTitle = "Disable user federation provider?"; -const validatePasswordPolicyFailMessage = - "User federation provider could not be saved: Validate Password Policy is applicable only with WRITABLE edit mode"; -const userImportingDisabledFailMessage = - "User federation provider could not be saved: Can not disable Importing users when LDAP provider mode is UNSYNCED"; - -const ldapTestSuccessMsg = "Successfully connected to LDAP"; -const ldapTestFailMsg = "Error when trying to connect to LDAP: 'UnknownHost'"; - -describe("User Federation LDAP tests", () => { - const realmName = `ldap-realm-${crypto.randomUUID()}`; - - before(() => adminClient.createRealm(realmName)); - - after(() => adminClient.deleteRealm(realmName)); - - beforeEach(() => { - loginPage.logIn(); - keycloakBefore(); - sidebarPage.goToRealm(realmName); - sidebarPage.goToUserFederation(); - }); - - it("Should create LDAP provider from empty state", () => { - // if tests don't start at empty state, e.g. user has providers configured locally, - // create a new card from the card view instead - cy.get("body").then(($body) => { - if ($body.find(`[data-testid=ldap-card]`).length > 0) { - providersPage.clickNewCard(provider); - } else { - providersPage.clickMenuCommand(addProviderMenu, allCapProvider); - } - }); - providersPage.fillLdapGeneralData(firstLdapName, firstLdapVendor); - providersPage.fillLdapConnectionData( - connectionUrlInvalid, - bindTypeSimple, - truststoreSpiNever, - connectionTimeoutTwoSecs, - bindDnCnOnly, - bindCredsInvalid, - ); - providersPage.fillLdapSearchingData( - editModeReadOnly, - firstUsersDn, - firstUserLdapAtt, - firstRdnLdapAtt, - firstUuidLdapAtt, - firstUserObjClasses, - firstUserLdapFilter, - searchScopeOneLevel, - firstReadTimeout, - ); - providersPage.save(provider); - masthead.checkNotificationMessage(createdSuccessMessage); - sidebarPage.goToUserFederation(); - }); - - it("Should fail updating advanced settings", () => { - providersPage.clickExistingCard(firstLdapName); - providersPage.toggleSwitch(providersPage.ldapv3PwSwitch); - providersPage.toggleSwitch(providersPage.validatePwPolicySwitch); - providersPage.toggleSwitch(providersPage.trustEmailSwitch); - providersPage.save(provider); - masthead.checkNotificationMessage(validatePasswordPolicyFailMessage); - sidebarPage.goToUserFederation(); - }); - - it("Should update advanced settings", () => { - providersPage.clickExistingCard(firstLdapName); - providersPage.toggleSwitch(providersPage.ldapv3PwSwitch); - providersPage.toggleSwitch(providersPage.validatePwPolicySwitch); - providersPage.toggleSwitch(providersPage.trustEmailSwitch); - providersPage.fillLdapSearchingData( - editModeWritable, - secondUsersDn, - secondUserLdapAtt, - secondRdnLdapAtt, - secondUuidLdapAtt, - secondUserObjClasses, - ); - providersPage.save(provider); - masthead.checkNotificationMessage(savedSuccessMessage); - sidebarPage.goToUserFederation(); - providersPage.clickExistingCard(firstLdapName); - providersPage.verifyToggle(providersPage.ldapv3PwSwitch, "on"); - providersPage.verifyToggle(providersPage.validatePwPolicySwitch, "on"); - providersPage.verifyToggle(providersPage.trustEmailSwitch, "on"); - }); - - it("Should set cache policy to evict_daily", () => { - providersPage.clickExistingCard(firstLdapName); - providersPage.selectCacheType(dailyPolicy); - providersPage.changeCacheTime("hour", newLdapHour); - providersPage.changeCacheTime("minute", newLdapMinute); - providersPage.save(provider); - - masthead.checkNotificationMessage(savedSuccessMessage); - sidebarPage.goToUserFederation(); - providersPage.clickExistingCard(firstLdapName); - - expect(cy.contains(dailyPolicy).should("exist")); - expect(cy.contains(defaultPolicy).should("not.exist")); - }); - - it("Should set cache policy to default", () => { - providersPage.clickExistingCard(firstLdapName); - providersPage.selectCacheType(defaultPolicy); - providersPage.save(provider); - - masthead.checkNotificationMessage(savedSuccessMessage); - sidebarPage.goToUserFederation(); - providersPage.clickExistingCard(firstLdapName); - - expect(cy.contains(defaultPolicy).should("exist")); - expect(cy.contains(dailyPolicy).should("not.exist")); - }); - - it("Should set cache policy to evict_weekly", () => { - providersPage.clickExistingCard(firstLdapName); - providersPage.selectCacheType(weeklyPolicy); - providersPage.changeCacheTime("day", newLdapDay); - providersPage.changeCacheTime("hour", newLdapHour); - providersPage.changeCacheTime("minute", newLdapMinute); - providersPage.save(provider); - - masthead.checkNotificationMessage(savedSuccessMessage); - sidebarPage.goToUserFederation(); - providersPage.clickExistingCard(firstLdapName); - - expect(cy.contains(weeklyPolicy).should("exist")); - expect(cy.contains(defaultPolicy).should("not.exist")); - }); - - it("Update connection and authentication settings and save", () => { - providersPage.clickExistingCard(firstLdapName); - - providersPage.fillLdapConnectionData( - connectionUrlInvalid, - bindTypeNone, - truststoreSpiNever, - connectionTimeoutTwoSecs, - ); - providersPage.toggleSwitch(providersPage.enableStartTls); - providersPage.toggleSwitch(providersPage.connectionPooling); - - providersPage.save(provider); - masthead.checkNotificationMessage(savedSuccessMessage); - - // now verify - sidebarPage.goToUserFederation(); - providersPage.clickExistingCard(firstLdapName); - providersPage.verifyTextField( - providersPage.connectionUrlInput, - connectionUrlInvalid, - ); - providersPage.verifyTextField( - providersPage.connectionTimeoutInput, - connectionTimeoutTwoSecs, - ); - providersPage.verifySelect( - providersPage.truststoreSpiInput, - truststoreSpiNever, - ); - providersPage.verifySelect(providersPage.bindTypeInput, bindTypeNone); - providersPage.verifyToggle(providersPage.enableStartTls, "on"); - providersPage.verifyToggle(providersPage.connectionPooling, "on"); - sidebarPage.goToUserFederation(); - }); - - it("Should fail connection and authentication tests", () => { - providersPage.clickExistingCard(firstLdapName); - - providersPage.testConnection(); - masthead.checkNotificationMessage(ldapTestFailMsg); - - providersPage.testAuthorization(); - masthead.checkNotificationMessage(ldapTestFailMsg); - - sidebarPage.goToUserFederation(); - }); - - it("Should make changes and pass connection and authentication tests", () => { - providersPage.clickExistingCard(firstLdapName); - - providersPage.fillLdapConnectionData( - connectionUrlValid, - bindTypeSimple, - truststoreSpiAlways, - connectionTimeoutTwoSecs, - bindDnCnDc, - bindCredsValid, - ); - providersPage.toggleSwitch(providersPage.enableStartTls); - providersPage.toggleSwitch(providersPage.connectionPooling); - - providersPage.save(provider); - - providersPage.testConnection(); - masthead.checkNotificationMessage(ldapTestSuccessMsg); - - providersPage.testAuthorization(); - masthead.checkNotificationMessage(ldapTestSuccessMsg); - - sidebarPage.goToUserFederation(); - }); - - it("Should update Kerberos integration settings and save", () => { - providersPage.clickExistingCard(firstLdapName); - - providersPage.toggleSwitch(providersPage.allowKerberosAuth); - providersPage.toggleSwitch(providersPage.debug); - providersPage.toggleSwitch(providersPage.useKerberosForPwAuth); - - providersPage.fillTextField( - providersPage.ldapKerberosRealmInput, - kerberosRealm, - ); - providersPage.fillTextField( - providersPage.ldapServerPrincipalInput, - serverPrincipal, - ); - providersPage.fillTextField(providersPage.ldapKeyTabInput, keyTab); - - providersPage.save(provider); - masthead.checkNotificationMessage(savedSuccessMessage); - - // now verify - sidebarPage.goToUserFederation(); - providersPage.clickExistingCard(firstLdapName); - providersPage.verifyTextField( - providersPage.ldapKerberosRealmInput, - kerberosRealm, - ); - providersPage.verifyTextField( - providersPage.ldapServerPrincipalInput, - serverPrincipal, - ); - providersPage.verifyTextField(providersPage.ldapKeyTabInput, keyTab); - providersPage.verifyToggle(providersPage.allowKerberosAuth, "on"); - providersPage.verifyToggle(providersPage.debug, "on"); - providersPage.verifyToggle(providersPage.useKerberosForPwAuth, "on"); - - sidebarPage.goToUserFederation(); - }); - - it("Should update Synchronization settings and save", () => { - providersPage.clickExistingCard(firstLdapName); - - providersPage.toggleSwitch(providersPage.importUsers); - providersPage.toggleSwitch(providersPage.periodicFullSync); - providersPage.toggleSwitch(providersPage.periodicUsersSync); - - providersPage.fillTextField(providersPage.ldapBatchSizeInput, batchSize); - providersPage.fillTextField( - providersPage.ldapFullSyncPeriodInput, - fullSyncPeriod, - ); - providersPage.fillTextField( - providersPage.ldapUsersSyncPeriodInput, - userSyncPeriod, - ); - - providersPage.save(provider); - masthead.checkNotificationMessage(savedSuccessMessage); - - // now verify - sidebarPage.goToUserFederation(); - providersPage.clickExistingCard(firstLdapName); - providersPage.verifyTextField(providersPage.ldapBatchSizeInput, batchSize); - providersPage.verifyTextField( - providersPage.ldapFullSyncPeriodInput, - fullSyncPeriod, - ); - providersPage.verifyTextField( - providersPage.ldapUsersSyncPeriodInput, - userSyncPeriod, - ); - providersPage.verifyToggle(providersPage.periodicFullSync, "on"); - providersPage.verifyToggle(providersPage.periodicUsersSync, "on"); - providersPage.verifyToggle(providersPage.importUsers, "on"); - sidebarPage.goToUserFederation(); - }); - - it("Should update LDAP searching and updating settings and save", () => { - providersPage.clickExistingCard(firstLdapName); - - providersPage.fillLdapSearchingData( - editModeWritable, - secondUsersDn, - secondUserLdapAtt, - secondRdnLdapAtt, - secondUuidLdapAtt, - secondUserObjClasses, - secondUserLdapFilter, - searchScopeSubtree, - secondReadTimeout, - ); - providersPage.toggleSwitch(providersPage.ldapPagination); - - providersPage.save(provider); - masthead.checkNotificationMessage(savedSuccessMessage); - - // now verify - sidebarPage.goToUserFederation(); - providersPage.clickExistingCard(firstLdapName); - - providersPage.verifySelect( - providersPage.ldapEditModeInput, - editModeWritable, - ); - providersPage.verifyTextField( - providersPage.ldapUsersDnInput, - secondUsersDn, - ); - providersPage.verifyTextField( - providersPage.ldapUserLdapAttInput, - secondUserLdapAtt, - ); - providersPage.verifyTextField( - providersPage.ldapRdnLdapAttInput, - secondRdnLdapAtt, - ); - providersPage.verifyTextField( - providersPage.ldapUuidLdapAttInput, - secondUuidLdapAtt, - ); - providersPage.verifyTextField( - providersPage.ldapUserObjClassesInput, - secondUserObjClasses, - ); - providersPage.verifyTextField( - providersPage.ldapUserLdapFilter, - secondUserLdapFilter, - ); - providersPage.verifySelect( - providersPage.ldapSearchScopeInput, - searchScopeSubtree, - ); - providersPage.verifyTextField( - providersPage.ldapReadTimeout, - secondReadTimeout, - ); - providersPage.verifyToggle(providersPage.ldapPagination, "on"); - - sidebarPage.goToUserFederation(); - providersPage.clickExistingCard(firstLdapName); - - providersPage.fillSelect(providersPage.ldapEditModeInput, editModeUnsynced); - - providersPage.toggleSwitch(providersPage.importUsers); - - providersPage.save(provider); - masthead.checkNotificationMessage(validatePasswordPolicyFailMessage); - - providersPage.toggleSwitch(providersPage.importUsers); - providersPage.toggleSwitch(providersPage.validatePwPolicySwitch); - providersPage.save(provider); - - masthead.checkNotificationMessage(userImportingDisabledFailMessage); - - providersPage.toggleSwitch(providersPage.importUsers); - - providersPage.save(provider); - masthead.checkNotificationMessage(savedSuccessMessage); - - // now verify - sidebarPage.goToUserFederation(); - providersPage.clickExistingCard(firstLdapName); - - providersPage.verifySelect( - providersPage.ldapEditModeInput, - editModeUnsynced, - ); - }); - - it("Should update display name", () => { - providersPage.clickExistingCard(firstLdapName); - providersPage.fillLdapGeneralData(updatedLdapName); - - providersPage.save(provider); - masthead.checkNotificationMessage(savedSuccessMessage); - - sidebarPage.goToUserFederation(); - providersPage.clickExistingCard(updatedLdapName); - - sidebarPage.goToUserFederation(); - }); - - it("Should update existing LDAP provider and cancel", () => { - providersPage.clickExistingCard(firstLdapName); - providersPage.selectCacheType(weeklyPolicy); - - providersPage.changeCacheTime("day", defaultLdapDay); - providersPage.changeCacheTime("hour", defaultLdapHour); - providersPage.changeCacheTime("minute", defaultLdapMinute); - - providersPage.cancel(provider); - - providersPage.clickExistingCard(updatedLdapName); - providersPage.selectCacheType(weeklyPolicy); - - providersPage.verifyChangedHourInput(newLdapHour, defaultLdapHour); - - sidebarPage.goToUserFederation(); - }); - - it("Should set cache policy to max_lifespan", () => { - providersPage.clickExistingCard(firstLdapName); - providersPage.selectCacheType(lifespanPolicy); - providersPage.fillMaxLifespanData(maxLifespan); - providersPage.save(provider); - - masthead.checkNotificationMessage(savedSuccessMessage); - sidebarPage.goToUserFederation(); - providersPage.clickExistingCard(firstLdapName); - - expect(cy.contains(lifespanPolicy).should("exist")); - expect(cy.contains(weeklyPolicy).should("not.exist")); - }); - - it("Should set cache policy to no_cache", () => { - providersPage.clickExistingCard(firstLdapName); - providersPage.selectCacheType(noCachePolicy); - providersPage.save(provider); - - masthead.checkNotificationMessage(savedSuccessMessage); - sidebarPage.goToUserFederation(); - providersPage.clickExistingCard(firstLdapName); - - expect(cy.contains(noCachePolicy).should("exist")); - expect(cy.contains(lifespanPolicy).should("not.exist")); - }); - - it("Should disable an existing LDAP provider", () => { - providersPage.clickExistingCard(firstLdapName); - providersPage.disableEnabledSwitch(allCapProvider); - modalUtils.checkModalTitle(disableModalTitle).confirmModal(); - masthead.checkNotificationMessage(savedSuccessMessage); - sidebarPage.goToUserFederation(); - expect(cy.contains("Disabled").should("exist")); - }); - - it("Should enable a previously-disabled LDAP provider", () => { - providersPage.clickExistingCard(firstLdapName); - providersPage.enableEnabledSwitch(allCapProvider); - masthead.checkNotificationMessage(savedSuccessMessage); - sidebarPage.goToUserFederation(); - expect(cy.contains("Enabled").should("exist")); - }); - - it("Should create new LDAP provider using New Provider dropdown", () => { - providersPage.clickMenuCommand(addProviderMenu, allCapProvider); - providersPage.fillLdapGeneralData(secondLdapName, secondLdapVendor); - providersPage.fillLdapConnectionData( - connectionUrlValid, - bindTypeSimple, - truststoreSpiNever, - connectionTimeoutTwoSecs, - bindDnCnOnly, - bindCredsInvalid, - ); - providersPage.fillLdapSearchingData( - editModeWritable, - secondUsersDn, - secondUserLdapAtt, - secondRdnLdapAtt, - secondUuidLdapAtt, - secondUserObjClasses, - ); - providersPage.save(provider); - masthead.checkNotificationMessage(createdSuccessMessage); - sidebarPage.goToUserFederation(); - }); - - it("Should delete LDAP provider from card view using card menu", () => { - providersPage.deleteCardFromCard(secondLdapName); - modalUtils.checkModalTitle(deleteModalTitle).confirmModal(); - masthead.checkNotificationMessage(deletedSuccessMessage); - }); - - it("Should delete LDAP provider using Settings view Action menu", () => { - providersPage.deleteCardFromMenu(firstLdapName); - modalUtils.checkModalTitle(deleteModalTitle).confirmModal(); - masthead.checkNotificationMessage(deletedSuccessMessage); - }); -}); diff --git a/js/apps/admin-ui/cypress/e2e/user_fed_test.spec.ts b/js/apps/admin-ui/cypress/e2e/user_fed_test.spec.ts deleted file mode 100644 index ad435bc12ff..00000000000 --- a/js/apps/admin-ui/cypress/e2e/user_fed_test.spec.ts +++ /dev/null @@ -1,19 +0,0 @@ -import LoginPage from "../support/pages/LoginPage"; -import SidebarPage from "../support/pages/admin-ui/SidebarPage"; -import { keycloakBefore } from "../support/util/keycloak_hooks"; - -const loginPage = new LoginPage(); -const sidebarPage = new SidebarPage(); - -describe("Accessibility tests for user federation", () => { - beforeEach(() => { - loginPage.logIn(); - keycloakBefore(); - sidebarPage.goToUserFederation(); - cy.injectAxe(); - }); - - it("Check a11y violations on load/ user federation", () => { - cy.checkA11y(); - }); -}); diff --git a/js/apps/admin-ui/cypress/e2e/users_attribute_search_test.spec.ts b/js/apps/admin-ui/cypress/e2e/users_attribute_search_test.spec.ts deleted file mode 100644 index 1fd5bb133a0..00000000000 --- a/js/apps/admin-ui/cypress/e2e/users_attribute_search_test.spec.ts +++ /dev/null @@ -1,100 +0,0 @@ -import SidebarPage from "../support/pages/admin-ui/SidebarPage"; -import LoginPage from "../support/pages/LoginPage"; -import { keycloakBefore } from "../support/util/keycloak_hooks"; -import adminClient from "../support/util/AdminClient"; -import { - DefaultUserAttribute, - UserFilterType, -} from "../support/pages/admin-ui/manage/users/UsersListingPage"; -import UsersPage from "../support/pages/admin-ui/manage/users/UsersPage"; - -describe("Query by user attributes", () => { - const loginPage = new LoginPage(); - const sidebarPage = new SidebarPage(); - const usersPage = new UsersPage(); - const listingPage = usersPage.listing(); - - const emailSuffix = "@example.org"; - - const user1Username = "user-attrs-1"; - const user1FirstName = "John"; - const user1LastName = "Doe"; - const user1Pwd = "pwd"; - const user2Username = "user-attrs-2"; - const user2FirstName = "Jane"; - const user2LastName = user1LastName; - - before(async () => { - await cleanupTestData(); - const user1 = await adminClient.createUser({ - username: user1Username, - credentials: [ - { - type: "password", - value: user1Pwd, - }, - ], - email: user1Username + emailSuffix, - firstName: user1FirstName, - lastName: user1LastName, - enabled: true, - }); - const user1Id = user1.id!; - await adminClient.addClientRoleToUser(user1Id, "master-realm", [ - "view-users", - ]); - - await adminClient.createUser({ - username: user2Username, - email: user2Username + emailSuffix, - firstName: user2FirstName, - lastName: user2LastName, - enabled: true, - }); - }); - - beforeEach(() => { - loginPage.logIn(user1Username, user1Pwd); - keycloakBefore(); - sidebarPage.goToUsers(); - }); - - after(async () => { - await cleanupTestData(); - }); - - async function cleanupTestData() { - await adminClient.deleteUser(user1Username, true); - await adminClient.deleteUser(user2Username, true); - } - - it("Query with one attribute condition", () => { - listingPage - .selectUserSearchFilter(UserFilterType.AttributeSearch) - .openUserAttributesSearchForm() - .addUserAttributeSearchCriteria( - DefaultUserAttribute.lastName, - user1LastName, - ) - .triggerAttributesSearch() - .itemExist(user1Username, true) - .itemExist(user2Username, true); - }); - - it("Query with two attribute conditions", () => { - listingPage - .selectUserSearchFilter(UserFilterType.AttributeSearch) - .openUserAttributesSearchForm() - .addUserAttributeSearchCriteria( - DefaultUserAttribute.lastName, - user1LastName, - ) - .addUserAttributeSearchCriteria( - DefaultUserAttribute.firstName, - user1FirstName, - ) - .triggerAttributesSearch() - .itemExist(user1Username, true) - .itemExist(user2Username, false); - }); -}); diff --git a/js/apps/admin-ui/cypress/e2e/users_enable_disable.spec.ts b/js/apps/admin-ui/cypress/e2e/users_enable_disable.spec.ts deleted file mode 100644 index 10b132ab23f..00000000000 --- a/js/apps/admin-ui/cypress/e2e/users_enable_disable.spec.ts +++ /dev/null @@ -1,84 +0,0 @@ -import UserRepresentation from "@keycloak/keycloak-admin-client/lib/defs/userRepresentation"; -import LoginPage from "../support/pages/LoginPage"; -import Masthead from "../support/pages/admin-ui/Masthead"; -import SidebarPage from "../support/pages/admin-ui/SidebarPage"; -import UsersPage from "../support/pages/admin-ui/manage/users/UsersPage"; -import UserDetailsPage from "../support/pages/admin-ui/manage/users/user_details/UserDetailsPage"; -import adminClient from "../support/util/AdminClient"; -import ModalUtils from "../support/util/ModalUtils"; -import { keycloakBefore } from "../support/util/keycloak_hooks"; - -const loginPage = new LoginPage(); -const sidebarPage = new SidebarPage(); -const usersPage = new UsersPage(); -const userDetailsPage = new UserDetailsPage(); -const masthead = new Masthead(); -const modal = new ModalUtils(); - -const createUser = (fields: UserRepresentation) => - cy - .wrap(null) - .then(() => - adminClient.createUser({ username: crypto.randomUUID(), ...fields }), - ); - -const deleteUser = (username: string) => - cy.wrap(null).then(() => adminClient.deleteUser(username)); - -describe("User enable/disable", () => { - beforeEach(() => { - loginPage.logIn(); - keycloakBefore(); - sidebarPage.goToUsers(); - }); - - it("disables a user", () => { - createUser({ enabled: true }).then(({ username }) => { - usersPage.goToUserDetailsPage(username!); - userDetailsPage.assertEnabled(username!); - - userDetailsPage.toggleEnabled(username!); - modal.confirmModal(); - masthead.checkNotificationMessage("The user has been saved"); - cy.wait(1000); - userDetailsPage.assertDisabled(username!); - - return deleteUser(username!); - }); - }); - - it("enables a user", () => { - createUser({ enabled: false }).then(({ username }) => { - usersPage.goToUserDetailsPage(username!); - userDetailsPage.assertDisabled(username!); - - userDetailsPage.toggleEnabled(username!); - masthead.checkNotificationMessage("The user has been saved"); - cy.wait(1000); - userDetailsPage.assertEnabled(username!); - - return deleteUser(username!); - }); - }); - - // See: https://github.com/keycloak/keycloak/issues/19647 - it("ensures submitting doesn't reset the enabled state", () => { - createUser({ enabled: true }).then(({ username }) => { - usersPage.goToUserDetailsPage(username!); - userDetailsPage.assertEnabled(username!); - - userDetailsPage.toggleEnabled(username!); - modal.confirmModal(); - masthead.checkNotificationMessage("The user has been saved"); - cy.wait(1000); - userDetailsPage.assertDisabled(username!); - - userDetailsPage.save(); - masthead.checkNotificationMessage("The user has been saved"); - cy.wait(1000); - userDetailsPage.assertDisabled(username!); - - return deleteUser(username!); - }); - }); -}); diff --git a/js/apps/admin-ui/cypress/e2e/users_test.spec.ts b/js/apps/admin-ui/cypress/e2e/users_test.spec.ts deleted file mode 100644 index d4b6a2abcad..00000000000 --- a/js/apps/admin-ui/cypress/e2e/users_test.spec.ts +++ /dev/null @@ -1,626 +0,0 @@ -import SidebarPage from "../support/pages/admin-ui/SidebarPage"; -import LoginPage from "../support/pages/LoginPage"; -import RealmSettingsPage from "../support/pages/admin-ui/manage/realm_settings/RealmSettingsPage"; -import CreateUserPage from "../support/pages/admin-ui/manage/users/CreateUserPage"; -import Masthead from "../support/pages/admin-ui/Masthead"; -import ListingPage from "../support/pages/admin-ui/ListingPage"; -import UserDetailsPage from "../support/pages/admin-ui/manage/users/user_details/UserDetailsPage"; -import AttributesTab from "../support/pages/admin-ui/manage/AttributesTab"; -import ModalUtils from "../support/util/ModalUtils"; -import { keycloakBefore } from "../support/util/keycloak_hooks"; -import UserGroupsPage from "../support/pages/admin-ui/manage/users/UserGroupsPage"; -import adminClient from "../support/util/AdminClient"; -import CredentialsPage from "../support/pages/admin-ui/manage/users/CredentialsPage"; -import UsersPage from "../support/pages/admin-ui/manage/users/UsersPage"; -import IdentityProviderLinksTab from "../support/pages/admin-ui/manage/users/user_details/tabs/IdentityProviderLinksTab"; -import RoleMappingTab from "../support/pages/admin-ui/manage/RoleMappingTab"; -import CommonPage from "../support/pages/CommonPage"; - -let groupName = "group"; -let groupsList: string[] = []; - -describe("User creation", () => { - const loginPage = new LoginPage(); - const sidebarPage = new SidebarPage(); - const realmSettingsPage = new RealmSettingsPage(); - const createUserPage = new CreateUserPage(); - const userGroupsPage = new UserGroupsPage(); - const masthead = new Masthead(); - const modalUtils = new ModalUtils(); - const listingPage = new ListingPage(); - const userDetailsPage = new UserDetailsPage(); - const credentialsPage = new CredentialsPage(); - const attributesTab = new AttributesTab(true); - const usersPage = new UsersPage(); - const identityProviderLinksTab = new IdentityProviderLinksTab(); - - let itemId = "user_crud"; - let itemIdWithGroups = "user_with_groups_crud"; - let itemIdWithCred = "user_crud_cred"; - const itemCredential = "Password"; - - before(async () => { - for (let i = 0; i <= 2; i++) { - groupName += "_" + crypto.randomUUID(); - await adminClient.createGroup(groupName); - groupsList = [...groupsList, groupName]; - } - }); - - beforeEach(() => { - loginPage.logIn(); - keycloakBefore(); - sidebarPage.goToUsers(); - }); - - after(() => adminClient.deleteGroups()); - - it("Go to create User page", () => { - createUserPage.goToCreateUser(); - cy.url().should("include", "users/add-user"); - - // Verify Cancel button works - createUserPage.cancel(); - cy.url().should("not.include", "/add-user"); - }); - - it("Create user test", () => { - itemId += "_" + crypto.randomUUID(); - // Create - createUserPage.goToCreateUser(); - - createUserPage.createUser(itemId); - - createUserPage.create(); - - masthead.checkNotificationMessage("The user has been created"); - }); - - it("Should check temporary admin user existence", () => { - const commonPage = new CommonPage(); - - // check banner visibility first - cy.get(".pf-v5-c-banner").should( - "contain.text", - "You are logged in as a temporary admin user.", - ); - - commonPage.tableToolbarUtils().searchItem("admin", false); - commonPage.tableUtils().checkRowItemExists("admin"); - commonPage - .tableUtils() - .checkTemporaryAdminLabelExists("temporary-admin-label"); - }); - - it("Create user with groups test", () => { - itemIdWithGroups += crypto.randomUUID(); - // Add user from search bar - createUserPage.goToCreateUser(); - - createUserPage.createUser(itemIdWithGroups); - - createUserPage.toggleAddGroupModal(); - - const groupsListCopy = groupsList.slice(0, 1); - - groupsListCopy.forEach((element) => { - cy.findByTestId(`${element}-check`).click(); - }); - - createUserPage.joinGroups(); - - createUserPage.create(); - - masthead.checkNotificationMessage("The user has been created"); - }); - - it("Create user with credentials test", () => { - itemIdWithCred += "_" + crypto.randomUUID(); - - // Add user from search bar - createUserPage.goToCreateUser(); - - createUserPage.createUser(itemIdWithCred); - - userDetailsPage.fillUserData(); - createUserPage.create(); - masthead.checkNotificationMessage("The user has been created"); - sidebarPage.waitForPageLoad(); - - credentialsPage - .goToCredentialsTab() - .clickEmptyStatePasswordBtn() - .fillPasswordForm() - .clickConfirmationBtn() - .clickSetPasswordBtn(); - }); - - it("Search existing user test", () => { - listingPage.searchItem(itemId).itemExist(itemId); - }); - - it("Search non-existing user test", () => { - listingPage.searchItem("user_DNE"); - listingPage.assertNoResults(); - }); - - it("User details test", () => { - sidebarPage.waitForPageLoad(); - listingPage.searchItem(itemId).itemExist(itemId); - - listingPage.goToItemDetails(itemId); - - userDetailsPage.fillUserData().save(); - - masthead.checkNotificationMessage("The user has been saved"); - - sidebarPage.waitForPageLoad(); - sidebarPage.goToUsers(); - listingPage.searchItem(itemId).itemExist(itemId); - }); - - it("Select Unmanaged attributes", () => { - sidebarPage.goToRealmSettings(); - sidebarPage.waitForPageLoad(); - realmSettingsPage.fillUnmanagedAttributes("Enabled"); - realmSettingsPage.save(realmSettingsPage.generalSaveBtn); - masthead.checkNotificationMessage("Realm successfully updated", true); - }); - - it("User attributes test", () => { - listingPage.goToItemDetails(itemId); - - attributesTab - .goToAttributesTab() - .addAttribute("key_test", "value_test") - .save(); - - masthead.checkNotificationMessage("The user has been saved"); - - attributesTab - .addAttribute("LDAP_ID", "value_test") - .addAttribute("LDAP_ID", "another_value_test") - .addAttribute("c", "d") - .save(); - - masthead.checkNotificationMessage("The user has not been saved: "); - - cy.get(".pf-v5-c-helper-text__item-text") - .filter(':contains("Update of read-only attribute rejected")') - .should("have.length", 2); - - cy.reload(); - - userDetailsPage.goToDetailsTab(); - attributesTab - .goToAttributesTab() - .checkAttribute("key_test", true) - .deleteAttribute(0); - - userDetailsPage.goToDetailsTab(); - attributesTab.goToAttributesTab().checkAttribute("key_test", false); - }); - - it("User attributes with multiple values test", () => { - listingPage.searchItem(itemId).itemExist(itemId); - listingPage.goToItemDetails(itemId); - - cy.intercept("PUT", `/admin/realms/master/users/*`).as("save-user"); - - const attributeKey = "key-multiple"; - attributesTab - .goToAttributesTab() - .addAttribute(attributeKey, "other value") - .save(); - - masthead.checkNotificationMessage("The user has been saved"); - - cy.wait("@save-user").should(({ request, response }) => { - expect(response?.statusCode).to.equal(204); - expect(request.body.attributes, "response body").deep.contains({ - "key-multiple": ["other value"], - }); - }); - }); - - it("Add user to groups test", () => { - // Go to user groups - listingPage.searchItem(itemId).itemExist(itemId); - listingPage.goToItemDetails(itemId); - - userGroupsPage.goToGroupsTab(); - userGroupsPage.toggleAddGroupModal(); - - const groupsListCopy = groupsList.slice(0, 3); - - groupsListCopy.forEach((element) => { - cy.findByTestId(`${element}-check`).click(); - }); - - userGroupsPage.joinGroups(); - }); - - it("Leave group test", () => { - listingPage.searchItem(itemId).itemExist(itemId); - listingPage.goToItemDetails(itemId); - // Go to user groups - userGroupsPage.goToGroupsTab(); - cy.findByTestId(`leave-${groupsList[0]}`).click(); - cy.findByTestId("confirm").click({ force: true }); - }); - - it("search and leave group", () => { - listingPage.searchItem(itemId).itemExist(itemId); - listingPage.goToItemDetails(itemId); - userGroupsPage.goToGroupsTab(); - - listingPage.searchItem("group"); - userGroupsPage.leaveGroupButtonDisabled(); - - listingPage.clickTableHeaderItemCheckboxAllRows(); - userGroupsPage.leaveGroupButtonEnabled(); - userGroupsPage.leaveGroup(); - }); - - it("Go to user consents test", () => { - listingPage.searchItem(itemId).itemExist(itemId); - - sidebarPage.waitForPageLoad(); - listingPage.goToItemDetails(itemId); - - cy.findByTestId("user-consents-tab").click(); - cy.findByTestId("empty-state").contains("No consents"); - }); - - describe("Identity provider links", () => { - const usernameIdpLinksTest = "user_idp_link_test"; - const identityProviders = [ - { testName: "Bitbucket", displayName: "BitBucket", alias: "bitbucket" }, - { testName: "Facebook", displayName: "Facebook", alias: "facebook" }, - { - testName: "Keycloak-oidc", - displayName: "Keycloak OpenID Connect", - alias: "keycloak-oidc", - }, - ]; - - before(async () => { - await Promise.all([ - adminClient.createUser({ - username: usernameIdpLinksTest, - enabled: true, - }), - identityProviders.forEach((idp) => - adminClient.createIdentityProvider(idp.displayName, idp.alias), - ), - ]); - }); - - after(async () => { - await adminClient.deleteUser(usernameIdpLinksTest); - await Promise.all( - identityProviders.map((idp) => - adminClient.deleteIdentityProvider(idp.alias), - ), - ); - }); - - beforeEach(() => { - usersPage.goToUserListTab().goToUserDetailsPage(usernameIdpLinksTest); - userDetailsPage.goToIdentityProviderLinksTab(); - }); - - identityProviders.forEach(($idp, linkedIdpsCount) => { - it(`Link account to IdP: ${$idp.testName}`, () => { - const availableIdpsCount = identityProviders.length - linkedIdpsCount; - - if (linkedIdpsCount == 0) { - identityProviderLinksTab.assertNoIdentityProvidersLinkedMessageExist( - true, - ); - } - identityProviderLinksTab - .assertAvailableIdentityProvidersItemsEqual(availableIdpsCount) - .clickLinkAccount($idp.testName) - .assertLinkAccountModalTitleEqual($idp.testName) - .assertLinkAccountModalIdentityProviderInputEqual($idp.testName) - .typeLinkAccountModalUserId("testUserId") - .typeLinkAccountModalUsername("testUsername") - .clickLinkAccountModalLinkBtn() - .assertNotificationIdentityProviderLinked() - .assertLinkedIdentityProvidersItemsEqual(linkedIdpsCount + 1) - .assertAvailableIdentityProvidersItemsEqual(availableIdpsCount - 1) - .assertLinkedIdentityProviderExist($idp.testName, true) - .assertAvailableIdentityProviderExist($idp.testName, false); - if (availableIdpsCount - 1 == 0) { - identityProviderLinksTab.assertNoAvailableIdentityProvidersMessageExist( - true, - ); - } - }); - }); - - it("Link account to already added IdP fail", () => { - cy.wrap(null).then(() => - adminClient.unlinkAccountIdentityProvider( - usernameIdpLinksTest, - identityProviders[0].displayName, - ), - ); - - sidebarPage.goToUsers(); - usersPage.goToUserListTab().goToUserDetailsPage(usernameIdpLinksTest); - userDetailsPage.goToIdentityProviderLinksTab(); - - cy.wrap(null).then(() => - adminClient.linkAccountIdentityProvider( - usernameIdpLinksTest, - identityProviders[0].displayName, - ), - ); - - identityProviderLinksTab - .clickLinkAccount(identityProviders[0].testName) - .assertLinkAccountModalTitleEqual(identityProviders[0].testName) - .assertLinkAccountModalIdentityProviderInputEqual( - identityProviders[0].testName, - ) - .typeLinkAccountModalUserId("testUserId") - .typeLinkAccountModalUsername("testUsername") - .clickLinkAccountModalLinkBtn() - .assertNotificationAlreadyLinkedError(); - modalUtils.cancelModal(); - }); - - identityProviders.forEach(($idp, availableIdpsCount) => { - it(`Unlink account from IdP: ${$idp.testName}`, () => { - const linkedIdpsCount = identityProviders.length - availableIdpsCount; - - if (availableIdpsCount == 0) { - identityProviderLinksTab.assertNoAvailableIdentityProvidersMessageExist( - true, - ); - } - identityProviderLinksTab - .assertAvailableIdentityProvidersItemsEqual(availableIdpsCount) - .clickUnlinkAccount($idp.testName) - .assertUnLinkAccountModalTitleEqual($idp.testName) - .clickUnlinkAccountModalUnlinkBtn() - .assertNotificationPoviderLinkRemoved() - .assertLinkedIdentityProvidersItemsEqual(linkedIdpsCount - 1) - .assertAvailableIdentityProvidersItemsEqual(availableIdpsCount + 1) - .assertLinkedIdentityProviderExist($idp.testName, false) - .assertAvailableIdentityProviderExist($idp.testName, true); - if (linkedIdpsCount - 1 == 0) { - identityProviderLinksTab.assertNoIdentityProvidersLinkedMessageExist( - true, - ); - } - }); - }); - }); - - it("Reset credential of User with empty state", () => { - listingPage.goToItemDetails(itemId); - credentialsPage - .goToCredentialsTab() - .clickEmptyStateResetBtn() - .fillResetCredentialForm(); - masthead.checkNotificationMessage( - "Failed: Failed to send execute actions email", - ); - }); - - it("Reset credential of User with existing credentials", () => { - listingPage.goToItemDetails(itemIdWithCred); - credentialsPage - .goToCredentialsTab() - .clickResetBtn() - .fillResetCredentialForm(); - - masthead.checkNotificationMessage( - "Failed: Failed to send execute actions email", - ); - }); - - it("Edit credential label", () => { - listingPage.goToItemDetails(itemIdWithCred); - credentialsPage - .goToCredentialsTab() - .clickEditCredentialLabelBtn() - .fillEditCredentialForm() - .clickEditConfirmationBtn(); - - masthead.checkNotificationMessage( - "The user label has been changed successfully.", - ); - }); - - it("Show credential data dialog", () => { - listingPage.goToItemDetails(itemIdWithCred); - credentialsPage - .goToCredentialsTab() - .clickShowDataDialogBtn() - .clickCloseDataDialogBtn(); - }); - - it("Delete credential", () => { - listingPage.goToItemDetails(itemIdWithCred); - credentialsPage.goToCredentialsTab(); - - cy.wait(2000); - cy.get("table") - .contains(itemCredential) - .parentsUntil("tbody") - .find(".pf-v5-c-table__action .pf-v5-c-menu-toggle") - .click(); - cy.get("table").contains("Delete").click(); - modalUtils.checkModalTitle("Delete credentials?").confirmModal(); - - masthead.checkNotificationMessage( - "The credentials has been deleted successfully.", - ); - }); - - it("Delete user from search bar test", () => { - // Delete - sidebarPage.waitForPageLoad(); - - listingPage.searchItem(itemId).itemExist(itemId); - listingPage.deleteItemFromSearchBar(itemId); - - modalUtils.checkModalTitle("Delete user " + itemId + "?").confirmModal(); - - masthead.checkNotificationMessage("The user has been deleted"); - sidebarPage.waitForPageLoad(); - - listingPage.itemExist(itemId, false); - }); - - it("Delete user with groups test", () => { - // Delete - listingPage.deleteItem(itemIdWithGroups); - - modalUtils - .checkModalTitle("Delete user " + itemIdWithGroups + "?") - .confirmModal(); - - masthead.checkNotificationMessage("The user has been deleted"); - sidebarPage.waitForPageLoad(); - - listingPage.itemExist(itemIdWithGroups, false); - }); - - it("Delete user with credential test", () => { - // Delete - listingPage.deleteItem(itemIdWithCred); - - modalUtils - .checkModalTitle("Delete user " + itemIdWithCred + "?") - .confirmModal(); - - masthead.checkNotificationMessage("The user has been deleted"); - sidebarPage.waitForPageLoad(); - - listingPage.itemExist(itemIdWithCred, false); - }); - - describe("Accessibility tests for users", () => { - const a11yUser = "a11y-user"; - const role = "admin"; - const roleType = "roles"; - const roleMappingTab = new RoleMappingTab(""); - - beforeEach(() => { - loginPage.logIn(); - keycloakBefore(); - sidebarPage.goToUsers(); - cy.injectAxe(); - }); - - it("Check a11y violations on load/ users list", () => { - cy.checkA11y(); - }); - - it("Check a11y violations on empty create user form", () => { - createUserPage.goToCreateUser(); - cy.checkA11y(); - }); - - it("Check a11y violations on user details tab", () => { - createUserPage.goToCreateUser(); - createUserPage.createUser(a11yUser); - userDetailsPage.fillUserData(); - createUserPage.create(); - cy.checkA11y(); - }); - - it("Check a11y violations on user credentials tab setting a password", () => { - usersPage.goToUserListTab().goToUserDetailsPage(a11yUser); - credentialsPage.goToCredentialsTab(); - credentialsPage - .clickEmptyStatePasswordBtn() - .fillPasswordForm() - .clickConfirmationBtn() - .clickSetPasswordBtn(); - cy.checkA11y(); - }); - - it("Check a11y violations on user credentials tab resetting a password", () => { - usersPage.goToUserListTab().goToUserDetailsPage(a11yUser); - credentialsPage.goToCredentialsTab(); - credentialsPage.clickResetBtn(); - cy.checkA11y(); - modalUtils.cancelModal(); - }); - - it("Check a11y violations on user role mapping tab", () => { - usersPage.goToUserListTab().goToUserDetailsPage(a11yUser); - roleMappingTab.goToRoleMappingTab(); - cy.checkA11y(); - }); - - it("Check a11y violations on user role mapping tab assigning a role dialog", () => { - usersPage.goToUserListTab().goToUserDetailsPage(a11yUser); - roleMappingTab.goToRoleMappingTab(); - cy.findByTestId("assignRole").click(); - cy.checkA11y(); - roleMappingTab.changeRoleTypeFilter(roleType).selectRow(role).assign(); - }); - - it("Check a11y violations on user groups tab", () => { - usersPage.goToUserListTab().goToUserDetailsPage(a11yUser); - userGroupsPage.goToGroupsTab(); - cy.checkA11y(); - }); - - it("Check a11y violations on user groups tab joining group dialog", () => { - usersPage.goToUserListTab().goToUserDetailsPage(a11yUser); - userGroupsPage.goToGroupsTab(); - cy.findByTestId("no-groups-empty-action").click(); - cy.checkA11y(); - }); - - it("Check a11y violations on user groups tab joining group", () => { - usersPage.goToUserListTab().goToUserDetailsPage(a11yUser); - userGroupsPage.goToGroupsTab(); - cy.findByTestId("no-groups-empty-action").click(); - const groupsListCopy = groupsList.slice(0, 1); - groupsListCopy.forEach((element) => { - cy.findByTestId(`${element}-check`).click(); - }); - - createUserPage.joinGroups(); - cy.checkA11y(); - }); - - it("Check a11y violations on user consents tab", () => { - usersPage.goToUserListTab().goToUserDetailsPage(a11yUser); - userDetailsPage.goToConsentsTab(); - cy.checkA11y(); - }); - - it("Check a11y violations on user identity provider links tab", () => { - usersPage.goToUserListTab().goToUserDetailsPage(a11yUser); - userDetailsPage.goToIdentityProviderLinksTab(); - cy.checkA11y(); - }); - - it("Check a11y violations on user sessions tab", () => { - usersPage.goToUserListTab().goToUserDetailsPage(a11yUser); - userDetailsPage.goToSessionsTab(); - cy.checkA11y(); - }); - - it("Check a11y violations on user deleting dialog", () => { - const commonPage = new CommonPage(); - usersPage.goToUserListTab().goToUserDetailsPage(a11yUser); - commonPage - .actionToolbarUtils() - .clickActionToggleButton() - .clickDropdownItem("Delete"); - cy.checkA11y(); - cy.findByTestId("confirm").click(); - }); - }); -}); diff --git a/js/apps/admin-ui/cypress/fixtures/ldap/server.json b/js/apps/admin-ui/cypress/fixtures/ldap/server.json deleted file mode 100644 index 8198a5dffad..00000000000 --- a/js/apps/admin-ui/cypress/fixtures/ldap/server.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "port": 3004, - "searchBase": "dc=test" -} \ No newline at end of file diff --git a/js/apps/admin-ui/cypress/fixtures/ldap/users.json b/js/apps/admin-ui/cypress/fixtures/ldap/users.json deleted file mode 100644 index a5088e4944a..00000000000 --- a/js/apps/admin-ui/cypress/fixtures/ldap/users.json +++ /dev/null @@ -1,7 +0,0 @@ -[ - { - "dn": "cn=user,dc=test", - "objectClass": "person", - "cn": "user-login" - } -] \ No newline at end of file diff --git a/js/apps/admin-ui/cypress/fixtures/partial-import-test-data/kcexport.json b/js/apps/admin-ui/cypress/fixtures/partial-import-test-data/kcexport.json deleted file mode 100644 index c66bb12f049..00000000000 --- a/js/apps/admin-ui/cypress/fixtures/partial-import-test-data/kcexport.json +++ /dev/null @@ -1,5254 +0,0 @@ -[ { - "id" : "master", - "realm" : "master", - "notBefore" : 0, - "revokeRefreshToken" : false, - "accessTokenLifespan" : 60, - "ssoSessionIdleTimeout" : 1800, - "ssoSessionMaxLifespan" : 36000, - "offlineSessionIdleTimeout" : 2592000, - "accessCodeLifespan" : 60, - "accessCodeLifespanUserAction" : 300, - "accessCodeLifespanLogin" : 1800, - "enabled" : true, - "sslRequired" : "external", - "registrationAllowed" : false, - "registrationEmailAsUsername" : false, - "rememberMe" : false, - "verifyEmail" : false, - "resetPasswordAllowed" : false, - "editUsernameAllowed" : false, - "bruteForceProtected" : false, - "maxFailureWaitSeconds" : 900, - "minimumQuickLoginWaitSeconds" : 60, - "waitIncrementSeconds" : 60, - "quickLoginCheckMilliSeconds" : 1000, - "maxDeltaTimeSeconds" : 43200, - "failureFactor" : 30, - "privateKey" : "MIIEpAIBAAKCAQEAv5g6gYoRAknG5Ekq2k2WYACyM25mTsaSC3UOUve4Dc8zmfbyUwGShkVsaUmgTy/UiuEHzrJ0U8pWg+xjdXIosyuKR8eEhORtA3kxuMzsSb3F1FFdb8l8vgtVU9waG2Xc0mHUE0P9tRCXUgXp8kCv0zULfmqGvtNkl4oNnbOB6v7w9tYCCxGof5nZXBclSHqOj8H7dy4JxEV0PDNLh70Pc3ey4ZLrXBkeOxetZXwWsnshLghr3XkMNQwSsuMgjeL06E+uoNN9gTdez63Q4UrfRBMKbEepmRq0vmRk1fYVrI6roeqQfi6joZlDgQFE/8bKy1hCe3ZgzU+rF+PyXPU+KwIDAQABAoIBAD7ZNsfrfGzduqqD/dSiguN3Fv2cB19r79hmS46Xx/5vq6OjyBXGfEQjXc6j4jxXmkb8Tk1VaKdbxkl8L5wFGKi9bZziK+xT6harmM3gGtqNr+lXz2iuFYdZvGHH36CBJ5Czmpe/Q+gzSxAS9I0M/yAvVFfhpdXPDj5PgOvsSH/HE+/n7oH/rElWtFuTmby30BLfhTD5QGEtnrLG/Zzblro4XF9wyCgm/ovfl3aBweLYnYKsZOFQu+h8uDylTL/bCyFU5W9zskmFAbTaRZfj3xOYd95LrE+lvu0pvi2L9JowvnDn1lfwPLo5BK6CdaHJLhtsHeWWEV4qmsDApp4lu5ECgYEA5NzEnvREGp3+TLZG62X+1r/t89YnCCK2RtwaoQ/59LGiqGmay6EuKL99BwWLqwYyCuwF5IWYL23tf3HWWh+q+jAK7ZojolXsAMgVCrKQ0aoibaYw8DDJ2m4D5oXeyIlUeyMQwjTE3MxMmevk3x4PRm45qGmkEwSdsmZJiNFdaj0CgYEA1lAuCHIQeWlAsb/847ziBdloPK+AmHpDOpzInXdLmZSdu5FqO2S2oGCYTM0M4FFBDoCTeq0xRmlrTWKQlLx7Jy4cVC6c+RdwrDIuKuxJOXQHrD7FUDg03Kk0CVYXUsfB1ryOIIC7Mj0X5hrfbUkd86Au5nOccbIqWetE63P2mIcCgYEAoVT7ii4ZQEY1+O/ZqKF69vnPjT9evn5xzhvk7bsschEy39OqGnfh6TmrsmJ3ZbV1W3usX77JXE36yQd/moKObdWmLn6lNg+p0Zc6NhNQwWxU3sTz5K4P7Vn2h+/A787XbgJ3EuBOEnQ2X58J9Trke7rCDHWEAyAS5qrylW85keUCgYEAzVcLlCn+IOY5B1ZlbqtGgMY6+pJJi07x5VHdYgqwU9mye8orV/b6iJWkt0lsge04gTWumMcixE0zc3TyBKDG+tZSbFIxMvVDjqmR1KyKyFKlG2MVWPRRqe8xHZTwSe99iUsmfnv5YHxqzp2G38ZDvW8IIOQ6zDEiJP+oDFUSvDcCgYBlo+X4gou44GjeIWSKX0agVa6gi588tp4FALFQ55SomtJKbX1OozeEN+e9zVsL/25c4NDrp61WoaJGixPKhSMGJ0u+snsWaM+2wtGjVoxCUpMLcSXTHzT4YkUK21sU6+Yzdg8PnNVA1JaI4XKtxuKtaMA+VlXlqfQ3ImGZdn6YDw==", - "publicKey" : "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAv5g6gYoRAknG5Ekq2k2WYACyM25mTsaSC3UOUve4Dc8zmfbyUwGShkVsaUmgTy/UiuEHzrJ0U8pWg+xjdXIosyuKR8eEhORtA3kxuMzsSb3F1FFdb8l8vgtVU9waG2Xc0mHUE0P9tRCXUgXp8kCv0zULfmqGvtNkl4oNnbOB6v7w9tYCCxGof5nZXBclSHqOj8H7dy4JxEV0PDNLh70Pc3ey4ZLrXBkeOxetZXwWsnshLghr3XkMNQwSsuMgjeL06E+uoNN9gTdez63Q4UrfRBMKbEepmRq0vmRk1fYVrI6roeqQfi6joZlDgQFE/8bKy1hCe3ZgzU+rF+PyXPU+KwIDAQAB", - "certificate" : "MIICmzCCAYMCBgFQ9+hyuzANBgkqhkiG9w0BAQsFADARMQ8wDQYDVQQDDAZtYXN0ZXIwHhcNMTUxMTExMTg1NTE3WhcNMjUxMTExMTg1NjU3WjARMQ8wDQYDVQQDDAZtYXN0ZXIwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQC/mDqBihECScbkSSraTZZgALIzbmZOxpILdQ5S97gNzzOZ9vJTAZKGRWxpSaBPL9SK4QfOsnRTylaD7GN1ciizK4pHx4SE5G0DeTG4zOxJvcXUUV1vyXy+C1VT3BobZdzSYdQTQ/21EJdSBenyQK/TNQt+aoa+02SXig2ds4Hq/vD21gILEah/mdlcFyVIeo6Pwft3LgnERXQ8M0uHvQ9zd7LhkutcGR47F61lfBayeyEuCGvdeQw1DBKy4yCN4vToT66g032BN17PrdDhSt9EEwpsR6mZGrS+ZGTV9hWsjquh6pB+LqOhmUOBAUT/xsrLWEJ7dmDNT6sX4/Jc9T4rAgMBAAEwDQYJKoZIhvcNAQELBQADggEBABi3/VA3jKTNNdIfe/Il56Xfdgp/upBjw0er5nb2Jq/JuR4zZWAB3B+1wCO2ofBJZM9psXLd9HL3zvXct3eytisGp9gfRvZ+aL6kanhLdj3pF06NA2lIFkx292alYEDKF56GnCZlnCtF88j1kreXaOdkeUSjWlatVvEikRJUNTijiHLcX9XSBQ8qiDcdLu+DBrEWLmSnDNwWPKnWAz/w4ypVE4RxH3v0KYCDesv887fdWuLZmEyvFcc8sEwH4K7wj1vWUjSqSz+9uv7sqV/adPBMPkUeGeqsHkGu6Wn5JhaYHvrXsza5ZQ9H/X3BNmnp5JZCk17jWwjfiTRx0VtX7rM=", - "codeSecret" : "bc4719b1-5c6f-4b55-abe7-11a32dae080c", - "roles" : { - "realm" : [ { - "id" : "9d2638c8-4c62-4c42-90ea-5f3c836d0cc8", - "name" : "user", - "scopeParamRequired" : false, - "composite" : false - }, { - "id" : "e927db37-b0cc-4f84-be22-faa799666d26", - "name" : "offline_access", - "description" : "${role_offline-access}", - "scopeParamRequired" : true, - "composite" : false - }, { - "id" : "f02fcbcc-5c75-4cab-afc8-157c372a0d76", - "name" : "admin", - "description" : "${role_admin}", - "scopeParamRequired" : false, - "composite" : true, - "composites" : { - "realm" : [ "create-realm" ], - "client" : { - "mynewrealm-realm" : [ "create-client", "view-events", "manage-events", "view-realm", "view-identity-providers", "view-clients", "manage-realm", "manage-clients", "impersonation", "view-users", "manage-identity-providers", "manage-users" ], - "demo-realm" : [ "view-clients", "view-users", "manage-realm", "manage-clients", "impersonation", "view-identity-providers", "manage-events", "manage-identity-providers", "view-realm", "manage-users", "create-client", "view-events" ], - "master-realm" : [ "view-clients", "impersonation", "manage-users", "manage-clients", "view-identity-providers", "manage-identity-providers", "view-realm", "manage-realm", "create-client", "view-users", "manage-events", "view-events" ] - } - } - }, { - "id" : "2a800219-13dd-4c97-bdee-997bd07969c2", - "name" : "noncomposite", - "description" : "Non-composite role", - "scopeParamRequired" : true, - "composite" : false - }, { - "id" : "08eb0d05-9f8e-4958-822c-1083a90ff52f", - "name" : "create-realm", - "description" : "${role_create-realm}", - "scopeParamRequired" : false, - "composite" : false - } ], - "client" : { - "database-service" : [ ], - "admin-client" : [ ], - "customer-portal-js" : [ ], - "security-admin-console" : [ ], - "product-sa-client-jwt-auth" : [ ], - "demo-realm" : [ { - "id" : "4802ec90-93d9-4d5b-b3e9-9185f69e4c49", - "name" : "manage-realm", - "description" : "${role_manage-realm}", - "scopeParamRequired" : false, - "composite" : false - }, { - "id" : "85b2e5a2-f67a-43fa-a353-8fb899ac91b7", - "name" : "manage-identity-providers", - "description" : "${role_manage-identity-providers}", - "scopeParamRequired" : false, - "composite" : false - }, { - "id" : "29bf4122-efdd-473b-9282-c2936c649443", - "name" : "view-clients", - "description" : "${role_view-clients}", - "scopeParamRequired" : false, - "composite" : false - }, { - "id" : "c2f2b7b5-1105-4a53-94fe-b72dc652a2c1", - "name" : "view-users", - "description" : "${role_view-users}", - "scopeParamRequired" : false, - "composite" : false - }, { - "id" : "37758fcd-0aed-4a96-81fb-22d4ab99a8a6", - "name" : "view-realm", - "description" : "${role_view-realm}", - "scopeParamRequired" : false, - "composite" : false - }, { - "id" : "a54fb635-b965-4fe6-87de-c80908146021", - "name" : "impersonation", - "description" : "${role_impersonation}", - "scopeParamRequired" : false, - "composite" : false - }, { - "id" : "fd5e3cc1-78ba-4006-b716-c79adf103bcd", - "name" : "manage-clients", - "description" : "${role_manage-clients}", - "scopeParamRequired" : false, - "composite" : false - }, { - "id" : "7186dd05-7ac6-4ad6-9e53-06f0833912d0", - "name" : "view-identity-providers", - "description" : "${role_view-identity-providers}", - "scopeParamRequired" : false, - "composite" : false - }, { - "id" : "059a454c-955a-4d05-93b3-93f3131889e3", - "name" : "manage-users", - "description" : "${role_manage-users}", - "scopeParamRequired" : false, - "composite" : false - }, { - "id" : "afc291f4-eb9a-4e16-9da9-37925f17192e", - "name" : "create-client", - "description" : "${role_create-client}", - "scopeParamRequired" : false, - "composite" : false - }, { - "id" : "b6a26d5c-0ee9-4852-b81f-24ccdf157efa", - "name" : "view-events", - "description" : "${role_view-events}", - "scopeParamRequired" : false, - "composite" : false - }, { - "id" : "2315217d-3266-462f-b02f-6b17778a5b75", - "name" : "manage-events", - "description" : "${role_manage-events}", - "scopeParamRequired" : false, - "composite" : false - } ], - "angular-product" : [ ], - "product-sa-client" : [ ], - "master-realm" : [ { - "id" : "9bee5e34-444f-49d2-a772-7865bead3515", - "name" : "view-realm", - "description" : "${role_view-realm}", - "scopeParamRequired" : false, - "composite" : false - }, { - "id" : "20154625-4f8a-4787-b050-d8f1ba75950e", - "name" : "view-users", - "description" : "${role_view-users}", - "scopeParamRequired" : false, - "composite" : false - }, { - "id" : "18cbc727-544a-479d-9f09-c6f17c8c6b70", - "name" : "manage-events", - "description" : "${role_manage-events}", - "scopeParamRequired" : false, - "composite" : false - }, { - "id" : "70e573e9-d1e3-48e2-92f4-e1471303b81a", - "name" : "manage-users", - "description" : "${role_manage-users}", - "scopeParamRequired" : false, - "composite" : false - }, { - "id" : "5de4c4ff-bd14-4e02-9407-b719b082b04e", - "name" : "view-clients", - "description" : "${role_view-clients}", - "scopeParamRequired" : false, - "composite" : false - }, { - "id" : "720bb2f3-a88d-428e-93c8-9b8233caa8e5", - "name" : "impersonation", - "description" : "${role_impersonation}", - "scopeParamRequired" : false, - "composite" : false - }, { - "id" : "acfc02b9-e18e-4931-ba2b-eb865b6373dc", - "name" : "manage-realm", - "description" : "${role_manage-realm}", - "scopeParamRequired" : false, - "composite" : false - }, { - "id" : "97d19f5a-382b-4c8e-b67e-f5d396371f87", - "name" : "manage-clients", - "description" : "${role_manage-clients}", - "scopeParamRequired" : false, - "composite" : false - }, { - "id" : "64649e1a-1d96-4610-a8f0-fbb0f091ca8f", - "name" : "view-events", - "description" : "${role_view-events}", - "scopeParamRequired" : false, - "composite" : false - }, { - "id" : "fc732649-6dda-435c-9fae-1fe2f9ad2176", - "name" : "view-identity-providers", - "description" : "${role_view-identity-providers}", - "scopeParamRequired" : false, - "composite" : false - }, { - "id" : "63ad6d6f-99fc-4048-ade9-06d837655c39", - "name" : "create-client", - "description" : "${role_create-client}", - "scopeParamRequired" : false, - "composite" : false - }, { - "id" : "5246c662-e043-4a4e-8db8-b9d62a8e7b5b", - "name" : "manage-identity-providers", - "description" : "${role_manage-identity-providers}", - "scopeParamRequired" : false, - "composite" : false - } ], - "broker" : [ { - "id" : "b80f960c-c4db-4d3d-a76d-bf6de7462909", - "name" : "read-token", - "description" : "${role_read-token}", - "scopeParamRequired" : false, - "composite" : false - } ], - "customer-portal-cli" : [ ], - "customer-portal" : [ ], - "mynewrealm-realm" : [ { - "id" : "d6147a85-57ea-4664-ae4c-eca82aa4033b", - "name" : "impersonation", - "description" : "${role_impersonation}", - "scopeParamRequired" : false, - "composite" : false - }, { - "id" : "b20e77e6-1163-4833-a637-7794244d4f15", - "name" : "view-clients", - "description" : "${role_view-clients}", - "scopeParamRequired" : false, - "composite" : false - }, { - "id" : "cd1dd572-6bd5-4409-81a8-f4dce75e7600", - "name" : "view-events", - "description" : "${role_view-events}", - "scopeParamRequired" : false, - "composite" : false - }, { - "id" : "4d5cd5db-51ae-4d18-86a3-1987222607ee", - "name" : "view-users", - "description" : "${role_view-users}", - "scopeParamRequired" : false, - "composite" : false - }, { - "id" : "bf693edd-8a74-45a0-9775-b65357e5398f", - "name" : "manage-identity-providers", - "description" : "${role_manage-identity-providers}", - "scopeParamRequired" : false, - "composite" : false - }, { - "id" : "eba019b2-14c5-4951-9fd0-4801dbd74cba", - "name" : "manage-events", - "description" : "${role_manage-events}", - "scopeParamRequired" : false, - "composite" : false - }, { - "id" : "98d2be44-ebd2-4d93-b348-2aa197ce3538", - "name" : "create-client", - "description" : "${role_create-client}", - "scopeParamRequired" : false, - "composite" : false - }, { - "id" : "9ce9c2f4-872d-476e-9bf3-975eb0220593", - "name" : "manage-realm", - "description" : "${role_manage-realm}", - "scopeParamRequired" : false, - "composite" : false - }, { - "id" : "474ce253-d224-443f-b5b2-ad80a226b91a", - "name" : "view-realm", - "description" : "${role_view-realm}", - "scopeParamRequired" : false, - "composite" : false - }, { - "id" : "7fa87f28-ad3e-4372-b262-f023726d6a5a", - "name" : "view-identity-providers", - "description" : "${role_view-identity-providers}", - "scopeParamRequired" : false, - "composite" : false - }, { - "id" : "5e289465-611c-4ecc-9256-c88b4e4f61fa", - "name" : "manage-users", - "description" : "${role_manage-users}", - "scopeParamRequired" : false, - "composite" : false - }, { - "id" : "cfc28d0b-78b6-49d3-aa01-b0f2f6cea71e", - "name" : "manage-clients", - "description" : "${role_manage-clients}", - "scopeParamRequired" : false, - "composite" : false - } ], - "product-portal" : [ ], - "account" : [ { - "id" : "8dfe4967-259f-453f-9193-a60f845e3396", - "name" : "manage-account", - "description" : "${role_manage-account}", - "scopeParamRequired" : false, - "composite" : false - }, { - "id" : "e494be2d-f5a7-43e1-924b-97fb75e07a1a", - "name" : "view-profile", - "description" : "${role_view-profile}", - "scopeParamRequired" : false, - "composite" : false - } ], - "third-party" : [ ], - "offline-access-portal" : [ ] - } - }, - "defaultRoles" : [ "offline_access" ], - "requiredCredentials" : [ "password" ], - "otpPolicyType" : "totp", - "otpPolicyAlgorithm" : "HmacSHA1", - "otpPolicyInitialCounter" : 0, - "otpPolicyDigits" : 6, - "otpPolicyLookAheadWindow" : 1, - "otpPolicyPeriod" : 30, - "users" : [ { - "id" : "ccee8213-15b0-4d38-bcb3-209cd563c743", - "createdTimestamp" : 1447268217566, - "username" : "admin", - "enabled" : true, - "totp" : false, - "emailVerified" : false, - "credentials" : [ { - "type" : "password", - "hashedSaltedValue" : "CFazI0ssShxu8szLm2bwLP+N8Dk+5PEspbpwtSgtkFrS7Lvq1XBTusbgJZg8LycST/fhUy7v0TAqPqPFBBU0Sw==", - "salt" : "97EXNDYXHkKehzFzXG/Fkg==", - "hashIterations" : 1, - "counter" : 0, - "digits" : 0, - "temporary" : false - } ], - "requiredActions" : [ ], - "realmRoles" : [ "offline_access", "admin" ], - "clientRoles" : { - "account" : [ "manage-account", "view-profile" ] - } - }, { - "id" : "beb49335-bf91-4712-b93b-f338cad7468d", - "username" : "bburke@redhat.com", - "enabled" : true, - "totp" : false, - "emailVerified" : false, - "firstName" : "Bill", - "lastName" : "Burke", - "email" : "bburke@redhat.com", - "credentials" : [ { - "type" : "password", - "hashedSaltedValue" : "30gHSyQ9IMLJc9vrwJA12OjbisrWPvmiveCzqovMucz4fcE6I10Djzqfec88w0FhEnpps4RVr4vh9mGpIYgiAg==", - "salt" : "L3hlszVvFI7lqRCe36aqbQ==", - "hashIterations" : 1, - "counter" : 0, - "digits" : 0, - "temporary" : false - } ], - "requiredActions" : [ ], - "realmRoles" : [ "user", "offline_access" ], - "clientRoles" : { - "account" : [ "manage-account" ] - } - }, { - "id" : "79d481e3-6aab-412b-b6aa-00db7954dc89", - "username" : "mposolda@redhat.com", - "enabled" : true, - "totp" : false, - "emailVerified" : false, - "firstName" : "Marek", - "lastName" : "Posolda", - "email" : "mposolda@redhat.com", - "credentials" : [ { - "type" : "password", - "hashedSaltedValue" : "jzbNz54Ir/XrzcDNoHuySKRCrr7hFXs916jVzKlyIMvg5Cirzt1vP3F88nDkBe3QM2OEV/jvOAZeKFK6XPHcFg==", - "salt" : "V66xxpnBgW8mL96W5wkaOg==", - "hashIterations" : 1, - "counter" : 0, - "digits" : 0, - "temporary" : false - } ], - "requiredActions" : [ ], - "realmRoles" : [ "user", "offline_access" ], - "clientRoles" : { - "account" : [ "manage-account" ] - } - }, { - "id" : "5af5b260-17f0-42e2-8f26-fa4e009354cf", - "username" : "stian", - "enabled" : true, - "totp" : false, - "emailVerified" : false, - "firstName" : "Stian", - "lastName" : "Thorgersen", - "email" : "stian@redhat.com", - "credentials" : [ { - "type" : "password", - "hashedSaltedValue" : "v4oc+B7t/743QGFLH+Y3dnSRfjBDJEN7xS/komuwSDC5YKxHPw+V8SoM5OTIQjXAf2fbXr50evNvrPIW9RPg+g==", - "salt" : "y9//kWaEfX0dvLwQ6uOBdg==", - "hashIterations" : 1, - "counter" : 0, - "digits" : 0, - "temporary" : false - } ], - "requiredActions" : [ ], - "realmRoles" : [ "user", "offline_access" ], - "clientRoles" : { - "account" : [ "manage-account" ] - } - } ], - "scopeMappings" : [ { - "client" : "security-admin-console", - "roles" : [ "admin" ] - } ], - "clients" : [ { - "id" : "8e05994e-72a2-4c9a-b6c7-56f644a43a4f", - "clientId" : "database-service", - "adminUrl" : "/database", - "baseUrl" : "/database", - "surrogateAuthRequired" : false, - "enabled" : true, - "clientAuthenticatorType" : "client-secret", - "secret" : "8b62ff99-85b3-4e4e-ad35-5223ca0c0a85", - "redirectUris" : [ ], - "webOrigins" : [ ], - "notBefore" : 0, - "bearerOnly" : true, - "consentRequired" : false, - "serviceAccountsEnabled" : false, - "directGrantsOnly" : false, - "publicClient" : false, - "frontchannelLogout" : false, - "attributes" : { }, - "fullScopeAllowed" : true, - "nodeReRegistrationTimeout" : -1, - "protocolMappers" : [ { - "id" : "a2431032-7607-4a9e-a0c8-94627434eb4d", - "name" : "username", - "protocol" : "openid-connect", - "protocolMapper" : "oidc-usermodel-property-mapper", - "consentRequired" : true, - "consentText" : "${username}", - "config" : { - "user.attribute" : "username", - "id.token.claim" : "true", - "access.token.claim" : "true", - "claim.name" : "preferred_username", - "jsonType.label" : "String" - } - }, { - "id" : "ab49a828-f2a3-4d24-8e9b-a54cc762b368", - "name" : "given name", - "protocol" : "openid-connect", - "protocolMapper" : "oidc-usermodel-property-mapper", - "consentRequired" : true, - "consentText" : "${givenName}", - "config" : { - "user.attribute" : "firstName", - "id.token.claim" : "true", - "access.token.claim" : "true", - "claim.name" : "given_name", - "jsonType.label" : "String" - } - }, { - "id" : "cdb61022-c6ca-4bba-baef-5026ecf0a57f", - "name" : "email", - "protocol" : "openid-connect", - "protocolMapper" : "oidc-usermodel-property-mapper", - "consentRequired" : true, - "consentText" : "${email}", - "config" : { - "user.attribute" : "email", - "id.token.claim" : "true", - "access.token.claim" : "true", - "claim.name" : "email", - "jsonType.label" : "String" - } - }, { - "id" : "6a5f83b9-65b8-44cb-bdc8-72b650aa0b0f", - "name" : "full name", - "protocol" : "openid-connect", - "protocolMapper" : "oidc-full-name-mapper", - "consentRequired" : true, - "consentText" : "${fullName}", - "config" : { - "id.token.claim" : "true", - "access.token.claim" : "true" - } - }, { - "id" : "38df05fb-c4e2-45d0-bab5-b36b6dafb18c", - "name" : "family name", - "protocol" : "openid-connect", - "protocolMapper" : "oidc-usermodel-property-mapper", - "consentRequired" : true, - "consentText" : "${familyName}", - "config" : { - "user.attribute" : "lastName", - "id.token.claim" : "true", - "access.token.claim" : "true", - "claim.name" : "family_name", - "jsonType.label" : "String" - } - }, { - "id" : "38f98204-fced-4a04-bcef-3a41e35ee7f4", - "name" : "role list", - "protocol" : "saml", - "protocolMapper" : "saml-role-list-mapper", - "consentRequired" : false, - "config" : { - "single" : "false", - "attribute.nameformat" : "Basic", - "attribute.name" : "Role" - } - } ] - }, { - "id" : "3f15550f-f7cd-4bf9-a40a-801472b0d9b7", - "clientId" : "admin-client", - "surrogateAuthRequired" : false, - "enabled" : true, - "clientAuthenticatorType" : "client-secret", - "secret" : "29e8215e-786b-4e59-913f-5acfe2cecf9f", - "redirectUris" : [ ], - "webOrigins" : [ ], - "notBefore" : 0, - "bearerOnly" : false, - "consentRequired" : false, - "serviceAccountsEnabled" : false, - "directGrantsOnly" : true, - "publicClient" : true, - "frontchannelLogout" : false, - "attributes" : { }, - "fullScopeAllowed" : true, - "nodeReRegistrationTimeout" : -1, - "protocolMappers" : [ { - "id" : "6c0d2ecd-72d5-41ef-b376-0e6312f27a05", - "name" : "username", - "protocol" : "openid-connect", - "protocolMapper" : "oidc-usermodel-property-mapper", - "consentRequired" : true, - "consentText" : "${username}", - "config" : { - "user.attribute" : "username", - "id.token.claim" : "true", - "access.token.claim" : "true", - "claim.name" : "preferred_username", - "jsonType.label" : "String" - } - }, { - "id" : "3dc86deb-5316-45fc-9d2f-1cbe15e87492", - "name" : "email", - "protocol" : "openid-connect", - "protocolMapper" : "oidc-usermodel-property-mapper", - "consentRequired" : true, - "consentText" : "${email}", - "config" : { - "user.attribute" : "email", - "id.token.claim" : "true", - "access.token.claim" : "true", - "claim.name" : "email", - "jsonType.label" : "String" - } - }, { - "id" : "e3e0b3ab-fd1f-466c-b409-f880a005b2f7", - "name" : "role list", - "protocol" : "saml", - "protocolMapper" : "saml-role-list-mapper", - "consentRequired" : false, - "config" : { - "single" : "false", - "attribute.nameformat" : "Basic", - "attribute.name" : "Role" - } - }, { - "id" : "4fd81299-d1fd-4234-a245-60d9c68b1532", - "name" : "full name", - "protocol" : "openid-connect", - "protocolMapper" : "oidc-full-name-mapper", - "consentRequired" : true, - "consentText" : "${fullName}", - "config" : { - "id.token.claim" : "true", - "access.token.claim" : "true" - } - }, { - "id" : "1a311b3e-8556-4d47-b537-35352ed62506", - "name" : "given name", - "protocol" : "openid-connect", - "protocolMapper" : "oidc-usermodel-property-mapper", - "consentRequired" : true, - "consentText" : "${givenName}", - "config" : { - "user.attribute" : "firstName", - "id.token.claim" : "true", - "access.token.claim" : "true", - "claim.name" : "given_name", - "jsonType.label" : "String" - } - }, { - "id" : "8aa953e8-9f79-4f24-b293-1a0fe6a04442", - "name" : "family name", - "protocol" : "openid-connect", - "protocolMapper" : "oidc-usermodel-property-mapper", - "consentRequired" : true, - "consentText" : "${familyName}", - "config" : { - "user.attribute" : "lastName", - "id.token.claim" : "true", - "access.token.claim" : "true", - "claim.name" : "family_name", - "jsonType.label" : "String" - } - } ] - }, { - "id" : "bc403281-e651-479e-8130-84ccd37ad4a6", - "clientId" : "customer-portal-js", - "baseUrl" : "/customer-portal-js", - "surrogateAuthRequired" : false, - "enabled" : true, - "clientAuthenticatorType" : "client-secret", - "secret" : "77638937-f511-4b72-ae21-4382dfcfd1c2", - "redirectUris" : [ "/customer-portal-js/*" ], - "webOrigins" : [ ], - "notBefore" : 0, - "bearerOnly" : false, - "consentRequired" : false, - "serviceAccountsEnabled" : false, - "directGrantsOnly" : false, - "publicClient" : true, - "frontchannelLogout" : false, - "attributes" : { }, - "fullScopeAllowed" : true, - "nodeReRegistrationTimeout" : -1, - "protocolMappers" : [ { - "id" : "d89257ef-2883-4c0b-ab91-7b8b34a186ba", - "name" : "username", - "protocol" : "openid-connect", - "protocolMapper" : "oidc-usermodel-property-mapper", - "consentRequired" : true, - "consentText" : "${username}", - "config" : { - "user.attribute" : "username", - "id.token.claim" : "true", - "access.token.claim" : "true", - "claim.name" : "preferred_username", - "jsonType.label" : "String" - } - }, { - "id" : "ceb1fd0c-cf62-435e-bc51-05d4dfa2bc83", - "name" : "given name", - "protocol" : "openid-connect", - "protocolMapper" : "oidc-usermodel-property-mapper", - "consentRequired" : true, - "consentText" : "${givenName}", - "config" : { - "user.attribute" : "firstName", - "id.token.claim" : "true", - "access.token.claim" : "true", - "claim.name" : "given_name", - "jsonType.label" : "String" - } - }, { - "id" : "e0d0b086-b9c8-42a0-baf3-58135bc07374", - "name" : "email", - "protocol" : "openid-connect", - "protocolMapper" : "oidc-usermodel-property-mapper", - "consentRequired" : true, - "consentText" : "${email}", - "config" : { - "user.attribute" : "email", - "id.token.claim" : "true", - "access.token.claim" : "true", - "claim.name" : "email", - "jsonType.label" : "String" - } - }, { - "id" : "3d38e1e2-1218-4fb6-8811-20d420195b48", - "name" : "role list", - "protocol" : "saml", - "protocolMapper" : "saml-role-list-mapper", - "consentRequired" : false, - "config" : { - "single" : "false", - "attribute.nameformat" : "Basic", - "attribute.name" : "Role" - } - }, { - "id" : "1550b89e-103e-429e-8c94-4fa37ca190a7", - "name" : "full name", - "protocol" : "openid-connect", - "protocolMapper" : "oidc-full-name-mapper", - "consentRequired" : true, - "consentText" : "${fullName}", - "config" : { - "id.token.claim" : "true", - "access.token.claim" : "true" - } - }, { - "id" : "bda0c751-4647-4311-b941-f7bdc2853e95", - "name" : "family name", - "protocol" : "openid-connect", - "protocolMapper" : "oidc-usermodel-property-mapper", - "consentRequired" : true, - "consentText" : "${familyName}", - "config" : { - "user.attribute" : "lastName", - "id.token.claim" : "true", - "access.token.claim" : "true", - "claim.name" : "family_name", - "jsonType.label" : "String" - } - } ] - }, { - "id" : "5cbaa3f5-6b80-42b1-820e-3230e087060b", - "clientId" : "security-admin-console", - "name" : "${client_security-admin-console}", - "baseUrl" : "/auth/admin/master/console/index.html", - "surrogateAuthRequired" : false, - "enabled" : true, - "clientAuthenticatorType" : "client-secret", - "secret" : "a030f7d0-1d5d-4d4b-b3b0-8a62c95b8de1", - "redirectUris" : [ "/auth/admin/master/console/*" ], - "webOrigins" : [ ], - "notBefore" : 0, - "bearerOnly" : false, - "consentRequired" : false, - "serviceAccountsEnabled" : false, - "directGrantsOnly" : false, - "publicClient" : true, - "frontchannelLogout" : false, - "attributes" : { }, - "fullScopeAllowed" : false, - "nodeReRegistrationTimeout" : 0, - "protocolMappers" : [ { - "id" : "fd943e23-e057-4e3f-a42a-d8eabcec48ce", - "name" : "email", - "protocol" : "openid-connect", - "protocolMapper" : "oidc-usermodel-property-mapper", - "consentRequired" : true, - "consentText" : "${email}", - "config" : { - "user.attribute" : "email", - "id.token.claim" : "true", - "access.token.claim" : "true", - "claim.name" : "email", - "jsonType.label" : "String" - } - }, { - "id" : "8c6bace2-dae6-4420-a3e8-e279c91befcc", - "name" : "role list", - "protocol" : "saml", - "protocolMapper" : "saml-role-list-mapper", - "consentRequired" : false, - "config" : { - "single" : "false", - "attribute.nameformat" : "Basic", - "attribute.name" : "Role" - } - }, { - "id" : "2d95bda0-9d7a-4595-bb31-a15b0599f362", - "name" : "username", - "protocol" : "openid-connect", - "protocolMapper" : "oidc-usermodel-property-mapper", - "consentRequired" : true, - "consentText" : "${username}", - "config" : { - "user.attribute" : "username", - "id.token.claim" : "true", - "access.token.claim" : "true", - "claim.name" : "preferred_username", - "jsonType.label" : "String" - } - }, { - "id" : "bf6ef571-6383-42ac-bbb2-5df1eac7c560", - "name" : "family name", - "protocol" : "openid-connect", - "protocolMapper" : "oidc-usermodel-property-mapper", - "consentRequired" : true, - "consentText" : "${familyName}", - "config" : { - "user.attribute" : "lastName", - "id.token.claim" : "true", - "access.token.claim" : "true", - "claim.name" : "family_name", - "jsonType.label" : "String" - } - }, { - "id" : "0b051624-dc37-4452-88a6-937ea748f797", - "name" : "full name", - "protocol" : "openid-connect", - "protocolMapper" : "oidc-full-name-mapper", - "consentRequired" : true, - "consentText" : "${fullName}", - "config" : { - "id.token.claim" : "true", - "access.token.claim" : "true" - } - }, { - "id" : "14f935dc-0c92-496d-a911-d8f0036e69a3", - "name" : "locale", - "protocol" : "openid-connect", - "protocolMapper" : "oidc-usermodel-attribute-mapper", - "consentRequired" : false, - "consentText" : "${locale}", - "config" : { - "user.attribute" : "locale", - "id.token.claim" : "true", - "access.token.claim" : "true", - "claim.name" : "locale", - "jsonType.label" : "String" - } - }, { - "id" : "2a1b96b1-ee51-467a-8c41-c36386aabbec", - "name" : "given name", - "protocol" : "openid-connect", - "protocolMapper" : "oidc-usermodel-property-mapper", - "consentRequired" : true, - "consentText" : "${givenName}", - "config" : { - "user.attribute" : "firstName", - "id.token.claim" : "true", - "access.token.claim" : "true", - "claim.name" : "given_name", - "jsonType.label" : "String" - } - } ] - }, { - "id" : "8ad378b0-4641-4407-a6f6-b6d68f420335", - "clientId" : "product-sa-client-jwt-auth", - "surrogateAuthRequired" : false, - "enabled" : true, - "clientAuthenticatorType" : "client-jwt", - "secret" : "b8fd08bd-fa1e-44fd-a90d-403c81949ef2", - "redirectUris" : [ ], - "webOrigins" : [ ], - "notBefore" : 0, - "bearerOnly" : false, - "consentRequired" : false, - "serviceAccountsEnabled" : true, - "directGrantsOnly" : false, - "publicClient" : false, - "frontchannelLogout" : false, - "attributes" : { - "jwt.credential.certificate" : "MIICnTCCAYUCBgFPPLDaTzANBgkqhkiG9w0BAQsFADASMRAwDgYDVQQDDAdjbGllbnQxMB4XDTE1MDgxNzE3MjI0N1oXDTI1MDgxNzE3MjQyN1owEjEQMA4GA1UEAwwHY2xpZW50MTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAIUjjgv+V3s96O+Za9002Lp/trtGuHBeaeVL9dFKMKzO2MPqdRmHB4PqNlDdd28Rwf5Xn6iWdFpyUKOnI/yXDLhdcuFpR0sMNK/C9Lt+hSpPFLuzDqgtPgDotlMxiHIWDOZ7g9/gPYNXbNvjv8nSiyqoguoCQiiafW90bPHsiVLdP7ZIUwCcfi1qQm7FhxRJ1NiW5dvUkuCnnWEf0XR+Wzc5eC9EgB0taLFiPsSEIlWMm5xlahYyXkPdNOqZjiRnrTWm5Y4uk8ZcsD/KbPTf/7t7cQXipVaswgjdYi1kK2/zRwOhg1QwWFX/qmvdd+fLxV0R6VqRDhn7Qep2cxwMxLsCAwEAATANBgkqhkiG9w0BAQsFAAOCAQEAKE6OA46sf20bz8LZPoiNsqRwBUDkaMGXfnob7s/hJZIIwDEx0IAQ3uKsG7q9wb+aA6s+v7S340zb2k3IxuhFaHaZpAd4CyR5cn1FHylbzoZ7rI/3ASqHDqpljdJaFqPH+m7nZWtyDvtZf+gkZ8OjsndwsSBK1d/jMZPp29qYbl1+XfO7RCp/jDqro/R3saYFaIFiEZPeKn1hUJn6BO48vxH1xspSu9FmlvDOEAOz4AuM58z4zRMP49GcFdCWr1wkonJUHaSptJaQwmBwLFUkCbE5I1ixGMb7mjEud6Y5jhfzJiZMo2U8RfcjNbrN0diZl3jB6LQIwESnhYSghaTjNQ==" - }, - "fullScopeAllowed" : true, - "nodeReRegistrationTimeout" : -1, - "protocolMappers" : [ { - "id" : "aa8d820a-aee2-416f-a224-760622c5a40b", - "name" : "username", - "protocol" : "openid-connect", - "protocolMapper" : "oidc-usermodel-property-mapper", - "consentRequired" : true, - "consentText" : "${username}", - "config" : { - "user.attribute" : "username", - "id.token.claim" : "true", - "access.token.claim" : "true", - "claim.name" : "preferred_username", - "jsonType.label" : "String" - } - }, { - "id" : "0a7b32fe-b70e-4c04-8818-b3aa98b5ed09", - "name" : "role list", - "protocol" : "saml", - "protocolMapper" : "saml-role-list-mapper", - "consentRequired" : false, - "config" : { - "single" : "false", - "attribute.nameformat" : "Basic", - "attribute.name" : "Role" - } - }, { - "id" : "b897d187-147b-4d89-93b5-7990757df443", - "name" : "email", - "protocol" : "openid-connect", - "protocolMapper" : "oidc-usermodel-property-mapper", - "consentRequired" : true, - "consentText" : "${email}", - "config" : { - "user.attribute" : "email", - "id.token.claim" : "true", - "access.token.claim" : "true", - "claim.name" : "email", - "jsonType.label" : "String" - } - }, { - "id" : "6e08a310-1ba7-407c-9d40-bd9c76575c8b", - "name" : "family name", - "protocol" : "openid-connect", - "protocolMapper" : "oidc-usermodel-property-mapper", - "consentRequired" : true, - "consentText" : "${familyName}", - "config" : { - "user.attribute" : "lastName", - "id.token.claim" : "true", - "access.token.claim" : "true", - "claim.name" : "family_name", - "jsonType.label" : "String" - } - }, { - "id" : "5b862d4f-bb7a-46dd-a504-91a3481d963f", - "name" : "given name", - "protocol" : "openid-connect", - "protocolMapper" : "oidc-usermodel-property-mapper", - "consentRequired" : true, - "consentText" : "${givenName}", - "config" : { - "user.attribute" : "firstName", - "id.token.claim" : "true", - "access.token.claim" : "true", - "claim.name" : "given_name", - "jsonType.label" : "String" - } - }, { - "id" : "c446d029-6865-464a-8cfa-77f4965f8507", - "name" : "full name", - "protocol" : "openid-connect", - "protocolMapper" : "oidc-full-name-mapper", - "consentRequired" : true, - "consentText" : "${fullName}", - "config" : { - "id.token.claim" : "true", - "access.token.claim" : "true" - } - } ] - }, { - "id" : "bafaa6ac-6744-43db-96f7-dc1017d501d2", - "clientId" : "demo-realm", - "name" : "demo Realm", - "surrogateAuthRequired" : false, - "enabled" : true, - "clientAuthenticatorType" : "client-secret", - "secret" : "aad11539-ab30-4055-86b4-6e013c47a798", - "redirectUris" : [ ], - "webOrigins" : [ ], - "notBefore" : 0, - "bearerOnly" : true, - "consentRequired" : false, - "serviceAccountsEnabled" : false, - "directGrantsOnly" : false, - "publicClient" : false, - "frontchannelLogout" : false, - "attributes" : { }, - "fullScopeAllowed" : true, - "nodeReRegistrationTimeout" : 0, - "protocolMappers" : [ { - "id" : "fdf2c87a-0f41-4309-bcbc-5b56f5afedcb", - "name" : "role list", - "protocol" : "saml", - "protocolMapper" : "saml-role-list-mapper", - "consentRequired" : false, - "config" : { - "single" : "false", - "attribute.nameformat" : "Basic", - "attribute.name" : "Role" - } - }, { - "id" : "dcce2cdc-91e7-4f68-8d28-edd254cc519e", - "name" : "email", - "protocol" : "openid-connect", - "protocolMapper" : "oidc-usermodel-property-mapper", - "consentRequired" : true, - "consentText" : "${email}", - "config" : { - "user.attribute" : "email", - "id.token.claim" : "true", - "access.token.claim" : "true", - "claim.name" : "email", - "jsonType.label" : "String" - } - }, { - "id" : "60900478-3bc6-449a-af97-7f1f06be3fde", - "name" : "family name", - "protocol" : "openid-connect", - "protocolMapper" : "oidc-usermodel-property-mapper", - "consentRequired" : true, - "consentText" : "${familyName}", - "config" : { - "user.attribute" : "lastName", - "id.token.claim" : "true", - "access.token.claim" : "true", - "claim.name" : "family_name", - "jsonType.label" : "String" - } - }, { - "id" : "5f6e2e63-dd59-44bb-aaa3-908125b1e364", - "name" : "username", - "protocol" : "openid-connect", - "protocolMapper" : "oidc-usermodel-property-mapper", - "consentRequired" : true, - "consentText" : "${username}", - "config" : { - "user.attribute" : "username", - "id.token.claim" : "true", - "access.token.claim" : "true", - "claim.name" : "preferred_username", - "jsonType.label" : "String" - } - }, { - "id" : "8c82272b-6995-4dca-a63d-2cad8c8aa40d", - "name" : "given name", - "protocol" : "openid-connect", - "protocolMapper" : "oidc-usermodel-property-mapper", - "consentRequired" : true, - "consentText" : "${givenName}", - "config" : { - "user.attribute" : "firstName", - "id.token.claim" : "true", - "access.token.claim" : "true", - "claim.name" : "given_name", - "jsonType.label" : "String" - } - }, { - "id" : "8492bd07-2e76-41d7-b0b8-eca7e66f7e5e", - "name" : "full name", - "protocol" : "openid-connect", - "protocolMapper" : "oidc-full-name-mapper", - "consentRequired" : true, - "consentText" : "${fullName}", - "config" : { - "id.token.claim" : "true", - "access.token.claim" : "true" - } - } ] - }, { - "id" : "a1b3689c-53d2-4964-bc51-395afbd6be74", - "clientId" : "angular-product", - "baseUrl" : "/angular-product/index.html", - "surrogateAuthRequired" : false, - "enabled" : true, - "clientAuthenticatorType" : "client-secret", - "secret" : "d169d88a-ee90-4c3f-bd71-cb39a4163bed", - "redirectUris" : [ "/angular-product/*" ], - "webOrigins" : [ ], - "notBefore" : 0, - "bearerOnly" : false, - "consentRequired" : false, - "serviceAccountsEnabled" : false, - "directGrantsOnly" : false, - "publicClient" : true, - "frontchannelLogout" : false, - "attributes" : { }, - "fullScopeAllowed" : true, - "nodeReRegistrationTimeout" : -1, - "protocolMappers" : [ { - "id" : "5ae72e66-1840-411e-9b5f-a9567377944b", - "name" : "family name", - "protocol" : "openid-connect", - "protocolMapper" : "oidc-usermodel-property-mapper", - "consentRequired" : true, - "consentText" : "${familyName}", - "config" : { - "user.attribute" : "lastName", - "id.token.claim" : "true", - "access.token.claim" : "true", - "claim.name" : "family_name", - "jsonType.label" : "String" - } - }, { - "id" : "ab973b0f-084c-424b-a1f6-bb4a434a3196", - "name" : "full name", - "protocol" : "openid-connect", - "protocolMapper" : "oidc-full-name-mapper", - "consentRequired" : true, - "consentText" : "${fullName}", - "config" : { - "id.token.claim" : "true", - "access.token.claim" : "true" - } - }, { - "id" : "13085615-0774-4048-a618-6646a17ff0ea", - "name" : "username", - "protocol" : "openid-connect", - "protocolMapper" : "oidc-usermodel-property-mapper", - "consentRequired" : true, - "consentText" : "${username}", - "config" : { - "user.attribute" : "username", - "id.token.claim" : "true", - "access.token.claim" : "true", - "claim.name" : "preferred_username", - "jsonType.label" : "String" - } - }, { - "id" : "d83166f3-6247-4fb8-81e1-8dce9563ed18", - "name" : "email", - "protocol" : "openid-connect", - "protocolMapper" : "oidc-usermodel-property-mapper", - "consentRequired" : true, - "consentText" : "${email}", - "config" : { - "user.attribute" : "email", - "id.token.claim" : "true", - "access.token.claim" : "true", - "claim.name" : "email", - "jsonType.label" : "String" - } - }, { - "id" : "67f079b8-8f75-4e95-9fca-1e5d6259147a", - "name" : "role list", - "protocol" : "saml", - "protocolMapper" : "saml-role-list-mapper", - "consentRequired" : false, - "config" : { - "single" : "false", - "attribute.nameformat" : "Basic", - "attribute.name" : "Role" - } - }, { - "id" : "96b9c867-7b8a-4675-be15-a441a695692f", - "name" : "given name", - "protocol" : "openid-connect", - "protocolMapper" : "oidc-usermodel-property-mapper", - "consentRequired" : true, - "consentText" : "${givenName}", - "config" : { - "user.attribute" : "firstName", - "id.token.claim" : "true", - "access.token.claim" : "true", - "claim.name" : "given_name", - "jsonType.label" : "String" - } - } ] - }, { - "id" : "0d1c1818-cf28-4e5d-96b6-457a594122b9", - "clientId" : "product-sa-client", - "surrogateAuthRequired" : false, - "enabled" : true, - "clientAuthenticatorType" : "client-secret", - "secret" : "password", - "redirectUris" : [ ], - "webOrigins" : [ ], - "notBefore" : 0, - "bearerOnly" : false, - "consentRequired" : false, - "serviceAccountsEnabled" : true, - "directGrantsOnly" : false, - "publicClient" : false, - "frontchannelLogout" : false, - "attributes" : { }, - "fullScopeAllowed" : true, - "nodeReRegistrationTimeout" : -1, - "protocolMappers" : [ { - "id" : "3d797492-d90b-4b3e-a325-f23605cb577b", - "name" : "full name", - "protocol" : "openid-connect", - "protocolMapper" : "oidc-full-name-mapper", - "consentRequired" : true, - "consentText" : "${fullName}", - "config" : { - "id.token.claim" : "true", - "access.token.claim" : "true" - } - }, { - "id" : "09331df8-260e-4581-b922-3a8c8c3ded0e", - "name" : "given name", - "protocol" : "openid-connect", - "protocolMapper" : "oidc-usermodel-property-mapper", - "consentRequired" : true, - "consentText" : "${givenName}", - "config" : { - "user.attribute" : "firstName", - "id.token.claim" : "true", - "access.token.claim" : "true", - "claim.name" : "given_name", - "jsonType.label" : "String" - } - }, { - "id" : "e90089b9-a831-45cd-bd7e-c923ca7e2cec", - "name" : "family name", - "protocol" : "openid-connect", - "protocolMapper" : "oidc-usermodel-property-mapper", - "consentRequired" : true, - "consentText" : "${familyName}", - "config" : { - "user.attribute" : "lastName", - "id.token.claim" : "true", - "access.token.claim" : "true", - "claim.name" : "family_name", - "jsonType.label" : "String" - } - }, { - "id" : "7a0bc75a-4890-4a04-9b1f-07032d75b223", - "name" : "role list", - "protocol" : "saml", - "protocolMapper" : "saml-role-list-mapper", - "consentRequired" : false, - "config" : { - "single" : "false", - "attribute.nameformat" : "Basic", - "attribute.name" : "Role" - } - }, { - "id" : "001ec6cc-7a59-4a04-8e77-5d61092009e1", - "name" : "username", - "protocol" : "openid-connect", - "protocolMapper" : "oidc-usermodel-property-mapper", - "consentRequired" : true, - "consentText" : "${username}", - "config" : { - "user.attribute" : "username", - "id.token.claim" : "true", - "access.token.claim" : "true", - "claim.name" : "preferred_username", - "jsonType.label" : "String" - } - }, { - "id" : "14eaf865-36e9-492f-98aa-ca76f52b6e25", - "name" : "email", - "protocol" : "openid-connect", - "protocolMapper" : "oidc-usermodel-property-mapper", - "consentRequired" : true, - "consentText" : "${email}", - "config" : { - "user.attribute" : "email", - "id.token.claim" : "true", - "access.token.claim" : "true", - "claim.name" : "email", - "jsonType.label" : "String" - } - } ] - }, { - "id" : "737c1d02-5b04-4caa-96ac-12f82b55e3a1", - "clientId" : "master-realm", - "name" : "master Realm", - "surrogateAuthRequired" : false, - "enabled" : true, - "clientAuthenticatorType" : "client-secret", - "secret" : "c9e38b12-57cf-47bd-8116-3b69ef3a2110", - "redirectUris" : [ ], - "webOrigins" : [ ], - "notBefore" : 0, - "bearerOnly" : true, - "consentRequired" : false, - "serviceAccountsEnabled" : false, - "directGrantsOnly" : false, - "publicClient" : false, - "frontchannelLogout" : false, - "attributes" : { }, - "fullScopeAllowed" : true, - "nodeReRegistrationTimeout" : 0, - "protocolMappers" : [ { - "id" : "0285f882-61a2-4b98-8f51-2b0f4d230edc", - "name" : "email", - "protocol" : "openid-connect", - "protocolMapper" : "oidc-usermodel-property-mapper", - "consentRequired" : true, - "consentText" : "${email}", - "config" : { - "user.attribute" : "email", - "id.token.claim" : "true", - "access.token.claim" : "true", - "claim.name" : "email", - "jsonType.label" : "String" - } - }, { - "id" : "b3216963-f3b5-4b1b-b5a1-c291ab15d835", - "name" : "family name", - "protocol" : "openid-connect", - "protocolMapper" : "oidc-usermodel-property-mapper", - "consentRequired" : true, - "consentText" : "${familyName}", - "config" : { - "user.attribute" : "lastName", - "id.token.claim" : "true", - "access.token.claim" : "true", - "claim.name" : "family_name", - "jsonType.label" : "String" - } - }, { - "id" : "4632dca4-a334-4353-826a-3ac8eb517fe5", - "name" : "given name", - "protocol" : "openid-connect", - "protocolMapper" : "oidc-usermodel-property-mapper", - "consentRequired" : true, - "consentText" : "${givenName}", - "config" : { - "user.attribute" : "firstName", - "id.token.claim" : "true", - "access.token.claim" : "true", - "claim.name" : "given_name", - "jsonType.label" : "String" - } - }, { - "id" : "14ade32e-ca83-4c4f-9fd1-8ced257eecf6", - "name" : "role list", - "protocol" : "saml", - "protocolMapper" : "saml-role-list-mapper", - "consentRequired" : false, - "config" : { - "single" : "false", - "attribute.nameformat" : "Basic", - "attribute.name" : "Role" - } - }, { - "id" : "bf76011c-5d36-4c84-b981-7fcfa3eee76e", - "name" : "full name", - "protocol" : "openid-connect", - "protocolMapper" : "oidc-full-name-mapper", - "consentRequired" : true, - "consentText" : "${fullName}", - "config" : { - "id.token.claim" : "true", - "access.token.claim" : "true" - } - }, { - "id" : "ea3d84dc-ed8c-4b77-a974-5bdf4c7591fc", - "name" : "username", - "protocol" : "openid-connect", - "protocolMapper" : "oidc-usermodel-property-mapper", - "consentRequired" : true, - "consentText" : "${username}", - "config" : { - "user.attribute" : "username", - "id.token.claim" : "true", - "access.token.claim" : "true", - "claim.name" : "preferred_username", - "jsonType.label" : "String" - } - } ] - }, { - "id" : "de89d8d5-e526-457f-a83f-a05a32d2b3c4", - "clientId" : "broker", - "name" : "${client_broker}", - "surrogateAuthRequired" : false, - "enabled" : true, - "clientAuthenticatorType" : "client-secret", - "secret" : "64bb4575-8bc4-41f8-95fe-37ccdc7e58b8", - "redirectUris" : [ ], - "webOrigins" : [ ], - "notBefore" : 0, - "bearerOnly" : false, - "consentRequired" : false, - "serviceAccountsEnabled" : false, - "directGrantsOnly" : false, - "publicClient" : false, - "frontchannelLogout" : false, - "attributes" : { }, - "fullScopeAllowed" : false, - "nodeReRegistrationTimeout" : 0, - "protocolMappers" : [ { - "id" : "2315624c-5a12-48c0-92c2-987eaec0a7f1", - "name" : "family name", - "protocol" : "openid-connect", - "protocolMapper" : "oidc-usermodel-property-mapper", - "consentRequired" : true, - "consentText" : "${familyName}", - "config" : { - "user.attribute" : "lastName", - "id.token.claim" : "true", - "access.token.claim" : "true", - "claim.name" : "family_name", - "jsonType.label" : "String" - } - }, { - "id" : "6b7b79a6-e852-4008-85b9-6514422a5f73", - "name" : "role list", - "protocol" : "saml", - "protocolMapper" : "saml-role-list-mapper", - "consentRequired" : false, - "config" : { - "single" : "false", - "attribute.nameformat" : "Basic", - "attribute.name" : "Role" - } - }, { - "id" : "3de1364e-b896-444e-8e67-8c143f9f5af9", - "name" : "given name", - "protocol" : "openid-connect", - "protocolMapper" : "oidc-usermodel-property-mapper", - "consentRequired" : true, - "consentText" : "${givenName}", - "config" : { - "user.attribute" : "firstName", - "id.token.claim" : "true", - "access.token.claim" : "true", - "claim.name" : "given_name", - "jsonType.label" : "String" - } - }, { - "id" : "1ff705e3-1dea-49c6-8671-48bb23599762", - "name" : "email", - "protocol" : "openid-connect", - "protocolMapper" : "oidc-usermodel-property-mapper", - "consentRequired" : true, - "consentText" : "${email}", - "config" : { - "user.attribute" : "email", - "id.token.claim" : "true", - "access.token.claim" : "true", - "claim.name" : "email", - "jsonType.label" : "String" - } - }, { - "id" : "4f896934-ecc5-491a-876e-1ec8f123dd4b", - "name" : "full name", - "protocol" : "openid-connect", - "protocolMapper" : "oidc-full-name-mapper", - "consentRequired" : true, - "consentText" : "${fullName}", - "config" : { - "id.token.claim" : "true", - "access.token.claim" : "true" - } - }, { - "id" : "c7f079d7-093d-4ff0-91ec-2eb433a24bc7", - "name" : "username", - "protocol" : "openid-connect", - "protocolMapper" : "oidc-usermodel-property-mapper", - "consentRequired" : true, - "consentText" : "${username}", - "config" : { - "user.attribute" : "username", - "id.token.claim" : "true", - "access.token.claim" : "true", - "claim.name" : "preferred_username", - "jsonType.label" : "String" - } - } ] - }, { - "id" : "d38fc352-f9bd-4ee8-a4b1-b1d49121d8de", - "clientId" : "customer-portal-cli", - "surrogateAuthRequired" : false, - "enabled" : true, - "clientAuthenticatorType" : "client-secret", - "secret" : "6f7a911c-46cc-47a4-a475-67584f387556", - "redirectUris" : [ "urn:ietf:wg:oauth:2.0:oob", "http://localhost" ], - "webOrigins" : [ "http://localhost" ], - "notBefore" : 0, - "bearerOnly" : false, - "consentRequired" : false, - "serviceAccountsEnabled" : false, - "directGrantsOnly" : false, - "publicClient" : true, - "frontchannelLogout" : false, - "attributes" : { }, - "fullScopeAllowed" : true, - "nodeReRegistrationTimeout" : -1, - "protocolMappers" : [ { - "id" : "77032cf9-8c5e-4c9a-8aa2-c1612586f70d", - "name" : "role list", - "protocol" : "saml", - "protocolMapper" : "saml-role-list-mapper", - "consentRequired" : false, - "config" : { - "single" : "false", - "attribute.nameformat" : "Basic", - "attribute.name" : "Role" - } - }, { - "id" : "b4f97a2f-bef6-4b28-bd07-376ea4b196ec", - "name" : "username", - "protocol" : "openid-connect", - "protocolMapper" : "oidc-usermodel-property-mapper", - "consentRequired" : true, - "consentText" : "${username}", - "config" : { - "user.attribute" : "username", - "id.token.claim" : "true", - "access.token.claim" : "true", - "claim.name" : "preferred_username", - "jsonType.label" : "String" - } - }, { - "id" : "675fff85-b373-45d4-8465-d76cbf860562", - "name" : "email", - "protocol" : "openid-connect", - "protocolMapper" : "oidc-usermodel-property-mapper", - "consentRequired" : true, - "consentText" : "${email}", - "config" : { - "user.attribute" : "email", - "id.token.claim" : "true", - "access.token.claim" : "true", - "claim.name" : "email", - "jsonType.label" : "String" - } - }, { - "id" : "bcb3716f-29d2-4904-97a5-6f460026da47", - "name" : "family name", - "protocol" : "openid-connect", - "protocolMapper" : "oidc-usermodel-property-mapper", - "consentRequired" : true, - "consentText" : "${familyName}", - "config" : { - "user.attribute" : "lastName", - "id.token.claim" : "true", - "access.token.claim" : "true", - "claim.name" : "family_name", - "jsonType.label" : "String" - } - }, { - "id" : "2ee67514-cfc1-4002-8e2d-894d208c93a9", - "name" : "full name", - "protocol" : "openid-connect", - "protocolMapper" : "oidc-full-name-mapper", - "consentRequired" : true, - "consentText" : "${fullName}", - "config" : { - "id.token.claim" : "true", - "access.token.claim" : "true" - } - }, { - "id" : "a36d453e-fee5-4407-b7a8-515509f86e7d", - "name" : "given name", - "protocol" : "openid-connect", - "protocolMapper" : "oidc-usermodel-property-mapper", - "consentRequired" : true, - "consentText" : "${givenName}", - "config" : { - "user.attribute" : "firstName", - "id.token.claim" : "true", - "access.token.claim" : "true", - "claim.name" : "given_name", - "jsonType.label" : "String" - } - } ] - }, { - "id" : "a8ad2322-3bfd-4d3d-b555-5d2927b3b43c", - "clientId" : "customer-portal", - "adminUrl" : "/customer-portal", - "baseUrl" : "/customer-portal", - "surrogateAuthRequired" : false, - "enabled" : true, - "clientAuthenticatorType" : "client-secret", - "secret" : "password", - "redirectUris" : [ "/customer-portal/*" ], - "webOrigins" : [ ], - "notBefore" : 0, - "bearerOnly" : false, - "consentRequired" : false, - "serviceAccountsEnabled" : false, - "directGrantsOnly" : false, - "publicClient" : false, - "frontchannelLogout" : false, - "attributes" : { }, - "fullScopeAllowed" : true, - "nodeReRegistrationTimeout" : -1, - "protocolMappers" : [ { - "id" : "6edd6df4-f175-43d7-a961-981a8517a8b5", - "name" : "given name", - "protocol" : "openid-connect", - "protocolMapper" : "oidc-usermodel-property-mapper", - "consentRequired" : true, - "consentText" : "${givenName}", - "config" : { - "user.attribute" : "firstName", - "id.token.claim" : "true", - "access.token.claim" : "true", - "claim.name" : "given_name", - "jsonType.label" : "String" - } - }, { - "id" : "a2a5df10-3b62-44ea-b7de-71974f4c54d6", - "name" : "role list", - "protocol" : "saml", - "protocolMapper" : "saml-role-list-mapper", - "consentRequired" : false, - "config" : { - "single" : "false", - "attribute.nameformat" : "Basic", - "attribute.name" : "Role" - } - }, { - "id" : "092682ff-d347-4386-b97b-e91cd469db94", - "name" : "email", - "protocol" : "openid-connect", - "protocolMapper" : "oidc-usermodel-property-mapper", - "consentRequired" : true, - "consentText" : "${email}", - "config" : { - "user.attribute" : "email", - "id.token.claim" : "true", - "access.token.claim" : "true", - "claim.name" : "email", - "jsonType.label" : "String" - } - }, { - "id" : "a23b0c07-6b27-4118-8efa-9ab29fbdc75a", - "name" : "family name", - "protocol" : "openid-connect", - "protocolMapper" : "oidc-usermodel-property-mapper", - "consentRequired" : true, - "consentText" : "${familyName}", - "config" : { - "user.attribute" : "lastName", - "id.token.claim" : "true", - "access.token.claim" : "true", - "claim.name" : "family_name", - "jsonType.label" : "String" - } - }, { - "id" : "0834e677-ee6b-40b4-aace-9720e0933b1e", - "name" : "full name", - "protocol" : "openid-connect", - "protocolMapper" : "oidc-full-name-mapper", - "consentRequired" : true, - "consentText" : "${fullName}", - "config" : { - "id.token.claim" : "true", - "access.token.claim" : "true" - } - }, { - "id" : "1c25b331-f020-4786-8786-549ff57ce3b3", - "name" : "username", - "protocol" : "openid-connect", - "protocolMapper" : "oidc-usermodel-property-mapper", - "consentRequired" : true, - "consentText" : "${username}", - "config" : { - "user.attribute" : "username", - "id.token.claim" : "true", - "access.token.claim" : "true", - "claim.name" : "preferred_username", - "jsonType.label" : "String" - } - } ] - }, { - "id" : "d2a382cb-fd72-4643-a3b6-f9dbc0da80f4", - "clientId" : "mynewrealm-realm", - "name" : "mynewrealm Realm", - "surrogateAuthRequired" : false, - "enabled" : true, - "clientAuthenticatorType" : "client-secret", - "secret" : "50cbe999-4c6f-4424-96cb-fd03919cce1e", - "redirectUris" : [ ], - "webOrigins" : [ ], - "notBefore" : 0, - "bearerOnly" : true, - "consentRequired" : false, - "serviceAccountsEnabled" : false, - "directGrantsOnly" : false, - "publicClient" : false, - "frontchannelLogout" : false, - "attributes" : { }, - "fullScopeAllowed" : true, - "nodeReRegistrationTimeout" : 0, - "protocolMappers" : [ { - "id" : "fd60f8ee-faf7-4d42-b3ee-a1e9b571b195", - "name" : "email", - "protocol" : "openid-connect", - "protocolMapper" : "oidc-usermodel-property-mapper", - "consentRequired" : true, - "consentText" : "${email}", - "config" : { - "user.attribute" : "email", - "id.token.claim" : "true", - "access.token.claim" : "true", - "claim.name" : "email", - "jsonType.label" : "String" - } - }, { - "id" : "68264dfd-75db-4dd8-8aae-0e470bf851f7", - "name" : "role list", - "protocol" : "saml", - "protocolMapper" : "saml-role-list-mapper", - "consentRequired" : false, - "config" : { - "single" : "false", - "attribute.nameformat" : "Basic", - "attribute.name" : "Role" - } - }, { - "id" : "960d419d-f616-40f1-ae78-ee10bab1ca00", - "name" : "username", - "protocol" : "openid-connect", - "protocolMapper" : "oidc-usermodel-property-mapper", - "consentRequired" : true, - "consentText" : "${username}", - "config" : { - "user.attribute" : "username", - "id.token.claim" : "true", - "access.token.claim" : "true", - "claim.name" : "preferred_username", - "jsonType.label" : "String" - } - }, { - "id" : "bc703891-d4d9-44de-b909-e168320a1650", - "name" : "family name", - "protocol" : "openid-connect", - "protocolMapper" : "oidc-usermodel-property-mapper", - "consentRequired" : true, - "consentText" : "${familyName}", - "config" : { - "user.attribute" : "lastName", - "id.token.claim" : "true", - "access.token.claim" : "true", - "claim.name" : "family_name", - "jsonType.label" : "String" - } - }, { - "id" : "ab9b12a2-fba8-4bd3-93c4-853081b61d7b", - "name" : "given name", - "protocol" : "openid-connect", - "protocolMapper" : "oidc-usermodel-property-mapper", - "consentRequired" : true, - "consentText" : "${givenName}", - "config" : { - "user.attribute" : "firstName", - "id.token.claim" : "true", - "access.token.claim" : "true", - "claim.name" : "given_name", - "jsonType.label" : "String" - } - }, { - "id" : "ba4a9642-0a04-49ff-9e82-370c50be52b1", - "name" : "full name", - "protocol" : "openid-connect", - "protocolMapper" : "oidc-full-name-mapper", - "consentRequired" : true, - "consentText" : "${fullName}", - "config" : { - "id.token.claim" : "true", - "access.token.claim" : "true" - } - } ] - }, { - "id" : "c8507822-3793-4f7c-a328-dfe45c125e02", - "clientId" : "product-portal", - "adminUrl" : "/product-portal", - "baseUrl" : "/product-portal", - "surrogateAuthRequired" : false, - "enabled" : true, - "clientAuthenticatorType" : "client-secret", - "secret" : "password", - "redirectUris" : [ "/product-portal/*" ], - "webOrigins" : [ ], - "notBefore" : 0, - "bearerOnly" : false, - "consentRequired" : false, - "serviceAccountsEnabled" : false, - "directGrantsOnly" : false, - "publicClient" : false, - "frontchannelLogout" : false, - "attributes" : { }, - "fullScopeAllowed" : true, - "nodeReRegistrationTimeout" : -1, - "protocolMappers" : [ { - "id" : "62613797-4231-4c0a-b3ca-c4128cb96922", - "name" : "family name", - "protocol" : "openid-connect", - "protocolMapper" : "oidc-usermodel-property-mapper", - "consentRequired" : true, - "consentText" : "${familyName}", - "config" : { - "user.attribute" : "lastName", - "id.token.claim" : "true", - "access.token.claim" : "true", - "claim.name" : "family_name", - "jsonType.label" : "String" - } - }, { - "id" : "f47d226f-ff60-408d-8eca-2241594b08a0", - "name" : "email", - "protocol" : "openid-connect", - "protocolMapper" : "oidc-usermodel-property-mapper", - "consentRequired" : true, - "consentText" : "${email}", - "config" : { - "user.attribute" : "email", - "id.token.claim" : "true", - "access.token.claim" : "true", - "claim.name" : "email", - "jsonType.label" : "String" - } - }, { - "id" : "e165f967-4267-485d-ae9c-065e35a36246", - "name" : "given name", - "protocol" : "openid-connect", - "protocolMapper" : "oidc-usermodel-property-mapper", - "consentRequired" : true, - "consentText" : "${givenName}", - "config" : { - "user.attribute" : "firstName", - "id.token.claim" : "true", - "access.token.claim" : "true", - "claim.name" : "given_name", - "jsonType.label" : "String" - } - }, { - "id" : "c1711314-d68d-4f0f-bb79-0ba3f88b9a70", - "name" : "username", - "protocol" : "openid-connect", - "protocolMapper" : "oidc-usermodel-property-mapper", - "consentRequired" : true, - "consentText" : "${username}", - "config" : { - "user.attribute" : "username", - "id.token.claim" : "true", - "access.token.claim" : "true", - "claim.name" : "preferred_username", - "jsonType.label" : "String" - } - }, { - "id" : "b204b8d1-f944-4fa7-a436-ff1d7923145e", - "name" : "full name", - "protocol" : "openid-connect", - "protocolMapper" : "oidc-full-name-mapper", - "consentRequired" : true, - "consentText" : "${fullName}", - "config" : { - "id.token.claim" : "true", - "access.token.claim" : "true" - } - }, { - "id" : "4c996673-4fdd-4d48-91d4-05d584fd7f12", - "name" : "role list", - "protocol" : "saml", - "protocolMapper" : "saml-role-list-mapper", - "consentRequired" : false, - "config" : { - "single" : "false", - "attribute.nameformat" : "Basic", - "attribute.name" : "Role" - } - } ] - }, { - "id" : "bdbdfb4a-64aa-49a7-89bb-d67ec85f272a", - "clientId" : "account", - "name" : "${client_account}", - "baseUrl" : "/auth/realms/master/account", - "surrogateAuthRequired" : false, - "enabled" : true, - "clientAuthenticatorType" : "client-secret", - "secret" : "5879d256-6b50-4233-85cf-379c699c26a0", - "defaultRoles" : [ "view-profile", "manage-account" ], - "redirectUris" : [ "/auth/realms/master/account/*" ], - "webOrigins" : [ ], - "notBefore" : 0, - "bearerOnly" : false, - "consentRequired" : false, - "serviceAccountsEnabled" : false, - "directGrantsOnly" : false, - "publicClient" : false, - "frontchannelLogout" : false, - "attributes" : { }, - "fullScopeAllowed" : false, - "nodeReRegistrationTimeout" : 0, - "protocolMappers" : [ { - "id" : "14d427a2-ceff-4b50-a94a-a4474fc4fdb2", - "name" : "email", - "protocol" : "openid-connect", - "protocolMapper" : "oidc-usermodel-property-mapper", - "consentRequired" : true, - "consentText" : "${email}", - "config" : { - "user.attribute" : "email", - "id.token.claim" : "true", - "access.token.claim" : "true", - "claim.name" : "email", - "jsonType.label" : "String" - } - }, { - "id" : "83a17f83-d98f-4e2e-91b4-b73e4e53186d", - "name" : "username", - "protocol" : "openid-connect", - "protocolMapper" : "oidc-usermodel-property-mapper", - "consentRequired" : true, - "consentText" : "${username}", - "config" : { - "user.attribute" : "username", - "id.token.claim" : "true", - "access.token.claim" : "true", - "claim.name" : "preferred_username", - "jsonType.label" : "String" - } - }, { - "id" : "5fba4099-df00-4982-9585-5af1759602ef", - "name" : "family name", - "protocol" : "openid-connect", - "protocolMapper" : "oidc-usermodel-property-mapper", - "consentRequired" : true, - "consentText" : "${familyName}", - "config" : { - "user.attribute" : "lastName", - "id.token.claim" : "true", - "access.token.claim" : "true", - "claim.name" : "family_name", - "jsonType.label" : "String" - } - }, { - "id" : "fc7586dd-8ed3-4656-9be7-c247bba69b85", - "name" : "role list", - "protocol" : "saml", - "protocolMapper" : "saml-role-list-mapper", - "consentRequired" : false, - "config" : { - "single" : "false", - "attribute.nameformat" : "Basic", - "attribute.name" : "Role" - } - }, { - "id" : "6e9d15d7-1da8-43d4-84e5-725c479edad7", - "name" : "given name", - "protocol" : "openid-connect", - "protocolMapper" : "oidc-usermodel-property-mapper", - "consentRequired" : true, - "consentText" : "${givenName}", - "config" : { - "user.attribute" : "firstName", - "id.token.claim" : "true", - "access.token.claim" : "true", - "claim.name" : "given_name", - "jsonType.label" : "String" - } - }, { - "id" : "a890ac50-4553-4238-8356-c22e37d1fa4e", - "name" : "full name", - "protocol" : "openid-connect", - "protocolMapper" : "oidc-full-name-mapper", - "consentRequired" : true, - "consentText" : "${fullName}", - "config" : { - "id.token.claim" : "true", - "access.token.claim" : "true" - } - } ] - }, { - "id" : "826c609d-d32e-4305-832c-2c847222c7c3", - "clientId" : "third-party", - "surrogateAuthRequired" : false, - "enabled" : true, - "clientAuthenticatorType" : "client-secret", - "secret" : "password", - "redirectUris" : [ "/oauth-client/*", "/oauth-client-cdi/*" ], - "webOrigins" : [ ], - "notBefore" : 0, - "bearerOnly" : false, - "consentRequired" : true, - "serviceAccountsEnabled" : false, - "directGrantsOnly" : false, - "publicClient" : false, - "frontchannelLogout" : false, - "attributes" : { }, - "fullScopeAllowed" : false, - "nodeReRegistrationTimeout" : -1, - "protocolMappers" : [ { - "id" : "a0c8b770-23ef-4d79-b8e9-6b76ff2a6e01", - "name" : "full name", - "protocol" : "openid-connect", - "protocolMapper" : "oidc-full-name-mapper", - "consentRequired" : true, - "consentText" : "${fullName}", - "config" : { - "id.token.claim" : "true", - "access.token.claim" : "true" - } - }, { - "id" : "eaff4d98-33c5-450f-bbe7-450bfd2ab117", - "name" : "email", - "protocol" : "openid-connect", - "protocolMapper" : "oidc-usermodel-property-mapper", - "consentRequired" : true, - "consentText" : "${email}", - "config" : { - "user.attribute" : "email", - "id.token.claim" : "true", - "access.token.claim" : "true", - "claim.name" : "email", - "jsonType.label" : "String" - } - }, { - "id" : "594e7a02-4241-434a-9b69-9f2d93d87656", - "name" : "family name", - "protocol" : "openid-connect", - "protocolMapper" : "oidc-usermodel-property-mapper", - "consentRequired" : true, - "consentText" : "${familyName}", - "config" : { - "user.attribute" : "lastName", - "id.token.claim" : "true", - "access.token.claim" : "true", - "claim.name" : "family_name", - "jsonType.label" : "String" - } - }, { - "id" : "a83ac8f8-7e01-44df-a5fb-24b939ec31ac", - "name" : "given name", - "protocol" : "openid-connect", - "protocolMapper" : "oidc-usermodel-property-mapper", - "consentRequired" : true, - "consentText" : "${givenName}", - "config" : { - "user.attribute" : "firstName", - "id.token.claim" : "true", - "access.token.claim" : "true", - "claim.name" : "given_name", - "jsonType.label" : "String" - } - }, { - "id" : "fc84619d-935f-4c75-8c31-44ee12448d1e", - "name" : "username", - "protocol" : "openid-connect", - "protocolMapper" : "oidc-usermodel-property-mapper", - "consentRequired" : true, - "consentText" : "${username}", - "config" : { - "user.attribute" : "username", - "id.token.claim" : "true", - "access.token.claim" : "true", - "claim.name" : "preferred_username", - "jsonType.label" : "String" - } - }, { - "id" : "15512f5b-a0c9-4d72-b398-8a5aebec741b", - "name" : "role list", - "protocol" : "saml", - "protocolMapper" : "saml-role-list-mapper", - "consentRequired" : false, - "config" : { - "single" : "false", - "attribute.nameformat" : "Basic", - "attribute.name" : "Role" - } - } ] - }, { - "id" : "d32d12db-d80c-457f-b1b4-bc2a3cd95826", - "clientId" : "offline-access-portal", - "adminUrl" : "/offline-access-portal", - "baseUrl" : "/offline-access-portal", - "surrogateAuthRequired" : false, - "enabled" : true, - "clientAuthenticatorType" : "client-secret", - "secret" : "password", - "redirectUris" : [ "/offline-access-portal/*" ], - "webOrigins" : [ ], - "notBefore" : 0, - "bearerOnly" : false, - "consentRequired" : true, - "serviceAccountsEnabled" : false, - "directGrantsOnly" : false, - "publicClient" : false, - "frontchannelLogout" : false, - "attributes" : { }, - "fullScopeAllowed" : false, - "nodeReRegistrationTimeout" : -1, - "protocolMappers" : [ { - "id" : "7787685f-67c8-43b1-b332-48ec497e1d44", - "name" : "full name", - "protocol" : "openid-connect", - "protocolMapper" : "oidc-full-name-mapper", - "consentRequired" : true, - "consentText" : "${fullName}", - "config" : { - "id.token.claim" : "true", - "access.token.claim" : "true" - } - }, { - "id" : "2f4b623a-d263-4b4a-ae0c-10648791981c", - "name" : "family name", - "protocol" : "openid-connect", - "protocolMapper" : "oidc-usermodel-property-mapper", - "consentRequired" : true, - "consentText" : "${familyName}", - "config" : { - "user.attribute" : "lastName", - "id.token.claim" : "true", - "access.token.claim" : "true", - "claim.name" : "family_name", - "jsonType.label" : "String" - } - }, { - "id" : "6b5193e7-06c5-4293-89c0-13c90c3fb7ed", - "name" : "role list", - "protocol" : "saml", - "protocolMapper" : "saml-role-list-mapper", - "consentRequired" : false, - "config" : { - "single" : "false", - "attribute.nameformat" : "Basic", - "attribute.name" : "Role" - } - }, { - "id" : "41c96cee-e661-4a06-922d-123016085265", - "name" : "email", - "protocol" : "openid-connect", - "protocolMapper" : "oidc-usermodel-property-mapper", - "consentRequired" : true, - "consentText" : "${email}", - "config" : { - "user.attribute" : "email", - "id.token.claim" : "true", - "access.token.claim" : "true", - "claim.name" : "email", - "jsonType.label" : "String" - } - }, { - "id" : "1d8d553e-dc33-4065-9598-b5decaf0d11c", - "name" : "given name", - "protocol" : "openid-connect", - "protocolMapper" : "oidc-usermodel-property-mapper", - "consentRequired" : true, - "consentText" : "${givenName}", - "config" : { - "user.attribute" : "firstName", - "id.token.claim" : "true", - "access.token.claim" : "true", - "claim.name" : "given_name", - "jsonType.label" : "String" - } - }, { - "id" : "8e689c7c-693f-4001-a267-985e9c42aa6b", - "name" : "username", - "protocol" : "openid-connect", - "protocolMapper" : "oidc-usermodel-property-mapper", - "consentRequired" : true, - "consentText" : "${username}", - "config" : { - "user.attribute" : "username", - "id.token.claim" : "true", - "access.token.claim" : "true", - "claim.name" : "preferred_username", - "jsonType.label" : "String" - } - } ] - } ], - "browserSecurityHeaders" : { - "contentSecurityPolicy" : "frame-src 'self'", - "xFrameOptions" : "SAMEORIGIN" - }, - "smtpServer" : { }, - "eventsEnabled" : false, - "eventsListeners" : [ "jboss-logging" ], - "enabledEventTypes" : [ "SEND_RESET_PASSWORD", "SEND_VERIFY_EMAIL", "EXECUTE_ACTIONS_ERROR", "REMOVE_FEDERATED_IDENTITY", "REMOVE_CREDENTIAL", "UPDATE_TOTP", "REMOVE_TOTP", "REVOKE_GRANT", "LOGIN_ERROR", "CLIENT_LOGIN", "RESET_PASSWORD_ERROR", "CODE_TO_TOKEN_ERROR", "CUSTOM_REQUIRED_ACTION", "UPDATE_EMAIL", "REGISTER_ERROR", "LOGOUT_ERROR", "UPDATE_EMAIL_ERROR", "UPDATE_PROFILE_ERROR", "IMPERSONATE", "LOGIN", "UPDATE_PASSWORD_ERROR", "UPDATE_CREDENTIAL_ERROR", "CLIENT_UPDATE_ERROR", "UPDATE_PROFILE", "REGISTER", "LOGOUT", "FEDERATED_IDENTITY_LINK", "CLIENT_REGISTER_ERROR", "CLIENT_REGISTER", "SEND_VERIFY_EMAIL_ERROR", "UPDATE_CREDENTIAL", "UPDATE_PASSWORD" ,"RESET_PASSWORD", "FEDERATED_IDENTITY_LINK_ERROR", "CLIENT_DELETE", "REMOVE_CREDENTIAL_ERROR", "REMOVE_TOTP_ERROR", "VERIFY_EMAIL_ERROR", "VERIFY_EMAIL", "SEND_RESET_PASSWORD_ERROR", "CLIENT_DELETE_ERROR", "CLIENT_LOGIN_ERROR", "CLIENT_UPDATE", "REMOVE_FEDERATED_IDENTITY_ERROR", "EXECUTE_ACTIONS", "CUSTOM_REQUIRED_ACTION_ERROR", "UPDATE_TOTP_ERROR", "CODE_TO_TOKEN" ], - "adminEventsEnabled" : true, - "adminEventsDetailsEnabled" : true, - "identityProviders" : [ { - "alias" : "keycloak-oidc", - "internalId" : "721b5dae-5b98-4284-bcd1-f872ce2ac174", - "providerId" : "keycloak-oidc", - "enabled" : true, - "updateProfileFirstLoginMode" : "on", - "trustEmail" : false, - "storeToken" : false, - "addReadTokenRoleOnCreate" : false, - "authenticateByDefault" : false, - "config" : { - "clientSecret" : "foo", - "clientId" : "foo", - "tokenUrl" : "foo", - "authorizationUrl" : "foo" - } - }, { - "alias" : "oidc", - "internalId" : "7c8070e6-87d7-42b0-97df-b4cb87bc0c98", - "providerId" : "oidc", - "enabled" : true, - "updateProfileFirstLoginMode" : "on", - "trustEmail" : false, - "storeToken" : false, - "addReadTokenRoleOnCreate" : false, - "authenticateByDefault" : false, - "config" : { - "clientSecret" : "asdf", - "clientId" : "asdf", - "tokenUrl" : "asdf", - "authorizationUrl" : "asdf" - } - } ], - "identityProviderMappers" : [ { - "id" : "2bee0286-db3b-4051-ae59-3d56bf8d9f4d", - "name" : "asdf", - "identityProviderAlias" : "oidc", - "identityProviderMapper" : "oidc-user-attribute-idp-mapper", - "config" : { - "claim" : "fasdf", - "user.attribute" : "asdf" - } - } ], - "identityFederationEnabled" : true, - "internationalizationEnabled" : false, - "supportedLocales" : [ ], - "authenticationFlows" : [ { - "alias" : "direct grant", - "description" : "OpenID Connect Resource Owner Grant", - "providerId" : "basic-flow", - "topLevel" : true, - "builtIn" : true, - "authenticationExecutions" : [ { - "authenticator" : "direct-grant-validate-username", - "autheticatorFlow" : false, - "requirement" : "REQUIRED", - "userSetupAllowed" : false, - "priority" : 10 - }, { - "authenticator" : "direct-grant-validate-password", - "autheticatorFlow" : false, - "requirement" : "REQUIRED", - "userSetupAllowed" : false, - "priority" : 20 - }, { - "authenticator" : "direct-grant-validate-otp", - "autheticatorFlow" : false, - "requirement" : "OPTIONAL", - "userSetupAllowed" : false, - "priority" : 30 - } ] - }, { - "alias" : "registration", - "description" : "registration flow", - "providerId" : "basic-flow", - "topLevel" : true, - "builtIn" : true, - "authenticationExecutions" : [ { - "authenticator" : "registration-page-form", - "flowAlias" : "registration form", - "autheticatorFlow" : true, - "requirement" : "REQUIRED", - "userSetupAllowed" : false, - "priority" : 10 - } ] - }, { - "alias" : "reset credentials", - "description" : "Reset credentials for a user if they forgot their password or something", - "providerId" : "basic-flow", - "topLevel" : true, - "builtIn" : true, - "authenticationExecutions" : [ { - "authenticator" : "reset-credentials-choose-user", - "autheticatorFlow" : false, - "requirement" : "REQUIRED", - "userSetupAllowed" : false, - "priority" : 10 - }, { - "authenticator" : "reset-credential-email", - "autheticatorFlow" : false, - "requirement" : "REQUIRED", - "userSetupAllowed" : false, - "priority" : 20 - }, { - "authenticator" : "reset-password", - "autheticatorFlow" : false, - "requirement" : "REQUIRED", - "userSetupAllowed" : false, - "priority" : 30 - }, { - "authenticator" : "reset-otp", - "autheticatorFlow" : false, - "requirement" : "OPTIONAL", - "userSetupAllowed" : false, - "priority" : 40 - } ] - }, { - "alias" : "browser", - "description" : "browser based authentication", - "providerId" : "basic-flow", - "topLevel" : true, - "builtIn" : true, - "authenticationExecutions" : [ { - "authenticator" : "auth-cookie", - "autheticatorFlow" : false, - "requirement" : "ALTERNATIVE", - "userSetupAllowed" : false, - "priority" : 10 - }, { - "authenticator" : "auth-spnego", - "autheticatorFlow" : false, - "requirement" : "DISABLED", - "userSetupAllowed" : false, - "priority" : 20 - }, { - "flowAlias" : "forms", - "autheticatorFlow" : true, - "requirement" : "ALTERNATIVE", - "userSetupAllowed" : false, - "priority" : 30 - } ] - }, { - "alias" : "forms", - "description" : "Username, password, otp and other auth forms.", - "providerId" : "basic-flow", - "topLevel" : false, - "builtIn" : true, - "authenticationExecutions" : [ { - "authenticator" : "auth-username-password-form", - "autheticatorFlow" : false, - "requirement" : "REQUIRED", - "userSetupAllowed" : false, - "priority" : 10 - }, { - "authenticator" : "auth-otp-form", - "autheticatorFlow" : false, - "requirement" : "OPTIONAL", - "userSetupAllowed" : false, - "priority" : 20 - } ] - }, { - "alias" : "clients", - "description" : "Base authentication for clients", - "providerId" : "client-flow", - "topLevel" : true, - "builtIn" : true, - "authenticationExecutions" : [ { - "authenticator" : "client-secret", - "autheticatorFlow" : false, - "requirement" : "ALTERNATIVE", - "userSetupAllowed" : false, - "priority" : 10 - }, { - "authenticator" : "client-jwt", - "autheticatorFlow" : false, - "requirement" : "ALTERNATIVE", - "userSetupAllowed" : false, - "priority" : 20 - } ] - }, { - "alias" : "registration form", - "description" : "registration form", - "providerId" : "form-flow", - "topLevel" : false, - "builtIn" : true, - "authenticationExecutions" : [ { - "authenticator" : "registration-user-creation", - "autheticatorFlow" : false, - "requirement" : "REQUIRED", - "userSetupAllowed" : false, - "priority" : 20 - }, { - "authenticator" : "registration-profile-action", - "autheticatorFlow" : false, - "requirement" : "REQUIRED", - "userSetupAllowed" : false, - "priority" : 40 - }, { - "authenticator" : "registration-password-action", - "autheticatorFlow" : false, - "requirement" : "REQUIRED", - "userSetupAllowed" : false, - "priority" : 50 - }, { - "authenticator" : "registration-recaptcha-action", - "autheticatorFlow" : false, - "requirement" : "DISABLED", - "userSetupAllowed" : false, - "priority" : 60 - } ] - } ], - "authenticatorConfig" : [ ], - "requiredActions" : [ { - "alias" : "VERIFY_EMAIL", - "name" : "Verify Email", - "providerId" : "VERIFY_EMAIL", - "enabled" : true, - "defaultAction" : false, - "config" : { } - }, { - "alias" : "CONFIGURE_TOTP", - "name" : "Configure Totp", - "providerId" : "CONFIGURE_TOTP", - "enabled" : true, - "defaultAction" : false, - "config" : { } - }, { - "alias" : "UPDATE_PROFILE", - "name" : "Update Profile", - "providerId" : "UPDATE_PROFILE", - "enabled" : true, - "defaultAction" : false, - "config" : { } - }, { - "alias" : "terms_and_conditions", - "name" : "Terms and Conditions", - "providerId" : "terms_and_conditions", - "enabled" : false, - "defaultAction" : false, - "config" : { } - }, { - "alias" : "UPDATE_PASSWORD", - "name" : "Update Password", - "providerId" : "UPDATE_PASSWORD", - "enabled" : true, - "defaultAction" : false, - "config" : { } - } ], - "browserFlow" : "browser", - "registrationFlow" : "registration", - "directGrantFlow" : "direct grant", - "resetCredentialsFlow" : "reset credentials", - "clientAuthenticationFlow" : "clients" -}, { - "id" : "demo", - "realm" : "demo", - "notBefore" : 0, - "revokeRefreshToken" : false, - "accessTokenLifespan" : 60, - "ssoSessionIdleTimeout" : 600, - "ssoSessionMaxLifespan" : 36000, - "offlineSessionIdleTimeout" : 2592000, - "accessCodeLifespan" : 60, - "accessCodeLifespanUserAction" : 300, - "accessCodeLifespanLogin" : 1800, - "enabled" : true, - "sslRequired" : "external", - "registrationAllowed" : false, - "registrationEmailAsUsername" : false, - "rememberMe" : false, - "verifyEmail" : false, - "resetPasswordAllowed" : false, - "editUsernameAllowed" : false, - "bruteForceProtected" : false, - "maxFailureWaitSeconds" : 900, - "minimumQuickLoginWaitSeconds" : 60, - "waitIncrementSeconds" : 60, - "quickLoginCheckMilliSeconds" : 1000, - "maxDeltaTimeSeconds" : 43200, - "failureFactor" : 30, - "privateKey" : "MIICXAIBAAKBgQCrVrCuTtArbgaZzL1hvh0xtL5mc7o0NqPVnYXkLvgcwiC3BjLGw1tGEGoJaXDuSaRllobm53JBhjx33UNv+5z/UMG4kytBWxheNVKnL6GgqlNabMaFfPLPCF8kAgKnsi79NMo+n6KnSY8YeUmec/p2vjO2NjsSAVcWEQMVhJ31LwIDAQABAoGAfmO8gVhyBxdqlxmIuglbz8bcjQbhXJLR2EoS8ngTXmN1bo2L90M0mUKSdc7qF10LgETBzqL8jYlQIbt+e6TH8fcEpKCjUlyq0Mf/vVbfZSNaVycY13nTzo27iPyWQHK5NLuJzn1xvxxrUeXI6A2WFpGEBLbHjwpx5WQG9A+2scECQQDvdn9NE75HPTVPxBqsEd2z10TKkl9CZxu10Qby3iQQmWLEJ9LNmy3acvKrE3gMiYNWb6xHPKiIqOR1as7L24aTAkEAtyvQOlCvr5kAjVqrEKXalj0Tzewjweuxc0pskvArTI2Oo070h65GpoIKLc9jf+UA69cRtquwP93aZKtW06U8dQJAF2Y44ks/mK5+eyDqik3koCI08qaC8HYq2wVl7G2QkJ6sbAaILtcvD92ToOvyGyeE0flvmDZxMYlvaZnaQ0lcSQJBAKZU6umJi3/xeEbkJqMfeLclD27XGEFoPeNrmdx0q10Azp4NfJAY+Z8KRyQCR2BEG+oNitBOZ+YXF9KCpH3cdmECQHEigJhYg+ykOvr1aiZUMFT72HU0jnmQe2FVekuG+LJUt2Tm7GtMjTFoGpf0JwrVuZN39fOYAlo+nTixgeW7X8Y=", - "publicKey" : "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCrVrCuTtArbgaZzL1hvh0xtL5mc7o0NqPVnYXkLvgcwiC3BjLGw1tGEGoJaXDuSaRllobm53JBhjx33UNv+5z/UMG4kytBWxheNVKnL6GgqlNabMaFfPLPCF8kAgKnsi79NMo+n6KnSY8YeUmec/p2vjO2NjsSAVcWEQMVhJ31LwIDAQAB", - "certificate" : "MIIBkTCB+wIGAVD9HwYqMA0GCSqGSIb3DQEBCwUAMA8xDTALBgNVBAMMBGRlbW8wHhcNMTUxMTEyMTkxMzAwWhcNMjUxMTEyMTkxNDQwWjAPMQ0wCwYDVQQDDARkZW1vMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCrVrCuTtArbgaZzL1hvh0xtL5mc7o0NqPVnYXkLvgcwiC3BjLGw1tGEGoJaXDuSaRllobm53JBhjx33UNv+5z/UMG4kytBWxheNVKnL6GgqlNabMaFfPLPCF8kAgKnsi79NMo+n6KnSY8YeUmec/p2vjO2NjsSAVcWEQMVhJ31LwIDAQABMA0GCSqGSIb3DQEBCwUAA4GBAIPmcZ++qAtAEzdrRMtkmyDAtf41R4MSC3+ljYErbFI9mPqnrY2BAzLpusivqxuORBwYetdhFuqAJAluB8K1a6aRadt2u2+z0eGEgkKVtfYs4tDth23lg8WvubmwyJrGfCY5GtHEAl3RuTCkFTSRqbJ9fzD68rhJQPojNxAhABze", - "codeSecret" : "b2e0a1a4-94ae-46d4-8d30-9b8ee47627ae", - "roles" : { - "realm" : [ { - "id" : "4c9c285e-ec83-4294-b629-57c22b3916d9", - "name" : "offline_access", - "description" : "${role_offline-access}", - "scopeParamRequired" : true, - "composite" : false - }, { - "id" : "6f916d2f-3dae-4153-b9c0-fc0987fc18e1", - "name" : "create-realm", - "description" : "${role_create-realm}", - "scopeParamRequired" : false, - "composite" : false - }, { - "id" : "d928d12d-5d3c-48a4-b1dc-510d23001963", - "name" : "admin", - "description" : "Administrator privileges", - "scopeParamRequired" : false, - "composite" : false - }, { - "id" : "0301e5bd-7902-4929-9da1-553de7738044", - "name" : "user", - "description" : "User privileges", - "scopeParamRequired" : false, - "composite" : false - } ], - "client" : { - "database-service" : [ ], - "admin-client" : [ ], - "realm-management" : [ { - "id" : "3b939f75-d013-4096-8462-48aa39261293", - "name" : "create-client", - "description" : "${role_create-client}", - "scopeParamRequired" : false, - "composite" : false - }, { - "id" : "08714717-6150-42f3-b360-e3706cea1b4d", - "name" : "view-events", - "description" : "${role_view-events}", - "scopeParamRequired" : false, - "composite" : false - }, { - "id" : "b20ee4e9-ba54-48c4-99fe-fc0281b9c230", - "name" : "view-realm", - "description" : "${role_view-realm}", - "scopeParamRequired" : false, - "composite" : false - }, { - "id" : "264f5da2-4917-47b5-b89a-38b3cdedf851", - "name" : "manage-users", - "description" : "${role_manage-users}", - "scopeParamRequired" : false, - "composite" : false - }, { - "id" : "bde13dc7-d843-4fdb-95c2-1ca5826477ac", - "name" : "view-identity-providers", - "description" : "${role_view-identity-providers}", - "scopeParamRequired" : false, - "composite" : false - }, { - "id" : "6e3455b4-11cc-4d59-89a3-93482cc30b04", - "name" : "impersonation", - "description" : "${role_impersonation}", - "scopeParamRequired" : false, - "composite" : false - }, { - "id" : "d69ef626-f6a7-4b83-b207-ad3fe380d93e", - "name" : "view-clients", - "description" : "${role_view-clients}", - "scopeParamRequired" : false, - "composite" : false - }, { - "id" : "04c6b2a0-c47d-445d-90e9-8b98545fdcee", - "name" : "view-users", - "description" : "${role_view-users}", - "scopeParamRequired" : false, - "composite" : false - }, { - "id" : "1213edcd-9442-47b3-a06a-3818acd928e5", - "name" : "manage-identity-providers", - "description" : "${role_manage-identity-providers}", - "scopeParamRequired" : false, - "composite" : false - }, { - "id" : "357a66b3-63e9-49e2-a571-7c1e6c6180dd", - "name" : "realm-admin", - "description" : "${role_realm-admin}", - "scopeParamRequired" : false, - "composite" : true, - "composites" : { - "client" : { - "realm-management" : [ "create-client", "view-events", "view-users", "manage-identity-providers", "view-realm", "manage-clients", "manage-users", "view-clients", "view-identity-providers", "impersonation", "manage-events", "manage-realm" ] - } - } - }, { - "id" : "b9b695e9-4261-46ec-aca1-da0fd9ed44aa", - "name" : "manage-clients", - "description" : "${role_manage-clients}", - "scopeParamRequired" : false, - "composite" : false - }, { - "id" : "098a9946-e58a-4a5c-b04e-5d4acfe9f6f1", - "name" : "manage-events", - "description" : "${role_manage-events}", - "scopeParamRequired" : false, - "composite" : false - }, { - "id" : "000d9791-8f42-49d7-bbdc-01e6b5a8cc70", - "name" : "manage-realm", - "description" : "${role_manage-realm}", - "scopeParamRequired" : false, - "composite" : false - } ], - "customer-portal-js" : [ ], - "security-admin-console" : [ ], - "product-sa-client-jwt-auth" : [ ], - "angular-product" : [ ], - "product-sa-client" : [ ], - "broker" : [ { - "id" : "89c1bae3-b2c9-4e2f-937f-7514923f5e5f", - "name" : "read-token", - "description" : "${role_read-token}", - "scopeParamRequired" : false, - "composite" : false - } ], - "customer-portal-cli" : [ ], - "customer-portal" : [ ], - "product-portal" : [ ], - "account" : [ { - "id" : "198c3c05-7bff-408f-8ada-95a5481861f9", - "name" : "manage-account", - "description" : "${role_manage-account}", - "scopeParamRequired" : false, - "composite" : false - }, { - "id" : "2cf786e5-e0bb-4492-bf7d-16688d12e5ff", - "name" : "view-profile", - "description" : "${role_view-profile}", - "scopeParamRequired" : false, - "composite" : false - } ], - "offline-access-portal" : [ ], - "third-party" : [ { - "id" : "59daf30e-3933-4386-b2cd-ced19f3f1ca2", - "name" : "myclientrole", - "description" : "My client role", - "scopeParamRequired" : false, - "composite" : false - } ] - } - }, - "defaultRoles" : [ "offline_access" ], - "requiredCredentials" : [ "password" ], - "otpPolicyType" : "totp", - "otpPolicyAlgorithm" : "HmacSHA1", - "otpPolicyInitialCounter" : 0, - "otpPolicyDigits" : 6, - "otpPolicyLookAheadWindow" : 1, - "otpPolicyPeriod" : 30, - "users" : [ { - "id" : "a7aff2b8-f001-47df-9f9f-f3f02d18f6b1", - "createdTimestamp" : 1447786264017, - "username" : "aaaa", - "enabled" : true, - "totp" : false, - "emailVerified" : false, - "credentials" : [ ], - "requiredActions" : [ ], - "realmRoles" : [ "offline_access" ], - "clientRoles" : { - "account" : [ "manage-account", "view-profile" ] - } - }, { - "id" : "be51490a-8473-4f83-8625-984959210741", - "createdTimestamp" : 1447786273233, - "username" : "bbbb", - "enabled" : true, - "totp" : false, - "emailVerified" : false, - "credentials" : [ ], - "requiredActions" : [ ], - "realmRoles" : [ "offline_access" ], - "clientRoles" : { - "account" : [ "manage-account", "view-profile" ] - } - }, { - "id" : "9b202a37-2b16-4341-bcc2-c2549586911c", - "username" : "bburke@redhat.com", - "enabled" : true, - "totp" : false, - "emailVerified" : false, - "firstName" : "Bill", - "lastName" : "Burke", - "email" : "bburke@redhat.com", - "credentials" : [ { - "type" : "password", - "hashedSaltedValue" : "FhdAutJurcyDSxVQma3VNMX2mcfnZ0MN2LToYCLWi3G+fnp793NrQ9xWzGICpsQ+nq1EA6M64o2bil+oh+ezmA==", - "salt" : "uBE9SOPCNIEhOdnc8ZXbFQ==", - "hashIterations" : 1, - "counter" : 0, - "digits" : 0, - "temporary" : false - } ], - "requiredActions" : [ ], - "realmRoles" : [ "offline_access", "user" ], - "clientRoles" : { - "account" : [ "manage-account" ] - } - }, { - "id" : "83454480-d38f-410f-8a36-1af1b6be5a19", - "createdTimestamp" : 1447786289606, - "username" : "cccc", - "enabled" : true, - "totp" : false, - "emailVerified" : false, - "credentials" : [ ], - "requiredActions" : [ ], - "realmRoles" : [ "offline_access" ], - "clientRoles" : { - "account" : [ "manage-account", "view-profile" ] - } - }, { - "id" : "999a7fe4-618a-4349-ae0c-96a9c47d34fd", - "username" : "mposolda@redhat.com", - "enabled" : true, - "totp" : false, - "emailVerified" : false, - "firstName" : "Marek", - "lastName" : "Posolda", - "email" : "mposolda@redhat.com", - "credentials" : [ { - "type" : "password", - "hashedSaltedValue" : "GmPpUa3c+8lX2IvdxktX4NfvVXdPwJKsk6tcGVrUD0s+yAUxsASPBoLbmLOUT59H28qkb7/KnAHLAi2euqcYNg==", - "salt" : "eA9HDWvaYqhKVCnfU2wNAg==", - "hashIterations" : 1, - "counter" : 0, - "digits" : 0, - "temporary" : false - } ], - "requiredActions" : [ ], - "realmRoles" : [ "offline_access", "user" ], - "clientRoles" : { - "account" : [ "manage-account" ] - } - }, { - "id" : "fc30bf89-c312-4d4a-9774-55555c938310", - "username" : "stian", - "enabled" : true, - "totp" : false, - "emailVerified" : false, - "firstName" : "Stian", - "lastName" : "Thorgersen", - "email" : "stian@redhat.com", - "credentials" : [ { - "type" : "password", - "hashedSaltedValue" : "VAuUKmATwpbkxNCFl1KmMYe9COd1EcpOJbs+C1S/VMjJWjJDG1Ebq4alkNUvTSFcHwtccVvXOw1zbes0QnahdA==", - "salt" : "91IXeHc7uNf4j0z7UZwwiw==", - "hashIterations" : 1, - "counter" : 0, - "digits" : 0, - "temporary" : false - } ], - "requiredActions" : [ ], - "realmRoles" : [ "offline_access", "user" ], - "clientRoles" : { - "account" : [ "manage-account" ] - } - } ], - "scopeMappings" : [ { - "client" : "offline-access-portal", - "roles" : [ "offline_access", "user" ] - } ], - "clientScopeMappings" : { - "realm-management" : [ { - "client" : "security-admin-console", - "roles" : [ "realm-admin" ] - } ] - }, - "clients" : [ { - "id" : "f2fdc211-9ab9-4b91-a7ba-077ba63abacb", - "clientId" : "database-service", - "adminUrl" : "/database", - "baseUrl" : "/database", - "surrogateAuthRequired" : false, - "enabled" : true, - "clientAuthenticatorType" : "client-secret", - "secret" : "c07577a5-421b-441f-99ab-5b3b854146a6", - "redirectUris" : [ ], - "webOrigins" : [ ], - "notBefore" : 0, - "bearerOnly" : true, - "consentRequired" : false, - "serviceAccountsEnabled" : false, - "directGrantsOnly" : false, - "publicClient" : false, - "frontchannelLogout" : false, - "attributes" : { }, - "fullScopeAllowed" : true, - "nodeReRegistrationTimeout" : -1, - "protocolMappers" : [ { - "id" : "5c5d79d8-ee42-43a0-a5f8-869eb9e7240c", - "name" : "full name", - "protocol" : "openid-connect", - "protocolMapper" : "oidc-full-name-mapper", - "consentRequired" : true, - "consentText" : "${fullName}", - "config" : { - "id.token.claim" : "true", - "access.token.claim" : "true" - } - }, { - "id" : "7270e5cd-383a-462c-864b-c9a62ec09669", - "name" : "username", - "protocol" : "openid-connect", - "protocolMapper" : "oidc-usermodel-property-mapper", - "consentRequired" : true, - "consentText" : "${username}", - "config" : { - "user.attribute" : "username", - "id.token.claim" : "true", - "access.token.claim" : "true", - "claim.name" : "preferred_username", - "jsonType.label" : "String" - } - }, { - "id" : "f9dabb18-b105-4d40-ac16-a6922d692745", - "name" : "email", - "protocol" : "openid-connect", - "protocolMapper" : "oidc-usermodel-property-mapper", - "consentRequired" : true, - "consentText" : "${email}", - "config" : { - "user.attribute" : "email", - "id.token.claim" : "true", - "access.token.claim" : "true", - "claim.name" : "email", - "jsonType.label" : "String" - } - }, { - "id" : "6cbe4afe-5c1a-403f-9bfe-94788586d1ca", - "name" : "given name", - "protocol" : "openid-connect", - "protocolMapper" : "oidc-usermodel-property-mapper", - "consentRequired" : true, - "consentText" : "${givenName}", - "config" : { - "user.attribute" : "firstName", - "id.token.claim" : "true", - "access.token.claim" : "true", - "claim.name" : "given_name", - "jsonType.label" : "String" - } - }, { - "id" : "24500a3a-d6f8-4125-8d87-549322afa2ba", - "name" : "family name", - "protocol" : "openid-connect", - "protocolMapper" : "oidc-usermodel-property-mapper", - "consentRequired" : true, - "consentText" : "${familyName}", - "config" : { - "user.attribute" : "lastName", - "id.token.claim" : "true", - "access.token.claim" : "true", - "claim.name" : "family_name", - "jsonType.label" : "String" - } - }, { - "id" : "952feb28-70a9-4288-8e43-25eaffe06059", - "name" : "role list", - "protocol" : "saml", - "protocolMapper" : "saml-role-list-mapper", - "consentRequired" : false, - "config" : { - "single" : "false", - "attribute.nameformat" : "Basic", - "attribute.name" : "Role" - } - } ] - }, { - "id" : "a9a0369c-3e8e-4c0a-9e9b-44f18d58bbc8", - "clientId" : "admin-client", - "surrogateAuthRequired" : false, - "enabled" : true, - "clientAuthenticatorType" : "client-secret", - "secret" : "5232b41c-8d89-4a37-b467-8c3bf6277f8f", - "redirectUris" : [ ], - "webOrigins" : [ ], - "notBefore" : 0, - "bearerOnly" : false, - "consentRequired" : false, - "serviceAccountsEnabled" : false, - "directGrantsOnly" : true, - "publicClient" : true, - "frontchannelLogout" : false, - "attributes" : { }, - "fullScopeAllowed" : true, - "nodeReRegistrationTimeout" : -1, - "protocolMappers" : [ { - "id" : "5a210a28-3542-4cc1-afc0-3825911b85be", - "name" : "username", - "protocol" : "openid-connect", - "protocolMapper" : "oidc-usermodel-property-mapper", - "consentRequired" : true, - "consentText" : "${username}", - "config" : { - "user.attribute" : "username", - "id.token.claim" : "true", - "access.token.claim" : "true", - "claim.name" : "preferred_username", - "jsonType.label" : "String" - } - }, { - "id" : "4ecac0b1-a61a-4a91-9540-b2f5b072f650", - "name" : "email", - "protocol" : "openid-connect", - "protocolMapper" : "oidc-usermodel-property-mapper", - "consentRequired" : true, - "consentText" : "${email}", - "config" : { - "user.attribute" : "email", - "id.token.claim" : "true", - "access.token.claim" : "true", - "claim.name" : "email", - "jsonType.label" : "String" - } - }, { - "id" : "e6ee1534-8301-414d-8264-e3ca38d47d9a", - "name" : "full name", - "protocol" : "openid-connect", - "protocolMapper" : "oidc-full-name-mapper", - "consentRequired" : true, - "consentText" : "${fullName}", - "config" : { - "id.token.claim" : "true", - "access.token.claim" : "true" - } - }, { - "id" : "7dd459f7-c23c-4543-be26-6ba28bba7291", - "name" : "family name", - "protocol" : "openid-connect", - "protocolMapper" : "oidc-usermodel-property-mapper", - "consentRequired" : true, - "consentText" : "${familyName}", - "config" : { - "user.attribute" : "lastName", - "id.token.claim" : "true", - "access.token.claim" : "true", - "claim.name" : "family_name", - "jsonType.label" : "String" - } - }, { - "id" : "38feea4a-d4ea-46e2-8a9d-a312a22b9aac", - "name" : "role list", - "protocol" : "saml", - "protocolMapper" : "saml-role-list-mapper", - "consentRequired" : false, - "config" : { - "single" : "false", - "attribute.nameformat" : "Basic", - "attribute.name" : "Role" - } - }, { - "id" : "4475e482-d67d-4ebb-a998-3f801bb54557", - "name" : "given name", - "protocol" : "openid-connect", - "protocolMapper" : "oidc-usermodel-property-mapper", - "consentRequired" : true, - "consentText" : "${givenName}", - "config" : { - "user.attribute" : "firstName", - "id.token.claim" : "true", - "access.token.claim" : "true", - "claim.name" : "given_name", - "jsonType.label" : "String" - } - } ] - }, { - "id" : "093f1be5-ab06-4a97-8c9b-ffcbe3e4e291", - "clientId" : "realm-management", - "name" : "${client_realm-management}", - "surrogateAuthRequired" : false, - "enabled" : true, - "clientAuthenticatorType" : "client-secret", - "secret" : "198e8543-d0f9-4095-a51c-af8ff13c2579", - "redirectUris" : [ ], - "webOrigins" : [ ], - "notBefore" : 0, - "bearerOnly" : true, - "consentRequired" : false, - "serviceAccountsEnabled" : false, - "directGrantsOnly" : false, - "publicClient" : false, - "frontchannelLogout" : false, - "attributes" : { }, - "fullScopeAllowed" : false, - "nodeReRegistrationTimeout" : 0, - "protocolMappers" : [ { - "id" : "349da162-0405-46f1-bfa4-d67b6812af7a", - "name" : "username", - "protocol" : "openid-connect", - "protocolMapper" : "oidc-usermodel-property-mapper", - "consentRequired" : true, - "consentText" : "${username}", - "config" : { - "user.attribute" : "username", - "id.token.claim" : "true", - "access.token.claim" : "true", - "claim.name" : "preferred_username", - "jsonType.label" : "String" - } - }, { - "id" : "7bc4b18e-e2dd-4eea-aad6-5ee807e07fb0", - "name" : "email", - "protocol" : "openid-connect", - "protocolMapper" : "oidc-usermodel-property-mapper", - "consentRequired" : true, - "consentText" : "${email}", - "config" : { - "user.attribute" : "email", - "id.token.claim" : "true", - "access.token.claim" : "true", - "claim.name" : "email", - "jsonType.label" : "String" - } - }, { - "id" : "d529517b-c9cc-4653-b87b-b69e6b1369a2", - "name" : "role list", - "protocol" : "saml", - "protocolMapper" : "saml-role-list-mapper", - "consentRequired" : false, - "config" : { - "single" : "false", - "attribute.nameformat" : "Basic", - "attribute.name" : "Role" - } - }, { - "id" : "55d60e9b-ce56-44ff-bffe-eefc828a9e5e", - "name" : "family name", - "protocol" : "openid-connect", - "protocolMapper" : "oidc-usermodel-property-mapper", - "consentRequired" : true, - "consentText" : "${familyName}", - "config" : { - "user.attribute" : "lastName", - "id.token.claim" : "true", - "access.token.claim" : "true", - "claim.name" : "family_name", - "jsonType.label" : "String" - } - }, { - "id" : "880e5b27-6eaa-4d13-852e-ef0ff1e5ba85", - "name" : "full name", - "protocol" : "openid-connect", - "protocolMapper" : "oidc-full-name-mapper", - "consentRequired" : true, - "consentText" : "${fullName}", - "config" : { - "id.token.claim" : "true", - "access.token.claim" : "true" - } - }, { - "id" : "5fd28107-0d3f-486a-9366-2ba8ebd3555d", - "name" : "given name", - "protocol" : "openid-connect", - "protocolMapper" : "oidc-usermodel-property-mapper", - "consentRequired" : true, - "consentText" : "${givenName}", - "config" : { - "user.attribute" : "firstName", - "id.token.claim" : "true", - "access.token.claim" : "true", - "claim.name" : "given_name", - "jsonType.label" : "String" - } - } ] - }, { - "id" : "a79cdc99-1ed3-406f-b02d-48b300c58613", - "clientId" : "customer-portal-js", - "baseUrl" : "/customer-portal-js", - "surrogateAuthRequired" : false, - "enabled" : true, - "clientAuthenticatorType" : "client-secret", - "secret" : "5bceb81d-118c-4871-b059-6e0323a6b1cb", - "redirectUris" : [ "/customer-portal-js/*" ], - "webOrigins" : [ ], - "notBefore" : 0, - "bearerOnly" : false, - "consentRequired" : false, - "serviceAccountsEnabled" : false, - "directGrantsOnly" : false, - "publicClient" : true, - "frontchannelLogout" : false, - "attributes" : { }, - "fullScopeAllowed" : true, - "nodeReRegistrationTimeout" : -1, - "protocolMappers" : [ { - "id" : "d86ab89c-b18a-4179-9765-5b2fe1e091bd", - "name" : "username", - "protocol" : "openid-connect", - "protocolMapper" : "oidc-usermodel-property-mapper", - "consentRequired" : true, - "consentText" : "${username}", - "config" : { - "user.attribute" : "username", - "id.token.claim" : "true", - "access.token.claim" : "true", - "claim.name" : "preferred_username", - "jsonType.label" : "String" - } - }, { - "id" : "d19687ce-8f3d-4e5e-a4a4-a4980b97ca6c", - "name" : "full name", - "protocol" : "openid-connect", - "protocolMapper" : "oidc-full-name-mapper", - "consentRequired" : true, - "consentText" : "${fullName}", - "config" : { - "id.token.claim" : "true", - "access.token.claim" : "true" - } - }, { - "id" : "f3a8f4e0-ee07-4fec-a20c-dbf668b66070", - "name" : "role list", - "protocol" : "saml", - "protocolMapper" : "saml-role-list-mapper", - "consentRequired" : false, - "config" : { - "single" : "false", - "attribute.nameformat" : "Basic", - "attribute.name" : "Role" - } - }, { - "id" : "01ad03a9-e6bc-4ede-82ed-d359f781c17b", - "name" : "given name", - "protocol" : "openid-connect", - "protocolMapper" : "oidc-usermodel-property-mapper", - "consentRequired" : true, - "consentText" : "${givenName}", - "config" : { - "user.attribute" : "firstName", - "id.token.claim" : "true", - "access.token.claim" : "true", - "claim.name" : "given_name", - "jsonType.label" : "String" - } - }, { - "id" : "bb169ec6-5de3-4824-a148-8f4395aa9a96", - "name" : "family name", - "protocol" : "openid-connect", - "protocolMapper" : "oidc-usermodel-property-mapper", - "consentRequired" : true, - "consentText" : "${familyName}", - "config" : { - "user.attribute" : "lastName", - "id.token.claim" : "true", - "access.token.claim" : "true", - "claim.name" : "family_name", - "jsonType.label" : "String" - } - }, { - "id" : "7e4b9ad5-b679-4942-a12a-0f3fe7829813", - "name" : "email", - "protocol" : "openid-connect", - "protocolMapper" : "oidc-usermodel-property-mapper", - "consentRequired" : true, - "consentText" : "${email}", - "config" : { - "user.attribute" : "email", - "id.token.claim" : "true", - "access.token.claim" : "true", - "claim.name" : "email", - "jsonType.label" : "String" - } - } ] - }, { - "id" : "4e300b13-3a93-40b4-b663-901c3cf08e00", - "clientId" : "security-admin-console", - "name" : "${client_security-admin-console}", - "baseUrl" : "/auth/admin/demo/console/index.html", - "surrogateAuthRequired" : false, - "enabled" : true, - "clientAuthenticatorType" : "client-secret", - "secret" : "3598448d-6430-486c-b2e7-061690e05042", - "redirectUris" : [ "/auth/admin/demo/console/*" ], - "webOrigins" : [ ], - "notBefore" : 0, - "bearerOnly" : false, - "consentRequired" : false, - "serviceAccountsEnabled" : false, - "directGrantsOnly" : false, - "publicClient" : true, - "frontchannelLogout" : false, - "attributes" : { }, - "fullScopeAllowed" : false, - "nodeReRegistrationTimeout" : 0, - "protocolMappers" : [ { - "id" : "a7df97a6-c744-4ed3-b559-efaf52d3cb00", - "name" : "username", - "protocol" : "openid-connect", - "protocolMapper" : "oidc-usermodel-property-mapper", - "consentRequired" : true, - "consentText" : "${username}", - "config" : { - "user.attribute" : "username", - "id.token.claim" : "true", - "access.token.claim" : "true", - "claim.name" : "preferred_username", - "jsonType.label" : "String" - } - }, { - "id" : "7363ee08-8353-4275-9c56-e37dfd1bf5e2", - "name" : "locale", - "protocol" : "openid-connect", - "protocolMapper" : "oidc-usermodel-attribute-mapper", - "consentRequired" : false, - "consentText" : "${locale}", - "config" : { - "user.attribute" : "locale", - "id.token.claim" : "true", - "access.token.claim" : "true", - "claim.name" : "locale", - "jsonType.label" : "String" - } - }, { - "id" : "acd0975e-4722-449e-a73e-73b11ad379a1", - "name" : "email", - "protocol" : "openid-connect", - "protocolMapper" : "oidc-usermodel-property-mapper", - "consentRequired" : true, - "consentText" : "${email}", - "config" : { - "user.attribute" : "email", - "id.token.claim" : "true", - "access.token.claim" : "true", - "claim.name" : "email", - "jsonType.label" : "String" - } - }, { - "id" : "a97100a1-e45a-4cae-b633-7ccd08178ff4", - "name" : "full name", - "protocol" : "openid-connect", - "protocolMapper" : "oidc-full-name-mapper", - "consentRequired" : true, - "consentText" : "${fullName}", - "config" : { - "id.token.claim" : "true", - "access.token.claim" : "true" - } - }, { - "id" : "ea5684e4-ffa5-40c2-89af-cf17fd97d210", - "name" : "family name", - "protocol" : "openid-connect", - "protocolMapper" : "oidc-usermodel-property-mapper", - "consentRequired" : true, - "consentText" : "${familyName}", - "config" : { - "user.attribute" : "lastName", - "id.token.claim" : "true", - "access.token.claim" : "true", - "claim.name" : "family_name", - "jsonType.label" : "String" - } - }, { - "id" : "a8c7c8fb-1906-4de3-a243-04f6809672a7", - "name" : "given name", - "protocol" : "openid-connect", - "protocolMapper" : "oidc-usermodel-property-mapper", - "consentRequired" : true, - "consentText" : "${givenName}", - "config" : { - "user.attribute" : "firstName", - "id.token.claim" : "true", - "access.token.claim" : "true", - "claim.name" : "given_name", - "jsonType.label" : "String" - } - }, { - "id" : "f12d2cdd-99ee-4344-b9c4-51c92fe89019", - "name" : "role list", - "protocol" : "saml", - "protocolMapper" : "saml-role-list-mapper", - "consentRequired" : false, - "config" : { - "single" : "false", - "attribute.nameformat" : "Basic", - "attribute.name" : "Role" - } - } ] - }, { - "id" : "e5c1c405-8946-4ba7-87b2-ebf95adecf95", - "clientId" : "product-sa-client-jwt-auth", - "surrogateAuthRequired" : false, - "enabled" : true, - "clientAuthenticatorType" : "client-jwt", - "secret" : "9ee8df09-53ad-4c6c-aac3-ef0c56cb712d", - "redirectUris" : [ ], - "webOrigins" : [ ], - "notBefore" : 0, - "bearerOnly" : false, - "consentRequired" : false, - "serviceAccountsEnabled" : true, - "directGrantsOnly" : false, - "publicClient" : false, - "frontchannelLogout" : false, - "attributes" : { - "jwt.credential.certificate" : "MIICnTCCAYUCBgFPPLDaTzANBgkqhkiG9w0BAQsFADASMRAwDgYDVQQDDAdjbGllbnQxMB4XDTE1MDgxNzE3MjI0N1oXDTI1MDgxNzE3MjQyN1owEjEQMA4GA1UEAwwHY2xpZW50MTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAIUjjgv+V3s96O+Za9002Lp/trtGuHBeaeVL9dFKMKzO2MPqdRmHB4PqNlDdd28Rwf5Xn6iWdFpyUKOnI/yXDLhdcuFpR0sMNK/C9Lt+hSpPFLuzDqgtPgDotlMxiHIWDOZ7g9/gPYNXbNvjv8nSiyqoguoCQiiafW90bPHsiVLdP7ZIUwCcfi1qQm7FhxRJ1NiW5dvUkuCnnWEf0XR+Wzc5eC9EgB0taLFiPsSEIlWMm5xlahYyXkPdNOqZjiRnrTWm5Y4uk8ZcsD/KbPTf/7t7cQXipVaswgjdYi1kK2/zRwOhg1QwWFX/qmvdd+fLxV0R6VqRDhn7Qep2cxwMxLsCAwEAATANBgkqhkiG9w0BAQsFAAOCAQEAKE6OA46sf20bz8LZPoiNsqRwBUDkaMGXfnob7s/hJZIIwDEx0IAQ3uKsG7q9wb+aA6s+v7S340zb2k3IxuhFaHaZpAd4CyR5cn1FHylbzoZ7rI/3ASqHDqpljdJaFqPH+m7nZWtyDvtZf+gkZ8OjsndwsSBK1d/jMZPp29qYbl1+XfO7RCp/jDqro/R3saYFaIFiEZPeKn1hUJn6BO48vxH1xspSu9FmlvDOEAOz4AuM58z4zRMP49GcFdCWr1wkonJUHaSptJaQwmBwLFUkCbE5I1ixGMb7mjEud6Y5jhfzJiZMo2U8RfcjNbrN0diZl3jB6LQIwESnhYSghaTjNQ==" - }, - "fullScopeAllowed" : true, - "nodeReRegistrationTimeout" : -1, - "protocolMappers" : [ { - "id" : "44476a5a-5910-41f0-81d0-f4df1bbf2af0", - "name" : "email", - "protocol" : "openid-connect", - "protocolMapper" : "oidc-usermodel-property-mapper", - "consentRequired" : true, - "consentText" : "${email}", - "config" : { - "user.attribute" : "email", - "id.token.claim" : "true", - "access.token.claim" : "true", - "claim.name" : "email", - "jsonType.label" : "String" - } - }, { - "id" : "893f9ec3-cc96-45c8-a45f-1a0acd5a4b9a", - "name" : "role list", - "protocol" : "saml", - "protocolMapper" : "saml-role-list-mapper", - "consentRequired" : false, - "config" : { - "single" : "false", - "attribute.nameformat" : "Basic", - "attribute.name" : "Role" - } - }, { - "id" : "5387018a-17b8-4ab5-a321-8b55c4ba8647", - "name" : "username", - "protocol" : "openid-connect", - "protocolMapper" : "oidc-usermodel-property-mapper", - "consentRequired" : true, - "consentText" : "${username}", - "config" : { - "user.attribute" : "username", - "id.token.claim" : "true", - "access.token.claim" : "true", - "claim.name" : "preferred_username", - "jsonType.label" : "String" - } - }, { - "id" : "d1859c79-ab34-4cfa-94ca-bddeed297851", - "name" : "given name", - "protocol" : "openid-connect", - "protocolMapper" : "oidc-usermodel-property-mapper", - "consentRequired" : true, - "consentText" : "${givenName}", - "config" : { - "user.attribute" : "firstName", - "id.token.claim" : "true", - "access.token.claim" : "true", - "claim.name" : "given_name", - "jsonType.label" : "String" - } - }, { - "id" : "7b7a51d7-d7e0-4dcd-8484-e9859d5fa936", - "name" : "full name", - "protocol" : "openid-connect", - "protocolMapper" : "oidc-full-name-mapper", - "consentRequired" : true, - "consentText" : "${fullName}", - "config" : { - "id.token.claim" : "true", - "access.token.claim" : "true" - } - }, { - "id" : "1afe8b40-940a-4b8c-b4e3-e4cb77564a04", - "name" : "family name", - "protocol" : "openid-connect", - "protocolMapper" : "oidc-usermodel-property-mapper", - "consentRequired" : true, - "consentText" : "${familyName}", - "config" : { - "user.attribute" : "lastName", - "id.token.claim" : "true", - "access.token.claim" : "true", - "claim.name" : "family_name", - "jsonType.label" : "String" - } - } ] - }, { - "id" : "236116d3-22be-4d91-9a96-baa47abf2b40", - "clientId" : "angular-product", - "baseUrl" : "/angular-product/index.html", - "surrogateAuthRequired" : false, - "enabled" : true, - "clientAuthenticatorType" : "client-secret", - "secret" : "8dcdd603-046b-4d9b-aa6c-a2216f08adbd", - "redirectUris" : [ "/angular-product/*" ], - "webOrigins" : [ ], - "notBefore" : 0, - "bearerOnly" : false, - "consentRequired" : false, - "serviceAccountsEnabled" : false, - "directGrantsOnly" : false, - "publicClient" : true, - "frontchannelLogout" : false, - "attributes" : { }, - "fullScopeAllowed" : true, - "nodeReRegistrationTimeout" : -1, - "protocolMappers" : [ { - "id" : "dcbfd946-b240-46a7-be7c-cc4805818cb1", - "name" : "email", - "protocol" : "openid-connect", - "protocolMapper" : "oidc-usermodel-property-mapper", - "consentRequired" : true, - "consentText" : "${email}", - "config" : { - "user.attribute" : "email", - "id.token.claim" : "true", - "access.token.claim" : "true", - "claim.name" : "email", - "jsonType.label" : "String" - } - }, { - "id" : "99ee6cff-9232-4a75-95c4-6758e44eee2e", - "name" : "family name", - "protocol" : "openid-connect", - "protocolMapper" : "oidc-usermodel-property-mapper", - "consentRequired" : true, - "consentText" : "${familyName}", - "config" : { - "user.attribute" : "lastName", - "id.token.claim" : "true", - "access.token.claim" : "true", - "claim.name" : "family_name", - "jsonType.label" : "String" - } - }, { - "id" : "e7977843-998c-4c41-9d60-2f2f3c7b4d31", - "name" : "given name", - "protocol" : "openid-connect", - "protocolMapper" : "oidc-usermodel-property-mapper", - "consentRequired" : true, - "consentText" : "${givenName}", - "config" : { - "user.attribute" : "firstName", - "id.token.claim" : "true", - "access.token.claim" : "true", - "claim.name" : "given_name", - "jsonType.label" : "String" - } - }, { - "id" : "c002b2f4-c104-4767-9032-3d676ea95e84", - "name" : "role list", - "protocol" : "saml", - "protocolMapper" : "saml-role-list-mapper", - "consentRequired" : false, - "config" : { - "single" : "false", - "attribute.nameformat" : "Basic", - "attribute.name" : "Role" - } - }, { - "id" : "8da0d621-c553-4711-b8af-ff701aa00067", - "name" : "full name", - "protocol" : "openid-connect", - "protocolMapper" : "oidc-full-name-mapper", - "consentRequired" : true, - "consentText" : "${fullName}", - "config" : { - "id.token.claim" : "true", - "access.token.claim" : "true" - } - }, { - "id" : "4ce074ae-0b30-489d-a6e0-250a0e9d09cc", - "name" : "username", - "protocol" : "openid-connect", - "protocolMapper" : "oidc-usermodel-property-mapper", - "consentRequired" : true, - "consentText" : "${username}", - "config" : { - "user.attribute" : "username", - "id.token.claim" : "true", - "access.token.claim" : "true", - "claim.name" : "preferred_username", - "jsonType.label" : "String" - } - } ] - }, { - "id" : "dbbf4149-862d-4169-a245-ff1311a5fee4", - "clientId" : "product-sa-client", - "surrogateAuthRequired" : false, - "enabled" : true, - "clientAuthenticatorType" : "client-secret", - "secret" : "password", - "redirectUris" : [ ], - "webOrigins" : [ ], - "notBefore" : 0, - "bearerOnly" : false, - "consentRequired" : false, - "serviceAccountsEnabled" : true, - "directGrantsOnly" : false, - "publicClient" : false, - "frontchannelLogout" : false, - "attributes" : { }, - "fullScopeAllowed" : true, - "nodeReRegistrationTimeout" : -1, - "protocolMappers" : [ { - "id" : "63c63de0-cace-4dcf-b9f3-748bcb30363c", - "name" : "given name", - "protocol" : "openid-connect", - "protocolMapper" : "oidc-usermodel-property-mapper", - "consentRequired" : true, - "consentText" : "${givenName}", - "config" : { - "user.attribute" : "firstName", - "id.token.claim" : "true", - "access.token.claim" : "true", - "claim.name" : "given_name", - "jsonType.label" : "String" - } - }, { - "id" : "90003b43-b9b5-4a99-9a55-cfa3a3f61bd1", - "name" : "email", - "protocol" : "openid-connect", - "protocolMapper" : "oidc-usermodel-property-mapper", - "consentRequired" : true, - "consentText" : "${email}", - "config" : { - "user.attribute" : "email", - "id.token.claim" : "true", - "access.token.claim" : "true", - "claim.name" : "email", - "jsonType.label" : "String" - } - }, { - "id" : "5768ee0f-9ca8-4e25-af4b-20d8168a3353", - "name" : "full name", - "protocol" : "openid-connect", - "protocolMapper" : "oidc-full-name-mapper", - "consentRequired" : true, - "consentText" : "${fullName}", - "config" : { - "id.token.claim" : "true", - "access.token.claim" : "true" - } - }, { - "id" : "48e4fdb0-366b-4398-9283-6caf200faa1a", - "name" : "role list", - "protocol" : "saml", - "protocolMapper" : "saml-role-list-mapper", - "consentRequired" : false, - "config" : { - "single" : "false", - "attribute.nameformat" : "Basic", - "attribute.name" : "Role" - } - }, { - "id" : "859d6733-75ce-4a4d-9327-eac92db09dde", - "name" : "username", - "protocol" : "openid-connect", - "protocolMapper" : "oidc-usermodel-property-mapper", - "consentRequired" : true, - "consentText" : "${username}", - "config" : { - "user.attribute" : "username", - "id.token.claim" : "true", - "access.token.claim" : "true", - "claim.name" : "preferred_username", - "jsonType.label" : "String" - } - }, { - "id" : "6581a732-d6c8-4f71-b79a-8a7f65fe029d", - "name" : "family name", - "protocol" : "openid-connect", - "protocolMapper" : "oidc-usermodel-property-mapper", - "consentRequired" : true, - "consentText" : "${familyName}", - "config" : { - "user.attribute" : "lastName", - "id.token.claim" : "true", - "access.token.claim" : "true", - "claim.name" : "family_name", - "jsonType.label" : "String" - } - } ] - }, { - "id" : "0373aa1f-2d8e-4dfe-952a-c3630b816052", - "clientId" : "broker", - "name" : "${client_broker}", - "surrogateAuthRequired" : false, - "enabled" : true, - "clientAuthenticatorType" : "client-secret", - "secret" : "14a007f3-c33d-4031-a65e-7638ad1b2ddb", - "redirectUris" : [ ], - "webOrigins" : [ ], - "notBefore" : 0, - "bearerOnly" : false, - "consentRequired" : false, - "serviceAccountsEnabled" : false, - "directGrantsOnly" : false, - "publicClient" : false, - "frontchannelLogout" : false, - "attributes" : { }, - "fullScopeAllowed" : false, - "nodeReRegistrationTimeout" : 0, - "protocolMappers" : [ { - "id" : "ceac6e36-c896-46a7-bb34-74c8221ff73e", - "name" : "family name", - "protocol" : "openid-connect", - "protocolMapper" : "oidc-usermodel-property-mapper", - "consentRequired" : true, - "consentText" : "${familyName}", - "config" : { - "user.attribute" : "lastName", - "id.token.claim" : "true", - "access.token.claim" : "true", - "claim.name" : "family_name", - "jsonType.label" : "String" - } - }, { - "id" : "dbc6f757-bef2-4ba2-a9d2-ca31eaea1bf4", - "name" : "full name", - "protocol" : "openid-connect", - "protocolMapper" : "oidc-full-name-mapper", - "consentRequired" : true, - "consentText" : "${fullName}", - "config" : { - "id.token.claim" : "true", - "access.token.claim" : "true" - } - }, { - "id" : "4ce51699-6cd3-4a28-84f9-5436b790bf34", - "name" : "email", - "protocol" : "openid-connect", - "protocolMapper" : "oidc-usermodel-property-mapper", - "consentRequired" : true, - "consentText" : "${email}", - "config" : { - "user.attribute" : "email", - "id.token.claim" : "true", - "access.token.claim" : "true", - "claim.name" : "email", - "jsonType.label" : "String" - } - }, { - "id" : "b69a15d2-1278-4383-821f-d30f283d2589", - "name" : "given name", - "protocol" : "openid-connect", - "protocolMapper" : "oidc-usermodel-property-mapper", - "consentRequired" : true, - "consentText" : "${givenName}", - "config" : { - "user.attribute" : "firstName", - "id.token.claim" : "true", - "access.token.claim" : "true", - "claim.name" : "given_name", - "jsonType.label" : "String" - } - }, { - "id" : "d758376d-7992-4210-82ef-dda968dbf7c6", - "name" : "username", - "protocol" : "openid-connect", - "protocolMapper" : "oidc-usermodel-property-mapper", - "consentRequired" : true, - "consentText" : "${username}", - "config" : { - "user.attribute" : "username", - "id.token.claim" : "true", - "access.token.claim" : "true", - "claim.name" : "preferred_username", - "jsonType.label" : "String" - } - }, { - "id" : "8035b804-1d16-41e6-8d87-3819d8bea996", - "name" : "role list", - "protocol" : "saml", - "protocolMapper" : "saml-role-list-mapper", - "consentRequired" : false, - "config" : { - "single" : "false", - "attribute.nameformat" : "Basic", - "attribute.name" : "Role" - } - } ] - }, { - "id" : "df7f0085-4ad8-4979-b33d-e399cc8eaf49", - "clientId" : "customer-portal-cli", - "surrogateAuthRequired" : false, - "enabled" : true, - "clientAuthenticatorType" : "client-secret", - "secret" : "4db5ba21-d810-42dc-9384-5a8268013d12", - "redirectUris" : [ "urn:ietf:wg:oauth:2.0:oob", "http://localhost" ], - "webOrigins" : [ "http://localhost" ], - "notBefore" : 0, - "bearerOnly" : false, - "consentRequired" : false, - "serviceAccountsEnabled" : false, - "directGrantsOnly" : false, - "publicClient" : true, - "frontchannelLogout" : false, - "attributes" : { }, - "fullScopeAllowed" : true, - "nodeReRegistrationTimeout" : -1, - "protocolMappers" : [ { - "id" : "196ca389-1240-4d86-980d-d6fe94224f11", - "name" : "family name", - "protocol" : "openid-connect", - "protocolMapper" : "oidc-usermodel-property-mapper", - "consentRequired" : true, - "consentText" : "${familyName}", - "config" : { - "user.attribute" : "lastName", - "id.token.claim" : "true", - "access.token.claim" : "true", - "claim.name" : "family_name", - "jsonType.label" : "String" - } - }, { - "id" : "cfe9b599-96e4-4063-84b1-de54659b6296", - "name" : "username", - "protocol" : "openid-connect", - "protocolMapper" : "oidc-usermodel-property-mapper", - "consentRequired" : true, - "consentText" : "${username}", - "config" : { - "user.attribute" : "username", - "id.token.claim" : "true", - "access.token.claim" : "true", - "claim.name" : "preferred_username", - "jsonType.label" : "String" - } - }, { - "id" : "f475e915-24b5-4670-a25d-2bd6166a26a5", - "name" : "email", - "protocol" : "openid-connect", - "protocolMapper" : "oidc-usermodel-property-mapper", - "consentRequired" : true, - "consentText" : "${email}", - "config" : { - "user.attribute" : "email", - "id.token.claim" : "true", - "access.token.claim" : "true", - "claim.name" : "email", - "jsonType.label" : "String" - } - }, { - "id" : "0a5eeb46-28a8-4e32-8ffe-84059f824ee4", - "name" : "role list", - "protocol" : "saml", - "protocolMapper" : "saml-role-list-mapper", - "consentRequired" : false, - "config" : { - "single" : "false", - "attribute.nameformat" : "Basic", - "attribute.name" : "Role" - } - }, { - "id" : "c74425c3-a762-46c6-beb9-1330fb39628c", - "name" : "given name", - "protocol" : "openid-connect", - "protocolMapper" : "oidc-usermodel-property-mapper", - "consentRequired" : true, - "consentText" : "${givenName}", - "config" : { - "user.attribute" : "firstName", - "id.token.claim" : "true", - "access.token.claim" : "true", - "claim.name" : "given_name", - "jsonType.label" : "String" - } - }, { - "id" : "17174fe0-b305-4b75-92f5-1ea0a3f5f7bf", - "name" : "full name", - "protocol" : "openid-connect", - "protocolMapper" : "oidc-full-name-mapper", - "consentRequired" : true, - "consentText" : "${fullName}", - "config" : { - "id.token.claim" : "true", - "access.token.claim" : "true" - } - } ] - }, { - "id" : "faf80527-7ecc-450b-985f-e74f6acccf13", - "clientId" : "customer-portal", - "adminUrl" : "/customer-portal", - "baseUrl" : "/customer-portal", - "surrogateAuthRequired" : false, - "enabled" : true, - "clientAuthenticatorType" : "client-secret", - "secret" : "password", - "redirectUris" : [ "/customer-portal/*" ], - "webOrigins" : [ ], - "notBefore" : 0, - "bearerOnly" : false, - "consentRequired" : false, - "serviceAccountsEnabled" : false, - "directGrantsOnly" : false, - "publicClient" : false, - "frontchannelLogout" : false, - "attributes" : { }, - "fullScopeAllowed" : true, - "nodeReRegistrationTimeout" : -1, - "protocolMappers" : [ { - "id" : "3be6ab05-39af-4512-9301-78dfd4663427", - "name" : "family name", - "protocol" : "openid-connect", - "protocolMapper" : "oidc-usermodel-property-mapper", - "consentRequired" : true, - "consentText" : "${familyName}", - "config" : { - "user.attribute" : "lastName", - "id.token.claim" : "true", - "access.token.claim" : "true", - "claim.name" : "family_name", - "jsonType.label" : "String" - } - }, { - "id" : "5b7bc226-696c-4aa6-9c25-d8911900d555", - "name" : "role list", - "protocol" : "saml", - "protocolMapper" : "saml-role-list-mapper", - "consentRequired" : false, - "config" : { - "single" : "false", - "attribute.nameformat" : "Basic", - "attribute.name" : "Role" - } - }, { - "id" : "dc5c8901-5fb5-4dff-90aa-6d373e49293c", - "name" : "full name", - "protocol" : "openid-connect", - "protocolMapper" : "oidc-full-name-mapper", - "consentRequired" : true, - "consentText" : "${fullName}", - "config" : { - "id.token.claim" : "true", - "access.token.claim" : "true" - } - }, { - "id" : "908647d2-97d6-4897-980d-a0653d2c7581", - "name" : "username", - "protocol" : "openid-connect", - "protocolMapper" : "oidc-usermodel-property-mapper", - "consentRequired" : true, - "consentText" : "${username}", - "config" : { - "user.attribute" : "username", - "id.token.claim" : "true", - "access.token.claim" : "true", - "claim.name" : "preferred_username", - "jsonType.label" : "String" - } - }, { - "id" : "76fcd11a-93f6-4f49-8840-3990ba7bd6b5", - "name" : "email", - "protocol" : "openid-connect", - "protocolMapper" : "oidc-usermodel-property-mapper", - "consentRequired" : true, - "consentText" : "${email}", - "config" : { - "user.attribute" : "email", - "id.token.claim" : "true", - "access.token.claim" : "true", - "claim.name" : "email", - "jsonType.label" : "String" - } - }, { - "id" : "be669592-3cb1-4cc2-98e9-38181f52eb80", - "name" : "given name", - "protocol" : "openid-connect", - "protocolMapper" : "oidc-usermodel-property-mapper", - "consentRequired" : true, - "consentText" : "${givenName}", - "config" : { - "user.attribute" : "firstName", - "id.token.claim" : "true", - "access.token.claim" : "true", - "claim.name" : "given_name", - "jsonType.label" : "String" - } - } ] - }, { - "id" : "3a5f2f8b-48ad-470e-aee8-c71744367ef7", - "clientId" : "product-portal", - "adminUrl" : "/product-portal", - "baseUrl" : "/product-portal", - "surrogateAuthRequired" : false, - "enabled" : true, - "clientAuthenticatorType" : "client-secret", - "secret" : "password", - "redirectUris" : [ "/product-portal/*" ], - "webOrigins" : [ ], - "notBefore" : 0, - "bearerOnly" : false, - "consentRequired" : false, - "serviceAccountsEnabled" : false, - "directGrantsOnly" : false, - "publicClient" : false, - "frontchannelLogout" : false, - "attributes" : { }, - "fullScopeAllowed" : true, - "nodeReRegistrationTimeout" : -1, - "protocolMappers" : [ { - "id" : "22815b6d-d796-4381-866f-712814759109", - "name" : "given name", - "protocol" : "openid-connect", - "protocolMapper" : "oidc-usermodel-property-mapper", - "consentRequired" : true, - "consentText" : "${givenName}", - "config" : { - "user.attribute" : "firstName", - "id.token.claim" : "true", - "access.token.claim" : "true", - "claim.name" : "given_name", - "jsonType.label" : "String" - } - }, { - "id" : "5f837d0b-06d6-4208-a1aa-49d181f65cb8", - "name" : "email", - "protocol" : "openid-connect", - "protocolMapper" : "oidc-usermodel-property-mapper", - "consentRequired" : true, - "consentText" : "${email}", - "config" : { - "user.attribute" : "email", - "id.token.claim" : "true", - "access.token.claim" : "true", - "claim.name" : "email", - "jsonType.label" : "String" - } - }, { - "id" : "4c26aac4-b1c2-440a-bec9-af87ea8d5f8a", - "name" : "username", - "protocol" : "openid-connect", - "protocolMapper" : "oidc-usermodel-property-mapper", - "consentRequired" : true, - "consentText" : "${username}", - "config" : { - "user.attribute" : "username", - "id.token.claim" : "true", - "access.token.claim" : "true", - "claim.name" : "preferred_username", - "jsonType.label" : "String" - } - }, { - "id" : "2d1cfd33-7bdd-482d-9550-2cee022cd8cf", - "name" : "family name", - "protocol" : "openid-connect", - "protocolMapper" : "oidc-usermodel-property-mapper", - "consentRequired" : true, - "consentText" : "${familyName}", - "config" : { - "user.attribute" : "lastName", - "id.token.claim" : "true", - "access.token.claim" : "true", - "claim.name" : "family_name", - "jsonType.label" : "String" - } - }, { - "id" : "8ac85b5f-b149-4db7-b72e-3494ea9a6a2b", - "name" : "full name", - "protocol" : "openid-connect", - "protocolMapper" : "oidc-full-name-mapper", - "consentRequired" : true, - "consentText" : "${fullName}", - "config" : { - "id.token.claim" : "true", - "access.token.claim" : "true" - } - }, { - "id" : "dce387b1-0805-4f27-bbb0-d6a49294b9f5", - "name" : "role list", - "protocol" : "saml", - "protocolMapper" : "saml-role-list-mapper", - "consentRequired" : false, - "config" : { - "single" : "false", - "attribute.nameformat" : "Basic", - "attribute.name" : "Role" - } - } ] - }, { - "id" : "c581706b-5a96-4ad6-8e28-8221bc1ae866", - "clientId" : "account", - "name" : "${client_account}", - "baseUrl" : "/auth/realms/demo/account", - "surrogateAuthRequired" : false, - "enabled" : true, - "clientAuthenticatorType" : "client-secret", - "secret" : "b1cef9f4-3843-494f-8fab-2aea834f6d21", - "defaultRoles" : [ "view-profile", "manage-account" ], - "redirectUris" : [ "/auth/realms/demo/account/*" ], - "webOrigins" : [ ], - "notBefore" : 0, - "bearerOnly" : false, - "consentRequired" : false, - "serviceAccountsEnabled" : false, - "directGrantsOnly" : false, - "publicClient" : false, - "frontchannelLogout" : false, - "attributes" : { }, - "fullScopeAllowed" : false, - "nodeReRegistrationTimeout" : 0, - "protocolMappers" : [ { - "id" : "aeb1484c-04f0-4e1f-a73b-05ecf7019ec9", - "name" : "role list", - "protocol" : "saml", - "protocolMapper" : "saml-role-list-mapper", - "consentRequired" : false, - "config" : { - "single" : "false", - "attribute.nameformat" : "Basic", - "attribute.name" : "Role" - } - }, { - "id" : "9bfc7028-7345-42ee-9f2c-8d92bc96e7d7", - "name" : "username", - "protocol" : "openid-connect", - "protocolMapper" : "oidc-usermodel-property-mapper", - "consentRequired" : true, - "consentText" : "${username}", - "config" : { - "user.attribute" : "username", - "id.token.claim" : "true", - "access.token.claim" : "true", - "claim.name" : "preferred_username", - "jsonType.label" : "String" - } - }, { - "id" : "01d89081-4505-4223-96b0-934530f83ae8", - "name" : "family name", - "protocol" : "openid-connect", - "protocolMapper" : "oidc-usermodel-property-mapper", - "consentRequired" : true, - "consentText" : "${familyName}", - "config" : { - "user.attribute" : "lastName", - "id.token.claim" : "true", - "access.token.claim" : "true", - "claim.name" : "family_name", - "jsonType.label" : "String" - } - }, { - "id" : "bafbfb31-1a00-4527-a07d-5b11bbf3559e", - "name" : "email", - "protocol" : "openid-connect", - "protocolMapper" : "oidc-usermodel-property-mapper", - "consentRequired" : true, - "consentText" : "${email}", - "config" : { - "user.attribute" : "email", - "id.token.claim" : "true", - "access.token.claim" : "true", - "claim.name" : "email", - "jsonType.label" : "String" - } - }, { - "id" : "c8cdee70-744e-47dc-8ffc-d0b6c7526756", - "name" : "given name", - "protocol" : "openid-connect", - "protocolMapper" : "oidc-usermodel-property-mapper", - "consentRequired" : true, - "consentText" : "${givenName}", - "config" : { - "user.attribute" : "firstName", - "id.token.claim" : "true", - "access.token.claim" : "true", - "claim.name" : "given_name", - "jsonType.label" : "String" - } - }, { - "id" : "1311046e-aa5b-48d8-944f-adeea53e70a5", - "name" : "full name", - "protocol" : "openid-connect", - "protocolMapper" : "oidc-full-name-mapper", - "consentRequired" : true, - "consentText" : "${fullName}", - "config" : { - "id.token.claim" : "true", - "access.token.claim" : "true" - } - } ] - }, { - "id" : "e6e83103-2950-4bdf-8118-981be005aed6", - "clientId" : "offline-access-portal", - "adminUrl" : "/offline-access-portal", - "baseUrl" : "/offline-access-portal", - "surrogateAuthRequired" : false, - "enabled" : true, - "clientAuthenticatorType" : "client-secret", - "secret" : "password", - "redirectUris" : [ "/offline-access-portal/*" ], - "webOrigins" : [ ], - "notBefore" : 0, - "bearerOnly" : false, - "consentRequired" : true, - "serviceAccountsEnabled" : false, - "directGrantsOnly" : false, - "publicClient" : false, - "frontchannelLogout" : false, - "attributes" : { }, - "fullScopeAllowed" : false, - "nodeReRegistrationTimeout" : -1, - "protocolMappers" : [ { - "id" : "6f2943c7-a0d1-4439-8cb9-c7d92e016b91", - "name" : "role list", - "protocol" : "saml", - "protocolMapper" : "saml-role-list-mapper", - "consentRequired" : false, - "config" : { - "single" : "false", - "attribute.nameformat" : "Basic", - "attribute.name" : "Role" - } - }, { - "id" : "1957c63f-1bb8-4069-8b02-226656e957b6", - "name" : "full name", - "protocol" : "openid-connect", - "protocolMapper" : "oidc-full-name-mapper", - "consentRequired" : true, - "consentText" : "${fullName}", - "config" : { - "id.token.claim" : "true", - "access.token.claim" : "true" - } - }, { - "id" : "3a62f4e1-adb2-4b0e-be0a-46313896a5f7", - "name" : "family name", - "protocol" : "openid-connect", - "protocolMapper" : "oidc-usermodel-property-mapper", - "consentRequired" : true, - "consentText" : "${familyName}", - "config" : { - "user.attribute" : "lastName", - "id.token.claim" : "true", - "access.token.claim" : "true", - "claim.name" : "family_name", - "jsonType.label" : "String" - } - }, { - "id" : "952f391a-9ad8-49ab-81e5-58f0039de196", - "name" : "email", - "protocol" : "openid-connect", - "protocolMapper" : "oidc-usermodel-property-mapper", - "consentRequired" : true, - "consentText" : "${email}", - "config" : { - "user.attribute" : "email", - "id.token.claim" : "true", - "access.token.claim" : "true", - "claim.name" : "email", - "jsonType.label" : "String" - } - }, { - "id" : "cfb0cc2e-9e51-4df6-b8a5-8ab559cf7f21", - "name" : "given name", - "protocol" : "openid-connect", - "protocolMapper" : "oidc-usermodel-property-mapper", - "consentRequired" : true, - "consentText" : "${givenName}", - "config" : { - "user.attribute" : "firstName", - "id.token.claim" : "true", - "access.token.claim" : "true", - "claim.name" : "given_name", - "jsonType.label" : "String" - } - }, { - "id" : "85c67366-c1af-4257-8839-59e89410e16b", - "name" : "username", - "protocol" : "openid-connect", - "protocolMapper" : "oidc-usermodel-property-mapper", - "consentRequired" : true, - "consentText" : "${username}", - "config" : { - "user.attribute" : "username", - "id.token.claim" : "true", - "access.token.claim" : "true", - "claim.name" : "preferred_username", - "jsonType.label" : "String" - } - } ] - }, { - "id" : "ea87a33c-879d-4bc5-93dc-6bb85143387f", - "clientId" : "third-party", - "surrogateAuthRequired" : false, - "enabled" : true, - "clientAuthenticatorType" : "client-secret", - "secret" : "password", - "redirectUris" : [ "/oauth-client/*", "/oauth-client-cdi/*" ], - "webOrigins" : [ ], - "notBefore" : 0, - "bearerOnly" : false, - "consentRequired" : true, - "serviceAccountsEnabled" : false, - "directGrantsOnly" : false, - "publicClient" : false, - "frontchannelLogout" : false, - "attributes" : { }, - "fullScopeAllowed" : false, - "nodeReRegistrationTimeout" : -1, - "protocolMappers" : [ { - "id" : "d3053d4b-07aa-4c5d-a43e-414919df06ce", - "name" : "username", - "protocol" : "openid-connect", - "protocolMapper" : "oidc-usermodel-property-mapper", - "consentRequired" : true, - "consentText" : "${username}", - "config" : { - "user.attribute" : "username", - "id.token.claim" : "true", - "access.token.claim" : "true", - "claim.name" : "preferred_username", - "jsonType.label" : "String" - } - }, { - "id" : "c93190fc-8c0d-415c-879b-6f2ab78bbb67", - "name" : "family name", - "protocol" : "openid-connect", - "protocolMapper" : "oidc-usermodel-property-mapper", - "consentRequired" : true, - "consentText" : "${familyName}", - "config" : { - "user.attribute" : "lastName", - "id.token.claim" : "true", - "access.token.claim" : "true", - "claim.name" : "family_name", - "jsonType.label" : "String" - } - }, { - "id" : "201fb55f-f3ca-4ff9-8897-082751585274", - "name" : "email", - "protocol" : "openid-connect", - "protocolMapper" : "oidc-usermodel-property-mapper", - "consentRequired" : true, - "consentText" : "${email}", - "config" : { - "user.attribute" : "email", - "id.token.claim" : "true", - "access.token.claim" : "true", - "claim.name" : "email", - "jsonType.label" : "String" - } - }, { - "id" : "9b39c00f-fd99-43b0-bd9b-b925e6c311a2", - "name" : "full name", - "protocol" : "openid-connect", - "protocolMapper" : "oidc-full-name-mapper", - "consentRequired" : true, - "consentText" : "${fullName}", - "config" : { - "id.token.claim" : "true", - "access.token.claim" : "true" - } - }, { - "id" : "68749430-666c-424d-a0a2-17633bdd94d7", - "name" : "role list", - "protocol" : "saml", - "protocolMapper" : "saml-role-list-mapper", - "consentRequired" : false, - "config" : { - "single" : "false", - "attribute.nameformat" : "Basic", - "attribute.name" : "Role" - } - }, { - "id" : "af9a8820-0d8d-43bc-bbb7-19c404f3b371", - "name" : "given name", - "protocol" : "openid-connect", - "protocolMapper" : "oidc-usermodel-property-mapper", - "consentRequired" : true, - "consentText" : "${givenName}", - "config" : { - "user.attribute" : "firstName", - "id.token.claim" : "true", - "access.token.claim" : "true", - "claim.name" : "given_name", - "jsonType.label" : "String" - } - } ] - } ], - "browserSecurityHeaders" : { - "contentSecurityPolicy" : "frame-src 'self'", - "xFrameOptions" : "SAMEORIGIN" - }, - "smtpServer" : { }, - "eventsEnabled" : false, - "eventsListeners" : [ "jboss-logging" ], - "enabledEventTypes" : [ "SEND_RESET_PASSWORD", "SEND_VERIFY_EMAIL", "EXECUTE_ACTIONS_ERROR", "REMOVE_FEDERATED_IDENTITY", "REMOVE_CREDENTIAL", "UPDATE_TOTP", "REMOVE_TOTP", "REVOKE_GRANT", "LOGIN_ERROR", "CLIENT_LOGIN", "RESET_PASSWORD_ERROR", "CODE_TO_TOKEN_ERROR", "CUSTOM_REQUIRED_ACTION", "UPDATE_EMAIL", "REGISTER_ERROR", "LOGOUT_ERROR", "UPDATE_EMAIL_ERROR", "UPDATE_PROFILE_ERROR", "IMPERSONATE", "LOGIN", "UPDATE_PASSWORD_ERROR", "UPDATE_CREDENTIAL_ERROR", "CLIENT_UPDATE_ERROR", "UPDATE_PROFILE", "REGISTER", "LOGOUT", "FEDERATED_IDENTITY_LINK", "CLIENT_REGISTER_ERROR", "CLIENT_REGISTER", "SEND_VERIFY_EMAIL_ERROR", "UPDATE_CREDENTIAL", "UPDATE_PASSWORD", "RESET_PASSWORD", "FEDERATED_IDENTITY_LINK_ERROR", "CLIENT_DELETE", "REMOVE_CREDENTIAL_ERROR", "REMOVE_TOTP_ERROR", "VERIFY_EMAIL_ERROR", "VERIFY_EMAIL", "SEND_RESET_PASSWORD_ERROR", "CLIENT_DELETE_ERROR", "CLIENT_LOGIN_ERROR", "CLIENT_UPDATE", "REMOVE_FEDERATED_IDENTITY_ERROR", "EXECUTE_ACTIONS", "CUSTOM_REQUIRED_ACTION_ERROR", "UPDATE_TOTP_ERROR", "CODE_TO_TOKEN" ], - "adminEventsEnabled" : true, - "adminEventsDetailsEnabled" : true, - "identityProviders" : [ { - "alias" : "keycloak-oidc", - "internalId" : "1cd4f1db-a891-42fc-967f-651b4c5d5ac1", - "providerId" : "keycloak-oidc", - "enabled" : true, - "updateProfileFirstLoginMode" : "on", - "trustEmail" : false, - "storeToken" : false, - "addReadTokenRoleOnCreate" : false, - "authenticateByDefault" : false, - "config" : { - "clientSecret" : "foo", - "clientId" : "foo", - "tokenUrl" : "foo", - "authorizationUrl" : "foo" - } - }, { - "alias" : "oidc", - "internalId" : "1b566532-c396-42d0-9d5a-d8b2d374a4e2", - "providerId" : "oidc", - "enabled" : true, - "updateProfileFirstLoginMode" : "on", - "trustEmail" : false, - "storeToken" : false, - "addReadTokenRoleOnCreate" : false, - "authenticateByDefault" : false, - "config" : { - "clientSecret" : "asdf", - "clientId" : "asdf", - "tokenUrl" : "asdf", - "authorizationUrl" : "asdf" - } - } ], - "identityFederationEnabled" : true, - "internationalizationEnabled" : false, - "supportedLocales" : [ ], - "authenticationFlows" : [ { - "alias" : "reset credentials", - "description" : "Reset credentials for a user if they forgot their password or something", - "providerId" : "basic-flow", - "topLevel" : true, - "builtIn" : true, - "authenticationExecutions" : [ { - "authenticator" : "reset-credentials-choose-user", - "autheticatorFlow" : false, - "requirement" : "REQUIRED", - "userSetupAllowed" : false, - "priority" : 10 - }, { - "authenticator" : "reset-credential-email", - "autheticatorFlow" : false, - "requirement" : "REQUIRED", - "userSetupAllowed" : false, - "priority" : 20 - }, { - "authenticator" : "reset-password", - "autheticatorFlow" : false, - "requirement" : "REQUIRED", - "userSetupAllowed" : false, - "priority" : 30 - }, { - "authenticator" : "reset-otp", - "autheticatorFlow" : false, - "requirement" : "OPTIONAL", - "userSetupAllowed" : false, - "priority" : 40 - } ] - }, { - "alias" : "clients", - "description" : "Base authentication for clients", - "providerId" : "client-flow", - "topLevel" : true, - "builtIn" : true, - "authenticationExecutions" : [ { - "authenticator" : "client-secret", - "autheticatorFlow" : false, - "requirement" : "ALTERNATIVE", - "userSetupAllowed" : false, - "priority" : 10 - }, { - "authenticator" : "client-jwt", - "autheticatorFlow" : false, - "requirement" : "ALTERNATIVE", - "userSetupAllowed" : false, - "priority" : 20 - } ] - }, { - "alias" : "registration", - "description" : "registration flow", - "providerId" : "basic-flow", - "topLevel" : true, - "builtIn" : true, - "authenticationExecutions" : [ { - "authenticator" : "registration-page-form", - "flowAlias" : "registration form", - "autheticatorFlow" : true, - "requirement" : "REQUIRED", - "userSetupAllowed" : false, - "priority" : 10 - } ] - }, { - "alias" : "registration form", - "description" : "registration form", - "providerId" : "form-flow", - "topLevel" : false, - "builtIn" : true, - "authenticationExecutions" : [ { - "authenticator" : "registration-user-creation", - "autheticatorFlow" : false, - "requirement" : "REQUIRED", - "userSetupAllowed" : false, - "priority" : 20 - }, { - "authenticator" : "registration-profile-action", - "autheticatorFlow" : false, - "requirement" : "REQUIRED", - "userSetupAllowed" : false, - "priority" : 40 - }, { - "authenticator" : "registration-password-action", - "autheticatorFlow" : false, - "requirement" : "REQUIRED", - "userSetupAllowed" : false, - "priority" : 50 - }, { - "authenticator" : "registration-recaptcha-action", - "autheticatorFlow" : false, - "requirement" : "DISABLED", - "userSetupAllowed" : false, - "priority" : 60 - } ] - }, { - "alias" : "browser", - "description" : "browser based authentication", - "providerId" : "basic-flow", - "topLevel" : true, - "builtIn" : true, - "authenticationExecutions" : [ { - "authenticator" : "auth-cookie", - "autheticatorFlow" : false, - "requirement" : "ALTERNATIVE", - "userSetupAllowed" : false, - "priority" : 10 - }, { - "authenticator" : "auth-spnego", - "autheticatorFlow" : false, - "requirement" : "DISABLED", - "userSetupAllowed" : false, - "priority" : 20 - }, { - "flowAlias" : "forms", - "autheticatorFlow" : true, - "requirement" : "ALTERNATIVE", - "userSetupAllowed" : false, - "priority" : 30 - } ] - }, { - "alias" : "forms", - "description" : "Username, password, otp and other auth forms.", - "providerId" : "basic-flow", - "topLevel" : false, - "builtIn" : true, - "authenticationExecutions" : [ { - "authenticator" : "auth-username-password-form", - "autheticatorFlow" : false, - "requirement" : "REQUIRED", - "userSetupAllowed" : false, - "priority" : 10 - }, { - "authenticator" : "auth-otp-form", - "autheticatorFlow" : false, - "requirement" : "OPTIONAL", - "userSetupAllowed" : false, - "priority" : 20 - } ] - }, { - "alias" : "direct grant", - "description" : "OpenID Connect Resource Owner Grant", - "providerId" : "basic-flow", - "topLevel" : true, - "builtIn" : true, - "authenticationExecutions" : [ { - "authenticator" : "direct-grant-validate-username", - "autheticatorFlow" : false, - "requirement" : "REQUIRED", - "userSetupAllowed" : false, - "priority" : 10 - }, { - "authenticator" : "direct-grant-validate-password", - "autheticatorFlow" : false, - "requirement" : "REQUIRED", - "userSetupAllowed" : false, - "priority" : 20 - }, { - "authenticator" : "direct-grant-validate-otp", - "autheticatorFlow" : false, - "requirement" : "OPTIONAL", - "userSetupAllowed" : false, - "priority" : 30 - } ] - } ], - "authenticatorConfig" : [ ], - "requiredActions" : [ { - "alias" : "UPDATE_PROFILE", - "name" : "Update Profile", - "providerId" : "UPDATE_PROFILE", - "enabled" : true, - "defaultAction" : false, - "config" : { } - }, { - "alias" : "terms_and_conditions", - "name" : "Terms and Conditions", - "providerId" : "terms_and_conditions", - "enabled" : false, - "defaultAction" : false, - "config" : { } - }, { - "alias" : "VERIFY_EMAIL", - "name" : "Verify Email", - "providerId" : "VERIFY_EMAIL", - "enabled" : true, - "defaultAction" : false, - "config" : { } - }, { - "alias" : "CONFIGURE_TOTP", - "name" : "Configure Totp", - "providerId" : "CONFIGURE_TOTP", - "enabled" : true, - "defaultAction" : false, - "config" : { } - }, { - "alias" : "UPDATE_PASSWORD", - "name" : "Update Password", - "providerId" : "UPDATE_PASSWORD", - "enabled" : true, - "defaultAction" : false, - "config" : { } - } ], - "browserFlow" : "browser", - "registrationFlow" : "registration", - "directGrantFlow" : "direct grant", - "resetCredentialsFlow" : "reset credentials", - "clientAuthenticationFlow" : "clients" -}, { - "id" : "mynewrealm", - "realm" : "mynewrealm", - "notBefore" : 0, - "revokeRefreshToken" : false, - "accessTokenLifespan" : 300, - "ssoSessionIdleTimeout" : 1800, - "ssoSessionMaxLifespan" : 36000, - "offlineSessionIdleTimeout" : 2592000, - "accessCodeLifespan" : 60, - "accessCodeLifespanUserAction" : 300, - "accessCodeLifespanLogin" : 1800, - "enabled" : true, - "sslRequired" : "external", - "registrationAllowed" : false, - "registrationEmailAsUsername" : false, - "rememberMe" : false, - "verifyEmail" : false, - "resetPasswordAllowed" : false, - "editUsernameAllowed" : false, - "bruteForceProtected" : false, - "maxFailureWaitSeconds" : 900, - "minimumQuickLoginWaitSeconds" : 60, - "waitIncrementSeconds" : 60, - "quickLoginCheckMilliSeconds" : 1000, - "maxDeltaTimeSeconds" : 43200, - "failureFactor" : 30, - "privateKey" : "MIIEowIBAAKCAQEAipWMs6L7fIFbAwGkVkPN3sw7J3lkvcFP2XyBbWm4uEruNg8Tz6WL8jRLXKiO24xO1Krf5Rdh25JZKpluciXswb6funfdgb5N0IZhiSD/mpYmlZEH5O07yIv7ojq5aVc6ZTVnfj55wRn6t0UO9rrOsjwLasToT1QYKuQBatutkOzmsDn7tjFlncGCoIwbiK3/JNsARKI1Jc4JwwilE6HZSbqSEC5O5+SLeM6b5TQUP6zUAnDDk/Z93q7Yt66XsuOkqu4FaTfdpkQi+RkJKytTbnwZvD8523I14RJTAJvypaiWHyx6c6qlPAeLALhyfeRf3Ge8O/xdFwij63Wpk/EMbQIDAQABAoIBAAbAfIdwBGKvhrihxtjxGsGlH6ivsGnSVkqZV1D2WqqX8/0sROHUBfp588YC7Frj/h88aAYoWnsxKSj7KrdjA6L4351dI6yjkfT75xqgQfPNJvoYg9Lyf/woXc0soUXxmwW9UVqEPrhaxK1TLwR0W4exhzjfeRYMWdUVIMCNDWrHHSWR/ZIpyYWvZVl3PnqpBu8VM7Q60B8bNY2eUZxXuhknLZn4OfM1yqA25SnoRiyJlfObPPjcEoW7Rs9oTqGLowrQAE0ULMUSmwzhhG942/uO356WSZnGvchLIAa1lwbXdN0kqrG8cKALZYrtruQufc1k1WkrLY2TITJocMTYPoECgYEA7jBEm1rXbGZvhHZN1RMGQ33G1N6vql7k05Q+ztl+7VL0xbxF8bBewefJ4MoXyCSHHPE7QsN10ZwI7OMH4lBBoL5+tVZ+ZJC/Mo3IqLmZcoUJPazG0wWbYcmND9h9ww34Xhm+j+pLhlFc1EGfVyXPXM8FnvmjPPFOBlfk0UjMvuECgYEAlPKEo3OJJFAFV6beT0lbmVQqor6o/jxr7MGFBylFwz6Wbybxbi3XlFRdNtUVEzJWV6Si5W0977QcxyK7jRGiXnxYnTII8F18l04qMBlF6n/ehVqaI/bDiqX/57CbcOafU1AcOwAZvXb41nhI/Gg/L3qH+QUMBOhXDlcP/Sa9uw0CgYEA4NQU3mPH9h1W5DzbSOX1Qp2loec0/2clLYXAJ3XrNk7YlxEZIIKvXu7QguufuR6pnqshmepv+tQDJL9EAN5qpDVL2xVyprBumWR15LWUXyGuUFYXMrcXLR2Xlj5ur0AvkXtRgfzRH08LhZsPsa4R5vPOxXm0GOFZGem7JcVG5mECgYBUPZ26/DtSaFe9LUmKukiuPaYniYH22KGJtCHS3Qrx1FIs52+hCxhkchqOSpGy28NtqlXfQJvJGKs2DXTZ4mFc4yMTNRtNJvKyeKjvrzuV12A5N/b55DTQE/baSU6A2k6+Rg7RZ8snF0TBuCI/b45dAgYpVytnEyk5mRAX83NXeQKBgHT1GghcVVIi1A01fLJADUglFQz1pMiccr11NROeRJPb3EDWXEgSClB4hv5pHY9iUtNxYV7s3rhCdfc+uCevH6HZH2ge+7f9HW9xnz6tRg7vLXXyV9IdpLOUyvQQCaxZ7KzOt3aGdN5a4FWDkdVyLgtV5DI9P6765aTbSjDyIOJb", - "publicKey" : "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAipWMs6L7fIFbAwGkVkPN3sw7J3lkvcFP2XyBbWm4uEruNg8Tz6WL8jRLXKiO24xO1Krf5Rdh25JZKpluciXswb6funfdgb5N0IZhiSD/mpYmlZEH5O07yIv7ojq5aVc6ZTVnfj55wRn6t0UO9rrOsjwLasToT1QYKuQBatutkOzmsDn7tjFlncGCoIwbiK3/JNsARKI1Jc4JwwilE6HZSbqSEC5O5+SLeM6b5TQUP6zUAnDDk/Z93q7Yt66XsuOkqu4FaTfdpkQi+RkJKytTbnwZvD8523I14RJTAJvypaiWHyx6c6qlPAeLALhyfeRf3Ge8O/xdFwij63Wpk/EMbQIDAQAB", - "certificate" : "MIICozCCAYsCBgFRF+OJTTANBgkqhkiG9w0BAQsFADAVMRMwEQYDVQQDDApteW5ld3JlYWxtMB4XDTE1MTExNzIzNTc0NloXDTI1MTExNzIzNTkyNlowFTETMBEGA1UEAwwKbXluZXdyZWFsbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAIqVjLOi+3yBWwMBpFZDzd7MOyd5ZL3BT9l8gW1puLhK7jYPE8+li/I0S1yojtuMTtSq3+UXYduSWSqZbnIl7MG+n7p33YG+TdCGYYkg/5qWJpWRB+TtO8iL+6I6uWlXOmU1Z34+ecEZ+rdFDva6zrI8C2rE6E9UGCrkAWrbrZDs5rA5+7YxZZ3BgqCMG4it/yTbAESiNSXOCcMIpROh2Um6khAuTufki3jOm+U0FD+s1AJww5P2fd6u2Leul7LjpKruBWk33aZEIvkZCSsrU258Gbw/OdtyNeESUwCb8qWolh8senOqpTwHiwC4cn3kX9xnvDv8XRcIo+t1qZPxDG0CAwEAATANBgkqhkiG9w0BAQsFAAOCAQEABKsK6mIwhTAzWoXFzx/h5qhjF90i98KDZ+iGaicmInwDFu3txSnsHwLq48Pm5Ks0D2tVrBqbDEGOtCwNJkrvXEzpqDJVRtWpUUA5W5NHDH1YDRm2teusYCtL6ffmSGbV1YDC0j1puBPKEM9xJIB9fop3332hRynbVzQtFpOSGj9RgBJLt7QqGtCZaVSJ1o5fxbUESVgQ7LSUn4SuOGNYtdF0ftonNxkpQMzEUu2sFcGXgCsnatmEv3hnkgMloFxraka+ahYhB50L0Z/8fC1kKkMFyKO5QNFh3r+b5YA8NPLCWCsAn9Fmryc6q5rHxAhvFemMxUUOjo7tFwKzyf0bhA==", - "codeSecret" : "d3dbbfb5-5b6b-4122-9fcb-ff53d62aebfc", - "roles" : { - "realm" : [ { - "id" : "a8e5f6e3-9835-444d-8899-e884490cb1b4", - "name" : "offline_access", - "description" : "${role_offline-access}", - "scopeParamRequired" : true, - "composite" : false - } ], - "client" : { - "realm-management" : [ { - "id" : "7451f1ae-5cd1-4c8b-8c5f-75f5618321c2", - "name" : "view-identity-providers", - "description" : "${role_view-identity-providers}", - "scopeParamRequired" : false, - "composite" : false - }, { - "id" : "64d85ad6-3565-45cd-8d56-3e6aa108c345", - "name" : "create-client", - "description" : "${role_create-client}", - "scopeParamRequired" : false, - "composite" : false - }, { - "id" : "77b6cbf9-44a9-4137-940d-249104598691", - "name" : "manage-realm", - "description" : "${role_manage-realm}", - "scopeParamRequired" : false, - "composite" : false - }, { - "id" : "db6d4b5e-1eae-4a46-9e67-97c0ec102d0c", - "name" : "view-events", - "description" : "${role_view-events}", - "scopeParamRequired" : false, - "composite" : false - }, { - "id" : "b1db57ea-cc1f-4b9b-a200-1e0bb7ffd6c5", - "name" : "view-users", - "description" : "${role_view-users}", - "scopeParamRequired" : false, - "composite" : false - }, { - "id" : "822ac2e6-b399-41c6-9681-27472132df54", - "name" : "view-realm", - "description" : "${role_view-realm}", - "scopeParamRequired" : false, - "composite" : false - }, { - "id" : "9424dffd-57a7-49e6-8cdc-1789e98abed1", - "name" : "manage-users", - "description" : "${role_manage-users}", - "scopeParamRequired" : false, - "composite" : false - }, { - "id" : "82cae12f-28ce-4749-8e08-4047f7ff7e9d", - "name" : "impersonation", - "description" : "${role_impersonation}", - "scopeParamRequired" : false, - "composite" : false - }, { - "id" : "0edd1e08-69a5-4597-bc1a-3dee984a3224", - "name" : "realm-admin", - "description" : "${role_realm-admin}", - "scopeParamRequired" : false, - "composite" : true, - "composites" : { - "client" : { - "realm-management" : [ "create-client", "view-identity-providers", "manage-realm", "manage-events", "view-clients", "view-users", "view-events", "view-realm", "manage-clients", "manage-users", "impersonation", "manage-identity-providers" ] - } - } - }, { - "id" : "fee2975b-bcb1-48ab-a21d-90c0049fc57c", - "name" : "manage-identity-providers", - "description" : "${role_manage-identity-providers}", - "scopeParamRequired" : false, - "composite" : false - }, { - "id" : "a239851f-f8a9-4be0-bd10-95521c1a951b", - "name" : "manage-events", - "description" : "${role_manage-events}", - "scopeParamRequired" : false, - "composite" : false - }, { - "id" : "fe01f41a-600e-4e86-a530-b76d822d2ca0", - "name" : "view-clients", - "description" : "${role_view-clients}", - "scopeParamRequired" : false, - "composite" : false - }, { - "id" : "94072c24-1e70-4010-a146-9f72233c14e0", - "name" : "manage-clients", - "description" : "${role_manage-clients}", - "scopeParamRequired" : false, - "composite" : false - } ], - "security-admin-console" : [ ], - "broker" : [ { - "id" : "96a4a79d-e555-4820-88f0-62640639dc6e", - "name" : "read-token", - "description" : "${role_read-token}", - "scopeParamRequired" : false, - "composite" : false - } ], - "account" : [ { - "id" : "7091dbcd-9239-4f3c-b5a8-49466f004de4", - "name" : "view-profile", - "description" : "${role_view-profile}", - "scopeParamRequired" : false, - "composite" : false - }, { - "id" : "ae422f88-cd9c-4d12-80dd-6ff8230711d8", - "name" : "manage-account", - "description" : "${role_manage-account}", - "scopeParamRequired" : false, - "composite" : false - } ] - } - }, - "defaultRoles" : [ "offline_access" ], - "requiredCredentials" : [ "password" ], - "otpPolicyType" : "totp", - "otpPolicyAlgorithm" : "HmacSHA1", - "otpPolicyInitialCounter" : 0, - "otpPolicyDigits" : 6, - "otpPolicyLookAheadWindow" : 1, - "otpPolicyPeriod" : 30, - "clientScopeMappings" : { - "realm-management" : [ { - "client" : "security-admin-console", - "roles" : [ "realm-admin" ] - } ] - }, - "clients" : [ { - "id" : "51f01c15-294a-4f28-935b-b82995e9f90d", - "clientId" : "realm-management", - "name" : "${client_realm-management}", - "surrogateAuthRequired" : false, - "enabled" : true, - "clientAuthenticatorType" : "client-secret", - "secret" : "1d30c53d-6ca2-4d06-9736-8a69a7065923", - "redirectUris" : [ ], - "webOrigins" : [ ], - "notBefore" : 0, - "bearerOnly" : true, - "consentRequired" : false, - "serviceAccountsEnabled" : false, - "directGrantsOnly" : false, - "publicClient" : false, - "frontchannelLogout" : false, - "attributes" : { }, - "fullScopeAllowed" : false, - "nodeReRegistrationTimeout" : 0, - "protocolMappers" : [ { - "id" : "22b5b169-7ab9-4acb-b55c-4b7bd39f3759", - "name" : "role list", - "protocol" : "saml", - "protocolMapper" : "saml-role-list-mapper", - "consentRequired" : false, - "config" : { - "single" : "false", - "attribute.nameformat" : "Basic", - "attribute.name" : "Role" - } - }, { - "id" : "f18fca13-fd5c-4fda-9111-3b321db2e71b", - "name" : "username", - "protocol" : "openid-connect", - "protocolMapper" : "oidc-usermodel-property-mapper", - "consentRequired" : true, - "consentText" : "${username}", - "config" : { - "user.attribute" : "username", - "id.token.claim" : "true", - "access.token.claim" : "true", - "claim.name" : "preferred_username", - "jsonType.label" : "String" - } - }, { - "id" : "3f8d5e3f-0d5c-4ee9-94e7-8a803cb5a2ae", - "name" : "email", - "protocol" : "openid-connect", - "protocolMapper" : "oidc-usermodel-property-mapper", - "consentRequired" : true, - "consentText" : "${email}", - "config" : { - "user.attribute" : "email", - "id.token.claim" : "true", - "access.token.claim" : "true", - "claim.name" : "email", - "jsonType.label" : "String" - } - }, { - "id" : "8a521257-f201-47fb-b06f-17986eed4121", - "name" : "family name", - "protocol" : "openid-connect", - "protocolMapper" : "oidc-usermodel-property-mapper", - "consentRequired" : true, - "consentText" : "${familyName}", - "config" : { - "user.attribute" : "lastName", - "id.token.claim" : "true", - "access.token.claim" : "true", - "claim.name" : "family_name", - "jsonType.label" : "String" - } - }, { - "id" : "d0500f07-3d6b-4eb8-a954-2f9da4781854", - "name" : "full name", - "protocol" : "openid-connect", - "protocolMapper" : "oidc-full-name-mapper", - "consentRequired" : true, - "consentText" : "${fullName}", - "config" : { - "id.token.claim" : "true", - "access.token.claim" : "true" - } - }, { - "id" : "27521786-780e-4611-9091-edc8088aadd2", - "name" : "given name", - "protocol" : "openid-connect", - "protocolMapper" : "oidc-usermodel-property-mapper", - "consentRequired" : true, - "consentText" : "${givenName}", - "config" : { - "user.attribute" : "firstName", - "id.token.claim" : "true", - "access.token.claim" : "true", - "claim.name" : "given_name", - "jsonType.label" : "String" - } - } ] - }, { - "id" : "8cdfc36c-7d7e-4594-a25f-4894ef39269e", - "clientId" : "security-admin-console", - "name" : "${client_security-admin-console}", - "baseUrl" : "/auth/admin/mynewrealm/console/index.html", - "surrogateAuthRequired" : false, - "enabled" : true, - "clientAuthenticatorType" : "client-secret", - "secret" : "b787e86e-2dbb-4f10-b739-a24cc5d77fa5", - "redirectUris" : [ "/auth/admin/mynewrealm/console/*" ], - "webOrigins" : [ ], - "notBefore" : 0, - "bearerOnly" : false, - "consentRequired" : false, - "serviceAccountsEnabled" : false, - "directGrantsOnly" : false, - "publicClient" : true, - "frontchannelLogout" : false, - "attributes" : { }, - "fullScopeAllowed" : false, - "nodeReRegistrationTimeout" : 0, - "protocolMappers" : [ { - "id" : "d6268fe9-8b6c-4387-8bed-700e37d09e58", - "name" : "username", - "protocol" : "openid-connect", - "protocolMapper" : "oidc-usermodel-property-mapper", - "consentRequired" : true, - "consentText" : "${username}", - "config" : { - "user.attribute" : "username", - "id.token.claim" : "true", - "access.token.claim" : "true", - "claim.name" : "preferred_username", - "jsonType.label" : "String" - } - }, { - "id" : "4a761028-ee37-4bb5-b382-8ef084252901", - "name" : "role list", - "protocol" : "saml", - "protocolMapper" : "saml-role-list-mapper", - "consentRequired" : false, - "config" : { - "single" : "false", - "attribute.nameformat" : "Basic", - "attribute.name" : "Role" - } - }, { - "id" : "c8d53d5f-11d1-488e-a320-d00aace93c80", - "name" : "family name", - "protocol" : "openid-connect", - "protocolMapper" : "oidc-usermodel-property-mapper", - "consentRequired" : true, - "consentText" : "${familyName}", - "config" : { - "user.attribute" : "lastName", - "id.token.claim" : "true", - "access.token.claim" : "true", - "claim.name" : "family_name", - "jsonType.label" : "String" - } - }, { - "id" : "0d012254-c633-4d6b-b626-b87848d22cd6", - "name" : "locale", - "protocol" : "openid-connect", - "protocolMapper" : "oidc-usermodel-attribute-mapper", - "consentRequired" : false, - "consentText" : "${locale}", - "config" : { - "user.attribute" : "locale", - "id.token.claim" : "true", - "access.token.claim" : "true", - "claim.name" : "locale", - "jsonType.label" : "String" - } - }, { - "id" : "559f5ed9-7f60-4300-bcf4-bd7cf3209cff", - "name" : "email", - "protocol" : "openid-connect", - "protocolMapper" : "oidc-usermodel-property-mapper", - "consentRequired" : true, - "consentText" : "${email}", - "config" : { - "user.attribute" : "email", - "id.token.claim" : "true", - "access.token.claim" : "true", - "claim.name" : "email", - "jsonType.label" : "String" - } - }, { - "id" : "aa663b13-70e1-4394-a6e7-59ae369e0a91", - "name" : "full name", - "protocol" : "openid-connect", - "protocolMapper" : "oidc-full-name-mapper", - "consentRequired" : true, - "consentText" : "${fullName}", - "config" : { - "id.token.claim" : "true", - "access.token.claim" : "true" - } - }, { - "id" : "e0f351ca-2742-4fe1-a352-fa57e141a042", - "name" : "given name", - "protocol" : "openid-connect", - "protocolMapper" : "oidc-usermodel-property-mapper", - "consentRequired" : true, - "consentText" : "${givenName}", - "config" : { - "user.attribute" : "firstName", - "id.token.claim" : "true", - "access.token.claim" : "true", - "claim.name" : "given_name", - "jsonType.label" : "String" - } - } ] - }, { - "id" : "b10d68a4-175f-4065-a7e1-a3697dfc3dc1", - "clientId" : "broker", - "name" : "${client_broker}", - "surrogateAuthRequired" : false, - "enabled" : true, - "clientAuthenticatorType" : "client-secret", - "secret" : "8ed66cb4-c134-4972-ab2b-036a86318783", - "redirectUris" : [ ], - "webOrigins" : [ ], - "notBefore" : 0, - "bearerOnly" : false, - "consentRequired" : false, - "serviceAccountsEnabled" : false, - "directGrantsOnly" : false, - "publicClient" : false, - "frontchannelLogout" : false, - "attributes" : { }, - "fullScopeAllowed" : false, - "nodeReRegistrationTimeout" : 0, - "protocolMappers" : [ { - "id" : "c965a94c-3a83-4363-99f3-7057b73e908e", - "name" : "username", - "protocol" : "openid-connect", - "protocolMapper" : "oidc-usermodel-property-mapper", - "consentRequired" : true, - "consentText" : "${username}", - "config" : { - "user.attribute" : "username", - "id.token.claim" : "true", - "access.token.claim" : "true", - "claim.name" : "preferred_username", - "jsonType.label" : "String" - } - }, { - "id" : "cded7603-4742-47d4-a1b9-6a1a2df6194c", - "name" : "email", - "protocol" : "openid-connect", - "protocolMapper" : "oidc-usermodel-property-mapper", - "consentRequired" : true, - "consentText" : "${email}", - "config" : { - "user.attribute" : "email", - "id.token.claim" : "true", - "access.token.claim" : "true", - "claim.name" : "email", - "jsonType.label" : "String" - } - }, { - "id" : "e062d72d-f6fa-4f5a-a478-a946ad0c4517", - "name" : "role list", - "protocol" : "saml", - "protocolMapper" : "saml-role-list-mapper", - "consentRequired" : false, - "config" : { - "single" : "false", - "attribute.nameformat" : "Basic", - "attribute.name" : "Role" - } - }, { - "id" : "a447ff4f-cc24-413a-b45a-7894c88b7322", - "name" : "family name", - "protocol" : "openid-connect", - "protocolMapper" : "oidc-usermodel-property-mapper", - "consentRequired" : true, - "consentText" : "${familyName}", - "config" : { - "user.attribute" : "lastName", - "id.token.claim" : "true", - "access.token.claim" : "true", - "claim.name" : "family_name", - "jsonType.label" : "String" - } - }, { - "id" : "f251c7b4-84c9-423d-a2fe-2c4397632889", - "name" : "given name", - "protocol" : "openid-connect", - "protocolMapper" : "oidc-usermodel-property-mapper", - "consentRequired" : true, - "consentText" : "${givenName}", - "config" : { - "user.attribute" : "firstName", - "id.token.claim" : "true", - "access.token.claim" : "true", - "claim.name" : "given_name", - "jsonType.label" : "String" - } - }, { - "id" : "ad02d245-71a7-48d1-b6de-9b1478d47452", - "name" : "full name", - "protocol" : "openid-connect", - "protocolMapper" : "oidc-full-name-mapper", - "consentRequired" : true, - "consentText" : "${fullName}", - "config" : { - "id.token.claim" : "true", - "access.token.claim" : "true" - } - } ] - }, { - "id" : "633aca91-83e3-4e63-b4c2-f96f403612ec", - "clientId" : "account", - "name" : "${client_account}", - "baseUrl" : "/auth/realms/mynewrealm/account", - "surrogateAuthRequired" : false, - "enabled" : true, - "clientAuthenticatorType" : "client-secret", - "secret" : "f8529b2c-dd3e-4d94-af0f-84cf0d9d6abe", - "defaultRoles" : [ "view-profile", "manage-account" ], - "redirectUris" : [ "/auth/realms/mynewrealm/account/*" ], - "webOrigins" : [ ], - "notBefore" : 0, - "bearerOnly" : false, - "consentRequired" : false, - "serviceAccountsEnabled" : false, - "directGrantsOnly" : false, - "publicClient" : false, - "frontchannelLogout" : false, - "attributes" : { }, - "fullScopeAllowed" : false, - "nodeReRegistrationTimeout" : 0, - "protocolMappers" : [ { - "id" : "6eb34932-a782-4bdb-92fc-25c4d9d43cea", - "name" : "email", - "protocol" : "openid-connect", - "protocolMapper" : "oidc-usermodel-property-mapper", - "consentRequired" : true, - "consentText" : "${email}", - "config" : { - "user.attribute" : "email", - "id.token.claim" : "true", - "access.token.claim" : "true", - "claim.name" : "email", - "jsonType.label" : "String" - } - }, { - "id" : "5692f01f-29ae-4bf0-a3ee-5d6fe07ee3c2", - "name" : "full name", - "protocol" : "openid-connect", - "protocolMapper" : "oidc-full-name-mapper", - "consentRequired" : true, - "consentText" : "${fullName}", - "config" : { - "id.token.claim" : "true", - "access.token.claim" : "true" - } - }, { - "id" : "c89c87c2-cbdf-44df-bf5c-29ccf10728ef", - "name" : "username", - "protocol" : "openid-connect", - "protocolMapper" : "oidc-usermodel-property-mapper", - "consentRequired" : true, - "consentText" : "${username}", - "config" : { - "user.attribute" : "username", - "id.token.claim" : "true", - "access.token.claim" : "true", - "claim.name" : "preferred_username", - "jsonType.label" : "String" - } - }, { - "id" : "0337493e-7145-4555-936c-a84308017dcf", - "name" : "family name", - "protocol" : "openid-connect", - "protocolMapper" : "oidc-usermodel-property-mapper", - "consentRequired" : true, - "consentText" : "${familyName}", - "config" : { - "user.attribute" : "lastName", - "id.token.claim" : "true", - "access.token.claim" : "true", - "claim.name" : "family_name", - "jsonType.label" : "String" - } - }, { - "id" : "9dda80c0-0d15-4b75-a4fd-d261421a28a5", - "name" : "role list", - "protocol" : "saml", - "protocolMapper" : "saml-role-list-mapper", - "consentRequired" : false, - "config" : { - "single" : "false", - "attribute.nameformat" : "Basic", - "attribute.name" : "Role" - } - }, { - "id" : "940c8402-e4dd-41d9-94e6-6ef5654afd05", - "name" : "given name", - "protocol" : "openid-connect", - "protocolMapper" : "oidc-usermodel-property-mapper", - "consentRequired" : true, - "consentText" : "${givenName}", - "config" : { - "user.attribute" : "firstName", - "id.token.claim" : "true", - "access.token.claim" : "true", - "claim.name" : "given_name", - "jsonType.label" : "String" - } - } ] - } ], - "browserSecurityHeaders" : { - "contentSecurityPolicy" : "frame-src 'self'", - "xFrameOptions" : "SAMEORIGIN" - }, - "smtpServer" : { }, - "eventsEnabled" : false, - "eventsListeners" : [ "jboss-logging" ], - "enabledEventTypes" : [ ], - "adminEventsEnabled" : false, - "adminEventsDetailsEnabled" : false, - "identityFederationEnabled" : false, - "internationalizationEnabled" : false, - "supportedLocales" : [ ], - "authenticationFlows" : [ { - "alias" : "clients", - "description" : "Base authentication for clients", - "providerId" : "client-flow", - "topLevel" : true, - "builtIn" : true, - "authenticationExecutions" : [ { - "authenticator" : "client-secret", - "autheticatorFlow" : false, - "requirement" : "ALTERNATIVE", - "userSetupAllowed" : false, - "priority" : 10 - }, { - "authenticator" : "client-jwt", - "autheticatorFlow" : false, - "requirement" : "ALTERNATIVE", - "userSetupAllowed" : false, - "priority" : 20 - } ] - }, { - "alias" : "registration form", - "description" : "registration form", - "providerId" : "form-flow", - "topLevel" : false, - "builtIn" : true, - "authenticationExecutions" : [ { - "authenticator" : "registration-user-creation", - "autheticatorFlow" : false, - "requirement" : "REQUIRED", - "userSetupAllowed" : false, - "priority" : 20 - }, { - "authenticator" : "registration-profile-action", - "autheticatorFlow" : false, - "requirement" : "REQUIRED", - "userSetupAllowed" : false, - "priority" : 40 - }, { - "authenticator" : "registration-password-action", - "autheticatorFlow" : false, - "requirement" : "REQUIRED", - "userSetupAllowed" : false, - "priority" : 50 - }, { - "authenticator" : "registration-recaptcha-action", - "autheticatorFlow" : false, - "requirement" : "DISABLED", - "userSetupAllowed" : false, - "priority" : 60 - } ] - }, { - "alias" : "registration", - "description" : "registration flow", - "providerId" : "basic-flow", - "topLevel" : true, - "builtIn" : true, - "authenticationExecutions" : [ { - "authenticator" : "registration-page-form", - "flowAlias" : "registration form", - "autheticatorFlow" : true, - "requirement" : "REQUIRED", - "userSetupAllowed" : false, - "priority" : 10 - } ] - }, { - "alias" : "forms", - "description" : "Username, password, otp and other auth forms.", - "providerId" : "basic-flow", - "topLevel" : false, - "builtIn" : true, - "authenticationExecutions" : [ { - "authenticator" : "auth-username-password-form", - "autheticatorFlow" : false, - "requirement" : "REQUIRED", - "userSetupAllowed" : false, - "priority" : 10 - }, { - "authenticator" : "auth-otp-form", - "autheticatorFlow" : false, - "requirement" : "OPTIONAL", - "userSetupAllowed" : false, - "priority" : 20 - } ] - }, { - "alias" : "browser", - "description" : "browser based authentication", - "providerId" : "basic-flow", - "topLevel" : true, - "builtIn" : true, - "authenticationExecutions" : [ { - "authenticator" : "auth-cookie", - "autheticatorFlow" : false, - "requirement" : "ALTERNATIVE", - "userSetupAllowed" : false, - "priority" : 10 - }, { - "authenticator" : "auth-spnego", - "autheticatorFlow" : false, - "requirement" : "DISABLED", - "userSetupAllowed" : false, - "priority" : 20 - }, { - "flowAlias" : "forms", - "autheticatorFlow" : true, - "requirement" : "ALTERNATIVE", - "userSetupAllowed" : false, - "priority" : 30 - } ] - }, { - "alias" : "direct grant", - "description" : "OpenID Connect Resource Owner Grant", - "providerId" : "basic-flow", - "topLevel" : true, - "builtIn" : true, - "authenticationExecutions" : [ { - "authenticator" : "direct-grant-validate-username", - "autheticatorFlow" : false, - "requirement" : "REQUIRED", - "userSetupAllowed" : false, - "priority" : 10 - }, { - "authenticator" : "direct-grant-validate-password", - "autheticatorFlow" : false, - "requirement" : "REQUIRED", - "userSetupAllowed" : false, - "priority" : 20 - }, { - "authenticator" : "direct-grant-validate-otp", - "autheticatorFlow" : false, - "requirement" : "OPTIONAL", - "userSetupAllowed" : false, - "priority" : 30 - } ] - }, { - "alias" : "reset credentials", - "description" : "Reset credentials for a user if they forgot their password or something", - "providerId" : "basic-flow", - "topLevel" : true, - "builtIn" : true, - "authenticationExecutions" : [ { - "authenticator" : "reset-credentials-choose-user", - "autheticatorFlow" : false, - "requirement" : "REQUIRED", - "userSetupAllowed" : false, - "priority" : 10 - }, { - "authenticator" : "reset-credential-email", - "autheticatorFlow" : false, - "requirement" : "REQUIRED", - "userSetupAllowed" : false, - "priority" : 20 - }, { - "authenticator" : "reset-password", - "autheticatorFlow" : false, - "requirement" : "REQUIRED", - "userSetupAllowed" : false, - "priority" : 30 - }, { - "authenticator" : "reset-otp", - "autheticatorFlow" : false, - "requirement" : "OPTIONAL", - "userSetupAllowed" : false, - "priority" : 40 - } ] - } ], - "authenticatorConfig" : [ ], - "requiredActions" : [ { - "alias" : "UPDATE_PROFILE", - "name" : "Update Profile", - "providerId" : "UPDATE_PROFILE", - "enabled" : true, - "defaultAction" : false, - "config" : { } - }, { - "alias" : "UPDATE_PASSWORD", - "name" : "Update Password", - "providerId" : "UPDATE_PASSWORD", - "enabled" : true, - "defaultAction" : false, - "config" : { } - }, { - "alias" : "terms_and_conditions", - "name" : "Terms and Conditions", - "providerId" : "terms_and_conditions", - "enabled" : false, - "defaultAction" : false, - "config" : { } - }, { - "alias" : "CONFIGURE_TOTP", - "name" : "Configure Totp", - "providerId" : "CONFIGURE_TOTP", - "enabled" : true, - "defaultAction" : false, - "config" : { } - }, { - "alias" : "VERIFY_EMAIL", - "name" : "Verify Email", - "providerId" : "VERIFY_EMAIL", - "enabled" : true, - "defaultAction" : false, - "config" : { } - } ], - "browserFlow" : "browser", - "registrationFlow" : "registration", - "directGrantFlow" : "direct grant", - "resetCredentialsFlow" : "reset credentials", - "clientAuthenticationFlow" : "clients" -} ] \ No newline at end of file diff --git a/js/apps/admin-ui/cypress/support/commands.ts b/js/apps/admin-ui/cypress/support/commands.ts deleted file mode 100644 index 8144727c8e0..00000000000 --- a/js/apps/admin-ui/cypress/support/commands.ts +++ /dev/null @@ -1,39 +0,0 @@ -// *********************************************** -// This example commands.js shows you how to -// create various custom commands and overwrite -// existing commands. -// -// For more comprehensive examples of custom -// commands please read more here: -// https://on.cypress.io/custom-commands -// *********************************************** -// -// -// -- This is a parent command -- -// Cypress.Commands.add("login", (email, password) => { ... }) -// -// -// -- This is a child command -- -// Cypress.Commands.add("drag", { prevSubject: 'element'}, (subject, options) => { ... }) -// -// -// -- This is a dual command -- -// Cypress.Commands.add("dismiss", { prevSubject: 'optional'}, (subject, options) => { ... }) -// -// -// -- This will overwrite an existing command -- -// Cypress.Commands.overwrite("visit", (originalFn, url, options) => { ... }) - -import "@testing-library/cypress/add-commands"; -import "@4tw/cypress-drag-drop"; -import "cypress-axe"; - -Cypress.Commands.overwrite("checkA11y", (originalFn, options) => { - const mergedOptions = { - /* eslint-disable @typescript-eslint/no-misused-spread */ - ...(typeof options === "object" ? options : {}), - includedImpacts: ["critical", "serious"], - }; - - return originalFn(undefined, mergedOptions); -}); diff --git a/js/apps/admin-ui/cypress/support/constants.ts b/js/apps/admin-ui/cypress/support/constants.ts deleted file mode 100644 index 74c2fae875a..00000000000 --- a/js/apps/admin-ui/cypress/support/constants.ts +++ /dev/null @@ -1 +0,0 @@ -export const SERVER_URL = "http://localhost:8080"; diff --git a/js/apps/admin-ui/cypress/support/e2e.ts b/js/apps/admin-ui/cypress/support/e2e.ts deleted file mode 100644 index d076cec9fd3..00000000000 --- a/js/apps/admin-ui/cypress/support/e2e.ts +++ /dev/null @@ -1,20 +0,0 @@ -// *********************************************************** -// This example support/index.js is processed and -// loaded automatically before your test files. -// -// This is a great place to put global configuration and -// behavior that modifies Cypress. -// -// You can change the location of this file or turn off -// automatically serving support files with the -// 'supportFile' configuration option. -// -// You can read more here: -// https://on.cypress.io/configuration -// *********************************************************** - -// Import commands.js using ES2015 syntax: -import "./commands"; - -// Alternatively you can use CommonJS syntax: -// require('./commands') diff --git a/js/apps/admin-ui/cypress/support/forms/Form.ts b/js/apps/admin-ui/cypress/support/forms/Form.ts deleted file mode 100644 index d96cce34aba..00000000000 --- a/js/apps/admin-ui/cypress/support/forms/Form.ts +++ /dev/null @@ -1,17 +0,0 @@ -export default class Form { - static assertSaveButtonEnabled() { - this.#getSaveButton().should("be.enabled"); - } - - static assertSaveButtonDisabled() { - this.#getSaveButton().should("be.disabled"); - } - - static clickSaveButton() { - this.#getSaveButton().click(); - } - - static #getSaveButton() { - return cy.findByTestId("save"); - } -} diff --git a/js/apps/admin-ui/cypress/support/forms/FormValidation.ts b/js/apps/admin-ui/cypress/support/forms/FormValidation.ts deleted file mode 100644 index b8eec8acdae..00000000000 --- a/js/apps/admin-ui/cypress/support/forms/FormValidation.ts +++ /dev/null @@ -1,33 +0,0 @@ -export default class FormValidation { - static assertRequired(chain: Cypress.Chainable>) { - return this.assertMessage(chain, "Required field"); - } - - static assertMessage( - chain: Cypress.Chainable>, - expectedMessage: string, - ) { - return this.#getHelperText(chain).should("have.text", expectedMessage); - } - - static assertMinValue( - chain: Cypress.Chainable>, - minValue: number, - ) { - this.assertMessage(chain, `Must be greater than ${minValue}`); - } - - static assertMaxValue( - chain: Cypress.Chainable>, - maxValue: number, - ) { - this.assertMessage(chain, `Must be less than ${maxValue}`); - } - - static #getHelperText(chain: Cypress.Chainable>) { - // A regular ID selector doesn't work here so we have to query by attribute. - return chain - .invoke("attr", "data-testid") - .then((id) => cy.get(`[data-testid="${id}-helper"]`)); - } -} diff --git a/js/apps/admin-ui/cypress/support/forms/Select.ts b/js/apps/admin-ui/cypress/support/forms/Select.ts deleted file mode 100644 index 8d7aadae7fc..00000000000 --- a/js/apps/admin-ui/cypress/support/forms/Select.ts +++ /dev/null @@ -1,20 +0,0 @@ -export default class Select { - static assertSelectedItem( - chain: Cypress.Chainable>, - itemName: string, - ) { - chain.parent().should("have.text", itemName); - } - - static selectItem( - chain: Cypress.Chainable>, - itemName: string, - ) { - chain.click(); - this.#getSelectMenu(chain).contains(itemName).click(); - } - - static #getSelectMenu(chain: Cypress.Chainable>) { - return chain.parent().get(".pf-v5-c-menu__list"); - } -} diff --git a/js/apps/admin-ui/cypress/support/pages/CommonElements.ts b/js/apps/admin-ui/cypress/support/pages/CommonElements.ts deleted file mode 100644 index 791e7695f3d..00000000000 --- a/js/apps/admin-ui/cypress/support/pages/CommonElements.ts +++ /dev/null @@ -1,61 +0,0 @@ -import { trim } from "lodash-es"; - -export default class CommonElements { - protected parentSelector; - protected primaryBtn; - protected secondaryBtn; - protected secondaryBtnLink; - protected dropdownMenuItem; - protected selectMenuItem; - protected dropdownToggleBtn; - protected dropdownSelectToggleBtn; - protected dropdownSelectToggleItem; - protected tableKebabBtn; - - constructor(parentSelector = "") { - this.parentSelector = trim(parentSelector) + " "; - this.primaryBtn = this.parentSelector + ".pf-v5-c-button.pf-m-primary"; - this.secondaryBtn = this.parentSelector + ".pf-v5-c-button.pf-m-secondary"; - this.secondaryBtnLink = this.parentSelector + ".pf-v5-c-button.pf-m-link"; - this.dropdownMenuItem = - this.parentSelector + ".pf-v5-c-menu__list .pf-v5-c-menu__item"; - this.selectMenuItem = - this.parentSelector + ".pf-v5-c-menu__list .pf-v5-c-menu__list-item"; - this.dropdownToggleBtn = this.parentSelector + ".pf-v5-c-menu-toggle"; - this.tableKebabBtn = this.parentSelector + ".pf-v5-c-menu-toggle"; - this.dropdownSelectToggleBtn = this.parentSelector + ".pf-v5-c-menu-toggle"; - this.dropdownSelectToggleItem = - this.parentSelector + ".pf-v5-c-menu__list > li"; - } - - clickPrimaryBtn() { - cy.get(this.primaryBtn).click(); - return this; - } - - clickSecondaryBtn(buttonName: string, force = false) { - cy.get(this.secondaryBtn).contains(buttonName).click({ force: force }); - return this; - } - - checkIfExists(exist: boolean) { - cy.get(this.parentSelector).should((!exist ? "not." : "") + "exist"); - return this; - } - - checkElementIsDisabled( - element: Cypress.Chainable>, - disabled: boolean, - ) { - element.then(($btn) => { - if ($btn.hasClass("pf-m-disabled")) { - element.should( - (!disabled ? "not." : "") + "have.class", - "pf-m-disabled", - ); - } else { - element.should((!disabled ? "not." : "") + "have.attr", "disabled"); - } - }); - } -} diff --git a/js/apps/admin-ui/cypress/support/pages/CommonPage.ts b/js/apps/admin-ui/cypress/support/pages/CommonPage.ts deleted file mode 100644 index 22b690b280d..00000000000 --- a/js/apps/admin-ui/cypress/support/pages/CommonPage.ts +++ /dev/null @@ -1,57 +0,0 @@ -import Masthead from "./admin-ui/Masthead"; -import SidebarPage from "./admin-ui/SidebarPage"; -import TabUtils from "./admin-ui/components/TabPage"; -import FormUtils from "./admin-ui/components/FormPage"; -import ModalUtils from "../util/ModalUtils"; -import ActionToolbarUtils from "./admin-ui/components/ActionToolbarPage"; -import TableToolbarUtils from "./admin-ui/components/TableToolbarPage"; -import TableUtils from "./admin-ui/components/TablePage"; -import EmptyStatePage from "./admin-ui/components/EmptyStatePage"; - -export default class CommonPage { - #mastheadPage = new Masthead(); - #sidebarPage = new SidebarPage(); - #tabUtilsObj = new TabUtils(); - #formUtilsObj = new FormUtils(); - #modalUtilsObj = new ModalUtils(); - #actionToolbarUtilsObj = new ActionToolbarUtils(); - #tableUtilsObj = new TableUtils(); - #tableToolbarUtilsObj = new TableToolbarUtils(); - #emptyStatePage = new EmptyStatePage(); - - masthead() { - return this.#mastheadPage; - } - - sidebar() { - return this.#sidebarPage; - } - - tabUtils() { - return this.#tabUtilsObj; - } - - formUtils() { - return this.#formUtilsObj; - } - - modalUtils() { - return this.#modalUtilsObj; - } - - actionToolbarUtils() { - return this.#actionToolbarUtilsObj; - } - - tableUtils() { - return this.#tableUtilsObj; - } - - tableToolbarUtils() { - return this.#tableToolbarUtilsObj; - } - - emptyState() { - return this.#emptyStatePage; - } -} diff --git a/js/apps/admin-ui/cypress/support/pages/LoginPage.ts b/js/apps/admin-ui/cypress/support/pages/LoginPage.ts deleted file mode 100644 index ca2e058d155..00000000000 --- a/js/apps/admin-ui/cypress/support/pages/LoginPage.ts +++ /dev/null @@ -1,38 +0,0 @@ -export default class LoginPage { - #userNameInput = "#username"; - #passwordInput = "#password"; - #submitBtn = "#kc-login"; - - #oldLoadContainer = "#loading"; - #loadContainer = "div.keycloak__loading-container"; - - isLogInPage() { - cy.get(this.#userNameInput).should("exist"); - cy.url().should("include", "/auth"); - - return this; - } - - logIn(userName = "admin", password = "admin") { - cy.session( - [userName, password], - () => { - cy.visit("/"); - - cy.get('[role="progressbar"]').should("not.exist"); - cy.get(this.#oldLoadContainer).should("not.exist"); - cy.get(this.#loadContainer).should("not.exist"); - - cy.get(this.#userNameInput).type(userName); - cy.get(this.#passwordInput).type(password); - - cy.get(this.#submitBtn).click(); - }, - { - validate() { - cy.get('[role="progressbar"]').should("not.exist"); - }, - }, - ); - } -} diff --git a/js/apps/admin-ui/cypress/support/pages/ViewHeaderPage.ts b/js/apps/admin-ui/cypress/support/pages/ViewHeaderPage.ts deleted file mode 100644 index f4f95876f8f..00000000000 --- a/js/apps/admin-ui/cypress/support/pages/ViewHeaderPage.ts +++ /dev/null @@ -1,8 +0,0 @@ -export default class ListingPage { - #actionMenu = "action-dropdown"; - - clickAction(action: string) { - cy.findByTestId(this.#actionMenu).click().findByTestId(action).click(); - return this; - } -} diff --git a/js/apps/admin-ui/cypress/support/pages/admin-ui/CreateRealmPage.ts b/js/apps/admin-ui/cypress/support/pages/admin-ui/CreateRealmPage.ts deleted file mode 100644 index 82577ee8db1..00000000000 --- a/js/apps/admin-ui/cypress/support/pages/admin-ui/CreateRealmPage.ts +++ /dev/null @@ -1,63 +0,0 @@ -import FormValidation from "../../forms/FormValidation"; - -export default class CreateRealmPage { - #modalClearBtn = "clear-button"; - #realmNameInput = "realm"; - #enabledSwitch = ".pf-v5-c-toolbar .pf-v5-c-switch__toggle"; - #createBtn = '[data-testid="create"]'; - #cancelBtn = '[data-testid="cancel"]'; - #codeEditor = ".w-tc-editor-text"; - - #getClearBtn() { - return cy.findByText("Clear"); - } - - fillRealmName(realmName: string) { - cy.findByTestId(this.#realmNameInput).clear().type(realmName); - - return this; - } - - fillCodeEditor() { - cy.get(this.#codeEditor).type("clear this field"); - - return this; - } - - createRealm(wait = true) { - if (wait) { - cy.intercept("POST", "/admin/realms").as("createRealm"); - cy.get(this.#createBtn).click(); - cy.wait("@createRealm"); - } else { - cy.get(this.#createBtn).click(); - } - - return this; - } - - disableRealm() { - cy.get(this.#enabledSwitch).click(); - - return this; - } - - cancelRealmCreation() { - cy.get(this.#cancelBtn).click(); - - return this; - } - - clearTextField() { - this.#getClearBtn().click(); - cy.findByTestId(this.#modalClearBtn).click(); - - return this; - } - - verifyRealmNameFieldInvalid() { - FormValidation.assertRequired(cy.findByTestId(this.#realmNameInput)); - - return this; - } -} diff --git a/js/apps/admin-ui/cypress/support/pages/admin-ui/ListingPage.ts b/js/apps/admin-ui/cypress/support/pages/admin-ui/ListingPage.ts deleted file mode 100644 index 8e2f2c735bc..00000000000 --- a/js/apps/admin-ui/cypress/support/pages/admin-ui/ListingPage.ts +++ /dev/null @@ -1,487 +0,0 @@ -import CommonElements from "../CommonElements"; - -export enum Filter { - Name = "Name", - AssignedType = "Assigned type", - Protocol = "Protocol", -} - -export enum FilterAssignedType { - AllTypes = "All types", - Default = "Default", - Optional = "Optional", - None = "None", -} - -export enum FilterProtocol { - All = "All", - SAML = "SAML", - OpenID = "OpenID Connect", -} - -export enum FilterSession { - AllSessionTypes = "All session types", - RegularSSO = "Regular SSO", - Offline = "Offline", - DirectGrant = "Direct grant", - ServiceAccount = "Service account", -} - -export default class ListingPage extends CommonElements { - #tableToolbar = "section .pf-v5-c-toolbar"; - #itemsRows = "table:visible"; - #deleteUserButton = "delete-user-btn"; - #emptyListImg = '[role="tabpanel"]:not([hidden]) [data-testid="empty-state"]'; - #emptyState = "empty-state"; - #itemRowDrpDwn = ".pf-v5-c-table__action button"; - #itemRowSelect = "[data-testid='cell-dropdown']"; - #itemRowSelectItem = ".pf-v5-c-menu__item"; - #itemCheckbox = ".pf-v5-c-table__check"; - public exportBtn = '[role="menuitem"]:nth-child(1)'; - public deleteBtn = '[role="menuitem"]:nth-child(2)'; - #searchBtn = - ".pf-v5-c-page__main .pf-v5-c-toolbar__content-section button.pf-m-control:visible"; - #listHeaderPrimaryBtn = - ".pf-v5-c-page__main .pf-v5-c-toolbar__content-section .pf-m-primary:visible"; - #listHeaderSecondaryBtn = - ".pf-v5-c-page__main .pf-v5-c-toolbar__content-section .pf-m-link"; - #previousPageBtn = - ".pf-v5-c-pagination:not([class*=pf-m-bottom]) button[data-action=previous]"; - #nextPageBtn = - ".pf-v5-c-pagination:not([class*=pf-m-bottom]) button[data-action=next]"; - public tableRowItem = "tbody tr[data-ouia-component-type]:visible"; - #table = "table[aria-label]"; - #filterSessionDropdownButton = ".pf-v5-c-select button:nth-child(1)"; - #filterDropdownButton = "[data-testid='clientScopeSearchType']"; - #protocolFilterDropdownButton = "[data-testid='clientScopeSearchProtocol']"; - #kebabMenu = "[data-testid='kebab']"; - #dropdownItem = ".pf-v5-c-menu__list-item"; - #toolbarChangeType = "#change-type-dropdown"; - #tableNameColumnPrefix = "name-column-"; - #rowGroup = "table:visible tbody[role='rowgroup']"; - #tableHeaderCheckboxItemAllRows = "input[aria-label='Select all rows']"; - #searchBtnInModal = - ".pf-v5-c-modal-box .pf-v5-c-toolbar__content-section button.pf-m-control:visible"; - #menuContent = ".pf-v5-c-menu__content"; - #menuItemText = ".pf-v5-c-menu__item-text"; - - #getSearchInput() { - return cy.findAllByTestId("table-search-input").last().find("input"); - } - - showPreviousPageTableItems() { - cy.get(this.#previousPageBtn).first().click(); - - return this; - } - - showNextPageTableItems() { - cy.get("body").then(($body) => { - if (!$body.find('[data-testid="' + this.#nextPageBtn + '"]').length) { - cy.get(this.#nextPageBtn).scrollIntoView(); - cy.get(this.#nextPageBtn).click(); - } - }); - - return this; - } - - goToCreateItem() { - cy.get(this.#listHeaderPrimaryBtn).click(); - - return this; - } - - goToImportItem() { - cy.get(this.#listHeaderSecondaryBtn).click(); - - return this; - } - - searchItem(searchValue: string, wait = true, realm = "master") { - if (wait) { - const searchUrl = `/admin/realms/${realm}/**/*${searchValue}*`; - cy.intercept(searchUrl).as("search"); - } - - this.#getSearchInput().click({ force: true }); - this.#getSearchInput().clear(); - if (searchValue) { - this.#getSearchInput().type(searchValue); - cy.get(this.#searchBtn).click({ force: true }); - } else { - // TODO: Remove else and move clickSearchButton outside of the if - this.#getSearchInput().type("{enter}"); - } - - if (wait) { - cy.wait(["@search"]); - } - - return this; - } - - searchItemInModal(searchValue: string) { - this.#getSearchInput().click({ force: true }); - this.#getSearchInput().clear(); - if (searchValue) { - this.#getSearchInput().type(searchValue); - } - cy.get(this.#searchBtnInModal).click({ force: true }); - } - - checkTableLength(length: number, identifier: string) { - cy.get("table") - .should("have.class", identifier) - .get("tbody") - .children() - .should("have.length", length); - } - - clickSearchBarActionButton() { - cy.get(this.#tableToolbar).find(this.#kebabMenu).click(); - - return this; - } - - clickSearchBarActionItem(itemName: string) { - cy.get(this.#tableToolbar) - .find(this.#dropdownItem) - .contains(itemName) - .click(); - - return this; - } - - clickRowDetails(itemName: string) { - cy.get(this.#itemsRows) - .contains(itemName) - .parentsUntil("tbody") - .find(this.#itemRowDrpDwn) - .click({ force: true }); - return this; - } - - markItemRow(itemName: string) { - cy.get(this.#itemsRows) - .contains(itemName) - .parentsUntil("tbody") - .find('input[name*="checkrow"]') - .click(); - return this; - } - - removeMarkedItems(name: string = "Remove") { - cy.get(this.#listHeaderSecondaryBtn).contains(name).click(); - return this; - } - - checkRowColumnValue(itemName: string, column: number, value: string) { - cy.get(this.#itemsRows) - .contains(itemName) - .parentsUntil("tbody") - .find("td:nth-child(" + column + ")") - .should("have.text", value); - return this; - } - - clickDetailMenu(name: string) { - cy.get(this.#itemsRows).contains(name).click(); - return this; - } - - clickMenuDelete() { - cy.get(this.#menuContent) - .find(this.#menuItemText) - .contains("Delete") - .click({ force: true }); - return this; - } - - clickMenuDuplicate() { - cy.get(this.#menuContent) - .find(this.#menuItemText) - .contains("Duplicate") - .click({ force: true }); - return this; - } - - clickItemCheckbox(itemName: string) { - cy.get(this.#itemsRows) - .contains(itemName) - .parentsUntil("tbody") - .find(this.#itemCheckbox) - .click(); - return this; - } - - clickTableHeaderItemCheckboxAllRows() { - cy.get(this.#tableHeaderCheckboxItemAllRows).click(); - return this; - } - - clickRowSelectButton(itemName: string) { - cy.get(this.#itemsRows) - .contains(itemName) - .parentsUntil("tbody") - .find(this.#itemRowSelect) - .click(); - return this; - } - - clickPrimaryButton() { - cy.get(this.#listHeaderPrimaryBtn).click(); - - return this; - } - - clickRowSelectItem(rowItemName: string, selectItemName: string) { - this.clickRowSelectButton(rowItemName); - cy.get(this.#itemRowSelectItem).contains(selectItemName).click(); - - return this; - } - - itemExist(itemName: string, exist = true) { - cy.get(this.#itemsRows) - .contains(itemName) - .should((!exist ? "not." : "") + "exist"); - - return this; - } - - goToItemDetails(itemName: string) { - cy.get(this.#itemsRows).contains(itemName).click({ force: true }); - - return this; - } - - checkEmptyList() { - cy.get(this.#emptyListImg).should("be.visible"); - - return this; - } - - deleteItem(itemName: string) { - this.clickRowDetails(itemName); - this.clickMenuDelete(); - - return this; - } - - duplicateItem(itemName: string) { - this.clickRowDetails(itemName); - this.clickMenuDuplicate(); - - return this; - } - - removeItem(itemName: string) { - this.clickRowDetails(itemName); - this.clickDetailMenu("Unassign"); - - return this; - } - - deleteItemFromSearchBar(itemName: string) { - this.markItemRow(itemName); - cy.findByTestId(this.#deleteUserButton).click(); - - return this; - } - - exportItem(itemName: string) { - this.clickRowDetails(itemName); - this.clickDetailMenu("Export"); - - return this; - } - - checkEmptySearch() { - cy.get(this.tableRowItem).its("length").as("initialCount"); - this.searchItem("", false); - cy.get(this.tableRowItem).its("length").as("finalCount"); - - cy.get("@initialCount").then((initial) => { - cy.get("@finalCount").then((final) => { - expect(initial).to.eq(final); - }); - }); - - return this; - } - - itemsEqualTo(amount: number) { - cy.get(this.tableRowItem).its("length").should("be.eq", amount); - - return this; - } - - itemsGreaterThan(amount: number) { - cy.get(this.tableRowItem).its("length").should("be.gt", amount); - - return this; - } - - itemContainValue(itemName: string, colIndex: number, value: string) { - cy.get(this.#itemsRows) - .contains(itemName) - .parentsUntil("tbody") - .find("td") - .eq(colIndex) - .should("contain", value); - - return this; - } - - selectClientScopeFilter(filter: Filter) { - return this.selectFilter("clientScopeSearch", filter); - } - - protected selectFilter(searchTypeButtonTestId: string, filterStr: string) { - cy.get(`[data-testid='${searchTypeButtonTestId}']`).click(); - cy.get(this.#dropdownItem).contains(filterStr).click(); - - return this; - } - - selectSecondaryFilter(itemName: string) { - cy.get(this.#filterDropdownButton).click(); - cy.get(this.#itemRowSelectItem).contains(itemName).click(); - - return this; - } - - selectSecondaryFilterAssignedType(assignedType: FilterAssignedType) { - this.selectSecondaryFilter(assignedType); - - return this; - } - - selectSecondaryFilterProtocol(protocol: FilterProtocol) { - cy.get(this.#protocolFilterDropdownButton).click(); - cy.get(this.#itemRowSelectItem).contains(protocol).click(); - - return this; - } - - selectSecondaryFilterSession(sessionName: FilterSession) { - cy.get(this.#filterSessionDropdownButton).click(); - cy.get(this.#itemRowSelectItem).contains(sessionName); - - return this; - } - - changeTypeToOfSelectedItems(assignedType: FilterAssignedType) { - cy.intercept("/admin/realms/master/client-scopes").as("load"); - cy.get(this.#toolbarChangeType).click(); - cy.get(this.#itemRowSelectItem).contains(assignedType).click(); - cy.wait("@load"); - return this; - } - - changeTypeToOfItem(assignedType: FilterAssignedType, itemName: string) { - cy.get(this.#itemsRows) - .contains(itemName) - .parentsUntil("tbody") - .find(this.#toolbarChangeType) - .first() - .click(); - - cy.get(this.#itemsRows) - .contains(itemName) - .parentsUntil("tbody") - .find(this.#toolbarChangeType) - .contains(assignedType) - .click(); - - return this; - } - - checkInSearchBarChangeTypeToButtonIsDisabled(disabled: boolean = true) { - let condition = "be.disabled"; - if (!disabled) { - condition = "be.enabled"; - } - cy.get(this.#toolbarChangeType).first().should(condition); - - return this; - } - - checkDropdownItemIsDisabled(itemName: string, disabled: boolean = true) { - cy.get(this.#dropdownItem) - .contains(itemName) - .should((disabled ? "" : "not.") + "be.disabled"); - - return this; - } - - checkTableExists(exists: boolean = true) { - let condition = "be.visible"; - if (!exists) { - condition = "not.be.visible"; - } - cy.get(this.#table).should(condition); - - return this; - } - - #getResourceLink(name: string) { - return cy.findByTestId(this.#tableNameColumnPrefix + name); - } - - goToResourceDetails(name: string) { - this.#getResourceLink(name).click(); - return this; - } - - assertNoResults() { - cy.findByTestId(this.#emptyState).should("exist"); - } - - assertDefaultResource() { - this.assertResource("Default Resource"); - return this; - } - - assertResource(name: string) { - this.#getResourceLink(name).should("exist"); - return this; - } - - #getRowGroup(index = 0) { - return cy.get(this.#rowGroup).eq(index); - } - - expandRow(index = 0) { - this.#getRowGroup(index) - .find("[class='pf-v5-c-button pf-m-plain'][id*='expandable']") - .click(); - return this; - } - - collapseRow(index = 0) { - this.#getRowGroup(index) - .find( - "[class='pf-v5-c-button pf-m-plain pf-m-expanded'][id*='expandable']", - ) - .click(); - return this; - } - - assertExpandedRowContainText(index = 0, text: string) { - this.#getRowGroup(index) - .find("tr[class='pf-v5-c-table__expandable-row pf-m-expanded']") - .should("contain.text", text); - return this; - } - - assertRowIsExpanded(index = 0, isExpanded: boolean) { - this.#getRowGroup(index) - .find( - "[class='pf-v5-c-button pf-m-plain pf-m-expanded'][id*='expandable']", - ) - .should((!isExpanded ? "not." : "") + "exist"); - return this; - } -} diff --git a/js/apps/admin-ui/cypress/support/pages/admin-ui/Masthead.ts b/js/apps/admin-ui/cypress/support/pages/admin-ui/Masthead.ts deleted file mode 100644 index f63cb038b9c..00000000000 --- a/js/apps/admin-ui/cypress/support/pages/admin-ui/Masthead.ts +++ /dev/null @@ -1,141 +0,0 @@ -import CommonElements from "../CommonElements"; -export default class Masthead extends CommonElements { - #logoBtn = ".pf-v5-c-page__header-brand-link img"; - #helpBtn = "#help"; - - #userDrpDwn = "#user-dropdown"; - #userDrpDwnKebab = "#user-dropdown-kebab"; - #lastAlert = "last-alert"; - #globalAlerts = "global-alerts"; - #documentationLink = "#link"; - #backToAdminConsoleLink = "referrer-link"; - #userDrpdwnItem = ".pf-v5-c-menu__item"; - - #getLastAlert() { - return cy.findByTestId(this.#lastAlert); - } - - #getAlerts() { - return cy.findAllByTestId(this.#globalAlerts); - } - - checkIsAdminUI() { - cy.get(this.#logoBtn).should("exist"); - cy.get(this.#userDrpDwn).should("exist"); - - return this; - } - - setMobileMode(isMobileMode: boolean) { - if (isMobileMode) { - cy.viewport("iphone-6"); - } else { - cy.viewport(1024, 768); - } - } - - toggleGlobalHelp() { - cy.get(this.#helpBtn).click(); - cy.get("#enableHelp").click({ force: true }); - } - - toggleUsernameDropdown() { - this.userDropdown().click(); - return this; - } - - toggleMobileViewHelp() { - cy.get(this.#userDrpdwnItem).contains("Help").click(); - return this; - } - - clickRealmInfo() { - cy.get(this.#userDrpdwnItem).contains("Realm info").click(); - return this; - } - - clickGlobalHelp() { - cy.get(this.#helpBtn).click(); - return this; - } - - getDocumentationLink() { - return cy.get(this.#documentationLink); - } - - clickDocumentationLink() { - this.getDocumentationLink() - .find("a") - .invoke("removeAttr", "target") - .click(); - return this; - } - - goToAdminConsole() { - cy.findByTestId(this.#backToAdminConsoleLink).click({ force: true }); - return this; - } - - userDropdown() { - return cy - .document() - .then(({ documentElement }) => documentElement.getBoundingClientRect()) - .then(({ width }) => - cy.get(width < 1024 ? this.#userDrpDwnKebab : this.#userDrpDwn), - ); - } - - signOut() { - this.toggleUsernameDropdown(); - cy.get("#sign-out").click(); - Cypress.session.clearAllSavedSessions(); - } - - accountManagement() { - this.toggleUsernameDropdown(); - cy.get("#manage-account").click(); - } - - checkNotificationMessage(message: string | RegExp, closeNotification = true) { - const alertElement = this.#getLastAlert(); - - if (typeof message === "string") { - alertElement.should(($el) => expect($el).to.contain.text(message)); - } else { - alertElement.should(($el) => expect($el).to.match(message)); - } - - if (closeNotification) { - this.#getLastAlert().find("button").last().click({ force: true }); - } - return this; - } - - closeLastAlertMessage() { - this.#getLastAlert().find("button").click(); - return this; - } - - closeAllAlertMessages() { - this.#getAlerts().find("button").click({ - force: true, - multiple: true, - }); - - return this; - } - - assertIsDesktopView() { - cy.get(this.#userDrpDwn).should("be.visible"); - cy.get(this.#userDrpDwnKebab).should("not.be.visible"); - - return this; - } - - assertIsMobileView() { - cy.get(this.#userDrpDwn).should("not.be.visible"); - cy.get(this.#userDrpDwnKebab).should("be.visible"); - - return this; - } -} diff --git a/js/apps/admin-ui/cypress/support/pages/admin-ui/SidebarPage.ts b/js/apps/admin-ui/cypress/support/pages/admin-ui/SidebarPage.ts deleted file mode 100644 index d999674c98d..00000000000 --- a/js/apps/admin-ui/cypress/support/pages/admin-ui/SidebarPage.ts +++ /dev/null @@ -1,165 +0,0 @@ -import CommonElements from "../CommonElements"; - -export default class SidebarPage extends CommonElements { - #realmsDrpDwn = "realmSelector"; - #createRealmBtn = "add-realm"; - - #clientsBtn = "#nav-item-clients"; - #clientScopesBtn = "#nav-item-client-scopes"; - #realmRolesBtn = "#nav-item-roles"; - #usersBtn = "#nav-item-users"; - #groupsBtn = "#nav-item-groups"; - #sessionsBtn = "#nav-item-sessions"; - #eventsBtn = "#nav-item-events"; - - #realmSettingsBtn = "#nav-item-realm-settings"; - #authenticationBtn = "#nav-item-authentication"; - #identityProvidersBtn = "#nav-item-identity-providers"; - #userFederationBtn = "#nav-item-user-federation"; - - realmsElements = '[id="realm-select"] li'; - - showCurrentRealms(length: number) { - cy.findByTestId(this.#realmsDrpDwn).click(); - cy.get(this.realmsElements).contains("Loading realms…").should("not.exist"); - cy.get(this.realmsElements).should( - "have.length", - length + 2, // account for recent realms - ); - cy.findByTestId(this.#realmsDrpDwn).click({ force: true }); - - return this; - } - - realmExists(realmName: string, exists = true) { - cy.findByTestId(this.#realmsDrpDwn).click(); - cy.get(this.realmsElements).contains("Loading realms…").should("not.exist"); - cy.get(this.realmsElements) - .contains(realmName) - .should((exists ? "" : "not.") + "exist"); - cy.findByTestId(this.#realmsDrpDwn).click(); - - return this; - } - - getCurrentRealm() { - return cy.findByTestId(this.#realmsDrpDwn).scrollIntoView().invoke("text"); - } - - goToRealm(realmName: string) { - this.waitForPageLoad(); - cy.intercept("GET", "/admin/realms/master/ui-ext/realms/names/*").as( - "getRealms", - ); - cy.findByTestId(this.#realmsDrpDwn).click(); - cy.get(this.realmsElements).contains("Loading realms…").should("not.exist"); - cy.get(this.realmsElements).contains(realmName).click(); - this.waitForPageLoad(); - - return this; - } - - goToCreateRealm() { - this.waitForPageLoad(); - cy.findByTestId(this.#createRealmBtn).click(); - this.waitForPageLoad(); - - return this; - } - - goToClients() { - this.waitForPageLoad(); - cy.get(this.#clientsBtn).click({ force: true }); - this.waitForPageLoad(); - - return this; - } - - goToClientScopes() { - this.waitForPageLoad(); - cy.get(this.#clientScopesBtn).click(); - this.waitForPageLoad(); - - return this; - } - - goToRealmRoles() { - cy.get(this.#realmRolesBtn).click(); - this.waitForPageLoad(); - - return this; - } - - goToUsers() { - this.waitForPageLoad(); - cy.get(this.#usersBtn).click(); - this.waitForPageLoad(); - - return this; - } - - goToGroups() { - this.waitForPageLoad(); - cy.get(this.#groupsBtn).click(); - this.waitForPageLoad(); - - return this; - } - - goToSessions() { - this.waitForPageLoad(); - cy.get(this.#sessionsBtn).click(); - this.waitForPageLoad(); - - return this; - } - - goToEvents() { - this.waitForPageLoad(); - cy.get(this.#eventsBtn).click(); - this.waitForPageLoad(); - - return this; - } - - goToRealmSettings() { - this.waitForPageLoad(); - cy.get(this.#realmSettingsBtn).click({ force: true }); - this.waitForPageLoad(); - - return this; - } - - goToAuthentication() { - this.waitForPageLoad(); - cy.get(this.#authenticationBtn).click(); - this.waitForPageLoad(); - - return this; - } - - goToIdentityProviders() { - this.waitForPageLoad(); - cy.get(this.#identityProvidersBtn).click(); - this.waitForPageLoad(); - - return this; - } - - goToUserFederation() { - this.waitForPageLoad(); - cy.get(this.#userFederationBtn).click(); - this.waitForPageLoad(); - - return this; - } - - waitForPageLoad() { - cy.get('[role="progressbar"]').should("not.exist"); - return this; - } - - checkRealmSettingsLinkContainsText(expectedText: string) { - cy.get(this.#realmSettingsBtn).should("contain", expectedText); - } -} diff --git a/js/apps/admin-ui/cypress/support/pages/admin-ui/components/ActionToolbarPage.ts b/js/apps/admin-ui/cypress/support/pages/admin-ui/components/ActionToolbarPage.ts deleted file mode 100644 index 528cc73deaa..00000000000 --- a/js/apps/admin-ui/cypress/support/pages/admin-ui/components/ActionToolbarPage.ts +++ /dev/null @@ -1,37 +0,0 @@ -import CommonElements from "../../CommonElements"; - -export default class ActionToolbarPage extends CommonElements { - constructor() { - super(".pf-v5-l-level.pf-m-gutter"); - } - - get bearerOnlyExplainerLabelElement() { - return cy - .get(this.parentSelector) - .findByTestId("bearer-only-explainer-label"); - } - - get bearerOnlyExplainerTooltipElement() { - return cy.findByTestId("bearer-only-explainer-tooltip"); - } - - clickActionToggleButton() { - cy.get(this.parentSelector).findByTestId("action-dropdown").click(); - return this; - } - - #getDropdownItem(itemName: string) { - return cy.get(this.dropdownMenuItem).contains(itemName); - } - - checkActionItemExists(itemName: string, exists: boolean) { - const condition = exists ? "exist" : "not.exist"; - this.#getDropdownItem(itemName).should(condition); - return this; - } - - clickDropdownItem(itemName: string) { - this.#getDropdownItem(itemName).click(); - return this; - } -} diff --git a/js/apps/admin-ui/cypress/support/pages/admin-ui/components/EmptyStatePage.ts b/js/apps/admin-ui/cypress/support/pages/admin-ui/components/EmptyStatePage.ts deleted file mode 100644 index 71d25d5ce45..00000000000 --- a/js/apps/admin-ui/cypress/support/pages/admin-ui/components/EmptyStatePage.ts +++ /dev/null @@ -1,7 +0,0 @@ -import CommonElements from "../../CommonElements"; - -export default class EmptyStatePage extends CommonElements { - constructor() { - super(".pf-v5-c-empty-state__content"); - } -} diff --git a/js/apps/admin-ui/cypress/support/pages/admin-ui/components/FormPage.ts b/js/apps/admin-ui/cypress/support/pages/admin-ui/components/FormPage.ts deleted file mode 100644 index 8419d9fad25..00000000000 --- a/js/apps/admin-ui/cypress/support/pages/admin-ui/components/FormPage.ts +++ /dev/null @@ -1,35 +0,0 @@ -import CommonElements from "../../CommonElements"; - -export default class FormPage extends CommonElements { - constructor() { - super(".pf-v5-c-form:visible"); - } - - save() { - cy.get(this.primaryBtn).contains("Save").click(); - return this; - } - - add() { - cy.get(this.primaryBtn).contains("Add").click(); - return this; - } - - cancel() { - cy.get(this.secondaryBtnLink).contains("Cancel").click(); - return this; - } - - revert() { - cy.get(this.secondaryBtnLink).contains("Revert").click(); - return this; - } - - checkSaveButtonIsDisabled(disabled: boolean) { - this.checkElementIsDisabled( - cy.get(this.primaryBtn).contains("Save"), - disabled, - ); - return this; - } -} diff --git a/js/apps/admin-ui/cypress/support/pages/admin-ui/components/PageObject.ts b/js/apps/admin-ui/cypress/support/pages/admin-ui/components/PageObject.ts deleted file mode 100644 index 233d679919b..00000000000 --- a/js/apps/admin-ui/cypress/support/pages/admin-ui/components/PageObject.ts +++ /dev/null @@ -1,393 +0,0 @@ -export default class PageObject { - #selectItemSelectedIcon = ".pf-v5-c-menu-toggle__toggle-icon"; - #drpDwnMenuList = ".pf-v5-c-menu__list"; - #drpDwnMenuItem = ".pf-v5-c-menu__item"; - #drpDwnMenuToggleBtn = ".pf-v5-c-menu-toggle"; - #selectMenuList = ".pf-v5-c-menu__list"; - #selectMenuItem = ".pf-v5-c-menu__list-item"; - #selectMenuToggleBtn = ".pf-v5-c-menu-toggle"; - #switchInput = ".pf-v5-c-switch__input"; - #formLabel = ".pf-v5-c-form__label"; - #chipGroupCloseBtn = ".pf-v5-c-chip-group__close"; - #chipItem = ".pf-v5-c-chip-group__list-item"; - #emptyStateDiv = ".pf-v5-c-empty-state:visible"; - #toolbarActionsButton = ".pf-v5-c-toolbar button[aria-label='Actions']"; - #breadcrumbItem = ".pf-v5-c-breadcrumb .pf-v5-c-breadcrumb__item"; - - genericChipGroupSelector = ".pf-v5-c-chip-group"; - - protected assertExist(element: Cypress.Chainable, exist: boolean) { - element.should((!exist ? "not." : "") + "exist"); - return this; - } - - protected assertIsVisible( - element: Cypress.Chainable, - isVisible: boolean, - ) { - element.should((!isVisible ? "not." : "") + "be.visible"); - return this; - } - - protected assertIsEnabled( - element: Cypress.Chainable, - isEnabled = true, - ) { - element.then(($btn) => { - if ($btn.hasClass("pf-m-disabled")) { - element.should( - (isEnabled ? "not." : "") + "have.class", - "pf-m-disabled", - ); - } else { - element.should((isEnabled ? "not." : "") + "have.attr", "disabled"); - } - }); - return this; - } - - protected assertIsDisabled(element: Cypress.Chainable) { - return this.assertIsEnabled(element, false); - } - - protected assertHaveText(element: Cypress.Chainable, text: string) { - element.should("have.text", text); - return this; - } - - protected assertHaveValue(element: Cypress.Chainable, value: string) { - element.should("have.value", value); - return this; - } - - protected assertSwitchStateOn( - element?: Cypress.Chainable, - isOn = true, - ) { - (element ?? cy.get(this.#switchInput)) - .parent() - .contains(isOn ? "On" : "Off") - .should("be.visible"); - return this; - } - - protected assertSwitchStateOff(element?: Cypress.Chainable) { - return this.assertSwitchStateOn(element, false); - } - - protected assertDropdownMenuIsOpen( - isOpen = true, - element?: Cypress.Chainable, - ) { - this.assertExist(element ?? cy.get(this.#drpDwnMenuList), isOpen); - return this; - } - - protected assertDropdownMenuIsClosed(element?: Cypress.Chainable) { - return this.assertDropdownMenuIsOpen( - false, - element ?? cy.get(this.#drpDwnMenuList), - ); - } - - protected clickDropdownMenuItem( - itemName: string, - element?: Cypress.Chainable, - ) { - (element ?? cy.get(this.#drpDwnMenuItem).contains(itemName)).click(); - return this; - } - - protected clickDropdownMenuToggleButton( - itemName: string, - element?: Cypress.Chainable, - ) { - element = - element ?? - cy - .get(this.#drpDwnMenuToggleBtn) - .parent() - .contains(itemName) - .parent() - .parent(); - element.click(); - return this; - } - - protected openDropdownMenu( - itemName: string, - element?: Cypress.Chainable, - ) { - element = - element ?? - cy - .get(this.#drpDwnMenuToggleBtn) - .parent() - .contains(itemName) - .parent() - .parent(); - this.clickDropdownMenuToggleButton(itemName, element); - this.assertDropdownMenuIsOpen(true); - return this; - } - - protected closeDropdownMenu( - itemName: string, - element?: Cypress.Chainable, - ) { - element = - element ?? - cy - .get(this.#drpDwnMenuToggleBtn) - .parent() - .contains(itemName) - .parent() - .parent(); - this.clickDropdownMenuToggleButton(itemName, element); - this.assertDropdownMenuIsOpen(false); - return this; - } - - protected assertDropdownMenuItemIsSelected( - itemName: string, - isSelected: boolean, - element?: Cypress.Chainable, - ) { - element = element ?? cy.get(this.#drpDwnMenuItem); - this.assertExist( - element.contains(itemName).find(this.#selectItemSelectedIcon), - isSelected, - ); - return this; - } - - protected assertDropdownMenuHasItems( - items: string[], - element?: Cypress.Chainable, - ) { - const initialElement = element; - for (const item of items) { - element = initialElement ?? cy.get(this.#drpDwnMenuList); - this.assertExist(element.find(this.#drpDwnMenuItem).contains(item), true); - } - return this; - } - - protected assertDropdownMenuHasLabels( - items: string[], - element?: Cypress.Chainable, - ) { - const initialElement = element; - for (const item of items) { - element = initialElement ?? cy.get(this.#drpDwnMenuList); - this.assertExist(element.find(this.#formLabel).contains(item), true); - } - return this; - } - - protected assertDropdownMenuItemsEqualTo( - number: number, - element?: Cypress.Chainable, - ) { - element = element ?? cy.get(this.#drpDwnMenuList); - element.find(this.#drpDwnMenuItem).should(($item) => { - expect($item).to.have.length(number); - }); - return this; - } - - protected assertSelectMenuIsOpen( - isOpen = true, - element?: Cypress.Chainable, - ) { - element = element ?? cy.get(this.#selectMenuList); - return this.assertDropdownMenuIsOpen(isOpen, element); - } - - protected assertSelectMenuIsClosed(element?: Cypress.Chainable) { - element = element ?? cy.get(this.#selectMenuList); - return this.assertDropdownMenuIsClosed(element); - } - - protected clickSelectMenuItem( - itemName: string, - element?: Cypress.Chainable, - ) { - element = - element ?? - cy.get(this.#selectMenuItem).contains(new RegExp(`^${itemName}$`)); - return this.clickDropdownMenuItem(itemName, element); - } - - protected clickSelectMenuToggleButton( - itemName: string, - element?: Cypress.Chainable, - ) { - element = - element ?? - cy.get(this.#selectMenuToggleBtn).contains(itemName).parent().parent(); - return this.clickDropdownMenuToggleButton(itemName, element); - } - - protected openSelectMenu(itemName: string, element?: Cypress.Chainable) { - element = - element ?? - cy.get(this.#selectMenuToggleBtn).contains(itemName).parent().parent(); - this.clickDropdownMenuToggleButton(itemName, element); - this.assertSelectMenuIsOpen(true); - return this; - } - - protected closeSelectMenu( - itemName: string, - element?: Cypress.Chainable, - ) { - element = - element ?? - cy.get(this.#selectMenuToggleBtn).contains(itemName).parent().parent(); - this.clickDropdownMenuToggleButton(itemName, element); - this.assertSelectMenuIsOpen(false); - return this; - } - - protected assertSelectMenuItemIsSelected( - itemName: string, - isSelected: boolean, - element?: Cypress.Chainable, - ) { - element = element ?? cy.get(this.#selectMenuItem); - return this.assertDropdownMenuItemIsSelected(itemName, isSelected, element); - } - - protected assertSelectMenuHasItems( - items: string[], - element?: Cypress.Chainable, - ) { - const initialElement = element; - for (const item of items) { - element = initialElement ?? cy.get(this.#selectMenuList); - this.assertExist(element.find(this.#selectMenuItem).contains(item), true); - } - return this; - } - - protected assertSelectMenuItemsEqualTo( - number: number, - element?: Cypress.Chainable, - ) { - element = element ?? cy.get(this.#selectMenuList); - element.find(this.#selectMenuItem).should(($item) => { - expect($item).to.have.length(number); - }); - return this; - } - - #getChipGroup(groupSelector: string, groupName: string) { - return cy.get(groupSelector).contains(groupName).parent().parent(); - } - - #getChipGroupWithLabel(groupSelector: string, label: string) { - cy.get(groupSelector) - .parent() - .find(".pf-v5-c-chip-group__label") - .contains(label); - - return cy.get(groupSelector); - } - - #getChipGroupItem( - groupSelector: string, - groupName: string, - itemName: string, - ) { - return this.#getChipGroup(groupSelector, groupName) - .find(this.#chipItem) - .contains(itemName) - .parent(); - } - - protected removeChipGroup(groupSelector: string, groupName: string) { - this.#getChipGroup(groupSelector, groupName) - .find(this.#chipGroupCloseBtn) - .find("button") - .click(); - return this; - } - - protected removeChipGroupItem( - groupSelector: string, - groupName: string, - itemName: string, - ) { - this.#getChipGroupItem(groupSelector, groupName, itemName) - .find("button") - .click(); - return this; - } - - protected assertChipGroupExist( - groupSelector: string, - groupName: string, - exist: boolean, - ) { - this.assertExist(cy.contains(groupSelector, groupName), exist); - return this; - } - - protected clickToolbarAction(itemName: string) { - cy.get(this.#toolbarActionsButton).click(); - this.clickDropdownMenuItem(itemName); - return this; - } - - protected assertChipGroupItemExist( - groupSelector: string, - groupName: string, - itemName: string, - exist: boolean, - ) { - this.assertExist( - this.#getChipGroup(groupSelector, groupName).contains( - this.#chipItem, - itemName, - ), - exist, - ); - return this; - } - - protected assertLabeledChipGroupItemExist( - groupSelector: string, - labelName: string, - itemName: string, - exist: boolean, - ) { - this.assertExist( - this.#getChipGroupWithLabel(groupSelector, labelName).contains( - this.#chipItem, - itemName, - ), - exist, - ); - return this; - } - - assertEmptyStateExist(exist: boolean) { - if (exist) { - cy.get(this.#emptyStateDiv).should("exist").should("be.visible"); - } else { - cy.get(this.#emptyStateDiv).should("not.exist"); - } - return this; - } - - protected clickBreadcrumbItem(itemName: string) { - cy.get(this.#breadcrumbItem).contains(itemName).click(); - return this; - } - - protected waitForPageLoad() { - cy.get('[role="progressbar"]').should("not.exist"); - return this; - } -} diff --git a/js/apps/admin-ui/cypress/support/pages/admin-ui/components/TabPage.ts b/js/apps/admin-ui/cypress/support/pages/admin-ui/components/TabPage.ts deleted file mode 100644 index e0ac2d979ef..00000000000 --- a/js/apps/admin-ui/cypress/support/pages/admin-ui/components/TabPage.ts +++ /dev/null @@ -1,46 +0,0 @@ -import CommonElements from "../../CommonElements"; - -export default class TabPage extends CommonElements { - protected tabItemSelector: string; - protected tabsList: string; - - constructor() { - super(".pf-v5-c-tabs"); - this.tabItemSelector = ".pf-v5-c-tabs__item"; - this.tabsList = '[role="tablist"]'; - } - - #getTab(tabName: string, index: number | undefined = 0) { - return cy - .get(this.parentSelector) - .eq(index) - .find(this.tabItemSelector) - .contains(tabName); - } - - clickTab(tabName: string, index: number | undefined = 0) { - this.#getTab(tabName, index).click(); - this.checkIsCurrentTab(tabName, index); - return this; - } - - checkIsCurrentTab(tabName: string, index: number | undefined = 0) { - this.#getTab(tabName, index).parent().should("have.class", "pf-m-current"); - return this; - } - - checkTabExists( - tabName: string, - exists: boolean, - index: number | undefined = 0, - ) { - const condition = exists ? "exist" : "not.exist"; - this.#getTab(tabName, index).should(condition); - return this; - } - - checkNumberOfTabsIsEqual(number: number) { - cy.get(this.tabsList).find("li").should("have.length", number); - return this; - } -} diff --git a/js/apps/admin-ui/cypress/support/pages/admin-ui/components/TablePage.ts b/js/apps/admin-ui/cypress/support/pages/admin-ui/components/TablePage.ts deleted file mode 100644 index c4c6f56d7a1..00000000000 --- a/js/apps/admin-ui/cypress/support/pages/admin-ui/components/TablePage.ts +++ /dev/null @@ -1,191 +0,0 @@ -import CommonElements from "../../CommonElements"; - -export default class TablePage extends CommonElements { - #tableRowItem: string; - #tableRowItemChckBx: string; - #tableHeaderRowItem: string; - #tableKebabMenu: string; - #tableInModal: boolean; - static tableSelector = ".pf-v5-c-table"; - - constructor(parentElement?: string) { - super(parentElement ?? TablePage.tableSelector + ":visible"); - this.#tableRowItem = this.parentSelector + "tbody tr"; - this.#tableHeaderRowItem = this.parentSelector + "thead tr"; - this.#tableRowItemChckBx = ".pf-v5-c-table__check"; - this.#tableKebabMenu = ".pf-v5-c-menu"; - this.#tableInModal = false; - } - - setTableInModal(value: boolean) { - this.#tableInModal = value; - } - - selectRowItemCheckbox(itemName: string) { - cy.get( - (this.#tableInModal ? ".pf-v5-c-modal-box.pf-m-md " : "") + - this.#tableRowItem, - ) - .contains(itemName) - .parentsUntil("tbody") - .find(this.#tableRowItemChckBx) - .click(); - return this; - } - - clickRowItemLink(itemName: string) { - cy.get( - (this.#tableInModal ? ".pf-v5-c-modal-box.pf-m-md " : "") + - this.#tableRowItem, - ) - .contains(itemName) - .click({ force: true }); - return this; - } - - selectRowItemAction(itemName: string, actionItemName: string) { - this.#getRowItemAction(itemName, actionItemName).click(); - return this; - } - - assertRowItemActionExist(itemName: string, actionItemName: string) { - this.#getRowItemAction(itemName, actionItemName).should("exist"); - return this; - } - - #getRowItemAction(itemName: string, actionItemName: string) { - return cy - .get( - (this.#tableInModal ? ".pf-v5-c-modal-box.pf-m-md " : "") + - this.#tableRowItem, - ) - .contains(itemName) - .parentsUntil("tbody") - .find(".pf-v5-c-table__action .pf-v5-c-menu-toggle") - .click() - .get(this.#tableKebabMenu) - .contains(actionItemName); - } - - typeValueToRowItem(row: number, column: number, value: string) { - cy.get( - (this.#tableInModal ? ".pf-v5-c-modal-box.pf-m-md " : "") + - this.#tableRowItem + - ":nth-child(" + - row + - ")", - ) - .find("td:nth-child(" + column + ")") - .type(value); - return this; - } - - clickRowItemByIndex(row: number, column: number, appendChildren?: string) { - cy.get( - (this.#tableInModal ? ".pf-v5-c-modal-box.pf-m-md " : "") + - this.#tableRowItem + - ":nth-child(" + - row + - ")", - ) - .find("td:nth-child(" + column + ") " + appendChildren) - .click(); - return this; - } - - clickRowItemByItemName( - itemName: string, - column: number, - appendChildren?: string, - ) { - cy.get( - (this.#tableInModal ? ".pf-v5-c-modal-box.pf-m-md " : "") + - this.#tableRowItem, - ) - .find("td:nth-child(" + column + ") " + appendChildren) - .contains(itemName) - .click(); - return this; - } - - clickHeaderItem(column: number, appendChildren?: string) { - cy.get( - (this.#tableInModal ? ".pf-v5-c-modal-box.pf-m-md " : "") + - this.#tableHeaderRowItem, - ) - .find("th:nth-child(" + column + ") " + appendChildren) - .click(); - return this; - } - - checkRowItemsEqualTo(amount: number) { - cy.get( - (this.#tableInModal ? ".pf-v5-c-modal-box.pf-m-md " : "") + - this.#tableRowItem, - ) - .its("length") - .should("be.eq", amount); - return this; - } - - checkRowItemsGreaterThan(amount: number) { - cy.get( - (this.#tableInModal ? ".pf-v5-c-modal-box.pf-m-md " : "") + - this.#tableRowItem, - ) - .its("length") - .should("be.gt", amount); - return this; - } - - checkRowItemExists(itemName: string, exist = true) { - cy.get( - (this.#tableInModal ? ".pf-v5-c-modal-box.pf-m-md " : "") + - this.#tableRowItem, - ) - .contains(itemName) - .should((!exist ? "not." : "") + "exist"); - return this; - } - - checkTemporaryAdminLabelExists(labelId: string, exist = true) { - cy.get( - (this.#tableInModal ? ".pf-v5-c-modal-box.pf-m-md " : "") + - this.#tableRowItem, - ) - .find(`#${labelId}`) - .should((!exist ? "not." : "") + "exist"); - return this; - } - - checkRowItemValueByItemName(itemName: string, column: number, value: string) { - cy.get( - (this.#tableInModal ? ".pf-v5-c-modal-box.pf-m-md " : "") + - this.#tableRowItem, - ) - .contains(itemName) - .parentsUntil("tbody") - .find("td:nth-child(" + column + ")") - .should("have.text", value); - return this; - } - - checkRowItemValueByIndex( - row: number, - column: number, - value: string, - appendChildren?: string, - ) { - cy.get( - (this.#tableInModal ? ".pf-v5-c-modal-box.pf-m-md " : "") + - this.#tableRowItem + - ":nth-child(" + - row + - ")", - ) - .find("td:nth-child(" + column + ") " + appendChildren) - .should("have.text", value) - .should("have.value", value); - return this; - } -} diff --git a/js/apps/admin-ui/cypress/support/pages/admin-ui/components/TableToolbarPage.ts b/js/apps/admin-ui/cypress/support/pages/admin-ui/components/TableToolbarPage.ts deleted file mode 100644 index 500925ca528..00000000000 --- a/js/apps/admin-ui/cypress/support/pages/admin-ui/components/TableToolbarPage.ts +++ /dev/null @@ -1,130 +0,0 @@ -import CommonElements from "../../CommonElements"; -import type { Filter, FilterAssignedType } from "../ListingPage"; - -export default class TableToolbar extends CommonElements { - #searchBtn: string; - #searchInput: string; - #changeTypeBtn: string; - #nextPageBtn: string; - #previousPageBtn: string; - #searchTypeDropdownBtn: string; - #actionToggleBtn: string; - - constructor() { - super(".pf-v5-c-toolbar:visible"); - this.#searchBtn = - this.parentSelector + "button[aria-label='Search']:visible"; - this.#searchInput = - this.parentSelector + ".pf-v5-c-text-input-group__text-input:visible"; - this.#changeTypeBtn = this.parentSelector + "#change-type-dropdown"; - this.#nextPageBtn = this.parentSelector + "button[data-action=next]"; - this.#previousPageBtn = - this.parentSelector + "button[data-action=previous]"; - this.#searchTypeDropdownBtn = "[data-testid='clientScopeSearchType']"; - this.#actionToggleBtn = "[data-testid='kebab']"; - } - - clickNextPageButton(isUpperButton = true) { - if (isUpperButton) { - cy.get(this.#nextPageBtn).first().click(); - } else { - cy.get(this.#nextPageBtn).last().click(); - } - return this; - } - - clickPreviousPageButton(isUpperButton = true) { - if (isUpperButton) { - cy.get(this.#previousPageBtn).first().click(); - } else { - cy.get(this.#previousPageBtn).last().click(); - } - return this; - } - - clickActionItem(actionItemName: string) { - cy.get(this.#actionToggleBtn).click(); - cy.get(this.dropdownMenuItem).contains(actionItemName).click(); - return this; - } - - clickSearchButton() { - cy.get(this.#searchBtn).click({ force: true }); - return this; - } - - clickPrimaryButton(itemName?: string) { - if (itemName == undefined) { - cy.get(this.primaryBtn).click(); - } else { - cy.get(this.primaryBtn).contains(itemName).click(); - } - return this; - } - - clickDropdownMenuItem(itemName: string) { - cy.get(this.dropdownMenuItem).contains(itemName).click(); - return this; - } - - searchItem(searchValue: string, wait = true) { - if (wait) { - const searchUrl = `/admin/realms/*/*${searchValue}*`; - cy.intercept(searchUrl).as("search"); - } - cy.get(this.#searchInput).clear(); - if (searchValue) { - cy.get(this.#searchInput).type(searchValue); - this.clickSearchButton(); - } else { - // TODO: Remove else and move clickSearchButton outside of the if - cy.get(this.#searchInput).type("{enter}"); - } - if (wait) { - cy.wait(["@search"]); - } - return this; - } - - selectSearchType(existingName: Filter, itemName: Filter) { - cy.contains("button", existingName).click(); - cy.get(this.dropdownMenuItem).contains(itemName).click(); - return this; - } - - selectSecondarySearchType(itemName: FilterAssignedType) { - cy.get(this.#searchTypeDropdownBtn).click(); - cy.get(this.dropdownSelectToggleItem).contains(itemName).click(); - return this; - } - - changeTypeTo(itemName: FilterAssignedType) { - cy.get(this.#changeTypeBtn).click(); - cy.get(this.dropdownSelectToggleItem).contains(itemName).click(); - return this; - } - - addClientScope() { - cy.get(this.primaryBtn).contains("Add client scope").click(); - return this; - } - - createClient() { - cy.get(this.primaryBtn).contains("Create client").click(); - return this; - } - - addMapper() { - cy.get(this.primaryBtn).contains("Add mapper").click(); - return this; - } - - checkActionItemIsEnabled(actionItemName: string, enabled: boolean) { - cy.get(this.#actionToggleBtn).click(); - cy.get(this.dropdownMenuItem) - .contains(actionItemName) - .should((!enabled ? "not." : "") + "be.disabled"); - cy.get(this.#actionToggleBtn).click(); - return this; - } -} diff --git a/js/apps/admin-ui/cypress/support/pages/admin-ui/configure/realm_settings/PartialExportModal.ts b/js/apps/admin-ui/cypress/support/pages/admin-ui/configure/realm_settings/PartialExportModal.ts deleted file mode 100644 index 01146aa5259..00000000000 --- a/js/apps/admin-ui/cypress/support/pages/admin-ui/configure/realm_settings/PartialExportModal.ts +++ /dev/null @@ -1,25 +0,0 @@ -export default class PartialExportModal { - open() { - cy.findByTestId("openPartialExportModal").click(); - } - - exportButton() { - return cy.findByTestId("export-button"); - } - - cancelButton() { - return cy.findByTestId("cancel-button"); - } - - includeGroupsAndRolesSwitch() { - return cy.get("#include-groups-and-roles-check"); - } - - includeClientsSwitch() { - return cy.get("#include-clients-check"); - } - - warningMessage() { - return cy.findByTestId("warning-message"); - } -} diff --git a/js/apps/admin-ui/cypress/support/pages/admin-ui/configure/realm_settings/PartialImportModal.ts b/js/apps/admin-ui/cypress/support/pages/admin-ui/configure/realm_settings/PartialImportModal.ts deleted file mode 100644 index ffcc2bbec1b..00000000000 --- a/js/apps/admin-ui/cypress/support/pages/admin-ui/configure/realm_settings/PartialImportModal.ts +++ /dev/null @@ -1,96 +0,0 @@ -export default class GroupModal { - #openPartialImport = "openPartialImportModal"; - - open() { - cy.findByTestId(this.#openPartialImport).click(); - return this; - } - - typeResourceFile = (filename: string) => { - cy.get("#partial-import-file-filename").selectFile( - "cypress/fixtures/partial-import-test-data/" + filename, - { action: "drag-drop" }, - ); - }; - - textArea() { - return cy.get(".w-tc-editor-text"); - } - - importButton() { - return cy.findByTestId("import-button"); - } - - cancelButton() { - return cy.findByTestId("cancel-button"); - } - - clearButton() { - return cy.get("button").contains("Clear"); - } - - clickClearConfirmButton() { - cy.findByTestId("clear-button").click(); - } - - closeButton() { - return cy.findByTestId("close-button"); - } - - usersCheckbox() { - return cy.findByTestId("users-checkbox"); - } - - clientsCheckbox() { - return cy.findByTestId("clients-checkbox"); - } - - groupsCheckbox() { - return cy.findByTestId("groups-checkbox"); - } - - idpCheckbox() { - return cy.findByTestId("identityProviders-checkbox"); - } - - realmRolesCheckbox() { - return cy.findByTestId("realmRoles-checkbox"); - } - - clientRolesCheckbox() { - return cy.findByTestId("clientRoles-checkbox"); - } - - userCount() { - return this.usersCheckbox().get("label"); - } - - clientCount() { - return this.clientsCheckbox().get("label"); - } - - groupCount() { - return this.groupsCheckbox().get("label"); - } - - idpCount() { - return this.idpCheckbox().get("label"); - } - - realmRolesCount() { - return this.realmRolesCheckbox().get("label"); - } - - clientRolesCount() { - return this.clientRolesCheckbox().get("label"); - } - - realmSelector() { - return cy.get("#realm-selector"); - } - - selectRealm(realm: string) { - this.realmSelector().click(); - cy.findByTestId(realm + "-select-option").click(); - } -} diff --git a/js/apps/admin-ui/cypress/support/pages/admin-ui/configure/realm_settings/RealmSettings.ts b/js/apps/admin-ui/cypress/support/pages/admin-ui/configure/realm_settings/RealmSettings.ts deleted file mode 100644 index 02aede45865..00000000000 --- a/js/apps/admin-ui/cypress/support/pages/admin-ui/configure/realm_settings/RealmSettings.ts +++ /dev/null @@ -1,8 +0,0 @@ -export default class RealmSettings { - #actionDropdown = "action-dropdown"; - - clickActionMenu() { - cy.findByTestId(this.#actionDropdown).click(); - return this; - } -} diff --git a/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/AttributesTab.ts b/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/AttributesTab.ts deleted file mode 100644 index 65624b3744b..00000000000 --- a/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/AttributesTab.ts +++ /dev/null @@ -1,101 +0,0 @@ -export default class AttributesTab { - #saveAttributeBtn = "attributes-save"; - #attributesTab = "attributes"; - #emptyState = "attributes-empty-state"; - #addAttributeBtn: string; - #keyInput: string; - #valueInput: string; - #removeBtn: string; - - constructor(isForUser = false) { - if (isForUser) { - this.#addAttributeBtn = "unmanagedAttributes-add-row"; - this.#keyInput = "unmanagedAttributes-key"; - this.#valueInput = "unmanagedAttributes-value"; - this.#removeBtn = "unmanagedAttributes-remove"; - } else { - this.#addAttributeBtn = "attributes-add-row"; - this.#keyInput = "attributes-key"; - this.#valueInput = "attributes-value"; - this.#removeBtn = "attributes-remove"; - } - } - - public goToAttributesTab() { - cy.findByTestId(this.#attributesTab).click(); - - return this; - } - - public addAttribute(key: string, value: string) { - this.addAnAttributeButton(); - - cy.findAllByTestId(this.#keyInput) - .its("length") - .then((length) => { - this.#keyInputAt(length - 1).type(key, { force: true }); - this.#valueInputAt(length - 1).type(value, { force: true }); - }); - - return this; - } - - public checkAttribute(key: string, exist: boolean) { - cy.findByTestId(this.#keyInput).should((exist ? "" : "not.") + "exist"); - - if (exist) { - cy.findAllByTestId(this.#keyInput).invoke("val").should("eq", key); - } - - return this; - } - - public save() { - cy.findByTestId(this.#saveAttributeBtn).click(); - return this; - } - - public revert() { - cy.get(".pf-v5-c-button.pf-m-link").contains("Revert").click(); - return this; - } - - public deleteAttributeButton(row: number) { - this.#removeButtonAt(row).click({ force: true }); - return this; - } - - public addAnAttributeButton() { - cy.wait(1000); - cy.findByTestId(this.#addAttributeBtn).click(); - return this; - } - - public deleteAttribute(rowIndex: number) { - this.deleteAttributeButton(rowIndex); - this.save(); - - return this; - } - - public assertEmpty() { - cy.findByTestId(this.#emptyState).should("exist"); - } - - public assertRowItemsEqualTo(amount: number) { - cy.findAllByTestId(this.#keyInput).its("length").should("be.eq", amount); - return this; - } - - #keyInputAt(index: number) { - return cy.findAllByTestId(this.#keyInput).eq(index); - } - - #valueInputAt(index: number) { - return cy.findAllByTestId(this.#valueInput).eq(index); - } - - #removeButtonAt(index: number) { - return cy.findAllByTestId(this.#removeBtn).eq(index); - } -} diff --git a/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/KeyValueInput.ts b/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/KeyValueInput.ts deleted file mode 100644 index 4a0d15b9e21..00000000000 --- a/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/KeyValueInput.ts +++ /dev/null @@ -1,45 +0,0 @@ -import type { KeyValueType } from "../../../../../src/components/key-value-form/key-value-convert"; - -export default class KeyValueInput { - #name: string; - - constructor(name: string) { - this.#name = name; - } - - fillKeyValue({ key, value }: KeyValueType) { - cy.findByTestId(`${this.#name}-add-row`).click(); - - cy.findAllByTestId(`${this.#name}-key`) - .its("length") - .then((length) => { - this.keyInputAt(length - 1).type(key); - this.valueInputAt(length - 1).type(value); - }); - - return this; - } - - deleteRow(index: number) { - cy.findAllByTestId(`${this.#name}-remove`).eq(index).click(); - return this; - } - - validateRows(numberOfRows: number) { - cy.findAllByTestId(`${this.#name}-key`).should("have.length", numberOfRows); - return this; - } - - save() { - cy.findByTestId("attributes-save").click(); - return this; - } - - keyInputAt(index: number) { - return cy.findAllByTestId(`${this.#name}-key`).eq(index); - } - - valueInputAt(index: number) { - return cy.findAllByTestId(`${this.#name}-value`).eq(index); - } -} diff --git a/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/LegacyKeyValueInput.ts b/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/LegacyKeyValueInput.ts deleted file mode 100644 index 80c500a184c..00000000000 --- a/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/LegacyKeyValueInput.ts +++ /dev/null @@ -1,33 +0,0 @@ -import type { KeyValueType } from "../../../../../src/components/key-value-form/key-value-convert"; - -export default class LegacyKeyValueInput { - #name: string; - - constructor(name: string) { - this.#name = name; - } - - fillKeyValue({ key, value }: KeyValueType, index = 0) { - cy.findByTestId(`${this.#name}.${index}.key`).clear(); - cy.findByTestId(`${this.#name}.${index}.key`).type(key); - cy.findByTestId(`${this.#name}.${index}.value`).clear(); - cy.findByTestId(`${this.#name}.${index}.value`).type(value); - cy.findByTestId(`${this.#name}-add-row`).click(); - return this; - } - - deleteRow(index: number) { - cy.findByTestId(`${this.#name}.${index}.remove`).click(); - return this; - } - - validateRows(numberOfRows: number) { - cy.findAllByTestId("row").should("have.length", numberOfRows); - return this; - } - - save() { - cy.findByTestId("save-attributes").click(); - return this; - } -} diff --git a/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/RoleMappingTab.ts b/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/RoleMappingTab.ts deleted file mode 100644 index c7b4693291f..00000000000 --- a/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/RoleMappingTab.ts +++ /dev/null @@ -1,111 +0,0 @@ -const expect = chai.expect; -export default class RoleMappingTab { - #type = "client"; - #serviceAccountTab = "serviceAccountTab"; - #scopeTab = "scopeTab"; - #assignEmptyRoleBtn = (type: string) => - `no-roles-for-this-${type}-empty-action`; - #assignRoleBtn = "assignRole"; - #unAssignBtn = "unAssignRole"; - #unAssignDrpDwnBtn = '.pf-v5-c-table__action li button[role="menuitem"]'; - #assignBtn = "assign"; - #hideInheritedRolesBtn = "#hideInheritedRoles"; - #assignedRolesTable = "assigned-roles"; - #namesColumn = "td:visible"; - #roleMappingTab = "role-mapping-tab"; - #filterTypeDropdown = "filter-type-dropdown"; - - constructor(type: string) { - this.#type = type; - } - - goToServiceAccountTab() { - cy.findByTestId(this.#serviceAccountTab).click(); - return this; - } - - goToScopeTab() { - cy.findByTestId(this.#scopeTab).click(); - return this; - } - - assignRole(notEmpty = true) { - cy.findByTestId( - notEmpty ? this.#assignEmptyRoleBtn(this.#type) : this.#assignRoleBtn, - ).click(); - return this; - } - - assign() { - cy.findByTestId(this.#assignBtn).click(); - return this; - } - - unAssign() { - cy.findByTestId(this.#unAssignBtn).click(); - return this; - } - - unAssignFromDropdown() { - cy.get(this.#unAssignDrpDwnBtn).click(); - return this; - } - - hideInheritedRoles() { - cy.get(this.#hideInheritedRolesBtn).check(); - return this; - } - - unhideInheritedRoles() { - cy.get(this.#hideInheritedRolesBtn).uncheck({ force: true }); - return this; - } - - changeRoleTypeFilter(filter: string) { - // Invert the filter because the testid of the DropdownItem is the current filter - const option = filter == "roles" ? "clients" : "roles"; - - cy.findByTestId(this.#filterTypeDropdown).click(); - cy.findByTestId(option).click(); - - cy.get('[role="progressbar"]').should("not.exist"); - - return this; - } - - selectRow(name: string, modal = false) { - cy.get(modal ? ".pf-v5-c-modal-box " : "" + this.#namesColumn) - .contains(name) - .parents("tr") - .within(() => { - cy.get("input").click(); - }); - return this; - } - - checkRoles(roleNames: string[], exist = true) { - if (roleNames.length) { - cy.findByTestId(this.#assignedRolesTable) - .get(this.#namesColumn) - .should((roles) => { - for (let index = 0; index < roleNames.length; index++) { - const roleName = roleNames[index]; - - if (exist) { - expect(roles).to.contain(roleName); - } else { - expect(roles).not.to.contain(roleName); - } - } - }); - } else { - cy.findByTestId(this.#assignedRolesTable).should("not.exist"); - } - return this; - } - - goToRoleMappingTab() { - cy.findByTestId(this.#roleMappingTab).click(); - return this; - } -} diff --git a/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/authentication/BindFlowModal.ts b/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/authentication/BindFlowModal.ts deleted file mode 100644 index aa8a67a6b3b..00000000000 --- a/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/authentication/BindFlowModal.ts +++ /dev/null @@ -1,18 +0,0 @@ -import ModalUtils from "../../../../util/ModalUtils"; - -export default class BindFlowModal extends ModalUtils { - #bindingType = "#chooseBindingType"; - #dropdownSelectToggleItem = ".pf-v5-c-menu__list > li"; - - fill(bindingType: string) { - cy.get(this.#bindingType).click(); - cy.get(this.#dropdownSelectToggleItem).contains(bindingType).click(); - return this; - } - - save() { - cy.findAllByTestId("save").click(); - - return this; - } -} diff --git a/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/authentication/CIBAPolicyPage.ts b/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/authentication/CIBAPolicyPage.ts deleted file mode 100644 index 2e24ed4b6ed..00000000000 --- a/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/authentication/CIBAPolicyPage.ts +++ /dev/null @@ -1,27 +0,0 @@ -import Masthead from "../../Masthead"; - -const masthead = new Masthead(); - -export default class CIBAPolicyPage { - static goToTab() { - cy.findByTestId("policies").click(); - cy.findByTestId("tab-ciba-policy").click(); - return this; - } - - static getBackchannelTokenDeliveryModeSelect() { - return cy.get("#cibaBackchannelTokenDeliveryMode"); - } - - static getExpiresInput() { - return cy.findByTestId("attributes.cibaExpiresIn"); - } - - static getIntervalInput() { - return cy.findByTestId("attributes.cibaInterval"); - } - - static assertSaveSuccess() { - masthead.checkNotificationMessage("CIBA policy successfully updated"); - } -} diff --git a/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/authentication/DuplicateFlowModal.ts b/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/authentication/DuplicateFlowModal.ts deleted file mode 100644 index cdec8feca10..00000000000 --- a/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/authentication/DuplicateFlowModal.ts +++ /dev/null @@ -1,22 +0,0 @@ -export default class DuplicateFlowModal { - #nameInput = "alias"; - #descriptionInput = "description"; - #confirmButton = "confirm"; - #errorText = ".pf-m-error"; - - fill(name?: string, description?: string) { - cy.findByTestId(this.#nameInput).clear(); - if (name) { - cy.findByTestId(this.#nameInput).type(name); - if (description) - cy.findByTestId(this.#descriptionInput).type(description); - } - - cy.findByTestId(this.#confirmButton).click(); - return this; - } - - shouldShowError(message: string) { - cy.get(this.#errorText).invoke("text").should("contain", message); - } -} diff --git a/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/authentication/FlowDetail.ts b/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/authentication/FlowDetail.ts deleted file mode 100644 index 39860de9583..00000000000 --- a/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/authentication/FlowDetail.ts +++ /dev/null @@ -1,120 +0,0 @@ -import Select from "../../../../forms/Select"; - -type RequirementType = "Required" | "Alternative" | "Disabled" | "Conditional"; - -export default class FlowDetails { - executionExists(name: string, exist = true) { - this.#getExecution(name).should((!exist ? "not." : "") + "exist"); - return this; - } - - flowExists(name: string) { - cy.findAllByText(name).should("exist"); - return this; - } - - #getExecution(name: string) { - return cy.findByTestId(name); - } - - moveRowTo(from: string, to: string) { - cy.findAllByTestId(from).drag(to); - - return this; - } - - expectPriorityChange(execution: string, callback: () => void) { - cy.findAllByTestId(execution).then((rowDetails) => { - const executionId = rowDetails.children().attr("data-id"); - cy.intercept( - "POST", - `/admin/realms/test*/authentication/executions/${executionId}/lower-priority`, - ).as("priority"); - callback(); - cy.wait("@priority"); - }); - } - - changeRequirement(execution: string, requirement: RequirementType) { - this.#getExecution(execution) - .parentsUntil(".keycloak__authentication__flow-row") - .find(".keycloak__authentication__requirement-dropdown") - .click() - .parent() - .contains(requirement) - .click(); - return this; - } - - goToDiagram() { - cy.get("#diagramView").click(); - return this; - } - - #clickEditDropdownForFlow(subFlowName: string, option: string) { - cy.findByTestId(`${subFlowName}-edit-dropdown`) - .click() - .parent() - .contains(option) - .click(); - } - - addExecution(subFlowName: string, executionTestId: string) { - this.#clickEditDropdownForFlow(subFlowName, "Add execution"); - - cy.get(".pf-v5-c-pagination").should("exist"); - cy.findByTestId(executionTestId).click(); - cy.findByTestId("modal-add").click(); - - return this; - } - - addCondition(subFlowName: string, executionTestId: string) { - this.#clickEditDropdownForFlow(subFlowName, "Add condition"); - - cy.findByTestId(executionTestId).click(); - cy.findByTestId("modal-add").click(); - - return this; - } - - addSubFlow(subFlowName: string, name: string) { - this.#clickEditDropdownForFlow(subFlowName, "Add sub-flow"); - this.#fillSubFlowModal(subFlowName, name); - - return this; - } - - clickRowDelete(name: string) { - cy.findByTestId(`${name}-delete`).click(); - - return this; - } - - #fillSubFlowModal(subFlowName: string, name: string) { - cy.get(".pf-v5-c-modal-box__title-text").contains( - "Add sub-flow to " + subFlowName, - ); - cy.findByTestId("name").type(name); - cy.findByTestId("modal-add").click(); - } - - fillCreateForm( - name: string, - description: string, - type: "Basic flow" | "Client flow", - ) { - cy.findByTestId("alias").type(name); - cy.findByTestId("description").type(description); - Select.selectItem(cy.get("#providerId"), type); - cy.findByTestId("create").click(); - return this; - } - - addSubFlowToEmpty(subFlowName: string, name: string) { - cy.findByTestId("addSubFlow").click(); - this.#fillSubFlowModal(subFlowName, name); - - return this; - } -} diff --git a/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/authentication/FlowDiagram.ts b/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/authentication/FlowDiagram.ts deleted file mode 100644 index 8530f80fed1..00000000000 --- a/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/authentication/FlowDiagram.ts +++ /dev/null @@ -1,35 +0,0 @@ -type Edge = { from: string; to: string }; - -export default class FlowDiagram { - exists() { - cy.get(".react-flow").should("exist"); - } - - edgesExist(edges: Edge[]) { - edges.forEach((edge) => { - this.#labelToId(edge.from).then((fromId) => { - this.#labelToId(edge.to).then((toId) => { - const label = `Edge from ${fromId} to ${toId}`; - cy.get(`[aria-label="${label}"]`); - }); - }); - }); - return this; - } - - #labelToId(label: string) { - return cy.findByText(label).then((node) => { - const id = node.attr("data-id"); - if (id) { - return cy.wrap(id); - } - // if data-id does not exist, we're looking at a subflow, which has the data-id - // on the grandparent - return cy - .wrap(node) - .parent() - .parent() - .then((n) => cy.wrap(n.attr("data-id"))); - }); - } -} diff --git a/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/authentication/OTPPolicies.ts b/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/authentication/OTPPolicies.ts deleted file mode 100644 index d85099a9a16..00000000000 --- a/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/authentication/OTPPolicies.ts +++ /dev/null @@ -1,28 +0,0 @@ -export default class OTPPolicies { - goToTab() { - cy.findAllByTestId("policies").click().get("#pf-tab-2-otpPolicy").click(); - return this; - } - - setPolicyType(type: string) { - cy.findByTestId(type).click(); - return this; - } - - increaseInitialCounter() { - cy.get('#otpPolicyInitialCounter [aria-label="Plus"]').click(); - return this; - } - - checkSupportedApplications(...supportedApplications: string[]) { - cy.findByTestId("supportedApplications") - .children() - .should("have.text", supportedApplications.join("")); - return this; - } - - save() { - cy.findByTestId("save").click(); - return this; - } -} diff --git a/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/authentication/PasswordPolicies.ts b/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/authentication/PasswordPolicies.ts deleted file mode 100644 index 26094246d7b..00000000000 --- a/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/authentication/PasswordPolicies.ts +++ /dev/null @@ -1,26 +0,0 @@ -export default class PasswordPolicies { - goToTab() { - cy.findAllByTestId("policies").click(); - return this; - } - - shouldShowEmptyState() { - cy.findByTestId("empty-state").should("exist"); - return this; - } - - addPolicy(name: string) { - cy.findByTestId("add-policy").click().parent().contains(name).click(); - return this; - } - - removePolicy(name: string) { - cy.findByTestId(name).click(); - return this; - } - - save() { - cy.findByTestId("save").click(); - return this; - } -} diff --git a/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/authentication/RequiredActions.ts b/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/authentication/RequiredActions.ts deleted file mode 100644 index e86da6366a5..00000000000 --- a/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/authentication/RequiredActions.ts +++ /dev/null @@ -1,52 +0,0 @@ -export default class RequiredActions { - #toId(name: string) { - return name.replace(/\s/g, "\\ "); - } - - #toKey(name: string) { - return name.replace(/\s/g, "-"); - } - - #getEnabledSwitch(name: string) { - return `#enable-${this.#toKey(name)}`; - } - #getDefaultSwitch(name: string) { - return `#default-${this.#toKey(name)}`; - } - - goToTab() { - cy.findByTestId("requiredActions").click(); - } - - switchAction(name: string) { - cy.get(this.#getEnabledSwitch(name)).scrollIntoView(); - cy.get(this.#getEnabledSwitch(name)).click({ force: true }); - return this; - } - - isChecked(name: string) { - cy.get(this.#getEnabledSwitch(name)).should("be.checked"); - return this; - } - - isDefaultEnabled(name: string) { - cy.get(this.#getDefaultSwitch(name)).should("be.enabled"); - return this; - } - - setAsDefault(name: string) { - cy.get(this.#getDefaultSwitch(name)).click({ force: true }); - return this; - } - - isDefaultChecked(name: string) { - cy.get(this.#getEnabledSwitch(name)).should("be.checked"); - return this; - } - - moveRowTo(from: string, to: string) { - cy.get("#" + this.#toId(from)).drag("#" + this.#toId(to)); - - return this; - } -} diff --git a/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/authentication/WebAuthnPolicies.ts b/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/authentication/WebAuthnPolicies.ts deleted file mode 100644 index c334de25e50..00000000000 --- a/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/authentication/WebAuthnPolicies.ts +++ /dev/null @@ -1,35 +0,0 @@ -export default class WebAuthnPolicies { - webAuthnPolicyCreateTimeout(value: number) { - cy.findByTestId("webAuthnPolicyCreateTimeout").clear(); - cy.findByTestId("webAuthnPolicyCreateTimeout").type(String(value)); - return this; - } - goToTab() { - cy.findByTestId("policies").click(); - cy.get("#pf-tab-3-webauthnPolicy").click(); - return this; - } - - goToPasswordlessTab() { - cy.findByTestId("policies").click(); - cy.get("#pf-tab-4-webauthnPasswordlessPolicy").click(); - return this; - } - - fillSelects(data: Record, isPasswordLess: boolean = false) { - for (const prop of Object.keys(data)) { - cy.get( - `#${ - isPasswordLess ? prop.replace("Policy", "PolicyPasswordless") : prop - }`, - ).click(); - cy.get(".pf-v5-c-menu__list").contains(data[prop]).click(); - } - return this; - } - - save() { - cy.findByTestId("save").click(); - return this; - } -} diff --git a/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/client_scopes/CreateClientScopePage.ts b/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/client_scopes/CreateClientScopePage.ts deleted file mode 100644 index 70fb92bdd60..00000000000 --- a/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/client_scopes/CreateClientScopePage.ts +++ /dev/null @@ -1,115 +0,0 @@ -import CommonPage from "../../../CommonPage"; - -export default class CreateClientScopePage extends CommonPage { - settingsTab: string; - mappersTab: string; - clientScopeNameInput: string; - clientScopeNameError: string; - clientScopeDescriptionInput: string; - clientScopeTypeDrpDwn: string; - clientScopeTypeList: string; - displayOnConsentInput: string; - displayOnConsentSwitch: string; - consentScreenTextInput: string; - includeInTokenSwitch: string; - displayOrderInput: string; - saveBtn: string; - cancelBtn: string; - - constructor() { - super(); - this.settingsTab = ".pf-v5-c-tabs__item:nth-child(1)"; - this.mappersTab = ".pf-v5-c-tabs__item:nth-child(2)"; - - this.clientScopeNameInput = "name"; - this.clientScopeNameError = "#name-helper"; - this.clientScopeDescriptionInput = "description"; - this.clientScopeTypeDrpDwn = "#kc-protocol"; - this.clientScopeTypeList = "#kc-protocol + ul"; - this.displayOnConsentInput = "attributes.display🍺on🍺consent🍺screen"; - this.displayOnConsentSwitch = - '[for="attributes.display🍺on🍺consent🍺screen"] .pf-v5-c-switch__toggle'; - this.consentScreenTextInput = "attributes.consent🍺screen🍺text"; - this.includeInTokenSwitch = "#attributes.include🍺in🍺token🍺scope-on"; - this.displayOrderInput = "attributes.gui🍺order"; - - this.saveBtn = '[type="submit"]'; - this.cancelBtn = '[type="button"]'; - } - - //#region General Settings - fillClientScopeData( - name: string, - description = "", - consentScreenText = "", - displayOrder = "", - ) { - cy.findByTestId(this.clientScopeNameInput).clear(); - - if (name) { - cy.findByTestId(this.clientScopeNameInput).type(name); - } - - if (description) { - cy.findByTestId(this.clientScopeDescriptionInput).type(description); - } - - if (consentScreenText) { - cy.findByTestId(this.consentScreenTextInput).type(consentScreenText); - } - - if (displayOrder) { - cy.findByTestId(this.displayOrderInput).type(displayOrder); - } - - return this; - } - - selectClientScopeType(clientScopeType: string) { - cy.get(this.clientScopeTypeDrpDwn).click(); - cy.get(this.clientScopeTypeList).contains(clientScopeType).click(); - - return this; - } - - getSwitchDisplayOnConsentScreenInput() { - return cy.findByTestId(this.displayOnConsentInput); - } - - getConsentScreenTextInput() { - return cy.findByTestId(this.consentScreenTextInput); - } - - switchDisplayOnConsentScreen() { - cy.get(this.displayOnConsentSwitch).click(); - - return this; - } - - switchIncludeInTokenScope() { - cy.get(this.includeInTokenSwitch).click(); - - return this; - } - //#endregion - - save() { - cy.get(this.saveBtn).click(); - - return this; - } - - save_is_disabled(value: boolean) { - cy.get(this.saveBtn) - .invoke("attr", "aria-disabled") - .should("eq", value ? "true" : "false"); - - return this; - } - - cancel() { - cy.get(this.cancelBtn).click(); - - return this; - } -} diff --git a/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/client_scopes/client_scope_details/ClientScopeDetailsPage.ts b/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/client_scopes/client_scope_details/ClientScopeDetailsPage.ts deleted file mode 100644 index d543f2f6558..00000000000 --- a/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/client_scopes/client_scope_details/ClientScopeDetailsPage.ts +++ /dev/null @@ -1,31 +0,0 @@ -import CommonPage from "../../../../CommonPage"; -import SettingsTab from "./tabs/SettingsTab"; -import MappersTab from "./tabs/MappersTab"; -import ScopeTab from "./tabs/ScopeTab"; - -export enum ClientScopeDetailsTab { - SettingsTab = "Settings", - MappersTab = "Mappers", - Scope = "Scope", -} - -export default class ClientScopeDetailsPage extends CommonPage { - #settingsTab = new SettingsTab(); - #scopesTab = new ScopeTab(); - #mappersTab = new MappersTab(); - - goToSettingsTab() { - this.tabUtils().clickTab(ClientScopeDetailsTab.SettingsTab); - return this.#settingsTab; - } - - goToMappersTab() { - this.tabUtils().clickTab(ClientScopeDetailsTab.MappersTab); - return this.#mappersTab; - } - - goToScopesTab() { - this.tabUtils().clickTab(ClientScopeDetailsTab.Scope); - return this.#scopesTab; - } -} diff --git a/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/client_scopes/client_scope_details/tabs/MappersTab.ts b/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/client_scopes/client_scope_details/tabs/MappersTab.ts deleted file mode 100644 index 055315ada28..00000000000 --- a/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/client_scopes/client_scope_details/tabs/MappersTab.ts +++ /dev/null @@ -1,64 +0,0 @@ -import CommonPage from "../../../../../CommonPage"; - -export default class MappersTab extends CommonPage { - #addMapperBtn = "#mapperAction"; - #fromPredefinedMappersBtn = - 'ul[class="pf-v5-c-menu__list"] > li:nth-child(1) button'; - #byConfigurationBtn = - 'ul[class="pf-v5-c-menu__list"] > li:nth-child(2) button'; - #mapperConfigurationList = - 'ul[aria-label="Add predefined mappers"] > li:not([id=header])'; - - #mapperNameInput = "#name"; - - addPredefinedMappers(mappersNames: string[]) { - cy.get(this.#addMapperBtn).click(); - cy.get(this.#fromPredefinedMappersBtn).click(); - - this.tableUtils().setTableInModal(true); - for (const mapperName of mappersNames) { - this.tableUtils().selectRowItemCheckbox(mapperName); - } - this.tableUtils().setTableInModal(false); - - this.modalUtils().confirmModal(); - this.masthead().checkNotificationMessage("Mapping successfully created"); - this.sidebar().waitForPageLoad(); - cy.contains(mappersNames[0]).should("exist"); - - for (const mapperName of mappersNames) { - this.tableUtils().checkRowItemExists(mapperName, true); - } - - return this; - } - - addMappersByConfiguration(predefinedMapperName: string, mapperName: string) { - cy.get(this.#addMapperBtn).click(); - cy.get(this.#byConfigurationBtn).click(); - - cy.get(this.#mapperConfigurationList) - .contains(predefinedMapperName) - .click(); - - cy.get(this.#mapperNameInput).type(mapperName); - - this.formUtils().save(); - this.masthead().checkNotificationMessage("Mapping successfully created"); - - return this; - } - - removeMappers(mappersNames: string[]) { - for (const mapperName of mappersNames) { - this.tableUtils().checkRowItemExists(mapperName); - this.tableUtils().selectRowItemAction(mapperName, "Delete"); - this.sidebar().waitForPageLoad(); - this.masthead().checkNotificationMessage("Mapping successfully deleted"); - this.sidebar().waitForPageLoad(); - this.tableUtils().checkRowItemExists(mapperName, false); - } - - return this; - } -} diff --git a/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/client_scopes/client_scope_details/tabs/ScopeTab.ts b/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/client_scopes/client_scope_details/tabs/ScopeTab.ts deleted file mode 100644 index 550617ba5f7..00000000000 --- a/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/client_scopes/client_scope_details/tabs/ScopeTab.ts +++ /dev/null @@ -1,3 +0,0 @@ -import CommonPage from "../../../../../CommonPage"; - -export default class ScopeTab extends CommonPage {} diff --git a/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/client_scopes/client_scope_details/tabs/SettingsTab.ts b/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/client_scopes/client_scope_details/tabs/SettingsTab.ts deleted file mode 100644 index 6e3827e0988..00000000000 --- a/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/client_scopes/client_scope_details/tabs/SettingsTab.ts +++ /dev/null @@ -1,3 +0,0 @@ -import PageObject from "../../../../components/PageObject"; - -export default class SettingsTab extends PageObject {} diff --git a/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/client_scopes/client_scope_details/tabs/mappers/MapperDetailsPage.ts b/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/client_scopes/client_scope_details/tabs/mappers/MapperDetailsPage.ts deleted file mode 100644 index 6f4b42a2c25..00000000000 --- a/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/client_scopes/client_scope_details/tabs/mappers/MapperDetailsPage.ts +++ /dev/null @@ -1,52 +0,0 @@ -import CommonPage from "../../../../../../CommonPage"; - -export enum ClaimJsonType { - String = "String", - Long = "long", - Int = "int", - Boolean = "boolean", - Json = "JSON", -} - -export default class MapperDetailsPage extends CommonPage { - #userAttributeInput = '[data-testid="config.user🍺attribute"]'; - #tokenClaimNameInput = '[data-testid="claim.name"]'; - #claimJsonType = '[id="jsonType.label"]'; - - fillUserAttribute(userAttribute: string) { - cy.get(this.#userAttributeInput).clear().type(userAttribute); - - return this; - } - - checkUserAttribute(userAttribute: string) { - cy.get(this.#userAttributeInput).should("have.value", userAttribute); - - return this; - } - - fillTokenClaimName(name: string) { - cy.get(this.#tokenClaimNameInput).clear().type(name); - - return this; - } - - checkTokenClaimName(name: string) { - cy.get(this.#tokenClaimNameInput).should("have.value", name); - - return this; - } - - changeClaimJsonType(type: string) { - cy.get(this.#claimJsonType).click(); - cy.get(this.#claimJsonType).parent().contains(type).click(); - - return this; - } - - checkClaimJsonType(type: string) { - cy.get(this.#claimJsonType).should("contain", type); - - return this; - } -} diff --git a/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/clients/ClientRegistrationPage.ts b/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/clients/ClientRegistrationPage.ts deleted file mode 100644 index 62c1d520631..00000000000 --- a/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/clients/ClientRegistrationPage.ts +++ /dev/null @@ -1,52 +0,0 @@ -import CommonPage from "../../../CommonPage"; - -export class ClientRegistrationPage extends CommonPage { - goToClientRegistrationTab() { - this.tabUtils().clickTab("registration"); - return this; - } - - goToAuthenticatedSubTab() { - cy.findAllByTestId("authenticated").click(); - return this; - } - - createPolicy() { - cy.findAllByTestId("createPolicy").click({ force: true }); - return this; - } - - createAnonymousPolicy() { - cy.findByTestId("createPolicy-anonymous").click(); - return this; - } - - createAuthenticatedPolicy() { - cy.findByTestId("createPolicy-authenticated").click(); - return this; - } - - findAndSelectInAnonymousPoliciesTable(policy: string) { - cy.findByTestId("clientRegistration-anonymous") - .find("tr") - .contains(policy) - .click(); - } - - findAndSelectInAuthenticatedPoliciesTable(policy: string) { - cy.findByTestId("clientRegistration-authenticated") - .find("tr") - .contains(policy) - .click(); - } - - selectRow(name: string) { - cy.findAllByTestId(name).click(); - return this; - } - - fillPolicyForm(props: { name: string }) { - cy.findAllByTestId("name").type(props.name); - return this; - } -} diff --git a/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/clients/ClientRolesTab.ts b/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/clients/ClientRolesTab.ts deleted file mode 100644 index 5f07c6da597..00000000000 --- a/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/clients/ClientRolesTab.ts +++ /dev/null @@ -1,78 +0,0 @@ -import CommonPage from "../../../CommonPage"; - -enum ClientRolesTabItems { - Details = "Details", - Attributes = "Attributes", - UsersInRole = "Users in role", - Permissions = "Permissions", -} - -export default class ClientRolesTab extends CommonPage { - #createRoleBtn = "create-role"; - #createRoleEmptyStateBtn = "no-roles-for-this-client-empty-action"; - #hideInheritedRolesChkBox = "#hideInheritedRoles"; - #rolesTab = "rolesTab"; - #associatedRolesTab = "associatedRolesTab"; - #defaultRolesTab = "default-roles-tab"; - #defaultGroupsTab = "default-groups-tab"; - - goToDetailsTab() { - this.tabUtils().clickTab(ClientRolesTabItems.Details); - return this; - } - - goToAttributesTab() { - this.tabUtils().clickTab(ClientRolesTabItems.Attributes); - return this; - } - - goToUsersInRoleTab() { - this.tabUtils().clickTab(ClientRolesTabItems.UsersInRole); - return this; - } - - goToPermissionsTab() { - this.tabUtils().clickTab(ClientRolesTabItems.Permissions); - return this; - } - - goToRolesTab() { - cy.findByTestId(this.#rolesTab).click(); - return this; - } - - goToAssociatedRolesTab() { - cy.findByTestId(this.#associatedRolesTab).click(); - return this; - } - - goToCreateRoleFromToolbar() { - cy.findByTestId(this.#createRoleBtn).click(); - return this; - } - - goToCreateRoleFromEmptyState() { - cy.findByTestId(this.#createRoleEmptyStateBtn).click(); - return this; - } - - fillClientRoleData() { - cy.findByTestId(this.#createRoleBtn).click(); - return this; - } - - hideInheritedRoles() { - cy.get(this.#hideInheritedRolesChkBox).check(); - return this; - } - - goToDefaultRolesTab() { - cy.findByTestId(this.#defaultRolesTab).click(); - return this; - } - - goToDefaultGroupsTab() { - cy.findByTestId(this.#defaultGroupsTab).click(); - return this; - } -} diff --git a/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/clients/ClientsPage.ts b/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/clients/ClientsPage.ts deleted file mode 100644 index 8d98819e6fb..00000000000 --- a/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/clients/ClientsPage.ts +++ /dev/null @@ -1,23 +0,0 @@ -import CommonPage from "../../../CommonPage"; -import ClientsListTab from "./tabs/ClientsListTab"; -import InitialAccessTokenTab from "./tabs/InitialAccessTokenTab"; - -enum ClientsTab { - ClientsList = "Clients list", - InitialAccessToken = "Initial access token", -} - -export default class ClientsPage extends CommonPage { - #clientsListTab = new ClientsListTab(); - #initialAccessTokenTab = new InitialAccessTokenTab(); - - goToClientsListTab() { - this.tabUtils().clickTab(ClientsTab.ClientsList); - return this.#clientsListTab; - } - - goToInitialAccessTokenTab() { - this.tabUtils().clickTab(ClientsTab.InitialAccessToken); - return this.#initialAccessTokenTab; - } -} diff --git a/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/clients/CreateClientPage.ts b/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/clients/CreateClientPage.ts deleted file mode 100644 index 523753b7fbc..00000000000 --- a/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/clients/CreateClientPage.ts +++ /dev/null @@ -1,309 +0,0 @@ -import Select from "../../../../forms/Select"; -import CommonPage from "../../../CommonPage"; - -export default class CreateClientPage extends CommonPage { - #clientTypeDrpDwn = "#protocol"; - #clientIdInput = "#clientId"; - #clientIdError = "#clientId + div"; - #clientNameInput = "#name"; - #clientDescriptionInput = "#kc-description"; - #alwaysDisplayInUISwitch = - '[for="kc-always-display-in-ui-switch"] .pf-v5-c-switch__toggle'; - #frontchannelLogoutSwitch = - '[for="kc-frontchannelLogout-switch"] .pf-v5-c-switch__toggle'; - - #clientAuthenticationSwitch = - '[for="kc-authentication-switch"] > .pf-v5-c-switch__toggle'; - #clientAuthenticationSwitchInput = "#kc-authentication-switch"; - #clientAuthorizationSwitch = - '[for="kc-authorization-switch"] > .pf-v5-c-switch__toggle'; - #clientAuthorizationSwitchInput = "#kc-authorization-switch"; - #standardFlowChkBx = "#kc-flow-standard"; - #directAccessChkBx = "#kc-flow-direct"; - #implicitFlowChkBx = "#kc-flow-implicit"; - #oidcCibaGrantChkBx = "#kc-oidc-ciba-grant"; - #deviceAuthGrantChkBx = "#kc-oauth-device-authorization-grant"; - #serviceAccountRolesChkBx = "#kc-flow-service-account"; - - #rootUrlInput = "rootUrl"; - #homeUrlInput = "baseUrl"; - #firstValidRedirectUrlInput = "redirectUris0"; - #firstWebOriginsInput = "webOrigins0"; - #adminUrlInput = "adminUrl"; - - #loginThemeDrpDwn = "#login_theme"; - #loginThemeList = 'ul[class="pf-v5-c-menu__list"]'; - #consentRequiredSwitch = '[for="consentRequired"] .pf-v5-c-switch__toggle'; - #consentRequiredSwitchInput = "#consentRequired"; - #displayClientOnScreenSwitch = - '[for="attributes.display🍺on🍺consent🍺screen"].pf-v5-c-switch'; - #displayClientOnScreenSwitchInput = - "#attributes\\.display🍺on🍺consent🍺screen"; - #clientConsentScreenText = "attributes.consent🍺screen🍺text"; - - #frontChannelLogoutSwitch = - '[for="kc-frontchannelLogout-switch"] > .pf-v5-c-switch__toggle'; - #frontChannelLogoutSwitchInput = "#kc-frontchannelLogout-switch"; - #frontChannelLogoutInput = "frontchannelLogoutUrl"; - #frontChannelLogoutSessionRequiredSwitchInput = - "#attributes\\.frontchannel🍺logout🍺session🍺required"; - #backChannelLogoutInput = "backchannelLogoutUrl"; - #backChannelLogoutSessionRequiredSwitchInput = - "#backchannelLogoutSessionRequired"; - #backChannelLogoutRevoqueSwitch = - '.pf-v5-c-form__group-control [for="backchannelLogoutRevokeOfflineSessions"] > .pf-v5-c-switch__toggle'; - #backChannelLogoutRevoqueSwitchInput = - "#backchannelLogoutRevokeOfflineSessions"; - - #actionDrpDwn = "action-dropdown"; - #deleteClientBtn = "delete-client"; - - #saveBtn = "Save"; - #continueBtn = "Next"; - #backBtn = "Back"; - #cancelBtn = "Cancel"; - - //#region General Settings - selectClientType(clientType: string) { - Select.selectItem(cy.get(this.#clientTypeDrpDwn), clientType); - - return this; - } - - fillClientData( - id: string, - name = "", - description = "", - alwaysDisplay?: boolean, - frontchannelLogout?: boolean, - ) { - cy.get(this.#clientIdInput).clear(); - - if (id) { - cy.get(this.#clientIdInput).type(id); - } - - if (name) { - cy.get(this.#clientNameInput).type(name); - } - - if (description) { - cy.get(this.#clientDescriptionInput).type(description); - } - - if (alwaysDisplay) { - cy.get(this.#alwaysDisplayInUISwitch).click(); - } - - if (frontchannelLogout) { - cy.get(this.#frontchannelLogoutSwitch).click(); - } - - return this; - } - - changeSwitches(switches: string[]) { - for (const uiSwitch of switches) { - cy.findByTestId(uiSwitch).check({ force: true }); - } - return this; - } - - checkClientIdRequiredMessage() { - cy.get(this.#clientIdInput) - .parent() - .should("have.class", "pf-v5-c-form-control pf-m-error"); - - return this; - } - - checkGeneralSettingsStepActive() { - cy.get(".pf-v5-c-wizard__nav-link") - .contains("General settings") - .should("have.class", "pf-m-current"); - - return this; - } - //#endregion - - //#region Capability config - switchClientAuthentication() { - cy.get(this.#clientAuthenticationSwitch).click(); - - return this; - } - - switchClientAuthorization() { - cy.get(this.#clientAuthorizationSwitch).click(); - - return this; - } - - clickStandardFlow() { - cy.get(this.#standardFlowChkBx).click(); - - return this; - } - - clickDirectAccess() { - cy.get(this.#directAccessChkBx).click(); - - return this; - } - - clickImplicitFlow() { - cy.get(this.#implicitFlowChkBx).click(); - - return this; - } - - clickServiceAccountRoles() { - cy.get(this.#serviceAccountRolesChkBx).click(); - - return this; - } - - clickOAuthDeviceAuthorizationGrant() { - cy.get(this.#deviceAuthGrantChkBx).click(); - - return this; - } - - clickOidcCibaGrant() { - cy.get(this.#oidcCibaGrantChkBx).click(); - - return this; - } - //#endregion - - save() { - cy.contains("button", this.#saveBtn).click(); - - return this; - } - - continue() { - cy.contains("button", this.#continueBtn).click(); - - return this; - } - - back() { - cy.contains("button", this.#backBtn).click(); - - return this; - } - - cancel() { - cy.contains("button", this.#cancelBtn).click(); - - return this; - } - - checkCapabilityConfigElements() { - cy.get(this.#oidcCibaGrantChkBx).scrollIntoView(); - - cy.get(this.#clientAuthenticationSwitchInput).should("not.be.disabled"); - cy.get(this.#clientAuthorizationSwitchInput).should("be.disabled"); - - cy.get(this.#standardFlowChkBx).should("not.be.disabled"); - cy.get(this.#directAccessChkBx).should("not.be.disabled"); - cy.get(this.#implicitFlowChkBx).should("not.be.disabled"); - cy.get(this.#serviceAccountRolesChkBx).should("be.disabled"); - cy.get(this.#deviceAuthGrantChkBx).should("not.be.disabled"); - cy.get(this.#oidcCibaGrantChkBx).should("be.disabled"); - - cy.get(this.#clientAuthenticationSwitch).click(); - cy.get(this.#clientAuthorizationSwitchInput).should("not.be.disabled"); - cy.get(this.#serviceAccountRolesChkBx).should("not.be.disabled"); - cy.get(this.#oidcCibaGrantChkBx).should("not.be.disabled"); - - cy.get(this.#clientAuthorizationSwitch).click(); - cy.get(this.#serviceAccountRolesChkBx).should("be.disabled"); - cy.get(this.#oidcCibaGrantChkBx).should("not.be.disabled"); - - cy.get(this.#clientAuthorizationSwitch).click(); - cy.get(this.#serviceAccountRolesChkBx).should("not.be.disabled"); - - cy.get(this.#clientAuthenticationSwitch).click(); - cy.get(this.#serviceAccountRolesChkBx).should("be.disabled"); - cy.get(this.#oidcCibaGrantChkBx).should("be.disabled"); - - return this; - } - - checkAccessSettingsElements() { - cy.findByTestId(this.#adminUrlInput).scrollIntoView(); - cy.findByTestId(this.#rootUrlInput).should("not.be.disabled"); - cy.findByTestId(this.#homeUrlInput).should("not.be.disabled"); - cy.findByTestId(this.#firstValidRedirectUrlInput).should("not.be.disabled"); - cy.findByTestId(this.#firstWebOriginsInput).should("not.be.disabled"); - cy.findByTestId(this.#adminUrlInput).should("not.be.disabled"); - - return this; - } - - checkLoginSettingsElements() { - cy.findByTestId(this.#clientConsentScreenText).scrollIntoView(); - cy.get(this.#loginThemeDrpDwn).should("not.be.disabled"); - cy.get(this.#consentRequiredSwitchInput).should("not.be.disabled"); - cy.get(this.#displayClientOnScreenSwitchInput).should("be.disabled"); - cy.findByTestId(this.#clientConsentScreenText).should("be.disabled"); - - cy.get(this.#loginThemeDrpDwn).click(); - cy.get(this.#loginThemeList).findByText("base").should("exist"); - cy.get(this.#loginThemeList).findByText("keycloak").should("exist"); - cy.get(this.#loginThemeDrpDwn).click(); - - cy.get(this.#consentRequiredSwitch).click(); - cy.get(this.#displayClientOnScreenSwitchInput).should("not.be.disabled"); - cy.findByTestId(this.#clientConsentScreenText).should("be.disabled"); - - cy.get(this.#displayClientOnScreenSwitch).click(); - cy.findByTestId(this.#clientConsentScreenText).should("not.be.disabled"); - - cy.get(this.#displayClientOnScreenSwitch).click(); - cy.findByTestId(this.#clientConsentScreenText).should("be.disabled"); - cy.get(this.#consentRequiredSwitch).click(); - cy.get(this.#displayClientOnScreenSwitchInput).should("be.disabled"); - - return this; - } - - checkLogoutSettingsElements() { - cy.get(this.#frontChannelLogoutSessionRequiredSwitchInput).scrollIntoView(); - cy.get(this.#frontChannelLogoutSwitchInput).should("not.be.disabled"); - cy.findByTestId(this.#frontChannelLogoutInput).should("not.be.disabled"); - cy.get(this.#frontChannelLogoutSessionRequiredSwitchInput).should( - "not.be.disabled", - ); - cy.findByTestId(this.#backChannelLogoutInput).should("not.exist"); - cy.get(this.#backChannelLogoutSessionRequiredSwitchInput).should( - "not.exist", - ); - cy.get(this.#backChannelLogoutRevoqueSwitchInput).should("not.exist"); - - cy.get(this.#frontChannelLogoutSwitch).click(); - cy.findByTestId(this.#frontChannelLogoutInput).should("not.exist"); - cy.get(this.#frontChannelLogoutSessionRequiredSwitchInput).should( - "not.exist", - ); - cy.findByTestId(this.#backChannelLogoutInput).should("not.be.disabled"); - cy.get(this.#backChannelLogoutSessionRequiredSwitchInput).should( - "not.be.disabled", - ); - cy.get(this.#backChannelLogoutRevoqueSwitchInput).should("not.be.disabled"); - - cy.get(this.#frontChannelLogoutSwitch).click(); - cy.findByTestId(this.#frontChannelLogoutInput).should("not.be.disabled"); - - return this; - } - - deleteClientFromActionDropdown() { - cy.findAllByTestId(this.#actionDrpDwn).click(); - cy.findAllByTestId(this.#deleteClientBtn).click(); - - return this; - } -} diff --git a/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/clients/CreateInitialAccessTokenPage.ts b/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/clients/CreateInitialAccessTokenPage.ts deleted file mode 100644 index a45479ff8a5..00000000000 --- a/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/clients/CreateInitialAccessTokenPage.ts +++ /dev/null @@ -1,18 +0,0 @@ -import CommonPage from "../../../CommonPage"; - -export default class CreateInitialAccessTokenPage extends CommonPage { - #expirationInput = "expiration"; - #countInput = "count"; - #countPlusBtn = '[data-testid="count"] [aria-label="Plus"]'; - - fillNewTokenData(expiration: number, count: number) { - cy.findByTestId(this.#expirationInput).clear().type(expiration.toString()); - cy.findByTestId(this.#countInput).clear(); - - for (let i = 0; i < count; i++) { - cy.get(this.#countPlusBtn).click(); - } - - return this; - } -} diff --git a/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/clients/client_details/ClientDetailsPage.ts b/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/clients/client_details/ClientDetailsPage.ts deleted file mode 100644 index 20b38dd73c1..00000000000 --- a/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/clients/client_details/ClientDetailsPage.ts +++ /dev/null @@ -1,111 +0,0 @@ -import CommonPage from "../../../../CommonPage"; -import AdvancedTab from "./tabs/AdvancedTab"; -import AuthorizationTab from "./tabs/AuthorizationTab"; -import ClientScopesTab from "./tabs/ClientScopesTab"; -import CredentialsTab from "./tabs/CredentialsTab"; -import KeysTab from "./tabs/KeysTab"; -import RolesTab from "./tabs/RolesTab"; -import SettingsTab from "./tabs/SettingsTab"; - -export enum ClientsDetailsTab { - Settings = "Settings", - Keys = "Keys", - Credentials = "Credentials", - Roles = "Roles", - Sessions = "Sessions", - Permissions = "Permissions", - ClientScopes = "Client scopes", - Authorization = "Authorization", - ServiceAccountsRoles = "Service accounts roles", - Advanced = "Advanced", - Scope = "Scope", - UserEvents = "Events", -} - -export default class ClientDetailsPage extends CommonPage { - #settingsTab = new SettingsTab(); - #keysTab = new KeysTab(); - #credentialsTab = new CredentialsTab(); - #rolesTab = new RolesTab(); - #clientScopesTab = new ClientScopesTab(); - #authorizationTab = new AuthorizationTab(); - #advancedTab = new AdvancedTab(); - #clientScopesSetupTab = "clientScopesSetupTab"; - #clientScopesEvaluateTab = "clientScopesEvaluateTab"; - #evaluateEffectiveProtocolMappersTab = "effective-protocol-mappers-tab"; - #evaluateEffectiveRoleScopeMappingsTab = "effective-role-scope-mappings-tab"; - #evaluateGeneratedAccessTokenTab = "generated-access-token-tab"; - #evaluateGeneratedIdTokenTab = "generated-id-token-tab"; - #evaluateGeneratedUserInfoTab = "generated-user-info-tab"; - - goToSettingsTab() { - this.tabUtils().clickTab(ClientsDetailsTab.Settings); - return this.#settingsTab; - } - - goToKeysTab() { - this.tabUtils().clickTab(ClientsDetailsTab.Keys); - return this.#keysTab; - } - - goToCredentials() { - this.tabUtils().clickTab(ClientsDetailsTab.Credentials); - return this.#credentialsTab; - } - - goToRolesTab() { - this.tabUtils().clickTab(ClientsDetailsTab.Roles); - return this.#rolesTab; - } - - goToClientScopesTab() { - this.tabUtils().clickTab(ClientsDetailsTab.ClientScopes); - return this.#clientScopesTab; - } - - goToAuthorizationTab() { - this.tabUtils().clickTab(ClientsDetailsTab.Authorization); - return this.#authorizationTab; - } - - goToAdvancedTab() { - this.tabUtils().clickTab(ClientsDetailsTab.Advanced); - return this.#advancedTab; - } - - goToClientScopesSetupTab() { - cy.findByTestId(this.#clientScopesSetupTab).click(); - return this; - } - - goToClientScopesEvaluateTab() { - this.goToClientScopesTab(); - cy.findByTestId(this.#clientScopesEvaluateTab).click(); - return this; - } - - goToClientScopesEvaluateEffectiveProtocolMappersTab() { - cy.findByTestId(this.#evaluateEffectiveProtocolMappersTab).click(); - return this; - } - - goToClientScopesEvaluateEffectiveRoleScopeMappingsTab() { - cy.findByTestId(this.#evaluateEffectiveRoleScopeMappingsTab).click(); - return this; - } - - goToClientScopesEvaluateGeneratedAccessTokenTab() { - cy.findByTestId(this.#evaluateGeneratedAccessTokenTab).click(); - return this; - } - - goToClientScopesEvaluateGeneratedIdTokenTab() { - cy.findByTestId(this.#evaluateGeneratedIdTokenTab).click(); - return this; - } - - goToClientScopesEvaluateGeneratedUserInfoTab() { - cy.findByTestId(this.#evaluateGeneratedUserInfoTab).click(); - return this; - } -} diff --git a/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/clients/client_details/CreateAuthorizationScopePage.ts b/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/clients/client_details/CreateAuthorizationScopePage.ts deleted file mode 100644 index acffbf8b410..00000000000 --- a/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/clients/client_details/CreateAuthorizationScopePage.ts +++ /dev/null @@ -1,9 +0,0 @@ -import CommonPage from "../../../../CommonPage"; -import type ScopeRepresentation from "@keycloak/keycloak-admin-client/lib/defs/scopeRepresentation"; - -export default class CreateAuthorizationScopePage extends CommonPage { - fillScopeForm(scope: ScopeRepresentation) { - Object.entries(scope).map(([key, value]) => cy.get(`#${key}`).type(value)); - return this; - } -} diff --git a/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/clients/client_details/CreatePermissionPage.ts b/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/clients/client_details/CreatePermissionPage.ts deleted file mode 100644 index 7a594920893..00000000000 --- a/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/clients/client_details/CreatePermissionPage.ts +++ /dev/null @@ -1,11 +0,0 @@ -import CommonPage from "../../../../CommonPage"; -import type PolicyRepresentation from "@keycloak/keycloak-admin-client/lib/defs/policyRepresentation"; - -export default class CreatePermissionPage extends CommonPage { - fillPermissionForm(permission: PolicyRepresentation) { - Object.entries(permission).map(([key, value]) => - cy.get(`#${key}`).type(value), - ); - return this; - } -} diff --git a/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/clients/client_details/CreateResourcePage.ts b/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/clients/client_details/CreateResourcePage.ts deleted file mode 100644 index f00d0420c5e..00000000000 --- a/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/clients/client_details/CreateResourcePage.ts +++ /dev/null @@ -1,19 +0,0 @@ -import CommonPage from "../../../../CommonPage"; -import type ResourceRepresentation from "@keycloak/keycloak-admin-client/lib/defs/resourceRepresentation"; - -export default class CreateResourcePage extends CommonPage { - fillResourceForm(resource: ResourceRepresentation) { - Object.entries(resource).map(([key, value]) => { - if (Array.isArray(value)) { - for (let index = 0; index < value.length; index++) { - const v = value[index]; - cy.findByTestId(`${key}${index}`).type(v); - cy.findByTestId("addValue").click(); - } - } else { - cy.get(`#${key}`).type(value); - } - }); - return this; - } -} diff --git a/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/clients/client_details/DedicatedScopesMappersTab.ts b/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/clients/client_details/DedicatedScopesMappersTab.ts deleted file mode 100644 index f7aa7300a76..00000000000 --- a/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/clients/client_details/DedicatedScopesMappersTab.ts +++ /dev/null @@ -1,41 +0,0 @@ -import CommonPage from "../../../../CommonPage"; - -enum mapperType { - FromPredefinedMappers = "From predefined mappers", - ByConfiguration = "By configuration", -} - -export default class DedicatedScopesMappersTab extends CommonPage { - #addPredefinedMapperEmptyStateBtn = "add-predefined-mapper-empty-action"; - #configureNewMapperEmptyStateBtn = "configure-a-new-mapper-empty-action"; - - addMapperFromPredefinedMappers() { - this.emptyState().checkIfExists(false); - this.tableToolbarUtils() - .addMapper() - .clickDropdownMenuItem(mapperType.ByConfiguration); - return this; - } - - addMapperByConfiguration() { - this.emptyState().checkIfExists(false); - this.tableToolbarUtils() - .addMapper() - .clickDropdownMenuItem(mapperType.FromPredefinedMappers); - return this; - } - - addPredefinedMapper() { - this.emptyState().checkIfExists(true); - cy.findByTestId(this.#addPredefinedMapperEmptyStateBtn).click(); - return this; - } - - configureNewMapper() { - this.emptyState().checkIfExists(true); - cy.findByTestId(this.#configureNewMapperEmptyStateBtn).click({ - force: true, - }); - return this; - } -} diff --git a/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/clients/client_details/DedicatedScopesPage.ts b/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/clients/client_details/DedicatedScopesPage.ts deleted file mode 100644 index 4ff94c63085..00000000000 --- a/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/clients/client_details/DedicatedScopesPage.ts +++ /dev/null @@ -1,23 +0,0 @@ -import CommonPage from "../../../../CommonPage"; -import DedicatedScopesMappersTab from "./DedicatedScopesMappersTab"; -import DedicatedScopesScopeTab from "./DedicatedScopesScopeTab"; - -export enum DedicatedScopesTab { - Mappers = "Mappers", - Scope = "Scope", -} - -export default class DedicatedScopesPage extends CommonPage { - #mappersTab = new DedicatedScopesMappersTab(); - #scopeTab = new DedicatedScopesScopeTab(); - - goToMappersTab() { - this.tabUtils().clickTab(DedicatedScopesTab.Mappers); - return this.#mappersTab; - } - - goToScopeTab() { - this.tabUtils().clickTab(DedicatedScopesTab.Scope); - return this.#scopeTab; - } -} diff --git a/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/clients/client_details/DedicatedScopesScopeTab.ts b/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/clients/client_details/DedicatedScopesScopeTab.ts deleted file mode 100644 index c7a145d7e11..00000000000 --- a/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/clients/client_details/DedicatedScopesScopeTab.ts +++ /dev/null @@ -1,3 +0,0 @@ -import CommonPage from "../../../../CommonPage"; - -export default class DedicatedScopesScopeTab extends CommonPage {} diff --git a/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/clients/client_details/tabs/AdvancedSamlTab.ts b/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/clients/client_details/tabs/AdvancedSamlTab.ts deleted file mode 100644 index e52a1641271..00000000000 --- a/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/clients/client_details/tabs/AdvancedSamlTab.ts +++ /dev/null @@ -1,27 +0,0 @@ -import PageObject from "../../../../components/PageObject"; - -export class AdvancedSamlTab extends PageObject { - #termsOfServiceUrlId = "attributes.tosUri"; - - saveFineGrain() { - cy.findAllByTestId("fineGrainSave").click(); - } - - revertFineGrain() { - cy.findByTestId("fineGrainRevert").click(); - } - - termsOfServiceUrl(termsOfServiceUrl: string) { - cy.findAllByTestId(this.#termsOfServiceUrlId).clear(); - cy.findAllByTestId(this.#termsOfServiceUrlId).type(termsOfServiceUrl); - return this; - } - - checkTermsOfServiceUrl(termsOfServiceUrl: string) { - cy.findAllByTestId(this.#termsOfServiceUrlId).should( - "have.value", - termsOfServiceUrl, - ); - return this; - } -} diff --git a/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/clients/client_details/tabs/AdvancedTab.ts b/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/clients/client_details/tabs/AdvancedTab.ts deleted file mode 100644 index cb361de9e35..00000000000 --- a/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/clients/client_details/tabs/AdvancedTab.ts +++ /dev/null @@ -1,250 +0,0 @@ -import PageObject from "../../../../components/PageObject"; - -export default class AdvancedTab extends PageObject { - #clusterNodesExpandBtn = - ".pf-v5-c-expandable-section .pf-v5-c-expandable-section__toggle"; - #testClusterAvailability = "#testClusterAvailability"; - #emptyClusterElement = "empty-state"; - #registerNodeManuallyBtn = "no-nodes-registered-empty-action"; - #deleteClusterNodeDrpDwn = - '[aria-label="Registered cluster nodes"] [aria-label="Kebab toggle"]'; - #deleteClusterNodeBtn = - '[aria-label="Registered cluster nodes"] [role="menu"] [type="button"]'; - #nodeHostInput = "node"; - #addNodeConfirmBtn = "#add-node-confirm"; - - #accessTokenSignatureAlgorithmInput = "#access🍺token🍺signed🍺response🍺alg"; - #fineGrainSaveBtn = "#fineGrainSave"; - #fineGrainRevertBtn = "#fineGrainRevert"; - #OIDCCompatabilitySaveBtn = "OIDCCompatabilitySave"; - #OIDCCompatabilityRevertBtn = "OIDCCompatabilityRevert"; - #OIDCAdvancedSaveBtn = "OIDCAdvancedSave"; - #OIDCAdvancedRevertBtn = "OIDCAdvancedRevert"; - #OIDCAuthFlowOverrideSaveBtn = "OIDCAuthFlowOverrideSave"; - #OIDCAuthFlowOverrideRevertBtn = "OIDCAuthFlowOverrideRevert"; - - #excludeSessionStateSwitch = - "#excludeSessionStateFromAuthenticationResponse-switch"; - #useRefreshTokenSwitch = "#useRefreshTokens"; - #useRefreshTokenForClientCredentialsGrantSwitch = - "#useRefreshTokenForClientCredentialsGrant"; - #useLowerCaseBearerTypeSwitch = "#useLowerCaseBearerType"; - - #oAuthMutualSwitch = - "attributes.tls🍺client🍺certificate🍺bound🍺access🍺tokens"; - #keyForCodeExchangeInput = "#keyForCodeExchange"; - #pushedAuthorizationRequestRequiredSwitch = - "attributes.require🍺pushed🍺authorization🍺requests"; - - #browserFlowInput = "#browser"; - #directGrantInput = "#direct_grant"; - - #jumpToOIDCCompatabilitySettings = - "jump-link-openid-connect-compatibility-modes"; - #jumpToAdvancedSettings = "jump-link-advanced-settings"; - #jumpToAuthFlowOverride = "jump-link-authentication-flow-overrides"; - - expandClusterNode() { - cy.get(this.#clusterNodesExpandBtn).click(); - return this; - } - - checkTestClusterAvailability(active: boolean) { - cy.get(this.#testClusterAvailability).should( - (active ? "not." : "") + "have.class", - "pf-m-disabled", - ); - return this; - } - - checkEmptyClusterNode() { - cy.findByTestId(this.#emptyClusterElement).should("exist"); - return this; - } - - registerNodeManually() { - cy.findByTestId(this.#registerNodeManuallyBtn).click(); - return this; - } - - deleteClusterNode() { - cy.get(this.#deleteClusterNodeDrpDwn).click(); - cy.get(this.#deleteClusterNodeBtn).click(); - return this; - } - - fillHost(host: string) { - cy.findByTestId(this.#nodeHostInput).type(host); - return this; - } - - saveHost() { - cy.get(this.#addNodeConfirmBtn).click(); - return this; - } - - selectAccessTokenSignatureAlgorithm(algorithm: string) { - cy.get(this.#accessTokenSignatureAlgorithmInput).click(); - cy.get(".pf-v5-c-menu__list").contains(algorithm).click(); - - return this; - } - - checkAccessTokenSignatureAlgorithm(algorithm: string) { - cy.get(this.#accessTokenSignatureAlgorithmInput).should( - "have.text", - algorithm, - ); - return this; - } - - saveFineGrain() { - cy.get(this.#fineGrainSaveBtn).click(); - return this; - } - - revertFineGrain() { - cy.get(this.#fineGrainRevertBtn).click(); - return this; - } - - saveCompatibility() { - cy.findByTestId(this.#OIDCCompatabilitySaveBtn).click(); - return this; - } - - revertCompatibility() { - cy.findByTestId(this.#OIDCCompatabilityRevertBtn).click(); - cy.findByTestId(this.#jumpToOIDCCompatabilitySettings).click(); - //uncomment when revert function reverts all switches, rather than just the first one - //this.assertSwitchStateOn(cy.get(this.useRefreshTokenForClientCredentialsGrantSwitch)); - this.assertSwitchStateOn(cy.get(this.#excludeSessionStateSwitch)); - return this; - } - - jumpToCompatability() { - cy.findByTestId(this.#jumpToOIDCCompatabilitySettings).click(); - return this; - } - - clickAllCompatibilitySwitch() { - cy.get(this.#excludeSessionStateSwitch).parent().click(); - this.assertSwitchStateOn(cy.get(this.#excludeSessionStateSwitch)); - cy.get(this.#useRefreshTokenSwitch).parent().click(); - this.assertSwitchStateOff(cy.get(this.#useRefreshTokenSwitch)); - cy.get(this.#useRefreshTokenForClientCredentialsGrantSwitch) - .parent() - .click(); - this.assertSwitchStateOn( - cy.get(this.#useRefreshTokenForClientCredentialsGrantSwitch), - ); - cy.get(this.#useLowerCaseBearerTypeSwitch).parent().click(); - this.assertSwitchStateOn(cy.get(this.#useLowerCaseBearerTypeSwitch)); - return this; - } - - clickExcludeSessionStateSwitch() { - cy.get(this.#excludeSessionStateSwitch).parent().click(); - this.assertSwitchStateOff(cy.get(this.#excludeSessionStateSwitch)); - } - clickUseRefreshTokenForClientCredentialsGrantSwitch() { - cy.get(this.#useRefreshTokenForClientCredentialsGrantSwitch) - .parent() - .click(); - this.assertSwitchStateOff( - cy.get(this.#useRefreshTokenForClientCredentialsGrantSwitch), - ); - } - - saveAdvanced() { - cy.findByTestId(this.#OIDCAdvancedSaveBtn).click(); - return this; - } - - revertAdvanced() { - cy.findByTestId(this.#OIDCAdvancedRevertBtn).click(); - return this; - } - - jumpToAdvanced() { - cy.findByTestId(this.#jumpToAdvancedSettings).click(); - return this; - } - - clickAdvancedSwitches() { - cy.findByTestId(this.#oAuthMutualSwitch).parent().click(); - cy.findByTestId(this.#pushedAuthorizationRequestRequiredSwitch) - .parent() - .click(); - return this; - } - - checkAdvancedSwitchesOn() { - cy.findByTestId(this.#oAuthMutualSwitch).scrollIntoView(); - this.assertSwitchStateOn(cy.findByTestId(this.#oAuthMutualSwitch)); - this.assertSwitchStateOn( - cy.findByTestId(this.#pushedAuthorizationRequestRequiredSwitch), - ); - return this; - } - - checkAdvancedSwitchesOff() { - this.assertSwitchStateOff(cy.findByTestId(this.#oAuthMutualSwitch)); - this.assertSwitchStateOff( - cy.findByTestId(this.#pushedAuthorizationRequestRequiredSwitch), - ); - return this; - } - - selectKeyForCodeExchangeInput(input: string) { - cy.get(this.#keyForCodeExchangeInput).click(); - cy.get(this.#keyForCodeExchangeInput) - .parent() - .get("ul") - .contains(input) - .click(); - return this; - } - - checkKeyForCodeExchangeInput(input: string) { - cy.get(this.#keyForCodeExchangeInput).should("have.text", input); - return this; - } - - saveAuthFlowOverride() { - cy.findByTestId(this.#OIDCAuthFlowOverrideSaveBtn).click(); - return this; - } - - revertAuthFlowOverride() { - cy.findByTestId(this.#OIDCAuthFlowOverrideRevertBtn).click(); - return this; - } - - jumpToAuthFlow() { - cy.findByTestId(this.#jumpToAuthFlowOverride).click(); - return this; - } - - selectBrowserFlowInput(input: string) { - cy.get(this.#browserFlowInput).click(); - cy.get(this.#browserFlowInput).parent().get("ul").contains(input).click(); - return this; - } - - selectDirectGrantInput(input: string) { - cy.get(this.#directGrantInput).click(); - cy.get(this.#directGrantInput).parent().get("ul").contains(input).click(); - return this; - } - - checkBrowserFlowInput(input: string) { - cy.get(this.#browserFlowInput).should("have.text", input); - return this; - } - - checkDirectGrantInput(input: string) { - cy.get(this.#directGrantInput).should("have.text", input); - return this; - } -} diff --git a/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/clients/client_details/tabs/AuthorizationTab.ts b/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/clients/client_details/tabs/AuthorizationTab.ts deleted file mode 100644 index 700f14f3c8e..00000000000 --- a/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/clients/client_details/tabs/AuthorizationTab.ts +++ /dev/null @@ -1,63 +0,0 @@ -import CommonPage from "../../../../../CommonPage"; -import SettingsTab from "./authorization_subtabs/SettingsTab"; -import ResourcesTab from "./authorization_subtabs/ResourcesTab"; -import ScopesTab from "./authorization_subtabs/ScopesTab"; -import PoliciesTab from "./authorization_subtabs/PoliciesTab"; -import PermissionsTab from "./authorization_subtabs/PermissionsTab"; -import EvaluateTab from "./authorization_subtabs/EvaluateTab"; -import ExportTab from "./authorization_subtabs/ExportTab"; - -enum AuthorizationSubTab { - Settings = "Settings", - Resources = "Resources", - Scopes = "Scopes", - Policies = "Policies", - Permissions = "Permissions", - Evaluate = "Evaluate", - Export = "Export", -} - -export default class AuthorizationTab extends CommonPage { - #settingsSubTab = new SettingsTab(); - #resourcesSubTab = new ResourcesTab(); - #scopesSubTab = new ScopesTab(); - #policiesSubTab = new PoliciesTab(); - #permissionsSubTab = new PermissionsTab(); - #evaluateSubTab = new EvaluateTab(); - #exportSubTab = new ExportTab(); - - goToSettingsSubTab() { - this.tabUtils().clickTab(AuthorizationSubTab.Settings, 1); - return this.#settingsSubTab; - } - - goToResourcesSubTab() { - this.tabUtils().clickTab(AuthorizationSubTab.Resources, 1); - return this.#resourcesSubTab; - } - - goToScopesSubTab() { - this.tabUtils().clickTab(AuthorizationSubTab.Scopes, 1); - return this.#scopesSubTab; - } - - goToPoliciesSubTab() { - this.tabUtils().clickTab(AuthorizationSubTab.Policies, 1); - return this.#policiesSubTab; - } - - goToPermissionsSubTab() { - this.tabUtils().clickTab(AuthorizationSubTab.Permissions, 1); - return this.#permissionsSubTab; - } - - goToEvaluateSubTab() { - this.tabUtils().clickTab(AuthorizationSubTab.Evaluate, 1); - return this.#evaluateSubTab; - } - - goToExportSubTab() { - this.tabUtils().clickTab(AuthorizationSubTab.Export, 1); - return this.#exportSubTab; - } -} diff --git a/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/clients/client_details/tabs/ClientScopesTab.ts b/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/clients/client_details/tabs/ClientScopesTab.ts deleted file mode 100644 index f9108b07bfe..00000000000 --- a/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/clients/client_details/tabs/ClientScopesTab.ts +++ /dev/null @@ -1,32 +0,0 @@ -import CommonPage from "../../../../../CommonPage"; -import SetupTab from "./clientscopes_subtabs/SetupTab"; -import EvaluateTab from "./clientscopes_subtabs/EvaluateTab"; -import DedicatedScopesPage from "../DedicatedScopesPage"; - -export enum ClientScopesSubTab { - Setup = "Setup", - Evaluate = "Evaluate", -} - -export default class ClientScopesTab extends CommonPage { - #setupSubTab = new SetupTab(); - #evaluateSubTab = new EvaluateTab(); - #dedicatedScopesPage = new DedicatedScopesPage(); - - goToSetupSubTab() { - this.tabUtils().clickTab(ClientScopesSubTab.Setup); - return this.#setupSubTab; - } - - goToEvaluateSubTab() { - this.tabUtils().clickTab(ClientScopesSubTab.Evaluate); - return this.#evaluateSubTab; - } - - clickDedicatedScope(clientId: string) { - cy.intercept("/admin/realms/*/clients/*").as("get"); - cy.findByText(`${clientId}-dedicated`).click(); - cy.wait("@get"); - return this.#dedicatedScopesPage; - } -} diff --git a/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/clients/client_details/tabs/CredentialsTab.ts b/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/clients/client_details/tabs/CredentialsTab.ts deleted file mode 100644 index 348b8c2c9d1..00000000000 --- a/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/clients/client_details/tabs/CredentialsTab.ts +++ /dev/null @@ -1,3 +0,0 @@ -import CommonPage from "../../../../../CommonPage"; - -export default class CredentialsTab extends CommonPage {} diff --git a/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/clients/client_details/tabs/KeysTab.ts b/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/clients/client_details/tabs/KeysTab.ts deleted file mode 100644 index e252a51d988..00000000000 --- a/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/clients/client_details/tabs/KeysTab.ts +++ /dev/null @@ -1,39 +0,0 @@ -import Select from "../../../../../../forms/Select"; -import CommonPage from "../../../../../CommonPage"; - -export default class KeysTab extends CommonPage { - #generateBtn = "generate"; - #confirmBtn = "confirm"; - #useJwksUrl = "useJwksUrl"; - #keyAlias = "keyAlias"; - #keyPassword = "keyPassword"; - #storePassword = "storePassword"; - - toggleUseJwksUrl() { - cy.findByTestId(this.#useJwksUrl).click({ force: true }); - return this; - } - - clickGenerate() { - cy.findByTestId(this.#generateBtn).click(); - return this; - } - - clickConfirm() { - cy.findByTestId(this.#confirmBtn).click(); - return this; - } - - fillGenerateModal( - archiveFormat: string, - keyAlias: string, - keyPassword: string, - storePassword: string, - ) { - Select.selectItem(cy.get("#format"), archiveFormat); - cy.findByTestId(this.#keyAlias).type(keyAlias); - cy.findByTestId(this.#keyPassword).type(keyPassword); - cy.findByTestId(this.#storePassword).type(storePassword); - return this; - } -} diff --git a/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/clients/client_details/tabs/RolesTab.ts b/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/clients/client_details/tabs/RolesTab.ts deleted file mode 100644 index a192e1c1b90..00000000000 --- a/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/clients/client_details/tabs/RolesTab.ts +++ /dev/null @@ -1,3 +0,0 @@ -import CommonPage from "../../../../../CommonPage"; - -export default class RolesTab extends CommonPage {} diff --git a/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/clients/client_details/tabs/SettingsTab.ts b/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/clients/client_details/tabs/SettingsTab.ts deleted file mode 100644 index 00f7adbba0f..00000000000 --- a/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/clients/client_details/tabs/SettingsTab.ts +++ /dev/null @@ -1,239 +0,0 @@ -import PageObject from "../../../../components/PageObject"; -import Masthead from "../../../../Masthead"; - -export enum NameIdFormat { - Username = "username", - Email = "email", - Transient = "transient", - Persistent = "persistent", -} - -const masthead = new Masthead(); - -export default class SettingsTab extends PageObject { - #samlNameIdFormat = "#saml_name_id_format"; - #forceNameIdFormat = "attributes.saml_force_name_id_format"; - #forcePostBinding = "attributes.saml🍺force🍺post🍺binding"; - #forceArtifactBinding = "attributes.saml🍺artifact🍺binding"; - #includeAuthnStatement = "attributes.saml🍺authnstatement"; - #includeOneTimeUseCondition = "attributes.saml🍺onetimeuse🍺condition"; - #optimizeLookup = "attributes.saml🍺server🍺signature🍺keyinfo🍺ext"; - - #signDocumentsSwitch = "attributes.saml🍺server🍺signature"; - #signAssertionsSwitch = "attributes.saml🍺assertion🍺signature"; - #signatureAlgorithm = "#saml🍺signature🍺algorithm"; - #signatureKeyName = - "#saml🍺server🍺signature🍺keyinfo🍺xmlSigKeyInfoKeyNameTransformer"; - #canonicalization = "#saml_signature_canonicalization_method"; - - #loginTheme = "#login_theme"; - #consentSwitch = "#consentRequired"; - #displayClientSwitch = "attributes.display🍺on🍺consent🍺screen"; - #consentScreenText = "attributes.consent🍺screen🍺text"; - - #saveBtn = "settings-save"; - #revertBtn = "settingsRevert"; - - #redirectUris = "redirectUris"; - - #idpInitiatedSsoUrlName = "attributes.saml_idp_initiated_sso_url_name"; - #idpInitiatedSsoRelayState = "attributes.saml_idp_initiated_sso_relay_state"; - #masterSamlProcessingUrl = "adminUrl"; - - public clickSaveBtn() { - cy.findByTestId(this.#saveBtn).click(); - return this; - } - - public clickRevertBtn() { - cy.findByTestId(this.#revertBtn).click(); - return this; - } - - public selectNameIdFormatDropdown(nameId: NameIdFormat) { - cy.get(this.#samlNameIdFormat).click(); - cy.findByText(nameId).click(); - return this; - } - - public selectSignatureAlgorithmDropdown(sign: string) { - cy.get(this.#signatureAlgorithm).click(); - cy.findByText(sign).click(); - return this; - } - - public selectSignatureKeyNameDropdown(keyName: string) { - cy.get(this.#signatureKeyName).click(); - cy.findByText(keyName).click(); - return this; - } - - public selectCanonicalizationDropdown(canon: string) { - cy.get(this.#canonicalization).click(); - cy.findByText(canon).click(); - } - - public selectLoginThemeDropdown(theme: string) { - cy.get(this.#loginTheme).click(); - cy.findByText(theme).click(); - } - - public clickForceNameIdFormatSwitch() { - cy.findByTestId(this.#forceNameIdFormat).parent().click(); - return this; - } - - public clickForcePostBindingSwitch() { - cy.findByTestId(this.#forcePostBinding).parent().click(); - return this; - } - - public clickForceArtifactBindingSwitch() { - cy.findByTestId(this.#forceArtifactBinding).parent().click(); - return this; - } - - public clickIncludeAuthnStatementSwitch() { - cy.findByTestId(this.#includeAuthnStatement).parent().click(); - return this; - } - - public clickIncludeOneTimeUseConditionSwitch() { - cy.findByTestId(this.#includeOneTimeUseCondition).parent().click(); - return this; - } - - public clickOptimizeLookupSwitch() { - cy.findByTestId(this.#optimizeLookup).parent().click(); - return this; - } - - public clickSignDocumentsSwitch() { - cy.findByTestId(this.#signDocumentsSwitch).parent().click(); - return this; - } - - public clickSignAssertionsSwitch() { - cy.findByTestId(this.#signAssertionsSwitch).parent().click(); - return this; - } - - public clickConsentSwitch() { - cy.get(this.#consentSwitch).parent().click(); - return this; - } - - public clickDisplayClientSwitch() { - cy.findByTestId(this.#displayClientSwitch).parent().click(); - return this; - } - - public assertNameIdFormatDropdown() { - this.selectNameIdFormatDropdown(NameIdFormat.Email); - this.selectNameIdFormatDropdown(NameIdFormat.Username); - this.selectNameIdFormatDropdown(NameIdFormat.Persistent); - this.selectNameIdFormatDropdown(NameIdFormat.Transient); - return this; - } - - public assertSignatureAlgorithmDropdown() { - this.selectSignatureAlgorithmDropdown("RSA_SHA1"); - this.selectSignatureAlgorithmDropdown("RSA_SHA256"); - this.selectSignatureAlgorithmDropdown("RSA_SHA256_MGF1"); - this.selectSignatureAlgorithmDropdown("RSA_SHA512"); - this.selectSignatureAlgorithmDropdown("RSA_SHA512_MGF1"); - this.selectSignatureAlgorithmDropdown("DSA_SHA1"); - return this; - } - - public assertSignatureKeyNameDropdown() { - this.selectSignatureKeyNameDropdown("KEY_ID"); - this.selectSignatureKeyNameDropdown("CERT_SUBJECT"); - this.selectSignatureKeyNameDropdown("NONE"); - return this; - } - - public assertCanonicalizationDropdown() { - this.selectCanonicalizationDropdown("EXCLUSIVE_WITH_COMMENTS"); - this.selectCanonicalizationDropdown("EXCLUSIVE"); - this.selectCanonicalizationDropdown("INCLUSIVE_WITH_COMMENTS"); - this.selectCanonicalizationDropdown("INCLUSIVE"); - return this; - } - - public assertLoginThemeDropdown() { - this.selectLoginThemeDropdown("base"); - this.selectLoginThemeDropdown("keycloak"); - return this; - } - - public assertSAMLCapabilitiesSwitches() { - this.clickForceNameIdFormatSwitch(); - this.assertSwitchStateOn(cy.findByTestId(this.#forceNameIdFormat)); - - this.clickForcePostBindingSwitch(); - this.assertSwitchStateOff(cy.findByTestId(this.#forcePostBinding)); - - this.clickForceArtifactBindingSwitch(); - this.assertSwitchStateOn(cy.findByTestId(this.#forceArtifactBinding)); - - this.clickIncludeAuthnStatementSwitch(); - this.assertSwitchStateOff(cy.findByTestId(this.#includeAuthnStatement)); - - this.clickIncludeOneTimeUseConditionSwitch(); - this.assertSwitchStateOn(cy.findByTestId(this.#includeOneTimeUseCondition)); - - this.clickOptimizeLookupSwitch(); - this.assertSwitchStateOn(cy.findByTestId(this.#optimizeLookup)); - return this; - } - - public assertSignatureEncryptionSwitches() { - cy.get(this.#signatureAlgorithm).should("exist"); - - this.clickSignDocumentsSwitch(); - this.assertSwitchStateOff(cy.findByTestId(this.#signDocumentsSwitch)); - cy.get(this.#signatureAlgorithm).should("not.exist"); - - this.clickSignAssertionsSwitch(); - this.assertSwitchStateOn(cy.findByTestId(this.#signAssertionsSwitch)); - cy.get(this.#signatureAlgorithm).should("exist"); - return this; - } - - public assertLoginSettings() { - cy.findByTestId(this.#displayClientSwitch).should("be.disabled"); - cy.findByTestId(this.#consentScreenText).should("be.disabled"); - this.clickConsentSwitch(); - cy.findByTestId(this.#displayClientSwitch).should("not.be.disabled"); - this.clickDisplayClientSwitch(); - cy.findByTestId(this.#consentScreenText).should("not.be.disabled"); - cy.findByTestId(this.#consentScreenText).click(); - cy.findByTestId(this.#consentScreenText).type("Consent Screen Text"); - return this; - } - - public selectRedirectUriTextField(number: number, text: string) { - cy.findByTestId(this.#redirectUris + number) - .click() - .clear() - .type(text); - return this; - } - - public assertAccessSettings() { - const redirectUriError = "Client could not be updated: invalid_input"; - - cy.findByTestId(this.#idpInitiatedSsoUrlName).click().type("a"); - cy.findByTestId(this.#idpInitiatedSsoRelayState).click().type("b"); - cy.findByTestId(this.#masterSamlProcessingUrl).click().type("c"); - - this.selectRedirectUriTextField(0, "Redirect Uri"); - cy.findByText("Add valid redirect URIs").click(); - this.selectRedirectUriTextField(1, "Redirect Uri second field"); - this.clickSaveBtn(); - masthead.checkNotificationMessage(redirectUriError); - - return this; - } -} diff --git a/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/clients/client_details/tabs/authorization_subtabs/EvaluateTab.ts b/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/clients/client_details/tabs/authorization_subtabs/EvaluateTab.ts deleted file mode 100644 index dfd3ff93071..00000000000 --- a/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/clients/client_details/tabs/authorization_subtabs/EvaluateTab.ts +++ /dev/null @@ -1,3 +0,0 @@ -import CommonPage from "../../../../../../CommonPage"; - -export default class EvaluateTab extends CommonPage {} diff --git a/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/clients/client_details/tabs/authorization_subtabs/ExportTab.ts b/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/clients/client_details/tabs/authorization_subtabs/ExportTab.ts deleted file mode 100644 index bdf8f3a22f1..00000000000 --- a/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/clients/client_details/tabs/authorization_subtabs/ExportTab.ts +++ /dev/null @@ -1,18 +0,0 @@ -import grantClipboardAccess from "../../../../../../../util/grantClipboardAccess"; -import CommonPage from "../../../../../../CommonPage"; - -export default class ExportTab extends CommonPage { - #exportDownloadBtn = "authorization-export-download"; - #exportCopyBtn = "authorization-export-copy"; - - copy() { - grantClipboardAccess(); - cy.findByTestId(this.#exportCopyBtn).click(); - return this; - } - - export() { - cy.findByTestId(this.#exportDownloadBtn).click(); - return this; - } -} diff --git a/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/clients/client_details/tabs/authorization_subtabs/PermissionsTab.ts b/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/clients/client_details/tabs/authorization_subtabs/PermissionsTab.ts deleted file mode 100644 index 9d527bd0e88..00000000000 --- a/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/clients/client_details/tabs/authorization_subtabs/PermissionsTab.ts +++ /dev/null @@ -1,26 +0,0 @@ -import CommonPage from "../../../../../../CommonPage"; -import CreatePermissionPage from "../../CreatePermissionPage"; -type PermissionType = "resource" | "scope"; - -export default class PermissionsTab extends CommonPage { - #createPermissionPage = new CreatePermissionPage(); - #createPermissionDrpDwn = "permissionCreateDropdown"; - #permissionResourceDrpDwn = "#resources"; - - createPermission(type: PermissionType) { - cy.findByTestId(this.#createPermissionDrpDwn).click(); - cy.findByTestId(`create-${type}`).click(); - return this.#createPermissionPage; - } - - selectResource(name: string) { - cy.get(this.#permissionResourceDrpDwn) - .click() - .parent() - .parent() - .findByText(name) - .parent() - .click(); - return this; - } -} diff --git a/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/clients/client_details/tabs/authorization_subtabs/PoliciesTab.ts b/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/clients/client_details/tabs/authorization_subtabs/PoliciesTab.ts deleted file mode 100644 index 6a5b7d65ff4..00000000000 --- a/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/clients/client_details/tabs/authorization_subtabs/PoliciesTab.ts +++ /dev/null @@ -1,35 +0,0 @@ -import CommonPage from "../../../../../../CommonPage"; - -export default class PoliciesTab extends CommonPage { - #emptyPolicyCreateBtn = "no-policies-empty-action"; - #createPolicyBtn = "createPolicy"; - - createPolicy(type: string, first = false) { - if (first) { - cy.findByTestId(this.#emptyPolicyCreateBtn).click(); - } else { - cy.findByTestId(this.#createPolicyBtn).click(); - } - cy.findByTestId(type).click(); - return this; - } - - fillBasePolicyForm(policy: { [key: string]: string }) { - Object.entries(policy).map(([key, value]) => - cy.findByTestId(key).type(value), - ); - return this; - } - - setPolicy(policyName: string) { - cy.findByTestId(policyName).click(); - return this; - } - - inputClient(clientName: string) { - cy.get("#clients").click(); - cy.get("ul li").contains(clientName).click(); - cy.get("#clients").click(); - return this; - } -} diff --git a/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/clients/client_details/tabs/authorization_subtabs/ResourcesTab.ts b/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/clients/client_details/tabs/authorization_subtabs/ResourcesTab.ts deleted file mode 100644 index 466cfbabf3e..00000000000 --- a/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/clients/client_details/tabs/authorization_subtabs/ResourcesTab.ts +++ /dev/null @@ -1,13 +0,0 @@ -import CommonPage from "../../../../../../CommonPage"; -import CreateResourcePage from "../../CreateResourcePage"; - -export default class ResourcesTab extends CommonPage { - #createResourcePage = new CreateResourcePage(); - #createResourceBtn = "createResource"; - - createResource() { - cy.findByTestId(this.#createResourceBtn).click(); - - return this.#createResourcePage; - } -} diff --git a/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/clients/client_details/tabs/authorization_subtabs/ScopesTab.ts b/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/clients/client_details/tabs/authorization_subtabs/ScopesTab.ts deleted file mode 100644 index 88766ff0889..00000000000 --- a/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/clients/client_details/tabs/authorization_subtabs/ScopesTab.ts +++ /dev/null @@ -1,12 +0,0 @@ -import CommonPage from "../../../../../../CommonPage"; -import CreateAuthorizationScopePage from "../../CreateAuthorizationScopePage"; - -export default class ScopesTab extends CommonPage { - #createAuthorizationScopePage = new CreateAuthorizationScopePage(); - #createScopeBtn = "no-authorization-scopes-empty-action"; - - createAuthorizationScope() { - cy.findByTestId(this.#createScopeBtn).click(); - return this.#createAuthorizationScopePage; - } -} diff --git a/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/clients/client_details/tabs/authorization_subtabs/SettingsTab.ts b/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/clients/client_details/tabs/authorization_subtabs/SettingsTab.ts deleted file mode 100644 index 9e5b81876e2..00000000000 --- a/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/clients/client_details/tabs/authorization_subtabs/SettingsTab.ts +++ /dev/null @@ -1,8 +0,0 @@ -import CommonPage from "../../../../../../CommonPage"; - -export default class SettingsTab extends CommonPage { - saveSettings() { - cy.findByTestId("authenticationSettingsSave").click(); - return this; - } -} diff --git a/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/clients/client_details/tabs/clientscopes_subtabs/EvaluateTab.ts b/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/clients/client_details/tabs/clientscopes_subtabs/EvaluateTab.ts deleted file mode 100644 index dfd3ff93071..00000000000 --- a/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/clients/client_details/tabs/clientscopes_subtabs/EvaluateTab.ts +++ /dev/null @@ -1,3 +0,0 @@ -import CommonPage from "../../../../../../CommonPage"; - -export default class EvaluateTab extends CommonPage {} diff --git a/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/clients/client_details/tabs/clientscopes_subtabs/SetupTab.ts b/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/clients/client_details/tabs/clientscopes_subtabs/SetupTab.ts deleted file mode 100644 index 981cb72ba87..00000000000 --- a/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/clients/client_details/tabs/clientscopes_subtabs/SetupTab.ts +++ /dev/null @@ -1,14 +0,0 @@ -import CommonPage from "../../../../../../CommonPage"; - -export enum SetupTabFilterItem { - Name = "Name", - AssignedType = "Assigned type", -} - -export enum SetupTabAssignedTypeItem { - AllTypes = "All types", - Default = "Default", - Optional = "Optional", -} - -export default class SetupTab extends CommonPage {} diff --git a/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/clients/tabs/ClientsListTab.ts b/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/clients/tabs/ClientsListTab.ts deleted file mode 100644 index 3423a24f06d..00000000000 --- a/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/clients/tabs/ClientsListTab.ts +++ /dev/null @@ -1,3 +0,0 @@ -import CommonPage from "../../../../CommonPage"; - -export default class ClientsListTab extends CommonPage {} diff --git a/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/clients/tabs/InitialAccessTokenTab.ts b/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/clients/tabs/InitialAccessTokenTab.ts deleted file mode 100644 index 9ae0730d3e0..00000000000 --- a/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/clients/tabs/InitialAccessTokenTab.ts +++ /dev/null @@ -1,77 +0,0 @@ -import CommonPage from "../../../../CommonPage"; - -export default class InitialAccessTokenTab extends CommonPage { - #initialAccessTokenTab = "initialAccessToken"; - - #emptyAction = "no-initial-access-tokens-empty-action"; - - #expirationNumberInput = "expiration"; - #expirationText = ".pf-v5-c-helper-text__item-text"; - #countInput = "#count input"; - #countPlusBtn = '#count [aria-label="Plus"]'; - #saveBtn = "save"; - - goToInitialAccessTokenTab() { - cy.findByTestId(this.#initialAccessTokenTab).click(); - return this; - } - - shouldBeEmpty() { - cy.findByTestId(this.#emptyAction).should("exist"); - return this; - } - - shouldNotBeEmpty() { - cy.findByTestId(this.#emptyAction).should("not.exist"); - return this; - } - - getFirstId(callback: (id: string) => void) { - cy.get("tbody > tr:first-child > td:first-child") - .invoke("text") - .then((text) => { - callback(text); - }); - return this; - } - - goToCreateFromEmptyList() { - cy.findByTestId(this.#emptyAction).click(); - return this; - } - - fillNewTokenData(expiration: number, count: number) { - cy.findByTestId(this.#expirationNumberInput).clear(); - cy.findByTestId(this.#expirationNumberInput).type(`${expiration}`); - cy.get(this.#countInput).clear(); - - for (let i = 0; i < count; i++) { - cy.get(this.#countPlusBtn).click(); - } - - return this; - } - - save() { - cy.findByTestId(this.#saveBtn).click(); - return this; - } - - checkExpirationGreaterThanZeroError() { - cy.get(this.#expirationText).should( - "have.text", - "Value should be greater than or equal to 1", - ); - return this; - } - - checkCountValue(value: number) { - cy.get(this.#countInput).should("have.value", value); - return this; - } - - checkSaveButtonIsDisabled() { - cy.findByTestId(this.#saveBtn).should("be.disabled"); - return this; - } -} diff --git a/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/events/EventsPage.ts b/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/events/EventsPage.ts deleted file mode 100644 index f0b0d0a6afb..00000000000 --- a/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/events/EventsPage.ts +++ /dev/null @@ -1,23 +0,0 @@ -import CommonPage from "../../../CommonPage"; -import UserEventsTab from "./tabs/UserEventsTab"; -import AdminEventsTab from "./tabs/AdminEventsTab"; - -export enum EventsTab { - UserEvents = "User events", - AdminEvents = "Admin events", -} - -export default class EventsPage extends CommonPage { - #userEventsTab = new UserEventsTab(); - #adminEventsTab = new AdminEventsTab(); - - goToUserEventsTab() { - this.tabUtils().clickTab(EventsTab.UserEvents); - return this.#userEventsTab; - } - - goToAdminEventsTab() { - this.tabUtils().clickTab(EventsTab.AdminEvents); - return this.#adminEventsTab; - } -} diff --git a/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/events/tabs/AdminEventsTab.ts b/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/events/tabs/AdminEventsTab.ts deleted file mode 100644 index 6d288bc08e0..00000000000 --- a/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/events/tabs/AdminEventsTab.ts +++ /dev/null @@ -1,326 +0,0 @@ -import ModalUtils from "../../../../../util/ModalUtils"; -import EmptyStatePage from "../../../components/EmptyStatePage"; -import PageObject from "../../../components/PageObject"; - -enum AdminEventsTabSearchFormFieldsLabel { - ResourceTypes = "Resource types", - OperationTypes = "Operation types", - ResourcePath = "Resource path", - Realm = "Realm", - Client = "Client", - User = "User", - IpAddress = "IP address", - DateFrom = "Date(from)", - DateTo = "Date(to)", -} - -export class AdminEventSearchData { - resourceTypes?: string[]; - operationTypes?: string[]; - resourcePath?: string; - realm?: string; - client?: string; - user?: string; - ipAddress?: string; - dateFrom?: string; - dateTo?: string; -} - -const emptyStatePage = new EmptyStatePage(); -const modalUtils = new ModalUtils(); - -export default class AdminEventsTab extends PageObject { - #searchAdminEventDrpDwnBtn = "dropdown-panel-btn"; - #searchEventsBtn = "search-events-btn"; - #operationTypesInputFld = - ".pf-v5-c-form-control.pf-v5-c-select__toggle-typeahead"; - #authAttrDataRow = 'tbody > tr > [data-label="Attribute"]'; - #authValDataRow = 'tbody > tr > [data-label="Value"]'; - #refreshBtn = "refresh-btn"; - #resourcePathInput = "#kc-resourcePath"; - #realmInput = "#kc-realm"; - #clientInput = "#kc-client"; - #userInput = "#kc-user"; - #ipAddressInput = "#kc-ipAddress"; - #dateFromInput = "#kc-dateFrom"; - #dateToInput = "#kc-dateTo"; - - public refresh() { - cy.findByTestId(this.#refreshBtn).click(); - return this; - } - - public openSearchAdminEventDropdownMenu() { - super.openDropdownMenu( - "", - cy.findByTestId(this.#searchAdminEventDrpDwnBtn), - ); - return this; - } - - public assertAdminSearchDropdownMenuHasLabels() { - super.assertDropdownMenuHasLabels( - Object.values(AdminEventsTabSearchFormFieldsLabel), - ); - return this; - } - - public openResourceTypesSelectMenu() { - cy.get(this.#operationTypesInputFld).first().click(); - return this; - } - - public closeResourceTypesSelectMenu() { - cy.get(this.#operationTypesInputFld).first().click(); - return this; - } - - public openOperationTypesSelectMenu() { - cy.get(this.#operationTypesInputFld).last().click(); - return this; - } - - public closeOperationTypesSelectMenu() { - cy.get(this.#operationTypesInputFld).last().click(); - return this; - } - - public typeIpAddress(ipAddress: string) { - cy.get(this.#ipAddressInput).type(ipAddress); - return this; - } - - searchAdminEvent(searchData: AdminEventSearchData) { - this.openSearchAdminEventDropdownMenu(); - if (searchData.resourceTypes) { - this.openResourceTypesSelectMenu(); - searchData.resourceTypes.forEach((value) => { - super.clickSelectMenuItem(value); - }); - this.closeResourceTypesSelectMenu(); - } - if (searchData.operationTypes) { - this.openOperationTypesSelectMenu(); - searchData.operationTypes.forEach((value) => { - super.clickSelectMenuItem(value); - }); - this.closeOperationTypesSelectMenu(); - } - if (searchData.resourcePath) { - cy.get(this.#resourcePathInput).type(searchData.resourcePath); - } - if (searchData.realm) { - cy.get(this.#realmInput).type(searchData.realm); - } - if (searchData.client) { - cy.get(this.#clientInput).type(searchData.client); - } - if (searchData.user) { - cy.get(this.#userInput).type(searchData.user); - } - if (searchData.ipAddress) { - cy.get(this.#ipAddressInput).type(searchData.ipAddress); - } - if (searchData.dateFrom) { - cy.get(this.#dateFromInput).type(searchData.dateFrom); - } - if (searchData.dateTo) { - cy.get(this.#dateToInput).type(searchData.dateTo); - } - cy.findByTestId(this.#searchEventsBtn).click(); - return this; - } - - public assertSearchAdminBtnEnabled(disabled: boolean) { - super.assertIsEnabled(cy.findByTestId(this.#searchEventsBtn), disabled); - return this; - } - - public searchAdminEventByResourceTypes(resourceTypes: string[]) { - const searchData = new AdminEventSearchData(); - searchData.resourceTypes = resourceTypes; - this.searchAdminEvent(searchData); - return this; - } - - public searchAdminEventByOperationTypes(operationTypes: string[]) { - const searchData = new AdminEventSearchData(); - searchData.operationTypes = operationTypes; - this.searchAdminEvent(searchData); - return this; - } - - public searchAdminEventByResourcePath(resourcePath: string) { - const searchData = new AdminEventSearchData(); - searchData.resourcePath = resourcePath; - this.searchAdminEvent(searchData); - return this; - } - - public searchAdminEventByRealm(realm: string) { - const searchData = new AdminEventSearchData(); - searchData.realm = realm; - this.searchAdminEvent(searchData); - return this; - } - - public searchAdminEventByClient(client: string) { - const searchData = new AdminEventSearchData(); - searchData.client = client; - this.searchAdminEvent(searchData); - return this; - } - - public searchAdminEventByUser(user: string) { - const searchData = new AdminEventSearchData(); - searchData.user = user; - this.searchAdminEvent(searchData); - return this; - } - - public searchAdminEventByIpAddress(ipAddress: string) { - const searchData = new AdminEventSearchData(); - searchData.ipAddress = ipAddress; - this.searchAdminEvent(searchData); - return this; - } - - public searchAdminEventByDateFrom(dateFrom: string) { - const searchData = new AdminEventSearchData(); - searchData.dateFrom = dateFrom; - this.searchAdminEvent(searchData); - return this; - } - - public searchAdminEventByDateTo(dateTo: string) { - const searchData = new AdminEventSearchData(); - searchData.dateTo = dateTo; - this.searchAdminEvent(searchData); - return this; - } - - public removeResourcePathChipGroup() { - super.removeChipGroup( - this.genericChipGroupSelector, - AdminEventsTabSearchFormFieldsLabel.ResourcePath, - ); - return this; - } - - public assertResourceTypesChipGroupExist(exist: boolean) { - super.assertChipGroupExist( - this.genericChipGroupSelector, - AdminEventsTabSearchFormFieldsLabel.ResourceTypes, - exist, - ); - return this; - } - - public assertOperationTypesChipGroupExist(exist: boolean) { - super.assertChipGroupExist( - this.genericChipGroupSelector, - AdminEventsTabSearchFormFieldsLabel.OperationTypes, - exist, - ); - return this; - } - - public assertResourcePathChipGroupExist(exist: boolean) { - super.assertChipGroupExist( - this.genericChipGroupSelector, - AdminEventsTabSearchFormFieldsLabel.ResourcePath, - exist, - ); - return this; - } - - public assertResourcePathChipGroupItemExist( - itemName: string, - exist: boolean, - ) { - super.assertChipGroupItemExist( - this.genericChipGroupSelector, - AdminEventsTabSearchFormFieldsLabel.ResourcePath, - itemName, - exist, - ); - return this; - } - - public assertRealmChipGroupExist(exist: boolean) { - super.assertChipGroupExist( - this.genericChipGroupSelector, - AdminEventsTabSearchFormFieldsLabel.Realm, - exist, - ); - return this; - } - - public assertClientChipGroupExist(exist: boolean) { - super.assertChipGroupExist( - this.genericChipGroupSelector, - AdminEventsTabSearchFormFieldsLabel.Client, - exist, - ); - return this; - } - - public assertUserChipGroupExist(exist: boolean) { - super.assertChipGroupExist( - this.genericChipGroupSelector, - AdminEventsTabSearchFormFieldsLabel.User, - exist, - ); - return this; - } - - public assertIpAddressChipGroupExist(exist: boolean) { - super.assertChipGroupExist( - this.genericChipGroupSelector, - AdminEventsTabSearchFormFieldsLabel.IpAddress, - exist, - ); - return this; - } - - public assertDateFromChipGroupExist(exist: boolean) { - super.assertChipGroupExist( - this.genericChipGroupSelector, - AdminEventsTabSearchFormFieldsLabel.DateFrom, - exist, - ); - return this; - } - - public assertDateToChipGroupExist(exist: boolean) { - super.assertChipGroupExist( - this.genericChipGroupSelector, - AdminEventsTabSearchFormFieldsLabel.DateTo, - exist, - ); - return this; - } - - public assertAuthDialogIsNotEmpty() { - modalUtils - .checkModalTitle("Auth") - .assertModalMessageContainText("Realm") - .assertModalMessageContainText("Client") - .assertModalMessageContainText("User") - .assertModalMessageContainText("IP address") - .assertModalHasElement(this.#authAttrDataRow, true) - .assertModalHasElement(this.#authValDataRow, true) - .closeModal(); - return this; - } - - public assertRepresentationDialogIsNotEmpty() { - modalUtils.checkModalTitle("Representation").closeModal(); - return this; - } - - public assertNoSearchResultsExist(exist: boolean) { - emptyStatePage.checkIfExists(exist); - return this; - } -} diff --git a/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/events/tabs/UserEventsTab.ts b/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/events/tabs/UserEventsTab.ts deleted file mode 100644 index c97070b90ea..00000000000 --- a/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/events/tabs/UserEventsTab.ts +++ /dev/null @@ -1,241 +0,0 @@ -import EmptyStatePage from "../../../components/EmptyStatePage"; -import PageObject from "../../../components/PageObject"; - -enum UserEventsTabSearchFormFieldsLabel { - UserId = "User ID", - EventType = "Event type", - Client = "Client", - DateFrom = "Date(from)", - DateTo = "Date(to)", - IpAddress = "IP Address", -} - -export class UserEventSearchData { - userId?: string; - eventType?: string[]; - client?: string; - dateFrom?: string; - dateTo?: string; - ipAddress?: string; -} - -const emptyStatePage = new EmptyStatePage(); - -export default class UserEventsTab extends PageObject { - #searchUserEventDrpDwnToggle = "dropdown-panel-btn"; - #searchUserIdInput = "#kc-userId"; - #searchEventTypeSelectToggle = - ".pf-v5-c-select.keycloak__events_search__type_select"; - #searchClientInput = "#kc-client"; - #searchDateFromInput = "#kc-dateFrom"; - #searchDateToInput = "#kc-dateTo"; - #searchIpAddress = "#kc-ipAddress"; - #searchEventsBtn = "search-events-btn"; - #refreshBtn = "refresh-btn"; - - public openSearchUserEventDropdownMenu() { - super.openDropdownMenu( - "", - cy.findByTestId(this.#searchUserEventDrpDwnToggle), - ); - return this; - } - - public openEventTypeSelectMenu() { - super.openSelectMenu("", cy.get(this.#searchEventTypeSelectToggle)); - return this; - } - - public closeEventTypeSelectMenu() { - super.closeSelectMenu("", cy.get(this.#searchEventTypeSelectToggle)); - return this; - } - - public clickEventTypeSelectItem(itemName: string) { - super.clickSelectMenuItem(itemName); - return this; - } - - public assertSearchEventBtnIsEnabled(enabled: boolean) { - super.assertIsEnabled(cy.findByTestId(this.#searchEventsBtn), enabled); - return this; - } - - public assertUserSearchDropdownMenuHasLabels() { - super.assertDropdownMenuHasLabels( - Object.values(UserEventsTabSearchFormFieldsLabel), - ); - return this; - } - - public assertSearchUserEventDropdownMenuExist(exist: boolean) { - super.assertExist( - cy.findByTestId(this.#searchUserEventDrpDwnToggle), - exist, - ); - return this; - } - - public refresh() { - cy.findByTestId(this.#refreshBtn).click(); - return this; - } - - public typeUserId(userId: string) { - cy.get(this.#searchUserIdInput).type(userId); - return this; - } - - public typeIpAddress(ipAddress: string) { - cy.get(this.#searchIpAddress).type(ipAddress); - return this; - } - - public searchUserEvent(searchData: UserEventSearchData) { - this.openSearchUserEventDropdownMenu(); - if (searchData.userId) { - this.typeUserId(searchData.userId); - } - if (searchData.eventType) { - this.openEventTypeSelectMenu(); - searchData.eventType.forEach((value) => { - super.clickSelectMenuItem(value); - }); - this.closeEventTypeSelectMenu(); - } - if (searchData.client) { - cy.get(this.#searchClientInput).type(searchData.client); - } - if (searchData.dateFrom) { - cy.get(this.#searchDateFromInput).type(searchData.dateFrom); - } - if (searchData.dateTo) { - cy.get(this.#searchDateToInput).type(searchData.dateTo); - } - if (searchData.ipAddress) { - cy.get(this.#searchIpAddress).type(searchData.ipAddress); - } - cy.findByTestId(this.#searchEventsBtn).click(); - return this; - } - - public searchUserEventByUserId(userId: string) { - const searchData = new UserEventSearchData(); - searchData.userId = userId; - this.searchUserEvent(searchData); - return this; - } - - public searchUserEventByEventType(eventType: string[]) { - const searchData = new UserEventSearchData(); - searchData.eventType = eventType; - this.searchUserEvent(searchData); - return this; - } - - public searchUserEventByClient(client: string) { - const searchData = new UserEventSearchData(); - searchData.client = client; - this.searchUserEvent(searchData); - return this; - } - - public searchUserEventByDateFrom(dateFrom: string) { - const searchData = new UserEventSearchData(); - searchData.dateFrom = dateFrom; - this.searchUserEvent(searchData); - return this; - } - - public searchUserEventByDateTo(dateTo: string) { - const searchData = new UserEventSearchData(); - searchData.dateTo = dateTo; - this.searchUserEvent(searchData); - return this; - } - - public searchUserEventByIpAddress(ipAddress: string) { - const searchData = new UserEventSearchData(); - searchData.ipAddress = ipAddress; - this.searchUserEvent(searchData); - return this; - } - - public removeEventTypeChipGroupItem(itemName: string) { - super.removeChipGroupItem( - this.genericChipGroupSelector, - UserEventsTabSearchFormFieldsLabel.EventType, - itemName, - ); - return this; - } - - public assertEventTypeChipGroupItemExist(itemName: string, exist: boolean) { - super.assertChipGroupItemExist( - this.genericChipGroupSelector, - UserEventsTabSearchFormFieldsLabel.EventType, - itemName, - exist, - ); - return this; - } - - public assertUserIdChipGroupExist(exist: boolean) { - super.assertChipGroupExist( - this.genericChipGroupSelector, - UserEventsTabSearchFormFieldsLabel.UserId, - exist, - ); - return this; - } - - public assertEventTypeChipGroupExist(exist: boolean) { - super.assertChipGroupExist( - this.genericChipGroupSelector, - UserEventsTabSearchFormFieldsLabel.EventType, - exist, - ); - return this; - } - - public assertClientChipGroupExist(exist: boolean) { - super.assertChipGroupExist( - this.genericChipGroupSelector, - UserEventsTabSearchFormFieldsLabel.Client, - exist, - ); - return this; - } - - public assertDateFromChipGroupExist(exist: boolean) { - super.assertChipGroupExist( - this.genericChipGroupSelector, - UserEventsTabSearchFormFieldsLabel.DateFrom, - exist, - ); - return this; - } - - public assertDateToChipGroupExist(exist: boolean) { - super.assertChipGroupExist( - this.genericChipGroupSelector, - UserEventsTabSearchFormFieldsLabel.DateTo, - exist, - ); - return this; - } - - public assertIpAddressChipGroupExist(exist: boolean) { - super.assertChipGroupExist( - this.genericChipGroupSelector, - UserEventsTabSearchFormFieldsLabel.IpAddress, - exist, - ); - return this; - } - - public assertNoSearchResultsExist(exist: boolean) { - emptyStatePage.checkIfExists(exist); - return this; - } -} diff --git a/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/groups/GroupModal.ts b/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/groups/GroupModal.ts deleted file mode 100644 index 4e72ee93660..00000000000 --- a/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/groups/GroupModal.ts +++ /dev/null @@ -1,36 +0,0 @@ -import ModalUtils from "../../../../util/ModalUtils"; - -export default class GroupModal extends ModalUtils { - #createGroupModalTitle = "Create a group"; - #groupNameInput = "name"; - #createGroupBnt = "createGroup"; - #renameButton = "renameGroup"; - #duplicateGroup = "duplicateGroup"; - - public setGroupNameInput(name: string) { - cy.findByTestId(this.#groupNameInput).clear().type(name); - return this; - } - - public create() { - cy.findByTestId(this.#createGroupBnt).click(); - return this; - } - - public rename() { - cy.findByTestId(this.#renameButton).click(); - return this; - } - - public duplicate() { - cy.findByTestId(this.#duplicateGroup).click(); - return this; - } - - public assertCreateGroupModalVisible(isVisible: boolean) { - super - .assertModalVisible(isVisible) - .assertModalTitleEqual(this.#createGroupModalTitle); - return this; - } -} diff --git a/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/groups/GroupPage.ts b/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/groups/GroupPage.ts deleted file mode 100644 index 42c77d85fa8..00000000000 --- a/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/groups/GroupPage.ts +++ /dev/null @@ -1,224 +0,0 @@ -import PageObject from "../../components/PageObject"; -import ListingPage from "../../ListingPage"; -import Masthead from "../../Masthead"; -import SidebarPage from "../../SidebarPage"; -import GroupModal from "./GroupModal"; -import MoveGroupModal from "./MoveGroupModal"; - -const groupModal = new GroupModal(); -const moveGroupModal = new MoveGroupModal(); -const listingPage = new ListingPage(); -const masthead = new Masthead(); -const sidebarPage = new SidebarPage(); - -export default class GroupPage extends PageObject { - protected createGroupEmptyStateBtn = "no-groups-in-this-realm-empty-action"; - #createGroupBtn = "openCreateGroupModal"; - protected actionDrpDwnButton = "action-dropdown"; - #searchField = "[data-testid='group-search']"; - - openCreateGroupModal(emptyState: boolean) { - if (emptyState) { - cy.findByTestId(this.createGroupEmptyStateBtn).click(); - } else { - cy.findByTestId(this.#createGroupBtn).click(); - } - return this; - } - - createGroup(groupName: string, emptyState: boolean) { - this.openCreateGroupModal(emptyState); - groupModal - .assertCreateGroupModalVisible(true) - .setGroupNameInput(groupName) - .create(); - cy.intercept("POST", "*/admin/realms/master/groups").as("post"); - return this; - } - - public searchGroup(searchValue: string, wait: boolean = false) { - this.search(this.#searchField, searchValue, wait); - - return this; - } - - protected search( - searchField: string, - searchValue: string, - wait: boolean, - exact = true, - ) { - if (wait) { - const searchUrl = `/admin/realms/master/**/*${searchValue}*`; - cy.intercept(searchUrl).as("search"); - } - - if (exact) { - cy.findByTestId("exact-search").check(); - } else { - cy.findByTestId("exact-search").uncheck(); - } - - cy.get(searchField + " input").clear(); - if (searchValue) { - cy.get(searchField + " input").type(searchValue); - cy.get(searchField + " button[type='submit']").click({ force: true }); - } else { - // TODO: Remove else and move clickSearchButton outside of the if - cy.get(searchField).type("{enter}"); - } - - if (wait) { - cy.wait(["@search"]); - } - } - - goToGroupChildGroupsTab(groupName: string) { - listingPage.goToItemDetails(groupName); - cy.intercept("GET", "*/admin/realms/master/groups/*").as("get"); - sidebarPage.waitForPageLoad(); - return this; - } - - selectGroupItemCheckbox(items: string[]) { - for (const item of items) { - listingPage.clickItemCheckbox(item); - } - return this; - } - - selectGroupItemCheckboxAllRows() { - listingPage.clickTableHeaderItemCheckboxAllRows(); - return this; - } - - deleteSelectedGroups(confirmModal = true) { - this.clickToolbarAction("Delete"); - if (confirmModal) { - groupModal.confirmModal(); - } - return this; - } - - showDeleteSelectedGroupsDialog() { - this.clickToolbarAction("Delete"); - return this; - } - - deleteGroupItem(groupName: string, confirmModal = true) { - listingPage.deleteItem(groupName); - if (confirmModal) { - groupModal.confirmModal(); - } - return this; - } - - duplicateGroupItem(groupName: string) { - cy.intercept("/admin/realms/master/groups/*").as("fetchGroup"); - listingPage.duplicateItem(groupName); - cy.wait("@fetchGroup"); - groupModal.confirmDuplicateModal(); - return this; - } - - moveGroupItemAction(groupName: string, destinationGroupName: string[]) { - listingPage.clickRowDetails(groupName); - listingPage.clickDetailMenu("Move to"); - moveGroupModal - .assertModalVisible(true) - .assertModalTitleEqual(`Move ${groupName} to Root`); - if (!destinationGroupName.includes("root")) { - for (const destination of destinationGroupName) { - moveGroupModal - .clickRow(destination) - .assertModalTitleEqual(`Move ${groupName} to ${destination}`); - } - } - moveGroupModal.clickMove(); - this.assertNotificationGroupMoved(); - moveGroupModal.assertModalExist(false); - return this; - } - - clickBreadcrumbItem(groupName: string) { - super.clickBreadcrumbItem(groupName); - return this; - } - - assertGroupItemExist(groupName: string, exist: boolean) { - listingPage.itemExist(groupName, exist); - return this; - } - - assertNoGroupsInThisRealmEmptyStateMessageExist(exist: boolean) { - this.assertEmptyStateExist(exist); - return this; - } - - assertGroupItemsEqual(number: number) { - listingPage.itemsEqualTo(number); - return this; - } - - assertNoSearchResultsMessageExist(exist: boolean) { - if (!exist) { - cy.get("keycloak_groups_treeview").should("be.visible"); - } else { - cy.get("keycloak_groups_treeview").should("not.exist"); - } - return this; - } - - assertNotificationGroupDeleted() { - masthead.checkNotificationMessage("Group deleted"); - return this; - } - - assertNotificationGroupsDeleted() { - masthead.checkNotificationMessage("Groups deleted"); - return this; - } - - assertNotificationGroupCreated() { - masthead.checkNotificationMessage("Group created"); - return this; - } - - assertNotificationGroupMoved() { - masthead.checkNotificationMessage("Group moved"); - return this; - } - - assertNotificationGroupUpdated() { - masthead.checkNotificationMessage("Group updated"); - return this; - } - - assertNotificationCouldNotCreateGroupWithEmptyName() { - masthead.checkNotificationMessage( - "Could not create group Group name is missing", - ); - return this; - } - - assertNotificationCouldNotCreateGroupWithDuplicatedName( - groupName: string, - errorMessage: string, - ) { - masthead.checkNotificationMessage( - errorMessage + groupName + "' already exists.", - ); - return this; - } - - assertNotificationGroupDuplicated() { - masthead.checkNotificationMessage("Group duplicated"); - return this; - } - - goToGroupActions(groupName: string) { - listingPage.clickRowDetails(groupName); - - return this; - } -} diff --git a/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/groups/MoveGroupModal.ts b/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/groups/MoveGroupModal.ts deleted file mode 100644 index 958d43ee517..00000000000 --- a/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/groups/MoveGroupModal.ts +++ /dev/null @@ -1,26 +0,0 @@ -import ModalUtils from "../../../../util/ModalUtils"; - -export default class MoveGroupModal extends ModalUtils { - #moveButton = "moveHere-button"; - #title = ".pf-v5-c-modal-box__title"; - - clickRow(groupName: string) { - cy.findByTestId(groupName).click(); - return this; - } - - clickRoot() { - cy.get(".pf-v5-c-breadcrumb__item > button").click(); - return this; - } - - checkTitle(title: string) { - cy.get(this.#title).should("have.text", title); - return this; - } - - clickMove() { - cy.findByTestId(this.#moveButton).click(); - return this; - } -} diff --git a/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/groups/SearchGroupPage.ts b/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/groups/SearchGroupPage.ts deleted file mode 100644 index 476dfcba71a..00000000000 --- a/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/groups/SearchGroupPage.ts +++ /dev/null @@ -1,36 +0,0 @@ -import GroupPage from "./GroupPage"; - -export class SearchGroupPage extends GroupPage { - #groupSearchField = "group-search"; - #searchButton = "[data-testid='group-search'] button[type='submit']"; - - public searchGroup(groupName: string) { - this.typeSearchInput(groupName); - this.clickSearchButton(); - return this; - } - - public searchGlobal(searchValue: string) { - this.search("[data-testid='searchForGroups']", searchValue, true); - - return this; - } - - public typeSearchInput(value: string) { - cy.findByTestId(this.#groupSearchField).type(value); - return this; - } - - public clickSearchButton() { - cy.get(this.#searchButton).click(); - return this; - } - - public checkTerm(searchTerm: string) { - cy.get(".pf-v5-c-chip-group") - .children() - .contains(searchTerm) - .should("exist"); - return this; - } -} diff --git a/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/groups/group_details/GroupDetailPage.ts b/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/groups/group_details/GroupDetailPage.ts deleted file mode 100644 index f6a03fdc05d..00000000000 --- a/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/groups/group_details/GroupDetailPage.ts +++ /dev/null @@ -1,176 +0,0 @@ -import ModalUtils from "../../../../../util/ModalUtils"; -import ListingPage from "../../../ListingPage"; -import GroupPage from "../GroupPage"; - -const modalUtils = new ModalUtils(); -const listingPage = new ListingPage(); -const groupPage = new GroupPage(); - -export default class GroupDetailPage extends GroupPage { - #groupNamesColumn = '[data-label="Group name"] > a'; - #memberTab = "members"; - #childGroupsTab = "groups"; - #attributesTab = "attributes"; - #roleMappingTab = "role-mapping-tab"; - #permissionsTab = "permissionsTab"; - #memberNameColumn = '[data-testid="members-table"] > tbody > tr'; - #addMembers = "addMember"; - #memberUsernameColumn = 'tbody > tr > [data-label="Username"]'; - #actionDrpDwnItemRenameGroup = "renameGroupAction"; - #actionDrpDwnItemDeleteGroup = "deleteGroup"; - #headerGroupName = ".pf-v5-l-level.pf-m-gutter"; - #renameGroupModalGroupNameInput = "name"; - #renameGroupModalRenameBtn = "renameGroup"; - #permissionSwitch = "permissionSwitch"; - - public goToChildGroupsTab() { - cy.findByTestId(this.#childGroupsTab).click(); - return this; - } - - public goToMembersTab() { - cy.findByTestId(this.#memberTab).click(); - return this; - } - - public goToAttributesTab() { - cy.findByTestId(this.#attributesTab).click(); - return this; - } - - public goToRoleMappingTab() { - cy.findByTestId(this.#roleMappingTab).click(); - return this; - } - - public goToPermissionsTab() { - cy.findByTestId(this.#permissionsTab).click(); - return this; - } - - public headerActionRenameGroup() { - super.openDropdownMenu("", cy.findByTestId(this.actionDrpDwnButton)); - super.clickDropdownMenuItem( - "", - cy.findByTestId(this.#actionDrpDwnItemRenameGroup), - ); - return this; - } - - public headerActionDeleteGroup() { - super.openDropdownMenu("", cy.findByTestId(this.actionDrpDwnButton)); - super.clickDropdownMenuItem( - "", - cy.findByTestId(this.#actionDrpDwnItemDeleteGroup), - ); - modalUtils.confirmModal(); - return this; - } - - public renameGroup(newGroupName: string) { - this.headerActionRenameGroup(); - modalUtils.checkModalTitle("Rename group"); - cy.findByTestId(this.#renameGroupModalGroupNameInput) - .clear() - .type(newGroupName); - cy.findByTestId(this.#renameGroupModalRenameBtn).click(); - return this; - } - - public deleteGroupHeaderAction() { - this.headerActionDeleteGroup(); - return this; - } - - public assertHeaderGroupNameEqual(groupName: string) { - cy.get(this.#headerGroupName).find("h1").should("have.text", groupName); - return this; - } - - checkListSubGroup(subGroups: string[]) { - cy.get(this.#groupNamesColumn).should((groups) => { - expect(groups).to.have.length(subGroups.length); - for (let index = 0; index < subGroups.length; index++) { - const subGroup = subGroups[index]; - expect(groups).to.contain(subGroup); - } - }); - return this; - } - - clickMembersTab() { - cy.findByTestId(this.#memberTab).click(); - return this; - } - - checkListMembers(members: string[]) { - cy.get(this.#memberNameColumn).should((member) => { - expect(member).to.have.length(members.length); - for (let index = 0; index < members.length; index++) { - expect(member.eq(index)).to.contain(members[index]); - } - }); - return this; - } - - checkSelectableMembers(members: string[]) { - cy.get(this.#memberUsernameColumn).should((member) => { - for (const user of members) { - expect(member).to.contain(user); - } - }); - return this; - } - - selectUsers(users: string[]) { - for (const user of users) { - cy.get(this.#memberUsernameColumn) - .contains(user) - .parent() - .find("input") - .click(); - } - return this; - } - - clickAddMembers() { - cy.findByTestId(this.#addMembers).click(); - return this; - } - - enablePermissionSwitch() { - cy.findByTestId(this.#permissionSwitch).parent().click(); - this.assertSwitchStateOn(cy.findByTestId(this.#permissionSwitch)); - cy.findByTestId(this.#permissionSwitch).parent().click(); - modalUtils - .checkModalTitle("Disable permissions?") - .checkConfirmButtonText("Confirm") - .confirmModal(); - this.assertSwitchStateOff(cy.findByTestId(this.#permissionSwitch)); - return this; - } - - checkDefaultRole() { - listingPage.itemExist("default-roles"); - } - - createRoleMappingSearch() { - listingPage.searchItemInModal("offline_access"); - listingPage.clickItemCheckbox("offline_access"); - } - - checkRoles(roleName: string | undefined = "offline_access") { - listingPage.itemExist(roleName); - listingPage.searchItem(roleName, false); - listingPage.itemExist(roleName); - listingPage.searchItem("non-existant-role", false); - groupPage.assertNoSearchResultsMessageExist(true); - } - - deleteRole() { - modalUtils - .checkModalTitle("Remove role?") - .checkConfirmButtonText("Remove") - .confirmModal(); - } -} diff --git a/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/groups/group_details/tabs/ChildGroupsTab.ts b/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/groups/group_details/tabs/ChildGroupsTab.ts deleted file mode 100644 index 03fe45fbd5a..00000000000 --- a/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/groups/group_details/tabs/ChildGroupsTab.ts +++ /dev/null @@ -1,21 +0,0 @@ -import GroupDetailPage from "../GroupDetailPage"; - -export default class ChildGroupsTab extends GroupDetailPage { - protected createGroupEmptyStateBtn = - "no-groups-in-this-sub-group-empty-action"; - protected createSubGroupBtn = "openCreateGroupModal"; - - public assertNoGroupsInThisSubGroupEmptyStateMessageExist(exist: boolean) { - super.assertEmptyStateExist(exist); - return this; - } - - public openCreateSubGroupModal(emptyState: boolean) { - if (emptyState) { - cy.findByTestId(this.createGroupEmptyStateBtn).click(); - } else { - cy.findByTestId(this.createSubGroupBtn).click(); - } - return this; - } -} diff --git a/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/groups/group_details/tabs/MembersTab.ts b/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/groups/group_details/tabs/MembersTab.ts deleted file mode 100644 index e8cec122cbd..00000000000 --- a/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/groups/group_details/tabs/MembersTab.ts +++ /dev/null @@ -1,96 +0,0 @@ -import ModalUtils from "../../../../../../util/ModalUtils"; -import ListingPage from "../../../../ListingPage"; -import Masthead from "../../../../Masthead"; -import SidebarPage from "../../../../SidebarPage"; -import GroupDetailPage from "../GroupDetailPage"; - -const modalUtils = new ModalUtils(); -const listingPage = new ListingPage(); -const masthead = new Masthead(); -const sidebarPage = new SidebarPage(); - -export default class MembersTab extends GroupDetailPage { - #addMemberEmptyStateBtn = "no-users-found-empty-action"; - #addMemberBtn = "addMember"; - #includeSubGroupsCheck = "includeSubGroupsCheck"; - - public openAddMemberModal(emptyState: boolean) { - cy.intercept("GET", "*/admin/realms/master/users?first=*").as("get"); - if (emptyState) { - cy.findByTestId(this.#addMemberEmptyStateBtn).click(); - } else { - cy.findByTestId(this.#addMemberBtn).click(); - } - sidebarPage.waitForPageLoad(); - return this; - } - - public addMember(usernames: string[], emptyState: boolean) { - this.openAddMemberModal(emptyState); - modalUtils.assertModalVisible(true).assertModalTitleEqual("Add member"); - for (const username of usernames) { - listingPage.clickItemCheckbox(username); - } - modalUtils.add(); - modalUtils.assertModalExist(false); - return this; - } - - public selectUserItemCheckbox(items: string[]) { - for (const item of items) { - listingPage.clickItemCheckbox(item); - } - return this; - } - - public leaveGroupSelectedUsers() { - this.clickToolbarAction("Leave"); - return this; - } - - public leaveGroupUserItem(username: string) { - listingPage.clickRowDetails(username); - listingPage.clickDetailMenu("Leave"); - return this; - } - - public showGroupMembershipsItem(username: string) { - listingPage.clickRowDetails(username); - listingPage.clickDetailMenu("Show memberships"); - return this; - } - - public cancelShowGroupMembershipsModal() { - modalUtils.cancelModal(); - return this; - } - - public clickCheckboxIncludeSubGroupUsers() { - cy.findByTestId(this.#includeSubGroupsCheck).click(); - return this; - } - - public assertNotificationUserAddedToTheGroup(amount: number) { - masthead.checkNotificationMessage( - `${amount} user${amount > 1 ? "s" : ""} added to the group`, - ); - return this; - } - - public assertNotificationUserLeftTheGroup(amount: number) { - masthead.checkNotificationMessage( - `${amount} user${amount > 1 ? "s" : ""} left the group`, - ); - return this; - } - - public assertNoUsersFoundEmptyStateMessageExist(exist: boolean) { - super.assertEmptyStateExist(exist); - return this; - } - - public assertUserItemExist(username: string, exist: boolean) { - listingPage.itemExist(username, exist); - return this; - } -} diff --git a/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/groups/group_details/tabs/PermissionsTab.ts b/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/groups/group_details/tabs/PermissionsTab.ts deleted file mode 100644 index c7027e53f0c..00000000000 --- a/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/groups/group_details/tabs/PermissionsTab.ts +++ /dev/null @@ -1,3 +0,0 @@ -import GroupDetailPage from "../GroupDetailPage"; - -export default class PermissionsTab extends GroupDetailPage {} diff --git a/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/identity_providers/AddMapperPage.ts b/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/identity_providers/AddMapperPage.ts deleted file mode 100644 index 7a01dd57bca..00000000000 --- a/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/identity_providers/AddMapperPage.ts +++ /dev/null @@ -1,364 +0,0 @@ -import Select from "../../../../forms/Select"; -import LegacyKeyValueInput from "../LegacyKeyValueInput"; - -export default class AddMapperPage { - #mappersTab = "mappers-tab"; - #noMappersAddMapperButton = "no-mappers-empty-action"; - #idpMapperSelectToggle = "#identityProviderMapper"; - #idpMapperSelect = "idp-mapper-select"; - #addMapperButton = "#add-mapper-button"; - - #mapperNameInput = "name"; - #attribute = "config.user🍺attribute"; - #attributeName = "attribute.name"; - #attributeFriendlyName = "attribute.friendly.name"; - #claimInput = "claim"; - #socialProfileJSONfieldPath = "jsonField"; - #userAttribute = "config.attribute"; - #userAttributeName = "config.userAttribute"; - #userAttributeValue = "attribute.value"; - #userSessionAttribute = "attribute"; - #userSessionAttributeValue = "attribute.value"; - #newMapperSaveButton = "new-mapper-save-button"; - #newMapperCancelButton = "new-mapper-cancel-button"; - #mappersUrl = "/oidc/mappers"; - #regexAttributeValuesSwitch = "are.attribute.values.regex"; - #syncmodeSelectToggle = "#syncMode"; - #attributesKeyInput = '[data-testid="config.attributes.0.key"]'; - #attributesValueInput = '[data-testid="config.attributes.0.value"]'; - #template = "template"; - #target = "#target"; - - goToMappersTab() { - cy.findByTestId(this.#mappersTab).click(); - return this; - } - - emptyStateAddMapper() { - cy.findByTestId(this.#noMappersAddMapperButton).click(); - return this; - } - - addMapper() { - cy.get(this.#addMapperButton).click(); - return this; - } - - clickCreateDropdown() { - cy.contains("Add provider").click(); - return this; - } - - saveNewMapper() { - cy.findByTestId(this.#newMapperSaveButton).click(); - return this; - } - - cancelNewMapper() { - cy.findByTestId(this.#newMapperCancelButton).click(); - return this; - } - - toggleSwitch(switchName: string) { - cy.findByTestId(switchName).click({ force: true }); - - return this; - } - - typeName(name: string) { - cy.findByTestId(this.#mapperNameInput).clear(); - cy.findByTestId(this.#mapperNameInput).type(name); - } - - fillSocialMapper(name: string) { - this.typeName(name); - - Select.selectItem(cy.get(this.#syncmodeSelectToggle), "Legacy"); - cy.get(this.#idpMapperSelectToggle).click(); - - cy.findByTestId(this.#idpMapperSelect) - .contains("Attribute Importer") - .click(); - - cy.findByTestId(this.#socialProfileJSONfieldPath).clear(); - cy.findByTestId(this.#socialProfileJSONfieldPath).type( - "social profile JSON field path", - ); - - cy.findByTestId(this.#userAttributeName).clear(); - - cy.findByTestId(this.#userAttributeName).type("user attribute name"); - - this.saveNewMapper(); - - return this; - } - - addRoleToMapperForm() { - cy.findByTestId("add-roles").click(); - cy.get("[aria-label='Select row 1']").click(); - cy.findByTestId("assign").click(); - return this; - } - - addAdvancedAttrToRoleMapper(name: string) { - this.typeName(name); - Select.selectItem(cy.get(this.#syncmodeSelectToggle), "Inherit"); - - cy.get(this.#idpMapperSelectToggle).click(); - - cy.findByTestId(this.#idpMapperSelect) - .contains("Advanced Attribute to Role") - .click(); - - cy.findByTestId("attributes-add-row").click(); - cy.get(this.#attributesKeyInput).clear(); - cy.get(this.#attributesKeyInput).type("key"); - - cy.get(this.#attributesValueInput).clear(); - cy.get(this.#attributesValueInput).type("value"); - - this.toggleSwitch(this.#regexAttributeValuesSwitch); - - this.addRoleToMapperForm(); - - this.saveNewMapper(); - - return this; - } - - addUsernameTemplateImporterMapper(name: string) { - this.typeName(name); - Select.selectItem(cy.get(this.#syncmodeSelectToggle), "Inherit"); - - cy.get(this.#idpMapperSelectToggle).click(); - - cy.findByTestId(this.#idpMapperSelect) - .contains("Username Template Importer") - .click(); - - cy.findByTestId(this.#template).clear(); - cy.findByTestId(this.#template).type("Template"); - - cy.get(this.#target).click().parent().contains("BROKER_ID").click(); - - this.saveNewMapper(); - - return this; - } - - addHardcodedUserSessionAttrMapper(name: string) { - this.typeName(name); - Select.selectItem(cy.get(this.#syncmodeSelectToggle), "Inherit"); - - cy.get(this.#idpMapperSelectToggle).click(); - - cy.findByTestId(this.#idpMapperSelect) - .contains("Hardcoded User Session Attribute") - .click(); - - cy.findByTestId(this.#userSessionAttribute).clear(); - cy.findByTestId(this.#userSessionAttribute).type("user session attribute"); - - cy.findByTestId(this.#userSessionAttributeValue).clear(); - cy.findByTestId(this.#userSessionAttributeValue).type( - "user session attribute value", - ); - - this.saveNewMapper(); - - return this; - } - - addSAMLAttrImporterMapper(name: string) { - this.typeName(name); - - Select.selectItem(cy.get(this.#syncmodeSelectToggle), "Inherit"); - - cy.get(this.#idpMapperSelectToggle).click(); - - cy.findByTestId(this.#idpMapperSelect) - .contains("Attribute Importer") - .click(); - - cy.findByTestId(this.#attributeName).clear(); - cy.findByTestId(this.#attributeName).type("attribute name"); - - cy.findByTestId(this.#attributeFriendlyName).clear(); - cy.findByTestId(this.#attributeFriendlyName).type( - "attribute friendly name", - ); - - cy.findByTestId(this.#attribute).clear().type("user attribute name"); - - this.saveNewMapper(); - - return this; - } - - addOIDCAttrImporterMapper(name: string) { - this.typeName(name); - - Select.selectItem(cy.get(this.#syncmodeSelectToggle), "Inherit"); - cy.get(this.#idpMapperSelectToggle).click(); - - cy.findByTestId(this.#idpMapperSelect) - .contains("Attribute Importer") - .click(); - - cy.findByTestId(this.#claimInput).clear().type("claim"); - cy.findByTestId(this.#attribute).clear().type("user attribute name"); - - this.saveNewMapper(); - - return this; - } - - addHardcodedRoleMapper(name: string) { - this.typeName(name); - Select.selectItem(cy.get(this.#syncmodeSelectToggle), "Inherit"); - - cy.get(this.#idpMapperSelectToggle).click(); - - cy.findByTestId(this.#idpMapperSelect).contains("Hardcoded Role").click(); - - this.addRoleToMapperForm(); - this.saveNewMapper(); - - return this; - } - - addHardcodedAttrMapper(name: string) { - this.typeName(name); - Select.selectItem(cy.get(this.#syncmodeSelectToggle), "Inherit"); - - cy.get(this.#idpMapperSelectToggle).click(); - - cy.findByTestId(this.#idpMapperSelect) - .contains("Hardcoded Attribute") - .click(); - - cy.findByTestId(this.#userAttribute).clear().type("user session attribute"); - - cy.findByTestId(this.#userAttributeValue) - .clear() - .type("user session attribute value"); - - this.saveNewMapper(); - - return this; - } - - addSAMLAttributeToRoleMapper(name: string) { - this.typeName(name); - - Select.selectItem(cy.get(this.#syncmodeSelectToggle), "Inherit"); - - cy.get(this.#idpMapperSelectToggle).click(); - - cy.findByTestId(this.#idpMapperSelect) - .contains("SAML Attribute to Role") - .click(); - - this.addRoleToMapperForm(); - - this.saveNewMapper(); - - return this; - } - - editUsernameTemplateImporterMapper() { - Select.selectItem(cy.get(this.#syncmodeSelectToggle), "Legacy"); - - cy.findByTestId(this.#template).type("_edited"); - - cy.get(this.#target).click().parent().contains("BROKER_USERNAME").click(); - - this.saveNewMapper(); - - return this; - } - - editSocialMapper() { - Select.selectItem(cy.get(this.#syncmodeSelectToggle), "Inherit"); - - cy.findByTestId(this.#socialProfileJSONfieldPath).clear(); - - cy.findByTestId(this.#socialProfileJSONfieldPath).type( - "social profile JSON field path edited", - ); - - cy.findByTestId(this.#userAttributeName).clear(); - - cy.findByTestId(this.#userAttributeName).type("user attribute name edited"); - - this.saveNewMapper(); - - return this; - } - - editSAMLorOIDCMapper() { - Select.selectItem(cy.get(this.#syncmodeSelectToggle), "Inherit"); - - cy.get(this.#attributesKeyInput).clear(); - cy.get(this.#attributesKeyInput).type("key_edited"); - - cy.get(this.#attributesValueInput).clear(); - cy.get(this.#attributesValueInput).type("value_edited"); - - this.toggleSwitch(this.#regexAttributeValuesSwitch); - - this.saveNewMapper(); - - return this; - } - - addOIDCAttributeImporterMapper(name: string) { - this.typeName(name); - - Select.selectItem(cy.get(this.#syncmodeSelectToggle), "Inherit"); - cy.get(this.#idpMapperSelectToggle).click(); - - cy.findByTestId(this.#idpMapperSelect) - .contains("Attribute Importer") - .click(); - - cy.findByTestId(this.#claimInput).clear(); - cy.findByTestId(this.#claimInput).type("claim"); - - cy.findByTestId(this.#userAttributeName).clear(); - cy.findByTestId(this.#userAttributeName).type("user attribute name"); - - this.saveNewMapper(); - - return this; - } - - addOIDCClaimToRoleMapper(name: string) { - this.typeName(name); - - Select.selectItem(cy.get(this.#syncmodeSelectToggle), "Inherit"); - - cy.get(this.#idpMapperSelectToggle).click(); - - cy.findByTestId(this.#idpMapperSelect).contains("Claim to Role").click(); - - cy.findByTestId("claims-add-row").click(); - const keyValue = new LegacyKeyValueInput("config.claims"); - - keyValue.fillKeyValue({ key: "key", value: "value" }); - - this.toggleSwitch("are.claim.values.regex"); - - this.addRoleToMapperForm(); - this.saveNewMapper(); - - return this; - } - - shouldGoToMappersTab() { - cy.url().should("include", this.#mappersUrl); - - return this; - } -} diff --git a/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/identity_providers/CreateProviderPage.ts b/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/identity_providers/CreateProviderPage.ts deleted file mode 100644 index f87dafcb4ba..00000000000 --- a/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/identity_providers/CreateProviderPage.ts +++ /dev/null @@ -1,136 +0,0 @@ -export default class CreateProviderPage { - #github = "github"; - #clientIdField = "config.clientId"; - #clientIdError = "#config\\.clientSecret-helper"; - #clientSecretField = "config.clientSecret"; - #displayName = "displayName"; - #discoveryEndpoint = "discoveryEndpoint"; - #authorizationUrl = "config.authorizationUrl"; - #addButton = "createProvider"; - #saveButton = "idp-details-save"; - #ssoServiceUrl = "sso-service-url"; - #authnContextClassRefs = "classref-field"; - #authnContextDeclRefs = "declref-field"; - #addProvider = "Add provider"; - #addClassRef = "Add AuthnContext ClassRef"; - #addDeclRef = "Add AuthnContext DeclRef"; - - checkVisible(name: string) { - cy.findByTestId(`${name}-card`).should("exist"); - return this; - } - - clickCard(name: string) { - cy.findByTestId(`${name}-card`).click(); - return this; - } - - clickGitHubCard() { - this.clickCard(this.#github); - return this; - } - - checkGitHubCardVisible() { - this.checkVisible(this.#github); - return this; - } - - checkClientIdRequiredMessage(exist = true) { - cy.get(this.#clientIdError).should((!exist ? "not." : "") + "exist"); - - return this; - } - - checkAddButtonDisabled(disabled = true) { - cy.findByTestId(this.#addButton).should( - !disabled ? "not." : "" + "be.disabled", - ); - return this; - } - - clickAdd() { - cy.findByTestId(this.#addButton).click(); - return this; - } - - clickSave() { - cy.findByTestId(this.#saveButton).click(); - return this; - } - - clickClassRefsAdd() { - cy.contains(this.#addClassRef).click(); - return this; - } - - clickDeclRefsAdd() { - cy.contains(this.#addDeclRef).click(); - return this; - } - - clickCreateDropdown() { - cy.contains(this.#addProvider).click(); - return this; - } - - clickItem(item: string) { - cy.findByTestId(item).click(); - return this; - } - - fill(id: string, secret = "") { - cy.findByTestId(this.#clientIdField).clear(); - - if (id) { - cy.findByTestId(this.#clientIdField).type(id); - } - - if (secret) { - cy.findByTestId(this.#clientSecretField).type(secret); - } - - return this; - } - - fillDisplayName(value: string) { - cy.findByTestId(this.#displayName).type("x"); - cy.findByTestId(this.#displayName).clear().type(value).blur(); - return this; - } - - fillDiscoveryUrl(value: string) { - cy.findByTestId(this.#discoveryEndpoint).type("x"); - cy.findByTestId(this.#discoveryEndpoint).clear().type(value).blur(); - return this; - } - - fillAuthnContextClassRefs(value: string) { - cy.findByTestId(this.#authnContextClassRefs).type("x"); - cy.findByTestId(this.#authnContextClassRefs).clear().type(value).blur(); - return this; - } - - fillAuthnContextDeclRefs(value: string) { - cy.findByTestId(this.#authnContextDeclRefs).type("x"); - cy.findByTestId(this.#authnContextDeclRefs).clear().type(value).blur(); - return this; - } - - fillSsoServiceUrl(value: string) { - cy.findByTestId(this.#ssoServiceUrl).type("x"); - cy.findByTestId(this.#ssoServiceUrl).clear().type(value).blur(); - return this; - } - - shouldBeSuccessful() { - cy.findByTestId(this.#discoveryEndpoint) - .parent() - .should("have.class", "pf-m-success"); - return this; - } - - shouldHaveAuthorizationUrl(value: string) { - cy.findByTestId(this.#authorizationUrl).should("have.value", value); - return this; - } -} diff --git a/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/identity_providers/OrderDialog.ts b/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/identity_providers/OrderDialog.ts deleted file mode 100644 index 2de2acdf7e6..00000000000 --- a/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/identity_providers/OrderDialog.ts +++ /dev/null @@ -1,31 +0,0 @@ -const expect = chai.expect; - -export default class OrderDialog { - #manageDisplayOrder = "manageDisplayOrder"; - #list = "manageOrderDataList"; - - openDialog() { - cy.findByTestId(this.#manageDisplayOrder).click({ force: true }); - return this; - } - - moveRowTo(from: string, to: string) { - cy.findByTestId(to).as("target"); - cy.findByTestId(from).drag("@target"); - return this; - } - - clickSave() { - cy.get("#modal-confirm").click(); - return this; - } - - checkOrder(providerNames: string[]) { - cy.get(`[data-testid=${this.#list}] li`).should((providers) => { - expect(providers).to.have.length(providerNames.length); - for (let index = 0; index < providerNames.length; index++) { - expect(providers.eq(index)).to.contain(providerNames[index]); - } - }); - } -} diff --git a/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/identity_providers/ProviderBaseAdvancedSettingsPage.ts b/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/identity_providers/ProviderBaseAdvancedSettingsPage.ts deleted file mode 100644 index 07694558515..00000000000 --- a/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/identity_providers/ProviderBaseAdvancedSettingsPage.ts +++ /dev/null @@ -1,507 +0,0 @@ -import PageObject from "../../components/PageObject"; -import Masthead from "../../Masthead"; - -const masthead = new Masthead(); - -export enum LoginFlowOption { - empty = "First login flow override", - none = "None", - browser = "browser", - directGrant = "direct grant", - registration = "registration", - resetCredentials = "reset credentials", - firstBrokerLogin = "first broker login", - dockerAuth = "docker auth", - httpChallenge = "http challenge", -} - -export enum SyncModeOption { - import = "Import", - legacy = "Legacy", - force = "Force", -} - -export enum PromptSelect { - unspecified = "Unspecified", - none = "None", - consent = "Consent", - login = "Login", - select = "Select account", -} - -export enum ClientAuthentication { - post = "Client secret sent as post", - basicAuth = "Client secret sent as basic auth", - jwt = "JWT signed with client secret", - jwtPrivKey = "JWT signed with private key", -} - -export enum ClientAssertionSigningAlg { - algorithmNotSpecified = "Algorithm not specified", - es256 = "ES256", - es384 = "ES384", - es512 = "ES512", - hs256 = "HS256", - hs384 = "HS384", - hs512 = "HS512", - ps256 = "PS256", - ps384 = "PS384", - ps512 = "PS512", - rs256 = "RS256", - rs384 = "RS384", - rs512 = "RS512", -} - -export default class ProviderBaseGeneralSettingsPage extends PageObject { - #scopesInput = "#scopes"; - #storeTokensSwitch = "#storeTokens"; - #storedTokensReadable = "#storedTokensReadable"; - #isAccessTokenJWT = "#isAccessTokenJWT"; - #acceptsPromptNoneForwardFromClientSwitch = "#acceptsPromptNone"; - #advancedSettingsToggle = ".pf-v5-c-expandable-section__toggle"; - #passLoginHintSwitch = "#passLoginHint"; - #passMaxAgeSwitch = "#passMaxAge"; - #passCurrentLocaleSwitch = "#passCurrentLocale"; - #backchannelLogoutSwitch = "#backchannelLogout"; - #promptSelect = "#prompt"; - #disableUserInfoSwitch = "#disableUserInfo"; - #trustEmailSwitch = "#trustEmail"; - #doNotStoreUsers = "#doNotStoreUsers"; - #accountLinkingOnlySwitch = "#accountLinkingOnly"; - #hideOnLoginPageSwitch = "#hideOnLoginPage"; - #firstLoginFlowSelect = "#firstBrokerLoginFlowAliasOverride"; - #postLoginFlowSelect = "#postBrokerLoginFlowAlias"; - #syncModeSelect = "#syncMode"; - #essentialClaimSwitch = "#filteredByClaim"; - #claimNameInput = "#kc-claim-filter-name"; - #claimValueInput = "#kc-claim-filter-value"; - #addBtn = "createProvider"; - #saveBtn = "idp-details-save"; - #revertBtn = "idp-details-revert"; - - #validateSignature = "#config\\.validateSignature"; - #jwksSwitch = "#config\\.useJwksUrl"; - #jwksUrl = "config.jwksUrl"; - #pkceSwitch = "#config\\.pkceEnabled"; - #pkceMethod = "#pkceMethod"; - #clientAuth = "#clientAuthMethod"; - #clientAssertionSigningAlg = "#clientAssertionSigningAlg"; - #clientAssertionAudienceInput = "#clientAssertionAudience"; - #jwtX509HeadersSwitch = "#jwtX509HeadersEnabled"; - - public clickSaveBtn() { - cy.findByTestId(this.#saveBtn).click(); - } - - public clickRevertBtn() { - cy.findByTestId(this.#revertBtn).click(); - } - - public typeScopesInput(text: string) { - cy.get(this.#scopesInput).type(text).blur(); - return this; - } - - public ensureAdvancedSettingsAreVisible() { - cy.findByTestId("jump-link-general-settings").click(); - cy.findByTestId("jump-link-advanced-settings").click(); - } - - public clickStoreTokensSwitch() { - cy.get(this.#storeTokensSwitch).parent().click(); - return this; - } - - public clickStoredTokensReadableSwitch() { - cy.get(this.#storedTokensReadable).parent().click(); - return this; - } - - public clickIsAccessTokenJWTSwitch() { - cy.get(this.#isAccessTokenJWT).parent().click(); - return this; - } - - public clickAcceptsPromptNoneForwardFromClientSwitch() { - cy.get(this.#acceptsPromptNoneForwardFromClientSwitch).parent().click(); - return this; - } - - public clickDisableUserInfoSwitch() { - cy.get(this.#disableUserInfoSwitch).parent().click(); - return this; - } - - public clickTrustEmailSwitch() { - cy.get(this.#trustEmailSwitch).parent().click(); - return this; - } - - public clickAccountLinkingOnlySwitch() { - cy.get(this.#accountLinkingOnlySwitch).parent().click(); - return this; - } - - public clickHideOnLoginPageSwitch() { - cy.get(this.#hideOnLoginPageSwitch).parent().click(); - return this; - } - - public clickEssentialClaimSwitch() { - cy.get(this.#essentialClaimSwitch).parent().click(); - return this; - } - - public clickdoNotStoreUsersSwitch() { - cy.get(this.#doNotStoreUsers).parent().click(); - return this; - } - - public typeClaimNameInput(text: string) { - cy.get(this.#claimNameInput).type(text).blur(); - return this; - } - - public typeClaimValueInput(text: string) { - cy.get(this.#claimValueInput).type(text).blur(); - return this; - } - - public selectFirstLoginFlowOption(loginFlowOption: LoginFlowOption) { - cy.get(this.#firstLoginFlowSelect).click(); - super.clickSelectMenuItem( - loginFlowOption, - cy.get(".pf-v5-c-menu__list-item").contains(loginFlowOption), - ); - return this; - } - - public selectPostLoginFlowOption(loginFlowOption: LoginFlowOption) { - cy.get(this.#postLoginFlowSelect).click(); - super.clickSelectMenuItem( - loginFlowOption, - cy.get(".pf-v5-c-menu__list-item").contains(loginFlowOption), - ); - return this; - } - - public selectClientAssertSignAlg( - clientAssertionSigningAlg: ClientAssertionSigningAlg, - ) { - cy.get(this.#clientAssertionSigningAlg).click(); - super.clickSelectMenuItem( - clientAssertionSigningAlg, - cy.get(".pf-v5-c-menu__list-item").contains(clientAssertionSigningAlg), - ); - return this; - } - - public typeClientAssertionAudience(text: string) { - cy.get(this.#clientAssertionAudienceInput).type(text).blur(); - return this; - } - - public selectSyncModeOption(syncModeOption: SyncModeOption) { - cy.get(this.#syncModeSelect).click(); - super.clickSelectMenuItem( - syncModeOption, - cy.get(".pf-v5-c-menu__list-item").contains(syncModeOption), - ); - return this; - } - - public selectPromptOption(promptOption: PromptSelect) { - cy.get(this.#promptSelect).click(); - super.clickSelectMenuItem( - promptOption, - cy.get(".pf-v5-c-menu__list-item").contains(promptOption).parent(), - ); - return this; - } - - public clickAdd() { - cy.findByTestId(this.#addBtn).click(); - return this; - } - - public assertScopesInputEqual(text: string) { - cy.get(this.#scopesInput).should("have.value", text).parent(); - return this; - } - - public assertStoreTokensSwitchTurnedOn(isOn: boolean) { - super.assertSwitchStateOn(cy.get(this.#storeTokensSwitch), isOn); - return this; - } - - public assertStoredTokensReadableTurnedOn(isOn: boolean) { - super.assertSwitchStateOn( - cy.get(this.#storedTokensReadable).parent(), - isOn, - ); - return this; - } - - public assertIsAccessTokenJWTTurnedOn(isOn: boolean) { - super.assertSwitchStateOn(cy.get(this.#isAccessTokenJWT).parent(), isOn); - return this; - } - - public assertAcceptsPromptNoneForwardFromClientSwitchTurnedOn(isOn: boolean) { - super.assertSwitchStateOn( - cy.get(this.#acceptsPromptNoneForwardFromClientSwitch).parent(), - isOn, - ); - return this; - } - - public assertDisableUserInfoSwitchTurnedOn(isOn: boolean) { - super.assertSwitchStateOn( - cy.get(this.#disableUserInfoSwitch).parent(), - isOn, - ); - return this; - } - - public assertTrustEmailSwitchTurnedOn(isOn: boolean) { - super.assertSwitchStateOn(cy.get(this.#trustEmailSwitch).parent(), isOn); - return this; - } - - public assertAccountLinkingOnlySwitchTurnedOn(isOn: boolean) { - super.assertSwitchStateOn(cy.get(this.#accountLinkingOnlySwitch), isOn); - return this; - } - - public assertHideOnLoginPageSwitchTurnedOn(isOn: boolean) { - super.assertSwitchStateOn( - cy.get(this.#hideOnLoginPageSwitch).parent(), - isOn, - ); - return this; - } - - public assertDoNotImportUsersSwitchTurnedOn(isOn: boolean) { - super.assertSwitchStateOn(cy.get(this.#doNotStoreUsers).parent(), isOn); - return this; - } - - public assertEssentialClaimSwitchTurnedOn(isOn: boolean) { - super.assertSwitchStateOn( - cy.get(this.#essentialClaimSwitch).parent(), - isOn, - ); - return this; - } - - public assertClaimInputEqual(text: string) { - cy.get(this.#claimNameInput).should("have.value", text).parent(); - return this; - } - - public assertClaimValueInputEqual(text: string) { - cy.get(this.#claimValueInput).should("have.value", text).parent(); - return this; - } - - public assertFirstLoginFlowSelectOptionEqual( - loginFlowOption: LoginFlowOption, - ) { - cy.get(this.#firstLoginFlowSelect).should("have.text", loginFlowOption); - return this; - } - - public assertPostLoginFlowSelectOptionEqual( - loginFlowOption: LoginFlowOption, - ) { - cy.get(this.#postLoginFlowSelect).should("have.text", loginFlowOption); - return this; - } - - public assertSyncModeSelectOptionEqual(syncModeOption: SyncModeOption) { - cy.get(this.#syncModeSelect).should("have.text", syncModeOption); - return this; - } - - public assertSyncModeShown(isShown: boolean) { - cy.get(this.#syncModeSelect).should(isShown ? "exist" : "not.exist"); - return this; - } - - public assertClientAssertSigAlgSelectOptionEqual( - clientAssertionSigningAlg: ClientAssertionSigningAlg, - ) { - cy.get(this.#clientAssertionSigningAlg).should( - "have.text", - clientAssertionSigningAlg, - ); - return this; - } - - public assertClientAssertionAudienceInputEqual(text: string) { - cy.get(this.#clientAssertionAudienceInput) - .should("have.value", text) - .parent(); - return this; - } - - public assertOIDCUrl(url: string) { - cy.findByTestId("jump-link-openid-connect-settings").click(); - cy.findByTestId(`config.${url}Url`).clear(); - cy.findByTestId(`config.${url}Url`).type("invalidUrl"); - this.clickSaveBtn(); - masthead.checkNotificationMessage( - "Could not update the provider The url [" + url + "_url] is malformed", - true, - ); - this.clickRevertBtn(); - //cy.findByTestId(url + "Url").contains - //("http://localhost:8180/realms/master/protocol/openid-connect/" + url) - return this; - } - - public assertOIDCSignatureSwitch() { - cy.findByTestId("jump-link-openid-connect-settings").click(); - cy.findByTestId(this.#jwksUrl).should("exist"); - super.assertSwitchStateOn(cy.get(this.#jwksSwitch)); - - cy.get(this.#jwksSwitch).parent().click(); - cy.findByTestId(this.#jwksUrl).should("not.exist"); - super.assertSwitchStateOff(cy.get(this.#jwksSwitch)); - - cy.get(this.#validateSignature).parent().click(); - cy.findByTestId(this.#jwksUrl).should("not.exist"); - super.assertSwitchStateOff(cy.get(this.#validateSignature)); - - this.clickRevertBtn(); - cy.findByTestId(this.#jwksUrl).should("exist"); - return this; - } - - public assertOIDCPKCESwitch() { - cy.findByTestId("jump-link-openid-connect-settings").click(); - super.assertSwitchStateOff(cy.get(this.#pkceSwitch)); - cy.get(this.#pkceMethod).should("not.exist"); - cy.get(this.#pkceSwitch).parent().click(); - - super.assertSwitchStateOn(cy.get(this.#pkceSwitch)); - cy.get(this.#pkceMethod).should("exist"); - return this; - } - - public assertOIDCClientAuthentication(option: ClientAuthentication) { - cy.findByTestId("jump-link-openid-connect-settings").click(); - cy.get(this.#clientAuth) - .click() - .get(".pf-v5-c-menu__list-item") - .contains(option) - .click(); - return this; - } - - public assertOIDCClientAuthSignAlg(alg: string) { - cy.findByTestId("jump-link-openid-connect-settings").click(); - cy.get(this.#clientAssertionSigningAlg) - .click() - .get(".pf-v5-c-menu__list-item") - .contains(alg) - .click(); - return this; - } - - public assertOIDCJWTX509HeadersSwitch() { - cy.findByTestId("jump-link-openid-connect-settings").click(); - cy.get(this.#clientAuth) - .click() - .get(".pf-v5-c-menu__list-item") - .contains(ClientAuthentication.post) - .click(); - cy.get(this.#jwtX509HeadersSwitch).should("not.exist"); - cy.get(this.#clientAuth) - .click() - .get(".pf-v5-c-menu__list-item") - .contains(ClientAuthentication.basicAuth) - .click(); - cy.get(this.#jwtX509HeadersSwitch).should("not.exist"); - cy.get(this.#clientAuth) - .click() - .get(".pf-v5-c-menu__list-item") - .contains(ClientAuthentication.jwt) - .click(); - cy.get(this.#jwtX509HeadersSwitch).should("not.exist"); - cy.get(this.#clientAuth) - .click() - .get(".pf-v5-c-menu__list-item") - .contains(ClientAuthentication.jwtPrivKey) - .click(); - cy.get(this.#jwtX509HeadersSwitch).should("exist"); - - super.assertSwitchStateOff(cy.get(this.#jwtX509HeadersSwitch)); - cy.get(this.#jwtX509HeadersSwitch).parent().click(); - super.assertSwitchStateOn(cy.get(this.#jwtX509HeadersSwitch)); - return this; - } - - public assertOIDCSettingsAdvancedSwitches() { - cy.get(this.#advancedSettingsToggle).scrollIntoView().click(); - - cy.get(this.#passLoginHintSwitch).parent().click(); - super.assertSwitchStateOn(cy.get(this.#passLoginHintSwitch)); - - cy.get(this.#passMaxAgeSwitch).parent().click(); - super.assertSwitchStateOn(cy.get(this.#passMaxAgeSwitch)); - - cy.get(this.#passCurrentLocaleSwitch).parent().click(); - super.assertSwitchStateOn(cy.get(this.#passCurrentLocaleSwitch)); - - cy.get(this.#backchannelLogoutSwitch).parent().click(); - super.assertSwitchStateOn(cy.get(this.#backchannelLogoutSwitch)); - - cy.get(this.#disableUserInfoSwitch).parent().click(); - super.assertSwitchStateOn(cy.get(this.#disableUserInfoSwitch)); - - this.clickAcceptsPromptNoneForwardFromClientSwitch(); - super.assertSwitchStateOn( - cy.get(this.#acceptsPromptNoneForwardFromClientSwitch), - ); - return this; - } - - public assertAdvancedSettings() { - cy.findByTestId("jump-link-advanced-settings").click(); - - this.clickStoreTokensSwitch(); - this.assertStoreTokensSwitchTurnedOn(true); - this.clickStoredTokensReadableSwitch(); - this.assertStoredTokensReadableTurnedOn(true); - this.clickIsAccessTokenJWTSwitch(); - this.assertIsAccessTokenJWTTurnedOn(true); - this.clickTrustEmailSwitch(); - this.assertTrustEmailSwitchTurnedOn(true); - this.clickAccountLinkingOnlySwitch(); - this.assertAccountLinkingOnlySwitchTurnedOn(true); - this.clickHideOnLoginPageSwitch(); - this.assertHideOnLoginPageSwitchTurnedOn(true); - - this.selectFirstLoginFlowOption(LoginFlowOption.browser); - this.selectPostLoginFlowOption(LoginFlowOption.directGrant); - this.selectSyncModeOption(SyncModeOption.import); - - this.clickRevertBtn(); - cy.get(this.#advancedSettingsToggle).scrollIntoView().click(); - this.assertStoreTokensSwitchTurnedOn(false); - this.assertStoredTokensReadableTurnedOn(false); - this.assertIsAccessTokenJWTTurnedOn(false); - this.assertTrustEmailSwitchTurnedOn(false); - this.assertAccountLinkingOnlySwitchTurnedOn(false); - this.assertHideOnLoginPageSwitchTurnedOn(false); - - this.assertFirstLoginFlowSelectOptionEqual(LoginFlowOption.empty); - this.assertPostLoginFlowSelectOptionEqual(LoginFlowOption.none); - this.assertSyncModeSelectOptionEqual(SyncModeOption.legacy); - this.assertClientAssertSigAlgSelectOptionEqual( - ClientAssertionSigningAlg.algorithmNotSpecified, - ); - return this; - } -} diff --git a/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/identity_providers/ProviderBaseGeneralSettingsPage.ts b/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/identity_providers/ProviderBaseGeneralSettingsPage.ts deleted file mode 100644 index 022916b118e..00000000000 --- a/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/identity_providers/ProviderBaseGeneralSettingsPage.ts +++ /dev/null @@ -1,140 +0,0 @@ -import FormValidation from "../../../../forms/FormValidation"; -import PageObject from "../../components/PageObject"; -import Masthead from "../../Masthead"; - -const masthead = new Masthead(); - -export default class ProviderBaseGeneralSettingsPage extends PageObject { - #redirectUriGroup = ".pf-v5-c-clipboard-copy__group"; - protected clientIdInput = "config.clientId"; - protected clientSecretInput = "config.clientSecret"; - #displayOrderInput = "#kc-display-order"; - #addBtn = "createProvider"; - #cancelBtn = "cancel"; - #requiredFieldErrorMsg = ".pf-v5-c-form__helper-text.pf-m-error"; - protected requiredFields: string[] = [ - this.clientIdInput, - this.clientSecretInput, - ]; - protected testData = { - ClientId: "client", - ClientSecret: "client_secret", - DisplayOrder: "0", - }; - - public typeClientId(clientId: string) { - if (clientId) { - cy.findByTestId(this.clientIdInput).type(clientId); - } else { - cy.findByTestId(this.clientIdInput).clear(); - } - return this; - } - - public typeClientSecret(clientSecret: string) { - if (clientSecret) { - cy.findByTestId(this.clientSecretInput).type(clientSecret); - } else { - cy.findByTestId(this.clientSecretInput).clear(); - } - return this; - } - - public typeDisplayOrder(displayOrder: string) { - cy.get(this.#displayOrderInput).type(displayOrder).blur(); - - return this; - } - - public clickShowPassword() { - cy.findByTestId(this.clientSecretInput).parent().find("button").click(); - return this; - } - - public clickCopyToClipboard() { - cy.get(this.#redirectUriGroup).find("button").click(); - return this; - } - - public clickAdd() { - cy.findByTestId(this.#addBtn).click(); - return this; - } - - public clickCancel() { - cy.findByTestId(this.#cancelBtn).click(); - return this; - } - - public assertRedirectUriInputEqual(value: string) { - cy.get(this.#redirectUriGroup).find("input").should("have.value", value); - return this; - } - - public assertClientIdInputEqual(text: string) { - cy.findByTestId(this.clientIdInput).should("have.text", text); - return this; - } - - public assertClientSecretInputEqual(text: string) { - cy.findByTestId(this.clientSecretInput).should("have.text", text); - return this; - } - - public assertDisplayOrderInputEqual(text: string) { - cy.findByTestId(this.clientSecretInput).should("have.text", text); - return this; - } - - public assertNotificationIdpCreated() { - masthead.checkNotificationMessage("Identity provider successfully created"); - return this; - } - - protected assertCommonRequiredFields(requiredFields: string[]) { - requiredFields.forEach((elementLocator) => { - if (elementLocator.includes("#")) { - FormValidation.assertRequired(cy.get(elementLocator)); - } else { - FormValidation.assertRequired(cy.findByTestId(elementLocator)); - } - }); - return this; - } - - public assertRequiredFieldsErrorsExist() { - return this.assertCommonRequiredFields(this.requiredFields); - } - - protected fillCommonFields(idpName: string) { - this.typeClientId(this.testData["ClientId"] + idpName); - this.typeClientSecret(this.testData["ClientSecret"] + idpName); - this.typeDisplayOrder(this.testData["DisplayOrder"]); - - return this; - } - - public fillData(idpName: string) { - this.fillCommonFields(idpName); - - return this; - } - - protected assertCommonFilledDataEqual(idpName: string) { - cy.findByTestId(this.clientIdInput).should( - "have.value", - this.testData["ClientId"] + idpName, - ); - cy.findByTestId(this.clientSecretInput).should("contain.value", "****"); - cy.get(this.#displayOrderInput).should( - "have.value", - this.testData["DisplayOrder"], - ); - return this; - } - - public assertFilledDataEqual(idpName: string) { - this.assertCommonFilledDataEqual(idpName); - return this; - } -} diff --git a/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/identity_providers/social/ProviderFacebookGeneralSettings.ts b/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/identity_providers/social/ProviderFacebookGeneralSettings.ts deleted file mode 100644 index 8ce90eadc0a..00000000000 --- a/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/identity_providers/social/ProviderFacebookGeneralSettings.ts +++ /dev/null @@ -1,38 +0,0 @@ -import ProviderBaseGeneralSettingsPage from "../ProviderBaseGeneralSettingsPage"; - -const additionalUsersProfile_input_test_value = - "additionalUsersProfile_input_test_value"; - -export default class ProviderFacebookGeneralSettings extends ProviderBaseGeneralSettingsPage { - #additionalUsersProfileFieldsInput = "fetchedFields"; - - public typeAdditionalUsersProfileFieldsInput(value: string) { - cy.findByTestId(this.#additionalUsersProfileFieldsInput).type(value); - cy.findByTestId(this.#additionalUsersProfileFieldsInput).blur(); - return this; - } - - public assertAdditionalUsersProfileFieldsInputEqual(value: string) { - cy.findByTestId(this.#additionalUsersProfileFieldsInput).should( - "have.value", - value, - ); - return this; - } - - public fillData(idpName: string) { - this.fillCommonFields(idpName); - this.typeAdditionalUsersProfileFieldsInput( - idpName + additionalUsersProfile_input_test_value, - ); - return this; - } - - public assertFilledDataEqual(idpName: string) { - this.assertCommonFilledDataEqual(idpName); - this.assertAdditionalUsersProfileFieldsInputEqual( - idpName + additionalUsersProfile_input_test_value, - ); - return this; - } -} diff --git a/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/identity_providers/social/ProviderGithubGeneralSettings.ts b/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/identity_providers/social/ProviderGithubGeneralSettings.ts deleted file mode 100644 index fc62dd4c519..00000000000 --- a/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/identity_providers/social/ProviderGithubGeneralSettings.ts +++ /dev/null @@ -1,45 +0,0 @@ -import ProviderBaseGeneralSettingsPage from "../ProviderBaseGeneralSettingsPage"; - -const base_url_input_test_value = "base_url_input_test_value"; -const api_url_input_test_value = "api_url_input_test_value"; - -export default class ProviderGithubGeneralSettings extends ProviderBaseGeneralSettingsPage { - #baseUrlInput = "baseUrl"; - #apiUrlInput = "apiUrl"; - - public typeBaseUrlInput(value: string) { - cy.findByTestId(this.#baseUrlInput).type(value); - cy.findByTestId(this.#baseUrlInput).blur(); - return this; - } - - public typeApiUrlInput(value: string) { - cy.findByTestId(this.#apiUrlInput).type(value); - cy.findByTestId(this.#apiUrlInput).blur(); - return this; - } - - public assertBaseUrlInputInputEqual(value: string) { - cy.findByTestId(this.#baseUrlInput).should("have.value", value); - return this; - } - - public assertApiUrlInputEqual(value: string) { - cy.findByTestId(this.#apiUrlInput).should("have.value", value); - return this; - } - - public fillData(idpName: string) { - this.fillCommonFields(idpName); - this.typeBaseUrlInput(idpName + base_url_input_test_value); - this.typeApiUrlInput(idpName + api_url_input_test_value); - return this; - } - - public assertFilledDataEqual(idpName: string) { - this.assertCommonFilledDataEqual(idpName); - this.assertBaseUrlInputInputEqual(idpName + base_url_input_test_value); - this.assertApiUrlInputEqual(idpName + api_url_input_test_value); - return this; - } -} diff --git a/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/identity_providers/social/ProviderGoogleGeneralSettings.ts b/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/identity_providers/social/ProviderGoogleGeneralSettings.ts deleted file mode 100644 index 441ed1127ea..00000000000 --- a/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/identity_providers/social/ProviderGoogleGeneralSettings.ts +++ /dev/null @@ -1,62 +0,0 @@ -import ProviderBaseGeneralSettingsPage from "../ProviderBaseGeneralSettingsPage"; - -const hosted_domain_input_test_value = "hosted_domain_input_test_value"; - -export default class ProviderGoogleGeneralSettings extends ProviderBaseGeneralSettingsPage { - #hostedDomainInput = "hostedDomain"; - #useUserIpParamSwitch = "userIp"; - #requestRefreshTokenSwitch = "offlineAccess"; - - public typeHostedDomainInput(value: string) { - cy.findByTestId(this.#hostedDomainInput).type(value); - cy.findByTestId(this.#hostedDomainInput).blur(); - return this; - } - - public clickUseUserIpParamSwitch() { - cy.findByTestId(this.#useUserIpParamSwitch).parent().click(); - return this; - } - - public clickRequestRefreshTokenSwitch() { - cy.findByTestId(this.#requestRefreshTokenSwitch).parent().click(); - return this; - } - - public assertHostedDomainInputEqual(value: string) { - cy.findByTestId(this.#hostedDomainInput).should("have.value", value); - return this; - } - - public assertUseUserIpParamSwitchTurnedOn(isOn: boolean) { - super.assertSwitchStateOn( - cy.findByTestId(this.#useUserIpParamSwitch), - isOn, - ); - return this; - } - - public assertRequestRefreshTokenSwitchTurnedOn(isOn: boolean) { - super.assertSwitchStateOn( - cy.findByTestId(this.#requestRefreshTokenSwitch), - isOn, - ); - return this; - } - - public fillData(idpName: string) { - this.fillCommonFields(idpName); - this.typeHostedDomainInput(hosted_domain_input_test_value); - this.clickUseUserIpParamSwitch(); - this.clickRequestRefreshTokenSwitch(); - return this; - } - - public assertFilledDataEqual(idpName: string) { - this.assertCommonFilledDataEqual(idpName); - this.assertHostedDomainInputEqual(hosted_domain_input_test_value); - this.assertSwitchStateOn(cy.findByTestId(this.#useUserIpParamSwitch)); - this.assertSwitchStateOn(cy.findByTestId(this.#requestRefreshTokenSwitch)); - return this; - } -} diff --git a/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/identity_providers/social/ProviderMicrosoftGeneralSettings.ts b/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/identity_providers/social/ProviderMicrosoftGeneralSettings.ts deleted file mode 100644 index 478ce7573d4..00000000000 --- a/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/identity_providers/social/ProviderMicrosoftGeneralSettings.ts +++ /dev/null @@ -1,29 +0,0 @@ -import ProviderBaseGeneralSettingsPage from "../ProviderBaseGeneralSettingsPage"; - -const TENANT_ID_VALUE = "12345678-9abc-def0-1234-56789abcdef0"; - -export default class ProviderMicrosoftGeneralSettings extends ProviderBaseGeneralSettingsPage { - #tenantIdTestId = "tenantId"; - - public typeTenantIdInput(value: string) { - cy.findByTestId(this.#tenantIdTestId).type(value).blur(); - return this; - } - - public assertTenantIdInputEqual(value: string) { - cy.findByTestId(this.#tenantIdTestId).should("have.value", value); - return this; - } - - public fillData(idpName: string) { - this.fillCommonFields(idpName); - this.typeTenantIdInput(TENANT_ID_VALUE); - return this; - } - - public assertFilledDataEqual(idpName: string) { - this.assertCommonFilledDataEqual(idpName); - this.assertTenantIdInputEqual(TENANT_ID_VALUE); - return this; - } -} diff --git a/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/identity_providers/social/ProviderOpenshiftGeneralSettings.ts b/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/identity_providers/social/ProviderOpenshiftGeneralSettings.ts deleted file mode 100644 index 2e49e94c49e..00000000000 --- a/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/identity_providers/social/ProviderOpenshiftGeneralSettings.ts +++ /dev/null @@ -1,40 +0,0 @@ -import ProviderBaseGeneralSettingsPage from "../ProviderBaseGeneralSettingsPage"; - -const base_url_input_test_value = "base_url_input_test_value"; - -export default class ProviderOpenshiftGeneralSettings extends ProviderBaseGeneralSettingsPage { - #baseUrlInput = "baseUrl"; - - constructor() { - super(); - } - - public typeBaseUrlInput(value: string) { - cy.findByTestId(this.#baseUrlInput).type(value); - cy.findByTestId(this.#baseUrlInput).blur(); - return this; - } - - public assertbaseUrlInputEqual(value: string) { - cy.findByTestId(this.#baseUrlInput).should("have.value", value); - return this; - } - - public assertRequiredFieldsErrorsExist() { - return this.assertCommonRequiredFields(this.requiredFields); - } - - public fillData(idpName: string) { - this.fillCommonFields(idpName); - cy.findByTestId(this.#baseUrlInput).type( - idpName + base_url_input_test_value, - ); - return this; - } - - public assertFilledDataEqual(idpName: string) { - this.assertCommonFilledDataEqual(idpName); - this.assertbaseUrlInputEqual(idpName + base_url_input_test_value); - return this; - } -} diff --git a/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/identity_providers/social/ProviderPaypalGeneralSettings.ts b/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/identity_providers/social/ProviderPaypalGeneralSettings.ts deleted file mode 100644 index e1eada3d0a0..00000000000 --- a/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/identity_providers/social/ProviderPaypalGeneralSettings.ts +++ /dev/null @@ -1,27 +0,0 @@ -import ProviderBaseGeneralSettingsPage from "../ProviderBaseGeneralSettingsPage"; - -export default class ProviderPaypalGeneralSettings extends ProviderBaseGeneralSettingsPage { - #targetSandboxSwitch = "sandbox"; - - public clickTargetSandboxSwitch() { - cy.findByTestId(this.#targetSandboxSwitch).parent().click(); - return this; - } - - public assertTargetSandboxSwitchTurnedOn(isOn: boolean) { - super.assertSwitchStateOn(cy.findByTestId(this.#targetSandboxSwitch), isOn); - return this; - } - - public fillData(idpName: string) { - this.fillCommonFields(idpName); - this.clickTargetSandboxSwitch(); - return this; - } - - public assertFilledDataEqual(idpName: string) { - this.assertCommonFilledDataEqual(idpName); - this.assertSwitchStateOn(cy.findByTestId(this.#targetSandboxSwitch)); - return this; - } -} diff --git a/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/identity_providers/social/ProviderSAMLSettings.ts b/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/identity_providers/social/ProviderSAMLSettings.ts deleted file mode 100644 index e8a9e3f29e3..00000000000 --- a/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/identity_providers/social/ProviderSAMLSettings.ts +++ /dev/null @@ -1,231 +0,0 @@ -import Select from "../../../../../forms/Select"; -import PageObject from "../../../components/PageObject"; -import Masthead from "../../../Masthead"; - -const masthead = new Masthead(); - -export default class ProviderSAMLSettings extends PageObject { - #samlSwitch = "Saml-switch"; - #modalConfirm = "#modal-confirm"; - #serviceProviderEntityID = "config.entityId"; - #identityProviderEntityId = "identityProviderEntityId"; - #ssoServiceUrl = "config.singleSignOnServiceUrl"; - #singleLogoutServiceUrl = "config.singleLogoutServiceUrl"; - #nameIdPolicyFormat = "#nameIDPolicyFormat"; - #principalType = "#principalType"; - - #allowCreate = "config.allowCreate"; - #httpPostBindingResponse = "config.postBindingResponse"; - #httpPostBindingAuthnRequest = "config.postBindingAuthnRequest"; - #httpPostBindingLogout = "config.postBindingLogout"; - #wantAuthnRequestsSigned = "config.wantAuthnRequestsSigned"; - - #signatureAlgorithm = "#signatureAlgorithm"; - #samlSignatureKeyName = "#xmlSigKeyInfoKeyNameTransformer"; - - #wantAssertionsSigned = "config.wantAssertionsSigned"; - #wantAssertionsEncrypted = "config.wantAssertionsEncrypted"; - #forceAuthentication = "config.forceAuthn"; - #validateSignature = "config.validateSignature"; - #validatingX509Certs = "config.signingCertificate"; - #signServiceProviderMetadata = "config.signSpMetadata"; - #passSubject = "config.loginHint"; - #allowedClockSkew = "#config\\.allowedClockSkew"; - #attributeConsumingServiceIndex = "#config\\.attributeConsumingServiceIndex"; - #attributeConsumingServiceName = "config.attributeConsumingServiceName"; - - #comparison = "#comparison"; - #saveBtn = "idp-details-save"; - #revertBtn = "idp-details-revert"; - - public clickSaveBtn() { - cy.findByTestId(this.#saveBtn).click(); - } - - public clickRevertBtn() { - cy.findByTestId(this.#revertBtn).click(); - } - - public enableProviderSwitch() { - cy.findByTestId(this.#samlSwitch).parent().click(); - masthead.checkNotificationMessage("Provider successfully updated"); - } - - public disableProviderSwitch() { - cy.findByTestId(this.#samlSwitch).parent().click(); - cy.get(this.#modalConfirm).click(); - masthead.checkNotificationMessage("Provider successfully updated"); - } - - public typeServiceProviderEntityId(entityId: string) { - cy.findByTestId(this.#serviceProviderEntityID) - .click() - .clear() - .type(entityId); - return this; - } - - public typeIdentityProviderEntityId(entityId: string) { - cy.findByTestId(this.#identityProviderEntityId) - .click() - .clear() - .type(entityId); - return this; - } - - public typeSsoServiceUrl(url: string) { - cy.findByTestId(this.#ssoServiceUrl).clear().type(url); - return this; - } - - public typeSingleLogoutServiceUrl(url: string) { - cy.findByTestId(this.#singleLogoutServiceUrl).clear().type(url); - return this; - } - - public typeX509Certs(cert: string) { - cy.findByTestId(this.#validatingX509Certs).clear(); - cy.findByTestId(this.#validatingX509Certs).type(cert); - return this; - } - - public selectNamePolicyIdFormat(option: string) { - cy.get(this.#nameIdPolicyFormat).scrollIntoView(); - Select.selectItem(cy.get(this.#nameIdPolicyFormat), option); - Select.assertSelectedItem(cy.get(this.#nameIdPolicyFormat), option); - return this; - } - - public selectPrincipalFormat(option: string) { - cy.get(this.#principalType).scrollIntoView(); - Select.selectItem(cy.get(this.#principalType), option); - Select.assertSelectedItem(cy.get(this.#principalType), option); - return this; - } - - public selectSignatureAlgorithm(algorithm: string) { - cy.get(this.#signatureAlgorithm).scrollIntoView(); - Select.selectItem(cy.get(this.#signatureAlgorithm), algorithm); - } - - public selectSAMLSignature(key: string) { - cy.get(this.#samlSignatureKeyName).scrollIntoView(); - Select.selectItem(cy.get(this.#samlSignatureKeyName), key); - } - - public selectComparison(comparison: string) { - cy.get(this.#comparison).scrollIntoView().click(); - cy.findByText(comparison).scrollIntoView().click(); - } - - public assertIdAndURLFields() { - const ssoServiceUrlError = - "Could not update the provider The url [singleSignOnServiceUrl] is malformed"; - const singleLogoutServiceUrlError = - "Could not update the provider The url [singleLogoutServiceUrl] is malformed"; - this.typeServiceProviderEntityId("ServiceProviderEntityId"); - this.typeIdentityProviderEntityId("IdentityProviderEntityId"); - this.clickSaveBtn(); - - this.typeSsoServiceUrl("Not a real URL"); - this.clickSaveBtn(); - masthead.checkNotificationMessage(ssoServiceUrlError); - this.clickRevertBtn(); - - this.typeSingleLogoutServiceUrl("Not a real URL"); - this.clickSaveBtn(); - masthead.checkNotificationMessage(singleLogoutServiceUrlError); - return this; - } - - public assertNameIdPolicyFormat() { - this.selectNamePolicyIdFormat("Transient"); - this.selectNamePolicyIdFormat("Email"); - this.selectNamePolicyIdFormat("Kerberos"); - this.selectNamePolicyIdFormat("X.509 Subject Name"); - this.selectNamePolicyIdFormat("Windows Domain Qualified Name"); - this.selectNamePolicyIdFormat("Unspecified"); - this.selectNamePolicyIdFormat("Persistent"); - return this; - } - - public assertSignatureAlgorithm() { - cy.findByTestId(this.#wantAuthnRequestsSigned).parent().click(); - cy.get(this.#signatureAlgorithm).should("not.exist"); - cy.get(this.#samlSignatureKeyName).should("not.exist"); - this.clickRevertBtn(); - cy.get(this.#signatureAlgorithm).should("exist"); - cy.get(this.#samlSignatureKeyName).should("exist"); - - this.selectSignatureAlgorithm("RSA_SHA1"); - this.selectSignatureAlgorithm("RSA_SHA256"); - this.selectSignatureAlgorithm("RSA_SHA256_MGF1"); - this.selectSignatureAlgorithm("RSA_SHA512"); - this.selectSignatureAlgorithm("RSA_SHA512_MGF1"); - this.selectSignatureAlgorithm("DSA_SHA1"); - - this.selectSAMLSignature("NONE"); - this.selectSAMLSignature("KEY_ID"); - this.selectSAMLSignature("CERT_SUBJECT"); - - return this; - } - - public assertPrincipalType() { - this.selectPrincipalFormat("Subject NameID"); - this.selectPrincipalFormat("Attribute [Name]"); - this.selectPrincipalFormat("Attribute [Friendly Name]"); - return this; - } - - public assertSAMLSwitches() { - cy.findByTestId(this.#allowCreate).parent().click(); - cy.findByTestId(this.#httpPostBindingResponse).parent().click(); - cy.findByTestId(this.#httpPostBindingLogout).parent().click(); - cy.findByTestId(this.#httpPostBindingAuthnRequest).parent().click(); - - cy.findByTestId(this.#wantAssertionsSigned).parent().click(); - cy.findByTestId(this.#wantAssertionsEncrypted).parent().click(); - cy.findByTestId(this.#forceAuthentication).parent().click(); - - cy.findByTestId(this.#signServiceProviderMetadata).parent().click(); - cy.findByTestId(this.#passSubject).parent().click(); - - return this; - } - - public assertValidateSignatures() { - cy.findByTestId(this.#validateSignature).parent().click(); - cy.findByTestId(this.#validatingX509Certs).should("not.exist"); - cy.findByTestId(this.#validateSignature).parent().click(); - this.typeX509Certs("X509 Certificate"); - this.clickRevertBtn(); - cy.findByTestId(this.#validatingX509Certs); - this.clickSaveBtn(); - return this; - } - - public assertTextFields() { - cy.get(this.#allowedClockSkew) - .find("input") - .should("have.value", 0) - .clear() - .type("111"); - - cy.get(this.#attributeConsumingServiceIndex) - .find("input") - .should("have.value", 0) - .clear() - .type("111"); - - cy.findByTestId(this.#attributeConsumingServiceName).click().type("name"); - } - - public assertAuthnContext() { - this.selectComparison("minimum"); - this.selectComparison("maximum"); - this.selectComparison("better"); - this.selectComparison("exact"); - return this; - } -} diff --git a/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/identity_providers/social/ProviderStackoverflowGeneralSettings.ts b/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/identity_providers/social/ProviderStackoverflowGeneralSettings.ts deleted file mode 100644 index fee4b3d769c..00000000000 --- a/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/identity_providers/social/ProviderStackoverflowGeneralSettings.ts +++ /dev/null @@ -1,38 +0,0 @@ -import ProviderBaseGeneralSettingsPage from "../ProviderBaseGeneralSettingsPage"; - -const key_input_test_value = "key_input_test_value"; - -export default class ProviderStackoverflowGeneralSettings extends ProviderBaseGeneralSettingsPage { - #keyInput = "key"; - - constructor() { - super(); - } - - public typeKeyInput(value: string) { - cy.findByTestId(this.#keyInput).type(value); - cy.findByTestId(this.#keyInput).blur(); - return this; - } - - public assertKeyInputEqual(value: string) { - cy.findByTestId(this.#keyInput).should("have.value", value); - return this; - } - - public assertRequiredFieldsErrorsExist() { - return this.assertCommonRequiredFields(this.requiredFields); - } - - public fillData(idpName: string) { - this.fillCommonFields(idpName); - this.typeKeyInput(idpName + key_input_test_value); - return this; - } - - public assertFilledDataEqual(idpName: string) { - this.assertCommonFilledDataEqual(idpName); - this.assertKeyInputEqual(idpName + key_input_test_value); - return this; - } -} diff --git a/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/organization/IdentityProviderTab.ts b/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/organization/IdentityProviderTab.ts deleted file mode 100644 index e793352a31f..00000000000 --- a/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/organization/IdentityProviderTab.ts +++ /dev/null @@ -1,22 +0,0 @@ -import Select from "../../../../forms/Select"; -import CommonPage from "../../../CommonPage"; - -export default class IdentityProviderTab extends CommonPage { - goToTab() { - cy.findByTestId("identityProvidersTab").click(); - } - - fillForm(data: { name: string; domain: string; public: boolean }) { - Select.selectItem(cy.findByTestId("alias"), data.name); - Select.selectItem(cy.get("#kc🍺org🍺domain"), data.domain); - if (data.public) { - cy.findByAltText("config.kc🍺org🍺broker🍺public").click(); - } - } - - assertAddedSuccess() { - this.masthead().checkNotificationMessage( - "Identity provider successfully linked to organization", - ); - } -} diff --git a/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/organization/MemberTab.ts b/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/organization/MemberTab.ts deleted file mode 100644 index 193d120ef47..00000000000 --- a/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/organization/MemberTab.ts +++ /dev/null @@ -1,17 +0,0 @@ -import CommonPage from "../../../CommonPage"; - -export default class MembersTab extends CommonPage { - goToTab() { - cy.findByTestId("membersTab").click(); - } - - clickAddRealmUser() { - cy.findByTestId("add-realm-user-empty-action").click(); - } - - assertMemberAddedSuccess() { - this.masthead().checkNotificationMessage( - "1 user added to the organization", - ); - } -} diff --git a/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/organization/OrganizationPage.ts b/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/organization/OrganizationPage.ts deleted file mode 100644 index d2a677731cf..00000000000 --- a/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/organization/OrganizationPage.ts +++ /dev/null @@ -1,51 +0,0 @@ -import CommonPage from "../../../CommonPage"; - -export default class OrganizationPage extends CommonPage { - #nameField = "[data-testid='name']"; - - goToTab() { - cy.get("#nav-item-organizations").click(); - } - - goToCreate(empty: boolean = true) { - cy.findByTestId( - empty ? "no-organizations-empty-action" : "addOrganization", - ).click(); - } - - fillCreatePage(values: { - name: string; - domain?: string[]; - description?: string; - }) { - this.fillNameField(values.name); - values.domain?.forEach((d, index) => { - cy.findByTestId(`domains${index}`).type(d); - if (index !== (values.domain?.length || 0) - 1) - cy.findByTestId("addValue").click(); - }); - if (values.description) - cy.findByTestId("description").type(values.description); - } - - getNameField() { - return cy.get(this.#nameField); - } - - fillNameField(name: string) { - cy.get(this.#nameField).clear().type(name); - return this.getNameField(); - } - - assertSaveSuccess() { - this.masthead().checkNotificationMessage( - "Organization successfully saved.", - ); - } - - assertDeleteSuccess() { - this.masthead().checkNotificationMessage( - "The organization has been deleted", - ); - } -} diff --git a/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/providers/PriorityDialog.ts b/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/providers/PriorityDialog.ts deleted file mode 100644 index f85114bb52c..00000000000 --- a/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/providers/PriorityDialog.ts +++ /dev/null @@ -1,31 +0,0 @@ -const expect = chai.expect; - -export default class PriorityDialog { - #managePriorityOrder = "viewHeader-lower-btn"; - #list = "manageOrderDataList"; - - openDialog() { - cy.findByTestId(this.#managePriorityOrder).click({ force: true }); - return this; - } - - moveRowTo(from: string, to: string) { - cy.findByTestId(to).as("target"); - cy.findByTestId(from).drag("@target"); - return this; - } - - clickSave() { - cy.get("#modal-confirm").click({ force: true }); - return this; - } - - checkOrder(providerNames: string[]) { - cy.get(`[data-testid=${this.#list}] li`).should((providers) => { - expect(providers).to.have.length(providerNames.length); - for (let index = 0; index < providerNames.length; index++) { - expect(providers.eq(index)).to.contain(providerNames[index]); - } - }); - } -} diff --git a/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/providers/ProviderPage.ts b/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/providers/ProviderPage.ts deleted file mode 100644 index 074e1714b30..00000000000 --- a/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/providers/ProviderPage.ts +++ /dev/null @@ -1,486 +0,0 @@ -export default class ProviderPage { - // KerberosSettingsRequired input values - #kerberosNameInput = "name"; - #kerberosRealmInput = "config.kerberosRealm.0"; - #kerberosPrincipalInput = "config.serverPrincipal.0"; - #kerberosKeytabInput = "config.keyTab.0"; - - // LdapSettingsGeneral input values - #ldapNameInput = "name"; - #ldapVendorInput = "#kc-vendor"; - - // LdapSettingsConnection input values - connectionUrlInput = "config.connectionUrl.0"; - truststoreSpiInput = "#useTruststoreSpi"; - connectionTimeoutInput = "config.connectionTimeout.0"; - bindTypeInput = "#kc-bind-type"; - bindDnInput = "config.bindDn.0"; - bindCredsInput = "config.bindCredential.0"; - #testConnectionBtn = "test-connection-button"; - #testAuthBtn = "test-auth-button"; - - // LdapSettingsSearching input values - ldapEditModeInput = "#editMode"; - ldapSearchScopeInput = "#kc-search-scope"; - ldapPagination = "ui-pagination"; - ldapUsersDnInput = "config.usersDn.0"; - ldapUserLdapAttInput = "config.usernameLDAPAttribute.0"; - ldapRdnLdapAttInput = "config.rdnLDAPAttribute.0"; - ldapUuidLdapAttInput = "config.uuidLDAPAttribute.0"; - ldapUserObjClassesInput = "config.userObjectClasses.0"; - ldapUserLdapFilter = "config.customUserSearchFilter.0"; - ldapReadTimeout = "config.readTimeout.0"; - - // LdapSettingsKerberosIntegration input values - ldapKerberosRealmInput = "config.kerberosRealm.0"; - ldapServerPrincipalInput = "config.serverPrincipal.0"; - ldapKeyTabInput = "config.keyTab.0"; - allowKerberosAuth = "allow-kerberos-auth"; - debug = "debug"; - useKerberosForPwAuth = "use-kerberos-pw-auth"; - - // LdapSettingsSynchronization input values - ldapBatchSizeInput = "config.batchSizeForSync.0"; - ldapFullSyncPeriodInput = "config.fullSyncPeriod.0"; - ldapUsersSyncPeriodInput = "config.changedSyncPeriod.0"; - importUsers = "import-users"; - periodicFullSync = "periodic-full-sync"; - periodicUsersSync = "periodic-changed-users-sync"; - - // SettingsCache input values - #cacheDayInput = "#kc-eviction-day"; - #cacheHourInput = "#kc-eviction-hour"; - #cacheMinuteInput = "#kc-eviction-minute"; - #cachePolicyInput = "#kc-cache-policy"; - - // Mapper input values - #userModelAttInput = "config.user🍺model🍺attribute"; - #ldapAttInput = "ldap.attribute"; - #userModelAttNameInput = "config.user🍺model🍺attribute"; - #attValueInput = "attribute.value"; - #ldapFullNameAttInput = "ldap.full.name.attribute"; - #ldapAttNameInput = "ldap.attribute.name"; - #ldapAttValueInput = "ldap.attribute.value"; - #groupInput = "group"; - #ldapGroupsDnInput = "groups.dn"; - #ldapRolesDnInput = "roles.dn"; - - // Mapper types - #msadUserAcctMapper = "msad-user-account-control-mapper"; - #msadLdsUserAcctMapper = "msad-lds-user-account-control-mapper"; - #userAttLdapMapper = "user-attribute-ldap-mapper"; - #hcAttMapper = "hardcoded-attribute-mapper"; - #certLdapMapper = "certificate-ldap-mapper"; - #fullNameLdapMapper = "full-name-ldap-mapper"; - #hcLdapAttMapper = "hardcoded-ldap-attribute-mapper"; - #hcLdapGroupMapper = "hardcoded-ldap-group-mapper"; - #groupLdapMapper = "group-ldap-mapper"; - #roleLdapMapper = "role-ldap-mapper"; - #hcLdapRoleMapper = "hardcoded-ldap-role-mapper"; - - #actionDropdown = "action-dropdown"; - #deleteCmd = "delete-cmd"; - - #mappersTab = "ldap-mappers-tab"; - #rolesTab = "rolesTab"; - #createRoleBtn = "no-roles-for-this-client-empty-action"; - #roleSaveBtn = "save"; - #roleNameField = "name"; - - #groupName = "aa-uf-mappers-group"; - #clientName = "aa-uf-mappers-client"; - - #maxLifespan = "kerberos-cache-lifespan"; - - // Kerberos settings switch input values - debugSwitch = "debug"; - firstLoginSwitch = "update-first-login"; - passwordAuthSwitch = "allow-password-authentication"; - - // LDAP switch input values - enableStartTls = "enable-start-tls"; - connectionPooling = "connection-pooling"; - - // LDAP advanced settings switch input values - ldapv3PwSwitch = "ldapv3-password"; - validatePwPolicySwitch = "password-policy"; - trustEmailSwitch = "trust-email"; - - changeCacheTime(unit: string, time: string) { - switch (unit) { - case "day": - cy.get(this.#cacheDayInput).click(); - cy.get(this.#cacheDayInput).parent().find("ul").contains(time).click(); - break; - case "hour": - cy.get(this.#cacheHourInput).click(); - cy.get(this.#cacheHourInput).parent().find("ul").contains(time).click(); - break; - case "minute": - cy.get(this.#cacheMinuteInput).click(); - cy.get(this.#cacheMinuteInput) - .parent() - .find("ul") - .contains(time) - .click(); - break; - default: - console.log("Invalid cache time, must be 'day', 'hour', or 'minute'."); - break; - } - return this; - } - - verifyChangedHourInput(expected: string, unexpected: string) { - expect(cy.get(this.#cacheHourInput).contains(expected).should("exist")); - expect( - cy.get(this.#cacheHourInput).contains(unexpected).should("not.exist"), - ); - return this; - } - - deleteCardFromCard(card: string) { - cy.findByTestId(`${card}-dropdown`).click(); - cy.findByTestId("card-delete").click(); - return this; - } - - deleteCardFromMenu(card: string) { - this.clickExistingCard(card); - cy.findByTestId(this.#actionDropdown).click(); - cy.findByTestId(this.#deleteCmd).click(); - return this; - } - - fillKerberosRequiredData( - name: string, - realm: string, - principal: string, - keytab: string, - ) { - if (name) { - cy.findByTestId(this.#kerberosNameInput).clear().type(name); - } - if (realm) { - cy.findByTestId(this.#kerberosRealmInput).clear().type(realm); - } - if (principal) { - cy.findByTestId(this.#kerberosPrincipalInput).clear().type(principal); - } - if (keytab) { - cy.findByTestId(this.#kerberosKeytabInput).clear().type(keytab); - } - return this; - } - - fillMaxLifespanData(lifespan: number) { - for (let i = 0; i < lifespan; i++) { - cy.findByTestId(this.#maxLifespan).click(); - } - return this; - } - - fillSelect(selectField: string, value: string) { - cy.get(selectField).click(); - cy.get(selectField).parent().find("ul").contains(value).click(); - } - - fillTextField(textField: string, value: string) { - cy.findByTestId(textField).type("x"); - cy.findByTestId(textField).clear().type(value).blur(); - return this; - } - - toggleSwitch(switchName: string) { - cy.findByTestId(switchName).click({ force: true }); - return this; - } - - verifyToggle(switchName: string, value: "on" | "off") { - cy.findByTestId(switchName).should("have.value", value); - return this; - } - - verifyTextField(fieldName: string, value: string) { - cy.findByTestId(fieldName).should("have.value", value); - } - - verifySelect(selectInput: string, value: string) { - cy.get(selectInput).should("contain", value); - } - - fillLdapGeneralData(name: string, vendor?: string) { - cy.findByTestId(this.#ldapNameInput).clear().type(name); - if (vendor) { - cy.get(this.#ldapVendorInput).click(); - cy.get(this.#ldapVendorInput) - .parent() - .find("ul") - .contains(vendor) - .click(); - } - return this; - } - - fillLdapConnectionData( - connectionUrl: string, - bindType: string, - truststoreSpi?: string, - connectionTimeout?: string, - bindDn?: string, - bindCreds?: string, - ) { - cy.findByTestId(this.connectionUrlInput).clear().type(connectionUrl); - - cy.get(this.bindTypeInput).click(); - cy.get(this.bindTypeInput).parent().find("ul").contains(bindType).click(); - - if (truststoreSpi) { - cy.get(this.truststoreSpiInput).click(); - cy.get(this.truststoreSpiInput) - .parent() - .find("ul") - .contains(truststoreSpi) - .click(); - } - if (connectionTimeout) { - cy.findByTestId(this.connectionTimeoutInput) - .clear() - .type(connectionTimeout); - } - if (bindDn) { - cy.findByTestId(this.bindDnInput).clear().type(bindDn); - } - if (bindCreds) { - cy.findByTestId(this.bindCredsInput).clear().type(bindCreds); - } - return this; - } - - fillLdapSearchingData( - editMode: string, - usersDn: string, - userLdapAtt?: string, - rdnLdapAtt?: string, - uuidLdapAtt?: string, - userObjClasses?: string, - userLdapFilter?: string, - searchScope?: string, - readTimeout?: string, - ) { - cy.get(this.ldapEditModeInput).click(); - cy.get(this.ldapEditModeInput) - .parent() - .find("ul") - .contains(editMode) - .click(); - cy.findByTestId(this.ldapUsersDnInput).clear().type(usersDn); - if (userLdapAtt) { - cy.findByTestId(this.ldapUserLdapAttInput).clear().type(userLdapAtt); - } - if (rdnLdapAtt) { - cy.findByTestId(this.ldapRdnLdapAttInput).clear().type(rdnLdapAtt); - } - if (uuidLdapAtt) { - cy.findByTestId(this.ldapUuidLdapAttInput).clear().type(uuidLdapAtt); - } - if (userObjClasses) { - cy.findByTestId(this.ldapUserObjClassesInput) - .clear() - .type(userObjClasses); - } - if (userLdapFilter) { - cy.findByTestId(this.ldapUserLdapFilter).clear().type(userLdapFilter); - } - if (searchScope) { - cy.get(this.ldapSearchScopeInput).click(); - cy.get(this.ldapSearchScopeInput) - .parent() - .find("ul") - .contains(searchScope) - .click(); - } - if (readTimeout) { - cy.findByTestId(this.ldapReadTimeout).clear().type(readTimeout); - } - return this; - } - - selectCacheType(cacheType: string) { - cy.get(this.#cachePolicyInput).click(); - cy.get(this.#cachePolicyInput) - .parent() - .find("ul") - .contains(cacheType) - .click(); - return this; - } - - goToMappers() { - cy.findByTestId(this.#mappersTab).click(); - } - - createRole(roleName: string) { - cy.findByTestId(this.#rolesTab).click(); - cy.wait(1000); - cy.findByTestId(this.#createRoleBtn).click(); - cy.wait(1000); - cy.findByTestId(this.#roleNameField).clear().type(roleName); - cy.wait(1000); - cy.findByTestId(this.#roleSaveBtn).click(); - cy.wait(1000); - } - - createNewMapper(mapperType: string) { - const userModelAttValue = "middleName"; - const ldapAttValue = "cn"; - const ldapDnValue = "ou=groups"; - - cy.contains("Add").click(); - cy.wait(1000); - - cy.get("#kc-providerId").click(); - cy.get("button").contains(mapperType).click(); - - cy.findByTestId("name").clear().type(`${mapperType}-test`); - - switch (mapperType) { - case this.#msadUserAcctMapper: - case this.#msadLdsUserAcctMapper: - break; - case this.#userAttLdapMapper: - case this.#certLdapMapper: - cy.findByTestId(this.#userModelAttInput) - .clear() - .type(userModelAttValue); - cy.findByTestId(this.#ldapAttInput).clear().type(ldapAttValue); - break; - case this.#hcAttMapper: - cy.findByTestId(this.#userModelAttNameInput) - .clear() - .type(userModelAttValue); - cy.findByTestId(this.#attValueInput).clear().type(ldapAttValue); - break; - case this.#fullNameLdapMapper: - cy.findByTestId(this.#ldapFullNameAttInput).clear().type(ldapAttValue); - break; - case this.#hcLdapAttMapper: - cy.findByTestId(this.#ldapAttNameInput).clear().type(userModelAttValue); - cy.findByTestId(this.#ldapAttValueInput).clear().type(ldapAttValue); - break; - case this.#hcLdapGroupMapper: - cy.findByTestId(this.#groupInput).clear().type(this.#groupName); - break; - case this.#groupLdapMapper: - cy.findByTestId(this.#ldapGroupsDnInput).clear().type(ldapDnValue); - break; - - case this.#roleLdapMapper: - cy.findByTestId(this.#ldapRolesDnInput).clear().type(ldapDnValue); - cy.get(".pf-v5-c-form__group") - .contains("Client ID") - .parent() - .parent() - .find("input") - .click(); - cy.get("button").contains(this.#clientName).click({ force: true }); - break; - - case this.#hcLdapRoleMapper: - cy.findByTestId("add-roles").click(); - cy.get("[aria-label='Select row 1']").click(); - cy.findByTestId("assign").click(); - break; - default: - console.log("Invalid mapper type."); - break; - } - } - - updateMapper(mapperType: string) { - const userModelAttValue = "lastName"; - const ldapAttValue = "sn"; - - switch (mapperType) { - case this.#msadUserAcctMapper: - case this.#msadLdsUserAcctMapper: - break; - case this.#userAttLdapMapper: - case this.#certLdapMapper: - cy.findByTestId(this.#userModelAttInput) - .clear() - .type(userModelAttValue); - cy.findByTestId(this.#ldapAttInput).clear().type(ldapAttValue); - break; - case this.#hcAttMapper: - cy.findByTestId(this.#userModelAttNameInput) - .clear() - .type(userModelAttValue); - cy.findByTestId(this.#attValueInput).clear().type(ldapAttValue); - break; - case this.#fullNameLdapMapper: - cy.findByTestId(this.#ldapFullNameAttInput).clear().type(ldapAttValue); - break; - case this.#hcLdapAttMapper: - cy.findByTestId(this.#ldapAttNameInput).clear().type(userModelAttValue); - cy.findByTestId(this.#ldapAttValueInput).clear().type(ldapAttValue); - break; - default: - console.log("Invalid mapper name."); - break; - } - } - - clickExistingCard(cardName: string) { - cy.findByTestId("keycloak-card-title").contains(cardName).click(); - cy.wait(1000); - return this; - } - - clickMenuCommand(menu: string, command: string) { - cy.contains("button", menu).click(); - cy.contains("li", command).click(); - return this; - } - - clickNewCard(providerType: string) { - cy.findByTestId(`${providerType}-card`).click(); - cy.wait(1000); - return this; - } - - assertCardContainsText(providerType: string, expectedText: string) { - cy.findByTestId(`${providerType}-card`).should("contain", expectedText); - return this; - } - - disableEnabledSwitch(providerType: string) { - cy.get(`#${providerType}-switch`).uncheck({ force: true }); - return this; - } - - enableEnabledSwitch(providerType: string) { - cy.get(`#${providerType}-switch`).check({ force: true }); - return this; - } - - save(providerType: string) { - cy.findByTestId(`${providerType}-save`).click(); - return this; - } - - cancel(providerType: string) { - cy.findByTestId(`${providerType}-cancel`).click(); - return this; - } - - testConnection() { - cy.findByTestId(this.#testConnectionBtn).click(); - return this; - } - - testAuthorization() { - cy.findByTestId(this.#testAuthBtn).click(); - return this; - } -} diff --git a/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/realm_roles/AssociatedRolesPage.ts b/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/realm_roles/AssociatedRolesPage.ts deleted file mode 100644 index 6a40e0874d8..00000000000 --- a/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/realm_roles/AssociatedRolesPage.ts +++ /dev/null @@ -1,93 +0,0 @@ -export default class AssociatedRolesPage { - #addRoleToolbarButton = "assignRole"; - #addAssociatedRolesModalButton = "assign"; - #compositeRoleBadge = "composite-role-badge"; - #filterTypeDropdown = "filter-type-dropdown"; - #filterTypeDropdownItem = "clients"; - #usersPage = "users-page"; - #removeRolesButton = "unAssignRole"; - #addRoleTable = '[aria-label="Roles"] td'; - #associatedRolesTab = "associatedRolesTab"; - #assignRole = "no-roles-in-this-realm-empty-action"; - - addAssociatedRealmRole(roleName: string) { - cy.findByTestId(this.#associatedRolesTab).should("exist").click(); - - cy.findByTestId(this.#assignRole).click(); - - cy.findByTestId(this.#filterTypeDropdown).click(); - - cy.findByTestId(this.#filterTypeDropdownItem).click(); - - cy.get(this.#addRoleTable) - .contains(roleName) - .parents("tr") - .within(() => { - cy.get("input").click(); - }); - cy.findByTestId(this.#addAssociatedRolesModalButton).click(); - - cy.url().should("include", "/associated-roles"); - - cy.findByTestId(this.#compositeRoleBadge).should( - "contain.text", - "Composite", - ); - - return this; - } - - addAssociatedRoleFromSearchBar(roleName: string, isClientRole?: boolean) { - cy.findByTestId(this.#addRoleToolbarButton).click({ force: true }); - - if (!isClientRole) { - cy.findByTestId(this.#filterTypeDropdown).click(); - cy.findByTestId(this.#filterTypeDropdownItem).click(); - } - - cy.findByTestId(".pf-v5-c-spinner__tail-ball").should("not.exist"); - - cy.get(this.#addRoleTable) - .contains(roleName) - .parents("tr") - .within(() => { - cy.get("input").click(); - }); - - cy.findByTestId(this.#addAssociatedRolesModalButton).click(); - - cy.contains("Users in role").click(); - cy.findByTestId(this.#usersPage).should("exist"); - } - - addAssociatedClientRole(roleName: string) { - cy.findByTestId(this.#addRoleToolbarButton).click(); - - cy.findByTestId(".pf-v5-c-spinner__tail-ball").should("not.exist"); - - cy.get(this.#addRoleTable) - .contains(roleName) - .parents("tr") - .within(() => { - cy.get("input").click(); - }); - - cy.findByTestId(this.#addAssociatedRolesModalButton).click(); - - cy.contains("Users in role").click(); - cy.findByTestId(this.#usersPage).should("exist"); - } - - removeAssociatedRoles() { - cy.findByTestId(this.#removeRolesButton).click(); - return this; - } - - isRemoveAssociatedRolesBtnDisabled() { - cy.findByTestId(this.#removeRolesButton).should( - "have.class", - "pf-m-disabled", - ); - return this; - } -} diff --git a/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/realm_roles/CreateRealmRolePage.ts b/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/realm_roles/CreateRealmRolePage.ts deleted file mode 100644 index bc527fd6907..00000000000 --- a/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/realm_roles/CreateRealmRolePage.ts +++ /dev/null @@ -1,82 +0,0 @@ -class CreateRealmRolePage { - #realmRoleNameInput = "name"; - #realmRoleNameError = "#name-helper"; - #realmRoleDescriptionInput = "description"; - #saveBtn = "save"; - #cancelBtn = "cancel"; - - //#region General Settings - fillRealmRoleData(name: string, description = "") { - cy.findByTestId(this.#realmRoleNameInput).clear(); - - if (name) { - cy.findByTestId(this.#realmRoleNameInput).type(name); - } - - if (description !== "") { - this.updateDescription(description); - } - return this; - } - - checkRealmRoleNameRequiredMessage() { - cy.findByTestId(this.#realmRoleNameInput) - .parent() - .should("have.class", "pf-v5-c-form-control pf-m-error"); - - return this; - } - //#endregion - - clickActionMenu(item: string) { - cy.findByTestId("action-dropdown") - .click() - .parent() - .within(() => { - cy.findByText(item).click(); - }); - return this; - } - - checkNameDisabled() { - cy.findByTestId(this.#realmRoleNameInput).should( - "have.attr", - "disabled", - "disabled", - ); - return this; - } - - checkDescription(description: string) { - cy.findByTestId(this.#realmRoleDescriptionInput).should( - "have.value", - description, - ); - return this; - } - - updateDescription(description: string) { - cy.findByTestId(this.#realmRoleDescriptionInput).clear(); - cy.findByTestId(this.#realmRoleDescriptionInput).type(description); - return this; - } - - save() { - cy.findByTestId(this.#saveBtn).click(); - - return this; - } - - cancel() { - cy.findByTestId(this.#cancelBtn).click(); - - return this; - } - - goToAttributesTab() { - cy.findByTestId("attributesTab").click(); - return this; - } -} - -export default new CreateRealmRolePage(); diff --git a/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/realm_settings/KeysTab.ts b/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/realm_settings/KeysTab.ts deleted file mode 100644 index aa09aa5125b..00000000000 --- a/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/realm_settings/KeysTab.ts +++ /dev/null @@ -1,25 +0,0 @@ -export default class KeysTab { - readonly #keysTab = "rs-keys-tab"; - readonly #providersTab = "rs-providers-tab"; - readonly #addProviderDropdown = "addProviderDropdown"; - - goToKeysTab() { - cy.findByTestId(this.#keysTab).click(); - - return this; - } - - goToProvidersTab() { - this.goToKeysTab(); - cy.findByTestId(this.#providersTab).click(); - - return this; - } - - addProvider(provider: string) { - cy.findByTestId(this.#addProviderDropdown).click(); - cy.findByTestId(`option-${provider}`).click(); - - return this; - } -} diff --git a/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/realm_settings/RealmSettingsPage.ts b/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/realm_settings/RealmSettingsPage.ts deleted file mode 100644 index 9ef9c8e7865..00000000000 --- a/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/realm_settings/RealmSettingsPage.ts +++ /dev/null @@ -1,1388 +0,0 @@ -import Select from "../../../../forms/Select"; - -import CommonPage from "../../../CommonPage"; -import ListingPage from "../../ListingPage"; -import RealmSettingsEventsTab from "./tabs/RealmSettingsEventsTab"; - -enum RealmSettingsTab { - Events = "Events", -} - -const expect = chai.expect; -export default class RealmSettingsPage extends CommonPage { - generalSaveBtn = "realmSettingsGeneralTab-save"; - generalRevertBtn = "realmSettingsGeneralTab-revert"; - themesSaveBtn = "themes-tab-save"; - sessionsSaveBtn = "sessions-tab-save"; - loginTab = "rs-login-tab"; - emailTab = "rs-email-tab"; - themesTab = "rs-themes-tab"; - localizationTab = "rs-localization-tab"; - securityDefensesTab = "rs-security-defenses-tab"; - sessionsTab = "rs-sessions-tab"; - userProfileTab = "rs-user-profile-tab"; - tokensTab = "rs-tokens-tab"; - selectLoginTheme = "#kc-login-theme"; - loginThemeList = "[data-testid='select-loginTheme']"; - selectAccountTheme = "#kc-account-theme"; - accountThemeList = "[data-testid='select-accountTheme']"; - selectAdminTheme = "#kc-admin-ui-theme"; - adminThemeList = "[data-testid='select-adminTheme']"; - selectEmailTheme = "#kc-email-theme"; - emailThemeList = "[data-testid='select-emailTheme']"; - ssoSessionIdleSelectMenu = "#kc-sso-session-idle-select-menu"; - ssoSessionIdleSelectMenuList = "#kc-sso-session-idle-select-menu ul"; - ssoSessionMaxSelectMenu = "#kc-sso-session-max-select-menu"; - ssoSessionMaxSelectMenuList = "#kc-sso-session-max-select-menu ul"; - - ssoSessionMaxRememberMeSelectMenu = - "#kc-sso-session-max-remember-me-select-menu"; - ssoSessionMaxRememberMeSelectMenuList = - "#kc-sso-session-max-remember-me-select-menu ul"; - - ssoSessionIdleRememberMeSelectMenu = - "#kc-sso-session-idle-remember-me-select-menu"; - ssoSessionIdleRememberMeSelectMenuList = - "#kc-sso-session-idle-remember-me-select-menu ul"; - - clientSessionIdleSelectMenu = "#kc-client-session-idle-select-menu"; - clientSessionIdleSelectMenuList = "#kc-client-session-idle-select-menu ul"; - - clientSessionMaxSelectMenu = "#kc-client-session-max-select-menu"; - clientSessionMaxSelectMenuList = "#kc-client-session-max-select-menu ul"; - - offlineSessionIdleSelectMenu = "#kc-offline-session-idle-select-menu"; - - loginTimeoutSelectMenu = "#kc-login-timeout-select-menu"; - loginTimeoutSelectMenuList = "#kc-login-timeout-select-menu ul"; - - loginActionTimeoutSelectMenu = "#kc-login-action-timeout-select-menu"; - loginActionTimeoutSelectMenuList = "#kc-login-action-timeout-select-menu ul"; - - selectDefaultLocale = "#kc-default-locale"; - defaultLocaleList = "select-default-locale"; - supportedLocalesTypeahead = "#supportedLocales"; - supportedLocalesToggle = "#kc-l-supported-locales"; - emailSaveBtn = "email-tab-save"; - managedAccessSwitch = "userManagedAccessAllowed"; - userRegSwitch = "user-reg-switch"; - forgotPwdSwitch = "forgot-pw-switch"; - rememberMeSwitch = "remember-me-switch"; - emailAsUsernameSwitch = "email-as-username-switch"; - editUsernameSwitch = "edit-username-switch"; - loginWithEmailSwitch = "login-with-email-switch"; - duplicateEmailsSwitch = "duplicate-emails-switch"; - verifyEmailSwitch = "verify-email-switch"; - authSwitch = "email-authentication-switch"; - enableSslCheck = "enable-ssl"; - enableStartTlsCheck = "enable-start-tls"; - addProviderDropdown = "addProviderDropdown"; - activeSwitch = "active"; - enabledSwitch = "enabled"; - addProviderButton = "add-provider-button"; - displayName = "name"; - enableEvents = "eventsEnabled"; - eventsUserSave = "save-user"; - enableAdminEvents = "adminEventsEnabled"; - eventsAdminSave = "save-admin"; - eventTypeColumn = "tbody > tr td"; - filterSelectMenu = ".kc-filter-type-select"; - passiveKeysOption = "PASSIVE-option"; - disabledKeysOption = "DISABLED-option"; - activeKeysOption = "ACTIVE-option"; - testConnectionButton = "test-connection-button"; - modalTestConnectionButton = "modal-test-connection-button"; - emailAddressInput = "email-address-input"; - addBundleButton = "add-translationBtn"; - confirmAddTranslation = "add-translation-confirm-button"; - keyInput = "key"; - valueInput = "value"; - deleteAction = "delete-action"; - modalConfirm = "confirm"; - ssoSessionIdleInput = "sso-session-idle-input"; - ssoSessionMaxInput = "sso-session-max-input"; - ssoSessionIdleRememberMeInput = "sso-session-idle-remember-me-input"; - ssoSessionMaxRememberMeInput = "sso-session-max-remember-me-input"; - clientSessionIdleInput = "client-session-idle-input"; - clientSessionMaxInput = "client-session-max-input"; - offlineSessionIdleInput = "offline-session-idle-input"; - offlineSessionMaxSwitch = "offline-session-max-switch"; - loginTimeoutInput = "login-timeout-input"; - loginActionTimeoutInput = "login-action-timeout-input"; - selectDefaultSignatureAlgorithm = "#kc-default-sig-alg"; - revokeRefreshTokenSwitch = "revoke-refresh-token-switch"; - accessTokenLifespanInput = "access-token-lifespan-input"; - accessTokenLifespanImplicitInput = "access-token-lifespan-implicit-input"; - parRequestUriLifespanInput = "par-request-uri-lifespan-input"; - clientLoginTimeoutInput = "client-login-timeout-input"; - offlineSessionMaxInput = "offline-session-max-input"; - userInitiatedActionLifespanInput = "user-initiated-action-lifespan"; - defaultAdminInitatedInput = "default-admin-initated-input"; - emailVerificationInput = "email-verification-input"; - idpEmailVerificationInput = "idp-email-verification-input"; - forgotPasswordInput = "forgot-pw-input"; - executeActionsInput = "execute-actions-input"; - - accessTokenLifespanSelectMenu = "#kc-access-token-lifespan-select-menu"; - accessTokenLifespanSelectMenuList = - "#kc-access-token-lifespan-select-menu ul"; - - parRequestUriLifespanSelectMenu = "#par-request-uri-lifespan-select-menu"; - parRequestUriLifespanSelectMenuList = - "#par-request-uri-lifespan-select-menu ul"; - - accessTokenLifespanImplicitSelectMenu = - "#kc-access-token-lifespan-implicit-select-menu"; - accessTokenLifespanImplicitSelectMenuList = - "#kc-access-token-lifespan-implicit-select-menu ul"; - - clientLoginTimeoutSelectMenu = "#kc-client-login-timeout-select-menu"; - clientLoginTimeoutSelectMenuList = "#kc-client-login-timeout-select-menu ul"; - - offlineSessionMaxSelectMenu = "#kc-offline-session-max-select-menu"; - offlineSessionMaxSelectMenuList = "#kc-offline-session-max-select-menu ul"; - - userInitiatedActionLifespanSelectMenu = - "#kc-user-initiated-action-lifespan-select-menu"; - userInitiatedActionLifespanSelectMenuList = - "#kc-user-initiated-action-lifespan-select-menu ul"; - - defaultAdminInitatedInputSelectMenu = - "#kc-default-admin-initiated-select-menu"; - defaultAdminInitatedInputSelectMenuList = - "#kc-default-admin-initiated-select-menu"; - - emailVerificationSelectMenu = "#kc-email-verification-select-menu"; - emailVerificationSelectMenuList = "#kc-email-verification-select-menu ul"; - - idpEmailVerificationSelectMenu = "#kc-idp-email-verification-select-menu"; - idpEmailVerificationSelectMenuList = - "#kc-idp-email-verification-select-menu ul"; - - forgotPasswordSelectMenu = "#kc-forgot-pw-select-menu"; - forgotPasswordSelectMenuList = "#kc-forgot-pw-select-menu ul"; - - executeActionsSelectMenu = "#kc-execute-actions-select-menu"; - executeActionsSelectMenuList = "#kc-execute-actions-select-menu ul"; - - #formViewProfilesView = "formView-profilesView"; - #jsonEditorProfilesView = "jsonEditor-profilesView"; - #createProfileBtn = "createProfile"; - #formViewSelect = "formView-profilesView"; - #jsonEditorSelect = "jsonEditor-profilesView"; - #formViewSelectPolicies = "formView-policiesView"; - #jsonEditorSelectPolicies = "jsonEditor-policiesView"; - #newClientProfileNameInput = "name"; - #newClientProfileDescriptionInput = "description"; - #saveNewClientProfileBtn = "saveCreateProfile"; - #cancelNewClientProfile = "cancelCreateProfile"; - #createPolicyEmptyStateBtn = "no-client-policies-empty-action"; - #createPolicyBtn = "createPolicy"; - #newClientPolicyNameInput = "name"; - #newClientPolicyDescriptionInput = "client-policy-description"; - #saveNewClientPolicyBtn = "saveCreatePolicy"; - #cancelNewClientPolicyBtn = "cancelCreatePolicy"; - #alertMessage = ".pf-v5-c-alert__title"; - #modalDialogTitle = ".pf-v5-c-modal-box__title-text"; - #modalDialogBodyText = ".pf-v5-c-modal-box__body"; - #deleteDialogCancelBtn = "#modal-cancel"; - #jsonEditorSaveBtn = "jsonEditor-saveBtn"; - #jsonEditorSavePoliciesBtn = "jsonEditor-policies-saveBtn"; - #jsonEditorReloadBtn = "jsonEditor-reloadBtn"; - #jsonEditor = ".w-tc-editor-text"; - #clientPolicyDrpDwn = '[data-testid="action-dropdown"]'; - #deleteclientPolicyDrpDwn = "deleteClientPolicyDropdown"; - #clientProfileOne = - 'a[href*="realm-settings/client-policies/Test/edit-profile"]'; - #clientProfileTwo = - 'a[href*="realm-settings/client-policies/Edit/edit-profile"]'; - #clientPolicy = 'a[href*="realm-settings/client-policies/Test/edit-policy"]'; - #reloadBtn = "reloadProfile"; - #addExecutor = "addExecutor"; - #addExecutorDrpDwn = "#kc-executor"; - #addExecutorDrpDwnOption = ".pf-v5-c-menu__list"; - #addExecutorCancelBtn = ".pf-v5-c-form__actions a"; - #addExecutorSaveBtn = "addExecutor-saveBtn"; - #availablePeriodExecutorFld = "available-period"; - #editExecutorBtn = - '[aria-label="Executors"] > li > div:first-child [data-testid="editExecutor"]'; - #executorAvailablePeriodInput = "[data-testid='available-period']"; - - #listingPage = new ListingPage(); - #addCondition = "addCondition"; - #addConditionDrpDwn = "#provider"; - #addConditionDrpDwnOption = ".pf-v5-c-menu__list"; - #addConditionCancelBtn = "addCondition-cancelBtn"; - #addConditionSaveBtn = "addCondition-saveBtn"; - #clientRolesConditionLink = "client-roles-condition-link"; - #clientScopesConditionLink = "client-scopes-condition-link"; - #eventListenersFormLabel = ".pf-v5-c-form__label-text"; - #eventListenersDrpDwn = "#eventsListeners"; - #eventListenersSaveBtn = "saveEventListenerBtn"; - #eventListenersRevertBtn = "revertEventListenerBtn"; - #eventListenersInputFld = - "#eventsListeners .pf-v5-c-text-input-group__text-input"; - #eventListenersDrpDwnOption = ".pf-v5-c-menu__list"; - #eventListenersDrwDwnSelect = "#eventsListeners .pf-v5-c-menu-toggle__button"; - #eventListenerRemove = ".pf-v5-c-chip__actions"; - #roleSelect = "config.roles0"; - #selectScopeButton = "addValue"; - #deleteClientRolesConditionBtn = "delete-client-roles-condition"; - #deleteClientScopesConditionBtn = "delete-client-scopes-condition"; - #fromDisplayName = "smtpServer.fromDisplayName"; - #replyToEmail = "smtpServer.replyTo"; - #port = "smtpServer.port"; - - #publicKeyBtn = ".kc-keys-list > tbody > tr > td > .button-wrapper > button"; - #localizationLocalesSubTab = "rs-localization-locales-tab"; - #localizationRealmOverridesSubTab = "rs-localization-realm-overrides-tab"; - #localizationEffectiveMessageBundlesSubTab = - "rs-localization-effective-message-bundles-tab"; - #realmSettingsEventsTab = new RealmSettingsEventsTab(); - #realmId = 'input[aria-label="Copyable input"]'; - #securityDefensesHeadersSaveBtn = "headers-form-tab-save"; - #securityDefensesBruteForceSaveBtn = "brute-force-tab-save"; - #securityDefensesHeadersTab = "security-defenses-headers-tab"; - #securityDefensesBruteForceTab = "security-defenses-brute-force-tab"; - #clientProfileLink = 'table[aria-label="Profiles"] tbody a'; - - #realmName?: string; - constructor(realmName?: string) { - super(); - this.#realmName = realmName; - } - - #getRealmDisplayName() { - return cy.findByTestId("displayName"); - } - - #getFrontEndURL() { - return cy.findByTestId("attributes.frontendUrl"); - } - - #getSSLRequired() { - return cy.get("#sslRequired"); - } - - #getUnmanagedAttributes() { - return cy.get("#unmanagedAttributePolicy"); - } - - getFromInput() { - return cy.findByTestId("smtpServer.from"); - } - - getHostInput() { - return cy.findByTestId("smtpServer.host"); - } - - goToEventsTab() { - this.tabUtils().clickTab(RealmSettingsTab.Events); - return this.#realmSettingsEventsTab; - } - - disableRealm() { - cy.get(this.#modalDialogTitle).contains("Disable realm?"); - cy.get(this.#modalDialogBodyText).contains( - "Users and clients cannot access the realm if it is disabled. Are you sure you want to continue?", - ); - cy.findByTestId(this.modalConfirm).click(); - } - selectLoginThemeType(themeType: string) { - cy.get(this.selectLoginTheme).click(); - cy.get(this.loginThemeList).contains(themeType).click(); - - return this; - } - - selectAccountThemeType(themeType: string) { - cy.get(this.selectAccountTheme).click(); - cy.get(this.accountThemeList).contains(themeType).click(); - return this; - } - - selectAdminThemeType(themeType: string) { - cy.get(this.selectAdminTheme).click(); - cy.get(this.adminThemeList).contains(themeType).click(); - return this; - } - - selectEmailThemeType(themeType: string) { - cy.get(this.selectEmailTheme).click(); - cy.get(this.emailThemeList).contains(themeType).click(); - return this; - } - - fillEmailField(email: string) { - cy.findByTestId(this.emailAddressInput).type(email); - return this; - } - - fillHostField(host: string) { - this.getHostInput().clear(); - this.getHostInput().type(host); - return this; - } - - getDisplayName(name: string) { - this.#getRealmDisplayName().should("have.value", name); - return this; - } - - getFrontendURL(url: string) { - this.#getFrontEndURL().should("have.value", url); - return this; - } - - getRequireSSL(option: string) { - Select.assertSelectedItem(this.#getSSLRequired(), option); - return this; - } - - getUnmanagedAttributes(option: string) { - Select.assertSelectedItem(this.#getUnmanagedAttributes(), option); - return this; - } - - fillDisplayName(displayName: string) { - this.#getRealmDisplayName().clear(); - this.#getRealmDisplayName().type(displayName); - } - - clearRealmId() { - cy.get(this.#realmId).clear(); - } - - fillFromDisplayName(displayName: string) { - cy.findByTestId(this.#fromDisplayName).clear().type(displayName); - } - - fillReplyToEmail(email: string) { - cy.findByTestId(this.#replyToEmail).clear(); - cy.findByTestId(this.#replyToEmail).type(email); - } - - fillPort(port: string) { - cy.findByTestId(this.#port).clear(); - cy.findByTestId(this.#port).type(port); - } - - fillFrontendURL(url: string) { - this.clearFrontendURL(); - this.#getFrontEndURL().type(url); - } - - clearFrontendURL() { - this.#getFrontEndURL().clear(); - } - - fillRequireSSL(option: string) { - Select.selectItem(this.#getSSLRequired(), option); - } - - fillUnmanagedAttributes(option: string) { - Select.selectItem(this.#getUnmanagedAttributes(), option); - } - - setDefaultLocale(locale: string) { - cy.get(this.selectDefaultLocale).click(); - cy.findByTestId(this.defaultLocaleList).contains(locale).click(); - return this; - } - - saveGeneral() { - cy.findByTestId(this.generalSaveBtn).click(); - - return this; - } - - saveThemes() { - cy.findByTestId(this.themesSaveBtn).click(); - - return this; - } - - saveSessions() { - cy.findByTestId(this.sessionsSaveBtn).click(); - - return this; - } - - addSenderEmail(senderEmail: string) { - this.getFromInput().clear(); - - if (senderEmail) { - this.getFromInput().type(senderEmail); - } - - return this; - } - - testSelectFilter() { - cy.get(this.filterSelectMenu).first().click(); - cy.findByTestId(this.passiveKeysOption).click(); - cy.get(this.filterSelectMenu).first().click(); - cy.findByTestId(this.disabledKeysOption).click(); - } - - deleteProvider(name: string) { - this.#listingPage.deleteItem(name); - this.modalUtils().checkModalTitle("Delete key provider?").confirmModal(); - - cy.get(this.#alertMessage).should( - "be.visible", - "Success. The provider has been deleted.", - ); - return this; - } - - checkKeyPublic() { - cy.get(this.#publicKeyBtn).contains("Public key").click(); - this.modalUtils().checkModalTitle("Public key").confirmModal(); - - cy.get(this.#publicKeyBtn).contains("Certificate").click(); - this.modalUtils().checkModalTitle("Certificate").confirmModal(); - } - - switchToActiveFilter() { - cy.get(this.filterSelectMenu).first().click(); - cy.findByTestId(this.activeKeysOption).click(); - } - - switchToPassiveFilter() { - cy.get(this.filterSelectMenu).first().click(); - cy.findByTestId(this.passiveKeysOption).click(); - } - - switchToDisabledFilter() { - cy.get(this.filterSelectMenu).first().click(); - cy.findByTestId(this.disabledKeysOption).click(); - } - - toggleSwitch(switchName: string, waitFor: boolean | undefined = true) { - const loadName = `load-${crypto.randomUUID()}`; - if (waitFor) { - cy.intercept({ path: "/admin/realms/*", times: 1 }).as(loadName); - } - cy.findByTestId(switchName).click({ force: true }); - if (waitFor) { - cy.wait(`@${loadName}`); - } - - return this; - } - - assertSwitch(switchName: string, on: boolean) { - cy.findByTestId(switchName).should("have.value", on ? "on" : "off"); - - return this; - } - - setSwitch(switchName: string, on: boolean) { - if (on) { - cy.findByTestId(switchName).check({ force: true }); - } else { - cy.findByTestId(switchName).uncheck({ force: true }); - } - - return this; - } - - toggleCheck(switchName: string) { - cy.findByTestId(switchName).click(); - - return this; - } - - toggleAddProviderDropdown() { - const keysUrl = `/admin/realms/${this.#realmName}/keys`; - cy.intercept(keysUrl).as("keysFetch"); - cy.findByTestId(this.addProviderDropdown).click(); - - return this; - } - - addProvider() { - cy.findByTestId(this.addProviderButton).click(); - - return this; - } - - addKeyValuePair(key: string, value: string) { - cy.findByTestId(this.addBundleButton).click(); - - cy.findByTestId(this.keyInput).type(key); - cy.findByTestId(this.valueInput).type(value); - - cy.findByTestId(this.confirmAddTranslation).click({ force: true }); - - return this; - } - - enterUIDisplayName(name: string) { - cy.findByTestId(this.displayName).clear().type(name); - } - - save(saveBtn: string) { - cy.findByTestId(saveBtn).click(); - - return this; - } - - revert(revertBtn: string) { - cy.findByTestId(revertBtn).click(); - - return this; - } - - clearEvents(type: "admin" | "user") { - cy.findByTestId(`clear-${type}-events`).click(); - - return this; - } - - addUserEvents(events: string[]) { - cy.findByTestId("addTypes").click(); - for (const event of events) { - cy.get(this.eventTypeColumn) - .contains(event) - .parent() - .find("input") - .click(); - } - return this; - } - - changeTimeUnit( - unit: "Minutes" | "Hours" | "Days", - inputType: string, - listType: string, - ) { - switch (unit) { - case "Minutes": - cy.get(inputType).click(); - cy.get(listType).contains(unit).click(); - break; - case "Hours": - cy.get(inputType).click(); - cy.get(listType).contains(unit).click(); - break; - case "Days": - cy.get(inputType).click(); - cy.get(listType).contains(unit).click(); - break; - default: - throw "Invalid unit, must be 'minutes', 'hours', or 'days'."; - } - return this; - } - - populateSessionsPage() { - cy.findByTestId(this.ssoSessionIdleInput).clear().type("1"); - this.changeTimeUnit( - "Minutes", - this.ssoSessionIdleSelectMenu, - this.ssoSessionIdleSelectMenuList, - ); - cy.findByTestId(this.ssoSessionMaxInput).clear().type("2"); - this.changeTimeUnit( - "Hours", - this.ssoSessionMaxSelectMenu, - this.ssoSessionMaxSelectMenuList, - ); - cy.findByTestId(this.ssoSessionIdleRememberMeInput).clear().type("3"); - this.changeTimeUnit( - "Days", - this.ssoSessionIdleRememberMeSelectMenu, - this.ssoSessionIdleRememberMeSelectMenuList, - ); - cy.findByTestId(this.ssoSessionMaxRememberMeInput).clear().type("4"); - this.changeTimeUnit( - "Minutes", - this.ssoSessionMaxRememberMeSelectMenu, - this.ssoSessionMaxRememberMeSelectMenuList, - ); - - cy.findByTestId(this.clientSessionIdleInput).clear().type("5"); - this.changeTimeUnit( - "Hours", - this.clientSessionIdleSelectMenu, - this.clientSessionIdleSelectMenuList, - ); - cy.findByTestId(this.clientSessionMaxInput).clear().type("6"); - this.changeTimeUnit( - "Days", - this.clientSessionMaxSelectMenu, - this.clientSessionMaxSelectMenuList, - ); - - cy.findByTestId(this.offlineSessionIdleInput).clear().type("7"); - this.toggleSwitch(this.offlineSessionMaxSwitch, false); - - cy.findByTestId(this.loginTimeoutInput).clear().type("9"); - this.changeTimeUnit( - "Minutes", - this.loginTimeoutSelectMenu, - this.loginTimeoutSelectMenuList, - ); - cy.findByTestId(this.loginActionTimeoutInput).clear().type("10"); - this.changeTimeUnit( - "Days", - this.loginActionTimeoutSelectMenu, - this.loginActionTimeoutSelectMenuList, - ); - } - - populateTokensPage() { - this.toggleSwitch(this.revokeRefreshTokenSwitch, false); - - cy.findByTestId(this.accessTokenLifespanInput) - .focus() - .clear({ force: true }); - cy.findByTestId(this.accessTokenLifespanInput).clear().type("1"); - this.changeTimeUnit( - "Days", - this.accessTokenLifespanSelectMenu, - this.accessTokenLifespanSelectMenuList, - ); - cy.findByTestId(this.accessTokenLifespanImplicitInput).clear().type("2"); - this.changeTimeUnit( - "Minutes", - this.accessTokenLifespanImplicitSelectMenu, - this.accessTokenLifespanImplicitSelectMenuList, - ); - cy.findByTestId("par-request-uri-lifespan-input").clear().type("2"); - this.changeTimeUnit( - "Hours", - this.parRequestUriLifespanSelectMenu, - this.parRequestUriLifespanSelectMenuList, - ); - - cy.findByTestId(this.clientLoginTimeoutInput).clear().type("3"); - this.changeTimeUnit( - "Hours", - this.clientLoginTimeoutSelectMenu, - this.clientLoginTimeoutSelectMenuList, - ); - - cy.findByTestId(this.userInitiatedActionLifespanInput).clear().type("4"); - this.changeTimeUnit( - "Minutes", - this.userInitiatedActionLifespanSelectMenu, - this.userInitiatedActionLifespanSelectMenuList, - ); - - cy.findByTestId(this.defaultAdminInitatedInput).clear().type("5"); - this.changeTimeUnit( - "Days", - this.defaultAdminInitatedInputSelectMenu, - this.defaultAdminInitatedInputSelectMenuList, - ); - - cy.findByTestId(this.emailVerificationInput).clear().type("6"); - this.changeTimeUnit( - "Days", - this.emailVerificationSelectMenu, - this.emailVerificationSelectMenuList, - ); - - cy.findByTestId(this.idpEmailVerificationInput).clear().type("7"); - this.changeTimeUnit( - "Days", - this.idpEmailVerificationSelectMenu, - this.idpEmailVerificationSelectMenuList, - ); - - cy.findByTestId(this.forgotPasswordInput).clear().type("8"); - this.changeTimeUnit( - "Days", - this.forgotPasswordSelectMenu, - this.forgotPasswordSelectMenuList, - ); - cy.findByTestId(this.executeActionsInput).clear().type("9"); - this.changeTimeUnit( - "Days", - this.executeActionsSelectMenu, - this.executeActionsSelectMenuList, - ); - } - - checkUserEvents(events: string[]) { - cy.get(this.eventTypeColumn).should((event) => { - for (const user of events) { - expect(event).to.contain(user); - } - }); - return this; - } - - setOfflineSessionMaxSwitch(value: boolean) { - this.setSwitch(this.offlineSessionMaxSwitch, value); - return this; - } - - clickAdd() { - cy.findByTestId("addEventTypeConfirm").click(); - return this; - } - - shouldDisplayEventListenersForm() { - cy.get(this.#eventListenersFormLabel) - .should("be.visible") - .contains("Event listeners"); - cy.get(this.#eventListenersDrpDwn).should("exist"); - cy.findByTestId(this.#eventListenersSaveBtn).should("exist"); - cy.findAllByTestId(this.#eventListenersRevertBtn).should("exist"); - } - - shouldRevertSavingEventListener() { - cy.get(this.#eventListenersInputFld).click().type("email"); - cy.get(this.#eventListenersDrpDwnOption).click(); - cy.get(this.#eventListenersDrwDwnSelect).click(); - cy.findByTestId(this.#eventListenersRevertBtn).click(); - cy.get(this.#eventListenersDrpDwn).should("not.have.text", "email"); - } - - shouldSaveEventListener() { - cy.get(this.#eventListenersInputFld).click().type("email"); - cy.get(this.#eventListenersDrpDwnOption).click(); - cy.get(this.#eventListenersDrwDwnSelect).click(); - cy.findByTestId(this.#eventListenersSaveBtn).click(); - cy.get(this.#alertMessage).should( - "be.visible", - "Event listener has been updated.", - ); - } - - shouldRemoveEventFromEventListener() { - cy.get(this.#eventListenerRemove).last().click({ force: true }); - cy.get(this.#eventListenersInputFld).click(); - cy.findByTestId(this.#eventListenersSaveBtn).click(); - cy.get(this.#alertMessage).should( - "be.visible", - "Event listener has been updated.", - ); - cy.get(this.#eventListenersDrpDwn).should("not.have.text", "email"); - } - - shouldRemoveAllEventListeners() { - cy.get(".pf-v5-c-chip__actions").first().click(); - cy.get(".pf-v5-c-chip__actions").click(); - cy.findByTestId(this.#eventListenersSaveBtn).click(); - cy.get(this.#eventListenersDrpDwn).should("not.have.text", "jboss-logging"); - cy.get(this.#eventListenersDrpDwn).should("not.have.text", "email"); - } - - shouldReSaveEventListener() { - cy.get(this.#eventListenersInputFld).click().type("jboss-logging"); - cy.get(this.#eventListenersDrpDwnOption).click(); - cy.get(this.#eventListenersDrwDwnSelect).click(); - cy.findByTestId(this.#eventListenersSaveBtn).click(); - } - - shouldDisplayProfilesTab() { - cy.findByTestId(this.#createProfileBtn).should("exist"); - cy.findByTestId(this.#formViewSelect).should("exist"); - cy.findByTestId(this.#jsonEditorSelect).should("exist"); - cy.get("table").should("be.visible").contains("td", "Global"); - } - - shouldDisplayNewClientProfileForm() { - cy.findByTestId(this.#createProfileBtn).click(); - cy.findByTestId(this.#newClientProfileNameInput).should("exist"); - cy.findByTestId(this.#newClientProfileDescriptionInput).should("exist"); - cy.findByTestId(this.#saveNewClientProfileBtn).should("exist"); - cy.findByTestId(this.#cancelNewClientProfile).should("exist"); - } - - createClientProfile(name: string, description: string) { - cy.findByTestId(this.#createProfileBtn).click(); - cy.findByTestId(this.#newClientProfileNameInput).type(name); - cy.findByTestId(this.#newClientProfileDescriptionInput).type(description); - return this; - } - - saveClientProfileCreation() { - cy.findByTestId(this.#saveNewClientProfileBtn).click(); - return this; - } - - cancelClientProfileCreation() { - cy.findByTestId(this.#cancelNewClientProfile).click(); - return this; - } - - shouldSearchClientProfile() { - new ListingPage().searchItem("Test", false).itemExist("Test"); - return this; - } - - cancelDeleteClientPolicy() { - cy.get(this.#deleteDialogCancelBtn) - .contains("Cancel") - .click({ force: true }); - cy.get("table").should("be.visible").contains("td", "Test"); - return this; - } - - deleteClientPolicyItemFromTable(name: string) { - this.#listingPage.searchItem(name, false); - this.#listingPage.clickRowDetails(name).clickDetailMenu("Delete"); - return this; - } - - shouldNavigateBetweenFormAndJSONView() { - cy.findByTestId(this.#jsonEditorProfilesView).check(); - cy.findByTestId(this.#jsonEditorSaveBtn).contains("Save"); - cy.findByTestId(this.#jsonEditorReloadBtn).contains("Reload"); - cy.findByTestId(this.#formViewProfilesView).check(); - cy.findByTestId(this.#createProfileBtn).contains("Create client profile"); - } - - shouldSaveChangedJSONProfiles() { - cy.findByTestId(this.#jsonEditorProfilesView).check(); - cy.get(this.#jsonEditor).type( - `{pageup}{del} [{ - "name": "Test", - "description": "Test Description", - "executors": [], - "global": false - }, {downarrow}{end}{backspace}{backspace}`, - { force: true }, - ); - cy.findByTestId(this.#jsonEditorSaveBtn).click(); - cy.get(this.#alertMessage).should( - "be.visible", - "The client profiles configuration was updated", - ); - cy.findByTestId(this.#formViewProfilesView).check(); - cy.get("table").should("be.visible").contains("td", "Test"); - } - - shouldEditClientProfile() { - cy.get(this.#clientProfileOne).click(); - cy.findByTestId(this.#newClientProfileNameInput) - .click() - .clear() - .type("Edit"); - cy.findByTestId(this.#newClientProfileDescriptionInput) - .click() - .clear() - .type("Edit Description"); - cy.findByTestId(this.#saveNewClientProfileBtn).click(); - cy.get(this.#alertMessage).should( - "be.visible", - "Client profile updated successfully", - ); - } - - shouldCheckEditedClientProfileListed() { - cy.get("table").should("be.visible").contains("td", "Edit"); - cy.get("table").should("not.have.text", "Test"); - } - - shouldShowErrorWhenNameBlank() { - cy.get(this.#clientProfileTwo).click(); - cy.findByTestId(this.#newClientProfileNameInput).click().clear(); - cy.get("form").should("not.have.text", "Required field"); - } - - shouldShowErrorWhenDuplicate() { - cy.get("form").should( - "not.have.text", - "The name must be unique within the realm", - ); - } - - shouldReloadClientProfileEdits() { - cy.get(this.#clientProfileTwo).click(); - cy.findByTestId(this.#newClientProfileNameInput).type("Reloading"); - cy.findByTestId(this.#reloadBtn).click(); - cy.findByTestId(this.#newClientProfileNameInput).should( - "have.value", - "Edit", - ); - } - - shouldNotHaveExecutorsConfigured() { - cy.get(this.#clientProfileTwo).click(); - cy.get('h2[class*="kc-emptyExecutors"]').should( - "have.text", - "No executors configured", - ); - } - - shouldCancelAddingExecutor() { - cy.get(this.#clientProfileTwo).click(); - cy.findByTestId(this.#addExecutor).click(); - cy.get(this.#addExecutorDrpDwn).click(); - cy.get(this.#addExecutorDrpDwnOption) - .contains("secure-ciba-signed-authn-req") - .click(); - cy.get(this.#addExecutorCancelBtn).click(); - cy.get('h2[class*="kc-emptyExecutors"]').should( - "have.text", - "No executors configured", - ); - } - - shouldAddExecutor() { - cy.get(this.#clientProfileTwo).click(); - cy.findByTestId(this.#addExecutor).click(); - cy.get(this.#addExecutorDrpDwn).click(); - cy.get(this.#addExecutorDrpDwnOption) - .contains("secure-ciba-signed-authn-req") - .click(); - cy.findByTestId(this.#addExecutorSaveBtn).click(); - cy.get(this.#alertMessage).should( - "be.visible", - "Success! Executor created successfully", - ); - cy.get('ul[class*="pf-v5-c-data-list"]').should( - "have.text", - "secure-ciba-signed-authn-req", - ); - } - - shouldCancelDeletingExecutor() { - cy.get(this.#clientProfileTwo).click(); - cy.get('svg[class*="kc-executor-trash-icon"]').click(); - cy.get(this.#modalDialogTitle).contains("Delete executor?"); - cy.get(this.#modalDialogBodyText).contains( - "The action will permanently delete secure-ciba-signed-authn-req. This cannot be undone.", - ); - cy.findByTestId(this.modalConfirm).contains("Delete"); - cy.get(this.#deleteDialogCancelBtn).contains("Cancel").click(); - cy.get('ul[class*="pf-v5-c-data-list"]').should( - "have.text", - "secure-ciba-signed-authn-req", - ); - } - - openProfileDetails(name: string) { - cy.intercept( - `/admin/realms/${this.#realmName}/client-policies/profiles*`, - ).as("profilesFetch"); - cy.get( - 'a[href*="realm-settings/client-policies/' + name + '/edit-profile"]', - ).click(); - cy.wait("@profilesFetch"); - return this; - } - - editExecutor(availablePeriod?: number) { - cy.intercept( - `/admin/realms/${this.#realmName}/client-policies/profiles*`, - ).as("profilesFetch"); - cy.get(this.#editExecutorBtn).click(); - cy.wait("@profilesFetch"); - if (availablePeriod) { - cy.get(this.#executorAvailablePeriodInput) - .clear() - .type(availablePeriod.toString()); - } - return this; - } - - saveExecutor() { - cy.findByTestId(this.#addExecutorSaveBtn).click(); - return this; - } - - cancelEditingExecutor() { - cy.get(this.#addExecutorCancelBtn) - .contains("Cancel") - .click({ force: true }); - return this; - } - - checkExecutorNotInList() { - cy.get('ul[class*="pf-v5-c-data-list"]').should( - "have.text", - "secure-ciba-signed-authn-req", - ); - return this; - } - - checkAvailablePeriodExecutor(value: number) { - cy.findByTestId(this.#availablePeriodExecutorFld).should( - "have.value", - value, - ); - return this; - } - - shouldEditExecutor() { - cy.get(this.#clientProfileTwo).click(); - cy.get(this.#editExecutorBtn).click(); - cy.findByTestId(this.#availablePeriodExecutorFld).clear().type("4000"); - cy.findByTestId(this.#addExecutorSaveBtn).click(); - cy.get(this.#alertMessage).should( - "be.visible", - "Executor updated successfully", - ); - } - - shouldDeleteExecutor() { - cy.get(this.#clientProfileTwo).click(); - cy.get('svg[class*="kc-executor-trash-icon"]').click(); - cy.get(this.#modalDialogTitle).contains("Delete executor?"); - cy.get(this.#modalDialogBodyText).contains( - "The action will permanently delete secure-ciba-signed-authn-req. This cannot be undone.", - ); - cy.findByTestId(this.modalConfirm).contains("Delete"); - cy.findByTestId(this.modalConfirm).click(); - cy.get('h2[class*="kc-emptyExecutors"]').should( - "have.text", - "No executors configured", - ); - } - - shouldReloadJSONProfiles() { - cy.findByTestId(this.#jsonEditorProfilesView).check(); - cy.findByTestId(this.#jsonEditorReloadBtn).contains("Reload").click(); - cy.findByTestId(this.#jsonEditorSaveBtn).contains("Save"); - cy.findByTestId(this.#jsonEditorReloadBtn).contains("Reload"); - } - - shouldSaveChangedJSONPolicies() { - cy.findByTestId(this.#jsonEditorSelectPolicies).check(); - cy.findByTestId(this.#jsonEditorReloadBtn).click(); - - cy.get(this.#jsonEditor).type(`{pageup}{del} [{ - "name": "Reload", - }, {downarrow}{end}{backspace}{backspace}{backspace}{backspace}`); - - cy.findByTestId(this.#jsonEditorReloadBtn).click(); - - cy.get(this.#jsonEditor).type(`{pageup}{del} [{ - "name": "Test", - "description": "Test Description", - "enabled": false, - "conditions": [], - "profiles": [], - }, {downarrow}{end}{backspace}{backspace}{backspace}{backspace}`); - - cy.findByTestId(this.#jsonEditorSavePoliciesBtn).click(); - - cy.get(this.#alertMessage).should( - "be.visible", - "The client policy configuration was updated", - ); - cy.findByTestId(this.#formViewSelectPolicies).check(); - cy.get("table").should("be.visible").contains("td", "Test"); - } - - shouldNavigateBetweenFormAndJSONViewPolicies() { - cy.findByTestId(this.#jsonEditorSelectPolicies).check(); - cy.findByTestId(this.#jsonEditorSavePoliciesBtn).contains("Save"); - cy.findByTestId(this.#jsonEditorReloadBtn).contains("Reload"); - cy.findByTestId(this.#formViewSelectPolicies).check(); - cy.findByTestId(this.#createPolicyEmptyStateBtn).contains( - "Create client policy", - ); - } - - checkDisplayPoliciesTab() { - cy.findByTestId(this.#createPolicyEmptyStateBtn).should("exist"); - cy.findByTestId(this.#formViewSelectPolicies).should("exist"); - cy.findByTestId(this.#jsonEditorSelectPolicies).should("exist"); - return this; - } - - checkNewClientPolicyForm() { - cy.findByTestId(this.#newClientPolicyNameInput).should("exist"); - cy.findByTestId(this.#newClientPolicyDescriptionInput).should("exist"); - cy.findByTestId(this.#saveNewClientPolicyBtn).should("exist"); - cy.findByTestId(this.#cancelNewClientPolicyBtn).should("exist"); - return this; - } - - cancelNewClientPolicyCreation() { - cy.findByTestId(this.#cancelNewClientPolicyBtn).click(); - return this; - } - - createNewClientPolicyFromList( - name: string, - description: string, - cancel?: boolean, - ) { - cy.findByTestId(this.#createPolicyBtn).click(); - cy.findByTestId(this.#newClientPolicyNameInput).type(name); - cy.findByTestId(this.#newClientPolicyDescriptionInput).type(description); - if (!cancel) { - cy.findByTestId(this.#saveNewClientPolicyBtn).click(); - } - return this; - } - - searchClientPolicy(name: string) { - new ListingPage().searchItem(name, false).itemExist(name); - return this; - } - - searchClientProfile(name: string) { - new ListingPage().searchItem(name, false).itemExist(name); - return this; - } - - searchNonExistingClientProfile(name: string) { - new ListingPage().searchItem(name, false); - return this; - } - - shouldNotHaveConditionsConfigured() { - cy.get(this.#clientPolicy).click(); - cy.get('h2[class*="kc-emptyConditions"]').should( - "have.text", - "No conditions configured", - ); - } - - shouldCancelAddingCondition() { - cy.get(this.#clientPolicy).click(); - cy.findByTestId(this.#addCondition).click(); - cy.get(this.#addConditionDrpDwn).click(); - cy.get(this.#addConditionDrpDwnOption).contains("any-client").click(); - cy.findByTestId(this.#addConditionCancelBtn).click(); - cy.get('h2[class*="kc-emptyConditions"]').should( - "have.text", - "No conditions configured", - ); - } - - shouldAddClientRolesCondition() { - cy.get(this.#clientPolicy).click(); - cy.findByTestId(this.#addCondition).click(); - cy.get(this.#addConditionDrpDwn).click(); - cy.get(this.#addConditionDrpDwnOption).contains("client-roles").click(); - cy.findByTestId(this.#roleSelect).clear().type("manage-realm"); - - cy.findByTestId(this.#addConditionSaveBtn).click(); - cy.get(this.#alertMessage).should( - "be.visible", - "Success! Condition created successfully", - ); - cy.get('ul[class*="pf-v5-c-data-list"]').should( - "have.text", - "client-roles", - ); - } - - addClientScopes() { - cy.findByTestId("config.scopes0").clear().type("one"); - cy.findByTestId(this.#selectScopeButton).click(); - cy.findByTestId("config.scopes1").clear().type("two"); - cy.findByTestId(this.#selectScopeButton).click(); - cy.findByTestId("config.scopes2").clear().type("three"); - } - - shouldAddClientScopesCondition() { - cy.get(this.#clientPolicy).click(); - cy.findByTestId(this.#addCondition).click(); - cy.get(this.#addConditionDrpDwn).click(); - cy.get(this.#addConditionDrpDwnOption).contains("client-scopes").click(); - - this.addClientScopes(); - - cy.findByTestId(this.#addConditionSaveBtn).click(); - cy.get(this.#alertMessage).should( - "be.visible", - "Success! Condition created successfully", - ); - cy.get('ul[class*="pf-v5-c-data-list"]').contains("client-scopes"); - } - - shouldEditClientRolesCondition() { - cy.get(this.#clientPolicy).click(); - - cy.findByTestId(this.#clientRolesConditionLink).click(); - - cy.findByTestId(this.#roleSelect).should("have.value", "manage-realm"); - cy.findByTestId(this.#roleSelect).clear().type("admin"); - - cy.findByTestId(this.#addConditionSaveBtn).click(); - cy.get(this.#alertMessage).should( - "be.visible", - "Success! Condition updated successfully", - ); - } - - shouldEditClientScopesCondition() { - cy.get(this.#clientPolicy).click(); - - cy.findByTestId(this.#clientScopesConditionLink).click(); - - cy.findByTestId("config.scopes0").clear().type("edit"); - - cy.findByTestId(this.#addConditionSaveBtn).click(); - cy.get(this.#alertMessage).should( - "be.visible", - "Success! Condition updated successfully", - ); - } - - checkConditionsListContains(name: string) { - cy.get('ul[class*="pf-v5-c-data-list"]').contains(name); - return this; - } - - deleteClientRolesCondition() { - cy.get(this.#clientPolicy).click(); - cy.findByTestId(this.#deleteClientRolesConditionBtn).click(); - return this; - } - - shouldDeleteClientScopesCondition() { - cy.get(this.#clientPolicy).click(); - cy.findByTestId(this.#deleteClientScopesConditionBtn).click(); - cy.get(this.#modalDialogTitle).contains("Delete condition?"); - cy.get(this.#modalDialogBodyText).contains( - "This action will permanently delete client-scopes. This cannot be undone.", - ); - cy.findByTestId(this.modalConfirm).contains("Delete"); - cy.findByTestId(this.modalConfirm).click({ force: true }); - cy.get('h2[class*="kc-emptyConditions"]').should( - "have.text", - "No conditions configured", - ); - } - - goToClientPoliciesTab() { - cy.findByTestId("rs-clientPolicies-tab").click(); - return this; - } - - goToClientPoliciesList() { - cy.findByTestId("rs-policies-clientPolicies-tab").click(); - return this; - } - - goToClientProfilesList() { - cy.findByTestId("rs-policies-clientProfiles-tab").click(); - return this; - } - - createNewClientPolicyFromEmptyState( - name: string, - description: string, - cancel?: boolean, - ) { - cy.findByTestId(this.#createPolicyEmptyStateBtn).click(); - cy.findByTestId(this.#newClientPolicyNameInput).type(name); - cy.findByTestId(this.#newClientPolicyDescriptionInput).type(description); - if (!cancel) { - cy.findByTestId(this.#saveNewClientPolicyBtn).click(); - } - return this; - } - - checkEmptyPolicyList() { - cy.findByTestId(this.#createPolicyEmptyStateBtn).should("exist"); - return this; - } - - checkElementNotInList(name: string) { - cy.get("tbody").should("not.contain.text", name); - return this; - } - - checkElementInList(name: string) { - cy.get("tbody").should("contain.text", name); - return this; - } - - deleteClientPolicyFromDetails() { - cy.get(this.#clientPolicyDrpDwn).click({ force: true }); - cy.findByTestId(this.#deleteclientPolicyDrpDwn) - .find("button") - .click({ force: true }); - return this; - } - - checkTextIsNotInTable(text: string) { - cy.get("table").should("not.have.text", text); - return this; - } - - shouldReloadJSONPolicies() { - cy.findByTestId(this.#jsonEditorSelectPolicies).check(); - cy.findByTestId(this.#jsonEditorReloadBtn).contains("Reload").click(); - cy.findByTestId(this.#jsonEditorSavePoliciesBtn).contains("Save"); - cy.findByTestId(this.#jsonEditorReloadBtn).contains("Reload"); - } - - goToLoginTab() { - cy.findByTestId(this.loginTab).click(); - return this; - } - - goToEmailTab() { - cy.findByTestId(this.emailTab).click(); - return this; - } - - goToThemesTab() { - cy.findByTestId(this.themesTab).click(); - return this; - } - - goToLocalizationTab() { - cy.findByTestId(this.localizationTab).click(); - return this; - } - - goToLocalizationLocalesSubTab() { - cy.findByTestId(this.#localizationLocalesSubTab).click(); - return this; - } - - goToLocalizationRealmOverridesSubTab() { - cy.findByTestId(this.#localizationRealmOverridesSubTab).click(); - return this; - } - - goToLocalizationEffectiveMessageBundlesSubTab() { - cy.findByTestId(this.#localizationEffectiveMessageBundlesSubTab).click(); - return this; - } - - goToSecurityDefensesTab() { - cy.findByTestId(this.securityDefensesTab).click(); - return this; - } - - saveSecurityDefensesHeaders() { - cy.findByTestId(this.#securityDefensesHeadersSaveBtn).click(); - } - - saveSecurityDefensesBruteForce() { - cy.findByTestId(this.#securityDefensesBruteForceSaveBtn).click(); - } - - goToSecurityDefensesHeadersTab() { - cy.findByTestId(this.#securityDefensesHeadersTab).click(); - return this; - } - - goToSecurityDefensesBruteForceTab() { - cy.findByTestId(this.#securityDefensesBruteForceTab).click(); - return this; - } - - goToSessionsTab() { - cy.findByTestId(this.sessionsTab).click(); - return this; - } - - goToTokensTab() { - cy.findByTestId(this.tokensTab).click(); - return this; - } - - goToClientProfileByNameLink(profileName: string) { - cy.get(this.#clientProfileLink).contains(profileName).click(); - return this; - } -} diff --git a/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/realm_settings/UserProfile.ts b/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/realm_settings/UserProfile.ts deleted file mode 100644 index 4f91865a18a..00000000000 --- a/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/realm_settings/UserProfile.ts +++ /dev/null @@ -1,240 +0,0 @@ -import Masthead from "../../Masthead"; -import ValidatorConfigDialogue from "./ValidatorConfigDialogue"; - -export default class UserProfile { - readonly masthead = new Masthead(); - readonly validatorConfigDialogue = new ValidatorConfigDialogue(this); - - #userProfileTab = "rs-user-profile-tab"; - #attributesTab = "attributesTab"; - #attributesGroupTab = "attributesGroupTab"; - #jsonEditorTab = "jsonEditorTab"; - #createAttributeButton = "createAttributeBtn"; - #actionsDrpDwn = "actions-dropdown"; - #deleteDrpDwnOption = "deleteDropdownAttributeItem"; - #editDrpDwnOption = "editDropdownAttributeItem"; - #cancelNewAttribute = "attribute-cancel"; - #newAttributeNameInput = "name"; - #newAttributeDisplayNameInput = "attributes-displayName"; - #newAttributeEnabledWhen = 'input[name="enabledWhen"]'; - #newAttributeEmptyValidators = ".kc-emptyValidators"; - #newAttributeAnnotationBtn = "annotations-add-row"; - #newAttributeAnnotationKey = "annotations.0.key"; - #newAttributeAnnotationValue = "annotations.0.value"; - #validatorsList = "tbody"; - #saveNewAttributeBtn = "attribute-create"; - #addValidatorBtn = "addValidator"; - #removeValidatorBtn = "deleteValidator"; - #deleteValidatorBtn = "confirm"; - #cancelRemovingValidatorBtn = "cancel"; - #newAttributeRequiredField = "input#kc-required.pf-v5-c-switch__input"; - #newAttributeUserEdit = "user-edit"; - #newAttributeAdminEdit = "admin-edit"; - #newAttributeUserView = "user-view"; - #newAttributeAdminView = "admin-view"; - #createAttributesGroupButton = "create-attributes-groups-action"; - #newAttributesGroupNameInput = "name"; - #newAttributesGroupDisplayNameInput = 'input[name="displayHeader"]'; - #saveNewAttributesGroupBtn = "saveGroupBtn"; - - goToTab() { - cy.findByTestId(this.#userProfileTab).click(); - return this; - } - - goToAttributesTab() { - cy.findByTestId(this.#attributesTab).click(); - return this; - } - - goToAttributesGroupTab() { - cy.findByTestId(this.#attributesGroupTab).click(); - return this; - } - - goToJsonEditorTab() { - cy.findByTestId(this.#jsonEditorTab).click(); - return this; - } - - clickOnCreateAttributeButton() { - cy.findByTestId(this.#createAttributeButton).click(); - return this; - } - - selectDropdown() { - cy.findByTestId(this.#actionsDrpDwn).click(); - return this; - } - - selectDeleteOption() { - cy.findByTestId(this.#deleteDrpDwnOption).click(); - return this; - } - - selectEditOption() { - cy.findByTestId(this.#editDrpDwnOption).click(); - return this; - } - - cancelAttributeCreation() { - cy.findByTestId(this.#cancelNewAttribute).click(); - return this; - } - - setAttributeNames(name: string, displayName: string) { - cy.findByTestId(this.#newAttributeNameInput).type(name); - cy.findByTestId(this.#newAttributeDisplayNameInput).type(displayName); - return this; - } - - checkElementNotInList(name: string) { - cy.get(this.#validatorsList).should("not.contain.text", name); - return this; - } - - saveAttributeCreation() { - cy.findByTestId(this.#saveNewAttributeBtn).click(); - return this; - } - - setAttributeRequired() { - cy.get(this.#newAttributeRequiredField).first().check({ force: true }); - - return this; - } - - setAllAttributePermissions() { - cy.findByTestId(this.#newAttributeUserEdit).first().check({ force: true }); - cy.findByTestId(this.#newAttributeUserView).first().check({ force: true }); - cy.findByTestId(this.#newAttributeAdminView).first().check({ force: true }); - - return this; - } - - setNoAttributePermissions() { - cy.findByTestId(this.#newAttributeAdminEdit) - .first() - .uncheck({ force: true }); - - return this; - } - - clickOnCreatesAttributesGroupButton() { - cy.findByTestId(this.#createAttributesGroupButton).click(); - return this; - } - - createAttributeGroup(name: string, displayName: string) { - cy.findByTestId(this.#newAttributesGroupNameInput).type(name); - cy.get(this.#newAttributesGroupDisplayNameInput).type(displayName); - return this; - } - - saveAttributesGroupCreation() { - cy.findByTestId(this.#saveNewAttributesGroupBtn).click(); - return this; - } - - selectElementInList(name: string) { - cy.get(this.#validatorsList).contains(name).click(); - return this; - } - - setAttributeGroup(group: string) { - cy.get("#group").click(); - cy.get("#group") - .parent() - .get(".pf-v5-c-menu__list-item") - .contains(group) - .click(); - - return this; - } - - resetAttributeGroup() { - return this.setAttributeGroup("None"); - } - - editAttribute(displayName: string) { - cy.findByTestId(this.#newAttributeDisplayNameInput) - .click() - .clear() - .type(displayName); - cy.get(this.#newAttributeEnabledWhen).first().check(); - cy.get(this.#newAttributeEmptyValidators).contains("No validators."); - cy.findByTestId(this.#newAttributeAnnotationBtn).click(); - cy.findByTestId(this.#newAttributeAnnotationKey).type("test"); - cy.findByTestId(this.#newAttributeAnnotationValue).type("123"); - return this; - } - - addValidator(type: string) { - this.clickAddValidator().selectValidatorType(type).clickSave(); - - return this; - } - - removeValidator() { - cy.findByTestId(this.#removeValidatorBtn).click(); - cy.findByTestId(this.#deleteValidatorBtn).click(); - return this; - } - - cancelAddingValidator(type: string) { - this.clickAddValidator().selectValidatorType(type).clickCancel(); - - return this; - } - - clickAddValidator() { - cy.findByTestId(this.#addValidatorBtn).click(); - - return this.validatorConfigDialogue; - } - - cancelRemovingValidator() { - cy.findByTestId(this.#removeValidatorBtn).click(); - cy.findByTestId(this.#cancelRemovingValidatorBtn).click(); - return this; - } - - #textArea() { - return cy.get(".w-tc-editor-text"); - } - - #getText() { - return this.#textArea().get(".view-lines"); - } - - typeJSON(text: string) { - this.#textArea().type(text, { force: true }); - return this; - } - - assertNotificationSaved() { - this.masthead.checkNotificationMessage( - "Success! User Profile configuration has been saved.", - ); - - return this; - } - - assertNotificationUpdated() { - this.masthead.checkNotificationMessage( - "User profile settings successfully updated.", - ); - - return this; - } - - shouldHaveText(text: string) { - this.#getText().should("have.text", text); - return this; - } - - saveJSON() { - cy.findAllByTestId("save").click(); - return this; - } -} diff --git a/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/realm_settings/UserRegistration.ts b/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/realm_settings/UserRegistration.ts deleted file mode 100644 index d3297ea25af..00000000000 --- a/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/realm_settings/UserRegistration.ts +++ /dev/null @@ -1,79 +0,0 @@ -export default class UserRegistration { - #userRegistrationTab = "rs-userRegistration-tab"; - #defaultGroupTab = "#pf-tab-20-groups"; - #addRoleBtn = "assignRole"; - #addDefaultGroupBtn = "no-default-groups-empty-action"; - #namesColumn = "tbody td:visible"; - #addBtn = "assign"; - #filterTypeDropdown = "filter-type-dropdown"; - - goToTab() { - cy.findByTestId(this.#userRegistrationTab).click({ force: true }); - return this; - } - - goToDefaultGroupTab() { - cy.get(this.#defaultGroupTab).click(); - return this; - } - - addRole() { - cy.findByTestId(this.#addRoleBtn).click({ force: true }); - return this; - } - - addDefaultGroup() { - cy.findByTestId(this.#addDefaultGroupBtn).click(); - return this; - } - - changeRoleTypeFilter(filter: string) { - // Invert the filter because the testid is the current selection - const option = filter == "roles" ? "clients" : "roles"; - - cy.findByTestId(this.#filterTypeDropdown).click(); - cy.findByTestId(option).click(); - - return this; - } - - selectRow(name: string) { - cy.get(this.#namesColumn) - .contains(name) - .parents("tr") - .within(() => { - cy.get("input").click(); - }); - return this; - } - - assign() { - cy.findByTestId(this.#addBtn).click(); - return this; - } -} - -export class GroupPickerDialog { - #addButton = "add-button"; - #title = ".pf-v5-c-modal-box__title"; - - clickRow(groupName: string) { - cy.findByTestId(groupName).within(() => cy.get("input").click()); - return this; - } - - clickRoot() { - cy.get(".pf-v5-c-breadcrumb__item > button").click(); - return this; - } - - checkTitle(title: string) { - cy.get(this.#title).should("have.text", title); - return this; - } - - clickAdd() { - cy.findByTestId(this.#addButton).click(); - return this; - } -} diff --git a/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/realm_settings/ValidatorConfigDialogue.ts b/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/realm_settings/ValidatorConfigDialogue.ts deleted file mode 100644 index 4a692d301c6..00000000000 --- a/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/realm_settings/ValidatorConfigDialogue.ts +++ /dev/null @@ -1,46 +0,0 @@ -import UserProfile from "./UserProfile"; -import Select from "../../../../forms/Select"; - -export default class ValidatorConfigDialogue { - readonly #validatorSelector = "#validator"; - readonly #saveValidatorButton = "save-validator-role-button"; - readonly #cancelValidatorButton = "cancel-validator-role-button"; - readonly #addValue = "addValue"; - - readonly userProfile: UserProfile; - - constructor(userProfile: UserProfile) { - this.userProfile = userProfile; - } - - clickSave() { - cy.findByTestId(this.#saveValidatorButton).click(); - - return this.userProfile; - } - - selectValidatorType(type: string) { - Select.selectItem(cy.get(this.#validatorSelector), type); - - return this; - } - - setListFieldValues(fieldName: string, values: string[]) { - for (let i = 0; i < values.length; i++) { - if (i != 0) { - cy.findByTestId(this.#addValue).click(); - } - - const testId = `config.options${i}`; - cy.findByTestId(testId).clear().type(values[i]); - } - - return this; - } - - clickCancel() { - cy.findByTestId(this.#cancelValidatorButton).click(); - - return this.userProfile; - } -} diff --git a/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/realm_settings/tabs/RealmSettingsEventsTab.ts b/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/realm_settings/tabs/RealmSettingsEventsTab.ts deleted file mode 100644 index 1b9df25b3cd..00000000000 --- a/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/realm_settings/tabs/RealmSettingsEventsTab.ts +++ /dev/null @@ -1,31 +0,0 @@ -import CommonPage from "../../../../CommonPage"; -import AdminEventsSettingsTab from "./realmsettings_events_subtabs/AdminEventsSettingsTab"; -import EventListenersTab from "./realmsettings_events_subtabs/EventListenersTab"; -import UserEventsSettingsTab from "./realmsettings_events_subtabs/UserEventsSettingsTab"; - -enum RealmSettingsEventsSubTab { - EventListeners = "Event listeners", - UserEventsSettings = "User events settings", - AdminEventsSettings = "Admin events settings", -} - -export default class RealmSettingsEventsTab extends CommonPage { - #eventListenersTab = new EventListenersTab(); - #userEventsSettingsTab = new UserEventsSettingsTab(); - #adminEventsSettingsTab = new AdminEventsSettingsTab(); - - goToEventListenersSubTab() { - this.tabUtils().clickTab(RealmSettingsEventsSubTab.EventListeners, 1); - return this.#eventListenersTab; - } - - goToUserEventsSettingsSubTab() { - this.tabUtils().clickTab(RealmSettingsEventsSubTab.UserEventsSettings, 1); - return this.#userEventsSettingsTab; - } - - goToAdminEventsSettingsSubTab() { - this.tabUtils().clickTab(RealmSettingsEventsSubTab.AdminEventsSettings, 1); - return this.#adminEventsSettingsTab; - } -} diff --git a/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/realm_settings/tabs/realmsettings_events_subtabs/AdminEventsSettingsTab.ts b/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/realm_settings/tabs/realmsettings_events_subtabs/AdminEventsSettingsTab.ts deleted file mode 100644 index 6703b63aa93..00000000000 --- a/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/realm_settings/tabs/realmsettings_events_subtabs/AdminEventsSettingsTab.ts +++ /dev/null @@ -1,65 +0,0 @@ -import ModalUtils from "../../../../../../util/ModalUtils"; -import PageObject from "../../../../components/PageObject"; -import Masthead from "../../../../Masthead"; - -const masthead = new Masthead(); -const modal = new ModalUtils(); - -export default class AdminEventsSettingsTab extends PageObject { - #saveEventsSwitch = "#adminEventsEnabled-switch"; - #clearAdminEventsBtn = "#clear-admin-events"; - #saveBtn = "#save-admin"; - - clearAdminEvents() { - cy.get(this.#clearAdminEventsBtn).click(); - modal.checkModalTitle("Clear events"); - cy.intercept("/admin/realms/*/admin-events").as("clearEvents"); - modal.confirmModal(); - cy.wait("@clearEvents"); - masthead.checkNotificationMessage("The admin events have been cleared"); - return this; - } - - disableSaveEvents() { - super.assertSwitchStateOn(cy.get(this.#saveEventsSwitch)); - cy.get(this.#saveEventsSwitch).parent().click(); - modal.checkModalTitle("Unsave events?"); - modal.confirmModal(); - super.assertSwitchStateOff(cy.get(this.#saveEventsSwitch)); - return this; - } - - enableSaveEvents() { - super.assertSwitchStateOff(cy.get(this.#saveEventsSwitch)); - cy.get(this.#saveEventsSwitch).parent().click(); - super.assertSwitchStateOn(cy.get(this.#saveEventsSwitch)); - return this; - } - - save( - { waitForRealm, waitForConfig } = { - waitForRealm: true, - waitForConfig: false, - }, - ) { - if (waitForRealm) { - cy.intercept("/admin/realms/*").as("saveRealm"); - } - - if (waitForConfig) { - cy.intercept("/admin/realms/*/events/config").as("saveConfig"); - } - - cy.get(this.#saveBtn).click(); - - if (waitForRealm) { - cy.wait("@saveRealm"); - } - - if (waitForConfig) { - cy.wait("@saveConfig"); - } - - return this; - } -} diff --git a/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/realm_settings/tabs/realmsettings_events_subtabs/EventListenersTab.ts b/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/realm_settings/tabs/realmsettings_events_subtabs/EventListenersTab.ts deleted file mode 100644 index 7ab854fb0a2..00000000000 --- a/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/realm_settings/tabs/realmsettings_events_subtabs/EventListenersTab.ts +++ /dev/null @@ -1,3 +0,0 @@ -import PageObject from "../../../../components/PageObject"; - -export default class EventListenersTab extends PageObject {} diff --git a/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/realm_settings/tabs/realmsettings_events_subtabs/UserEventsSettingsTab.ts b/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/realm_settings/tabs/realmsettings_events_subtabs/UserEventsSettingsTab.ts deleted file mode 100644 index 47ce5e21bdf..00000000000 --- a/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/realm_settings/tabs/realmsettings_events_subtabs/UserEventsSettingsTab.ts +++ /dev/null @@ -1,41 +0,0 @@ -import ModalUtils from "../../../../../../util/ModalUtils"; -import PageObject from "../../../../components/PageObject"; -import Masthead from "../../../../Masthead"; - -const masthead = new Masthead(); -const modal = new ModalUtils(); - -export default class UserEventsSettingsTab extends PageObject { - #saveEventsSwitch = "#eventsEnabled-switch"; - #clearUserEventsBtn = "#clear-user-events"; - #saveBtn = "#save-user"; - - clearUserEvents() { - cy.get(this.#clearUserEventsBtn).click(); - modal.checkModalTitle("Clear events"); - modal.confirmModal(); - masthead.checkNotificationMessage("The user events have been cleared"); - return this; - } - - disableSaveEventsSwitch() { - cy.get(this.#saveEventsSwitch).parent().click(); - super.assertSwitchStateOn(cy.get(this.#saveEventsSwitch)); - this.waitForPageLoad(); - modal.checkModalTitle("Unsave events?"); - modal.confirmModal(); - super.assertSwitchStateOff(cy.get(this.#saveEventsSwitch)); - return this; - } - - enableSaveEventsSwitch() { - cy.get(this.#saveEventsSwitch).parent().click(); - super.assertSwitchStateOn(cy.get(this.#saveEventsSwitch)); - return this; - } - - save() { - cy.get(this.#saveBtn).click(); - return this; - } -} diff --git a/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/sessions/SessionsPage.ts b/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/sessions/SessionsPage.ts deleted file mode 100644 index 31548e21cb5..00000000000 --- a/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/sessions/SessionsPage.ts +++ /dev/null @@ -1,41 +0,0 @@ -export default class SessionsPage { - #revocationActionItem = "revocation"; - #setToNowButton = "set-to-now-button"; - #actionDropdown = "action-dropdown"; - #clearNotBeforeButton = "clear-not-before-button"; - #pushButton = "modal-test-connection-button"; - #notBeforeInput = "not-before-input"; - - setToNow() { - this.#openRevocationDialog(); - cy.findByTestId(this.#setToNowButton).click(); - Cypress.session.clearAllSavedSessions(); - } - - checkNotBeforeValueExists() { - this.#openRevocationDialog(); - cy.findByTestId(this.#notBeforeInput).should("not.have.value", "None"); - } - - clearNotBefore() { - this.#openRevocationDialog(); - cy.findByTestId(this.#clearNotBeforeButton).click(); - } - - checkNotBeforeCleared() { - this.#openRevocationDialog(); - cy.findByTestId(this.#notBeforeInput).should("have.value", "None"); - } - - pushRevocation() { - this.#openRevocationDialog(); - cy.findByTestId(this.#pushButton).click(); - } - - #openRevocationDialog() { - cy.findByTestId(this.#actionDropdown).click(); - cy.intercept("/admin/realms/master").as("fetchRealm"); - cy.findByTestId(this.#revocationActionItem).click(); - cy.wait("@fetchRealm"); - } -} diff --git a/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/users/CreateUserPage.ts b/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/users/CreateUserPage.ts deleted file mode 100644 index df19539f569..00000000000 --- a/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/users/CreateUserPage.ts +++ /dev/null @@ -1,189 +0,0 @@ -import Masthead from "../../Masthead"; -import FormValidation from "../../../../forms/FormValidation"; -import Select from "../../../../forms/Select"; - -export default class CreateUserPage { - readonly masthead = new Masthead(); - readonly emptyOptionValue = "Choose..."; - - usersEmptyState: string; - emptyStateCreateUserBtn: string; - addUserBtn: string; - joinGroupsBtn: string; - joinBtn: string; - createBtn: string; - saveBtn: string; - cancelBtn: string; - - constructor() { - this.usersEmptyState = "empty-state"; - this.emptyStateCreateUserBtn = "no-users-found-empty-action"; - this.addUserBtn = "add-user"; - this.joinGroupsBtn = "join-groups-button"; - this.joinBtn = "join-button"; - this.createBtn = "user-creation-save"; - this.saveBtn = "user-creation-save"; - this.cancelBtn = "user-creation-revert"; - } - - //#region General Settings - createUser(username: string) { - return this.setUsername(username); - } - - goToCreateUser() { - cy.get("body").then((body) => { - if (body.find(`[data-testid=${this.addUserBtn}]`).length > 0) { - cy.findByTestId(this.addUserBtn).click({ force: true }); - } else { - cy.findByTestId(this.emptyStateCreateUserBtn).click({ force: true }); - } - }); - - return this; - } - - toggleAddGroupModal() { - cy.findByTestId(this.joinGroupsBtn).click(); - - return this; - } - - joinGroups() { - cy.findByTestId(this.joinBtn).click(); - - return this; - } - - create() { - cy.findByTestId(this.createBtn).click(); - - return this; - } - - update() { - cy.findByTestId(this.saveBtn).click(); - - return this; - } - - assertAttributeValue(attrName: string, expectedValue: string) { - cy.findByTestId(attrName).should("have.value", expectedValue); - - return this; - } - - assertAttributeFieldExists(attrName: string, shouldExist: boolean) { - const chainer = shouldExist ? "exist" : "not.exist"; - cy.findByTestId(attrName).should(chainer); - - return this; - } - - assertAttributeSelect( - attrName: string, - expectedOptionsWithoutEmptyOption: string[], - expectedValue: string, - ) { - Select.assertSelectedItem( - this.#getSelectFieldButton(attrName), - expectedValue, - ); - - return this; - } - - #getSelectFieldButton(attrName: string) { - const attrSelector = `#${attrName}`; - return cy.get(attrSelector); - } - - #getSelectOptions(attrName: string) { - return this.#getSelectFieldButton(attrName) - .parent() - .find(".pf-v5-c-select__menu-item"); - } - - #toggleSelectField( - attrName: string, - toggleCondition?: (currentlyExpanded: boolean) => boolean, - ) { - return this.#getSelectFieldButton(attrName).then(($selectField) => { - const currentlyExpanded = $selectField.attr("aria-expanded") === "true"; - if (!toggleCondition || toggleCondition(currentlyExpanded)) { - cy.wrap($selectField).click(); - } - }); - } - - assertAttributeLabel(attrName: string, expectedText: string) { - cy.get(`.pf-v5-c-form__label[for='${attrName}'] .pf-v5-c-form__label-text`) - .contains(expectedText) - .should("exist"); - - return this; - } - - assertValidationErrorRequired(attrName: string) { - FormValidation.assertMessage( - cy.findByTestId(attrName), - `Please specify '${attrName}'.`, - ); - - return this; - } - - assertGroupDisplayName(group: string, expectedDisplayName: string) { - cy.get(`h1#${group.toLowerCase()}`).should( - "have.text", - expectedDisplayName, - ); - - return this; - } - - setAttributeValue(attrName: string, value: string) { - cy.findByTestId(attrName).as("attr").clear(); - cy.get("@attr").type(value); - - return this; - } - - setAttributeValueOnSelect(attrName: string, value: string) { - Select.selectItem(this.#getSelectFieldButton(attrName), value); - - return this; - } - - setUsername(value: string) { - this.#getUsernameField().clear(); - - if (value) { - this.#getUsernameField().type(value); - } - - return this; - } - - #getUsernameField() { - return cy.findByTestId("username"); - } - - assertNotificationCreated() { - this.masthead.checkNotificationMessage("The user has been created"); - - return this; - } - - assertNotificationUpdated() { - this.masthead.checkNotificationMessage("The user has been saved"); - - return this; - } - - cancel() { - cy.findByTestId(this.cancelBtn).click(); - - return this; - } -} diff --git a/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/users/CredentialsPage.ts b/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/users/CredentialsPage.ts deleted file mode 100644 index 1a1c70da8c2..00000000000 --- a/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/users/CredentialsPage.ts +++ /dev/null @@ -1,127 +0,0 @@ -export default class CredentialsPage { - readonly #credentialsTab = "credentials"; - readonly #emptyStatePasswordBtn = "no-credentials-empty-action"; - readonly #emptyStateResetBtn = "credential-reset-empty-action"; - readonly #resetBtn = "credentialResetBtn"; - readonly #setPasswordBtn = "confirm"; - readonly #credentialResetModal = "credential-reset-modal"; - readonly #resetModalActionsToggleBtn = - "[data-testid=credential-reset-modal] #actions"; - - readonly #passwordField = "passwordField"; - readonly #passwordConfirmationField = "passwordConfirmationField"; - readonly #resetActions = [ - "Verify Email", - "Update Profile", - "Configure OTP", - "Update Password", - "Terms and Conditions", - ]; - readonly #confirmationButton = "confirm"; - readonly #editLabelBtn = "editUserLabelBtn"; - readonly #labelField = "userLabelFld"; - readonly #editConfirmationBtn = "editUserLabelAcceptBtn"; - readonly #showDataDialogBtn = "showDataBtn"; - readonly #closeDataDialogBtn = '.pf-v5-c-modal-box [aria-label^="Close"]'; - - goToCredentialsTab() { - cy.intercept("/admin/realms/*/users/*/credentials").as("load"); - cy.findByTestId(this.#credentialsTab).click(); - cy.wait("@load"); - cy.wait(200); - - return this; - } - clickEmptyStatePasswordBtn() { - cy.findByTestId(this.#emptyStatePasswordBtn).click(); - - return this; - } - - clickEmptyStateResetBtn() { - cy.findByTestId(this.#emptyStateResetBtn).click(); - - return this; - } - - clickResetBtn() { - cy.findByTestId(this.#resetBtn).click(); - - return this; - } - - clickResetModalActionsToggleBtn() { - cy.get(this.#resetModalActionsToggleBtn).click(); - - return this; - } - - clickResetModalAction(index: number) { - cy.get("[data-testid=credential-reset-modal] .pf-v5-c-menu__list") - .contains(this.#resetActions[index]) - .click(); - - return this; - } - - clickConfirmationBtn() { - cy.findByTestId(this.#confirmationButton).click(); - - return this; - } - - fillPasswordForm() { - cy.findByTestId(this.#passwordField).type("test"); - cy.findByTestId(this.#passwordConfirmationField).type("test"); - - return this; - } - - fillResetCredentialForm() { - cy.findByTestId(this.#credentialResetModal); - this.clickResetModalActionsToggleBtn() - .clickResetModalAction(2) - .clickResetModalAction(3) - .clickConfirmationBtn(); - - return this; - } - - clickSetPasswordBtn() { - cy.findByTestId(this.#setPasswordBtn).click(); - - return this; - } - - clickEditCredentialLabelBtn() { - cy.findByTestId(this.#editLabelBtn) - .should("be.visible") - .click({ force: true }); - - return this; - } - - fillEditCredentialForm() { - cy.findByTestId(this.#labelField).focus().type("test"); - - return this; - } - - clickEditConfirmationBtn() { - cy.findByTestId(this.#editConfirmationBtn).click(); - - return this; - } - - clickShowDataDialogBtn() { - cy.findByTestId(this.#showDataDialogBtn).click(); - - return this; - } - - clickCloseDataDialogBtn() { - cy.get(this.#closeDataDialogBtn).click({ force: true }); - - return this; - } -} diff --git a/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/users/UserGroupsPage.ts b/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/users/UserGroupsPage.ts deleted file mode 100644 index 629bc2af314..00000000000 --- a/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/users/UserGroupsPage.ts +++ /dev/null @@ -1,40 +0,0 @@ -import ModalUtils from "../../../../../support/util/ModalUtils"; - -const modalUtils = new ModalUtils(); - -export default class UserGroupsPage { - #userGroupsTab = "user-groups-tab"; - #noGroupsAddGroupButton = "no-groups-empty-action"; - #joinGroupButton = "join-button"; - #leaveGroupButton = "leave-group-button"; - - goToGroupsTab() { - cy.findByTestId(this.#userGroupsTab).click(); - return this; - } - - toggleAddGroupModal() { - cy.findByTestId(this.#noGroupsAddGroupButton).click({ force: true }); - return this; - } - - joinGroups() { - cy.findByTestId(this.#joinGroupButton).click(); - } - - leaveGroup() { - cy.findByTestId(this.#leaveGroupButton).click(); - modalUtils.confirmModal(); - return this; - } - - leaveGroupButtonDisabled() { - cy.findByTestId(this.#leaveGroupButton).should("be.disabled"); - return this; - } - - leaveGroupButtonEnabled() { - cy.findByTestId(this.#leaveGroupButton).should("not.be.disabled"); - return this; - } -} diff --git a/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/users/UsersListingPage.ts b/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/users/UsersListingPage.ts deleted file mode 100644 index c00186aa6d3..00000000000 --- a/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/users/UsersListingPage.ts +++ /dev/null @@ -1,88 +0,0 @@ -import ListingPage from "../../ListingPage"; -import UsersPage from "./UsersPage"; - -export enum DefaultUserAttribute { - username = "Username", - email = "Email", - firstName = "First name", - lastName = "Last name", -} - -export enum UserFilterType { - DefaultSearch = "Default search", - AttributeSearch = "Attribute search", -} - -export default class UsersListingPage extends ListingPage { - #dropdownPanelBtn = "[data-testid='dropdown-panel-btn']"; - #userAttributeSearchForm = "[data-testid='user-attribute-search-form']"; - #userAttributeSearchAddFilterBtn = - "[data-testid='user-attribute-search-add-filter-button']"; - #userAttributeSearchBtn = "[data-testid='search-user-attribute-btn']"; - #usersPage: UsersPage; - - constructor(usersPage: UsersPage) { - super(); - this.#usersPage = usersPage; - console.log("this.u1", usersPage); - console.log("this.u2", this.#usersPage); - } - - selectUserSearchFilter(filter: UserFilterType) { - super.selectFilter("user-search-toggle", filter); - - return this; - } - - openUserAttributesSearchForm() { - cy.get(this.#dropdownPanelBtn).click(); - cy.get(this.#userAttributeSearchForm).should("be.visible"); - - return this; - } - - addUserAttributeSearchCriteria( - defaultUserAttribute: DefaultUserAttribute, - attributeValue: string, - ) { - return this.addUserAttributeSearchCriteriaCustom( - defaultUserAttribute, - attributeValue, - ); - } - - addUserAttributeSearchCriteriaCustom( - attributeLabel: string, - attributeValue: string, - ) { - cy.get(this.#userAttributeSearchForm) - .find(".pf-m-typeahead") - .click() - .get(".pf-v5-c-menu__list-item") - .contains(attributeLabel) - .click({ force: true }); - - cy.get(this.#userAttributeSearchForm) - .find("#value") - .clear() - .type(attributeValue); - - cy.get(this.#userAttributeSearchForm) - .find(this.#userAttributeSearchAddFilterBtn) - .click(); - - this.#usersPage.assertAttributeSearchChipExists( - attributeLabel, - attributeValue, - true, - ); - - return this; - } - - triggerAttributesSearch() { - cy.get(this.#userAttributeSearchBtn).click(); - - return this; - } -} diff --git a/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/users/UsersPage.ts b/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/users/UsersPage.ts deleted file mode 100644 index 6fa691d6df5..00000000000 --- a/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/users/UsersPage.ts +++ /dev/null @@ -1,48 +0,0 @@ -import PageObject from "../../components/PageObject"; -import UsersListingPage from "./UsersListingPage"; - -export default class UsersPage extends PageObject { - #userListTabLink = "listTab"; - #permissionsTabLink = "permissionsTab"; - #userAttributeSearchChipsGroup = - "[data-testid='user-attribute-search-chips-group']"; - #usersListingPage = new UsersListingPage(this); - - public goToUserListTab() { - cy.findByTestId(this.#userListTabLink).click(); - - return this; - } - - public listing() { - return this.#usersListingPage; - } - - public goToPermissionsTab() { - cy.findByTestId(this.#permissionsTabLink).click(); - - return this; - } - - public goToUserDetailsPage(username: string) { - this.#usersListingPage.searchItem(username); - this.#usersListingPage.goToItemDetails(username); - - return this; - } - - public assertAttributeSearchChipExists( - attributeLabel: string, - attributeValue: string, - exists: boolean, - ) { - super.assertLabeledChipGroupItemExist( - this.#userAttributeSearchChipsGroup, - attributeLabel, - attributeValue, - exists, - ); - - return this; - } -} diff --git a/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/users/user_details/UserDetailsPage.ts b/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/users/user_details/UserDetailsPage.ts deleted file mode 100644 index 83cd7642698..00000000000 --- a/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/users/user_details/UserDetailsPage.ts +++ /dev/null @@ -1,110 +0,0 @@ -import { RequiredActionAlias } from "@keycloak/keycloak-admin-client/lib/defs/requiredActionProviderRepresentation"; -import PageObject from "../../../components/PageObject"; - -export default class UserDetailsPage extends PageObject { - saveBtn: string; - cancelBtn: string; - emailInput: string; - emailValue: () => string; - firstNameInput: string; - firstNameValue: string; - lastNameInput: string; - lastNameValue: string; - requiredUserActions: RequiredActionAlias[]; - identityProviderLinksTab: string; - detailsTab: string; - consentsTab: string; - sessionsTab: string; - - constructor() { - super(); - this.saveBtn = "user-creation-save"; - this.cancelBtn = "cancel-create-user"; - this.emailInput = "email"; - this.emailValue = () => - "example" + "_" + crypto.randomUUID() + "@example.com"; - this.firstNameInput = "firstName"; - this.firstNameValue = "firstname"; - this.lastNameInput = "lastName"; - this.lastNameValue = "lastname"; - this.requiredUserActions = [RequiredActionAlias.UPDATE_PASSWORD]; - this.identityProviderLinksTab = "identity-provider-links-tab"; - this.detailsTab = "user-details-tab"; - this.consentsTab = "user-consents-tab"; - this.sessionsTab = "user-sessions-tab"; - } - - public goToIdentityProviderLinksTab() { - cy.intercept("/admin/realms/master/identity-provider/instances").as( - "idpInstances", - ); - cy.intercept("/admin/realms/master/users/*/federated-identity").as( - "fedIdentity", - ); - cy.findByTestId(this.identityProviderLinksTab).click(); - cy.wait(["@idpInstances", "@fedIdentity"]); - - return this; - } - - fillUserData() { - cy.findByTestId(this.emailInput).type(this.emailValue()); - cy.findByTestId(this.firstNameInput).type(this.firstNameValue); - cy.findByTestId(this.lastNameInput).type(this.lastNameValue); - - return this; - } - - save() { - cy.findByTestId(this.saveBtn).click(); - - return this; - } - - cancel() { - cy.findByTestId(this.cancelBtn).click(); - - return this; - } - - goToDetailsTab() { - cy.findByTestId(this.detailsTab).click(); - return this; - } - - goToConsentsTab() { - cy.findByTestId(this.consentsTab).click(); - return this; - } - - goToSessionsTab() { - cy.findByTestId(this.sessionsTab).click(); - return this; - } - - toggleEnabled(userName: string) { - this.#getEnabledSwitch(userName).click({ force: true }); - } - - assertEnabled(userName: string) { - this.#getEnabledSwitchLabel(userName) - .scrollIntoView() - .contains("Enabled") - .should("be.visible"); - } - - assertDisabled(userName: string) { - this.#getEnabledSwitchLabel(userName) - .scrollIntoView() - .contains("Disabled") - .should("be.visible"); - } - - #getEnabledSwitch(userName: string) { - return cy.findByTestId(`${userName}-switch`); - } - - #getEnabledSwitchLabel(userName: string) { - return this.#getEnabledSwitch(userName).closest("label"); - } -} diff --git a/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/users/user_details/tabs/IdentityProviderLinksTab.ts b/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/users/user_details/tabs/IdentityProviderLinksTab.ts deleted file mode 100644 index 2cdf5a4e837..00000000000 --- a/js/apps/admin-ui/cypress/support/pages/admin-ui/manage/users/user_details/tabs/IdentityProviderLinksTab.ts +++ /dev/null @@ -1,157 +0,0 @@ -import ModalUtils from "../../../../../../util/ModalUtils"; -import Masthead from "../../../../Masthead"; - -const modalUtils = new ModalUtils(); -const masthead = new Masthead(); - -export default class IdentityProviderLinksTab { - #linkedProvidersSection = ".kc-linked-idps"; - #availableProvidersSection = ".kc-available-idps"; - #linkAccountBtn = ".pf-v5-c-button.pf-m-link"; - #linkAccountModalIdentityProviderInput = "idpNameInput"; - #linkAccountModalUserIdInput = "userId"; - #linkAccountModalUsernameInput = "userName"; - - public clickLinkAccount(idpName: string) { - cy.get(this.#availableProvidersSection + " tr") - .contains(idpName) - .parent() - .find(this.#linkAccountBtn) - .click(); - - return this; - } - - public clickUnlinkAccount(idpName: string) { - cy.get(this.#linkedProvidersSection + " tr") - .contains(idpName) - .parent() - .parent() - .find(this.#linkAccountBtn) - .click(); - - return this; - } - - public typeLinkAccountModalUserId(userId: string) { - cy.findByTestId(this.#linkAccountModalUserIdInput).type(userId); - - return this; - } - - public typeLinkAccountModalUsername(username: string) { - cy.findByTestId(this.#linkAccountModalUsernameInput).type(username); - - return this; - } - - public clickLinkAccountModalLinkBtn() { - modalUtils.confirmModal(); - return this; - } - - public clickUnlinkAccountModalUnlinkBtn() { - modalUtils.confirmModal(); - return this; - } - - public assertNoIdentityProvidersLinkedMessageExist(exist: boolean) { - cy.get(this.#linkedProvidersSection).should( - (exist ? "" : "not.") + "contain.text", - "No identity providers linked.", - ); - - return this; - } - - public assertNoAvailableIdentityProvidersMessageExist(exist: boolean) { - cy.get(this.#availableProvidersSection).should( - (exist ? "" : "not.") + "contain.text", - "No available identity providers.", - ); - - return this; - } - - public assertLinkAccountModalTitleEqual(idpName: string) { - modalUtils.assertModalTitleEqual(`Link account to ${idpName}`); - - return this; - } - - public assertUnLinkAccountModalTitleEqual(idpName: string) { - modalUtils.assertModalTitleEqual(`Unlink account from ${idpName}?`); - - return this; - } - - public assertLinkAccountModalIdentityProviderInputEqual(idpName: string) { - cy.findByTestId(this.#linkAccountModalIdentityProviderInput).should( - "have.value", - idpName, - ); - - return this; - } - - public assertNotificationIdentityProviderLinked() { - masthead.checkNotificationMessage("Identity provider has been linked"); - - return this; - } - - public assertNotificationAlreadyLinkedError() { - masthead.checkNotificationMessage( - "Could not link identity provider User is already linked with provider", - ); - - return this; - } - - public assertNotificationPoviderLinkRemoved() { - masthead.checkNotificationMessage("The provider link has been removed"); - - return this; - } - - public assertLinkedIdentityProvidersItemsEqual(count: number) { - if (count > 0) { - cy.get(this.#linkedProvidersSection + " tbody") - .find("tr") - .should("have.length", count); - } else { - cy.get(this.#linkedProvidersSection + " tbody").should("not.exist"); - } - - return this; - } - - public assertAvailableIdentityProvidersItemsEqual(count: number) { - if (count > 0) { - cy.get(this.#availableProvidersSection + " tbody") - .find("tr") - .should("have.length", count); - } else { - cy.get(this.#availableProvidersSection + " tbody").should("not.exist"); - } - return this; - } - - public assertLinkedIdentityProviderExist(idpName: string, exist: boolean) { - cy.get(this.#linkedProvidersSection).should( - (exist ? "" : "not.") + "contain.text", - idpName, - ); - - return this; - } - - public assertAvailableIdentityProviderExist(idpName: string, exist: boolean) { - cy.get(this.#availableProvidersSection).should( - (exist ? "" : "not.") + "contain.text", - idpName, - ); - - return this; - } -} diff --git a/js/apps/admin-ui/cypress/support/util/ModalUtils.ts b/js/apps/admin-ui/cypress/support/util/ModalUtils.ts deleted file mode 100644 index 133e497e2dd..00000000000 --- a/js/apps/admin-ui/cypress/support/util/ModalUtils.ts +++ /dev/null @@ -1,114 +0,0 @@ -import PageObject from "../pages/admin-ui/components/PageObject"; -import TablePage from "../pages/admin-ui/components/TablePage"; - -export default class ModalUtils extends PageObject { - #modalDiv = ".pf-v5-c-modal-box"; - #modalTitle = ".pf-v5-c-modal-box .pf-v5-c-modal-box__title-text"; - #modalMessage = ".pf-v5-c-modal-box .pf-v5-c-modal-box__body"; - #confirmModalBtn = "confirm"; - #cancelModalBtn = "cancel"; - #closeModalBtn = ".pf-v5-c-modal-box .pf-m-plain"; - #copyToClipboardBtn = '[id*="copy-button"]'; - #addModalDropdownBtn = "#add-dropdown"; - #addModalDropdownItem = ".pf-v5-c-modal-box__footer .pf-v5-c-menu__content"; - #addBtn = "add"; - #tablePage = new TablePage(TablePage.tableSelector); - #confirmDuplicateModalBtn = "duplicateGroup"; - - table() { - return this.#tablePage; - } - - add() { - cy.findByTestId(this.#addBtn).click(); - return this; - } - - confirmModal() { - cy.findByTestId(this.#confirmModalBtn).click({ force: true }); - - return this; - } - - confirmDuplicateModal() { - cy.findByTestId(this.#confirmDuplicateModalBtn).click(); - - return this; - } - - checkConfirmButtonText(text: string) { - cy.findByTestId(this.#confirmModalBtn).contains(text); - - return this; - } - - confirmModalWithItem(itemName: string) { - cy.get(this.#addModalDropdownBtn).click(); - cy.get(this.#addModalDropdownItem).contains(itemName).click(); - - return this; - } - - cancelModal() { - cy.findByTestId(this.#cancelModalBtn).click({ force: true }); - - return this; - } - - cancelButtonContains(text: string) { - cy.findByTestId(this.#cancelModalBtn).contains(text); - - return this; - } - - copyToClipboard() { - cy.get(this.#copyToClipboardBtn).click(); - - return this; - } - - closeModal() { - cy.get(this.#closeModalBtn).click({ force: true }); - - return this; - } - - checkModalTitle(title: string) { - //deprecated - this.assertModalTitleEqual(title); - return this; - } - - checkModalMessage(message: string) { - cy.get(this.#modalMessage).invoke("text").should("eq", message); - - return this; - } - - assertModalMessageContainText(text: string) { - cy.get(this.#modalMessage).should("contain.text", text); - return this; - } - - assertModalHasElement(elementSelector: string, exist: boolean) { - cy.get(this.#modalDiv) - .find(elementSelector) - .should((exist ? "" : ".not") + "exist"); - return this; - } - - assertModalVisible(isVisible: boolean) { - super.assertIsVisible(cy.get(this.#modalDiv), isVisible); - return this; - } - - assertModalExist(exist: boolean) { - super.assertExist(cy.get(this.#modalDiv), exist); - return this; - } - - assertModalTitleEqual(text: string) { - cy.get(this.#modalTitle).invoke("text").should("eq", text); - return this; - } -} diff --git a/js/apps/admin-ui/cypress/support/util/grantClipboardAccess.ts b/js/apps/admin-ui/cypress/support/util/grantClipboardAccess.ts deleted file mode 100644 index 86a12a14da5..00000000000 --- a/js/apps/admin-ui/cypress/support/util/grantClipboardAccess.ts +++ /dev/null @@ -1,13 +0,0 @@ -export default function grantClipboardAccess() { - // Use the Chrome debugger protocol to grant access to the clipboard. - // https://chromedevtools.github.io/devtools-protocol/tot/Browser/#method-grantPermissions - cy.wrap( - Cypress.automation("remote:debugger:protocol", { - command: "Browser.grantPermissions", - params: { - permissions: ["clipboardReadWrite", "clipboardSanitizedWrite"], - origin: window.location.origin, - }, - }), - ); -} diff --git a/js/apps/admin-ui/cypress/support/util/keycloak_hooks.ts b/js/apps/admin-ui/cypress/support/util/keycloak_hooks.ts deleted file mode 100644 index 75970fe737d..00000000000 --- a/js/apps/admin-ui/cypress/support/util/keycloak_hooks.ts +++ /dev/null @@ -1,16 +0,0 @@ -export const keycloakBefore = () => { - /* - Prevent unpredictable 401 errors from failing individual tests. - These are most often occurring during the login process: - GET /admin/serverinfo/ - GET /admin/master/console/whoami - */ - cy.on("uncaught:exception", (err) => { - console.log("-------------------"); - console.log(err); - console.log("--------------------"); - return false; - }); - cy.visit(""); - cy.get('[role="progressbar"]').should("not.exist"); -}; diff --git a/js/apps/admin-ui/cypress/tsconfig.json b/js/apps/admin-ui/cypress/tsconfig.json deleted file mode 100644 index 801e32ca195..00000000000 --- a/js/apps/admin-ui/cypress/tsconfig.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "extends": "../tsconfig.json", - "include": ["**/*", "../src/i18next.d.ts"], - "compilerOptions": { - "types": [ - "node", - "cypress", - "@testing-library/cypress", - "@4tw/cypress-drag-drop", - "cypress-axe" - ], - "module": "ES2015", - "target": "ES2015", - "useDefineForClassFields": false - } -} diff --git a/js/apps/admin-ui/maven-resources/theme/keycloak.v2/admin/index.ftl b/js/apps/admin-ui/maven-resources/theme/keycloak.v2/admin/index.ftl index c9f3f62c486..4766c0c6eb0 100644 --- a/js/apps/admin-ui/maven-resources/theme/keycloak.v2/admin/index.ftl +++ b/js/apps/admin-ui/maven-resources/theme/keycloak.v2/admin/index.ftl @@ -127,7 +127,7 @@
- + diff --git a/js/apps/admin-ui/package.json b/js/apps/admin-ui/package.json index 5c08a0befcc..3d3fa958bc6 100644 --- a/js/apps/admin-ui/package.json +++ b/js/apps/admin-ui/package.json @@ -23,10 +23,7 @@ "preview": "wireit", "lint": "wireit", "test": "wireit", - "cy:open": "cypress open --e2e --browser chrome", - "cy:run": "cypress run --browser chrome", - "cy:check-types": "wireit", - "cy:ldap-server": "ldap-server-mock --conf=./cypress/fixtures/ldap/server.json --database=./cypress/fixtures/ldap/users.json" + "test:integration": "playwright test" }, "wireit": { "dev": { @@ -79,12 +76,6 @@ "../../libs/ui-shared:build", "../../libs/keycloak-admin-client:build" ] - }, - "cy:check-types": { - "command": "tsc --project cypress/tsconfig.json", - "dependencies": [ - "../../libs/keycloak-admin-client:build" - ] } }, "dependencies": { @@ -115,8 +106,8 @@ "use-react-router-breadcrumbs": "^4.0.1" }, "devDependencies": { - "@4tw/cypress-drag-drop": "^2.3.0", - "@testing-library/cypress": "^10.0.3", + "@axe-core/playwright": "^4.10.1", + "@playwright/test": "^1.49.1", "@testing-library/dom": "^10.4.0", "@testing-library/jest-dom": "^6.6.3", "@testing-library/react": "^16.2.0", @@ -126,13 +117,10 @@ "@types/react": "^18.3.18", "@types/react-dom": "^18.3.5", "@vitejs/plugin-react-swc": "^3.8.0", - "cypress": "^14.1.0", - "cypress-axe": "^1.6.0", - "cypress-split": "^1.24.14", "jsdom": "^26.0.0", - "ldap-server-mock": "^6.0.1", "lightningcss": "^1.29.2", "ts-node": "^10.9.2", + "uuid": "^11.1.0", "vite": "^6.2.1", "vite-plugin-checker": "^0.9.0", "vite-plugin-dts": "^4.5.3", diff --git a/js/apps/admin-ui/playwright.config.ts b/js/apps/admin-ui/playwright.config.ts new file mode 100644 index 00000000000..77020e77a68 --- /dev/null +++ b/js/apps/admin-ui/playwright.config.ts @@ -0,0 +1,29 @@ +import { defineConfig, devices } from "@playwright/test"; + +/** + * See https://playwright.dev/docs/test-configuration. + */ +export default defineConfig({ + testDir: "./test", + fullyParallel: true, + forbidOnly: !!process.env.CI, + retries: process.env.CI ? 2 : 0, + workers: 1, + reporter: process.env.CI ? [["github"], ["html"]] : "list", + + use: { + baseURL: "http://localhost:8080", + trace: "on-first-retry", + }, + + /* Configure projects for major browsers */ + projects: [ + { + name: "chromium", + use: { + ...devices["Desktop Chrome"], + viewport: { width: 1920, height: 1200 }, + }, + }, + ], +}); diff --git a/js/apps/admin-ui/src/PageHeader.tsx b/js/apps/admin-ui/src/PageHeader.tsx index f24dfda2188..b72640d6499 100644 --- a/js/apps/admin-ui/src/PageHeader.tsx +++ b/js/apps/admin-ui/src/PageHeader.tsx @@ -1,22 +1,10 @@ -import { useEnvironment, useHelp } from "@keycloak/keycloak-ui-shared"; import { - Avatar, - Divider, - Dropdown, - DropdownItem, - DropdownList, - Masthead, - MastheadBrand, - MastheadContent, - MastheadToggle, - MenuToggle, - PageToggleButton, - Toolbar, - ToolbarContent, - ToolbarItem, -} from "@patternfly/react-core"; -import { BarsIcon, EllipsisVIcon, HelpIcon } from "@patternfly/react-icons"; -import { useState } from "react"; + KeycloakMasthead, + useEnvironment, + useHelp, +} from "@keycloak/keycloak-ui-shared"; +import { DropdownItem, ToolbarItem } from "@patternfly/react-core"; +import { HelpIcon } from "@patternfly/react-icons"; import { useTranslation } from "react-i18next"; import { Link, useHref } from "react-router-dom"; import { PageHeaderClearCachesModal } from "./PageHeaderClearCachesModal"; @@ -24,7 +12,6 @@ import { HelpHeader } from "./components/help-enabler/HelpHeader"; import { RealmPanel } from "./components/realm-selector/RealmPanel"; import { useAccess } from "./context/access/Access"; import { useRealm } from "./context/realm-context/RealmContext"; -import { useWhoAmI } from "./context/whoami/WhoAmI"; import { toDashboard } from "./dashboard/routes/Dashboard"; import { usePreviewLogo } from "./realm-settings/themes/LogoContext"; import { joinPath } from "./utils/joinPath"; @@ -45,20 +32,6 @@ const ManageAccountDropdownItem = () => { ); }; -const SignOutDropdownItem = () => { - const { keycloak } = useEnvironment(); - const { t } = useTranslation(); - return ( - keycloak.logout({ redirectUri: "" })} - > - {t("signOut")} - - ); -}; - const ServerInfoDropdownItem = () => { const { realm } = useRealm(); const { t } = useTranslation(); @@ -108,8 +81,6 @@ const kebabDropdownItems = (isMasterRealm: boolean, isManager: boolean) => [ ? [] : []), , - , - , ]; const userDropdownItems = (isMasterRealm: boolean, isManager: boolean) => [ @@ -118,146 +89,52 @@ const userDropdownItems = (isMasterRealm: boolean, isManager: boolean) => [ ...(isMasterRealm && isManager ? [] : []), - , - , ]; -const KebabDropdown = () => { - const [isDropdownOpen, setDropdownOpen] = useState(false); - const { realm } = useRealm(); - const { hasAccess } = useAccess(); - - const isMasterRealm = realm === "master"; - const isManager = hasAccess("manage-realm"); - - return ( - setDropdownOpen(isOpen)} - toggle={(ref) => ( - setDropdownOpen(!isDropdownOpen)} - isExpanded={isDropdownOpen} - > - - - )} - isOpen={isDropdownOpen} - > - - {kebabDropdownItems(isMasterRealm, isManager)} - - - ); -}; - -const UserDropdown = () => { - const { whoAmI } = useWhoAmI(); - const [isDropdownOpen, setDropdownOpen] = useState(false); - const { realm } = useRealm(); - const { hasAccess } = useAccess(); - - const isMasterRealm = realm === "master"; - const isManager = hasAccess("manage-realm"); - - return ( - setDropdownOpen(isOpen)} - toggle={(ref) => ( - setDropdownOpen(!isDropdownOpen)} - > - {whoAmI.getDisplayName()} - - )} - > - {userDropdownItems(isMasterRealm, isManager)} - - ); -}; - export const Header = () => { const { environment, keycloak } = useEnvironment(); const { t } = useTranslation(); const { realm } = useRealm(); + const { hasAccess } = useAccess(); + const contextLogo = usePreviewLogo(); const customLogo = contextLogo?.logo; - const picture = keycloak.tokenParsed?.picture; + const isMasterRealm = realm === "master"; + const isManager = hasAccess("manage-realm"); + const logo = customLogo || environment.logo || "/logo.svg"; const url = useHref(toDashboard({ realm })); const logoUrl = environment.logoUrl ? environment.logoUrl : url; return ( - - - - - - - - - - - - - - - - - - - - - - - - - + } + toolbarItems={[ + + + , + ]} + /> ); }; diff --git a/js/apps/admin-ui/src/PageNav.tsx b/js/apps/admin-ui/src/PageNav.tsx index 97c6dcfb4a8..dd4dbc584ff 100644 --- a/js/apps/admin-ui/src/PageNav.tsx +++ b/js/apps/admin-ui/src/PageNav.tsx @@ -38,10 +38,12 @@ const LeftNav = ({ title, path, id }: LeftNavProps) => { return null; } + const name = "nav-item" + path.replace("/", "-"); return (
  • `pf-v5-c-nav__link${isActive ? " pf-m-current" : ""}` diff --git a/js/apps/admin-ui/src/authentication/components/FlowRow.tsx b/js/apps/admin-ui/src/authentication/components/FlowRow.tsx index 69850399ac6..c876950f6eb 100644 --- a/js/apps/admin-ui/src/authentication/components/FlowRow.tsx +++ b/js/apps/admin-ui/src/authentication/components/FlowRow.tsx @@ -88,12 +88,12 @@ export const FlowRow = ({ /> )} {execution.authenticationFlow && ( - <> + {execution.displayName}
    {" "} {execution.alias} {execution.description} - +
    )} , diff --git a/js/apps/admin-ui/src/authentication/policies/Policies.tsx b/js/apps/admin-ui/src/authentication/policies/Policies.tsx index 5a72bfabd89..edec808ba68 100644 --- a/js/apps/admin-ui/src/authentication/policies/Policies.tsx +++ b/js/apps/admin-ui/src/authentication/policies/Policies.tsx @@ -46,6 +46,7 @@ export const Policies = () => { > {t("passwordPolicy")}} > @@ -53,6 +54,7 @@ export const Policies = () => { {t("otpPolicy")}} > @@ -60,6 +62,7 @@ export const Policies = () => { {t("webauthnPolicy")}} > @@ -67,6 +70,7 @@ export const Policies = () => { {t("webauthnPasswordlessPolicy")}} > diff --git a/js/apps/admin-ui/src/client-scopes/EditClientScope.tsx b/js/apps/admin-ui/src/client-scopes/EditClientScope.tsx index 6810c44e926..7d6cc37137d 100644 --- a/js/apps/admin-ui/src/client-scopes/EditClientScope.tsx +++ b/js/apps/admin-ui/src/client-scopes/EditClientScope.tsx @@ -2,7 +2,12 @@ import ClientScopeRepresentation from "@keycloak/keycloak-admin-client/lib/defs/ import type ProtocolMapperRepresentation from "@keycloak/keycloak-admin-client/lib/defs/protocolMapperRepresentation"; import type { RoleMappingPayload } from "@keycloak/keycloak-admin-client/lib/defs/roleRepresentation"; import type { ProtocolMapperTypeRepresentation } from "@keycloak/keycloak-admin-client/lib/defs/serverInfoRepesentation"; -import { useAlerts, useFetch, useHelp } from "@keycloak/keycloak-ui-shared"; +import { + KeycloakSpinner, + useAlerts, + useFetch, + useHelp, +} from "@keycloak/keycloak-ui-shared"; import { Alert, AlertVariant, @@ -23,7 +28,6 @@ import { changeScope, } from "../components/client-scope/ClientScopeTypes"; import { useConfirmDialog } from "../components/confirm-dialog/ConfirmDialog"; -import { KeycloakSpinner } from "@keycloak/keycloak-ui-shared"; import { RoleMapping, Row } from "../components/role-mapping/RoleMapping"; import { RoutableTabs, @@ -35,11 +39,7 @@ import { convertFormValuesToObject } from "../util"; import { useParams } from "../utils/useParams"; import { MapperList } from "./details/MapperList"; import { ScopeForm } from "./details/ScopeForm"; -import { - ClientScopeParams, - ClientScopeTab, - toClientScope, -} from "./routes/ClientScope"; +import { ClientScopeParams, toClientScope } from "./routes/ClientScope"; import { toClientScopes } from "./routes/ClientScopes"; import { toMapper } from "./routes/Mapper"; import { useAccess } from "../context/access/Access"; @@ -99,19 +99,14 @@ export default function EditClientScope() { return hasOptionalScope ? ClientScope.optional : AllClientScopes.none; } - const useTab = (tab: ClientScopeTab) => - useRoutableTab( - toClientScope({ - realm, - id, - tab, - }), - ); - - const settingsTab = useTab("settings"); - const mappersTab = useTab("mappers"); - const scopeTab = useTab("scope"); - const eventsTab = useTab("events"); + const settingsTab = useRoutableTab( + toClientScope({ realm, id, tab: "settings" }), + ); + const mappersTab = useRoutableTab( + toClientScope({ realm, id, tab: "mappers" }), + ); + const scopeTab = useRoutableTab(toClientScope({ realm, id, tab: "scope" })); + const eventsTab = useRoutableTab(toClientScope({ realm, id, tab: "events" })); const onSubmit = async (formData: ClientScopeDefaultOptionalType) => { const clientScope = convertFormValuesToObject({ @@ -239,7 +234,7 @@ export default function EditClientScope() { /> - + - - diff --git a/js/apps/admin-ui/src/clients/authorization/AuthorizationExport.tsx b/js/apps/admin-ui/src/clients/authorization/AuthorizationExport.tsx index e6f359fd727..3f1e5ef39dc 100644 --- a/js/apps/admin-ui/src/clients/authorization/AuthorizationExport.tsx +++ b/js/apps/admin-ui/src/clients/authorization/AuthorizationExport.tsx @@ -1,6 +1,6 @@ import type ResourceServerRepresentation from "@keycloak/keycloak-admin-client/lib/defs/resourceServerRepresentation"; import { - TextAreaControl, + KeycloakSpinner, useAlerts, useFetch, } from "@keycloak/keycloak-ui-shared"; @@ -10,12 +10,12 @@ import { Button, PageSection, } from "@patternfly/react-core"; +import CodeEditor from "@uiw/react-textarea-code-editor"; import { saveAs } from "file-saver"; import { useState } from "react"; import { useTranslation } from "react-i18next"; import { useAdminClient } from "../../admin-client"; import { FormAccess } from "../../components/form/FormAccess"; -import { KeycloakSpinner } from "@keycloak/keycloak-ui-shared"; import { prettyPrintJSON } from "../../util"; import { useParams } from "../../utils/useParams"; import type { ClientParams } from "../routes/Client"; @@ -69,14 +69,13 @@ export const AuthorizationExport = () => { role="manage-authorization" className="pf-v5-u-mt-lg" > -