1.0.6 • Published 2 years ago

jest-testrail-reporter2 v1.0.6

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

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:

NameTypeRequiredDefault value
hoststring:white_check_mark:
usernamestring:white_check_mark:
passwordstring:white_check_mark:
projectmap:white_check_mark:
project.idnumber:white_check_mark:
statusIdsmap:x:see below
statusIds.disablednumber:white_check_mark:2
statusIds.failednumber:white_check_mark:5
statusIds.passednumber:white_check_mark:1
statusIds.pendingnumber:white_check_mark:4
statusIds.skippednumber:white_check_mark:3
statusIds.todonumber:white_check_mark:3
testRunmap:white_check_mark:
testRun.namestring, function:white_check_mark:
testRun.descriptionstring, function:x:

License

See LICENSE file.

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago