Remove REA permission grants, scope ceilings, approval confirmations, and inert settings. Preserve selected local evidence, accept caller-chosen commands and paths, and report actual runtime failures. Harden provider results, schema serialization, snapshot evidence binding, archive paths, source maps, native screenshots, managed EH parsing, and cancellation cleanup. Regenerate tool metadata and document direct invocation. BREAKING CHANGE: Removed permission configuration and policy commands, approval fields, filesystem scope inputs, and fixed confirmation options. Process capture inherits the host environment and accepts command names; callers must refresh tool schemas and migrate removed fields.
40 lines
1.3 KiB
TypeScript
40 lines
1.3 KiB
TypeScript
import { expect, it } from "vitest";
|
|
import type { Page } from "playwright-core";
|
|
|
|
import { BrowserScenarioSecrets } from "./BrowserScenarioSecrets.js";
|
|
import { performPlaywrightScenarioAction } from "./PlaywrightScenarioActions.js";
|
|
import { browserScenarioSchema } from "../domain/browserScenario.js";
|
|
|
|
it("uses exact accessible-name matching without a caller confirmation field", async () => {
|
|
const scenario = browserScenarioSchema.parse({
|
|
browser: { mode: "launch", executable_path: "chrome" },
|
|
start_url: { url: "https://app.example.test/" },
|
|
actions: [
|
|
{
|
|
step_id: "submit",
|
|
action: "click",
|
|
locator: { kind: "role", role: "button", name: "Submit" },
|
|
},
|
|
],
|
|
});
|
|
const calls: unknown[][] = [];
|
|
const page = {
|
|
getByRole: (...args: unknown[]) => {
|
|
calls.push(args);
|
|
return { click: async () => undefined };
|
|
},
|
|
} as unknown as Page;
|
|
const secrets = BrowserScenarioSecrets.resolve(scenario, {});
|
|
if (secrets === undefined) throw new Error("No secret declarations expected");
|
|
const action = scenario.actions.at(0);
|
|
if (action === undefined) throw new Error("Expected one scenario action");
|
|
|
|
await performPlaywrightScenarioAction({
|
|
page,
|
|
action,
|
|
secrets,
|
|
});
|
|
|
|
expect(calls).toEqual([["button", { name: "Submit", exact: true }]]);
|
|
});
|