@decocms/parity 0.17.5 → 0.17.6
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/cli.js +38 -11
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -38632,21 +38632,26 @@ var VIEWPORT_PRESETS = {
|
|
|
38632
38632
|
}
|
|
38633
38633
|
};
|
|
38634
38634
|
async function launchBrowser(opts = {}) {
|
|
38635
|
-
const doLaunch = () =>
|
|
38636
|
-
|
|
38637
|
-
|
|
38638
|
-
|
|
38639
|
-
|
|
38640
|
-
|
|
38641
|
-
|
|
38642
|
-
|
|
38643
|
-
|
|
38644
|
-
|
|
38635
|
+
const doLaunch = () => Promise.race([
|
|
38636
|
+
chromium.launch({
|
|
38637
|
+
headless: opts.headless ?? true,
|
|
38638
|
+
slowMo: opts.slowMo ?? 0,
|
|
38639
|
+
timeout: 30000,
|
|
38640
|
+
args: [
|
|
38641
|
+
"--disable-blink-features=AutomationControlled",
|
|
38642
|
+
"--no-sandbox",
|
|
38643
|
+
"--disable-setuid-sandbox",
|
|
38644
|
+
"--disable-gpu",
|
|
38645
|
+
"--no-zygote"
|
|
38646
|
+
]
|
|
38647
|
+
}),
|
|
38648
|
+
new Promise((_, reject) => setTimeout(() => reject(new Error("Chromium launch timeout (35 s)")), 35000))
|
|
38649
|
+
]);
|
|
38645
38650
|
try {
|
|
38646
38651
|
return await doLaunch();
|
|
38647
38652
|
} catch (err) {
|
|
38648
38653
|
const msg = err.message ?? "";
|
|
38649
|
-
if (msg.includes("Timeout") || msg.includes("timed out")) {
|
|
38654
|
+
if (msg.includes("Timeout") || msg.includes("timed out") || msg.includes("Chromium launch timeout")) {
|
|
38650
38655
|
throw new Error([
|
|
38651
38656
|
"Chromium timed out while launching (30 s).",
|
|
38652
38657
|
"On macOS, try reinstalling the browser binaries:",
|
|
@@ -52282,6 +52287,10 @@ async function flowPurchaseJourney(ctx) {
|
|
|
52282
52287
|
}
|
|
52283
52288
|
const spBefore9 = screenshotPath(ctx, "pj-9-checkout-before");
|
|
52284
52289
|
await screenshotStable(page, { path: spBefore9, fullPage: false });
|
|
52290
|
+
await Promise.race([
|
|
52291
|
+
dismissOverlays(page, ctx),
|
|
52292
|
+
new Promise((resolve) => setTimeout(resolve, 4000))
|
|
52293
|
+
]);
|
|
52285
52294
|
let usedSelector = checkoutHit.selector;
|
|
52286
52295
|
let clickedText = await checkoutHit.locator.innerText().catch(() => "");
|
|
52287
52296
|
let reachedCheckout = false;
|
|
@@ -52301,6 +52310,24 @@ async function flowPurchaseJourney(ctx) {
|
|
|
52301
52310
|
reachedCheckout = /\/(checkout|carrinho)(\/|$|\?)/i.test(page.url());
|
|
52302
52311
|
if (reachedCheckout)
|
|
52303
52312
|
break;
|
|
52313
|
+
if (checkoutHit) {
|
|
52314
|
+
const blocker = await dismissBlockingOverlay(page, ctx, checkoutHit.locator);
|
|
52315
|
+
if (blocker?.dismissed) {
|
|
52316
|
+
dlog2(ctx, `step 9 go-checkout: cleared blocking overlay (${blocker.method}) — retrying click`);
|
|
52317
|
+
await Promise.all([
|
|
52318
|
+
page.waitForURL(/\/(checkout|carrinho)/i, { timeout: 1e4 }).catch(() => {
|
|
52319
|
+
return;
|
|
52320
|
+
}),
|
|
52321
|
+
checkoutHit.locator.click({ timeout: 5000 }).catch(() => {
|
|
52322
|
+
return;
|
|
52323
|
+
})
|
|
52324
|
+
]);
|
|
52325
|
+
await page.waitForTimeout(1500);
|
|
52326
|
+
reachedCheckout = /\/(checkout|carrinho)(\/|$|\?)/i.test(page.url());
|
|
52327
|
+
if (reachedCheckout)
|
|
52328
|
+
break;
|
|
52329
|
+
}
|
|
52330
|
+
}
|
|
52304
52331
|
if (budget.remaining <= 0)
|
|
52305
52332
|
break;
|
|
52306
52333
|
dlog2(ctx, `step 9 go-checkout: click on \`${usedSelector}\` didn't navigate (attempt ${attempt}). URL still ${page.url()}. Asking LLM for another selector.`);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@decocms/parity",
|
|
3
|
-
"version": "0.17.
|
|
3
|
+
"version": "0.17.6",
|
|
4
4
|
"description": "E2E parity validator for site migrations. Compares prod vs cand and reports UI, functional, SEO, visual, and Web Vitals deltas with an LLM-ranked HTML report.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|