@empiricalrun/test-gen 0.79.2 → 0.79.4
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/CHANGELOG.md +14 -0
- package/dist/agent/chat/exports.d.ts +1 -0
- package/dist/agent/chat/exports.d.ts.map +1 -1
- package/dist/agent/chat/exports.js +3 -1
- package/dist/agent/chat/index.d.ts.map +1 -1
- package/dist/agent/chat/index.js +22 -3
- package/dist/agent/chat/prompt/pw-utils-docs.d.ts +1 -1
- package/dist/agent/chat/prompt/pw-utils-docs.d.ts.map +1 -1
- package/dist/agent/chat/prompt/pw-utils-docs.js +1 -1
- package/dist/agent/chat/prompt/repo.d.ts.map +1 -1
- package/dist/agent/chat/prompt/repo.js +4 -3
- package/dist/agent/chat/prompt/trace-utils-docs.d.ts +2 -0
- package/dist/agent/chat/prompt/trace-utils-docs.d.ts.map +1 -0
- package/dist/agent/chat/prompt/trace-utils-docs.js +208 -0
- package/dist/agent/code-review/index.d.ts +1 -1
- package/dist/agent/code-review/index.d.ts.map +1 -1
- package/dist/agent/code-review/index.js +4 -4
- package/dist/agent/code-review/{parser.d.ts → xml-parser.d.ts} +1 -1
- package/dist/agent/code-review/xml-parser.d.ts.map +1 -0
- package/dist/agent/code-review/{parser.js → xml-parser.js} +1 -1
- package/dist/agent/fast-triage/index.d.ts +8 -0
- package/dist/agent/fast-triage/index.d.ts.map +1 -0
- package/dist/agent/fast-triage/index.js +79 -0
- package/dist/agent/index.d.ts +2 -1
- package/dist/agent/index.d.ts.map +1 -1
- package/dist/agent/index.js +4 -1
- package/dist/agent/master/element-annotation.d.ts.map +1 -1
- package/dist/agent/master/element-annotation.js +2 -19
- package/dist/agent/triage/index.js +2 -2
- package/dist/bin/index.js +3 -3
- package/dist/bin/utils/platform/web/index.d.ts.map +1 -1
- package/dist/bin/utils/platform/web/index.js +3 -2
- package/dist/constants/index.d.ts +1 -1
- package/dist/constants/index.js +1 -1
- package/dist/dashboard/client.d.ts +16 -1
- package/dist/dashboard/client.d.ts.map +1 -1
- package/dist/dashboard/client.js +33 -9
- package/dist/dashboard/index.d.ts +1 -0
- package/dist/dashboard/index.d.ts.map +1 -1
- package/dist/dashboard/index.js +4 -1
- package/dist/dashboard/tool-response-from-sandbox.d.ts +5 -0
- package/dist/dashboard/tool-response-from-sandbox.d.ts.map +1 -0
- package/dist/dashboard/tool-response-from-sandbox.js +40 -0
- package/dist/dashboard/tool-response.d.ts +1 -0
- package/dist/dashboard/tool-response.d.ts.map +1 -1
- package/dist/dashboard/tool-response.js +1 -0
- package/dist/file-info/adapters/github/index.d.ts.map +1 -1
- package/dist/file-info/adapters/github/index.js +1 -1
- package/dist/file-info/adapters/github/reader.d.ts.map +1 -1
- package/dist/file-info/adapters/github/reader.js +9 -3
- package/dist/generate-summary/frame-sampling.d.ts +12 -0
- package/dist/generate-summary/frame-sampling.d.ts.map +1 -0
- package/dist/generate-summary/frame-sampling.js +72 -0
- package/dist/generate-summary/generate-error-stack-summary.d.ts +11 -0
- package/dist/generate-summary/generate-error-stack-summary.d.ts.map +1 -0
- package/dist/generate-summary/generate-error-stack-summary.js +41 -0
- package/dist/generate-summary/generate-failed-step-screenshot-diff-summary.d.ts +58 -0
- package/dist/generate-summary/generate-failed-step-screenshot-diff-summary.d.ts.map +1 -0
- package/dist/generate-summary/generate-failed-step-screenshot-diff-summary.js +460 -0
- package/dist/generate-summary/generate-grouped-summary.d.ts +18 -0
- package/dist/generate-summary/generate-grouped-summary.d.ts.map +1 -0
- package/dist/generate-summary/generate-grouped-summary.js +88 -0
- package/dist/generate-summary/merge-summary.d.ts +16 -0
- package/dist/generate-summary/merge-summary.d.ts.map +1 -0
- package/dist/generate-summary/merge-summary.js +43 -0
- package/dist/generate-summary/pick-videos-for-comparison.d.ts +9 -0
- package/dist/generate-summary/pick-videos-for-comparison.d.ts.map +1 -0
- package/dist/generate-summary/pick-videos-for-comparison.js +54 -0
- package/dist/telemetry/index.d.ts +3 -3
- package/dist/telemetry/index.d.ts.map +1 -1
- package/dist/telemetry/index.js +11 -6
- package/dist/tools/analyse-video/index.js +1 -1
- package/dist/tools/definitions/delete-file.js +1 -1
- package/dist/tools/definitions/grep.d.ts.map +1 -1
- package/dist/tools/definitions/grep.js +1 -1
- package/dist/tools/definitions/publish-markdown-report.d.ts +8 -0
- package/dist/tools/definitions/publish-markdown-report.d.ts.map +1 -0
- package/dist/tools/definitions/publish-markdown-report.js +29 -0
- package/dist/tools/definitions/rename-file.js +2 -2
- package/dist/tools/definitions/safe-bash.d.ts.map +1 -1
- package/dist/tools/definitions/safe-bash.js +10 -8
- package/dist/tools/definitions/str_replace_editor.d.ts.map +1 -1
- package/dist/tools/definitions/str_replace_editor.js +12 -4
- package/dist/tools/definitions/trace-dot-zip.d.ts +7 -0
- package/dist/tools/definitions/trace-dot-zip.d.ts.map +1 -0
- package/dist/tools/definitions/trace-dot-zip.js +16 -0
- package/dist/tools/definitions/utils.js +1 -1
- package/dist/tools/delete-file/index.d.ts.map +1 -1
- package/dist/tools/delete-file/index.js +9 -6
- package/dist/tools/diagnosis-fetcher.d.ts +5 -0
- package/dist/tools/diagnosis-fetcher.d.ts.map +1 -1
- package/dist/tools/diagnosis-fetcher.js +56 -13
- package/dist/tools/executor/index.d.ts.map +1 -1
- package/dist/tools/executor/index.js +2 -2
- package/dist/tools/fetch-file/index.d.ts.map +1 -1
- package/dist/tools/fetch-file/index.js +110 -10
- package/dist/tools/fetch-file/utils.d.ts +13 -1
- package/dist/tools/fetch-file/utils.d.ts.map +1 -1
- package/dist/tools/fetch-file/utils.js +44 -118
- package/dist/tools/file-operations/index.d.ts.map +1 -1
- package/dist/tools/file-operations/index.js +7 -5
- package/dist/tools/file-operations/shared/helpers.d.ts +13 -0
- package/dist/tools/file-operations/shared/helpers.d.ts.map +1 -1
- package/dist/tools/file-operations/shared/helpers.js +24 -0
- package/dist/tools/file-operations/view/index.d.ts.map +1 -1
- package/dist/tools/file-operations/view/index.js +9 -3
- package/dist/tools/grep/index.d.ts.map +1 -1
- package/dist/tools/grep/index.js +7 -2
- package/dist/tools/index.d.ts +2 -2
- package/dist/tools/index.d.ts.map +1 -1
- package/dist/tools/index.js +14 -10
- package/dist/tools/issues-v1/index.d.ts +0 -2
- package/dist/tools/issues-v1/index.d.ts.map +1 -1
- package/dist/tools/issues-v1/index.js +1 -5
- package/dist/tools/merge-conflicts/index.d.ts.map +1 -1
- package/dist/tools/merge-conflicts/index.js +8 -8
- package/dist/tools/publish-markdown-report/index.d.ts +3 -0
- package/dist/tools/publish-markdown-report/index.d.ts.map +1 -0
- package/dist/tools/publish-markdown-report/index.js +196 -0
- package/dist/tools/rename-file/index.d.ts.map +1 -1
- package/dist/tools/rename-file/index.js +11 -7
- package/dist/tools/run-test.d.ts.map +1 -1
- package/dist/tools/run-test.js +12 -7
- package/dist/tools/safe-bash/index.d.ts.map +1 -1
- package/dist/tools/safe-bash/index.js +18 -2
- package/dist/tools/test-gen-browser.d.ts.map +1 -1
- package/dist/tools/test-gen-browser.js +13 -10
- package/dist/tools/trace-dot-zip/index.d.ts +3 -1
- package/dist/tools/trace-dot-zip/index.d.ts.map +1 -1
- package/dist/tools/trace-dot-zip/index.js +21 -23
- package/dist/tools/trace-dot-zip/utils/console-trace.d.ts.map +1 -1
- package/dist/tools/trace-dot-zip/utils/console-trace.js +11 -5
- package/dist/tools/trace-dot-zip/utils/extract-screenshots.d.ts +27 -0
- package/dist/tools/trace-dot-zip/utils/extract-screenshots.d.ts.map +1 -0
- package/dist/tools/trace-dot-zip/utils/extract-screenshots.js +128 -0
- package/dist/tools/trace-dot-zip/utils/extract-steps.d.ts +12 -0
- package/dist/tools/trace-dot-zip/utils/extract-steps.d.ts.map +1 -0
- package/dist/tools/trace-dot-zip/utils/extract-steps.js +130 -0
- package/dist/tools/trace-dot-zip/utils/extract-zip.d.ts +13 -16
- package/dist/tools/trace-dot-zip/utils/extract-zip.d.ts.map +1 -1
- package/dist/tools/trace-dot-zip/utils/extract-zip.js +27 -167
- package/dist/tools/trace-dot-zip/utils/network-trace.d.ts.map +1 -1
- package/dist/tools/trace-dot-zip/utils/network-trace.js +136 -105
- package/dist/utils/model.d.ts.map +1 -1
- package/dist/utils/model.js +2 -6
- package/dist/video-core/index.d.ts.map +1 -1
- package/dist/video-core/index.js +17 -33
- package/package.json +13 -16
- package/tsconfig.tsbuildinfo +1 -1
- package/dist/agent/code-review/parser.d.ts.map +0 -1
- package/dist/agent/master/icon-descriptor/index.d.ts +0 -22
- package/dist/agent/master/icon-descriptor/index.d.ts.map +0 -1
- package/dist/agent/master/icon-descriptor/index.js +0 -249
- package/dist/agent/master/icon-descriptor/normalize-svg.d.ts +0 -2
- package/dist/agent/master/icon-descriptor/normalize-svg.d.ts.map +0 -1
- package/dist/agent/master/icon-descriptor/normalize-svg.js +0 -247
- package/dist/tools/issues-v1/create-issue.d.ts +0 -3
- package/dist/tools/issues-v1/create-issue.d.ts.map +0 -1
- package/dist/tools/issues-v1/create-issue.js +0 -72
- package/dist/tools/issues-v1/update-issue.d.ts +0 -3
- package/dist/tools/issues-v1/update-issue.d.ts.map +0 -1
- package/dist/tools/issues-v1/update-issue.js +0 -74
- package/dist/trace-utils/index.d.ts +0 -4
- package/dist/trace-utils/index.d.ts.map +0 -1
- package/dist/trace-utils/index.js +0 -10
- package/dist/utils/playwright-report-parser.d.ts +0 -13
- package/dist/utils/playwright-report-parser.d.ts.map +0 -1
- package/dist/utils/playwright-report-parser.js +0 -138
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.deduplicateImages = exports.generateNetworkTrace = exports.getFilenamesInZip = exports.extractFileFromZipFromUrl = void 0;
|
|
4
|
-
var extract_zip_1 = require("../tools/trace-dot-zip/utils/extract-zip");
|
|
5
|
-
Object.defineProperty(exports, "extractFileFromZipFromUrl", { enumerable: true, get: function () { return extract_zip_1.extractFileFromZipFromUrl; } });
|
|
6
|
-
Object.defineProperty(exports, "getFilenamesInZip", { enumerable: true, get: function () { return extract_zip_1.getFilenamesInZip; } });
|
|
7
|
-
var network_trace_1 = require("../tools/trace-dot-zip/utils/network-trace");
|
|
8
|
-
Object.defineProperty(exports, "generateNetworkTrace", { enumerable: true, get: function () { return network_trace_1.generateNetworkTrace; } });
|
|
9
|
-
var dedup_image_1 = require("../utils/dedup/dedup-image");
|
|
10
|
-
Object.defineProperty(exports, "deduplicateImages", { enumerable: true, get: function () { return dedup_image_1.deduplicateImages; } });
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { HtmlReportData, HtmlReportFile, HtmlReportTest, PlaywrightMatchingTest, PlaywrightTestReport } from "@empiricalrun/shared-types/playwright-utils";
|
|
2
|
-
import type { JSONReport } from "playwright/types/testReporter";
|
|
3
|
-
export declare function parsePlaywrightTestReport(jsonReport: JSONReport): PlaywrightTestReport;
|
|
4
|
-
export declare const findTestInReport: (reportJson: HtmlReportFile, targetTest: PlaywrightMatchingTest, allFiles: HtmlReportData["files"]) => HtmlReportTest | null;
|
|
5
|
-
export interface TestCriteria {
|
|
6
|
-
name: string;
|
|
7
|
-
file_path: string;
|
|
8
|
-
suites: string[];
|
|
9
|
-
}
|
|
10
|
-
export declare function findMatchingTest(tests: PlaywrightMatchingTest[], testCriteria: TestCriteria): PlaywrightMatchingTest | null;
|
|
11
|
-
export declare function fetchAndFindTestCase(summaryJsonUrl: string, testCriteria: TestCriteria): Promise<PlaywrightMatchingTest>;
|
|
12
|
-
export declare function findTestInPlaywrightSummary(summaryJson: JSONReport, testCriteria: TestCriteria): Promise<PlaywrightMatchingTest | null>;
|
|
13
|
-
//# sourceMappingURL=playwright-report-parser.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"playwright-report-parser.d.ts","sourceRoot":"","sources":["../../src/utils/playwright-report-parser.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,cAAc,EACd,cAAc,EACd,cAAc,EACd,sBAAsB,EACtB,oBAAoB,EACrB,MAAM,6CAA6C,CAAC;AACrD,OAAO,KAAK,EACV,UAAU,EAGX,MAAM,+BAA+B,CAAC;AAqEvC,wBAAgB,yBAAyB,CACvC,UAAU,EAAE,UAAU,GACrB,oBAAoB,CAuBtB;AAED,eAAO,MAAM,gBAAgB,GAC3B,YAAY,cAAc,EAC1B,YAAY,sBAAsB,EAClC,UAAU,cAAc,CAAC,OAAO,CAAC,0BAwBlC,CAAC;AAEF,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,EAAE,CAAC;CAClB;AAED,wBAAgB,gBAAgB,CAC9B,KAAK,EAAE,sBAAsB,EAAE,EAC/B,YAAY,EAAE,YAAY,GACzB,sBAAsB,GAAG,IAAI,CAgB/B;AAED,wBAAsB,oBAAoB,CACxC,cAAc,EAAE,MAAM,EACtB,YAAY,EAAE,YAAY,GACzB,OAAO,CAAC,sBAAsB,CAAC,CAqBjC;AAED,wBAAsB,2BAA2B,CAC/C,WAAW,EAAE,UAAU,EACvB,YAAY,EAAE,YAAY,GACzB,OAAO,CAAC,sBAAsB,GAAG,IAAI,CAAC,CASxC"}
|
|
@@ -1,138 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.findTestInReport = void 0;
|
|
4
|
-
exports.parsePlaywrightTestReport = parsePlaywrightTestReport;
|
|
5
|
-
exports.findMatchingTest = findMatchingTest;
|
|
6
|
-
exports.fetchAndFindTestCase = fetchAndFindTestCase;
|
|
7
|
-
exports.findTestInPlaywrightSummary = findTestInPlaywrightSummary;
|
|
8
|
-
function filterOutFlakyResult(results) {
|
|
9
|
-
const allResults = results.filter((result) => result);
|
|
10
|
-
if (allResults.length === 0) {
|
|
11
|
-
return null;
|
|
12
|
-
}
|
|
13
|
-
const passedResult = allResults.find((result) => result.status === "passed");
|
|
14
|
-
const result = passedResult || allResults[0];
|
|
15
|
-
if (!result) {
|
|
16
|
-
return null;
|
|
17
|
-
}
|
|
18
|
-
return result;
|
|
19
|
-
}
|
|
20
|
-
function extractTestsFromSuite(suite, parentTitle, matchingTests) {
|
|
21
|
-
const suiteTitle = parentTitle
|
|
22
|
-
? `${parentTitle} > ${suite.title}`
|
|
23
|
-
: suite.title;
|
|
24
|
-
if (suite.specs) {
|
|
25
|
-
if (suite.specs) {
|
|
26
|
-
suite.specs.forEach((spec) => {
|
|
27
|
-
if (spec.tests) {
|
|
28
|
-
spec.tests.forEach((test) => {
|
|
29
|
-
if (test.results && test.results.length > 0) {
|
|
30
|
-
const filteredResult = filterOutFlakyResult(test.results);
|
|
31
|
-
if (!filteredResult) {
|
|
32
|
-
return;
|
|
33
|
-
}
|
|
34
|
-
matchingTests.push({
|
|
35
|
-
id: spec.id,
|
|
36
|
-
title: spec.title,
|
|
37
|
-
suiteTitle,
|
|
38
|
-
file: spec.file,
|
|
39
|
-
line: spec.line,
|
|
40
|
-
status: filteredResult.status,
|
|
41
|
-
duration: filteredResult.duration,
|
|
42
|
-
startTime: filteredResult.startTime,
|
|
43
|
-
steps: filteredResult.steps || [],
|
|
44
|
-
attachments: filteredResult.attachments || [],
|
|
45
|
-
stdout: filteredResult.stdout.filter((s) => "text" in s) || [],
|
|
46
|
-
stderr: filteredResult.stderr.filter((s) => "text" in s) || [],
|
|
47
|
-
errors: filteredResult.errors || [],
|
|
48
|
-
error: filteredResult.error || null,
|
|
49
|
-
errorLocation: filteredResult.errorLocation || undefined,
|
|
50
|
-
projectName: test.projectName,
|
|
51
|
-
expectedStatus: test.expectedStatus,
|
|
52
|
-
ok: spec.ok,
|
|
53
|
-
});
|
|
54
|
-
}
|
|
55
|
-
});
|
|
56
|
-
}
|
|
57
|
-
});
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
if (suite.suites) {
|
|
61
|
-
suite.suites.forEach((nestedSuite) => {
|
|
62
|
-
extractTestsFromSuite(nestedSuite, suiteTitle, matchingTests);
|
|
63
|
-
});
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
function parsePlaywrightTestReport(jsonReport) {
|
|
67
|
-
const suites = jsonReport.suites || [];
|
|
68
|
-
const stats = jsonReport.stats || {};
|
|
69
|
-
const matchingTests = [];
|
|
70
|
-
suites.forEach((suite) => {
|
|
71
|
-
extractTestsFromSuite(suite, "", matchingTests);
|
|
72
|
-
});
|
|
73
|
-
const result = {
|
|
74
|
-
tests: matchingTests,
|
|
75
|
-
stats: {
|
|
76
|
-
total: stats.expected || 0,
|
|
77
|
-
passed: (stats.expected || 0) - (stats.unexpected || 0),
|
|
78
|
-
failed: stats.unexpected || 0,
|
|
79
|
-
skipped: stats.skipped || 0,
|
|
80
|
-
duration: stats.duration || 0,
|
|
81
|
-
startTime: stats.startTime,
|
|
82
|
-
},
|
|
83
|
-
};
|
|
84
|
-
return result;
|
|
85
|
-
}
|
|
86
|
-
const findTestInReport = (reportJson, targetTest, allFiles) => {
|
|
87
|
-
const matchingFile = reportJson.files?.find((file) => file.fileName === targetTest.file);
|
|
88
|
-
if (!matchingFile) {
|
|
89
|
-
return null;
|
|
90
|
-
}
|
|
91
|
-
// Get the corresponding JSON file data
|
|
92
|
-
const fileDataKey = `${matchingFile.fileId}.json`;
|
|
93
|
-
const fileData = allFiles[fileDataKey];
|
|
94
|
-
if (!fileData) {
|
|
95
|
-
return null;
|
|
96
|
-
}
|
|
97
|
-
// Find the specific test in this file's tests
|
|
98
|
-
let matchingTest = fileData.tests?.find((test) => test.title === targetTest.title);
|
|
99
|
-
return matchingTest || null;
|
|
100
|
-
};
|
|
101
|
-
exports.findTestInReport = findTestInReport;
|
|
102
|
-
function findMatchingTest(tests, testCriteria) {
|
|
103
|
-
return (tests.find((test) => {
|
|
104
|
-
const titleMatches = test.title === testCriteria.name;
|
|
105
|
-
const fileMatches = test.file === testCriteria.file_path;
|
|
106
|
-
let suitesMatch = false;
|
|
107
|
-
if (testCriteria.suites && testCriteria.suites.length > 0) {
|
|
108
|
-
suitesMatch = testCriteria.suites.every((suite) => test.suiteTitle.includes(suite));
|
|
109
|
-
}
|
|
110
|
-
return titleMatches && fileMatches && suitesMatch;
|
|
111
|
-
}) || null);
|
|
112
|
-
}
|
|
113
|
-
async function fetchAndFindTestCase(summaryJsonUrl, testCriteria) {
|
|
114
|
-
const summaryResponse = await fetch(summaryJsonUrl);
|
|
115
|
-
if (!summaryResponse.ok) {
|
|
116
|
-
if (summaryResponse.status === 404) {
|
|
117
|
-
throw new Error(`Summary report not found at ${summaryJsonUrl}. The file may have been auto-deleted if this is an old test run.`);
|
|
118
|
-
}
|
|
119
|
-
else {
|
|
120
|
-
throw new Error(`Failed to fetch summary report: ${summaryResponse.statusText}`);
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
const summaryData = await summaryResponse.json();
|
|
124
|
-
const testCase = await findTestInPlaywrightSummary(summaryData, testCriteria);
|
|
125
|
-
if (!testCase) {
|
|
126
|
-
throw new Error("Test case not found in the summary report");
|
|
127
|
-
}
|
|
128
|
-
return testCase;
|
|
129
|
-
}
|
|
130
|
-
async function findTestInPlaywrightSummary(summaryJson, testCriteria) {
|
|
131
|
-
try {
|
|
132
|
-
const parsedReport = parsePlaywrightTestReport(summaryJson);
|
|
133
|
-
return findMatchingTest(parsedReport.tests, testCriteria);
|
|
134
|
-
}
|
|
135
|
-
catch (error) {
|
|
136
|
-
throw new Error(`Failed to fetch or parse summary report: ${error instanceof Error ? error.message : "Unknown error"}`);
|
|
137
|
-
}
|
|
138
|
-
}
|