From 215adcd893ed6f3612fcfca126eda7e857999a8c Mon Sep 17 00:00:00 2001 From: rmanaem Date: Thu, 8 Aug 2024 13:15:20 -0400 Subject: [PATCH] Set up cypress screenshots --- .github/workflows/compatibility.yaml | 6 ++++++ cypress.config.js | 2 ++ cypress/e2e/simple-test.cy.js | 2 ++ 3 files changed, 10 insertions(+) diff --git a/.github/workflows/compatibility.yaml b/.github/workflows/compatibility.yaml index 68a5c34..70076ae 100644 --- a/.github/workflows/compatibility.yaml +++ b/.github/workflows/compatibility.yaml @@ -51,6 +51,12 @@ jobs: with: wait-on: http://localhost:3000 component: false + + - name: Upload Cypress screenshots as artifacts + uses: actions/upload-artifact@v2 + with: + name: cypress-screenshots + path: cypress/screenshots - name: Latest failed, tell someone if: ${{ failure() }} diff --git a/cypress.config.js b/cypress.config.js index 8bc9a4b..cfce8b6 100644 --- a/cypress.config.js +++ b/cypress.config.js @@ -1,6 +1,8 @@ const { defineConfig } = require("cypress"); module.exports = defineConfig({ + screenshotsFolder: 'cypress/screenshots', + screenshotOnRunFailure: true, e2e: { experimentalStudio: true, setupNodeEvents(on, config) { diff --git a/cypress/e2e/simple-test.cy.js b/cypress/e2e/simple-test.cy.js index 7456990..9d6e528 100644 --- a/cypress/e2e/simple-test.cy.js +++ b/cypress/e2e/simple-test.cy.js @@ -5,7 +5,9 @@ describe('Full stack e2e', () => { 'local graph 1{downarrow}{enter}' ); cy.get('[data-cy="submit-query-button"]').click(); + cy.screenshot() cy.get('[data-cy="result-container"]').contains("from Local graph 1",{matchCase: false}); + cy.screenshot() }) it('API', () => { cy.request("localhost:8000/query").as("query");