File tree Expand file tree Collapse file tree 2 files changed +28
-21
lines changed
github-actions/run-cypress-tests Expand file tree Collapse file tree 2 files changed +28
-21
lines changed Original file line number Diff line number Diff line change @@ -10,13 +10,8 @@ inputs:
1010 it to ''.
1111 required : false
1212 default : " @smoke"
13- threads :
14- description :
15- Amount of parallel executors. Supported values are 1-3.
16- required : false
17- default : " 1"
1813 video :
19- description :
14+ description :
2015 Turn video on or off. Supported values are 'true' and 'false'.
2116 required : false
2217 default : ' false'
@@ -25,20 +20,11 @@ runs:
2520 using : " composite"
2621 steps :
2722 - name : Run the tests
28- if : inputs.video == 'false'
29- run : |
30- docker exec cypress \
31- bash -c "yarn ws:db build && yarn ws:e2e cypress-parallel --script cy:run --threads ${{ inputs.threads }} \
32- --verbose --reporterModulePath '../node_modules/cypress-multi-reporters' --specsDir 'e2e/*.cy.ts' --weightsJson './parallel-weights.json'"
33- shell : bash
34-
35- - name : Run the tests and record video
36- if : inputs.video == 'true'
37- run : |
38- docker exec cypress \
39- bash -c "yarn ws:db build && yarn ws:e2e cypress-parallel --script cy:run:video --threads ${{ inputs.threads }} \
40- --verbose --reporterModulePath '../node_modules/cypress-multi-reporters' --specsDir 'e2e/*.cy.ts' --weightsJson './parallel-weights.json'"
23+ run : docker exec -i cypress bash < /home/runner/work/_actions/HSLdevcom/jore4-tools/run-cypress-tests-v3-wip/github-actions/run-cypress-tests/run-cypress.sh
4124 shell : bash
25+ env :
26+ TEST_TAGS : ${{ inputs.test-tags }}
27+ TEST_VIDEO : ${{ inputs.video }}
4228
4329 - name : Retrieve test reports from container
4430 # should be run even if the tests fail
5339 uses : actions/upload-artifact@v4
5440 with :
5541 name : cypress-docker-reports
56- path : |
57- ${{ github.workspace }}/test-reports
42+ path : ${{ github.workspace }}/test-reports
5843
5944 - name : Fail the job
6045 # should fail the job if the tests fail
Original file line number Diff line number Diff line change 1+ #! /usr/bin/env bash
2+
3+ set -euo pipefail
4+
5+ runArgs=(yarn ws:e2e)
6+
7+ if [[ $TEST_VIDEO = " true" ]]; then
8+ runArgs+=(cy:run)
9+ else
10+ runArgs+=(cy:run:video)
11+ fi
12+
13+ if [[ -n $TEST_TAGS ]]; then
14+ runArgs+=(--env grepTags=\' " ${TEST_TAGS} " \' )
15+ fi
16+
17+ Xvfb -screen 0 3840x2160x24 :91
18+ export DISPLAY=:91
19+
20+ yarn ws:e2e " ${runArgs[@]} "
21+
22+ pkill Xvfb
You can’t perform that action at this time.
0 commit comments