From 5d4a4a0755ac60e975248104fc58e953463ba2aa Mon Sep 17 00:00:00 2001 From: Konstantinos Paparas Date: Tue, 9 Jan 2024 19:16:03 +0100 Subject: [PATCH] ci: enable cypress video uploading --- .github/workflows/ci.yml | 4 ++-- example/cypress.config.ts | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e9dcc0a..971056a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -106,7 +106,7 @@ jobs: if: failure() with: name: cypress-screenshots - path: example/cypress/e2e/screenshots + path: example/cypress/screenshots retention-days: 7 - name: Upload videos @@ -114,7 +114,7 @@ jobs: if: always() with: name: cypress-videos - path: example/cypress/e2e/videos + path: example/cypress/videos retention-days: 7 - name: Upload coverage diff --git a/example/cypress.config.ts b/example/cypress.config.ts index bc3a5ba..a37a869 100644 --- a/example/cypress.config.ts +++ b/example/cypress.config.ts @@ -1,12 +1,16 @@ import * as fs from 'node:fs'; import { defineConfig } from 'cypress'; +const captureVideo = !!process.env.CI; + export default defineConfig({ viewportWidth: 1280, viewportHeight: 720, e2e: { specPattern: 'cypress/e2e/**/*.cy.ts', baseUrl: 'http://localhost:4173', + video: captureVideo, + videoCompression: captureVideo, setupNodeEvents: (on): void => { on( 'after:spec',