monocart-reporter 2.3.3 → 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/cli.js CHANGED
@@ -11,7 +11,7 @@ const KSR = require('koa-static-resolver');
11
11
  const Koa = require('koa');
12
12
  const CG = require('console-grid');
13
13
 
14
- const { program } = require('./packages/monocart-vendor.js');
14
+ const { program, open } = require('./packages/monocart-vendor.js');
15
15
  const defaultOptions = require('./default/options.js');
16
16
  const version = require('../package.json').version;
17
17
 
@@ -81,8 +81,7 @@ const showIpInfo = (protocol, port) => {
81
81
  };
82
82
 
83
83
  const openUrl = async (p) => {
84
- const open = await import('open');
85
- await open.default(p);
84
+ await open(p);
86
85
  };
87
86
 
88
87
  const createServer = (app, options) => {
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