html-reporter 11.1.0 → 11.2.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 (94) hide show
  1. package/build/lib/cli/commands/remove-unused-screens/index.js +1 -1
  2. package/build/lib/cli/commands/remove-unused-screens/index.js.map +1 -1
  3. package/build/lib/cli/commands/remove-unused-screens/utils.d.ts +1 -1
  4. package/build/lib/cli/commands/remove-unused-screens/utils.js +2 -2
  5. package/build/lib/cli/commands/remove-unused-screens/utils.js.map +1 -1
  6. package/build/lib/gui/index.js +0 -3
  7. package/build/lib/gui/index.js.map +1 -1
  8. package/build/lib/gui/listen-with-fallback.d.ts +12 -0
  9. package/build/lib/gui/listen-with-fallback.js +57 -0
  10. package/build/lib/gui/listen-with-fallback.js.map +1 -0
  11. package/build/lib/gui/routes/plugins.js +2 -1
  12. package/build/lib/gui/routes/plugins.js.map +1 -1
  13. package/build/lib/gui/server.js +15 -7
  14. package/build/lib/gui/server.js.map +1 -1
  15. package/build/lib/static/203.min.js +1 -0
  16. package/build/lib/static/23.min.js +1 -0
  17. package/build/lib/static/299.min.js +1 -0
  18. package/build/lib/static/326.min.js +1 -0
  19. package/build/lib/static/373.min.css +1 -0
  20. package/build/lib/static/373.min.js +1 -0
  21. package/build/lib/static/641.min.js +1 -1
  22. package/build/lib/static/864.min.css +1 -0
  23. package/build/lib/static/864.min.js +1 -0
  24. package/build/lib/static/gui.html +1 -1
  25. package/build/lib/static/gui.min.js +1 -1
  26. package/build/lib/static/index.html +1 -1
  27. package/build/lib/static/modules/utils/pluginMiddlewareRoute.d.ts +2 -0
  28. package/build/lib/static/modules/utils/pluginMiddlewareRoute.js +12 -0
  29. package/build/lib/static/modules/utils/pluginMiddlewareRoute.js.map +1 -0
  30. package/build/lib/static/new-ui-gui.html +1 -1
  31. package/build/lib/static/new-ui-report.html +1 -1
  32. package/build/lib/static/newGui.min.js +1 -1
  33. package/build/lib/static/newReport.min.js +1 -1
  34. package/build/lib/static/report.min.js +1 -1
  35. package/build/package.json +21 -4
  36. package/package.json +21 -4
  37. package/plugins-sdk/build/lib/static/new-ui/constants/plugins.d.ts +4 -0
  38. package/plugins-sdk/build/lib/static/new-ui/constants/plugins.d.ts.map +1 -0
  39. package/plugins-sdk/build/lib/static/new-ui/constants/plugins.js +5 -0
  40. package/plugins-sdk/build/lib/static/new-ui/constants/plugins.js.map +1 -0
  41. package/plugins-sdk/build/plugins-sdk/index.d.ts +5 -0
  42. package/plugins-sdk/build/plugins-sdk/index.d.ts.map +1 -0
  43. package/plugins-sdk/build/plugins-sdk/index.js +2 -0
  44. package/plugins-sdk/build/plugins-sdk/index.js.map +1 -0
  45. package/plugins-sdk/build-ui/lib/adapters/test-result/index.d.ts +33 -0
  46. package/plugins-sdk/build-ui/lib/adapters/test-result/sqlite.d.ts +34 -0
  47. package/plugins-sdk/build-ui/lib/adapters/test-result/transformers/db.d.ts +11 -0
  48. package/plugins-sdk/build-ui/lib/adapters/test-result/transformers/tree.d.ts +11 -0
  49. package/plugins-sdk/build-ui/lib/common-utils.d.ts +57 -0
  50. package/plugins-sdk/build-ui/lib/constants/browser.d.ts +6 -0
  51. package/plugins-sdk/build-ui/lib/constants/checked-statuses.d.ts +10 -0
  52. package/plugins-sdk/build-ui/lib/constants/database.d.ts +105 -0
  53. package/plugins-sdk/build-ui/lib/constants/defaults.d.ts +3 -0
  54. package/plugins-sdk/build-ui/lib/constants/diff-modes.d.ts +41 -0
  55. package/plugins-sdk/build-ui/lib/constants/errors.d.ts +3 -0
  56. package/plugins-sdk/build-ui/lib/constants/features.d.ts +12 -0
  57. package/plugins-sdk/build-ui/lib/constants/group-tests.d.ts +7 -0
  58. package/plugins-sdk/build-ui/lib/constants/index.d.ts +14 -0
  59. package/plugins-sdk/build-ui/lib/constants/local-storage.d.ts +9 -0
  60. package/plugins-sdk/build-ui/lib/constants/paths.d.ts +3 -0
  61. package/plugins-sdk/build-ui/lib/constants/plugin-events.d.ts +6 -0
  62. package/plugins-sdk/build-ui/lib/constants/save-formats.d.ts +3 -0
  63. package/plugins-sdk/build-ui/lib/constants/test-statuses.d.ts +41 -0
  64. package/plugins-sdk/build-ui/lib/constants/tests.d.ts +5 -0
  65. package/plugins-sdk/build-ui/lib/constants/tool-names.d.ts +5 -0
  66. package/plugins-sdk/build-ui/lib/constants/view-modes.d.ts +9 -0
  67. package/plugins-sdk/build-ui/lib/db-utils/common.d.ts +39 -0
  68. package/plugins-sdk/build-ui/lib/db-utils/migrations.d.ts +5 -0
  69. package/plugins-sdk/build-ui/lib/db-utils/server.d.ts +17 -0
  70. package/plugins-sdk/build-ui/lib/errors/index.d.ts +43 -0
  71. package/plugins-sdk/build-ui/lib/local-image-file-saver.d.ts +2 -0
  72. package/plugins-sdk/build-ui/lib/plugin-api.d.ts +41 -0
  73. package/plugins-sdk/build-ui/lib/server-utils.d.ts +70 -0
  74. package/plugins-sdk/build-ui/lib/sqlite-client.d.ts +60 -0
  75. package/plugins-sdk/build-ui/lib/static/modules/local-storage-wrapper.d.ts +22 -0
  76. package/plugins-sdk/build-ui/lib/static/modules/plugins-sdk-ui.d.ts +3 -0
  77. package/plugins-sdk/build-ui/lib/static/modules/plugins-sdk-ui.js +1 -0
  78. package/plugins-sdk/build-ui/lib/static/modules/static-image-accepter.d.ts +47 -0
  79. package/plugins-sdk/build-ui/lib/static/new-ui/components/PanelSection/index.d.ts +8 -0
  80. package/plugins-sdk/build-ui/lib/static/new-ui/features/suites/components/SuitesPage/types.d.ts +33 -0
  81. package/plugins-sdk/build-ui/lib/static/new-ui/types/index.d.ts +4 -0
  82. package/plugins-sdk/build-ui/lib/static/new-ui/types/store.d.ts +320 -0
  83. package/plugins-sdk/build-ui/lib/tests-tree-builder/base.d.ts +91 -0
  84. package/plugins-sdk/build-ui/lib/tests-tree-builder/static.d.ts +51 -0
  85. package/plugins-sdk/build-ui/lib/types.d.ts +315 -0
  86. package/build/lib/static/194.min.js +0 -1
  87. package/build/lib/static/354.min.css +0 -1
  88. package/build/lib/static/354.min.js +0 -1
  89. package/build/lib/static/556.min.css +0 -1
  90. package/build/lib/static/556.min.js +0 -1
  91. package/build/lib/static/825.min.js +0 -1
  92. package/build/lib/static/925.min.js +0 -1
  93. package/build/lib/static/971.min.js +0 -1
  94. /package/build/lib/static/{825.min.css → 299.min.css} +0 -0
