docs(alpha): simplify native setup and verify generic starter creation
This commit is contained in:
@@ -246,7 +246,9 @@ export async function launchChrome({ width = 1440, height = 900, chromePath } =
|
||||
return api.evaluate(`(() => {
|
||||
const el = document.querySelector(${JSON.stringify(selector)});
|
||||
if (!el) return null;
|
||||
el.scrollIntoView({ block: "center", inline: "center" });
|
||||
// CSS smooth scrolling is asynchronous; measuring immediately after
|
||||
// it can click outside the viewport instead of the target control.
|
||||
el.scrollIntoView({ block: "center", inline: "center", behavior: "instant" });
|
||||
const r = el.getBoundingClientRect();
|
||||
return { x: r.x + r.width / 2, y: r.y + r.height / 2 };
|
||||
})()`);
|
||||
@@ -267,7 +269,7 @@ export async function launchChrome({ width = 1440, height = 900, chromePath } =
|
||||
const all = [...document.querySelectorAll(${JSON.stringify(selector)})];
|
||||
const el = all.find((node) => (node.textContent ?? "").includes(wanted));
|
||||
if (!el) return false;
|
||||
el.scrollIntoView({ block: "center" });
|
||||
el.scrollIntoView({ block: "center", behavior: "instant" });
|
||||
el.setAttribute("data-test-click", "1");
|
||||
return true;
|
||||
})()`);
|
||||
|
||||
Reference in New Issue
Block a user