Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: add autofill cypress test #4607

Merged
merged 23 commits into from
Jan 31, 2025
Merged
Show file tree
Hide file tree
Changes from 16 commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
a9f4d14
test: update cypress test steps to include conditional autofill logic
adriencyberspace Jan 22, 2025
437fbe8
test: run autofill test after regular test (broken)
adriencyberspace Jan 22, 2025
c1e52d8
test: change second test to Elm Village for continuity
adriencyberspace Jan 22, 2025
ce79372
test: remove zeros from mock bday months
adriencyberspace Jan 22, 2025
f626b4e
test: edit command conditionals based on actual autofill logic and ad…
adriencyberspace Jan 22, 2025
dde4c16
chore: move cy.wait into autofill only conditional and move step 12 t…
adriencyberspace Jan 23, 2025
f1ae40b
test: create blue sky specific autofill application and run that afte…
adriencyberspace Jan 23, 2025
43099d4
chore: add BlueSkyProgramsAndPreferences to minimalDataApplication
adriencyberspace Jan 23, 2025
f62f7d2
chore: remove only from test
adriencyberspace Jan 23, 2025
08e13aa
chore: pull nextStep logic out of function argument
adriencyberspace Jan 24, 2025
b272929
chore: wait 1 second on step 6 autofill
adriencyberspace Jan 24, 2025
de459bb
chore: remove cy.log and put autofill logic back in arg
adriencyberspace Jan 24, 2025
831dfb0
Merge branch 'main' into 3385/cypress-autofill
adriencyberspace Jan 24, 2025
8f78113
test: add pathname checks before and after problematic line
adriencyberspace Jan 24, 2025
9b55ea7
Merge branch '3385/cypress-autofill' of https://github.com/bloom-hous…
adriencyberspace Jan 24, 2025
4f84a2b
test: conditional isNextRouteValid call because using skip arg was in…
adriencyberspace Jan 24, 2025
2c9d77e
test: grab text to slow down step 6 during autofill
adriencyberspace Jan 24, 2025
a8c87cb
test: run step6 only if not autofill
adriencyberspace Jan 28, 2025
9034e9e
test: select text instead of cy.wait() to slow app down
adriencyberspace Jan 28, 2025
055715b
Merge branch 'main' into 3385/cypress-autofill
adriencyberspace Jan 28, 2025
277cb08
Merge branch 'main' into 3385/cypress-autofill
adriencyberspace Jan 30, 2025
3ea30e5
test: rm minimalApplication, pass empty programs array, don't skip ho…
adriencyberspace Jan 31, 2025
28c4e86
Merge branch 'main' into 3385/cypress-autofill
adriencyberspace Jan 31, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 4 additions & 7 deletions sites/public/cypress/e2e/pages/submit-application.spec.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { ElmVillageApplication, minimalDataApplication } from "../../mockData/applicationData"
import { ElmVillageApplication, autofillBlueSkyApplication } from "../../mockData/applicationData"

