Skip to content

Commit 392ab45

Browse files
authored
Merge pull request #552 from patilatharv/feat/wdio-video-login-533
test(bdd): add WDIO video recording for “Wrong login” scenario (#533)
2 parents 0f49a2a + d52bd2b commit 392ab45

File tree

4 files changed

+35
-14
lines changed

4 files changed

+35
-14
lines changed

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,7 @@ web-build/
2828
.env
2929

3030
#asdf
31-
.tool-versions
31+
.tool-versions
32+
33+
# Test videos
34+
apps/bdd/test-videos/

apps/bdd/features/iteration3/send-token-by-email.feature

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,5 @@ Feature: send token to someone by email address
1010
And I input the email address and click 'submit'
1111
Then I should see a confirmation message that the token has been sent
1212
And I should receive an email with the token details
13-
Email content:
14-
| subject | Greenstand Token sent to you! |
15-
| body | You have received a token from wallet-1. Please click link below to claim it. |
13+
| subject | Greenstand Token sent to you! |
14+
| body | You have received a token from wallet-1. Please click link below to claim it. |

apps/bdd/package.json

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,30 +5,33 @@
55
"description": "WebdriverIO End-to-End Tests for Treetracker Wallet App",
66
"main": "index.js",
77
"scripts": {
8-
"wdio": "wdio run ./wdio.conf.js",
9-
"wdio:watch": "wdio run ./wdio.conf.js --watch",
8+
"wdio": "wdio run ./wdio.conf.ts",
9+
"wdio:watch": "wdio run ./wdio.conf.ts --watch",
1010
"type-check": "tsc --noEmit",
1111
"build": "tsc",
12-
"test": "wdio run ./wdio.conf.js",
13-
"test:local": "wdio run ./wdio.conf.js --baseUrl http://localhost:3000",
14-
"test:headless": "wdio run ./wdio.conf.js --headless",
15-
"test:login": "wdio run ./wdio.conf.js --spec ./features/login.feature",
16-
"test:debug": "wdio run ./wdio.conf.js --logLevel debug",
12+
"test": "wdio run ./wdio.conf.ts",
13+
"test:local": "wdio run ./wdio.conf.ts --baseUrl http://localhost:3000",
14+
"test:headless": "wdio run ./wdio.conf.ts --headless",
15+
"test:login": "wdio run ./wdio.conf.ts --spec ./features/login.feature",
16+
"test:debug": "wdio run ./wdio.conf.ts --logLevel debug",
1717
"test:update-driver": "yarn add -D chromedriver@latest"
1818
},
1919
"devDependencies": {
2020
"@badisi/wdio-harness": "^4.2.0",
2121
"@testing-library/webdriverio": "^3.2.1",
2222
"@types/jasmine": "^5.1.8",
23-
"@types/node": "^24.2.1",
23+
"@types/node": "^24.5.0",
2424
"@wdio/cli": "^9.18.4",
2525
"@wdio/cucumber-framework": "^9.18.0",
2626
"@wdio/globals": "^9.17.0",
2727
"@wdio/jasmine-framework": "^9.18.0",
2828
"@wdio/local-runner": "^9.18.4",
2929
"@wdio/spec-reporter": "^9.18.0",
30-
"chromedriver": "136.0.0",
30+
"chromedriver": "^140.0.2",
31+
"ts-node": "^10.9.2",
32+
"typescript": "^5.9.2",
3133
"wdio-chromedriver-service": "^8.1.1",
34+
"wdio-video-reporter": "^6.1.1",
3235
"wdio-wait-for": "^3.1.0"
3336
}
3437
}

apps/bdd/wdio.conf.ts

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
import type { Options } from "@wdio/types";
2+
import path from "node:path";
3+
// Video reporter for recording test execution - useful for debugging and demos
4+
import Video from "wdio-video-reporter";
25

36
export const config: Options.Testrunner = {
47
//
@@ -140,7 +143,20 @@ export const config: Options.Testrunner = {
140143
// Test reporter for stdout.
141144
// The only one supported by default is 'dot'
142145
// see also: https://webdriver.io/docs/dot-reporter
143-
reporters: ["spec"],
146+
reporters: [
147+
"spec",
148+
// Video reporter: Records test execution for debugging and analysis
149+
// Videos are saved to apps/bdd/test-videos/ directory
150+
[
151+
Video as any,
152+
{
153+
saveAllVideos: true, // record all test runs including passing tests
154+
outputDir: path.resolve(__dirname, "test-videos"), // output directory for video files
155+
videoSlowdownMultiplier: 1,
156+
videoFormat: "mp4", // MP4 format for better compatibility
157+
},
158+
],
159+
],
144160

145161
// If you are using Cucumber you need to specify the location of your step definitions.
146162
cucumberOpts: {

0 commit comments

Comments
 (0)