Publish results simple and easy.
npm install playwright-qase-reporter
The Playwright reporter has the ability to auto-generate test cases and suites from your test data.
But if necessary, you can independently register the ID of already existing test cases from TMS before the executing tests. For example:
import { qase } from 'playwright-qase-reporter/dist/playwright';
describe('Test suite', () => {
test(qase([1,2], 'Several ids'), () => {
expect(true).toBe(true);
})
test(qase(3, 'Correct test'), () => {
expect(true).toBe(true);
})
test.skip(qase("4", 'Skipped test'), () => {
expect(true).toBe(true);
})
test(qase(["5", "6"], 'Failed test'), () => {
expect(true).toBe(false);
})
});
You should also have an active item in the project settings at
https://app.qase.io/project/QASE_PROJECT_CODE/settings/options
options in the Test Runs
block:
Auto create test cases
and
Allow submitting results in bulk
To run tests and create a test run, execute the command (for example from folder examples):
QASE_REPORT=1 npx playwright test
or
npm test
A test run will be performed and available at:
https://app.qase.io/run/QASE_PROJECT_CODE
Reporter options (* - required):
- *
apiToken
- Token for API access, you can find more information here - *
projectCode
- Code of your project (can be extracted from main page of your project:https://app.qase.io/project/DEMOTR
-DEMOTR
is project code here)basePath
- Qase.io url runId
- Run ID from Qase TMS (also can be got from run URL)environmentId
- Environment ID from Qase TMSlogging
[true/false] - Enabled debug logging from reporter or notrunComplete
[true/false] - Complete run after all tests are finisheduploadAttachments
[true/false] - Uploading attachments (screenshot/video) after test endedrootSuiteTitle
- A parent suite for your autocreated tests
Example playwright.config.js
config:
const config = {
use: {
screenshot: 'only-on-failure',
video: 'retain-on-failure',
},
reporter: [
['list'],
['playwright-qase-reporter',
{
apiToken: 'api_key',
projectCode: 'project_code',
runComplete: true,
basePath: 'https://api.qase.io/v1',
logging: true,
uploadAttachments: true,
}],
],
};
module.exports = config;
You can check example configuration with multiple reporters in example project.
Supported ENV variables:
QASE_REPORT
- You should pass this ENV if you want to use qase reporterQASE_API_TOKEN
- API tokenQASE_PROJECT_CODE
- Code of your project (can be extracted from main page of your project: https://app.qase.io/project/DEMOTR - DEMOTR is project code here)QASE_API_BASE_URL
- Qase.io urlQASE_RUN_ID
- Pass Run ID from ENV and override reporter optionsQASE_ENVIRONMENT_ID
- Pass Environment ID from ENV and override reporter optionsQASE_RUN_NAME
- Set custom Run name, when new run is createdQASE_RUN_DESCRIPTION
- Set custom Run description, when new run is createdQASE_RUN_COMPLETE
- Complete run after all tests are finishedQASE_UPLOAD_ATTACHMENTS
- Uploading attachments (screenshot/video) after test endedQASE_ROOT_SUITE_TITLE
- Same asrootSuiteTitle
We maintain the reporter on LTS versions of Node. You can find the current versions by following the link