This commit is contained in:
Zeeshaun
2026-03-25 11:54:22 -05:00
parent 4d52ebc209
commit 883009770f
776 changed files with 86726 additions and 0 deletions
@@ -0,0 +1,12 @@
export enum TestingInputType {
TEXT, SELECT, CHECK, RADIO
}
export interface TestInputCommand {
fieldId: string;
fieldValue: any;
fieldType: TestingInputType;
}
export type TestInputSet = Array<TestInputCommand>;
@@ -0,0 +1,22 @@
export class PageDataTools {
public static readonly numbersList = '1234567890';
public static readonly alphabetList = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
public static createRandomEmail(startLength = 10, endLength = 10): string {
const begin = this.createRandomString(startLength);
const end = this.createRandomString(endLength);
const email = [begin, '@', end, '.com'];
return email.join('');
}
public static createRandomString(stringLength: number) {
const characters = this.alphabetList;
let result = '';
for (let j = stringLength; j > 0; --j) {
result += characters[Math.floor(Math.random() * characters.length)];
}
return result;
}
}
@@ -0,0 +1,87 @@
import { browser, by, element, ElementFinder, protractor, promise } from 'protractor';
import { TestingInputType, TestInputCommand, TestInputSet } from './data-driven/test-input-command';
export class PageObjectTools {
public static urlChanged(url): any {
return function () {
return browser.getCurrentUrl().then(function (actualUrl) {
return url !== actualUrl;
});
};
}
public static fillFields(dataSet: TestInputSet, prefix?: string): void {
dataSet.forEach((command: TestInputCommand) => {
PageObjectTools.executeTestInputCommand(command, prefix);
}, this);
}
static executeTestInputCommand(command: TestInputCommand, prefix?: string): any {
const fullId = prefix ? prefix + command.fieldId : command.fieldId;
const currentField = element(by.id(fullId));
if (!currentField || !currentField.isDisplayed()) {
throw new Error('Couldn\'t execute command, field not found: ' + fullId);
}
switch (command.fieldType) {
default:
throw new Error('You must specify a field type for field Id: ' + fullId);
case TestingInputType.TEXT:
currentField.sendKeys(command.fieldValue);
break;
case TestingInputType.SELECT:
PageObjectTools.selectDropDownField(currentField, command.fieldValue);
break;
case TestingInputType.CHECK:
PageObjectTools.clickCheckBox(currentField);
break;
case TestingInputType.RADIO:
PageObjectTools.selectRadioButton(currentField, command.fieldValue);
break;
}
}
public static findFieldsInPageByIdArray(fieldsIdSet: Array<string>, prefix?: string) {
let foundField = null;
const usedPrefix = prefix || '';
const allFields = [];
fieldsIdSet.forEach((fieldId, index) => {
foundField = element(by.id(usedPrefix + fieldId));
if (foundField) {
allFields.push(foundField);
}
});
return allFields;
}
public static selectDropDownField(elementFinder: ElementFinder, optionNumber: number) {
const desiredOption = elementFinder.all(by.tagName('option')).get(optionNumber);
const EC = protractor.ExpectedConditions;
browser.wait(EC.visibilityOf(desiredOption), 5000).then(() => {
desiredOption.click();
});
}
public static selectRadioButton(elementFinder: ElementFinder, optionNumber: number) {
const desiredOption = elementFinder.all(by.tagName('label')).get(optionNumber);
const EC = protractor.ExpectedConditions;
browser.wait(EC.visibilityOf(desiredOption), 5000).then(() => {
desiredOption.click();
});
}
static clickCheckBox(checkbox: ElementFinder) {
browser.executeScript('arguments[0].click();', checkbox.getWebElement());
}
public static getElementsIdField(fieldId: string, prefix?: string): any {
const firstElement = element( by.id( prefix ? prefix + fieldId : fieldId));
return firstElement.getAttribute( 'id' );
}
public static getFocusedElement(): any {
return browser.driver.switchTo().activeElement().getAttribute('id');
}
}
@@ -0,0 +1,88 @@
import { by, element, promise } from 'protractor';
import { PageObjectTools } from '../page-object-tools';
import { TestInputSet, TestingInputType } from '../data-driven/test-input-command';
export class CollateralPagePo {
public readonly ESTIMATED_VALUE = '-inputEstimatedValue';
public readonly PROPERTY_TYPE = '-inputPropertyType';
public readonly HAS_FIRST_MORTGAGE = 'inputFirstMortgage';
public readonly HAS_SECOND_MORTGAGE = 'inputSecondMortgage';
public readonly PAYOFF_FIRST_MORTGAGE = 'payoffFirstMortgage';
public readonly PAYOFF_SECOND_MORTGAGE = 'payoffSecondMortgage';
public readonly IS_SAME_ADDRESS = 'isAddressSame';
public readonly IS_BEING_IMPROVED = 'inputBeingImproved';
public readonly IS_LISTED_FOR_SALE = 'inputListedForSale';
// address information
public readonly ADDRESS_1 = '-inputAddress1';
public readonly ADDRESS_2 = '-inputAddress2';
public readonly CITY = '-inputCity';
public readonly STATE = '-inputState';
public readonly ZIP = '-inputZip';
public readonly OCCUPANCY_TYPE = '-inputOccupancyType';
public readonly NEXT_BUTTON = 'buttonNext';
public readonly ALL_FIELDS = [this.ESTIMATED_VALUE, this.PROPERTY_TYPE,
this.IS_SAME_ADDRESS, this.IS_BEING_IMPROVED, this.IS_LISTED_FOR_SALE, this.NEXT_BUTTON];
public readonly ADDRESS_FIELDS = [ this.OCCUPANCY_TYPE, this.ADDRESS_1, this.ADDRESS_2, this.CITY, this.STATE, this.ZIP];
public readonly LIEN_POSITION_FIELDS = [ this.HAS_FIRST_MORTGAGE, this.HAS_SECOND_MORTGAGE, this.PAYOFF_FIRST_MORTGAGE,this.PAYOFF_SECOND_MORTGAGE];
public readonly MINIMAL_DATA: TestInputSet = [
{ fieldId: this.IS_SAME_ADDRESS, fieldValue: 0, fieldType: TestingInputType.RADIO },
{ fieldId: this.IS_BEING_IMPROVED, fieldValue: 0, fieldType: TestingInputType.RADIO },
{ fieldId: this.IS_LISTED_FOR_SALE, fieldValue: 0, fieldType: TestingInputType.RADIO },
{ fieldId: this.ESTIMATED_VALUE, fieldValue: '12345', fieldType: TestingInputType.TEXT },
{ fieldId: this.PROPERTY_TYPE, fieldValue: 2, fieldType: TestingInputType.SELECT },
{ fieldId: this.HAS_FIRST_MORTGAGE, fieldValue: 0, fieldType: TestingInputType.RADIO },
{ fieldId: this.HAS_SECOND_MORTGAGE, fieldValue: 0, fieldType: TestingInputType.RADIO }
];
public readonly MAXIMUM_DATA: TestInputSet = [
{ fieldId: this.IS_SAME_ADDRESS, fieldValue: 1, fieldType: TestingInputType.RADIO },
{ fieldId: this.ADDRESS_1, fieldValue: '1000 South 8th Pl.', fieldType: TestingInputType.TEXT },
{ fieldId: this.CITY, fieldValue: 'Codeville', fieldType: TestingInputType.TEXT },
{ fieldId: this.STATE, fieldValue: 40, fieldType: TestingInputType.SELECT },
{ fieldId: this.ZIP, fieldValue: 53207, fieldType: TestingInputType.TEXT },
{ fieldId: this.IS_BEING_IMPROVED, fieldValue: 0, fieldType: TestingInputType.RADIO },
{ fieldId: this.IS_LISTED_FOR_SALE, fieldValue: 0, fieldType: TestingInputType.RADIO },
{ fieldId: this.OCCUPANCY_TYPE, fieldValue: 2, fieldType: TestingInputType.SELECT },
{ fieldId: this.ESTIMATED_VALUE, fieldValue: '12345', fieldType: TestingInputType.TEXT },
{ fieldId: this.PROPERTY_TYPE, fieldValue: 2, fieldType: TestingInputType.SELECT },
{ fieldId: this.HAS_FIRST_MORTGAGE, fieldValue: 0, fieldType: TestingInputType.RADIO },
{ fieldId: this.HAS_SECOND_MORTGAGE, fieldValue: 0, fieldType: TestingInputType.RADIO },
{ fieldId: this.PAYOFF_FIRST_MORTGAGE, fieldValue: 0, fieldType: TestingInputType.CHECK },
{ fieldId: this.PAYOFF_SECOND_MORTGAGE, fieldValue: 0, fieldType: TestingInputType.CHECK },
];
public canGoNext(): promise.Promise<boolean> {
const nextButton = element(by.id(this.NEXT_BUTTON));
if (nextButton) {
return nextButton.isEnabled();
}
throw new Error('Couldn\'t get next button');
}
public submit(): void {
const nextButton = element(by.id(this.NEXT_BUTTON));
nextButton.click();
}
public fillFieldsMinimal(): void {
PageObjectTools.fillFields(this.MINIMAL_DATA);
}
public fillFieldsMaximum(): void {
PageObjectTools.fillFields(this.MAXIMUM_DATA);
}
public getFocusedElement() {
return PageObjectTools.getFocusedElement();
}
public getFirstElement() {
// it focuses on the yes/no radio, not the overall input
return PageObjectTools.getElementsIdField('isSameYes');
}
}
@@ -0,0 +1,125 @@
import { browser, by, element, ElementFinder, protractor, promise } from 'protractor';
import { PageObjectTools } from '../page-object-tools';
import { PageDataTools } from '../page-data-tools';
import { TestInputSet, TestingInputType } from '../data-driven/test-input-command';
export class ContactPagePo {
public readonly FIRST_NAME = 'inputFirstName';
public readonly MIDDLE_INITIAL = 'inputMiddleInitial';
public readonly LAST_NAME = 'inputLastName';
public readonly DOB = 'inputDOB';
public readonly SUFFIX = 'inputSuffix';
public readonly SSN = 'inputSSN';
public readonly PRIMARY_PHONE = 'inputPrimaryPhoneNumber';
public readonly PRIMARY_PHONE_TYPE = 'inputPrimaryPhoneType';
public readonly SECONDARY_PHONE = 'inputSecondaryPhoneNumber';
public readonly SECONDARY_PHONE_TYPE = 'inputSecondaryPhoneType';
public readonly EMAIL = 'inputEmail';
public readonly MARITAL_STATUS = 'inputMaritalStatus';
public readonly CO_APPLICANT_SPOUSE = 'inputCoApplicantSpouse';
public readonly NEXT_BUTTON = 'buttonNext';
public readonly ALL_FIELDS = [
this.FIRST_NAME, this.MIDDLE_INITIAL, this.LAST_NAME, this.DOB, this.SUFFIX, this.SSN, this.PRIMARY_PHONE,
this.PRIMARY_PHONE_TYPE, this.SECONDARY_PHONE, this.SECONDARY_PHONE_TYPE, this.EMAIL, this.NEXT_BUTTON];
public readonly COAPP_FIELDS = [ ...this.ALL_FIELDS, this.MARITAL_STATUS, this.CO_APPLICANT_SPOUSE];
public readonly MINIMAL_DATA: TestInputSet = [
{ fieldId: this.FIRST_NAME, fieldValue: 'John', fieldType: TestingInputType.TEXT },
{ fieldId: this.MIDDLE_INITIAL, fieldValue: 'A', fieldType: TestingInputType.TEXT },
{ fieldId: this.LAST_NAME, fieldValue: 'DOE', fieldType: TestingInputType.TEXT },
{ fieldId: this.DOB, fieldValue: '01011999', fieldType: TestingInputType.TEXT },
{ fieldId: this.SSN, fieldValue: '111223333', fieldType: TestingInputType.TEXT },
{ fieldId: this.PRIMARY_PHONE, fieldValue: '8475551234', fieldType: TestingInputType.TEXT },
{ fieldId: this.EMAIL, fieldValue: PageDataTools.createRandomEmail(), fieldType: TestingInputType.TEXT },
{ fieldId: this.MARITAL_STATUS, fieldValue: 1, fieldType: TestingInputType.RADIO }
];
public readonly MINIMAL_DATA_NO_MARITAL: TestInputSet = [
{ fieldId: this.FIRST_NAME, fieldValue: 'John', fieldType: TestingInputType.TEXT },
{ fieldId: this.MIDDLE_INITIAL, fieldValue: 'A', fieldType: TestingInputType.TEXT },
{ fieldId: this.LAST_NAME, fieldValue: 'DOE', fieldType: TestingInputType.TEXT },
{ fieldId: this.DOB, fieldValue: '01011999', fieldType: TestingInputType.TEXT },
{ fieldId: this.SSN, fieldValue: '111223333', fieldType: TestingInputType.TEXT },
{ fieldId: this.PRIMARY_PHONE, fieldValue: '8475551234', fieldType: TestingInputType.TEXT },
{ fieldId: this.EMAIL, fieldValue: PageDataTools.createRandomEmail(), fieldType: TestingInputType.TEXT }
];
public readonly MAXIMUM_DATA: TestInputSet = [
...this.MINIMAL_DATA,
{ fieldId: this.SUFFIX, fieldValue: 2, fieldType: TestingInputType.SELECT },
{ fieldId: this.PRIMARY_PHONE_TYPE, fieldValue: 1, fieldType: TestingInputType.RADIO },
{ fieldId: this.SECONDARY_PHONE, fieldValue: '8475561234', fieldType: TestingInputType.TEXT },
{ fieldId: this.SECONDARY_PHONE_TYPE, fieldValue: 0, fieldType: TestingInputType.RADIO }
];
public readonly MAXIMUM_COAPP_DATA: TestInputSet = [
{ fieldId: this.FIRST_NAME, fieldValue: 'Jane', fieldType: TestingInputType.TEXT },
{ fieldId: this.MIDDLE_INITIAL, fieldValue: 'B', fieldType: TestingInputType.TEXT },
{ fieldId: this.LAST_NAME, fieldValue: 'DOE', fieldType: TestingInputType.TEXT },
{ fieldId: this.DOB, fieldValue: '02021998', fieldType: TestingInputType.TEXT },
{ fieldId: this.SUFFIX, fieldValue: 2, fieldType: TestingInputType.SELECT },
{ fieldId: this.SSN, fieldValue: '333223333', fieldType: TestingInputType.TEXT },
{ fieldId: this.PRIMARY_PHONE, fieldValue: '8475554321', fieldType: TestingInputType.TEXT },
{ fieldId: this.EMAIL, fieldValue: PageDataTools.createRandomEmail(), fieldType: TestingInputType.TEXT },
{ fieldId: this.PRIMARY_PHONE_TYPE, fieldValue: 1, fieldType: TestingInputType.RADIO },
{ fieldId: this.SECONDARY_PHONE, fieldValue: '8475564321', fieldType: TestingInputType.TEXT },
{ fieldId: this.SECONDARY_PHONE_TYPE, fieldValue: 0, fieldType: TestingInputType.RADIO },
{ fieldId: this.MARITAL_STATUS, fieldValue: 0, fieldType: TestingInputType.RADIO }
];
public readonly MAXIMUM_COAPP_DATA_PRIMARY: TestInputSet = [
...this.MAXIMUM_COAPP_DATA,
{ fieldId: this.CO_APPLICANT_SPOUSE, fieldValue: 0, fieldType: TestingInputType.RADIO }
];
public readonly MAXIMUM_PRIMARY_NOT_MARRIED_TO_COAPP: TestInputSet = [
...this.MAXIMUM_COAPP_DATA,
{ fieldId: this.CO_APPLICANT_SPOUSE, fieldValue: 1, fieldType: TestingInputType.RADIO }
];
public canGoNext(): promise.Promise<boolean> {
const nextButton = element(by.id(this.NEXT_BUTTON));
if (nextButton) {
return nextButton.isEnabled();
}
throw new Error('Couldn\'t get next button');
}
public submit(): void {
const nextButton = element(by.id(this.NEXT_BUTTON));
nextButton.click();
}
public fillFieldsMinimal(): void {
PageObjectTools.fillFields(this.MINIMAL_DATA);
}
public fillFieldsMinimalNoMarital(): void {
PageObjectTools.fillFields(this.MINIMAL_DATA_NO_MARITAL);
}
public fillFieldsMaximum(): void {
PageObjectTools.fillFields(this.MAXIMUM_DATA);
}
public fillFieldsMaximumCoApplicant(): void {
PageObjectTools.fillFields(this.MAXIMUM_COAPP_DATA_PRIMARY);
}
public fillFieldsMaximumCoApplicantNonPrimary(): void {
PageObjectTools.fillFields(this.MAXIMUM_COAPP_DATA);
}
public fillFieldsPrimaryMarriedButNotMarriedToCoApplicant(): void {
PageObjectTools.fillFields(this.MAXIMUM_PRIMARY_NOT_MARRIED_TO_COAPP);
}
public getFocusedElement() {
return PageObjectTools.getFocusedElement();
}
public getFirstElement(prefix?: string) {
return PageObjectTools.getElementsIdField(this.FIRST_NAME, prefix);
}
}
@@ -0,0 +1,137 @@
import { browser, by, element, ElementFinder, protractor, promise } from 'protractor';
import { PageObjectTools } from '../page-object-tools';
import { TestingInputType, TestInputSet } from '../data-driven/test-input-command';
export class EmploymentPagePo {
public readonly DEFAULT_PREFIX = '';
public readonly PRIOR0_PREFIX = 'priorEmployer0-';
public readonly EMPLOYMENT_INDICATED = 'hasEmploymentIncome0';
public readonly OTHER_INCOME_INDICATED = 'hasOtherIncome0';
public readonly IS_PAYING_CHILD_SUPPORT = 'isPayingChildSupport';
public readonly EMPLOYER_NAME = 'inputEmployerName';
public readonly JOB_TITLE = 'inputJobTitle';
public readonly SALARY = 'inputSalary';
public readonly OTHER_INCOME = 'inputOtherAnnualIncome';
public readonly OTHER_INCOME_SOURCE = 'inputOtherAnnualIncomeSource';
public readonly WORK_PHONE = 'inputWorkPhoneNumber';
public readonly EMPLOYMENT_TYPE = 'inputEmploymentType';
public readonly SCHEDULE = 'inputSchedule';
public readonly EMPLOYMENT_LENGTH_YEARS = 'inputEmploymentLengthYears';
public readonly EMPLOYMENT_LENGTH_MONTHS = 'inputEmploymentLengthMonths';
public readonly CHILD_SUPPORT_AMOUNT = 'inputChildSupportAmount';
public readonly WEEKLY_HOURS = 'inputWeeklyHours';
public readonly NEXT_BUTTON = 'buttonNext';
public readonly STARTING_FIELDS = [this.EMPLOYMENT_INDICATED, this.OTHER_INCOME_INDICATED, this.IS_PAYING_CHILD_SUPPORT];
public readonly EMPLOYMENT_FIELDS = [
this.EMPLOYER_NAME, this.JOB_TITLE, this.SALARY, this.WORK_PHONE, this.EMPLOYMENT_TYPE, this.SCHEDULE,
this.EMPLOYMENT_LENGTH_YEARS, this.EMPLOYMENT_LENGTH_MONTHS];
public readonly MINIMAL_DATA: TestInputSet = [
{ fieldId: this.EMPLOYER_NAME, fieldValue: 'Acme Packaging', fieldType: TestingInputType.TEXT },
{ fieldId: this.JOB_TITLE, fieldValue: 'Acme Packer', fieldType: TestingInputType.TEXT },
{ fieldId: this.SALARY, fieldValue: 30000, fieldType: TestingInputType.TEXT },
{ fieldId: this.EMPLOYMENT_TYPE, fieldValue: 1, fieldType: TestingInputType.SELECT },
{ fieldId: this.SCHEDULE, fieldValue: 1, fieldType: TestingInputType.RADIO },
{ fieldId: this.EMPLOYMENT_LENGTH_YEARS, fieldValue: 3, fieldType: TestingInputType.SELECT },
{ fieldId: this.EMPLOYMENT_LENGTH_MONTHS, fieldValue: 2, fieldType: TestingInputType.SELECT }
];
public readonly SECOND_INCOME_DATA: TestInputSet = [
{ fieldId: this.EMPLOYER_NAME, fieldValue: 'Acme Delivery', fieldType: TestingInputType.TEXT },
{ fieldId: this.JOB_TITLE, fieldValue: 'Delivery Driver', fieldType: TestingInputType.TEXT },
{ fieldId: this.SALARY, fieldValue: 15, fieldType: TestingInputType.TEXT },
{ fieldId: this.EMPLOYMENT_TYPE, fieldValue: 1, fieldType: TestingInputType.SELECT },
{ fieldId: this.SCHEDULE, fieldValue: 1, fieldType: TestingInputType.RADIO },
{ fieldId: this.EMPLOYMENT_LENGTH_YEARS, fieldValue: 3, fieldType: TestingInputType.SELECT },
{ fieldId: this.EMPLOYMENT_LENGTH_MONTHS, fieldValue: 2, fieldType: TestingInputType.SELECT }
];
public readonly MAXIMUM_DATA: TestInputSet = [
...this.MINIMAL_DATA,
{ fieldId: this.WORK_PHONE, fieldValue: 4148765309, fieldType: TestingInputType.TEXT },
];
public readonly OTHER_INCOME_DATA: TestInputSet = [
{ fieldId: this.OTHER_INCOME, fieldValue: 20000, fieldType: TestingInputType.TEXT },
{ fieldId: this.OTHER_INCOME_SOURCE, fieldValue: 'Stuff1', fieldType: TestingInputType.TEXT }
];
public readonly CHILD_SUPPORT_DATA: TestInputSet = [
{ fieldId: this.CHILD_SUPPORT_AMOUNT, fieldValue: 200, fieldType: TestingInputType.TEXT }
];
// Page hides everything by default
public showEmploymentFields(): void {
const showEmployment = element(by.id(this.EMPLOYMENT_INDICATED));
PageObjectTools.clickCheckBox(showEmployment);
}
public showOtherIncomeFields(): void {
const showOtherIncomeOne = element(by.id(this.OTHER_INCOME_INDICATED));
PageObjectTools.clickCheckBox(showOtherIncomeOne);
}
public toggleOtherIncomeGroupOne(): void {
const showOtherIncomeOne = element(by.id(this.OTHER_INCOME_INDICATED));
PageObjectTools.clickCheckBox(showOtherIncomeOne);
}
public clearOtherIncomeGroupOne(): void {
const clearOtherIncomeOneSource = element(by.id(this.OTHER_INCOME_SOURCE));
const clearOtherIncomeOne = element(by.id(this.OTHER_INCOME));
clearOtherIncomeOneSource.clear();
clearOtherIncomeOne.clear();
}
public showChildSupportFields(): void {
const showChildSupport = element(by.id(this.IS_PAYING_CHILD_SUPPORT));
PageObjectTools.clickCheckBox(showChildSupport);
}
public canGoNext(): promise.Promise<boolean> {
const nextButton = element(by.id(this.NEXT_BUTTON));
if (nextButton) {
return nextButton.isEnabled();
}
throw new Error('Couldn\'t get next button');
}
public submit(): void {
const nextButton = element(by.id(this.NEXT_BUTTON));
nextButton.click();
}
public fillFieldsMinimal(): void {
PageObjectTools.fillFields(this.MINIMAL_DATA, this.DEFAULT_PREFIX);
}
public fillFieldsMaximum(): void {
PageObjectTools.fillFields(this.MAXIMUM_DATA, this.DEFAULT_PREFIX);
}
public fillChildSupportFields(): void {
PageObjectTools.fillFields(this.CHILD_SUPPORT_DATA);
}
public fillOtherIncomeFields(): void {
PageObjectTools.fillFields(this.OTHER_INCOME_DATA);
}
/**
* Please note, this may need to be adjusted to match the current required employment length.
* As of 09/14/18, this isn't called...
*/
public markSingleIncomeNotEnough(): void {
PageObjectTools.executeTestInputCommand(
{ fieldId: this.EMPLOYMENT_LENGTH_YEARS, fieldValue: 1, fieldType: TestingInputType.SELECT }, this.DEFAULT_PREFIX);
}
public fillSecondIncome(): void {
PageObjectTools.fillFields(this.SECOND_INCOME_DATA, this.PRIOR0_PREFIX);
}
}
@@ -0,0 +1,122 @@
import { by, element, promise } from 'protractor';
import { PageObjectTools } from '../page-object-tools';
import { TestInputSet, TestingInputType } from '../data-driven/test-input-command';
export class HmdaPagePo {
public readonly DEFAULT_PREFIX = 'applicant-';
// race information
public readonly AMERICAN_INDIAN_ALASKA_NATIVE = 'inputAmericanIndianAlaskaNative';
public readonly AMERICAN_INDIAN_ALASKA_NATIVE_TEXT = 'inputAmericanIndianAlaskaNativeText';
public readonly BLACK_OR_AFRICAN_AMERICAN = 'inputBlackOrAfricanAmerican';
public readonly ASIAN = 'inputAsian';
public readonly ASIAN_INDIAN = 'inputAsianIndian';
public readonly CHINESE = 'inputChinese';
public readonly FILIPINO = 'inputFilipino';
public readonly JAPANESE = 'inputJapanese';
public readonly KOREAN = 'inputKorean';
public readonly VIETNAMESE = 'inputVietnamese';
public readonly OTHER_ASIAN = 'inputOtherAsian';
public readonly OTHER_ASIAN_TEXT = 'inputOtherAsianText';
public readonly HAWAIIAN = 'inputHawaiian';
public readonly NATIVE_HAWAIIAN = 'inputNativeHawaiian';
public readonly GUAMANIAN_CHAMORRO = 'inputNativeGuamanianChamorro';
public readonly SAMOAN = 'inputNativeSamoan';
public readonly OTHER_PACIFIC_ISLANDER = 'inputOtherPacificIslander';
public readonly OTHER_PACIFIC_ISLANDER_TEXT = 'inputOtherPacificIslanderText';
public readonly WHITE = 'inputWhite';
public readonly RACE_DID_NOT_PROVIDE = 'inputRaceDidNotProvide';
// ethnicity information
public readonly HISPANIC_OR_LATINO = 'inputHispanicOrLatino';
public readonly MEXICAN = 'inputMexican';
public readonly PUERTO_RICAN = 'inputPuertoRican';
public readonly CUBAN = 'inputCuban';
public readonly OTHER_HISPANIC_LATINO = 'inputOtherHispanicLatino';
public readonly OTHER_HISPANIC_LATINO_TEXT = 'inputOtherHispanicLatinoText';
public readonly NOT_HISPANIC_OR_LATINO = 'inputNotHispanicOrLatino';
public readonly ETHNICITY_DID_NOT_PROVIDE = 'inputEthnicityDidNotProvide';
// gender information
public readonly FEMALE = 'inputFemale';
public readonly MALE = 'inputMale';
public readonly GENDER_DID_NOT_PROVIDE = 'inputGenderDidNotProvide';
public readonly NEXT_BUTTON = 'buttonNext';
public readonly GENDER_FIELDS = [
this.MALE, this.FEMALE, this.GENDER_DID_NOT_PROVIDE
];
public readonly RACE_FIELDS = [
this.AMERICAN_INDIAN_ALASKA_NATIVE, this.AMERICAN_INDIAN_ALASKA_NATIVE_TEXT, this.BLACK_OR_AFRICAN_AMERICAN, this.ASIAN,
this.ASIAN_INDIAN, this.CHINESE, this.FILIPINO, this.JAPANESE, this.KOREAN, this.VIETNAMESE, this.OTHER_ASIAN, this.OTHER_ASIAN_TEXT,
this.HAWAIIAN, this.NATIVE_HAWAIIAN, this.GUAMANIAN_CHAMORRO, this.SAMOAN, this.OTHER_PACIFIC_ISLANDER,
this.WHITE, this.RACE_DID_NOT_PROVIDE
];
public readonly ETHNICITY_FIELDS = [
this.HISPANIC_OR_LATINO, this.MEXICAN, this.PUERTO_RICAN, this.CUBAN, this.OTHER_HISPANIC_LATINO,
this.OTHER_HISPANIC_LATINO_TEXT, this.NOT_HISPANIC_OR_LATINO, this.ETHNICITY_DID_NOT_PROVIDE,
];
public readonly ALL_FIELDS = [
...this.RACE_FIELDS, ...this.GENDER_FIELDS, ...this.ETHNICITY_FIELDS, this.NEXT_BUTTON
];
public readonly MINIMAL_DATA: TestInputSet = [
{ fieldId: this.RACE_DID_NOT_PROVIDE, fieldValue: 1, fieldType: TestingInputType.CHECK },
{ fieldId: this.ETHNICITY_DID_NOT_PROVIDE, fieldValue: 1, fieldType: TestingInputType.CHECK },
{ fieldId: this.GENDER_DID_NOT_PROVIDE, fieldValue: 1, fieldType: TestingInputType.CHECK }
];
public readonly MAXIMUM_DATA: TestInputSet = [
...this.MINIMAL_DATA,
{ fieldId: this.AMERICAN_INDIAN_ALASKA_NATIVE, fieldValue: 1, fieldType: TestingInputType.CHECK },
{ fieldId: this.AMERICAN_INDIAN_ALASKA_NATIVE_TEXT, fieldValue: 'Enrolled principal or tribe', fieldType: TestingInputType.TEXT },
{ fieldId: this.BLACK_OR_AFRICAN_AMERICAN, fieldValue: 1, fieldType: TestingInputType.CHECK },
{ fieldId: this.ASIAN, fieldValue: 1, fieldType: TestingInputType.CHECK },
{ fieldId: this.ASIAN_INDIAN, fieldValue: 1, fieldType: TestingInputType.CHECK },
{ fieldId: this.CHINESE, fieldValue: 1, fieldType: TestingInputType.CHECK },
{ fieldId: this.FILIPINO, fieldValue: 1, fieldType: TestingInputType.CHECK },
{ fieldId: this.JAPANESE, fieldValue: 1, fieldType: TestingInputType.CHECK },
{ fieldId: this.KOREAN, fieldValue: 1, fieldType: TestingInputType.CHECK },
{ fieldId: this.VIETNAMESE, fieldValue: 1, fieldType: TestingInputType.CHECK },
{ fieldId: this.OTHER_ASIAN, fieldValue: 1, fieldType: TestingInputType.CHECK },
{ fieldId: this.OTHER_ASIAN_TEXT, fieldValue: 'Hmong, Laotian, Thai,Pakistani, Cambodian', fieldType: TestingInputType.TEXT },
{ fieldId: this.HAWAIIAN, fieldValue: 1, fieldType: TestingInputType.CHECK },
{ fieldId: this.NATIVE_HAWAIIAN, fieldValue: 1, fieldType: TestingInputType.CHECK },
{ fieldId: this.GUAMANIAN_CHAMORRO, fieldValue: 1, fieldType: TestingInputType.CHECK },
{ fieldId: this.SAMOAN, fieldValue: 1, fieldType: TestingInputType.CHECK },
{ fieldId: this.OTHER_PACIFIC_ISLANDER, fieldValue: 1, fieldType: TestingInputType.CHECK },
{ fieldId: this.OTHER_PACIFIC_ISLANDER_TEXT, fieldValue: 'Fijian, Tongan', fieldType: TestingInputType.TEXT },
{ fieldId: this.WHITE, fieldValue: 1, fieldType: TestingInputType.CHECK },
{ fieldId: this.HISPANIC_OR_LATINO, fieldValue: 1, fieldType: TestingInputType.CHECK },
{ fieldId: this.MEXICAN, fieldValue: 1, fieldType: TestingInputType.CHECK },
{ fieldId: this.PUERTO_RICAN, fieldValue: 1, fieldType: TestingInputType.CHECK },
{ fieldId: this.CUBAN, fieldValue: 1, fieldType: TestingInputType.CHECK },
{ fieldId: this.OTHER_HISPANIC_LATINO, fieldValue: 1, fieldType: TestingInputType.CHECK },
{ fieldId: this.OTHER_HISPANIC_LATINO_TEXT, fieldValue: 'Argentinean,Colombian, Dominican', fieldType: TestingInputType.TEXT },
{ fieldId: this.NOT_HISPANIC_OR_LATINO, fieldValue: 1, fieldType: TestingInputType.CHECK },
{ fieldId: this.MALE, fieldValue: 1, fieldType: TestingInputType.CHECK },
];
public canGoNext(): promise.Promise<boolean> {
const nextButton = element(by.id(this.NEXT_BUTTON));
if (nextButton) {
return nextButton.isEnabled();
}
throw new Error('Couldn\'t get next button');
}
public submit(): void {
const nextButton = element(by.id(this.NEXT_BUTTON));
nextButton.click();
}
public fillFieldsMinimal(): void {
PageObjectTools.fillFields(this.MINIMAL_DATA , this.DEFAULT_PREFIX);
}
public fillFieldsMaximum(): void {
PageObjectTools.fillFields(this.MAXIMUM_DATA , this.DEFAULT_PREFIX);
}
}
@@ -0,0 +1,143 @@
import { browser, by, element, ElementFinder, protractor, promise } from 'protractor';
import { PageObjectTools } from '../page-object-tools';
import { TestingInputType, TestInputSet } from '../data-driven/test-input-command';
export class ResidencePagePo {
public readonly DEFAULT_PREFIX = 'addressInfo-';
public readonly MAILING_PREFIX = 'mailingInfo-';
public readonly PRIOR_PREFIX = '0-';
public readonly COAPP_PREFIX = '-';
public readonly ADDRESS_LINE_1 = 'inputAddress1';
public readonly ADDRESS_LINE_2 = 'inputAddress2';
public readonly CITY = 'inputCity';
public readonly STATE = 'inputState';
public readonly ZIP = 'inputZip';
public readonly RESIDENCE_STATUS = 'inputResidenceStatus';
public readonly RESIDENCE_MONTHLY_PAYMENT = 'inputResidenceMonthlyPayment';
public readonly RESIDENCE_TIME_YEARS = 'inputResidenceTimeYears';
public readonly RESIDENCE_TIME_MONTHS = 'inputResidenceTimeMonths';
public readonly MAILING_SAME = 'isMailingSameYes';
public readonly IS_ADDRESS_SAME = 'isAddressSame';
public readonly NEXT_BUTTON = 'buttonNext';
public readonly ALL_FIELDS = [
this.ADDRESS_LINE_1, this.ADDRESS_LINE_2, this.CITY, this.STATE, this.ZIP, this.RESIDENCE_STATUS,
this.RESIDENCE_MONTHLY_PAYMENT, this.RESIDENCE_TIME_YEARS, this.RESIDENCE_TIME_MONTHS, this.MAILING_SAME
];
public readonly MAILING_FIELDS = [
this.ADDRESS_LINE_1, this.ADDRESS_LINE_2, this.CITY, this.STATE, this.ZIP
];
public readonly COAPP_FIELDS = [
...this.ALL_FIELDS
];
public readonly MINIMAL_DATA: TestInputSet = [
{ fieldId: this.ADDRESS_LINE_1, fieldValue: '999 South 8th Pl.', fieldType: TestingInputType.TEXT },
{ fieldId: this.CITY, fieldValue: 'Codeville', fieldType: TestingInputType.TEXT },
{ fieldId: this.STATE, fieldValue: 40, fieldType: TestingInputType.SELECT },
{ fieldId: this.ZIP, fieldValue: 53207, fieldType: TestingInputType.TEXT },
{ fieldId: this.RESIDENCE_MONTHLY_PAYMENT, fieldValue: 1500, fieldType: TestingInputType.TEXT },
{ fieldId: this.RESIDENCE_STATUS, fieldValue: 2, fieldType: TestingInputType.SELECT },
{ fieldId: this.RESIDENCE_TIME_YEARS, fieldValue: 4, fieldType: TestingInputType.SELECT },
{ fieldId: this.RESIDENCE_TIME_MONTHS, fieldValue: 4, fieldType: TestingInputType.SELECT }
];
public readonly MINIMAL_DATA_IN_WI: TestInputSet = [
{ fieldId: this.ADDRESS_LINE_1, fieldValue: '999 South 8th Pl.', fieldType: TestingInputType.TEXT },
{ fieldId: this.CITY, fieldValue: 'Codeville', fieldType: TestingInputType.TEXT },
{ fieldId: this.ZIP, fieldValue: 53207, fieldType: TestingInputType.TEXT },
{ fieldId: this.RESIDENCE_MONTHLY_PAYMENT, fieldValue: 1500, fieldType: TestingInputType.TEXT },
{ fieldId: this.RESIDENCE_STATUS, fieldValue: 2, fieldType: TestingInputType.SELECT },
{ fieldId: this.RESIDENCE_TIME_YEARS, fieldValue: 4, fieldType: TestingInputType.SELECT },
{ fieldId: this.RESIDENCE_TIME_MONTHS, fieldValue: 4, fieldType: TestingInputType.SELECT }
];
public readonly MAXIMUM_DATA: TestInputSet = [
{ fieldId: this.ADDRESS_LINE_1, fieldValue: '1000 South 8th Pl.', fieldType: TestingInputType.TEXT },
{ fieldId: this.CITY, fieldValue: 'Codeville', fieldType: TestingInputType.TEXT },
{ fieldId: this.STATE, fieldValue: 40, fieldType: TestingInputType.SELECT },
{ fieldId: this.ZIP, fieldValue: 53207, fieldType: TestingInputType.TEXT },
{ fieldId: this.RESIDENCE_MONTHLY_PAYMENT, fieldValue: 1500, fieldType: TestingInputType.TEXT },
{ fieldId: this.RESIDENCE_STATUS, fieldValue: 2, fieldType: TestingInputType.SELECT },
{ fieldId: this.RESIDENCE_TIME_YEARS, fieldValue: 2, fieldType: TestingInputType.SELECT },
{ fieldId: this.RESIDENCE_TIME_MONTHS, fieldValue: 2, fieldType: TestingInputType.SELECT }
];
public readonly MAILING_DATA: TestInputSet = [
{ fieldId: this.ADDRESS_LINE_1, fieldValue: '111 North 7th St.', fieldType: TestingInputType.TEXT },
{ fieldId: this.CITY, fieldValue: 'Codeville', fieldType: TestingInputType.TEXT },
{ fieldId: this.STATE, fieldValue: 40, fieldType: TestingInputType.SELECT },
{ fieldId: this.ZIP, fieldValue: 53215, fieldType: TestingInputType.TEXT }
];
public readonly PRIOR_RESIDENCE_DATA: TestInputSet = [
{ fieldId: this.ADDRESS_LINE_1, fieldValue: '1000 South 8th Pl.', fieldType: TestingInputType.TEXT },
{ fieldId: this.CITY, fieldValue: 'Codeville', fieldType: TestingInputType.TEXT },
{ fieldId: this.STATE, fieldValue: 40, fieldType: TestingInputType.SELECT },
{ fieldId: this.ZIP, fieldValue: 53207, fieldType: TestingInputType.TEXT },
{ fieldId: this.RESIDENCE_STATUS, fieldValue: 2, fieldType: TestingInputType.SELECT },
{ fieldId: this.RESIDENCE_TIME_YEARS, fieldValue: 2, fieldType: TestingInputType.SELECT },
{ fieldId: this.RESIDENCE_TIME_MONTHS, fieldValue: 2, fieldType: TestingInputType.SELECT }
];
public canGoNext(): promise.Promise<boolean> {
const nextButton = element(by.id(this.NEXT_BUTTON));
if (nextButton) {
return nextButton.isEnabled();
}
throw new Error('Couldn\'t get next button');
}
public submit(): void {
const nextButton = element(by.id(this.NEXT_BUTTON));
nextButton.click();
}
public fillFieldsMinimal(): void {
PageObjectTools.fillFields(this.MINIMAL_DATA, this.DEFAULT_PREFIX);
}
public showMailingAddress(): void {
const mailingIsSameCheck = element(by.id(this.DEFAULT_PREFIX + this.MAILING_SAME));
PageObjectTools.clickCheckBox(mailingIsSameCheck);
}
public showSecondAddress(): void {
PageObjectTools.executeTestInputCommand(
{ fieldId: this.RESIDENCE_TIME_YEARS, fieldValue: 2, fieldType: TestingInputType.SELECT }, this.DEFAULT_PREFIX);
}
public markAddressNotSame(): void {
PageObjectTools.executeTestInputCommand(
{ fieldId: this.IS_ADDRESS_SAME, fieldValue: 1, fieldType: TestingInputType.RADIO });
}
public markAddressSame(): void {
PageObjectTools.executeTestInputCommand(
{ fieldId: this.IS_ADDRESS_SAME, fieldValue: 0, fieldType: TestingInputType.RADIO });
}
public fillFieldsCoApplicant(): void {
PageObjectTools.fillFields(this.MAILING_DATA, this.COAPP_PREFIX);
}
public fillAdditionalFieldsMaximum(): void {
PageObjectTools.fillFields(this.PRIOR_RESIDENCE_DATA, this.PRIOR_PREFIX);
PageObjectTools.fillFields(this.MAILING_DATA, this.MAILING_PREFIX);
}
public fillFieldsMinimalLivingInWI(): void {
PageObjectTools.fillFields(this.MINIMAL_DATA_IN_WI, this.DEFAULT_PREFIX);
}
public getFocusedElement() {
return PageObjectTools.getFocusedElement();
}
public getFirstElement(prefix?: string) {
return PageObjectTools.getElementsIdField(this.ADDRESS_LINE_1, prefix);
}
}
@@ -0,0 +1,41 @@
import { by, element, promise } from 'protractor';
import { PageObjectTools } from '../page-object-tools';
import { TestingInputType, TestInputSet } from '../data-driven/test-input-command';
export class SpouseTypePagePo {
public readonly IS_FULL_INFO_SPOUSE = 'inputIsFullInfoSpouse';
public readonly NEXT_BUTTON = 'buttonNext';
public readonly STARTING_FIELDS = [this.IS_FULL_INFO_SPOUSE];
public readonly FULL_INFO_SPOUSE_DATA: TestInputSet = [
{ fieldId: this.IS_FULL_INFO_SPOUSE, fieldValue: 0, fieldType: TestingInputType.RADIO }
];
public readonly TATTLE_SPOUSE_DATA: TestInputSet = [
{ fieldId: this.IS_FULL_INFO_SPOUSE, fieldValue: 1, fieldType: TestingInputType.RADIO }
];
public canGoNext(): promise.Promise<boolean> {
const nextButton = element(by.id(this.NEXT_BUTTON));
if (nextButton) {
return nextButton.isEnabled();
}
throw new Error('Couldn\'t get next button');
}
public submit(): void {
const nextButton = element(by.id(this.NEXT_BUTTON));
nextButton.click();
}
public fillFieldsFullInfoSpouse(): void {
PageObjectTools.fillFields(this.FULL_INFO_SPOUSE_DATA);
}
public fillFieldsTattleSpouse(): void {
PageObjectTools.fillFields(this.TATTLE_SPOUSE_DATA);
}
}
@@ -0,0 +1,34 @@
import { browser, by, element, ElementFinder, protractor, promise } from 'protractor';
import { PageObjectTools } from '../page-object-tools';
import { PageDataTools } from '../page-data-tools';
import { TestInputSet, TestingInputType } from '../data-driven/test-input-command';
export class SummaryPagePo {
public readonly NEXT_BUTTON = 'buttonNext';
public readonly NOTE_FIELD = 'inputNote';
public readonly PRIMARY_CONTACT = 'inputContact';
public readonly PROMO_CODE = 'inputPromoCode';
public readonly ALL_FIELDS = [this.NOTE_FIELD, this.NEXT_BUTTON];
public readonly MINIMAL_DATA: TestInputSet = [
{ fieldId: this.PRIMARY_CONTACT, fieldValue: 1, fieldType: TestingInputType.SELECT },
];
public canGoNext(): promise.Promise<boolean> {
const nextButton = element(by.id(this.NEXT_BUTTON));
if (nextButton) {
return nextButton.isEnabled();
}
throw new Error('Couldn\'t get next button');
}
public submit(): void {
const nextButton = element(by.id(this.NEXT_BUTTON));
nextButton.click();
}
public fillFieldsMinimal(): void {
PageObjectTools.fillFields(this.MINIMAL_DATA);
}
}
@@ -0,0 +1,75 @@
import { browser, by, element, ElementFinder, protractor, promise } from 'protractor';
import { PageObjectTools } from '../page-object-tools';
import { TestingInputType, TestInputSet } from '../data-driven/test-input-command';
export class TattleSpousePagePo {
public readonly FIRST_NAME = 'inputFirstName';
public readonly MIDDLE_INITIAL = 'inputMiddleInitial';
public readonly LAST_NAME = 'inputLastName';
public readonly ADDRESS_LINE_1 = 'inputAddress1';
public readonly ADDRESS_LINE_2 = 'inputAddress2';
public readonly CITY = 'inputCity';
public readonly STATE = 'inputState';
public readonly ZIP = 'inputZip';
public readonly IS_ADDRESS_SAME = 'isAddressSame';
public readonly NEXT_BUTTON = 'buttonNext';
public readonly ALL_FIELDS = [
this.ADDRESS_LINE_1, this.ADDRESS_LINE_2, this.CITY, this.STATE, this.ZIP, this.IS_ADDRESS_SAME,
this.FIRST_NAME, this.MIDDLE_INITIAL, this.LAST_NAME
];
public readonly MAILING_FIELDS = [
this.ADDRESS_LINE_1, this.ADDRESS_LINE_2, this.CITY, this.STATE, this.ZIP
];
public readonly MINIMAL_DATA: TestInputSet = [
{ fieldId: this.FIRST_NAME, fieldValue: 'Bob', fieldType: TestingInputType.TEXT },
{ fieldId: this.MIDDLE_INITIAL, fieldValue: 'B', fieldType: TestingInputType.TEXT },
{ fieldId: this.LAST_NAME, fieldValue: 'Uecker', fieldType: TestingInputType.TEXT },
{ fieldId: this.IS_ADDRESS_SAME, fieldValue: 0, fieldType: TestingInputType.RADIO }
];
public readonly MAXIMUM_DATA: TestInputSet = [
{ fieldId: this.FIRST_NAME, fieldValue: 'Bob', fieldType: TestingInputType.TEXT },
{ fieldId: this.MIDDLE_INITIAL, fieldValue: 'B', fieldType: TestingInputType.TEXT },
{ fieldId: this.LAST_NAME, fieldValue: 'Uecker', fieldType: TestingInputType.TEXT },
{ fieldId: this.IS_ADDRESS_SAME, fieldValue: 1, fieldType: TestingInputType.RADIO },
{ fieldId: this.ADDRESS_LINE_1, fieldValue: '1000 South 8th Pl.', fieldType: TestingInputType.TEXT },
{ fieldId: this.CITY, fieldValue: 'Codeville', fieldType: TestingInputType.TEXT },
{ fieldId: this.STATE, fieldValue: 40, fieldType: TestingInputType.SELECT },
{ fieldId: this.ZIP, fieldValue: 53207, fieldType: TestingInputType.TEXT }
];
public canGoNext(): promise.Promise<boolean> {
const nextButton = element(by.id(this.NEXT_BUTTON));
if (nextButton) {
return nextButton.isEnabled();
}
throw new Error('Couldn\'t get next button');
}
public submit(): void {
const nextButton = element(by.id(this.NEXT_BUTTON));
nextButton.click();
}
public fillFieldsMinimal(): void {
PageObjectTools.fillFields(this.MINIMAL_DATA);
}
public fillFieldsMaximum(): void {
PageObjectTools.fillFields(this.MAXIMUM_DATA);
}
public getFocusedElement() {
return PageObjectTools.getFocusedElement();
}
public getFirstElement(prefix?: string) {
return PageObjectTools.getElementsIdField(this.ADDRESS_LINE_1, prefix);
}
}
@@ -0,0 +1,93 @@
import { by, element, promise } from 'protractor';
import { PageObjectTools } from '../page-object-tools';
import { TestInputSet, TestingInputType } from '../data-driven/test-input-command';
export class VehicleCollateralPagePo {
// text input fields
public readonly VALUE = 'inputValue';
public readonly YEAR = 'inputYear';
public readonly MAKE = 'inputMake';
public readonly MODEL = 'inputModel';
public readonly MILEAGE = 'inputMileage';
// drop down menus
public readonly TERM = 'inputTerm';
public readonly CONDITION = 'inputCondition';
public readonly LOAN_PURPOSE = 'inputLoanPurpose';
// radio/pill buttons
public readonly TYPE = 'inputType';
public readonly SELLER = 'inputSeller';
public readonly NEXT_BUTTON = 'buttonNext';
public readonly ALL_FIELDS = [this.VALUE, this.CONDITION, this.YEAR,
this.MAKE, this.MODEL, this.MILEAGE, this.TERM, this.LOAN_PURPOSE, this.TYPE, this.SELLER, this.NEXT_BUTTON];
public readonly MINIMAL_DATA: TestInputSet = [
{ fieldId: this.VALUE, fieldValue: '12345', fieldType: TestingInputType.TEXT },
{ fieldId: this.TYPE, fieldValue: 1, fieldType: TestingInputType.RADIO },
{ fieldId: this.CONDITION, fieldValue: 1, fieldType: TestingInputType.SELECT },
{ fieldId: this.YEAR, fieldValue: '2018', fieldType: TestingInputType.TEXT },
{ fieldId: this.MAKE, fieldValue: 'Subaru', fieldType: TestingInputType.TEXT },
{ fieldId: this.MODEL, fieldValue: 'Outback', fieldType: TestingInputType.TEXT },
{ fieldId: this.MILEAGE, fieldValue: '17320', fieldType: TestingInputType.TEXT },
{ fieldId: this.TERM, fieldValue: 2, fieldType: TestingInputType.SELECT },
{ fieldId: this.LOAN_PURPOSE, fieldValue: 1, fieldType: TestingInputType.SELECT }
];
public readonly VEHICLE_SELLER_INFO: TestInputSet = [
{ fieldId: this.SELLER, fieldValue: 1, fieldType: TestingInputType.RADIO }
];
public readonly MAXIMUM_DATA: TestInputSet = [
{ fieldId: this.VALUE, fieldValue: '12345', fieldType: TestingInputType.TEXT },
{ fieldId: this.TYPE, fieldValue: 1, fieldType: TestingInputType.RADIO },
{ fieldId: this.CONDITION, fieldValue: 1, fieldType: TestingInputType.SELECT },
{ fieldId: this.YEAR, fieldValue: '2018', fieldType: TestingInputType.TEXT },
{ fieldId: this.MAKE, fieldValue: 'Subaru', fieldType: TestingInputType.TEXT },
{ fieldId: this.MODEL, fieldValue: 'Outback', fieldType: TestingInputType.TEXT },
{ fieldId: this.MILEAGE, fieldValue: '17320', fieldType: TestingInputType.TEXT },
{ fieldId: this.TERM, fieldValue: 2, fieldType: TestingInputType.SELECT },
{ fieldId: this.LOAN_PURPOSE, fieldValue: 2, fieldType: TestingInputType.SELECT },
...this.VEHICLE_SELLER_INFO
];
public canGoNext(): promise.Promise<boolean> {
const nextButton = element(by.id(this.NEXT_BUTTON));
if (nextButton) {
return nextButton.isEnabled();
}
throw new Error('Couldn\'t get next button');
}
public canClickDropdown(): promise.Promise<boolean> {
const dropdown = element(by.id(this.TERM));
if (dropdown) {
return dropdown.isEnabled();
}
throw new Error('Couldn\'t click the dropbox');
}
public submit(): void {
const nextButton = element(by.id(this.NEXT_BUTTON));
nextButton.click();
}
public fillFieldsMinimal(): void {
PageObjectTools.fillFields(this.MINIMAL_DATA);
}
public fillFieldsMaximum(): void {
PageObjectTools.fillFields(this.MAXIMUM_DATA);
}
public getFocusedElement() {
return PageObjectTools.getFocusedElement();
}
public getFirstElement() {
return PageObjectTools.getElementsIdField(this.VALUE);
}
}
@@ -0,0 +1,35 @@
import { browser, by, element, ElementFinder, protractor, promise } from 'protractor';
export class WizardPagePo {
public readonly NEXT_BUTTON = 'buttonNext';
public readonly PREVIOUS_BUTTON = 'buttonPrevious';
public readonly ALL_FIELDS = [this.PREVIOUS_BUTTON, this.NEXT_BUTTON];
public canGoNext(): promise.Promise<boolean> {
const nextButton = element(by.id(this.NEXT_BUTTON));
if (nextButton) {
return nextButton.isEnabled();
}
throw new Error('Couldn\'t get next button');
}
public canGoPrevious(): promise.Promise<boolean> {
const previousButton = element(by.id(this.PREVIOUS_BUTTON));
if (previousButton) {
return previousButton.isEnabled();
}
throw new Error('Couldn\'t get previous button');
}
public goNext(): void {
const nextButton = element(by.id(this.NEXT_BUTTON));
nextButton.click();
}
public goPrevious(): void {
const nextButton = element(by.id(this.PREVIOUS_BUTTON));
nextButton.click();
}
}
@@ -0,0 +1,91 @@
import {browser, by, element, ElementFinder, protractor} from 'protractor';
import { MaskingService } from 'src/app/shared/masking/masking.service';
export interface ElementIndexer {
[key: string]: ElementFinder;
}
export class SharedAppPo {
public numbersList = '1234567890';
public alphabetList = 'abcdfghijklmnopqrstuvwxyzABCDFGHIJKLMNOPQRSTUVWXYZ';
public emptyPhone = MaskingService.emptyPhone;
navigateTo() {
return browser.get('/');
}
navigateToSpecific(location: string) {
return browser.get(location);
}
getHeaderBar() {
return element(by.css('lw-navigation'));
}
getInputById(id: string): ElementFinder {
return element(by.id(id));
}
createRandomString(stringLength: number) {
const characters = this.alphabetList;
let result = '';
for (let j = stringLength; j > 0; --j) {
result += characters[Math.floor(Math.random() * characters.length)];
}
return result;
}
createRandomNumber(numberLength: number) {
const numbers = this.numbersList;
let result = '';
for (let j = numberLength; j > 0; --j) {
const nextNum = numbers[Math.floor(Math.random() * numbers.length)];
if (nextNum !== '0') {
result += numbers[Math.floor(Math.random() * numbers.length)];
} else {
j++;
}
}
return result;
}
createRandomEmail(startLength = 10, endLength = 10): string {
const begin = this.createRandomString(startLength);
const end = this.createRandomString(endLength);
const email = [begin, '@', end, '.com'];
return email.join('');
}
getPageTitle() {
return browser.getTitle();
}
// used mainly in demos / development
sleep(time: number) {
browser.sleep(time);
}
makeSSN(inputValue) {
return MaskingService.makeSSN(inputValue);
}
makePhone(inputValue) {
return MaskingService.makePhone(inputValue);
}
makeDOB(inputValue) {
return MaskingService.makeDOB(inputValue);
}
makeNumber(inputValue) {
return MaskingService.makeNumber(inputValue);
}
selectDropDownField(elementFinder: ElementFinder, optionNumber: number) {
const desiredOption = elementFinder.all(by.tagName('option')).get(optionNumber);
const EC = protractor.ExpectedConditions;
browser.wait(EC.visibilityOf(desiredOption), 5000).then(() => {
desiredOption.click();
});
}
}