Skip to content

Commit

Permalink
e2e: add cypress-terminal-report
Browse files Browse the repository at this point in the history
That we see something in the output of our e2e tests in the terminal.
This should help with debugging.
  • Loading branch information
BacLuc committed Mar 2, 2025
1 parent ac1b5b9 commit 27ba2d2
Show file tree
Hide file tree
Showing 5 changed files with 63 additions and 1 deletion.
4 changes: 3 additions & 1 deletion .github/workflows/reusable-e2e-tests-run.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ jobs:
uses: actions/cache@0c907a75c2c80ebcb7f088228285e798b750cf8f # v4
with:
path: .cache
key: docker-compose-${{ hashFiles('frontend/package-lock.json', 'print/package-lock.json', 'api/composer.lock') }}-${{ matrix.browser }}
key: docker-compose-${{ hashFiles('frontend/package-lock.json', 'print/package-lock.json', 'api/composer.lock', 'e2e/package-lock.json') }}-${{ matrix.browser }}
restore-keys: |
docker-compose-
Expand All @@ -68,6 +68,8 @@ jobs:

# pull cypress while container are starting up
- run: docker compose pull e2e

- run: docker compose run --entrypoint="npm ci" --rm e2e

- run: sh -x wait-for-container-startup.sh

Expand Down
4 changes: 4 additions & 0 deletions e2e/cypress.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ module.exports = defineConfig({
deleteDownloads: () => deleteDownloads(config),
moveDownloads: (destSubDir) => moveDownloads(config, destSubDir),
})
const cypressTerminalReportOptions = {
printLogsToConsole: 'always',
}
require('cypress-terminal-report/src/installLogsPrinter')(on, cypressTerminalReportOptions)

Check failure on line 22 in e2e/cypress.config.js

View workflow job for this annotation

GitHub Actions / Lint: e2e (ESLint)

Replace `on,·cypressTerminalReportOptions` with `⏎········on,⏎········cypressTerminalReportOptions⏎······`
},
specPattern: 'specs/**/*.cy.{js,jsx,ts,tsx}',
supportFile: 'support/index.js',
Expand Down
50 changes: 50 additions & 0 deletions e2e/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions e2e/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
"@eslint/eslintrc": "3.3.0",
"@eslint/js": "9.21.0",
"cypress": "13.16.1",
"cypress-terminal-report": "7.1.0",
"eslint": "9.21.0",
"eslint-config-prettier": "10.0.2",
"eslint-plugin-cypress": "4.1.0",
Expand Down
5 changes: 5 additions & 0 deletions e2e/support/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@

// Import commands.js using ES2015 syntax:
import './commands'
import installLogsCollector from 'cypress-terminal-report/src/installLogsCollector'

installLogsCollector({
commandTimings: 'seconds',
})

// Alternatively you can use CommonJS syntax:
// require('./commands')

0 comments on commit 27ba2d2

Please # to comment.