autokap 1.3.20 → 1.3.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/dist/browser.js +16 -2
- package/dist/opcode-runner.js +20 -2
- package/package.json +1 -1
package/dist/browser.js
CHANGED
|
@@ -885,11 +885,25 @@ export class Browser {
|
|
|
885
885
|
}
|
|
886
886
|
// Kiosk + zero-position anchor for Xvfb: Chromium normally renders its
|
|
887
887
|
// own toolbar/tabbar in headed mode, which would appear at the top of
|
|
888
|
-
// every clip. `--kiosk` removes
|
|
889
|
-
// `--window-size` make the page fill the
|
|
888
|
+
// every clip. `--kiosk` removes the address bar + tab strip;
|
|
889
|
+
// `--window-position=0,0` and `--window-size` make the page fill the
|
|
890
|
+
// Xvfb screen exactly. The `--disable-features` block kills the
|
|
891
|
+
// separate "infobar" surfaces (translate suggestion, save-password
|
|
892
|
+
// prompt, autofill banner, "Chrome is being controlled by automated
|
|
893
|
+
// software" warning) — these render OUTSIDE kiosk's chrome and would
|
|
894
|
+
// otherwise show up at the top of every clip captured via x11grab.
|
|
895
|
+
// CDP screenshot capture (Mac/Win/local Linux) hits the page surface
|
|
896
|
+
// directly so it never sees these; only ffmpeg x11grab does.
|
|
890
897
|
const xvfbWindowArgs = isLinuxWithGpu ? [
|
|
891
898
|
'--kiosk',
|
|
892
899
|
'--window-position=0,0',
|
|
900
|
+
'--disable-features=Translate,TranslateUI,AutofillServerCommunication,InfoBars',
|
|
901
|
+
'--disable-infobars',
|
|
902
|
+
'--disable-blink-features=AutomationControlled',
|
|
903
|
+
'--disable-translate',
|
|
904
|
+
'--no-default-browser-check',
|
|
905
|
+
'--no-first-run',
|
|
906
|
+
'--noerrdialogs',
|
|
893
907
|
] : [];
|
|
894
908
|
const clipArgs = [
|
|
895
909
|
...baseArgs,
|
package/dist/opcode-runner.js
CHANGED
|
@@ -322,11 +322,29 @@ async function executeOpcode(opcode, index, adapter, verifier, breaker, recovery
|
|
|
322
322
|
return softSkipResult(opcode, index, startTime, reason, telemetry);
|
|
323
323
|
return handleFailure(opcode, index, adapter, verifier, isInteraction, breaker, recoveryChain, telemetry, healerPatches, options, executionState, variantId, currentVariant, startTime, deadlineMs, effectiveTimeoutMs, reason);
|
|
324
324
|
}
|
|
325
|
-
// Verify action had effect (for interaction opcodes)
|
|
325
|
+
// Verify action had effect (for interaction opcodes). The verifier
|
|
326
|
+
// catches silent failures: e.g. CLICK on a stale selector that found
|
|
327
|
+
// nothing and the page-state-passing postcondition is coincidentally
|
|
328
|
+
// satisfied by an unrelated state. For most interactions, no DOM
|
|
329
|
+
// change after the action means the action didn't really happen.
|
|
330
|
+
//
|
|
331
|
+
// PRESS_KEY is the exception. Keys are CONDITIONAL by nature: Escape
|
|
332
|
+
// is a no-op when no modal is open; Enter is a no-op when no form is
|
|
333
|
+
// focused; Tab is a no-op when no focusable target exists. A preset
|
|
334
|
+
// may legitimately script PRESS_KEY against a page that has already
|
|
335
|
+
// reached the target state via earlier opcodes (e.g. SLEEP let an
|
|
336
|
+
// auto-close timer run). The postcondition has already passed by this
|
|
337
|
+
// point — trust it for PRESS_KEY and skip the no-effect penalty.
|
|
326
338
|
if (isInteraction) {
|
|
327
339
|
const verification = await verifier.verifyAfterAction(adapter);
|
|
328
340
|
if (!verification.hadEffect && opcode.postcondition.type !== 'always' && opcode.postcondition.type !== 'any_change') {
|
|
329
|
-
|
|
341
|
+
if (opcode.kind === 'PRESS_KEY') {
|
|
342
|
+
logger.debug(`[opcode ${index}] PRESS_KEY had no DOM effect (${verification.summary}) — ` +
|
|
343
|
+
`postcondition passed, treating as redundant-but-successful`);
|
|
344
|
+
}
|
|
345
|
+
else {
|
|
346
|
+
return handleFailure(opcode, index, adapter, verifier, isInteraction, breaker, recoveryChain, telemetry, healerPatches, options, executionState, variantId, currentVariant, startTime, deadlineMs, effectiveTimeoutMs, `action had no effect: ${verification.summary}`);
|
|
347
|
+
}
|
|
330
348
|
}
|
|
331
349
|
}
|
|
332
350
|
// Record successful mock data application
|