cucumberjs-qase-reporter 0.2.9 → 2.0.0-beta.0

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
@@ -37,16 +37,16 @@ Feature: Cucumber documentation
37
37
  And I should see a "Dependencies" badge
38
38
  ```
39
39
  ---
40
- To run tests and create a test run, execute the command (for example from folder examples):
40
+ To run tests and create a test run, execute the command (for example from folder examples/cucumberjs):
41
41
  ```bash
42
- cucumber-js -f cucumberjs-qase-reporter --format-options='{\"qaseConfig\": \"./.qaserc\"}' features -r examples/zombie/support -r examples/zombie/steps
42
+ QASE_MODE=testops cucumber-js -f cucumberjs-qase-reporter:/dev/null features -r zombie/support -r zombie/steps --publish-quiet
43
43
  ```
44
44
  or
45
45
  ```bash
46
46
  npm test
47
47
  ```
48
48
  <p align="center">
49
- <img width="65%" src="./examples/screenshots/screenshot.png">
49
+ <img width="65%" src="./screenshots/screenshot.png">
50
50
  </p>
51
51
 
52
52
  A test run will be performed and available at:
@@ -56,56 +56,53 @@ https://app.qase.io/run/QASE_PROJECT_CODE
56
56
  ```
57
57
 
58
58
  <p align="center">
59
- <img src="./examples/screenshots/demo.gif">
59
+ <img src="./screenshots/demo.gif">
60
60
  </p>
61
61
 
62
62
  ## Configuration
63
63
 
64
64
  Qase reporter supports passing parameters using two ways:
65
- using `.qaserc` file and using ENV variables.
65
+ using `.qaserc`/`qase.config.json` file and using ENV variables.
66
66
 
