Skip to content

Commit cc9fbf5

Browse files
committed
chore: configure Cucumber testing with CI workflow and reporting
1 parent b94140f commit cc9fbf5

File tree

4 files changed

+62
-4
lines changed

4 files changed

+62
-4
lines changed

.github/workflows/playwright.yml

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
1-
name: Playwright Tests
1+
name: E2E Tests
22
on:
33
push:
44
branches: [ main, master ]
55
pull_request:
66
branches: [ main, master ]
7+
78
jobs:
8-
test:
9+
playwright:
10+
name: Playwright Tests
911
timeout-minutes: 60
1012
runs-on: ubuntu-latest
1113
steps:
@@ -25,6 +27,28 @@ jobs:
2527
- uses: actions/upload-artifact@v4
2628
if: ${{ !cancelled() }}
2729
with:
28-
name: playwright-report
30+
name: playwright-results
2931
path: playwright-report/
3032
retention-days: 10
33+
34+
cucumber:
35+
name: Cucumber Tests
36+
timeout-minutes: 30
37+
runs-on: ubuntu-latest
38+
steps:
39+
- uses: actions/checkout@v4
40+
- uses: actions/setup-node@v4
41+
with:
42+
node-version: lts/*
43+
- name: Install dependencies
44+
run: npm ci
45+
- name: Install Playwright Browser
46+
run: npx playwright install chromium
47+
- name: Run Cucumber tests
48+
run: npm run test:cucumber
49+
- uses: actions/upload-artifact@v4
50+
if: ${{ !cancelled() }}
51+
with:
52+
name: cucumber-results
53+
path: cucumber-report/
54+
retention-days: 10

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,12 @@ cypress/videos/
3434

3535
# Cucumber Specific
3636
.cucumber-cache/
37+
cucumber-report/
3738
cucumber-report.html
3839
cucumber-report.json
40+
junit.xml
41+
cucumber-report/**/*
42+
reports/cucumber/**
3943

4044
# IDE and Editor Files
4145
.idea/

cucumber.config.js

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
const common = {
2+
formatOptions: {
3+
snippetInterface: 'async-await'
4+
},
5+
format: [
6+
'progress-bar',
7+
'html:cucumber-report/report.html',
8+
'json:cucumber-report/report.json'
9+
],
10+
paths: ['tests/e2e/cucumber-tests/features/**/*.feature'],
11+
require: [
12+
'tests/e2e/cucumber-tests/steps/**/*.js',
13+
'tests/e2e/cucumber-tests/pages/**/*.js',
14+
'tests/e2e/cucumber-tests/utils/**/*.js'
15+
]
16+
};
17+
18+
module.exports = {
19+
default: {
20+
...common,
21+
parallel: 2,
22+
format: [...common.format, 'summary']
23+
},
24+
ci: {
25+
...common,
26+
parallel: 4,
27+
format: [...common.format, 'junit:cucumber-report/junit.xml'],
28+
retry: 1
29+
}
30+
};

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"test:head": "npx playwright test --headed",
1010
"test:debug": "npx playwright test --debug",
1111
"test:codegen": "npx playwright codegen",
12-
"test:cucumber": "cucumber-js --config cucumber.json"
12+
"test:cucumber": "cucumber-js --config cucumber.config.js --profile ci"
1313
},
1414
"keywords": [],
1515
"author": "",

0 commit comments

Comments
 (0)