-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
migrate cypress tests over to cypress folder
- Loading branch information
1 parent
5da94e4
commit 86282e1
Showing
14 changed files
with
1,302 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
module.exports = { | ||
plugins: [ | ||
'cypress' | ||
], | ||
env: { | ||
mocha: true, | ||
'cypress/globals': true | ||
}, | ||
rules: { | ||
strict: 'off' | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
import { generateRequestObject } from '../fixtures/fpcStandaloneRequest'; | ||
import { removeUniqueFields } from '../support/helpers'; | ||
|
||
describe('FPC only application', () => { | ||
const options = { includeFPC: true } | ||
it('Fills eligibility questionnaire', () => { | ||
cy.fillEligibilityQuestionnaire(options) | ||
}) | ||
|
||
it('Accepts valid information for the personal-info page', () => { | ||
cy.fillPersonalInfoPage(options) | ||
}); | ||
|
||
it('Accepts valid information for the spouse page', () => { | ||
cy.fillSpousePage(options) | ||
}); | ||
|
||
it('Accepts valid information for the child page', () => { | ||
cy.fillChildPage(options) | ||
}) | ||
|
||
it('Accepts valid information for the FPC info page', () => { | ||
cy.fillFPCInfoPage() | ||
}) | ||
|
||
it('Accepts valid information for the contact info page', () => { | ||
cy.fillMailingAddress() | ||
}); | ||
|
||
it('Displays the phone number with contact information', () => { | ||
cy.contains('(555) 555-5555') | ||
cy.continue(); | ||
}) | ||
|
||
it('Submits with the expected payload', () => { | ||
cy.fillConsent(options); | ||
cy.submitApplication(); | ||
cy.wait('@submitApplication') | ||
.then(interception => { | ||
expect(removeUniqueFields(interception.request.body)).to.deep.equal(removeUniqueFields(generateRequestObject())) | ||
}); | ||
}); | ||
|
||
it('Redirects user to confirmation page when successful', () => { | ||
cy.url().should('include', 'submission'); | ||
cy.contains('Confirmation of submission') | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
import { generateRequestObject } from '../fixtures/mspStandaloneRequest.js'; | ||
import { removeUniqueFields } from '../support/helpers'; | ||
|
||
describe('MSP only application', () => { | ||
const options = {includeMSP: true} | ||
it('Fills eligibility questionnaire', () => { | ||
cy.fillEligibilityQuestionnaire(options) | ||
}); | ||
|
||
it('Accepts valid information for the personal-info page', () => { | ||
cy.fillPersonalInfoPage(options) | ||
}); | ||
|
||
it('Accepts valid information for the spouse page', () => { | ||
cy.fillSpousePage(options) | ||
}); | ||
|
||
it('Accepts valid information for the child page', () => { | ||
cy.fillChildPage(options) | ||
}); | ||
|
||
it('Accepts valid information for the contact info page', () => { | ||
cy.fillResidentialAddress() | ||
}); | ||
|
||
it('Displays the phone number with contact information', () => { | ||
cy.contains('(555) 555-5555') | ||
cy.continue(); | ||
}); | ||
|
||
it('submits form with expected payload', () => { | ||
cy.fillConsent(options) | ||
cy.submitApplication() | ||
cy.wait('@submitApplication') | ||
.then(interception => { | ||
expect(removeUniqueFields(interception.request.body)).to.deep.equal(removeUniqueFields(generateRequestObject())) | ||
}) | ||
}); | ||
|
||
it('Redirects user to confirmation page when successful', () => { | ||
cy.url().should('include', 'submission'); | ||
cy.contains('Confirmation of submission') | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
import { generateRequestObject } from '../fixtures/sbStandaloneRequest.js'; | ||
import { removeUniqueFields } from '../support/helpers'; | ||
|
||
describe('SB only application', () => { | ||
const options = {includeSB: true} | ||
it('Fills eligibility questionnaire', () => { | ||
cy.fillEligibilityQuestionnaire(options) | ||
}); | ||
|
||
it('Accepts valid information for the personal-info page', () => { | ||
cy.fillPersonalInfoPage(options) | ||
}); | ||
|
||
it('Accepts valid information for the spouse page', () => { | ||
cy.fillSpousePage(options) | ||
}); | ||
|
||
it('Accepts valid information for the supplemental benefits information page', () => { | ||
cy.fillSBInfoPage(options) | ||
}); | ||
|
||
it('Accepts valid information for the documents page', () => { | ||
cy.fillDocumentsPage() | ||
}); | ||
|
||
it('Accepts valid information for the contact info page', () => { | ||
cy.fillMailingAddress() | ||
}); | ||
|
||
it('Displays the phone number with contact information', () => { | ||
cy.contains('(555) 555-5555') | ||
cy.continue(); | ||
}); | ||
|
||
it('submits form with expected payload', () => { | ||
cy.fillConsent(options) | ||
cy.submitApplication() | ||
cy.wait('@submitApplication') | ||
.then(interception => { | ||
expect(removeUniqueFields(interception.request.body)).to.deep.equal(removeUniqueFields(generateRequestObject())) | ||
}) | ||
}); | ||
|
||
it('Redirects user to confirmation page when successful', () => { | ||
cy.url().should('include', 'submission'); | ||
cy.contains('Confirmation of submission') | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
import { generateRequestObject } from '../fixtures/fullApplication.js'; | ||
import { removeUniqueFields } from '../support/helpers'; | ||
|
||
describe('Full application for MSP FPC and SB', () => { | ||
const options = {includeMSP: true, includeFPC: false, includeSB: true} | ||
it('Fills eligibility questionnaire', () => { | ||
cy.fillEligibilityQuestionnaire(options) | ||
}); | ||
|
||
it('Accepts valid information for the personal-info page', () => { | ||
cy.fillPersonalInfoPage(options) | ||
}); | ||
|
||
it('Accepts valid information for the spouse page', () => { | ||
cy.fillSpousePage(options) | ||
}); | ||
|
||
it('Accepts valid information for the child page', () => { | ||
cy.fillChildPage(options) | ||
}); | ||
|
||
it('Accepts valid information for the supplemental benefits information page', () => { | ||
cy.fillSBInfoPage(options) | ||
}); | ||
|
||
it('Accepts valid information for the documents page', () => { | ||
cy.fillDocumentsPage() | ||
}); | ||
|
||
it('Accepts valid information for the contact info page', () => { | ||
cy.fillResidentialAddress() | ||
}); | ||
|
||
it('Displays the phone number with contact information', () => { | ||
cy.contains('(555) 555-5555') | ||
cy.continue(); | ||
}); | ||
|
||
it('submits form with expected payload', () => { | ||
cy.fillConsent(options) | ||
cy.submitApplication() | ||
cy.wait('@submitApplication') | ||
.then(interception => { | ||
expect(removeUniqueFields(interception.request.body)).to.deep.equal(removeUniqueFields(generateRequestObject())) | ||
}) | ||
}); | ||
|
||
it('Redirects user to confirmation page when successful', () => { | ||
cy.url().should('include', 'submission'); | ||
cy.contains('Confirmation of submission') | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
// import { generateRequestObject } from '../fixtures/fullApplication.js'; | ||
// import { removeUniqueFields } from '../helpers'; | ||
|
||
describe('Full application for MSP FPC and SB', () => { | ||
// const options = {includeMSP: true, includeFPC: false, includeSB: true} | ||
it('Navigates the MSP Elibility page', () => { | ||
const eligibilityError = "Please complete the questionnaire to continue."; | ||
cy.visit("/msp-eligibility"); | ||
cy.location().should((loc) => { | ||
expect(loc.pathname).to.eq("/ahdc/msp-eligibility"); | ||
}); | ||
cy.get("[data-cy=apply-msp-yes]").click({ | ||
force: true, | ||
}); | ||
cy.get("[data-cy=continue]").click(); | ||
cy.contains(eligibilityError); | ||
cy.get("[data-cy=live-in-bc-no]").click({ | ||
force: true, | ||
}); | ||
cy.contains("you may not be eligible for MSP or related income-based programs."); | ||
}); | ||
|
||
// it('Fills eligibility questionnaire', () => { | ||
// cy.fillEligibilityQuestionnaire(options) | ||
// }); | ||
|
||
// it('Accepts valid information for the personal-info page', () => { | ||
// cy.fillPersonalInfoPage(options) | ||
// }); | ||
|
||
// it('Accepts valid information for the spouse page', () => { | ||
// cy.fillSpousePage(options) | ||
// }); | ||
|
||
// it('Accepts valid information for the child page', () => { | ||
// cy.fillChildPage(options) | ||
// }); | ||
|
||
// it('Accepts valid information for the supplemental benefits information page', () => { | ||
// cy.fillSBInfoPage(options) | ||
// }); | ||
|
||
// it('Accepts valid information for the documents page', () => { | ||
// cy.fillDocumentsPage() | ||
// }); | ||
|
||
// it('Accepts valid information for the contact info page', () => { | ||
// cy.fillResidentialAddress() | ||
// }); | ||
|
||
// it('Displays the phone number with contact information', () => { | ||
// cy.contains('(555) 555-5555') | ||
// cy.continue(); | ||
// }); | ||
|
||
// it('submits form with expected payload', () => { | ||
// cy.fillConsent(options) | ||
// cy.submitApplication() | ||
// cy.wait('@submitApplication') | ||
// .then(interception => { | ||
// expect(removeUniqueFields(interception.request.body)).to.deep.equal(removeUniqueFields(generateRequestObject())) | ||
// }) | ||
// }); | ||
|
||
// it('Redirects user to confirmation page when successful', () => { | ||
// cy.url().should('include', 'submission'); | ||
// cy.contains('Confirmation of submission') | ||
// }); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
import { formatISODate } from 'common-lib-vue'; | ||
|
||
export const generateRequestObject = () => { | ||
const currentDate = new Date(); | ||
|
||
return { | ||
"firstName": "alex", | ||
"secondName": "jaimie", | ||
"lastName": "doe", | ||
"sin": "238795439", | ||
"phn": "9999999998", | ||
"gender": null, | ||
"birthDate": "2000-01-01", | ||
"telephone": "5555555555", | ||
"addressLine1": "123 fake st.", | ||
"addressLine2": null, | ||
"addressLine3": null, | ||
"city": "duncan", | ||
"postalCode": "V8P1A1", | ||
"provinceOrState": "British Columbia", | ||
"country": "Canada", | ||
"authorizedByApplicant": "Y", | ||
"powerOfAttorney": "N", | ||
"spousePowerOfAttorney": "N", | ||
"authorizedBySpouse": "Y", | ||
"spouse": { | ||
"firstName": "sarah", | ||
"secondName": "jaimie", | ||
"lastName": "doe", | ||
"gender": null, | ||
"birthDate": "1990-06-20", | ||
"telephone": "5555555555", | ||
"sin": "195544135", | ||
"phn": "9348671676" | ||
}, | ||
"fairPharmaCare": { | ||
"uuid": "1f630383-be09-4bbf-b980-a516ce6ffb6f", | ||
"clientName": null, | ||
"processDate": formatISODate(currentDate), | ||
"accountHolderNetIncome": "20000", | ||
"accountHolderRDSP": "2000", | ||
"spouseNetIncome": "20000", | ||
"spouseRDSP": "2000", | ||
"spousePostalCode": "V8P1A1", | ||
"persons": [ | ||
{ | ||
"givenName": "ralph", | ||
"surname": "wiggum", | ||
"postalCode": "V8P1A1", | ||
"perType": "2", | ||
"dateOfBirth": "2019-02-01", | ||
"phn": "9344507929" | ||
} | ||
], | ||
"attachments": [], | ||
"familyNumber": null, | ||
"deductibleAmount": null, | ||
"annualMaximumAmount": null, | ||
"copayPercentage": null | ||
} | ||
} | ||
} |
Oops, something went wrong.