cucumber-reactive-reporter 1.0.9 → 1.0.10

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
@@ -36,7 +36,12 @@ let metadata = {
36
36
  "additional key": "value",
37
37
  "more keys": "value"
38
38
  };
39
+ let linkTags = [{
40
+ "pattern": "[a-zA-Z]*-(\\d)*$",
41
+ "link": "https://my.jira.server/browse/"
42
+ }];
39
43
  options.metadata = metadata;
44
+ options.linkTags = linkTags;
40
45
  (async () => {
41
46
  await Reporter.generate("mytest/cucumber-output.json", "htmlOutputFolder/", options);
42
47
  })();
@@ -51,22 +56,9 @@ options.metadata = metadata;
51
56
  * ```(@catfacts or @image) and not @1_tag```
52
57
  ## TODOs and ideas for improvement:
53
58
 
54
- 1. consider adding hooks for linking to jira the way allure does it:
55
- ```
56
- links: {
57
- issue: {
58
- pattern: [/@issue=(.*)/],
59
- urlTemplate: "http://localhost:8080/issue/%s"
60
- },
61
- tms: {
62
- pattern: [/@tms=(.*)/],
63
- urlTemplate: "http://localhost:8080/tms/%s"
64
- }
65
- }
66
- ```
67
- 2. patch more settings for intial render (before/after toggle, theme, filter etc.)
68
- 3. handle state "ambiguous" (probably lump em with errors), generate one when there are two test definitions with similar regex
69
- 4. Figure out a strategy for handling combined reports (from parallel runs)
59
+ 1. patch more settings for intial render (before/after toggle, theme, filter etc.)
60
+ 2. handle state "ambiguous" (probably lump em with errors), generate one when there are two test definitions with similar regex
61
+ 3. Figure out a strategy for handling combined reports (from parallel runs)
70
62
 
71
63
  ### Release notes
72
64
 
