monocart-reporter 1.6.31 → 1.6.33

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/README.md CHANGED
@@ -1,8 +1,6 @@
1
1
  # Monocart Reporter
2
2
 
3
3
  [![](https://img.shields.io/npm/v/monocart-reporter)](https://www.npmjs.com/package/monocart-reporter)
4
- ![](https://img.shields.io/librariesio/github/cenfun/monocart-reporter)
5
- ![](https://img.shields.io/librariesio/dependents/npm/monocart-reporter)
6
4
  [![](https://badgen.net/npm/dw/monocart-reporter)](https://www.npmjs.com/package/monocart-reporter)
7
5
  ![](https://img.shields.io/github/license/cenfun/monocart-reporter)
8
6
 
@@ -308,6 +306,7 @@ module.exports = {
308
306
  ]
309
307
  };
310
308
  ```
309
+ multiple matches example: [collect-data](https://github.com/cenfun/monocart-reporter-test/tree/main/tests/collect-data)
311
310
 
312
311
  ### Collect Data from the Annotations
313
312
  It should be easier than getting from title. see [custom annotations](https://playwright.dev/docs/test-annotations#custom-annotations) via `test.info().annotations`
@@ -452,18 +451,6 @@ test.describe('suite title', () => {
452
451
  */
453
452
  const { test, expect } = require('@playwright/test');
454
453
  ```
455
- ```js
456
- // for project (Can't use comments but use project level `metadata`)
457
- // playwright.config.js
458
- module.exports = {
459
- projects: [{
460
- name: 'Desktop Chromium',
461
- metadata: {
462
- owner: 'PO'
463
- }
464
- }]
465
- };
466
- ```
467
454
 
468
455
  ### Remove Secrets and Sensitive Data
469
456
  > The report may hosted outside of the organization’s internal boundaries, security becomes a big issue. Any secrets or sensitive data, such as usernames, passwords, tokens and API keys, should be handled with extreme care. The following example is removing the password and token from the report data with the string replacement in `visitor` function.
@@ -493,7 +480,7 @@ module.exports = {
493
480
  ]
494
481
  };
495
482
  ```
496
- see example [remove-secrets](https://github.com/cenfun/monocart-reporter-test/tree/main/tests/remove-secrets)
483
+ see example: [remove-secrets](https://github.com/cenfun/monocart-reporter-test/tree/main/tests/remove-secrets)
497
484
 
498
485
  ## Style Tags
499
486
  * Add tag to test/describe title ( starts with `@` )
@@ -842,7 +829,7 @@ test('finally, attach HAR', async () => {
842
829
  await attachNetworkReport(harPath, test.info());
843
830
  });
844
831
  ```
845
- Preview [Network HTML Report](https://cenfun.github.io/monocart-reporter/network-1a18723ee59b36867898/index.html)
832
+ Preview [Network HTML Report](https://cenfun.github.io/monocart-reporter/network-38e613e8d93547bdb27f/index.html)
846
833
 
847
834
  ## Merge Shard Reports
848
835
  There will be multiple reports to be generated if Playwright test executes in sharding mode. for example:
@@ -875,7 +862,7 @@ await merge(reportDataList, {
875
862
  }
876
863
  });
877
864
  ```
878
- example: [merged report](https://cenfun.github.io/monocart-reporter-test/merged)
865
+ Preview [merged report](https://cenfun.github.io/monocart-reporter-test/merged)
879
866
 
880
867
  ## onEnd hook
881
868
  The `onEnd` function will be executed after report generated. Arguments:
@@ -943,12 +930,12 @@ check example: [xray](https://github.com/cenfun/monocart-reporter-test/tree/main
943
930
  ![](/docs/slack.png)
944
931
 
945
932
  ## Discord Integration
946
- Using [Discord webhooks](https://discord.com/developers/docs/resources/webhook) to post messages to channels. example: [discord-webhook](https://github.com/cenfun/monocart-reporter-test/tree/main/integrations/discord-webhook)
933
+ Using [Discord webhooks](https://discord.com/developers/docs/resources/webhook) to post messages to channels. check example: [discord-webhook](https://github.com/cenfun/monocart-reporter-test/tree/main/integrations/discord-webhook)
947
934
 
948
935
  ![](/docs/discord.png)
949
936
 
950
937
  ## Teams Integration
951
- Please create an [Incoming Webhooks](https://learn.microsoft.com/en-us/microsoftteams/platform/webhooks-and-connectors/how-to/add-incoming-webhook) for the channel first. example: [teams-webhook](https://github.com/cenfun/monocart-reporter-test/tree/main/integrations/teams-webhook)
938
+ Please create an [Incoming Webhooks](https://learn.microsoft.com/en-us/microsoftteams/platform/webhooks-and-connectors/how-to/add-incoming-webhook) for the channel first. check example: [teams-webhook](https://github.com/cenfun/monocart-reporter-test/tree/main/integrations/teams-webhook)
952
939
 
953
940
  ![](/docs/teams.png)
954
941
 
package/lib/common.js CHANGED
@@ -39,7 +39,8 @@ const stepHandler = (item, summary) => {
39
39
  const tagHandler = (item, tags, tagOptions) => {
40
40
  const matches = item.title.matchAll(Util.tagPattern);
41
41
  for (const match of matches) {
42
- const tag = match[1];
42
+ // all, before, key, after
43
+ const tag = match[2];
43
44
  let tagItem = tags[tag];
44
45
  if (!tagItem) {
45
46
  tagItem = {};
@@ -9,7 +9,7 @@ module.exports = [{
9
9
  id: 'title',
10
10
  name: 'Title',
11
11
  searchable: true,
12
- width: 300,
12
+ width: 350,
13
13
  maxWidth: 1230
14
14
  }, {
15
15
  id: 'type',
@@ -81,16 +81,6 @@ const generateData = async (results) => {
81
81
  // global metadata
82
82
  const metadata = config.metadata || {};
83
83
 
84
- // merge project row metadata
85
- config.projects.forEach((p, i) => {
86
- // merge project metadata to project row
87
- const pm = p.metadata;
88
- const row = data.rows[i];
89
- if (pm && row) {
90
- Object.assign(row, pm);
91
- }
92
- });
93
-
94
84
  const reportName = getReportName(options, config, metadata);
95
85
  options.name = reportName;
96
86
 
@@ -1,7 +1,7 @@
1
1
  const Util = {
2
2
 
3
3
  // definition
4
- tagPattern: /@([^@\s]+)/g,
4
+ tagPattern: /(\s*)@([^@\s]+)(\s*)/g,
5
5
  lineBreakPattern: /\r\n|[\r\n\u2028\u2029]/gu,
6
6
 
7
7
  attachments: {