qase-javascript-commons 2.3.0 → 2.3.2

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
@@ -31,31 +31,31 @@ Qase JS Reporters can be configured in multiple ways:
31
31
 
32
32
  All configuration options are listed in the table below:
33
33
 
34
- | Description | Config file | Environment variable | Default value | Required | Possible values |
35
- |----------------------------------------------------------------------------------------------------------------------------|----------------------------|---------------------------------|-----------------------------------------|----------|----------------------------|
36
- | **Common** | | | | | |
37
- | Mode of reporter | `mode` | `QASE_MODE` | `off` | No | `testops`, `report`, `off` |
38
- | Fallback mode of reporter | `fallback` | `QASE_FALLBACK` | `off` | No | `testops`, `report`, `off` |
39
- | Environment | `environment` | `QASE_ENVIRONMENT` | undefined | No | Any string |
40
- | Root suite | `rootSuite` | `QASE_ROOT_SUITE` | undefined | No | Any string |
41
- | Enable debug logs | `debug` | `QASE_DEBUG` | `False` | No | `True`, `False` |
42
- | Enable capture logs from `stdout` and `stderr` | `testops.defect` | `QASE_CAPTURE_LOGS` | `False` | No | `True`, `False` |
43
- | **Qase Report configuration** | | | | | |
44
- | Driver used for report mode | `report.driver` | `QASE_REPORT_DRIVER` | `local` | No | `local` |
45
- | Path to save the report | `report.connection.path` | `QASE_REPORT_CONNECTION_PATH` | `./build/qase-report` | | |
46
- | Local report format | `report.connection.format` | `QASE_REPORT_CONNECTION_FORMAT` | `json` | | `json`, `jsonp` |
47
- | **Qase TestOps configuration** | | | | | |
48
- | Token for [API access](https://developers.qase.io/#authentication) | `testops.api.token` | `QASE_TESTOPS_API_TOKEN` | undefined | Yes | Any string |
49
- | Qase API host. For enterprise users, specify full address: `api-example.qase.io` | `testops.api.host` | `QASE_TESTOPS_API_HOST` | `qase.io` | No | Any string |
50
- | Qase enterprise environment | `testops.api.enterprise` | `QASE_TESTOPS_API_ENTERPRISE` | `False` | No | `True`, `False` |
34
+ | Description | Config file | Environment variable | Default value | Required | Possible values |
35
+ |-----------------------------------------------------------------------------------------------------------------------|----------------------------|---------------------------------|-----------------------------------------|----------|----------------------------|
36
+ | **Common** | | | | | |
37
+ | Mode of reporter | `mode` | `QASE_MODE` | `off` | No | `testops`, `report`, `off` |
38
+ | Fallback mode of reporter | `fallback` | `QASE_FALLBACK` | `off` | No | `testops`, `report`, `off` |
39
+ | Environment | `environment` | `QASE_ENVIRONMENT` | undefined | No | Any string |
40
+ | Root suite | `rootSuite` | `QASE_ROOT_SUITE` | undefined | No | Any string |
41
+ | Enable debug logs | `debug` | `QASE_DEBUG` | `False` | No | `True`, `False` |
42
+ | Enable capture logs from `stdout` and `stderr` | `testops.defect` | `QASE_CAPTURE_LOGS` | `False` | No | `True`, `False` |
43
+ | **Qase Report configuration** | | | | | |
44
+ | Driver used for report mode | `report.driver` | `QASE_REPORT_DRIVER` | `local` | No | `local` |
45
+ | Path to save the report | `report.connection.path` | `QASE_REPORT_CONNECTION_PATH` | `./build/qase-report` | | |
46
+ | Local report format | `report.connection.format` | `QASE_REPORT_CONNECTION_FORMAT` | `json` | | `json`, `jsonp` |
47
+ | **Qase TestOps configuration** | | | | | |
48
+ | Token for [API access](https://developers.qase.io/#authentication) | `testops.api.token` | `QASE_TESTOPS_API_TOKEN` | undefined | Yes | Any string |
49
+ | Qase API host. For enterprise users, specify address: `example.qase.io` | `testops.api.host` | `QASE_TESTOPS_API_HOST` | `qase.io` | No | Any string |
50
+ | Qase enterprise environment | `testops.api.enterprise` | `QASE_TESTOPS_API_ENTERPRISE` | `False` | No | `True`, `False` |
51
51
  | Code of your project, which you can take from the URL: `https://app.qase.io/project/DEMOTR` - `DEMOTR` is the project code | `testops.project` | `QASE_TESTOPS_PROJECT` | undefined | Yes | Any string |
52
- | Qase test run ID | `testops.run.id` | `QASE_TESTOPS_RUN_ID` | undefined | No | Any integer |
53
- | Qase test run title | `testops.run.title` | `QASE_TESTOPS_RUN_TITLE` | `Automated run <Current date and time>` | No | Any string |
54
- | Qase test run description | `testops.run.description` | `QASE_TESTOPS_RUN_DESCRIPTION` | `<Framework name> automated run` | No | Any string |
55
- | Qase test run complete | `testops.run.complete` | `QASE_TESTOPS_RUN_COMPLETE` | `True` | | `True`, `False` |
56
- | Qase test plan ID | `testops.plan.id` | `QASE_TESTOPS_PLAN_ID` | undefined | No | Any integer |
57
- | Size of batch for sending test results | `testops.batch.size` | `QASE_TESTOPS_BATCH_SIZE` | `200` | No | Any integer |
58
- | Enable defects for failed test cases | `testops.defect` | `QASE_TESTOPS_DEFECT` | `False` | No | `True`, `False` |
52
+ | Qase test run ID | `testops.run.id` | `QASE_TESTOPS_RUN_ID` | undefined | No | Any integer |
53
+ | Qase test run title | `testops.run.title` | `QASE_TESTOPS_RUN_TITLE` | `Automated run <Current date and time>` | No | Any string |
54
+ | Qase test run description | `testops.run.description` | `QASE_TESTOPS_RUN_DESCRIPTION` | `<Framework name> automated run` | No | Any string |
55
+ | Qase test run complete | `testops.run.complete` | `QASE_TESTOPS_RUN_COMPLETE` | `True` | | `True`, `False` |
56
+ | Qase test plan ID | `testops.plan.id` | `QASE_TESTOPS_PLAN_ID` | undefined | No | Any integer |
57
+ | Size of batch for sending test results | `testops.batch.size` | `QASE_TESTOPS_BATCH_SIZE` | `200` | No | Any integer |
58
+ | Enable defects for failed test cases | `testops.defect` | `QASE_TESTOPS_DEFECT` | `False` | No | `True`, `False` |
59
59
 
60
60
  ### Example `qase.config.json` config:
61
61
 
package/changelog.md CHANGED
@@ -1,3 +1,9 @@
1
+ # qase-javascript-commons@2.3.2
2
+
3
+ ## What's new
4
+
5
+ Fixed an issue with attachments content type.
6
+
1
7
  # qase-javascript-commons@2.3.0
2
8
 
3
9
  ## What's new
@@ -58,10 +58,10 @@ class ClientV1 {
58
58
  if (this.config.run.id) {
59
59
  return this.config.run.id;
60
60
  }
61
- this.logger.logDebug('Creating test run');
62
61
  try {
63
62
  const environmentId = await this.getEnvironmentId();
64
63
  const runObject = this.prepareRunObject(environmentId);
64
+ this.logger.logDebug(`Creating test run: ${JSON.stringify(runObject)}`);
65
65
  const { data } = await this.runClient.createRun(this.config.project, runObject);
66
66
  if (!data.result?.id) {
67
67
  throw new qase_error_1.QaseError('Failed to create test run');
@@ -119,7 +119,7 @@ class ClientV1 {
119
119
  return {
120
120
  name: attachment.file_name,
121
121
  value: typeof attachment.content === 'string'
122
- ? Buffer.from(attachment.content)
122
+ ? Buffer.from(attachment.content, attachment.content.match(/^[A-Za-z0-9+/=]+$/) ? 'base64' : undefined)
123
123
  : attachment.content,
124
124
  };
125
125
  }
@@ -135,7 +135,7 @@ class ClientV1 {
135
135
  description: this.config.run.description ?? '',
136
136
  is_autotest: true,
137
137
  cases: [],
138
- start_time: (0, dateUtils_1.formatUTCDate)(new Date()),
138
+ start_time: (0, dateUtils_1.getStartTime)(),
139
139
  };
140
140
  if (environmentId !== undefined) {
141
141
  runObject.environment_id = environmentId;
@@ -15,7 +15,6 @@ function formatUTCDate(date) {
15
15
  exports.formatUTCDate = formatUTCDate;
16
16
  function getStartTime() {
17
17
  const date = new Date();
18
- date.setSeconds(-10);
19
- return formatUTCDate(date);
18
+ return formatUTCDate(new Date(date.getTime() - 10000));
20
19
  }
21
20
  exports.getStartTime = getStartTime;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "qase-javascript-commons",
3
- "version": "2.3.0",
3
+ "version": "2.3.2",
4
4
  "description": "Qase JS Reporters",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -32,8 +32,8 @@
32
32
  "lodash.merge": "^4.6.2",
33
33
  "lodash.mergewith": "^4.6.2",
34
34
  "mime-types": "^2.1.33",
35
- "qase-api-client": "~1.0.0",
36
- "qase-api-v2-client": "~1.0.0",
35
+ "qase-api-client": "~1.0.1",
36
+ "qase-api-v2-client": "~1.0.1",
37
37
  "strip-ansi": "^6.0.1",
38
38
  "uuid": "^9.0.0",
39
39
  "async-mutex": "~0.5.0"