@cypress/github-action 5.3.0 → 5.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +39 -15
- package/dist/index.js +641 -4775
- package/package.json +2 -3
package/README.md
CHANGED
|
@@ -4,7 +4,8 @@
|
|
|
4
4
|
|
|
5
5
|
## Examples
|
|
6
6
|
|
|
7
|
-
- [
|
|
7
|
+
- [End-to-End](#end-to-end-testing) testing
|
|
8
|
+
- [Component](#component-testing) testing
|
|
8
9
|
- [Explicit version](#explicit-version)
|
|
9
10
|
- Run tests in a given [browser](#browser)
|
|
10
11
|
- using [Chrome](#chrome)
|
|
@@ -23,7 +24,7 @@
|
|
|
23
24
|
- Set Cypress [config values](#config)
|
|
24
25
|
- Use specific [config file](#config-file)
|
|
25
26
|
- Run tests in [parallel](#parallel)
|
|
26
|
-
-
|
|
27
|
+
- Combine [Component and E2E](#component-and-e2e-testing) testing
|
|
27
28
|
- [Build app](#build-app) before running the tests
|
|
28
29
|
- [Start server](#start-server) before running the tests
|
|
29
30
|
- [Start multiple servers](#start-multiple-servers) before running the tests
|
|
@@ -49,7 +50,7 @@ Current examples contained in this repository are based on Cypress 12.x and can
|
|
|
49
50
|
|
|
50
51
|
Some older **external** examples, linked to by this document, are based solely on Cypress 9 and below and therefore use a [Legacy Configuration](https://on.cypress.io/guides/references/legacy-configuration). These may need modification to be applied to Cypress 10 and later. Each of these external links is listed with a `(legacy)` notation.
|
|
51
52
|
|
|
52
|
-
###
|
|
53
|
+
### End-to-End Testing
|
|
53
54
|
|
|
54
55
|
```yml
|
|
55
56
|
name: End-to-end tests
|
|
@@ -66,12 +67,37 @@ jobs:
|
|
|
66
67
|
uses: cypress-io/github-action@v5
|
|
67
68
|
```
|
|
68
69
|
|
|
69
|
-
[](.github/workflows/example-basic.yml)
|
|
70
71
|
|
|
71
|
-
The workflow file [
|
|
72
|
+
The workflow file [example-basic.yml](.github/workflows/example-basic.yml) shows how Cypress runs on GH Actions using Ubuntu (20 and 22), Windows, and macOS without additional OS dependencies necessary.
|
|
73
|
+
|
|
74
|
+
This workflow uses the default [test type](https://on.cypress.io/guides/overview/why-cypress#Test-types) of [End-to-End (E2E) Testing](https://on.cypress.io/guides/overview/why-cypress#End-to-end). Alternatively, [Component Testing](https://on.cypress.io/guides/overview/why-cypress#Component) can be utilized by referencing the [Component Testing](#component-testing) section below.
|
|
72
75
|
|
|
73
76
|
**Note:** this package assumes that `cypress` is declared as a development dependency in the `package.json` file. The `cypress` NPM module is required to run Cypress via its [NPM module API](https://on.cypress.io/module-api).
|
|
74
77
|
|
|
78
|
+
### Component Testing
|
|
79
|
+
|
|
80
|
+
To use [Cypress Component Testing](https://on.cypress.io/component-testing) add `component: true`
|
|
81
|
+
|
|
82
|
+
```yml
|
|
83
|
+
name: End-to-end tests
|
|
84
|
+
on: push
|
|
85
|
+
jobs:
|
|
86
|
+
cypress-run:
|
|
87
|
+
runs-on: ubuntu-22.04
|
|
88
|
+
steps:
|
|
89
|
+
- name: Checkout
|
|
90
|
+
uses: actions/checkout@v3
|
|
91
|
+
- name: Cypress run
|
|
92
|
+
uses: cypress-io/github-action@v5
|
|
93
|
+
with:
|
|
94
|
+
component: true
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
[](.github/workflows/example-component-test.yml)
|
|
98
|
+
|
|
99
|
+
See the example project [component-tests](examples/component-tests/) and the [example-component-test.yml](.github/workflows/example-component-test.yml) workflow for more details.
|
|
100
|
+
|
|
75
101
|
### Explicit version
|
|
76
102
|
|
|
77
103
|
**Best practice:**
|
|
@@ -139,7 +165,7 @@ name: Edge
|
|
|
139
165
|
on: push
|
|
140
166
|
jobs:
|
|
141
167
|
edge:
|
|
142
|
-
runs-on:
|
|
168
|
+
runs-on: ubuntu-22.04
|
|
143
169
|
name: E2E on Edge
|
|
144
170
|
steps:
|
|
145
171
|
- uses: actions/checkout@v3
|
|
@@ -565,25 +591,22 @@ jobs:
|
|
|
565
591
|
|
|
566
592
|
The Cypress GH Action does not spawn or create any additional containers - it only links the multiple containers spawned using the matrix strategy into a single logical Cypress Cloud run and into splitting the specs amongst the machines. See the [Cypress parallelization](https://on.cypress.io/parallelization) guide for the explanation.
|
|
567
593
|
|
|
568
|
-
### Component
|
|
594
|
+
### Component and E2E Testing
|
|
569
595
|
|
|
570
|
-
|
|
596
|
+
[Component Testing](https://on.cypress.io/guides/overview/why-cypress#Component) and [End-to-End (E2E) Testing](https://on.cypress.io/guides/overview/why-cypress#End-to-end) types can be combined in the same job using separate steps
|
|
571
597
|
|
|
572
598
|
```yml
|
|
573
|
-
- name: Run E2E tests
|
|
599
|
+
- name: Run E2E tests
|
|
574
600
|
uses: cypress-io/github-action@v5
|
|
575
601
|
|
|
576
|
-
- name: Run Component
|
|
602
|
+
- name: Run Component Testing
|
|
577
603
|
uses: cypress-io/github-action@v5
|
|
578
604
|
with:
|
|
579
605
|
# we have already installed everything
|
|
580
606
|
install: false
|
|
581
|
-
# to run component tests we need to use "component: true"
|
|
582
607
|
component: true
|
|
583
608
|
```
|
|
584
609
|
|
|
585
|
-
See the example project [component-test](examples/component-tests/) and the [example-component-test-workflow](.github/workflows/example-component-test.yml) for more details.
|
|
586
|
-
|
|
587
610
|
### Build app
|
|
588
611
|
|
|
589
612
|
You can run a build step before starting tests
|
|
@@ -1145,7 +1168,6 @@ See [cypress-gh-action-example](https://github.com/bahmutov/cypress-gh-action-ex
|
|
|
1145
1168
|
| [cypress-gh-action-changed-files](https://github.com/bahmutov/cypress-gh-action-changed-files) (legacy) | Shows how to run different Cypress projects depending on changed files |
|
|
1146
1169
|
| [cypress-examples](https://github.com/bahmutov/cypress-examples) | Shows separate install job from parallel test jobs |
|
|
1147
1170
|
| [cypress-gh-action-split-jobs](https://github.com/bahmutov/cypress-gh-action-split-jobs) (legacy) | Shows a separate install job with the build step, and another job that runs the tests |
|
|
1148
|
-
| [cypress-react-component-example](https://github.com/bahmutov/cypress-react-component-example) (legacy) | Run E2E and component tests using this action |
|
|
1149
1171
|
<!-- prettier-ignore-end -->
|
|
1150
1172
|
|
|
1151
1173
|
## Notes
|
|
@@ -1351,7 +1373,7 @@ See the [example-cron.yml](./.github/workflows/example-cron.yml) workflow.
|
|
|
1351
1373
|
### Suppress test summary
|
|
1352
1374
|
|
|
1353
1375
|
The default test summary can be suppressed by using the parameter `publish-summary` and setting its value to `false`.
|
|
1354
|
-
Sometimes users want to publish test summary using a specific action.
|
|
1376
|
+
Sometimes users want to publish test summary using a specific action.
|
|
1355
1377
|
For example, a user running Cypress tests using a matrix and wants to retrieve the test summary for each matrix job and use a specific action that merges reports.
|
|
1356
1378
|
|
|
1357
1379
|
```yml
|
|
@@ -1381,6 +1403,8 @@ See [Releases](https://github.com/cypress-io/github-action/releases) for full de
|
|
|
1381
1403
|
| v2 | Cypress runs using the [NPM module API](https://docs.cypress.io/guides/guides/module-api) instead of being started via the command line. |
|
|
1382
1404
|
| v1 | *This version is no longer runnable in GitHub due to security changes.* |
|
|
1383
1405
|
|
|
1406
|
+
*Note: [GitHub announced](https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/) their plan to disable `save-state` and `set-output` commands by May 31, 2023. This will prevent [cypress-io/github-action](https://github.com/cypress-io/github-action) version [v4.2.1](https://github.com/cypress-io/github-action/releases/tag/v4.2.1), and earlier, running after this date since they use `set-output`. Affected users should update to using `v5` of the [cypress-io/github-action](https://github.com/cypress-io/github-action) action before the deadline.*
|
|
1407
|
+
|
|
1384
1408
|
## License
|
|
1385
1409
|
|
|
1386
1410
|
[MIT License](./LICENSE.md)
|