Skip to content

Commit ce5a53d

Browse files
committed
add inspector mode
1 parent 079aa97 commit ce5a53d

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
"format": "biome format --write",
1414
"test": "vitest",
1515
"test:bdd": "cucumber-js",
16+
"test:bdd:debug": "PWDEBUG=1 cucumber-js",
1617
"type-check": "tsc --noEmit",
1718
"prepare": "husky",
1819
"oidc": "node dev-auth/oidc-provider.mjs",

tests/bdd/support/hooks.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,21 @@ let browser: Browser | undefined;
1212
setDefaultTimeout(60 * 1000); // 60s per step
1313

1414
Before(async function (this: PlaywrightWorld) {
15+
const isDebug = !!process.env.PWDEBUG;
1516
if (!browser) {
16-
browser = await chromium.launch({ headless: true });
17+
browser = await chromium.launch({
18+
headless: !isDebug,
19+
slowMo: isDebug ? 100 : 0,
20+
});
1721
}
1822
const context: BrowserContext = await browser.newContext();
1923
const page: Page = await context.newPage();
2024
this.context = context;
2125
this.page = page;
26+
27+
if (isDebug) {
28+
await this.page.pause();
29+
}
2230
});
2331

2432
After(async function (this: PlaywrightWorld) {

0 commit comments

Comments
 (0)