Skip to content
This repository has been archived by the owner on May 6, 2024. It is now read-only.

v1.3.3 BEARS Patch Release #981

Merged
merged 41 commits into from
Aug 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
27ec8f6
Add e2e to validate content on accordion cards
nehemiah-abuga Jul 13, 2023
4ad4ccf
[MegaLinter] Apply linters fixes
nehemiah-abuga Jul 13, 2023
4f4b2bd
Merge branch 'main' into 911-e2e-validate-accordion-content
scottqueen-bixal Jul 13, 2023
5a1e823
run tests in pipeline in headed mode
nehemiah-abuga Jul 18, 2023
bb8ef83
upgrade cypress to resolve issues with headless browser run
nehemiah-abuga Jul 19, 2023
862a72c
Added capability for cross-browser support
nehemiah-abuga Jul 20, 2023
b7d7fa2
[MegaLinter] Apply linters fixes
nehemiah-abuga Jul 20, 2023
db8a237
Update README.md
nehemiah-abuga Jul 20, 2023
ddca55b
Merge pull request #943 from GSA/933-fix-failing-test-links-in-pipeline
scottqueen-bixal Jul 20, 2023
c30c112
Merge pull request #945 from GSA/913-cypress-e2e-cross-browser
scottqueen-bixal Jul 20, 2023
4164b44
Merge branch 'main' into 911-e2e-validate-accordion-content
nehemiah-abuga Jul 20, 2023
e921c3a
Merge pull request #934 from GSA/911-e2e-validate-accordion-content
nehemiah-abuga Jul 20, 2023
a2c48ff
Add e2e url based configuration tests to validate benefits display c…
nehemiah-abuga Aug 2, 2023
88a9279
[MegaLinter] Apply linters fixes
nehemiah-abuga Aug 2, 2023
b4e1c99
Merge pull request #971 from GSA/912-cypress-e2e-selected-filters-cri…
scottqueen-bixal Aug 2, 2023
7d0266b
cypress add support for webkit safari browser engine
nehemiah-abuga Aug 2, 2023
b9becaf
add install webkit browser dependencies
nehemiah-abuga Aug 2, 2023
71edb44
update on github yml file
nehemiah-abuga Aug 3, 2023
002f390
update on github yml file
nehemiah-abuga Aug 3, 2023
e2f328d
update on github yml file
nehemiah-abuga Aug 3, 2023
8e5fee5
[MegaLinter] Apply linters fixes
nehemiah-abuga Aug 8, 2023
ab32f7f
updated content
scottqueen-bixal Aug 8, 2023
d028faa
update content
scottqueen-bixal Aug 8, 2023
22d5783
updated content
scottqueen-bixal Aug 8, 2023
818ada3
Merge pull request #974 from GSA/940-cypress-webkit-safari-browser-su…
scottqueen-bixal Aug 8, 2023
276faae
Merge branch 'main' into 949-updated-criteria-requirement-match
scottqueen-bixal Aug 8, 2023
f5191c1
[972] - Add 'webkit' condition to 'Install WebKit browser dependencie…
FatmaBakir Aug 8, 2023
122b904
[972] - Add 'webkit' condition to 'Install WebKit browser dependencie…
FatmaBakir Aug 8, 2023
74c828b
[972] - Add 'webkit' condition to 'Install WebKit browser dependencie…
FatmaBakir Aug 8, 2023
e72bc8d
[972] - Add 'webkit' condition to 'Install WebKit browser dependencie…
FatmaBakir Aug 8, 2023
bc60828
Merge pull request #976 from GSA/949-updated-criteria-requirement-match
scottqueen-bixal Aug 8, 2023
73769a5
[972] - Add 'webkit' condition to 'Install WebKit browser dependencie…
FatmaBakir Aug 9, 2023
84f5520
[972] - Trying Chrome only
FatmaBakir Aug 9, 2023
4bbe805
[972] - Trying Chrome only
FatmaBakir Aug 9, 2023
a13904a
[972] - commenting out ui-render-content.cy.js test
FatmaBakir Aug 9, 2023
a2ae42a
[972] - commenting out ui-render-content.cy.js test for all containers
FatmaBakir Aug 9, 2023
903a5fb
updated package tag
scottqueen-bixal Aug 9, 2023
dfeffe6
Merge branch 'release' into main
scottqueen-bixal Aug 9, 2023
d9d08a5
[972] - Add condition to Install Webkit Browser dependency step
FatmaBakir Aug 9, 2023
67fd569
Merge branch 'main' into 972-task/Support-QA-with-Cypress-Pipeline
FatmaBakir Aug 9, 2023
a866ad9
Merge pull request #982 from GSA/972-task/Support-QA-with-Cypress-Pip…
FatmaBakir Aug 9, 2023
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
20 changes: 16 additions & 4 deletions .github/workflows/cypress.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,14 @@ permissions: read-all

