Skip to content

Commit

Permalink
add table of contents to the examples section
Browse files Browse the repository at this point in the history
  • Loading branch information
bahmutov committed Nov 13, 2020
1 parent 24e868e commit 414d144
Show file tree
Hide file tree
Showing 2 changed files with 70 additions and 39 deletions.
3 changes: 2 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,6 @@
},
"peacock.color": "#f9e64f",
"editor.formatOnPaste": false,
"editor.formatOnSave": true
"editor.formatOnSave": true,
"markdown.extension.toc.updateOnSave": false
}
106 changes: 68 additions & 38 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,36 @@
## Examples

- [Basic](#basic)
- [Explicit version](#explicit-version)
- Run tests in a given [browser](#browser)
* using [Firefox](#firefox)
* using [Edge](#edge)
* using [headless mode](#headless)
- Using [Docker image](#docker-image)
- Specify [environment variables](#env)
- Run only some [spec files](#specs)
- Test [project in subfolder](#project)
- [Record results](#record-test-results-on-cypress-dashboard) on Cypress Dashboard
- Tag [recordings](#tag-recordings)
- [Quiet output](#quiet-flag)
- Store [test artifacts](#artifacts) on GitHub
- Set Cypress [config values](#config)
- Use specific [config file](#config-file)
- Run tests in [parallel](#parallel)
- [Build app](#build-app) before running the tests
- [Start server](#start-server) before running the tests
- [Wait for server](#wait-on) before running the tests
- use [command prefix](#command-prefix)
- use [own custom test command](#custom-test-command)
- pass [custom build id](#custom-build-id) when recording to Dashboard
- use different [working-directory](#working-directory)
- use [custom cache key](#custom-cache-key)
- run tests on multiple [Node versions](#node-versions)
- split [install and tests](#split-install-and-tests) into separate jobs
- use [custom install commands](#custom-install)
- [more examples](#more-examples)

### Basic

```yml
Expand Down Expand Up @@ -64,44 +94,6 @@ jobs:

[![Chrome example](https://github.com/cypress-io/github-action/workflows/example-chrome/badge.svg?branch=master)](.github/workflows/example-chrome.yml)

### Headless

Run the browser in headless mode

```yml
name: Chrome headless
on: [push]
jobs:
cypress-run:
runs-on: ubuntu-16.04
steps:
- uses: actions/checkout@v1
- uses: cypress-io/github-action@v2
with:
browser: chrome
headless: true
```

### Docker image

You can run tests in a GH Action in your Docker container.

```yml
name: E2E in custom container
on: [push]
jobs:
cypress-run:
runs-on: ubuntu-16.04
# Cypress Docker image with Chrome v78
# and Firefox v70 pre-installed
container: cypress/browsers:node12.13.0-chrome78-ff70
steps:
- uses: actions/checkout@v1
- uses: cypress-io/github-action@v2
with:
browser: chrome
```

### Firefox

In order to run Firefox, you need to use non-root user (Firefox security restriction).
Expand Down Expand Up @@ -145,6 +137,44 @@ jobs:

**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.

### Headless

Run the browser in headless mode

```yml
name: Chrome headless
on: [push]
jobs:
cypress-run:
runs-on: ubuntu-16.04
steps:
- uses: actions/checkout@v1
- uses: cypress-io/github-action@v2
with:
browser: chrome
headless: true
```

### Docker image

You can run tests in a GH Action in your Docker container.

```yml
name: E2E in custom container
on: [push]
jobs:
cypress-run:
runs-on: ubuntu-16.04
# Cypress Docker image with Chrome v78
# and Firefox v70 pre-installed
container: cypress/browsers:node12.13.0-chrome78-ff70
steps:
- uses: actions/checkout@v1
- uses: cypress-io/github-action@v2
with:
browser: chrome
```

### Env

Specify the env argument with `env` parameter
Expand Down

0 comments on commit 414d144

Please sign in to comment.