testit-adapter-playwright 3.2.10-TMS-5.4 → 3.3.0

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.
Files changed (2) hide show
  1. package/dist/utils.js +14 -28
  2. package/package.json +2 -2
package/dist/utils.js CHANGED
@@ -34,33 +34,19 @@ function stripAscii(str) {
34
34
  exports.stepAttachRegexp = /^stepattach_(\w{8}-\w{4}-\w{4}-\w{4}-\w{12})_/i;
35
35
  const asciiRegex = new RegExp("[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:[a-zA-Z\\d]*(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)|(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))", "g");
36
36
  function processAttachmentExtensions(attachment) {
37
- switch (attachment.contentType) {
38
- case labels_1.ContentType.ZIP:
39
- if (!attachment.name.includes(labels_1.Extensions.ZIP)) {
40
- attachment.name += labels_1.Extensions.ZIP;
41
- }
42
- return attachment;
43
- case labels_1.ContentType.PNG:
44
- if (!attachment.name.includes(labels_1.Extensions.PNG)) {
45
- attachment.name += labels_1.Extensions.PNG;
46
- }
47
- return attachment;
48
- case labels_1.ContentType.WEBM:
49
- if (!attachment.name.includes(labels_1.Extensions.WEBM)) {
50
- attachment.name += labels_1.Extensions.WEBM;
51
- }
52
- return attachment;
53
- case labels_1.ContentType.MD:
54
- if (!attachment.name.includes(labels_1.Extensions.MD)) {
55
- attachment.name += labels_1.Extensions.MD;
56
- }
57
- return attachment;
58
- case labels_1.ContentType.JPEG:
59
- if (!attachment.name.includes(labels_1.Extensions.JPEG)) {
60
- attachment.name += labels_1.Extensions.JPEG;
61
- }
62
- return attachment;
63
- default:
64
- return attachment;
37
+ const extensionMap = {
38
+ [labels_1.ContentType.ZIP]: labels_1.Extensions.ZIP,
39
+ [labels_1.ContentType.PNG]: labels_1.Extensions.PNG,
40
+ [labels_1.ContentType.WEBM]: labels_1.Extensions.WEBM,
41
+ [labels_1.ContentType.MD]: labels_1.Extensions.MD,
42
+ [labels_1.ContentType.JPEG]: labels_1.Extensions.JPEG,
43
+ };
44
+ const extension = extensionMap[attachment.contentType];
45
+ if (extension && !attachment.name.includes(extension)) {
46
+ return {
47
+ ...attachment,
48
+ name: attachment.name + extension
49
+ };
65
50
  }
51
+ return attachment;
66
52
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "testit-adapter-playwright",
3
- "version": "3.2.10-TMS-5.4",
3
+ "version": "3.3.0",
4
4
  "description": "Playwright adapter for Test IT",
5
5
  "license": "Apache-2.0",
6
6
  "author": {
@@ -40,7 +40,7 @@
40
40
  "prettier": "^3.0.1"
41
41
  },
42
42
  "dependencies": {
43
- "testit-js-commons": "3.2.10-TMS-5.4"
43
+ "testit-js-commons": "3.3.0"
44
44
  },
45
45
  "files": [
46
46
  "dist"