diff --git a/.github/workflows/example-chrome-for-testing.yml b/.github/workflows/example-chrome-for-testing.yml new file mode 100644 index 000000000..b615fca35 --- /dev/null +++ b/.github/workflows/example-chrome-for-testing.yml @@ -0,0 +1,28 @@ +name: example-chrome-for-testing +on: + push: + branches: + - 'master' + pull_request: + workflow_dispatch: + +jobs: + tests: + runs-on: ubuntu-24.04 + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Install Chrome for Testing + # https://github.com/browser-actions/setup-chrome + uses: browser-actions/setup-chrome@v1 + with: + chrome-version: 137 + - name: Cypress info + uses: ./ + with: + # just for full picture after installing Cypress + # print information about detected browsers, etc + # see https://on.cypress.io/command-line#cypress-info + build: npm run info + working-directory: examples/browser + browser: chrome-for-testing diff --git a/README.md b/README.md index 0f5c5ebfa..981b24f6e 100644 --- a/README.md +++ b/README.md @@ -31,6 +31,7 @@ The following examples demonstrate the actions' functions. - Select [action version](#action-version) - Run tests in a given [browser](#browser) - using [Chrome](#chrome) + - using [Chrome for Testing](#chrome-for-testing) - using [Firefox](#firefox) - using [Edge](#edge) - using [headed mode](#headed) @@ -178,6 +179,29 @@ jobs: [![Chrome example](https://github.com/cypress-io/github-action/actions/workflows/example-chrome.yml/badge.svg)](.github/workflows/example-chrome.yml) +### Chrome for Testing + +To install [Google Chrome for Testing](https://developer.chrome.com/blog/chrome-for-testing/), specify a partial or full numerical Chrome for Testing version using [browser-actions/setup-chrome](https://github.com/browser-actions/setup-chrome). Refer to [Chrome for Testing availability](https://googlechromelabs.github.io/chrome-for-testing/) for current versions or [JSON API endpoints](https://github.com/GoogleChromeLabs/chrome-for-testing#json-api-endpoints) for all available versions. + +```yml +name: Chrome for Testing +on: push +jobs: + chrome: + runs-on: ubuntu-24.04 + name: E2E on Chrome for Testing + steps: + - uses: actions/checkout@v4 + - uses: browser-actions/setup-chrome@v1 + with: + chrome-version: 137 + - uses: cypress-io/github-action@v6 + with: + browser: chrome-for-testing +``` + +[![Chrome for Testing example](https://github.com/cypress-io/github-action/actions/workflows/example-chrome-for-testing.yml/badge.svg)](.github/workflows/example-chrome-for-testing.yml) + ### Firefox ```yml