@terra-symposium/standards-reporting 0.0.0-stage → 0.3.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/README.md +39 -2
- package/dist/core.d.ts +122 -0
- package/dist/core.d.ts.map +1 -0
- package/dist/core.js +69 -0
- package/dist/core.js.map +1 -0
- package/dist/load-testing.d.ts +78 -0
- package/dist/load-testing.d.ts.map +1 -0
- package/dist/load-testing.js +201 -0
- package/dist/load-testing.js.map +1 -0
- package/dist/metadata.d.ts +7 -0
- package/dist/metadata.d.ts.map +1 -0
- package/dist/metadata.js +26 -0
- package/dist/metadata.js.map +1 -0
- package/dist/playwright.d.ts +113 -0
- package/dist/playwright.d.ts.map +1 -0
- package/dist/playwright.js +568 -0
- package/dist/playwright.js.map +1 -0
- package/dist/slideshow.d.ts +23 -0
- package/dist/slideshow.d.ts.map +1 -0
- package/dist/slideshow.js +281 -0
- package/dist/slideshow.js.map +1 -0
- package/dist/spreadsheet.d.ts +14 -0
- package/dist/spreadsheet.d.ts.map +1 -0
- package/dist/spreadsheet.js +286 -0
- package/dist/spreadsheet.js.map +1 -0
- package/dist/viewports.d.ts +117 -0
- package/dist/viewports.d.ts.map +1 -0
- package/dist/viewports.js +156 -0
- package/dist/viewports.js.map +1 -0
- package/package.json +48 -5
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* packages/reporting/src/playwright.ts
|
|
3
|
+
* Playwright fixtures and reporter for reusable test evidence.
|
|
4
|
+
*/
|
|
5
|
+
import { diagnosticCount } from './core.js';
|
|
6
|
+
import type { LoadBudgetOverride, LoadTestingConfig, ProjectDefinition } from './core.js';
|
|
7
|
+
import type { ViewportCatalog } from './viewports.js';
|
|
8
|
+
/** Browser diagnostic captured by the reusable page fixture. */
|
|
9
|
+
export type BrowserDiagnostic = {
|
|
10
|
+
level: string;
|
|
11
|
+
message: string;
|
|
12
|
+
url?: string;
|
|
13
|
+
};
|
|
14
|
+
/** Playwright fixture that records browser console, page, and request failures. */
|
|
15
|
+
export declare const diagnosticsTest: import("@playwright/test").TestType<import("@playwright/test").PlaywrightTestArgs & import("@playwright/test").PlaywrightTestOptions, import("@playwright/test").PlaywrightWorkerArgs & import("@playwright/test").PlaywrightWorkerOptions>;
|
|
16
|
+
/** Test-local load helpers exposed by the reusable load fixture. */
|
|
17
|
+
export type LoadTestController = {
|
|
18
|
+
/** Sets a budget override for this test's total elapsed duration. */
|
|
19
|
+
setTestBudget: (budget: LoadBudgetOverride) => void;
|
|
20
|
+
/** Measures a named asynchronous or synchronous operation and preserves its return value. */
|
|
21
|
+
measure: <T>(name: string, op: () => T | Promise<T>, budget?: LoadBudgetOverride) => Promise<T>;
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* Playwright fixture that records navigations and named operation timings.
|
|
25
|
+
* Import as `test` in suites that need page and operation-level measurements.
|
|
26
|
+
*/
|
|
27
|
+
export declare const loadTest: import("@playwright/test").TestType<import("@playwright/test").PlaywrightTestArgs & import("@playwright/test").PlaywrightTestOptions & {
|
|
28
|
+
load: LoadTestController;
|
|
29
|
+
}, import("@playwright/test").PlaywrightWorkerArgs & import("@playwright/test").PlaywrightWorkerOptions>;
|
|
30
|
+
/** Application-specific paths and catalog settings for the shared reporter. */
|
|
31
|
+
export type ReportingOptions = {
|
|
32
|
+
featureFiles?: readonly string[];
|
|
33
|
+
projects?: readonly ProjectDefinition[];
|
|
34
|
+
viewportCatalog?: ViewportCatalog;
|
|
35
|
+
outputRoot?: string;
|
|
36
|
+
reportFile?: string;
|
|
37
|
+
slideshowFile?: string;
|
|
38
|
+
supplementalResultsFile?: string;
|
|
39
|
+
qualityConfigFile?: string;
|
|
40
|
+
loadTesting?: LoadTestingConfig;
|
|
41
|
+
};
|
|
42
|
+
/**
|
|
43
|
+
* Removes terminal color escapes before diagnostics enter an artifact.
|
|
44
|
+
* @param valerminal output that may contain ANSI escape sequences.
|
|
45
|
+
* @returns Terminal output with ANSI formatting removed.
|
|
46
|
+
*/
|
|
47
|
+
export declare const stripAnsi: (val: string) => string;
|
|
48
|
+
/**
|
|
49
|
+
* Parses browser diagnostic attachments into readable artifact lines.
|
|
50
|
+
* @param raw JSON attachment text or a plain diagnostic message.
|
|
51
|
+
* @returns Normalized diagnostic lines.
|
|
52
|
+
*/
|
|
53
|
+
export declare const parseDiagnostics: (raw: string) => string[];
|
|
54
|
+
/** Creates the reusable Playwright reporter with application-specific output configuration. */
|
|
55
|
+
export default class ProgressReporter {
|
|
56
|
+
private readonly options;
|
|
57
|
+
private readonly results;
|
|
58
|
+
private readonly terminalDiagnostics;
|
|
59
|
+
private readonly runDiagnostics;
|
|
60
|
+
private readonly expectedTests;
|
|
61
|
+
private readonly completedTests;
|
|
62
|
+
/**
|
|
63
|
+
* Creates a reporter that writes application-specific visual test artifacts.
|
|
64
|
+
*
|
|
65
|
+
* @param opts Application-specific reporter configuration.
|
|
66
|
+
*/
|
|
67
|
+
constructor(opts?: ReportingOptions);
|
|
68
|
+
/**
|
|
69
|
+
* Records the full expected suite so interrupted tests can be represented.
|
|
70
|
+
* @param _config Playwright configuration supplied by the reporter lifecycle.
|
|
71
|
+
* @param suite Playwright suite containing all discovered tests.
|
|
72
|
+
* @returns Nothing; the expected-test registry is updated in place.
|
|
73
|
+
*/
|
|
74
|
+
onBegin(_config: Parameters<NonNullable<import('@playwright/test/reporter').Reporter['onBegin']>>[0], suite: Parameters<NonNullable<import('@playwright/test/reporter').Reporter['onBegin']>>[1]): void;
|
|
75
|
+
/**
|
|
76
|
+
* Associates stderr with a test result or the run when no test is active.
|
|
77
|
+
* @param chunk Terminal output emitted by Playwright.
|
|
78
|
+
* @param test Active test identity, when available.
|
|
79
|
+
* @param result Active test result, when available.
|
|
80
|
+
* @returns Nothing; diagnostic state is updated in place.
|
|
81
|
+
*/
|
|
82
|
+
onStdErr(chunk: string | Buffer, test?: object, result?: object): void;
|
|
83
|
+
/**
|
|
84
|
+
* Retains diagnostic-looking stdout without treating ordinary output as failure evidence.
|
|
85
|
+
* @param chunk Terminal output emitted by Playwright.
|
|
86
|
+
* @param test Active test identity, when available.
|
|
87
|
+
* @param result Active test result, when available.
|
|
88
|
+
* @returns Nothing; diagnostic state is updated in place.
|
|
89
|
+
*/
|
|
90
|
+
onStdOut(chunk: string | Buffer, test?: object, result?: object): void;
|
|
91
|
+
/**
|
|
92
|
+
* Retains reporter-level errors in the run diagnostics.
|
|
93
|
+
* @param err Reporter-level error emitted by Playwright.
|
|
94
|
+
* @returns Nothing; run diagnostics are updated in place.
|
|
95
|
+
*/
|
|
96
|
+
onError(err: {
|
|
97
|
+
message: string;
|
|
98
|
+
}): void;
|
|
99
|
+
/**
|
|
100
|
+
* Normalizes a completed Playwright result and associates its evidence.
|
|
101
|
+
* @param test Completed Playwright test case.
|
|
102
|
+
* @param result Completed Playwright test result and attachments.
|
|
103
|
+
* @returns Nothing; the normalized result is appended to the run.
|
|
104
|
+
*/
|
|
105
|
+
onTestEnd(test: import('@playwright/test/reporter').TestCase, result: import('@playwright/test/reporter').TestResult): void;
|
|
106
|
+
/**
|
|
107
|
+
* Emits interrupted results and writes the spreadsheet and slideshow artifacts.
|
|
108
|
+
* @returns A promise that resolves after both report artifacts are written.
|
|
109
|
+
*/
|
|
110
|
+
onEnd(): Promise<'failed' | void>;
|
|
111
|
+
}
|
|
112
|
+
export { diagnosticCount };
|
|
113
|
+
//# sourceMappingURL=playwright.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"playwright.d.ts","sourceRoot":"","sources":["../src/playwright.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAUH,OAAO,EAAE,eAAe,EAAyB,MAAM,WAAW,CAAC;AAUnE,OAAO,KAAK,EAAE,kBAAkB,EAAyC,iBAAiB,EAAE,iBAAiB,EAA2B,MAAM,WAAW,CAAC;AAC1J,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAMtD,gEAAgE;AAChE,MAAM,MAAM,i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