@@ -80,3 +72,4 @@ links: {
80
72
  | 1.0.7 | Changed feature pagination to be always on if above 10 elements, the reason why is you can change to display 10 at a time to force single column|
81
73
  | 1.0.8 | Fixed json parsing error for newer cucumber version, where Before and After steps do not provide code line info|
82
74
  | 1.0.9 | Fixed displayed step duration in newer versions of cucumber|
75
+ | 1.0.10 | New reporter option to convert some tags to custom links|
@@ -3,6 +3,7 @@
3
3
  function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
4
4
 
5
5
  var fs = _interopDefault(require('fs'));
6
+ require('fs/promises');
6
7
  var ncp = _interopDefault(require('ncp'));
7
8
  var path = _interopDefault(require('path'));
8
9
  var ut = _interopDefault(require('util'));
@@ -58,14 +59,19 @@ const generate = async (source, dest, options) => {
58
59
  options ? true : options = {};
59
60
  const CUCUMBER_JSON_PATH = "_cucumber-results.json";
60
61
  const SETTINGS_JSON_PATH = "_reporter_settings.json";
61
- const HTML_PATH = path.join(path.dirname(modulePath), "react"); //defaults
62
+ const HTML_PATH = path.join(path.dirname(modulePath), "react"); // "linkTags": [{
63
+ // "pattern": "[a-zA-Z]*-(\\d)*$",
64
+ // "link": "https://bydeluxe.atlassian.net/browse/"
65
+ // }]
66
+ //defaults
62
67
 
63
68
  const {
64
69
  title = "Cucumber Report",
65
70
  //report page title
66
71
  description = "Cucumber report",
67
72
  //description to be set at the page header
68
- metadata = {}
73
+ metadata = {},
74
+ linkTags = null
69
75
  } = options;
70
76
 
71
77
  let __dirname = path.resolve();
@@ -84,7 +90,7 @@ const generate = async (source, dest, options) => {
84
90
  }
85
91
  }
86
92
 
87
- console.log(`__dirname: ${__dirname}\n` + `html path: ${HTML_PATH}\n` + `source: ${source}\n` + `destination: ${dest}\n` + `title: ${title}\n` + `description: ${description}\n` + `metadata: ${ut.inspect(metadata, false, null)}\n`); //validate input json and make a copy
93
+ console.log(`__dirname: ${__dirname}\n` + `html path: ${HTML_PATH}\n` + `source: ${source}\n` + `destination: ${dest}\n` + `title: ${title}\n` + `description: ${description}\n` + `metadata: ${ut.inspect(metadata, false, null)}\n` + `linkTags: ${ut.inspect(linkTags, false, null)}\n`); //validate input json and make a copy
88
94
 
89
95
  let str = fs.readFileSync(source).toString();
90
96
  let obj = JSON.parse(str);
@@ -1,4 +1,5 @@
1
1
  import fs from 'fs';
2
+ import 'fs/promises';
2
3
  import ncp from 'ncp';
3
4
  import path from 'path';
4
5
  import ut from 'util';
@@ -54,14 +55,19 @@ const generate = async (source, dest, options) => {
54
55
  options ? true : options = {};
55
56
  const CUCUMBER_JSON_PATH = "_cucumber-results.json";
56
57
  const SETTINGS_JSON_PATH = "_reporter_settings.json";
57
- const HTML_PATH = path.join(path.dirname(modulePath), "react"); //defaults
58
+ const HTML_PATH = path.join(path.dirname(modulePath), "react"); // "linkTags": [{
59
+ // "pattern": "[a-zA-Z]*-(\\d)*$",
60
+ // "link": "https://bydeluxe.atlassian.net/browse/"
61
+ // }]
62
+ //defaults
58
63
 
59
64
  const {
60
65
  title = "Cucumber Report",
61
66
  //report page title
62
67
  description = "Cucumber report",
63
68
  //description to be set at the page header
64
- metadata = {}
69
+ metadata = {},
70
+ linkTags = null
65
71
  } = options;
66
72
 
67
73
  let __dirname = path.resolve();
@@ -80,7 +86,7 @@ const generate = async (source, dest, options) => {
80
86
  }
81
87
  }
82
88
 
83
- console.log(`__dirname: ${__dirname}\n` + `html path: ${HTML_PATH}\n` + `source: ${source}\n` + `destination: ${dest}\n` + `title: ${title}\n` + `description: ${description}\n` + `metadata: ${ut.inspect(metadata, false, null)}\n`); //validate input json and make a copy
89
+ console.log(`__dirname: ${__dirname}\n` + `html path: ${HTML_PATH}\n` + `source: ${source}\n` + `destination: ${dest}\n` + `title: ${title}\n` + `description: ${description}\n` + `metadata: ${ut.inspect(metadata, false, null)}\n` + `linkTags: ${ut.inspect(linkTags, false, null)}\n`); //validate input json and make a copy
84
90
 
85
91
  let str = fs.readFileSync(source).toString();
86
92
  let obj = JSON.parse(str);
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cucumber-reactive-reporter",
3
- "version": "1.0.9",
3
+ "version": "1.0.10",
4
4
  "description": "A filterable html report generator for cucumberjs written in react",
5
5
  "private": false,
6
6
  "homepage": "https://github.com/unsuspecting-noob/cucumber-reactive-reporter",
@@ -1,18 +1,18 @@
1
1
  self.__precacheManifest = (self.__precacheManifest || []).concat([
2
2
  {
3
- "revision": "0d1f2ca0f1bdb2e2f33d927d836e2ef5",
3
+ "revision": "2cf4b2fae6824e4886d08e06bec0fec5",
4
4
  "url": "./index.html"
5
5
  },
6
6
  {
7
- "revision": "ef7ab0d10083791eb7e5",
7
+ "revision": "c918967a5be3093b1dd9",
8
8
  "url": "./static/css/2.css"
9
9
  },
10
10
  {
11
- "revision": "b5778a6faeed31cd891f",
11
+ "revision": "3bfaa216c0baff752102",
12
12
  "url": "./static/css/main.css"
13
13
  },
14
14
  {
15
- "revision": "ef7ab0d10083791eb7e5",
15
+ "revision": "c918967a5be3093b1dd9",
16
16
  "url": "./static/js/2.js"
17
17
  },
18
18
  {
@@ -20,7 +20,7 @@ self.__precacheManifest = (self.__precacheManifest || []).concat([
20
20
  "url": "./static/js/2.js.LICENSE.txt"
21
21
  },
22
22
  {
23
- "revision": "b5778a6faeed31cd891f",
23
+ "revision": "3bfaa216c0baff752102",
24
24
  "url": "./static/js/main.js"
25
25
  },
26
26
  {