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 {
userNameInput: string;
passwordInput: string;
submitBtn: string;
errorText: string;
userDrpDwn: string;
oldLoadContainer: string;
loadContainer: string;
private userNameInput = "#username";
private passwordInput = "#password";
private submitBtn = "#kc-login";
private userDrpDwn = "#user-dropdown";
constructor() {
this.userNameInput = "#username";
this.passwordInput = "#password";
this.submitBtn = "#kc-login";
this.userDrpDwn = "#user-dropdown";
this.errorText = ".kc-feedback-text";
this.oldLoadContainer = "#loading";
this.loadContainer = "div.keycloak__loading-container";
}
private errorText = ".kc-feedback-text";
private oldLoadContainer = "#loading";
private loadContainer = "div.keycloak__loading-container";
isLogInPage() {
cy.get(this.userNameInput).should("exist");

View file

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

View file

@ -1,119 +1,64 @@
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
this.kerberosNameInput = "data-testid=kerberos-name";
this.kerberosRealmInput = "data-testid=kerberos-realm";
this.kerberosPrincipalInput = "data-testid=kerberos-principal";
this.kerberosKeytabInput = "data-testid=kerberos-keytab";
private kerberosNameInput = "data-testid=kerberos-name";
private kerberosRealmInput = "data-testid=kerberos-realm";
private kerberosPrincipalInput = "data-testid=kerberos-principal";
private kerberosKeytabInput = "data-testid=kerberos-keytab";
// LdapSettingsGeneral required input values
this.ldapNameInput = "data-testid=ldap-name";
this.ldapVendorInput = "#kc-vendor";
this.ldapVendorList = "#kc-vendor + ul";
private ldapNameInput = "data-testid=ldap-name";
private ldapVendorInput = "#kc-vendor";
private 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";
private ldapConnectionUrlInput = "data-testid=ldap-connection-url";
private ldapBindTypeInput = "#kc-bind-type";
private ldapBindTypeList = "#kc-bind-type + ul";
private ldapBindDnInput = "data-testid=ldap-bind-dn";
private 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";
private ldapUsersDnInput = "data-testid=ldap-users-dn";
private ldapUserLdapAttInput = "data-testid=ldap-username-attribute";
private ldapRdnLdapAttInput = "data-testid=ldap-rdn-attribute";
private ldapUuidLdapAttInput = "data-testid=ldap-uuid-attribute";
private 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";
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";
// Mapper required input values
this.userModelAttInput = "data-testid=mapper-userModelAttribute-fld";
this.ldapAttInput = "data-testid=mapper-ldapAttribute-fld";
this.userModelAttNameInput =
private userModelAttInput = "data-testid=mapper-userModelAttribute-fld";
private ldapAttInput = "data-testid=mapper-ldapAttribute-fld";
private 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";
private attValueInput = "data-testid=mapper-attributeValue-fld";
private ldapFullNameAttInput = "data-testid=mapper-fullNameAttribute-fld";
private ldapAttNameInput = "data-testid=mapper-ldapAttributeName-fld";
private ldapAttValueInput = "data-testid=mapper-ldapAttributeValue-fld";
private 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";
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";
// this.groupLdapMapper = "group-ldap-mapper";
// this.roleMapper = "role-ldap-mapper";
// this.hcLdapRoleMapper = "hardcoded-ldap-role-mapper";
this.groupName = "my-mappers-group";
}
private groupName = "my-mappers-group";
changeCacheTime(unit: string, time: string) {
switch (unit) {

View file

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