From f0dd913240cb6e581e865282c8dba55259da717b Mon Sep 17 00:00:00 2001 From: Nehemiah Abuga <121119072+nehemiah-abuga@users.noreply.github.com> Date: Sat, 20 Jul 2024 06:56:34 -0700 Subject: [PATCH 1/3] PXBF-1566-include-screenshots-on-failure: include screenshots on failure --- .github/workflows/test-cypress.yml | 30 ++++++++++++++++++- ...lected-criteria-eligibility-benefits.cy.js | 1 + .../Accordion/__tests__/indexAccordion.cy.jsx | 2 +- 3 files changed, 31 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test-cypress.yml b/.github/workflows/test-cypress.yml index 0fc6bd226..ed66e9915 100644 --- a/.github/workflows/test-cypress.yml +++ b/.github/workflows/test-cypress.yml @@ -40,6 +40,13 @@ jobs: build: "npm run cy:build:storybook" start: "npm run cy:run:pipeline" + - name: Artifact(s) + if: failure() + uses: actions/upload-artifact@v4 + with: + name: cypress screenshots + path: ./benefit-finder/cypress/screenshots + tests-firefox: runs-on: ubuntu-latest steps: @@ -65,6 +72,13 @@ jobs: build: "npm run cy:build:storybook" start: "npm run cy:run:pipeline" + - name: Artifact(s) + if: failure() + uses: actions/upload-artifact@v4 + with: + name: cypress screenshots + path: ./benefit-finder/cypress/screenshots + tests-edge: runs-on: ubuntu-latest steps: @@ -89,6 +103,13 @@ jobs: env: NODE_ENV=test build: "npm run cy:build:storybook" start: "npm run cy:run:pipeline" + + - name: Artifact(s) + if: failure() + uses: actions/upload-artifact@v4 + with: + name: cypress screenshots + path: ./benefit-finder/cypress/screenshots tests-webkit: runs-on: ubuntu-latest @@ -125,7 +146,7 @@ jobs: - name: Artifact(s) if: failure() - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: cypress screenshots path: ./benefit-finder/cypress/screenshots @@ -154,3 +175,10 @@ jobs: browser: chrome env: NODE_ENV=test build: "npm run cy:prebuild:storybook" + + - name: Artifact(s) + if: failure() + uses: actions/upload-artifact@v4 + with: + name: cypress screenshots + path: ./benefit-finder/cypress/screenshots diff --git a/benefit-finder/cypress/e2e/storybook/selected-criteria-eligibility-benefits.cy.js b/benefit-finder/cypress/e2e/storybook/selected-criteria-eligibility-benefits.cy.js index 40afe8f58..5966a8e1a 100644 --- a/benefit-finder/cypress/e2e/storybook/selected-criteria-eligibility-benefits.cy.js +++ b/benefit-finder/cypress/e2e/storybook/selected-criteria-eligibility-benefits.cy.js @@ -206,5 +206,6 @@ describe('Validate correct eligibility benefits display based on selected criter pageObjects .keyEligibilityCriteriaListIcon() .should('have.class', 'bf-checkmark--green') + pageObjects.benefitsAccordion().should('have.length', 22) }) }) diff --git a/benefit-finder/src/shared/components/Accordion/__tests__/indexAccordion.cy.jsx b/benefit-finder/src/shared/components/Accordion/__tests__/indexAccordion.cy.jsx index e297c50e9..8e26feee4 100644 --- a/benefit-finder/src/shared/components/Accordion/__tests__/indexAccordion.cy.jsx +++ b/benefit-finder/src/shared/components/Accordion/__tests__/indexAccordion.cy.jsx @@ -10,6 +10,6 @@ describe('Accordion component tests', () => { cy.get(accordionButton).click() cy.get(accordionButton).should('have.attr', 'aria-expanded', 'true') cy.get(accordionButton).click() - cy.get(accordionButton).should('have.attr', 'aria-expanded', 'false') + cy.get(accordionButton).should('have.attr', 'aria-expanded', 'true') }) }) From 5713e168075261405fa703589bebd6ff9cd48d5f Mon Sep 17 00:00:00 2001 From: Nehemiah Abuga <121119072+nehemiah-abuga@users.noreply.github.com> Date: Sat, 20 Jul 2024 07:12:29 -0700 Subject: [PATCH 2/3] PXBF-1566-include-screenshots-on-failure: include screenshots on failure --- .github/workflows/test-cypress-prod-links.yml | 8 ++++++++ .github/workflows/test-cypress.yml | 20 +++++++++---------- 2 files changed, 18 insertions(+), 10 deletions(-) diff --git a/.github/workflows/test-cypress-prod-links.yml b/.github/workflows/test-cypress-prod-links.yml index 9691138f5..91b64059f 100644 --- a/.github/workflows/test-cypress-prod-links.yml +++ b/.github/workflows/test-cypress-prod-links.yml @@ -33,6 +33,14 @@ jobs: config-file: cypress.prod.links.config.js working-directory: benefit-finder + - name: Prod Artifact(s) + if: failure() + uses: actions/upload-artifact@v4 + with: + name: Prod cypress screenshots + path: ./benefit-finder/cypress/screenshots + + - name: create github issue uses: dacbd/create-issue-action@main if: failure() diff --git a/.github/workflows/test-cypress.yml b/.github/workflows/test-cypress.yml index ed66e9915..e54321a36 100644 --- a/.github/workflows/test-cypress.yml +++ b/.github/workflows/test-cypress.yml @@ -40,11 +40,11 @@ jobs: build: "npm run cy:build:storybook" start: "npm run cy:run:pipeline" - - name: Artifact(s) + - name: Chrome Artifact(s) if: failure() uses: actions/upload-artifact@v4 with: - name: cypress screenshots + name: Chrome cypress screenshots path: ./benefit-finder/cypress/screenshots tests-firefox: @@ -72,11 +72,11 @@ jobs: build: "npm run cy:build:storybook" start: "npm run cy:run:pipeline" - - name: Artifact(s) + - name: Firefox Artifact(s) if: failure() uses: actions/upload-artifact@v4 with: - name: cypress screenshots + name: Firefox cypress screenshots path: ./benefit-finder/cypress/screenshots tests-edge: @@ -104,11 +104,11 @@ jobs: build: "npm run cy:build:storybook" start: "npm run cy:run:pipeline" - - name: Artifact(s) + - name: Edge Artifact(s) if: failure() uses: actions/upload-artifact@v4 with: - name: cypress screenshots + name: Edge cypress screenshots path: ./benefit-finder/cypress/screenshots tests-webkit: @@ -144,11 +144,11 @@ jobs: build: "npm run cy:build:storybook" start: "npm run cy:run:pipeline" - - name: Artifact(s) + - name: Webkit Artifact(s) if: failure() uses: actions/upload-artifact@v4 with: - name: cypress screenshots + name: Webkit cypress screenshots path: ./benefit-finder/cypress/screenshots tests-components: @@ -176,9 +176,9 @@ jobs: env: NODE_ENV=test build: "npm run cy:prebuild:storybook" - - name: Artifact(s) + - name: Component Artifact(s) if: failure() uses: actions/upload-artifact@v4 with: - name: cypress screenshots + name: Component cypress screenshots path: ./benefit-finder/cypress/screenshots From ad5b861c51f326818d80027da77911b5bfe888be Mon Sep 17 00:00:00 2001 From: Nehemiah Abuga <121119072+nehemiah-abuga@users.noreply.github.com> Date: Sat, 20 Jul 2024 07:20:33 -0700 Subject: [PATCH 3/3] PXBF-1566-include-screenshots-on-failure: update failing tests used for testing pipeline --- .../e2e/storybook/selected-criteria-eligibility-benefits.cy.js | 1 - .../shared/components/Accordion/__tests__/indexAccordion.cy.jsx | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/benefit-finder/cypress/e2e/storybook/selected-criteria-eligibility-benefits.cy.js b/benefit-finder/cypress/e2e/storybook/selected-criteria-eligibility-benefits.cy.js index 5966a8e1a..40afe8f58 100644 --- a/benefit-finder/cypress/e2e/storybook/selected-criteria-eligibility-benefits.cy.js +++ b/benefit-finder/cypress/e2e/storybook/selected-criteria-eligibility-benefits.cy.js @@ -206,6 +206,5 @@ describe('Validate correct eligibility benefits display based on selected criter pageObjects .keyEligibilityCriteriaListIcon() .should('have.class', 'bf-checkmark--green') - pageObjects.benefitsAccordion().should('have.length', 22) }) }) diff --git a/benefit-finder/src/shared/components/Accordion/__tests__/indexAccordion.cy.jsx b/benefit-finder/src/shared/components/Accordion/__tests__/indexAccordion.cy.jsx index 8e26feee4..e297c50e9 100644 --- a/benefit-finder/src/shared/components/Accordion/__tests__/indexAccordion.cy.jsx +++ b/benefit-finder/src/shared/components/Accordion/__tests__/indexAccordion.cy.jsx @@ -10,6 +10,6 @@ describe('Accordion component tests', () => { cy.get(accordionButton).click() cy.get(accordionButton).should('have.attr', 'aria-expanded', 'true') cy.get(accordionButton).click() - cy.get(accordionButton).should('have.attr', 'aria-expanded', 'true') + cy.get(accordionButton).should('have.attr', 'aria-expanded', 'false') }) })