Skip to content
This repository was archived by the owner on May 20, 2024. It is now read-only.

Commit 8f9ffcc

Browse files
committed
Merge remote-tracking branch 'origin/10.0.0' into renovate/cypress-12.x
2 parents 52afec1 + f142afb commit 8f9ffcc

17 files changed

+158
-161
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,18 +81,18 @@ Full code coverage is not the guarantee of exceptional quality. For example, the
8181

8282
## Smoke tests
8383

84-
As an example, there is a reusable smoke test [cypress/integration/smoke.js](cypress/integration/smoke.js) that goes through the most important parts of the app, covering 84% of the source code. This test can be reused from other tests, for example from [cypress/integration/smoke-spec.js](cypress/integration/smoke-spec.js), that can be executed after deploy for example by using [cypress-smoke.json](cypress-smoke.json) config file
84+
As an example, there is a reusable smoke test [cypress/integration/smoke.js](cypress/integration/smoke.js) that goes through the most important parts of the app, covering 84% of the source code. This test can be reused from other tests, for example from [cypress/integration/smoke-spec.js](cypress/integration/smoke-spec.js), that can be executed after deploy for example by using [cypress.config.smoke.js](cypress.config.smoke.js) config file
8585

8686
```shell
87-
npx cypress run --config-file cypress-smoke.json
87+
npx cypress run --config-file cypress.config.smoke.js
8888
```
8989

9090
## Component tests
9191

9292
Unit (individual JS functions) and component tests (React components) can be run without any server. There is no need to set anything up, this project works right out of the box without any additional steps, except you need to add `import 'cypress-react-unit-test'` to your Cypress [`supportFile`](https://on.cypress.io/configuration#Folders-Files).
9393

9494
```shell
95-
$ npx cypress open --config-file cypress-unit.json
95+
$ npx cypress open --config-file cypress.config.unit.js
9696
```
9797

9898
These tests leave alongside Jest tests in [src](src) folder and are named `*.cy-spec.js`. Implemented using [cypress-react-unit-test](https://github.com/bahmutov/cypress-react-unit-test).

circle.yml

Lines changed: 2 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -3,33 +3,6 @@ version: 2.1
33
orbs:
44
cypress: cypress-io/cypress@2
55
workflows:
6-
# a separate workflow to confirm
7-
# an older version of Cypress still works
8-
test-previous-cypress:
9-
jobs:
10-
- cypress/run:
11-
name: 'Cypress v6.0.0'
12-
yarn: true
13-
executor: cypress/base-12-14-0
14-
post-checkout:
15-
- run: yarn add -D cypress@6.0.0
16-
# we need to start the web application
17-
start: npm start
18-
command: NODE_ENV=test npm run cypress:run
19-
# there are no jobs to follow this one
20-
# so no need to save the workspace files (saves time)
21-
no-workspace: true
22-
# verify the collected code coverage
23-
post-steps:
24-
# store the created coverage report folder
25-
# you can click on it in the CircleCI UI
26-
# to see live static HTML site
27-
- store_artifacts:
28-
path: coverage
29-
# show code coverage numbers
30-
- run: npm run report:coverage:summary
31-
- run: npm run report:coverage:text
32-
336
# testing the currently installed Cypress version
347
test-current-cypress:
358
jobs:
@@ -69,7 +42,7 @@ workflows:
6942
requires:
7043
- Install
7144
install-command: echo 'Nothing to install in this job'
72-
command: npx cypress run --config-file cypress-unit.json
45+
command: npx cypress run --config-file cypress.config.unit.js
7346
no-workspace: true
7447

7548
- cypress/run:
@@ -84,5 +57,5 @@ workflows:
8457
only:
8558
- master
8659
start: npm start
87-
command: NODE_ENV=test npx cypress run --config-file cypress-smoke.json
60+
command: NODE_ENV=test npx cypress run --config-file cypress.config.smoke.js
8861
no-workspace: true

cypress-unit.json

Lines changed: 0 additions & 11 deletions
This file was deleted.

cypress.config.js

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
const { defineConfig } = require('cypress')
2+
3+
module.exports = defineConfig({
4+
env: {
5+
'cypress-plugin-snapshots': {},
6+
},
7+
e2e: {
8+
// We've imported your old cypress plugins here.
9+
// You may want to clean this up later by importing these.
10+
setupNodeEvents(on, config) {
11+
require('@cypress/code-coverage/task')(on, config)
12+
13+
on('file:preprocessor', require('@cypress/code-coverage/use-babelrc'))
14+
15+
return config
16+
},
17+
baseUrl: 'http://localhost:1234',
18+
excludeSpecPattern: ['**/*.snap', '**/__snapshot__/*', '**/smoke.js'],
19+
},
20+
})

cypress-smoke.json renamed to cypress.config.smoke.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{
1+
module.exports = {
22
"baseUrl": "http://localhost:1234",
33
"testFiles": [
44
"smoke-spec.js"

cypress.config.unit.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
module.exports = {
2+
pluginsFile: false,
3+
fixturesFolder: false,
4+
supportFile: "node_modules/cypress-react-unit-test/support",
5+
testFiles: "**/*.cy-spec.js",
6+
viewportWidth: 300,
7+
viewportHeight: 300,
8+
experimentalComponentTesting: true,
9+
componentFolder: "src/components",
10+
};

cypress.json

Lines changed: 0 additions & 11 deletions
This file was deleted.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)