playwright-slack-report 1.1.2 → 1.1.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.
|
@@ -67,19 +67,14 @@ class ResultsParser {
|
|
|
67
67
|
}
|
|
68
68
|
addTestResult(suiteName, testCase) {
|
|
69
69
|
const testResults = [];
|
|
70
|
+
const projectSettings = this.getParentConfigInformation(testCase);
|
|
70
71
|
for (const result of testCase.results) {
|
|
71
72
|
testResults.push({
|
|
72
73
|
suiteName,
|
|
73
74
|
name: testCase.title,
|
|
74
75
|
status: result.status,
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
? testCase.parent.parent._projectConfig.use.defaultBrowserType
|
|
78
|
-
: '',
|
|
79
|
-
// eslint-disable-next-line no-underscore-dangle
|
|
80
|
-
projectName: testCase.parent?.parent?._projectConfig?.name
|
|
81
|
-
? testCase.parent.parent._projectConfig.name
|
|
82
|
-
: '',
|
|
76
|
+
browser: projectSettings.browser,
|
|
77
|
+
projectName: projectSettings.projectName,
|
|
83
78
|
retry: result.retry,
|
|
84
79
|
retries: testCase.retries,
|
|
85
80
|
startedAt: new Date(result.startTime).toISOString(),
|
|
@@ -114,5 +109,17 @@ class ResultsParser {
|
|
|
114
109
|
.replace(/=========================== logs ===========================\n/g, '');
|
|
115
110
|
return logsStripped;
|
|
116
111
|
}
|
|
112
|
+
getParentConfigInformation(testCase) {
|
|
113
|
+
if (testCase._projectConfig !== undefined) {
|
|
114
|
+
return {
|
|
115
|
+
projectName: testCase._projectConfig.name || '',
|
|
116
|
+
browser: testCase._projectConfig.use?.defaultBrowserType || '',
|
|
117
|
+
};
|
|
118
|
+
}
|
|
119
|
+
if (testCase.parent) {
|
|
120
|
+
return this.getParentConfigInformation(testCase.parent);
|
|
121
|
+
}
|
|
122
|
+
return { projectName: '', browser: '' };
|
|
123
|
+
}
|
|
117
124
|
}
|
|
118
125
|
exports.default = ResultsParser;
|
package/package.json
CHANGED