skopix 2.0.13 → 2.0.15
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 +16 -6
- package/cli/commands/dashboard.js +14 -6
- package/package.json +1 -1
package/cli/commands/agent.js
CHANGED
|
@@ -248,16 +248,18 @@ export async function agentCommand(options) {
|
|
|
248
248
|
|
|
249
249
|
const browser = await chromium.launch({ headless: test.headless || false, args: ['--no-sandbox'] });
|
|
250
250
|
const wantReport = test.generateReport !== false;
|
|
251
|
-
const browserZoom = test.browserZoom ||
|
|
251
|
+
const browserZoom = test.browserZoom || 1;
|
|
252
252
|
const ctx = await browser.newContext({
|
|
253
|
-
viewport: { width:
|
|
253
|
+
viewport: { width: 1280, height: 800 },
|
|
254
254
|
deviceScaleFactor: 1,
|
|
255
|
-
...(wantReport ? { recordVideo: { dir: sessionDir, size: { width:
|
|
255
|
+
...(wantReport ? { recordVideo: { dir: sessionDir, size: { width: 1280, height: 800 } } } : {}),
|
|
256
256
|
});
|
|
257
257
|
const page = await ctx.newPage();
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
258
|
+
const applyZoom = async () => {
|
|
259
|
+
if (browserZoom !== 1) {
|
|
260
|
+
await page.evaluate((z) => { document.documentElement.style.zoom = z; }, String(browserZoom)).catch(() => {});
|
|
261
|
+
}
|
|
262
|
+
};
|
|
261
263
|
|
|
262
264
|
const allSteps = [...(setupTest ? (setupTest.steps || []) : []), ...(test.steps || [])];
|
|
263
265
|
let stepNum = 0, passed = true, failReason = '';
|
|
@@ -267,12 +269,20 @@ export async function agentCommand(options) {
|
|
|
267
269
|
await page.waitForTimeout(800);
|
|
268
270
|
}
|
|
269
271
|
|
|
272
|
+
// Apply zoom now if no setup test (otherwise applied at setup→main transition)
|
|
273
|
+
if (!setupTest) await applyZoom();
|
|
274
|
+
|
|
270
275
|
send({ type: 'stdout', text: '◆ Replaying ' + allSteps.length + ' steps on ' + os.hostname() });
|
|
271
276
|
|
|
272
277
|
for (const step of allSteps) {
|
|
273
278
|
stepNum++;
|
|
274
279
|
const sel = sanitiseSelector(step.stableSelector || step.selector);
|
|
275
280
|
const isSetup = setupTest && stepNum <= (setupTest.steps || []).length;
|
|
281
|
+
const isFirstMainStep = setupTest && stepNum === (setupTest.steps || []).length + 1;
|
|
282
|
+
|
|
283
|
+
// Apply zoom at the transition from setup to main test steps
|
|
284
|
+
if (isFirstMainStep) await applyZoom();
|
|
285
|
+
|
|
276
286
|
const desc = step.description || (step.action + ' ' + (sel || ''));
|
|
277
287
|
send({ type: 'stdout', text: ' [' + stepNum + '/' + allSteps.length + '] ' + step.action.toUpperCase() + (isSetup ? ' [SETUP]' : '') + ' — ' + desc });
|
|
278
288
|
|
|
@@ -2503,6 +2503,8 @@ function cleanTest(t) {
|
|
|
2503
2503
|
if (t.jira) out.jira = true;
|
|
2504
2504
|
if (t.linear) out.linear = true;
|
|
2505
2505
|
if (t.headless) out.headless = true;
|
|
2506
|
+
if (t.generateReport === false) out.generateReport = false;
|
|
2507
|
+
if (t.browserZoom && t.browserZoom !== 1) out.browserZoom = t.browserZoom;
|
|
2506
2508
|
return out;
|
|
2507
2509
|
}
|
|
2508
2510
|
|
|
@@ -3077,17 +3079,20 @@ function startReplay(test, setupTest, activeRuns, reportsDir, currentUser, env)
|
|
|
3077
3079
|
});
|
|
3078
3080
|
|
|
3079
3081
|
const wantReport = test.generateReport !== false;
|
|
3080
|
-
const browserZoom = test.browserZoom ||
|
|
3082
|
+
const browserZoom = test.browserZoom || 1;
|
|
3081
3083
|
|
|
3082
3084
|
const ctx = await chromiumBrowser.newContext({
|
|
3083
|
-
viewport: { width:
|
|
3085
|
+
viewport: { width: 1280, height: 800 },
|
|
3084
3086
|
deviceScaleFactor: 1,
|
|
3085
|
-
...(wantReport ? { recordVideo: { dir: sessionDir, size: { width:
|
|
3087
|
+
...(wantReport ? { recordVideo: { dir: sessionDir, size: { width: 1280, height: 800 } } } : {}),
|
|
3086
3088
|
});
|
|
3087
3089
|
const page = await ctx.newPage();
|
|
3088
|
-
|
|
3089
|
-
|
|
3090
|
-
|
|
3090
|
+
// Apply zoom after page loads, not via addInitScript (which affects setup steps too)
|
|
3091
|
+
const applyZoom = async () => {
|
|
3092
|
+
if (browserZoom !== 1) {
|
|
3093
|
+
await page.evaluate((z) => { document.documentElement.style.zoom = z; }, String(browserZoom)).catch(() => {});
|
|
3094
|
+
}
|
|
3095
|
+
};
|
|
3091
3096
|
|
|
3092
3097
|
// Navigate to start URL
|
|
3093
3098
|
if (test.url) {
|
|
@@ -3109,6 +3114,9 @@ function startReplay(test, setupTest, activeRuns, reportsDir, currentUser, env)
|
|
|
3109
3114
|
broadcast({ type: 'stdout', text: ' \u2714 Setup complete — continuing with test steps' });
|
|
3110
3115
|
}
|
|
3111
3116
|
|
|
3117
|
+
// Apply zoom now (after setup, before main test steps)
|
|
3118
|
+
await applyZoom();
|
|
3119
|
+
|
|
3112
3120
|
// Run main test steps
|
|
3113
3121
|
if (setupTest) { broadcast({ type: 'stdout', text: '' }); broadcast({ type: 'stdout', text: ' ─── TEST: ' + test.name + ' ───' }); }
|
|
3114
3122
|
await executeSteps(test.steps, page, null);
|
package/package.json
CHANGED