trident is a sample and lightly tools aims to improve collaboration efficiency between SDET and QA based on initiative from Einstein/TestIT.
API SDK for TestIt according to api-doc
- put this dependency in your project package.json
``shell`
npm installssh
npm install -verbose git+ssh://git@git.ringcentral.com:coding-now/testit-sdk.githttps
npm install -verbose git+https://git.ringcentral.com/coding-now/testit-sdk.git
`typescript`
import TestItSDK from 'testIt-sdk';
const TESTIT_ENDPOINT = 'https://testit.ringcentral.com';
const testItSdk = new TestItSDK(TESTIT_ENDPOINT);
await testItSdk.login('username','password');
`typescript`
testItSdk.logout();
#### Get all projects
`typescript`
const projects = await testItSdk.getProjects();
#### Get project by id
`typescript`
const project = await testItSdk.getProjectById(projectId);
#### Get project by name
`typescript`
const project = await testItSdk.getProjectByName(projectName);
#### Get project id by name
`typescript`
const projectId = await testItSdk.getProjectIdByName(projectName);
#### Get project tree by project id
`typescript`
const projectTree = await testIdSdk.getProjectTreeById(projectId);
#### Get test case by id
`typescript`
const testCase = await testItSdk.getTestCaseById(caseId);
#### Get test case by key
`typescript`
const testCase = await testItSdk.getTestCaseByKey(caseKey);
#### Get test cases by id array
`typescript`
const caseIds = [...];
const testCases = await testItSdk.getTestCasesByIds(caseIds);
#### Get test plans by case id
`typescript`
const testPlans = await testItSdk.getTestPlansByTestCaseId(caseId);
#### Get execution history by case id
`typescript`
const executionHistory = await testItSdk.getExecutionHistoryByTestCaseId(caseId);
#### Get test suite by id
`typescript`
const testSuite = await testItSdk.getTestSuiteById(suiteId);
#### Get suite tree by id
`typescript`
const suiteTree = await testItSdk.getSuiteTreeById(suiteId);
#### Get test plan by id
`typescript`
const testPlan = await testItSdk.getTestPlanById(testPlanId);
#### Get test plan tree by id
`typescript`
const planTree = await testItSdk.getTreeByTestPlanId(testPlanId);
#### Get builds by test plan id
`typescript`
const builds = await testItSdk.getBuildsByTestPlanId(testPlanId);
#### Get execution progress by plan id
`typescript`
const executionProgress = await testItSdk.getExecutionProgressByTestPlanId(testPlanId);
#### Get build by build id
`typescript`
const build = await testItSdk.getBuildById(buildId);
- Search options include
- ProjectName
- Keywords
- Subtype
- SuiteName(only the lowest level of suite name)
- Automated by
- Priority
#### Search test cases by search options
`typescript`
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
`typescript`
const suiteName = '...';
const projectName = '...';
await testItSdk.searchCasesBySuiteName(suiteName,projectName)
#### Store file by case key
`typescript`
const caseKey = '...';
const filePath = "...";
const templatePath = "..."
await testItSdk.storeFileByCaseKey(caseKey,filePath,templatePath);
#### Store files by search options
`typescript`
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
`typescript`
const suiteName = '...';
const projectName = '...';
const filePath = '...';
await testItSdk.storeCasesBySuiteName(suiteName,projectName,filePath);
`typescript``
export interface SearchOptions{
projectName : string;
keywords ?: string[];
subtype ?: string[];
suiteName ?: string;
}