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

Commit 86d0f58

Browse files
authored
Merge pull request #239 from cypress-io/renovate/cypress-12.x
Update dependency cypress to v12
2 parents 8cde04d + 106ccdb commit 86d0f58

18 files changed

+1210
-472
lines changed

.gitlab-ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ cache:
1414

1515
# this job installs NPM dependencies and Cypress
1616
test:
17-
image: cypress/base:12.19.0
17+
image: cypress/base:14
1818
script:
1919
- yarn install --frozen-lockfile
2020
# check Cypress binary path and cached versions

README.md

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -81,22 +81,12 @@ 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

90-
## Component tests
91-
92-
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).
93-
94-
```shell
95-
$ npx cypress open --config-file cypress-unit.json
96-
```
97-
98-
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).
99-
10090
## License
10191

10292
This project is licensed under the terms of the [MIT license](/LICENSE.md).

circle.yml

Lines changed: 5 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,19 @@
11
# see https://github.com/cypress-io/circleci-orb
22
version: 2.1
33
orbs:
4-
cypress: cypress-io/cypress@1
4+
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:
369
- cypress/install:
3710
name: Install
3811
yarn: true
39-
executor: cypress/base-12-14-0
12+
executor: cypress/base-14
4013

4114
- cypress/run:
4215
name: full tests
43-
executor: cypress/base-12-14-0
16+
executor: cypress/base-14
4417
requires:
4518
- Install
4619
install-command: echo 'Nothing to install in this job'
@@ -63,18 +36,9 @@ workflows:
6336
# https://coveralls.io/github/cypress-io/cypress-example-todomvc-redux
6437
- run: npm run coveralls
6538

66-
- cypress/run:
67-
name: component tests
68-
executor: cypress/base-12-14-0
69-
requires:
70-
- Install
71-
install-command: echo 'Nothing to install in this job'
72-
command: npx cypress run --config-file cypress-unit.json
73-
no-workspace: true
74-
7539
- cypress/run:
7640
name: smoke tests
77-
executor: cypress/base-12-14-0
41+
executor: cypress/base-14
7842
requires:
7943
- Install
8044
install-command: echo 'Nothing to install in this job'
@@ -84,5 +48,5 @@ workflows:
8448
only:
8549
- master
8650
start: npm start
87-
command: NODE_ENV=test npx cypress run --config-file cypress-smoke.json
51+
command: NODE_ENV=test npx cypress run --config-file cypress.config.smoke.js
8852
no-workspace: true

cypress-unit.json

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

cypress.config.js

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

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.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)