cypress-qase-reporter 2.2.1 → 2.2.3

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
@@ -98,6 +98,9 @@ parameterize your tests.
98
98
  - `qase.groupParameters` - set the group parameters of the test case
99
99
  - `qase.ignore` - ignore the test case in Qase. The test will be executed, but the results will not be sent to Qase.
100
100
  - `qase.step` - create a step in the test case
101
+ - `qase.attach` - attach a file or content to the test case
102
+
103
+ For detailed instructions on using annotations and methods, refer to [Usage](docs/usage.md).
101
104
 
102
105
  For example:
103
106
 
package/changelog.md CHANGED
@@ -1,3 +1,21 @@
1
+ # cypress-qase-reporter@2.2.3
2
+
3
+ ## What's new
4
+
5
+ Fixed an issue with the `@cypress/grep` plugin. When the `grepOmitFiltered` option is set to `true`, the reporter
6
+ encounters an error.
7
+
8
+ ```log
9
+ Cannot set properties of undefined (setting 'title')
10
+ ```
11
+
12
+ # cypress-qase-reporter@2.2.2
13
+
14
+ ## What's new
15
+
16
+ Fixed an issue with metadata. When specifying the path to the Cypress config located outside the root directory,
17
+ metadata was not added to the test case.
18
+
1
19
  # cypress-qase-reporter@2.2.1
2
20
 
3
21
  ## What's new
@@ -6,7 +24,7 @@ When specifying test names, QaseIDs are now excluded from the final test name.
6
24
 
7
25
  ```js
8
26
  // The test name will be 'Example', not 'Example (Qase ID: 1)'
9
- qase(1,it('Example', () => {
27
+ qase(1, it('Example', () => {
10
28
  expect(true).to.equal(true);
11
29
  })
12
30
  );
@@ -1,6 +1,7 @@
1
1
  import { Attach, Metadata } from './models';
2
2
  import { Attachment } from 'qase-javascript-commons';
3
3
  export declare class MetadataManager {
4
+ static metadataPath: string;
4
5
  static getMetadata(): Metadata | undefined;
5
6
  static setIgnore(): void;
6
7
  static addStepStart(name: string): void;
@@ -8,7 +8,6 @@ const fs_1 = require("fs");
8
8
  const uuid_1 = require("uuid");
9
9
  const path_1 = __importDefault(require("path"));
10
10
  const qase_javascript_commons_1 = require("qase-javascript-commons");
11
- const metadataPath = 'qaseMetadata';
12
11
  // eslint-disable-next-line @typescript-eslint/no-extraneous-class
13
12
  class MetadataManager {
14
13
  static getMetadata() {
@@ -30,7 +29,7 @@ class MetadataManager {
30
29
  stepAttachments: {},
31
30
  };
32
31
  try {
33
- const data = (0, fs_1.readFileSync)(metadataPath, 'utf8');
32
+ const data = (0, fs_1.readFileSync)(this.metadataPath, 'utf8');
34
33
  metadata = JSON.parse(data);
35
34
  return metadata;
36
35
  }
@@ -126,7 +125,7 @@ class MetadataManager {
126
125
  static setMetadata(metadata) {
127
126
  try {
128
127
  const data = JSON.stringify(metadata);
129
- (0, fs_1.writeFileSync)(metadataPath, data);
128
+ (0, fs_1.writeFileSync)(this.metadataPath, data);
130
129
  }
131
130
  catch (err) {
132
131
  console.error('Error writing metadata file:', err);
@@ -137,14 +136,14 @@ class MetadataManager {
137
136
  return;
138
137
  }
139
138
  try {
140
- (0, fs_1.unlinkSync)(metadataPath);
139
+ (0, fs_1.unlinkSync)(this.metadataPath);
141
140
  }
142
141
  catch (err) {
143
142
  console.error('Error clearing state file:', err);
144
143
  }
145
144
  }
146
145
  static isExists() {
147
- return (0, fs_1.existsSync)(metadataPath);
146
+ return (0, fs_1.existsSync)(this.metadataPath);
148
147
  }
149
148
  static prepareAttach(attach) {
150
149
  const attachments = [];
@@ -190,3 +189,4 @@ class MetadataManager {
190
189
  }
191
190
  }
192
191
  exports.MetadataManager = MetadataManager;
192
+ MetadataManager.metadataPath = path_1.default.resolve(__dirname, 'qaseMetadata');
package/dist/mocha.js CHANGED
@@ -2,6 +2,10 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.qase = void 0;
4
4
  const qase = (caseId, test) => {
5
+ // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
6
+ if (!test?.title) {
7
+ return test;
8
+ }
5
9
  const caseIds = Array.isArray(caseId) ? caseId : [caseId];
6
10
  test.title = `${test.title} (Qase ID: ${caseIds.join(',')})`;
7
11
  return test;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cypress-qase-reporter",
3
- "version": "2.2.1",
3
+ "version": "2.2.3",
4
4
  "description": "Qase Cypress Reporter",
5
5
  "homepage": "https://github.com/qase-tms/qase-javascript",
6
6
  "sideEffects": false,