playwright-qase-reporter 2.1.6 → 2.1.7

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,9 @@
1
+ # playwright-qase-reporter@2.1.7
2
+
3
+ ## What's new
4
+
5
+ - Improved handling thread id for parallel and shared workers tests.
6
+
1
7
  # playwright-qase-reporter@2.1.6
2
8
 
3
9
  ## What's new
@@ -1,4 +1,3 @@
1
- /// <reference types="node" />
2
1
  export declare const ReporterContentType = "application/qase.metadata+json";
3
2
  export interface MetadataMessage {
4
3
  ids?: number[];
@@ -23,122 +22,19 @@ export interface MetadataMessage {
23
22
  */
24
23
  export declare const qase: {
25
24
  (caseId: number | string | number[] | string[], name: string): string;
26
- /**
27
- * Set IDs for the test case
28
- * Use `qase()` instead. This method is deprecated and kept for reverse compatibility.
29
- *
30
- * @param {number | number[]} value
31
- *
32
- * @example
33
- * test('test', async ({ page }) => {
34
- * qase.id(1);
35
- * await page.goto('https://example.com');
36
- * });
37
- *
38
- */
39
- id(value: number | number[]): any;
40
- /**
41
- * Set a title for the test case
42
- * @param {string} value
43
- * @example
44
- * test('test', async ({ page }) => {
45
- * qase.title("Title");
46
- * await page.goto('https://example.com');
47
- * });
48
- */
49
- title(value: string): any;
50
- /**
51
- * Set fields for the test case
52
- * @param {Record<string, string>[]} values
53
- * @example
54
- * test('test', async ({ page }) => {
55
- * qase.fields({ 'severity': 'high', 'priority': 'medium' });
56
- * await page.goto('https://example.com');
57
- * });
58
- */
59
- fields(values: Record<string, string>): any;
60
- /**
61
- * Set parameters for the test case
62
- * @param {Record<string, string>[]} values
63
- * @example
64
- * for (const value of values) {
65
- * test('test', async ({ page }) => {
66
- * qase.parameters({ 'parameter': value });
67
- * await page.goto('https://example.com');
68
- * });
69
- * )
70
- */
71
- parameters(values: Record<string, string>): any;
72
- /**
73
- * Set group parameters for the test case.
74
- * All parameters will be grouped as a single entity.
75
- * @param {Record<string, string>[]} values
76
- * @example
77
- * for (const value of values) {
78
- * test('test', async ({ page }) => {
79
- * qase.groupParameters({ 'parameter': value });
80
- * await page.goto('https://example.com');
81
- * });
82
- * )
83
- */
84
- groupParameters(values: Record<string, string>): any;
85
- /**
86
- * Attach a file to the test case or the step
87
- * @param attach
88
- * @example
89
- * test('test', async ({ page }) => {
90
- * qase.attach({ name: 'attachment.txt', content: 'Hello, world!', contentType: 'text/plain' });
91
- * qase.attach({ paths: '/path/to/file'});
92
- * qase.attach({ paths: ['/path/to/file', '/path/to/another/file']});
93
- * await page.goto('https://example.com');
94
- * });
95
- */
25
+ id(value: number | number[]): /*elided*/ any;
26
+ title(value: string): /*elided*/ any;
27
+ fields(values: Record<string, string>): /*elided*/ any;
28
+ parameters(values: Record<string, string>): /*elided*/ any;
29
+ groupParameters(values: Record<string, string>): /*elided*/ any;
96
30
  attach(attach: {
97
31
  name?: string;
98
32
  paths?: string | string[];
99
33
  content?: Buffer | string;
100
34
  contentType?: string;
101
- }): any;
102
- /**
103
- * Ignore the test case result in Qase
104
- * @example
105
- * test('test', async ({ page }) => {
106
- * qase.ignore();
107
- * await page.goto('https://example.com');
108
- * });
109
- */
110
- ignore(): any;
111
- /**
112
- * Set a suite for the test case
113
- * @param {string} value
114
- * @example
115
- * test('test', async ({ page }) => {
116
- * qase.suite("Suite");
117
- * await page.goto('https://example.com');
118
- * });
119
- */
120
- suite(value: string): any;
121
- /**
122
- * Set a comment for the test case
123
- * @param {string} value
124
- * @example
125
- * test('test', async ({ page }) => {
126
- * qase.comment("Comment");
127
- * await page.goto('https://example.com');
128
- * });
129
- */
130
- comment(value: string): any;
131
- /**
132
- * Set a expected result and data for the test step
133
- * @param action
134
- * @param expectedResult
135
- * @param data
136
- * @example
137
- * test('test', async ({ page }) => {
138
- * await test.step(qase.step('action', 'expected result', 'data'), async () => {
139
- * await page.goto('https://example.com');
140
- * });
141
- * });
142
- */
35
+ }): /*elided*/ any;
36
+ ignore(): /*elided*/ any;
37
+ suite(value: string): /*elided*/ any;
38
+ comment(value: string): /*elided*/ any;
143
39
  step(action: string, expectedResult: string | undefined, data: string | undefined): string;
144
40
  };
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
15
15
  }) : function(o, v) {
16
16
  o["default"] = v;
17
17
  });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
