@cypress/github-action 4.0.0 → 4.1.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 +5 -6
- package/action.yml +2 -2
- package/dist/index.js +51 -4
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -4,13 +4,12 @@
|
|
|
4
4
|
|
|
5
5
|
## Examples
|
|
6
6
|
|
|
7
|
-
- [Cypress 10](#cypress-10)
|
|
8
7
|
- [Basic](#basic)
|
|
9
8
|
- [Explicit version](#explicit-version)
|
|
10
9
|
- Run tests in a given [browser](#browser)
|
|
11
10
|
- using [Firefox](#firefox)
|
|
12
11
|
- using [Edge](#edge)
|
|
13
|
-
- using [
|
|
12
|
+
- using [headed mode](#headed)
|
|
14
13
|
- Using [Docker image](#docker-image)
|
|
15
14
|
- Specify [environment variables](#env)
|
|
16
15
|
- Run only some [spec files](#specs)
|
|
@@ -150,12 +149,12 @@ jobs:
|
|
|
150
149
|
|
|
151
150
|
**Note:** Microsoft has not released Edge for Linux yet, thus you need to run these tests on Windows or Mac runners with Edge preinstalled. You can use [`cypress info`](https://on.cypress.io/command-line#cypress-info) command to see the browsers installed on the machine.
|
|
152
151
|
|
|
153
|
-
###
|
|
152
|
+
### Headed
|
|
154
153
|
|
|
155
|
-
Run the browser in headless mode
|
|
154
|
+
Run the browser in headed mode - as of Cypress v8.0 the `cypress run` command executes tests in `headless` mode by default
|
|
156
155
|
|
|
157
156
|
```yml
|
|
158
|
-
name: Chrome
|
|
157
|
+
name: Chrome headed
|
|
159
158
|
on: [push]
|
|
160
159
|
jobs:
|
|
161
160
|
cypress-run:
|
|
@@ -165,7 +164,7 @@ jobs:
|
|
|
165
164
|
- uses: cypress-io/github-action@v4
|
|
166
165
|
with:
|
|
167
166
|
browser: chrome
|
|
168
|
-
|
|
167
|
+
headed: true
|
|
169
168
|
```
|
|
170
169
|
|
|
171
170
|
### Docker image
|
package/action.yml
CHANGED
|
@@ -59,8 +59,8 @@ inputs:
|
|
|
59
59
|
working-directory:
|
|
60
60
|
description: 'Working directory containing Cypress folder'
|
|
61
61
|
required: false
|
|
62
|
-
|
|
63
|
-
description: 'Whether or not to use
|
|
62
|
+
headed:
|
|
63
|
+
description: 'Whether or not to use headed mode'
|
|
64
64
|
required: false
|
|
65
65
|
spec:
|
|
66
66
|
description: 'Provide a specific specs to run'
|
package/dist/index.js
CHANGED
|
@@ -74623,6 +74623,7 @@ const cliParser = __nccwpck_require__(8604)()
|
|
|
74623
74623
|
const findYarnWorkspaceRoot = __nccwpck_require__(6748)
|
|
74624
74624
|
const debug = __nccwpck_require__(8237)('@cypress/github-action')
|
|
74625
74625
|
const { ping } = __nccwpck_require__(9390)
|
|
74626
|
+
const { SUMMARY_ENV_VAR } = __nccwpck_require__(1327)
|
|
74626
74627
|
|
|
74627
74628
|
/**
|
|
74628
74629
|
* Parses input command, finds the tool and
|
|
@@ -75105,8 +75106,8 @@ const runTestsUsingCommandLine = async () => {
|
|
|
75105
75106
|
|
|
75106
75107
|
const record = getInputBool('record')
|
|
75107
75108
|
const parallel = getInputBool('parallel')
|
|
75108
|
-
const headless = getInputBool('headless')
|
|
75109
75109
|
const component = getInputBool('component')
|
|
75110
|
+
const headed = getInputBool('headed')
|
|
75110
75111
|
|
|
75111
75112
|
// TODO using yarn to run cypress when yarn is used for install
|
|
75112
75113
|
// split potentially long command?
|
|
@@ -75125,8 +75126,8 @@ const runTestsUsingCommandLine = async () => {
|
|
|
75125
75126
|
if (component) {
|
|
75126
75127
|
cmd.push('--component')
|
|
75127
75128
|
}
|
|
75128
|
-
if (
|
|
75129
|
-
cmd.push('--
|
|
75129
|
+
if (headed) {
|
|
75130
|
+
cmd.push('--headed')
|
|
75130
75131
|
}
|
|
75131
75132
|
if (record) {
|
|
75132
75133
|
cmd.push('--record')
|
|
@@ -75226,7 +75227,7 @@ const runTests = async () => {
|
|
|
75226
75227
|
const commandPrefix = core.getInput('command-prefix')
|
|
75227
75228
|
const customCommand = core.getInput('command')
|
|
75228
75229
|
const cypressOptions = {
|
|
75229
|
-
|
|
75230
|
+
headed: getInputBool('headed'),
|
|
75230
75231
|
record: getInputBool('record'),
|
|
75231
75232
|
parallel: getInputBool('parallel'),
|
|
75232
75233
|
quiet: getInputBool('quiet'),
|
|
@@ -75355,9 +75356,55 @@ const runTests = async () => {
|
|
|
75355
75356
|
process.chdir(workingDirectory)
|
|
75356
75357
|
return cypress
|
|
75357
75358
|
.run(cypressOptions)
|
|
75359
|
+
.then(generateSummary)
|
|
75358
75360
|
.then(onTestsFinished, onTestsError)
|
|
75359
75361
|
}
|
|
75360
75362
|
|
|
75363
|
+
// Summary is not available for GitHub Enterprise at the moment
|
|
75364
|
+
const isSummaryEnabled = () => {
|
|
75365
|
+
return process.env[SUMMARY_ENV_VAR] !== undefined
|
|
75366
|
+
}
|
|
75367
|
+
|
|
75368
|
+
const generateSummary = async (testResults) => {
|
|
75369
|
+
if (!isSummaryEnabled()) {
|
|
75370
|
+
return testResults
|
|
75371
|
+
}
|
|
75372
|
+
|
|
75373
|
+
const headers = [
|
|
75374
|
+
{ data: 'Result', header: true },
|
|
75375
|
+
{ data: 'Passed :white_check_mark:', header: true },
|
|
75376
|
+
{ data: 'Failed :x:', header: true },
|
|
75377
|
+
{ data: 'Pending :hand:', header: true },
|
|
75378
|
+
{ data: 'Skipped :leftwards_arrow_with_hook:', header: true },
|
|
75379
|
+
{ data: 'Duration :clock8:', header: true }
|
|
75380
|
+
]
|
|
75381
|
+
|
|
75382
|
+
const status =
|
|
75383
|
+
testResults.totalFailed === 0
|
|
75384
|
+
? 'Passing :white_check_mark:'
|
|
75385
|
+
: 'Failing :red_circle:'
|
|
75386
|
+
|
|
75387
|
+
const summaryRows = [
|
|
75388
|
+
status,
|
|
75389
|
+
`${testResults.totalPassed}`,
|
|
75390
|
+
`${testResults.totalFailed}`,
|
|
75391
|
+
`${testResults.totalPending}`,
|
|
75392
|
+
`${testResults.totalSkipped}`,
|
|
75393
|
+
`${testResults.totalDuration / 1000}s` || ''
|
|
75394
|
+
]
|
|
75395
|
+
|
|
75396
|
+
await core.summary
|
|
75397
|
+
.addHeading('Cypress Results', 2)
|
|
75398
|
+
.addTable([headers, summaryRows])
|
|
75399
|
+
.addLink(
|
|
75400
|
+
testResults.runUrl ? 'View Run in Dashboard' : '',
|
|
75401
|
+
testResults.runUrl || ''
|
|
75402
|
+
)
|
|
75403
|
+
.write()
|
|
75404
|
+
|
|
75405
|
+
return testResults
|
|
75406
|
+
}
|
|
75407
|
+
|
|
75361
75408
|
const installMaybe = () => {
|
|
75362
75409
|
const installParameter = getInputBool('install', true)
|
|
75363
75410
|
if (!installParameter) {
|