@crvouga/atlas 1.13.0 → 1.15.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +14 -1
- package/dist/playwright/src/index.d.ts +4 -0
- package/dist/playwright/src/index.js +4 -0
- package/dist/playwright/src/ui-catalog.d.ts +51 -0
- package/dist/playwright/src/ui-catalog.js +44 -0
- package/dist/reports/src/evidence-detail.d.ts +19 -0
- package/dist/reports/src/evidence-detail.js +31 -4
- package/dist/reports/src/evidence-types.d.ts +5 -2
- package/dist/reports/src/layer-merge.d.ts +5 -1
- package/dist/reports/src/layer-merge.js +13 -5
- package/dist/reports/src/layer-store.d.ts +1 -1
- package/dist/reports/src/layer-store.js +4 -2
- package/dist/reports/src/layer-types.d.ts +2 -0
- package/dist/reports/src/report-index.js +9 -5
- package/dist/reports/src/run-compare.d.ts +182 -0
- package/dist/reports/src/run-compare.js +329 -0
- package/dist/reports/src/test-catalog.d.ts +8 -0
- package/dist/reports/src/test-catalog.js +14 -1
- package/dist/reports/src/ui-catalog-publish.d.ts +92 -0
- package/dist/reports/src/ui-catalog-publish.js +68 -0
- package/dist/reports/src/ui-catalog.d.ts +229 -0
- package/dist/reports/src/ui-catalog.js +273 -0
- package/dist/reports/src/ui-state.d.ts +70 -0
- package/dist/reports/src/ui-state.js +66 -0
- package/dist/schema/src/api.d.ts +354 -0
- package/dist/schema/src/api.js +78 -3
- package/dist/server/src/app.js +15 -0
- package/dist/server/src/openapi.js +22 -2
- package/docs/reference/http-api.md +46 -0
- package/docs/reference/playwright.md +63 -0
- package/docs/reference/reports.md +942 -4
- package/docs/reference/schema.md +33 -0
- package/docs/report-contract.md +2 -2
- package/docs/rich-evidence.md +5 -0
- package/docs/server.md +2 -0
- package/docs/ui-catalog.md +173 -0
- package/docs/ui.md +45 -1
- package/llms-full.txt +276 -3
- package/llms.txt +1 -0
- package/package.json +2 -1
- package/packages/schema/schemas/effective-delta.schema.json +75 -2
- package/packages/schema/schemas/effective-evidence.schema.json +75 -2
- package/packages/schema/schemas/evidence-page.schema.json +1 -1
- package/packages/schema/schemas/layer-rows.schema.json +74 -1
- package/packages/schema/schemas/report-run.schema.json +25 -3
- package/packages/schema/schemas/report-runs.schema.json +1 -1
- package/packages/schema/schemas/review-collection.schema.json +1 -1
- package/packages/schema/schemas/review-manifest.schema.json +1 -1
- package/packages/schema/schemas/test-catalog.schema.json +1 -1
- package/packages/schema/schemas/test-history.schema.json +2 -2
- package/packages/server/openapi.json +1559 -175
- package/packages/visualizer/src/app/AppShell.tsx +36 -30
- package/packages/visualizer/src/app/router.tsx +10 -1
- package/packages/visualizer/src/catalog/UiCatalogFilters.tsx +65 -0
- package/packages/visualizer/src/catalog/UiCatalogPage.tsx +342 -0
- package/packages/visualizer/src/catalog/provider.tsx +25 -0
- package/packages/visualizer/src/catalog/search.ts +68 -0
- package/packages/visualizer/src/catalog/words.ts +26 -0
- package/packages/visualizer/src/components/Header.tsx +17 -4
- package/packages/visualizer/src/explorer/ComparePair.tsx +597 -0
- package/packages/visualizer/src/explorer/CompareView.tsx +340 -0
- package/packages/visualizer/src/explorer/Explorer.tsx +6 -2
- package/packages/visualizer/src/explorer/RunsView.tsx +10 -0
- package/packages/visualizer/src/explorer/playlist.tsx +1 -1
- package/packages/visualizer/src/explorer/search.ts +15 -3
|
@@ -104,7 +104,10 @@ recognise screens and tap or type (`screen`, `recognize`, `locate`, the signal c
|
|
|
104
104
|
the media tools (`captureScreen`, `ScreencastRecorder`, `ffmpeg`, `PHONE` and the pacing presets). Needs the
|
|
105
105
|
`playwright` package; clips and thumbnails need FFmpeg on the PATH.
|
|
106
106
|
|
|
107
|
+
Also `captureUiState`, the optional Playwright adapter of the UI catalog (it needs no Playwright import itself).
|
|
108
|
+
|
|
107
109
|
See docs/statecharts.md
|
|
110
|
+
See docs/ui-catalog.md
|
|
108
111
|
|
|
109
112
|
### Playwright screenshots, clips and paced actions
|
|
110
113
|
|
|
@@ -301,3 +304,63 @@ const states = {
|
|
|
301
304
|
'No todos': screen({ all: [text('Nothing to do yet')], none: [role('listitem')] })
|
|
302
305
|
};
|
|
303
306
|
```
|
|
307
|
+
|
|
308
|
+
### Playwright adapter for the UI catalog
|
|
309
|
+
|
|
310
|
+
Source: `packages/playwright/src/ui-catalog.ts`
|
|
311
|
+
|
|
312
|
+
The optional Playwright side of the UI catalog: take a page to a state, wait until it is ready, photograph it, and hand the
|
|
313
|
+
result to `uiStateLayer` (`@crvouga/atlas/reports/ui-catalog-publish`) as a capture. This is the only Playwright-specific code
|
|
314
|
+
of the feature; reading, composing and exploring the catalog know nothing about it, and any other program that writes the
|
|
315
|
+
same layer produces the same catalog. The page is typed by the three methods used, so no `playwright` import is needed here
|
|
316
|
+
and a Playwright Test `page`, a `Page` of the driver, or a stub all fit.
|
|
317
|
+
|
|
318
|
+
See docs/ui-catalog.md
|
|
319
|
+
|
|
320
|
+
#### `CapturePage`
|
|
321
|
+
|
|
322
|
+
```ts
|
|
323
|
+
export type CapturePage = {
|
|
324
|
+
screenshot(options?: { readonly fullPage?: boolean; readonly animations?: 'disabled' | 'allow'; readonly type?: 'png' }): Promise<Uint8Array>;
|
|
325
|
+
viewportSize(): { readonly width: number; readonly height: number } | null;
|
|
326
|
+
};
|
|
327
|
+
```
|
|
328
|
+
|
|
329
|
+
The part of a Playwright `Page` that capturing uses.
|
|
330
|
+
|
|
331
|
+
#### `CaptureUiStateOptions`
|
|
332
|
+
|
|
333
|
+
```ts
|
|
334
|
+
export type CaptureUiStateOptions = UiStateFacts & {
|
|
335
|
+
/** The state's stable id: how a later capture replaces this one. */
|
|
336
|
+
readonly id: string;
|
|
337
|
+
readonly title?: string;
|
|
338
|
+
/** Resolves when the page shows the state (a locator is visible, the network is idle). A rejection or a timeout makes the capture `failed`, with the reason as its detail. */
|
|
339
|
+
readonly ready?: (page: CapturePage) => Promise<void>;
|
|
340
|
+
/** How long to wait for `ready`; default 15 seconds. */
|
|
341
|
+
readonly readyTimeoutMs?: number;
|
|
342
|
+
/** Photograph the whole scrollable page rather than the viewport. */
|
|
343
|
+
readonly fullPage?: boolean;
|
|
344
|
+
/** Extra labels for the capture (`browser`, `os`), which never split it. */
|
|
345
|
+
readonly labels?: Readonly<Record<string, string>>;
|
|
346
|
+
};
|
|
347
|
+
```
|
|
348
|
+
|
|
349
|
+
What to capture and how to know the page is ready.
|
|
350
|
+
|
|
351
|
+
#### `captureUiState`
|
|
352
|
+
|
|
353
|
+
```ts
|
|
354
|
+
export async function captureUiState(page: CapturePage, options: CaptureUiStateOptions): Promise<UiStateCapture>
|
|
355
|
+
```
|
|
356
|
+
|
|
357
|
+
Wait for the page to be ready, photograph it, and return the capture to publish. Never throws for the page's sake: a page
|
|
358
|
+
that never became ready, or could not be photographed, is a `failed` capture that says why, so a broken state shows in the
|
|
359
|
+
catalog instead of ending the run. A readiness failure still attaches a picture of what the page showed, for diagnosis.
|
|
360
|
+
|
|
361
|
+
**Example**
|
|
362
|
+
|
|
363
|
+
```ts
|
|
364
|
+
const shot = await captureUiState(page, { id: 'checkout/payment', route: '/checkout', ready: p => expectVisible(p, '#total') });
|
|
365
|
+
await publishChecks(store, uiStateLayer({ producer: 'playwright', recordedAtMs: Date.now(), environment: 'desktop-web', profile: { viewport: '1280x800' }, states: [shot] }));
|
|
366
|
+
```
|