npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@dlenroc/testrail

v1.9.1

Published

TestRail API client with error handling and typing

Downloads

117,727

Readme

@dlenroc/testrail · NPM Version Supported Node.js version

Installation

npm install @dlenroc/testrail --save

Example

// import TestRail from '@dlenroc/testrail';
// const TestRail = require('@dlenroc/testrail');

const api = new TestRail({
    host: 'https://{organization}.testrail.net',
    username: '{username}',
    password: '{token/password}',
});

const projects = await api.getProjects();

console.log(projects);

APIs

Attachments

addAttachmentToCase(caseId: number, payload: AddAttachment): Promise<CreatedAttachment>
addAttachmentToPlan(planId: number, payload: AddAttachment): Promise<CreatedAttachment>
addAttachmentToPlanEntry(planId: number, entryId: string, payload: AddAttachment): Promise<CreatedAttachment>
addAttachmentToResult(resultId: number, payload: AddAttachment): Promise<CreatedAttachment>
addAttachmentToRun(runId: number, payload: AddAttachment): Promise<CreatedAttachment>
getAttachmentsForCase(caseId: number, filters?: Pagination): Promise<AttachmentForCase[]>
getAttachmentsForPlan(planId: number, filters?: Pagination): Promise<AttachmentForPlan[]>
getAttachmentsForPlanEntry(planId: number, entryId: string): Promise<AttachmentForPlanEntry[]>
getAttachmentsForRun(runId: number, filters?: Pagination): Promise<AttachmentForRun[]>
getAttachmentsForTest(testId: number): Promise<AttachmentForTest[]>
getAttachment(attachmentId: string): Promise<Blob>
deleteAttachment(attachmentId: string): Promise<void>

BDDs

getBdd(caseId: number): Promise<Blob>
addBdd(sectionId: number, payload: AddAttachment): Promise<Case>

Cases

getCase(caseId: number): Promise<Case>
getCases(projectId: number, filters?: CaseFilters): Promise<Case[]>
getHistoryForCase(caseId: number, filters?: Pagination): Promise<CaseHistory[]>
addCase(sectionId: number, payload: AddCase): Promise<Case>
copyCasesToSection(sectionId: number, payload: CopyCasesToSection): Promise<void>
updateCase(caseId: number, payload: UpdateCase): Promise<Case>
updateCases(suiteId: number, payload: UpdateCases): Promise<void>
moveCasesToSection(sectionId: number, payload: MoveCasesToSection): Promise<void>
deleteCase(caseId: number): Promise<void>
deleteCases(suiteId: number, payload: DeleteCases): Promise<void>

Case Fields

getCaseFields(): Promise<CaseField[]>
addCaseField(payload: AddCaseField): Promise<CaseField>

Case Types

getCaseTypes(): Promise<CaseType[]>

Configurations

getConfigs(projectId: number): Promise<Config[]>
addConfigGroup(projectId: number, payload: AddConfigGroup): Promise<Config>
addConfig(configGroupId: number, payload: AddConfig): Promise<ConfigItem>
updateConfigGroup(configGroupId: number, payload: UpdateConfigGroup): Promise<Config>
updateConfig(configId: number, payload: UpdateConfig): Promise<ConfigItem>
deleteConfigGroup(configGroupId: number): Promise<void>
deleteConfig(configId: number): Promise<void>

Datasets

getDataset(datasetId: number): Promise<Dataset>
getDatasets(projectId: number, filters?: Pagination): Promise<Dataset[]>
addDataset(projectId: number, payload: AddDataset): Promise<Group>
updateDataset(datasetId: number, payload: AddDataset): Promise<Group>
deleteDataset(datasetId: number): Promise<void>

Groups

getGroup(groupId: number): Promise<Group>
getGroups(filters?: Pagination): Promise<Group[]>
addGroup(payload: AddGroup): Promise<Group>
updateGroup(groupId: number, payload: AddGroup): Promise<Group>
deleteGroup(groupId: number): Promise<void>

Milestones

