# testrail-js-api

> Library exposing TestRail API

Latest version **0.3.2** (published 2022-09-30) · MIT license · 0 weekly downloads

## Install

```sh
npm install testrail-js-api
pnpm add testrail-js-api
yarn add testrail-js-api
bun add testrail-js-api
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.3.2 |
| Published | 2022-09-30 |
| First published | 2020-03-03 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Node | >=10.13 |
| Dependencies | 2 |
| Unpacked size | 68.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | Damian Osipiuk |
| Maintainers | mrmentor, damianosipiuk |
| Keywords | testrail, api |

## Links

- npm: https://www.npmjs.com/package/testrail-js-api
- Repository: https://github.com/DamianOsipiuk/testrail-api
- Homepage: https://github.com/DamianOsipiuk/testrail-api#readme
- Issues: https://github.com/DamianOsipiuk/testrail-api/issues
- npm.io page: https://npm.io/package/testrail-js-api

## Dependencies (2)

- [form-data](https://npm.io/package/form-data.md) ^4.0.0
- [node-fetch](https://npm.io/package/node-fetch.md) ^2.6.7

## Recent versions

- 0.3.2 (latest) — 2022-09-30
- 0.3.1 — 2022-09-30
- 0.3.0 — 2021-09-25
- 0.2.1 — 2021-06-10
- 0.2.0 — 2020-11-24
- 0.1.6 — 2020-07-06
- 0.1.5 — 2020-04-10
- 0.1.4 — 2020-03-06
- 0.1.3 — 2020-03-06
- 0.1.2 — 2020-03-05
- 0.1.1 — 2020-03-05
- 0.1.0 — 2020-03-03

## README

[![NPM](https://img.shields.io/npm/v/testrail-js-api)](https://www.npmjs.com/package/testrail-js-api) [![NPM](https://img.shields.io/npm/l/testrail-js-api)](https://github.com/DamianOsipiuk/testrail-js-api/blob/master/LICENSE) [![NPM](https://img.shields.io/node/v/testrail-js-api)](https://github.com/DamianOsipiuk/testrail-js-api/blob/master/package.json)

# 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);
```

2. 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 }) => {
    ...
});
```

---
_Source: https://npm.io/package/testrail-js-api · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
