Skip to content

DamianOsipiuk/testrail-js-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

7cce427 · Sep 25, 2021

History

34 Commits
Jun 10, 2021
Sep 25, 2021
Jun 10, 2021
Jun 10, 2021
Dec 16, 2020
Dec 16, 2020
Feb 28, 2020
Nov 23, 2020
Sep 25, 2021
Sep 25, 2021
Sep 25, 2021
Dec 16, 2020

Repository files navigation

NPM NPM NPM

Notice

Please make sure to check the API reference: https://www.gurock.com/testrail/docs/api

To upload attachments for test results you have to enable an option to edit test reults:

Please note the ability to edit test results must be enabled under 'Site Settings' in order for add_attachment_to_result endpoints to work.

Usage

  1. Create new instance of the TestRail class by passing:
  • host - TestRail server address
  • user - Username that has access to the target project.
  • apiKey - Generate API Key from TestRail options.
const testrail = new TestRail(host, user, apiKey);
  1. Invoke API methods. All methods return a promise with response and a value as an object.
const { response, value } = await testrail.addRun(
    projectId,
    runPayload,
);
testrail.addRun(
    projectId,
    runPayload,
).then(({ response, value }) => {
    ...
});