jobs:
install:
name: cypress-e2e-run
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
containers: [chrome, firefox, edge, webkit]

steps:
- name: Checkout
uses: actions/checkout@v3
Expand All @@ -26,6 +32,13 @@ jobs:
- name: Install dependencies
run: npm ci

- name: Install WebKit browser dependencies
if: ${{ (matrix.containers == 'webkit') }}
uses: cypress-io/github-action@v5
with:
build: npx playwright install-deps webkit
runTests: false

- name: Set Branch Based Cypress Config file
env:
SITE_PREFIX: ${{ secrets.SITE_PREFIX }}
Expand All @@ -38,14 +51,13 @@ jobs:
cat cypress.config.js

- name: Cypress run
uses: cypress-io/github-action@v3
uses: cypress-io/github-action@v5
with:
browser: chrome
headless: true
browser: ${{ matrix.containers }}
start: npm run federalist

- uses: actions/upload-artifact@v3
if: always ()
if: failure ()
with:
name: cypress-screenshots
path: cypress/screenshots
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ docker compose down

```bash
# To run cypress tests headlessly
$ npm run cypress:run_chrome
$ npm run cy:run:chrome

# To open Cypress Test Runner and manually run tests
$ npm run cypress:open
Expand Down
3 changes: 2 additions & 1 deletion cypress.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,13 @@ module.exports = defineConfig({
video: false,
retries: {
runMode: 2,
openMode: 2,
openMode: 1,
},
e2e: {
baseUrl: "https://benefits-tool-demo.usa.gov/",
specPattern: "cypress/e2e/**/*.cy.{js,jsx,ts,tsx}",
testIsolation: false,
supportFile: false,
},
experimentalWebKitSupport: true,
})
39 changes: 12 additions & 27 deletions cypress/e2e/ui/accordions.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,12 @@ describe("Validate opening and closing of accordion cards", () => {
pages
.accordions()
.contains(EN_BENEFITS_COVID_19["fema-covid-19-funeral-assistance.title"])
.invoke("prop", "ariaExpanded")
.should("eq", "true")
.should("have.attr", "aria-expanded", "true")
pages.accordions().contains(EN_BENEFITS_COVID_19["fema-covid-19-funeral-assistance.title"]).click()
pages
.accordions()
.contains(EN_BENEFITS_COVID_19["fema-covid-19-funeral-assistance.title"])
.invoke("prop", "ariaExpanded")
.should("eq", "false")
.should("have.attr", "aria-expanded", "false")
})

it("Validate opening and closing of Veteran's Burial Allowance accordion card in Death of a loved one Spanish page", () => {
Expand All @@ -36,14 +34,12 @@ describe("Validate opening and closing of accordion cards", () => {
pages
.accordions()
.contains(ES_BENEFITS_VA_BURIAL_ALLOWANCE["va-burial-allowance.title"])
.invoke("prop", "ariaExpanded")
.should("eq", "true")
.should("have.attr", "aria-expanded", "true")
pages.accordions().contains(ES_BENEFITS_VA_BURIAL_ALLOWANCE["va-burial-allowance.title"]).click()
pages
.accordions()
.contains(ES_BENEFITS_VA_BURIAL_ALLOWANCE["va-burial-allowance.title"])
.invoke("prop", "ariaExpanded")
.should("eq", "false")
.should("have.attr", "aria-expanded", "false")
})

it("Validate opening and closing of Tax Relief Programs for People with Disabilites accordion card in Disabilites English page", () => {
Expand All @@ -52,14 +48,12 @@ describe("Validate opening and closing of accordion cards", () => {
pages
.accordions()
.contains(EN_BENEFITS_IRS_TAX_HELP_DISABILITY["irs-tax-help-disability.title"])
.invoke("prop", "ariaExpanded")
.should("eq", "true")
.should("have.attr", "aria-expanded", "true")
pages.accordions().contains(EN_BENEFITS_IRS_TAX_HELP_DISABILITY["irs-tax-help-disability.title"]).click()
pages
.accordions()
.contains(EN_BENEFITS_IRS_TAX_HELP_DISABILITY["irs-tax-help-disability.title"])
.invoke("prop", "ariaExpanded")
.should("eq", "false")
.should("have.attr", "aria-expanded", "false")
})

it("Validate opening and closing of Social Security Disability Insurance for Spouse accordion card in Disabilites Spanish page", () => {
Expand All @@ -72,33 +66,26 @@ describe("Validate opening and closing of accordion cards", () => {
pages
.accordions()
.contains(ES_BENEFITS_SSA_DISABILITY_INSURANCE_SPOUSE["ssa-disability-insurance-spouse.title"])
.invoke("prop", "ariaExpanded")
.should("eq", "true")
.should("have.attr", "aria-expanded", "true")
pages
.accordions()
.contains(ES_BENEFITS_SSA_DISABILITY_INSURANCE_SPOUSE["ssa-disability-insurance-spouse.title"])
.click()
pages
.accordions()
.contains(ES_BENEFITS_SSA_DISABILITY_INSURANCE_SPOUSE["ssa-disability-insurance-spouse.title"])
.invoke("prop", "ariaExpanded")
.should("eq", "false")
.should("have.attr", "aria-expanded", "false")
})

it("Validate opening and closing of Veteran's Pension accordion card in Retirement English page", () => {
pages.otherBenefitsUsaCardGroup().contains(EN_LIFE_EVENTS_RETIREMENT["retirement.title"]).click()
pages.accordions().contains(EN_BENEFITS_VA_PENSION["va-pension.title"]).click()
pages
.accordions()
.contains(EN_BENEFITS_VA_PENSION["va-pension.title"])
.invoke("prop", "ariaExpanded")
.should("eq", "true")
pages.accordions().contains(EN_BENEFITS_VA_PENSION["va-pension.title"]).should("have.attr", "aria-expanded", "true")
pages.accordions().contains(EN_BENEFITS_VA_PENSION["va-pension.title"]).click()
pages
.accordions()
.contains(EN_BENEFITS_VA_PENSION["va-pension.title"])
.invoke("prop", "ariaExpanded")
.should("eq", "false")
.should("have.attr", "aria-expanded", "false")
})

it("Validate opening and closing of Retirement Benefits for Child with Disabilities accordion card in Retirement Spanish page", () => {
Expand All @@ -111,16 +98,14 @@ describe("Validate opening and closing of accordion cards", () => {
pages
.accordions()
.contains(ES_BENEFITS_SSA_RETIREMENT_BENEFITS_CHILD_DISABLED["ssa-retirement-benefits-child-disabled.title"])
.invoke("prop", "ariaExpanded")
.should("eq", "true")
.should("have.attr", "aria-expanded", "true")
pages
.accordions()
.contains(ES_BENEFITS_SSA_RETIREMENT_BENEFITS_CHILD_DISABLED["ssa-retirement-benefits-child-disabled.title"])
.click()
pages
.accordions()
.contains(ES_BENEFITS_SSA_RETIREMENT_BENEFITS_CHILD_DISABLED["ssa-retirement-benefits-child-disabled.title"])
.invoke("prop", "ariaExpanded")
.should("eq", "false")
.should("have.attr", "aria-expanded", "false")
})
})
4 changes: 2 additions & 2 deletions cypress/e2e/ui/open-all-close-all-button.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ describe("Validate Open All button functionality", () => {
cy.visit({ url: sitePage.route })
pages.openAllButton().click()
pages.accordions().each((accordion) => {
cy.wrap(accordion).invoke("prop", "ariaExpanded").should("eq", "true")
cy.wrap(accordion).should("have.attr", "aria-expanded", "true")
})
})
})
Expand All @@ -24,7 +24,7 @@ describe("Validate Close All button functionality", () => {
pages.openAllButton().click()
pages.closeAllButton().click()
pages.accordions().each((accordion) => {
cy.wrap(accordion).invoke("prop", "ariaExpanded").should("eq", "false")
cy.wrap(accordion).should("have.attr", "aria-expanded", "false")
})
})
})
Expand Down
162 changes: 162 additions & 0 deletions cypress/e2e/ui/selected-criteria-options.cy.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,162 @@
/// <reference types="cypress"/>

import { pages } from "../../support/page-objects/pages.js"
import * as utils from "../../support/utils.js"
import * as EN_CRITERIA_DATA from "../../../locales/en/criteria.json"
import * as ES_CRITERIA_DATA from "../../../locales/es/criteria.json"
import * as EN_SURVIVOR_BENEFITS_CHILD_DATA from "../../../locales/en/benefits/ssa-survivor-benefits-child.json"
import * as ES_SURVIVOR_BENEFITS_PARENTS_DATA from "../../../locales/es/benefits/ssa-survivor-benefits-parents.json"
import * as EN_SSA_DISABILITY_INSURANCE_CHILD_DISABLED_DATA from "../../../locales/en/benefits/ssa-disability-insurance-child-disabled.json"
import * as ES_DOD_RETIREMENT_AND_DISABILITY_PAYMENTS_DATA from "../../../locales/es/benefits/dod-retirement-and-disability-payments.json"
import * as EN_DOD_THRIFT_SAVINGS_PLAN_DATA from "../../../locales/en/benefits/dod-thrift-savings-plan.json"
import * as ES_DOI_HOUSING_IMPROVEMENT_PROGRAM_DATA from "../../../locales/es/benefits/doi-housing-improvement-program.json"

describe("Validate selected creteria options in DOLO English Page", () => {
it("Validate Survivor Benefits for Child accordion is rendered correctly based on selected criteria options", () => {
//18 years ago minus one day - applicant under 18 years old
//1 day = 365.2425 (accounts for leap year)
const dateOfBirth = utils.getDateByOffset(-(18 * 365.2425 - 1))

const maritalStatus = encodeURI(
EN_SURVIVOR_BENEFITS_CHILD_DATA["ssa-survivor-benefits-child.eligibility.acceptableValues1"]
)
const applicantRelationship = encodeURI(EN_CRITERIA_DATA["criteria.applicant_relationship.values2"])

cy.visit({
url: `death-of-a-loved-one/?e782efd=1&b95c6d4=${dateOfBirth}&a748b56=${maritalStatus}&9d65c08=1&8f306c9=${applicantRelationship}`,
})

pages
.accordions()
.contains(EN_SURVIVOR_BENEFITS_CHILD_DATA["ssa-survivor-benefits-child.title"])
.click()
.parent()
.should("have.class", "border-success-dark")

pages.survivorBenefitsChildIcons().each(($icon) => {
cy.wrap($icon).parent().should("have.class", "text-success-dark")
})
})
})

describe("Validate selected creteria options in DOLO Spanish Page", () => {
it("Validate Beneficios para padre/madre sobreviviente accordion is rendered correctly based on selected criteria options", () => {
//62 years ago plus one day - applicant is at least 62 years old
const dateOfBirth = utils.getDateByOffset(-(62 * 365.2425 + 1))
const applicantRelationship = encodeURI(
ES_SURVIVOR_BENEFITS_PARENTS_DATA["ssa-survivor-benefits-parents.eligibility.acceptableValues"]
)

cy.visit({
url: `es/death-of-a-loved-one/?e782efd=1&b95c6d4=${dateOfBirth}&9d65c08=1&8f306c9=${applicantRelationship}`,
})

pages
.accordions()
.contains(ES_SURVIVOR_BENEFITS_PARENTS_DATA["ssa-survivor-benefits-parents.title"])
.click()
.parent()
.should("have.class", "border-success-dark")

pages.survivorBenefitsParentIcons().each(($icon) => {
cy.wrap($icon).parent().should("have.class", "text-success-dark")
})
})
})

describe("Validate selected creteria options in Disability English Page", () => {
it("Validate Social Security Disability Insurance for Child with Disabilities accordion is rendered correctly based on selected criteria options", () => {
//18 years ago plus one day - applicant at least 18 years old
const dateOfBirth = utils.getDateByOffset(-(18 * 365.2425 + 1))
const applicantRelationship = encodeURI(
EN_SSA_DISABILITY_INSURANCE_CHILD_DISABLED_DATA[
"ssa-disability-insurance-child-disabled.eligibility.acceptableValues"
]
)

cy.visit({
url: `disability/?b95c6d4=${dateOfBirth}&a748b56=${applicantRelationship}&9d65c08=1&8c5fff1=1&32c6b93=1&52fb8ed=1`,
})

pages
.accordions()
.contains(EN_SSA_DISABILITY_INSURANCE_CHILD_DISABLED_DATA["ssa-disability-insurance-child-disabled.title"])
.click()
.parent()
.should("have.class", "border-success-dark")

pages.disabilityInsuranceChildDisabledIcons().each(($icon) => {
cy.wrap($icon).parent().should("have.class", "text-success-dark")
})
})
})

describe("Validate selected creteria options in Disability Spanish Page", () => {
it("Validate Pagos Concurrentes de Jubilación y de Discapacidad (CRDP) accordion is rendered correctly based on selected criteria options", () => {
//60 years ago plus one day - applicant at least 60 years old
const dateOfBirth = utils.getDateByOffset(-(60 * 365.2425 + 1))
const applicantServiceStatus = encodeURI(ES_CRITERIA_DATA["criteria.applicant_service_status.values3"])
const applicantServedMilitary = encodeURI(
ES_DOD_RETIREMENT_AND_DISABILITY_PAYMENTS_DATA[
"dod-retirement-and-disability-payments.eligibility.acceptableValues"
]
)

cy.visit({
url: `es/disability/?b95c6d4=${dateOfBirth}&8c5fff1=1&2fe2b3a=${applicantServedMilitary}&633dad2=${applicantServiceStatus}`,
})

pages
.accordions()
.contains(ES_DOD_RETIREMENT_AND_DISABILITY_PAYMENTS_DATA["dod-retirement-and-disability-payments.title"])
.click()
.parent()
.should("have.class", "border-success-dark")

pages.retirementAndDisabilityPaymentsIcons().each(($icon) => {
cy.wrap($icon).parent().should("have.class", "text-success-dark")
})
})
})

describe("Validate selected creteria options in Retirement English Page", () => {
it("Validate Thrift Savings Plan (TSP) accordion is rendered correctly based on selected criteria options", () => {
//60 years ago plus one day - applicant is at least 60 years old
const dateOfBirth = utils.getDateByOffset(-(60 * 365.2425 + 1))
const applicantRelationship =
EN_DOD_THRIFT_SAVINGS_PLAN_DATA["dod-thrift-savings-plan.eligibility.acceptableValues"]

cy.visit({ url: `retirement/?b95c6d4=${dateOfBirth}&2fe2b3a=${applicantRelationship}` })

pages
.accordions()
.contains(EN_DOD_THRIFT_SAVINGS_PLAN_DATA["dod-thrift-savings-plan.title"])
.click()
.parent()
.should("have.class", "border-success-dark")

pages.thriftSavingsPlanIcons().each(($icon) => {
cy.wrap($icon).parent().should("have.class", "text-success-dark")
})
})
})

describe("Validate selected creteria options in Retirement Spanish Page", () => {
it("Validate Programa de mejoramiento de vivienda (HIP) accordion is rendered correctly based on selected criteria options", () => {
const applicantAmericanIndia =
ES_DOI_HOUSING_IMPROVEMENT_PROGRAM_DATA["doi-housing-improvement-program.eligibility.acceptableValues"]

cy.visit({ url: `es/retirement/?05c56fb=1&6c8cb1d=${applicantAmericanIndia}` })

pages
.accordions()
.contains(ES_DOI_HOUSING_IMPROVEMENT_PROGRAM_DATA["doi-housing-improvement-program.title"])
.click()
.parent()
.should("have.class", "border-success-dark")

pages.housingImprovementProgramIcons().each(($icon) => {
cy.wrap($icon).parent().should("have.class", "text-success-dark")
})
})
})
Loading
Loading