Adding
This commit is contained in:
@@ -0,0 +1,177 @@
|
||||
import { browser, protractor } from 'protractor';
|
||||
import { PageObjectTools } from '../shared/page-object-tools';
|
||||
import { HelocPageOnePo } from './pages/page-one.po';
|
||||
import { ContactPagePo } from '../shared/pages/contact-page.po';
|
||||
import { EmploymentPagePo } from '../shared/pages/employment-page.po';
|
||||
import { ResidencePagePo } from '../shared/pages/residence-page.po';
|
||||
import { HmdaPagePo } from '../shared/pages/hmda-page.po';
|
||||
import { CollateralPagePo } from '../shared/pages/collateral-page.po';
|
||||
import { SummaryPagePo } from '../shared/pages/summary-page.po';
|
||||
import { CreditCardDisclosuresPagePo } from '../credit-card/pages/page-disclosures.po';
|
||||
|
||||
describe('It should create a maximum HELOC application ', () => {
|
||||
|
||||
it('should accept maximum inputs for page 1 (Member/Loan Type)', () => {
|
||||
const page = new HelocPageOnePo();
|
||||
browser.get(page.PAGE_URL);
|
||||
const inputArray = PageObjectTools.findFieldsInPageByIdArray(page.ALL_FIELDS);
|
||||
expect(inputArray.length).toEqual(page.ALL_FIELDS.length);
|
||||
expect(page.canGoNext()).toEqual(false);
|
||||
page.fillFieldsMaximum();
|
||||
expect(page.canGoNext()).toEqual(true);
|
||||
page.submit();
|
||||
});
|
||||
|
||||
it('should accept maximum inputs for page 2 (Personal Info)', () => {
|
||||
const page = new ContactPagePo();
|
||||
expect(page.getFocusedElement()).toEqual(page.getFirstElement());
|
||||
const inputArray = PageObjectTools.findFieldsInPageByIdArray(page.ALL_FIELDS);
|
||||
expect(inputArray.length).toEqual(page.ALL_FIELDS.length);
|
||||
expect(page.canGoNext()).toEqual(false);
|
||||
page.fillFieldsMaximumCoApplicant();
|
||||
expect(page.canGoNext()).toEqual(true);
|
||||
page.submit();
|
||||
});
|
||||
|
||||
it('should accept maximum inputs for page 3 (Residence)', () => {
|
||||
const page = new ResidencePagePo();
|
||||
expect(page.getFocusedElement()).toEqual(page.getFirstElement(page.DEFAULT_PREFIX));
|
||||
const inputArray = PageObjectTools.findFieldsInPageByIdArray(page.ALL_FIELDS);
|
||||
expect(inputArray.length).toEqual(page.ALL_FIELDS.length);
|
||||
expect(page.canGoNext()).toEqual(false);
|
||||
page.fillFieldsMinimal();
|
||||
expect(page.canGoNext()).toEqual(true);
|
||||
page.submit();
|
||||
});
|
||||
|
||||
it('should accept maximum inputs for HMDA page (HMDA: Race/Ethnicity/Gender)', () => {
|
||||
const page = new HmdaPagePo();
|
||||
const inputArray = PageObjectTools.findFieldsInPageByIdArray(page.ALL_FIELDS);
|
||||
expect(inputArray.length).toEqual(page.ALL_FIELDS.length);
|
||||
expect(page.canGoNext()).toEqual(false);
|
||||
page.fillFieldsMaximum();
|
||||
expect(page.canGoNext()).toEqual(true);
|
||||
page.submit();
|
||||
});
|
||||
|
||||
|
||||
it('should accept maximum inputs for page 4 (Employment)', () => {
|
||||
const page = new EmploymentPagePo();
|
||||
let inputArray = PageObjectTools.findFieldsInPageByIdArray(page.STARTING_FIELDS, page.DEFAULT_PREFIX);
|
||||
expect(inputArray.length).toEqual(page.STARTING_FIELDS.length);
|
||||
expect(page.canGoNext()).toEqual(true);
|
||||
page.showEmploymentFields();
|
||||
inputArray = PageObjectTools.findFieldsInPageByIdArray([...page.STARTING_FIELDS, ...page.EMPLOYMENT_FIELDS], page.DEFAULT_PREFIX);
|
||||
expect(inputArray.length).toEqual([...page.STARTING_FIELDS, ...page.EMPLOYMENT_FIELDS].length);
|
||||
expect(page.canGoNext()).toEqual(false);
|
||||
page.showOtherIncomeFields();
|
||||
page.showChildSupportFields();
|
||||
page.fillFieldsMaximum();
|
||||
expect(page.canGoNext()).toEqual(false);
|
||||
page.fillChildSupportFields();
|
||||
page.fillOtherIncomeFields();
|
||||
page.markSingleIncomeNotEnough();
|
||||
// Will no longer happen.
|
||||
// expect(page.canGoNext()).toEqual(false);
|
||||
// page.fillSecondIncome();
|
||||
expect(page.canGoNext()).toEqual(true);
|
||||
page.submit();
|
||||
});
|
||||
|
||||
it('should accept maximum inputs for page 2.A (Co-Applicant Personal Info)', () => {
|
||||
const page = new ContactPagePo();
|
||||
const EC = protractor.ExpectedConditions;
|
||||
browser.wait(EC.visibilityOf(page.getFirstElement()), 5000).then(() => {});
|
||||
expect(page.getFocusedElement()).toEqual(page.getFirstElement());
|
||||
const inputArray = PageObjectTools.findFieldsInPageByIdArray(page.COAPP_FIELDS);
|
||||
expect(inputArray.length).toEqual(page.COAPP_FIELDS.length);
|
||||
expect(page.canGoNext()).toEqual(false);
|
||||
page.fillFieldsMaximumCoApplicantNonPrimary();
|
||||
expect(page.canGoNext()).toEqual(true);
|
||||
page.submit();
|
||||
});
|
||||
|
||||
|
||||
it('should accept maximum inputs for page 3.A (Co-applicant Residence)', () => {
|
||||
const page = new ResidencePagePo();
|
||||
page.markAddressNotSame();
|
||||
expect(page.getFocusedElement()).toEqual(page.getFirstElement(page.DEFAULT_PREFIX));
|
||||
const inputArray = PageObjectTools.findFieldsInPageByIdArray(page.ALL_FIELDS);
|
||||
expect(inputArray.length).toEqual(page.ALL_FIELDS.length);
|
||||
expect(page.canGoNext()).toEqual(false);
|
||||
page.fillFieldsMinimal();
|
||||
page.showMailingAddress();
|
||||
page.showSecondAddress();
|
||||
page.fillAdditionalFieldsMaximum();
|
||||
expect(page.canGoNext()).toEqual(true);
|
||||
page.submit();
|
||||
});
|
||||
|
||||
it('should accept maximum inputs for co-applicant HMDA page (Co-applicant HMDA: Race/Ethnicity/Gender)', () => {
|
||||
const page = new HmdaPagePo();
|
||||
const inputArray = PageObjectTools.findFieldsInPageByIdArray(page.ALL_FIELDS);
|
||||
expect(inputArray.length).toEqual(page.ALL_FIELDS.length);
|
||||
expect(page.canGoNext()).toEqual(false);
|
||||
page.fillFieldsMaximum();
|
||||
expect(page.canGoNext()).toEqual(true);
|
||||
page.submit();
|
||||
});
|
||||
|
||||
it('should accept maximum inputs for page 4.A (Co-applicant Employment)', () => {
|
||||
const page = new EmploymentPagePo();
|
||||
let inputArray = PageObjectTools.findFieldsInPageByIdArray(page.STARTING_FIELDS);
|
||||
expect(inputArray.length).toEqual(page.STARTING_FIELDS.length);
|
||||
expect(page.canGoNext()).toEqual(true);
|
||||
page.showEmploymentFields();
|
||||
inputArray = PageObjectTools.findFieldsInPageByIdArray([...page.EMPLOYMENT_FIELDS], page.DEFAULT_PREFIX);
|
||||
expect(inputArray.length).toEqual([...page.EMPLOYMENT_FIELDS].length);
|
||||
expect(page.canGoNext()).toEqual(false);
|
||||
page.showOtherIncomeFields();
|
||||
page.showChildSupportFields();
|
||||
page.fillFieldsMaximum();
|
||||
expect(page.canGoNext()).toEqual(false);
|
||||
page.fillChildSupportFields();
|
||||
page.fillOtherIncomeFields();
|
||||
page.markSingleIncomeNotEnough();
|
||||
// Will no longer happen.
|
||||
// expect(page.canGoNext()).toEqual(false);
|
||||
// page.fillSecondIncome();
|
||||
expect(page.canGoNext()).toEqual(true);
|
||||
page.submit();
|
||||
});
|
||||
|
||||
it('should accept maximum inputs for collateral page (Collateral)', () => {
|
||||
const page = new CollateralPagePo();
|
||||
const EC = protractor.ExpectedConditions;
|
||||
browser.wait(EC.visibilityOf(page.getFirstElement()), 5000).then(() => {});
|
||||
expect(page.getFocusedElement()).toEqual(page.getFirstElement());
|
||||
let inputArray = PageObjectTools.findFieldsInPageByIdArray(page.ALL_FIELDS);
|
||||
expect(inputArray.length).toEqual(page.ALL_FIELDS.length);
|
||||
expect(page.canGoNext()).toEqual(false);
|
||||
inputArray = PageObjectTools.findFieldsInPageByIdArray([...page.ALL_FIELDS, ...page.ADDRESS_FIELDS, ...page.LIEN_POSITION_FIELDS]);
|
||||
expect(inputArray.length).toEqual([...page.ALL_FIELDS, ...page.ADDRESS_FIELDS, ...page.LIEN_POSITION_FIELDS].length);
|
||||
expect(page.canGoNext()).toEqual(false);
|
||||
page.fillFieldsMaximum();
|
||||
expect(page.canGoNext()).toEqual(true);
|
||||
page.submit();
|
||||
});
|
||||
|
||||
it('should accept maximum inputs for page 5 (Disclosures)', () => {
|
||||
const page = new CreditCardDisclosuresPagePo();
|
||||
const inputArray = PageObjectTools.findFieldsInPageByIdArray(page.ALL_FIELDS);
|
||||
expect(inputArray.length).toEqual(page.ALL_FIELDS.length);
|
||||
expect(page.canGoNext()).toEqual(false);
|
||||
page.fillFieldsMinimal();
|
||||
expect(page.canGoNext()).toEqual(true);
|
||||
page.submit();
|
||||
});
|
||||
|
||||
it('should show application information on page 6 (Summary)', () => {
|
||||
const page = new SummaryPagePo();
|
||||
const inputArray = PageObjectTools.findFieldsInPageByIdArray(page.ALL_FIELDS);
|
||||
expect(inputArray.length).toEqual(page.ALL_FIELDS.length);
|
||||
page.fillFieldsMinimal();
|
||||
expect(page.canGoNext()).toEqual(true);
|
||||
});
|
||||
|
||||
});
|
||||
@@ -0,0 +1,99 @@
|
||||
import { browser, by, element, ElementFinder, protractor } from 'protractor';
|
||||
import { PageObjectTools } from '../shared/page-object-tools';
|
||||
import { HelocPageOnePo } from './pages/page-one.po';
|
||||
import { ContactPagePo } from '../shared/pages/contact-page.po';
|
||||
import { EmploymentPagePo } from '../shared/pages/employment-page.po';
|
||||
import { ResidencePagePo } from '../shared/pages/residence-page.po';
|
||||
import { HmdaPagePo } from '../shared/pages/hmda-page.po';
|
||||
import { CollateralPagePo } from '../shared/pages/collateral-page.po';
|
||||
import { SummaryPagePo } from '../shared/pages/summary-page.po';
|
||||
import { CreditCardDisclosuresPagePo } from '../credit-card/pages/page-disclosures.po';
|
||||
|
||||
describe('It should create a minimal HELOC application ', () => {
|
||||
|
||||
it('should accept basic inputs for page 1 (Member/Loan Type)', () => {
|
||||
const page = new HelocPageOnePo();
|
||||
browser.get(page.PAGE_URL);
|
||||
const inputArray = PageObjectTools.findFieldsInPageByIdArray(page.ALL_FIELDS);
|
||||
expect(inputArray.length).toEqual(page.ALL_FIELDS.length);
|
||||
expect(page.canGoNext()).toEqual(false);
|
||||
page.fillFieldsMinimal();
|
||||
expect(page.canGoNext()).toEqual(true);
|
||||
page.submit();
|
||||
});
|
||||
|
||||
it('should accept basic inputs for page 2 (Personal Info)', () => {
|
||||
const page = new ContactPagePo();
|
||||
const inputArray = PageObjectTools.findFieldsInPageByIdArray(page.ALL_FIELDS);
|
||||
expect(inputArray.length).toEqual(page.ALL_FIELDS.length);
|
||||
expect(page.canGoNext()).toEqual(false);
|
||||
page.fillFieldsMinimal();
|
||||
expect(page.canGoNext()).toEqual(true);
|
||||
page.submit();
|
||||
});
|
||||
|
||||
it('should accept basic inputs for page 3 (Residence)', () => {
|
||||
const page = new ResidencePagePo();
|
||||
const inputArray = PageObjectTools.findFieldsInPageByIdArray(page.ALL_FIELDS);
|
||||
expect(inputArray.length).toEqual(page.ALL_FIELDS.length);
|
||||
expect(page.canGoNext()).toEqual(false);
|
||||
page.fillFieldsMinimal();
|
||||
expect(page.canGoNext()).toEqual(true);
|
||||
page.submit();
|
||||
});
|
||||
|
||||
it('should accept basic inputs for page 3.A (HMDA: Race/Ethnicity/Gender)', () => {
|
||||
const page = new HmdaPagePo();
|
||||
const inputArray = PageObjectTools.findFieldsInPageByIdArray(page.ALL_FIELDS);
|
||||
expect(inputArray.length).toEqual(page.ALL_FIELDS.length);
|
||||
expect(page.canGoNext()).toEqual(false);
|
||||
page.fillFieldsMinimal();
|
||||
expect(page.canGoNext()).toEqual(true);
|
||||
page.submit();
|
||||
});
|
||||
|
||||
it('should accept basic inputs for page 4 (Employment)', () => {
|
||||
const page = new EmploymentPagePo();
|
||||
let inputArray = PageObjectTools.findFieldsInPageByIdArray(page.STARTING_FIELDS, page.DEFAULT_PREFIX);
|
||||
expect(inputArray.length).toEqual(page.STARTING_FIELDS.length);
|
||||
expect(page.canGoNext()).toEqual(true);
|
||||
page.showEmploymentFields();
|
||||
inputArray = PageObjectTools.findFieldsInPageByIdArray([...page.STARTING_FIELDS, ...page.EMPLOYMENT_FIELDS], page.DEFAULT_PREFIX);
|
||||
expect(inputArray.length).toEqual([...page.STARTING_FIELDS, ...page.EMPLOYMENT_FIELDS].length);
|
||||
expect(page.canGoNext()).toEqual(false);
|
||||
page.fillFieldsMinimal();
|
||||
expect(page.canGoNext()).toEqual(true);
|
||||
page.submit();
|
||||
});
|
||||
|
||||
|
||||
it('should accept basic inputs for page 4.A (Collateral)', () => {
|
||||
const page = new CollateralPagePo();
|
||||
const inputArray = PageObjectTools.findFieldsInPageByIdArray(page.ALL_FIELDS);
|
||||
expect(inputArray.length).toEqual(page.ALL_FIELDS.length);
|
||||
expect(page.canGoNext()).toEqual(false);
|
||||
page.fillFieldsMinimal();
|
||||
expect(page.canGoNext()).toEqual(true);
|
||||
page.submit();
|
||||
});
|
||||
|
||||
|
||||
it('should accept basic inputs for page 5 (Disclosures)', () => {
|
||||
const page = new CreditCardDisclosuresPagePo();
|
||||
const inputArray = PageObjectTools.findFieldsInPageByIdArray(page.ALL_FIELDS);
|
||||
expect(inputArray.length).toEqual(page.ALL_FIELDS.length);
|
||||
expect(page.canGoNext()).toEqual(false);
|
||||
page.fillFieldsMinimal();
|
||||
expect(page.canGoNext()).toEqual(true);
|
||||
page.submit();
|
||||
});
|
||||
|
||||
it('should show application information on page 6 (Summary)', () => {
|
||||
const page = new SummaryPagePo();
|
||||
const inputArray = PageObjectTools.findFieldsInPageByIdArray(page.ALL_FIELDS);
|
||||
expect(inputArray.length).toEqual(page.ALL_FIELDS.length);
|
||||
page.fillFieldsMinimal();
|
||||
expect(page.canGoNext()).toEqual(true);
|
||||
});
|
||||
|
||||
});
|
||||
@@ -0,0 +1,56 @@
|
||||
import { by, element, promise } from 'protractor';
|
||||
import { PageObjectTools } from '../../shared/page-object-tools';
|
||||
import { TestInputSet, TestingInputType } from '../../shared/data-driven/test-input-command';
|
||||
|
||||
export class HelocPageOnePo {
|
||||
|
||||
public readonly PAGE_URL = '/loan-wizard/eq/he/step-1';
|
||||
|
||||
public readonly LIMIT_REQUESTED = 'inputLimitRequested';
|
||||
public readonly ANOTHER_PERSON = 'inputApplicantType';
|
||||
public readonly LIVE_IN_WI = 'inputLivesInMaritalPropertyState';
|
||||
public readonly JOINT_CREDIT = 'inputConfirmJointCredit';
|
||||
public readonly CO_APP_LIVE_IN_WI = 'inputCoAppLivesInMaritalPropertyState';
|
||||
public readonly PURPOSE_OF_LOAN = 'inputPurposeOfLoan';
|
||||
public readonly NEXT_BUTTON = 'buttonNext';
|
||||
public readonly ALL_FIELDS = [this.LIMIT_REQUESTED, this.ANOTHER_PERSON, this.LIVE_IN_WI, this.NEXT_BUTTON, this.PURPOSE_OF_LOAN];
|
||||
public readonly HIDDEN_FIELDS_1 = [this.JOINT_CREDIT, this.CO_APP_LIVE_IN_WI];
|
||||
|
||||
public readonly MINIMAL_DATA: TestInputSet = [
|
||||
{ fieldId: this.LIMIT_REQUESTED, fieldValue: 5432, fieldType: TestingInputType.TEXT },
|
||||
{ fieldId: this.ANOTHER_PERSON, fieldValue: 1, fieldType: TestingInputType.RADIO },
|
||||
{ fieldId: this.LIVE_IN_WI, fieldValue: 1, fieldType: TestingInputType.RADIO },
|
||||
{ fieldId: this.PURPOSE_OF_LOAN, fieldValue: 1, fieldType: TestingInputType.SELECT }
|
||||
];
|
||||
|
||||
public readonly MAXIMUM_DATA: TestInputSet = [
|
||||
{ fieldId: this.LIMIT_REQUESTED, fieldValue: 5432, fieldType: TestingInputType.TEXT },
|
||||
{ fieldId: this.ANOTHER_PERSON, fieldValue: 0, fieldType: TestingInputType.RADIO },
|
||||
{ fieldId: this.LIVE_IN_WI, fieldValue: 0, fieldType: TestingInputType.RADIO },
|
||||
{ fieldId: this.JOINT_CREDIT, fieldValue: 0, fieldType: TestingInputType.RADIO },
|
||||
{ fieldId: this.CO_APP_LIVE_IN_WI, fieldValue: 0, fieldType: TestingInputType.RADIO },
|
||||
{ fieldId: this.PURPOSE_OF_LOAN, 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);
|
||||
}
|
||||
|
||||
public fillFieldsMaximum(): void {
|
||||
PageObjectTools.fillFields(this.MAXIMUM_DATA);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user