getMilestone(milestoneId: number): Promise<Milestone>
getMilestones(projectId: number, filters?: MilestoneFilters): Promise<Milestone[]>
addMilestone(projectId: number, payload: AddMilestone): Promise<Milestone>
updateMilestone(milestoneId: number, payload: UpdateMilestone): Promise<Milestone>
deleteMilestone(milestoneId: number): Promise<void>

Roles

getRoles(filters?: Pagination): Promise<Role[]>

Plans

getPlan(planId: number): Promise<Plan>
getPlans(projectId: number, filters?: PlanFilters): Promise<PlanItem[]>
addPlan(projectId: number, payload: AddPlan): Promise<Plan>
addPlanEntry(planId: number, payload: AddPlanEntry): Promise<PlanEntry>
addRunToPlanEntry(planId: number, entryId: string, payload: AddRunToPlanEntry): Promise<PlanEntry>
updatePlan(planId: number, payload: UpdatePlan): Promise<Plan>
updatePlanEntry(planId: number, entryId: string, payload: UpdatePlanEntry): Promise<PlanEntry>
updateRunInPlanEntry(runId: number, payload: UpdateRunInPlanEntry): Promise<PlanEntry>
closePlan(planId: number): Promise<Plan>
deletePlan(planId: number): Promise<void>
deletePlanEntry(planId: number, entryId: string): Promise<void>
deleteRunFromPlanEntry(runId: number): Promise<void>

Priorities

getPriorities(): Promise<Priority[]>

Projects

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

Reports

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

Results

getResults(testId: number, filters?: ResultFilters): Promise<Result[]>
getResultsForCase(runId: number, caseId: number, filters?: ResultFilters): Promise<Result[]>
getResultsForRun(runId: number, filters?: ResultForRunFilters): Promise<Result[]>
addResult(testId: number, payload: AddResult): Promise<Result>
addResultForCase(runId: number, caseId: number, payload: AddResult): Promise<Result>
addResults(runId: number, payload: AddResults): Promise<Result[]>
addResultsForCases(runId: number, payload: AddResultsForCases): Promise<Result[]>

Result Fields

getResultFields(): Promise<ResultField[]>

Runs

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

Sections

getSection(sectionId: number): Promise<Section>
getSections(projectId: number, filters?: SectionFilters): Promise<Section[]>
addSection(projectId: number, payload: AddSection): Promise<Section>
moveSection(sectionId: number, payload: MoveSection): Promise<Section>
updateSection(sectionId: number, payload: UpdateSection): Promise<Section>
deleteSection(sectionId: number): Promise<void>

Shared steps

getSharedStep(stepId: number): Promise<SharedStep>
getSharedSteps(projectId: number, filters?: SharedStepFilters): Promise<SharedStep[]>
getSharedStepHistory(stepId: number, filters?: Pagination): Promise<SharedStepHistory[]> {
addSharedStep(projectId: number, payload: AddSharedStep): Promise<SharedStep>
updateSharedStep(stepId: number, payload: UpdateSharedStep): Promise<SharedStep>
deleteSharedStep(stepId: number, payload?: DeleteSharedStep): Promise<void>

Statuses

getStatuses(): Promise<Status[]>
getCaseStatuses(filters?: Pagination): Promise<CaseStatus[]>

Suites

getSuite(suiteId: number): Promise<Suite>
getSuites(projectId: number): Promise<Suite[]>
addSuite(projectId: number, payload: AddSuite): Promise<Suite>
updateSuite(suiteId: number, payload: UpdateSuite): 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>
getCurrentUser(): Promise<User>
getUserByEmail(email: string): Promise<User>
getUsers(filters?: UserFilters): Promise<User[]>
addUser(payload: AddUser): Promise<User>
updateUser(userId: number, payload: AddUser): Promise<User>

Variables

getVariables(projectId: number, filters?: Pagination): Promise<Variable[]>
addVariable(projectId: number, payload: AddVariable): Promise<Variable>
updateVariable(variableId: number, payload: AddVariable): Promise<Variable>
deleteVariable(variableId: number): Promise<void>