viewev 0.0.0-stage → 0.1.0-beta.1
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/LICENSE +21 -0
- package/README.md +148 -2
- package/assets/logo/Logo-horizontal.png +0 -0
- package/dist/adapters/storybook/index.d.ts +5 -0
- package/dist/adapters/storybook/index.js +4 -0
- package/dist/adapters/storybook/index.js.map +1 -0
- package/dist/adapters/storybook/provider.d.ts +24 -0
- package/dist/adapters/storybook/provider.js +114 -0
- package/dist/adapters/storybook/provider.js.map +1 -0
- package/dist/adapters/storybook/scenarios.d.ts +30 -0
- package/dist/adapters/storybook/scenarios.js +64 -0
- package/dist/adapters/storybook/scenarios.js.map +1 -0
- package/dist/adapters/storybook/static-server.d.ts +10 -0
- package/dist/adapters/storybook/static-server.js +105 -0
- package/dist/adapters/storybook/static-server.js.map +1 -0
- package/dist/adapters/storybook/storybook-index.d.ts +32 -0
- package/dist/adapters/storybook/storybook-index.js +35 -0
- package/dist/adapters/storybook/storybook-index.js.map +1 -0
- package/dist/baselines/environment-check.d.ts +7 -0
- package/dist/baselines/environment-check.js +24 -0
- package/dist/baselines/environment-check.js.map +1 -0
- package/dist/baselines/environment-key.d.ts +8 -0
- package/dist/baselines/environment-key.js +12 -0
- package/dist/baselines/environment-key.js.map +1 -0
- package/dist/baselines/file-store.d.ts +12 -0
- package/dist/baselines/file-store.js +81 -0
- package/dist/baselines/file-store.js.map +1 -0
- package/dist/baselines/git-store.d.ts +16 -0
- package/dist/baselines/git-store.js +150 -0
- package/dist/baselines/git-store.js.map +1 -0
- package/dist/baselines/memory-store.d.ts +3 -0
- package/dist/baselines/memory-store.js +15 -0
- package/dist/baselines/memory-store.js.map +1 -0
- package/dist/baselines/metadata.d.ts +16 -0
- package/dist/baselines/metadata.js +84 -0
- package/dist/baselines/metadata.js.map +1 -0
- package/dist/baselines/types.d.ts +33 -0
- package/dist/baselines/types.js +2 -0
- package/dist/baselines/types.js.map +1 -0
- package/dist/browser/playwright/capturer.d.ts +2 -0
- package/dist/browser/playwright/capturer.js +142 -0
- package/dist/browser/playwright/capturer.js.map +1 -0
- package/dist/browser/playwright/environment.d.ts +4 -0
- package/dist/browser/playwright/environment.js +36 -0
- package/dist/browser/playwright/environment.js.map +1 -0
- package/dist/browser/playwright/index.d.ts +1 -0
- package/dist/browser/playwright/index.js +2 -0
- package/dist/browser/playwright/index.js.map +1 -0
- package/dist/browser/types.d.ts +43 -0
- package/dist/browser/types.js +2 -0
- package/dist/browser/types.js.map +1 -0
- package/dist/ci/github-summary.d.ts +5 -0
- package/dist/ci/github-summary.js +110 -0
- package/dist/ci/github-summary.js.map +1 -0
- package/dist/cli/baseline-ref.d.ts +6 -0
- package/dist/cli/baseline-ref.js +11 -0
- package/dist/cli/baseline-ref.js.map +1 -0
- package/dist/cli/bin.d.ts +2 -0
- package/dist/cli/bin.js +13 -0
- package/dist/cli/bin.js.map +1 -0
- package/dist/cli/commands/baseline.d.ts +3 -0
- package/dist/cli/commands/baseline.js +90 -0
- package/dist/cli/commands/baseline.js.map +1 -0
- package/dist/cli/commands/capture.d.ts +3 -0
- package/dist/cli/commands/capture.js +42 -0
- package/dist/cli/commands/capture.js.map +1 -0
- package/dist/cli/commands/config.d.ts +3 -0
- package/dist/cli/commands/config.js +25 -0
- package/dist/cli/commands/config.js.map +1 -0
- package/dist/cli/commands/doctor.d.ts +3 -0
- package/dist/cli/commands/doctor.js +19 -0
- package/dist/cli/commands/doctor.js.map +1 -0
- package/dist/cli/commands/report.d.ts +3 -0
- package/dist/cli/commands/report.js +16 -0
- package/dist/cli/commands/report.js.map +1 -0
- package/dist/cli/commands/scenarios.d.ts +3 -0
- package/dist/cli/commands/scenarios.js +30 -0
- package/dist/cli/commands/scenarios.js.map +1 -0
- package/dist/cli/commands/test.d.ts +3 -0
- package/dist/cli/commands/test.js +285 -0
- package/dist/cli/commands/test.js.map +1 -0
- package/dist/cli/context.d.ts +21 -0
- package/dist/cli/context.js +22 -0
- package/dist/cli/context.js.map +1 -0
- package/dist/cli/doctor.d.ts +12 -0
- package/dist/cli/doctor.js +113 -0
- package/dist/cli/doctor.js.map +1 -0
- package/dist/cli/format.d.ts +17 -0
- package/dist/cli/format.js +128 -0
- package/dist/cli/format.js.map +1 -0
- package/dist/cli/impact.d.ts +16 -0
- package/dist/cli/impact.js +63 -0
- package/dist/cli/impact.js.map +1 -0
- package/dist/cli/program.d.ts +11 -0
- package/dist/cli/program.js +70 -0
- package/dist/cli/program.js.map +1 -0
- package/dist/cli/session.d.ts +27 -0
- package/dist/cli/session.js +53 -0
- package/dist/cli/session.js.map +1 -0
- package/dist/comparison/compare.d.ts +11 -0
- package/dist/comparison/compare.js +41 -0
- package/dist/comparison/compare.js.map +1 -0
- package/dist/comparison/types.d.ts +34 -0
- package/dist/comparison/types.js +2 -0
- package/dist/comparison/types.js.map +1 -0
- package/dist/config/load.d.ts +23 -0
- package/dist/config/load.js +93 -0
- package/dist/config/load.js.map +1 -0
- package/dist/config/schema.d.ts +473 -0
- package/dist/config/schema.js +157 -0
- package/dist/config/schema.js.map +1 -0
- package/dist/core/artifacts.d.ts +6 -0
- package/dist/core/artifacts.js +2 -0
- package/dist/core/artifacts.js.map +1 -0
- package/dist/core/baseline-run.d.ts +37 -0
- package/dist/core/baseline-run.js +85 -0
- package/dist/core/baseline-run.js.map +1 -0
- package/dist/core/capture-settings.d.ts +6 -0
- package/dist/core/capture-settings.js +21 -0
- package/dist/core/capture-settings.js.map +1 -0
- package/dist/core/discovery.d.ts +3 -0
- package/dist/core/discovery.js +17 -0
- package/dist/core/discovery.js.map +1 -0
- package/dist/core/impact.d.ts +19 -0
- package/dist/core/impact.js +28 -0
- package/dist/core/impact.js.map +1 -0
- package/dist/core/pool.d.ts +5 -0
- package/dist/core/pool.js +21 -0
- package/dist/core/pool.js.map +1 -0
- package/dist/core/result.d.ts +117 -0
- package/dist/core/result.js +53 -0
- package/dist/core/result.js.map +1 -0
- package/dist/core/selection.d.ts +8 -0
- package/dist/core/selection.js +8 -0
- package/dist/core/selection.js.map +1 -0
- package/dist/core/test-run.d.ts +40 -0
- package/dist/core/test-run.js +141 -0
- package/dist/core/test-run.js.map +1 -0
- package/dist/impact/git.d.ts +17 -0
- package/dist/impact/git.js +55 -0
- package/dist/impact/git.js.map +1 -0
- package/dist/impact/storybook.d.ts +16 -0
- package/dist/impact/storybook.js +324 -0
- package/dist/impact/storybook.js.map +1 -0
- package/dist/impact/types.d.ts +28 -0
- package/dist/impact/types.js +23 -0
- package/dist/impact/types.js.map +1 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +4 -0
- package/dist/index.js.map +1 -0
- package/dist/reference/build.d.ts +10 -0
- package/dist/reference/build.js +36 -0
- package/dist/reference/build.js.map +1 -0
- package/dist/reference/git-worktree.d.ts +8 -0
- package/dist/reference/git-worktree.js +77 -0
- package/dist/reference/git-worktree.js.map +1 -0
- package/dist/reference/open.d.ts +13 -0
- package/dist/reference/open.js +66 -0
- package/dist/reference/open.js.map +1 -0
- package/dist/reporting/artifacts.d.ts +8 -0
- package/dist/reporting/artifacts.js +23 -0
- package/dist/reporting/artifacts.js.map +1 -0
- package/dist/reporting/html.d.ts +4 -0
- package/dist/reporting/html.js +251 -0
- package/dist/reporting/html.js.map +1 -0
- package/dist/reporting/report.d.ts +12 -0
- package/dist/reporting/report.js +55 -0
- package/dist/reporting/report.js.map +1 -0
- package/dist/reporting/results-json.d.ts +36 -0
- package/dist/reporting/results-json.js +38 -0
- package/dist/reporting/results-json.js.map +1 -0
- package/dist/scenarios/glob.d.ts +7 -0
- package/dist/scenarios/glob.js +21 -0
- package/dist/scenarios/glob.js.map +1 -0
- package/dist/scenarios/model.d.ts +61 -0
- package/dist/scenarios/model.js +31 -0
- package/dist/scenarios/model.js.map +1 -0
- package/dist/scenarios/schema.d.ts +8 -0
- package/dist/scenarios/schema.js +70 -0
- package/dist/scenarios/schema.js.map +1 -0
- package/dist/shared/environment.d.ts +23 -0
- package/dist/shared/environment.js +2 -0
- package/dist/shared/environment.js.map +1 -0
- package/dist/shared/errors.d.ts +23 -0
- package/dist/shared/errors.js +29 -0
- package/dist/shared/errors.js.map +1 -0
- package/dist/shared/png.d.ts +3 -0
- package/dist/shared/png.js +14 -0
- package/dist/shared/png.js.map +1 -0
- package/dist/shared/size.d.ts +4 -0
- package/dist/shared/size.js +2 -0
- package/dist/shared/size.js.map +1 -0
- package/docs/architecture.md +176 -0
- package/docs/ci.md +86 -0
- package/docs/impact.md +61 -0
- package/docs/publishing.md +35 -0
- package/package.json +58 -4
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { environmentDifferences } from '../baselines/environment-check.js';
|
|
2
|
+
import { createMetadata, sha256Hex } from '../baselines/metadata.js';
|
|
3
|
+
import { captureRequestFor } from './capture-settings.js';
|
|
4
|
+
import { mapWithConcurrency } from './pool.js';
|
|
5
|
+
function describe(error) {
|
|
6
|
+
return error instanceof Error ? error.message : String(error);
|
|
7
|
+
}
|
|
8
|
+
async function processScenario(deps, options, scenario) {
|
|
9
|
+
const { session, store } = deps;
|
|
10
|
+
let existing;
|
|
11
|
+
let replacedUnreadable;
|
|
12
|
+
try {
|
|
13
|
+
existing = await store.read(scenario.id);
|
|
14
|
+
}
|
|
15
|
+
catch (error) {
|
|
16
|
+
// An unreadable baseline cannot be trusted. `create` must not touch it; `update` is how
|
|
17
|
+
// it gets replaced.
|
|
18
|
+
if (options.mode === 'create') {
|
|
19
|
+
return { scenario, action: 'error', message: describe(error) };
|
|
20
|
+
}
|
|
21
|
+
replacedUnreadable = describe(error);
|
|
22
|
+
}
|
|
23
|
+
if (options.mode === 'create' && existing !== undefined) {
|
|
24
|
+
return { scenario, action: 'kept' };
|
|
25
|
+
}
|
|
26
|
+
const captured = await session.capture(captureRequestFor(scenario, options.config));
|
|
27
|
+
if (!captured.ok) {
|
|
28
|
+
return {
|
|
29
|
+
scenario,
|
|
30
|
+
action: 'error',
|
|
31
|
+
message: `[${captured.error.phase}] ${captured.error.message}`,
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
const clipped = captured.clipped ? { clipped: true } : {};
|
|
35
|
+
if (existing !== undefined) {
|
|
36
|
+
const differences = environmentDifferences(existing.metadata.environment, session.environment);
|
|
37
|
+
if (differences.length > 0 && !options.allowEnvironmentChange) {
|
|
38
|
+
return {
|
|
39
|
+
scenario,
|
|
40
|
+
action: 'error',
|
|
41
|
+
message: `The existing baseline was captured in a different environment (${differences.join('; ')}). ` +
|
|
42
|
+
'Updating only some baselines would mix environments. Use --all to rebaseline everything, ' +
|
|
43
|
+
'or --allow-environment-change to override.',
|
|
44
|
+
...clipped,
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
if (sha256Hex(captured.png) === existing.metadata.sha256) {
|
|
48
|
+
return { scenario, action: 'unchanged', ...clipped };
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
try {
|
|
52
|
+
await store.write(scenario.id, {
|
|
53
|
+
png: captured.png,
|
|
54
|
+
metadata: createMetadata({
|
|
55
|
+
scenario,
|
|
56
|
+
environment: session.environment,
|
|
57
|
+
deviceScaleFactor: options.config.capture.deviceScaleFactor,
|
|
58
|
+
png: captured.png,
|
|
59
|
+
}),
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
catch (error) {
|
|
63
|
+
return { scenario, action: 'error', message: describe(error) };
|
|
64
|
+
}
|
|
65
|
+
return {
|
|
66
|
+
scenario,
|
|
67
|
+
action: existing === undefined && replacedUnreadable === undefined ? 'created' : 'updated',
|
|
68
|
+
...(replacedUnreadable !== undefined
|
|
69
|
+
? { message: `replaced an unreadable baseline (${replacedUnreadable})` }
|
|
70
|
+
: {}),
|
|
71
|
+
...clipped,
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Writes baselines for the given scenarios. This is the only code path that changes
|
|
76
|
+
* baselines, and it only runs when the user explicitly asks for it.
|
|
77
|
+
*/
|
|
78
|
+
export async function runBaselineWrite(deps, options) {
|
|
79
|
+
return mapWithConcurrency(options.scenarios, options.config.concurrency, async (scenario) => {
|
|
80
|
+
const result = await processScenario(deps, options, scenario);
|
|
81
|
+
options.onResult?.(result);
|
|
82
|
+
return result;
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
//# sourceMappingURL=baseline-run.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"baseline-run.js","sourceRoot":"","sources":["../../src/core/baseline-run.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,mCAAmC,CAAC;AAC3E,OAAO,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AAKrE,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC1D,OAAO,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAoC/C,SAAS,QAAQ,CAAC,KAAc;IAC9B,OAAO,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;AAChE,CAAC;AAED,KAAK,UAAU,eAAe,CAC5B,IAAqB,EACrB,OAA2B,EAC3B,QAAwB;IAExB,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,GAAG,IAAI,CAAC;IAEhC,IAAI,QAAoC,CAAC;IACzC,IAAI,kBAAsC,CAAC;IAC3C,IAAI,CAAC;QACH,QAAQ,GAAG,MAAM,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;IAC3C,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,wFAAwF;QACxF,oBAAoB;QACpB,IAAI,OAAO,CAAC,IAAI,KAAK,QAAQ,EAAE,CAAC;YAC9B,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC;QACjE,CAAC;QACD,kBAAkB,GAAG,QAAQ,CAA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AACL,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { CaptureEnvironment, CaptureRequest } from '../browser/types.js';
|
|
2
|
+
import type { ViewevConfig } from '../config/schema.js';
|
|
3
|
+
import type { VisualScenario } from '../scenarios/model.js';
|
|
4
|
+
export declare function captureEnvironmentFrom(config: ViewevConfig): CaptureEnvironment;
|
|
5
|
+
/** Scenario-level options override the global capture settings. */
|
|
6
|
+
export declare function captureRequestFor(scenario: VisualScenario, config: ViewevConfig): CaptureRequest;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export function captureEnvironmentFrom(config) {
|
|
2
|
+
return {
|
|
3
|
+
browser: config.browser.engine,
|
|
4
|
+
deviceScaleFactor: config.capture.deviceScaleFactor,
|
|
5
|
+
locale: config.capture.locale,
|
|
6
|
+
timezoneId: config.capture.timezoneId,
|
|
7
|
+
colorScheme: config.capture.colorScheme,
|
|
8
|
+
reducedMotion: config.capture.reducedMotion,
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
/** Scenario-level options override the global capture settings. */
|
|
12
|
+
export function captureRequestFor(scenario, config) {
|
|
13
|
+
return {
|
|
14
|
+
url: scenario.target.url,
|
|
15
|
+
viewport: scenario.viewport,
|
|
16
|
+
waitForSelector: scenario.capture?.waitForSelector,
|
|
17
|
+
disableAnimations: scenario.capture?.disableAnimations ?? config.capture.disableAnimations,
|
|
18
|
+
timeoutMs: config.capture.timeoutMs,
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=capture-settings.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"capture-settings.js","sourceRoot":"","sources":["../../src/core/capture-settings.ts"],"names":[],"mappings":"AAIA,MAAM,UAAU,sBAAsB,CAAC,MAAoB;IACzD,OAAO;QACL,OAAO,EAAE,MAAM,CAAC,OAAO,CAAC,MAAM;QAC9B,iBAAiB,EAAE,MAAM,CAAC,OAAO,CAAC,iBAAiB;QACnD,MAAM,EAAE,MAAM,CAAC,OAAO,CAAC,MAAM;QAC7B,UAAU,EAAE,MAAM,CAAC,OAAO,CAAC,UAAU;QACrC,WAAW,EAAE,MAAM,CAAC,OAAO,CAAC,WAAW;QACvC,aAAa,EAAE,MAAM,CAAC,OAAO,CAAC,aAAa;KAC5C,CAAC;AACJ,CAAC;AAED,mEAAmE;AACnE,MAAM,UAAU,iBAAiB,CAAC,QAAwB,EAAE,MAAoB;IAC9E,OAAO;QACL,GAAG,EAAE,QAAQ,CAAC,MAAM,CAAC,GAAG;QACxB,QAAQ,EAAE,QAAQ,CAAC,QAAQ;QAC3B,eAAe,EAAE,QAAQ,CAAC,OAAO,EAAE,eAAe;QAClD,iBAAiB,EAAE,QAAQ,CAAC,OAAO,EAAE,iBAAiB,IAAI,MAAM,CAAC,OAAO,CAAC,iBAAiB;QAC1F,SAAS,EAAE,MAAM,CAAC,OAAO,CAAC,SAAS;KACpC,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { ScenarioProvider, ScenarioProviderContext, VisualScenario } from '../scenarios/model.js';
|
|
2
|
+
/** Runs a provider and validates what it returns. */
|
|
3
|
+
export declare function discoverScenarios(provider: ScenarioProvider, context: ScenarioProviderContext): Promise<VisualScenario[]>;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { validateScenarios } from '../scenarios/schema.js';
|
|
2
|
+
import { ExitCode, ViewevError } from '../shared/errors.js';
|
|
3
|
+
/** Runs a provider and validates what it returns. */
|
|
4
|
+
export async function discoverScenarios(provider, context) {
|
|
5
|
+
let found;
|
|
6
|
+
try {
|
|
7
|
+
found = await provider.discover(context);
|
|
8
|
+
}
|
|
9
|
+
catch (error) {
|
|
10
|
+
if (error instanceof ViewevError)
|
|
11
|
+
throw error;
|
|
12
|
+
const reason = error instanceof Error ? error.message : String(error);
|
|
13
|
+
throw new ViewevError(`Scenario provider "${provider.name}" failed: ${reason}`, ExitCode.ExecutionError, { cause: error });
|
|
14
|
+
}
|
|
15
|
+
return validateScenarios(found, provider.name);
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=discovery.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"discovery.js","sourceRoot":"","sources":["../../src/core/discovery.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAE5D,qDAAqD;AACrD,MAAM,CAAC,KAAK,UAAU,iBAAiB,CACrC,QAA0B,EAC1B,OAAgC;IAEhC,IAAI,KAAgC,CAAC;IACrC,IAAI,CAAC;QACH,KAAK,GAAG,MAAM,QAAQ,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;IAC3C,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,IAAI,KAAK,YAAY,WAAW;YAAE,MAAM,KAAK,CAAC;QAC9C,MAAM,MAAM,GAAG,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QACtE,MAAM,IAAI,WAAW,CACnB,sBAAsB,QAAQ,CAAC,IAAI,aAAa,MAAM,EAAE,EACxD,QAAQ,CAAC,cAAc,EACvB,EAAE,KAAK,EAAE,KAAK,EAAE,CACjB,CAAC;IACJ,CAAC;IACD,OAAO,iBAAiB,CAAC,KAAK,EAAE,QAAQ,CAAC,IAAI,CAAC,CAAC;AACjD,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { ImpactSelection } from '../impact/types.js';
|
|
2
|
+
import type { VisualScenario } from '../scenarios/model.js';
|
|
3
|
+
import type { SelectionInfo } from './result.js';
|
|
4
|
+
export interface ImpactContext {
|
|
5
|
+
readonly baseRef: string;
|
|
6
|
+
readonly changedFileCount: number;
|
|
7
|
+
}
|
|
8
|
+
export interface ImpactPlan {
|
|
9
|
+
readonly selected: VisualScenario[];
|
|
10
|
+
readonly info: SelectionInfo;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Narrows `scenarios` (already filtered by include, exclude and --filter) to the ones the
|
|
14
|
+
* analysis selected. Ids the analysis names that are not in `scenarios` are ignored: the user
|
|
15
|
+
* may have filtered them out.
|
|
16
|
+
*/
|
|
17
|
+
export declare function applyImpact(scenarios: readonly VisualScenario[], selection: ImpactSelection, context: ImpactContext): ImpactPlan;
|
|
18
|
+
/** A selection that runs everything, used when the analysis cannot be trusted. */
|
|
19
|
+
export declare function fallbackToAll(reason: string): ImpactSelection;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Narrows `scenarios` (already filtered by include, exclude and --filter) to the ones the
|
|
3
|
+
* analysis selected. Ids the analysis names that are not in `scenarios` are ignored: the user
|
|
4
|
+
* may have filtered them out.
|
|
5
|
+
*/
|
|
6
|
+
export function applyImpact(scenarios, selection, context) {
|
|
7
|
+
const base = {
|
|
8
|
+
total: scenarios.length,
|
|
9
|
+
baseRef: context.baseRef,
|
|
10
|
+
changedFileCount: context.changedFileCount,
|
|
11
|
+
};
|
|
12
|
+
if (selection.mode === 'all') {
|
|
13
|
+
return {
|
|
14
|
+
selected: [...scenarios],
|
|
15
|
+
info: { mode: 'all', selected: scenarios.length, reason: selection.reason, ...base },
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
const selected = scenarios.filter((scenario) => Object.hasOwn(selection.scenarios, scenario.id));
|
|
19
|
+
const reasons = {};
|
|
20
|
+
for (const scenario of selected)
|
|
21
|
+
reasons[scenario.id] = selection.scenarios[scenario.id] ?? [];
|
|
22
|
+
return { selected, info: { mode: 'impact', selected: selected.length, reasons, ...base } };
|
|
23
|
+
}
|
|
24
|
+
/** A selection that runs everything, used when the analysis cannot be trusted. */
|
|
25
|
+
export function fallbackToAll(reason) {
|
|
26
|
+
return { mode: 'all', reason };
|
|
27
|
+
}
|
|
28
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AE,KAAK,EAAE,MAAM,EAAE,CAAC;AACjC,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Runs `task` for every item with at most `limit` tasks in flight and returns the results in
|
|
3
|
+
* the order of `items`. `task` must handle its own errors; a thrown error rejects the whole call.
|
|
4
|
+
*/
|
|
5
|
+
export declare function mapWithConcurrency<T, R>(items: readonly T[], limit: number, task: (item: T, index: number) => Promise<R>): Promise<R[]>;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Runs `task` for every item with at most `limit` tasks in flight and returns the results in
|
|
3
|
+
* the order of `items`. `task` must handle its own errors; a thrown error rejects the whole call.
|
|
4
|
+
*/
|
|
5
|
+
export async function mapWithConcurrency(items, limit, task) {
|
|
6
|
+
const results = new Array(items.length);
|
|
7
|
+
let next = 0;
|
|
8
|
+
async function worker() {
|
|
9
|
+
for (;;) {
|
|
10
|
+
const index = next;
|
|
11
|
+
next += 1;
|
|
12
|
+
if (index >= items.length)
|
|
13
|
+
return;
|
|
14
|
+
results[index] = await task(items[index], index);
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
const workers = Math.max(1, Math.min(limit, items.length));
|
|
18
|
+
await Promise.all(Array.from({ length: workers }, () => worker()));
|
|
19
|
+
return results;
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=pool.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pool.js","sourceRoot":"","sources":["../../src/core/pool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,kBAAkB,CACtC,KAAmB,EACnB,KAAa,EACb,IAA4C;IAE5C,MAAM,OAAO,GAAG,IAAI,KAAK,CAAI,KAAK,CAAC,MAAM,CAAC,CAAC;IAC3C,IAAI,IAAI,GAAG,CAAC,CAAC;IAEb,KAAK,UAAU,MAAM;QACnB,SAAS,CAAC;YACR,MAAM,KAAK,GAAG,IAAI,CAAC;YACnB,IAAI,IAAI,CAAC,CAAC;YACV,IAAI,KAAK,IAAI,KAAK,CAAC,MAAM;gBAAE,OAAO;YAClC,OAAO,CAAC,KAAK,CAAC,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,KAAK,CAAM,EAAE,KAAK,CAAC,CAAC;QACxD,CAAC;IACH,CAAC;IAED,MAAM,OAAO,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC;IAC3D,MAAM,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,OAAO,EAAE,EAAE,GAAG,EAAE,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;IACnE,OAAO,OAAO,CAAC;AACjB,CAAC"}
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import type { DiffStats } from '../comparison/types.js';
|
|
2
|
+
import type { ScenarioId, VisualScenario } from '../scenarios/model.js';
|
|
3
|
+
import { ExitCode } from '../shared/errors.js';
|
|
4
|
+
import type { EnvironmentInfo } from '../shared/environment.js';
|
|
5
|
+
import type { Size } from '../shared/size.js';
|
|
6
|
+
/** Paths are relative to the report directory so a report can be moved as a unit. */
|
|
7
|
+
export interface ArtifactPaths {
|
|
8
|
+
readonly expected?: string;
|
|
9
|
+
readonly actual?: string;
|
|
10
|
+
readonly diff?: string;
|
|
11
|
+
}
|
|
12
|
+
export interface ScenarioError {
|
|
13
|
+
readonly phase: 'discover' | 'navigate' | 'ready' | 'stabilize' | 'screenshot' | 'compare' | 'baseline';
|
|
14
|
+
readonly message: string;
|
|
15
|
+
}
|
|
16
|
+
export type ScenarioOutcome = {
|
|
17
|
+
readonly status: 'passed';
|
|
18
|
+
readonly stats: DiffStats;
|
|
19
|
+
} | {
|
|
20
|
+
readonly status: 'regression';
|
|
21
|
+
readonly cause: 'pixels';
|
|
22
|
+
readonly stats: DiffStats;
|
|
23
|
+
readonly artifacts: ArtifactPaths;
|
|
24
|
+
} | {
|
|
25
|
+
readonly status: 'regression';
|
|
26
|
+
readonly cause: 'dimensions';
|
|
27
|
+
readonly expected: Size;
|
|
28
|
+
readonly actual: Size;
|
|
29
|
+
readonly artifacts: ArtifactPaths;
|
|
30
|
+
} | {
|
|
31
|
+
readonly status: 'changed';
|
|
32
|
+
readonly change: 'added';
|
|
33
|
+
readonly artifacts: ArtifactPaths;
|
|
34
|
+
} | {
|
|
35
|
+
readonly status: 'changed';
|
|
36
|
+
readonly change: 'modified';
|
|
37
|
+
readonly cause: 'pixels';
|
|
38
|
+
readonly stats: DiffStats;
|
|
39
|
+
readonly artifacts: ArtifactPaths;
|
|
40
|
+
} | {
|
|
41
|
+
readonly status: 'changed';
|
|
42
|
+
readonly change: 'modified';
|
|
43
|
+
readonly cause: 'dimensions';
|
|
44
|
+
readonly expected: Size;
|
|
45
|
+
readonly actual: Size;
|
|
46
|
+
readonly artifacts: ArtifactPaths;
|
|
47
|
+
} | {
|
|
48
|
+
readonly status: 'missing-baseline';
|
|
49
|
+
readonly artifacts: ArtifactPaths;
|
|
50
|
+
} | {
|
|
51
|
+
readonly status: 'error';
|
|
52
|
+
readonly error: ScenarioError;
|
|
53
|
+
};
|
|
54
|
+
export interface ScenarioResult {
|
|
55
|
+
readonly scenario: VisualScenario;
|
|
56
|
+
readonly outcome: ScenarioOutcome;
|
|
57
|
+
readonly durationMs: number;
|
|
58
|
+
/** True when the page was larger than the viewport, so the screenshot shows only part of it. */
|
|
59
|
+
readonly clipped?: boolean;
|
|
60
|
+
}
|
|
61
|
+
/** Commit whose application UI was captured as the comparison reference for this run. */
|
|
62
|
+
export interface ReferenceInfo {
|
|
63
|
+
readonly ref: string;
|
|
64
|
+
readonly commit: string;
|
|
65
|
+
}
|
|
66
|
+
/** How the scenarios of a run were chosen, when impact analysis took part. */
|
|
67
|
+
export interface SelectionInfo {
|
|
68
|
+
/** "all": every scenario runs (possibly as a fallback). "impact": only affected ones run. */
|
|
69
|
+
readonly mode: 'all' | 'impact';
|
|
70
|
+
/** Scenarios that passed the filters, before impact analysis. */
|
|
71
|
+
readonly total: number;
|
|
72
|
+
readonly selected: number;
|
|
73
|
+
readonly baseRef?: string;
|
|
74
|
+
readonly changedFileCount?: number;
|
|
75
|
+
/** Why every scenario runs, when it is a fallback or a decision of the analysis. */
|
|
76
|
+
readonly reason?: string;
|
|
77
|
+
/** For each selected scenario, why it was selected. */
|
|
78
|
+
readonly reasons?: Readonly<Record<string, readonly string[]>>;
|
|
79
|
+
}
|
|
80
|
+
export interface RunResult {
|
|
81
|
+
readonly startedAt: string;
|
|
82
|
+
readonly durationMs: number;
|
|
83
|
+
readonly environment?: EnvironmentInfo;
|
|
84
|
+
readonly reference?: ReferenceInfo;
|
|
85
|
+
readonly scenarios: readonly ScenarioResult[];
|
|
86
|
+
/** Baselines that exist on disk but no longer have a scenario. */
|
|
87
|
+
readonly obsolete: readonly ScenarioId[];
|
|
88
|
+
/** Obsolete baselines that the change itself removes, so they do not fail the run. */
|
|
89
|
+
readonly removed?: readonly ScenarioId[];
|
|
90
|
+
/** Problems that did not fail the run, for example baselines from another Chromium version. */
|
|
91
|
+
readonly warnings?: readonly string[];
|
|
92
|
+
/** Present when the scenarios were chosen by impact analysis ("viewev test --changed"). */
|
|
93
|
+
readonly selection?: SelectionInfo;
|
|
94
|
+
}
|
|
95
|
+
export interface RunSummary {
|
|
96
|
+
readonly total: number;
|
|
97
|
+
readonly passed: number;
|
|
98
|
+
readonly regressions: number;
|
|
99
|
+
/** Visual changes that the change proposes baselines for. They do not fail the run. */
|
|
100
|
+
readonly changed: number;
|
|
101
|
+
readonly missingBaselines: number;
|
|
102
|
+
readonly errors: number;
|
|
103
|
+
readonly obsolete: number;
|
|
104
|
+
readonly removed: number;
|
|
105
|
+
}
|
|
106
|
+
export interface ExitPolicy {
|
|
107
|
+
readonly failOnObsolete: boolean;
|
|
108
|
+
}
|
|
109
|
+
export declare function summarize(result: RunResult): RunSummary;
|
|
110
|
+
/**
|
|
111
|
+
* Execution errors win over visual failures: an incomplete run cannot be trusted to have
|
|
112
|
+
* found every regression, so it is surfaced as the more serious condition.
|
|
113
|
+
*
|
|
114
|
+
* "changed" scenarios never fail the run. They are approved by reviewing and merging the
|
|
115
|
+
* baseline changes in the pull request, not by this process.
|
|
116
|
+
*/
|
|
117
|
+
export declare function exitCodeFor(summary: RunSummary, policy: ExitPolicy): ExitCode;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { ExitCode } from '../shared/errors.js';
|
|
2
|
+
export function summarize(result) {
|
|
3
|
+
let passed = 0;
|
|
4
|
+
let regressions = 0;
|
|
5
|
+
let changed = 0;
|
|
6
|
+
let missingBaselines = 0;
|
|
7
|
+
let errors = 0;
|
|
8
|
+
for (const { outcome } of result.scenarios) {
|
|
9
|
+
switch (outcome.status) {
|
|
10
|
+
case 'passed':
|
|
11
|
+
passed += 1;
|
|
12
|
+
break;
|
|
13
|
+
case 'regression':
|
|
14
|
+
regressions += 1;
|
|
15
|
+
break;
|
|
16
|
+
case 'changed':
|
|
17
|
+
changed += 1;
|
|
18
|
+
break;
|
|
19
|
+
case 'missing-baseline':
|
|
20
|
+
missingBaselines += 1;
|
|
21
|
+
break;
|
|
22
|
+
case 'error':
|
|
23
|
+
errors += 1;
|
|
24
|
+
break;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
return {
|
|
28
|
+
total: result.scenarios.length,
|
|
29
|
+
passed,
|
|
30
|
+
regressions,
|
|
31
|
+
changed,
|
|
32
|
+
missingBaselines,
|
|
33
|
+
errors,
|
|
34
|
+
obsolete: result.obsolete.length,
|
|
35
|
+
removed: result.removed?.length ?? 0,
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Execution errors win over visual failures: an incomplete run cannot be trusted to have
|
|
40
|
+
* found every regression, so it is surfaced as the more serious condition.
|
|
41
|
+
*
|
|
42
|
+
* "changed" scenarios never fail the run. They are approved by reviewing and merging the
|
|
43
|
+
* baseline changes in the pull request, not by this process.
|
|
44
|
+
*/
|
|
45
|
+
export function exitCodeFor(summary, policy) {
|
|
46
|
+
if (summary.errors > 0)
|
|
47
|
+
return ExitCode.ExecutionError;
|
|
48
|
+
const visualFailures = summary.regressions + summary.missingBaselines + (policy.failOnObsolete ? summary.obsolete : 0);
|
|
49
|
+
if (visualFailures > 0)
|
|
50
|
+
return ExitCode.VisualFailure;
|
|
51
|
+
return ExitCode.Ok;
|
|
52
|
+
}
|
|
53
|
+
//# sourceMappingURL=result.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"result.js","sourceRoot":"","sources":["../../src/core/result.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAwH/C,MAAM,UAAU,SAAS,CAAC,MAAiB;IACzC,IAAI,MAAM,GAAG,CAAC,CAAC;IACf,IAAI,WAAW,GAAG,CAAC,CAAC;IACpB,IAAI,OAAO,GAAG,CAAC,CAAC;IAChB,IAAI,gBAAgB,GAAG,CAAC,CAAC;IACzB,IAAI,MAAM,GAAG,CAAC,CAAC;IAEf,KAAK,MAAM,EAAE,OAAO,EAAE,IAAI,MAAM,CAAC,SAAS,EAAE,CAAC;QAC3C,QAAQ,OAAO,CAAC,MAAM,EAAE,CAAC;YACvB,KAAK,QAAQ;gBACX,MAAM,IAAI,CAAC,CAAC;gBACZ,MAAM;YACR,KAAK,YAAY;gBACf,WAAW,IAAI,CAAC,CAAC;gBACjB,MAAM;YACR,KAAK,SAAS;gBACZ,OAAO,IAAI,CAAC,CAAC;gBACb,MAAM;YACR,KAAK,kBAAkB;gBACrB,gBAAgB,IAAI,CAAC,CAAC;gBACtB,MAAM;YACR,KAAK,OAAO;gBACV,MAAM,IAAI,CAAC,CAAC;gBACZ,MAAM;QACV,CAAC;IACH,CAAC;IAED,OAAO;QACL,KAAK,EAAE,MAAM,CAAC,SAAS,CAAC,MAAM;QAC9B,MAAM;QACN,WAAW;QACX,OAAO;QACP,gBAAgB;QAChB,MAAM;QACN,QAAQ,EAAE,MAAM,CAAC,QAAQ,CAAC,MAAM;QAChC,OAAO,EAAE,MAAM,CAAC,OAAO,EAAE,MAAM,IAAI,CAAC;KACrC,CAAC;AACJ,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,WAAW,CAAC,OAAmB,EAAE,MAAkB;IACjE,IAAI,OAAO,CAAC,MAAM,GAAG,CAAC;QAAE,OAAO,QAAQ,CAAC,cAAc,CAAC;IAEvD,MAAM,cAAc,GAClB,OAAO,CAAC,WAAW,GAAG,OAAO,CAAC,gBAAgB,GAAG,CAAC,MAAM,CAAC,cAAc,CAAC,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAClG,IAAI,cAAc,GAAG,CAAC;QAAE,OAAO,QAAQ,CAAC,aAAa,CAAC;IAEtD,OAAO,QAAQ,CAAC,EAAE,CAAC;AACrB,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { VisualScenario } from '../scenarios/model.js';
|
|
2
|
+
export interface SelectionFilters {
|
|
3
|
+
/** Glob patterns matched against scenario ids. Empty means every scenario. */
|
|
4
|
+
readonly include: readonly string[];
|
|
5
|
+
/** Exclusion wins over inclusion. */
|
|
6
|
+
readonly exclude: readonly string[];
|
|
7
|
+
}
|
|
8
|
+
export declare function selectScenarios(scenarios: readonly VisualScenario[], filters: SelectionFilters): VisualScenario[];
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { matchesAnyGlob } from '../scenarios/glob.js';
|
|
2
|
+
export function selectScenarios(scenarios, filters) {
|
|
3
|
+
return scenarios.filter((scenario) => {
|
|
4
|
+
const included = filters.include.length === 0 || matchesAnyGlob(scenario.id, filters.include);
|
|
5
|
+
return included && !matchesAnyGlob(scenario.id, filters.exclude);
|
|
6
|
+
});
|
|
7
|
+
}
|
|
8
|
+
//# sourceMappingURL=selection.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"selection.js","sourceRoot":"","sources":["../../src/core/selection.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAUtD,MAAM,UAAU,eAAe,CAC7B,SAAoC,EACpC,OAAyB;IAEzB,OAAO,SAAS,CAAC,MAAM,CAAC,CAAC,QAAQ,EAAE,EAAE;QACnC,MAAM,QAAQ,GAAG,OAAO,CAAC,OAAO,CAAC,MAAM,KAAK,CAAC,IAAI,cAAc,CAAC,QAAQ,CAAC,EAAE,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC;QAC9F,OAAO,QAAQ,IAAI,CAAC,cAAc,CAAC,QAAQ,CAAC,EAAE,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC;IACnE,CAAC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import type { BaselineReader } from '../baselines/types.js';
|
|
2
|
+
import type { CaptureSession } from '../browser/types.js';
|
|
3
|
+
import type { ComparisonOptions, ImageComparator } from '../comparison/types.js';
|
|
4
|
+
import type { ViewevConfig } from '../config/schema.js';
|
|
5
|
+
import type { ScenarioId, VisualScenario } from '../scenarios/model.js';
|
|
6
|
+
import type { ArtifactWriter } from './artifacts.js';
|
|
7
|
+
import type { RunResult, ScenarioResult, ReferenceInfo, SelectionInfo } from './result.js';
|
|
8
|
+
export interface TestRunDeps {
|
|
9
|
+
readonly session: CaptureSession;
|
|
10
|
+
/** The approved baselines. The only thing a scenario is judged against. */
|
|
11
|
+
readonly store: BaselineReader;
|
|
12
|
+
readonly compare: ImageComparator;
|
|
13
|
+
readonly artifacts: ArtifactWriter;
|
|
14
|
+
/**
|
|
15
|
+
* Baselines proposed by the change under test (a pull request). A difference from the
|
|
16
|
+
* approved baselines that matches a proposed baseline is reported as "changed" instead of
|
|
17
|
+
* a regression, so reviewers see exactly which visual changes the change makes. The
|
|
18
|
+
* proposal is never trusted on its own: it only counts if the screenshot matches it.
|
|
19
|
+
*/
|
|
20
|
+
readonly proposed?: BaselineReader;
|
|
21
|
+
}
|
|
22
|
+
export interface TestRunOptions {
|
|
23
|
+
readonly config: ViewevConfig;
|
|
24
|
+
/** The scenarios to run, after filtering. */
|
|
25
|
+
readonly scenarios: readonly VisualScenario[];
|
|
26
|
+
/** Every discovered scenario, before filtering; baselines without one are obsolete. */
|
|
27
|
+
readonly discoveredIds: readonly ScenarioId[];
|
|
28
|
+
/** How the scenarios were chosen, recorded in the result when impact analysis took part. */
|
|
29
|
+
readonly selection?: SelectionInfo;
|
|
30
|
+
/** Set when the baselines were captured from a target branch for this run only. */
|
|
31
|
+
readonly reference?: ReferenceInfo;
|
|
32
|
+
readonly onResult?: (result: ScenarioResult) => void;
|
|
33
|
+
}
|
|
34
|
+
/** Scenario-level options override the global comparison settings. */
|
|
35
|
+
export declare function comparisonOptionsFor(scenario: VisualScenario, config: ViewevConfig): ComparisonOptions;
|
|
36
|
+
/**
|
|
37
|
+
* Captures every scenario and compares it with its approved baseline. It never writes or
|
|
38
|
+
* changes a baseline: approving a visual change is always a separate, explicit step.
|
|
39
|
+
*/
|
|
40
|
+
export declare function runTest(deps: TestRunDeps, options: TestRunOptions): Promise<RunResult>;
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
import { environmentDifferences } from '../baselines/environment-check.js';
|
|
2
|
+
import { captureRequestFor } from './capture-settings.js';
|
|
3
|
+
import { mapWithConcurrency } from './pool.js';
|
|
4
|
+
/** Scenario-level options override the global comparison settings. */
|
|
5
|
+
export function comparisonOptionsFor(scenario, config) {
|
|
6
|
+
const global = config.comparison;
|
|
7
|
+
const own = scenario.comparison;
|
|
8
|
+
const maxDiffRatio = own?.maxDiffRatio ?? global.maxDiffRatio;
|
|
9
|
+
return {
|
|
10
|
+
colorThreshold: own?.colorThreshold ?? global.colorThreshold,
|
|
11
|
+
maxDiffPixels: own?.maxDiffPixels ?? global.maxDiffPixels,
|
|
12
|
+
...(maxDiffRatio !== undefined ? { maxDiffRatio } : {}),
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
function errorOutcome(phase, error) {
|
|
16
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
17
|
+
return { status: 'error', error: { phase, message } };
|
|
18
|
+
}
|
|
19
|
+
async function evaluateScenario(deps, config, scenario, warnings) {
|
|
20
|
+
const captured = await deps.session.capture(captureRequestFor(scenario, config));
|
|
21
|
+
if (!captured.ok) {
|
|
22
|
+
return {
|
|
23
|
+
outcome: {
|
|
24
|
+
status: 'error',
|
|
25
|
+
error: { phase: captured.error.phase, message: captured.error.message },
|
|
26
|
+
},
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
const clipped = captured.clipped;
|
|
30
|
+
const options = comparisonOptionsFor(scenario, config);
|
|
31
|
+
let phase = 'baseline';
|
|
32
|
+
try {
|
|
33
|
+
const approved = await deps.store.read(scenario.id);
|
|
34
|
+
// Only looked at when the screenshot differs from what is approved.
|
|
35
|
+
const proposalMatches = async () => {
|
|
36
|
+
const proposed = await deps.proposed?.read(scenario.id);
|
|
37
|
+
return (proposed !== undefined && deps.compare(proposed.png, captured.png, options).kind === 'match');
|
|
38
|
+
};
|
|
39
|
+
if (approved === undefined) {
|
|
40
|
+
const matches = await proposalMatches();
|
|
41
|
+
const actual = await deps.artifacts.write(scenario.id, 'actual', captured.png);
|
|
42
|
+
return {
|
|
43
|
+
outcome: matches
|
|
44
|
+
? { status: 'changed', change: 'added', artifacts: { actual } }
|
|
45
|
+
: { status: 'missing-baseline', artifacts: { actual } },
|
|
46
|
+
clipped,
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
const differences = environmentDifferences(approved.metadata.environment, deps.session.environment);
|
|
50
|
+
if (differences.length > 0) {
|
|
51
|
+
const message = `Baselines were captured in a different environment: ${differences.join('; ')}.`;
|
|
52
|
+
if (config.baselines.strictEnvironment) {
|
|
53
|
+
return { outcome: { status: 'error', error: { phase: 'baseline', message } }, clipped };
|
|
54
|
+
}
|
|
55
|
+
warnings.add(message);
|
|
56
|
+
}
|
|
57
|
+
phase = 'compare';
|
|
58
|
+
const result = deps.compare(approved.png, captured.png, options);
|
|
59
|
+
if (result.kind === 'match') {
|
|
60
|
+
return { outcome: { status: 'passed', stats: result.stats }, clipped };
|
|
61
|
+
}
|
|
62
|
+
const expected = await deps.artifacts.write(scenario.id, 'expected', approved.png);
|
|
63
|
+
const actual = await deps.artifacts.write(scenario.id, 'actual', captured.png);
|
|
64
|
+
const status = (await proposalMatches()) ? 'changed' : 'regression';
|
|
65
|
+
if (result.cause === 'dimensions') {
|
|
66
|
+
const artifacts = { expected, actual };
|
|
67
|
+
return {
|
|
68
|
+
outcome: status === 'changed'
|
|
69
|
+
? {
|
|
70
|
+
status,
|
|
71
|
+
change: 'modified',
|
|
72
|
+
cause: 'dimensions',
|
|
73
|
+
expected: result.expected,
|
|
74
|
+
actual: result.actual,
|
|
75
|
+
artifacts,
|
|
76
|
+
}
|
|
77
|
+
: {
|
|
78
|
+
status,
|
|
79
|
+
cause: 'dimensions',
|
|
80
|
+
expected: result.expected,
|
|
81
|
+
actual: result.actual,
|
|
82
|
+
artifacts,
|
|
83
|
+
},
|
|
84
|
+
clipped,
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
const diff = await deps.artifacts.write(scenario.id, 'diff', result.diffPng);
|
|
88
|
+
const artifacts = { expected, actual, diff };
|
|
89
|
+
return {
|
|
90
|
+
outcome: status === 'changed'
|
|
91
|
+
? { status, change: 'modified', cause: 'pixels', stats: result.stats, artifacts }
|
|
92
|
+
: { status, cause: 'pixels', stats: result.stats, artifacts },
|
|
93
|
+
clipped,
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
catch (error) {
|
|
97
|
+
return { outcome: errorOutcome(phase, error), clipped };
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* Captures every scenario and compares it with its approved baseline. It never writes or
|
|
102
|
+
* changes a baseline: approving a visual change is always a separate, explicit step.
|
|
103
|
+
*/
|
|
104
|
+
export async function runTest(deps, options) {
|
|
105
|
+
const startedAt = new Date();
|
|
106
|
+
const warnings = new Set();
|
|
107
|
+
const scenarios = await mapWithConcurrency(options.scenarios, options.config.concurrency, async (scenario) => {
|
|
108
|
+
const started = Date.now();
|
|
109
|
+
const { outcome, clipped } = await evaluateScenario(deps, options.config, scenario, warnings);
|
|
110
|
+
const result = {
|
|
111
|
+
scenario,
|
|
112
|
+
outcome,
|
|
113
|
+
durationMs: Date.now() - started,
|
|
114
|
+
...(clipped === true ? { clipped } : {}),
|
|
115
|
+
};
|
|
116
|
+
options.onResult?.(result);
|
|
117
|
+
return result;
|
|
118
|
+
});
|
|
119
|
+
const known = new Set(options.discoveredIds);
|
|
120
|
+
const withoutScenario = (await deps.store.list()).filter((id) => !known.has(id));
|
|
121
|
+
// A baseline whose scenario is gone is only acceptable if the change removes it too.
|
|
122
|
+
let obsolete = withoutScenario;
|
|
123
|
+
let removed = [];
|
|
124
|
+
if (deps.proposed !== undefined) {
|
|
125
|
+
const stillProposed = new Set(await deps.proposed.list());
|
|
126
|
+
obsolete = withoutScenario.filter((id) => stillProposed.has(id));
|
|
127
|
+
removed = withoutScenario.filter((id) => !stillProposed.has(id));
|
|
128
|
+
}
|
|
129
|
+
return {
|
|
130
|
+
startedAt: startedAt.toISOString(),
|
|
131
|
+
durationMs: Date.now() - startedAt.getTime(),
|
|
132
|
+
environment: deps.session.environment,
|
|
133
|
+
...(options.reference !== undefined ? { reference: options.reference } : {}),
|
|
134
|
+
scenarios,
|
|
135
|
+
obsolete,
|
|
136
|
+
...(deps.proposed !== undefined ? { removed } : {}),
|
|
137
|
+
...(options.selection !== undefined ? { selection: options.selection } : {}),
|
|
138
|
+
...(warnings.size > 0 ? { warnings: [...warnings] } : {}),
|
|
139
|
+
};
|
|
140
|
+
}
|
|
141
|
+
//# sourceMappingURL=test-run.js.map
|
|
@@ -0,0 +1 @@
|
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