cypress-qase-reporter 2.0.1 → 2.0.2

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/changelog.md CHANGED
@@ -1,3 +1,12 @@
1
+ # cypress-qase-reporter@2.0.2
2
+
3
+ ## What's new
4
+
5
+ 1. Cypress kills the process after the last tests.
6
+ The reporter will wait for all results to be sent to Qase and will not block the process after sending.
7
+
8
+ 2. The reporter will collect suites and add them to results.
9
+
1
10
  # cypress-qase-reporter@2.0.1
2
11
 
3
12
  ## What's new
package/dist/reporter.js CHANGED
@@ -11,6 +11,8 @@ const qase_javascript_commons_1 = require("qase-javascript-commons");
11
11
  const traverse_dir_1 = require("./utils/traverse-dir");
12
12
  const configSchema_1 = require("./configSchema");
13
13
  const { EVENT_TEST_FAIL, EVENT_TEST_PASS, EVENT_TEST_PENDING, EVENT_RUN_END, EVENT_RUN_BEGIN, } = mocha_1.Runner.constants;
14
+ // eslint-disable-next-line @typescript-eslint/unbound-method
15
+ const _exit = process.exit;
14
16
  /**
15
17
  * @class CypressQaseReporter
16
18
  * @extends reporters.Base
@@ -98,6 +100,21 @@ class CypressQaseReporter extends mocha_1.reporters.Base {
98
100
  const attachments = this.screenshotsFolder
99
101
  ? CypressQaseReporter.findAttachments(ids, this.screenshotsFolder)
100
102
  : undefined;
103
+ let relations = {};
104
+ if (test.parent !== undefined) {
105
+ const data = [];
106
+ for (const suite of test.parent.titlePath()) {
107
+ data.push({
108
+ title: suite,
109
+ public_id: null,
110
+ });
111
+ }
112
+ relations = {
113
+ suite: {
114
+ data: data,
115
+ },
116
+ };
117
+ }
101
118
  const result = {
102
119
  attachments: attachments ?? [],
103
120
  author: null,
@@ -105,7 +122,7 @@ class CypressQaseReporter extends mocha_1.reporters.Base {
105
122
  message: test.err?.message ?? null,
106
123
  muted: false,
107
124
  params: {},
108
- relations: {},
125
+ relations: relations,
109
126
  run_id: null,
110
127
  signature: '',
111
128
  steps: [],
@@ -122,7 +139,6 @@ class CypressQaseReporter extends mocha_1.reporters.Base {
122
139
  },
123
140
  testops_id: ids.length > 0 ? ids : null,
124
141
  title: test.title,
125
- // suiteTitle: test.parent?.titlePath(),
126
142
  };
127
143
  void this.reporter.addTestResult(result);
128
144
  }
@@ -130,8 +146,6 @@ class CypressQaseReporter extends mocha_1.reporters.Base {
130
146
  * @private
131
147
  */
132
148
  preventExit() {
133
- // eslint-disable-next-line @typescript-eslint/unbound-method
134
- const _exit = process.exit;
135
149
  const mutableProcess = process;
136
150
  mutableProcess.exit = (code) => {
137
151
  process.exitCode = code || 0;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cypress-qase-reporter",
3
- "version": "2.0.1",
3
+ "version": "2.0.2",
4
4
  "description": "Qase Cypress Reporter",
5
5
  "homepage": "https://github.com/qase-tms/qase-javascript",
6
6
  "sideEffects": false,