testrail-api-node
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

TestRail API GitHub package version Dependencies Status GitHub top language

Installation

npm install dlenroc/node-testrail-api --save

Example

const TestRail = require('testrail');
 
const api = new TestRail({
  host: 'https://{organization}.testrail.net',
  user: '{username}',
  password: '{password}'
});
 
let testCase = await api.getCase(1);
console.log(testCase.title);
 
// or
 
api.getCase(1).then(testCase => console.log(testCase.title));

APIs

Attachments

addAttachmentToResult(resultId: number, filePath: String): Promise<AddAttachment>
addAttachmentToResultForCase(resultId: number, caseId: number, filePath: String): Promise<AddAttachment>
getAttachmentsForCase(caseId: number): Promise<Attachment>
getAttachmentsForTest(testId: number): Promise<Attachment>
getAttachment(attachmentId: number): Promise<Attachment>
deleteAttachment(attachmentId: number): Promise<void>

Cases

getCase(caseId: number): Promise<Case>
getCases(projectId: number, filters?: CaseFilters): Promise<Case[]>
addCase(sectionId: number, data: NewCase): Promise<Case>
updateCase(caseId: number, data: NewCase): Promise<Case>
deleteCase(caseId: number): Promise<void>

Case Fields

getCaseFields(): Promise<CaseField[]>
addCaseField(data: NewCaseField): Promise<CaseField>

Case Types

getCaseTypes(): Promise<CaseType[]>

Configurations

getConfigs(projectId: number): Promise<Config[]>
addConfigGroup(projectId: number, data: NewConfig): Promise<Config>
addConfig(configGroupId: number, data: NewConfig): Promise<ConfigItem>
updateConfigGroup(configGroupId: number, data: NewConfig): Promise<Config>
updateConfig(configId: number, data: NewConfig): Promise<ConfigItem>
deleteConfigGroup(configGroupId: number): Promise<void>
deleteConfig(configId: number): Promise<void>

Milestones

getMilestone(milestoneId: number): Promise<Milestone>
getMilestones(projectId: number, filters?: MilestoneFilter): Promise<Milestone[]>
addMilestone(projectId: number, data: NewMilestone): Promise<Milestone>
updateMilestone(milestoneId: number, data: UpdateMilestone): Promise<Milestone>
deleteMilestone(milestoneId: number): Promise<void>

Plans

getPlan(planId: number): Promise<Plan>
getPlans(projectId: number, filters?: PlanFilters): Promise<Plan[]>
addPlan(projectId: number, data: NewPlan): Promise<Plan>
addPlanEntry(planId: number, data: NewPlanEntry): Promise<PlanEntry>
updatePlan(planId: number, data: UpdatePlan): Promise<Plan>
updatePlanEntry(planId: number, entryId: string, data: UpdatePlanEntry): Promise<PlanEntry>
closePlan(planId: number): Promise<Plan>
deletePlan(planId: number): Promise<void>
deletePlanEntry(planId: number, entryId: string): Promise<void>

Priorities

getPriorities(): Promise<Priority>

Projects

getProject(projectId: number): Promise<Project>
getProjects(filters?: ProjectFilters): Promise<Project[]>
addProject(data: NewProject): Promise<Project>
updateProject(projectId: number, data: UpdateProject): Promise<Project>
deleteProject(projectId: number): Promise<void>

Reports

getReports(projectId: number): Promise<Report[]>
runReport(reportTemplateId): Promise<ReportUrls>

Results

getResults(testId: number, filters?: ResultFilters): Promise<Result[]>
getResultsForCase(runId: number, caseId, filters?: ResultFilters): Promise<Result[]>
getResultsForRun(runId: number, filters?: ResultsForRunFilters): Promise<Result[]>
addResult(testId: number, data: NewResult): Promise<Result>
addResultForCase(runId: number, caseId: number, data: NewResult): Promise<Result>
addResults(runId: number, data: { results: NewResult[] }): Promise<Result[]>
addResultsForCases(runId: number, data: NewResultForCase): Promise<Result[]>

Result Fields

getResultFields(): Promise<ResultField[]>

Runs

getRun(runId: number): Promise<Run>
getRuns(projectId: number, filters?: RunFilters): Promise<Run[]>
addRun(projectId: number, data: NewRun): Promise<Run>
updateRun(runId: number, data: UpdateRun): Promise<Run>
closeRun(runId: number): Promise<Run>
deleteRun(runId: number): Promise<void>

Sections

getSection(sectionId: number): Promise<Section>
getSections(projectId: number, filters?: SectionsFilters): Promise<Section[]>
addSection(projectId: number, data: NewSection): Promise<Section>
updateSection(sectionId: number, data: UpdateSection): Promise<Section>
deleteSection(sectionId: number): Promise<void>

Statuses

getStatuses(): Promise<Status[]>

Suites

getSuite(suiteId: number): Promise<Suite>
getSuites(projectId: number): Promise<Suite[]>
addSuite(projectId: number, data: NewSuite): Promise<Suite>
updateSuite(suiteId: number, data: NewSuite): Promise<Suite>
deleteSuite(suiteId: number): Promise<void>

Templates

getTemplates(projectId: number): Promise<Template[]>

Tests

getTest(testId: number): Promise<Test>
getTests(runId: number, filters?: TestFilters): Promise<Test[]>

Users

getUser(userId: number): Promise<User>
getUserByEmail(email: string): Promise<User>
getUsers(): Promise<User[]>

Readme

Keywords

Package Sidebar

Install

npm i testrail-api-node

Weekly Downloads

15

Version

1.0.0

License

MIT

Unpacked Size

39.6 kB

Total Files

5

Last publish

Collaborators

  • thotasivasai