cucumberjs-qase-reporter 0.2.8-alpha.1 → 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
@@ -36,34 +36,17 @@ Feature: Cucumber documentation
36
36
  Then I should see a "Build Status" badge
37
37
  And I should see a "Dependencies" badge
38
38
  ```
39
-
40
- You should also have an active item in the project settings at
41
-
42
- ```
43
- https://app.qase.io/project/QASE_PROJECT_CODE/settings/options
44
- ```
45
-
46
- options in the `Test Runs` block:
47
-
48
- ```
49
- Auto create test cases
50
- ```
51
- and
52
-
53
- ```
54
- Allow submitting results in bulk
55
- ```
56
39
  ---
57
- 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):
58
41
  ```bash
59
- 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
60
43
  ```
61
44
  or
62
45
  ```bash
63
46
  npm test
64
47
  ```
65
48
  <p align="center">
66
- <img width="65%" src="./examples/screenshots/screenshot.png">
49
+ <img width="65%" src="./screenshots/screenshot.png">
67
50
  </p>
68
51
 
69
52
  A test run will be performed and available at:
@@ -73,56 +56,53 @@ https://app.qase.io/run/QASE_PROJECT_CODE
73
56
  ```
74
57
 
75
58
  <p align="center">
76
- <img src="./examples/screenshots/demo.gif">
59
+ <img src="./screenshots/demo.gif">
77
60
  </p>
78
61
 
79
62
  ## Configuration
80
63
 
81
64
  Qase reporter supports passing parameters using two ways:
82
- using `.qaserc` file and using ENV variables.
65
+ using `.qaserc`/`qase.config.json` file and using ENV variables.
83
66
 
84
- `.qaserc` parameters:
85
- - `enabled` - Enable reporter
86
- - `basePath` - URL Qase.io
87
- - `environmentId` - To execute with the sending of the envinroment information
88
- - `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
89
72
  [here](https://developers.qase.io/#authentication)
90
- - `projectCode` - Code of your project (can be extracted from main
73
+ - *`testops.project` - Code of your project (can be extracted from main
91
74
  page of your project: `https://app.qase.io/project/DEMOTR` -
92
75
  `DEMOTR` is project code here)
93
- - `runId` - Pass Run ID
94
- - `runName` - Set custom Run name, when new run is created.
95
- Supported parameters:
96
- - `%DATE%`
97
- - `runDescription` - Set custom Run description, when new run is created
98
- - `logging` - Enabled debug logging from reporter or not
99
- - `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
100
80
 
101
81
  Example configuration file:
82
+
102
83
  ```json
103
84
  {
104
- "enabled": true,
105
- "logging": true,
106
- "apiToken": "api_key",
107
- "projectCode": "project_code",
108
- "runName": "CucumberJS run %DATE%",
109
- "environmentId": 1,
110
- "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
+ }
111
93
  }
112
94
  ```
113
95
 
114
96
  Supported ENV variables:
115
97
 
116
- - `QASE_ENABLED` - Same as `enabled`
117
- - `QASE_API_BASE_URL` - Same as `basePath`
118
- - `QASE_API_TOKEN` - Same as `apiToken`
119
- - `QASE_PROJECT` - Same as `projectCode`
120
- - `QASE_RUN_ID` - Pass Run ID from ENV and override reporter options
121
- - `QASE_RUN_NAME` - Same as `runName`
122
- - `QASE_RUN_DESCRIPTION` - Same as `runDescription`
123
- - `QASE_ENVIRONMENT_ID` - Same as `environmentId`
124
- - `QASE_LOGGING` - Same as `logging`
125
- - `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`
126
106
 
127
107
  To run using ENV you have to execute:
128
108
  ```bash
@@ -153,8 +133,13 @@ exports.config = {
153
133
  }
154
134
  ```
155
135
 
156
- **Do not forget to add .qaserc file!**
136
+ **Do not forget to add `.qaserc`/`qase.config.json` file!**
137
+
138
+ ## Requirements
157
139
 
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/)
158
141
  <!-- references -->
159
142
 
143
+ `@cucumber/cucumber >= 7.0.0`
144
+
160
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.8-alpha.1",
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.1",
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;