trident-beta
TypeScript icon, indicating that this package has built-in type declarations

1.13.0 • Public • Published

TestIt SDK

API SDK for TestIt according to api-doc

Installation

  • put this dependency in your project package.json
npm install
# ssh
npm install -verbose git+ssh://git@git.ringcentral.com:coding-now/testit-sdk.git
# https
npm install -verbose git+https://git.ringcentral.com/coding-now/testit-sdk.git

APIs

Login

import TestItSDK from 'testIt-sdk';
const TESTIT_ENDPOINT = 'https://testit.ringcentral.com';
const testItSdk = new TestItSDK(TESTIT_ENDPOINT);
await testItSdk.login('username','password');

Logout

testItSdk.logout();

Project API

Get all projects

const projects = await testItSdk.getProjects();

Get project by id

const project = await testItSdk.getProjectById(projectId); 

Get project by name

const project = await testItSdk.getProjectByName(projectName);

Get project id by name

const projectId = await testItSdk.getProjectIdByName(projectName);

Get project tree by project id

const projectTree = await testIdSdk.getProjectTreeById(projectId);

Test Case API

Get test case by id

const testCase = await testItSdk.getTestCaseById(caseId);

Get test case by key

const testCase = await testItSdk.getTestCaseByKey(caseKey);

Get test cases by id array

const caseIds = [...];
const testCases = await testItSdk.getTestCasesByIds(caseIds);

Get test plans by case id

const testPlans = await testItSdk.getTestPlansByTestCaseId(caseId);

Get execution history by case id

const executionHistory = await testItSdk.getExecutionHistoryByTestCaseId(caseId);

Test Suite API

Get test suite by id

const testSuite = await testItSdk.getTestSuiteById(suiteId);

Get suite tree by id

const suiteTree = await testItSdk.getSuiteTreeById(suiteId);

Test Plan API

Get test plan by id

const testPlan = await testItSdk.getTestPlanById(testPlanId);

Get test plan tree by id

const planTree = await testItSdk.getTreeByTestPlanId(testPlanId);

Get builds by test plan id

const builds = await testItSdk.getBuildsByTestPlanId(testPlanId);

Get execution progress by plan id

const executionProgress = await testItSdk.getExecutionProgressByTestPlanId(testPlanId);

Test Builds API

Get build by build id

const build = await testItSdk.getBuildById(buildId);

Search API

  • Search options include
    • ProjectName
    • Keywords
    • Subtype
    • SuiteName(only the lowest level of suite name)
    • Automated by
    • Priority

Search test cases by search options

const projectName = "...";
const keywords = ['...','...'];
const subtype = ['...','...'];
const suiteName = '...';
const searchOption : SearchOptions = {
    projectName : projectName,
    subtype : subtype,
    keywords : keywords,
  	suiteName : suiteName,
}
const testCases = await testItSdk.searchCasesBySearchOptions(searchOption);

Search test cases by suite name

  • Because of the insufficient of rich search tools(only the lowest level of suite name)
  • Search using any level of suite name
const suiteName = '...';
const projectName = '...';
await testItSdk.searchCasesBySuiteName(suiteName,projectName)

Store template info API

Store file by case key

const caseKey = '...';
const filePath = "...";
const templatePath = "..."
await testItSdk.storeFileByCaseKey(caseKey,filePath,templatePath);

Store files by search options

const projectName = "...";
const keywords = ['...','...'];
const subtype = ['...','...'];
const suiteName = '...';
const filePath = '...';
const templatePath = '...';
const searchOption : SearchOptions = {
    projectName : projectName,
    subtype : subtype,
    keywords : keywords,
  	suiteName : suiteName,
}
await testItSdk.storeFilesBySearchOptions(searchOption,filePath,templatePath);

Store files by suite name

const suiteName = '...';
const projectName = '...';
const filePath = '...';
await testItSdk.storeCasesBySuiteName(suiteName,projectName,filePath);

[Interface]Search Options

export interface SearchOptions{
  projectName : string;
  keywords ?: string[];
  subtype ?: string[];
  suiteName ?: string;
}

More Information

Readme

Keywords

Package Sidebar

Install

npm i trident-beta

Weekly Downloads

6

Version

1.13.0

License

ISC

Unpacked Size

1.81 MB

Total Files

70

Last publish

Collaborators

  • fengsen.deng