Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: demonstrate config-file parameter #1047

Merged
merged 1 commit into from
Oct 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions .github/workflows/example-config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,22 @@ jobs:
wait-on: 'http://localhost:3333'
config: baseUrl=http://localhost:3333

config-file:
# example where we use a custom config-file
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Cypress tests
uses: ./
with:
working-directory: examples/config
build: npm run build
start: npm start
wait-on: 'http://localhost:3333'
config-file: cypress.config-alternate.js

separate-specs:
# example where we pass specs to run via multiple lines
runs-on: ubuntu-22.04
Expand Down
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -547,7 +547,7 @@ jobs:

### Config File

Specify the path to your config file with `config-file` parameter
Specify the path to your [Configuration File](https://on.cypress.io/guides/references/configuration#Configuration-File) with `config-file` parameter

```yml
name: Cypress tests
Expand All @@ -563,9 +563,11 @@ jobs:
- name: Cypress run
uses: cypress-io/github-action@v6
with:
config-file: tests/cypress-config.json
config-file: cypress.config-alternate.js
```

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

### Parallel

**Note:** Cypress parallelization requires a [Cypress Cloud](https://on.cypress.io/cloud-introduction) account.
Expand Down
12 changes: 12 additions & 0 deletions examples/config/cypress.config-alternate.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
const { defineConfig } = require('cypress')

module.exports = defineConfig({
fixturesFolder: false,
e2e: {
baseUrl: 'http://localhost:3333',
setupNodeEvents(on, config) {
console.log('\nUsing cypress.config-alternate.js config-file')
},
supportFile: false
},
})