|
1 | 1 | version: 2.1
|
2 | 2 | orbs:
|
3 | 3 | # https://github.com/cypress-io/circleci-orb
|
4 |
| - cypress: cypress-io/cypress@1 |
5 |
| - |
6 |
| -executors: |
7 |
| - with-ff: |
8 |
| - docker: |
9 |
| - - image: 'cypress/browsers:node18.12.0-chrome103-ff107' |
| 4 | + cypress: cypress-io/cypress@3 |
10 | 5 |
|
11 | 6 | workflows:
|
12 | 7 | build:
|
13 | 8 | 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 | 9 | # to run end-to-end tests in Electron browser
|
30 | 10 | - cypress/run:
|
31 | 11 | 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 |
| 12 | + post-install: npm run build |
| 13 | + start-command: npm start |
| 14 | + cypress-command: "npx wait-on@latest http://localhost:3003 && npx cypress run" |
40 | 15 |
|
41 |
| - # reuse the workspace from the install job |
42 | 16 | # to run end-to-end tests in Firefox browser
|
43 | 17 | - cypress/run:
|
44 | 18 | 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 |
| 19 | + install-browsers: true |
| 20 | + post-install: npm run build |
| 21 | + start-command: npm start |
| 22 | + cypress-command: "npx wait-on@latest http://localhost:3003 && npx cypress run --browser firefox" |
56 | 23 |
|
57 | 24 | # wait for all jobs to finish and possible run NPM release
|
58 | 25 | - cypress/run:
|
59 | 26 | name: NPM release
|
60 |
| - executor: with-ff |
61 | 27 | requires:
|
62 |
| - - Install |
63 | 28 | - Electron test
|
64 | 29 | - Firefox test
|
65 | 30 | # nothing to install - cypress/install job does it
|
66 | 31 | # and nothing to pass to the next job
|
67 | 32 | install-command: echo 'Nothing to install in this job'
|
68 |
| - no-workspace: true |
69 | 33 | # instead of "cypress run" do NPM release 😁
|
70 |
| - command: npm run semantic-release |
| 34 | + cypress-command: npm run semantic-release |
71 | 35 |
|
0 commit comments