@wdio/junit-reporter 7.16.1 → 7.16.11

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
@@ -5,19 +5,9 @@ WebdriverIO XML Reporter
5
5
 
6
6
  ## Installation
7
7
 
8
- The easiest way is to keep `@wdio/junit-reporter` as a devDependency in your `package.json`.
8
+ The easiest way is to keep `@wdio/junit-reporter` as a devDependency in your `package.json`, via:
9
9
 
10
- ```json
11
- {
12
- "devDependencies": {
13
- "@wdio/junit-reporter": "^6.3.6"
14
- }
15
- }
16
- ```
17
-
18
- You can simple do it by:
19
-
20
- ```bash
10
+ ```sh
21
11
  npm install @wdio/junit-reporter --save-dev
22
12
  ```
23
13
 
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,YAAY,EAAE,EAAc,WAAW,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAGjF,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAA;AAOnD;;;;;GAKG;AACH,cAAM,aAAc,SAAQ,YAAY;IAQhB,OAAO,EAAE,oBAAoB;IAPjD,OAAO,CAAC,eAAe,CAAQ;IAC/B,OAAO,CAAC,YAAY,CAAC,CAAQ;IAC7B,OAAO,CAAC,gBAAgB,CAAC,CAAQ;IACjC,OAAO,CAAC,cAAc,CAAC,CAAQ;IAC/B,OAAO,CAAC,cAAc,CAAC,CAAK;IAC5B,OAAO,CAAC,kBAAkB,CAAC,CAAK;gBAEZ,OAAO,EAAE,oBAAoB;IAOjD,WAAW,CAAE,SAAS,EAAE,SAAS;IAIjC,WAAW,CAAE,MAAM,EAAE,WAAW;IAKhC,OAAO,CAAC,YAAY;IAMpB,OAAO,CAAC,eAAe;IAkBvB,OAAO,CAAC,4BAA4B;IAgFpC,OAAO,CAAC,kBAAkB;IAsE1B,OAAO,CAAC,cAAc;IAyCtB,OAAO,CAAC,mBAAmB;IAmB3B,OAAO,CAAC,kBAAkB;IAoB1B,OAAO,CAAC,OAAO;CAGlB;AAED,eAAe,aAAa,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,YAAY,EAAE,EAAc,WAAW,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAGjF,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAA;AAOnD;;;;;GAKG;AACH,cAAM,aAAc,SAAQ,YAAY;IAQhB,OAAO,EAAE,oBAAoB;IAPjD,OAAO,CAAC,eAAe,CAAQ;IAC/B,OAAO,CAAC,YAAY,CAAC,CAAQ;IAC7B,OAAO,CAAC,gBAAgB,CAAC,CAAQ;IACjC,OAAO,CAAC,cAAc,CAAC,CAAQ;IAC/B,OAAO,CAAC,cAAc,CAAC,CAAK;IAC5B,OAAO,CAAC,kBAAkB,CAAC,CAAK;gBAEZ,OAAO,EAAE,oBAAoB;IAOjD,WAAW,CAAE,SAAS,EAAE,SAAS;IAIjC,WAAW,CAAE,MAAM,EAAE,WAAW;IAKhC,OAAO,CAAC,YAAY;IAMpB,OAAO,CAAC,eAAe;IAkBvB,OAAO,CAAC,4BAA4B;IAmFpC,OAAO,CAAC,kBAAkB;IAyE1B,OAAO,CAAC,cAAc;IAyCtB,OAAO,CAAC,mBAAmB;IAmB3B,OAAO,CAAC,kBAAkB;IAoB1B,OAAO,CAAC,OAAO;CAGlB;AAED,eAAe,aAAa,CAAA"}
package/build/index.js CHANGED
@@ -52,7 +52,9 @@ class JunitReporter extends reporter_1.default {
52
52
  return suite;
53
53
  }
54
54
  _addCucumberFeatureToBuilder(builder, runner, specFileName, suite) {
55
- const featureName = this._prepareName(suite.title);
55
+ const featureName = !this.options.suiteNameFormat || this.options.suiteNameFormat instanceof RegExp
56
+ ? this._prepareName(suite.title)
57
+ : this.options.suiteNameFormat({ name: this.options.suiteNameFormat.name, suite });
56
58
  const filePath = specFileName.replace(process.cwd(), '.');
57
59
  if (suite.type === 'feature') {
58
60
  const feature = builder.testSuite()
@@ -123,8 +125,10 @@ class JunitReporter extends reporter_1.default {
123
125
  return builder;
124
126
  }
125
127
  _addSuiteToBuilder(builder, runner, specFileName, suite) {
126
- const suiteName = this._prepareName(suite.title);
127
128
  const filePath = specFileName.replace(process.cwd(), '.');
129
+ const suiteName = !this.options.suiteNameFormat || this.options.suiteNameFormat instanceof RegExp
130
+ ? this._prepareName(suite.title)
131
+ : this.options.suiteNameFormat({ name: this.options.suiteNameFormat.name, suite });
128
132
  let testSuite = builder.testSuite()
129
133
  .name(suiteName)
130
134
  .timestamp(suite.start)
package/build/types.d.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  import { Reporters } from '@wdio/types';
2
2
  import { SuiteStats } from '@wdio/reporter';
3
+ declare type TestSuiteNameFunction = (options: TestSuiteNameFormatOptions) => string;
3
4
  interface ClassNameFormatOptions {
4
5
  /**
5
6
  * Configured package name
@@ -14,6 +15,10 @@ interface ClassNameFormatOptions {
14
15
  */
15
16
  suite?: SuiteStats;
16
17
  }
18
+ interface TestSuiteNameFormatOptions {
19
+ name?: any;
20
+ suite: SuiteStats;
21
+ }
17
22
  export interface JUnitReporterOptions extends Reporters.Options {
18
23
  /**
19
24
  * Define the xml files created after the test execution.
@@ -33,11 +38,19 @@ export interface JUnitReporterOptions extends Reporters.Options {
33
38
  */
34
39
  outputFileFormat?: (opts: any) => string;
35
40
  /**
36
- * Gives the ability to provide custom regex for formatting test suite name (e.g. in output xml ).
41
+ * Gives the ability to provide custom regex for formatting test suite name (e.g. in output xml ) or
42
+ * override the generated name of a test suite.
43
+ *
37
44
  *
38
- * @default /[^a-z0-9]+/
45
+ * @example regex
46
+ * /[^a-z0-9]+/
47
+ *
48
+ * @example suiteName
49
+ * suiteNameFormat: function (options) {
50
+ * return `${options.suite.title}`
51
+ * }
39
52
  */
40
- suiteNameFormat?: RegExp;
53
+ suiteNameFormat?: RegExp | TestSuiteNameFunction;
41
54
  /**
42
55
  * Give the ability to override the generated classname of a test case.
43
56
  *
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AACvC,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAE3C,UAAU,sBAAsB;IAC5B;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB;;OAEG;IACH,iBAAiB,CAAC,EAAE,GAAG,CAAA;IACvB;;OAEG;IACH,KAAK,CAAC,EAAE,UAAU,CAAC;CACtB;AAED,MAAM,WAAW,oBAAqB,SAAQ,SAAS,CAAC,OAAO;IAC3D;;;;;;;;;;;;;;;OAeG;IACH,gBAAgB,CAAC,EAAE,CAAC,IAAI,EAAE,GAAG,KAAK,MAAM,CAAA;IACxC;;;;OAIG;IACH,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB;;;;;;;OAOG;IACH,eAAe,CAAC,EAAE,CAAC,OAAO,EAAE,sBAAsB,KAAK,MAAM,CAAA;IAC7D;;;;;OAKG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAA;IAC1B;;;;;;;;;;;;;;;;;;;OAmBG;IACH,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAoCG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;CACxC"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AACvC,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAE3C,aAAK,qBAAqB,GAAG,CAAC,OAAO,EAAE,0BAA0B,KAAK,MAAM,CAAA;AAE5E,UAAU,sBAAsB;IAC5B;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB;;OAEG;IACH,iBAAiB,CAAC,EAAE,GAAG,CAAA;IACvB;;OAEG;IACH,KAAK,CAAC,EAAE,UAAU,CAAA;CACrB;AAED,UAAU,0BAA0B;IAChC,IAAI,CAAC,EAAE,GAAG,CAAA;IACV,KAAK,EAAE,UAAU,CAAA;CACpB;AAED,MAAM,WAAW,oBAAqB,SAAQ,SAAS,CAAC,OAAO;IAC3D;;;;;;;;;;;;;;;OAeG;IACH,gBAAgB,CAAC,EAAE,CAAC,IAAI,EAAE,GAAG,KAAK,MAAM,CAAA;IACxC;;;;;;;;;;;;OAYG;IACH,eAAe,CAAC,EAAE,MAAM,GAAG,qBAAqB,CAAA;IAChD;;;;;;;OAOG;IACH,eAAe,CAAC,EAAE,CAAC,OAAO,EAAE,sBAAsB,KAAK,MAAM,CAAA;IAC7D;;;;;OAKG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAA;IAC1B;;;;;;;;;;;;;;;;;;;OAmBG;IACH,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAoCG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;CACxC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wdio/junit-reporter",
3
- "version": "7.16.1",
3
+ "version": "7.16.11",
4
4
  "description": "A WebdriverIO reporter that creates Jenkins compatible XML based JUnit reports",
5
5
  "author": "Christian Bromann <christian@saucelabs.com>",
6
6
  "homepage": "https://github.com/webdriverio/webdriverio/tree/main/packages/wdio-junit-reporter",
@@ -26,8 +26,8 @@
26
26
  "dependencies": {
27
27
  "@types/json-stringify-safe": "^5.0.0",
28
28
  "@types/validator": "^13.1.3",
29
- "@wdio/reporter": "7.16.1",
30
- "@wdio/types": "7.16.1",
29
+ "@wdio/reporter": "7.16.11",
30
+ "@wdio/types": "7.16.11",
31
31
  "json-stringify-safe": "^5.0.1",
32
32
  "junit-report-builder": "^3.0.0",
33
33
  "validator": "^13.0.0"
@@ -38,5 +38,5 @@
38
38
  "publishConfig": {
39
39
  "access": "public"
40
40
  },
41
- "gitHead": "5aba1c7aeeb2592fe90cc3ba64129b4668a5dde1"
41
+ "gitHead": "7aa1d82a1590b47db444734dc86fae7bca1c777c"
42
42
  }