@empiricalrun/playwright-utils 0.9.3-reporter-revert.2 → 0.9.3
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/dist/config.d.ts.map +1 -1
- package/dist/config.js +3 -4
- package/package.json +12 -12
- package/dist/reporter/types/htmlReporter.d.ts +0 -106
- package/dist/reporter/types/htmlReporter.d.ts.map +0 -1
- package/dist/reporter/types/htmlReporter.js +0 -17
- package/dist/reporter/types/index.d.ts +0 -2
- package/dist/reporter/types/index.d.ts.map +0 -1
- package/dist/reporter/types/index.js +0 -2
- package/dist/reporter/upload.d.ts +0 -11
- package/dist/reporter/upload.d.ts.map +0 -1
- package/dist/reporter/upload.js +0 -135
- package/dist/test/scripts/pw-locator-patch/expect.d.ts +0 -5
- package/dist/test/scripts/pw-locator-patch/expect.d.ts.map +0 -1
- package/dist/test/scripts/pw-locator-patch/expect.js +0 -36
- package/dist/test/scripts/pw-locator-patch/hover.d.ts +0 -5
- package/dist/test/scripts/pw-locator-patch/hover.d.ts.map +0 -1
- package/dist/test/scripts/pw-locator-patch/hover.js +0 -31
- package/dist/test/scripts/pw-locator-patch/inner-text.d.ts +0 -5
- package/dist/test/scripts/pw-locator-patch/inner-text.d.ts.map +0 -1
- package/dist/test/scripts/pw-locator-patch/inner-text.js +0 -32
- package/dist/test/scripts/pw-locator-patch/input-value.d.ts +0 -5
- package/dist/test/scripts/pw-locator-patch/input-value.d.ts.map +0 -1
- package/dist/test/scripts/pw-locator-patch/input-value.js +0 -32
- package/dist/test/scripts/pw-locator-patch/is-checked.d.ts +0 -5
- package/dist/test/scripts/pw-locator-patch/is-checked.d.ts.map +0 -1
- package/dist/test/scripts/pw-locator-patch/is-checked.js +0 -32
- package/dist/test/scripts/pw-locator-patch/is-disabled.d.ts +0 -5
- package/dist/test/scripts/pw-locator-patch/is-disabled.d.ts.map +0 -1
- package/dist/test/scripts/pw-locator-patch/is-disabled.js +0 -32
- package/dist/test/scripts/pw-locator-patch/is-editable.d.ts +0 -5
- package/dist/test/scripts/pw-locator-patch/is-editable.d.ts.map +0 -1
- package/dist/test/scripts/pw-locator-patch/is-editable.js +0 -32
- package/dist/test/scripts/pw-locator-patch/text-content.d.ts +0 -5
- package/dist/test/scripts/pw-locator-patch/text-content.d.ts.map +0 -1
- package/dist/test/scripts/pw-locator-patch/text-content.js +0 -32
- package/dist/third_party/html-reporter-types.d.ts +0 -107
- package/dist/third_party/html-reporter-types.d.ts.map +0 -1
- package/dist/third_party/html-reporter-types.js +0 -18
package/dist/config.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAa7D,wBAAgB,gBAAgB,IAAI,MAAM,CAazC;AAED,eAAO,MAAM,UAAU,EAAE,
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAa7D,wBAAgB,gBAAgB,IAAI,MAAM,CAazC;AAED,eAAO,MAAM,UAAU,EAAE,oBAwBxB,CAAC"}
|
package/dist/config.js
CHANGED
|
@@ -33,16 +33,15 @@ function chromeStablePath() {
|
|
|
33
33
|
exports.chromeStablePath = chromeStablePath;
|
|
34
34
|
exports.baseConfig = {
|
|
35
35
|
testDir: "./tests",
|
|
36
|
-
|
|
36
|
+
outputDir: "./playwright-report/data", // to store default playwright artifacts (during and post test run)
|
|
37
37
|
fullyParallel: true,
|
|
38
38
|
forbidOnly: false,
|
|
39
39
|
retries: process.env.CI ? 2 : 0,
|
|
40
40
|
workers: undefined,
|
|
41
41
|
reporter: [
|
|
42
42
|
["list"], // For real-time reporting on CI terminal (vs. the default "dot" reporter)
|
|
43
|
-
["json", { outputFile: "
|
|
44
|
-
["
|
|
45
|
-
// ["./node_modules/@empiricalrun/playwright-utils/dist/reporter/custom.js"],
|
|
43
|
+
["json", { outputFile: "playwright-report/summary.json" }],
|
|
44
|
+
["./node_modules/@empiricalrun/playwright-utils/dist/reporter/custom.js"],
|
|
46
45
|
],
|
|
47
46
|
use: {
|
|
48
47
|
trace: "on",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@empiricalrun/playwright-utils",
|
|
3
|
-
"version": "0.9.3
|
|
3
|
+
"version": "0.9.3",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"registry": "https://registry.npmjs.org/",
|
|
6
6
|
"access": "public"
|
|
@@ -21,14 +21,6 @@
|
|
|
21
21
|
"url": "https://github.com/empirical-run/empirical.git"
|
|
22
22
|
},
|
|
23
23
|
"author": "Empirical Team <hey@empirical.run>",
|
|
24
|
-
"scripts": {
|
|
25
|
-
"dev": "tsc --build --watch",
|
|
26
|
-
"build": "tsc --build && node ./../../tools/static-env-vars.js dist",
|
|
27
|
-
"clean": "tsc --build --clean",
|
|
28
|
-
"lint": "eslint .",
|
|
29
|
-
"test": "vitest run",
|
|
30
|
-
"test:watch": "vitest"
|
|
31
|
-
},
|
|
32
24
|
"devDependencies": {
|
|
33
25
|
"@playwright/test": "^1.44.1",
|
|
34
26
|
"@types/node": "^20.14.9"
|
|
@@ -37,14 +29,22 @@
|
|
|
37
29
|
"@aws-sdk/client-s3": "^3.614.0",
|
|
38
30
|
"@aws-sdk/s3-request-presigner": "^3.614.0",
|
|
39
31
|
"@babel/code-frame": "^7.24.7",
|
|
40
|
-
"@empiricalrun/llm": "^0.9.1",
|
|
41
|
-
"@empiricalrun/r2-uploader": "^0.1.1",
|
|
42
32
|
"@types/babel__code-frame": "^7.0.6",
|
|
43
33
|
"@types/md5": "^2.3.5",
|
|
44
34
|
"@types/mime": "3.0.0",
|
|
45
35
|
"mailosaur": "^8.6.1",
|
|
46
36
|
"md5": "^2.3.0",
|
|
47
37
|
"mime": "3.0.0",
|
|
48
|
-
"playwright-core": "^1.46.1"
|
|
38
|
+
"playwright-core": "^1.46.1",
|
|
39
|
+
"@empiricalrun/llm": "^0.9.1",
|
|
40
|
+
"@empiricalrun/r2-uploader": "^0.1.1"
|
|
41
|
+
},
|
|
42
|
+
"scripts": {
|
|
43
|
+
"dev": "tsc --build --watch",
|
|
44
|
+
"build": "tsc --build && node ./../../tools/static-env-vars.js dist",
|
|
45
|
+
"clean": "tsc --build --clean",
|
|
46
|
+
"lint": "eslint .",
|
|
47
|
+
"test": "vitest run",
|
|
48
|
+
"test:watch": "vitest"
|
|
49
49
|
}
|
|
50
50
|
}
|
|
@@ -1,106 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (c) Microsoft Corporation.
|
|
3
|
-
*
|
|
4
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
-
* you may not use this file except in compliance with the License.
|
|
6
|
-
* You may obtain a copy of the License at
|
|
7
|
-
*
|
|
8
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
-
*
|
|
10
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
-
* See the License for the specific language governing permissions and
|
|
14
|
-
* limitations under the License.
|
|
15
|
-
*/
|
|
16
|
-
import type { Metadata } from "@playwright/test";
|
|
17
|
-
export type Stats = {
|
|
18
|
-
total: number;
|
|
19
|
-
expected: number;
|
|
20
|
-
unexpected: number;
|
|
21
|
-
flaky: number;
|
|
22
|
-
skipped: number;
|
|
23
|
-
ok: boolean;
|
|
24
|
-
};
|
|
25
|
-
export type FilteredStats = {
|
|
26
|
-
total: number;
|
|
27
|
-
duration: number;
|
|
28
|
-
};
|
|
29
|
-
export type Location = {
|
|
30
|
-
file: string;
|
|
31
|
-
line: number;
|
|
32
|
-
column: number;
|
|
33
|
-
};
|
|
34
|
-
export type HTMLReport = {
|
|
35
|
-
metadata: Metadata;
|
|
36
|
-
files: TestFileSummary[];
|
|
37
|
-
stats: Stats;
|
|
38
|
-
projectNames: string[];
|
|
39
|
-
startTime: number;
|
|
40
|
-
duration: number;
|
|
41
|
-
errors: string[];
|
|
42
|
-
};
|
|
43
|
-
export type TestFile = {
|
|
44
|
-
fileId: string;
|
|
45
|
-
fileName: string;
|
|
46
|
-
tests: TestCase[];
|
|
47
|
-
};
|
|
48
|
-
export type TestFileSummary = {
|
|
49
|
-
fileId: string;
|
|
50
|
-
fileName: string;
|
|
51
|
-
tests: TestCaseSummary[];
|
|
52
|
-
stats: Stats;
|
|
53
|
-
};
|
|
54
|
-
export type TestCaseAnnotation = {
|
|
55
|
-
type: string;
|
|
56
|
-
description?: string;
|
|
57
|
-
};
|
|
58
|
-
export type TestCaseSummary = {
|
|
59
|
-
testId: string;
|
|
60
|
-
title: string;
|
|
61
|
-
path: string[];
|
|
62
|
-
projectName: string;
|
|
63
|
-
location: Location;
|
|
64
|
-
annotations: TestCaseAnnotation[];
|
|
65
|
-
tags: string[];
|
|
66
|
-
outcome: "skipped" | "expected" | "unexpected" | "flaky";
|
|
67
|
-
duration: number;
|
|
68
|
-
ok: boolean;
|
|
69
|
-
results: TestResultSummary[];
|
|
70
|
-
};
|
|
71
|
-
export type TestResultSummary = {
|
|
72
|
-
attachments: {
|
|
73
|
-
name: string;
|
|
74
|
-
contentType: string;
|
|
75
|
-
path?: string;
|
|
76
|
-
}[];
|
|
77
|
-
};
|
|
78
|
-
export type TestCase = Omit<TestCaseSummary, "results"> & {
|
|
79
|
-
results: TestResult[];
|
|
80
|
-
};
|
|
81
|
-
export type TestAttachment = {
|
|
82
|
-
name: string;
|
|
83
|
-
body?: string;
|
|
84
|
-
path?: string;
|
|
85
|
-
contentType: string;
|
|
86
|
-
};
|
|
87
|
-
export type TestResult = {
|
|
88
|
-
retry: number;
|
|
89
|
-
startTime: string;
|
|
90
|
-
duration: number;
|
|
91
|
-
steps: TestStep[];
|
|
92
|
-
errors: string[];
|
|
93
|
-
attachments: TestAttachment[];
|
|
94
|
-
status: "passed" | "failed" | "timedOut" | "skipped" | "interrupted";
|
|
95
|
-
};
|
|
96
|
-
export type TestStep = {
|
|
97
|
-
title: string;
|
|
98
|
-
startTime: string;
|
|
99
|
-
duration: number;
|
|
100
|
-
location?: Location;
|
|
101
|
-
snippet?: string;
|
|
102
|
-
error?: string;
|
|
103
|
-
steps: TestStep[];
|
|
104
|
-
count: number;
|
|
105
|
-
};
|
|
106
|
-
//# sourceMappingURL=htmlReporter.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"htmlReporter.d.ts","sourceRoot":"","sources":["../../../src/reporter/types/htmlReporter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAEjD,MAAM,MAAM,KAAK,GAAG;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,EAAE,EAAE,OAAO,CAAC;CACb,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,MAAM,MAAM,QAAQ,GAAG;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,MAAM,MAAM,UAAU,GAAG;IACvB,QAAQ,EAAE,QAAQ,CAAC;IACnB,KAAK,EAAE,eAAe,EAAE,CAAC;IACzB,KAAK,EAAE,KAAK,CAAC;IACb,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,EAAE,CAAC;CAClB,CAAC;AAEF,MAAM,MAAM,QAAQ,GAAG;IACrB,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,QAAQ,EAAE,CAAC;CACnB,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG;IAC5B,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,eAAe,EAAE,CAAC;IACzB,KAAK,EAAE,KAAK,CAAC;CACd,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,WAAW,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAExE,MAAM,MAAM,eAAe,GAAG;IAC5B,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,QAAQ,CAAC;IACnB,WAAW,EAAE,kBAAkB,EAAE,CAAC;IAClC,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,OAAO,EAAE,SAAS,GAAG,UAAU,GAAG,YAAY,GAAG,OAAO,CAAC;IACzD,QAAQ,EAAE,MAAM,CAAC;IACjB,EAAE,EAAE,OAAO,CAAC;IACZ,OAAO,EAAE,iBAAiB,EAAE,CAAC;CAC9B,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG;IAC9B,WAAW,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,WAAW,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;CACrE,CAAC;AAEF,MAAM,MAAM,QAAQ,GAAG,IAAI,CAAC,eAAe,EAAE,SAAS,CAAC,GAAG;IACxD,OAAO,EAAE,UAAU,EAAE,CAAC;CACvB,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF,MAAM,MAAM,UAAU,GAAG;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,QAAQ,EAAE,CAAC;IAClB,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,WAAW,EAAE,cAAc,EAAE,CAAC;IAC9B,MAAM,EAAE,QAAQ,GAAG,QAAQ,GAAG,UAAU,GAAG,SAAS,GAAG,aAAa,CAAC;CACtE,CAAC;AAEF,MAAM,MAAM,QAAQ,GAAG;IACrB,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,QAAQ,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,QAAQ,EAAE,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;CACf,CAAC"}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* Copyright (c) Microsoft Corporation.
|
|
4
|
-
*
|
|
5
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
-
* you may not use this file except in compliance with the License.
|
|
7
|
-
* You may obtain a copy of the License at
|
|
8
|
-
*
|
|
9
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
-
*
|
|
11
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
-
* See the License for the specific language governing permissions and
|
|
15
|
-
* limitations under the License.
|
|
16
|
-
*/
|
|
17
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/reporter/types/index.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,QAAQ,GAAG,MAAM,EAAE,CAAC"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
interface FileMap {
|
|
2
|
-
[file: string]: string;
|
|
3
|
-
}
|
|
4
|
-
export declare function uploadDirectory({ sourceDir, fileList, destinationDir, uploadBucket, }: {
|
|
5
|
-
sourceDir: string;
|
|
6
|
-
fileList?: string[];
|
|
7
|
-
destinationDir: string;
|
|
8
|
-
uploadBucket: string;
|
|
9
|
-
}): Promise<FileMap>;
|
|
10
|
-
export {};
|
|
11
|
-
//# sourceMappingURL=upload.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"upload.d.ts","sourceRoot":"","sources":["../../src/reporter/upload.ts"],"names":[],"mappings":"AAsBA,UAAU,OAAO;IACf,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC;CACxB;AA+GD,wBAAsB,eAAe,CAAC,EACpC,SAAS,EACT,QAAQ,EACR,cAAc,EACd,YAAY,GACb,EAAE;IACD,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IACpB,cAAc,EAAE,MAAM,CAAC;IACvB,YAAY,EAAE,MAAM,CAAC;CACtB,GAAG,OAAO,CAAC,OAAO,CAAC,CAYnB"}
|
package/dist/reporter/upload.js
DELETED
|
@@ -1,135 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
|
-
};
|
|
28
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
-
exports.uploadDirectory = void 0;
|
|
30
|
-
const client_s3_1 = require("@aws-sdk/client-s3");
|
|
31
|
-
const s3_request_presigner_1 = require("@aws-sdk/s3-request-presigner");
|
|
32
|
-
const fs = __importStar(require("fs"));
|
|
33
|
-
const md5_1 = __importDefault(require("md5"));
|
|
34
|
-
const path_1 = __importDefault(require("path"));
|
|
35
|
-
const getFileList = (dir) => {
|
|
36
|
-
let files = [];
|
|
37
|
-
const items = fs.readdirSync(dir, {
|
|
38
|
-
withFileTypes: true,
|
|
39
|
-
});
|
|
40
|
-
for (const item of items) {
|
|
41
|
-
const isDir = item.isDirectory();
|
|
42
|
-
const absolutePath = `${dir}/${item.name}`;
|
|
43
|
-
if (isDir) {
|
|
44
|
-
files = [...files, ...getFileList(absolutePath)];
|
|
45
|
-
}
|
|
46
|
-
else {
|
|
47
|
-
files.push(absolutePath);
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
return files;
|
|
51
|
-
};
|
|
52
|
-
const run = async (config) => {
|
|
53
|
-
const map = new Map();
|
|
54
|
-
const urls = {};
|
|
55
|
-
const S3 = new client_s3_1.S3Client({
|
|
56
|
-
region: "auto",
|
|
57
|
-
endpoint: `https://${config.accountId}.r2.cloudflarestorage.com`,
|
|
58
|
-
credentials: {
|
|
59
|
-
accessKeyId: config.accessKeyId,
|
|
60
|
-
secretAccessKey: config.secretAccessKey,
|
|
61
|
-
},
|
|
62
|
-
});
|
|
63
|
-
let files;
|
|
64
|
-
if (config.fileList) {
|
|
65
|
-
files = config.fileList;
|
|
66
|
-
}
|
|
67
|
-
else {
|
|
68
|
-
files = getFileList(config.sourceDir);
|
|
69
|
-
}
|
|
70
|
-
await Promise.all(files.map(async (file) => {
|
|
71
|
-
const fileStream = fs.readFileSync(file);
|
|
72
|
-
const fileName = file.replace(config.sourceDir, "");
|
|
73
|
-
const fileKey = path_1.default.join(config.destinationDir !== "" ? config.destinationDir : config.sourceDir, fileName);
|
|
74
|
-
if (fileKey.includes(".gitkeep"))
|
|
75
|
-
return;
|
|
76
|
-
// console.log(fileKey);
|
|
77
|
-
let mimeType = "application/octet-stream";
|
|
78
|
-
try {
|
|
79
|
-
const mime = (await import("mime")).default;
|
|
80
|
-
mimeType = mime.getType(file) || "application/octet-stream";
|
|
81
|
-
}
|
|
82
|
-
catch (err) {
|
|
83
|
-
console.warn("Failed to get mime type for file", file, err);
|
|
84
|
-
}
|
|
85
|
-
const uploadParams = {
|
|
86
|
-
Bucket: config.bucket,
|
|
87
|
-
Key: fileKey,
|
|
88
|
-
Body: fileStream,
|
|
89
|
-
ContentLength: fs.statSync(file).size,
|
|
90
|
-
ContentType: mimeType ?? "application/octet-stream",
|
|
91
|
-
};
|
|
92
|
-
const cmd = new client_s3_1.PutObjectCommand(uploadParams);
|
|
93
|
-
const digest = (0, md5_1.default)(fileStream);
|
|
94
|
-
cmd.middlewareStack.add((next) => async (args) => {
|
|
95
|
-
args.request.headers["if-none-match"] = `"${digest}"`;
|
|
96
|
-
return await next(args);
|
|
97
|
-
}, {
|
|
98
|
-
step: "build",
|
|
99
|
-
name: "addETag",
|
|
100
|
-
});
|
|
101
|
-
try {
|
|
102
|
-
const data = await S3.send(cmd);
|
|
103
|
-
// console.log(`R2 Success - ${file}`);
|
|
104
|
-
map.set(file, data);
|
|
105
|
-
const fileUrl = await (0, s3_request_presigner_1.getSignedUrl)(S3, cmd);
|
|
106
|
-
urls[file] = fileUrl;
|
|
107
|
-
}
|
|
108
|
-
catch (err) {
|
|
109
|
-
const error = err;
|
|
110
|
-
if (error["$metadata"]) {
|
|
111
|
-
if (error.$metadata.httpStatusCode !== 412) {
|
|
112
|
-
console.log(`R2 Error - ${file} ${config.sourceDir} ${config.destinationDir} \nError: ${error}`);
|
|
113
|
-
console.log("Upload response", error.$response, "with status", error.$metadata.httpStatusCode);
|
|
114
|
-
throw error;
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
return;
|
|
119
|
-
}));
|
|
120
|
-
return urls;
|
|
121
|
-
};
|
|
122
|
-
async function uploadDirectory({ sourceDir, fileList, destinationDir, uploadBucket, }) {
|
|
123
|
-
let config = {
|
|
124
|
-
accountId: process.env.R2_ACCOUNT_ID,
|
|
125
|
-
accessKeyId: process.env.R2_ACCESS_KEY_ID,
|
|
126
|
-
secretAccessKey: process.env.R2_SECRET_ACCESS_KEY,
|
|
127
|
-
bucket: uploadBucket,
|
|
128
|
-
sourceDir,
|
|
129
|
-
destinationDir,
|
|
130
|
-
fileList,
|
|
131
|
-
};
|
|
132
|
-
const uploadedFiles = await run(config);
|
|
133
|
-
return uploadedFiles;
|
|
134
|
-
}
|
|
135
|
-
exports.uploadDirectory = uploadDirectory;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"expect.d.ts","sourceRoot":"","sources":["../../../../src/test/scripts/pw-locator-patch/expect.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAIhD,wBAAgB,WAAW,CAAC,YAAY,EAAE;IAAE,SAAS,EAAE,OAAO,CAAA;CAAE,QAmC/D"}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.patchExpect = void 0;
|
|
4
|
-
const constants_1 = require("../../constants");
|
|
5
|
-
function patchExpect(LocatorClass) {
|
|
6
|
-
//@ts-ignore _expect returnsPromise<{ matches: boolean, received?: any, log?: string[], timedOut?: boolean }>
|
|
7
|
-
const originalExpect = LocatorClass.prototype._expect;
|
|
8
|
-
// @ts-ignore _expect is a private method in playwright
|
|
9
|
-
// https://github.com/microsoft/playwright/blob/69287f26bc514b740eac40160503d6fac8185d37/packages/playwright-core/src/client/locator.ts#L352
|
|
10
|
-
LocatorClass.prototype._expect = async function (expression, options) {
|
|
11
|
-
const result = await originalExpect.apply(this, [expression, options]);
|
|
12
|
-
if (result.matches) {
|
|
13
|
-
try {
|
|
14
|
-
await this.evaluate((node) => {
|
|
15
|
-
if (node.scrollIntoViewIfNeeded) {
|
|
16
|
-
node.scrollIntoViewIfNeeded();
|
|
17
|
-
}
|
|
18
|
-
else {
|
|
19
|
-
node.scrollIntoView();
|
|
20
|
-
}
|
|
21
|
-
node.classList.add("empirical-element-grab-highlight");
|
|
22
|
-
setTimeout(() => {
|
|
23
|
-
if (node && node.isConnected && node.classList) {
|
|
24
|
-
node.classList.remove("empirical-element-grab-highlight");
|
|
25
|
-
}
|
|
26
|
-
}, 2000);
|
|
27
|
-
}, undefined, { timeout: constants_1.DEFAULT_SCRIPT_EXECUTION_TIMEOUT });
|
|
28
|
-
}
|
|
29
|
-
catch (e) {
|
|
30
|
-
console.warn("Failed to add highlight for locator method: _expect");
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
return result;
|
|
34
|
-
};
|
|
35
|
-
}
|
|
36
|
-
exports.patchExpect = patchExpect;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"hover.d.ts","sourceRoot":"","sources":["../../../../src/test/scripts/pw-locator-patch/hover.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAI3C,wBAAgB,UAAU,CAAC,YAAY,EAAE;IAAE,SAAS,EAAE,OAAO,CAAA;CAAE,QA2B9D"}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.patchHover = void 0;
|
|
4
|
-
const constants_1 = require("../../constants");
|
|
5
|
-
function patchHover(LocatorClass) {
|
|
6
|
-
const originalHover = LocatorClass.prototype.hover;
|
|
7
|
-
LocatorClass.prototype.hover = async function (options) {
|
|
8
|
-
// ref: https://github.com/microsoft/playwright/blob/69287f26bc514b740eac40160503d6fac8185d37/packages/playwright-core/src/client/locator.ts#L243
|
|
9
|
-
await originalHover.apply(this, [options]);
|
|
10
|
-
try {
|
|
11
|
-
await this.evaluate((node) => {
|
|
12
|
-
if (node.scrollIntoViewIfNeeded) {
|
|
13
|
-
node.scrollIntoViewIfNeeded();
|
|
14
|
-
}
|
|
15
|
-
else {
|
|
16
|
-
node.scrollIntoView();
|
|
17
|
-
}
|
|
18
|
-
node.classList.add("empirical-element-grab-highlight");
|
|
19
|
-
setTimeout(() => {
|
|
20
|
-
if (node && node.isConnected && node.classList) {
|
|
21
|
-
node.classList.remove("empirical-element-grab-highlight");
|
|
22
|
-
}
|
|
23
|
-
}, 2000);
|
|
24
|
-
}, undefined, { timeout: constants_1.DEFAULT_SCRIPT_EXECUTION_TIMEOUT });
|
|
25
|
-
}
|
|
26
|
-
catch (e) {
|
|
27
|
-
console.warn("Failed to add highlight for locator method: hover");
|
|
28
|
-
}
|
|
29
|
-
};
|
|
30
|
-
}
|
|
31
|
-
exports.patchHover = patchHover;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"inner-text.d.ts","sourceRoot":"","sources":["../../../../src/test/scripts/pw-locator-patch/inner-text.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAIhD,wBAAgB,cAAc,CAAC,YAAY,EAAE;IAAE,SAAS,EAAE,OAAO,CAAA;CAAE,QA4BlE"}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.patchInnerText = void 0;
|
|
4
|
-
const constants_1 = require("../../constants");
|
|
5
|
-
function patchInnerText(LocatorClass) {
|
|
6
|
-
const originalInputValue = LocatorClass.prototype.innerText;
|
|
7
|
-
//ref: https://github.com/microsoft/playwright/blob/69287f26bc514b740eac40160503d6fac8185d37/packages/playwright-core/src/client/locator.ts#L251
|
|
8
|
-
LocatorClass.prototype.innerText = async function (options) {
|
|
9
|
-
const result = await originalInputValue.apply(this, [options]);
|
|
10
|
-
try {
|
|
11
|
-
await this.evaluate((node) => {
|
|
12
|
-
if (node.scrollIntoViewIfNeeded) {
|
|
13
|
-
node.scrollIntoViewIfNeeded();
|
|
14
|
-
}
|
|
15
|
-
else {
|
|
16
|
-
node.scrollIntoView();
|
|
17
|
-
}
|
|
18
|
-
node.classList.add("empirical-element-grab-highlight");
|
|
19
|
-
setTimeout(() => {
|
|
20
|
-
if (node && node.isConnected && node.classList) {
|
|
21
|
-
node.classList.remove("empirical-element-grab-highlight");
|
|
22
|
-
}
|
|
23
|
-
}, 2000);
|
|
24
|
-
}, undefined, { timeout: constants_1.DEFAULT_SCRIPT_EXECUTION_TIMEOUT });
|
|
25
|
-
}
|
|
26
|
-
catch (e) {
|
|
27
|
-
console.warn("Failed to add highlight for locator method: innerText");
|
|
28
|
-
}
|
|
29
|
-
return result;
|
|
30
|
-
};
|
|
31
|
-
}
|
|
32
|
-
exports.patchInnerText = patchInnerText;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"input-value.d.ts","sourceRoot":"","sources":["../../../../src/test/scripts/pw-locator-patch/input-value.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAIhD,wBAAgB,eAAe,CAAC,YAAY,EAAE;IAAE,SAAS,EAAE,OAAO,CAAA;CAAE,QA4BnE"}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.patchInputValue = void 0;
|
|
4
|
-
const constants_1 = require("../../constants");
|
|
5
|
-
function patchInputValue(LocatorClass) {
|
|
6
|
-
const originalInputValue = LocatorClass.prototype.inputValue;
|
|
7
|
-
//ref: github.com/microsoft/playwright/blob/69287f26bc514b740eac40160503d6fac8185d37/packages/playwright-core/src/client/locator.ts#L255
|
|
8
|
-
LocatorClass.prototype.inputValue = async function (options) {
|
|
9
|
-
const result = await originalInputValue.apply(this, [options]);
|
|
10
|
-
try {
|
|
11
|
-
await this.evaluate((node) => {
|
|
12
|
-
if (node.scrollIntoViewIfNeeded) {
|
|
13
|
-
node.scrollIntoViewIfNeeded();
|
|
14
|
-
}
|
|
15
|
-
else {
|
|
16
|
-
node.scrollIntoView();
|
|
17
|
-
}
|
|
18
|
-
node.classList.add("empirical-element-grab-highlight");
|
|
19
|
-
setTimeout(() => {
|
|
20
|
-
if (node && node.isConnected && node.classList) {
|
|
21
|
-
node.classList.remove("empirical-element-grab-highlight");
|
|
22
|
-
}
|
|
23
|
-
}, 2000);
|
|
24
|
-
}, undefined, { timeout: constants_1.DEFAULT_SCRIPT_EXECUTION_TIMEOUT });
|
|
25
|
-
}
|
|
26
|
-
catch (e) {
|
|
27
|
-
console.warn("Failed to add highlight for locator method: inputValue");
|
|
28
|
-
}
|
|
29
|
-
return result;
|
|
30
|
-
};
|
|
31
|
-
}
|
|
32
|
-
exports.patchInputValue = patchInputValue;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"is-checked.d.ts","sourceRoot":"","sources":["../../../../src/test/scripts/pw-locator-patch/is-checked.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAI3C,wBAAgB,cAAc,CAAC,YAAY,EAAE;IAAE,SAAS,EAAE,OAAO,CAAA;CAAE,QA4BlE"}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.patchIsChecked = void 0;
|
|
4
|
-
const constants_1 = require("../../constants");
|
|
5
|
-
function patchIsChecked(LocatorClass) {
|
|
6
|
-
const originalIsChecked = LocatorClass.prototype.isChecked;
|
|
7
|
-
LocatorClass.prototype.isChecked = async function (options) {
|
|
8
|
-
// ref: https://github.com/microsoft/playwright/blob/69287f26bc514b740eac40160503d6fac8185d37/packages/playwright-core/src/client/locator.ts#L259
|
|
9
|
-
const result = await originalIsChecked.apply(this, [options]);
|
|
10
|
-
try {
|
|
11
|
-
await this.evaluate((node) => {
|
|
12
|
-
if (node.scrollIntoViewIfNeeded) {
|
|
13
|
-
node.scrollIntoViewIfNeeded();
|
|
14
|
-
}
|
|
15
|
-
else {
|
|
16
|
-
node.scrollIntoView();
|
|
17
|
-
}
|
|
18
|
-
node.classList.add("empirical-element-grab-highlight");
|
|
19
|
-
setTimeout(() => {
|
|
20
|
-
if (node && node.isConnected && node.classList) {
|
|
21
|
-
node.classList.remove("empirical-element-grab-highlight");
|
|
22
|
-
}
|
|
23
|
-
}, 2000);
|
|
24
|
-
}, undefined, { timeout: constants_1.DEFAULT_SCRIPT_EXECUTION_TIMEOUT });
|
|
25
|
-
}
|
|
26
|
-
catch (e) {
|
|
27
|
-
console.warn("Failed to add highlight for locator method: isChecked");
|
|
28
|
-
}
|
|
29
|
-
return result;
|
|
30
|
-
};
|
|
31
|
-
}
|
|
32
|
-
exports.patchIsChecked = patchIsChecked;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"is-disabled.d.ts","sourceRoot":"","sources":["../../../../src/test/scripts/pw-locator-patch/is-disabled.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAI3C,wBAAgB,eAAe,CAAC,YAAY,EAAE;IAAE,SAAS,EAAE,OAAO,CAAA;CAAE,QA4BnE"}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.patchIsDisabled = void 0;
|
|
4
|
-
const constants_1 = require("../../constants");
|
|
5
|
-
function patchIsDisabled(LocatorClass) {
|
|
6
|
-
const originalIsDisabled = LocatorClass.prototype.isDisabled;
|
|
7
|
-
LocatorClass.prototype.isDisabled = async function (options) {
|
|
8
|
-
// ref: https://github.com/microsoft/playwright/blob/69287f26bc514b740eac40160503d6fac8185d37/packages/playwright-core/src/client/locator.ts#L263
|
|
9
|
-
const result = await originalIsDisabled.apply(this, [options]);
|
|
10
|
-
try {
|
|
11
|
-
await this.evaluate((node) => {
|
|
12
|
-
if (node.scrollIntoViewIfNeeded) {
|
|
13
|
-
node.scrollIntoViewIfNeeded();
|
|
14
|
-
}
|
|
15
|
-
else {
|
|
16
|
-
node.scrollIntoView();
|
|
17
|
-
}
|
|
18
|
-
node.classList.add("empirical-element-grab-highlight");
|
|
19
|
-
setTimeout(() => {
|
|
20
|
-
if (node && node.isConnected && node.classList) {
|
|
21
|
-
node.classList.remove("empirical-element-grab-highlight");
|
|
22
|
-
}
|
|
23
|
-
}, 2000);
|
|
24
|
-
}, undefined, { timeout: constants_1.DEFAULT_SCRIPT_EXECUTION_TIMEOUT });
|
|
25
|
-
}
|
|
26
|
-
catch (e) {
|
|
27
|
-
console.warn("Failed to add highlight for locator method: isDisabled");
|
|
28
|
-
}
|
|
29
|
-
return result;
|
|
30
|
-
};
|
|
31
|
-
}
|
|
32
|
-
exports.patchIsDisabled = patchIsDisabled;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"is-editable.d.ts","sourceRoot":"","sources":["../../../../src/test/scripts/pw-locator-patch/is-editable.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAI3C,wBAAgB,eAAe,CAAC,YAAY,EAAE;IAAE,SAAS,EAAE,OAAO,CAAA;CAAE,QA4BnE"}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.patchIsEditable = void 0;
|
|
4
|
-
const constants_1 = require("../../constants");
|
|
5
|
-
function patchIsEditable(LocatorClass) {
|
|
6
|
-
const originalIsEditable = LocatorClass.prototype.isEditable;
|
|
7
|
-
LocatorClass.prototype.isEditable = async function (options) {
|
|
8
|
-
// ref: https://github.com/microsoft/playwright/blob/69287f26bc514b740eac40160503d6fac8185d37/packages/playwright-core/src/client/locator.ts#L267
|
|
9
|
-
const result = await originalIsEditable.apply(this, [options]);
|
|
10
|
-
try {
|
|
11
|
-
await this.evaluate((node) => {
|
|
12
|
-
if (node.scrollIntoViewIfNeeded) {
|
|
13
|
-
node.scrollIntoViewIfNeeded();
|
|
14
|
-
}
|
|
15
|
-
else {
|
|
16
|
-
node.scrollIntoView();
|
|
17
|
-
}
|
|
18
|
-
node.classList.add("empirical-element-grab-highlight");
|
|
19
|
-
setTimeout(() => {
|
|
20
|
-
if (node && node.isConnected && node.classList) {
|
|
21
|
-
node.classList.remove("empirical-element-grab-highlight");
|
|
22
|
-
}
|
|
23
|
-
}, 2000);
|
|
24
|
-
}, undefined, { timeout: constants_1.DEFAULT_SCRIPT_EXECUTION_TIMEOUT });
|
|
25
|
-
}
|
|
26
|
-
catch (e) {
|
|
27
|
-
console.warn("Failed to add highlight for locator method: isEditable");
|
|
28
|
-
}
|
|
29
|
-
return result;
|
|
30
|
-
};
|
|
31
|
-
}
|
|
32
|
-
exports.patchIsEditable = patchIsEditable;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"text-content.d.ts","sourceRoot":"","sources":["../../../../src/test/scripts/pw-locator-patch/text-content.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAIhD,wBAAgB,gBAAgB,CAAC,YAAY,EAAE;IAAE,SAAS,EAAE,OAAO,CAAA;CAAE,QA4BpE"}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.patchTextContent = void 0;
|
|
4
|
-
const constants_1 = require("../../constants");
|
|
5
|
-
function patchTextContent(LocatorClass) {
|
|
6
|
-
const originalTextContent = LocatorClass.prototype.textContent;
|
|
7
|
-
//ref: https://github.com/microsoft/playwright/blob/69287f26bc514b740eac40160503d6fac8185d37/packages/playwright-core/src/client/locator.ts#L318
|
|
8
|
-
LocatorClass.prototype.textContent = async function (options) {
|
|
9
|
-
const result = await originalTextContent.apply(this, [options]);
|
|
10
|
-
try {
|
|
11
|
-
await this.evaluate((node) => {
|
|
12
|
-
if (node.scrollIntoViewIfNeeded) {
|
|
13
|
-
node.scrollIntoViewIfNeeded();
|
|
14
|
-
}
|
|
15
|
-
else {
|
|
16
|
-
node.scrollIntoView();
|
|
17
|
-
}
|
|
18
|
-
node.classList.add("empirical-element-grab-highlight");
|
|
19
|
-
setTimeout(() => {
|
|
20
|
-
if (node && node.isConnected && node.classList) {
|
|
21
|
-
node.classList.remove("empirical-element-grab-highlight");
|
|
22
|
-
}
|
|
23
|
-
}, 2000);
|
|
24
|
-
}, undefined, { timeout: constants_1.DEFAULT_SCRIPT_EXECUTION_TIMEOUT });
|
|
25
|
-
}
|
|
26
|
-
catch (e) {
|
|
27
|
-
console.warn("Failed to add highlight for locator method: textContent");
|
|
28
|
-
}
|
|
29
|
-
return result;
|
|
30
|
-
};
|
|
31
|
-
}
|
|
32
|
-
exports.patchTextContent = patchTextContent;
|
|
@@ -1,107 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Original file: https://github.com/microsoft/playwright/blob/cf8c14f884b6f24966350a5f49b1580c3e183d21/packages/html-reporter/src/types.ts
|
|
3
|
-
* Copyright (c) Microsoft Corporation.
|
|
4
|
-
*
|
|
5
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
-
* you may not use this file except in compliance with the License.
|
|
7
|
-
* You may obtain a copy of the License at
|
|
8
|
-
*
|
|
9
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
-
*
|
|
11
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
-
* See the License for the specific language governing permissions and
|
|
15
|
-
* limitations under the License.
|
|
16
|
-
*/
|
|
17
|
-
import type { Metadata } from '@playwright/test';
|
|
18
|
-
export type Stats = {
|
|
19
|
-
total: number;
|
|
20
|
-
expected: number;
|
|
21
|
-
unexpected: number;
|
|
22
|
-
flaky: number;
|
|
23
|
-
skipped: number;
|
|
24
|
-
ok: boolean;
|
|
25
|
-
};
|
|
26
|
-
export type FilteredStats = {
|
|
27
|
-
total: number;
|
|
28
|
-
duration: number;
|
|
29
|
-
};
|
|
30
|
-
export type Location = {
|
|
31
|
-
file: string;
|
|
32
|
-
line: number;
|
|
33
|
-
column: number;
|
|
34
|
-
};
|
|
35
|
-
export type HTMLReport = {
|
|
36
|
-
metadata: Metadata;
|
|
37
|
-
files: TestFileSummary[];
|
|
38
|
-
stats: Stats;
|
|
39
|
-
projectNames: string[];
|
|
40
|
-
startTime: number;
|
|
41
|
-
duration: number;
|
|
42
|
-
errors: string[];
|
|
43
|
-
};
|
|
44
|
-
export type TestFile = {
|
|
45
|
-
fileId: string;
|
|
46
|
-
fileName: string;
|
|
47
|
-
tests: TestCase[];
|
|
48
|
-
};
|
|
49
|
-
export type TestFileSummary = {
|
|
50
|
-
fileId: string;
|
|
51
|
-
fileName: string;
|
|
52
|
-
tests: TestCaseSummary[];
|
|
53
|
-
stats: Stats;
|
|
54
|
-
};
|
|
55
|
-
export type TestCaseAnnotation = {
|
|
56
|
-
type: string;
|
|
57
|
-
description?: string;
|
|
58
|
-
};
|
|
59
|
-
export type TestCaseSummary = {
|
|
60
|
-
testId: string;
|
|
61
|
-
title: string;
|
|
62
|
-
path: string[];
|
|
63
|
-
projectName: string;
|
|
64
|
-
location: Location;
|
|
65
|
-
annotations: TestCaseAnnotation[];
|
|
66
|
-
tags: string[];
|
|
67
|
-
outcome: 'skipped' | 'expected' | 'unexpected' | 'flaky';
|
|
68
|
-
duration: number;
|
|
69
|
-
ok: boolean;
|
|
70
|
-
results: TestResultSummary[];
|
|
71
|
-
};
|
|
72
|
-
export type TestResultSummary = {
|
|
73
|
-
attachments: {
|
|
74
|
-
name: string;
|
|
75
|
-
contentType: string;
|
|
76
|
-
path?: string;
|
|
77
|
-
}[];
|
|
78
|
-
};
|
|
79
|
-
export type TestCase = Omit<TestCaseSummary, 'results'> & {
|
|
80
|
-
results: TestResult[];
|
|
81
|
-
};
|
|
82
|
-
export type TestAttachment = {
|
|
83
|
-
name: string;
|
|
84
|
-
body?: string;
|
|
85
|
-
path?: string;
|
|
86
|
-
contentType: string;
|
|
87
|
-
};
|
|
88
|
-
export type TestResult = {
|
|
89
|
-
retry: number;
|
|
90
|
-
startTime: string;
|
|
91
|
-
duration: number;
|
|
92
|
-
steps: TestStep[];
|
|
93
|
-
errors: string[];
|
|
94
|
-
attachments: TestAttachment[];
|
|
95
|
-
status: 'passed' | 'failed' | 'timedOut' | 'skipped' | 'interrupted';
|
|
96
|
-
};
|
|
97
|
-
export type TestStep = {
|
|
98
|
-
title: string;
|
|
99
|
-
startTime: string;
|
|
100
|
-
duration: number;
|
|
101
|
-
location?: Location;
|
|
102
|
-
snippet?: string;
|
|
103
|
-
error?: string;
|
|
104
|
-
steps: TestStep[];
|
|
105
|
-
count: number;
|
|
106
|
-
};
|
|
107
|
-
//# sourceMappingURL=html-reporter-types.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"html-reporter-types.d.ts","sourceRoot":"","sources":["../../src/third_party/html-reporter-types.ts"],"names":[],"mappings":"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"}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* Original file: https://github.com/microsoft/playwright/blob/cf8c14f884b6f24966350a5f49b1580c3e183d21/packages/html-reporter/src/types.ts
|
|
4
|
-
* Copyright (c) Microsoft Corporation.
|
|
5
|
-
*
|
|
6
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
7
|
-
* you may not use this file except in compliance with the License.
|
|
8
|
-
* You may obtain a copy of the License at
|
|
9
|
-
*
|
|
10
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
11
|
-
*
|
|
12
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
13
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
14
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
15
|
-
* See the License for the specific language governing permissions and
|
|
16
|
-
* limitations under the License.
|
|
17
|
-
*/
|
|
18
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|