style: oxfmt
This commit is contained in:
@@ -350,13 +350,9 @@ export function createBrowserTool(opts?: {
|
|||||||
throw new Error("request required");
|
throw new Error("request required");
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
const result = await browserAct(
|
const result = await browserAct(baseUrl, request as Parameters<typeof browserAct>[1], {
|
||||||
baseUrl,
|
profile,
|
||||||
request as Parameters<typeof browserAct>[1],
|
});
|
||||||
{
|
|
||||||
profile,
|
|
||||||
},
|
|
||||||
);
|
|
||||||
return jsonResult(result);
|
return jsonResult(result);
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
const msg = String(err);
|
const msg = String(err);
|
||||||
@@ -364,7 +360,7 @@ export function createBrowserTool(opts?: {
|
|||||||
const tabs = await browserTabs(baseUrl, { profile }).catch(() => []);
|
const tabs = await browserTabs(baseUrl, { profile }).catch(() => []);
|
||||||
if (!tabs.length) {
|
if (!tabs.length) {
|
||||||
throw new Error(
|
throw new Error(
|
||||||
'No Chrome tabs are attached via the Clawdbot Browser Relay extension. Click the toolbar icon on the tab you want to control (badge ON), then retry.',
|
"No Chrome tabs are attached via the Clawdbot Browser Relay extension. Click the toolbar icon on the tab you want to control (badge ON), then retry.",
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
throw new Error(
|
throw new Error(
|
||||||
|
|||||||
@@ -71,7 +71,7 @@ describe("pw-role-snapshot", () => {
|
|||||||
|
|
||||||
it("preserves Playwright aria-ref ids in ai snapshots", () => {
|
it("preserves Playwright aria-ref ids in ai snapshots", () => {
|
||||||
const ai = [
|
const ai = [
|
||||||
'- navigation [ref=e1]:',
|
"- navigation [ref=e1]:",
|
||||||
' - link "Home" [ref=e5]',
|
' - link "Home" [ref=e5]',
|
||||||
' - heading "Title" [ref=e6]',
|
' - heading "Title" [ref=e6]',
|
||||||
' - button "Save" [ref=e7] [cursor=pointer]:',
|
' - button "Save" [ref=e7] [cursor=pointer]:',
|
||||||
@@ -79,7 +79,7 @@ describe("pw-role-snapshot", () => {
|
|||||||
].join("\n");
|
].join("\n");
|
||||||
|
|
||||||
const res = buildRoleSnapshotFromAiSnapshot(ai, { interactive: true });
|
const res = buildRoleSnapshotFromAiSnapshot(ai, { interactive: true });
|
||||||
expect(res.snapshot).toContain('[ref=e5]');
|
expect(res.snapshot).toContain("[ref=e5]");
|
||||||
expect(res.snapshot).toContain('- link "Home"');
|
expect(res.snapshot).toContain('- link "Home"');
|
||||||
expect(res.snapshot).toContain('- button "Save"');
|
expect(res.snapshot).toContain('- button "Save"');
|
||||||
expect(res.snapshot).not.toContain("navigation");
|
expect(res.snapshot).not.toContain("navigation");
|
||||||
|
|||||||
Reference in New Issue
Block a user