wdio-qase-reporter 1.0.0-beta.4 → 1.0.1

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
@@ -111,7 +111,7 @@ Example `qase.config.json` config:
111
111
  }
112
112
  ```
113
113
 
114
- Also, you need to configure the reporter using the `wdio.conf.ts` file:
114
+ Also, you need to configure the reporter using the `wdio.conf.ts` or `wdio.conf.js` files:
115
115
 
116
116
  ```ts
117
117
  // wdio.conf.ts
@@ -140,7 +140,34 @@ export const config: Options.Testrunner = {
140
140
  };
141
141
  ```
142
142
 
143
- Additional options of the reporter in the `wdio.conf.ts` file:
143
+ ```javascript
144
+ // wdio.conf.js
145
+ const WDIOQaseReporter = require('wdio-qase-reporter').default;
146
+ const {beforeRunHook, afterRunHook} = require('wdio-qase-reporter');
147
+
148
+
149
+ exports.config = {
150
+ reporters: [[WDIOQaseReporter, {
151
+ disableWebdriverStepsReporting: true,
152
+ disableWebdriverScreenshotsReporting: true,
153
+ useCucumber: false,
154
+ }]],
155
+
156
+ // ...
157
+ // =====
158
+ // Hooks
159
+ // =====
160
+ onPrepare: async function() {
161
+ await beforeRunHook();
162
+ },
163
+ onComplete: async function() {
164
+ await afterRunHook();
165
+ },
166
+ // ... other options
167
+ };
168
+ ```
169
+
170
+ Additional options of the reporter in the `wdio.conf.ts` or `wdio.conf.js` files:
144
171
 
145
172
  - `disableWebdriverStepsReporting` - optional parameter(`false` by default), in order to log only custom steps to the reporter.
146
173
  - `disableWebdriverScreenshotsReporting` - optional parameter(`false` by default), in order to not attach screenshots to the reporter.
package/changelog.md CHANGED
@@ -1,3 +1,15 @@
1
+ # qase-wdio@1.0.1
2
+
3
+ ## What's new
4
+
5
+ Resolved an issue with handling parent test suites, ensuring proper structure and reporting.
6
+
7
+ # qase-wdio@1.0.0
8
+
9
+ ## What's new
10
+
11
+ Major release of the WDIO reporter package.
12
+
1
13
  # qase-wdio@1.0.0-beta.4
2
14
 
3
15
  ## What's new
package/dist/options.js CHANGED
@@ -2,6 +2,9 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.QaseReporterOptions = void 0;
4
4
  class QaseReporterOptions {
5
+ useCucumber;
6
+ disableWebdriverStepsReporting;
7
+ disableWebdriverScreenshotsReporting;
5
8
  constructor() {
6
9
  this.useCucumber = false;
7
10
  this.disableWebdriverStepsReporting = false;
package/dist/reporter.js CHANGED
@@ -12,6 +12,28 @@ const utils_1 = require("./utils");
12
12
  const path_1 = __importDefault(require("path"));
13
13
  const events_1 = require("./events");
14
14
  class WDIOQaseReporter extends reporter_1.default {
15
+ /**
16
+ * @type {Record<string, TestStatusEnum>}
17
+ */
18
+ static statusMap = {
19
+ 'passed': qase_javascript_commons_1.TestStatusEnum.passed,
20
+ 'failed': qase_javascript_commons_1.TestStatusEnum.failed,
21
+ 'skipped': qase_javascript_commons_1.TestStatusEnum.skipped,
22
+ 'pending': qase_javascript_commons_1.TestStatusEnum.skipped,
23
+ };
24
+ /**
25
+ * @type {ReporterInterface}
26
+ * @private
27
+ */
28
+ reporter;
29
+ storage;
30
+ /**
31
+ * @type {boolean}
32
+ * @private
33
+ */
34
+ isSync;
35
+ _options;
36
+ _isMultiremote;
15
37
  constructor(options) {
16
38
  // eslint-disable-next-line @typescript-eslint/no-unsafe-argument
17
39
  super(options);
@@ -365,6 +387,7 @@ class WDIOQaseReporter extends reporter_1.default {
365
387
  data: {
366
388
  action: title,
367
389
  expected_result: null,
390
+ data: null,
368
391
  },
369
392
  parent_id: this.storage.getLastItem()?.id ?? null,
370
393
  execution: {
@@ -417,13 +440,4 @@ class WDIOQaseReporter extends reporter_1.default {
417
440
  return { key, value };
418
441
  }
419
442
  }
420
- /**
421
- * @type {Record<string, TestStatusEnum>}
422
- */
423
- WDIOQaseReporter.statusMap = {
424
- 'passed': qase_javascript_commons_1.TestStatusEnum.passed,
425
- 'failed': qase_javascript_commons_1.TestStatusEnum.failed,
426
- 'skipped': qase_javascript_commons_1.TestStatusEnum.skipped,
427
- 'pending': qase_javascript_commons_1.TestStatusEnum.skipped,
428
- };
429
443
  exports.default = WDIOQaseReporter;
package/dist/step.js CHANGED
@@ -8,10 +8,10 @@ const qase_javascript_commons_1 = require("qase-javascript-commons");
8
8
  const uuid_1 = require("uuid");
9
9
  const path_1 = __importDefault(require("path"));
10
10
  class QaseStep {
11
+ name = '';
12
+ attachments = [];
13
+ steps = [];
11
14
  constructor(name) {
12
- this.name = '';
13
- this.attachments = [];
14
- this.steps = [];
15
15
  this.name = name;
16
16
  }
17
17
  attach(attach) {
@@ -57,6 +57,7 @@ class QaseStep {
57
57
  step.data = {
58
58
  action: this.name,
59
59
  expected_result: null,
60
+ data: null,
60
61
  };
61
62
  try {
62
63
  await body.call(this, this);
package/dist/storage.js CHANGED
@@ -3,16 +3,20 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.findLast = exports.Storage = void 0;
4
4
  const qase_javascript_commons_1 = require("qase-javascript-commons");
5
5
  class Storage {
6
- constructor() {
7
- this.suites = [];
8
- this.ignore = false;
9
- this.items = [];
10
- }
6
+ currentFile;
7
+ suites = [];
8
+ ignore = false;
9
+ items = [];
11
10
  clear() {
12
11
  this.currentFile = undefined;
13
- this.suites = [];
14
12
  this.items = [];
15
13
  this.ignore = false;
14
+ if (this.suites.length > 0) {
15
+ this.suites.pop();
16
+ }
17
+ else {
18
+ this.suites = [];
19
+ }
16
20
  }
17
21
  push(item) {
18
22
  this.items.push(item);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wdio-qase-reporter",
3
- "version": "1.0.0-beta.4",
3
+ "version": "1.0.1",
4
4
  "description": "Qase WebDriverIO Reporter",
5
5
  "homepage": "https://github.com/qase-tms/qase-javascript",
6
6
  "sideEffects": false,
@@ -32,7 +32,7 @@
32
32
  "author": "Qase Team <support@qase.io>",
33
33
  "license": "Apache-2.0",
34
34
  "dependencies": {
35
- "qase-javascript-commons": "~2.2.0",
35
+ "qase-javascript-commons": "~2.2.14",
36
36
  "uuid": "^9.0.1",
37
37
  "@types/node": "^20.1.0",
38
38
  "@wdio/reporter": "^8.39.0",