25
35
  var __importDefault = (this && this.__importDefault) || function (mod) {
26
36
  return (mod && mod.__esModule) ? mod : { "default": mod };
27
37
  };
package/dist/reporter.js CHANGED
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
15
15
  }) : function(o, v) {
16
16
  o["default"] = v;
17
17
  });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
25
35
  Object.defineProperty(exports, "__esModule", { value: true });
26
36
  exports.PlaywrightQaseReporter = void 0;
27
37
  const uuid_1 = require("uuid");
@@ -337,7 +347,7 @@ class PlaywrightQaseReporter {
337
347
  stacktrace: error === null ?
338
348
  null : error.stacktrace === undefined ?
339
349
  null : error.stacktrace,
340
- thread: result.parallelIndex.toString(),
350
+ thread: process.ppid.toString() + '-' + result.parallelIndex.toString(),
341
351
  },
342
352
  fields: testCaseMetadata.fields,
343
353
  id: (0, uuid_1.v4)(),
package/docs/usage.md CHANGED
@@ -183,8 +183,7 @@ test('test', async ({ page }) => {
183
183
 
184
184
  ## Adding Steps to a Test
185
185
 
186
- You can add steps to a test case using the `qase.step` function. This function accepts a string, which will be used as
187
- the step description in Qase.
186
+ You can add steps to a test case using the `qase.step` function. This function accepts a string for the action, and optionally an expected result and input data, which will be used as the step description in Qase.
188
187
 
189
188
  ### Example
190
189
 
@@ -199,6 +198,19 @@ test('test', async ({ page }) => {
199
198
  });
200
199
  ```
201
200
 
201
+ ### Example with Expected Result and Data
202
+
203
+ ```javascript
204
+ import { qase } from 'playwright-qase-reporter';
205
+
206
+ test('test', async ({ page }) => {
207
+ await test.step(qase.step('Click button', 'Button should be clicked', 'Button data'), async () => {
208
+ await page.click('button');
209
+ });
210
+ await page.goto('https://example.com');
211
+ });
212
+ ```
213
+
202
214
  ## Annotations
203
215
 
204
216
  Playwright Qase reporter supports test annotations for setting Qase IDs, titles, and suites.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "playwright-qase-reporter",
3
- "version": "2.1.6",
3
+ "version": "2.1.7",
4
4
  "description": "Qase TMS Playwright Reporter",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -44,17 +44,17 @@
44
44
  "license": "Apache-2.0",
45
45
  "dependencies": {
46
46
  "chalk": "^4.1.2",
47
- "qase-javascript-commons": "~2.4.2",
48
- "uuid": "^9.0.0"
47
+ "qase-javascript-commons": "~2.4.16",
48
+ "uuid": "^9.0.1"
49
49
  },
50
50
  "peerDependencies": {
51
51
  "@playwright/test": ">=1.16.3"
52
52
  },
53
53
  "devDependencies": {
54
- "@jest/globals": "^29.5.0",
55
- "@types/jest": "^29.5.2",
56
- "ajv": "^8.12.0",
57
- "jest": "^29.5.0",
58
- "ts-jest": "^29.1.0"
54
+ "@jest/globals": "^29.7.0",
55
+ "@types/jest": "^29.5.14",
56
+ "ajv": "^8.17.1",
57
+ "jest": "^29.7.0",
58
+ "ts-jest": "^29.4.5"
59
59
  }
60
60
  }
@@ -2,7 +2,9 @@
2
2
  "extends": "./tsconfig.json",
3
3
 
4
4
  "compilerOptions": {
5
- "noEmit": false
5
+ "noEmit": false,
6
+ "skipLibCheck": true,
7
+ "types": []
6
8
  },
7
9
 
8
10
  "include": ["./src/**/*.ts"]