html-reporter 11.5.0 → 11.6.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.
Files changed (161) hide show
  1. package/build/lib/config/index.js +4 -0
  2. package/build/lib/config/index.js.map +1 -1
  3. package/build/lib/static/321.min.js +1 -0
  4. package/build/lib/static/420.min.js +1 -0
  5. package/build/lib/static/734.min.css +1 -1
  6. package/build/lib/static/734.min.js +1 -1
  7. package/build/lib/static/896.min.css +1 -0
  8. package/build/lib/static/896.min.js +1 -0
  9. package/build/lib/static/gui.html +1 -1
  10. package/build/lib/static/gui.min.js +1 -1
  11. package/build/lib/static/index.html +1 -1
  12. package/build/lib/static/new-ui-gui.html +1 -1
  13. package/build/lib/static/new-ui-report.html +1 -1
  14. package/build/lib/static/newGui.min.js +1 -1
  15. package/build/lib/static/newReport.min.js +1 -1
  16. package/build/lib/static/report.min.js +1 -1
  17. package/build/package.json +1 -1
  18. package/package.json +1 -1
  19. package/plugins-sdk/build/lib/static/new-ui/constants/plugins.d.ts +2 -1
  20. package/plugins-sdk/build/lib/static/new-ui/constants/plugins.d.ts.map +1 -1
  21. package/plugins-sdk/build/lib/static/new-ui/constants/plugins.js +1 -0
  22. package/plugins-sdk/build/lib/static/new-ui/constants/plugins.js.map +1 -1
  23. package/plugins-sdk/build-ui/lib/adapters/config/index.d.ts +7 -0
  24. package/plugins-sdk/build-ui/lib/adapters/config/playwright.d.ts +24 -0
  25. package/plugins-sdk/build-ui/lib/adapters/config/testplane.d.ts +13 -0
  26. package/plugins-sdk/build-ui/lib/adapters/event-handling/testplane/snapshots.d.ts +33 -0
  27. package/plugins-sdk/build-ui/lib/adapters/test/index.d.ts +25 -0
  28. package/plugins-sdk/build-ui/lib/adapters/test/playwright.d.ts +23 -0
  29. package/plugins-sdk/build-ui/lib/adapters/test/testplane.d.ts +19 -0
  30. package/plugins-sdk/build-ui/lib/adapters/test-collection/index.d.ts +4 -0
  31. package/plugins-sdk/build-ui/lib/adapters/test-collection/playwright.d.ts +8 -0
  32. package/plugins-sdk/build-ui/lib/adapters/test-collection/testplane.d.ts +11 -0
  33. package/plugins-sdk/build-ui/lib/adapters/test-result/playwright.d.ts +82 -0
  34. package/plugins-sdk/build-ui/lib/adapters/test-result/reporter.d.ts +33 -0
  35. package/plugins-sdk/build-ui/lib/adapters/test-result/testplane/history.d.ts +9 -0
  36. package/plugins-sdk/build-ui/lib/adapters/test-result/testplane/index.d.ts +50 -0
  37. package/plugins-sdk/build-ui/lib/adapters/test-result/utils/index.d.ts +5 -0
  38. package/plugins-sdk/build-ui/lib/adapters/tool/index.d.ts +34 -0
  39. package/plugins-sdk/build-ui/lib/adapters/tool/playwright/index.d.ts +46 -0
  40. package/plugins-sdk/build-ui/lib/adapters/tool/playwright/ipc.d.ts +8 -0
  41. package/plugins-sdk/build-ui/lib/adapters/tool/playwright/reporter.d.ts +13 -0
  42. package/plugins-sdk/build-ui/lib/adapters/tool/playwright/transformer.d.ts +1 -0
  43. package/plugins-sdk/build-ui/lib/adapters/tool/testplane/index.d.ts +55 -0
  44. package/plugins-sdk/build-ui/lib/adapters/tool/testplane/runner/all-test-runner.d.ts +5 -0
  45. package/plugins-sdk/build-ui/lib/adapters/tool/testplane/runner/index.d.ts +4 -0
  46. package/plugins-sdk/build-ui/lib/adapters/tool/testplane/runner/runner.d.ts +9 -0
  47. package/plugins-sdk/build-ui/lib/adapters/tool/testplane/runner/specific-test-runner.d.ts +9 -0
  48. package/plugins-sdk/build-ui/lib/adapters/tool/testplane/test-results-handler.d.ts +4 -0
  49. package/plugins-sdk/build-ui/lib/adapters/tool/types.d.ts +9 -0
  50. package/plugins-sdk/build-ui/lib/cache.d.ts +8 -0
  51. package/plugins-sdk/build-ui/lib/config/custom-gui-asserts.d.ts +1 -0
  52. package/plugins-sdk/build-ui/lib/config/index.d.ts +5 -0
  53. package/plugins-sdk/build-ui/lib/constants/performance-marks.d.ts +9 -0
  54. package/plugins-sdk/build-ui/lib/db-utils/client.d.ts +50 -0
  55. package/plugins-sdk/build-ui/lib/gui/api/facade.d.ts +7 -0
  56. package/plugins-sdk/build-ui/lib/gui/api/index.d.ts +13 -0
  57. package/plugins-sdk/build-ui/lib/gui/app.d.ts +20 -0
  58. package/plugins-sdk/build-ui/lib/gui/constants/client-events.d.ts +13 -0
  59. package/plugins-sdk/build-ui/lib/gui/constants/custom-gui-control-types.d.ts +2 -0
  60. package/plugins-sdk/build-ui/lib/gui/constants/gui-events.d.ts +7 -0
  61. package/plugins-sdk/build-ui/lib/gui/constants/index.d.ts +4 -0
  62. package/plugins-sdk/build-ui/lib/gui/constants/server.d.ts +3 -0
  63. package/plugins-sdk/build-ui/lib/gui/event-source.d.ts +8 -0
  64. package/plugins-sdk/build-ui/lib/gui/index.d.ts +18 -0
  65. package/plugins-sdk/build-ui/lib/gui/listen-with-fallback.d.ts +12 -0
  66. package/plugins-sdk/build-ui/lib/gui/routes/plugins.d.ts +3 -0
  67. package/plugins-sdk/build-ui/lib/gui/server.d.ts +18 -0
  68. package/plugins-sdk/build-ui/lib/gui/tool-runner/index.d.ts +58 -0
  69. package/plugins-sdk/build-ui/lib/gui/tool-runner/utils.d.ts +7 -0
  70. package/plugins-sdk/build-ui/lib/image-cache.d.ts +3 -0
  71. package/plugins-sdk/build-ui/lib/image-store.d.ts +10 -0
  72. package/plugins-sdk/build-ui/lib/images-info-saver.d.ts +28 -0
  73. package/plugins-sdk/build-ui/lib/plugin-utils.d.ts +2 -0
  74. package/plugins-sdk/build-ui/lib/report-builder/gui.d.ts +44 -0
  75. package/plugins-sdk/build-ui/lib/report-builder/static.d.ts +40 -0
  76. package/plugins-sdk/build-ui/lib/reporter-helpers.d.ts +7 -0
  77. package/plugins-sdk/build-ui/lib/static/components/controls/control-button.d.ts +32 -0
  78. package/plugins-sdk/build-ui/lib/static/components/controls/selects/control.d.ts +21 -0
  79. package/plugins-sdk/build-ui/lib/static/components/controls/selects/label.d.ts +11 -0
  80. package/plugins-sdk/build-ui/lib/static/components/details.d.ts +14 -0
  81. package/plugins-sdk/build-ui/lib/static/components/icons/view-in-browser/index.d.ts +23 -0
  82. package/plugins-sdk/build-ui/lib/static/components/measurement-context.d.ts +3 -0
  83. package/plugins-sdk/build-ui/lib/static/components/modals/find-same-diffs.d.ts +13 -0
  84. package/plugins-sdk/build-ui/lib/static/components/modals/index.d.ts +8 -0
  85. package/plugins-sdk/build-ui/lib/static/components/modals/screenshot-accepter/body.d.ts +35 -0
  86. package/plugins-sdk/build-ui/lib/static/components/modals/screenshot-accepter/header.d.ts +76 -0
  87. package/plugins-sdk/build-ui/lib/static/components/modals/screenshot-accepter/index.d.ts +91 -0
  88. package/plugins-sdk/build-ui/lib/static/components/modals/screenshot-accepter/meta.d.ts +13 -0
  89. package/plugins-sdk/build-ui/lib/static/components/modals/static-accepter-confirm/index.d.ts +13 -0
  90. package/plugins-sdk/build-ui/lib/static/components/progress-bar/index.d.ts +14 -0
  91. package/plugins-sdk/build-ui/lib/static/components/retry-switcher/index.d.ts +13 -0
  92. package/plugins-sdk/build-ui/lib/static/components/state/state-fail/index.d.ts +53 -0
  93. package/plugins-sdk/build-ui/lib/static/modules/action-names.d.ts +85 -0
  94. package/plugins-sdk/build-ui/lib/static/modules/actions/browsers.d.ts +9 -0
  95. package/plugins-sdk/build-ui/lib/static/modules/actions/custom-gui.d.ts +7 -0
  96. package/plugins-sdk/build-ui/lib/static/modules/actions/features.d.ts +8 -0
  97. package/plugins-sdk/build-ui/lib/static/modules/actions/filters.d.ts +22 -0
  98. package/plugins-sdk/build-ui/lib/static/modules/actions/find-same-diffs.d.ts +2 -0
  99. package/plugins-sdk/build-ui/lib/static/modules/actions/group-tests.d.ts +11 -0
  100. package/plugins-sdk/build-ui/lib/static/modules/actions/gui-server-connection.d.ts +8 -0
  101. package/plugins-sdk/build-ui/lib/static/modules/actions/index.d.ts +19 -0
  102. package/plugins-sdk/build-ui/lib/static/modules/actions/lifecycle.d.ts +35 -0
  103. package/plugins-sdk/build-ui/lib/static/modules/actions/loading.d.ts +8 -0
  104. package/plugins-sdk/build-ui/lib/static/modules/actions/modals.d.ts +13 -0
  105. package/plugins-sdk/build-ui/lib/static/modules/actions/notifications.d.ts +5 -0
  106. package/plugins-sdk/build-ui/lib/static/modules/actions/processing.d.ts +7 -0
  107. package/plugins-sdk/build-ui/lib/static/modules/actions/run-tests.d.ts +46 -0
  108. package/plugins-sdk/build-ui/lib/static/modules/actions/screenshots.d.ts +20 -0
  109. package/plugins-sdk/build-ui/lib/static/modules/actions/settings.d.ts +13 -0
  110. package/plugins-sdk/build-ui/lib/static/modules/actions/snapshots.d.ts +17 -0
  111. package/plugins-sdk/build-ui/lib/static/modules/actions/sort-tests.d.ts +13 -0
  112. package/plugins-sdk/build-ui/lib/static/modules/actions/static-accepter.d.ts +55 -0
  113. package/plugins-sdk/build-ui/lib/static/modules/actions/suites-page.d.ts +59 -0
  114. package/plugins-sdk/build-ui/lib/static/modules/actions/suites-tree-state.d.ts +67 -0
  115. package/plugins-sdk/build-ui/lib/static/modules/actions/types.d.ts +33 -0
  116. package/plugins-sdk/build-ui/lib/static/modules/actions/visual-checks-page.d.ts +22 -0
  117. package/plugins-sdk/build-ui/lib/static/modules/default-state.d.ts +189 -0
  118. package/plugins-sdk/build-ui/lib/static/modules/load-plugin.d.ts +2 -0
  119. package/plugins-sdk/build-ui/lib/static/modules/plugins-sdk-ui.d.ts +1 -0
  120. package/plugins-sdk/build-ui/lib/static/modules/plugins.d.ts +5 -0
  121. package/plugins-sdk/build-ui/lib/static/modules/query-params.d.ts +10 -0
  122. package/plugins-sdk/build-ui/lib/static/modules/selectors/index.d.ts +3 -0
  123. package/plugins-sdk/build-ui/lib/static/modules/selectors/stats.d.ts +3 -0
  124. package/plugins-sdk/build-ui/lib/static/modules/selectors/tree.d.ts +791 -0
  125. package/plugins-sdk/build-ui/lib/static/modules/selectors/view.d.ts +2 -0
  126. package/plugins-sdk/build-ui/lib/static/modules/utils/imageEntity.d.ts +3 -0
  127. package/plugins-sdk/build-ui/lib/static/modules/utils/index.d.ts +48 -0
  128. package/plugins-sdk/build-ui/lib/static/modules/utils/pluginMiddlewareRoute.d.ts +2 -0
  129. package/plugins-sdk/build-ui/lib/static/modules/utils/state.d.ts +15 -0
  130. package/plugins-sdk/build-ui/lib/static/modules/yandex-metrika.d.ts +47 -0
  131. package/plugins-sdk/build-ui/lib/static/new-ui/components/AttemptPickerItem/index.d.ts +8 -0
  132. package/plugins-sdk/build-ui/lib/static/new-ui/components/DiffViewer/ListMode.d.ts +9 -0
  133. package/plugins-sdk/build-ui/lib/static/new-ui/components/DiffViewer/OnionSkinMode.d.ts +8 -0
  134. package/plugins-sdk/build-ui/lib/static/new-ui/components/DiffViewer/OnlyDiffMode.d.ts +10 -0
  135. package/plugins-sdk/build-ui/lib/static/new-ui/components/DiffViewer/SideBySideMode.d.ts +9 -0
  136. package/plugins-sdk/build-ui/lib/static/new-ui/components/DiffViewer/SideBySideToFitMode.d.ts +14 -0
  137. package/plugins-sdk/build-ui/lib/static/new-ui/components/DiffViewer/SwipeMode.d.ts +8 -0
  138. package/plugins-sdk/build-ui/lib/static/new-ui/components/DiffViewer/SwitchMode.d.ts +8 -0
  139. package/plugins-sdk/build-ui/lib/static/new-ui/components/DiffViewer/types.d.ts +7 -0
  140. package/plugins-sdk/build-ui/lib/static/new-ui/components/DiffViewer/utils.d.ts +5 -0
  141. package/plugins-sdk/build-ui/lib/static/new-ui/components/MetaInfo/index.d.ts +18 -0
  142. package/plugins-sdk/build-ui/lib/static/new-ui/components/Screenshot/DiffCircle.d.ts +13 -0
  143. package/plugins-sdk/build-ui/lib/static/new-ui/components/Screenshot/index.d.ts +22 -0
  144. package/plugins-sdk/build-ui/lib/static/new-ui/components/Screenshot/utils.d.ts +2 -0
  145. package/plugins-sdk/build-ui/lib/static/new-ui/features/suites/components/CollapsibleSection/index.d.ts +18 -0
  146. package/plugins-sdk/build-ui/lib/static/new-ui/features/suites/components/CollapsibleSection/utils.d.ts +1 -0
  147. package/plugins-sdk/build-ui/lib/static/new-ui/features/suites/constants.d.ts +1 -0
  148. package/plugins-sdk/build-ui/lib/static/new-ui/providers/analytics.d.ts +8 -0
  149. package/plugins-sdk/build-ui/lib/static/new-ui/store/selectors.d.ts +18 -0
  150. package/plugins-sdk/build-ui/lib/static/new-ui/types/store.d.ts +4 -0
  151. package/plugins-sdk/build-ui/lib/static/new-ui/utils/analytics.d.ts +8 -0
  152. package/plugins-sdk/build-ui/lib/static/new-ui/utils/api.d.ts +3 -0
  153. package/plugins-sdk/build-ui/lib/static/new-ui/utils/index.d.ts +7 -0
  154. package/plugins-sdk/build-ui/lib/test-attempt-manager.d.ts +13 -0
  155. package/plugins-sdk/build-ui/lib/tests-tree-builder/gui.d.ts +56 -0
  156. package/plugins-sdk/build-ui/lib/workers/create-workers.d.ts +15 -0
  157. package/build/lib/static/281.min.css +0 -1
  158. package/build/lib/static/281.min.js +0 -1
  159. package/build/lib/static/359.min.js +0 -1
  160. package/build/lib/static/850.min.js +0 -1
  161. /package/build/lib/static/{850.min.css → 321.min.css} +0 -0
