157 lines
6.1 KiB
TypeScript
157 lines
6.1 KiB
TypeScript
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);
|
|
});
|
|
|
|
});
|