cypress-qase-reporter 1.4.3 → 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
@@ -13,7 +13,7 @@ npm install cypress-qase-reporter
13
13
  If you want to decorate come test with Qase Case ID you could use qase function:
14
14
 
15
15
  ```typescript
16
- import { qase } from 'cypress-qase-reporter/dist/mocha';
16
+ import { qase } from 'cypress-qase-reporter';
17
17
 
18
18
  describe('My First Test', () => {
19
19
  qase([1,2],
@@ -40,8 +40,12 @@ describe('My First Test', () => {
40
40
 
41
41
  ```
42
42
  If you are going to use several specifications for execution and you have in config
43
- ```bash
44
- "runComplete": true
43
+ ```json
44
+ "testops": {
45
+ "run": {
46
+ "complete": true
47
+ }
48
+ }
45
49
  ```
46
50
  then it is necessary to additionally set in the project settings
47
51
  ```
@@ -50,14 +54,14 @@ Allow to add results for cases in closed runs.
50
54
 
51
55
  To run tests and create a test run, execute the command (for example from folder examples):
52
56
  ```bash
53
- QASE_REPORT=1 npx cypress run
57
+ QASE_MODE=testops npx cypress run
54
58
  ```
55
59
  or
56
60
  ```bash
57
61
  npm test
58
62
  ```
59
63
  <p align="center">
60
- <img width="65%" src="examples_cypress_v10/screenshots/screenshot.png">
64
+ <img width="65%" src="./screenshots/screenshot.png">
61
65
  </p>
62
66
 
63
67
  A test run will be performed and available at:
@@ -70,40 +74,40 @@ https://app.qase.io/run/QASE_PROJECT_CODE
70
74
 
71
75
  Reporter options (* - required):
72
76
 
