1
1
version : 2.1
2
2
orbs :
3
- cypress : cypress-io/cypress@2.2.0
3
+ cypress : cypress-io/cypress@3
4
4
jobs :
5
+ install :
6
+ executor : cypress/default
7
+ steps :
8
+ - checkout
9
+ - attach_workspace :
10
+ at : ~/
11
+ - cypress/install :
12
+ install-browsers : true
13
+ install-command : yarn install --frozen-lockfile
14
+ - persist_to_workspace :
15
+ root : ~/
16
+ paths : .
17
+
5
18
build :
6
19
docker :
7
20
- image : cimg/node:lts
14
27
- persist_to_workspace :
15
28
root : ~/
16
29
paths : .
30
+ run-tests-in-parallel :
31
+ executor : cypress/default
32
+ parallelism : 2
33
+ steps :
34
+ - attach_workspace :
35
+ at : ~/
36
+ - cypress/install :
37
+ install-browsers : true
38
+ install-command : " echo 'skipping install'"
39
+ - cypress/run-tests :
40
+ # following examples from
41
+ # https://circleci.com/docs/2.0/parallelism-faster-jobs/
42
+ cypress-command : |
43
+ TESTFILES=$(circleci tests glob "cypress/e2e/**/*.cy.ts" | circleci tests split --total=2)
44
+ echo "Test files for this machine are $TESTFILES"
45
+ npx cypress run --browser chrome --spec $TESTFILES
17
46
18
47
release :
19
48
docker :
@@ -29,35 +58,14 @@ jobs:
29
58
workflows :
30
59
build :
31
60
jobs :
32
- - cypress/install :
33
- executor : cypress/base-16-14-2-slim
34
- yarn : true
61
+ - install
35
62
- build :
36
63
requires :
37
- - cypress/install
38
- - cypress/run :
39
- executor : cypress/base-16-14-2-slim
40
- parallelism : 2
41
- # make sure app has been installed and built
42
- # before running tests across multiple machines
43
- # this avoids installing same dependencies 10 times
64
+ - install
65
+ - run-tests-in-parallel :
66
+ name : Run Cypress tests
44
67
requires :
45
- - cypress/install
46
- browser : chrome
47
- # notice a trick to avoid re-installing dependencies
48
- # in this job - a do-nothing "install-command" parameter
49
- install-command : echo 'Nothing to install in this job'
50
- yarn : true
51
- no-workspace : true
52
- # we are not going to use results from this job anywhere else
53
- record : false
54
- store_artifacts : true
55
- # following examples from
56
- # https://circleci.com/docs/2.0/parallelism-faster-jobs/
57
- command : |
58
- TESTFILES=$(circleci tests glob "cypress/e2e/**/*.cy.ts" | circleci tests split --total=2)
59
- echo "Test files for this machine are $TESTFILES"
60
- npx cypress run --spec $TESTFILES
68
+ - install
61
69
- release :
62
70
name : NPM release
63
71
filters :
@@ -66,4 +74,4 @@ workflows:
66
74
- main
67
75
requires :
68
76
- build
69
- - cypress/run
77
+ - Run Cypress tests
0 commit comments