@vijaypjavvadi/bdd2pw 4.6.6 → 4.7.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.
- package/CHANGELOG.md +148 -0
- package/README.md +18 -18
- package/dist/cli.js +5 -0
- package/dist/cli.js.map +1 -1
- package/dist/discovery/mcpClient.js +1 -1
- package/dist/discovery/mcpClient.js.map +1 -1
- package/dist/emitters/pomwrightEmitter.d.ts +151 -0
- package/dist/emitters/pomwrightEmitter.js +445 -0
- package/dist/emitters/pomwrightEmitter.js.map +1 -0
- package/dist/index.js +141 -26
- package/dist/index.js.map +1 -1
- package/dist/llm/anthropicClient.js.map +1 -1
- package/dist/llm/openaiClient.js +1 -1
- package/dist/llm/openaiClient.js.map +1 -1
- package/dist/repo/pomwrightScanner.d.ts +40 -0
- package/dist/repo/pomwrightScanner.js +129 -0
- package/dist/repo/pomwrightScanner.js.map +1 -0
- package/dist/repo/projectScaffolder.d.ts +6 -0
- package/dist/repo/projectScaffolder.js +27 -0
- package/dist/repo/projectScaffolder.js.map +1 -1
- package/dist/reports/specMerge.js +1 -1
- package/dist/reports/specMerge.js.map +1 -1
- package/dist/transformers/hierarchyInferrer.d.ts +57 -0
- package/dist/transformers/hierarchyInferrer.js +192 -0
- package/dist/transformers/hierarchyInferrer.js.map +1 -0
- package/dist/transformers/stepMatcher.js +20 -0
- package/dist/transformers/stepMatcher.js.map +1 -1
- package/dist/types.d.ts +28 -0
- package/package.json +13 -6
|
@@ -0,0 +1,445 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* v4.7.0 — POMWright target emitter (PoC per POMWright#63 design
|
|
4
|
+
* discussion with DyHex).
|
|
5
|
+
*
|
|
6
|
+
* Classic emission (the existing `pw-emit` path) produces a Page Object
|
|
7
|
+
* class with `readonly fieldName = page.getBy...` class fields. POMWright
|
|
8
|
+
* is structurally different:
|
|
9
|
+
*
|
|
10
|
+
* • Class extends `PageObject<Paths>`, where `Paths` is a TypeScript
|
|
11
|
+
* union of all registered dotted paths.
|
|
12
|
+
* • Locators are registered inside `defineLocators()` via
|
|
13
|
+
* `this.add(path).method(...)`, not as class fields.
|
|
14
|
+
* • The constructor calls `super(page, baseUrl, path)` so navigation
|
|
15
|
+
* is baked in.
|
|
16
|
+
* • Tests use POMWright's `test` fixture (extended from
|
|
17
|
+
* `@playwright/test`) and reach locators via `pom.getNestedLocator(path)`.
|
|
18
|
+
*
|
|
19
|
+
* This file produces the POMWright-shape POM + spec. The hierarchy
|
|
20
|
+
* inferrer (`src/transformers/hierarchyInferrer.ts`) walks each
|
|
21
|
+
* `LocatorChoice` and returns the dotted path; when no stable ancestor
|
|
22
|
+
* is found, the leaf is emitted flat with a `// TODO:` review marker
|
|
23
|
+
* (the explicit fallback DyHex asked for).
|
|
24
|
+
*
|
|
25
|
+
* Scope caveats (per the DyHex reply):
|
|
26
|
+
* - New-POM only. Existing POMWright POM update/augment is deferred.
|
|
27
|
+
* - Reusable locator segments (POMWright's full strength) are
|
|
28
|
+
* emitted as the straight dotted path a first implementation can
|
|
29
|
+
* produce; shared-segment deduplication across pages is a later
|
|
30
|
+
* feature.
|
|
31
|
+
* - `@step()` decoration on methods is not added yet (POMWright
|
|
32
|
+
* docs call it out as "any async method") — the PoC emits plain
|
|
33
|
+
* spec bodies without decorators to keep the scope honest.
|
|
34
|
+
*/
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.emitPomwrightPom = emitPomwrightPom;
|
|
37
|
+
exports.emitPomwrightSpec = emitPomwrightSpec;
|
|
38
|
+
const hierarchyInferrer_1 = require("../transformers/hierarchyInferrer");
|
|
39
|
+
/**
|
|
40
|
+
* Render a POMWright-shape Page Object (pom module) from the IR.
|
|
41
|
+
*/
|
|
42
|
+
function emitPomwrightPom(input) {
|
|
43
|
+
const { pom, baseUrl, urlPath } = input;
|
|
44
|
+
const warnings = [];
|
|
45
|
+
const pathByFieldName = new Map();
|
|
46
|
+
// 1. Walk every LocatorChoice, infer its hierarchical path.
|
|
47
|
+
// Collect warnings for flat-fallback cases.
|
|
48
|
+
const inferred = pom.fields.map((choice) => ({ choice, inf: (0, hierarchyInferrer_1.inferPomwrightPath)(choice) }));
|
|
49
|
+
// 2. Build the Paths union — deduplicated set of EVERY intermediate
|
|
50
|
+
// segment in the chain. POMWright requires parents registered too
|
|
51
|
+
// when `getNestedLocator()` is called, because the chain is built
|
|
52
|
+
// bottom-up from the registered segments.
|
|
53
|
+
const allPaths = new Set();
|
|
54
|
+
for (const { inf } of inferred) {
|
|
55
|
+
// Walk prefixes of the dotted path so parents are present.
|
|
56
|
+
for (let i = 1; i <= inf.segments.length; i++) {
|
|
57
|
+
allPaths.add(inf.segments.slice(0, i).join("."));
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
// v4.7.0 PoC gap #1 — fold in every existing registration's path so
|
|
61
|
+
// AUGMENT's union includes paths the user already wrote.
|
|
62
|
+
if (input.existingRegistrations) {
|
|
63
|
+
for (const p of input.existingRegistrations.keys()) {
|
|
64
|
+
allPaths.add(p);
|
|
65
|
+
// Register parent prefixes too, in case the user wrote just a
|
|
66
|
+
// leaf without the chain (unusual but legal).
|
|
67
|
+
const segs = p.split(".");
|
|
68
|
+
for (let i = 1; i <= segs.length; i++) {
|
|
69
|
+
allPaths.add(segs.slice(0, i).join("."));
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
const pathsSorted = [...allPaths].sort();
|
|
74
|
+
// 3. Populate pathByFieldName for the spec emitter.
|
|
75
|
+
for (const { choice, inf } of inferred) {
|
|
76
|
+
pathByFieldName.set(choice.fieldName, inf.path);
|
|
77
|
+
if (inf.reviewNeeded) {
|
|
78
|
+
warnings.push({
|
|
79
|
+
severity: "warn",
|
|
80
|
+
message: `POMWright hierarchy fell back to flat for "${choice.fieldName}" — ` +
|
|
81
|
+
`no stable ancestor (main/form/nav/section-with-name) was found in the scanned xpath/CSS. ` +
|
|
82
|
+
`Consider adding an id, aria-label or role to the container, or editing the registered ` +
|
|
83
|
+
`path in the generated POM by hand.`,
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
// 4. Emit the class body.
|
|
88
|
+
const lines = [];
|
|
89
|
+
lines.push(`import { type Page } from "@playwright/test";`);
|
|
90
|
+
const hasNewMethods = typeof input.methodsAppend === "string" && input.methodsAppend.length > 0;
|
|
91
|
+
const hasExistingMethods = Array.isArray(input.existingMethods) && input.existingMethods.length > 0;
|
|
92
|
+
const needsStepImport = hasNewMethods || hasExistingMethods;
|
|
93
|
+
if (needsStepImport) {
|
|
94
|
+
lines.push(`import { PageObject, step } from "pomwright";`);
|
|
95
|
+
}
|
|
96
|
+
else {
|
|
97
|
+
lines.push(`import { PageObject } from "pomwright";`);
|
|
98
|
+
}
|
|
99
|
+
lines.push(``);
|
|
100
|
+
lines.push(`type Paths =`);
|
|
101
|
+
for (let i = 0; i < pathsSorted.length; i++) {
|
|
102
|
+
const sep = i === pathsSorted.length - 1 ? ";" : "";
|
|
103
|
+
lines.push(` | ${JSON.stringify(pathsSorted[i])}${sep}`);
|
|
104
|
+
}
|
|
105
|
+
lines.push(``);
|
|
106
|
+
lines.push(`export class ${pom.className} extends PageObject<Paths> {`);
|
|
107
|
+
lines.push(` constructor(page: Page) {`);
|
|
108
|
+
lines.push(` super(page, ${JSON.stringify(baseUrl)}, ${JSON.stringify(urlPath)});`);
|
|
109
|
+
lines.push(` }`);
|
|
110
|
+
lines.push(``);
|
|
111
|
+
lines.push(` protected defineLocators(): void {`);
|
|
112
|
+
// Emit INTERMEDIATE ancestor segments first (so the chain parents
|
|
113
|
+
// resolve). Each segment becomes a single registration; POMWright
|
|
114
|
+
// chains them together on `getNestedLocator`.
|
|
115
|
+
// Strategy: for each unique path, register the leaf step only once.
|
|
116
|
+
// The segment's Playwright call: for a leaf locator we have the
|
|
117
|
+
// original `choice.api(args)`; for ancestor segments we synthesise
|
|
118
|
+
// `getByRole(tag, { name })` or `locator(tag)` as best effort.
|
|
119
|
+
const emitted = new Set();
|
|
120
|
+
// Register ancestors in order of depth so the output reads root-first.
|
|
121
|
+
for (const path of pathsSorted) {
|
|
122
|
+
if (emitted.has(path))
|
|
123
|
+
continue;
|
|
124
|
+
emitted.add(path);
|
|
125
|
+
// v4.7.0 PoC gap #1 — existing registration wins over a fresh pick
|
|
126
|
+
// for the same path (classic AUGMENT: human-curated tuning stays).
|
|
127
|
+
const existingReg = input.existingRegistrations?.get(path);
|
|
128
|
+
if (existingReg) {
|
|
129
|
+
lines.push(` this.add(${JSON.stringify(path)}).${existingReg};`);
|
|
130
|
+
continue;
|
|
131
|
+
}
|
|
132
|
+
// Does a leaf LocatorChoice correspond exactly to this path?
|
|
133
|
+
const leafMatch = inferred.find((x) => x.inf.path === path);
|
|
134
|
+
if (leafMatch) {
|
|
135
|
+
const { api, args } = leafMatch.choice;
|
|
136
|
+
lines.push(` this.add(${JSON.stringify(path)}).${api}(${args});`);
|
|
137
|
+
continue;
|
|
138
|
+
}
|
|
139
|
+
// Ancestor-only segment — synthesise from the last `<tag>@<name>` piece.
|
|
140
|
+
const lastSegment = path.split(".").pop() ?? path;
|
|
141
|
+
const [tag, name] = lastSegment.split("@");
|
|
142
|
+
if (name) {
|
|
143
|
+
// Prefer getByRole when the tag corresponds to an ARIA landmark role.
|
|
144
|
+
const landmarkRole = ARIA_LANDMARK_ROLE[tag];
|
|
145
|
+
if (landmarkRole) {
|
|
146
|
+
lines.push(` this.add(${JSON.stringify(path)}).getByRole(${JSON.stringify(landmarkRole)}, { name: ${JSON.stringify(deCamel(name))} });`);
|
|
147
|
+
}
|
|
148
|
+
else {
|
|
149
|
+
// Fall back to CSS selector on the tag + name as id/aria-label (best effort).
|
|
150
|
+
lines.push(` this.add(${JSON.stringify(path)}).locator(${JSON.stringify(`${tag}[id="${name}"], ${tag}[aria-label="${deCamel(name)}"], ${tag}[name="${name}"]`)});`);
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
else {
|
|
154
|
+
// Bare landmark (`main`, `nav`, `header`, `footer`, `aside`).
|
|
155
|
+
const landmarkRole = ARIA_LANDMARK_ROLE[tag];
|
|
156
|
+
if (landmarkRole) {
|
|
157
|
+
lines.push(` this.add(${JSON.stringify(path)}).getByRole(${JSON.stringify(landmarkRole)});`);
|
|
158
|
+
}
|
|
159
|
+
else {
|
|
160
|
+
lines.push(` this.add(${JSON.stringify(path)}).locator(${JSON.stringify(tag)});`);
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
lines.push(` }`);
|
|
165
|
+
if (hasNewMethods) {
|
|
166
|
+
lines.push(``);
|
|
167
|
+
lines.push(input.methodsAppend);
|
|
168
|
+
}
|
|
169
|
+
// v4.7.0 PoC gap #1 — preserve every @step() method the scanner
|
|
170
|
+
// extracted from the existing file, verbatim, AFTER any freshly
|
|
171
|
+
// synthesised methods. Deduplicates by name: a new methodsAppend
|
|
172
|
+
// entry with the same name as an existing method WINS (freshly
|
|
173
|
+
// regenerated bodies reflect the current scenarios).
|
|
174
|
+
if (hasExistingMethods) {
|
|
175
|
+
const newMethodNames = new Set();
|
|
176
|
+
if (input.methodsAppend) {
|
|
177
|
+
for (const m of input.methodsAppend.matchAll(/async\s+([A-Za-z_$][\w$]*)\s*\(/g)) {
|
|
178
|
+
newMethodNames.add(m[1]);
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
for (const em of input.existingMethods) {
|
|
182
|
+
if (newMethodNames.has(em.name))
|
|
183
|
+
continue;
|
|
184
|
+
lines.push(``);
|
|
185
|
+
lines.push(` @step()`);
|
|
186
|
+
lines.push(` async ${em.name}(): Promise<void> {`);
|
|
187
|
+
for (const bl of em.body.split("\n")) {
|
|
188
|
+
lines.push(` ${bl}`);
|
|
189
|
+
}
|
|
190
|
+
lines.push(` }`);
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
lines.push(`}`);
|
|
194
|
+
lines.push(``);
|
|
195
|
+
return {
|
|
196
|
+
contents: lines.join("\n"),
|
|
197
|
+
pathByFieldName,
|
|
198
|
+
warnings,
|
|
199
|
+
};
|
|
200
|
+
}
|
|
201
|
+
const ARIA_LANDMARK_ROLE = {
|
|
202
|
+
main: "main",
|
|
203
|
+
nav: "navigation",
|
|
204
|
+
header: "banner",
|
|
205
|
+
footer: "contentinfo",
|
|
206
|
+
aside: "complementary",
|
|
207
|
+
section: "region",
|
|
208
|
+
form: "form",
|
|
209
|
+
dialog: "dialog",
|
|
210
|
+
table: "table",
|
|
211
|
+
fieldset: "group",
|
|
212
|
+
};
|
|
213
|
+
/**
|
|
214
|
+
* `userName` → `User Name`, `login` → `Login`. Used to turn a camelCase
|
|
215
|
+
* path-segment name back into something that matches the element's
|
|
216
|
+
* accessible name on the page (best effort).
|
|
217
|
+
*/
|
|
218
|
+
function deCamel(s) {
|
|
219
|
+
return s.replace(/([a-z])([A-Z])/g, "$1 $2").replace(/^./, (c) => c.toUpperCase());
|
|
220
|
+
}
|
|
221
|
+
function emitPomwrightSpec(input) {
|
|
222
|
+
const warnings = [];
|
|
223
|
+
const { describeName, pomClassName, pomVar, pomImportPath, scenarios, pathByFieldName, } = input;
|
|
224
|
+
// Translate a `<pomVar>.<field>` reference into a
|
|
225
|
+
// `<pomVar>.getNestedLocator("<path>")` reference.
|
|
226
|
+
// Leaves `<pomVar>.page` (the base Page escape hatch) alone.
|
|
227
|
+
const translate = (expr) => {
|
|
228
|
+
// Simple regex rewrite — the PoC. Doesn't handle every TS syntax, but
|
|
229
|
+
// the binding emitter output is predictable enough that this works
|
|
230
|
+
// for the common rule-emitted shapes.
|
|
231
|
+
const escapedVar = pomVar.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
232
|
+
const re = new RegExp(`\\b${escapedVar}\\.([A-Za-z_$][\\w$]*)`, "g");
|
|
233
|
+
return expr.replace(re, (_m, field) => {
|
|
234
|
+
// Known POMWright base-class members — leave untouched.
|
|
235
|
+
if (field === "page" ||
|
|
236
|
+
field === "getNestedLocator" ||
|
|
237
|
+
field === "getLocatorSchema" ||
|
|
238
|
+
field === "navigation" ||
|
|
239
|
+
field === "sessionStorage") {
|
|
240
|
+
return _m;
|
|
241
|
+
}
|
|
242
|
+
// POMWright replaces the synthesised `goto()` with its own
|
|
243
|
+
// `navigation.goto()` helper that reads the baseUrl + path given
|
|
244
|
+
// to `super(...)` in the constructor.
|
|
245
|
+
if (field === "goto")
|
|
246
|
+
return `${pomVar}.navigation.goto`;
|
|
247
|
+
const p = pathByFieldName.get(field);
|
|
248
|
+
if (!p) {
|
|
249
|
+
warnings.push({
|
|
250
|
+
severity: "warn",
|
|
251
|
+
message: `POMWright translation: no path for field "${field}" — left as-is, test may not compile.`,
|
|
252
|
+
});
|
|
253
|
+
return _m;
|
|
254
|
+
}
|
|
255
|
+
return `${pomVar}.getNestedLocator(${JSON.stringify(p)})`;
|
|
256
|
+
});
|
|
257
|
+
};
|
|
258
|
+
// v4.7.0 — match the classic emitter's v4.6.4 default (skip).
|
|
259
|
+
const todoMode = input.todoStepHandling ?? "skip";
|
|
260
|
+
const renderBinding = (b) => {
|
|
261
|
+
const label = ((b.step.keyword ?? "").trim() +
|
|
262
|
+
" " +
|
|
263
|
+
(b.step.text ?? "").trim()).trim();
|
|
264
|
+
const labelLit = JSON.stringify(label || "(empty step)");
|
|
265
|
+
const body = [];
|
|
266
|
+
if (b.customBody) {
|
|
267
|
+
body.push(...translate(b.customBody).split("\n"));
|
|
268
|
+
}
|
|
269
|
+
else if (b.pomCall) {
|
|
270
|
+
const args = b.pomCall.args.join(", ");
|
|
271
|
+
body.push(translate(`await ${b.pomCall.page}.${b.pomCall.method}(${args});`));
|
|
272
|
+
}
|
|
273
|
+
else if (b.assertion) {
|
|
274
|
+
const locator = translate(b.assertion.locator);
|
|
275
|
+
const expected = b.assertion.expected !== undefined ? b.assertion.expected : "";
|
|
276
|
+
body.push(`await expect(${locator}).${b.assertion.matcher}(${expected});`);
|
|
277
|
+
}
|
|
278
|
+
else {
|
|
279
|
+
// v4.7.0 — attestqa-handoff defence parity with the classic path.
|
|
280
|
+
// "throw" raises an error so the test fails at the unbound step;
|
|
281
|
+
// "skip" / "none" leave a TODO comment (skip short-circuits via
|
|
282
|
+
// the test.fixme at the top of the test; none accepts silent pass).
|
|
283
|
+
const safeWarning = (b.warning ?? "no rule matched this step").replace(/\r?\n/g, " ");
|
|
284
|
+
if (todoMode === "throw") {
|
|
285
|
+
body.push(`throw new Error(${JSON.stringify(`TODO (bdd2pw): step not implemented — ${safeWarning}`)});`);
|
|
286
|
+
}
|
|
287
|
+
else {
|
|
288
|
+
body.push(`// TODO: ${safeWarning}`);
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
return (` await test.step(${labelLit}, async () => {\n` +
|
|
292
|
+
body.map((l) => ` ${l}`).join("\n") +
|
|
293
|
+
`\n });`);
|
|
294
|
+
};
|
|
295
|
+
// v4.7.0 PoC gap #2a. When stepMethods is on, each scenario's
|
|
296
|
+
// binding body becomes a method on the POM, decorated with @step()
|
|
297
|
+
// from POMWright. The test then calls that method instead of
|
|
298
|
+
// inlining `test.step(...)` per Gherkin step.
|
|
299
|
+
const stepMethods = input.stepMethods === true;
|
|
300
|
+
const pomMethodChunks = [];
|
|
301
|
+
const methodNameFor = (scenarioName) => {
|
|
302
|
+
const safe = scenarioName
|
|
303
|
+
.replace(/[^a-zA-Z0-9]+/g, " ")
|
|
304
|
+
.trim()
|
|
305
|
+
.split(/\s+/)
|
|
306
|
+
.map((w, i) => i === 0 ? w.toLowerCase() : w.charAt(0).toUpperCase() + w.slice(1).toLowerCase())
|
|
307
|
+
.join("");
|
|
308
|
+
return `scenario${safe.charAt(0).toUpperCase()}${safe.slice(1)}` || "scenario";
|
|
309
|
+
};
|
|
310
|
+
const lines = [];
|
|
311
|
+
lines.push(`import { expect } from "@playwright/test";`);
|
|
312
|
+
lines.push(`import { test as base } from "pomwright";`);
|
|
313
|
+
lines.push(`import { ${pomClassName} } from "${pomImportPath}";`);
|
|
314
|
+
lines.push(``);
|
|
315
|
+
lines.push(`const test = base.extend<{ ${pomVar}: ${pomClassName} }>({`);
|
|
316
|
+
lines.push(` ${pomVar}: async ({ page }, use) => {`);
|
|
317
|
+
lines.push(` await use(new ${pomClassName}(page));`);
|
|
318
|
+
lines.push(` },`);
|
|
319
|
+
lines.push(`});`);
|
|
320
|
+
lines.push(``);
|
|
321
|
+
lines.push(`test.describe(${JSON.stringify(describeName)}, () => {`);
|
|
322
|
+
if (input.beforeEach && input.beforeEach.length) {
|
|
323
|
+
lines.push(` test.beforeEach(async ({ ${pomVar} }) => {`);
|
|
324
|
+
for (const b of input.beforeEach) {
|
|
325
|
+
lines.push(renderBinding(b).replace(/^ {2}/gm, " "));
|
|
326
|
+
}
|
|
327
|
+
lines.push(` });`);
|
|
328
|
+
lines.push(``);
|
|
329
|
+
}
|
|
330
|
+
for (const s of scenarios) {
|
|
331
|
+
if (s.tags)
|
|
332
|
+
for (const t of s.tags)
|
|
333
|
+
lines.push(` // ${t}`);
|
|
334
|
+
lines.push(` test(${JSON.stringify(s.name)}, async ({ ${pomVar} }) => {`);
|
|
335
|
+
// v4.7.0 — parity with the classic emitter's v4.6.4 unbound-step
|
|
336
|
+
// defence (attestqa handoff 2026-10-19 — silent pass is wrong).
|
|
337
|
+
// If any binding is TODO, prepend test.fixme so Playwright reports
|
|
338
|
+
// the test as skipped rather than silently passed. The step-methods
|
|
339
|
+
// branch is unaffected (the method body contains the TODOs there).
|
|
340
|
+
if (todoMode === "skip") {
|
|
341
|
+
const todoBindings = s.bindings.filter((b) => !b.customBody && !b.pomCall && !b.assertion);
|
|
342
|
+
if (todoBindings.length > 0) {
|
|
343
|
+
const titles = todoBindings
|
|
344
|
+
.slice(0, 3)
|
|
345
|
+
.map((b) => {
|
|
346
|
+
const kw = (b.step.keyword ?? "").trim();
|
|
347
|
+
const tx = (b.step.text ?? "").trim();
|
|
348
|
+
return (kw ? `${kw} ${tx}` : tx).trim();
|
|
349
|
+
})
|
|
350
|
+
.join(" | ");
|
|
351
|
+
const more = todoBindings.length > 3 ? ` (+${todoBindings.length - 3} more)` : "";
|
|
352
|
+
const reason = `bdd2pw: ${todoBindings.length} step(s) not bound — ${titles}${more}`;
|
|
353
|
+
lines.push(` test.fixme(true, ${JSON.stringify(reason.replace(/\r?\n/g, " "))});`);
|
|
354
|
+
}
|
|
355
|
+
}
|
|
356
|
+
if (stepMethods) {
|
|
357
|
+
// Call the POM method; the method itself carries @step() so the
|
|
358
|
+
// Playwright report viewer shows one row per scenario.
|
|
359
|
+
const m = methodNameFor(s.name);
|
|
360
|
+
lines.push(` await ${pomVar}.${m}();`);
|
|
361
|
+
// Collect the method body for the POM-append output. Inside the
|
|
362
|
+
// POM class method body, references to the page-object variable
|
|
363
|
+
// (`loginPage`) should become `this`; the method body translator
|
|
364
|
+
// rewrites `<pomVar>.<x>` → `this.<x>` for every rewrite the spec
|
|
365
|
+
// translator does for `<pomVar>.<x>` → `<pomVar>.getNestedLocator(...)`.
|
|
366
|
+
const translateInsideMethod = makeInsideMethodTranslator(pomVar, pathByFieldName, warnings);
|
|
367
|
+
const bodyLines = [];
|
|
368
|
+
for (const b of s.bindings) {
|
|
369
|
+
const translated = renderBindingBodyOnly(b, pomVar, translateInsideMethod);
|
|
370
|
+
for (const l of translated.split("\n"))
|
|
371
|
+
bodyLines.push(` ${l}`);
|
|
372
|
+
}
|
|
373
|
+
pomMethodChunks.push(` @step()\n async ${m}(): Promise<void> {\n${bodyLines.join("\n")}\n }`);
|
|
374
|
+
}
|
|
375
|
+
else {
|
|
376
|
+
for (const b of s.bindings) {
|
|
377
|
+
lines.push(renderBinding(b).replace(/^ {2}/gm, " "));
|
|
378
|
+
}
|
|
379
|
+
}
|
|
380
|
+
lines.push(` });`);
|
|
381
|
+
lines.push(``);
|
|
382
|
+
}
|
|
383
|
+
lines.push(`});`);
|
|
384
|
+
const result = { contents: lines.join("\n"), warnings };
|
|
385
|
+
if (stepMethods && pomMethodChunks.length > 0) {
|
|
386
|
+
result.pomMethodsAppend = pomMethodChunks.join("\n\n");
|
|
387
|
+
}
|
|
388
|
+
return result;
|
|
389
|
+
}
|
|
390
|
+
/**
|
|
391
|
+
* v4.7.0 PoC gap #2a. Translator variant for use INSIDE a POM class
|
|
392
|
+
* method body. Rewrites `<pomVar>.<field>` references to `this.<field>`
|
|
393
|
+
* equivalents, so the emitted code is valid inside the class:
|
|
394
|
+
*
|
|
395
|
+
* loginPage.usernameInput.fill("x") (spec context)
|
|
396
|
+
* → this.getNestedLocator("main.form@login.input@username").fill("x") (method body)
|
|
397
|
+
*
|
|
398
|
+
* loginPage.goto() → this.navigation.goto()
|
|
399
|
+
* loginPage.page → this.page
|
|
400
|
+
* loginPage.navigation → this.navigation
|
|
401
|
+
*/
|
|
402
|
+
function makeInsideMethodTranslator(pomVar, pathByFieldName, warnings) {
|
|
403
|
+
const escapedVar = pomVar.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
404
|
+
const re = new RegExp(`\\b${escapedVar}\\.([A-Za-z_$][\\w$]*)`, "g");
|
|
405
|
+
return (expr) => expr.replace(re, (_m, field) => {
|
|
406
|
+
if (field === "page" ||
|
|
407
|
+
field === "getNestedLocator" ||
|
|
408
|
+
field === "getLocatorSchema" ||
|
|
409
|
+
field === "navigation" ||
|
|
410
|
+
field === "sessionStorage") {
|
|
411
|
+
return `this.${field}`;
|
|
412
|
+
}
|
|
413
|
+
if (field === "goto")
|
|
414
|
+
return `this.navigation.goto`;
|
|
415
|
+
const p = pathByFieldName.get(field);
|
|
416
|
+
if (!p) {
|
|
417
|
+
warnings.push({
|
|
418
|
+
severity: "warn",
|
|
419
|
+
message: `POMWright translation (inside method): no path for field "${field}" — left as-is, test may not compile.`,
|
|
420
|
+
});
|
|
421
|
+
return _m;
|
|
422
|
+
}
|
|
423
|
+
return `this.getNestedLocator(${JSON.stringify(p)})`;
|
|
424
|
+
});
|
|
425
|
+
}
|
|
426
|
+
/**
|
|
427
|
+
* Render a binding as pure statements (no `test.step` wrapper) — used by
|
|
428
|
+
* the @step()-decorated method body. Mirrors renderBinding minus the
|
|
429
|
+
* step wrapper and label line.
|
|
430
|
+
*/
|
|
431
|
+
function renderBindingBodyOnly(b, pomVar, translate) {
|
|
432
|
+
if (b.customBody)
|
|
433
|
+
return translate(b.customBody);
|
|
434
|
+
if (b.pomCall) {
|
|
435
|
+
const args = b.pomCall.args.join(", ");
|
|
436
|
+
return translate(`await ${b.pomCall.page}.${b.pomCall.method}(${args});`);
|
|
437
|
+
}
|
|
438
|
+
if (b.assertion) {
|
|
439
|
+
const locator = translate(b.assertion.locator);
|
|
440
|
+
const expected = b.assertion.expected !== undefined ? b.assertion.expected : "";
|
|
441
|
+
return `await expect(${locator}).${b.assertion.matcher}(${expected});`;
|
|
442
|
+
}
|
|
443
|
+
return `// TODO: ${b.warning ?? "no rule matched this step"}`;
|
|
444
|
+
}
|
|
445
|
+
//# sourceMappingURL=pomwrightEmitter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pomwrightEmitter.js","sourceRoot":"","sources":["../../src/emitters/pomwrightEmitter.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;;AAsDH,4CA+KC;AAkGD,8CAqMC;AAzgBD,yEAA0F;AAgD1F;;GAEG;AACH,SAAgB,gBAAgB,CAAC,KAA4B;IAC3D,MAAM,EAAE,GAAG,EAAE,OAAO,EAAE,OAAO,EAAE,GAAG,KAAK,CAAC;IACxC,MAAM,QAAQ,GAAiB,EAAE,CAAC;IAClC,MAAM,eAAe,GAAG,IAAI,GAAG,EAAkB,CAAC;IAElD,4DAA4D;IAC5D,+CAA+C;IAC/C,MAAM,QAAQ,GAAwD,GAAG,CAAC,MAAM,CAAC,GAAG,CAClF,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,EAAE,MAAM,EAAE,GAAG,EAAE,IAAA,sCAAkB,EAAC,MAAM,CAAC,EAAE,CAAC,C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