@auto-wiz/playwright 1.3.1 → 1.3.3
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/dist/runner.js +36 -1
- package/package.json +3 -3
package/dist/runner.js
CHANGED
|
@@ -33,6 +33,10 @@ class PlaywrightFlowRunner {
|
|
|
33
33
|
}
|
|
34
34
|
for (const [index, step] of flow.steps.entries()) {
|
|
35
35
|
try {
|
|
36
|
+
// Step delay for debugging
|
|
37
|
+
if (options.stepDelay && index > 0) {
|
|
38
|
+
await page.waitForTimeout(options.stepDelay);
|
|
39
|
+
}
|
|
36
40
|
const result = await this.runStep(step, page, options);
|
|
37
41
|
if (!result.success) {
|
|
38
42
|
// Playwright usually throws, but if we catch it:
|
|
@@ -76,7 +80,8 @@ class PlaywrightFlowRunner {
|
|
|
76
80
|
}
|
|
77
81
|
case "type": {
|
|
78
82
|
const locator = await this.resolveLocator(page, step, timeout);
|
|
79
|
-
|
|
83
|
+
// originalText가 실제 값, text는 마스킹된 값
|
|
84
|
+
const rawText = step.originalText || step.text || "";
|
|
80
85
|
const text = this.resolveText(rawText, options.variables);
|
|
81
86
|
await locator.fill(text, { timeout });
|
|
82
87
|
if (step.submit) {
|
|
@@ -245,6 +250,36 @@ class PlaywrightFlowRunner {
|
|
|
245
250
|
}
|
|
246
251
|
break;
|
|
247
252
|
}
|
|
253
|
+
case "keyboard": {
|
|
254
|
+
const key = step.key;
|
|
255
|
+
if (!key) {
|
|
256
|
+
return { success: false, error: "Keyboard step requires key" };
|
|
257
|
+
}
|
|
258
|
+
if (step.locator) {
|
|
259
|
+
const locator = await this.resolveLocator(page, step, timeout);
|
|
260
|
+
await locator.focus({ timeout });
|
|
261
|
+
}
|
|
262
|
+
await page.keyboard.press(key);
|
|
263
|
+
break;
|
|
264
|
+
}
|
|
265
|
+
case "waitForNavigation": {
|
|
266
|
+
const navTimeout = step.timeoutMs || timeout;
|
|
267
|
+
await page.waitForLoadState("domcontentloaded", {
|
|
268
|
+
timeout: navTimeout,
|
|
269
|
+
});
|
|
270
|
+
break;
|
|
271
|
+
}
|
|
272
|
+
case "screenshot": {
|
|
273
|
+
if (step.locator) {
|
|
274
|
+
const locator = await this.resolveLocator(page, step, timeout);
|
|
275
|
+
const buffer = await locator.screenshot({ type: "png" });
|
|
276
|
+
const base64 = buffer.toString("base64");
|
|
277
|
+
return { success: true, extractedData: base64 };
|
|
278
|
+
}
|
|
279
|
+
const buffer = await page.screenshot({ type: "png" });
|
|
280
|
+
const base64 = buffer.toString("base64");
|
|
281
|
+
return { success: true, extractedData: base64 };
|
|
282
|
+
}
|
|
248
283
|
}
|
|
249
284
|
return { success: true };
|
|
250
285
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@auto-wiz/playwright",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.3",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"author": "JaeSang",
|
|
6
6
|
"repository": {
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
}
|
|
24
24
|
},
|
|
25
25
|
"peerDependencies": {
|
|
26
|
-
"@auto-wiz/core": "^1.2.
|
|
26
|
+
"@auto-wiz/core": "^1.2.3"
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
29
|
"playwright": "^1.40.0"
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"devDependencies": {
|
|
32
32
|
"typescript": "^5.0.0",
|
|
33
33
|
"@types/node": "^20.0.0",
|
|
34
|
-
"@auto-wiz/core": "1.2.
|
|
34
|
+
"@auto-wiz/core": "1.2.3"
|
|
35
35
|
},
|
|
36
36
|
"scripts": {
|
|
37
37
|
"build": "tsc"
|