Skip to content

Commit 0b0a8fe

Browse files
authored
test: rework example-chrome workflow (#1035)
* test: rework example-chrome workflow * explain use of build parameter
1 parent 8b1cbe3 commit 0b0a8fe

File tree

1 file changed

+16
-12
lines changed

1 file changed

+16
-12
lines changed

.github/workflows/example-chrome.yml

+16-12
Original file line numberDiff line numberDiff line change
@@ -14,39 +14,43 @@ jobs:
1414
- name: Checkout
1515
uses: actions/checkout@v4
1616

17-
- name: Cypress info
17+
- name: Chrome headless
1818
uses: ./
1919
with:
20-
# just for full picture after installing Cypress
21-
# print information about detected browsers, etc
20+
# Print information about the system and current environment
21+
# including detected browsers
22+
# which are pre-installed in GitHub-hosted runners
2223
# see https://on.cypress.io/command-line#cypress-info
24+
# We do not need the build parameter to build an app here
25+
# because the remote https://example.cypress.io site
26+
# is already built and running, and so for convenience
27+
# we repurpose the build parameter to get cypress info instead.
2328
build: npx cypress info
2429
working-directory: examples/browser
25-
26-
- name: Chrome
27-
uses: ./
28-
with:
29-
working-directory: examples/browser
3030
browser: chrome
31+
# As of Cypress v8.0 the `cypress run` command
32+
# executes tests in `headless` mode by default
3133

3234
- uses: actions/upload-artifact@v3
3335
with:
34-
name: screenshots-in-chrome
36+
name: screenshots-headless-chrome
3537
path: examples/browser/cypress/screenshots
3638

3739
- run: npx image-size cypress/screenshots/**/*.png
3840
working-directory: examples/browser
3941

40-
- name: Chrome headless
42+
- name: Chrome headed
4143
uses: ./
4244
with:
45+
# Cypress and dependencies are already installed
46+
install: false
4347
working-directory: examples/browser
4448
browser: chrome
45-
headed: false
49+
headed: true
4650

4751
- uses: actions/upload-artifact@v3
4852
with:
49-
name: screenshots-in-headless-chrome
53+
name: screenshots-headed-chrome
5054
path: examples/browser/cypress/screenshots
5155

5256
- run: npx image-size cypress/screenshots/**/*.png

0 commit comments

Comments
 (0)