Skip to main content

Shared Steps

The shared steps endpoints allow you to manage reusable test steps that can be referenced across multiple test cases. Shared steps consist of a title and a list of sub-steps, each with a description and expected result.

About Shared Steps

Shared steps are reusable test step templates that can be used in multiple test cases. They consist of:

  1. Title: A descriptive name for the shared step (1-255 characters)
  2. Sub-steps: A list of individual steps, each with:
    • Description: What action to perform (HTML content)
    • Expected: The expected result (HTML content)

When a shared step is used in a test case, all its sub-steps are included. Updates to a shared step automatically propagate to all test cases that reference it.

important
  • Shared steps must have at least one sub-step
  • Each sub-step must have at least a description or expected result (or both)
  • The title of a shared step must be unique within a project
  • Shared steps are versioned - updates create new versions while preserving old ones
  • Deleted sub-steps are marked with a deletedAt timestamp but are not deleted because they may still be referenced by some test case versions

List Shared Steps

GET/api/public/v0/project/{project_id}/shared-step

Retrieves all non deleted shared steps within a project, optionally sorted and with additional fields included.

Path Parameters

  • project_id: The project identifier (can be either the project code or UUID)

Query Parameters

All query parameters are optional.

ParameterTypeDescriptionAllowed ValuesExample
sortFieldstringField to sort bycreated_at, titlesortField=title
sortOrderstringSort order (requires sortField; default: desc)asc, descsortOrder=asc
includestringInclude additional fields in the response which are omitted by defaulttcaseCountinclude=tcaseCount
tip
  • Use include=tcaseCount to see how many test cases reference each shared step
  • Sorting by created_at shows the most recently created steps first (with desc) or oldest first (with asc)
  • Sorting by title provides alphabetical ordering

Example Request

Fetch all shared steps

curl \
-H "Authorization: ApiKey your.api.key.here" \
https://your-company.your-region-code.qasphere.com/api/public/v0/project/BD/shared-step

Fetch all shared steps sorted by title in ascending order

curl \
-H "Authorization: ApiKey your.api.key.here" \
https://your-company.your-region-code.qasphere.com/api/public/v0/project/BD/shared-step?sortField=title&sortOrder=asc

Fetch all shared steps with test case count included

curl \
-H "Authorization: ApiKey your.api.key.here" \
https://your-company.your-region-code.qasphere.com/api/public/v0/project/BD/shared-step?include=tcaseCount

Response Fields

{
sharedSteps: Array<{ // List of shared step objects
id: number // Unique identifier of the shared step
version: number // Version of the shared step
type: string // Type of the step (always "shared" for shared steps)
title: string // Title of the shared step
isLatest: boolean // Whether this is the latest version of the step
subSteps: Array<{ // List of sub-steps
id: number // Unique identifier of the sub-step
type: string // Type of the step (always "shared_sub_step")
version: number // Version of the step (same as parent step)
isLatest: boolean // Whether this is the latest version (same as parent step)
description: html // Details of the sub-step
expected: html // Expected result from the sub-step
deletedAt?: string // Date the sub-step was deleted on (ISO 8601 format)
}>
deletedAt?: string // Date the shared step was deleted on (ISO 8601 format)
tcaseCount?: number // Number of test cases using this shared step (only included if requested)
}>
}

Example Response

{
"sharedSteps": [
{
"id": 1,
"version": 3,
"type": "shared",
"title": "User login validation",
"isLatest": true,
"subSteps": [
{
"id": 2,
"type": "shared_sub_step",
"version": 3,
"isLatest": true,
"description": "<p>Navigate to the login page</p>",
"expected": "<p>Login form is displayed</p>"
},
{
"id": 3,
"type": "shared_sub_step",
"version": 3,
"isLatest": true,
"description": "<p>Enter valid username and password</p>",
"expected": "<p>Credentials are accepted</p>"
},
{
"id": 4,
"type": "shared_sub_step",
"version": 3,
"isLatest": true,
"description": "<p>Click the login button</p>",
"expected": "<p>User is redirected to the dashboard</p>"
}
]
},
{
"id": 5,
"version": 1,
"type": "shared",
"title": "Form submission validation",
"isLatest": true,
"subSteps": [
{
"id": 6,
"type": "shared_sub_step",
"version": 1,
"isLatest": true,
"description": "<p>Fill in all required fields</p>",
"expected": "<p>All fields are populated correctly</p>"
},
{
"id": 7,
"type": "shared_sub_step",
"version": 1,
"isLatest": true,
"description": "<p>Submit the form</p>",
"expected": "<p>Form is submitted successfully</p>"
}
],
"tcaseCount": 12
}
]
}

Get Shared Step

GET/api/public/v0/project/{project_id}/shared-step/{step_id}

Get details of a single shared step using its ID.

Path Parameters

  • project_id: The project identifier (can be either the project code or UUID)
  • step_id: The shared step identifier (numeric ID)

Example Request

curl \
-H "Authorization: ApiKey your.api.key.here" \
https://your-company.your-region-code.qasphere.com/api/public/v0/project/BD/shared-step/1

Response Fields

{
id: number // Unique identifier of the shared step
version: number // Version of the shared step
type: string // Type of the step (always "shared" for shared steps)
title: string // Title of the shared step
isLatest: boolean // Whether this is the latest version of the step
subSteps: Array<{ // List of sub-steps
id: number // Unique identifier of the sub-step
type: string // Type of the step (always "shared_sub_step")
version: number // Version of the step (same as parent step)
description: html // Details of the sub-step
expected: html // Expected result from the sub-step
deletedAt?: string // Date the sub-step was deleted on (ISO 8601 format)
}>
isLatest: boolean // Whether this is the latest version (same as parent step)
deletedAt?: string // Date the shared step was deleted on (ISO 8601 format)
}

Example Response

{
"id": 1,
"version": 3,
"type": "shared",
"title": "User login validation",
"isLatest": true,
"subSteps": [
{
"id": 2,
"type": "shared_sub_step",
"version": 3,
"isLatest": true,
"description": "<p>Navigate to the login page</p>",
"expected": "<p>Login form is displayed</p>"
},
{
"id": 3,
"type": "shared_sub_step",
"version": 3,
"isLatest": true,
"description": "<p>Enter valid username and password</p>",
"expected": "<p>Credentials are accepted</p>"
},
{
"id": 4,
"type": "shared_sub_step",
"version": 3,
"isLatest": true,
"description": "<p>Click the login button</p>",
"expected": "<p>User is redirected to the dashboard</p>"
}
]
}