feat(sdk-android): snapshot property delegate + feature-scoped files + screen fix (#34)

* rename web to inspect ui

* feat(sdk-android): add camelToSnakeCase conversion

* feat(sdk-android): add snapshot() property delegate with tests

* feat(folio): add feature-scoped sanderling snapshot objects

* refactor(folio): slim FolioApplication to snapshot object references

* fix(folio): rename route snapshot to screen, update spec.ts
This commit is contained in:
pj authored and GitHub committed 2026-04-22 19:55:45 +07:00
1 parent d5b6f6ccaf
commit 46abb28ed6
51 files changed
+297 -84

No files matched your search

+25
View File
@@ -0,0 +1,25 @@
import type { Run, RunSummary, Step } from "./types";
async function getJson<T>(path: string): Promise<T> {
const response = await fetch(path, { headers: { Accept: "application/json" } });
if (!response.ok) {
throw new Error(`request failed: ${response.status} ${response.statusText} (${path})`);
}
return (await response.json()) as T;
}
export function listRuns(): Promise<RunSummary[]> {
return getJson<RunSummary[]>("/api/runs");
}
export function getRun(runId: string): Promise<Run> {
return getJson<Run>(`/api/runs/${encodeURIComponent(runId)}`);
}
export function getStep(runId: string, index: number): Promise<Step> {
return getJson<Step>(`/api/runs/${encodeURIComponent(runId)}/steps/${index}`);
}
export function screenshotUrl(runId: string, name: string): string {
return `/api/runs/${encodeURIComponent(runId)}/screenshots/${encodeURIComponent(name)}`;
}