Qase JS Reporters
npm install qase-javascript-commonsThis module is an SDK for developing test reporters for Qase TMS.
It's using qaseio as an API client, and all Qase reporters are, in turn,
using this package.
You should use it if you're developing your own test reporter for a special-purpose framework.
To report results from tests using a popular framework or test runner,
don't install this module directly and
use the corresponding reporter module instead:
* CucumberJS
* Cypress
* Jest
* Newman
* Playwright
* TestCafe
``bash`
npm install qase-javascript-commons
Qase JS Reporters can be configured in multiple ways:
* using a config file qase.config.json
* using environment variables
All configuration options are listed in the table below:
| Description | Config file | Environment variable | Default value | Required | Possible values |
|-----------------------------------------------------------------------------------------------------------------------|----------------------------|---------------------------------|-----------------------------------------|----------|----------------------------|
| Common | | | | | |
| Mode of reporter | mode | QASE_MODE | off | No | testops, testops_multi, report, off |fallback
| Fallback mode of reporter | | QASE_FALLBACK | off | No | testops, testops_multi, report, off |environment
| Environment | | QASE_ENVIRONMENT | undefined | No | Any string |rootSuite
| Root suite | | QASE_ROOT_SUITE | undefined | No | Any string |debug
| Enable debug logs | | QASE_DEBUG | False | No | True, False |stdout
| Enable capture logs from and stderr | testops.defect | QASE_CAPTURE_LOGS | False | No | True, False |fromStatus=toStatus
| Map test result statuses to different values (format: ) | statusMapping | QASE_STATUS_MAPPING | undefined | No | Object mapping statuses (e.g., {"invalid": "failed", "skipped": "passed"}) |logging.console
| Logging configuration | | | | | |
| Enable/disable console output for reporter logs | | QASE_LOGGING_CONSOLE | True | No | True, False |logging.file
| Enable/disable file output for reporter logs | | QASE_LOGGING_FILE | Same as debug setting | No | True, False |report.driver
| Qase Report configuration | | | | | |
| Driver used for report mode | | QASE_REPORT_DRIVER | local | No | local |report.connection.path
| Path to save the report | | QASE_REPORT_CONNECTION_PATH | ./build/qase-report | | |report.connection.format
| Local report format | | QASE_REPORT_CONNECTION_FORMAT | json | | json, jsonp |testops.api.token
| Qase TestOps configuration | | | | | |
| Token for API access | | QASE_TESTOPS_API_TOKEN | undefined | Yes | Any string |example.qase.io
| Qase API host. For enterprise users, specify address: | testops.api.host | QASE_TESTOPS_API_HOST | qase.io | No | Any string |testops.api.enterprise
| Qase enterprise environment | | QASE_TESTOPS_API_ENTERPRISE | False | No | True, False |https://app.qase.io/project/DEMOTR
| Code of your project, which you can take from the URL: - DEMOTR is the project code | testops.project | QASE_TESTOPS_PROJECT | undefined | Yes | Any string |testops.run.id
| Qase test run ID | | QASE_TESTOPS_RUN_ID | undefined | No | Any integer |testops.run.title
| Qase test run title | | QASE_TESTOPS_RUN_TITLE | Automated run | No | Any string |testops.run.description
| Qase test run description | | QASE_TESTOPS_RUN_DESCRIPTION | | No | Any string |testops.run.complete
| Qase test run complete | | QASE_TESTOPS_RUN_COMPLETE | True | | True, False |testops.run.tags
| Array of tags to be added to the test run | | QASE_TESTOPS_RUN_TAGS | [] | No | Array of strings |testops.run.externalLink
| External link to associate with test run (e.g., Jira ticket) | | QASE_TESTOPS_RUN_EXTERNAL_LINK | undefined | No | JSON object with type (jiraCloud or jiraServer) and link (e.g., PROJ-123) |testops.plan.id
| Qase test plan ID | | QASE_TESTOPS_PLAN_ID | undefined | No | Any integer |testops.batch.size
| Size of batch for sending test results | | QASE_TESTOPS_BATCH_SIZE | 200 | No | Any integer |testops.defect
| Enable defects for failed test cases | | QASE_TESTOPS_DEFECT | False | No | True, False |testops.uploadAttachments
| Enable/disable attachment uploads | | QASE_TESTOPS_UPLOAD_ATTACHMENTS | true | No | True, False |testops.statusFilter
| Filter test results by status (comma-separated list of statuses to exclude from reporting) | | QASE_TESTOPS_STATUS_FILTER | undefined | No | Array of strings (passed, failed, skipped, invalid) |group1=value1,group2=value2
| Configuration values to create/find in groups (format: ) | testops.configurations.values | QASE_TESTOPS_CONFIGURATIONS_VALUES | undefined | No | Comma-separated key=value pairs |testops.configurations.createIfNotExists
| Create configuration groups if they don't exist | | QASE_TESTOPS_CONFIGURATIONS_CREATE_IF_NOT_EXISTS | false | No | True, False |testops.showPublicReportLink
| Enable public report link generation and display after test run completion | | QASE_TESTOPS_SHOW_PUBLIC_REPORT_LINK | False | No | True, False |testops_multi.default_project
| Qase TestOps Multi-Project configuration | | | | | |
| Default project code for tests without explicit project mapping | | N/A (use config file) | First project in projects | No | Any string (must match one of projects[].code) |testops_multi.projects
| Array of project configurations | | N/A (use config file) | [] | Yes\\ | Array of objects |testops_multi.projects[].code
| Project code | | N/A | undefined | Yes\\ | Any string |testops_multi.projects[].run.title
| Project-specific test run title | | N/A | Same as single-project default | No | Any string |testops_multi.projects[].run.description
| Project-specific test run description | | N/A | Same as single-project default | No | Any string |testops_multi.projects[].run.complete
| Project-specific test run complete | | N/A | true | No | true, false |testops_multi.projects[].run.id
| Project-specific test run ID | | N/A | undefined | No | Any integer |testops_multi.projects[].plan.id
| Project-specific test plan ID | | N/A | undefined | No | Any integer |testops_multi.projects[].environment
| Project-specific environment | | N/A | Uses global environment if not set | No | Any string |
\\ Required when using testops_multi mode
`json`
{
"mode": "testops",
"fallback": "report",
"debug": false,
"environment": "local",
"captureLogs": false,
"statusMapping": {
"invalid": "failed",
"skipped": "passed"
},
"logging": {
"console": true,
"file": true
},
"report": {
"driver": "local",
"connection": {
"local": {
"path": "./build/qase-report",
"format": "json"
}
}
},
"testops": {
"api": {
"token": "
"host": "qase.io"
},
"run": {
"title": "Regress run",
"description": "Regress run description",
"complete": true,
"tags": ["tag1", "tag2"],
"externalLink": {
"type": "jiraCloud",
"link": "PROJ-123"
}
},
"defect": false,
"project": "
"uploadAttachments": true,
"showPublicReportLink": true,
"statusFilter": ["passed", "skipped"],
"batch": {
"size": 100
},
"configurations": {
"values": [
{
"name": "group1",
"value": "value1"
},
{
"name": "group2",
"value": "value2"
}
],
"createIfNotExists": true
}
}
}
Example qase.config.json for multi-project reporting:
`json`
{
"mode": "testops_multi",
"fallback": "report",
"debug": false,
"environment": "local",
"logging": {
"console": true,
"file": false
},
"report": {
"driver": "local",
"connection": {
"local": {
"path": "./build/qase-report",
"format": "json"
}
}
},
"testops": {
"api": {
"token": "
"host": "qase.io"
},
"batch": { "size": 100 },
"showPublicReportLink": true
},
"testops_multi": {
"default_project": "PROJ1",
"projects": [
{
"code": "PROJ1",
"run": {
"title": "PROJ1 Multi-Project Run",
"description": "Test run for PROJ1 project",
"complete": true
},
"plan": { "id": 1 },
"environment": "staging"
},
{
"code": "PROJ2",
"run": {
"title": "PROJ2 Multi-Project Run",
"description": "Test run for PROJ2 project",
"complete": true
},
"environment": "production"
}
]
}
}
`bashSet external link for Jira Cloud
export QASE_TESTOPS_RUN_EXTERNAL_LINK='{"type":"jiraCloud","link":"PROJ-123"}'
Multi-Project Support
The multi-project feature allows you to send test results to multiple Qase projects simultaneously, with different test case IDs for each project. This is useful when:
* You need to report the same test to different projects
* Different projects track the same functionality with different test case IDs
* You want to maintain separate test runs for different environments or teams
$3
1. Configure multiple projects in the
testops_multi.projects array
2. Each project can have its own run configuration (title, description, plan, environment)
3. Use framework-specific helpers or markers to map test cases to projects (see table below)
4. Tests without explicit project mapping are sent to default_project (or the first project). Results without any case ID are also sent to the default project without linking to a test case.$3
For detailed framework-specific documentation on multi-project support, see:
qase.projects(mapping, it(...)), title markers
* Playwright Multi-Project Guide — qase.projects(mapping), qase.projectsTitle(), annotations
* Jest Multi-Project Guide — qase.projects(mapping, name)
* Vitest Multi-Project Guide — addQaseProjects(name, mapping)
* Mocha Multi-Project Guide — qase.projects(mapping, name)
* WDIO Multi-Project Guide — qase.projects(mapping, name)
* CucumberJS Multi-Project Guide — tags @qaseid.PROJ(ids) in feature files
* Newman — comments in test script
* TestCafe — qase.projects(mapping).create() in test.meta()$3
For runnable examples, see the multi-project examples directory.
$3
Set
mode to testops_multi and add a testops_multi section with default_project and projects:`json
{
"mode": "testops_multi",
"testops": {
"api": { "token": "", "host": "qase.io" },
"batch": { "size": 100 }
},
"testops_multi": {
"default_project": "PROJ1",
"projects": [
{
"code": "PROJ1",
"run": { "title": "Project 1 Run", "complete": true },
"plan": { "id": 1 },
"environment": "staging"
},
{
"code": "PROJ2",
"run": { "title": "Project 2 Run", "id": 123, "complete": true },
"environment": "production"
}
]
}
}
`$3
For each result you can set
testops_project_mapping (or use the helpers on TestResultType):-
testops_project_mapping: Record — project code → list of test case IDs.
- Backward compatibility: if testops_project_mapping is empty or missing, the result uses testops_id and is sent to default_project (or the first project).$3
Use the syntax below only when
mode is testops_multi. For single-project mode (testops), keep using the usual single-project syntax (e.g. (Qase ID: 123) or qase(1, 'name')).Use the helper methods below so project codes and IDs are formatted correctly (same idea as
qase(id, name) for single-project).#### Vitest
- Single project:
addQaseId(name, caseIds) → "name (Qase ID: 1,2)".
- Multi-project: addQaseProjects(name, mapping) → "name (Qase PROJ1: 1,2) (Qase PROJ2: 3)".`js
import { addQaseId, addQaseProjects } from 'vitest-qase-reporter/vitest';// Single project (legacy)
it(addQaseId('login flow', [100]), async () => { ... });
// Multi-project — use helper so title is formatted correctly
it(addQaseProjects('login flow', { PROJ1: [100], PROJ2: [200] }), async () => { ... });
// Multiple IDs per project
it(addQaseProjects('checkout', { PROJ1: [10, 11], PROJ2: [20] }), async () => { ... });
`#### Jest
- Single project:
qase(caseId, name).
- Multi-project: qase.projects(mapping, name).`js
const { qase } = require('jest-qase-reporter');// Single project
test(qase(100, 'login flow'), () => { ... });
// Multi-project
test(qase.projects({ PROJ1: [100], PROJ2: [200] }, 'login flow'), () => { ... });
`#### Cypress
- Single project:
qase(caseId, test) (mutates test title) or title string (Qase ID: 100).
- Multi-project: qase.projects(mapping, name) returns the title string; use it as the first argument to it().`js
const { qase } = require('cypress-qase-reporter');// Single project
it(qase(100, 'login flow'), () => { ... }); // if qase receives test
it('login flow (Qase ID: 100)', () => { ... });
// Multi-project — use helper
it(qase.projects({ PROJ1: [100], PROJ2: [200] }, 'login flow'), () => { ... });
`Tags (Cucumber/BDD):
@qaseid.PROJ1(100) @qaseid.PROJ2(200).#### Playwright
- Single project:
qase(caseId, name) or qase.id([1, 2]) in test.
- Multi-project: qase.projects(mapping) inside the test (metadata, not title).`js
const { test } = require('@playwright/test');
const { qase } = require('playwright-qase-reporter');// Multi-project: set mapping inside the test
test('login and checkout', async ({ page }) => {
qase.projects({ PROJ1: [1, 2], PROJ2: [3] });
await page.goto('/login');
// ...
});
// Single project
test(qase(1, 'single project test'), async ({ page }) => { ... });
`#### Mocha
- Single project:
qase(caseId, name).
- Multi-project: qase.projects(mapping, name).`js
const { qase } = require('mocha-qase-reporter');it(qase(100, 'login flow'), function () { ... });
it(qase.projects({ PROJ1: [100], PROJ2: [200] }, 'login flow'), function () { ... });
`#### WDIO (WebdriverIO)
- Single project:
qase(qaseId, name).
- Multi-project: qase.projects(mapping, name).`js
const { qase } = require('wdio-qase-reporter');it(qase(1, 'should work'), async () => { ... });
it(qase.projects({ PROJ1: [100], PROJ2: [200] }, 'Login flow'), async () => { ... });
`You can still type markers manually in the title (e.g.
(Qase PROJ1: 100) (Qase PROJ2: 200)); the helpers avoid typos and keep the format consistent.#### Summary
| Framework | Single project (legacy) | Multi-project (project: IDs in title or API) |
|------------|-----------------------------|--------------------------------------------------|
| Vitest |
(Qase ID: 123) in title | (Qase PROJ1: 123) (Qase PROJ2: 456) in title |
| Jest | (Qase ID: 123) in title | (Qase PROJ1: 123) (Qase PROJ2: 456) in title |
| Cypress| (Qase ID: 123) or @qaseid(123) | (Qase PROJ1: 123) (Qase PROJ2: 456) or @qaseid.PROJ1(123) @qaseid.PROJ2(456) |
| Playwright | qase(1, 'name') or metadata | qase.projects({ PROJ1: [1, 2], PROJ2: [3] }) in test |
| Mocha | (Qase ID: 123) in title | (Qase PROJ1: 123) (Qase PROJ2: 456) in title |
| WDIO | (Qase ID: 123) in title | (Qase PROJ1: 123) (Qase PROJ2: 456) in title |- Title format:
(Qase PROJECT_CODE: id1,id2,...) — space after Qase, project code (letters, numbers, underscores), colon, then one or more IDs separated by commas. Several projects = several such blocks in one title.
- Cypress tags: @qaseid.PROJECT_CODE(id1,id2,...).
- Playwright: qase.projects({ PROJECT_CODE: [id1, id2, ...], ... }); project codes must match testops_multi.projects[].code.Tests that do not specify any multi-project mapping are sent to
default_project` (or the first project) using their usual single-project ID, if any.