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,153 @@
import { browser, by, element, ElementFinder, protractor } from 'protractor';
import { CreditCardPageOnePo } from './pages/page-one.po';
import { ContactPagePo } from '../shared/pages/contact-page.po';
import { PageObjectTools } from '../shared/page-object-tools';
import { ResidencePagePo } from '../shared/pages/residence-page.po';
import { EmploymentPagePo } from '../shared/pages/employment-page.po';
import { CreditCardDisclosuresPagePo } from './pages/page-disclosures.po';
import { SummaryPagePo } from '../shared/pages/summary-page.po';
import { SpouseTypePagePo } from '../shared/pages/spouse-type-page.po';
describe('It should create a credit card application for 4 full info individuals', () => {
it('should accept maximum inputs for page 1 (Member/Loan Type)', () => {
const page = new CreditCardPageOnePo();
browser.get(page.PAGE_URL);
browser.sleep(1000);
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);
page.fillFieldsMaximum();
inputArray = PageObjectTools.findFieldsInPageByIdArray([...page.ALL_FIELDS, ...page.HIDDEN_FIELDS_1]);
expect(inputArray.length).toEqual(page.ALL_FIELDS.length + page.HIDDEN_FIELDS_1.length);
expect(page.canGoNext()).toEqual(true);
page.submit();
});
it('should accept minimum inputs for page 2.A (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.fillFieldsPrimaryMarriedButNotMarriedToCoApplicant();
expect(page.canGoNext()).toEqual(true);
page.submit();
});
it('should accept minimum inputs for page 3.A (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.fillFieldsMinimalLivingInWI();
expect(page.canGoNext()).toEqual(true);
page.submit();
});
it('should accept minimum inputs for page 4.A (Employment)', () => {
const page = new EmploymentPagePo();
expect(page.canGoNext()).toEqual(true);
page.submit();
});
it('should accept FULL INFO SPOUSE input for Applicant spouse type page', () => {
const page = new SpouseTypePagePo();
expect(page.canGoNext()).toEqual(false);
page.fillFieldsFullInfoSpouse();
expect(page.canGoNext()).toEqual(true);
page.submit();
});
it('should accept minimum inputs for page 2.B (Applicant\'s Spouse Personal Info)', () => {
const page = new ContactPagePo();
expect(page.canGoNext()).toEqual(false);
page.fillFieldsMinimalNoMarital();
expect(page.canGoNext()).toEqual(true);
page.submit();
});
it('should accept minimum inputs for page 3.B (Applicant\'s Spouse Residence)', () => {
const page = new ResidencePagePo();
page.markAddressSame();
expect(page.canGoNext()).toEqual(true);
page.submit();
});
it('should accept minimum inputs for page 4.B (Applicant\'s Spouse Employment)', () => {
const page = new EmploymentPagePo();
expect(page.canGoNext()).toEqual(true);
page.submit();
});
it('should accept maximum inputs for page 2.C (Co-Applicant Personal Info)', () => {
const page = new ContactPagePo();
expect(page.canGoNext()).toEqual(false);
page.fillFieldsMaximumCoApplicantNonPrimary();
expect(page.canGoNext()).toEqual(true);
page.submit();
});
it('should accept minimum inputs for page 3.C (Co-applicant Residence)', () => {
const page = new ResidencePagePo();
expect(page.canGoNext()).toEqual(false);
page.fillFieldsMinimalLivingInWI();
expect(page.canGoNext()).toEqual(true);
page.submit();
});
it('should accept minimum inputs for page 4.C (Co-applicant Employment)', () => {
const page = new EmploymentPagePo();
expect(page.canGoNext()).toEqual(true);
page.submit();
});
it('should accept FULL INFO SPOUSE input for CoApplicant spouse type page', () => {
const page = new SpouseTypePagePo();
expect(page.canGoNext()).toEqual(false);
page.fillFieldsFullInfoSpouse();
expect(page.canGoNext()).toEqual(true);
page.submit();
});
it('should accept minimum inputs for page 2.D (CoApplicant\'s Spouse Personal Info)', () => {
const page = new ContactPagePo();
expect(page.canGoNext()).toEqual(false);
page.fillFieldsMinimalNoMarital();
expect(page.canGoNext()).toEqual(true);
page.submit();
});
it('should accept minimum inputs for page 3.D (CoApplicant\'s Spouse Residence)', () => {
const page = new ResidencePagePo();
page.markAddressSame();
expect(page.canGoNext()).toEqual(true);
page.submit();
});
it('should accept minimum inputs for page 4.D (CoApplicant\'s Spouse Employment)', () => {
const page = new EmploymentPagePo();
expect(page.canGoNext()).toEqual(true);
page.submit();
});
it('should 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,129 @@
import { browser, by, element, ElementFinder, protractor } from 'protractor';
import { CreditCardPageOnePo } from './pages/page-one.po';
import { ContactPagePo } from '../shared/pages/contact-page.po';
import { PageObjectTools } from '../shared/page-object-tools';
import { ResidencePagePo } from '../shared/pages/residence-page.po';
import { EmploymentPagePo } from '../shared/pages/employment-page.po';
import { CreditCardDisclosuresPagePo } from './pages/page-disclosures.po';
import { SummaryPagePo } from '../shared/pages/summary-page.po';
import { WizardPagePo } from '../shared/pages/wizard-page.po';
describe('It should allow free navigation of a completed credit card application', () => {
it('should accept maximum inputs for page 1.', () => {
const page = new CreditCardPageOnePo();
browser.get(page.PAGE_URL);
page.fillFieldsMaximum();
expect(page.canGoNext()).toEqual(true);
page.submit();
});
it('should accept maximum inputs for page 2 (Personal Info)', () => {
const page = new ContactPagePo();
page.fillFieldsMaximumCoApplicant();
expect(page.canGoNext()).toEqual(true);
page.submit();
});
it('should accept maximum inputs for page 3 (Residence)', () => {
const page = new ResidencePagePo();
page.fillFieldsMinimal();
page.showMailingAddress();
page.showSecondAddress();
page.fillAdditionalFieldsMaximum();
expect(page.canGoNext()).toEqual(true);
page.submit();
});
it('should accept maximum inputs for page 4 (Employment)', () => {
const page = new EmploymentPagePo();
page.showEmploymentFields();
page.showOtherIncomeFields();
page.showChildSupportFields();
page.fillFieldsMaximum();
expect(page.canGoNext()).toEqual(false);
page.fillChildSupportFields();
page.fillOtherIncomeFields();
page.markSingleIncomeNotEnough();
expect(page.canGoNext()).toEqual(true);
// Will no longer happen.
// 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();
page.fillFieldsMaximum();
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 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 maximum inputs for page 5 (Disclosures)', () => {
const page = new CreditCardDisclosuresPagePo();
page.fillFieldsMinimal();
expect(page.canGoNext()).toEqual(true);
});
it('should jump back to the beginning.', () => {
const urlList = [
'http://localhost:4200/loan-wizard/cc/cb/co-applicant-financial',
'http://localhost:4200/loan-wizard/cc/cb/co-applicant-residential',
'http://localhost:4200/loan-wizard/cc/cb/co-applicant-personal',
'http://localhost:4200/loan-wizard/cc/cb/step-4',
'http://localhost:4200/loan-wizard/cc/cb/step-3',
'http://localhost:4200/loan-wizard/cc/cb/step-2',
'http://localhost:4200/loan-wizard/cc/cb/step-1'
];
const page = new WizardPagePo();
urlList.forEach((eachUrl) => {
expect(page.canGoPrevious()).toEqual(true);
page.goPrevious();
browser.getCurrentUrl().then((newUrl) => {
expect(newUrl).toEqual(eachUrl);
});
expect(page.canGoNext()).toEqual(true);
}, this);
});
});
@@ -0,0 +1,144 @@
import { browser, by, element, ElementFinder, protractor } from 'protractor';
import { CreditCardPageOnePo } from './pages/page-one.po';
import { ContactPagePo } from '../shared/pages/contact-page.po';
import { PageObjectTools } from '../shared/page-object-tools';
import { ResidencePagePo } from '../shared/pages/residence-page.po';
import { EmploymentPagePo } from '../shared/pages/employment-page.po';
import { CreditCardDisclosuresPagePo } from './pages/page-disclosures.po';
import { SummaryPagePo } from '../shared/pages/summary-page.po';
describe('It should create a maximum credit card application ', () => {
it('should accept maximum inputs for page 1 (Member/Loan Type)', () => {
const page = new CreditCardPageOnePo();
browser.get(page.PAGE_URL);
browser.sleep(1000);
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);
page.fillFieldsMaximum();
inputArray = PageObjectTools.findFieldsInPageByIdArray([...page.ALL_FIELDS, ...page.HIDDEN_FIELDS_1]);
expect(inputArray.length).toEqual(page.ALL_FIELDS.length + page.HIDDEN_FIELDS_1.length);
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();
page.showMailingAddress();
page.showSecondAddress();
page.fillAdditionalFieldsMaximum();
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);
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 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 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 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,85 @@
import { browser, by, element, ElementFinder, protractor } from 'protractor';
import { CreditCardPageOnePo } from './pages/page-one.po';
import { ContactPagePo } from '../shared/pages/contact-page.po';
import { PageObjectTools } from '../shared/page-object-tools';
import { ResidencePagePo } from '../shared/pages/residence-page.po';
import { EmploymentPagePo } from '../shared/pages/employment-page.po';
import { CreditCardDisclosuresPagePo } from './pages/page-disclosures.po';
import { SummaryPagePo } from '../shared/pages/summary-page.po';
describe('It should create a minimal credit card application ', () => {
it('should accept basic inputs for page 1 (Member/Loan Type)', () => {
const page = new CreditCardPageOnePo();
browser.get(page.PAGE_URL);
browser.sleep(1000);
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.fillFieldsMinimal();
expect(page.canGoNext()).toEqual(true);
page.fillFieldsForFailureToConfirmJointCredit();
expect(page.canGoNext()).toEqual(false);
page.dismissModalByOkayButton();
expect(page.canGoNext()).toEqual(true);
page.submit();
});
it('should accept basic 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.fillFieldsMinimal();
expect(page.canGoNext()).toEqual(true);
page.submit();
});
it('should accept basic 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 basic inputs for page 4 (Employment)', () => {
const page = new EmploymentPagePo();
const inputArray = PageObjectTools.findFieldsInPageByIdArray(page.STARTING_FIELDS);
expect(inputArray.length).toEqual(page.STARTING_FIELDS.length);
// For a minimal credit card, don't enter any income :-)
// expect(page.canGoNext()).toEqual(false);
// 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.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);
});
// We could go to the next page, but we'd create X loans every time we run these tests...
});
@@ -0,0 +1,130 @@
import { browser, by, element, ElementFinder, protractor } from 'protractor';
import { CreditCardPageOnePo } from './pages/page-one.po';
import { ContactPagePo } from '../shared/pages/contact-page.po';
import { PageObjectTools } from '../shared/page-object-tools';
import { ResidencePagePo } from '../shared/pages/residence-page.po';
import { EmploymentPagePo } from '../shared/pages/employment-page.po';
import { CreditCardDisclosuresPagePo } from './pages/page-disclosures.po';
import { SummaryPagePo } from '../shared/pages/summary-page.po';
import { SpouseTypePagePo } from '../shared/pages/spouse-type-page.po';
import { TattleSpousePagePo } from '../shared/pages/tattle-spouse-page.po';
describe('It should create a credit card application for 2 full info individuals + 2 tattle spouses', () => {
it('should accept maximum inputs for page 1 (Member/Loan Type)', () => {
const page = new CreditCardPageOnePo();
browser.get(page.PAGE_URL);
browser.sleep(1000);
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);
page.fillFieldsMaximum();
inputArray = PageObjectTools.findFieldsInPageByIdArray([...page.ALL_FIELDS, ...page.HIDDEN_FIELDS_1]);
expect(inputArray.length).toEqual(page.ALL_FIELDS.length + page.HIDDEN_FIELDS_1.length);
expect(page.canGoNext()).toEqual(true);
page.submit();
});
it('should accept minimum inputs for page 2.A (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.fillFieldsPrimaryMarriedButNotMarriedToCoApplicant();
expect(page.canGoNext()).toEqual(true);
page.submit();
});
it('should accept minimum inputs for page 3.A (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.fillFieldsMinimalLivingInWI();
expect(page.canGoNext()).toEqual(true);
page.submit();
});
it('should accept minimum inputs for page 4.A (Employment)', () => {
const page = new EmploymentPagePo();
expect(page.canGoNext()).toEqual(true);
page.submit();
});
it('should accept TATTLE SPOUSE input for Applicant spouse type page', () => {
const page = new SpouseTypePagePo();
expect(page.canGoNext()).toEqual(false);
page.fillFieldsTattleSpouse();
expect(page.canGoNext()).toEqual(true);
page.submit();
});
it('should accept minimum inputs for tattle spouse page (Applicant\'s Spouse Tattle Info)', () => {
const page = new TattleSpousePagePo();
expect(page.canGoNext()).toEqual(false);
page.fillFieldsMinimal();
expect(page.canGoNext()).toEqual(true);
page.submit();
});
it('should accept maximum inputs for page 2.C (Co-Applicant Personal Info)', () => {
const page = new ContactPagePo();
expect(page.canGoNext()).toEqual(false);
page.fillFieldsMaximumCoApplicantNonPrimary();
expect(page.canGoNext()).toEqual(true);
page.submit();
});
it('should accept minimum inputs for page 3.C (Co-applicant Residence)', () => {
const page = new ResidencePagePo();
expect(page.canGoNext()).toEqual(false);
page.fillFieldsMinimalLivingInWI();
expect(page.canGoNext()).toEqual(true);
page.submit();
});
it('should accept minimum inputs for page 4.C (Co-applicant Employment)', () => {
const page = new EmploymentPagePo();
expect(page.canGoNext()).toEqual(true);
page.submit();
});
it('should accept TATTLE SPOUSE input for CoApplicant spouse type page', () => {
const page = new SpouseTypePagePo();
expect(page.canGoNext()).toEqual(false);
page.fillFieldsTattleSpouse();
expect(page.canGoNext()).toEqual(true);
page.submit();
});
it('should accept minimum inputs for tattle spouse page (CoApplicant\'s Spouse Tattle Info)', () => {
const page = new TattleSpousePagePo();
expect(page.canGoNext()).toEqual(false);
page.fillFieldsMinimal();
expect(page.canGoNext()).toEqual(true);
page.submit();
});
it('should 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,34 @@
import { browser, by, element, ElementFinder, protractor, promise } from 'protractor';
import { PageObjectTools } from '../../shared/page-object-tools';
export class CreditCardDisclosuresPagePo {
public readonly PAGE_URL = '/loan-wizard/cc/cb/disclosures';
public readonly DISCLOSE_TRUTHFUL = 'truthful';
public readonly DISCLOSE_CONTACT = 'contact';
public readonly NEXT_BUTTON = 'buttonNext';
public readonly ALL_FIELDS = [
this.DISCLOSE_TRUTHFUL, this.DISCLOSE_CONTACT,
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 submit(): void {
const nextButton = element(by.id(this.NEXT_BUTTON));
nextButton.click();
}
public fillFieldsMinimal(): void {
const truthful = element(by.id(this.DISCLOSE_TRUTHFUL));
PageObjectTools.clickCheckBox(truthful);
}
}
@@ -0,0 +1,77 @@
import { browser, by, element, ElementFinder, protractor, promise } from 'protractor';
import { PageObjectTools } from '../../shared/page-object-tools';
import { TestInputSet, TestInputCommand, TestingInputType } from '../../shared/data-driven/test-input-command';
export class CreditCardPageOnePo {
public readonly PAGE_URL = '/loan-wizard/cc/cb/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 NEXT_BUTTON = 'buttonNext';
public readonly MODAL_CLOSE_BUTTON = 'modalCloseButton';
public readonly MODAL_OKAY_BUTTON = 'modalOkayButton';
public readonly ALL_FIELDS = [this.LIMIT_REQUESTED, this.ANOTHER_PERSON, this.LIVE_IN_WI, this.NEXT_BUTTON];
public readonly HIDDEN_FIELDS_1 = [this.JOINT_CREDIT, this.CO_APP_LIVE_IN_WI];
public readonly MINIMAL_DATA: TestInputSet = [
{ fieldId: this.LIMIT_REQUESTED, fieldValue: 1234, fieldType: TestingInputType.TEXT },
{ fieldId: this.ANOTHER_PERSON, fieldValue: 1, fieldType: TestingInputType.RADIO },
{ fieldId: this.LIVE_IN_WI, fieldValue: 1, fieldType: TestingInputType.RADIO }
];
public readonly MAXIMUM_DATA: TestInputSet = [
{ fieldId: this.LIMIT_REQUESTED, fieldValue: 1234, 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 }
];
public readonly JOINT_CREDIT_DATA: TestInputSet = [
{ fieldId: this.ANOTHER_PERSON, fieldValue: 0, fieldType: TestingInputType.RADIO },
{ fieldId: this.JOINT_CREDIT, 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 fillFieldsForFailureToConfirmJointCredit(): void {
PageObjectTools.fillFields(this.JOINT_CREDIT_DATA);
}
public dismissModalByOkayButton(): void {
const modalOkayButton = element(by.id(this.MODAL_OKAY_BUTTON));
modalOkayButton.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.LIMIT_REQUESTED);
}
}
@@ -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);
}
}
@@ -0,0 +1,10 @@
import { SelectLoanPo } from './select-loan.po';
export class SelectLoanCreditPo extends SelectLoanPo {
public readonly PAGE_URL = '/select-loan/credit-card';
public readonly CASH_BACK = 'cc-cash';
public readonly REWARDS = 'cc-reward';
public readonly STUDENT = 'cc-student';
public readonly SECURED = 'cc-secured';
}
@@ -0,0 +1,11 @@
import { SelectLoanPo } from './select-loan.po';
export class SelectLoanHomePo extends SelectLoanPo {
public readonly PAGE_URL = '/select-loan/home-equity';
public readonly HELOC = 'eq-heloc';
public readonly HOME_EQUITY = 'eq-fixed';
public readonly MORT_REFI = 'eq-refi';
public readonly MANU_HOME = 'eq-manu';
}
@@ -0,0 +1,7 @@
import { SelectLoanPo } from './select-loan.po';
export class SelectLoanPersonalPo extends SelectLoanPo {
public readonly PAGE_URL = '/loan-wizard/sl/pe';
}
@@ -0,0 +1,9 @@
import { SelectLoanPo } from './select-loan.po';
export class SelectLoanVehicleSubPo extends SelectLoanPo {
public PAGE_URL = '/select-loan/sub-vehicle';
public readonly LOAN = 've-loan';
public readonly PRE = 've-pre';
}
@@ -0,0 +1,11 @@
import { SelectLoanPo } from './select-loan.po';
export class SelectLoanVehiclePo extends SelectLoanPo {
public readonly PAGE_URL = '/select-loan/vehicle';
public readonly AUTO = 've-sub';
public readonly BOAT = 've-boat';
public readonly POWERSPORTS = 've-power';
public readonly TRAILER = 've-trailer';
}
@@ -0,0 +1,42 @@
import {browser, by, element } from 'protractor';
export class SelectLoanPo {
public PAGE_URL = '/';
public readonly CREDIT_CARD_CARD = 'cc-card';
public readonly HOME_EQUITY_CARD = 'he-card';
public readonly VEHICLE_CARD = 've-card';
public readonly PERSONAL_CARD = 'pe-card';
public readonly PREVIOUS_BUTTON = 'previous';
navigateTo() {
return browser.get(this.PAGE_URL);
}
getHeaderBar() {
return element(by.css('lw-navigation'));
}
getPageTitle() {
return browser.getTitle();
}
getTextByClassName(className: string) {
return element(by.className(className)).getText();
}
isElementEnabled(eId: string) {
return element(by.id(eId)).isEnabled();
}
clickCard(eId: string): void {
const card = element(by.id(eId));
card.click();
}
goPrevious(): void {
const nextButton = element(by.id(this.PREVIOUS_BUTTON));
nextButton.click();
}
}
@@ -0,0 +1,107 @@
import { SelectLoanPo } from './pages/select-loan.po';
import { SelectLoanCreditPo } from './pages/select-loan-credit.po';
import { browser } from 'protractor';
import { SelectLoanVehiclePo } from './pages/select-loan-vehicle.po';
import { SelectLoanHomePo } from './pages/select-loan-home.po';
import { SelectLoanPersonalPo } from './pages/select-loan-personal.po';
import { SelectLoanVehicleSubPo } from './pages/select-loan-vehicle-sub.po';
describe('Select Loan', () => {
const landingPage = new SelectLoanPo();
it('should display landing page with correct text and cards', () => {
landingPage.navigateTo();
expect(landingPage.getHeaderBar()).toBeDefined();
const text = landingPage.getTextByClassName('loan-header');
expect(text).toEqual('Start a new loan application');
expect(landingPage.isElementEnabled(landingPage.CREDIT_CARD_CARD)).toEqual(true);
expect(landingPage.isElementEnabled(landingPage.HOME_EQUITY_CARD)).toEqual(true);
expect(landingPage.isElementEnabled(landingPage.PERSONAL_CARD)).toEqual(true);
expect(landingPage.isElementEnabled(landingPage.VEHICLE_CARD)).toEqual(true);
landingPage.clickCard(landingPage.CREDIT_CARD_CARD);
});
it('should display credit card landing page with correct text and cards', () => {
const page = new SelectLoanCreditPo();
expect(page.getHeaderBar()).toBeDefined();
const text = page.getTextByClassName('loan-header');
expect(text).toEqual('Select a credit card type');
expect(page.isElementEnabled(page.CASH_BACK)).toEqual(true);
expect(page.isElementEnabled(page.REWARDS)).toEqual(true);
expect(page.isElementEnabled(page.SECURED)).toEqual(true);
expect(page.isElementEnabled(page.STUDENT)).toEqual(true);
page.clickCard(page.CASH_BACK);
browser.navigate().back();
page.clickCard(page.REWARDS);
browser.navigate().back();
page.clickCard(page.SECURED);
browser.navigate().back();
page.clickCard(page.STUDENT);
browser.navigate().back();
page.goPrevious();
landingPage.clickCard(landingPage.VEHICLE_CARD);
});
it('should display vehicle landing page with correct text and cards', () => {
const page = new SelectLoanVehiclePo();
expect(page.getHeaderBar()).toBeDefined();
const text = page.getTextByClassName('loan-header');
expect(text).toEqual('Select a vehicle type');
expect(page.isElementEnabled(page.BOAT)).toEqual(true);
expect(page.isElementEnabled(page.POWERSPORTS)).toEqual(true);
expect(page.isElementEnabled(page.TRAILER)).toEqual(true);
expect(page.isElementEnabled(page.AUTO)).toEqual(true);
page.clickCard(page.BOAT);
browser.navigate().back();
page.clickCard(page.POWERSPORTS);
browser.navigate().back();
page.clickCard(page.TRAILER);
browser.navigate().back();
page.clickCard(page.AUTO);
});
it('should display vehicle sub landing page with correct text and cards', () => {
const page = new SelectLoanVehicleSubPo();
expect(page.getHeaderBar()).toBeDefined();
const text = page.getTextByClassName('loan-header');
expect(text).toEqual('Select a vehicle type');
expect(page.isElementEnabled(page.LOAN)).toEqual(true);
expect(page.isElementEnabled(page.PRE)).toEqual(true);
page.clickCard(page.LOAN);
browser.navigate().back();
page.clickCard(page.PRE);
browser.navigate().back();
page.goPrevious();
page.goPrevious();
landingPage.clickCard(landingPage.HOME_EQUITY_CARD);
});
it('should display home equity landing page with correct text and cards', () => {
const page = new SelectLoanHomePo();
expect(page.getHeaderBar()).toBeDefined();
const text = page.getTextByClassName('loan-header');
expect(text).toEqual('Select a home equity type');
expect(page.isElementEnabled(page.HOME_EQUITY)).toEqual(true);
expect(page.isElementEnabled(page.MANU_HOME)).toEqual(true);
expect(page.isElementEnabled(page.MORT_REFI)).toEqual(true);
expect(page.isElementEnabled(page.HELOC)).toEqual(true);
page.clickCard(page.HOME_EQUITY);
browser.navigate().back();
page.clickCard(page.MANU_HOME);
browser.navigate().back();
page.clickCard(page.MORT_REFI);
browser.navigate().back();
page.clickCard(page.HELOC);
browser.navigate().back();
page.goPrevious();
landingPage.clickCard(landingPage.PERSONAL_CARD);
});
it('should start personal loan ', () => {
const page = new SelectLoanPersonalPo();
expect(page.getHeaderBar()).toBeDefined();
browser.navigate().back();
expect(landingPage.getHeaderBar()).toBeDefined();
});
});
@@ -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();
});
}
}
@@ -0,0 +1,34 @@
import { by, element, promise } from 'protractor';
import { PageObjectTools } from '../../shared/page-object-tools';
export class SignatureDisclosuresPagePo {
public readonly PAGE_URL = '/loan-wizard/sl/pe/disclosures';
public readonly DISCLOSE_TRUTHFUL = 'truthful';
public readonly DISCLOSE_CONTACT = 'contact';
public readonly NEXT_BUTTON = 'buttonNext';
public readonly ALL_FIELDS = [
this.DISCLOSE_TRUTHFUL, this.DISCLOSE_CONTACT,
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 submit(): void {
const nextButton = element(by.id(this.NEXT_BUTTON));
nextButton.click();
}
public fillFieldsMinimal(): void {
const truthful = element(by.id(this.DISCLOSE_TRUTHFUL));
PageObjectTools.clickCheckBox(truthful);
}
}
@@ -0,0 +1,92 @@
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 SignaturePageOnePo {
public readonly PAGE_URL = '/loan-wizard/sl/pe/step-1';
public readonly LIMIT_REQUESTED = 'inputLimitRequested';
public readonly PURPOSE_OF_LOAN_SIGNATURE = 'inputPurposeOfLoanSignature';
public readonly ANOTHER_PERSON = 'inputApplicantType';
public readonly LIVE_IN_WI = 'inputLivesInMaritalPropertyState';
public readonly JOINT_CREDIT = 'inputConfirmJointCredit';
public readonly SELECT_TERM = 'inputTerm';
public readonly CO_APP_LIVE_IN_WI = 'inputCoAppLivesInMaritalPropertyState';
public readonly NEXT_BUTTON = 'buttonNext';
public readonly MODAL_CLOSE_BUTTON = 'modalCloseButton';
public readonly MODAL_OKAY_BUTTON = 'modalOkayButton';
public readonly ALL_FIELDS = [this.SELECT_TERM, this.LIMIT_REQUESTED, this.ANOTHER_PERSON, this.LIVE_IN_WI, this.NEXT_BUTTON, this.PURPOSE_OF_LOAN_SIGNATURE];
public readonly HIDDEN_FIELDS_1 = [this.JOINT_CREDIT, this.CO_APP_LIVE_IN_WI];
public readonly MINIMAL_DATA: TestInputSet = [
{ fieldId: this.LIMIT_REQUESTED, fieldValue: 1234, fieldType: TestingInputType.TEXT },
{ fieldId: this.PURPOSE_OF_LOAN_SIGNATURE, fieldValue: "Other", fieldType: TestingInputType.TEXT},
{ fieldId: this.ANOTHER_PERSON, fieldValue: 1, fieldType: TestingInputType.RADIO },
{ fieldId: this.LIVE_IN_WI, fieldValue: 1, fieldType: TestingInputType.RADIO },
{ fieldId: this.SELECT_TERM, fieldValue: 1, fieldType: TestingInputType.SELECT }
];
public readonly MAXIMUM_DATA: TestInputSet = [
{ fieldId: this.LIMIT_REQUESTED, fieldValue: 1234, fieldType: TestingInputType.TEXT },
{ fieldId: this.PURPOSE_OF_LOAN_SIGNATURE, fieldValue: "Other", 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.SELECT_TERM, fieldValue: 1, fieldType: TestingInputType.SELECT }
];
public readonly JOINT_CREDIT_DATA: TestInputSet = [
{ fieldId: this.ANOTHER_PERSON, fieldValue: 0, fieldType: TestingInputType.RADIO },
{ fieldId: this.JOINT_CREDIT, 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 canClickDropdown(): promise.Promise<boolean> {
const dropdown = element(by.id(this.SELECT_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 fillFieldsForFailureToConfirmJointCredit(): void {
PageObjectTools.fillFields(this.JOINT_CREDIT_DATA);
}
public dismissModalByOkayButton(): void {
const modalOkayButton = element(by.id(this.MODAL_OKAY_BUTTON));
modalOkayButton.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.LIMIT_REQUESTED);
}
}
@@ -0,0 +1,156 @@
import { browser } from 'protractor';
import { SignaturePageOnePo } from './pages/page-one.po';
import { ContactPagePo } from '../shared/pages/contact-page.po';
import { PageObjectTools } from '../shared/page-object-tools';
import { ResidencePagePo } from '../shared/pages/residence-page.po';
import { EmploymentPagePo } from '../shared/pages/employment-page.po';
import { SignatureDisclosuresPagePo } from './pages/page-disclosures.po';
import { SummaryPagePo } from '../shared/pages/summary-page.po';
import { SpouseTypePagePo } from '../shared/pages/spouse-type-page.po';
describe('It should create a signature loan application for 4 full info individuals', () => {
it('should accept maximum inputs for page 1 (Member/Loan Type)', () => {
const page = new SignaturePageOnePo();
browser.get(page.PAGE_URL);
browser.sleep(1000);
expect(page.getFocusedElement()).toEqual(page.getFirstElement());
let inputArray = PageObjectTools.findFieldsInPageByIdArray(page.ALL_FIELDS);
expect(inputArray.length).toEqual(page.ALL_FIELDS.length);
expect(page.canClickDropdown()).toEqual(false);
expect(page.canGoNext()).toEqual(false);
page.fillFieldsMaximum();
inputArray = PageObjectTools.findFieldsInPageByIdArray([...page.ALL_FIELDS, ...page.HIDDEN_FIELDS_1]);
expect(inputArray.length).toEqual(page.ALL_FIELDS.length + page.HIDDEN_FIELDS_1.length);
expect(page.canClickDropdown()).toEqual(true);
expect(page.canGoNext()).toEqual(true);
page.submit();
});
it('should accept minimum inputs for page 2.A (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.fillFieldsPrimaryMarriedButNotMarriedToCoApplicant();
expect(page.canGoNext()).toEqual(true);
page.submit();
});
it('should accept minimum inputs for page 3.A (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.fillFieldsMinimalLivingInWI();
expect(page.canGoNext()).toEqual(true);
page.submit();
});
it('should accept minimum inputs for page 4.A (Employment)', () => {
const page = new EmploymentPagePo();
expect(page.canGoNext()).toEqual(true);
page.submit();
});
it('should accept FULL INFO SPOUSE input for Applicant spouse type page', () => {
const page = new SpouseTypePagePo();
expect(page.canGoNext()).toEqual(false);
page.fillFieldsFullInfoSpouse();
expect(page.canGoNext()).toEqual(true);
page.submit();
});
it('should accept minimum inputs for page 2.B (Applicant\'s Spouse Personal Info)', () => {
const page = new ContactPagePo();
expect(page.canGoNext()).toEqual(false);
page.fillFieldsMinimalNoMarital();
expect(page.canGoNext()).toEqual(true);
page.submit();
});
it('should accept minimum inputs for page 3.B (Applicant\'s Spouse Residence)', () => {
const page = new ResidencePagePo();
page.markAddressSame();
expect(page.canGoNext()).toEqual(true);
page.submit();
});
it('should accept minimum inputs for page 4.B (Applicant\'s Spouse Employment)', () => {
const page = new EmploymentPagePo();
expect(page.canGoNext()).toEqual(true);
page.submit();
});
it('should accept maximum inputs for page 2.C (Co-Applicant Personal Info)', () => {
const page = new ContactPagePo();
expect(page.canGoNext()).toEqual(false);
page.fillFieldsMaximumCoApplicantNonPrimary();
expect(page.canGoNext()).toEqual(true);
page.submit();
});
it('should accept minimum inputs for page 3.C (Co-applicant Residence)', () => {
const page = new ResidencePagePo();
expect(page.canGoNext()).toEqual(false);
page.fillFieldsMinimalLivingInWI();
expect(page.canGoNext()).toEqual(true);
page.submit();
});
it('should accept minimum inputs for page 4.C (Co-applicant Employment)', () => {
const page = new EmploymentPagePo();
expect(page.canGoNext()).toEqual(true);
page.submit();
});
it('should accept FULL INFO SPOUSE input for CoApplicant spouse type page', () => {
const page = new SpouseTypePagePo();
expect(page.canGoNext()).toEqual(false);
page.fillFieldsFullInfoSpouse();
expect(page.canGoNext()).toEqual(true);
page.submit();
});
it('should accept minimum inputs for page 2.D (CoApplicant\'s Spouse Personal Info)', () => {
const page = new ContactPagePo();
expect(page.canGoNext()).toEqual(false);
page.fillFieldsMinimalNoMarital();
expect(page.canGoNext()).toEqual(true);
page.submit();
});
it('should accept minimum inputs for page 3.D (CoApplicant\'s Spouse Residence)', () => {
const page = new ResidencePagePo();
page.markAddressSame();
expect(page.canGoNext()).toEqual(true);
page.submit();
});
it('should accept minimum inputs for page 4.D (CoApplicant\'s Spouse Employment)', () => {
const page = new EmploymentPagePo();
expect(page.canGoNext()).toEqual(true);
page.submit();
});
it('should maximum inputs for page 5 (Disclosures)', () => {
const page = new SignatureDisclosuresPagePo();
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,127 @@
import { browser } from 'protractor';
import { ContactPagePo } from '../shared/pages/contact-page.po';
import { PageObjectTools } from '../shared/page-object-tools';
import { ResidencePagePo } from '../shared/pages/residence-page.po';
import { EmploymentPagePo } from '../shared/pages/employment-page.po';
import { WizardPagePo } from '../shared/pages/wizard-page.po';
import { SignaturePageOnePo } from './pages/page-one.po';
import { SignatureDisclosuresPagePo } from './pages/page-disclosures.po';
describe('It should allow free navigation of a completed signature loan application', () => {
it('should accept maximum inputs for page 1.', () => {
const page = new SignaturePageOnePo();
browser.get(page.PAGE_URL);
expect(page.canClickDropdown()).toEqual(false);
page.fillFieldsMaximum();
expect(page.canClickDropdown()).toEqual(true);
expect(page.canGoNext()).toEqual(true);
page.submit();
});
it('should accept maximum inputs for page 2 (Personal Info)', () => {
const page = new ContactPagePo();
page.fillFieldsMaximumCoApplicant();
expect(page.canGoNext()).toEqual(true);
page.submit();
});
it('should accept maximum inputs for page 3 (Residence)', () => {
const page = new ResidencePagePo();
page.fillFieldsMinimal();
page.showMailingAddress();
page.showSecondAddress();
page.fillAdditionalFieldsMaximum();
expect(page.canGoNext()).toEqual(true);
page.submit();
});
it('should accept maximum inputs for page 4 (Employment)', () => {
const page = new EmploymentPagePo();
page.showEmploymentFields();
page.showOtherIncomeFields();
page.showChildSupportFields();
page.fillFieldsMaximum();
expect(page.canGoNext()).toEqual(false);
page.fillChildSupportFields();
page.fillOtherIncomeFields();
page.markSingleIncomeNotEnough();
expect(page.canGoNext()).toEqual(true);
page.submit();
});
it('should accept maximum inputs for page 2.A (Co-Applicant Personal Info)', () => {
const page = new ContactPagePo();
page.fillFieldsMaximum();
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 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 maximum inputs for page 5 (Disclosures)', () => {
const page = new SignatureDisclosuresPagePo();
page.fillFieldsMinimal();
expect(page.canGoNext()).toEqual(true);
});
it('should jump back to the beginning.', () => {
const urlList = [
'http://localhost:4200/loan-wizard/sl/pe/co-applicant-financial',
'http://localhost:4200/loan-wizard/sl/pe/co-applicant-residential',
'http://localhost:4200/loan-wizard/sl/pe/co-applicant-personal',
'http://localhost:4200/loan-wizard/sl/pe/step-4',
'http://localhost:4200/loan-wizard/sl/pe/step-3',
'http://localhost:4200/loan-wizard/sl/pe/step-2',
'http://localhost:4200/loan-wizard/sl/pe/step-1'
];
const page = new WizardPagePo();
urlList.forEach((eachUrl) => {
expect(page.canGoPrevious()).toEqual(true);
page.goPrevious();
browser.getCurrentUrl().then((newUrl) => {
expect(newUrl).toEqual(eachUrl);
});
expect(page.canGoNext()).toEqual(true);
}, this);
});
});
@@ -0,0 +1,141 @@
import { browser } from 'protractor';
import { SignaturePageOnePo } from './pages/page-one.po';
import { ContactPagePo } from '../shared/pages/contact-page.po';
import { PageObjectTools } from '../shared/page-object-tools';
import { ResidencePagePo } from '../shared/pages/residence-page.po';
import { EmploymentPagePo } from '../shared/pages/employment-page.po';
import { SummaryPagePo } from '../shared/pages/summary-page.po';
import { SignatureDisclosuresPagePo } from './pages/page-disclosures.po';
import { protractor } from 'protractor/built/ptor';
describe('It should create a maximum signature loan application ', () => {
it('should accept maximum inputs for page 1 (Member/Loan Type)', () => {
const page = new SignaturePageOnePo();
browser.get(page.PAGE_URL);
browser.sleep(1000);
expect(page.getFocusedElement()).toEqual(page.getFirstElement());
let inputArray = PageObjectTools.findFieldsInPageByIdArray(page.ALL_FIELDS);
expect(inputArray.length).toEqual(page.ALL_FIELDS.length);
expect(page.canClickDropdown()).toEqual(false);
expect(page.canGoNext()).toEqual(false);
page.fillFieldsMaximum();
inputArray = PageObjectTools.findFieldsInPageByIdArray([...page.ALL_FIELDS, ...page.HIDDEN_FIELDS_1]);
expect(inputArray.length).toEqual(page.ALL_FIELDS.length + page.HIDDEN_FIELDS_1.length);
expect(page.canClickDropdown()).toEqual(true);
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();
page.showMailingAddress();
page.showSecondAddress();
page.fillAdditionalFieldsMaximum();
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);
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();
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 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();
expect(page.canGoNext()).toEqual(true);
page.submit();
});
it('should maximum inputs for page 5 (Disclosures)', () => {
const page = new SignatureDisclosuresPagePo();
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,78 @@
import { browser } from 'protractor';
import { ContactPagePo } from '../shared/pages/contact-page.po';
import { PageObjectTools } from '../shared/page-object-tools';
import { ResidencePagePo } from '../shared/pages/residence-page.po';
import { EmploymentPagePo } from '../shared/pages/employment-page.po';
import { SummaryPagePo } from '../shared/pages/summary-page.po';
import { SignaturePageOnePo } from './pages/page-one.po';
import { SignatureDisclosuresPagePo } from './pages/page-disclosures.po';
describe('It should create a minimal signature loan application ', () => {
it('should accept basic inputs for page 1 (Member/Loan Type)', () => {
const page = new SignaturePageOnePo();
browser.get(page.PAGE_URL);
browser.sleep(1000);
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);
expect(page.canClickDropdown()).toEqual(false);
page.fillFieldsMinimal();
expect(page.canClickDropdown()).toEqual(true);
expect(page.canGoNext()).toEqual(true);
page.fillFieldsForFailureToConfirmJointCredit();
expect(page.canGoNext()).toEqual(false);
page.dismissModalByOkayButton();
expect(page.canGoNext()).toEqual(true);
page.submit();
});
it('should accept basic 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.fillFieldsMinimal();
expect(page.canGoNext()).toEqual(true);
page.submit();
});
it('should accept basic 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 basic inputs for page 4 (Employment)', () => {
const page = new EmploymentPagePo();
const inputArray = PageObjectTools.findFieldsInPageByIdArray(page.STARTING_FIELDS);
expect(inputArray.length).toEqual(page.STARTING_FIELDS.length);
expect(page.canGoNext()).toEqual(true);
page.submit();
});
it('should accept basic inputs for page 5 (Disclosures)', () => {
const page = new SignatureDisclosuresPagePo();
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,132 @@
import { browser } from 'protractor';
import { SignaturePageOnePo } from './pages/page-one.po';
import { ContactPagePo } from '../shared/pages/contact-page.po';
import { PageObjectTools } from '../shared/page-object-tools';
import { ResidencePagePo } from '../shared/pages/residence-page.po';
import { EmploymentPagePo } from '../shared/pages/employment-page.po';
import { SignatureDisclosuresPagePo } from './pages/page-disclosures.po';
import { SummaryPagePo } from '../shared/pages/summary-page.po';
import { SpouseTypePagePo } from '../shared/pages/spouse-type-page.po';
import { TattleSpousePagePo } from '../shared/pages/tattle-spouse-page.po';
describe('It should create a signature loan application for 2 full info individuals + 2 tattle spouses', () => {
it('should accept maximum inputs for page 1 (Member/Loan Type)', () => {
const page = new SignaturePageOnePo();
browser.get(page.PAGE_URL);
browser.sleep(1000);
expect(page.getFocusedElement()).toEqual(page.getFirstElement());
let inputArray = PageObjectTools.findFieldsInPageByIdArray(page.ALL_FIELDS);
expect(inputArray.length).toEqual(page.ALL_FIELDS.length);
expect(page.canClickDropdown()).toEqual(false);
expect(page.canGoNext()).toEqual(false);
page.fillFieldsMaximum();
inputArray = PageObjectTools.findFieldsInPageByIdArray([...page.ALL_FIELDS, ...page.HIDDEN_FIELDS_1]);
expect(inputArray.length).toEqual(page.ALL_FIELDS.length + page.HIDDEN_FIELDS_1.length);
expect(page.canClickDropdown()).toEqual(true);
expect(page.canGoNext()).toEqual(true);
page.submit();
});
it('should accept minimum inputs for page 2.A (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.fillFieldsPrimaryMarriedButNotMarriedToCoApplicant();
expect(page.canGoNext()).toEqual(true);
page.submit();
});
it('should accept minimum inputs for page 3.A (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.fillFieldsMinimalLivingInWI();
expect(page.canGoNext()).toEqual(true);
page.submit();
});
it('should accept minimum inputs for page 4.A (Employment)', () => {
const page = new EmploymentPagePo();
expect(page.canGoNext()).toEqual(true);
page.submit();
});
it('should accept TATTLE SPOUSE input for Applicant spouse type page', () => {
const page = new SpouseTypePagePo();
expect(page.canGoNext()).toEqual(false);
page.fillFieldsTattleSpouse();
expect(page.canGoNext()).toEqual(true);
page.submit();
});
it('should accept minimum inputs for tattle spouse page (Applicant\'s Spouse Tattle Info)', () => {
const page = new TattleSpousePagePo();
expect(page.canGoNext()).toEqual(false);
page.fillFieldsMinimal();
expect(page.canGoNext()).toEqual(true);
page.submit();
});
it('should accept maximum inputs for page 2.C (Co-Applicant Personal Info)', () => {
const page = new ContactPagePo();
expect(page.canGoNext()).toEqual(false);
page.fillFieldsMaximumCoApplicantNonPrimary();
expect(page.canGoNext()).toEqual(true);
page.submit();
});
it('should accept minimum inputs for page 3.C (Co-applicant Residence)', () => {
const page = new ResidencePagePo();
expect(page.canGoNext()).toEqual(false);
page.fillFieldsMinimalLivingInWI();
expect(page.canGoNext()).toEqual(true);
page.submit();
});
it('should accept minimum inputs for page 4.C (Co-applicant Employment)', () => {
const page = new EmploymentPagePo();
expect(page.canGoNext()).toEqual(true);
page.submit();
});
it('should accept TATTLE SPOUSE input for CoApplicant spouse type page', () => {
const page = new SpouseTypePagePo();
expect(page.canGoNext()).toEqual(false);
page.fillFieldsTattleSpouse();
expect(page.canGoNext()).toEqual(true);
page.submit();
});
it('should accept minimum inputs for tattle spouse page (CoApplicant\'s Spouse Tattle Info)', () => {
const page = new TattleSpousePagePo();
expect(page.canGoNext()).toEqual(false);
page.fillFieldsMinimal();
expect(page.canGoNext()).toEqual(true);
page.submit();
});
it('should maximum inputs for page 5 (Disclosures)', () => {
const page = new SignatureDisclosuresPagePo();
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,77 @@
import { browser, by, element, ElementFinder, protractor, promise } from 'protractor';
import { PageObjectTools } from '../../shared/page-object-tools';
import { TestInputSet, TestInputCommand, TestingInputType } from '../../shared/data-driven/test-input-command';
export class VehiclePageOnePo {
public readonly PAGE_URL = '/loan-wizard/ve/auto/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 NEXT_BUTTON = 'buttonNext';
public readonly MODAL_CLOSE_BUTTON = 'modalCloseButton';
public readonly MODAL_OKAY_BUTTON = 'modalOkayButton';
public readonly ALL_FIELDS = [this.LIMIT_REQUESTED, this.ANOTHER_PERSON, this.LIVE_IN_WI, this.NEXT_BUTTON];
public readonly HIDDEN_FIELDS_1 = [this.JOINT_CREDIT, this.CO_APP_LIVE_IN_WI];
public readonly MINIMAL_DATA: TestInputSet = [
{ fieldId: this.LIMIT_REQUESTED, fieldValue: 54321, fieldType: TestingInputType.TEXT },
{ fieldId: this.ANOTHER_PERSON, fieldValue: 1, fieldType: TestingInputType.RADIO },
{ fieldId: this.LIVE_IN_WI, fieldValue: 1, fieldType: TestingInputType.RADIO }
];
public readonly MAXIMUM_DATA: TestInputSet = [
{ fieldId: this.LIMIT_REQUESTED, fieldValue: 54321, 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 }
];
public readonly JOINT_CREDIT_DATA: TestInputSet = [
{ fieldId: this.ANOTHER_PERSON, fieldValue: 0, fieldType: TestingInputType.RADIO },
{ fieldId: this.JOINT_CREDIT, 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 fillFieldsForFailureToConfirmJointCredit(): void {
PageObjectTools.fillFields(this.JOINT_CREDIT_DATA);
}
public dismissModalByOkayButton(): void {
const modalOkayButton = element(by.id(this.MODAL_OKAY_BUTTON));
modalOkayButton.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.LIMIT_REQUESTED);
}
}
@@ -0,0 +1,152 @@
import { browser, protractor } from 'protractor';
import { PageObjectTools } from '../shared/page-object-tools';
import { VehiclePageOnePo } 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 { SummaryPagePo } from '../shared/pages/summary-page.po';
import { CreditCardDisclosuresPagePo } from '../credit-card/pages/page-disclosures.po';
import { VehicleCollateralPagePo } from '../shared/pages/vehicle-collateral-page.po';
describe('It should create a maximum vehicle application ', () => {
it('should accept maximum inputs for page 1 (Member/Loan Type)', () => {
const page = new VehiclePageOnePo();
browser.get(page.PAGE_URL);
browser.sleep(1000);
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);
page.fillFieldsMaximum();
inputArray = PageObjectTools.findFieldsInPageByIdArray([...page.ALL_FIELDS, ...page.HIDDEN_FIELDS_1]);
expect(inputArray.length).toEqual(page.ALL_FIELDS.length + page.HIDDEN_FIELDS_1.length);
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 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();
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 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();
expect(page.canGoNext()).toEqual(true);
page.submit();
});
it('should accept maximum inputs for page 4.B (Vehicle Collateral)', () => {
const page = new VehicleCollateralPagePo();
const EC = protractor.ExpectedConditions;
browser.wait(EC.visibilityOf(page.getFirstElement()), 5000).then(() => {});
expect(page.getFocusedElement()).toEqual(page.getFirstElement());
const inputArray = PageObjectTools.findFieldsInPageByIdArray(page.ALL_FIELDS);
expect(inputArray.length).toEqual(page.ALL_FIELDS.length);
expect(page.canClickDropdown()).toEqual(false);
expect(page.canGoNext()).toEqual(false);
page.fillFieldsMaximum();
expect(page.canClickDropdown()).toEqual(true);
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,96 @@
import { browser } from 'protractor';
import { PageObjectTools } from '../shared/page-object-tools';
import { VehiclePageOnePo } 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 { SummaryPagePo } from '../shared/pages/summary-page.po';
import { CreditCardDisclosuresPagePo } from '../credit-card/pages/page-disclosures.po';
import { VehicleCollateralPagePo } from '../shared/pages/vehicle-collateral-page.po';
describe('It should create a minimal vehicle application ', () => {
it('should accept basic inputs for page 1 (Member/Loan Type)', () => {
const page = new VehiclePageOnePo();
browser.get(page.PAGE_URL);
browser.sleep(1000);
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.fillFieldsMinimal();
expect(page.canGoNext()).toEqual(true);
page.fillFieldsForFailureToConfirmJointCredit();
expect(page.canGoNext()).toEqual(false);
page.dismissModalByOkayButton();
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 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 collateral page 4.A (Vehicle Collateral)', () => {
const page = new VehicleCollateralPagePo();
expect(page.getFocusedElement()).toEqual(page.getFirstElement());
const inputArray = PageObjectTools.findFieldsInPageByIdArray(page.ALL_FIELDS);
expect(inputArray.length).toEqual(page.ALL_FIELDS.length);
expect(page.canClickDropdown()).toEqual(false);
expect(page.canGoNext()).toEqual(false);
page.fillFieldsMinimal();
expect(page.canClickDropdown()).toEqual(true);
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);
});
});