Skip to content

A modern, fully typed TestRail API client for Node.js and browsers. Built with TypeScript

License

Notifications You must be signed in to change notification settings

kiwamizamurai/testrail-modern-client

Repository files navigation

TestRail Modern API Client

npm version npm downloads License: MIT

A modern, type-safe TestRail API client written in TypeScript.

Note

Some TestRail API endpoints may differ from the official documentation. Our implementation is based on actual responses obtained through reverse engineering.

Installation

npm install testrail-modern-client

Quick Start

import { TestRailClient } from 'testrail-modern-client';

const client = new TestRailClient({
  host: 'https://your-instance.testrail.io',
  email: 'your-email',
  password: 'your-password', // or API key
});

// Get a test case
const testCase = await client.cases.get(1);

// Create a test run
const run = await client.runs.add(1, {
  name: 'Test Run',
  include_all: true,
});

Authentication

TestRail API uses HTTP basic authentication. There are two ways to authenticate:

1. Email and API Key (Recommended)

Generate an API key in TestRail under "My Settings". Then use your email address and the API key as password:

import { TestRailClient } from 'testrail-modern-client';

const client = new TestRailClient({
  host: 'https://your-instance.testrail.io',
  email: '[email protected]',
  password: 'your-api-key'  // API key from My Settings
});

2. Email and Password

Use your TestRail email and password. Note: This might be your Active Directory or LDAP password depending on your TestRail configuration.

import { TestRailClient } from 'testrail-modern-client';

const client = new TestRailClient({
  host: 'https://your-instance.testrail.io',
  email: '[email protected]',
  password: 'your-password'
});

Important: Always use HTTPS for your TestRail instance to ensure secure authentication. TestRail Hosted accounts use HTTPS by default.

API Reference

  1. Introduction to the TestRail API

About

A modern, fully typed TestRail API client for Node.js and browsers. Built with TypeScript

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published