Merge pull request #588 from edewit/default-value

Fixed bug
This commit is contained in:
mfrances17 2021-05-07 11:34:30 -04:00 committed by GitHub
commit 84bc7e8091
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 82 additions and 157 deletions

View file

@ -58,8 +58,7 @@ describe("Masthead tests with kebab menu", () => {
}); });
it("shows kabab and hides regular menu", () => { it("shows kabab and hides regular menu", () => {
cy.get(masthead.userDrpDwn).should("not.exist"); masthead.checkKebabShown();
cy.get(masthead.userDrpDwnKebab).should("exist");
}); });
// TODO: Add test for help when using kebab menu. // TODO: Add test for help when using kebab menu.

View file

@ -1,22 +1,12 @@
export default class LoginPage { export default class LoginPage {
userNameInput: string; private userNameInput = "#username";
passwordInput: string; private passwordInput = "#password";
submitBtn: string; private submitBtn = "#kc-login";
errorText: string; private userDrpDwn = "#user-dropdown";
userDrpDwn: string;
oldLoadContainer: string;
loadContainer: string;
constructor() { private errorText = ".kc-feedback-text";
this.userNameInput = "#username"; private oldLoadContainer = "#loading";
this.passwordInput = "#password"; private loadContainer = "div.keycloak__loading-container";
this.submitBtn = "#kc-login";
this.userDrpDwn = "#user-dropdown";
this.errorText = ".kc-feedback-text";
this.oldLoadContainer = "#loading";
this.loadContainer = "div.keycloak__loading-container";
}
isLogInPage() { isLogInPage() {
cy.get(this.userNameInput).should("exist"); cy.get(this.userNameInput).should("exist");

View file

@ -1,19 +1,11 @@
export default class Masthead { export default class Masthead {
menuBtn: string; private menuBtn = "#nav-toggle";
logoBtn: string; private logoBtn = "#masthead-logo";
helpBtn: string; private helpBtn = "#help";
userDrpDwn: string;
userDrpDwnKebab: string;
isMobile: boolean;
constructor() {
this.menuBtn = "#nav-toggle";
this.logoBtn = "#masthead-logo";
this.helpBtn = "#help";
this.userDrpDwn = "#user-dropdown"; private userDrpDwn = "#user-dropdown";
this.userDrpDwnKebab = "#user-dropdown-kebab"; private userDrpDwnKebab = "#user-dropdown-kebab";
this.isMobile = false; private isMobile = false;
}
isAdminConsole() { isAdminConsole() {
cy.get(this.logoBtn).should("exist"); cy.get(this.logoBtn).should("exist");
@ -63,4 +55,11 @@ export default class Masthead {
return this; return this;
} }
checkKebabShown() {
cy.get(this.userDrpDwn).should("not.exist");
cy.get(this.userDrpDwnKebab).should("exist");
return this;
}
} }

View file

@ -10,8 +10,7 @@ export default class GroupModal {
} }
fillGroupForm(name = "") { fillGroupForm(name = "") {
cy.get('[data-testid=groupNameInput]').clear(); cy.getId(this.nameInput).clear().type(name);
cy.get('[data-testid=groupNameInput]').type(name);
return this; return this;
} }

View file

@ -45,7 +45,7 @@ export default class CreateProviderPage {
} }
clickCreateDropdown() { clickCreateDropdown() {
cy.getId(this.addProviderDropdown).click(); cy.getId(this.addProviderDropdown, { timeout: 10000 }).click();
return this; return this;
} }

View file

@ -1,119 +1,64 @@
export default class ProviderPage { export default class ProviderPage {
kerberosNameInput: string; // KerberosSettingsRequired required input values
kerberosRealmInput: string; private kerberosNameInput = "data-testid=kerberos-name";
kerberosPrincipalInput: string; private kerberosRealmInput = "data-testid=kerberos-realm";
kerberosKeytabInput: string; private kerberosPrincipalInput = "data-testid=kerberos-principal";
private kerberosKeytabInput = "data-testid=kerberos-keytab";
ldapNameInput: string; // LdapSettingsGeneral required input values
ldapVendorInput: string; private ldapNameInput = "data-testid=ldap-name";
ldapVendorList: string; private ldapVendorInput = "#kc-vendor";
private ldapVendorList = "#kc-vendor + ul";
ldapConnectionUrlInput: string; // LdapSettingsConnection required input values
ldapBindTypeInput: string; private ldapConnectionUrlInput = "data-testid=ldap-connection-url";
ldapBindTypeList: string; private ldapBindTypeInput = "#kc-bind-type";
ldapBindDnInput: string; private ldapBindTypeList = "#kc-bind-type + ul";
ldapBindCredsInput: string; private ldapBindDnInput = "data-testid=ldap-bind-dn";
private ldapBindCredsInput = "data-testid=ldap-bind-credentials";
ldapUsersDnInput: string; // LdapSettingsSearching required input values
ldapUserLdapAttInput: string; private ldapUsersDnInput = "data-testid=ldap-users-dn";
ldapRdnLdapAttInput: string; private ldapUserLdapAttInput = "data-testid=ldap-username-attribute";
ldapUuidLdapAttInput: string; private ldapRdnLdapAttInput = "data-testid=ldap-rdn-attribute";
ldapUserObjClassesInput: string; private ldapUuidLdapAttInput = "data-testid=ldap-uuid-attribute";
private ldapUserObjClassesInput = "data-testid=ldap-user-object-classes";
cacheDayInput: string; // SettingsCache input values
cacheDayList: string; private cacheDayInput = "#kc-eviction-day";
cacheHourInput: string; private cacheDayList = "#kc-eviction-day + ul";
cacheHourList: string; private cacheHourInput = "#kc-eviction-hour";
cacheMinuteInput: string; private cacheHourList = "#kc-eviction-hour + ul";
cacheMinuteList: string; private cacheMinuteInput = "#kc-eviction-minute";
cachePolicyInput: string; private cacheMinuteList = "#kc-eviction-minute + ul";
cachePolicyList: string; private cachePolicyInput = "#kc-cache-policy";
private cachePolicyList = "#kc-cache-policy + ul";
userModelAttInput: string; // Mapper required input values
ldapAttInput: string; private userModelAttInput = "data-testid=mapper-userModelAttribute-fld";
userModelAttNameInput: string; private ldapAttInput = "data-testid=mapper-ldapAttribute-fld";
attValueInput: string; private userModelAttNameInput =
ldapFullNameAttInput: string; "data-testid=mapper-userModelAttributeName-fld";
ldapAttNameInput: string; private attValueInput = "data-testid=mapper-attributeValue-fld";
ldapAttValueInput: string; private ldapFullNameAttInput = "data-testid=mapper-fullNameAttribute-fld";
groupInput: string; private ldapAttNameInput = "data-testid=mapper-ldapAttributeName-fld";
private ldapAttValueInput = "data-testid=mapper-ldapAttributeValue-fld";
private groupInput = "data-testid=mapper-group-fld";
msadUserAcctMapper: string; // mapper types
msadLdsUserAcctMapper: string; private msadUserAcctMapper = "msad-user-account-control-mapper";
userAttLdapMapper: string; private msadLdsUserAcctMapper = "msad-lds-user-account-control-mapper";
hcAttMapper: string; private userAttLdapMapper = "user-attribute-ldap-mapper";
certLdapMapper: string; private hcAttMapper = "hardcoded-attribute-mapper";
fullNameLdapMapper: string; private certLdapMapper = "certificate-ldap-mapper";
hcLdapAttMapper: string; private fullNameLdapMapper = "full-name-ldap-mapper";
hcLdapGroupMapper: string; private hcLdapAttMapper = "hardcoded-ldap-attribute-mapper";
// roleMapper: string; private hcLdapGroupMapper = "hardcoded-ldap-group-mapper";
// groupLdapMapper: string; // this.groupLdapMapper = "group-ldap-mapper";
// hcLdapRoleMapper string; // this.roleMapper = "role-ldap-mapper";
// this.hcLdapRoleMapper = "hardcoded-ldap-role-mapper";
groupName: string; private groupName = "my-mappers-group";
constructor() {
// KerberosSettingsRequired required input values
this.kerberosNameInput = "data-testid=kerberos-name";
this.kerberosRealmInput = "data-testid=kerberos-realm";
this.kerberosPrincipalInput = "data-testid=kerberos-principal";
this.kerberosKeytabInput = "data-testid=kerberos-keytab";
// LdapSettingsGeneral required input values
this.ldapNameInput = "data-testid=ldap-name";
this.ldapVendorInput = "#kc-vendor";
this.ldapVendorList = "#kc-vendor + ul";
// LdapSettingsConnection required input values
this.ldapConnectionUrlInput = "data-testid=ldap-connection-url";
this.ldapBindTypeInput = "#kc-bind-type";
this.ldapBindTypeList = "#kc-bind-type + ul";
this.ldapBindDnInput = "data-testid=ldap-bind-dn";
this.ldapBindCredsInput = "data-testid=ldap-bind-credentials";
// LdapSettingsSearching required input values
this.ldapUsersDnInput = "data-testid=ldap-users-dn";
this.ldapUserLdapAttInput = "data-testid=ldap-username-attribute";
this.ldapRdnLdapAttInput = "data-testid=ldap-rdn-attribute";
this.ldapUuidLdapAttInput = "data-testid=ldap-uuid-attribute";
this.ldapUserObjClassesInput = "data-testid=ldap-user-object-classes";
// SettingsCache input values
this.cacheDayInput = "#kc-eviction-day";
this.cacheDayList = "#kc-eviction-day + ul";
this.cacheHourInput = "#kc-eviction-hour";
this.cacheHourList = "#kc-eviction-hour + ul";
this.cacheMinuteInput = "#kc-eviction-minute";
this.cacheMinuteList = "#kc-eviction-minute + ul";
this.cachePolicyInput = "#kc-cache-policy";
this.cachePolicyList = "#kc-cache-policy + ul";
// Mapper required input values
this.userModelAttInput = "data-testid=mapper-userModelAttribute-fld";
this.ldapAttInput = "data-testid=mapper-ldapAttribute-fld";
this.userModelAttNameInput =
"data-testid=mapper-userModelAttributeName-fld";
this.attValueInput = "data-testid=mapper-attributeValue-fld";
this.ldapFullNameAttInput = "data-testid=mapper-fullNameAttribute-fld";
this.ldapAttNameInput = "data-testid=mapper-ldapAttributeName-fld";
this.ldapAttValueInput = "data-testid=mapper-ldapAttributeValue-fld";
this.groupInput = "data-testid=mapper-group-fld";
// mapper types
this.msadUserAcctMapper = "msad-user-account-control-mapper";
this.msadLdsUserAcctMapper = "msad-lds-user-account-control-mapper";
this.userAttLdapMapper = "user-attribute-ldap-mapper";
this.hcAttMapper = "hardcoded-attribute-mapper";
this.certLdapMapper = "certificate-ldap-mapper";
this.fullNameLdapMapper = "full-name-ldap-mapper";
this.hcLdapAttMapper = "hardcoded-ldap-attribute-mapper";
this.hcLdapGroupMapper = "hardcoded-ldap-group-mapper";
// this.groupLdapMapper = "group-ldap-mapper";
// this.roleMapper = "role-ldap-mapper";
// this.hcLdapRoleMapper = "hardcoded-ldap-role-mapper";
this.groupName = "my-mappers-group";
}
changeCacheTime(unit: string, time: string) { changeCacheTime(unit: string, time: string) {
switch (unit) { switch (unit) {
@ -172,7 +117,7 @@ export default class ProviderPage {
fillLdapRequiredGeneralData(name: string, vendor: string) { fillLdapRequiredGeneralData(name: string, vendor: string) {
if (name) { if (name) {
cy.get(`[${this.ldapNameInput}]`).type(name); cy.get(`[${this.ldapNameInput}]`).clear().type(name);
} }
if (vendor) { if (vendor) {
cy.get(this.ldapVendorInput).click(); cy.get(this.ldapVendorInput).click();

View file

@ -1,17 +1,10 @@
export default class ModalUtils { export default class ModalUtils {
modalTitle: string; private modalTitle = ".pf-c-modal-box .pf-c-modal-box__title-text";
modalMessage: string; private modalMessage = ".pf-c-modal-box .pf-c-modal-box__body";
confirmModalBtn: string;
cancelModalBtn: string;
closeModalBtn: string;
constructor() {
this.modalTitle = ".pf-c-modal-box .pf-c-modal-box__title-text";
this.modalMessage = ".pf-c-modal-box .pf-c-modal-box__body";
this.confirmModalBtn = "#modal-confirm"; private confirmModalBtn = "#modal-confirm";
this.cancelModalBtn = "#modal-cancel"; private cancelModalBtn = "#modal-cancel";
this.closeModalBtn = ".pf-c-modal-box .pf-m-plain"; private closeModalBtn = ".pf-c-modal-box .pf-m-plain";
}
confirmModal() { confirmModal() {
cy.get(this.confirmModalBtn).click(); cy.get(this.confirmModalBtn).click();