Options
All
  • Public
  • Public/Protected
  • All
Menu

Index

Functions

  • addAttachmentToCase(caseID: number, file: Buffer, filename: string): Promise<{ attachment_id: number }>
  • Adds an attachment to a test plan. The maximum allowable upload size is set to 256MB.

    Parameters

    • caseID: number

      The ID of the test case the attachment should be added to

    • file: Buffer

      The file to be uploaded

    • filename: string

      The filename to be associated

    Returns Promise<{ attachment_id: number }>

    Object containing attachment_id

  • addAttachmentToPlan(planID: number, file: Buffer, filename: string): Promise<{ attachment_id: number }>
  • Adds an attachment to a test plan. The maximum allowable upload size is set to 256MB.

    Parameters

    • planID: number

      The ID of the test plan the attachment should be added to

    • file: Buffer

      The file to be uploaded

    • filename: string

      The filename to be associated

    Returns Promise<{ attachment_id: number }>

  • addAttachmentToPlanEntry(planID: number, entryID: number, file: Buffer, filename: string): Promise<{ attachment_id: number }>
  • Adds an attachment to a test plan entry. The maximum allowable upload size is set to 256MB.

    Parameters

    • planID: number

      The ID of the test plan containing the entry

    • entryID: number

      The ID of the test plan entry the attachment should be added to

    • file: Buffer

      The file to be uploaded

    • filename: string

      The filename to be associated

    Returns Promise<{ attachment_id: number }>

    Object containing attachment_id

  • addAttachmentToResult(resultID: number, file: Buffer, filename: string): Promise<{ attachment_id: number }>
  • Adds an attachment to a result based on the result ID. The maximum allowable upload size is set to 256MB.

    Parameters

    • resultID: number

      The ID of the test result the attachment should be added to

    • file: Buffer

      The file to be uploaded

    • filename: string

      The filename to be associated

    Returns Promise<{ attachment_id: number }>

    Object containing attachment_id

  • addAttachmentToRun(runID: number, file: Buffer, filename: string): Promise<{ attachment_id: number }>
  • Adds an attachment to test run. The maximum allowable upload size is set to 256MB.

    Parameters

    • runID: number

      The ID of the test run the attachment should be added to

    • file: Buffer

      The file to be uploaded

    • filename: string

      The filename to be associated

    Returns Promise<{ attachment_id: number }>

    Object containing attachment_id

  • addCase(sectionID: number, _case: Partial<Case> & Pick<Case, "title">): Promise<Case>
  • Creates a new test case.

    Parameters

    • sectionID: number

      The ID of the section the test case should be added to

    • _case: Partial<Case> & Pick<Case, "title">

      The new Case data

    Returns Promise<Case>

    If successful, this method returns the new test case using the same response format as getCase

  • addCaseField(data: { configs?: { context?: { is_global?: boolean | undefined; project_ids?: (number | undefined)[] | undefined; } | undefined; options?: { is_required?: boolean | undefined; default_value?: string | undefined; items?: string | undefined; } | undefined; }; description?: string; include_all?: boolean; label?: string; name?: string; template_ids?: (undefined | number)[]; type?: string }): Promise<CaseField>
  • Creates a new test case custom field.

    Parameters

    • data: { configs?: { context?: { is_global?: boolean | undefined; project_ids?: (number | undefined)[] | undefined; } | undefined; options?: { is_required?: boolean | undefined; default_value?: string | undefined; items?: string | undefined; } | undefined; }; description?: string; include_all?: boolean; label?: string; name?: string; template_ids?: (undefined | number)[]; type?: string }

      The new CaseField data

      • Optional configs?: { context?: { is_global?: boolean | undefined; project_ids?: (number | undefined)[] | undefined; } | undefined; options?: { is_required?: boolean | undefined; default_value?: string | undefined; items?: string | undefined; } | undefined; }
      • Optional description?: string
      • Optional include_all?: boolean
      • Optional label?: string
      • Optional name?: string
      • Optional template_ids?: (undefined | number)[]
      • Optional type?: string

    Returns Promise<CaseField>

    If successful, this method returns the new custom field.

  • addConfig(configGroupID: number, data: Pick<Pick<TestPlanConfigGroup, "id" | "name"> & { group_id: number }, "name">): Promise<void>
  • Creates a new configuration – requires TestRail 5.2 or later.

    Parameters

    • configGroupID: number

      The ID of the configuration group the configuration should be added to

    • data: Pick<Pick<TestPlanConfigGroup, "id" | "name"> & { group_id: number }, "name">

      The new config data

    Returns Promise<void>

  • Creates a new configuration group – requires TestRail 5.2 or later.

    Parameters

    • projectID: number

      The ID of the project the configuration group should be added to

    • data: Pick<TestPlanConfigGroup, "name">

      The new config group data

    Returns Promise<void>

  • Creates a new dataset.

    Parameters

    • projectID: number

      The ID of the project to which the dataset should be added.

    • data: Dataset

      The new dataset data

    Returns Promise<Dataset>

    The newly created dataset

  • Creates a new group

    Parameters

    • data: Partial<Group>

      Object containing the new group data

    Returns Promise<Group>

    If successful, this method returns the new group using the same response format as getGroup.

  • Creates a new milestone.

    Parameters

    • projectID: number

      The ID of the project the milestone should be added to

    • data: Pick<Milestone, "name"> & Partial<Milestone>

      An object with the new milestone data

    Returns Promise<Milestone>

    If successful, this method returns the new milestone using the same response format as getMilestone.

  • addPlan(projectID: number, data: { assignedto_id?: number; blocked_count?: number; completed_on?: number; created_by?: number; created_on?: number; custom_status?_count?: number; description?: string; entries?: (undefined | ({ id?: string | undefined; suite_id?: number | undefined; name?: string | undefined; refs?: string | null | undefined; description?: string | null | undefined; include_all?: boolean | undefined; runs?: ({ ...; } | undefined)[] | undefined; }))[]; failed_count?: number; id?: number; is_completed?: boolean; milestone_id?: number; name?: string; passed_count?: number; project_id?: number; refs?: string; retest_count?: number; untested_count?: number; url?: string } & Pick<Plan, "name" | "milestone_id" | "description" | "entries">): Promise<unknown>
  • Creates a new test plan.

    Parameters

    • projectID: number

      The ID of the project the test plan should be added to

    • data: { assignedto_id?: number; blocked_count?: number; completed_on?: number; created_by?: number; created_on?: number; custom_status?_count?: number; description?: string; entries?: (undefined | ({ id?: string | undefined; suite_id?: number | undefined; name?: string | undefined; refs?: string | null | undefined; description?: string | null | undefined; include_all?: boolean | undefined; runs?: ({ ...; } | undefined)[] | undefined; }))[]; failed_count?: number; id?: number; is_completed?: boolean; milestone_id?: number; name?: string; passed_count?: number; project_id?: number; refs?: string; retest_count?: number; untested_count?: number; url?: string } & Pick<Plan, "name" | "milestone_id" | "description" | "entries">

      The new test plan data

    Returns Promise<unknown>

    If successful, this method returns the new test plan using the same response format as getPlan.

  • addPlanEntry(planID: number, data: Pick<Run, "name" | "suite_id" | "refs" | "assignedto_id" | "config_ids" | "description" | "include_all"> & { case_ids: number[]; runs: Run[] }): Promise<Plan>
  • Adds one or more new test runs to a test plan.

    Parameters

    • planID: number

      The ID of the plan the test runs should be added to

    • data: Pick<Run, "name" | "suite_id" | "refs" | "assignedto_id" | "config_ids" | "description" | "include_all"> & { case_ids: number[]; runs: Run[] }

      The new plan entry data

    Returns Promise<Plan>

    If successful, this method returns the new test plan entry including test runs using the same response format as the entries field of getPlan, but for a single entry instead of a list of entries.

  • Creates a new project (admin status required).

    Parameters

    Returns Promise<Project>

    If successful, this method returns the new project using the same response format as getProject.

  • addResult(testID: number, data: Partial<Result>): Promise<Result>
  • Adds a new test result, comment or assigns a test. It’s recommended to use addResults instead if you plan to add results for multiple tests.

    Parameters

    • testID: number

      The ID of the test the result should be added to

    • data: Partial<Result>

      Object containing new result data

    Returns Promise<Result>

    If successful, this method returns the new test result using the same response format as getResults, but with a single result instead of a list of results.

  • addResultForCase(runID: number, caseID: number, data: Partial<Result>): Promise<Result>
  • Adds a new test result, comment or assigns a test (for a test run and case combination). It’s recommended to use addResultsForCases instead if you plan to add results for multiple test cases.

    Parameters

    • runID: number

      The ID of the test run

    • caseID: number

      The ID of the test case

    • data: Partial<Result>

      Object containing new result data

    Returns Promise<Result>

    If successful, this method returns the new test result using the same response format as getResults, but with a single result instead of a list of results.

  • addResults(runID: number, data: { results: Partial<Result>[] }): Promise<Result[]>
  • Adds one or more new test results, comments or assigns one or more tests. Ideal for test automation to bulk-add multiple test results in one step.

    Parameters

    • runID: number

      The ID of the test run the results should be added to

    • data: { results: Partial<Result>[] }

      A list of objects containing the new result data

    Returns Promise<Result[]>

    If successful, this method returns the new test results using the same response format as getResults and in the same order as the list of the request.

  • addResultsForCases(runID: number, data: { results: Partial<Result>[] }): Promise<Result[]>
  • Adds one or more new test results, comments or assigns one or more tests (using the case IDs). Ideal for test automation to bulk-add multiple test results in one step.

    Parameters

    • runID: number

      The ID of the test run the results should be added to

    • data: { results: Partial<Result>[] }

      A list of objects containing the new result data

    Returns Promise<Result[]>

    If successful, this method returns the new test results using the same response format as getResults and in the same order as the list of the request.

  • addRun(projectID: number, data: Pick<Run, "name"> & { case_ids: number[] } | Pick<Run, "name" | "include_all">): Promise<Run>
  • Creates a new test run.

    Parameters

    • projectID: number

      The ID of the project the test run should be added to

    • data: Pick<Run, "name"> & { case_ids: number[] } | Pick<Run, "name" | "include_all">

      The new Run data

    Returns Promise<Run>

    If successful, this method returns the new test run using the same response format as getRun.

  • addRunToPlanEntry(planID: number, entryID: number, data: Pick<Run, "refs" | "assignedto_id" | "config_ids" | "description" | "include_all"> & { case_ids: number[] }): Promise<void>
  • Adds a new test run to a test plan entry (using configurations)

    Parameters

    • planID: number

      The ID of the plan the test runs should be added to

    • entryID: number

      The ID of the test plan entry

    • data: Pick<Run, "refs" | "assignedto_id" | "config_ids" | "description" | "include_all"> & { case_ids: number[] }

      The new run data

    Returns Promise<void>

  • addSection(projectID: number, data: Partial<Pick<Section, "name" | "suite_id" | "description" | "parent_id">>): Promise<Section>
  • Creates a new section.

    Parameters

    • projectID: number

      The ID of the project

    • data: Partial<Pick<Section, "name" | "suite_id" | "description" | "parent_id">>

      An object containing the new section data

    Returns Promise<Section>

    If successful, this method returns the new section using the same response format as getSection.

  • addSharedStep(projectID: number, data: Pick<SharedStep, "created_by" | "title" | "custom_steps_separated">): Promise<SharedStep>
  • Creates a new set of shared steps. Requires permission to add test cases within the project.

    Parameters

    • projectID: number

      The ID of the project

    • data: Pick<SharedStep, "created_by" | "title" | "custom_steps_separated">

      The new shared step data

    Returns Promise<SharedStep>

    If successful, this method returns the new shared steps using the same response format as getSharedStep.

  • addSuite(projectID: number, data: Pick<Suite, "name"> & Partial<Pick<Suite, "description">>): Promise<Suite>
  • Creates a new test suite.

    Parameters

    • projectID: number

      The ID of the project the test suite should be added to

    • data: Pick<Suite, "name"> & Partial<Pick<Suite, "description">>

      The new suite data

    Returns Promise<Suite>

    If successful, this method returns the new test suite using the same response format as getSuite.

  • Creates a new variable.

    Parameters

    • projectID: number

      The ID of the project to which the variable should be added.

    • data: Pick<Variable, "name">

      The new variable data

    Returns Promise<Variable>

    Returns the newly created variable

  • closePlan(planID: number): Promise<Plan>
  • Closes an existing test plan and archives its test runs & results.

    Parameters

    • planID: number

      The ID of the test plan

    Returns Promise<Plan>

    If successful, this method returns the closed test plan using the same response format as getPlan.

  • closeRun(runID: number): Promise<Run>
  • Closes an existing test run and archives its tests & results.

    Parameters

    • runID: number

      The ID of the test run

    Returns Promise<Run>

    If successful, this method returns the closed test run using the same response format as getRun.

  • copyCasesToSection(sectionID: number, parameters: { caseIDs: number[] }): Promise<void>
  • Copies the list of cases to another suite/section.

    Parameters

    • sectionID: number

      The ID of the section the test case should be copied to

    • parameters: { caseIDs: number[] }

      Filter parameters

      • caseIDs: number[]

    Returns Promise<void>

  • deleteAttachment(attachmentID: number): Promise<void>
  • Deletes the specified attachment identified by attachmentID.

    Parameters

    • attachmentID: number

      The ID of the attachment to delete

    Returns Promise<void>

  • deleteCase(caseID: number, soft?: boolean): Promise<{ results: number; tests: number }>
  • Deletes an existing test case.

    Parameters

    • caseID: number

      The ID of the test case

    • soft: boolean = false

      Set to true to return information about the data which will be deleted, but will not proceed with the deletion.

    Returns Promise<{ results: number; tests: number }>

  • deleteCases(suiteID: number, data: { case_ids: number[]; project_id: number }, soft?: boolean): Promise<{ results: number; tests: number }>
  • Deletes multiple test cases from a project or test suite.

    Parameters

    • suiteID: number

      The ID of the suite (Only required if project is in multi-suite mode)

    • data: { case_ids: number[]; project_id: number }

      An object containing case_ids and project_id

      • case_ids: number[]
      • project_id: number
    • soft: boolean = false

      Set to true to return information about the data which will be deleted, but will not proceed with the deletion.

    Returns Promise<{ results: number; tests: number }>

  • deleteConfig(configID: number): Promise<void>
  • Deletes an existing configuration – requires TestRail 5.2 or later.

    Parameters

    • configID: number

      The ID of the configuration

    Returns Promise<void>

  • deleteConfigGroup(configGroupID: number): Promise<void>
  • Deletes an existing configuration group and its configurations – requires TestRail 5.2 or later.

    Parameters

    • configGroupID: number

      The ID of the configuration group

    Returns Promise<void>

  • deleteDataset(datasetID: number): Promise<void>
  • Deletes an existing dataset.

    Parameters

    • datasetID: number

      The ID of the dataset to be deleted.

    Returns Promise<void>

  • deleteGroup(groupID: number): Promise<void>
  • Deletes an existing group

    Parameters

    • groupID: number

      The ID of the group

    Returns Promise<void>

  • deleteMilestone(milestoneID: number): Promise<void>
  • Deletes an existing milestone.

    Parameters

    • milestoneID: number

      The ID of the milestone

    Returns Promise<void>

  • deletePlan(planID: number): Promise<void>
  • Deletes an existing test plan.

    Parameters

    • planID: number

      The ID of the test plan

    Returns Promise<void>

  • deletePlanEntry(planID: number, entryID: number): Promise<void>
  • Deletes one or more existing test runs from a plan.

    Parameters

    • planID: number

      The ID of the test plan

    • entryID: number

      The ID of the test plan entry (note: not the test run ID)

    Returns Promise<void>

  • deleteProject(projectID: number): Promise<void>
  • Deletes an existing project (admin status required).

    Parameters

    • projectID: number

      The ID of the project

    Returns Promise<void>

  • deleteRun(runID: number, soft?: boolean): Promise<unknown>
  • Deletes an existing test run.

    Parameters

    • runID: number

      The ID of the test run

    • soft: boolean = false

      Set to true to return information about the data which will be deleted, but will not proceed with the deletion.

    Returns Promise<unknown>

  • deleteRunFromPlanEntry(runID: number): Promise<void>
  • Deletes a test run from a test plan entry

    Parameters

    • runID: number

      The ID of the test run

    Returns Promise<void>

  • deleteSection(sectionID: number, soft?: boolean): Promise<void>
  • Deletes an existing section.

    Parameters

    • sectionID: number

      The ID of the section

    • soft: boolean = false

      Set to true to return information about the data which will be deleted, but will not proceed with the deletion.

    Returns Promise<void>

  • deleteSharedStep(sharedStepID: number, keepInClass?: boolean): Promise<void>
  • Deletes an existing shared step entity. Requires permission to delete test cases within the project.

    Parameters

    • sharedStepID: number

      The ID of the set of shared steps

    • keepInClass: boolean = true

      Default is true. Submit false to delete the shared steps from all test cases as well as the shared step repository

    Returns Promise<void>

  • deleteSuite(suiteID: number, soft?: boolean): Promise<void>
  • The ID of the test suite

    Parameters

    • suiteID: number

      An object containing the populated fields to be updated

    • soft: boolean = false

      Set to true to return information about the data which will be deleted, but will not proceed with the deletion.

    Returns Promise<void>

  • deleteVariable(variableID: number): Promise<void>
  • Deletes an existing variable.

    Parameters

    • variableID: number

      The ID of the variable to be deleted.

    Returns Promise<void>

  • getAttachment(attachmentID: number): Promise<Attachment>
  • Retrieves the requested file identified by attachment_id.

    Parameters

    • attachmentID: number

      The ID of the test to retrieve attachments from

    Returns Promise<Attachment>

    Object containing attachment metadata

  • getAttachmentsForCase(caseID: number, parameters?: Partial<DefaultParameters>): Promise<{ attachments: Attachment[]; next: null | GetAttachmentsForCaseCursor; prev: null | GetAttachmentsForCaseCursor }>
  • Returns a list of attachments for a test case.

    Parameters

    • caseID: number

      The ID of the test case to retrieve attachments from

    • Optional parameters: Partial<DefaultParameters>

      Filter parameters

    Returns Promise<{ attachments: Attachment[]; next: null | GetAttachmentsForCaseCursor; prev: null | GetAttachmentsForCaseCursor }>

    A cursor object containing the current attachment and next and prev functions

  • getAttachmentsForPlan(planID: number, parameters?: Partial<DefaultParameters>): Promise<(Attachment & { entity_attachment_id: string; icon_name: string })[]>
  • Returns a list of attachments for a test plan.

    Parameters

    • planID: number

      The ID of the test plan to retrieve attachments from

    • Optional parameters: Partial<DefaultParameters>

      Filter parameters

    Returns Promise<(Attachment & { entity_attachment_id: string; icon_name: string })[]>

    A list of attachments

  • getAttachmentsForPlanEntry(planID: number, entryID: number, parameters?: Partial<DefaultParameters>): Promise<{ attachments: (Attachment & { entity_attachment_id: string; icon_name: string })[]; next: null | GetAttachmentsForPlanEntryCursor; prev: null | GetAttachmentsForPlanEntryCursor }>
  • Returns a list of attachments for a test plan entry.

    Parameters

    • planID: number

      The ID of the test plan containing the entry

    • entryID: number

      The ID of the test plan entry to retrieve attachments from

    • Optional parameters: Partial<DefaultParameters>

      Filter parameters

    Returns Promise<{ attachments: (Attachment & { entity_attachment_id: string; icon_name: string })[]; next: null | GetAttachmentsForPlanEntryCursor; prev: null | GetAttachmentsForPlanEntryCursor }>

    The method returns the same response format as getAttachmentsForPlan.

  • getAttachmentsForRun(runID: number, parameters?: Partial<DefaultParameters>): Promise<{ attachments: (Attachment & { entity_attachment_id: string; icon_name: string })[]; next: null | GetAttachmentsForRunCursor; prev: null | GetAttachmentsForRunCursor }>
  • Returns a list of attachments for a test run.

    Parameters

    • runID: number

      The ID of the test run to retrieve attachments from

    • Optional parameters: Partial<DefaultParameters>

      Filter parameters

    Returns Promise<{ attachments: (Attachment & { entity_attachment_id: string; icon_name: string })[]; next: null | GetAttachmentsForRunCursor; prev: null | GetAttachmentsForRunCursor }>

    A cursor object containing the current attachment and next and prev functions

  • getAttachmentsForTest(testID: number, parameters?: Partial<DefaultParameters>): Promise<{ attachments: Attachment[]; next: null | GetAttachmentsForTestCursor; prev: null | GetAttachmentsForTestCursor }>
  • Returns a list of attachments for a test’s results.

    returnsthe

    method returns the same response format as getAttachmentsForCase.

    Parameters

    • testID: number

      The ID of the test to retrieve attachments from

    • Optional parameters: Partial<DefaultParameters>

      Filter parameters

    Returns Promise<{ attachments: Attachment[]; next: null | GetAttachmentsForTestCursor; prev: null | GetAttachmentsForTestCursor }>

  • getCase(caseID: number): Promise<Case>
  • Returns an existing test case

    Parameters

    • caseID: number

      The ID of the test case

    Returns Promise<Case>

    Case

  • Returns a list of available test case custom fields.

    Returns Promise<CaseField[]>

    A list of case fields

  • getCaseStatuses(): Promise<{ case_statuses: CaseStatus[]; next: null | GetCaseStatusesCursor; prev: null | GetCaseStatusesCursor }>
  • Returns a list of available test case statuses.

    Returns Promise<{ case_statuses: CaseStatus[]; next: null | GetCaseStatusesCursor; prev: null | GetCaseStatusesCursor }>

    An object containing all test case statuses with next and prev cursor functions

  • Returns a list of available case types.

    Returns Promise<CaseType[]>

    The response includes an array of test case types. Each case type has a unique ID and a name. The field is true for the default case type and false otherwise.

  • getCases(projectID: number, parameters?: Partial<GetCasesParameters>): Promise<{ cases: Case[]; next: CasesCursor | null; prev: CasesCursor | null }>
  • Returns a list of test cases for a project or specific test suite (if the project has multiple suites enabled).

    Parameters

    • projectID: number

      The ID of the project

    • Optional parameters: Partial<GetCasesParameters>

      Filter parameters

    Returns Promise<{ cases: Case[]; next: CasesCursor | null; prev: CasesCursor | null }>

    An object containing a list of cases and next and previous cursors

  • getConfig<K>(key: K): Config[K]
  • Type Parameters

    • K extends keyof Config

    Parameters

    • key: K

    Returns Config[K]

  • Returns a list of available configurations, grouped by configuration groups.

    Parameters

    • projectID: number

      The ID of the project

    Returns Promise<TestPlanConfigGroup[]>

    An array of configuration groups

  • getDataset(datasetID: number): Promise<Dataset>
  • Retrieves the requested dataset.

    Parameters

    • datasetID: number

      The ID of the dataset to retrieve.

    Returns Promise<Dataset>

    The dataset referenced by the ID

  • getDatasets(projectID: number): Promise<{ datasets: Dataset[]; next: null | GetDatasetsCursor; prev: null | GetDatasetsCursor }>
  • Retrieves the requested list of datasets

    Parameters

    • projectID: number

      The ID of the project from which to retrieve datasets

    Returns Promise<{ datasets: Dataset[]; next: null | GetDatasetsCursor; prev: null | GetDatasetsCursor }>

    An object containing a list of datasets along with next and prev cursor functions

  • getGroup(groupID: number): Promise<Pick<Group, "id" | "name" | "user_ids">>
  • Returns an existing group.

    Parameters

    • groupID: number

      The ID of the group

    Returns Promise<Pick<Group, "id" | "name" | "user_ids">>

    The group referenced by the ID

  • getGroups(): Promise<{ groups: Group[]; next: null | GetGroupsCursor; prev: null | GetGroupsCursor }>
  • Returns the list of available groups

    Returns Promise<{ groups: Group[]; next: null | GetGroupsCursor; prev: null | GetGroupsCursor }>

    An object containing a list of the groups along with next and prev cursor functions

  • getHistoryForCase(caseID: number, parameters?: Partial<GetHistoryForCaseParameters>): Promise<{ caseHistory: CaseHistory; next: CaseHistoryCursor | null; prev: CaseHistoryCursor | null }>
  • Returns the edit history for a test case_id.

    Parameters

    • caseID: number

      The ID of the test case

    • Optional parameters: Partial<GetHistoryForCaseParameters>

      Filter parameters

    Returns Promise<{ caseHistory: CaseHistory; next: CaseHistoryCursor | null; prev: CaseHistoryCursor | null }>

  • getMilestone(milestoneID: number): Promise<Milestone>
  • Returns an existing milestone.

    Parameters

    • milestoneID: number

      The ID of the milestone

    Returns Promise<Milestone>

    The milestone referenced by the ID

  • getMilestones(projectID: number, parameters?: Partial<GetMilestonesParameters>): Promise<{ milestones: Milestone[]; next: null | GetMilestonesCursor; prev: null | GetMilestonesCursor }>
  • Returns the list of milestones for a project.

    Parameters

    • projectID: number

      The ID of the project

    • Optional parameters: Partial<GetMilestonesParameters>

      Filter parameters

    Returns Promise<{ milestones: Milestone[]; next: null | GetMilestonesCursor; prev: null | GetMilestonesCursor }>

    An object containing a list of milestones along with next and prev cursor functions

  • getPlan(planID: number): Promise<Plan>
  • Returns an existing test plan.

    Parameters

    • planID: number

      The ID of the test plan

    Returns Promise<Plan>

    The test plan if found, if not throws an error

  • getPlans(projectID: number, parameters?: Partial<GetPlansParameters>): Promise<{ next: null | GetPlansCursor; plans: Plan[]; prev: null | GetPlansCursor }>
  • Returns a list of test plans for a project.

    Parameters

    • projectID: number

      The ID of the project

    • Optional parameters: Partial<GetPlansParameters>

      Filter parameters

    Returns Promise<{ next: null | GetPlansCursor; plans: Plan[]; prev: null | GetPlansCursor }>

    The response includes an array of test plans. Each test plan in this list follows the same format as getPlan, except for the entries field which is not included in the response.

  • Returns a list of available test case priorities.

    Returns Promise<Priority[]>

    The response include an array of priorities. Each priority has a unique ID, a name, and a short version of the name. The priority field determines the order of the priorities. The is_default field is true for the default priority and false otherwise.

  • getProject(projectID: number): Promise<Project>
  • Returns an existing project.

    Parameters

    • projectID: number

      The ID of the project

    Returns Promise<Project>

    The project if found, throws an error if not

  • getProjects(parameters?: Partial<GetProjectsParameters>): Promise<{ next: null | GetProjectsCursor; prev: null | GetProjectsCursor; projects: Project[] }>
  • Returns the list of available projects.

    Parameters

    • Optional parameters: Partial<GetProjectsParameters>

      Filter parameters

    Returns Promise<{ next: null | GetProjectsCursor; prev: null | GetProjectsCursor; projects: Project[] }>

    The response includes an array of projects. Each project in this list follows the same format as getProject.

  • getReports(projectID: number): Promise<Report[]>
  • Returns a list of API available reports by the project.

    Parameters

    • projectID: number

      The ID of the project for which you want a list of API accessible reports

    Returns Promise<Report[]>

    A list of reports owned by the project referenced by the ID

  • Returns a list of available test result custom fields.

    Returns Promise<ResultField>

    An array of custom field definitions

  • getResults(testID: number, parameters?: Partial<GetResultsParameters>): ReturnType<GetResultsCursor>
  • Returns a list of test results for a test.

    Parameters

    • testID: number

      The ID of the test

    • Optional parameters: Partial<GetResultsParameters>

      Filter parameters

    Returns ReturnType<GetResultsCursor>

    An object containing all the test results along with next and prev cursor functions

  • getResultsForCase(runID: number, caseID: number, parameters?: Partial<GetResultsParameters>): ReturnType<GetResultsForCaseCursor>
  • Returns a list of test results for a test run and case combination.

    Parameters

    • runID: number

      The ID of the test run

    • caseID: number

      The ID of the test case

    • Optional parameters: Partial<GetResultsParameters>

      Filter parameters

    Returns ReturnType<GetResultsForCaseCursor>

    This method uses the same response format as getResults.

  • getResultsForRun(runID: number, parameters?: Partial<GetResultsForRunParameters>): ReturnType<GetResultsForRunCursor>
  • Returns a list of test results for a test run.

    Parameters

    • runID: number

      The ID of the test run

    • Optional parameters: Partial<GetResultsForRunParameters>

      Filter parameters

    Returns ReturnType<GetResultsForRunCursor>

    This method uses the same response format as getResults.

  • getRoles(parameters?: Partial<DefaultParameters>): Promise<{ next: null | GetRolesCursor; prev: null | GetRolesCursor; roles: Role[] }>
  • Returns a list of available roles

    Parameters

    • Optional parameters: Partial<DefaultParameters>

      Filter parameters

    Returns Promise<{ next: null | GetRolesCursor; prev: null | GetRolesCursor; roles: Role[] }>

    An object containing a list of roles along with next and prev cursor functions

  • getRun(runID: number): Promise<Run>
  • Returns an existing test run. Please see getTests for the list of included tests in this run.

    Parameters

    • runID: number

      The ID of the test run

    Returns Promise<Run>

    Object containing system fields

  • getRuns(projectID: number, parameters?: Partial<GetRunsParameters>): Promise<{ next: null | GetRunsCursor; prev: null | GetRunsCursor; runs: Run[] }>
  • Returns a list of test runs for a project. Only returns those test runs that are not part of a test plan (please see getPlans/getPlan for this).

    Parameters

    • projectID: number

      The ID of the project

    • Optional parameters: Partial<GetRunsParameters>

      Filter parameters

    Returns Promise<{ next: null | GetRunsCursor; prev: null | GetRunsCursor; runs: Run[] }>

    The response includes an array of test runs. Each test run in ‘runs’ array follows the same format as getRun.

  • getSection(sectionID: number): Promise<Section>
  • Returns an existing section.

    Parameters

    • sectionID: number

      The ID of the section

    Returns Promise<Section>

    The section referenced by the ID

  • getSections(projectID: number, parameters: Partial<GetSectionsParameters>): Promise<{ next: null | GetSectionsCursor; prev: null | GetSectionsCursor; sections: Section[] }>
  • Returns a list of sections for a project and test suite.

    Parameters

    • projectID: number

      The ID of the project

    • parameters: Partial<GetSectionsParameters>

      Filter parameters

    Returns Promise<{ next: null | GetSectionsCursor; prev: null | GetSectionsCursor; sections: Section[] }>

    An object containing a list of sections along with next and prev cursor functions

  • getSharedStep(sharedStepID: number): Promise<SharedStep>
  • Returns an existing set of shared steps.

    Parameters

    • sharedStepID: number

      The ID of the set of shared steps

    Returns Promise<SharedStep>

    An object containing custom shared steps

  • getSharedStepHistory(sharedStepID: number): Promise<{ next: null | GetSharedStepHistoryCursor; prev: null | GetSharedStepHistoryCursor; step_history: SharedStep[] }>
  • Returns an existing set of shared steps.

    Parameters

    • sharedStepID: number

      The ID of the set of shared steps

    Returns Promise<{ next: null | GetSharedStepHistoryCursor; prev: null | GetSharedStepHistoryCursor; step_history: SharedStep[] }>

    The change history of the steps

  • getSharedSteps(projectID: number, parameters?: Partial<GetSharedStepsParameters>): Promise<{ next: null | GetSharedStepsCursor; prev: null | GetSharedStepsCursor; shared_steps: SharedStep[] }>
  • Returns a list of shared steps for a project.

    Parameters

    • projectID: number

      The ID of the project

    • Optional parameters: Partial<GetSharedStepsParameters>

      Filter parameters

    Returns Promise<{ next: null | GetSharedStepsCursor; prev: null | GetSharedStepsCursor; shared_steps: SharedStep[] }>

    The response includes an array of shared test steps. Each entry in the array follows the same format as getSharedStep.

  • getStatuses(): Promise<Status[]>
  • Returns a list of available test statuses.

    Returns Promise<Status[]>

    Returns a list of all system and custom formats

  • getSuite(suiteID: number): Promise<Suite>
  • Returns an existing test suite.

    Parameters

    • suiteID: number

      The ID of the test suite

    Returns Promise<Suite>

    The suite referenced by the ID

  • getSuites(projectID: number): Promise<Suite[]>
  • Returns a list of test suites for a project.

    Parameters

    • projectID: number

      The ID of the project

    Returns Promise<Suite[]>

    The response includes an array of test suites. Each test suite in this list follows the same format as getSuite.

  • getTemplates(projectID: number): Promise<Template[]>
  • Returns a list of available templates for a project_id.

    Parameters

    • projectID: number

      The ID of the project

    Returns Promise<Template[]>

    The response includes an array of templates (field layouts). Each template has a unique ID and a name. The is_default field is true for the default template and false otherwise.

  • getTest(testID: number, withData?: string): Promise<Test>
  • Returns an existing test.

    Parameters

    • testID: number

      The ID of the test

    • Optional withData: string

      The parameter to get data

    Returns Promise<Test>

    Object containing system fields

  • getTests(runID: number, parameters?: Partial<GetTestsParameters>): Promise<{ next: null | GetTestsCursor; prev: null | GetTestsCursor; tests: Test[] }>
  • Returns a list of tests for a test run

    Parameters

    • runID: number

      The ID of the test run

    • Optional parameters: Partial<GetTestsParameters>

      Filter parameters

    Returns Promise<{ next: null | GetTestsCursor; prev: null | GetTestsCursor; tests: Test[] }>

    The response includes an array of tests. Each test in this list follows the same format as getTest.

  • getVariables(projectID: number, parameters?: Partial<DefaultParameters>): Promise<{ next: null | GetVariablesCursor; prev: null | GetVariablesCursor; variables: Variable[] }>
  • Retrieves the requested variables.

    Parameters

    • projectID: number

      The ID of the project from which to retrieve variables.

    • Optional parameters: Partial<DefaultParameters>

      Filter parameters

    Returns Promise<{ next: null | GetVariablesCursor; prev: null | GetVariablesCursor; variables: Variable[] }>

    An object containing a list of variables along with next and prev cursor functions

  • moveCasesToSection(sectionID: number, data: { case_ids: number[]; suite_id: number }): Promise<void>
  • Moves cases to another suite or section.

    Parameters

    • sectionID: number

      The ID of the section the case will be moved to.

    • data: { case_ids: number[]; suite_id: number }

      Supported system fields

      • case_ids: number[]
      • suite_id: number

    Returns Promise<void>

  • moveSection(sectionID: number, data: Pick<Section, "parent_id"> & { after_id: number }): Promise<void>
  • Moves a section to another suite or section.

    Parameters

    • sectionID: number

      The ID of the section

    • data: Pick<Section, "parent_id"> & { after_id: number }

      Object containing parent_id and after_id of a section to insert this section after

    Returns Promise<void>

  • Executes the report identified using the report_id parameter and returns URL‘s for accessing the report in HTML and PDF format.

    Parameters

    • reportTemplateID: number

      The ID of the run template

    Returns Promise<ReportRunResult>

    An object containing URIs for the generated reports

  • setConfig<K>(key: K, value: Config[K]): void
  • Type Parameters

    • K extends keyof Config

    Parameters

    • key: K
    • value: Config[K]

    Returns void

  • updateCase(caseID: number, data: Partial<Case>): Promise<unknown>
  • Updates an existing test case (partial updates are supported, i.e. you can submit and update specific fields only).

    Parameters

    • caseID: number

      The ID of the test case

    • data: Partial<Case>

      An object with the populated fields to be updated

    Returns Promise<unknown>

    If successful, this method returns the new test case using the same response format as getCase.

  • updateCases(suiteID: number, data: Partial<Case> & { case_ids: number[] }): Promise<{ updated_cases: Case[] }>
  • Updates multiple test cases with the same values, like setting a set of test cases to “High” priority. This does not support updating multiple test cases with different values per test case.

    Parameters

    • suiteID: number

      The ID of the test suite (optional if the project is operating in single suite mode)

    • data: Partial<Case> & { case_ids: number[] }

      An object with the populated fields to be updated

    Returns Promise<{ updated_cases: Case[] }>

    If successful, this method returns the new test case using the same response format as getCase.

  • updateConfig(configID: number, data: Partial<Pick<TestPlanConfigGroup, "id" | "name"> & { group_id: number }>): Promise<void>
  • Updates an existing configuration- requires TestRail 5.2 or later.

    Parameters

    • configID: number

      The ID of the configuration

    • data: Partial<Pick<TestPlanConfigGroup, "id" | "name"> & { group_id: number }>

      An object containing the populated fields to be updated

    Returns Promise<void>

  • Updates an existing configuration group – requires TestRail 5.2 or later.

    Parameters

    • configGroupID: number

      The ID of the configuration group

    • data: Partial<TestPlanConfigGroup>

      An object containing the populated fields to be updated

    Returns Promise<void>

  • updateDataset(datasetID: number, data: Partial<Dataset>): Promise<Dataset>
  • Updates an existing dataset.

    Parameters

    • datasetID: number

      The ID of the project to which the dataset should be updated.

    • data: Partial<Dataset>

      If successful, this method returns the new dataset using the same response format as addDataset.

    Returns Promise<Dataset>

  • updateGroup(groupID: number, data: Partial<Group>): Promise<Group>
  • Updates an existing group

    Parameters

    • groupID: number

      The ID of the group

    • data: Partial<Group>

      An object with the populated fields to be updated

    Returns Promise<Group>

    If successful, this method returns the new group using the same response format as getGroup.

  • updateMilestone(milestoneID: number, data: Partial<Pick<Milestone, "is_completed" | "is_started" | "parent_id" | "start_on">>): Promise<Milestone>
  • Updates an existing milestone (partial updates are supported, i.e. you can submit and update specific fields only).

    Parameters

    • milestoneID: number

      The ID of the milestone

    • data: Partial<Pick<Milestone, "is_completed" | "is_started" | "parent_id" | "start_on">>

      An object containing the populated fields to be updated

    Returns Promise<Milestone>

    If successful, this method returns the updated milestone using the same response format as getMilestone.

  • updatePlan(planID: number, data: Partial<Plan>): Promise<Plan>
  • Updates an existing test plan (partial updates are supported, i.e. you can submit and update specific fields only).

    Parameters

    • planID: number

      The ID of the test plan

    • data: Partial<Plan>

      Object containing the populated fields to be updated

    Returns Promise<Plan>

    If successful, this method returns the updated test plan using the same response format as getPlan.

  • updatePlanEntry(planID: number, entryID: number, data: Pick<Run, "name" | "refs" | "assignedto_id" | "description" | "include_all"> & { case_id: number }): Promise<Plan>
  • Updates one or more groups of test runs in a plan (partial updates are supported, i.e. you can submit and update specific fields only).

    Parameters

    • planID: number

      The ID of the test plan

    • entryID: number

      The ID of the test plan entry

    • data: Pick<Run, "name" | "refs" | "assignedto_id" | "description" | "include_all"> & { case_id: number }

      Object containing the populated fields to be updated

    Returns Promise<Plan>

    If successful, this method returns the updated test plan entry including test runs using the same response format as the entries field of getPlan, but for a single entry instead of a list of entries.

  • updateProject(projectID: number, data: Partial<Project>): Promise<Project>
  • Updates an existing project (admin status required; partial updates are supported, i.e. you can submit and update specific fields only).

    Parameters

    • projectID: number

      The ID of the project

    • data: Partial<Project>

      Object containing the populated fields to be updated

    Returns Promise<Project>

    The updated project

  • updateRun(runID: number, data: Partial<Run>): Promise<Run>
  • Updates an existing test run (partial updates are supported, i.e. you can submit and update specific fields only).

    Parameters

    • runID: number

      The ID of the test run

    • data: Partial<Run>

      Object containing populated fields to be updated

    Returns Promise<Run>

    If successful, this method returns the updated test run using the same response format as getRun.

  • updateRunInPlanEntry(runID: number, data: Pick<Run, "refs" | "assignedto_id" | "description" | "include_all"> & { case_ids: number[] }): Promise<void>
  • Updates a run inside a plan entry which uses configurations

    Parameters

    • runID: number

      The ID of the test run

    • data: Pick<Run, "refs" | "assignedto_id" | "description" | "include_all"> & { case_ids: number[] }

      Object containing the populated fields to be updated

    Returns Promise<void>

  • updateSection(sectionID: number, data: Partial<Pick<Section, "name" | "description">>): Promise<Section>
  • Updates an existing section (partial updates are supported, i.e. you can submit and update specific fields only).

    Parameters

    • sectionID: number

      The ID of the section

    • data: Partial<Pick<Section, "name" | "description">>

      An object containing the populated fields to be updated

    Returns Promise<Section>

    If successful, this method returns the updated section using the same response format as getSection.

  • updateSharedStep(sharedStepID: number, data: Partial<Pick<SharedStep, "limit" | "offset" | "created_by" | "refs" | "updated_after" | "updated_before" | "custom_steps_separated">> & Pick<SharedStep, "title">): Promise<SharedStep>
  • Updates an existing set of shared steps (partial updates are supported, i.e. you can submit and update specific fields only). Requires permission to edit test cases within the project.

    Parameters

    • sharedStepID: number

      The ID of the set of shared steps

    • data: Partial<Pick<SharedStep, "limit" | "offset" | "created_by" | "refs" | "updated_after" | "updated_before" | "custom_steps_separated">> & Pick<SharedStep, "title">

      An object containing the populated fields to be updated

    Returns Promise<SharedStep>

    If successful, this method returns the updated shared steps using the same response format as getSharedStep.

  • updateSuite(suiteID: number, data: Partial<Suite>): Promise<AxiosResponse<Suite, any>>
  • Updates an existing test suite (partial updates are supported, i.e. you can submit and update specific fields only).

    Parameters

    • suiteID: number

      The ID of the test suite

    • data: Partial<Suite>

    Returns Promise<AxiosResponse<Suite, any>>

    If successful, this method returns the updated test suite using the same response format as getSuite.

  • Updates an existing variable.

    Parameters

    • variableID: number

      The ID of the variable to update.

    • data: Partial<Variable>

      An object containing the populated fields to be updated

    Returns Promise<Variable>

    If successful, this method returns the new dataset using the same response format as addVariable.

Generated using TypeDoc