|
1 | 1 | version: 2.1 |
2 | 2 | orbs: |
3 | 3 | # https://github.com/cypress-io/circleci-orb |
4 | | - cypress: cypress-io/cypress@1 |
| 4 | + cypress: cypress-io/cypress@3 |
5 | 5 |
|
6 | | -executors: |
7 | | - with-ff: |
8 | | - docker: |
9 | | - - image: 'cypress/browsers:node18.12.0-chrome103-ff107' |
| 6 | +jobs: |
| 7 | + node-18: |
| 8 | + executor: |
| 9 | + name: cypress/default |
| 10 | + node-version: "18.16.1" |
| 11 | + steps: |
| 12 | + - cypress/run: |
| 13 | + post-install: npm run build |
| 14 | + start-command: npm start |
10 | 15 |
|
11 | 16 | workflows: |
12 | 17 | build: |
13 | 18 | jobs: |
14 | | - # first, run a single job to install dependencies and Cypress |
15 | | - # and perform a few more small steps like linting |
16 | | - - cypress/install: |
17 | | - name: Install |
18 | | - build: npm run build |
19 | | - post-steps: |
20 | | - - run: |
21 | | - name: Show info 📺 |
22 | | - command: npx cypress info |
23 | | - # catch accidental "it.only" tests |
24 | | - - run: |
25 | | - name: Catch accidental "it.only" 🖐 |
26 | | - command: npm run stop-only |
27 | | - |
28 | | - # reuse the workspace from the install job |
29 | 19 | # to run end-to-end tests in Electron browser |
30 | | - - cypress/run: |
| 20 | + - node-18: |
31 | 21 | name: Electron test |
32 | | - requires: |
33 | | - - Install |
34 | | - install-command: echo 'Nothing to install in this job' |
35 | | - # to run tests, we need to start the web application |
36 | | - start: npm start |
37 | | - wait-on: 'http://localhost:3003' |
38 | | - no-workspace: true |
39 | | - store_artifacts: true |
| 22 | + cypress-command: "npx wait-on@latest http://localhost:3003 && npx cypress run" |
40 | 23 |
|
41 | | - # reuse the workspace from the install job |
42 | 24 | # to run end-to-end tests in Firefox browser |
43 | | - - cypress/run: |
| 25 | + - node-18: |
44 | 26 | name: Firefox test |
45 | | - executor: with-ff |
46 | | - requires: |
47 | | - - Install |
48 | | - install-command: echo 'Nothing to install in this job' |
49 | | - # to run tests, we need to start the web application |
50 | | - start: npm start |
51 | | - wait-on: 'http://localhost:3003' |
52 | | - # run tests using Firefox browser pre-installed in the executor image |
53 | | - browser: firefox |
54 | | - no-workspace: true |
55 | | - store_artifacts: true |
| 27 | + install-browsers: true |
| 28 | + cypress-command: "npx wait-on@latest http://localhost:3003 && npx cypress run --browser firefox" |
56 | 29 |
|
57 | 30 | # wait for all jobs to finish and possible run NPM release |
58 | | - - cypress/run: |
| 31 | + - node-18: |
59 | 32 | name: NPM release |
60 | | - executor: with-ff |
61 | 33 | requires: |
62 | | - - Install |
63 | 34 | - Electron test |
64 | 35 | - Firefox test |
65 | | - # nothing to install - cypress/install job does it |
66 | | - # and nothing to pass to the next job |
| 36 | + post-install: npm install |
| 37 | + start-command: echo 'Nothing to start in this job' |
67 | 38 | install-command: echo 'Nothing to install in this job' |
68 | | - no-workspace: true |
69 | 39 | # instead of "cypress run" do NPM release 😁 |
70 | | - command: npm run semantic-release |
| 40 | + cypress-command: npm run semantic-release |
71 | 41 |
|
0 commit comments