https://github.com/qtsolv/jest-testrail-reporter2
Reporter for Jest to automatically create test runs in TestRail, link test cases and update their status.
https://github.com/qtsolv/jest-testrail-reporter2
automation jest qa reporter reporting testing testrail
Last synced: 24 days ago
JSON representation
Reporter for Jest to automatically create test runs in TestRail, link test cases and update their status.
- Host: GitHub
- URL: https://github.com/qtsolv/jest-testrail-reporter2
- Owner: qtsolv
- License: mit
- Created: 2022-05-26T06:27:44.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2023-01-27T16:14:16.000Z (over 2 years ago)
- Last Synced: 2024-08-09T08:51:10.415Z (9 months ago)
- Topics: automation, jest, qa, reporter, reporting, testing, testrail
- Language: JavaScript
- Homepage:
- Size: 62.5 KB
- Stars: 2
- Watchers: 0
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# jest-testrail-reporter2
Reporter for [Jest](https://jestjs.io/) to create test runs in [TestRail](https://www.gurock.com/testrail/), link test cases and update their status automatically.
[](https://www.npmjs.com/package/jest-testrail-reporter2)
[](https://www.npmjs.com/package/jest-testrail-reporter2)### Installation
To install the library in your project, use below command:
```shell
npm install jest-testrail-reporter2 --save-dev# or using Yarn
yarn add jest-testrail-reporter2 --dev
```### Usage
You need to add the case ID in your test title anywhere (preferable in the beginning).
```js
// C001 is the case ID below
test("C001 - This is an example test", () => {
// ... your assertions
});// or you can put it in the end
test("This is an example test - C001", () => {
// ... your assertions
});// or maybe anywhere, first match to C\d+ will be used
test("This is C001 test", () => {
// ... your assertions
});
```Finally, include the reporter in your `jest.config.js` as follows:
```js
{
reporters: [// ... other reporters
["jest-testrail-reporter2", {
host: 'https://yourorg.testrail.io',
username: '[email protected]',
password: 'password' || 'api key',
project: { id: 1 },
testRun: {
name() {
return "Test Run #" + new Date().getTime();
},
},
}],
]
}
```Possible options and their respective types/values are as below:
| **Name** | **Type** | **Required** | **Default value** |
|---------------------|--------------------|--------------------|-------------------|
| host | `string` | :white_check_mark: | |
| username | `string` | :white_check_mark: | |
| password | `string` | :white_check_mark: | |
| project | `map` | :white_check_mark: | |
| project.id | `number` | :white_check_mark: | |
| statusIds | `map` | :x: | *see below* |
| statusIds.disabled | `number` | :white_check_mark: | 2 |
| statusIds.failed | `number` | :white_check_mark: | 5 |
| statusIds.passed | `number` | :white_check_mark: | 1 |
| statusIds.pending | `number` | :white_check_mark: | 4 |
| statusIds.skipped | `number` | :white_check_mark: | 3 |
| statusIds.todo | `number` | :white_check_mark: | 3 |
| testRun | `map` | :white_check_mark: | |
| testRun.name | `string, function` | :white_check_mark: | |
| testRun.description | `string, function` | :x: | |
| testSuite | `map` | :x: | |
| testSuite.id | `number` | :x: | |### License
See [LICENSE](LICENSE) file.