@testomatio/reporter 1.6.6-beta-1-pw-metadata → 1.6.6
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/lib/adapter/playwright.js +4 -28
- package/lib/client.js +3 -23
- package/package.json +1 -1
|
@@ -55,28 +55,11 @@ class PlaywrightReporter {
|
|
|
55
55
|
logs = `\n\n${chalk.bold('Logs:')}\n${chalk.red(result.stderr.join(''))}\n${result.stdout.join('')}`;
|
|
56
56
|
}
|
|
57
57
|
const manuallyAttachedArtifacts = services.artifacts.get(fullTestTitle);
|
|
58
|
-
const
|
|
58
|
+
const keyValues = services.keyValues.get(fullTestTitle);
|
|
59
59
|
const rid = test.id || test.testId || uuidv4();
|
|
60
60
|
|
|
61
|
-
/**
|
|
62
|
-
* @type {{
|
|
63
|
-
* browser?: string,
|
|
64
|
-
* dependencies: string[],
|
|
65
|
-
* isMobile?: boolean
|
|
66
|
-
* metadata: Record<string, any>,
|
|
67
|
-
* name: string,
|
|
68
|
-
* }}
|
|
69
|
-
*/
|
|
70
|
-
const project = {
|
|
71
|
-
browser: test.parent.project().use.defaultBrowserType,
|
|
72
|
-
dependencies: test.parent.project().dependencies,
|
|
73
|
-
isMobile: test.parent.project().use.isMobile,
|
|
74
|
-
metadata: test.parent.project().metadata,
|
|
75
|
-
name: test.parent.project().name,
|
|
76
|
-
};
|
|
77
|
-
|
|
78
61
|
const reportTestPromise = this.client.addTestRun(checkStatus(result.status), {
|
|
79
|
-
rid
|
|
62
|
+
rid,
|
|
80
63
|
error,
|
|
81
64
|
test_id: getTestomatIdFromTestTitle(`${title} ${test.tags?.join(' ')}`),
|
|
82
65
|
suite_title,
|
|
@@ -85,19 +68,12 @@ class PlaywrightReporter {
|
|
|
85
68
|
time: duration,
|
|
86
69
|
logs,
|
|
87
70
|
manuallyAttachedArtifacts,
|
|
88
|
-
meta:
|
|
89
|
-
browser: project.browser,
|
|
90
|
-
isMobile: project.isMobile,
|
|
91
|
-
project: project.name,
|
|
92
|
-
projectDependencies: project.dependencies,
|
|
93
|
-
...testMeta,
|
|
94
|
-
...project.metadata, // metadata has any type (in playwright), but we will stringify it in client.js
|
|
95
|
-
},
|
|
71
|
+
meta: keyValues,
|
|
96
72
|
file: test.location?.file,
|
|
97
73
|
});
|
|
98
74
|
|
|
99
75
|
this.uploads.push({
|
|
100
|
-
rid
|
|
76
|
+
rid,
|
|
101
77
|
title: test.title,
|
|
102
78
|
files: result.attachments.filter(a => a.body || a.path),
|
|
103
79
|
file: test.location?.file,
|
package/lib/client.js
CHANGED
|
@@ -165,27 +165,6 @@ class Client {
|
|
|
165
165
|
} = testData;
|
|
166
166
|
let { message = '' } = testData;
|
|
167
167
|
|
|
168
|
-
// stringify meta values and limit keys and values length to 255
|
|
169
|
-
if (meta) {
|
|
170
|
-
for (const key in meta) {
|
|
171
|
-
if (typeof meta[key] === 'object') {
|
|
172
|
-
meta[key] = JSON.stringify(meta[key]);
|
|
173
|
-
}
|
|
174
|
-
// cut values
|
|
175
|
-
if (meta[key].length > 255) {
|
|
176
|
-
meta[key] = meta[key].substring(0, 255);
|
|
177
|
-
debug(APP_PREFIX, `Meta info value "${meta[key]}" is too long, trimmed to 255 characters`);
|
|
178
|
-
}
|
|
179
|
-
// cut keys
|
|
180
|
-
if (key.length > 255) {
|
|
181
|
-
const newKey = key.substring(0, 255);
|
|
182
|
-
meta[newKey] = meta[key];
|
|
183
|
-
delete meta[key];
|
|
184
|
-
debug(APP_PREFIX, `Meta info key "${key}" is too long, trimmed to 255 characters`);
|
|
185
|
-
}
|
|
186
|
-
}
|
|
187
|
-
}
|
|
188
|
-
|
|
189
168
|
let errorFormatted = '';
|
|
190
169
|
if (error) {
|
|
191
170
|
errorFormatted += this.formatError(error) || '';
|
|
@@ -201,6 +180,7 @@ class Client {
|
|
|
201
180
|
const uploadedFiles = [];
|
|
202
181
|
|
|
203
182
|
for (let f of files) {
|
|
183
|
+
if (!f) continue; // f === null
|
|
204
184
|
if (typeof f === 'object') {
|
|
205
185
|
if (!f.path) continue;
|
|
206
186
|
|
|
@@ -279,7 +259,7 @@ class Client {
|
|
|
279
259
|
APP_PREFIX,
|
|
280
260
|
`🗄️ ${this.uploader.successfulUploads.length} artifacts ${
|
|
281
261
|
process.env.TESTOMATIO_PRIVATE_ARTIFACTS ? 'privately' : chalk.bold('publicly')
|
|
282
|
-
} 🟢uploaded to S3 bucket`,
|
|
262
|
+
} 🟢 uploaded to S3 bucket`,
|
|
283
263
|
);
|
|
284
264
|
}
|
|
285
265
|
|
|
@@ -295,7 +275,7 @@ class Client {
|
|
|
295
275
|
|
|
296
276
|
uploadedArtifacts.forEach(upload => {
|
|
297
277
|
debug(
|
|
298
|
-
`🟢Uploaded artifact`,
|
|
278
|
+
`🟢 Uploaded artifact`,
|
|
299
279
|
`${upload.relativePath},`,
|
|
300
280
|
'size:',
|
|
301
281
|
`${upload.sizePretty},`,
|