Skip to content

Commit

Permalink
qase-javascript-commons: support enterprise environment
Browse files Browse the repository at this point in the history
Rename `baseUrl` to `host` in config
  • Loading branch information
gibiw committed Jun 10, 2024
1 parent cbd1154 commit 6bce558
Show file tree
Hide file tree
Showing 8 changed files with 29 additions and 6 deletions.
1 change: 1 addition & 0 deletions qase-javascript-commons/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ All configuration options are listed in the table below:
| **Qase TestOps configuration** | | | | | |
| Token for [API access](https://developers.qase.io/#authentication) | `testops.api.token` | `QASE_TESTOPS_API_TOKEN` | | Yes | Any string |
| Qase API host | `testops.api.host` | `QASE_TESTOPS_API_HOST` | `qase.io` | No | Any string |
| Qase enterprise environment | `testops.api.enterprise` | `QASE_TESTOPS_API_ENTERPRISE` | `False` | No | `True`, `False` |
| 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` | | Yes | Any string |
| Qase test run ID | `testops.run.id` | `QASE_TESTOPS_RUN_ID` | | No | Any integer |
| Qase test run title | `testops.run.title` | `QASE_TESTOPS_RUN_TITLE` | `Automated run <Current date and time>` | No | Any string |
Expand Down
22 changes: 22 additions & 0 deletions qase-javascript-commons/changelog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,25 @@
# [email protected]

## What's new

Added new configuration options `enterprise` for the Qase TestOps reporter in the `qase.config.json` file and environment variables.
Support enterprise API URL. Now the reporters will upload test results to your own Qase instance.

```diff
{
...
"testops": {
"api": {
"token": "token",
"host": "qase.io",
+ "enterprise": true
}
...
},
...
}
```

# [email protected]

## What's new
Expand Down
2 changes: 1 addition & 1 deletion qase-javascript-commons/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "qase-javascript-commons",
"version": "2.0.8",
"version": "2.0.9",
"description": "Qase JS Reporters",
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export const configValidationSchema: JSONSchemaType<ConfigType> = {
nullable: true,
},

baseUrl: {
host: {
type: 'string',
nullable: true,
},
Expand Down
2 changes: 1 addition & 1 deletion qase-javascript-commons/src/env/env-enum.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export enum EnvTestOpsEnum {
*/
export enum EnvApiEnum {
token = 'QASE_TESTOPS_API_TOKEN',
baseUrl = 'QASE_TESTOPS_API_HOST',
host = 'QASE_TESTOPS_API_HOST',
}

/**
Expand Down
2 changes: 1 addition & 1 deletion qase-javascript-commons/src/env/env-to-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export const envToConfig = (env: EnvType): ConfigType => ({

api: {
token: env[EnvApiEnum.token],
baseUrl: env[EnvApiEnum.baseUrl],
host: env[EnvApiEnum.host],
},

run: {
Expand Down
2 changes: 1 addition & 1 deletion qase-javascript-commons/src/env/env-type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export type EnvType = {
[EnvTestOpsEnum.useV2]?: boolean;

[EnvApiEnum.token]?: string;
[EnvApiEnum.baseUrl]?: string;
[EnvApiEnum.host]?: string;

[EnvRunEnum.id]?: number;
[EnvRunEnum.title]?: string;
Expand Down
2 changes: 1 addition & 1 deletion qase-javascript-commons/src/env/env-validation-schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ export const envValidationSchema: JSONSchemaType<EnvType> = {
type: 'string',
nullable: true,
},
[EnvApiEnum.baseUrl]: {
[EnvApiEnum.host]: {
type: 'string',
nullable: true,
},
Expand Down

0 comments on commit 6bce558

Please sign in to comment.