diff --git a/src/pages/docs/api/examples/update-test-case-results-using-API.md b/src/pages/docs/api/examples/update-test-case-results-using-API.md index b6287162..6abc7ee5 100644 --- a/src/pages/docs/api/examples/update-test-case-results-using-API.md +++ b/src/pages/docs/api/examples/update-test-case-results-using-API.md @@ -6,34 +6,32 @@ noindex: false order: 21.65 page_id: "Update Test Case results using API" warning: false -contextual_links: -- type: section - name: "Contents" -- type: link - name: "Update Test Case results using REST API" - url: "#update-test-case-results-using-rest-api" --- -
+--- In Testsigma, you can update the Test Case Results using API. This article discusses how to update Test Case results as Passed, Failed, and Not Executed using REST API. + This endpoint allows users to update the Test Case result using REST API. + |**Request Type**|**PUT**| |---|---| -|**Endpoint**|https://app.testsigma.com/api/v1/executions/results/<run_id>/override
The <run_id> can be obtained from the Run Results.| +|**Endpoint**|https://app.testsigma.com/api/v1/execution_results/<run_id>/override
The <run_id> can be obtained from the Run Results.| |**Authorization**|Bearer ****
Same as the Testsigma API key mentioned above.| |**Request Body Type (JSON)**|Raw| |**Request Body**|[
{
"testCaseResultId": 3646,
"comment": "Modifying the results 1",
"result": "SUCCESS"
}
]
| |**Response Body(JSON)**|{
"errors": [],
"message": "Overridden the results successfully"
}| -**Request fields**
+ +### **Request fields** **testCaseResultId:** ID of Test Case result.
**comment:** Comment you want to add to change the result.
**result:** The result you want to override the current result.
-**Response fields**
+ +### **Response fields** **errors:** Errors in request fields if there are any.
**message:** Message of overridden results.
@@ -47,3 +45,4 @@ This endpoint allows users to update the Test Case result using REST API. +--- \ No newline at end of file diff --git a/src/pages/docs/api/overview.md b/src/pages/docs/api/overview.md index f3aa1b0e..bd224fd9 100644 --- a/src/pages/docs/api/overview.md +++ b/src/pages/docs/api/overview.md @@ -11,6 +11,9 @@ contextual_links: - type: link name: "Authorization" url: "#authorization" +- type: link + name: "Get IDs of Projects, Applications and Uploads" + url: "#get-ids-of-projects-applications-and-uploads" - type: link name: "Available REST API Endpoints" url: "#available-rest-api-endpoints" @@ -23,18 +26,100 @@ contextual_links: Testsigma has a set of REST API Endpoints to manage the entities available in Testsigma. The most common usage of these endpoints is within your CI/CD Pipeline. -A fair understanding of REST APIs is expected. If not, please refer to some relevant resources regarding REST API or consult with your Dev team before proceeding further. +A fair understanding of REST APIs is expected. If not, please refer to some relevant resources regarding REST API or consult with your dev team before proceeding further. --- -##**Authorization** + +## **Authorization** + All Testsigma API Endpoints require authentication. The user authenticates the request using Bearer Token which is the user’s API Key. -**“Authentication” : “Bearer ”** +**“Authentication” : “Bearer ”** + +To know more about generating and obtaining API Keys, see [how to generate API keys](https://testsigma.com/docs/configuration/api-keys/) -To know more about generating and obtaining API Keys, see [How to generate API Keys](https://testsigma.com/docs/configuration/api-keys/) --- -##**Available REST API Endpoints** + +## **Get IDs of Projects, Applications and Uploads** + + +Testsigma has a set of endpoints to retrieve IDs of projects, applications, and uploads using APIs. This article discusses getting these IDs by using APIs. + + +### **Get IDs using Postman API** + +1. From **My Workspace**, go to **APIs** and click on ‘**+**’ to open a new request. +![APIs](https://s3.amazonaws.com/static-docs.testsigma.com/new_images/projects/applications/pmapis.png) + + +2. From the new request page, select **GET** from the method dropdown. +![GET Method](https://s3.amazonaws.com/static-docs.testsigma.com/new_images/projects/applications/pmgetmethod.png) + + +3. On the **URL Textbox**, +![URL Textbox](https://s3.amazonaws.com/static-docs.testsigma.com/new_images/projects/applications/pmurltb.png) + - Enter https://app.testsigma.com/api/v1/projects to get project IDs. + - Enter https://app.testsigma.com/api/v1/applications to get application IDs. + - Enter https://app.testsigma.com/api/v1/uploads to get upload IDs. + + +Let’s use the first URL & retrieve the IDs of projects. + + +4. Click on **Authorization**, select **Authorization type** and enter the **Token**. +![Authorization](https://s3.amazonaws.com/static-docs.testsigma.com/new_images/projects/applications/pmauthapi.png) + +5. Click on **Send** to retrieve details of all projects. +![Send](https://s3.amazonaws.com/static-docs.testsigma.com/new_images/projects/applications/pmrbsend.png) + +6. You’ll find IDs of all projects in the response body. +![IDs](https://s3.amazonaws.com/static-docs.testsigma.com/new_images/projects/applications/pmidfrb.png) + +Follow the same steps from 4-6 with the other URLs mentioned in step 3 to get details of applications and uploads. + +Here’s a quick GIF demonstrating how to retrieve IDs of projects, applications, and uploads using APIs in Postman. +![Workflow to retrive URL](https://s3.amazonaws.com/static-docs.testsigma.com/new_images/projects/applications/getidspostman.gif) + + +### **Get IDs using Testsigma API** + +1. Create a **Test Case** by navigating to **Create Tests > Test Cases**. +![Test Case](https://s3.amazonaws.com/static-docs.testsigma.com/new_images/projects/applications/tsapitc.png) + + +2. Add a **REST API Step**. +![REST API Test Step](https://s3.amazonaws.com/static-docs.testsigma.com/new_images/projects/applications/tsrestspiteststep.png) + + +3. On the **REST API** page, select **GET** from the method dropdown. +![GET Method](https://s3.amazonaws.com/static-docs.testsigma.com/new_images/projects/applications/tsgetmthod.png) + +4. On the **URL Textbox**, +![URL Textbox](https://s3.amazonaws.com/static-docs.testsigma.com/new_images/projects/applications/tsurltb.png) + - Enter https://app.testsigma.com/api/v1/projects to get project IDs. + - Enter https://app.testsigma.com/api/v1/applications to get application IDs. + - Enter https://app.testsigma.com/api/v1/uploads to get upload IDs. + +Let’s use the second URL & retrieve the IDs of applications. + + +5. Click on **Authorization**, select **Authorization type** and enter the **Token**. +![Authorization](https://s3.amazonaws.com/static-docs.testsigma.com/new_images/projects/applications/tsapiauth.png) + + +6. Click on **Send** to retrieve details of all applications. +![Send](https://s3.amazonaws.com/static-docs.testsigma.com/new_images/projects/applications/tssendapi.png) + +7. You’ll find IDs of all applications in the response body. + + +Here’s a quick GIF demonstrating how to retrieve IDs of projects, applications, and uploads using APIs in Testsigma. +![Workflow](https://s3.amazonaws.com/static-docs.testsigma.com/new_images/projects/applications/getidtestsigma.gif) + +--- + +## **Available REST API Endpoints** 1. [Environments](https://testsigma.com/docs/api/environments/) 2. [Elements](https://testsigma.com/docs/api/elements/) @@ -42,10 +127,13 @@ To know more about generating and obtaining API Keys, see [How to generate API K 4. [Uploads](https://testsigma.com/docs/api/upload-files/) --- -##**Advanced Use Cases** -Here are some advanced use cases for Testsigma APIs -[Trigger Multiple Application Type Test Plans](https://testsigma.com/docs/api/examples/trigger-multiple-test-plans/) +## **Advanced Use Cases** + +Here are some advanced use cases for Testsigma APIs: + +- [Trigger Multiple Application Type Test Plans](https://testsigma.com/docs/api/examples/trigger-multiple-test-plans/) -[Trigger Test Plan remotely and wait until Completion](https://testsigma.com/docs/api/examples/trigger-test-plan-wait-completion/) +- [Trigger Test Plan remotely and wait until Completion](https://testsigma.com/docs/api/examples/trigger-test-plan-wait-completion/) +--- \ No newline at end of file