put assign and initialize into one line

This commit is contained in:
Erik Jan de Wit 2021-05-06 10:38:45 +02:00
parent 312927e3d2
commit f6357ccc7c
4 changed files with 71 additions and 151 deletions

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");

View file

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

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();