@decocms/parity 0.17.4 → 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 +46 -5
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -38632,15 +38632,34 @@ var VIEWPORT_PRESETS = {
|
|
|
38632
38632
|
}
|
|
38633
38633
|
};
|
|
38634
38634
|
async function launchBrowser(opts = {}) {
|
|
38635
|
-
const doLaunch = () =>
|
|
38636
|
-
|
|
38637
|
-
|
|
38638
|
-
|
|
38639
|
-
|
|
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
|
+
]);
|
|
38640
38650
|
try {
|
|
38641
38651
|
return await doLaunch();
|
|
38642
38652
|
} catch (err) {
|
|
38643
38653
|
const msg = err.message ?? "";
|
|
38654
|
+
if (msg.includes("Timeout") || msg.includes("timed out") || msg.includes("Chromium launch timeout")) {
|
|
38655
|
+
throw new Error([
|
|
38656
|
+
"Chromium timed out while launching (30 s).",
|
|
38657
|
+
"On macOS, try reinstalling the browser binaries:",
|
|
38658
|
+
" npx playwright install chromium chromium-headless-shell",
|
|
38659
|
+
"Or set PARITY_SKIP_PLAYWRIGHT_INSTALL=1 and install manually."
|
|
38660
|
+
].join(`
|
|
38661
|
+
`));
|
|
38662
|
+
}
|
|
38644
38663
|
if (!msg.includes("Executable doesn't exist"))
|
|
38645
38664
|
throw err;
|
|
38646
38665
|
if (process.env.PARITY_SKIP_PLAYWRIGHT_INSTALL === "1") {
|
|
@@ -52268,6 +52287,10 @@ async function flowPurchaseJourney(ctx) {
|
|
|
52268
52287
|
}
|
|
52269
52288
|
const spBefore9 = screenshotPath(ctx, "pj-9-checkout-before");
|
|
52270
52289
|
await screenshotStable(page, { path: spBefore9, fullPage: false });
|
|
52290
|
+
await Promise.race([
|
|
52291
|
+
dismissOverlays(page, ctx),
|
|
52292
|
+
new Promise((resolve) => setTimeout(resolve, 4000))
|
|
52293
|
+
]);
|
|
52271
52294
|
let usedSelector = checkoutHit.selector;
|
|
52272
52295
|
let clickedText = await checkoutHit.locator.innerText().catch(() => "");
|
|
52273
52296
|
let reachedCheckout = false;
|
|
@@ -52287,6 +52310,24 @@ async function flowPurchaseJourney(ctx) {
|
|
|
52287
52310
|
reachedCheckout = /\/(checkout|carrinho)(\/|$|\?)/i.test(page.url());
|
|
52288
52311
|
if (reachedCheckout)
|
|
52289
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
|
+
}
|
|
52290
52331
|
if (budget.remaining <= 0)
|
|
52291
52332
|
break;
|
|
52292
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",
|