Add Part chapter with verified boolean and geometry captures
Co-Authored-By: Claude Code <noreply@anthropic.com>
This commit is contained in:
@@ -59,6 +59,7 @@ async function runOnce() {
|
||||
}
|
||||
if (action.nth !== undefined) locator = locator.nth(action.nth);
|
||||
else if (!action.all) locator = locator.first();
|
||||
if (action.optional && (await locator.count()) === 0) return;
|
||||
if (action.all) {
|
||||
const count = await locator.count();
|
||||
for (let index = 0; index < count; index++) await locator.nth(index).click();
|
||||
@@ -150,6 +151,12 @@ async function runOnce() {
|
||||
await page.locator(action.selector).first().waitFor({ state: "visible", timeout: 30000 });
|
||||
record({ action: "assertVisible", selector: action.selector });
|
||||
break;
|
||||
case "assertValue": {
|
||||
const value = await page.locator(action.selector).first().inputValue();
|
||||
if (String(value) !== String(action.value)) throw new Error(`assertValue failed: ${action.selector} ${value} != ${action.value}`);
|
||||
record({ action: "assertValue", selector: action.selector, value });
|
||||
break;
|
||||
}
|
||||
case "wait": await page.waitForTimeout(action.ms ?? 500); break;
|
||||
default: throw new Error(`unknown action ${action.type}`);
|
||||
}
|
||||
|
||||
@@ -22,6 +22,8 @@ for (const viewport of [{ width: 1440, height: 900 }, { width: 390, height: 844
|
||||
page.on("response", response => { if (response.status() >= 400) failed.push(`${response.status()} ${response.url()}`); });
|
||||
const response = await page.goto(url, { waitUntil: "load", timeout: 120000 });
|
||||
await page.waitForTimeout(800);
|
||||
await page.evaluate(() => { for (const image of document.images) image.loading = "eager"; });
|
||||
await page.waitForTimeout(1500);
|
||||
const metrics = await page.evaluate(() => {
|
||||
const images = [...document.images];
|
||||
return {
|
||||
|
||||
Reference in New Issue
Block a user