Fix error message and update and add tests (#2807)
* Fix user-fed-password-policy-error-message * Add test for error messages * Remove only function * Change switch toggle * Modify toggle * Add save action * Set error messages to constant * Remove alert and message changes
This commit is contained in:
parent
0f5df6a5df
commit
64deaa5fb7
2 changed files with 17 additions and 4 deletions
|
@ -86,9 +86,8 @@ describe("Realm tests", () => {
|
||||||
cy.findByText("Delete").click();
|
cy.findByText("Delete").click();
|
||||||
modalUtils.confirmModal();
|
modalUtils.confirmModal();
|
||||||
masthead.checkNotificationMessage("The realm has been deleted");
|
masthead.checkNotificationMessage("The realm has been deleted");
|
||||||
});
|
|
||||||
|
|
||||||
it("Should update realms on delete", () => {
|
// Show current realms
|
||||||
sidebarPage.showCurrentRealms(2);
|
sidebarPage.showCurrentRealms(2);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -109,9 +108,8 @@ describe("Realm tests", () => {
|
||||||
masthead.checkNotificationMessage("Realm created");
|
masthead.checkNotificationMessage("Realm created");
|
||||||
|
|
||||||
cy.wait(["@fetch"]);
|
cy.wait(["@fetch"]);
|
||||||
});
|
|
||||||
|
|
||||||
it("Should show current realms", () => {
|
// Show current realms
|
||||||
sidebarPage.showCurrentRealms(4);
|
sidebarPage.showCurrentRealms(4);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -88,6 +88,10 @@ const deletedSuccessMessage = "The user federation provider has been deleted.";
|
||||||
const deleteModalTitle = "Delete user federation provider?";
|
const deleteModalTitle = "Delete user federation provider?";
|
||||||
const disableModalTitle = "Disable user federation provider?";
|
const disableModalTitle = "Disable user federation provider?";
|
||||||
const nonWritableFailMessage = "User federation provider could not be saved:";
|
const nonWritableFailMessage = "User federation provider could not be saved:";
|
||||||
|
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 ldapTestSuccessMsg = "Successfully connected to LDAP";
|
||||||
const ldapTestFailMsg =
|
const ldapTestFailMsg =
|
||||||
|
@ -427,8 +431,19 @@ describe("User Federation LDAP tests", () => {
|
||||||
providersPage.clickExistingCard(firstLdapName);
|
providersPage.clickExistingCard(firstLdapName);
|
||||||
|
|
||||||
providersPage.fillSelect(providersPage.ldapEditModeInput, editModeUnsynced);
|
providersPage.fillSelect(providersPage.ldapEditModeInput, editModeUnsynced);
|
||||||
|
|
||||||
|
providersPage.toggleSwitch(providersPage.importUsers);
|
||||||
|
|
||||||
|
providersPage.save(provider);
|
||||||
|
masthead.checkNotificationMessage(validatePasswordPolicyFailMessage);
|
||||||
|
|
||||||
providersPage.toggleSwitch(providersPage.importUsers);
|
providersPage.toggleSwitch(providersPage.importUsers);
|
||||||
providersPage.toggleSwitch(providersPage.validatePwPolicySwitch);
|
providersPage.toggleSwitch(providersPage.validatePwPolicySwitch);
|
||||||
|
providersPage.save(provider);
|
||||||
|
|
||||||
|
masthead.checkNotificationMessage(userImportingDisabledFailMessage);
|
||||||
|
|
||||||
|
providersPage.toggleSwitch(providersPage.importUsers);
|
||||||
|
|
||||||
providersPage.save(provider);
|
providersPage.save(provider);
|
||||||
masthead.checkNotificationMessage(savedSuccessMessage);
|
masthead.checkNotificationMessage(savedSuccessMessage);
|
||||||
|
|
Loading…
Reference in a new issue