@andrii_kremlovskyi/playwright-traces-reader 2.3.0 → 2.5.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/README.md +42 -7
- package/dist/cli/formatters.d.ts +3 -1
- package/dist/cli/formatters.d.ts.map +1 -1
- package/dist/cli/formatters.js +21 -1
- package/dist/cli/formatters.js.map +1 -1
- package/dist/cli/helpers.d.ts +2 -0
- package/dist/cli/helpers.d.ts.map +1 -1
- package/dist/cli/helpers.js +28 -1
- package/dist/cli/helpers.js.map +1 -1
- package/dist/cli/json.d.ts +16 -2
- package/dist/cli/json.d.ts.map +1 -1
- package/dist/cli/json.js +18 -0
- package/dist/cli/json.js.map +1 -1
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +23 -0
- package/dist/cli.js.map +1 -1
- package/dist/docGenerator/actionTranslator.d.ts +15 -0
- package/dist/docGenerator/actionTranslator.d.ts.map +1 -0
- package/dist/docGenerator/actionTranslator.js +299 -0
- package/dist/docGenerator/actionTranslator.js.map +1 -0
- package/dist/docGenerator/copilotRenderer.d.ts +17 -0
- package/dist/docGenerator/copilotRenderer.d.ts.map +1 -0
- package/dist/docGenerator/copilotRenderer.js +247 -0
- package/dist/docGenerator/copilotRenderer.js.map +1 -0
- package/dist/docGenerator/featureLinker.d.ts +12 -0
- package/dist/docGenerator/featureLinker.d.ts.map +1 -0
- package/dist/docGenerator/featureLinker.js +117 -0
- package/dist/docGenerator/featureLinker.js.map +1 -0
- package/dist/docGenerator/index.d.ts +7 -0
- package/dist/docGenerator/index.d.ts.map +1 -0
- package/dist/docGenerator/index.js +19 -0
- package/dist/docGenerator/index.js.map +1 -0
- package/dist/docGenerator/markdownRenderer.d.ts +19 -0
- package/dist/docGenerator/markdownRenderer.d.ts.map +1 -0
- package/dist/docGenerator/markdownRenderer.js +214 -0
- package/dist/docGenerator/markdownRenderer.js.map +1 -0
- package/dist/docGenerator/types.d.ts +97 -0
- package/dist/docGenerator/types.d.ts.map +1 -0
- package/dist/docGenerator/types.js +3 -0
- package/dist/docGenerator/types.js.map +1 -0
- package/dist/docGenerator/vaultBuilder.d.ts +20 -0
- package/dist/docGenerator/vaultBuilder.d.ts.map +1 -0
- package/dist/docGenerator/vaultBuilder.js +437 -0
- package/dist/docGenerator/vaultBuilder.js.map +1 -0
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -1
- package/dist/parseTrace.d.ts +22 -0
- package/dist/parseTrace.d.ts.map +1 -1
- package/dist/parseTrace.js +66 -0
- package/dist/parseTrace.js.map +1 -1
- package/package.json +3 -3
- package/templates/skills/analyze-playwright-traces/SKILL.md +68 -10
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { TestStep } from '../extractors';
|
|
2
|
+
import type { TranslatedStep } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* Maps a Playwright trace action title to a human-readable description.
|
|
5
|
+
*
|
|
6
|
+
* `TestStep` has `title` and `method` but no structured params. Action parameters
|
|
7
|
+
* are embedded in the title string (e.g. `locator.click(getByRole('button'))`).
|
|
8
|
+
* We parse the title string using regex to extract method, selector, and arguments.
|
|
9
|
+
*/
|
|
10
|
+
export declare function translateStep(step: TestStep): TranslatedStep;
|
|
11
|
+
/**
|
|
12
|
+
* Translates an array of TestSteps to TranslatedSteps.
|
|
13
|
+
*/
|
|
14
|
+
export declare function translateSteps(steps: TestStep[]): TranslatedStep[];
|
|
15
|
+
//# sourceMappingURL=actionTranslator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"actionTranslator.d.ts","sourceRoot":"","sources":["../../src/docGenerator/actionTranslator.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAC9C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAE9C;;;;;;GAMG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,QAAQ,GAAG,cAAc,CAwB5D;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,QAAQ,EAAE,GAAG,cAAc,EAAE,CAElE"}
|
|
@@ -0,0 +1,299 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.translateStep = translateStep;
|
|
4
|
+
exports.translateSteps = translateSteps;
|
|
5
|
+
/**
|
|
6
|
+
* Maps a Playwright trace action title to a human-readable description.
|
|
7
|
+
*
|
|
8
|
+
* `TestStep` has `title` and `method` but no structured params. Action parameters
|
|
9
|
+
* are embedded in the title string (e.g. `locator.click(getByRole('button'))`).
|
|
10
|
+
* We parse the title string using regex to extract method, selector, and arguments.
|
|
11
|
+
*/
|
|
12
|
+
function translateStep(step) {
|
|
13
|
+
const isTestStep = step.method === 'step' || step.method === 'test.step';
|
|
14
|
+
// test.step() titles are already human-readable — pass through as-is.
|
|
15
|
+
if (isTestStep) {
|
|
16
|
+
return {
|
|
17
|
+
text: step.title,
|
|
18
|
+
method: step.method,
|
|
19
|
+
isTestStep: true,
|
|
20
|
+
durationMs: step.durationMs,
|
|
21
|
+
callId: step.callId,
|
|
22
|
+
children: step.children.map(translateStep),
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
const text = translateActionTitle(step.title, step.method);
|
|
26
|
+
return {
|
|
27
|
+
text,
|
|
28
|
+
method: step.method,
|
|
29
|
+
isTestStep: false,
|
|
30
|
+
durationMs: step.durationMs,
|
|
31
|
+
callId: step.callId,
|
|
32
|
+
children: step.children.map(translateStep),
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Translates an array of TestSteps to TranslatedSteps.
|
|
37
|
+
*/
|
|
38
|
+
function translateSteps(steps) {
|
|
39
|
+
return steps.map(translateStep);
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Parses a Playwright action title string and returns a human-readable description.
|
|
43
|
+
*/
|
|
44
|
+
function translateActionTitle(title, method) {
|
|
45
|
+
// Hook methods — pass through
|
|
46
|
+
if (method === 'hook')
|
|
47
|
+
return title;
|
|
48
|
+
// page.goto(url)
|
|
49
|
+
const gotoMatch = title.match(/^page\.goto\(([^)]+)\)$/);
|
|
50
|
+
if (gotoMatch)
|
|
51
|
+
return `Navigate to ${stripQuotes(gotoMatch[1])}`;
|
|
52
|
+
// locator.click(...) / .dblclick(...)
|
|
53
|
+
if (method === 'click' || method === 'dblclick') {
|
|
54
|
+
const selector = extractSelector(title);
|
|
55
|
+
const verb = method === 'dblclick' ? 'Double-click' : 'Click';
|
|
56
|
+
return selector ? `${verb} on ${selector}` : `${verb} on element`;
|
|
57
|
+
}
|
|
58
|
+
// locator.fill(text)
|
|
59
|
+
if (method === 'fill') {
|
|
60
|
+
const { selector, arg } = extractSelectorAndArg(title);
|
|
61
|
+
const value = arg ? `'${arg}'` : 'value';
|
|
62
|
+
return selector ? `Enter ${value} in ${selector}` : `Enter ${value} in field`;
|
|
63
|
+
}
|
|
64
|
+
// locator.type(text) / pressSequentially
|
|
65
|
+
if (method === 'type' || method === 'pressSequentially') {
|
|
66
|
+
const { selector, arg } = extractSelectorAndArg(title);
|
|
67
|
+
const value = arg ? `'${arg}'` : 'text';
|
|
68
|
+
return selector ? `Type ${value} in ${selector}` : `Type ${value} in field`;
|
|
69
|
+
}
|
|
70
|
+
// locator.press(key)
|
|
71
|
+
if (method === 'press') {
|
|
72
|
+
const { selector, arg } = extractSelectorAndArg(title);
|
|
73
|
+
const key = arg || 'key';
|
|
74
|
+
return selector ? `Press ${key} on ${selector}` : `Press ${key}`;
|
|
75
|
+
}
|
|
76
|
+
// locator.check / uncheck
|
|
77
|
+
if (method === 'check') {
|
|
78
|
+
const selector = extractSelector(title);
|
|
79
|
+
return selector ? `Check ${selector}` : 'Check checkbox';
|
|
80
|
+
}
|
|
81
|
+
if (method === 'uncheck') {
|
|
82
|
+
const selector = extractSelector(title);
|
|
83
|
+
return selector ? `Uncheck ${selector}` : 'Uncheck checkbox';
|
|
84
|
+
}
|
|
85
|
+
// locator.selectOption(value)
|
|
86
|
+
if (method === 'selectOption') {
|
|
87
|
+
const { selector, arg } = extractSelectorAndArg(title);
|
|
88
|
+
const value = arg ? `'${arg}'` : 'option';
|
|
89
|
+
return selector ? `Select ${value} in ${selector}` : `Select ${value} in dropdown`;
|
|
90
|
+
}
|
|
91
|
+
// locator.hover()
|
|
92
|
+
if (method === 'hover') {
|
|
93
|
+
const selector = extractSelector(title);
|
|
94
|
+
return selector ? `Hover over ${selector}` : 'Hover over element';
|
|
95
|
+
}
|
|
96
|
+
// locator.focus()
|
|
97
|
+
if (method === 'focus') {
|
|
98
|
+
const selector = extractSelector(title);
|
|
99
|
+
return selector ? `Focus on ${selector}` : 'Focus on element';
|
|
100
|
+
}
|
|
101
|
+
// locator.scrollIntoViewIfNeeded()
|
|
102
|
+
if (method === 'scrollIntoViewIfNeeded') {
|
|
103
|
+
const selector = extractSelector(title);
|
|
104
|
+
return selector ? `Scroll to ${selector}` : 'Scroll to element';
|
|
105
|
+
}
|
|
106
|
+
// locator.waitFor()
|
|
107
|
+
if (method === 'waitFor') {
|
|
108
|
+
const selector = extractSelector(title);
|
|
109
|
+
return selector ? `Wait for ${selector}` : 'Wait for element';
|
|
110
|
+
}
|
|
111
|
+
// page.waitForURL / page.waitForNavigation / page.waitForLoadState etc.
|
|
112
|
+
if (method === 'waitForURL') {
|
|
113
|
+
const urlMatch = title.match(/waitForURL\(([^)]+)\)/);
|
|
114
|
+
return urlMatch ? `Wait for URL ${stripQuotes(urlMatch[1])}` : 'Wait for URL';
|
|
115
|
+
}
|
|
116
|
+
if (method === 'waitForNavigation')
|
|
117
|
+
return 'Wait for navigation';
|
|
118
|
+
if (method === 'waitForLoadState')
|
|
119
|
+
return 'Wait for page load';
|
|
120
|
+
if (method === 'waitForEvent')
|
|
121
|
+
return title;
|
|
122
|
+
if (method === 'waitForTimeout') {
|
|
123
|
+
const msMatch = title.match(/waitForTimeout\((\d+)\)/);
|
|
124
|
+
return msMatch ? `Wait for ${msMatch[1]}ms` : 'Wait for timeout';
|
|
125
|
+
}
|
|
126
|
+
// page.reload()
|
|
127
|
+
if (method === 'reload')
|
|
128
|
+
return 'Reload page';
|
|
129
|
+
// page.goBack() / page.goForward()
|
|
130
|
+
if (method === 'goBack')
|
|
131
|
+
return 'Go back';
|
|
132
|
+
if (method === 'goForward')
|
|
133
|
+
return 'Go forward';
|
|
134
|
+
// page.close()
|
|
135
|
+
if (method === 'close')
|
|
136
|
+
return 'Close page';
|
|
137
|
+
// Assertions: expect(…).toBeVisible(), toBe…, toHaveText, etc.
|
|
138
|
+
if (method.startsWith('toBe') || method.startsWith('toHave') || method.startsWith('toContain') || method.startsWith('toEqual') || method.startsWith('toMatch')) {
|
|
139
|
+
return translateAssertion(title, method);
|
|
140
|
+
}
|
|
141
|
+
// locator.setInputFiles / locator.inputValue
|
|
142
|
+
if (method === 'setInputFiles') {
|
|
143
|
+
const selector = extractSelector(title);
|
|
144
|
+
return selector ? `Upload file(s) to ${selector}` : 'Upload file(s)';
|
|
145
|
+
}
|
|
146
|
+
if (method === 'inputValue') {
|
|
147
|
+
const selector = extractSelector(title);
|
|
148
|
+
return selector ? `Read value from ${selector}` : 'Read input value';
|
|
149
|
+
}
|
|
150
|
+
// locator.textContent / innerText / innerHTML
|
|
151
|
+
if (method === 'textContent' || method === 'innerText') {
|
|
152
|
+
const selector = extractSelector(title);
|
|
153
|
+
return selector ? `Read text from ${selector}` : 'Read text content';
|
|
154
|
+
}
|
|
155
|
+
if (method === 'innerHTML') {
|
|
156
|
+
const selector = extractSelector(title);
|
|
157
|
+
return selector ? `Read HTML from ${selector}` : 'Read inner HTML';
|
|
158
|
+
}
|
|
159
|
+
// locator.getAttribute(name)
|
|
160
|
+
if (method === 'getAttribute') {
|
|
161
|
+
const { selector, arg } = extractSelectorAndArg(title);
|
|
162
|
+
return selector ? `Read attribute '${arg}' from ${selector}` : `Read attribute '${arg}'`;
|
|
163
|
+
}
|
|
164
|
+
// locator.isVisible / isEnabled / isChecked / isDisabled / isEditable / isHidden
|
|
165
|
+
if (method === 'isVisible' || method === 'isEnabled' || method === 'isChecked' ||
|
|
166
|
+
method === 'isDisabled' || method === 'isEditable' || method === 'isHidden') {
|
|
167
|
+
const selector = extractSelector(title);
|
|
168
|
+
const state = method.replace('is', '').toLowerCase();
|
|
169
|
+
return selector ? `Check if ${selector} is ${state}` : `Check if element is ${state}`;
|
|
170
|
+
}
|
|
171
|
+
// locator.count()
|
|
172
|
+
if (method === 'count') {
|
|
173
|
+
const selector = extractSelector(title);
|
|
174
|
+
return selector ? `Count ${selector} elements` : 'Count elements';
|
|
175
|
+
}
|
|
176
|
+
// locator.screenshot / page.screenshot
|
|
177
|
+
if (method === 'screenshot')
|
|
178
|
+
return 'Take screenshot';
|
|
179
|
+
// page.evaluate / locator.evaluate / evaluateHandle
|
|
180
|
+
if (method === 'evaluate' || method === 'evaluateHandle')
|
|
181
|
+
return 'Execute JavaScript in page';
|
|
182
|
+
// API request methods
|
|
183
|
+
if (method === 'fetch')
|
|
184
|
+
return `API request: ${title}`;
|
|
185
|
+
if (method === 'get' || method === 'post' || method === 'put' || method === 'patch' || method === 'delete' || method === 'head') {
|
|
186
|
+
return `API ${method.toUpperCase()} request`;
|
|
187
|
+
}
|
|
188
|
+
// Frame methods
|
|
189
|
+
if (method === 'frame' || method === 'frameLocator') {
|
|
190
|
+
return title;
|
|
191
|
+
}
|
|
192
|
+
// dialog handling
|
|
193
|
+
if (method === 'dialog')
|
|
194
|
+
return title;
|
|
195
|
+
// Fallback — return original title
|
|
196
|
+
return title;
|
|
197
|
+
}
|
|
198
|
+
/**
|
|
199
|
+
* Translates assertion titles to human-readable form.
|
|
200
|
+
*/
|
|
201
|
+
function translateAssertion(title, method) {
|
|
202
|
+
const selector = extractSelector(title);
|
|
203
|
+
const element = selector || 'element';
|
|
204
|
+
switch (method) {
|
|
205
|
+
case 'toBeVisible': return `Verify ${element} is visible`;
|
|
206
|
+
case 'toBeHidden': return `Verify ${element} is hidden`;
|
|
207
|
+
case 'toBeEnabled': return `Verify ${element} is enabled`;
|
|
208
|
+
case 'toBeDisabled': return `Verify ${element} is disabled`;
|
|
209
|
+
case 'toBeChecked': return `Verify ${element} is checked`;
|
|
210
|
+
case 'toBeEditable': return `Verify ${element} is editable`;
|
|
211
|
+
case 'toBeEmpty': return `Verify ${element} is empty`;
|
|
212
|
+
case 'toBeFocused': return `Verify ${element} is focused`;
|
|
213
|
+
case 'toBeAttached': return `Verify ${element} is attached`;
|
|
214
|
+
case 'toHaveText': return `Verify ${element} has expected text`;
|
|
215
|
+
case 'toHaveValue': return `Verify ${element} has expected value`;
|
|
216
|
+
case 'toHaveAttribute': return `Verify ${element} has expected attribute`;
|
|
217
|
+
case 'toHaveClass': return `Verify ${element} has expected class`;
|
|
218
|
+
case 'toHaveCSS': return `Verify ${element} has expected CSS`;
|
|
219
|
+
case 'toHaveCount': return `Verify ${element} has expected count`;
|
|
220
|
+
case 'toHaveId': return `Verify ${element} has expected ID`;
|
|
221
|
+
case 'toHaveTitle': return 'Verify page has expected title';
|
|
222
|
+
case 'toHaveURL': return 'Verify page has expected URL';
|
|
223
|
+
case 'toHaveScreenshot': return `Verify ${element} matches screenshot`;
|
|
224
|
+
case 'toContainText': return `Verify ${element} contains expected text`;
|
|
225
|
+
case 'toEqual': return `Verify ${element} equals expected value`;
|
|
226
|
+
case 'toMatchSnapshot': return 'Verify matches snapshot';
|
|
227
|
+
case 'toMatchAriaSnapshot': return `Verify ${element} matches aria snapshot`;
|
|
228
|
+
default: return title;
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
// ---------- Helpers ----------
|
|
232
|
+
/**
|
|
233
|
+
* Extracts the selector portion from a title like `locator.click(getByRole('button'))`.
|
|
234
|
+
*/
|
|
235
|
+
function extractSelector(title) {
|
|
236
|
+
// Match pattern: method.action(selector) or expect(locator).assertion
|
|
237
|
+
const locatorMatch = title.match(/(?:locator|expect)\((.+?)\)\./);
|
|
238
|
+
if (locatorMatch)
|
|
239
|
+
return humanizeSelector(locatorMatch[1]);
|
|
240
|
+
// Direct pattern: something.method(selectorExpression)
|
|
241
|
+
const directMatch = title.match(/\.(?:click|dblclick|fill|type|press|check|uncheck|hover|focus|selectOption|waitFor|scrollIntoViewIfNeeded|setInputFiles|inputValue|textContent|innerText|innerHTML|getAttribute|isVisible|isEnabled|isChecked|isDisabled|isEditable|isHidden|count|screenshot)\((.+?)\)$/);
|
|
242
|
+
if (directMatch)
|
|
243
|
+
return humanizeSelector(directMatch[1]);
|
|
244
|
+
// Simpler pattern for getBy* directly in title
|
|
245
|
+
const getByMatch = title.match(/(getBy\w+\([^)]*\))/);
|
|
246
|
+
if (getByMatch)
|
|
247
|
+
return humanizeSelector(getByMatch[1]);
|
|
248
|
+
return null;
|
|
249
|
+
}
|
|
250
|
+
/**
|
|
251
|
+
* Extracts selector and first argument from titles like `locator.fill(selector, 'value')`.
|
|
252
|
+
*/
|
|
253
|
+
function extractSelectorAndArg(title) {
|
|
254
|
+
// Pattern: "locator.method('value')" where value is the last quoted arg
|
|
255
|
+
const quoted = title.match(/,\s*['"]([^'"]*)['"]\s*\)$/);
|
|
256
|
+
const arg = quoted ? quoted[1] : null;
|
|
257
|
+
const selector = extractSelector(title);
|
|
258
|
+
return { selector, arg };
|
|
259
|
+
}
|
|
260
|
+
/**
|
|
261
|
+
* Converts Playwright selector expressions to human-readable descriptions.
|
|
262
|
+
*/
|
|
263
|
+
function humanizeSelector(selector) {
|
|
264
|
+
// getByRole('button', { name: 'Submit' }) → "button 'Submit'"
|
|
265
|
+
const roleMatch = selector.match(/getByRole\(['"](\w+)['"](?:,\s*\{[^}]*name:\s*['"]([^'"]+)['"][^}]*\})?\)/);
|
|
266
|
+
if (roleMatch) {
|
|
267
|
+
return roleMatch[2] ? `${roleMatch[1]} '${roleMatch[2]}'` : roleMatch[1];
|
|
268
|
+
}
|
|
269
|
+
// getByText('...') → "'...'"
|
|
270
|
+
const textMatch = selector.match(/getByText\(['"]([^'"]+)['"]\)/);
|
|
271
|
+
if (textMatch)
|
|
272
|
+
return `'${textMatch[1]}'`;
|
|
273
|
+
// getByLabel('...') → "field '...'"
|
|
274
|
+
const labelMatch = selector.match(/getByLabel\(['"]([^'"]+)['"]\)/);
|
|
275
|
+
if (labelMatch)
|
|
276
|
+
return `field '${labelMatch[1]}'`;
|
|
277
|
+
// getByPlaceholder('...') → "field with placeholder '...'"
|
|
278
|
+
const placeholderMatch = selector.match(/getByPlaceholder\(['"]([^'"]+)['"]\)/);
|
|
279
|
+
if (placeholderMatch)
|
|
280
|
+
return `field with placeholder '${placeholderMatch[1]}'`;
|
|
281
|
+
// getByTestId('...') → "element [data-testid='...']"
|
|
282
|
+
const testIdMatch = selector.match(/getByTestId\(['"]([^'"]+)['"]\)/);
|
|
283
|
+
if (testIdMatch)
|
|
284
|
+
return `element [test-id='${testIdMatch[1]}']`;
|
|
285
|
+
// getByAltText('...') → "image '...'"
|
|
286
|
+
const altMatch = selector.match(/getByAltText\(['"]([^'"]+)['"]\)/);
|
|
287
|
+
if (altMatch)
|
|
288
|
+
return `image '${altMatch[1]}'`;
|
|
289
|
+
// getByTitle('...') → "element titled '...'"
|
|
290
|
+
const titleMatch = selector.match(/getByTitle\(['"]([^'"]+)['"]\)/);
|
|
291
|
+
if (titleMatch)
|
|
292
|
+
return `element titled '${titleMatch[1]}'`;
|
|
293
|
+
// CSS/XPath selectors — keep as-is but trim quotes
|
|
294
|
+
return stripQuotes(selector);
|
|
295
|
+
}
|
|
296
|
+
function stripQuotes(value) {
|
|
297
|
+
return value.replace(/^['"]|['"]$/g, '').trim();
|
|
298
|
+
}
|
|
299
|
+
//# sourceMappingURL=actionTranslator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"actionTranslator.js","sourceRoot":"","sources":["../../src/docGenerator/actionTranslator.ts"],"names":[],"mappings":";;AAUA,sCAwBC;AAK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,CAAC,GAAG,CAAC;IAE1C,oCAAoC;IACpC,MAAM,UAAU,GAAG,QAAQ,CAAC,KAAK,CAAC,gCAAgC,CAAC,CAAC;IACpE,IAAI,UAAU;QAAE,OAAO,UAAU,UAAU,CAAC,CAAC,CAAC,GAAG,CAAC;IAElD,2DAA2D;IAC3D,MAAM,gBAAgB,GAAG,QAAQ,CAAC,KAAK,CAAC,sCAAsC,CAAC,CAAC;IAChF,IAAI,gBAAgB;QAAE,OAAO,2BAA2B,gBAAgB,CAAC,CAAC,CAAC,GAAG,CAAC;IAE/E,qDAAqD;IACrD,MAAM,WAAW,GAAG,QAAQ,CAAC,KAAK,CAAC,iCAAiC,CAAC,CAAC;IACtE,IAAI,WAAW;QAAE,OAAO,qBAAqB,WAAW,CAAC,CAAC,CAAC,IAAI,CAAC;IAEhE,sCAAsC;IACtC,MAAM,QAAQ,GAAG,QAAQ,CAAC,KAAK,CAAC,kCAAkC,CAAC,CAAC;IACpE,IAAI,QAAQ;QAAE,OAAO,UAAU,QAAQ,CAAC,CAAC,CAAC,GAAG,CAAC;IAE9C,6CAA6C;IAC7C,MAAM,UAAU,GAAG,QAAQ,CAAC,KAAK,CAAC,gCAAgC,CAAC,CAAC;IACpE,IAAI,UAAU;QAAE,OAAO,mBAAmB,UAAU,CAAC,CAAC,CAAC,GAAG,CAAC;IAE3D,mDAAmD;IACnD,OAAO,WAAW,CAAC,QAAQ,CAAC,CAAC;AAC/B,CAAC;AAED,SAAS,WAAW,CAAC,KAAa;IAChC,OAAO,KAAK,CAAC,OAAO,CAAC,cAAc,EAAE,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC;AAClD,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { TranslatedStep, StepApiCall } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* Manages a Copilot SDK session for rendering test steps into markdown.
|
|
4
|
+
* Falls back gracefully if the Copilot CLI is unavailable or auth fails.
|
|
5
|
+
*/
|
|
6
|
+
export declare class CopilotStepRenderer {
|
|
7
|
+
private client;
|
|
8
|
+
private session;
|
|
9
|
+
private _available;
|
|
10
|
+
get available(): boolean;
|
|
11
|
+
private _startError;
|
|
12
|
+
get startError(): string | null;
|
|
13
|
+
start(): Promise<boolean>;
|
|
14
|
+
renderSteps(testTitle: string, steps: TranslatedStep[], networkMap: Map<string, StepApiCall[]>): Promise<string | null>;
|
|
15
|
+
stop(): Promise<void>;
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=copilotRenderer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"copilotRenderer.d.ts","sourceRoot":"","sources":["../../src/docGenerator/copilotRenderer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AA2H3D;;;GAGG;AACH,qBAAa,mBAAmB;IAE9B,OAAO,CAAC,MAAM,CAAa;IAE3B,OAAO,CAAC,OAAO,CAAa;IAC5B,OAAO,CAAC,UAAU,CAAS;IAE3B,IAAI,SAAS,IAAI,OAAO,CAEvB;IAED,OAAO,CAAC,WAAW,CAAuB;IAE1C,IAAI,UAAU,IAAI,MAAM,GAAG,IAAI,CAE9B;IAEK,KAAK,IAAI,OAAO,CAAC,OAAO,CAAC;IAoCzB,WAAW,CAAC,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,cAAc,EAAE,EAAE,UAAU,EAAE,GAAG,CAAC,MAAM,EAAE,WAAW,EAAE,CAAC,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC;IAoBvH,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;CAQ5B"}
|
|
@@ -0,0 +1,247 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CopilotStepRenderer = void 0;
|
|
4
|
+
const SYSTEM_MESSAGE = `You are a technical writer generating Obsidian-compatible markdown from Playwright test step data.
|
|
5
|
+
|
|
6
|
+
Rules:
|
|
7
|
+
- Output ONLY the Steps section content. Do NOT include the "## Steps" heading.
|
|
8
|
+
- The step tree has two types: "test.step" (user-defined) and "action" (low-level Playwright actions).
|
|
9
|
+
- Root-level "test.step" entries become numbered bullet points.
|
|
10
|
+
- "action" entries under a test.step are enrichment context — extract SPECIFIC DETAILS and add them inline:
|
|
11
|
+
- fill/type → mention the value (e.g. date of birth: 01/01/1990)
|
|
12
|
+
- selectOption → mention the selected value
|
|
13
|
+
- goto/navigate → mention the URL if meaningful
|
|
14
|
+
- expect/assert → mention what was verified
|
|
15
|
+
- Omit trivial actions: scroll, hover, focus, wait, page load
|
|
16
|
+
- Strip locator syntax: remove [placeholder='...'], getByRole(...), CSS. Keep only human-meaningful content.
|
|
17
|
+
- Omit action values that are UUIDs, tokens, or long hashes.
|
|
18
|
+
- Nested "test.step" entries become sub-bullets with their own enriched details.
|
|
19
|
+
- Each "test.step" may have a "calls" array of API calls made within that step:
|
|
20
|
+
- endpoint: the API path — use it to clarify WHAT was called
|
|
21
|
+
- status: HTTP status — mention if it indicates something meaningful (e.g. 201 Created, 400 Bad Request)
|
|
22
|
+
- reqPlaceholder / resPlaceholder: Placeholders for request/response payloads. If present, you MUST append them verbatim at the end of your sentence. Example: \`Made POST to /api/orders. %%REQ-0-call@123%% %%RES-0-call@123%%\`.
|
|
23
|
+
- retries: if present, the call was polled N more times — note it briefly (e.g. "polled until complete")
|
|
24
|
+
- Skip /oauth/token and similar auth endpoints — just mention authentication happened
|
|
25
|
+
- Just note the endpoint, method and status — payloads are not included in the data
|
|
26
|
+
- If there are NO "test.step" entries, render all actions as a flat bullet list.
|
|
27
|
+
- Do NOT include durations, timestamps, or raw technical IDs.
|
|
28
|
+
- Do NOT wrap output in code fences or add explanations.
|
|
29
|
+
- Output clean markdown only.`;
|
|
30
|
+
// Titles that identify framework-generated test.step wrappers (not user-authored).
|
|
31
|
+
const FRAMEWORK_STEP_PREFIXES = [
|
|
32
|
+
'Sending [', 'Deserializing response', 'Authenticating for',
|
|
33
|
+
'before each hook', 'after each hook',
|
|
34
|
+
];
|
|
35
|
+
function isFrameworkStep(text) {
|
|
36
|
+
return FRAMEWORK_STEP_PREFIXES.some(p => text.toLowerCase().startsWith(p.toLowerCase()));
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Builds a shallow, Copilot-friendly simplified tree.
|
|
40
|
+
* Only includes user-authored test.step nodes and action steps.
|
|
41
|
+
* Framework internals (e.g. "Sending [post] request") are omitted.
|
|
42
|
+
*/
|
|
43
|
+
function simplifySteps(steps, networkMap) {
|
|
44
|
+
const result = [];
|
|
45
|
+
for (const s of steps) {
|
|
46
|
+
if (s.isTestStep && isFrameworkStep(s.text))
|
|
47
|
+
continue;
|
|
48
|
+
const simplified = {
|
|
49
|
+
text: s.text,
|
|
50
|
+
type: s.isTestStep ? 'test.step' : 'action',
|
|
51
|
+
children: simplifySteps(s.children, networkMap),
|
|
52
|
+
};
|
|
53
|
+
// Attach network calls to user test.steps that have them.
|
|
54
|
+
if (s.callId && s.isTestStep) {
|
|
55
|
+
const calls = networkMap.get(s.callId);
|
|
56
|
+
if (calls && calls.length > 0) {
|
|
57
|
+
simplified.calls = calls.map((c, i) => ({
|
|
58
|
+
method: c.method,
|
|
59
|
+
endpoint: extractPath(c.url),
|
|
60
|
+
status: c.status,
|
|
61
|
+
...(c.requestBody ? { reqPlaceholder: `%%REQ-${i}-${s.callId}%%` } : {}),
|
|
62
|
+
...(c.responseBody ? { resPlaceholder: `%%RES-${i}-${s.callId}%%` } : {}),
|
|
63
|
+
...(c.retries ? { retries: c.retries } : {}),
|
|
64
|
+
}));
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
result.push(simplified);
|
|
68
|
+
}
|
|
69
|
+
return result;
|
|
70
|
+
}
|
|
71
|
+
function extractPath(url) {
|
|
72
|
+
try {
|
|
73
|
+
return new URL(url).pathname;
|
|
74
|
+
}
|
|
75
|
+
catch {
|
|
76
|
+
return url;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Normalises sub-bullet indentation so it is consistent regardless of whether the
|
|
81
|
+
* parent numbered item is single-digit (1–9) or multi-digit (10+).
|
|
82
|
+
*
|
|
83
|
+
* Copilot naturally aligns sub-bullets with the text of the parent, e.g.:
|
|
84
|
+
* "1. item\n - sub" (3 spaces — aligns after "1. ")
|
|
85
|
+
* "10. item\n - sub" (4 spaces — aligns after "10. ")
|
|
86
|
+
*
|
|
87
|
+
* Obsidian treats 4-space-indented bullets as nested lists, causing a visual indent
|
|
88
|
+
* jump at item 10. We normalise all list-item sub-bullet indentation to exactly 2 spaces
|
|
89
|
+
* so the rendered output is consistent throughout.
|
|
90
|
+
*/
|
|
91
|
+
function normalizeListIndentation(text) {
|
|
92
|
+
return text
|
|
93
|
+
.split('\n')
|
|
94
|
+
.map(line => {
|
|
95
|
+
// Match lines indented with 3+ spaces that start a bullet (- or *)
|
|
96
|
+
const m = line.match(/^( {3,})([-*] .*)$/);
|
|
97
|
+
if (!m)
|
|
98
|
+
return line;
|
|
99
|
+
const depth = Math.round(m[1].length / 3); // approximate nesting level
|
|
100
|
+
return `${' '.repeat(depth)}${m[2]}`;
|
|
101
|
+
})
|
|
102
|
+
.join('\n');
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* Manages a Copilot SDK session for rendering test steps into markdown.
|
|
106
|
+
* Falls back gracefully if the Copilot CLI is unavailable or auth fails.
|
|
107
|
+
*/
|
|
108
|
+
class CopilotStepRenderer {
|
|
109
|
+
constructor() {
|
|
110
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
111
|
+
this.client = null;
|
|
112
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
113
|
+
this.session = null;
|
|
114
|
+
this._available = false;
|
|
115
|
+
this._startError = null;
|
|
116
|
+
}
|
|
117
|
+
get available() {
|
|
118
|
+
return this._available;
|
|
119
|
+
}
|
|
120
|
+
get startError() {
|
|
121
|
+
return this._startError;
|
|
122
|
+
}
|
|
123
|
+
async start() {
|
|
124
|
+
try {
|
|
125
|
+
const sdk = await import('@github/copilot-sdk');
|
|
126
|
+
this.client = new sdk.CopilotClient();
|
|
127
|
+
await this.client.start();
|
|
128
|
+
// Discover available models and pick the best one
|
|
129
|
+
const models = await this.client.listModels();
|
|
130
|
+
const modelIds = (models ?? []).map((m) => m.id);
|
|
131
|
+
// Preference order
|
|
132
|
+
const preferred = ['gpt-4.1', 'gpt-4o', 'gpt-4', 'claude-sonnet-4'];
|
|
133
|
+
const model = preferred.find(m => modelIds.includes(m)) ?? modelIds[0];
|
|
134
|
+
if (!model) {
|
|
135
|
+
throw new Error(`No models available. Listed models: ${JSON.stringify(modelIds)}`);
|
|
136
|
+
}
|
|
137
|
+
this.session = await this.client.createSession({
|
|
138
|
+
model,
|
|
139
|
+
onPermissionRequest: () => ({ kind: 'denied-interactively-by-user' }),
|
|
140
|
+
systemMessage: {
|
|
141
|
+
mode: 'replace',
|
|
142
|
+
content: SYSTEM_MESSAGE,
|
|
143
|
+
},
|
|
144
|
+
});
|
|
145
|
+
this._available = true;
|
|
146
|
+
return true;
|
|
147
|
+
}
|
|
148
|
+
catch (error) {
|
|
149
|
+
this._available = false;
|
|
150
|
+
this._startError = error instanceof Error ? error.message : String(error);
|
|
151
|
+
return false;
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
async renderSteps(testTitle, steps, networkMap) {
|
|
155
|
+
if (!this._available || !this.session)
|
|
156
|
+
return null;
|
|
157
|
+
try {
|
|
158
|
+
const simplified = simplifySteps(steps, networkMap);
|
|
159
|
+
const prompt = `Generate the Steps section for this test:\n\nTest: "${testTitle}"\n\nStep tree:\n${JSON.stringify(simplified, null, 2)}`;
|
|
160
|
+
process.stdout.write(`[copilot] Sending prompt of length: ${prompt.length} chars...\n`);
|
|
161
|
+
const response = await this.session.sendAndWait({ prompt }, 120000);
|
|
162
|
+
let content = response?.data?.content;
|
|
163
|
+
if (typeof content === 'string' && content.trim().length > 0) {
|
|
164
|
+
content = processPlaceholders(content, networkMap);
|
|
165
|
+
return normalizeListIndentation(content.trim());
|
|
166
|
+
}
|
|
167
|
+
return null;
|
|
168
|
+
}
|
|
169
|
+
catch (error) {
|
|
170
|
+
process.stderr.write(`[copilot] renderSteps error: ${error instanceof Error ? error.message : String(error)}\n`);
|
|
171
|
+
return null;
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
async stop() {
|
|
175
|
+
try {
|
|
176
|
+
if (this.session)
|
|
177
|
+
await this.session.disconnect();
|
|
178
|
+
}
|
|
179
|
+
catch { /* ignore */ }
|
|
180
|
+
try {
|
|
181
|
+
if (this.client)
|
|
182
|
+
await this.client.stop();
|
|
183
|
+
}
|
|
184
|
+
catch { /* ignore */ }
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
exports.CopilotStepRenderer = CopilotStepRenderer;
|
|
188
|
+
/**
|
|
189
|
+
* Replaces Copilot placeholders with actual inline HTML <details> blocks containing raw JSON payloads.
|
|
190
|
+
*/
|
|
191
|
+
function processPlaceholders(content, networkMap) {
|
|
192
|
+
return content.replace(/(%%(REQ|RES)-(\d+)-(.*?)%%)/g, (match, fullMatch, type, indexStr, callId) => {
|
|
193
|
+
const idx = parseInt(indexStr, 10);
|
|
194
|
+
const calls = networkMap.get(callId);
|
|
195
|
+
if (!calls || !calls[idx])
|
|
196
|
+
return '';
|
|
197
|
+
const call = calls[idx];
|
|
198
|
+
const body = type === 'REQ' ? call.requestBody : call.responseBody;
|
|
199
|
+
if (!body)
|
|
200
|
+
return '';
|
|
201
|
+
const title = type === 'REQ' ? 'Request Payload' : 'Response Payload';
|
|
202
|
+
let formattedBody = body;
|
|
203
|
+
try {
|
|
204
|
+
const parsed = JSON.parse(body);
|
|
205
|
+
scrubLargeStrings(parsed, 1000);
|
|
206
|
+
formattedBody = JSON.stringify(parsed, null, 2);
|
|
207
|
+
}
|
|
208
|
+
catch {
|
|
209
|
+
// If parsing fails but it's a huge string, do a fast regex replacement
|
|
210
|
+
if (formattedBody.length > 2000) {
|
|
211
|
+
formattedBody = formattedBody.replace(/(: \")([^\"]{1000,})(\")/g, (m, prefix, str, suffix) => {
|
|
212
|
+
return prefix + str.substring(0, 100) + '... [scrubbed large string]' + suffix;
|
|
213
|
+
});
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
const escapedBody = formattedBody.replace(/</g, '<').replace(/>/g, '>');
|
|
217
|
+
return `<details><summary>${title}</summary><pre><code class="language-json">${escapedBody}</code></pre></details>`;
|
|
218
|
+
});
|
|
219
|
+
}
|
|
220
|
+
/**
|
|
221
|
+
* Mutates an object in-place to scrub string values exceeding maxLength.
|
|
222
|
+
* Useful for stripping massive base64 blobs before writing to Markdown.
|
|
223
|
+
*/
|
|
224
|
+
function scrubLargeStrings(obj, maxLength) {
|
|
225
|
+
if (Array.isArray(obj)) {
|
|
226
|
+
for (let i = 0; i < obj.length; i++) {
|
|
227
|
+
if (typeof obj[i] === 'string' && obj[i].length > maxLength) {
|
|
228
|
+
obj[i] = `${obj[i].substring(0, 100)}... [scrubbed large string, total length: ${obj[i].length}]`;
|
|
229
|
+
}
|
|
230
|
+
else if (obj[i] && typeof obj[i] === 'object') {
|
|
231
|
+
scrubLargeStrings(obj[i], maxLength);
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
else if (obj && typeof obj === 'object') {
|
|
236
|
+
for (const key of Object.keys(obj)) {
|
|
237
|
+
const val = obj[key];
|
|
238
|
+
if (typeof val === 'string' && val.length > maxLength) {
|
|
239
|
+
obj[key] = `${val.substring(0, 100)}... [scrubbed large string, total length: ${val.length}]`;
|
|
240
|
+
}
|
|
241
|
+
else if (val && typeof val === 'object') {
|
|
242
|
+
scrubLargeStrings(val, maxLength);
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
//# sourceMappingURL=copilotRenderer.js.map
|
|
@@ -0,0 +1 @@
|
|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C,EAAE,GAAG,CAAC,6CAA6C,GAAG,CAAC,MAAM,GAAG,CAAC;YAClG,CAAC;iBAAM,IAAI,GAAG,IAAI,OAAO,GAAG,KAAK,QAAQ,EAAE,CAAC;gBACxC,iBAAiB,CAAC,GAAG,EAAE,SAAS,CAAC,CAAC;YACtC,CAAC;QACH,CAAC;IACH,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { FeatureMapping, DocTestEntry } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* Resolves feature wiki-links for a test based on feature mappings.
|
|
4
|
+
* Returns array of `[[feature-name]]` strings.
|
|
5
|
+
*/
|
|
6
|
+
export declare function resolveFeatures(fullTitle: string, sourceFile: string, mappings: FeatureMapping[]): string[];
|
|
7
|
+
/**
|
|
8
|
+
* Creates stub feature Markdown files in the features/ directory.
|
|
9
|
+
* Only creates files for features referenced by at least one test doc.
|
|
10
|
+
*/
|
|
11
|
+
export declare function createFeatureStubs(featuresDir: string, entries: DocTestEntry[]): Promise<string[]>;
|
|
12
|
+
//# sourceMappingURL=featureLinker.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"featureLinker.d.ts","sourceRoot":"","sources":["../../src/docGenerator/featureLinker.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAE5D;;;GAGG;AACH,wBAAgB,eAAe,CAC7B,SAAS,EAAE,MAAM,EACjB,UAAU,EAAE,MAAM,EAClB,QAAQ,EAAE,cAAc,EAAE,GACzB,MAAM,EAAE,CAqBV;AAED;;;GAGG;AACH,wBAAsB,kBAAkB,CACtC,WAAW,EAAE,MAAM,EACnB,OAAO,EAAE,YAAY,EAAE,GACtB,OAAO,CAAC,MAAM,EAAE,CAAC,CA6BnB"}
|