@testomatio/reporter 1.6.12 → 1.6.14
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 +10 -5
- package/lib/client.js +1 -1
- package/lib/pipe/html.js +2 -0
- package/package.json +1 -1
|
@@ -116,9 +116,13 @@ class PlaywrightReporter {
|
|
|
116
116
|
}
|
|
117
117
|
|
|
118
118
|
if (artifact.body) {
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
119
|
+
let filePath = generateTmpFilepath(artifact.name);
|
|
120
|
+
|
|
121
|
+
const extension = artifact.contentType?.split('/')[1]?.replace('jpeg', 'jpg');
|
|
122
|
+
if (extension) filePath += `.${extension}`;
|
|
123
|
+
|
|
124
|
+
fs.writeFileSync(filePath, artifact.body);
|
|
125
|
+
return filePath;
|
|
122
126
|
}
|
|
123
127
|
|
|
124
128
|
return null;
|
|
@@ -218,9 +222,10 @@ function appendStep(step, shift = 0) {
|
|
|
218
222
|
return resultStep;
|
|
219
223
|
}
|
|
220
224
|
|
|
221
|
-
function
|
|
225
|
+
function generateTmpFilepath(filename = '') {
|
|
226
|
+
filename = filename || `tmp.${crypto.randomBytes(16).toString('hex')}`;
|
|
222
227
|
const tmpdir = os.tmpdir();
|
|
223
|
-
return path.join(tmpdir,
|
|
228
|
+
return path.join(tmpdir, filename);
|
|
224
229
|
}
|
|
225
230
|
|
|
226
231
|
/**
|
package/lib/client.js
CHANGED
|
@@ -65,7 +65,7 @@ class Client {
|
|
|
65
65
|
try {
|
|
66
66
|
const filterPipe = this.pipes.find(p => p.constructor.name.toLowerCase() === `${pipe.toLowerCase()}pipe`);
|
|
67
67
|
|
|
68
|
-
if (!filterPipe
|
|
68
|
+
if (!filterPipe?.isEnabled) {
|
|
69
69
|
// TODO:for the future for the another pipes
|
|
70
70
|
console.warn(
|
|
71
71
|
APP_PREFIX,
|
package/lib/pipe/html.js
CHANGED