@testomatio/reporter 2.0.1-beta.7 → 2.0.1-beta.8
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 +3 -12
- package/package.json +1 -1
- package/src/adapter/playwright.js +7 -11
|
@@ -123,18 +123,9 @@ class PlaywrightReporter {
|
|
|
123
123
|
}
|
|
124
124
|
if (artifact.body) {
|
|
125
125
|
let filePath = generateTmpFilepath(artifact.name);
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
const mimeType = artifact.contentType.split('/')[1];
|
|
130
|
-
const extensionMap = {
|
|
131
|
-
jpeg: 'jpg',
|
|
132
|
-
plain: 'txt',
|
|
133
|
-
};
|
|
134
|
-
const extension = extensionMap[mimeType] || mimeType;
|
|
135
|
-
if (extension)
|
|
136
|
-
filePath += `.${extension}`;
|
|
137
|
-
}
|
|
126
|
+
const extension = artifact.contentType?.split('/')[1]?.replace('jpeg', 'jpg');
|
|
127
|
+
if (extension)
|
|
128
|
+
filePath += `.${extension}`;
|
|
138
129
|
fs_1.default.writeFileSync(filePath, artifact.body);
|
|
139
130
|
return filePath;
|
|
140
131
|
}
|
package/package.json
CHANGED
|
@@ -125,24 +125,20 @@ class PlaywrightReporter {
|
|
|
125
125
|
#getArtifactPath(artifact) {
|
|
126
126
|
if (artifact.path) {
|
|
127
127
|
if (path.isAbsolute(artifact.path)) return artifact.path;
|
|
128
|
+
|
|
128
129
|
return path.join(this.config.outputDir || this.config.projects[0].outputDir, artifact.path);
|
|
129
130
|
}
|
|
131
|
+
|
|
130
132
|
if (artifact.body) {
|
|
131
133
|
let filePath = generateTmpFilepath(artifact.name);
|
|
132
|
-
|
|
133
|
-
const
|
|
134
|
-
if (
|
|
135
|
-
|
|
136
|
-
const extensionMap = {
|
|
137
|
-
jpeg: 'jpg',
|
|
138
|
-
plain: 'txt',
|
|
139
|
-
};
|
|
140
|
-
const extension = extensionMap[mimeType] || mimeType;
|
|
141
|
-
if (extension) filePath += `.${extension}`;
|
|
142
|
-
}
|
|
134
|
+
|
|
135
|
+
const extension = artifact.contentType?.split('/')[1]?.replace('jpeg', 'jpg');
|
|
136
|
+
if (extension) filePath += `.${extension}`;
|
|
137
|
+
|
|
143
138
|
fs.writeFileSync(filePath, artifact.body);
|
|
144
139
|
return filePath;
|
|
145
140
|
}
|
|
141
|
+
|
|
146
142
|
return null;
|
|
147
143
|
}
|
|
148
144
|
|