skopix 2.0.21 → 2.0.22
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/cli/commands/agent.js +12 -0
- package/package.json +1 -1
package/cli/commands/agent.js
CHANGED
|
@@ -254,6 +254,14 @@ export async function agentCommand(options) {
|
|
|
254
254
|
deviceScaleFactor: 1,
|
|
255
255
|
...(wantReport ? { recordVideo: { dir: sessionDir, size: { width: 1280, height: 800 } } } : {}),
|
|
256
256
|
});
|
|
257
|
+
// Set zoom via initScript so it persists across page loads and route changes
|
|
258
|
+
if (browserZoom !== 1) {
|
|
259
|
+
await ctx.addInitScript((zoom) => {
|
|
260
|
+
const applyZ = () => { if (document.documentElement) document.documentElement.style.zoom = zoom; };
|
|
261
|
+
applyZ();
|
|
262
|
+
document.addEventListener('DOMContentLoaded', applyZ);
|
|
263
|
+
}, String(browserZoom));
|
|
264
|
+
}
|
|
257
265
|
const page = await ctx.newPage();
|
|
258
266
|
const applyZoom = async () => {
|
|
259
267
|
if (browserZoom !== 1) {
|
|
@@ -272,6 +280,9 @@ export async function agentCommand(options) {
|
|
|
272
280
|
// Apply zoom now if no setup test (otherwise applied at setup→main transition)
|
|
273
281
|
if (!setupTest) await applyZoom();
|
|
274
282
|
|
|
283
|
+
// Listen for future navigations and re-apply zoom
|
|
284
|
+
page.on('load', () => { applyZoom().catch(() => {}); });
|
|
285
|
+
|
|
275
286
|
send({ type: 'stdout', text: '◆ Replaying ' + allSteps.length + ' steps on ' + os.hostname() });
|
|
276
287
|
|
|
277
288
|
for (const step of allSteps) {
|
|
@@ -358,6 +369,7 @@ export async function agentCommand(options) {
|
|
|
358
369
|
try { const ro = new URL(navUrl).origin; const to = new URL(test.url).origin; if (ro !== to) navUrl = navUrl.replace(ro, to); } catch {}
|
|
359
370
|
}
|
|
360
371
|
await page.goto(navUrl, { waitUntil: 'domcontentloaded', timeout: 15000 });
|
|
372
|
+
await applyZoom();
|
|
361
373
|
await page.waitForTimeout(800);
|
|
362
374
|
|
|
363
375
|
} else if (step.action === 'click') {
|
package/package.json
CHANGED