Skip to content

Commit c290d25

Browse files
authored
Merge pull request #3 from sirajvind/pulsifi-automation-test
feat(automation): Implement Cucumber BDD Tests with Playwright for Mailsac
2 parents ae0838c + cc9fbf5 commit c290d25

File tree

10 files changed

+2734
-56
lines changed

10 files changed

+2734
-56
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: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,15 @@ playwright/.cache/
3232
cypress/screenshots/
3333
cypress/videos/
3434

35+
# Cucumber Specific
36+
.cucumber-cache/
37+
cucumber-report/
38+
cucumber-report.html
39+
cucumber-report.json
40+
junit.xml
41+
cucumber-report/**/*
42+
reports/cucumber/**
43+
3544
# IDE and Editor Files
3645
.idea/
3746
.vscode/

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+
};

cucumber.json

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"default": {
3+
"paths": [
4+
"tests/e2e/cucumber-tests/features"
5+
],
6+
"require": [
7+
"tests/e2e/cucumber-tests/steps/*.js"
8+
],
9+
"formatOptions": {
10+
"snippetInterface": "async-await"
11+
},
12+
"format": [
13+
"progress-bar",
14+
"html:cucumber-report.html"
15+
],
16+
"worldParameters": {
17+
"timeout": 30000
18+
19+
}
20+
}
21+
}

0 commit comments

Comments
 (0)