@@ -0,0 +1,24 @@
1
+ import type { ConfigAdapter } from './index';
2
+ import type { FullConfig, FullProject } from '@playwright/test/reporter';
3
+ import type { TestAdapter } from '../test';
4
+ export type PwtProject = FullProject & {
5
+ snapshotPathTemplate?: string;
6
+ };
7
+ export type PwtConfig = FullConfig & {
8
+ testDir?: string;
9
+ snapshotDir?: string;
10
+ snapshotPathTemplate?: string;
11
+ projects?: PwtProject[];
12
+ };
13
+ export declare const DEFAULT_BROWSER_ID = "chromium";
14
+ export declare class PlaywrightConfigAdapter implements ConfigAdapter {
15
+ private _config;
16
+ private _browserIds;
17
+ static create<T extends PlaywrightConfigAdapter>(this: new (config: PwtConfig) => T, config: PwtConfig): T;
18
+ constructor(config: PwtConfig);
19
+ get original(): PwtConfig;
20
+ get tolerance(): number;
21
+ get antialiasingTolerance(): number;
22
+ get browserIds(): string[];
23
+ getScreenshotPath(test: TestAdapter, stateName: string): string;
24
+ }
@@ -0,0 +1,13 @@
1
+ import type { Config } from 'testplane';
2
+ import type { ConfigAdapter } from './';
3
+ import type { TestplaneTestAdapter } from '../test/testplane';
4
+ export declare class TestplaneConfigAdapter implements ConfigAdapter {
5
+ private _config;
6
+ static create<T extends TestplaneConfigAdapter>(this: new (config: Config) => T, config: Config): T;
7
+ constructor(config: Config);
8
+ get tolerance(): number;
9
+ get antialiasingTolerance(): number;
10
+ get browserIds(): string[];
11
+ getBrowserConfig(browserId: string): ReturnType<Config['forBrowser']>;
12
+ getScreenshotPath(test: TestplaneTestAdapter, stateName: string): string;
13
+ }
@@ -0,0 +1,33 @@
1
+ import type { eventWithTime as RrwebEvent } from '@rrweb/types';
2
+ import type Testplane from 'testplane';
3
+ import { ReporterTestResult } from '../../test-result';
4
+ import { SnapshotAttachment, SnapshotsSaver } from '../../../types';
5
+ import { EventSource } from '../../../gui/event-source';
6
+ export interface TestContext {
7
+ testPath: string[];
8
+ browserId: string;
9
+ }
10
+ export interface SnapshotsData {
11
+ rrwebSnapshots: RrwebEvent[];
12
+ }
13
+ export declare const snapshotsInProgress: Record<string, RrwebEvent[]>;
14
+ export declare const getSnapshotHashWithoutAttempt: (context: TestContext) => string;
15
+ interface CreateSnapshotFilePathParams {
16
+ attempt: number;
17
+ hash: string;
18
+ browserId: string;
19
+ timestamp: number;
20
+ }
21
+ export declare function createSnapshotFilePath({ attempt: attemptInput, hash, browserId, timestamp }: CreateSnapshotFilePathParams): string;
22
+ export declare const handleDomSnapshotsEvent: (client: EventSource | null, context: TestContext, data: SnapshotsData) => void;
23
+ interface FinalizeSnapshotsParams {
24
+ testResult: ReporterTestResult;
25
+ attempt: number;
26
+ timeTravelConfig: Testplane['config']['timeTravel'];
27
+ reportPath: string;
28
+ eventName: Testplane['events'][keyof Testplane['events']];
29
+ events: Testplane['events'];
30
+ snapshotsSaver?: SnapshotsSaver | null;
31
+ }
32
+ export declare const finalizeSnapshotsForTest: ({ testResult, attempt, reportPath, timeTravelConfig, events, eventName, snapshotsSaver }: FinalizeSnapshotsParams) => Promise<SnapshotAttachment[]>;
33
+ export {};
@@ -0,0 +1,25 @@
1
+ import { TestStatus } from '../../constants';
2
+ import type { ReporterTestResult } from '../test-result';
3
+ import type { AssertViewResult } from '../../types';
4
+ export interface CreateTestResultOpts {
5
+ status: TestStatus;
6
+ attempt?: number;
7
+ assertViewResults?: AssertViewResult[];
8
+ error?: Error;
9
+ sessionId?: string;
10
+ meta?: {
11
+ url?: string;
12
+ };
13
+ duration: number;
14
+ }
15
+ export interface TestAdapter {
16
+ readonly id: string;
17
+ readonly pending: boolean;
18
+ readonly disabled: boolean;
19
+ readonly silentlySkipped: boolean;
20
+ readonly browserId: string;
21
+ readonly fullName: string;
22
+ readonly file: string;
23
+ readonly titlePath: string[];
24
+ createTestResult(opts: CreateTestResultOpts): ReporterTestResult;
25
+ }
@@ -0,0 +1,23 @@
1
+ import type { TestAdapter, CreateTestResultOpts } from './';
2
+ import type { ReporterTestResult } from '../test-result';
3
+ export type PwtRawTest = {
4
+ file: string;
5
+ browserName: string;
6
+ title: string;
7
+ titlePath: string[];
8
+ };
9
+ export declare class PlaywrightTestAdapter implements TestAdapter {
10
+ private _test;
11
+ static create<T extends PlaywrightTestAdapter>(this: new (test: PwtRawTest) => T, test: PwtRawTest): T;
12
+ constructor(test: PwtRawTest);
13
+ get original(): PwtRawTest;
14
+ get id(): string;
15
+ get pending(): boolean;
16
+ get disabled(): boolean;
17
+ get silentlySkipped(): boolean;
18
+ get browserId(): string;
19
+ get fullName(): string;
20
+ get file(): string;
21
+ get titlePath(): string[];
22
+ createTestResult(opts: CreateTestResultOpts): ReporterTestResult;
23
+ }
@@ -0,0 +1,19 @@
1
+ import type { TestAdapter, CreateTestResultOpts } from './';
2
+ import type { Test, Config } from 'testplane';
3
+ import type { ReporterTestResult } from '../test-result';
4
+ export declare class TestplaneTestAdapter implements TestAdapter {
5
+ private _test;
6
+ private _saveHistoryMode?;
7
+ static create<T extends TestplaneTestAdapter>(this: new (test: Test, saveHistoryMode?: Config['saveHistoryMode']) => T, test: Test, saveHistoryMode?: Config['saveHistoryMode']): T;
8
+ constructor(test: Test, saveHistoryMode?: Config['saveHistoryMode']);
9
+ get original(): Test;
10
+ get id(): string;
11
+ get pending(): boolean;
12
+ get disabled(): boolean;
13
+ get silentlySkipped(): boolean;
14
+ get browserId(): string;
15
+ get fullName(): string;
16
+ get file(): string;
17
+ get titlePath(): string[];
18
+ createTestResult(opts: CreateTestResultOpts): ReporterTestResult;
19
+ }
@@ -0,0 +1,4 @@
1
+ import type { TestAdapter } from '../test';
2
+ export interface TestCollectionAdapter {
3
+ readonly tests: TestAdapter[];
4
+ }
@@ -0,0 +1,8 @@
1
+ import { PlaywrightTestAdapter, type PwtRawTest } from '../test/playwright';
2
+ import type { TestCollectionAdapter } from './';
3
+ export declare class PlaywrightTestCollectionAdapter implements TestCollectionAdapter {
4
+ private _testAdapters;
5
+ static create<T>(this: new (tests: PwtRawTest[]) => T, tests: PwtRawTest[]): T;
6
+ constructor(tests: PwtRawTest[]);
7
+ get tests(): PlaywrightTestAdapter[];
8
+ }
@@ -0,0 +1,11 @@
1
+ import { TestplaneTestAdapter } from '../test/testplane';
2
+ import type { TestCollectionAdapter } from './';
3
+ import type { Config, TestCollection } from 'testplane';
4
+ export declare class TestplaneTestCollectionAdapter implements TestCollectionAdapter {
5
+ private _testCollection;
6
+ private _testAdapters;
7
+ static create<T>(this: new (testCollection: TestCollection, saveHistoryMode?: Config['saveHistoryMode']) => T, testCollection: TestCollection, saveHistoryMode?: Config['saveHistoryMode']): T;
8
+ constructor(testCollection: TestCollection, saveHistoryMode?: Config['saveHistoryMode']);
9
+ get original(): TestCollection;
10
+ get tests(): TestplaneTestAdapter[];
11
+ }
@@ -0,0 +1,82 @@
1
+ import { TestCase as PlaywrightTestCase, TestResult as PlaywrightTestResult } from '@playwright/test/reporter';
2
+ import { ReporterTestResult } from './index';
3
+ import { TestStatus } from '../../constants';
4
+ import { Attachment, ErrorDetails, ImageFile, ImageInfoFull, TestError, TestStepCompressed } from '../../types';
5
+ import type { CoordBounds } from 'looks-same';
6
+ export type PlaywrightAttachment = PlaywrightTestResult['attachments'][number] & {
7
+ relativePath?: string;
8
+ size?: {
9
+ width: number;
10
+ height: number;
11
+ };
12
+ isUpdated?: boolean;
13
+ };
14
+ type ExtendedError<T> = TestError & {
15
+ meta?: T & {
16
+ type: string;
17
+ };
18
+ };
19
+ export type PwtImageDiffError = ExtendedError<{
20
+ snapshotName: string;
21
+ diffClusters: CoordBounds[];
22
+ }>;
23
+ export type PwtNoRefImageError = ExtendedError<{
24
+ snapshotName: string;
25
+ }>;
26
+ export type PlaywrightImageFile = ImageFile & {
27
+ relativePath: string;
28
+ };
29
+ export declare enum PwtTestStatus {
30
+ PASSED = "passed",
31
+ FAILED = "failed",
32
+ TIMED_OUT = "timedOut",
33
+ INTERRUPTED = "interrupted",
34
+ SKIPPED = "skipped"
35
+ }
36
+ export declare enum ImageTitleEnding {
37
+ Expected = "-expected.png",
38
+ Actual = "-actual.png",
39
+ Diff = "-diff.png",
40
+ Previous = "-previous.png"
41
+ }
42
+ export interface TestResultWithGuiStatus extends Omit<PlaywrightTestResult, 'status'> {
43
+ status: PlaywrightTestResult['status'] | TestStatus.RUNNING | TestStatus.UPDATED;
44
+ }
45
+ export declare const DEFAULT_DIFF_OPTIONS: {
46
+ diffColor: string;
47
+ };
48
+ export declare const getStatus: (result: TestResultWithGuiStatus) => TestStatus;
49
+ export declare class PlaywrightTestResultAdapter implements ReporterTestResult {
50
+ private readonly _testCase;
51
+ private readonly _testResult;
52
+ private _attempt;
53
+ static create<T extends PlaywrightTestResultAdapter>(this: new (testCase: PlaywrightTestCase, testResult: PlaywrightTestResult, attempt: number) => T, testCase: PlaywrightTestCase, testResult: PlaywrightTestResult, attempt: number): T;
54
+ constructor(testCase: PlaywrightTestCase, testResult: PlaywrightTestResult, attempt: number);
55
+ get attempt(): number;
56
+ get browserId(): string;
57
+ get description(): string | undefined;
58
+ get error(): TestError | undefined;
59
+ get errorDetails(): ErrorDetails | null;
60
+ get file(): string;
61
+ get fullName(): string;
62
+ get history(): TestStepCompressed[];
63
+ get id(): string;
64
+ get imageDir(): string;
65
+ get imagesInfo(): ImageInfoFull[];
66
+ get meta(): Record<string, unknown>;
67
+ get multipleTabs(): boolean;
68
+ get screenshot(): ImageFile | null;
69
+ get sessionId(): string;
70
+ get skipReason(): string;
71
+ get state(): {
72
+ name: string;
73
+ };
74
+ get status(): TestStatus;
75
+ get testPath(): string[];
76
+ get timestamp(): number;
77
+ get url(): string;
78
+ private get _attachmentsByState();
79
+ get duration(): number;
80
+ get attachments(): Attachment[];
81
+ }
82
+ export {};
@@ -0,0 +1,33 @@
1
+ import { TestStatus } from '../../constants';
2
+ import { TestError, ErrorDetails, ImageInfoFull, ImageBase64, ImageFile, TestStepCompressed, Attachment } from '../../types';
3
+ import { ReporterTestResult } from './index';
4
+ export declare class ReporterTestAdapter implements ReporterTestResult {
5
+ private _testResult;
6
+ private _errorDetails;
7
+ constructor(testResult: ReporterTestResult);
8
+ get attempt(): number;
9
+ get browserId(): string;
10
+ get description(): string | undefined;
11
+ get error(): TestError | undefined;
12
+ get errorDetails(): ErrorDetails | null;
13
+ get file(): string;
14
+ get fullName(): string;
15
+ get history(): TestStepCompressed[];
16
+ get id(): string;
17
+ get imageDir(): string;
18
+ get imagesInfo(): ImageInfoFull[];
19
+ get meta(): Record<string, unknown>;
20
+ get multipleTabs(): boolean;
21
+ get screenshot(): ImageBase64 | ImageFile | null | undefined;
22
+ get sessionId(): string;
23
+ get skipReason(): string | undefined;
24
+ get state(): {
25
+ name: string;
26
+ };
27
+ get status(): TestStatus;
28
+ get testPath(): string[];
29
+ get timestamp(): number;
30
+ get url(): string | undefined;
31
+ get duration(): number;
32
+ get attachments(): Attachment[];
33
+ }
@@ -0,0 +1,9 @@
1
+ import { TestStepCompressed, TestplaneSuite, TestplaneTestResult } from '../../../types';
2
+ import type { Config } from 'testplane';
3
+ export declare const getSkipComment: (suite: TestplaneTestResult | TestplaneSuite) => string | null | undefined;
4
+ export declare const wrapSkipComment: (skipComment: string | null | undefined) => string;
5
+ export declare const getTotalTime: (items: TestStepCompressed[], start: number, size: number) => number;
6
+ export declare const getItemAverageTime: (items: TestStepCompressed[], start: number, repeat: number, index: number, groupLen: number) => number;
7
+ export declare const MIN_REPEATS = 3;
8
+ export declare const collapseRepeatingGroups: (arr: TestStepCompressed[], minRepeats?: number) => TestStepCompressed[];
9
+ export declare const getHistory: (history: TestplaneTestResult['history'] | undefined, saveHistoryMode?: Config['saveHistoryMode']) => TestStepCompressed[];
@@ -0,0 +1,50 @@
1
+ import { TestStatus } from '../../../constants';
2
+ import { ReporterTestResult } from '../index';
3
+ import type Testplane from 'testplane';
4
+ import type { Test as TestplaneTest, Config } from 'testplane';
5
+ import type { Attachment, ErrorDetails, ImageBase64, ImageInfoFull, TestError, TestplaneTestResult, TestStepCompressed } from '../../../types';
6
+ import type { ValueOf } from 'type-fest';
7
+ export declare const getStatus: (eventName: ValueOf<Testplane['events']>, events: Testplane['events'], testResult: TestplaneTestResult) => TestStatus;
8
+ export interface TestplaneTestResultAdapterOptions {
9
+ attempt: number;
10
+ status: TestStatus;
11
+ duration: number;
12
+ saveHistoryMode?: Config['saveHistoryMode'];
13
+ }
14
+ export declare class TestplaneTestResultAdapter implements ReporterTestResult {
15
+ private _testResult;
16
+ private _errorDetails;
17
+ private _timestamp;
18
+ private _attempt;
19
+ private _status;
20
+ private _duration;
21
+ private _saveHistoryMode?;
22
+ static create(this: new (testResult: TestplaneTest | TestplaneTestResult, options: TestplaneTestResultAdapterOptions) => TestplaneTestResultAdapter, testResult: TestplaneTest | TestplaneTestResult, options: TestplaneTestResultAdapterOptions): TestplaneTestResultAdapter;
23
+ constructor(testResult: TestplaneTest | TestplaneTestResult, { attempt, status, duration, saveHistoryMode }: TestplaneTestResultAdapterOptions);
24
+ get fullName(): string;
25
+ get skipReason(): string;
26
+ get status(): TestStatus;
27
+ get sessionId(): string;
28
+ get browserId(): string;
29
+ get imagesInfo(): ImageInfoFull[];
30
+ get attempt(): number;
31
+ get history(): TestStepCompressed[];
32
+ get error(): undefined | TestError;
33
+ get imageDir(): string;
34
+ get state(): {
35
+ name: string;
36
+ };
37
+ get testPath(): string[];
38
+ get id(): string;
39
+ get screenshot(): ImageBase64 | undefined;
40
+ get description(): string | undefined;
41
+ get meta(): Record<string, unknown>;
42
+ get errorDetails(): ErrorDetails | null;
43
+ get file(): string;
44
+ get url(): string | undefined;
45
+ get multipleTabs(): boolean;
46
+ get timestamp(): number;
47
+ set timestamp(timestamp: number);
48
+ get duration(): number;
49
+ get attachments(): Attachment[];
50
+ }
@@ -0,0 +1,5 @@
1
+ import { ReporterTestResult } from '../index';
2
+ import { ErrorDetails, ImageInfoFull } from '../../../types';
3
+ export declare const copyAndUpdate: (original: ReporterTestResult, updates: Partial<ReporterTestResult>) => ReporterTestResult;
4
+ export declare const extractErrorDetails: (testResult: ReporterTestResult) => ErrorDetails | null;
5
+ export declare const removeBufferFromImagesInfo: (imagesInfo: ImageInfoFull) => ImageInfoFull;
@@ -0,0 +1,34 @@
1
+ import type { CommanderStatic } from '@gemini-testing/commander';
2
+ import { TestCollectionAdapter } from '../test-collection';
3
+ import { ConfigAdapter } from '../config';
4
+ import type { GuiApi } from '../../gui/api';
5
+ import type { EventSource } from '../../gui/event-source';
6
+ import { GuiReportBuilder } from '../../report-builder/gui';
7
+ import { BrowserFeature, ToolName } from '../../constants';
8
+ import type { ImageFile, ReporterConfig } from '../../types';
9
+ import type { TestSpec } from './types';
10
+ import type { HtmlReporter } from '../../plugin-api';
11
+ export interface ToolAdapterOptionsFromCli {
12
+ toolName: ToolName;
13
+ configPath?: string;
14
+ }
15
+ export interface UpdateReferenceOpts {
16
+ refImg: ImageFile;
17
+ state: string;
18
+ }
19
+ export interface ToolAdapter {
20
+ readonly toolName: ToolName;
21
+ readonly config: ConfigAdapter;
22
+ readonly reporterConfig: ReporterConfig;
23
+ readonly htmlReporter: HtmlReporter;
24
+ readonly guiApi?: GuiApi;
25
+ readonly browserFeatures: Record<string, BrowserFeature[]>;
26
+ initGuiApi(): void;
27
+ readTests(paths: string[], cliTool: CommanderStatic): Promise<TestCollectionAdapter>;
28
+ run(testCollection: TestCollectionAdapter, tests: TestSpec[], cliTool: CommanderStatic): Promise<boolean>;
29
+ runWithoutRetries(testCollection: TestCollectionAdapter, tests: TestSpec[], cliTool: CommanderStatic): Promise<boolean>;
30
+ updateReference(opts: UpdateReferenceOpts): void;
31
+ handleTestResults(reportBuilder: GuiReportBuilder, eventSource: EventSource): void;
32
+ halt(err: Error, timeout: number): void;
33
+ }
34
+ export declare const makeToolAdapter: (opts: ToolAdapterOptionsFromCli) => Promise<ToolAdapter>;
@@ -0,0 +1,46 @@
1
+ import { PlaywrightConfigAdapter } from '../../config/playwright';
2
+ import { PlaywrightTestCollectionAdapter } from '../../test-collection/playwright';
3
+ import { HtmlReporter } from '../../../plugin-api';
4
+ import { ToolName, BrowserFeature } from '../../../constants';
5
+ import { GuiApi } from '../../../gui/api';
6
+ import { ToolAdapter, ToolAdapterOptionsFromCli } from '../index';
7
+ import type { GuiReportBuilder } from '../../../report-builder/gui';
8
+ import type { EventSource } from '../../../gui/event-source';
9
+ import type { ReporterConfig } from '../../../types';
10
+ import type { TestSpec } from '../types';
11
+ import type { FullConfig } from '@playwright/test/reporter';
12
+ type PlaywrightToolAdapterOptions = ToolAdapterOptionsFromCli & {
13
+ config: FullConfig;
14
+ configPath: string;
15
+ };
16
+ export declare const DEFAULT_CONFIG_PATHS: string[];
17
+ export declare class PlaywrightToolAdapter implements ToolAdapter {
18
+ private _toolName;
19
+ private _configPath;
20
+ private _config;
21
+ private _reporterConfig;
22
+ private _hasProjectsInConfig;
23
+ private _htmlReporter;
24
+ private _pwtBinaryPath;
25
+ private _reportBuilder;
26
+ private _eventSource;
27
+ private _guiApi?;
28
+ static create(this: new (options: PlaywrightToolAdapterOptions) => PlaywrightToolAdapter, options: ToolAdapterOptionsFromCli): Promise<PlaywrightToolAdapter>;
29
+ constructor(opts: PlaywrightToolAdapterOptions);
30
+ get configPath(): string;
31
+ get toolName(): ToolName;
32
+ get config(): PlaywrightConfigAdapter;
33
+ get reporterConfig(): ReporterConfig;
34
+ get htmlReporter(): HtmlReporter;
35
+ get guiApi(): GuiApi | undefined;
36
+ get browserFeatures(): Record<string, BrowserFeature[]>;
37
+ initGuiApi(): void;
38
+ readTests(): Promise<PlaywrightTestCollectionAdapter>;
39
+ run(_testCollection: PlaywrightTestCollectionAdapter, tests?: TestSpec[]): Promise<boolean>;
40
+ runWithoutRetries(_testCollection: PlaywrightTestCollectionAdapter, tests?: TestSpec[]): Promise<boolean>;
41
+ private _runTests;
42
+ handleTestResults(reportBuilder: GuiReportBuilder, eventSource: EventSource): void;
43
+ updateReference(): void;
44
+ halt(err: Error): void;
45
+ }
46
+ export {};
@@ -0,0 +1,8 @@
1
+ import type { ChildProcess } from 'node:child_process';
2
+ declare const _default: {
3
+ emit: (event: string, data?: Record<string, unknown>) => void;
4
+ on: <T extends Record<string, unknown>>(event: string, handler: (msg: T & {
5
+ event: string;
6
+ }) => void, proc?: ChildProcess | NodeJS.Process) => void;
7
+ };
8
+ export default _default;
@@ -0,0 +1,13 @@
1
+ import type { Reporter, TestCase } from '@playwright/test/reporter';
2
+ import type { TestResultWithGuiStatus } from '../../test-result/playwright';
3
+ export type PwtEventMessage = {
4
+ test: TestCase;
5
+ result: TestResultWithGuiStatus;
6
+ browserName: string;
7
+ titlePath: string[];
8
+ };
9
+ export default class MyReporter implements Reporter {
10
+ onTestBegin(test: TestCase, result: TestResultWithGuiStatus): void;
11
+ onTestEnd(test: TestCase, result: TestResultWithGuiStatus): void;
12
+ onEnd(): void;
13
+ }
@@ -0,0 +1 @@
1
+ export declare const setupTransformHook: () => VoidFunction;
@@ -0,0 +1,55 @@
1
+ import type Testplane from 'testplane';
2
+ import type { CommanderStatic } from '@gemini-testing/commander';
3
+ import type { TestplaneTestCollectionAdapter } from '../../test-collection/testplane';
4
+ import { GuiApi } from '../../../gui/api';
5
+ import { HtmlReporter } from '../../../plugin-api';
6
+ import { ApiFacade } from '../../../gui/api/facade';
7
+ import { EventSource } from '../../../gui/event-source';
8
+ import { GuiReportBuilder } from '../../../report-builder/gui';
9
+ import { BrowserFeature, ToolName } from '../../../constants';
10
+ import { ToolAdapter, ToolAdapterOptionsFromCli, UpdateReferenceOpts } from '../index';
11
+ import type { CustomGuiActionPayload, TestSpec } from '../types';
12
+ import type { ReporterConfig } from '../../../types';
13
+ import type { ConfigAdapter } from '../../config/index';
14
+ type HtmlReporterApi = {
15
+ gui: ApiFacade;
16
+ htmlReporter: HtmlReporter;
17
+ };
18
+ export type TestplaneWithHtmlReporter = Testplane & HtmlReporterApi;
19
+ interface OptionsFromPlugin {
20
+ toolName: ToolName.Testplane;
21
+ tool: Testplane;
22
+ reporterConfig: ReporterConfig;
23
+ }
24
+ type RunTestArgs = [TestplaneTestCollectionAdapter, TestSpec[], CommanderStatic];
25
+ type Options = ToolAdapterOptionsFromCli | OptionsFromPlugin;
26
+ export declare class TestplaneToolAdapter implements ToolAdapter {
27
+ private _toolName;
28
+ private _tool;
29
+ private _config;
30
+ private _reporterConfig;
31
+ private _htmlReporter;
32
+ private _guiApi?;
33
+ private _browserConfigs;
34
+ private _retryCache;
35
+ static create<TestplaneToolAdapter>(this: new (options: Options) => TestplaneToolAdapter, options: Options): TestplaneToolAdapter;
36
+ constructor(opts: Options);
37
+ get toolName(): ToolName;
38
+ get config(): ConfigAdapter;
39
+ get reporterConfig(): ReporterConfig;
40
+ get htmlReporter(): HtmlReporter;
41
+ get guiApi(): GuiApi | undefined;
42
+ get browserFeatures(): Record<string, BrowserFeature[]>;
43
+ initGuiApi(): void;
44
+ readTests(paths: string[], cliTool: CommanderStatic): Promise<TestplaneTestCollectionAdapter>;
45
+ run(testCollectionAdapter: TestplaneTestCollectionAdapter, tests: TestSpec[] | undefined, cliTool: CommanderStatic): Promise<boolean>;
46
+ runWithoutRetries(...args: RunTestArgs): Promise<boolean>;
47
+ updateReference(opts: UpdateReferenceOpts): void;
48
+ handleTestResults(reportBuilder: GuiReportBuilder, eventSource: EventSource): void;
49
+ halt(err: Error, timeout: number): void;
50
+ initGuiHandler(): Promise<void>;
51
+ runCustomGuiAction(payload: CustomGuiActionPayload): Promise<void>;
52
+ private _disableRetries;
53
+ private _restoreRetries;
54
+ }
55
+ export {};
@@ -0,0 +1,5 @@
1
+ import { BaseRunner } from './runner';
2
+ import type { TestCollection } from 'testplane';
3
+ export declare class AllTestRunner extends BaseRunner {
4
+ run<U>(runHandler: (testCollection: TestCollection) => U): U;
5
+ }
@@ -0,0 +1,4 @@
1
+ import type { TestCollection } from 'testplane';
2
+ import type { TestRunner } from './runner';
3
+ import type { TestSpec } from '../../types';
4
+ export declare const createTestRunner: (collection: TestCollection, tests: TestSpec[]) => TestRunner;
@@ -0,0 +1,9 @@
1
+ import type { TestCollection } from 'testplane';
2
+ export interface TestRunner {
3
+ run<U>(handler: (testCollection: TestCollection) => U): U;
4
+ }
5
+ export declare class BaseRunner implements TestRunner {
6
+ protected _collection: TestCollection;
7
+ constructor(collection: TestCollection);
8
+ run<U>(runHandler: (testCollection: TestCollection) => U): U;
9
+ }
@@ -0,0 +1,9 @@
1
+ import { BaseRunner } from './runner';
2
+ import type { TestSpec } from '../../types';
3
+ import type { TestCollection } from 'testplane';
4
+ export declare class SpecificTestRunner extends BaseRunner {
5
+ private _tests;
6
+ constructor(collection: TestCollection, tests: TestSpec[]);
7
+ run<U>(runHandler: (testCollection: TestCollection) => U): U;
8
+ private _filter;
9
+ }
@@ -0,0 +1,4 @@
1
+ import { GuiReportBuilder } from '../../../report-builder/gui';
2
+ import { EventSource } from '../../../gui/event-source';
3
+ import { TestplaneWithHtmlReporter } from '../../tool/testplane/index';
4
+ export declare const handleTestResults: (testplane: TestplaneWithHtmlReporter, reportBuilder: GuiReportBuilder, client: EventSource) => void;
@@ -0,0 +1,9 @@
1
+ export interface TestSpec {
2
+ testName: string;
3
+ browserName: string;
4
+ }
5
+ export interface CustomGuiActionPayload {
6
+ sectionName: string;
7
+ groupIndex: number;
8
+ controlIndex: number;
9
+ }
@@ -0,0 +1,8 @@
1
+ export declare class Cache<Key, Value> {
2
+ private _getKeyHash;
3
+ private _cache;
4
+ constructor(hashFn: (key: Key) => string);
5
+ has(key: Key): boolean;
6
+ get(key: Key): Value | undefined;
7
+ set(key: Key, value: Value): this;
8
+ }
@@ -0,0 +1 @@
1
+ export declare const assertCustomGui: (customGui: unknown) => void;
@@ -0,0 +1,5 @@
1
+ import { ReporterConfig, ReporterOptions } from '../types';
2
+ type AssertionFn<T> = (value: unknown) => asserts value is T;
3
+ export declare const assertNumber: (name: string) => AssertionFn<number>;
4
+ export declare const parseConfig: (options: Partial<ReporterOptions>) => ReporterConfig;
5
+ export {};
@@ -0,0 +1,9 @@
1
+ declare const _default: {
2
+ readonly JS_EXEC: "js exec";
3
+ readonly DBS_LOADED: "dbs loaded";
4
+ readonly DBS_MERGED: "dbs merged";
5
+ readonly PLUGINS_LOADED: "plugins loaded";
6
+ readonly DB_EXTRACTED_ROWS: "db extracted rows";
7
+ readonly FULLY_LOADED: "fully loaded";
8
+ };
9
+ export default _default;