jest-testrail-reporter2

1.0.6 • Public • Published

jest-testrail-reporter2

Reporter for Jest to create test runs in TestRail, link test cases and update their status automatically.

npm npm

Installation

To install the library in your project, use below command:

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).

// 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:

{
  reporters: [

    // ... other reporters

    ["jest-testrail-reporter2", {
      host: 'https://yourorg.testrail.io',
      username: 'name@example.com',
      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
username string
password string
project map
project.id number
statusIds map see below
statusIds.disabled number 2
statusIds.failed number 5
statusIds.passed number 1
statusIds.pending number 4
statusIds.skipped number 3
statusIds.todo number 3
testRun map
testRun.name string, function
testRun.description string, function

License

See LICENSE file.

Package Sidebar

Install

npm i jest-testrail-reporter2

Weekly Downloads

99

Version

1.0.6

License

MIT

Unpacked Size

37.3 kB

Total Files

14

Last publish

Collaborators

  • vpzqtsolv