describe("Submit", function () {
it("should submit an application for the Elm Village listing", function () {
it("should submit an application for the Elm Village listing, then autofill and submit an application for Blue Sky Apartments", function () {
cy.intercept("GET", "/geocoding/v5/**", { fixture: "address" })
// Interceptor for the address in the preference
cy.intercept(
Expand All @@ -17,10 +17,7 @@ describe("Submit", function () {
}
)

cy.submitApplication("Elm Village", ElmVillageApplication, false, true)
})
it("should submit a minimal application for the Test: Default, No Preferences", function () {
cy.intercept("GET", "/geocoding/v5/**", { fixture: "address" })
cy.submitApplication("Blue Sky Apartments", minimalDataApplication, false, false)
cy.submitApplication("Elm Village", ElmVillageApplication, false, true, false)
cy.submitApplication("Blue Sky Apartments", autofillBlueSkyApplication, true, true, true)
})
})
229 changes: 104 additions & 125 deletions sites/public/cypress/mockData/applicationData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ export const ElmVillageApplication: Application = {
firstName: "First Name",
middleName: "Middle Name",
lastName: "Last Name",
birthMonth: "07",
birthMonth: "7",
birthDay: "17",
birthYear: "1996",
emailAddress: "[email protected]",
Expand Down Expand Up @@ -166,7 +166,7 @@ export const ElmVillageApplication: Application = {
firstName: "Member Name",
middleName: "Member Middle Name",
lastName: "Member Last Name",
birthMonth: "07",
birthMonth: "7",
birthDay: "17",
birthYear: "1996",
householdMemberAddress: {
Expand All @@ -191,42 +191,12 @@ export const ElmVillageApplication: Application = {
},
],
preferredUnitTypes: [
{
...idDefaults,
id: "dff3ff70-7085-4dab-afd9-de4b33e0ec1e",
name: "SRO" as UnitTypeEnum,
numBedrooms: 0,
},
{
...idDefaults,
id: "dff3ff70-7085-4dab-afd9-de4b33e0ec1e",
name: "Studio" as UnitTypeEnum,
numBedrooms: 0,
},
{
...idDefaults,
id: "dff3ff70-7085-4dab-afd9-de4b33e0ec1e",
name: "1 Bedroom" as UnitTypeEnum,
numBedrooms: 1,
},
{
...idDefaults,
id: "dff3ff70-7085-4dab-afd9-de4b33e0ec1e",
name: "2 Bedroom" as UnitTypeEnum,
numBedrooms: 2,
},
{
...idDefaults,
id: "dff3ff70-7085-4dab-afd9-de4b33e0ec1e",
name: "3 Bedroom" as UnitTypeEnum,
numBedrooms: 3,
},
{
...idDefaults,
id: "dff3ff70-7085-4dab-afd9-de4b33e0ec1e",
name: "4 Bedroom" as UnitTypeEnum,
numBedrooms: 3,
},
],
demographics: {
...idDefaults,
Expand Down Expand Up @@ -307,6 +277,107 @@ export const ElmVillageApplication: Application = {
language: LanguagesEnum.en,
}

const BlueSkyProgramsAndPreferences = {
preferences: [],
programs: [
adriencyberspace marked this conversation as resolved.
Show resolved Hide resolved
{
claimed: false,
key: "servedInMilitary",
options: [
{
key: "servedInMilitary",
checked: false,
},
{
key: "doNotConsider",
checked: false,
},
{
key: "preferNotToSay",
checked: false,
},
],
},
{
key: "tay",
claimed: false,
options: [
{
key: "tay",
checked: false,
},
{
key: "doNotConsider",
checked: false,
},
{
key: "preferNotToSay",
checked: false,
},
],
},
{
key: "disabilityOrMentalIllness",
claimed: false,
options: [
{
key: "disabilityOrMentalIllness",
checked: false,
},
{
key: "doNotConsider",
checked: false,
},
{
key: "preferNotToSay",
checked: false,
},
],
},
{
key: "housingSituation",
claimed: false,
options: [
{
key: "notPermanent",
checked: false,
},
{
key: "homeless",
checked: false,
},
{
key: "doNotConsider",
checked: false,
},
{
key: "preferNotToSay",
checked: false,
},
],
},
{
key: "rentBasedOnIncome",
claimed: false,
options: [
{
key: "flatRent",
checked: false,
},
{
key: "30Percent",
checked: false,
},
],
},
] as ApplicationMultiselectQuestion[],
}

export const autofillBlueSkyApplication: Application = {
adriencyberspace marked this conversation as resolved.
Show resolved Hide resolved
...ElmVillageApplication,
...BlueSkyProgramsAndPreferences,
}

export const minimalDataApplication: Application = {
adriencyberspace marked this conversation as resolved.
Show resolved Hide resolved
markedAsDuplicate: false,
...idDefaults,
Expand Down Expand Up @@ -411,99 +482,7 @@ export const minimalDataApplication: Application = {
howDidYouHear: [],
race: [],
},
preferences: [],
programs: [
{
claimed: false,
key: "servedInMilitary",
options: [
{
key: "servedInMilitary",
checked: false,
},
{
key: "doNotConsider",
checked: false,
},
{
key: "preferNotToSay",
checked: false,
},
],
},
{
key: "tay",
claimed: false,
options: [
{
key: "tay",
checked: false,
},
{
key: "doNotConsider",
checked: false,
},
{
key: "preferNotToSay",
checked: false,
},
],
},
{
key: "disabilityOrMentalIllness",
claimed: false,
options: [
{
key: "disabilityOrMentalIllness",
checked: false,
},
{
key: "doNotConsider",
checked: false,
},
{
key: "preferNotToSay",
checked: false,
},
],
},
{
key: "housingSituation",
claimed: false,
options: [
{
key: "notPermanent",
checked: false,
},
{
key: "homeless",
checked: false,
},
{
key: "doNotConsider",
checked: false,
},
{
key: "preferNotToSay",
checked: false,
},
],
},
{
key: "rentBasedOnIncome",
claimed: true,
options: [
{
key: "flatRent",
checked: true,
},
{
key: "30Percent",
checked: true,
},
],
},
] as ApplicationMultiselectQuestion[],
...BlueSkyProgramsAndPreferences,
confirmationCode: "",
status: ApplicationStatusEnum.draft,
submissionType: ApplicationSubmissionTypeEnum.electronical,
Expand Down
Loading