forked from keycloak/keycloak
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add user-profile admin-ui test to realm_settings_user_profile_enabled…
….spec.ts: "Checks that attribute with select-annotation is displayed and editable when user is created/edited" - refactor existing tests to use page objects, add new helper methods to page objects and use it in existing tests - rename CreateUserPage#save() to #create(), and add a new method #update() - add new test mentioned above - re-enable test "Checks that required attribute with permissions to view/edit is present and required when user is created" - stabilize realm_settings_user_profile_enabled.spec.ts by resetting the user-profile to default and resetting the realm attributes to default before each test Signed-off-by: Daniel Fesenmeyer <[email protected]>
- Loading branch information
1 parent
94b0e22
commit 37efa89
Showing
9 changed files
with
554 additions
and
293 deletions.
There are no files selected for viewing
484 changes: 252 additions & 232 deletions
484
js/apps/admin-ui/cypress/e2e/realm_settings_user_profile_enabled.spec.ts
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
46 changes: 46 additions & 0 deletions
46
.../admin-ui/cypress/support/pages/admin-ui/manage/realm_settings/ValidatorConfigDialogue.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
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; | ||
} | ||
} |
Oops, something went wrong.