feat(native): add inspection primitives, dispatch traces and approved UI observation (#500)
* fix(hopper): normalize string-backed addresses and update verification * feat(native): add inspection primitives, dispatch traces and approved UI observation * test: prioritize real artifact E2E and captured golden regressions * fix(process): queue observed output before reactive rendering actions * test: prune redundant cases and strengthen boundary assertions * fix(cli): route native value tracing through shared workflows * test: replace synthetic success with real workflows and captured data * fix(catalog): separate portable metadata from native host availability
This commit is contained in:
@@ -9,21 +9,6 @@ import { startFakeCdpBrowser } from "../../fixtures/fakeCdpBrowser.js";
|
||||
import { describeBrowser, trackBrowser } from "./cdpBrowserProvider.support.js";
|
||||
|
||||
describeBrowser("CdpBrowserProvider: discovery authorization 1", () => {
|
||||
it("returns every approved page target inline", async () => {
|
||||
const browser = await startFakeCdpBrowser({ additionalPageCount: 205 });
|
||||
trackBrowser(browser);
|
||||
const listed = await new CdpBrowserProvider().listTargets(
|
||||
listBrowserTargetsInputSchema.parse({
|
||||
cdp_endpoint: browser.endpoint,
|
||||
allowed_origins: [browser.allowedOrigin],
|
||||
}),
|
||||
);
|
||||
if (!listed.ok) throw listed.error;
|
||||
expect(listed.value.targets).toHaveLength(206);
|
||||
expect(listed.value.targets[0]?.target_id).toBe("allowed-page");
|
||||
expect(listed.value.targets.at(-1)?.target_id).toBe("allowed-page-0204");
|
||||
});
|
||||
|
||||
it("lists only exact-origin pages and sanitizes URLs", async () => {
|
||||
const browser = await startFakeCdpBrowser();
|
||||
trackBrowser(browser);
|
||||
|
||||
@@ -390,31 +390,6 @@ describeBrowser("CdpBrowserProvider: document script 3", () => {
|
||||
},
|
||||
});
|
||||
});
|
||||
|
||||
it("returns every DOM node and complete approved script source", async () => {
|
||||
const browser = await startFakeCdpBrowser();
|
||||
trackBrowser(browser);
|
||||
const request = inspectWebPageInputSchema.parse({
|
||||
cdp_endpoint: browser.endpoint,
|
||||
allowed_origins: [browser.allowedOrigin],
|
||||
target_id: "allowed-page",
|
||||
observation_ms: 0,
|
||||
include_script_sources: true,
|
||||
});
|
||||
const result = await new CdpBrowserProvider().inspectPage(request);
|
||||
if (!result.ok) throw result.error;
|
||||
expect(result.value.completeness.truncated_sections).not.toContain(
|
||||
"script_sources",
|
||||
);
|
||||
expect(result.value.dom).toMatchObject({ total_nodes: 2 });
|
||||
expect(result.value.dom.nodes).toHaveLength(2);
|
||||
expect(result.value.scripts.items[0]?.source).toMatchObject({
|
||||
included: true,
|
||||
});
|
||||
expect(browser.commands.map(({ method }) => method)).toContain(
|
||||
"Debugger.getScriptSource",
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
describeBrowser("CdpBrowserProvider: document script 4", () => {
|
||||
|
||||
@@ -106,10 +106,9 @@ describe("passive V8 Inspector provider", () => {
|
||||
origin: null,
|
||||
},
|
||||
]);
|
||||
expect(fake.commands.map(({ method }) => method)).toEqual([
|
||||
"Runtime.enable",
|
||||
"Debugger.enable",
|
||||
]);
|
||||
expect(new Set(fake.commands.map(({ method }) => method))).toEqual(
|
||||
new Set(["Runtime.enable", "Debugger.enable"]),
|
||||
);
|
||||
expect(JSON.stringify(result.value)).toContain(outside);
|
||||
expect(result.value.unavailable_without_instrumentation).toContain(
|
||||
"Electron IPC messages and handlers",
|
||||
|
||||
Reference in New Issue
Block a user