diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 9273aeb9aa7d..daf0331288fa 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -385,6 +385,13 @@ jobs: name: cypress_screenshots_${{ matrix.specs }} path: ${{ github.workspace }}/tests/cypress/screenshots + - name: Uploading cypress videos as an artifact + if: failure() + uses: actions/upload-artifact@v3.1.1 + with: + name: cypress_videos_${{ matrix.specs }} + path: ${{ github.workspace }}/tests/cypress/videos + publish_dev_images: if: github.ref == 'refs/heads/develop' needs: [rest_api_testing, unit_testing, e2e_testing] diff --git a/tests/cypress.config.js b/tests/cypress.config.js index 37400e0c3601..f6d327466adc 100644 --- a/tests/cypress.config.js +++ b/tests/cypress.config.js @@ -2,7 +2,7 @@ const { defineConfig } = require('cypress'); const plugins = require('./cypress/plugins/index'); module.exports = defineConfig({ - video: false, + video: true, viewportWidth: 1300, viewportHeight: 960, defaultCommandTimeout: 25000, diff --git a/tests/cypress/plugins/index.js b/tests/cypress/plugins/index.js index 9d51227c08a3..790aef6a81bc 100644 --- a/tests/cypress/plugins/index.js +++ b/tests/cypress/plugins/index.js @@ -41,5 +41,11 @@ module.exports = (on, config) => { } return launchOptions; }); + + on('after:spec', (spec, results) => { + if (results && results.stats.failures === 0 && results.video) { + fs.unlinkSync(results.video); + } + }); return config; };