monocart-reporter 2.3.4 → 2.4.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.
package/lib/common.js CHANGED
@@ -35,11 +35,10 @@ const stepHandler = (item, summary) => {
35
35
 
36
36
  // ===========================================================================
37
37
 
38
+ // all tags for global report
38
39
  const tagHandler = (item, tags, tagOptions) => {
39
- const matches = item.title.matchAll(Util.tagPattern);
40
- for (const match of matches) {
41
- // all, before, key, after
42
- const tag = match[2];
40
+
41
+ const addTag = (tag) => {
43
42
  let tagItem = tags[tag];
44
43
  if (!tagItem) {
45
44
  tagItem = {};
@@ -55,6 +54,26 @@ const tagHandler = (item, tags, tagOptions) => {
55
54
  tags[tag] = tagItem;
56
55
  }
57
56
  tagItem.value += 1;
57
+ };
58
+
59
+ // new syntax in playwright v1.42
60
+ if (item.tags) {
61
+
62
+ // tag starts with @
63
+ item.tags.forEach((t) => {
64
+ const tag = `${t}`.slice(1);
65
+ addTag(tag);
66
+ });
67
+
68
+ return;
69
+ }
70
+
71
+ // supports old title tag
72
+ const matches = item.title.matchAll(Util.tagPattern);
73
+ for (const match of matches) {
74
+ // all, before, key, after
75
+ const tag = match[2];
76
+ addTag(tag);
58
77
  }
59
78
  };
60
79