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 - npm Package Compare versions

Comparing version 1.0.3 to 1.0.4

13

index.js

@@ -1,1 +0,12 @@

module.exports = require('./dist/testrail').TestRailClient;
const options = {
domain: process.env.TESTRAIL_DOMAIN,
username: process.env.TESTRAIL_USERNAME,
password: process.env.TESTRAIL_APIKEY,
projectId: process.env.TESTRAIL_PROJECTID
};
const Client = require('./dist/testrail').TestRailClient;
const outClient = new Client(options);
module.exports = outClient;
module.exports.default = require('./dist/testrail').TestRailClient;

2

package.json
{
"name": "testrail-api-client",
"version": "1.0.3",
"version": "1.0.4",
"description": "JavaScript client for TestRail API",

@@ -5,0 +5,0 @@ "main": "index.js",

# testrail-api-client
TypeScript (JavaScript) client for TestRail API v2
[![npm version](https://img.shields.io/npm/v/testrail-api-client.svg?style=flat-square)](https://www.npmjs.com/package/testrail-api-client)
[![npm downloads](https://img.shields.io/npm/dm/testrail-api-client.svg?style=flat-square)](http://npm-stat.com/charts.html?package=testrail-api-client)
## Installing
Using npm:
```bash
$ npm install testrail-api-client
```
Using yarn:
```bash
$ yarn add testrail-api-client
```
## Example
### note: CommonJS usage
#### Using Environment Variables:
```js
const client = require('testrail-api-client');
```
#### Using Custom Options:
```js
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
```js
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
```js
client.getCasesFromRun(123)
.then(function (cases) {
console.log(`Number of cases from run #${runId}: ${cases.length}`)
})
.catch(error => console.error(error));
```
### closeRun
```js
client.closeRun(123)
.then(console.log(`Closed run with id: ${runId}`))
.catch(error => console.error(error));
```
### closeRun
```js
client.getCases(suiteId)
.then(function (cases) {
console.log(`Number of cases in suiteid=${suiteId}: ${cases.length}`);
})
.catch(error => console.error(error));
```
## Environment variables
| Variable | Description |
|-----------|---------------|
| TESTRAIL_DOMAIN | This is a required variable to point the client to your TestRail instance.<br /><br />_Required_<br />Example: `example.testrail.com` |
| TESTRAIL_USERNAME | This is a required variable to authenticate HTTP communication.<br /><br />_Required_<br />Example: `example@example.com` |
| TESTRAIL_APIKEY | This is a required variable to authenticate HTTP communication. Can be obtained in TestRail settings, see [http://docs.gurock.com/testrail-api2/accessing].<br /><br />_Required_<br />Example: `ABC` |
| TESTRAIL_PROJECTID | This is a required variable to point client to the right project.<br /><br />_Required_<br />Example: `1` |
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