67
- `.qaserc` parameters:
68
- - `enabled` - Enable reporter
69
- - `basePath` - URL Qase.io
70
- - `environmentId` - To execute with the sending of the envinroment information
71
- - `apiToken` - Token for API access, you can find more information
67
+ `.qaserc` parameters, (* - required):
68
+ - `mode` - `testops`/`off` Enables reporter, default - `off`
69
+ - `debug` - Enables debug logging, defaule - `false`
70
+ - `environment` - To execute with the sending of the envinroment information
71
+ - *`testops.api.token` - Token for API access, you can find more information
72
72
  [here](https://developers.qase.io/#authentication)
73
- - `projectCode` - Code of your project (can be extracted from main
73
+ - *`testops.project` - Code of your project (can be extracted from main
74
74
  page of your project: `https://app.qase.io/project/DEMOTR` -
75
75
  `DEMOTR` is project code here)
76
- - `runId` - Pass Run ID
77
- - `runName` - Set custom Run name, when new run is created.
78
- Supported parameters:
79
- - `%DATE%`
80
- - `runDescription` - Set custom Run description, when new run is created
81
- - `logging` - Enabled debug logging from reporter or not
82
- - `rootSuiteTitle` - A parent suite for your autocreated tests
76
+ - `testops.run.id` - Pass Run ID
77
+ - `testops.run.title` - Set custom Run name, when new run is created
78
+ - `testops.run.description` - Set custom Run description, when new run is created
79
+ - `testops.run.complete` - Whether the run should be completed
83
80
 
84
81
  Example configuration file:
82
+
85
83
  ```json
86
84
  {
87
- "enabled": true,
88
- "logging": true,
89
- "apiToken": "api_key",
90
- "projectCode": "project_code",
91
- "runName": "CucumberJS run %DATE%",
92
- "environmentId": 1,
93
- "basePath": "https://api.qase.io/v1"
85
+ "debug": true,
86
+ "environment": 1,
87
+ "testops": {
88
+ "api": {
89
+ "token": "api_key"
90
+ },
91
+ "project": "project_code"
92
+ }
94
93
  }
95
94
  ```
96
95
 
97
96
  Supported ENV variables:
98
97
 
99
- - `QASE_ENABLED` - Same as `enabled`
100
- - `QASE_API_BASE_URL` - Same as `basePath`
101
- - `QASE_API_TOKEN` - Same as `apiToken`
102
- - `QASE_PROJECT` - Same as `projectCode`
103
- - `QASE_RUN_ID` - Pass Run ID from ENV and override reporter options
104
- - `QASE_RUN_NAME` - Same as `runName`
105
- - `QASE_RUN_DESCRIPTION` - Same as `runDescription`
106
- - `QASE_ENVIRONMENT_ID` - Same as `environmentId`
107
- - `QASE_LOGGING` - Same as `logging`
108
- - `QASE_ROOT_SUITE_TITLE` - Same as `rootSuiteTitle`
98
+ - `QASE_MODE` - Same as `mode`
99
+ - `QASE_DEBUG` - Same as `debug`
100
+ - `QASE_ENVIRONMENT` - Same as `environment`
101
+ - `QASE_TESTOPS_API_TOKEN` - Same as `testops.api.token`
102
+ - `QASE_TESTOPS_PROJECT` - Same as `testops.project`
103
+ - `QASE_TESTOPS_RUN_ID` - Pass Run ID from ENV and override reporter option `testops.run.id`
104
+ - `QASE_TESTOPS_RUN_TITLE` - Same as `testops.run.title`
105
+ - `QASE_TESTOPS_RUN_DESCRIPTION` - Same as `testops.run.description`
109
106
 
110
107
  To run using ENV you have to execute:
111
108
  ```bash
@@ -136,11 +133,13 @@ exports.config = {
136
133
  }
137
134
  ```
138
135
 
139
- **Do not forget to add .qaserc file!**
136
+ **Do not forget to add `.qaserc`/`qase.config.json` file!**
140
137
 
141
138
  ## Requirements
142
139
 
143
140
  We maintain the reporter on LTS versions of Node. You can find the current versions by following the [link](https://nodejs.org/en/about/releases/)
144
141
  <!-- references -->
145
142
 
143
+ `@cucumber/cucumber >= 7.0.0`
144
+
146
145
  [auth]: https://developers.qase.io/#authentication
package/package.json CHANGED
@@ -1,63 +1,54 @@
1
1
  {
2
2
  "name": "cucumberjs-qase-reporter",
3
- "version": "v0.2.9",
3
+ "version": "2.0.0-beta.0",
4
4
  "description": "Qase TMS CucumberJS Reporter",
5
+ "homepage": "https://github.com/qase-tms/qase-javascript",
5
6
  "main": "./dist/index.js",
6
7
  "types": "./dist/index.d.ts",
7
- "homepage": "",
8
+ "exports": {
9
+ ".": "./dist/index.js",
10
+ "./reporter": "./dist/reporter.js",
11
+ "./package.json": "./package.json"
12
+ },
13
+ "typesVersions": {
14
+ "*": {
15
+ ".": [
16
+ "./dist/index.d.ts"
17
+ ],
18
+ "reporter": [
19
+ "./dist/reporter.d.ts"
20
+ ]
21
+ }
22
+ },
8
23
  "bugs": {
9
- "url": "https://github.com/qase-tms/qase-javascript/"
24
+ "url": "https://github.com/qase-tms/qase-javascript/issues"
10
25
  },
11
26
  "repository": {
12
27
  "type": "git",
13
- "url": ""
28
+ "url": "git+https://github.com/qase-tms/qase-javascript.git"
14
29
  },
15
30
  "engines": {
16
- "node": ">=10"
31
+ "node": ">=14"
17
32
  },
18
33
  "scripts": {
19
- "dev": "npm run lint && tsc",
20
- "dev:watch": "nodemon --exec 'npm run dev || exit 1'",
21
- "lint": "eslint src/**",
22
- "lint:fix": "eslint --fix src/**",
23
- "build": "npm run clean && npm run dev",
24
- "test": "jest --coverage",
25
- "clean": "rm -rf dist || true",
26
- "example": "npm run build && cd examples && npm run test-zombie"
27
- },
28
- "author": {
29
- "name": "Parviz Khavari",
30
- "email": "havaripa@gmail.com"
34
+ "build": "npm run clean && tsc --project tsconfig.build.json",
35
+ "lint": "eslint .",
36
+ "test": "jest --passWithNoTests",
37
+ "clean": "rm -rf dist"
31
38
  },
39
+ "author": "Parviz Khavari <havaripa@gmail.com>",
32
40
  "license": "Apache-2.0",
33
- "devDependencies": {
34
- "@cucumber/cucumber": "^7.0.0",
35
- "@cucumber/messages": "^14.0.1",
36
- "@hutson/npm-deploy-git-tag": "^6.0.0",
37
- "@types/jest": "^23.3.7",
38
- "@types/long": "^4.0.1",
39
- "@typescript-eslint/eslint-plugin": "^3.10.1",
40
- "@typescript-eslint/eslint-plugin-tslint": "^3.10.1",
41
- "@typescript-eslint/parser": "^3.10.1",
42
- "ansi-regex": "^6.0.1",
43
- "axios-mock-adapter": "^1.19.0",
44
- "eslint": "^7.17.0",
45
- "eslint-plugin-jsdoc": "^26.0.1",
46
- "eslint-plugin-prefer-arrow": "^1.2.1",
47
- "handlebars": "^4.7.7",
48
- "jest": "^26.6.3",
49
- "json-schema": "^0.4.0",
50
- "long": "^4.0.0",
51
- "nodemon": "^2.0.7",
52
- "ts-jest": "^26.4.4",
53
- "typescript": "^3.9.3"
54
- },
55
41
  "dependencies": {
56
- "chalk": "^4.1.0",
57
- "file-type": "^17.1.1",
58
- "mime-types": "^2.1.35",
59
- "moment": "^2.29.1",
60
- "qaseio": "^2.0.2",
61
- "read-chunk": "^4.0.2"
42
+ "@cucumber/messages": "^22.0.0",
43
+ "qase-javascript-commons": "^2.0.0-beta.0"
44
+ },
45
+ "peerDependencies": {
46
+ "@cucumber/cucumber": ">=7.0.0"
47
+ },
48
+ "devDependencies": {
49
+ "@jest/globals": "^29.5.0",
50
+ "@types/jest": "^29.5.2",
51
+ "jest": "^29.5.0",
52
+ "ts-jest": "^29.1.0"
62
53
  }
63
54
  }
@@ -0,0 +1,9 @@
1
+ {
2
+ "extends": "./tsconfig.json",
3
+
4
+ "compilerOptions": {
5
+ "noEmit": false
6
+ },
7
+
8
+ "include": ["./src/**/*.ts"]
9
+ }
package/dist/index.d.ts DELETED
@@ -1,36 +0,0 @@
1
- import { Formatter } from '@cucumber/cucumber';
2
- import { IFormatterOptions } from '@cucumber/cucumber/lib/formatter';
3
- declare class QaseReporter extends Formatter {
4
- private readonly config;
5
- private api;
6
- private enabled;
7
- private pickleInfo;
8
- private testCaseStarts;
9
- private testCaseStartedResult;
10
- private testCaseStartedAttachment;
11
- private testCaseStartedErrors;
12
- private testCaseScenarioId;
13
- private pending;
14
- private results;
15
- private scenarios;
16
- private uploadsInQueueCount;
17
- constructor(options: IFormatterOptions);
18
- private waitUploads;
19
- private upload;
20
- private publishResults;
21
- private addErrorMessage;
22
- private _log;
23
- private checkProject;
24
- private createRun;
25
- private createRunObject;
26
- private checkRun;
27
- private saveRunId;
28
- private logTestItem;
29
- private addForSending;
30
- private addKnownCasesForSending;
31
- private addNewCasesForSending;
32
- private extractIds;
33
- private createHeaders;
34
- private getPackageVersion;
35
- }
36
- export = QaseReporter;