package/package.json CHANGED
@@ -1,21 +1,36 @@
1
1
  {
2
2
  "name": "html-reporter",
3
- "version": "11.1.0",
3
+ "version": "11.2.0",
4
4
  "description": "Html-reporter and GUI for viewing and managing results of a tests run. Currently supports Testplane and Hermione.",
5
5
  "files": [
6
- "build"
6
+ "build",
7
+ "plugins-sdk/build",
8
+ "plugins-sdk/build-ui"
7
9
  ],
8
10
  "exports": {
9
11
  "./testplane": "./build/testplane.js",
10
12
  "./hermione": "./build/hermione.js",
11
13
  "./playwright": "./build/playwright.js",
12
- "./jest": "./build/jest.js"
14
+ "./jest": "./build/jest.js",
15
+ "./plugins-sdk": {
16
+ "types": "./plugins-sdk/build/plugins-sdk/index.d.ts",
17
+ "default": "./plugins-sdk/build/plugins-sdk/index.js"
18
+ },
19
+ "./plugins-sdk/ui": {
20
+ "types": "./plugins-sdk/build-ui/lib/static/modules/plugins-sdk-ui.d.ts",
21
+ "default": "./plugins-sdk/build-ui/lib/static/modules/plugins-sdk-ui.js"
22
+ }
13
23
  },
14
24
  "scripts": {
15
- "build": "rimraf build && npm run build:client && npm run build:server && npm run build-bundle -- --minify",
25
+ "build": "rimraf build && npm run build:client && npm run build:server && npm run build-bundle -- --minify && npm run build:sdk",
16
26
  "build:client": "cross-env NODE_ENV=production webpack build --config=webpack.prod.js --progress && npm run copy-static",
17
27
  "build:client:dev": "cross-env NODE_ENV=development webpack build --config=webpack.dev.js --progress && npm run copy-static",
18
28
  "build:server": "npx tsc",
29
+ "build:sdk": "npm run build:sdk:clean && npm run build:sdk:main && npm run build:sdk:ui-types && npm run build:sdk:ui-stub",
30
+ "build:sdk:clean": "rimraf plugins-sdk/build plugins-sdk/build-ui",
31
+ "build:sdk:main": "tsc --project plugins-sdk/tsconfig.json",
32
+ "build:sdk:ui-types": "tspc --project plugins-sdk/tsconfig.ui.json",
33
+ "build:sdk:ui-stub": "echo 'module.exports = {};' > plugins-sdk/build-ui/lib/static/modules/plugins-sdk-ui.js",
19
34
  "build-bundle": "esbuild ./lib/bundle/index.ts --outdir=./build/lib/bundle --bundle --format=cjs --platform=node --target=ES2021",
20
35
  "copy-static": "copyfiles 'lib/static/icons/*' .npmignore build",
21
36
  "coverage": "nyc npm run test-unit",
@@ -261,8 +276,10 @@
261
276
  "testplane": "^8.30.3",
262
277
  "tree-kill": "^1.2.2",
263
278
  "ts-node": "^10.9.1",
279
+ "ts-patch": "^3.3.0",
264
280
  "type-fest": "^3.13.1",
265
281
  "typescript": "^5.0.4",
282
+ "typescript-transform-paths": "^3.5.5",
266
283
  "web-vitals": "^1.1.2",
267
284
  "webpack": "^5.89.0",
268
285
  "webpack-cli": "^5.1.4",
@@ -0,0 +1,4 @@
1
+ export declare enum ExtensionPointName {
2
+ SettingsPanel = "settings-panel"
3
+ }
4
+ //# sourceMappingURL=plugins.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugins.d.ts","sourceRoot":"","sources":["../../../../../../lib/static/new-ui/constants/plugins.ts"],"names":[],"mappings":"AAAA,oBAAY,kBAAkB;IAC1B,aAAa,mBAAmB;CACnC"}
@@ -0,0 +1,5 @@
1
+ export var ExtensionPointName;
2
+ (function (ExtensionPointName) {
3
+ ExtensionPointName["SettingsPanel"] = "settings-panel";
4
+ })(ExtensionPointName || (ExtensionPointName = {}));
5
+ //# sourceMappingURL=plugins.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugins.js","sourceRoot":"","sources":["../../../../../../lib/static/new-ui/constants/plugins.ts"],"names":[],"mappings":"AAAA,MAAM,CAAN,IAAY,kBAEX;AAFD,WAAY,kBAAkB;IAC1B,sDAAgC,CAAA;AACpC,CAAC,EAFW,kBAAkB,KAAlB,kBAAkB,QAE7B"}
@@ -0,0 +1,5 @@
1
+ export { ExtensionPointName } from '../lib/static/new-ui/constants/plugins';
2
+ export interface PluginOptions {
3
+ pluginServerEndpointPrefix: string;
4
+ }
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,kBAAkB,EAAC,MAAM,wCAAwC,CAAC;AAE1E,MAAM,WAAW,aAAa;IAC1B,0BAA0B,EAAE,MAAM,CAAC;CACtC"}
@@ -0,0 +1,2 @@
1
+ export { ExtensionPointName } from '../lib/static/new-ui/constants/plugins';
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,kBAAkB,EAAC,MAAM,wCAAwC,CAAC"}
@@ -0,0 +1,33 @@
1
+ import type { TestStatus } from '../../constants';
2
+ import type { ErrorDetails, ImageBase64, ImageFile, ImageInfoFull, TestError, TestStepCompressed, Attachment } from '../../types';
3
+ export interface ReporterTestResult {
4
+ readonly attempt: number;
5
+ readonly browserId: string;
6
+ readonly description: string | undefined;
7
+ readonly error: undefined | TestError;
8
+ readonly errorDetails: ErrorDetails | null;
9
+ readonly file: string;
10
+ readonly fullName: string;
11
+ readonly history: TestStepCompressed[];
12
+ readonly id: string;
13
+ readonly imageDir: string;
14
+ readonly imagesInfo: ImageInfoFull[];
15
+ readonly meta: {
16
+ browserVersion?: string;
17
+ } & Record<string, unknown>;
18
+ readonly multipleTabs: boolean;
19
+ readonly screenshot: ImageBase64 | ImageFile | null | undefined;
20
+ readonly sessionId: string;
21
+ readonly skipReason?: string;
22
+ readonly state: {
23
+ name: string;
24
+ };
25
+ readonly status: TestStatus;
26
+ readonly testPath: string[];
27
+ /** Test start timestamp in ms */
28
+ readonly timestamp: number;
29
+ readonly url?: string;
30
+ /** Test duration in ms */
31
+ readonly duration: number;
32
+ readonly attachments: Attachment[];
33
+ }
@@ -0,0 +1,34 @@
1
+ import { TestStatus } from '../../constants';
2
+ import { AssertViewResult, TestError, ErrorDetails, ImageInfoFull, ImageBase64, ImageFile, RawSuitesRow, TestStepCompressed, Attachment } from '../../types';
3
+ import { ReporterTestResult } from './index';
4
+ export declare class SqliteTestResultAdapter implements ReporterTestResult {
5
+ private _testResult;
6
+ private _parsedTestResult;
7
+ constructor(testResult: RawSuitesRow, attempt: number);
8
+ get assertViewResults(): AssertViewResult[];
9
+ get attempt(): number;
10
+ get browserId(): string;
11
+ get description(): string | undefined;
12
+ get error(): TestError | undefined;
13
+ get errorDetails(): ErrorDetails | null;
14
+ get file(): string;
15
+ get fullName(): string;
16
+ get history(): TestStepCompressed[];
17
+ get id(): string;
18
+ get imageDir(): string;
19
+ get imagesInfo(): ImageInfoFull[];
20
+ get meta(): Record<string, unknown>;
21
+ get multipleTabs(): boolean;
22
+ get screenshot(): ImageBase64 | ImageFile | null | undefined;
23
+ get sessionId(): string;
24
+ get skipReason(): string | undefined;
25
+ get state(): {
26
+ name: string;
27
+ };
28
+ get status(): TestStatus;
29
+ get testPath(): string[];
30
+ get timestamp(): number;
31
+ get url(): string | undefined;
32
+ get duration(): number;
33
+ get attachments(): Attachment[];
34
+ }
@@ -0,0 +1,11 @@
1
+ import { ReporterTestResult } from '../index';
2
+ import { DbTestResult } from '../../../sqlite-client';
3
+ interface Options {
4
+ baseHost?: string;
5
+ }
6
+ export declare class DbTestResultTransformer {
7
+ private _options;
8
+ constructor(options: Options);
9
+ transform(testResult: ReporterTestResult): DbTestResult;
10
+ }
11
+ export {};
@@ -0,0 +1,11 @@
1
+ import { ReporterTestResult } from '../index';
2
+ import { BaseTreeTestResult } from '../../../tests-tree-builder/base';
3
+ interface Options {
4
+ baseHost?: string;
5
+ }
6
+ export declare class TreeTestResultTransformer {
7
+ private _transformer;
8
+ constructor(options: Options);
9
+ transform(testResult: ReporterTestResult): BaseTreeTestResult;
10
+ }
11
+ export {};
@@ -0,0 +1,57 @@
1
+ import type { AxiosRequestConfig } from 'axios';
2
+ import { TestStatus } from './constants';
3
+ import { CheckStatus } from './constants/checked-statuses';
4
+ import { ImageDiffError, InvalidRefImageError, NoRefImageError } from './errors';
5
+ import type { ImageBase64, ImageBuffer, ImageFile, ImageInfoFull, ImageInfoWithState, TestError } from './types';
6
+ import type { ReporterTestResult } from './adapters/test-result';
7
+ export declare const getShortMD5: (str: string) => string;
8
+ export declare const logger: Pick<Console, "error" | "log" | "warn">;
9
+ export declare const isSuccessStatus: (status: TestStatus) => boolean;
10
+ export declare const isFailStatus: (status: TestStatus) => status is TestStatus.FAIL;
11
+ export declare const isIdleStatus: (status: TestStatus) => boolean;
12
+ export declare const isRunningStatus: (status: TestStatus) => boolean;
13
+ export declare const isErrorStatus: (status: TestStatus) => boolean;
14
+ export declare const isSkippedStatus: (status: TestStatus) => boolean;
15
+ export declare const isUpdatedStatus: (status: TestStatus) => boolean;
16
+ export declare const isStagedStatus: (status: TestStatus) => boolean;
17
+ export declare const isCommitedStatus: (status: TestStatus) => boolean;
18
+ export declare const determineFinalStatus: (statuses: TestStatus[]) => TestStatus | null;
19
+ export declare const getUrlWithBase: (url: string | undefined, base: string | undefined) => string;
20
+ export declare const getRelativeUrl: (absoluteUrl: string) => string;
21
+ export declare const mkTestId: (fullTitle: string, browserId: string) => string;
22
+ export declare const isAssertViewError: (error?: unknown) => boolean;
23
+ export declare const isImageDiffError: (error?: unknown) => error is ImageDiffError;
24
+ export declare const isNoRefImageError: (error?: unknown) => error is NoRefImageError;
25
+ export declare const isInvalidRefImageError: (error?: unknown) => error is InvalidRefImageError;
26
+ export declare const isImageError: (error?: unknown) => boolean;
27
+ export declare const hasNoRefImageErrors: ({ assertViewResults }: {
28
+ assertViewResults?: {
29
+ name?: string | undefined;
30
+ }[] | undefined;
31
+ }) => boolean;
32
+ export declare const hasFailedImages: (imagesInfo?: ImageInfoFull[]) => boolean;
33
+ export declare const hasUnrelatedToScreenshotsErrors: (error: TestError) => boolean;
34
+ export declare const getError: (error?: TestError) => undefined | Pick<TestError, 'name' | 'message' | 'stack' | 'stateName' | 'snippet'>;
35
+ export declare const hasDiff: (assertViewResults: {
36
+ name?: string;
37
+ }[]) => boolean;
38
+ export declare const determineStatus: (testResult: Pick<ReporterTestResult, 'status' | 'error' | 'imagesInfo'>) => TestStatus;
39
+ export declare const isBase64Image: (image: ImageFile | ImageBuffer | ImageBase64 | null | undefined) => image is ImageBase64;
40
+ export declare const isUrl: (str: string) => boolean;
41
+ export declare const fetchFile: <T = unknown>(url: string, options?: AxiosRequestConfig) => Promise<{
42
+ data: T | null;
43
+ status: number;
44
+ }>;
45
+ export declare const normalizeUrls: (urls: string[] | undefined, baseUrl: string) => string[];
46
+ export declare const isCheckboxChecked: (status: number) => boolean;
47
+ export declare const isCheckboxIndeterminate: (status: number) => boolean;
48
+ export declare const isCheckboxUnchecked: (status: number) => boolean;
49
+ export declare const getToggledCheckboxState: (status: number) => CheckStatus;
50
+ export declare function getDetailsFileName(testId: string, browserId: string, attempt: number): string;
51
+ export declare const getTestHash: (testResult: ReporterTestResult) => string;
52
+ export declare const isImageBufferData: (imageData: ImageBuffer | ImageFile | ImageBase64 | undefined) => imageData is ImageBuffer;
53
+ export declare const isImageInfoWithState: (imageInfo: ImageInfoFull) => imageInfo is ImageInfoWithState;
54
+ export declare const trimArray: <T>(array: T[]) => T[];
55
+ export declare const mergeSnippetIntoErrorStack: <T extends Error>(error: T & {
56
+ snippet?: string | undefined;
57
+ }) => T;
@@ -0,0 +1,6 @@
1
+ export declare enum BrowserVersions {
2
+ UNKNOWN = "unknown"
3
+ }
4
+ export declare enum BrowserFeature {
5
+ LiveSnapshotsStreaming = "live-snapshots-streaming"
6
+ }
@@ -0,0 +1,10 @@
1
+ export declare const UNCHECKED = 0;
2
+ export declare const INDETERMINATE = 0.5;
3
+ export declare const CHECKED = 1;
4
+ declare const _default: {
5
+ UNCHECKED: number;
6
+ INDETERMINATE: number;
7
+ CHECKED: number;
8
+ };
9
+ export default _default;
10
+ export type CheckStatus = typeof UNCHECKED | typeof INDETERMINATE | typeof CHECKED;
@@ -0,0 +1,105 @@
1
+ export declare const DB_TYPES: {
2
+ readonly int: "INT";
3
+ readonly text: "TEXT";
4
+ };
5
+ export declare const DB_COLUMNS: {
6
+ readonly SUITE_PATH: "suitePath";
7
+ readonly SUITE_NAME: "suiteName";
8
+ readonly NAME: "name";
9
+ readonly SUITE_URL: "suiteUrl";
10
+ readonly META_INFO: "metaInfo";
11
+ readonly HISTORY: "history";
12
+ readonly DESCRIPTION: "description";
13
+ readonly ERROR: "error";
14
+ readonly SKIP_REASON: "skipReason";
15
+ readonly IMAGES_INFO: "imagesInfo";
16
+ readonly SCREENSHOT: "screenshot";
17
+ readonly MULTIPLE_TABS: "multipleTabs";
18
+ readonly STATUS: "status";
19
+ readonly TIMESTAMP: "timestamp";
20
+ readonly DURATION: "duration";
21
+ readonly ATTACHMENTS: "attachments";
22
+ };
23
+ export declare const SUITES_TABLE_COLUMNS: readonly [{
24
+ readonly name: "suitePath";
25
+ readonly type: "TEXT";
26
+ }, {
27
+ readonly name: "suiteName";
28
+ readonly type: "TEXT";
29
+ }, {
30
+ readonly name: "name";
31
+ readonly type: "TEXT";
32
+ }, {
33
+ readonly name: "suiteUrl";
34
+ readonly type: "TEXT";
35
+ }, {
36
+ readonly name: "metaInfo";
37
+ readonly type: "TEXT";
38
+ }, {
39
+ readonly name: "history";
40
+ readonly type: "TEXT";
41
+ }, {
42
+ readonly name: "description";
43
+ readonly type: "TEXT";
44
+ }, {
45
+ readonly name: "error";
46
+ readonly type: "TEXT";
47
+ }, {
48
+ readonly name: "skipReason";
49
+ readonly type: "TEXT";
50
+ }, {
51
+ readonly name: "imagesInfo";
52
+ readonly type: "TEXT";
53
+ }, {
54
+ readonly name: "screenshot";
55
+ readonly type: "INT";
56
+ }, {
57
+ readonly name: "multipleTabs";
58
+ readonly type: "INT";
59
+ }, {
60
+ readonly name: "status";
61
+ readonly type: "TEXT";
62
+ }, {
63
+ readonly name: "timestamp";
64
+ readonly type: "INT";
65
+ }, {
66
+ readonly name: "duration";
67
+ readonly type: "INT";
68
+ }, {
69
+ readonly name: "attachments";
70
+ readonly type: "TEXT";
71
+ }];
72
+ export declare const DB_VERSION_TABLE_NAME = "version";
73
+ export declare const VERSION_TABLE_COLUMNS: readonly [{
74
+ readonly name: "version_number";
75
+ readonly type: "INT";
76
+ }];
77
+ export type LabeledVersionRow = {
78
+ [K in (typeof VERSION_TABLE_COLUMNS)[number]['name']]: string;
79
+ };
80
+ export declare const DB_CURRENT_VERSION = 1;
81
+ export declare const DB_MAX_AVAILABLE_PAGE_SIZE = 65536;
82
+ export declare const DB_SUITES_TABLE_NAME = "suites";
83
+ export declare const LOCAL_DATABASE_NAME = "sqlite.db";
84
+ export declare const DATABASE_URLS_JSON_NAME = "databaseUrls.json";
85
+ interface DbColumnIndexes {
86
+ [DB_COLUMNS.SUITE_PATH]: 0;
87
+ [DB_COLUMNS.SUITE_NAME]: 1;
88
+ [DB_COLUMNS.NAME]: 2;
89
+ [DB_COLUMNS.SUITE_URL]: 3;
90
+ [DB_COLUMNS.META_INFO]: 4;
91
+ [DB_COLUMNS.HISTORY]: 5;
92
+ [DB_COLUMNS.DESCRIPTION]: 6;
93
+ [DB_COLUMNS.ERROR]: 7;
94
+ [DB_COLUMNS.SKIP_REASON]: 8;
95
+ [DB_COLUMNS.IMAGES_INFO]: 9;
96
+ [DB_COLUMNS.SCREENSHOT]: 10;
97
+ [DB_COLUMNS.MULTIPLE_TABS]: 11;
98
+ [DB_COLUMNS.STATUS]: 12;
99
+ [DB_COLUMNS.TIMESTAMP]: 13;
100
+ [DB_COLUMNS.DURATION]: 14;
101
+ [DB_COLUMNS.ATTACHMENTS]: 15;
102
+ }
103
+ export declare const DB_COLUMN_INDEXES: DbColumnIndexes;
104
+ export declare const DB_FILE_EXTENSION = ".db";
105
+ export {};
@@ -0,0 +1,3 @@
1
+ import { StoreReporterConfig } from '../types';
2
+ export declare const CIRCLE_RADIUS = 150;
3
+ export declare const configDefaults: StoreReporterConfig;
@@ -0,0 +1,41 @@
1
+ import type { ValueOf } from 'type-fest';
2
+ export declare const DiffModes: {
3
+ readonly THREE_UP: {
4
+ readonly id: "3-up";
5
+ readonly title: "List";
6
+ readonly description: "List. Show images one after another in vertical layout.";
7
+ };
8
+ readonly THREE_UP_SCALED: {
9
+ readonly id: "3-up-scaled";
10
+ readonly title: "SbS";
11
+ readonly description: "Side by Side. Show images in one row.";
12
+ };
13
+ readonly THREE_UP_SCALED_TO_FIT: {
14
+ readonly id: "3-up-scaled-to-fit";
15
+ readonly title: "SbS (fit screen)";
16
+ readonly description: "Side by Side. Show images in one row and scale them down if needed to fit the screen.";
17
+ };
18
+ readonly ONLY_DIFF: {
19
+ readonly id: "only-diff";
20
+ readonly title: "Only Diff";
21
+ readonly description: "Only Diff. Show only diff image, click to highlight diff areas.";
22
+ };
23
+ readonly SWITCH: {
24
+ readonly id: "switch";
25
+ readonly title: "Switch";
26
+ readonly description: "Switch. Click to switch between expected and actual images.";
27
+ };
28
+ readonly SWIPE: {
29
+ readonly id: "swipe";
30
+ readonly title: "Swipe";
31
+ readonly description: "Swipe. Move the divider to compare expected and actual images.";
32
+ };
33
+ readonly ONION_SKIN: {
34
+ readonly id: "onion-skin";
35
+ readonly title: "Onion skin";
36
+ readonly description: "Onion Skin. Change the image opacity to compare expected and actual images.";
37
+ };
38
+ };
39
+ export type DiffModes = typeof DiffModes;
40
+ export type DiffMode = ValueOf<DiffModes>;
41
+ export type DiffModeId = DiffModes[keyof DiffModes]['id'];
@@ -0,0 +1,3 @@
1
+ export declare const ERROR_TITLE_TEXT_LENGTH = 200;
2
+ export declare const NEW_ISSUE_LINK = "https://github.com/gemini-testing/html-reporter/issues/new";
3
+ export declare const IMAGE_COMPARISON_FAILED_MESSAGE = "image comparison failed";
@@ -0,0 +1,12 @@
1
+ export interface Feature {
2
+ name: string;
3
+ }
4
+ export declare const RunTestsFeature: {
5
+ readonly name: "run-tests";
6
+ };
7
+ export declare const EditScreensFeature: {
8
+ readonly name: "edit-screens";
9
+ };
10
+ export declare const TimeTravelFeature: {
11
+ readonly name: "time-travel";
12
+ };
@@ -0,0 +1,7 @@
1
+ export namespace SECTIONS {
2
+ let RESULT: string;
3
+ let META: string;
4
+ }
5
+ export const ERROR_KEY: "error";
6
+ export const RESULT_KEYS: "error"[];
7
+ export const KEY_DELIMITER: ".";
@@ -0,0 +1,14 @@
1
+ export * from './browser';
2
+ export * from './database';
3
+ export * from './defaults';
4
+ export * from './diff-modes';
5
+ export * from './errors';
6
+ export * from './features';
7
+ export * from './group-tests';
8
+ export * from './paths';
9
+ export * from './tests';
10
+ export * from './plugin-events';
11
+ export * from './save-formats';
12
+ export * from './test-statuses';
13
+ export * from './tool-names';
14
+ export * from './view-modes';
@@ -0,0 +1,9 @@
1
+ export declare enum LocalStorageKey {
2
+ UIMode = "ui-mode",
3
+ TimeTravelUseRecommendedSettings = "time-travel-use-recommended-settings"
4
+ }
5
+ export declare const TIME_TRAVEL_PLAYER_VISIBILITY_KEY = "time-travel-player-visibility";
6
+ export declare enum UiMode {
7
+ Old = "old",
8
+ New = "new"
9
+ }
@@ -0,0 +1,3 @@
1
+ export declare const IMAGES_PATH = "images";
2
+ export declare const SNAPSHOTS_PATH = "snapshots";
3
+ export declare const ERROR_DETAILS_PATH = "error-details";
@@ -0,0 +1,6 @@
1
+ export declare enum PluginEvents {
2
+ DATABASE_CREATED = "databaseCreated",
3
+ TEST_SCREENSHOTS_SAVED = "testScreenshotsSaved",
4
+ REPORT_SAVED = "reportSaved",
5
+ IMAGES_SAVER_UPDATED = "imagesSaverUpdated"
6
+ }
@@ -0,0 +1,3 @@
1
+ export declare enum SaveFormat {
2
+ SQLITE = "sqlite"
3
+ }
@@ -0,0 +1,41 @@
1
+ export declare enum TestStatus {
2
+ IDLE = "idle",
3
+ QUEUED = "queued",
4
+ RUNNING = "running",
5
+ SUCCESS = "success",
6
+ FAIL = "fail",
7
+ ERROR = "error",
8
+ SKIPPED = "skipped",
9
+ UPDATED = "updated",
10
+ /**
11
+ * @note used by staticImageAccepter only
12
+ */
13
+ STAGED = "staged",
14
+ /**
15
+ * @note used by staticImageAccepter only
16
+ */
17
+ COMMITED = "commited",
18
+ /**
19
+ * @note used in new UI only for rendering icons
20
+ */
21
+ RETRY = "retry",
22
+ /** @note used to display tests that have both failed screenshots and errors */
23
+ FAIL_ERROR = "fail_error"
24
+ }
25
+ export declare const IDLE = TestStatus.IDLE;
26
+ export declare const QUEUED = TestStatus.QUEUED;
27
+ export declare const RUNNING = TestStatus.RUNNING;
28
+ export declare const SUCCESS = TestStatus.SUCCESS;
29
+ export declare const FAIL = TestStatus.FAIL;
30
+ export declare const ERROR = TestStatus.ERROR;
31
+ export declare const SKIPPED = TestStatus.SKIPPED;
32
+ export declare const UPDATED = TestStatus.UPDATED;
33
+ export declare const FAIL_ERROR = TestStatus.FAIL_ERROR;
34
+ /**
35
+ * @note used by staticImageAccepter only
36
+ */
37
+ export declare const STAGED = TestStatus.STAGED;
38
+ /**
39
+ * @note used by staticImageAccepter only
40
+ */
41
+ export declare const COMMITED = TestStatus.COMMITED;
@@ -0,0 +1,5 @@
1
+ export declare const DEFAULT_TITLE_DELIMITER = " ";
2
+ export declare const TESTPLANE_TITLE_DELIMITER = " ";
3
+ export declare const PWT_TITLE_DELIMITER = " \u203A ";
4
+ export declare const UNKNOWN_ATTEMPT = -1;
5
+ export declare const UNKNOWN_SESSION_ID = "unknown session id";
@@ -0,0 +1,5 @@
1
+ export declare enum ToolName {
2
+ Testplane = "testplane",
3
+ Playwright = "playwright",
4
+ Jest = "jest"
5
+ }
@@ -0,0 +1,9 @@
1
+ export declare enum ViewMode {
2
+ ALL = "all",
3
+ PASSED = "passed",
4
+ FAILED = "failed",
5
+ RETRIED = "retried",
6
+ SKIPPED = "skipped",
7
+ STAGED = "staged",
8
+ COMMITED = "commited"
9
+ }
@@ -0,0 +1,39 @@
1
+ import type { DbUrlsJsonData, RawSuitesRow, ReporterConfig } from '../types';
2
+ import type { Database as SqlJsDatabase, Statement } from '@gemini-testing/sql.js';
3
+ import type { ReadonlyDeep } from 'type-fest';
4
+ export declare const selectAllQuery: (tableName: string) => string;
5
+ export declare const selectAllSuitesQuery: () => string;
6
+ export declare const createTablesQuery: () => string[];
7
+ export declare const compareDatabaseRowsByTimestamp: (row1: RawSuitesRow, row2: RawSuitesRow) => number;
8
+ export interface Database {
9
+ }
10
+ export interface DbLoadResult {
11
+ url: string;
12
+ status: string;
13
+ data: null | unknown;
14
+ }
15
+ export interface DbDetails {
16
+ url: string;
17
+ status: string;
18
+ success: boolean;
19
+ }
20
+ export interface HandleDatabasesOptions {
21
+ pluginConfig: ReporterConfig;
22
+ loadDbJsonUrl: (dbJsonUrl: string) => Promise<{
23
+ data: DbUrlsJsonData | null;
24
+ status?: string;
25
+ }>;
26
+ formatData?: (dbJsonUrl: string, status?: string) => DbLoadResult;
27
+ prepareUrls: (dbUrls: string[], baseUrls: string) => string[];
28
+ loadDbUrl: (dbUrl: string, opts: HandleDatabasesOptions) => Promise<DbLoadResult | string>;
29
+ }
30
+ export declare const handleDatabases: (dbJsonUrls: string[], opts: HandleDatabasesOptions) => Promise<(string | DbLoadResult)[]>;
31
+ export declare const mergeTables: ({ db, dbPaths, getExistingTables }: {
32
+ db: SqlJsDatabase;
33
+ dbPaths: string[];
34
+ getExistingTables?: ((getTablesStatement: Statement) => string[]) | undefined;
35
+ }) => void;
36
+ export declare function createTableQuery(tableName: string, columns: ReadonlyDeep<{
37
+ name: string;
38
+ type: string;
39
+ }[]>): string;
@@ -0,0 +1,5 @@
1
+ import type { Database } from '@gemini-testing/sql.js';
2
+ export declare const getDatabaseVersion: (db: Database) => number | null;
3
+ export declare const setDatabaseVersion: (db: Database, version: number) => void;
4
+ export declare const migrateDatabase: (db: Database, version: number) => Promise<void>;
5
+ export declare const backupAndReset: (reportPath: string) => Promise<string>;
@@ -0,0 +1,17 @@
1
+ import type { Database } from '@gemini-testing/sql.js';
2
+ import { DbLoadResult, HandleDatabasesOptions } from './common';
3
+ import { Tree } from '../tests-tree-builder/base';
4
+ import { ReporterTestResult } from '../adapters/test-result';
5
+ import { SqliteClient } from '../sqlite-client';
6
+ export * from './common';
7
+ export declare const makeSqlDatabaseFromData: (data: Buffer | undefined) => Promise<Database & {
8
+ filename: string;
9
+ }>;
10
+ export declare const makeSqlDatabaseFromFile: (dbPath: string | null) => Promise<Database & {
11
+ filename: string;
12
+ }>;
13
+ export declare const prepareUrls: (urls: string[], baseUrl: string) => string[];
14
+ export declare function downloadDatabases(dbJsonUrls: string[], opts: HandleDatabasesOptions): Promise<(string | DbLoadResult)[]>;
15
+ export declare function mergeDatabases(srcDbPaths: string[], reportPath: string): Promise<void>;
16
+ export declare function getTestsTreeFromDatabase(dbPath: string, baseHost: string): Promise<Tree>;
17
+ export declare const getTestFromDb: <T = unknown>(dbClient: SqliteClient, testResult: ReporterTestResult) => T | undefined;