diff --git a/.github/workflows/cypress.yaml b/.github/workflows/cypress.yaml index 9f6dac9c9..4841812a8 100644 --- a/.github/workflows/cypress.yaml +++ b/.github/workflows/cypress.yaml @@ -53,7 +53,8 @@ jobs: browser: chrome # headed: true # tchap uses headless, since we don't record videos. - command: "yarn test:cypress" + command: "yarn test:cypress:record" + record: true # Note : 'working-directory' changes pwd, for everything. If you use it you need to change relative paths for everything, it's tricky. env: E2E_TEST_USER_EMAIL: ${{ secrets.E2E_TEST_USER_EMAIL }} @@ -61,3 +62,19 @@ jobs: E2E_TEST_USER_SECURITY_KEY: ${{ secrets.E2E_TEST_USER_SECURITY_KEY }} E2E_TEST_USER_HOMESERVER_URL: "https://matrix.agent1.tchap.incubateur.net" E2E_TEST_USER_HOMESERVER_SHORT: "agent1.tchap.incubateur.net" + # pass GitHub token to allow accurately detecting a build vs a re-run build + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + # pass the Dashboard record key as an environment variable + CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }} + # pass the project ID + CYPRESS_PROJECT_ID: 'x8og2r' + + - name: Upload Artifact + if: failure() + uses: actions/upload-artifact@v3 + with: + name: cypress-results + path: | + cypress/screenshots + cypress/videos + cypress/synapselogs diff --git a/cypress.config.ts b/cypress.config.ts index f4a32ff86..a587cb103 100644 --- a/cypress.config.ts +++ b/cypress.config.ts @@ -36,7 +36,7 @@ getVar("E2E_TEST_USER_HOMESERVER_SHORT"); export default defineConfig({ watchForFileChanges: false, videoUploadOnPasses: false, - projectId: "ppvnzg", + projectId: 'x8og2r', experimentalInteractiveRunEvents: true, defaultCommandTimeout: 10000, chromeWebSecurity: false, diff --git a/package.json b/package.json index b17444425..786414e12 100644 --- a/package.json +++ b/package.json @@ -69,6 +69,7 @@ "test": "jest", "test:cypress": "cypress run", "test:cypress:open": "cypress open", + "test:cypress:record": "cypress run --record", "coverage": "yarn test --coverage", "analyse:unused-exports": "ts-node ./scripts/analyse_unused_exports.ts", "postinstall": "./scripts/tchap/apply_patches.sh",