@cypress/github-action 7.2.0 → 7.3.0
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 +26 -0
- package/action.yml +3 -0
- package/dist/index.js +14 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -37,6 +37,7 @@ The following examples demonstrate the actions' functions.
|
|
|
37
37
|
- using [headed mode](#headed)
|
|
38
38
|
- Using [Docker image](#docker-image)
|
|
39
39
|
- Specify [environment variables](#env)
|
|
40
|
+
- Specify [expose variables](#expose)
|
|
40
41
|
- Run only some [spec files](#specs)
|
|
41
42
|
- Test [project in subfolder](#project)
|
|
42
43
|
- [Record results](#record-test-results-on-cypress-cloud) on Cypress Cloud
|
|
@@ -358,6 +359,30 @@ For more examples, see the workflows below, using environment variables for [rec
|
|
|
358
359
|
|
|
359
360
|
[](.github/workflows/example-env.yml)
|
|
360
361
|
|
|
362
|
+
### Expose
|
|
363
|
+
|
|
364
|
+
Specify the expose argument with `expose` parameter. Expose variables are for non-sensitive, public config values that are synchronous and exposed to the browser (requires Cypress 15.10.0 or later).
|
|
365
|
+
|
|
366
|
+
```yml
|
|
367
|
+
name: Cypress tests
|
|
368
|
+
on: push
|
|
369
|
+
jobs:
|
|
370
|
+
cypress-run:
|
|
371
|
+
runs-on: ubuntu-24.04
|
|
372
|
+
steps:
|
|
373
|
+
- name: Checkout
|
|
374
|
+
uses: actions/checkout@v6
|
|
375
|
+
|
|
376
|
+
- name: Cypress run with expose
|
|
377
|
+
uses: cypress-io/github-action@v7
|
|
378
|
+
with:
|
|
379
|
+
expose: host=api.dev.local,port=4222
|
|
380
|
+
```
|
|
381
|
+
|
|
382
|
+
For more information, see [Cypress.expose()](https://docs.cypress.io/api/cypress-api/expose) in the Cypress documentation.
|
|
383
|
+
|
|
384
|
+
[](.github/workflows/example-expose.yml)
|
|
385
|
+
|
|
361
386
|
### Specs
|
|
362
387
|
|
|
363
388
|
Specify the [spec files to run](https://docs.cypress.io/guides/guides/command-line.html#cypress-run-spec-lt-spec-gt) with `spec` parameter
|
|
@@ -1619,6 +1644,7 @@ jobs:
|
|
|
1619
1644
|
| `--config-file`, `-C` | [`config-file`](#config-file) | Specify configuration file |
|
|
1620
1645
|
| `--e2e` | [`component: false`](#component-testing) (default) | Run end to end tests |
|
|
1621
1646
|
| `--env`, `-e` | [`env`](#env) | Specify environment variables |
|
|
1647
|
+
| `--expose`, `-x` | [`expose`](#expose) | Specify expose variables for non-sensitive, public config values |
|
|
1622
1648
|
| `--group` | [`group`](#parallel) | Group recorded tests together under a single run for Cloud recording |
|
|
1623
1649
|
| `--headed` | [`headed`](#headed) | Display the browser instead of running headlessly |
|
|
1624
1650
|
| `--headless` | [`headed: false`](#headed) (default) | Hide the browser instead of running headed |
|
package/action.yml
CHANGED
|
@@ -29,6 +29,9 @@ inputs:
|
|
|
29
29
|
env:
|
|
30
30
|
description: 'Sets Cypress environment variables'
|
|
31
31
|
required: false
|
|
32
|
+
expose:
|
|
33
|
+
description: 'Sets Cypress expose variables for non-sensitive, public config values (requires Cypress 15.10.0 or later)'
|
|
34
|
+
required: false
|
|
32
35
|
group:
|
|
33
36
|
description: 'Group setting for recording tests'
|
|
34
37
|
required: false
|
package/dist/index.js
CHANGED
|
@@ -102320,6 +102320,12 @@ const runTestsUsingCommandLine = async () => {
|
|
|
102320
102320
|
cmd.push(envInput)
|
|
102321
102321
|
}
|
|
102322
102322
|
|
|
102323
|
+
const exposeInput = core.getInput('expose')
|
|
102324
|
+
if (exposeInput) {
|
|
102325
|
+
cmd.push('--expose')
|
|
102326
|
+
cmd.push(exposeInput)
|
|
102327
|
+
}
|
|
102328
|
+
|
|
102323
102329
|
const quiet = getInputBool('quiet')
|
|
102324
102330
|
if (quiet) {
|
|
102325
102331
|
cmd.push('--quiet')
|
|
@@ -102360,6 +102366,7 @@ const commandIgnoredStringInputs = [
|
|
|
102360
102366
|
'config',
|
|
102361
102367
|
'config-file',
|
|
102362
102368
|
'env',
|
|
102369
|
+
'expose',
|
|
102363
102370
|
'group',
|
|
102364
102371
|
'project',
|
|
102365
102372
|
'spec',
|
|
@@ -102383,7 +102390,9 @@ const validateCustomCommand = () => {
|
|
|
102383
102390
|
})
|
|
102384
102391
|
if (ignoredInputParameters.length > 0) {
|
|
102385
102392
|
core.warning(
|
|
102386
|
-
`command parameter is used and the following other parameters are ignored: ${ignoredInputParameters
|
|
102393
|
+
`command parameter is used and the following other parameters are ignored: ${ignoredInputParameters
|
|
102394
|
+
.sort()
|
|
102395
|
+
.join(', ')}.`
|
|
102387
102396
|
)
|
|
102388
102397
|
}
|
|
102389
102398
|
}
|
|
@@ -102479,6 +102488,10 @@ const runTests = async () => {
|
|
|
102479
102488
|
cypressOptions.env = core.getInput('env')
|
|
102480
102489
|
}
|
|
102481
102490
|
|
|
102491
|
+
if (core.getInput('expose')) {
|
|
102492
|
+
cypressOptions.expose = core.getInput('expose')
|
|
102493
|
+
}
|
|
102494
|
+
|
|
102482
102495
|
if (cypressOptions.parallel || cypressOptions.group) {
|
|
102483
102496
|
const { branch, buildId } = await getCiBuildId()
|
|
102484
102497
|
if (branch) {
|