diff --git a/.github/workflows/js-ci.yml b/.github/workflows/js-ci.yml index 7e8ac1deb1..6a9fe5ad95 100644 --- a/.github/workflows/js-ci.yml +++ b/.github/workflows/js-ci.yml @@ -194,14 +194,25 @@ jobs: strategy: matrix: container: [1, 2, 3, 4, 5] + browser: [chrome, firefox] + exclude: + # Only test with Firefox on scheduled runs + - browser: ${{ github.event_name != 'schedule' && 'firefox' || '' }} steps: - uses: actions/checkout@v3 - 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 with: working-directory: js @@ -233,7 +244,8 @@ jobs: install: false record: true parallel: true - browser: chrome + group: ${{ matrix.browser }} + browser: ${{ matrix.browser }} wait-on: http://localhost:8080 working-directory: js/apps/admin-ui env: @@ -245,7 +257,7 @@ jobs: - name: Upload server logs uses: actions/upload-artifact@v3 with: - name: server-log-${{ matrix.container }} + name: server-log-${{ matrix.container }}-${{ matrix.browser }} path: ~/server.log check-set-status: 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 index ab57a9252e..578d1a572e 100644 --- a/js/apps/admin-ui/cypress/e2e/authentication_policies_ciba.spec.ts +++ b/js/apps/admin-ui/cypress/e2e/authentication_policies_ciba.spec.ts @@ -1,3 +1,4 @@ +import { v4 as uuid } from "uuid"; import Form from "../support/forms/Form"; import FormValidation from "../support/forms/FormValidation"; import Select from "../support/forms/Select"; @@ -11,7 +12,7 @@ const loginPage = new LoginPage(); const sidebarPage = new SidebarPage(); describe("Authentication - Policies - CIBA", () => { - const realmName = crypto.randomUUID(); + const realmName = uuid(); before(() => adminClient.createRealm(realmName)); after(() => adminClient.deleteRealm(realmName)); diff --git a/js/apps/admin-ui/cypress/e2e/authentication_test.spec.ts b/js/apps/admin-ui/cypress/e2e/authentication_test.spec.ts index 5734a73b9d..f7eda8c674 100644 --- a/js/apps/admin-ui/cypress/e2e/authentication_test.spec.ts +++ b/js/apps/admin-ui/cypress/e2e/authentication_test.spec.ts @@ -1,3 +1,4 @@ +import { v4 as uuid } from "uuid"; import { keycloakBefore } from "../support/util/keycloak_hooks"; import LoginPage from "../support/pages/LoginPage"; import SidebarPage from "../support/pages/admin-ui/SidebarPage"; @@ -20,7 +21,7 @@ const masthead = new Masthead(); const sidebarPage = new SidebarPage(); const commonPage = new CommonPage(); const listingPage = new ListingPage(); -const realmName = "test" + crypto.randomUUID(); +const realmName = "test" + uuid(); describe("Authentication test", () => { const detailPage = new FlowDetails(); 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 index 294ed97580..a3a45a135e 100644 --- a/js/apps/admin-ui/cypress/e2e/client_authorization_test.spec.ts +++ b/js/apps/admin-ui/cypress/e2e/client_authorization_test.spec.ts @@ -1,3 +1,4 @@ +import { v4 as uuid } from "uuid"; import { keycloakBefore } from "../support/util/keycloak_hooks"; import adminClient from "../support/util/AdminClient"; import LoginPage from "../support/pages/LoginPage"; @@ -20,7 +21,7 @@ describe("Client authentication subtab", () => { const clientDetailsPage = new ClientDetailsPage(); const policiesSubTab = new PoliciesTab(); const permissionsSubTab = new PermissionsTab(); - const clientId = "client-authentication-" + crypto.randomUUID(); + const clientId = "client-authentication-" + uuid(); before(() => adminClient.createClient({ 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 index d92e190bbd..337d191235 100644 --- a/js/apps/admin-ui/cypress/e2e/client_scopes_test.spec.ts +++ b/js/apps/admin-ui/cypress/e2e/client_scopes_test.spec.ts @@ -1,3 +1,4 @@ +import { v4 as uuid } from "uuid"; import LoginPage from "../support/pages/LoginPage"; import Masthead from "../support/pages/admin-ui/Masthead"; import ListingPage, { @@ -295,7 +296,7 @@ describe("Client Scopes test", () => { }); it("Client scope CRUD test", () => { - itemId += "_" + crypto.randomUUID(); + itemId += "_" + uuid(); // Create listingPage.itemExist(itemId, false).goToCreateItem(); diff --git a/js/apps/admin-ui/cypress/e2e/clients_test.spec.ts b/js/apps/admin-ui/cypress/e2e/clients_test.spec.ts index f77210b2d7..ede7daf40b 100644 --- a/js/apps/admin-ui/cypress/e2e/clients_test.spec.ts +++ b/js/apps/admin-ui/cypress/e2e/clients_test.spec.ts @@ -1,3 +1,4 @@ +import { v4 as uuid } from "uuid"; import LoginPage from "../support/pages/LoginPage"; import ListingPage, { Filter, @@ -314,7 +315,7 @@ describe("Clients test", () => { }); it("Client CRUD test", () => { - itemId += "_" + crypto.randomUUID(); + itemId += "_" + uuid(); // Create commonPage.tableUtils().checkRowItemExists(itemId, false); @@ -481,7 +482,7 @@ describe("Clients test", () => { describe("Roles tab test", () => { const rolesTab = new ClientRolesTab(); - const client = "client_" + crypto.randomUUID(); + const client = "client_" + uuid(); before(() => adminClient.createClient({ @@ -687,7 +688,7 @@ describe("Clients test", () => { loginPage.logIn(); keycloakBefore(); commonPage.sidebar().goToClients(); - client = "client_" + crypto.randomUUID(); + client = "client_" + uuid(); commonPage.tableToolbarUtils().createClient(); createClientPage .selectClientType("openid-connect") diff --git a/js/apps/admin-ui/cypress/e2e/events_test.spec.ts b/js/apps/admin-ui/cypress/e2e/events_test.spec.ts index 5ac40241c5..7cdda14ed4 100644 --- a/js/apps/admin-ui/cypress/e2e/events_test.spec.ts +++ b/js/apps/admin-ui/cypress/e2e/events_test.spec.ts @@ -1,3 +1,4 @@ +import { v4 as uuid } from "uuid"; import LoginPage from "../support/pages/LoginPage"; import SidebarPage from "../support/pages/admin-ui/SidebarPage"; import UserEventsTab, { @@ -33,7 +34,7 @@ describe.skip("Events tests", () => { const eventsTestUser = { eventsTestUserId: "", userRepresentation: { - username: "events-test" + crypto.randomUUID(), + username: "events-test" + uuid(), enabled: true, credentials: [{ value: "events-test" }], }, @@ -268,7 +269,7 @@ describe.skip("Events tests", () => { }); describe("Admin events list", () => { - const realmName = crypto.randomUUID(); + const realmName = uuid(); before(() => adminClient.createRealm(realmName)); after(() => adminClient.deleteRealm(realmName)); diff --git a/js/apps/admin-ui/cypress/e2e/group_test.spec.ts b/js/apps/admin-ui/cypress/e2e/group_test.spec.ts index cdd516dd0c..b955b25ab3 100644 --- a/js/apps/admin-ui/cypress/e2e/group_test.spec.ts +++ b/js/apps/admin-ui/cypress/e2e/group_test.spec.ts @@ -1,3 +1,4 @@ +import { v4 as uuid } from "uuid"; 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"; @@ -55,7 +56,7 @@ describe("Group test", () => { loginPage.logIn(); keycloakBefore(); sidebarPage.goToGroups(); - groupName = groupNamePrefix + crypto.randomUUID(); + groupName = groupNamePrefix + uuid(); groupNames.push(groupName); }); diff --git a/js/apps/admin-ui/cypress/e2e/masthead_test.spec.ts b/js/apps/admin-ui/cypress/e2e/masthead_test.spec.ts index 1f805ac15c..43d2b5697e 100644 --- a/js/apps/admin-ui/cypress/e2e/masthead_test.spec.ts +++ b/js/apps/admin-ui/cypress/e2e/masthead_test.spec.ts @@ -38,8 +38,20 @@ describe("Masthead tests", () => { it("Should go to documentation page", () => { masthead.clickGlobalHelp(); - masthead.clickDocumentationLink(); - cy.get("#header").should("contain.text", "Server Administration Guide"); + 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", () => { 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 index 0da22e99f3..82d79dc4e3 100644 --- a/js/apps/admin-ui/cypress/e2e/partial_import_test.spec.ts +++ b/js/apps/admin-ui/cypress/e2e/partial_import_test.spec.ts @@ -44,7 +44,7 @@ describe("Partial import test", () => { it("Import button only enabled if JSON has something to import", () => { modal.open(); - modal.textArea().type("{}"); + modal.textArea().type("{}", { force: true }); modal.importButton().should("be.disabled"); modal.cancelButton().click(); }); @@ -119,7 +119,7 @@ describe("Partial import test", () => { //clear button should be disabled if there is nothing in the dialog modal.clearButton().should("be.disabled"); - modal.textArea().type("{}"); + modal.textArea().type("{}", { force: true }); modal.textArea().get(".view-lines").should("have.text", "{}"); modal.clearButton().should("not.be.disabled"); modal.clearButton().click(); 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 index f65b30c3a1..8a0f43c403 100644 --- a/js/apps/admin-ui/cypress/e2e/realm_roles_test.spec.ts +++ b/js/apps/admin-ui/cypress/e2e/realm_roles_test.spec.ts @@ -1,3 +1,4 @@ +import { v4 as uuid } from "uuid"; import LoginPage from "../support/pages/LoginPage"; import Masthead from "../support/pages/admin-ui/Masthead"; import ModalUtils from "../support/util/ModalUtils"; @@ -46,7 +47,7 @@ describe("Realm roles test", () => { }); it("Realm role CRUD test", () => { - itemId += "_" + crypto.randomUUID(); + itemId += "_" + uuid(); // Create listingPage.itemExist(itemId, false).goToCreateItem(); @@ -69,7 +70,7 @@ describe("Realm roles test", () => { }); it("should delete role from details action", () => { - itemId += "_" + crypto.randomUUID(); + itemId += "_" + uuid(); listingPage.goToCreateItem(); createRealmRolePage.fillRealmRoleData(itemId).save(); masthead.checkNotificationMessage("Role created", true); @@ -89,7 +90,7 @@ describe("Realm roles test", () => { }); it("Add associated roles test", () => { - itemId += "_" + crypto.randomUUID(); + itemId += "_" + uuid(); // Create listingPage.itemExist(itemId, false).goToCreateItem(); @@ -183,7 +184,7 @@ describe("Realm roles test", () => { it("Should delete associated roles from list test", () => { itemId = "realm_role_crud"; - itemId += "_" + crypto.randomUUID(); + itemId += "_" + uuid(); // Create listingPage.itemExist(itemId, false).goToCreateItem(); 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 index b82a73b4f7..8bd6ee2eca 100644 --- 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 @@ -1,3 +1,4 @@ +import { v4 as uuid } from "uuid"; 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"; @@ -12,7 +13,7 @@ const modalUtils = new ModalUtils(); const masthead = new Masthead(); describe("Realm settings client policies tab tests", () => { - const realmName = "Realm_" + crypto.randomUUID(); + const realmName = "Realm_" + uuid(); const realmSettingsPage = new RealmSettingsPage(realmName); beforeEach(() => { 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 index eeab299c16..8256d9f1c9 100644 --- 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 @@ -1,3 +1,4 @@ +import { v4 as uuid } from "uuid"; 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"; @@ -14,7 +15,7 @@ const masthead = new Masthead(); describe("Realm settings client profiles tab tests", () => { const profileName = "Test"; const editedProfileName = "Edit"; - const realmName = "Realm_" + crypto.randomUUID(); + const realmName = "Realm_" + uuid(); const realmSettingsPage = new RealmSettingsPage(realmName); beforeEach(() => { 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 index 57987c16fb..a2d66a9eab 100644 --- 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 @@ -1,3 +1,4 @@ +import { v4 as uuid } from "uuid"; 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"; @@ -16,7 +17,7 @@ const realmSettingsPage = new RealmSettingsPage(); const keysTab = new KeysTab(); describe("Realm settings events tab tests", () => { - const realmName = "Realm_" + crypto.randomUUID(); + const realmName = "Realm_" + uuid(); const listingPage = new ListingPage(); beforeEach(() => { @@ -89,10 +90,7 @@ describe("Realm settings events tab tests", () => { }; const addBundle = () => { - realmSettingsPage.addKeyValuePair( - "key_" + crypto.randomUUID(), - "value_" + crypto.randomUUID() - ); + realmSettingsPage.addKeyValuePair("key_" + uuid(), "value_" + uuid()); return this; }; 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 index f5213a7f3b..508962f3df 100644 --- 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 @@ -1,3 +1,4 @@ +import { v4 as uuid } from "uuid"; 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"; @@ -11,7 +12,7 @@ const masthead = new Masthead(); const realmSettingsPage = new RealmSettingsPage(); describe("Realm settings general tab tests", () => { - const realmName = "Realm_" + crypto.randomUUID(); + const realmName = "Realm_" + uuid(); beforeEach(() => { loginPage.logIn(); 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 index 81ea0dafac..d06b4d4bef 100644 --- 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 @@ -1,3 +1,4 @@ +import { v4 as uuid } from "uuid"; 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"; @@ -17,7 +18,7 @@ const keysTab = new KeysTab(); const modalUtils = new ModalUtils(); describe("Realm settings tabs tests", () => { - const realmName = "Realm_" + crypto.randomUUID(); + const realmName = "Realm_" + uuid(); beforeEach(() => { loginPage.logIn(); diff --git a/js/apps/admin-ui/cypress/e2e/realm_settings_user_profile_tab.spec.ts b/js/apps/admin-ui/cypress/e2e/realm_settings_user_profile_tab.spec.ts index fa2823aace..f198ac17aa 100644 --- a/js/apps/admin-ui/cypress/e2e/realm_settings_user_profile_tab.spec.ts +++ b/js/apps/admin-ui/cypress/e2e/realm_settings_user_profile_tab.spec.ts @@ -1,3 +1,4 @@ +import { v4 as uuid } from "uuid"; 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"; @@ -23,7 +24,7 @@ const clickCreateAttributeButton = () => userProfileTab.createAttributeButtonClick(); describe("User profile tabs", () => { - const realmName = "Realm_" + crypto.randomUUID(); + const realmName = "Realm_" + uuid(); const attributeName = "Test"; before(() => diff --git a/js/apps/admin-ui/cypress/e2e/realm_test.spec.ts b/js/apps/admin-ui/cypress/e2e/realm_test.spec.ts index a6bc188e58..9da137bfa0 100644 --- a/js/apps/admin-ui/cypress/e2e/realm_test.spec.ts +++ b/js/apps/admin-ui/cypress/e2e/realm_test.spec.ts @@ -1,3 +1,4 @@ +import { v4 as uuid } from "uuid"; import LoginPage from "../support/pages/LoginPage"; import SidebarPage from "../support/pages/admin-ui/SidebarPage"; import CreateRealmPage from "../support/pages/admin-ui/CreateRealmPage"; @@ -14,9 +15,9 @@ const createRealmPage = new CreateRealmPage(); const realmSettings = new RealmSettings(); const modalUtils = new ModalUtils(); -const testRealmName = "Test-realm-" + crypto.randomUUID(); -const newRealmName = "New-Test-realm-" + crypto.randomUUID(); -const editedRealmName = "Edited-Test-realm-" + crypto.randomUUID(); +const testRealmName = "Test-realm-" + uuid(); +const newRealmName = "New-Test-realm-" + uuid(); +const editedRealmName = "Edited-Test-realm-" + uuid(); const testDisabledName = "Test-Disabled"; describe("Realm tests", () => { 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 index 4d9d552e3b..ce9af5bdb8 100644 --- a/js/apps/admin-ui/cypress/e2e/users_enable_disable.spec.ts +++ b/js/apps/admin-ui/cypress/e2e/users_enable_disable.spec.ts @@ -1,3 +1,4 @@ +import { v4 as uuid } from "uuid"; import UserRepresentation from "@keycloak/keycloak-admin-client/lib/defs/userRepresentation"; import LoginPage from "../support/pages/LoginPage"; import Masthead from "../support/pages/admin-ui/Masthead"; @@ -16,9 +17,7 @@ const masthead = new Masthead(); const createUser = (fields: UserRepresentation) => cy .wrap(null) - .then(() => - adminClient.createUser({ username: crypto.randomUUID(), ...fields }) - ); + .then(() => adminClient.createUser({ username: uuid(), ...fields })); const deleteUser = (username: string) => cy.wrap(null).then(() => adminClient.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 index a6ecbfa4e2..e2bf657c76 100644 --- a/js/apps/admin-ui/cypress/e2e/users_test.spec.ts +++ b/js/apps/admin-ui/cypress/e2e/users_test.spec.ts @@ -1,3 +1,5 @@ +import { v4 as uuid } from "uuid"; + import SidebarPage from "../support/pages/admin-ui/SidebarPage"; import LoginPage from "../support/pages/LoginPage"; import CreateUserPage from "../support/pages/admin-ui/manage/users/CreateUserPage"; @@ -39,7 +41,7 @@ describe("User creation", () => { before(async () => { for (let i = 0; i <= 2; i++) { - groupName += "_" + crypto.randomUUID(); + groupName += "_" + uuid(); await adminClient.createGroup(groupName); groupsList = [...groupsList, groupName]; } @@ -63,7 +65,7 @@ describe("User creation", () => { }); it("Create user test", () => { - itemId += "_" + crypto.randomUUID(); + itemId += "_" + uuid(); // Create createUserPage.goToCreateUser(); @@ -75,7 +77,7 @@ describe("User creation", () => { }); it("Create user with groups test", () => { - itemIdWithGroups += crypto.randomUUID(); + itemIdWithGroups += uuid(); // Add user from search bar createUserPage.goToCreateUser(); @@ -97,7 +99,7 @@ describe("User creation", () => { }); it("Create user with credentials test", () => { - itemIdWithCred += "_" + crypto.randomUUID(); + itemIdWithCred += "_" + uuid(); // Add user from search bar createUserPage.goToCreateUser(); 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 index cfab4abbeb..5e81613be2 100644 --- a/js/apps/admin-ui/cypress/support/pages/admin-ui/Masthead.ts +++ b/js/apps/admin-ui/cypress/support/pages/admin-ui/Masthead.ts @@ -58,8 +58,12 @@ export default class Masthead extends CommonElements { return this; } + getDocumentationLink() { + return cy.get(this.documentationLink); + } + clickDocumentationLink() { - cy.get(this.documentationLink) + this.getDocumentationLink() .find("a") .invoke("removeAttr", "target") .click(); 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 index 6b64c94d52..e9365585f8 100644 --- 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 @@ -148,7 +148,7 @@ export default class UserProfile { } typeJSON(text: string) { - this.textArea().type(text); + this.textArea().type(text, { force: true }); 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 index 6d02ffb7fc..3a0120c428 100644 --- 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 @@ -1,3 +1,4 @@ +import { v4 as uuid } from "uuid"; import { RequiredActionAlias } from "@keycloak/keycloak-admin-client/lib/defs/requiredActionProviderRepresentation"; import PageObject from "../../../components/PageObject"; @@ -20,8 +21,7 @@ export default class UserDetailsPage extends PageObject { this.saveBtn = "save-user"; this.cancelBtn = "cancel-create-user"; this.emailInput = "email-input"; - this.emailValue = () => - "example" + "_" + crypto.randomUUID() + "@example.com"; + this.emailValue = () => "example" + "_" + uuid() + "@example.com"; this.firstNameInput = "firstName-input"; this.firstNameValue = "firstname"; this.lastNameInput = "lastName-input"; diff --git a/js/apps/admin-ui/package.json b/js/apps/admin-ui/package.json index 63d612c66b..91dd033203 100644 --- a/js/apps/admin-ui/package.json +++ b/js/apps/admin-ui/package.json @@ -100,12 +100,14 @@ "@types/lodash-es": "^4.17.7", "@types/react": "^18.2.13", "@types/react-dom": "^18.2.6", + "@types/uuid": "^9.0.2", "@vitejs/plugin-react-swc": "^3.3.2", "cypress": "^12.14.0", "cypress-axe": "^1.4.0", "jsdom": "^22.1.0", "ldap-server-mock": "^6.0.1", "ts-node": "^10.9.1", + "uuid": "^9.0.0", "vite": "^4.3.9", "vite-plugin-checker": "^0.6.0", "vitest": "^0.32.2" diff --git a/js/pnpm-lock.yaml b/js/pnpm-lock.yaml index 2c8cb49f5e..afcd235980 100644 --- a/js/pnpm-lock.yaml +++ b/js/pnpm-lock.yaml @@ -250,6 +250,9 @@ importers: '@types/react-dom': specifier: ^18.2.6 version: 18.2.6 + '@types/uuid': + specifier: ^9.0.2 + version: 9.0.2 '@vitejs/plugin-react-swc': specifier: ^3.3.2 version: 3.3.2(vite@4.3.9) @@ -268,6 +271,9 @@ importers: ts-node: specifier: ^10.9.1 version: 10.9.1(@types/node@20.3.1)(typescript@5.1.3) + uuid: + specifier: ^9.0.0 + version: 9.0.0 vite: specifier: ^4.3.9 version: 4.3.9(@types/node@20.3.1) @@ -1963,6 +1969,10 @@ packages: '@types/jest': 29.5.2 dev: true + /@types/uuid@9.0.2: + resolution: {integrity: sha512-kNnC1GFBLuhImSnV7w4njQkUiJi0ZXUycu1rUaouPqiKlXkh77JKgdRnTAp1x5eBwcIwbtI+3otwzuIDEuDoxQ==} + dev: true + /@types/yargs-parser@21.0.0: resolution: {integrity: sha512-iO9ZQHkZxHn4mSakYV0vFHAVDyEOIJQrV2uZ06HxEPcx+mt8swXoZHIbaaJ2crJYFfErySgktuTZ3BeLz+XmFA==} dev: true @@ -6507,6 +6517,11 @@ packages: hasBin: true dev: true + /uuid@9.0.0: + resolution: {integrity: sha512-MXcSTerfPa4uqyzStbRoTgt5XIe3x5+42+q1sDuy3R5MDk66URdLMOZe5aPX/SQd+kuYAh0FdP/pO28IkQyTeg==} + hasBin: true + dev: true + /v8-compile-cache-lib@3.0.1: resolution: {integrity: sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==} dev: true