Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

testrail-api-client

Package Overview
Dependencies
Maintainers
1
Versions
22
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

testrail-api-client

JavaScript client for TestRail API

  • 1.0.4
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
3.6K
decreased by-40.63%
Maintainers
1
Weekly downloads
 
Created
Source

testrail-api-client

TypeScript (JavaScript) client for TestRail API v2

npm version npm downloads

Installing

Using npm:

$ npm install testrail-api-client

Using yarn:

$ yarn add testrail-api-client

Example

note: CommonJS usage

Using Environment Variables:
const client = require('testrail-api-client');
Using Custom Options:
const client = require('testrail-api-client').default;

const options = {
    domain: "example.testrail.com",
    username: "example@example.com",
    password: "ABC",
    projectId: 1
};

const client_options = new client(options);

addRun

client.addRun("Example Run", "Example Description", 123, [1,2,3])
  .then(function (runId) {
      console.log(`Created run with id: ${runId}`)
  })
  .catch(error => console.error(error));

getCasesFromRun

client.getCasesFromRun(123)
  .then(function (cases) {
      console.log(`Number of cases from run #${runId}: ${cases.length}`)
  })
  .catch(error => console.error(error));

closeRun

client.closeRun(123)
  .then(console.log(`Closed run with id: ${runId}`))
  .catch(error => console.error(error));

closeRun

client.getCases(suiteId)
  .then(function (cases) {
      console.log(`Number of cases in suiteid=${suiteId}: ${cases.length}`);
  })
  .catch(error => console.error(error));

Environment variables

VariableDescription
TESTRAIL_DOMAINThis is a required variable to point the client to your TestRail instance.

Required
Example: example.testrail.com
TESTRAIL_USERNAMEThis is a required variable to authenticate HTTP communication.

Required
Example: example@example.com
TESTRAIL_APIKEYThis is a required variable to authenticate HTTP communication. Can be obtained in TestRail settings, see [http://docs.gurock.com/testrail-api2/accessing].

Required
Example: ABC
TESTRAIL_PROJECTIDThis is a required variable to point client to the right project.

Required
Example: 1

FAQs

Package last updated on 03 Apr 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc