@cypress/github-action 6.8.0 โ 6.9.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 +90 -27
- package/dist/index.js +80 -31
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# cypress-io/github-action [![Action status][ci-badge]][ci-workflow] [![cypress][cloud-badge]][cloud-project] [![renovate-app badge][renovate-badge]][renovate-bot]
|
|
2
2
|
|
|
3
|
-
> [Cypress](https://www.cypress.io) based `cypress-io/github-action` runs [End-to-End](#end-to-end-testing) or [Component](#component-testing) tests in [GitHub Actions](https://docs.github.com/en/actions/) Continuous Integration (CI) workflows, optionally [recording](#record-test-results-on-cypress-cloud) to [Cypress Cloud](https://on.cypress.io/
|
|
3
|
+
> [Cypress](https://www.cypress.io) based `cypress-io/github-action` runs [End-to-End](#end-to-end-testing) or [Component](#component-testing) tests in [GitHub Actions](https://docs.github.com/en/actions/) Continuous Integration (CI) workflows, optionally [recording](#record-test-results-on-cypress-cloud) to [Cypress Cloud](https://on.cypress.io/cloud-introduction)
|
|
4
4
|
|
|
5
5
|
## Introduction
|
|
6
6
|
|
|
@@ -15,7 +15,7 @@ In addition to running Cypress tests, the action includes [dependency installati
|
|
|
15
15
|
| [Caching](#caching) of Cypress binary and dependencies for [npm](https://docs.npmjs.com/cli/commands/npm-cache) and [Yarn Classic](https://classic.yarnpkg.com/lang/en/docs/cli/cache/) installations | Reduced download bandwidth requirements |
|
|
16
16
|
| [Job summary](#job-summary-title) | Fast access to results overview |
|
|
17
17
|
| [Docker](#docker-image) compatibility | Improved independence from [GitHub-hosted runner image](https://docs.github.com/en/actions/using-github-hosted-runners/using-github-hosted-runners/about-github-hosted-runners) version changes. Fixed Docker environments can be used. |
|
|
18
|
-
| [Recording](#record-test-results-on-cypress-cloud) to Cypress Cloud compatibility including [parallel](#parallel) execution | Improved interpretation of test results through [Cypress Cloud](https://on.cypress.io/cloud)
|
|
18
|
+
| [Recording](#record-test-results-on-cypress-cloud) to Cypress Cloud compatibility including [parallel](#parallel) execution | Improved interpretation of test results through [Cypress Cloud](https://on.cypress.io/cloud-introduction) |
|
|
19
19
|
| [Live examples](#examples) | Speeds up introduction and troubleshooting |
|
|
20
20
|
| [Yarn Modern](#yarn-modern) usage and cache examples | Extends usage beyond [Yarn Classic](https://classic.yarnpkg.com/) |
|
|
21
21
|
| [pnpm cache examples](#pnpm) | Reduced download bandwidth requirements for [pnpm](https://pnpm.io/) |
|
|
@@ -56,7 +56,7 @@ The following examples demonstrate the actions' functions.
|
|
|
56
56
|
- [Wait for server](#wait-on) to respond before running the tests
|
|
57
57
|
- Use [custom install command](#custom-install-command)
|
|
58
58
|
- Use [command prefix](#command-prefix)
|
|
59
|
-
- Use [
|
|
59
|
+
- Use [custom test command](#custom-test-command)
|
|
60
60
|
- Pass [custom build id](#custom-build-id) when recording to Cypress Cloud
|
|
61
61
|
- Generate a [robust custom build id](#robust-custom-build-id) to allow re-running the workflow
|
|
62
62
|
- Use different [working-directory](#working-directory)
|
|
@@ -70,6 +70,7 @@ The following examples demonstrate the actions' functions.
|
|
|
70
70
|
- Use [custom cache key](#custom-cache-key)
|
|
71
71
|
- Run tests on multiple [Node versions](#node-versions)
|
|
72
72
|
- Split [install and tests](#split-install-and-tests) into separate jobs
|
|
73
|
+
- Split [install and tests](#split-install-and-test-with-artifacts) with artifacts
|
|
73
74
|
- Use [custom install commands](#custom-install)
|
|
74
75
|
- Install [only Cypress](#install-cypress-only) to avoid installing all dependencies
|
|
75
76
|
- Use [timeouts](#timeouts) to avoid hanging CI jobs
|
|
@@ -381,7 +382,7 @@ For more information, visit [the Cypress command-line docs](https://on.cypress.i
|
|
|
381
382
|
|
|
382
383
|
### Record test results on Cypress Cloud
|
|
383
384
|
|
|
384
|
-
By setting the parameter `record` to `true`, you can record your test results into [Cypress Cloud](https://on.cypress.io/cloud). Read the [Cypress Cloud setup](https://on.cypress.io/cloud/get-started/setup) documentation to learn how to sign up to Cypress Cloud, to create and set up a [Cloud project](https://on.cypress.io/cloud/account-management/projects) to get the required `projectId` and record key for recording.
|
|
385
|
+
By setting the parameter `record` to `true`, you can record your test results into [Cypress Cloud](https://on.cypress.io/cloud-introduction). Read the [Cypress Cloud setup](https://on.cypress.io/cloud/get-started/setup) documentation to learn how to sign up to Cypress Cloud, to create and set up a [Cloud project](https://on.cypress.io/cloud/account-management/projects) to get the required `projectId` and record key for recording.
|
|
385
386
|
|
|
386
387
|
- The `projectId` can either be stored in the [Cypress Configuration File](https://on.cypress.io/app/references/configuration#Configuration-File) or passed to the action as an environment variable `CYPRESS_PROJECT_ID`. In the example below, it is retrieved from a [GitHub secret](https://docs.github.com/en/actions/security-for-github-actions/security-guides/using-secrets-in-github-actions) variable.
|
|
387
388
|
|
|
@@ -528,7 +529,7 @@ jobs:
|
|
|
528
529
|
# let's make sure our "app" works on several versions of Node
|
|
529
530
|
strategy:
|
|
530
531
|
matrix:
|
|
531
|
-
node: [20, 22, 23]
|
|
532
|
+
node: [20, 22, 23, 24]
|
|
532
533
|
name: E2E on Node v${{ matrix.node }}
|
|
533
534
|
steps:
|
|
534
535
|
- name: Setup Node
|
|
@@ -931,7 +932,19 @@ If you do not commit a lock file to the repository, you cannot use the action to
|
|
|
931
932
|
|
|
932
933
|
### Command prefix
|
|
933
934
|
|
|
934
|
-
You can prefix
|
|
935
|
+
You can prefix a test command using the `command-prefix` parameter. This is useful, for example, when running [BrowserStack Percy](https://www.browserstack.com/docs/percy/integrate/cypress), which requires the test command to be prefixed with `percy exec --`. When this parameter is used, the action constructs and executes a CLI command using [npx](https://docs.npmjs.com/cli/v11/commands/npx) in the following form:
|
|
936
|
+
|
|
937
|
+
```shell
|
|
938
|
+
npx <command-prefix> cypress run <cli run options>
|
|
939
|
+
```
|
|
940
|
+
|
|
941
|
+
where the `<command-prefix>` is the literal string value from the `command-prefix` parameter and `<cli run options>` are put together from action parameters such as the value of the `browser` parameter. The complete constructed command is shown in the logs. For the example below, this is shown as:
|
|
942
|
+
|
|
943
|
+
```text
|
|
944
|
+
Cypress test command: npx percy exec -- npx cypress run --browser chrome
|
|
945
|
+
```
|
|
946
|
+
|
|
947
|
+
Since `command-prefix` is run using `npx`, it is compatible with [npm](https://docs.npmjs.com/cli/v11/) and [Yarn Classic](https://classic.yarnpkg.com/). It may also be used with [pnpm](https://pnpm.io/settings#nodelinker) and [Yarn Modern](https://yarnpkg.com/configuration/yarnrc#nodeLinker) when they are configured for `nodeLinker` compatibility with the `node_modules` directory structure of npm. An alternative to using `command-prefix` is to pass a complete [command](#custom-test-command) parameter instead, including the exact command to be passed to the CLI.
|
|
935
948
|
|
|
936
949
|
```yml
|
|
937
950
|
name: Visual
|
|
@@ -945,32 +958,36 @@ jobs:
|
|
|
945
958
|
- name: Cypress run
|
|
946
959
|
uses: cypress-io/github-action@v6
|
|
947
960
|
with:
|
|
948
|
-
start: npm start
|
|
949
|
-
# quote the url to be safe against YML parsing surprises
|
|
950
|
-
wait-on: 'http://localhost:8080'
|
|
951
|
-
# the entire command will automatically be prefixed with "npm"
|
|
952
|
-
# and we need the second "npm" to execute "cypress run ..." command line
|
|
953
961
|
command-prefix: 'percy exec -- npx'
|
|
962
|
+
browser: chrome
|
|
954
963
|
```
|
|
955
964
|
|
|
965
|
+
If `command-prefix` is used, then no [job summary](#job-summary-title) is produced, since it runs Cypress with a CLI [cypress run](https://on.cypress.io/app/references/command-line#cypress-run) command instead of using the [Cypress Module API](https://docs.cypress.io/app/references/module-api). The `command` parameter overrides the `command-prefix` parameter, preventing these two parameters from being used together.
|
|
966
|
+
|
|
956
967
|
### Custom test command
|
|
957
968
|
|
|
958
|
-
|
|
969
|
+
The `command` parameter executes a CLI command using the GitHub [@actions/exec](https://github.com/actions/toolkit/tree/main/packages/exec) action.
|
|
970
|
+
|
|
971
|
+
This parameter is useful for special test cases, for example:
|
|
972
|
+
|
|
973
|
+
- in the project [examples/custom-command](./examples/custom-command/), a JavaScript [examples/custom-command/index.js](./examples/custom-command/index.js) is run with `node .` through `command: npm run custom-test`
|
|
974
|
+
- in the workflow [example-yarn-modern-pnp.yml](.github/workflows/example-yarn-modern-pnp.yml) Yarn Modern with Plug'n'Play is run with `command: yarn run --binaries-only cypress run` since [Yarn Plug'n'Play](#yarn-plugnplay) is not natively supported by the action.
|
|
975
|
+
|
|
976
|
+
If you don't have a special case and you just need to convert a `cypress run` CLI command to use the Cypress GitHub Action, refer to the section [Migrating from CLI command](#migrating-from-cli-command) which explains how to map CLI options to equivalent action parameters, avoiding the need for the `command` parameter in most cases.
|
|
977
|
+
|
|
978
|
+
There are some parameters that cannot be used together with the `command` parameter, and these are ignored. The parameters include action input parameters listed in the table [CLI Run Option / Action Parameter](#cli-run-option--action-parameter), the [publish-summary](#suppress-job-summary), [summary-title](#job-summary-title) and [command-prefix](#command-prefix). If any such parameters are passed to the action, a warning message appears in the logs that the parameters have been ignored.
|
|
979
|
+
|
|
980
|
+
Correct example snippet:
|
|
959
981
|
|
|
960
982
|
```yml
|
|
961
983
|
steps:
|
|
962
|
-
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
- name: Custom tests ๐งช
|
|
966
|
-
uses: cypress-io/github-action@v6
|
|
984
|
+
- uses: actions/checkout@v4
|
|
985
|
+
- uses: cypress-io/github-action@v6
|
|
967
986
|
with:
|
|
968
|
-
command: npm run
|
|
987
|
+
command: npm run custom-test
|
|
969
988
|
```
|
|
970
989
|
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
See [example-custom-command.yml](.github/workflows/example-custom-command.yml) file.
|
|
990
|
+
[](.github/workflows/example-custom-command.yml)
|
|
974
991
|
|
|
975
992
|
### Custom build id
|
|
976
993
|
|
|
@@ -1293,7 +1310,7 @@ jobs:
|
|
|
1293
1310
|
# let's make sure our "app" works on several versions of Node
|
|
1294
1311
|
strategy:
|
|
1295
1312
|
matrix:
|
|
1296
|
-
node: [20, 22, 23]
|
|
1313
|
+
node: [20, 22, 23, 24]
|
|
1297
1314
|
name: E2E on Node v${{ matrix.node }}
|
|
1298
1315
|
steps:
|
|
1299
1316
|
- name: Setup Node
|
|
@@ -1327,7 +1344,7 @@ jobs:
|
|
|
1327
1344
|
runs-on: ubuntu-24.04
|
|
1328
1345
|
strategy:
|
|
1329
1346
|
matrix:
|
|
1330
|
-
node: [20, 22, 23]
|
|
1347
|
+
node: [20, 22, 23, 24]
|
|
1331
1348
|
name: E2E on Node v${{ matrix.node }}
|
|
1332
1349
|
steps:
|
|
1333
1350
|
- uses: actions/setup-node@v4
|
|
@@ -1370,6 +1387,54 @@ jobs:
|
|
|
1370
1387
|
|
|
1371
1388
|
See [cypress-gh-action-monorepo](https://github.com/bahmutov/cypress-gh-action-monorepo) for a working example.
|
|
1372
1389
|
|
|
1390
|
+
### Split install and test with artifacts
|
|
1391
|
+
|
|
1392
|
+
If your test job(s) first need a build step, you can split the jobs into a separate build job followed by test jobs. You pass the build results to any subsequent jobs using [GitHub Actions artifacts](https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/storing-and-sharing-data-from-a-workflow).
|
|
1393
|
+
|
|
1394
|
+
In the build job, use [upload-artifact](https://github.com/actions/upload-artifact) to store the build results, then in subsequent jobs use [download-artifact](https://github.com/actions/download-artifact) to restore them.
|
|
1395
|
+
|
|
1396
|
+
Your tests jobs may use a [GitHub Actions matrix strategy](https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/running-variations-of-jobs-in-a-workflow), such as when recording to [Cypress Cloud](https://on.cypress.io/cloud-introduction) with [parallel jobs](#parallel).
|
|
1397
|
+
|
|
1398
|
+
```yml
|
|
1399
|
+
name: Split build and test
|
|
1400
|
+
on: push
|
|
1401
|
+
jobs:
|
|
1402
|
+
build:
|
|
1403
|
+
runs-on: ubuntu-24.04
|
|
1404
|
+
steps:
|
|
1405
|
+
- uses: actions/checkout@v4
|
|
1406
|
+
- name: Build app
|
|
1407
|
+
uses: cypress-io/github-action@v6
|
|
1408
|
+
with:
|
|
1409
|
+
runTests: false # only build app, don't test yet
|
|
1410
|
+
build: npm run build
|
|
1411
|
+
- name: Store build artifacts
|
|
1412
|
+
uses: actions/upload-artifact@v4
|
|
1413
|
+
with:
|
|
1414
|
+
name: app
|
|
1415
|
+
path: build
|
|
1416
|
+
if-no-files-found: error
|
|
1417
|
+
retention-days: 1
|
|
1418
|
+
|
|
1419
|
+
test:
|
|
1420
|
+
needs: build
|
|
1421
|
+
runs-on: ubuntu-24.04
|
|
1422
|
+
steps:
|
|
1423
|
+
- uses: actions/checkout@v4
|
|
1424
|
+
- name: Restore build artifacts
|
|
1425
|
+
uses: actions/download-artifact@v4
|
|
1426
|
+
with:
|
|
1427
|
+
name: app
|
|
1428
|
+
path: build
|
|
1429
|
+
|
|
1430
|
+
- name: Cypress tests
|
|
1431
|
+
uses: cypress-io/github-action@v6
|
|
1432
|
+
with:
|
|
1433
|
+
start: npm start # start server using the build artifacts
|
|
1434
|
+
```
|
|
1435
|
+
|
|
1436
|
+
[](.github/workflows/example-build-artifacts.yml)
|
|
1437
|
+
|
|
1373
1438
|
### Custom install
|
|
1374
1439
|
|
|
1375
1440
|
Finally, you might not need this GH Action at all. For example, if you want to split the npm dependencies installation from the Cypress binary installation, then it makes no sense to use this action. Instead you can install and cache Cypress yourself.
|
|
@@ -1419,8 +1484,6 @@ jobs:
|
|
|
1419
1484
|
| [cypress-io/cypress-example-kitchensink](https://github.com/cypress-io/cypress-example-kitchensink) | Runs every API command in Cypress using various CI platforms including GitHub Actions |
|
|
1420
1485
|
| [cypress-io/cypress-realworld-app](https://github.com/cypress-io/cypress-realworld-app) | A real-world example payment application. Uses GitHub Actions and CircleCI. |
|
|
1421
1486
|
| [cypress-gh-action-monorepo](https://github.com/bahmutov/cypress-gh-action-monorepo) | Splits install and running tests commands, runs Cypress from sub-folder |
|
|
1422
|
-
| [cypress-examples](https://github.com/bahmutov/cypress-examples) | Shows separate install job from parallel test jobs |
|
|
1423
|
-
| [cypress-gh-action-split-jobs](https://github.com/bahmutov/cypress-gh-action-split-jobs) | Shows a separate install job with the build step, and another job that runs the tests |
|
|
1424
1487
|
|
|
1425
1488
|
## Migration
|
|
1426
1489
|
|
|
@@ -1598,7 +1661,7 @@ If you configure a `workflow_dispatch` event in your own workflows, you will be
|
|
|
1598
1661
|
|
|
1599
1662
|
### Outputs
|
|
1600
1663
|
|
|
1601
|
-
This action sets a GitHub step output `resultsUrl` if the run was recorded on [Cypress Cloud](https://on.cypress.io/cloud-introduction) using the action parameter setting `record: true` (see [Record test results on Cypress Cloud](#record-test-results-on-cypress-cloud)). Note that if a custom test command with the [command](#custom-test-command)
|
|
1664
|
+
This action sets a GitHub step output `resultsUrl` if the run was recorded on [Cypress Cloud](https://on.cypress.io/cloud-introduction) using the action parameter setting `record: true` (see [Record test results on Cypress Cloud](#record-test-results-on-cypress-cloud)). Note that if a custom test command with the [command](#custom-test-command) parameter or the [command-prefix](#command-prefix) parameter are used then no `resultsUrl` step output is saved.
|
|
1602
1665
|
|
|
1603
1666
|
This is an example of using the step output `resultsUrl`:
|
|
1604
1667
|
|
|
@@ -1749,7 +1812,7 @@ jobs:
|
|
|
1749
1812
|
|
|
1750
1813
|
Node.js is required to run this action. The recommended version `v6` supports:
|
|
1751
1814
|
|
|
1752
|
-
- **Node.js** 20.x, 22.x and
|
|
1815
|
+
- **Node.js** 20.x, 22.x, 23.x and 24.x
|
|
1753
1816
|
|
|
1754
1817
|
and is generally aligned with [Node.js's release schedule](https://github.com/nodejs/Release).
|
|
1755
1818
|
|
package/dist/index.js
CHANGED
|
@@ -63543,7 +63543,7 @@ module.exports = {
|
|
|
63543
63543
|
|
|
63544
63544
|
|
|
63545
63545
|
const { parseSetCookie } = __nccwpck_require__(4408)
|
|
63546
|
-
const { stringify
|
|
63546
|
+
const { stringify } = __nccwpck_require__(3121)
|
|
63547
63547
|
const { webidl } = __nccwpck_require__(1744)
|
|
63548
63548
|
const { Headers } = __nccwpck_require__(554)
|
|
63549
63549
|
|
|
@@ -63619,14 +63619,13 @@ function getSetCookies (headers) {
|
|
|
63619
63619
|
|
|
63620
63620
|
webidl.brandCheck(headers, Headers, { strict: false })
|
|
63621
63621
|
|
|
63622
|
-
const cookies =
|
|
63622
|
+
const cookies = headers.getSetCookie()
|
|
63623
63623
|
|
|
63624
63624
|
if (!cookies) {
|
|
63625
63625
|
return []
|
|
63626
63626
|
}
|
|
63627
63627
|
|
|
63628
|
-
|
|
63629
|
-
return cookies.map((pair) => parseSetCookie(Array.isArray(pair) ? pair[1] : pair))
|
|
63628
|
+
return cookies.map((pair) => parseSetCookie(pair))
|
|
63630
63629
|
}
|
|
63631
63630
|
|
|
63632
63631
|
/**
|
|
@@ -64054,14 +64053,15 @@ module.exports = {
|
|
|
64054
64053
|
/***/ }),
|
|
64055
64054
|
|
|
64056
64055
|
/***/ 3121:
|
|
64057
|
-
/***/ ((module
|
|
64056
|
+
/***/ ((module) => {
|
|
64058
64057
|
|
|
64059
64058
|
"use strict";
|
|
64060
64059
|
|
|
64061
64060
|
|
|
64062
|
-
|
|
64063
|
-
|
|
64064
|
-
|
|
64061
|
+
/**
|
|
64062
|
+
* @param {string} value
|
|
64063
|
+
* @returns {boolean}
|
|
64064
|
+
*/
|
|
64065
64065
|
function isCTLExcludingHtab (value) {
|
|
64066
64066
|
if (value.length === 0) {
|
|
64067
64067
|
return false
|
|
@@ -64322,31 +64322,13 @@ function stringify (cookie) {
|
|
|
64322
64322
|
return out.join('; ')
|
|
64323
64323
|
}
|
|
64324
64324
|
|
|
64325
|
-
let kHeadersListNode
|
|
64326
|
-
|
|
64327
|
-
function getHeadersList (headers) {
|
|
64328
|
-
if (headers[kHeadersList]) {
|
|
64329
|
-
return headers[kHeadersList]
|
|
64330
|
-
}
|
|
64331
|
-
|
|
64332
|
-
if (!kHeadersListNode) {
|
|
64333
|
-
kHeadersListNode = Object.getOwnPropertySymbols(headers).find(
|
|
64334
|
-
(symbol) => symbol.description === 'headers list'
|
|
64335
|
-
)
|
|
64336
|
-
|
|
64337
|
-
assert(kHeadersListNode, 'Headers cannot be parsed')
|
|
64338
|
-
}
|
|
64339
|
-
|
|
64340
|
-
const headersList = headers[kHeadersListNode]
|
|
64341
|
-
assert(headersList)
|
|
64342
|
-
|
|
64343
|
-
return headersList
|
|
64344
|
-
}
|
|
64345
|
-
|
|
64346
64325
|
module.exports = {
|
|
64347
64326
|
isCTLExcludingHtab,
|
|
64348
|
-
|
|
64349
|
-
|
|
64327
|
+
validateCookieName,
|
|
64328
|
+
validateCookiePath,
|
|
64329
|
+
validateCookieValue,
|
|
64330
|
+
toIMFDate,
|
|
64331
|
+
stringify
|
|
64350
64332
|
}
|
|
64351
64333
|
|
|
64352
64334
|
|
|
@@ -68350,6 +68332,7 @@ const {
|
|
|
68350
68332
|
isValidHeaderName,
|
|
68351
68333
|
isValidHeaderValue
|
|
68352
68334
|
} = __nccwpck_require__(2538)
|
|
68335
|
+
const util = __nccwpck_require__(3837)
|
|
68353
68336
|
const { webidl } = __nccwpck_require__(1744)
|
|
68354
68337
|
const assert = __nccwpck_require__(9491)
|
|
68355
68338
|
|
|
@@ -68903,6 +68886,9 @@ Object.defineProperties(Headers.prototype, {
|
|
|
68903
68886
|
[Symbol.toStringTag]: {
|
|
68904
68887
|
value: 'Headers',
|
|
68905
68888
|
configurable: true
|
|
68889
|
+
},
|
|
68890
|
+
[util.inspect.custom]: {
|
|
68891
|
+
enumerable: false
|
|
68906
68892
|
}
|
|
68907
68893
|
})
|
|
68908
68894
|
|
|
@@ -78079,6 +78065,20 @@ class Pool extends PoolBase {
|
|
|
78079
78065
|
? { ...options.interceptors }
|
|
78080
78066
|
: undefined
|
|
78081
78067
|
this[kFactory] = factory
|
|
78068
|
+
|
|
78069
|
+
this.on('connectionError', (origin, targets, error) => {
|
|
78070
|
+
// If a connection error occurs, we remove the client from the pool,
|
|
78071
|
+
// and emit a connectionError event. They will not be re-used.
|
|
78072
|
+
// Fixes https://github.com/nodejs/undici/issues/3895
|
|
78073
|
+
for (const target of targets) {
|
|
78074
|
+
// Do not use kRemoveClient here, as it will close the client,
|
|
78075
|
+
// but the client cannot be closed in this state.
|
|
78076
|
+
const idx = this[kClients].indexOf(target)
|
|
78077
|
+
if (idx !== -1) {
|
|
78078
|
+
this[kClients].splice(idx, 1)
|
|
78079
|
+
}
|
|
78080
|
+
}
|
|
78081
|
+
})
|
|
78082
78082
|
}
|
|
78083
78083
|
|
|
78084
78084
|
[kGetDispatcher] () {
|
|
@@ -93982,10 +93982,58 @@ const runTestsUsingCommandLine = async () => {
|
|
|
93982
93982
|
|
|
93983
93983
|
return exec.exec(quote(npxPath), cmd, opts)
|
|
93984
93984
|
}
|
|
93985
|
+
/**
|
|
93986
|
+
* Validate input parameters for consistency when command parameter is used
|
|
93987
|
+
* Output GitHub actions annotation warning if ignored parameters are used
|
|
93988
|
+
*/
|
|
93989
|
+
const commandIgnoredBooleanInputs = [
|
|
93990
|
+
// parameter name, default value
|
|
93991
|
+
['component', false],
|
|
93992
|
+
['headed', false],
|
|
93993
|
+
['parallel', false],
|
|
93994
|
+
['quiet', false],
|
|
93995
|
+
['record', false],
|
|
93996
|
+
['publish-summary', true]
|
|
93997
|
+
]
|
|
93998
|
+
const commandIgnoredStringInputs = [
|
|
93999
|
+
'auto-cancel-after-failures',
|
|
94000
|
+
'browser',
|
|
94001
|
+
'ci-build-id',
|
|
94002
|
+
'config',
|
|
94003
|
+
'config-file',
|
|
94004
|
+
'env',
|
|
94005
|
+
'group',
|
|
94006
|
+
'project',
|
|
94007
|
+
'spec',
|
|
94008
|
+
'tag',
|
|
94009
|
+
'command-prefix',
|
|
94010
|
+
'summary-title'
|
|
94011
|
+
]
|
|
94012
|
+
let ignoredInputParameters = []
|
|
94013
|
+
const validateCustomCommand = () => {
|
|
94014
|
+
commandIgnoredBooleanInputs.forEach((input) => {
|
|
94015
|
+
const inputParameter = input[0]
|
|
94016
|
+
const inputDefault = input[1]
|
|
94017
|
+
if (getInputBool(inputParameter) !== inputDefault) {
|
|
94018
|
+
ignoredInputParameters.push(inputParameter)
|
|
94019
|
+
}
|
|
94020
|
+
})
|
|
94021
|
+
commandIgnoredStringInputs.forEach((input) => {
|
|
94022
|
+
if (core.getInput(input)) {
|
|
94023
|
+
ignoredInputParameters.push(input)
|
|
94024
|
+
}
|
|
94025
|
+
})
|
|
94026
|
+
if (ignoredInputParameters.length > 0) {
|
|
94027
|
+
core.warning(
|
|
94028
|
+
`command parameter is used and the following other parameters are ignored: ${ignoredInputParameters.sort().join(', ')}.`
|
|
94029
|
+
)
|
|
94030
|
+
}
|
|
94031
|
+
}
|
|
93985
94032
|
|
|
93986
94033
|
/**
|
|
93987
94034
|
* Run Cypress tests by collecting input parameters
|
|
93988
94035
|
* and using Cypress module API to run tests.
|
|
94036
|
+
* If command parameter is specified, then run using @actions/exec instead.
|
|
93989
94037
|
* @see https://on.cypress.io/module-api
|
|
93990
94038
|
*/
|
|
93991
94039
|
const runTests = async () => {
|
|
@@ -94014,6 +94062,7 @@ const runTests = async () => {
|
|
|
94014
94062
|
|
|
94015
94063
|
if (customCommand) {
|
|
94016
94064
|
console.log('Using custom test command: %s', customCommand)
|
|
94065
|
+
validateCustomCommand() // catch ignored parameters and output warning
|
|
94017
94066
|
return execCommand(customCommand, true, 'run tests')
|
|
94018
94067
|
}
|
|
94019
94068
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cypress/github-action",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.9.1",
|
|
4
4
|
"description": "GitHub Action for running Cypress end-to-end and component tests",
|
|
5
5
|
"private": false,
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -52,12 +52,12 @@
|
|
|
52
52
|
"supports-color": "9.3.1"
|
|
53
53
|
},
|
|
54
54
|
"devDependencies": {
|
|
55
|
-
"@eslint/js": "9.
|
|
55
|
+
"@eslint/js": "9.26.0",
|
|
56
56
|
"@stylistic/eslint-plugin": "4.2.0",
|
|
57
57
|
"@types/node": "22.13.10",
|
|
58
58
|
"@vercel/ncc": "0.38.1",
|
|
59
|
-
"eslint": "9.
|
|
60
|
-
"eslint-plugin-cypress": "4.
|
|
59
|
+
"eslint": "9.26.0",
|
|
60
|
+
"eslint-plugin-cypress": "4.3.0",
|
|
61
61
|
"globals": "16.0.0",
|
|
62
62
|
"husky": "9.1.7",
|
|
63
63
|
"markdown-link-check": "3.13.7",
|