From 53f7df36c885208cff142bceb49121b5865fc817 Mon Sep 17 00:00:00 2001 From: Matthew Thornton <44626690+ThorntonMatthewD@users.noreply.github.com> Date: Sun, 8 Oct 2023 19:38:50 -0400 Subject: [PATCH] Add upload-artifact step with an intentional test failure --- .github/workflows/ci.yml | 10 ++++++++++ cypress/e2e/map.cy.ts | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 060d5ce..fc70e6e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -31,4 +31,14 @@ jobs: run: npm run test:unit - name: Run end-to-end tests + id: e2eTests run: npm run test:e2e + + # Uploads the failure screenshots produced by Cypress + - uses: actions/upload-artifact@v3 + if: always() && (steps.e2eTests.outcome == 'failure') + with: + name: my-artifact + path: cypress/screenshots/**/*.png + + diff --git a/cypress/e2e/map.cy.ts b/cypress/e2e/map.cy.ts index 95b67dc..dab65d2 100644 --- a/cypress/e2e/map.cy.ts +++ b/cypress/e2e/map.cy.ts @@ -35,7 +35,7 @@ describe("Map", () => { cy.get(".leaflet-control-layers-overlays label input").click(); }); - cy.url().should("contain", "maps="); + cy.url().should("contain", "mops="); }); it("unchecks a map layer and changes URL", () => {