@vijaypjavvadi/bdd2pw 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (83) hide show
  1. package/CHANGELOG.md +308 -0
  2. package/LICENSE +21 -0
  3. package/README.md +254 -0
  4. package/dist/cli.d.ts +6 -0
  5. package/dist/cli.js +176 -0
  6. package/dist/cli.js.map +1 -0
  7. package/dist/discovery/mcpClient.d.ts +53 -0
  8. package/dist/discovery/mcpClient.js +326 -0
  9. package/dist/discovery/mcpClient.js.map +1 -0
  10. package/dist/discovery/snapshotParser.d.ts +13 -0
  11. package/dist/discovery/snapshotParser.js +51 -0
  12. package/dist/discovery/snapshotParser.js.map +1 -0
  13. package/dist/emitters/facade.d.ts +52 -0
  14. package/dist/emitters/facade.js +125 -0
  15. package/dist/emitters/facade.js.map +1 -0
  16. package/dist/http/artifacts.d.ts +14 -0
  17. package/dist/http/artifacts.js +36 -0
  18. package/dist/http/artifacts.js.map +1 -0
  19. package/dist/http/jobs.d.ts +26 -0
  20. package/dist/http/jobs.js +59 -0
  21. package/dist/http/jobs.js.map +1 -0
  22. package/dist/http/routes.d.ts +11 -0
  23. package/dist/http/routes.js +267 -0
  24. package/dist/http/routes.js.map +1 -0
  25. package/dist/http/schemas.d.ts +167 -0
  26. package/dist/http/schemas.js +57 -0
  27. package/dist/http/schemas.js.map +1 -0
  28. package/dist/index.d.ts +49 -0
  29. package/dist/index.js +507 -0
  30. package/dist/index.js.map +1 -0
  31. package/dist/llm/governanceClient.d.ts +24 -0
  32. package/dist/llm/governanceClient.js +22 -0
  33. package/dist/llm/governanceClient.js.map +1 -0
  34. package/dist/llm/providers/anthropic.d.ts +8 -0
  35. package/dist/llm/providers/anthropic.js +12 -0
  36. package/dist/llm/providers/anthropic.js.map +1 -0
  37. package/dist/llm/providers/gemini.d.ts +5 -0
  38. package/dist/llm/providers/gemini.js +9 -0
  39. package/dist/llm/providers/gemini.js.map +1 -0
  40. package/dist/llm/providers/openai.d.ts +5 -0
  41. package/dist/llm/providers/openai.js +9 -0
  42. package/dist/llm/providers/openai.js.map +1 -0
  43. package/dist/parser/gherkinParser.d.ts +17 -0
  44. package/dist/parser/gherkinParser.js +143 -0
  45. package/dist/parser/gherkinParser.js.map +1 -0
  46. package/dist/repo/projectScaffolder.d.ts +24 -0
  47. package/dist/repo/projectScaffolder.js +64 -0
  48. package/dist/repo/projectScaffolder.js.map +1 -0
  49. package/dist/repo/repoScanner.d.ts +21 -0
  50. package/dist/repo/repoScanner.js +132 -0
  51. package/dist/repo/repoScanner.js.map +1 -0
  52. package/dist/reports/reviewReport.d.ts +19 -0
  53. package/dist/reports/reviewReport.js +96 -0
  54. package/dist/reports/reviewReport.js.map +1 -0
  55. package/dist/server.d.ts +10 -0
  56. package/dist/server.js +40 -0
  57. package/dist/server.js.map +1 -0
  58. package/dist/transformers/locatorPicker.d.ts +40 -0
  59. package/dist/transformers/locatorPicker.js +283 -0
  60. package/dist/transformers/locatorPicker.js.map +1 -0
  61. package/dist/transformers/pomResolver.d.ts +28 -0
  62. package/dist/transformers/pomResolver.js +35 -0
  63. package/dist/transformers/pomResolver.js.map +1 -0
  64. package/dist/transformers/stepMatcher.d.ts +36 -0
  65. package/dist/transformers/stepMatcher.js +461 -0
  66. package/dist/transformers/stepMatcher.js.map +1 -0
  67. package/dist/types.d.ts +166 -0
  68. package/dist/types.js +7 -0
  69. package/dist/types.js.map +1 -0
  70. package/dist/utils/logger.d.ts +6 -0
  71. package/dist/utils/logger.js +25 -0
  72. package/dist/utils/logger.js.map +1 -0
  73. package/dist/utils/naming.d.ts +23 -0
  74. package/dist/utils/naming.js +58 -0
  75. package/dist/utils/naming.js.map +1 -0
  76. package/dist/validate/tscRunner.d.ts +17 -0
  77. package/dist/validate/tscRunner.js +98 -0
  78. package/dist/validate/tscRunner.js.map +1 -0
  79. package/package.json +69 -0
  80. package/templates/gitignore.tmpl +10 -0
  81. package/templates/package.json.tmpl +16 -0
  82. package/templates/playwright.config.ts.tmpl +24 -0
  83. package/templates/tsconfig.json.tmpl +15 -0
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+ /**
3
+ * Structured logger. JSON to stdout. Pretty-print only when TTY + DEBUG set.
4
+ */
5
+ var __importDefault = (this && this.__importDefault) || function (mod) {
6
+ return (mod && mod.__esModule) ? mod : { "default": mod };
7
+ };
8
+ Object.defineProperty(exports, "__esModule", { value: true });
9
+ exports.logger = void 0;
10
+ const pino_1 = __importDefault(require("pino"));
11
+ const isTty = process.stdout.isTTY === true;
12
+ const debug = process.env.DEBUG === "1" || process.env.DEBUG === "true";
13
+ exports.logger = (0, pino_1.default)({
14
+ level: process.env.LOG_LEVEL ?? (debug ? "debug" : "info"),
15
+ base: { app: "bdd2pw" },
16
+ ...(isTty && debug
17
+ ? {
18
+ transport: {
19
+ target: "pino-pretty",
20
+ options: { colorize: true, translateTime: "HH:MM:ss.l" },
21
+ },
22
+ }
23
+ : {}),
24
+ });
25
+ //# sourceMappingURL=logger.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"logger.js","sourceRoot":"","sources":["../../src/utils/logger.ts"],"names":[],"mappings":";AAAA;;GAEG;;;;;;AAEH,gDAAwB;AAExB,MAAM,KAAK,GAAG,OAAO,CAAC,MAAM,CAAC,KAAK,KAAK,IAAI,CAAC;AAC5C,MAAM,KAAK,GAAG,OAAO,CAAC,GAAG,CAAC,KAAK,KAAK,GAAG,IAAI,OAAO,CAAC,GAAG,CAAC,KAAK,KAAK,MAAM,CAAC;AAE3D,QAAA,MAAM,GAAG,IAAA,cAAI,EAAC;IACzB,KAAK,EAAE,OAAO,CAAC,GAAG,CAAC,SAAS,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC;IAC1D,IAAI,EAAE,EAAE,GAAG,EAAE,QAAQ,EAAE;IACvB,GAAG,CAAC,KAAK,IAAI,KAAK;QAChB,CAAC,CAAC;YACE,SAAS,EAAE;gBACT,MAAM,EAAE,aAAa;gBACrB,OAAO,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,aAAa,EAAE,YAAY,EAAE;aACzD;SACF;QACH,CAAC,CAAC,EAAE,CAAC;CACR,CAAC,CAAC"}
@@ -0,0 +1,23 @@
1
+ /**
2
+ * Naming helpers. Pure functions, fully unit-tested — these stabilise the
3
+ * shape of emitted code and must not change behaviour without a snapshot
4
+ * test bump.
5
+ */
6
+ /** Convert any case to PascalCase. */
7
+ export declare function pascalCase(input: string): string;
8
+ /** Convert any case to camelCase. */
9
+ export declare function camelCase(input: string): string;
10
+ /** Convert any case to kebab-case. */
11
+ export declare function kebabCase(input: string): string;
12
+ /** Convert any case to snake_case. */
13
+ export declare function snakeCase(input: string): string;
14
+ /**
15
+ * Convert a Page Object class name to its expected file path stem.
16
+ * `LoginPage` → `login.page`
17
+ */
18
+ export declare function pageObjectFileStem(className: string): string;
19
+ /**
20
+ * Convert a feature name to a spec file stem.
21
+ * `User Login` → `user-login.spec`
22
+ */
23
+ export declare function specFileStem(featureName: string): string;
@@ -0,0 +1,58 @@
1
+ "use strict";
2
+ /**
3
+ * Naming helpers. Pure functions, fully unit-tested — these stabilise the
4
+ * shape of emitted code and must not change behaviour without a snapshot
5
+ * test bump.
6
+ */
7
+ Object.defineProperty(exports, "__esModule", { value: true });
8
+ exports.pascalCase = pascalCase;
9
+ exports.camelCase = camelCase;
10
+ exports.kebabCase = kebabCase;
11
+ exports.snakeCase = snakeCase;
12
+ exports.pageObjectFileStem = pageObjectFileStem;
13
+ exports.specFileStem = specFileStem;
14
+ /** Convert any case to PascalCase. */
15
+ function pascalCase(input) {
16
+ return splitWords(input)
17
+ .map((w) => w.charAt(0).toUpperCase() + w.slice(1).toLowerCase())
18
+ .join("");
19
+ }
20
+ /** Convert any case to camelCase. */
21
+ function camelCase(input) {
22
+ const pascal = pascalCase(input);
23
+ return pascal.charAt(0).toLowerCase() + pascal.slice(1);
24
+ }
25
+ /** Convert any case to kebab-case. */
26
+ function kebabCase(input) {
27
+ return splitWords(input).map((w) => w.toLowerCase()).join("-");
28
+ }
29
+ /** Convert any case to snake_case. */
30
+ function snakeCase(input) {
31
+ return splitWords(input).map((w) => w.toLowerCase()).join("_");
32
+ }
33
+ /**
34
+ * Convert a Page Object class name to its expected file path stem.
35
+ * `LoginPage` → `login.page`
36
+ */
37
+ function pageObjectFileStem(className) {
38
+ const stripped = className.replace(/Page$/i, "");
39
+ return `${kebabCase(stripped)}.page`;
40
+ }
41
+ /**
42
+ * Convert a feature name to a spec file stem.
43
+ * `User Login` → `user-login.spec`
44
+ */
45
+ function specFileStem(featureName) {
46
+ return `${kebabCase(featureName)}.spec`;
47
+ }
48
+ /** Split an arbitrary string into word tokens for case conversion. */
49
+ function splitWords(input) {
50
+ return input
51
+ .replace(/[_\-\s]+/g, " ")
52
+ .replace(/([a-z])([A-Z])/g, "$1 $2")
53
+ .replace(/([A-Z]+)([A-Z][a-z])/g, "$1 $2")
54
+ .trim()
55
+ .split(/\s+/)
56
+ .filter(Boolean);
57
+ }
58
+ //# sourceMappingURL=naming.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"naming.js","sourceRoot":"","sources":["../../src/utils/naming.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;AAGH,gCAIC;AAGD,8BAGC;AAGD,8BAEC;AAGD,8BAEC;AAMD,gDAGC;AAMD,oCAEC;AAtCD,sCAAsC;AACtC,SAAgB,UAAU,CAAC,KAAa;IACtC,OAAO,UAAU,CAAC,KAAK,CAAC;SACrB,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC;SAChE,IAAI,CAAC,EAAE,CAAC,CAAC;AACd,CAAC;AAED,qCAAqC;AACrC,SAAgB,SAAS,CAAC,KAAa;IACrC,MAAM,MAAM,GAAG,UAAU,CAAC,K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ReviewItem`s. Uses the user's local `typescript` if present (in
4
+ * `<repo>/node_modules/.bin/tsc`), else falls back to PATH.
5
+ *
6
+ * The output format is the standard TS one:
7
+ * pages/login.page.ts(12,3): error TS2304: Cannot find name 'Locator'.
8
+ *
9
+ * Each diagnostic becomes one `ReviewItem` with severity 'error'. Warnings
10
+ * (`error TS6133`-style "unused variable") are downgraded to severity 'warn'.
11
+ */
12
+ import type { ReviewItem } from "../types";
13
+ export interface TscResult {
14
+ errorCount: number;
15
+ items: ReviewItem[];
16
+ }
17
+ export declare function tscValidate(repoRoot: string): Promise<TscResult>;
@@ -0,0 +1,98 @@
1
+ "use strict";
2
+ /**
3
+ * Run `tsc --noEmit` against the emitted repo and parse diagnostics into
4
+ * `ReviewItem`s. Uses the user's local `typescript` if present (in
5
+ * `<repo>/node_modules/.bin/tsc`), else falls back to PATH.
6
+ *
7
+ * The output format is the standard TS one:
8
+ * pages/login.page.ts(12,3): error TS2304: Cannot find name 'Locator'.
9
+ *
10
+ * Each diagnostic becomes one `ReviewItem` with severity 'error'. Warnings
11
+ * (`error TS6133`-style "unused variable") are downgraded to severity 'warn'.
12
+ */
13
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
14
+ if (k2 === undefined) k2 = k;
15
+ var desc = Object.getOwnPropertyDescriptor(m, k);
16
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
17
+ desc = { enumerable: true, get: function() { return m[k]; } };
18
+ }
19
+ Object.defineProperty(o, k2, desc);
20
+ }) : (function(o, m, k, k2) {
21
+ if (k2 === undefined) k2 = k;
22
+ o[k2] = m[k];
23
+ }));
24
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
25
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
26
+ }) : function(o, v) {
27
+ o["default"] = v;
28
+ });
29
+ var __importStar = (this && this.__importStar) || (function () {
30
+ var ownKeys = function(o) {
31
+ ownKeys = Object.getOwnPropertyNames || function (o) {
32
+ var ar = [];
33
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
34
+ return ar;
35
+ };
36
+ return ownKeys(o);
37
+ };
38
+ return function (mod) {
39
+ if (mod && mod.__esModule) return mod;
40
+ var result = {};
41
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
42
+ __setModuleDefault(result, mod);
43
+ return result;
44
+ };
45
+ })();
46
+ Object.defineProperty(exports, "__esModule", { value: true });
47
+ exports.tscValidate = tscValidate;
48
+ const child_process_1 = require("child_process");
49
+ const path = __importStar(require("path"));
50
+ const fs = __importStar(require("fs-extra"));
51
+ async function tscValidate(repoRoot) {
52
+ const localTsc = path.join(repoRoot, "node_modules", ".bin", process.platform === "win32" ? "tsc.cmd" : "tsc");
53
+ const cmd = (await fs.pathExists(localTsc)) ? localTsc : "tsc";
54
+ return new Promise((resolve) => {
55
+ const proc = (0, child_process_1.spawn)(cmd, ["--noEmit", "--pretty", "false"], {
56
+ cwd: repoRoot,
57
+ shell: process.platform === "win32",
58
+ });
59
+ let stdout = "";
60
+ let stderr = "";
61
+ proc.stdout.on("data", (d) => (stdout += d.toString()));
62
+ proc.stderr.on("data", (d) => (stderr += d.toString()));
63
+ proc.on("error", (err) => {
64
+ resolve({
65
+ errorCount: 0,
66
+ items: [
67
+ {
68
+ severity: "warn",
69
+ message: `Could not invoke tsc (${err.message}). Skipping validation.`,
70
+ },
71
+ ],
72
+ });
73
+ });
74
+ proc.on("close", () => {
75
+ const items = parseTscOutput(stdout + "\n" + stderr);
76
+ const errorCount = items.filter((i) => i.severity === "error").length;
77
+ resolve({ errorCount, items });
78
+ });
79
+ });
80
+ }
81
+ function parseTscOutput(output) {
82
+ const items = [];
83
+ const lineRe = /^(.+?)\((\d+),\d+\):\s+(error|warning)\s+TS(\d+):\s+(.+)$/;
84
+ for (const line of output.split(/\r?\n/)) {
85
+ const m = line.match(lineRe);
86
+ if (!m)
87
+ continue;
88
+ const [, file, lineNum, sev, _code, message] = m;
89
+ items.push({
90
+ severity: sev === "warning" ? "warn" : "error",
91
+ file,
92
+ line: Number(lineNum),
93
+ message,
94
+ });
95
+ }
96
+ return items;
97
+ }
98
+ //# sourceMappingURL=tscRunner.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tscRunner.js","sourceRoot":"","sources":["../../src/validate/tscRunner.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;GAUG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAYH,kCAmCC;AA7CD,iDAAsC;AACtC,2CAA6B;AAC7B,6CAA+B;AAQxB,KAAK,UAAU,WAAW,CAAC,QAAgB;IAChD,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,CACxB,QAAQ,EACR,cAAc,EACd,MAAM,EACN,OAAO,CAAC,QAAQ,KAAK,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,KAAK,CACjD,CAAC;IACF,MAAM,GAAG,GAAG,CAAC,MAAM,EAAE,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC;IAE/D,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE;QAC7B,MAAM,IAAI,GAAG,IAAA,qBAAK,EAAC,GAAG,EAAE,CAAC,UAAU,EAAE,UAAU,EAAE,OAAO,CAAC,EAAE;YACzD,GAAG,EAAE,QAAQ;YACb,KAAK,EAAE,OAAO,CAAC,QAAQ,KAAK,OAAO;SACpC,CAAC,CAAC;QACH,IAAI,MAAM,GAAG,EAAE,CAAC;QAChB,IAAI,MAAM,GAAG,EAAE,CAAC;QAChB,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,MAAM,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,MAAM,IAAI,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC;QACxD,IAAI,CAAC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,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO;YAC9C,IAAI;YACJ,IAAI,EAAE,MAAM,CAAC,OAAO,CAAC;YACrB,OAAO;SACR,CAAC,CAAC;IACL,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC"}
package/package.json ADDED
@@ -0,0 +1,69 @@
1
+ {
2
+ "name": "@vijaypjavvadi/bdd2pw",
3
+ "version": "1.0.0",
4
+ "description": "Scaffold runnable Playwright TypeScript tests from Gherkin .feature files. Detects existing Page Objects, scans live pages via Microsoft Playwright MCP, emits POMs + specs, ready for execution. CLI + HTTP service. Optional governed LLM fallback (Anthropic / OpenAI / Gemini).",
5
+ "bin": { "bdd2pw": "dist/cli.js" },
6
+ "main": "dist/index.js",
7
+ "types": "dist/index.d.ts",
8
+ "files": ["dist", "templates", "README.md", "CHANGELOG.md", "LICENSE"],
9
+ "repository": { "type": "git", "url": "git+https://github.com/javvadivijayprasad/bdd2pw.git" },
10
+ "homepage": "https://github.com/javvadivijayprasad/bdd2pw#readme",
11
+ "bugs": { "url": "https://github.com/javvadivijayprasad/bdd2pw/issues" },
12
+ "publishConfig": { "access": "public" },
13
+ "scripts": {
14
+ "build": "tsc",
15
+ "start": "node dist/cli.js",
16
+ "serve": "node dist/server.js",
17
+ "dev": "ts-node src/cli.ts",
18
+ "dev:serve": "ts-node src/server.ts",
19
+ "test": "vitest run",
20
+ "test:watch": "vitest",
21
+ "test:cov": "vitest run --coverage",
22
+ "test:update": "vitest run -u",
23
+ "verify": "tsc && node scripts/verify.js",
24
+ "prepublishOnly": "npm run build && npm test",
25
+ "lint": "eslint . --ext .ts && tsc --noEmit",
26
+ "format": "prettier --write \"src/**/*.ts\" \"tests/**/*.ts\""
27
+ },
28
+ "keywords": ["playwright", "bdd", "gherkin", "cucumber", "page-object", "test-automation", "scaffold", "mcp"],
29
+ "author": { "name": "Vijay Prasad", "email": "jvijayprasad@gmail.com", "url": "https://github.com/javvadivijayprasad" },
30
+ "license": "MIT",
31
+ "dependencies": {
32
+ "@cucumber/gherkin": "^28.0.0",
33
+ "@cucumber/messages": "^24.1.0",
34
+ "@vijaypjavvadi/pw-emit": "^1.0.0",
35
+ "archiver": "^7.0.1",
36
+ "chalk": "^4.1.2",
37
+ "commander": "^12.1.0",
38
+ "express": "^4.19.2",
39
+ "fs-extra": "^11.2.0",
40
+ "pino": "^9.0.0",
41
+ "ts-morph": "^22.0.0",
42
+ "ulid": "^2.3.0",
43
+ "undici": "^6.19.0",
44
+ "zod": "^3.23.8"
45
+ },
46
+ "peerDependencies": { "@playwright/test": ">=1.40.0" },
47
+ "peerDependenciesMeta": { "@playwright/test": { "optional": true } },
48
+ "optionalDependencies": {
49
+ "@anthropic-ai/sdk": "^0.91.1",
50
+ "better-sqlite3": "^11.0.0",
51
+ "pino-pretty": "^11.0.0",
52
+ "playwright": "^1.45.0"
53
+ },
54
+ "devDependencies": {
55
+ "@types/archiver": "^6.0.2",
56
+ "@types/express": "^4.17.21",
57
+ "@types/fs-extra": "^11.0.4",
58
+ "@types/node": "^20.12.0",
59
+ "@typescript-eslint/eslint-plugin": "^8.18.0",
60
+ "@typescript-eslint/parser": "^8.18.0",
61
+ "@vitest/coverage-v8": "^1.6.0",
62
+ "eslint": "^8.57.0",
63
+ "prettier": "^3.2.5",
64
+ "ts-node": "^10.9.2",
65
+ "typescript": "^5.4.5",
66
+ "vitest": "^1.6.0"
67
+ },
68
+ "engines": { "node": ">=18" }
69
+ }
@@ -0,0 +1,10 @@
1
+ node_modules/
2
+ test-results/
3
+ playwright-report/
4
+ playwright/.cache/
5
+ .env
6
+ .env.local
7
+ *.log
8
+ .DS_Store
9
+ .idea/
10
+ .vscode/
@@ -0,0 +1,16 @@
1
+ {
2
+ "name": "{{projectName}}",
3
+ "version": "0.1.0",
4
+ "private": true,
5
+ "scripts": {
6
+ "test": "playwright test",
7
+ "test:headed": "playwright test --headed",
8
+ "test:debug": "playwright test --debug",
9
+ "report": "playwright show-report"
10
+ },
11
+ "devDependencies": {
12
+ "@playwright/test": "^1.45.0",
13
+ "@types/node": "^20.0.0",
14
+ "typescript": "^5.4.5"
15
+ }
16
+ }
@@ -0,0 +1,24 @@
1
+ import { defineConfig, devices } from "@playwright/test";
2
+
3
+ /**
4
+ * Generated by @vijaypjavvadi/bdd2pw.
5
+ * https://playwright.dev/docs/test-configuration
6
+ */
7
+ export default defineConfig({
8
+ testDir: "./tests",
9
+ fullyParallel: true,
10
+ forbidOnly: !!process.env.CI,
11
+ retries: process.env.CI ? 2 : 0,
12
+ workers: process.env.CI ? 1 : undefined,
13
+ reporter: [["html", { open: "never" }], ["list"]],
14
+ use: {
15
+ baseURL: process.env.BASE_URL ?? "{{baseUrl}}",
16
+ trace: "on-first-retry",
17
+ screenshot: "only-on-failure",
18
+ },
19
+ projects: [
20
+ { name: "chromium", use: { ...devices["Desktop Chrome"] } },
21
+ { name: "firefox", use: { ...devices["Desktop Firefox"] } },
22
+ { name: "webkit", use: { ...devices["Desktop Safari"] } },
23
+ ],
24
+ });
@@ -0,0 +1,15 @@
1
+ {
2
+ "compilerOptions": {
3
+ "target": "ES2022",
4
+ "module": "commonjs",
5
+ "lib": ["ES2022", "DOM"],
6
+ "strict": true,
7
+ "esModuleInterop": true,
8
+ "forceConsistentCasingInFileNames": true,
9
+ "skipLibCheck": true,
10
+ "resolveJsonModule": true,
11
+ "moduleResolution": "node"
12
+ },
13
+ "include": ["pages/**/*.ts", "tests/**/*.ts", "fixtures/**/*.ts"],
14
+ "exclude": ["node_modules"]
15
+ }