junit-testrail-reporter
v1.5.1
Published
Report JUnit test results to TestRail
Downloads
732
Maintainers
Readme
You've got some test cases in TestRail that are automated and the results are ouputted in a JUnit format. This will report the results as a run in TestRail.
Installation
npm install --save-dev junit-testrail-reporter
pnpm install --save-dev junit-testrail-reporter
yarn add --dev junit-testrail-reporter
Usage
Add the test suite and case identifier in the title of your test:
... it('S123456 C123456 given some scenario when an action is taken then something is true', () => {}) // multiple test cases are supported as well test('S123456 C654321 C654321 C678901 given some scenario when an action is taken then something is true', () => {}) // so are multiple test suites test('S123456 C123456 S654321 C654321 C678901 given some scenario when an action is taken then something is true', () => {}) ...
Configure and run your tests to output a JUnit test report
- https://github.com/jest-community/jest-junit
- https://github.com/michaelleeallen/mocha-junit-reporter
Run
npx junit-testrail-reporter --resultsPattern='test-results/*.xml'
pnpm exec junit-testrail-reporter --resultsPattern='test-results/*.xml'
yarn exec junit-testrail-reporter --resultsPattern='test-results/*.xml'
Configuration
| Argument Name | Environment Variable | Description | Required | Default |
| ----------------------- | ----------------------- | ------------------------------------------------------------------------- | -------- | -------------------------------------------------- |
| host
or h
| TESTRAIL_HOST
| The host of the TestRail server to send results to. | ✔️ | - |
| keepOpen
| TESTRAIL_KEEP_OPEN
| If true, the reporter will leave the test runs open in TestRail. | ❌ | false
|
| - | TESTRAIL_PASSWORD
| The password, of the user, used to authenticate with TestRail. | ✔️ | - |
| milestoneId
| TESTRAIL_MILESTONE_ID
| The identifier, if any, of the milestone to group test results under. | ✔️ | - |
| projectId
| TESTRAIL_PROJECT_ID
| The identifier of the TestRail project to send results to. | ✔️ | - |
| resultsPattern
or p
| - | The glob pattern for test result files that will be reported to TestRail. | ✔️ | - |
| runName
or r
| TESTRAIL_RUN_NAME
| A brief description used to identify the automated test run. | ❌ | "Automated Test Run via junit-testrail-reporter"
|
| username
or u
| TESTRAIL_USERNAME
| The username of the account to authenticate with TestRail. | ✔️ | - |
The password configuration parameter can only be set via environment variable.
The resultsPattern configuration parameter can only be set via command line arguments.