Skip to content

Commit fdc236b

Browse files
authored
document configuration for v10+ (#133)
* document configuration for v10+ * update actions
1 parent f49124b commit fdc236b

File tree

4 files changed

+31
-8
lines changed

4 files changed

+31
-8
lines changed

.github/workflows/badges.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ jobs:
1212
runs-on: ubuntu-latest
1313
steps:
1414
- name: Checkout 🛎
15-
uses: actions/checkout@v2
15+
uses: actions/checkout@v3
1616

1717
- name: Update version badges 🏷
18-
run: npx -p dependency-version-badge update-badge cypress @bahmutov/cypress-fiddle
18+
run: npm run badges
1919

2020
- name: Commit any changed files 💾
2121
uses: stefanzweifel/git-auto-commit-action@v4

.github/workflows/ci.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ jobs:
55
runs-on: ubuntu-20.04
66
steps:
77
- name: Checkout 🛎
8-
uses: actions/checkout@v2
8+
uses: actions/checkout@v3
99

1010
# Node > 16
1111
# npm > 8
@@ -15,7 +15,7 @@ jobs:
1515
npm -v
1616
1717
- name: Run tests 🧪
18-
uses: cypress-io/github-action@v2
18+
uses: cypress-io/github-action@v5
1919
with:
2020
command: npm t
2121

@@ -26,7 +26,8 @@ jobs:
2626
# TODO: confirm the exported JavaScript file
2727
2828
- name: Semantic Release 🚀
29-
uses: cycjimmy/semantic-release-action@v2
29+
uses: cycjimmy/semantic-release-action@v3
30+
if: github.ref == 'refs/heads/main'
3031
with:
3132
branch: main
3233
env:

README.md

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,28 @@ npm i -D cypress-markdown-preprocessor
1616
yarn add -D cypress-markdown-preprocessor
1717
```
1818

19-
Add to your Cypress plugins file
19+
### Configure the plugin
20+
21+
If you are using Cypress v10+, add to your Cypress plugins file
22+
23+
```js
24+
// cypress.config.js
25+
const { defineConfig } = require('cypress')
26+
const mdPreprocessor = require('cypress-markdown-preprocessor')
27+
28+
module.exports = defineConfig({
29+
e2e: {
30+
setupNodeEvents(on, config) {
31+
on('file:preprocessor', mdPreprocessor)
32+
return config
33+
},
34+
// use Markdown file from folder "docs" as tests
35+
specPattern: 'docs/**/*.md',
36+
},
37+
})
38+
```
39+
40+
If you are using Cypress before version 10, add the following to your plugins file:
2041

2142
```js
2243
// cypress/plugins/index.js
@@ -26,7 +47,7 @@ module.exports = (on, config) => {
2647
}
2748
```
2849

29-
Set the [`testFiles`](https://on.cypress.io/configuration) to use Markdown files as specs
50+
And set the [`testFiles`](https://on.cypress.io/configuration) in file `cypress.json` to use Markdown files as specs
3051

3152
```json
3253
{

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@
1414
"cy:open": "cypress open",
1515
"cy:run": "cypress run",
1616
"test": "cypress-expect run --min-passing 2",
17-
"semantic-release": "semantic-release"
17+
"semantic-release": "semantic-release",
18+
"badges": "npx -p dependency-version-badge update-badge cypress @bahmutov/cypress-fiddle"
1819
},
1920
"repository": {
2021
"type": "git",

0 commit comments

Comments
 (0)