73
- - *`apiToken` - Token for API access, you can find more information
77
+ - `mode` - `testops`/`off` Enables reporter, default - `off`
78
+ - `debug` - Enables debug logging, defaule - `false`
79
+ - `environment` - To execute with the sending of the envinroment information
80
+ - *`testops.api.token` - Token for API access, you can find more information
74
81
  [here](https://developers.qase.io/#authentication)
75
- - *`projectCode` - Code of your project (can be extracted from main
76
- page of your project: `https://app.qase.io/project/DEMOTR` -
82
+ - *`testops.project` - Code of your project (can be extracted from main
83
+ page of your project: `https://app.qase.io/project/DEMOTR` -
77
84
  `DEMOTR` is project code here)
78
- - `runId` - Run ID from Qase TMS (also can be got from run URL)
79
- - `logging` [true/false] - Enabled debug logging from reporter or not
80
- - `environmentId` - To execute with the sending of the envinroment information
81
- - `basePath` - URL Qase.io
82
- - `screenshotFolder` - Folder for save screenshot cypress,
83
- - `sendScreenshot` [true/false] - Permission to send screenshots to Qase TMS
84
- - `runComplete` [true/false] - Permission for automatic completion of the test run
85
+ - `testops.uploadAttachments` - Permission to send screenshots to Qase TMS
86
+ - `testops.run.id` - Pass Run ID
87
+ - `testops.run.title` - Set custom Run name, when new run is created
88
+ - `testops.run.description` - Set custom Run description, when new run is created
89
+ - `testops.run.complete` - Whether the run should be completed
90
+ - `framework.cypress.screenshotFolder` - Folder for save screenshot cypress
85
91
 
86
- #### You can check example configuration with multiple reporters in [demo project (cypress v10)](examples_cypress_v10/cypress.config.js) and [demo project (cypress v6)](examples_cypress_v6/cypress.json).
92
+ #### You can check example configuration with multiple reporters in [demo project](../examples/cypress/cypress.config.js).
87
93
 
88
94
  Supported ENV variables:
89
95
 
90
- - `QASE_REPORT` - You **should** pass this ENV if you want to use
91
- qase reporter
92
- - `QASE_RUN_ID` - Pass Run ID from ENV and override reporter options
93
- - `QASE_RUN_NAME` - Set custom Run name, when new run is created
94
- - `QASE_RUN_DESCRIPTION` - Set custom Run description, when new run is created
95
- - `QASE_API_TOKEN` - Token for API access, you can find more information
96
- [here](https://developers.qase.io/#authentication)
97
- - `QASE_API_BASE_URL` - URL Qase.io, default value `https://api.qase.io/v1`
98
- - `QASE_ENVIRONMENT_ID` - To execute with the sending of the envinroment information
99
- - `QASE_SCREENSHOT_FOLDER` - Folder for save screenshot cypress
100
- - `QASE_SCREENSHOT_SENDING` - Permission to send screenshots to Qase TMS
101
- - `QASE_RUN_COMPLETE` - Permission for automatic completion of the test run
96
+ - `QASE_MODE` - Same as `mode`
97
+ - `QASE_DEBUG` - Same as `debug`
98
+ - `QASE_ENVIRONMENT` - Same as `environment`
99
+ - `QASE_TESTOPS_API_TOKEN` - Same as `testops.api.token`
100
+ - `QASE_TESTOPS_PROJECT` - Same as `testops.project`
101
+ - `QASE_TESTOPS_RUN_ID` - Pass Run ID from ENV and override reporter option `testops.run.id`
102
+ - `QASE_TESTOPS_RUN_TITLE` - Same as `testops.run.title`
103
+ - `QASE_TESTOPS_RUN_DESCRIPTION` - Same as `testops.run.description`
102
104
 
103
105
  ## Requirements
104
106
 
105
107
  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/)
106
108
 
109
+ `cypress >= 8.0.0`
110
+
107
111
  <!-- references -->
108
112
 
109
113
  [auth]: https://developers.qase.io/#authentication
package/package.json CHANGED
@@ -1,58 +1,61 @@
1
1
  {
2
2
  "name": "cypress-qase-reporter",
3
- "version": "v1.4.3",
4
- "description": "Qase TMS Cypress Reporter",
5
- "main": "./dist/index.js",
6
- "types": "./dist/index.d.ts",
7
- "homepage": "https://github.com/qase-tms/qase-cypress",
3
+ "version": "2.0.0-beta.0",
4
+ "description": "Qase Cypress Reporter",
5
+ "homepage": "https://github.com/qase-tms/qase-javascript",
6
+ "sideEffects": false,
7
+ "main": "./dist/index.cjs.js",
8
+ "types": "./dist/index.cjs.d.ts",
9
+ "exports": {
10
+ ".": "./dist/index.js",
11
+ "./mocha": "./dist/mocha.js",
12
+ "./reporter": "./dist/reporter.js",
13
+ "./package.json": "./package.json"
14
+ },
15
+ "typesVersions": {
16
+ "*": {
17
+ ".": [
18
+ "./dist/index.d.ts"
19
+ ],
20
+ "mocha": [
21
+ "./dist/mocha.d.ts"
22
+ ],
23
+ "reporter": [
24
+ "./dist/reporter.d.ts"
25
+ ]
26
+ }
27
+ },
8
28
  "bugs": {
9
- "url": "https://github.com/qase-tms/qase-cypress/issues"
29
+ "url": "https://github.com/qase-tms/qase-javascript/issues"
10
30
  },
11
31
  "repository": {
12
32
  "type": "git",
13
- "url": "https://github.com/qase-tms/qase-cypress.git"
33
+ "url": "git+https://github.com/qase-tms/qase-javascript.git"
14
34
  },
15
35
  "engines": {
16
- "node": ">=10"
36
+ "node": ">=14"
17
37
  },
18
38
  "scripts": {
19
- "dev": "npm run lint && tsc && cp ./src/reportBulk.js ./dist",
20
- "dev:watch": "nodemon --exec 'npm run dev || exit 1'",
21
- "lint": "eslint --fix src/**",
22
- "build": "npm run clean && npm run dev",
23
- "test": "jest --coverage",
24
- "clean": "rm -rf dist || true"
25
- },
26
- "author": {
27
- "name": "Parviz Khavari",
28
- "email": "csctclan@gmail.com"
39
+ "build": "npm run clean && tsc --project tsconfig.build.json",
40
+ "lint": "eslint .",
41
+ "test": "jest --passWithNoTests",
42
+ "clean": "rm -rf dist"
29
43
  },
44
+ "author": "Nikita Fedorov <nik333r@gmail.com>",
30
45
  "license": "Apache-2.0",
31
46
  "dependencies": {
32
- "form-data": "^4.0.0",
33
- "qaseio": "^2.0.2"
47
+ "qase-javascript-commons": "^2.0.0-beta.0"
48
+ },
49
+ "peerDependencies": {
50
+ "cypress": ">=8.0.0"
34
51
  },
35
52
  "devDependencies": {
36
- "@hutson/npm-deploy-git-tag": "^6.0.0",
37
- "@types/chalk": "^2.2.0",
38
- "@types/jest": "^23.3.7",
39
- "@types/mocha": "^7.0.2",
40
- "@typescript-eslint/eslint-plugin": "^3.10.1",
41
- "@typescript-eslint/eslint-plugin-tslint": "^3.10.1",
42
- "@typescript-eslint/parser": "^3.10.1",
43
- "ansi-regex": "^6.0.1",
44
- "axios-mock-adapter": "^1.19.0",
45
- "chalk": "^4.1.0",
46
- "cypress": "^4.12.1",
47
- "eslint": "^7.14.0",
48
- "eslint-plugin-jsdoc": "^26.0.1",
49
- "eslint-plugin-prefer-arrow": "^1.2.2",
50
- "handlebars": "^4.7.7",
51
- "jest": "^26.6.3",
52
- "json-schema": "^0.4.0",
53
- "mocha": "^9.0.0",
54
- "nodemon": "^2.0.6",
55
- "ts-jest": "^26.4.4",
56
- "typescript": "^3.9.7"
53
+ "@jest/globals": "^29.5.0",
54
+ "@types/jest": "^29.5.2",
55
+ "@types/mocha": "^10.0.1",
56
+ "ajv": "^8.12.0",
57
+ "jest": "^29.5.0",
58
+ "mocha": "^10.2.0",
59
+ "ts-jest": "^29.1.0"
57
60
  }
58
61
  }
@@ -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,28 +0,0 @@
1
- import { MochaOptions, Runner, reporters } from 'mocha';
2
- declare class CypressQaseReporter extends reporters.Base {
3
- testCasesForPublishingCount: number;
4
- private api;
5
- private pending;
6
- private shouldPublish;
7
- private results;
8
- private options;
9
- private runId?;
10
- private isDisabled;
11
- private resultsForPublishing;
12
- constructor(runner: Runner, options: MochaOptions);
13
- private static getEnv;
14
- private static getCaseId;
15
- private static createRunObject;
16
- private static createHeaders;
17
- private static getSuitePath;
18
- private static getPackageVersion;
19
- private log;
20
- private addRunnerListeners;
21
- private checkProject;
22
- private createRun;
23
- private checkRun;
24
- private saveRunId;
25
- private logTestItem;
26
- private transformCaseResultToBulkObject;
27
- }
28
- export = CypressQaseReporter;