Skip to content

Commit 4581de4

Browse files
authored
test: demonstrate config-file parameter (#1047)
1 parent bd9dda3 commit 4581de4

File tree

3 files changed

+32
-2
lines changed

3 files changed

+32
-2
lines changed

.github/workflows/example-config.yml

+16
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,22 @@ jobs:
2424
wait-on: 'http://localhost:3333'
2525
config: baseUrl=http://localhost:3333
2626

27+
config-file:
28+
# example where we use a custom config-file
29+
runs-on: ubuntu-22.04
30+
steps:
31+
- name: Checkout
32+
uses: actions/checkout@v4
33+
34+
- name: Cypress tests
35+
uses: ./
36+
with:
37+
working-directory: examples/config
38+
build: npm run build
39+
start: npm start
40+
wait-on: 'http://localhost:3333'
41+
config-file: cypress.config-alternate.js
42+
2743
separate-specs:
2844
# example where we pass specs to run via multiple lines
2945
runs-on: ubuntu-22.04

README.md

+4-2
Original file line numberDiff line numberDiff line change
@@ -547,7 +547,7 @@ jobs:
547547

548548
### Config File
549549

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

552552
```yml
553553
name: Cypress tests
@@ -563,9 +563,11 @@ jobs:
563563
- name: Cypress run
564564
uses: cypress-io/github-action@v6
565565
with:
566-
config-file: tests/cypress-config.json
566+
config-file: cypress.config-alternate.js
567567
```
568568

569+
[![example-config](https://github.com/cypress-io/github-action/workflows/example-config/badge.svg?branch=master)](.github/workflows/example-config.yml)
570+
569571
### Parallel
570572

571573
**Note:** Cypress parallelization requires a [Cypress Cloud](https://on.cypress.io/cloud-introduction) account.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
const { defineConfig } = require('cypress')
2+
3+
module.exports = defineConfig({
4+
fixturesFolder: false,
5+
e2e: {
6+
baseUrl: 'http://localhost:3333',
7+
setupNodeEvents(on, config) {
8+
console.log('\nUsing cypress.config-alternate.js config-file')
9+
},
10+
supportFile: false
11+
},
12+
})

0 commit comments

Comments
 (0)