Skip to content

Commit

Permalink
test: rework example-chrome workflow (cypress-io#1035)
Browse files Browse the repository at this point in the history
* test: rework example-chrome workflow

* explain use of build parameter
  • Loading branch information
MikeMcC399 authored Sep 19, 2023
1 parent 8b1cbe3 commit 0b0a8fe
Showing 1 changed file with 16 additions and 12 deletions.
28 changes: 16 additions & 12 deletions .github/workflows/example-chrome.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,39 +14,43 @@ jobs:
- name: Checkout
uses: actions/checkout@v4

- name: Cypress info
- name: Chrome headless
uses: ./
with:
# just for full picture after installing Cypress
# print information about detected browsers, etc
# Print information about the system and current environment
# including detected browsers
# which are pre-installed in GitHub-hosted runners
# see https://on.cypress.io/command-line#cypress-info
# We do not need the build parameter to build an app here
# because the remote https://example.cypress.io site
# is already built and running, and so for convenience
# we repurpose the build parameter to get cypress info instead.
build: npx cypress info
working-directory: examples/browser

- name: Chrome
uses: ./
with:
working-directory: examples/browser
browser: chrome
# As of Cypress v8.0 the `cypress run` command
# executes tests in `headless` mode by default

- uses: actions/upload-artifact@v3
with:
name: screenshots-in-chrome
name: screenshots-headless-chrome
path: examples/browser/cypress/screenshots

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

- name: Chrome headless
- name: Chrome headed
uses: ./
with:
# Cypress and dependencies are already installed
install: false
working-directory: examples/browser
browser: chrome
headed: false
headed: true

- uses: actions/upload-artifact@v3
with:
name: screenshots-in-headless-chrome
name: screenshots-headed-chrome
path: examples/browser/cypress/screenshots

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

0 comments on commit 0b0a8fe

Please sign in to comment.