2021-03-05 20:55:01 +00:00
|
|
|
export default class ProviderPage {
|
2022-04-05 19:33:51 +00:00
|
|
|
// KerberosSettingsRequired input values
|
|
|
|
private kerberosNameInput = "kerberos-name";
|
|
|
|
private kerberosRealmInput = "kerberos-realm";
|
|
|
|
private kerberosPrincipalInput = "kerberos-principal";
|
|
|
|
private kerberosKeytabInput = "kerberos-keytab";
|
|
|
|
|
|
|
|
// LdapSettingsGeneral input values
|
|
|
|
private ldapNameInput = "ldap-name";
|
2021-05-06 08:38:45 +00:00
|
|
|
private ldapVendorInput = "#kc-vendor";
|
|
|
|
private ldapVendorList = "#kc-vendor + ul";
|
|
|
|
|
2022-04-05 19:33:51 +00:00
|
|
|
// LdapSettingsConnection input values
|
|
|
|
connectionUrlInput = "ldap-connection-url";
|
|
|
|
truststoreSpiInput = "#kc-use-truststore-spi";
|
|
|
|
truststoreSpiList = "#kc-use-truststore-spi + ul";
|
|
|
|
connectionTimeoutInput = "connection-timeout";
|
|
|
|
bindTypeInput = "#kc-bind-type";
|
|
|
|
private bindTypeList = "#kc-bind-type + ul";
|
|
|
|
bindDnInput = "ldap-bind-dn";
|
|
|
|
bindCredsInput = "ldap-bind-credentials";
|
|
|
|
private testConnectionBtn = "test-connection-button";
|
|
|
|
private testAuthBtn = "test-auth-button";
|
|
|
|
|
|
|
|
// LdapSettingsSearching input values
|
2022-04-08 09:47:14 +00:00
|
|
|
ldapEditModeInput = "#kc-edit-mode";
|
2021-09-23 14:11:41 +00:00
|
|
|
private ldapEditModeList = "#kc-edit-mode + ul";
|
2022-04-08 09:47:14 +00:00
|
|
|
ldapSearchScopeInput = "#kc-search-scope";
|
|
|
|
private ldapSearchScopeInputList = "#kc-search-scope + ul";
|
|
|
|
ldapPagination = "console-pagination";
|
|
|
|
ldapUsersDnInput = "ldap-users-dn";
|
|
|
|
ldapUserLdapAttInput = "ldap-username-attribute";
|
|
|
|
ldapRdnLdapAttInput = "ldap-rdn-attribute";
|
|
|
|
ldapUuidLdapAttInput = "ldap-uuid-attribute";
|
|
|
|
ldapUserObjClassesInput = "ldap-user-object-classes";
|
|
|
|
ldapUserLdapFilter = "user-ldap-filter";
|
|
|
|
ldapReadTimeout = "ldap-read-timeout";
|
2021-05-06 08:38:45 +00:00
|
|
|
|
2022-04-06 22:06:56 +00:00
|
|
|
// LdapSettingsKerberosIntegration input values
|
|
|
|
ldapKerberosRealmInput = "kerberos-realm";
|
|
|
|
ldapServerPrincipalInput = "kerberos-principal";
|
|
|
|
ldapKeyTabInput = "kerberos-keytab";
|
|
|
|
allowKerberosAuth = "allow-kerberos-auth";
|
|
|
|
debug = "debug";
|
|
|
|
useKerberosForPwAuth = "use-kerberos-pw-auth";
|
|
|
|
|
|
|
|
// LdapSettingsSynchronization input values
|
|
|
|
ldapBatchSizeInput = "batch-size";
|
|
|
|
ldapFullSyncPeriodInput = "full-sync-period";
|
|
|
|
ldapUsersSyncPeriodInput = "changed-users-sync-period";
|
|
|
|
importUsers = "import-users";
|
|
|
|
periodicFullSync = "periodic-full-sync";
|
|
|
|
periodicUsersSync = "periodic-changed-users-sync";
|
|
|
|
|
2021-05-06 08:38:45 +00:00
|
|
|
// SettingsCache input values
|
|
|
|
private cacheDayInput = "#kc-eviction-day";
|
|
|
|
private cacheDayList = "#kc-eviction-day + ul";
|
|
|
|
private cacheHourInput = "#kc-eviction-hour";
|
|
|
|
private cacheHourList = "#kc-eviction-hour + ul";
|
|
|
|
private cacheMinuteInput = "#kc-eviction-minute";
|
|
|
|
private cacheMinuteList = "#kc-eviction-minute + ul";
|
|
|
|
private cachePolicyInput = "#kc-cache-policy";
|
|
|
|
private cachePolicyList = "#kc-cache-policy + ul";
|
|
|
|
|
2022-04-05 19:33:51 +00:00
|
|
|
// Mapper input values
|
2021-12-16 16:24:22 +00:00
|
|
|
private userModelAttInput = "user.model.attribute";
|
|
|
|
private ldapAttInput = "ldap.attribute";
|
|
|
|
private userModelAttNameInput = "user.model.attribute";
|
|
|
|
private attValueInput = "attribute.value";
|
|
|
|
private ldapFullNameAttInput = "ldap.full.name.attribute";
|
|
|
|
private ldapAttNameInput = "ldap.attribute.name";
|
|
|
|
private ldapAttValueInput = "ldap.attribute.value";
|
|
|
|
private groupInput = "group";
|
2022-01-03 07:11:07 +00:00
|
|
|
private ldapGroupsDnInput = "groups.dn";
|
|
|
|
private ldapRolesDnInput = "roles.dn";
|
2021-05-06 08:38:45 +00:00
|
|
|
|
2022-03-16 10:48:21 +00:00
|
|
|
// Mapper types
|
2021-05-06 08:38:45 +00:00
|
|
|
private msadUserAcctMapper = "msad-user-account-control-mapper";
|
|
|
|
private msadLdsUserAcctMapper = "msad-lds-user-account-control-mapper";
|
|
|
|
private userAttLdapMapper = "user-attribute-ldap-mapper";
|
|
|
|
private hcAttMapper = "hardcoded-attribute-mapper";
|
|
|
|
private certLdapMapper = "certificate-ldap-mapper";
|
|
|
|
private fullNameLdapMapper = "full-name-ldap-mapper";
|
|
|
|
private hcLdapAttMapper = "hardcoded-ldap-attribute-mapper";
|
|
|
|
private hcLdapGroupMapper = "hardcoded-ldap-group-mapper";
|
2021-06-03 20:47:47 +00:00
|
|
|
private groupLdapMapper = "group-ldap-mapper";
|
2021-06-04 16:33:38 +00:00
|
|
|
private roleLdapMapper = "role-ldap-mapper";
|
|
|
|
private hcLdapRoleMapper = "hardcoded-ldap-role-mapper";
|
|
|
|
|
2022-04-05 19:33:51 +00:00
|
|
|
private actionDropdown = "action-dropdown";
|
|
|
|
private deleteCmd = "delete-cmd";
|
|
|
|
|
|
|
|
private mappersTab = "ldap-mappers-tab";
|
2022-02-01 07:20:52 +00:00
|
|
|
private rolesTab = "rolesTab";
|
2022-04-05 19:33:51 +00:00
|
|
|
private createRoleBtn = "no-roles-for-this-client-empty-action";
|
|
|
|
private realmRolesSaveBtn = "realm-roles-save-button";
|
2021-06-04 16:33:38 +00:00
|
|
|
private roleNameField = "#kc-name";
|
2021-12-23 14:43:23 +00:00
|
|
|
private clientIdSelect = "#client\\.id-select-typeahead";
|
2021-05-06 08:38:45 +00:00
|
|
|
|
2021-06-03 20:47:47 +00:00
|
|
|
private groupName = "aa-uf-mappers-group";
|
2021-06-04 16:33:38 +00:00
|
|
|
private clientName = "aa-uf-mappers-client";
|
2021-02-23 20:49:57 +00:00
|
|
|
|
2022-03-16 10:48:21 +00:00
|
|
|
private maxLifespan = "kerberos-cache-lifespan";
|
|
|
|
|
|
|
|
// Kerberos settings switch input values
|
|
|
|
debugSwitch = "debug";
|
|
|
|
firstLoginSwitch = "update-first-login";
|
|
|
|
passwordAuthSwitch = "allow-password-authentication";
|
|
|
|
|
2022-04-05 19:33:51 +00:00
|
|
|
// LDAP switch input values
|
|
|
|
enableStartTls = "enable-start-tls";
|
|
|
|
connectionPooling = "connection-pooling";
|
|
|
|
|
2021-03-05 20:55:01 +00:00
|
|
|
changeCacheTime(unit: string, time: string) {
|
|
|
|
switch (unit) {
|
|
|
|
case "day":
|
|
|
|
cy.get(this.cacheDayInput).click();
|
|
|
|
cy.get(this.cacheDayList).contains(time).click();
|
|
|
|
break;
|
|
|
|
case "hour":
|
|
|
|
cy.get(this.cacheHourInput).click();
|
|
|
|
cy.get(this.cacheHourList).contains(time).click();
|
|
|
|
break;
|
|
|
|
case "minute":
|
|
|
|
cy.get(this.cacheMinuteInput).click();
|
|
|
|
cy.get(this.cacheMinuteList).contains(time).click();
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
console.log("Invalid cache time, must be 'day', 'hour', or 'minute'.");
|
|
|
|
break;
|
|
|
|
}
|
2021-03-02 15:23:21 +00:00
|
|
|
return this;
|
|
|
|
}
|
|
|
|
|
2021-12-06 10:50:29 +00:00
|
|
|
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;
|
|
|
|
}
|
|
|
|
|
2021-03-02 15:23:21 +00:00
|
|
|
deleteCardFromCard(card: string) {
|
2022-04-05 19:33:51 +00:00
|
|
|
cy.findByTestId(`${card}-dropdown`).click();
|
|
|
|
cy.findByTestId("card-delete").click();
|
2021-03-02 15:23:21 +00:00
|
|
|
return this;
|
|
|
|
}
|
|
|
|
|
2022-01-05 17:06:53 +00:00
|
|
|
deleteCardFromMenu(card: string) {
|
2021-03-02 15:23:21 +00:00
|
|
|
this.clickExistingCard(card);
|
2022-04-05 19:33:51 +00:00
|
|
|
cy.findByTestId(this.actionDropdown).click();
|
|
|
|
cy.findByTestId(this.deleteCmd).click();
|
2021-03-05 20:55:01 +00:00
|
|
|
return this;
|
|
|
|
}
|
2021-04-28 05:50:41 +00:00
|
|
|
|
2021-03-05 20:55:01 +00:00
|
|
|
fillKerberosRequiredData(
|
|
|
|
name: string,
|
|
|
|
realm: string,
|
|
|
|
principal: string,
|
|
|
|
keytab: string
|
|
|
|
) {
|
|
|
|
if (name) {
|
2022-04-05 19:33:51 +00:00
|
|
|
cy.findByTestId(this.kerberosNameInput).clear().type(name);
|
2021-03-05 20:55:01 +00:00
|
|
|
}
|
|
|
|
if (realm) {
|
2022-04-05 19:33:51 +00:00
|
|
|
cy.findByTestId(this.kerberosRealmInput).clear().type(realm);
|
2021-03-05 20:55:01 +00:00
|
|
|
}
|
|
|
|
if (principal) {
|
2022-04-05 19:33:51 +00:00
|
|
|
cy.findByTestId(this.kerberosPrincipalInput).clear().type(principal);
|
2021-03-05 20:55:01 +00:00
|
|
|
}
|
|
|
|
if (keytab) {
|
2022-04-05 19:33:51 +00:00
|
|
|
cy.findByTestId(this.kerberosKeytabInput).clear().type(keytab);
|
2021-03-05 20:55:01 +00:00
|
|
|
}
|
2021-03-02 15:23:21 +00:00
|
|
|
return this;
|
|
|
|
}
|
|
|
|
|
2022-04-05 07:18:57 +00:00
|
|
|
fillMaxLifespanData(lifespan: number) {
|
|
|
|
for (let i = 0; i < lifespan; i++) {
|
|
|
|
cy.findByTestId(this.maxLifespan).click();
|
|
|
|
}
|
2022-03-16 10:48:21 +00:00
|
|
|
return this;
|
|
|
|
}
|
|
|
|
|
2022-04-08 09:47:14 +00:00
|
|
|
fillSelect(selectField: string, value: string) {
|
|
|
|
cy.get(selectField).click();
|
|
|
|
cy.get(`${selectField} + ul`).contains(value).click();
|
|
|
|
}
|
|
|
|
|
2022-04-06 22:06:56 +00:00
|
|
|
fillTextField(textField: string, value: string) {
|
|
|
|
cy.findByTestId(textField).type("x");
|
|
|
|
cy.findByTestId(textField).clear().type(value).blur();
|
|
|
|
return this;
|
|
|
|
}
|
|
|
|
|
2022-03-16 10:48:21 +00:00
|
|
|
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;
|
|
|
|
}
|
|
|
|
|
2022-04-05 19:33:51 +00:00
|
|
|
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);
|
2021-02-23 20:49:57 +00:00
|
|
|
if (vendor) {
|
|
|
|
cy.get(this.ldapVendorInput).click();
|
|
|
|
cy.get(this.ldapVendorList).contains(vendor).click();
|
|
|
|
}
|
|
|
|
return this;
|
|
|
|
}
|
|
|
|
|
2022-04-05 19:33:51 +00:00
|
|
|
fillLdapConnectionData(
|
2021-02-23 20:49:57 +00:00
|
|
|
connectionUrl: string,
|
|
|
|
bindType: string,
|
2022-04-05 19:33:51 +00:00
|
|
|
truststoreSpi?: string,
|
|
|
|
connectionTimeout?: string,
|
2021-05-14 19:44:45 +00:00
|
|
|
bindDn?: string,
|
|
|
|
bindCreds?: string
|
2021-02-23 20:49:57 +00:00
|
|
|
) {
|
2022-04-05 19:33:51 +00:00
|
|
|
cy.findByTestId(this.connectionUrlInput).clear().type(connectionUrl);
|
|
|
|
|
|
|
|
cy.get(this.bindTypeInput).click();
|
|
|
|
cy.get(this.bindTypeList).contains(bindType).click();
|
|
|
|
|
|
|
|
if (truststoreSpi) {
|
|
|
|
cy.get(this.truststoreSpiInput).click();
|
|
|
|
cy.get(this.truststoreSpiList).contains(truststoreSpi).click();
|
2021-02-23 20:49:57 +00:00
|
|
|
}
|
2022-04-05 19:33:51 +00:00
|
|
|
if (connectionTimeout) {
|
|
|
|
cy.findByTestId(this.connectionTimeoutInput)
|
|
|
|
.clear()
|
|
|
|
.type(connectionTimeout);
|
2021-02-23 20:49:57 +00:00
|
|
|
}
|
|
|
|
if (bindDn) {
|
2022-04-05 19:33:51 +00:00
|
|
|
cy.findByTestId(this.bindDnInput).clear().type(bindDn);
|
2021-02-23 20:49:57 +00:00
|
|
|
}
|
|
|
|
if (bindCreds) {
|
2022-04-05 19:33:51 +00:00
|
|
|
cy.findByTestId(this.bindCredsInput).clear().type(bindCreds);
|
2021-02-23 20:49:57 +00:00
|
|
|
}
|
|
|
|
return this;
|
|
|
|
}
|
|
|
|
|
2022-04-05 19:33:51 +00:00
|
|
|
fillLdapSearchingData(
|
2021-09-23 14:11:41 +00:00
|
|
|
editMode: string,
|
2021-02-23 20:49:57 +00:00
|
|
|
usersDn: string,
|
2022-04-05 19:33:51 +00:00
|
|
|
userLdapAtt?: string,
|
|
|
|
rdnLdapAtt?: string,
|
|
|
|
uuidLdapAtt?: string,
|
2022-04-08 09:47:14 +00:00
|
|
|
userObjClasses?: string,
|
|
|
|
userLdapFilter?: string,
|
|
|
|
searchScope?: string,
|
|
|
|
readTimeout?: string
|
2021-02-23 20:49:57 +00:00
|
|
|
) {
|
2022-04-05 19:33:51 +00:00
|
|
|
cy.get(this.ldapEditModeInput).click();
|
|
|
|
cy.get(this.ldapEditModeList).contains(editMode).click();
|
|
|
|
cy.findByTestId(this.ldapUsersDnInput).clear().type(usersDn);
|
2021-02-23 20:49:57 +00:00
|
|
|
if (userLdapAtt) {
|
2022-04-05 19:33:51 +00:00
|
|
|
cy.findByTestId(this.ldapUserLdapAttInput).clear().type(userLdapAtt);
|
2021-02-23 20:49:57 +00:00
|
|
|
}
|
|
|
|
if (rdnLdapAtt) {
|
2022-04-05 19:33:51 +00:00
|
|
|
cy.findByTestId(this.ldapRdnLdapAttInput).clear().type(rdnLdapAtt);
|
2021-02-23 20:49:57 +00:00
|
|
|
}
|
|
|
|
if (uuidLdapAtt) {
|
2022-04-05 19:33:51 +00:00
|
|
|
cy.findByTestId(this.ldapUuidLdapAttInput).clear().type(uuidLdapAtt);
|
2021-02-23 20:49:57 +00:00
|
|
|
}
|
|
|
|
if (userObjClasses) {
|
2022-04-05 19:33:51 +00:00
|
|
|
cy.findByTestId(this.ldapUserObjClassesInput)
|
|
|
|
.clear()
|
|
|
|
.type(userObjClasses);
|
2021-02-23 20:49:57 +00:00
|
|
|
}
|
2022-04-08 09:47:14 +00:00
|
|
|
if (userLdapFilter) {
|
|
|
|
cy.findByTestId(this.ldapUserLdapFilter).clear().type(userLdapFilter);
|
|
|
|
}
|
|
|
|
if (searchScope) {
|
|
|
|
cy.get(this.ldapSearchScopeInput).click();
|
|
|
|
cy.get(this.ldapSearchScopeInputList).contains(searchScope).click();
|
|
|
|
}
|
|
|
|
if (readTimeout) {
|
|
|
|
cy.findByTestId(this.ldapReadTimeout).clear().type(readTimeout);
|
|
|
|
}
|
2021-02-23 20:49:57 +00:00
|
|
|
return this;
|
|
|
|
}
|
|
|
|
|
|
|
|
selectCacheType(cacheType: string) {
|
2021-03-05 20:55:01 +00:00
|
|
|
cy.get(this.cachePolicyInput).click();
|
|
|
|
cy.get(this.cachePolicyList).contains(cacheType).click();
|
2021-02-23 20:49:57 +00:00
|
|
|
return this;
|
|
|
|
}
|
|
|
|
|
2021-04-28 05:50:41 +00:00
|
|
|
goToMappers() {
|
2022-04-05 19:33:51 +00:00
|
|
|
cy.findByTestId(this.mappersTab).click();
|
2021-04-28 05:50:41 +00:00
|
|
|
}
|
|
|
|
|
2021-06-04 16:33:38 +00:00
|
|
|
createRole(roleName: string) {
|
2022-02-01 07:20:52 +00:00
|
|
|
cy.findByTestId(this.rolesTab).click();
|
2021-06-04 16:33:38 +00:00
|
|
|
cy.wait(1000);
|
2022-04-05 19:33:51 +00:00
|
|
|
cy.findByTestId(this.createRoleBtn).click();
|
2021-06-04 16:33:38 +00:00
|
|
|
cy.wait(1000);
|
2022-04-05 19:33:51 +00:00
|
|
|
cy.get(this.roleNameField).clear().type(roleName);
|
2021-06-04 16:33:38 +00:00
|
|
|
cy.wait(1000);
|
2022-04-05 19:33:51 +00:00
|
|
|
cy.findByTestId(this.realmRolesSaveBtn).click();
|
2021-06-04 16:33:38 +00:00
|
|
|
cy.wait(1000);
|
|
|
|
}
|
|
|
|
|
2021-04-28 05:50:41 +00:00
|
|
|
createNewMapper(mapperType: string) {
|
|
|
|
const userModelAttValue = "firstName";
|
|
|
|
const ldapAttValue = "cn";
|
2021-06-04 16:33:38 +00:00
|
|
|
const ldapDnValue = "ou=groups";
|
2021-04-28 05:50:41 +00:00
|
|
|
|
2021-06-16 11:35:03 +00:00
|
|
|
cy.contains("Add").click();
|
2021-04-28 05:50:41 +00:00
|
|
|
cy.wait(1000);
|
|
|
|
|
|
|
|
cy.get("#kc-providerId").click();
|
2021-06-16 14:16:46 +00:00
|
|
|
cy.get("button").contains(mapperType).click();
|
2021-04-28 05:50:41 +00:00
|
|
|
|
2022-04-05 19:33:51 +00:00
|
|
|
cy.findByTestId("ldap-mapper-name").clear().type(`${mapperType}-test`);
|
2021-04-28 05:50:41 +00:00
|
|
|
|
|
|
|
switch (mapperType) {
|
|
|
|
case this.msadUserAcctMapper:
|
|
|
|
case this.msadLdsUserAcctMapper:
|
|
|
|
break;
|
|
|
|
case this.userAttLdapMapper:
|
|
|
|
case this.certLdapMapper:
|
2022-04-05 19:33:51 +00:00
|
|
|
cy.findByTestId(this.userModelAttInput).clear().type(userModelAttValue);
|
|
|
|
cy.findByTestId(this.ldapAttInput).clear().type(ldapAttValue);
|
2021-04-28 05:50:41 +00:00
|
|
|
break;
|
|
|
|
case this.hcAttMapper:
|
2022-04-05 19:33:51 +00:00
|
|
|
cy.findByTestId(this.userModelAttNameInput)
|
|
|
|
.clear()
|
|
|
|
.type(userModelAttValue);
|
|
|
|
cy.findByTestId(this.attValueInput).clear().type(ldapAttValue);
|
2021-04-28 05:50:41 +00:00
|
|
|
break;
|
|
|
|
case this.fullNameLdapMapper:
|
2022-04-05 19:33:51 +00:00
|
|
|
cy.findByTestId(this.ldapFullNameAttInput).clear().type(ldapAttValue);
|
2021-04-28 05:50:41 +00:00
|
|
|
break;
|
|
|
|
case this.hcLdapAttMapper:
|
2022-04-05 19:33:51 +00:00
|
|
|
cy.findByTestId(this.ldapAttNameInput).clear().type(userModelAttValue);
|
|
|
|
cy.findByTestId(this.ldapAttValueInput).clear().type(ldapAttValue);
|
2021-04-28 05:50:41 +00:00
|
|
|
break;
|
|
|
|
case this.hcLdapGroupMapper:
|
2022-04-05 19:33:51 +00:00
|
|
|
cy.findByTestId(this.groupInput).clear().type(this.groupName);
|
2021-04-28 05:50:41 +00:00
|
|
|
break;
|
2021-06-03 20:47:47 +00:00
|
|
|
case this.groupLdapMapper:
|
2022-04-05 19:33:51 +00:00
|
|
|
cy.findByTestId(this.ldapGroupsDnInput).clear().type(ldapDnValue);
|
2021-06-03 20:47:47 +00:00
|
|
|
break;
|
2021-06-04 16:33:38 +00:00
|
|
|
|
|
|
|
case this.roleLdapMapper:
|
2022-04-05 19:33:51 +00:00
|
|
|
cy.findByTestId(this.ldapRolesDnInput).clear().type(ldapDnValue);
|
2021-06-04 16:33:38 +00:00
|
|
|
cy.get(this.clientIdSelect).click();
|
|
|
|
cy.get("button").contains(this.clientName).click({ force: true });
|
|
|
|
break;
|
|
|
|
|
|
|
|
case this.hcLdapRoleMapper:
|
2021-12-23 14:43:23 +00:00
|
|
|
cy.get("#group-role-select-typeahead")
|
|
|
|
.click()
|
|
|
|
.get(".pf-c-select__menu-item")
|
|
|
|
.first()
|
|
|
|
.click();
|
|
|
|
cy.get("#role-role-select-typeahead")
|
|
|
|
.click()
|
|
|
|
.get(".pf-c-select__menu-item")
|
|
|
|
.first()
|
|
|
|
.click();
|
2021-06-04 16:33:38 +00:00
|
|
|
break;
|
2021-04-28 05:50:41 +00:00
|
|
|
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:
|
2021-12-16 16:24:22 +00:00
|
|
|
cy.findByTestId(this.userModelAttInput).clear().type(userModelAttValue);
|
|
|
|
cy.findByTestId(this.ldapAttInput).clear().type(ldapAttValue);
|
2021-04-28 05:50:41 +00:00
|
|
|
break;
|
|
|
|
case this.hcAttMapper:
|
2021-12-16 16:24:22 +00:00
|
|
|
cy.findByTestId(this.userModelAttNameInput)
|
|
|
|
.clear()
|
|
|
|
.type(userModelAttValue);
|
|
|
|
cy.findByTestId(this.attValueInput).clear().type(ldapAttValue);
|
2021-04-28 05:50:41 +00:00
|
|
|
break;
|
|
|
|
case this.fullNameLdapMapper:
|
2021-12-16 16:24:22 +00:00
|
|
|
cy.findByTestId(this.ldapFullNameAttInput).clear().type(ldapAttValue);
|
2021-04-28 05:50:41 +00:00
|
|
|
break;
|
|
|
|
case this.hcLdapAttMapper:
|
2021-12-16 16:24:22 +00:00
|
|
|
cy.findByTestId(this.ldapAttNameInput).clear().type(userModelAttValue);
|
|
|
|
cy.findByTestId(this.ldapAttValueInput).clear().type(ldapAttValue);
|
2021-04-28 05:50:41 +00:00
|
|
|
break;
|
|
|
|
default:
|
|
|
|
console.log("Invalid mapper name.");
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-03-02 15:23:21 +00:00
|
|
|
clickExistingCard(cardName: string) {
|
2022-04-05 19:33:51 +00:00
|
|
|
cy.findByTestId("keycloak-card-title").contains(cardName).click();
|
2021-03-01 21:56:26 +00:00
|
|
|
cy.wait(1000);
|
|
|
|
return this;
|
|
|
|
}
|
|
|
|
|
2021-03-02 15:23:21 +00:00
|
|
|
clickMenuCommand(menu: string, command: string) {
|
|
|
|
cy.contains("button", menu).click();
|
|
|
|
cy.contains("li", command).click();
|
|
|
|
return this;
|
|
|
|
}
|
|
|
|
|
|
|
|
clickNewCard(providerType: string) {
|
2022-04-05 19:33:51 +00:00
|
|
|
cy.findByTestId(`${providerType}-card`).click();
|
2021-03-02 15:23:21 +00:00
|
|
|
cy.wait(1000);
|
|
|
|
return this;
|
|
|
|
}
|
|
|
|
|
2021-03-05 20:55:01 +00:00
|
|
|
disableEnabledSwitch(providerType: string) {
|
|
|
|
cy.get(`#${providerType}-switch`).uncheck({ force: true });
|
2021-03-01 21:56:26 +00:00
|
|
|
return this;
|
2021-02-23 20:49:57 +00:00
|
|
|
}
|
|
|
|
|
2021-03-05 20:55:01 +00:00
|
|
|
enableEnabledSwitch(providerType: string) {
|
|
|
|
cy.get(`#${providerType}-switch`).check({ force: true });
|
2021-03-01 21:56:26 +00:00
|
|
|
return this;
|
2021-02-23 20:49:57 +00:00
|
|
|
}
|
|
|
|
|
2021-03-05 20:55:01 +00:00
|
|
|
save(providerType: string) {
|
2022-04-05 19:33:51 +00:00
|
|
|
cy.findByTestId(`${providerType}-save`).click();
|
2021-02-23 20:49:57 +00:00
|
|
|
return this;
|
|
|
|
}
|
|
|
|
|
2021-03-05 20:55:01 +00:00
|
|
|
cancel(providerType: string) {
|
2022-04-05 19:33:51 +00:00
|
|
|
cy.findByTestId(`${providerType}-cancel`).click();
|
|
|
|
return this;
|
|
|
|
}
|
|
|
|
|
|
|
|
testConnection() {
|
|
|
|
cy.findByTestId(this.testConnectionBtn).click();
|
|
|
|
return this;
|
|
|
|
}
|
|
|
|
|
|
|
|
testAuthorization() {
|
|
|
|
cy.findByTestId(this.testAuthBtn).click();
|
2021-02-23 20:49:57 +00:00
|
|
|
return this;
|
|
|
|
}
|
|
|
|
}
|