From 32385304d82c9eab3856db01588e1a5d5c465b82 Mon Sep 17 00:00:00 2001 From: Mike McCready <66998419+MikeMcC399@users.noreply.github.com> Date: Thu, 30 Mar 2023 16:16:10 +0200 Subject: [PATCH] Add GitHub installed browsers --- .../continuous-integration/github-actions.mdx | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/docs/guides/continuous-integration/github-actions.mdx b/docs/guides/continuous-integration/github-actions.mdx index eabb9f9aed..6cdad3590b 100644 --- a/docs/guides/continuous-integration/github-actions.mdx +++ b/docs/guides/continuous-integration/github-actions.mdx @@ -129,6 +129,31 @@ example project and place the above GitHub Action configuration in - Start the project web server (`npm start`) - Run the Cypress tests within our GitHub repository within Electron. +## Testing on GitHub with Installed Browsers + +[GitHub-hosted runners](https://github.com/actions/runner-images) offer images +with pre-installed browsers to use for testing. The `ubuntu` and `windows` +runners each include Google Chrome, Mozilla Firefox and Microsoft Edge +pre-installed. The `macos` runners additionally include Apple Safari. Refer to +[GitHub Actions Runner Images](https://github.com/actions/runner-images/blob/main/README.md) +for current details. + +Use the action's `browser` parameter to select the desired browser. To change +the above example to select Chrome instead of the default browser Electron, add +`browser: chrome` as follows. + +```yaml +- name: Cypress run + uses: cypress-io/github-action@v5 + with: + build: npm run build + start: npm start + browser: chrome +``` + +For more examples, see the action's +[Browser](https://github.com/cypress-io/github-action#browser) section. + ## Testing in Chrome and Firefox with Cypress Docker Images GitHub Actions provides the option to specify a container image for the job.