diff --git a/assets/images/kane-ai/knowledge-base/api-testing/image1.jpg b/assets/images/kane-ai/knowledge-base/api-testing/image1.jpg new file mode 100644 index 000000000..64bef08bd Binary files /dev/null and b/assets/images/kane-ai/knowledge-base/api-testing/image1.jpg differ diff --git a/assets/images/kane-ai/knowledge-base/api-testing/image10.jpg b/assets/images/kane-ai/knowledge-base/api-testing/image10.jpg new file mode 100644 index 000000000..065c0c855 Binary files /dev/null and b/assets/images/kane-ai/knowledge-base/api-testing/image10.jpg differ diff --git a/assets/images/kane-ai/knowledge-base/api-testing/image2.jpg b/assets/images/kane-ai/knowledge-base/api-testing/image2.jpg new file mode 100644 index 000000000..4d9b244cc Binary files /dev/null and b/assets/images/kane-ai/knowledge-base/api-testing/image2.jpg differ diff --git a/assets/images/kane-ai/knowledge-base/api-testing/image3.jpg b/assets/images/kane-ai/knowledge-base/api-testing/image3.jpg new file mode 100644 index 000000000..24dbe5bda Binary files /dev/null and b/assets/images/kane-ai/knowledge-base/api-testing/image3.jpg differ diff --git a/assets/images/kane-ai/knowledge-base/api-testing/image6.jpg b/assets/images/kane-ai/knowledge-base/api-testing/image6.jpg new file mode 100644 index 000000000..828aa7abf Binary files /dev/null and b/assets/images/kane-ai/knowledge-base/api-testing/image6.jpg differ diff --git a/assets/images/kane-ai/knowledge-base/api-testing/image8.jpg b/assets/images/kane-ai/knowledge-base/api-testing/image8.jpg new file mode 100644 index 000000000..affcd3ac4 Binary files /dev/null and b/assets/images/kane-ai/knowledge-base/api-testing/image8.jpg differ diff --git a/assets/images/kane-ai/knowledge-base/api-testing/image9.jpg b/assets/images/kane-ai/knowledge-base/api-testing/image9.jpg new file mode 100644 index 000000000..aaf7f04bf Binary files /dev/null and b/assets/images/kane-ai/knowledge-base/api-testing/image9.jpg differ diff --git a/docs/app-auto-network-throttling.md b/docs/app-auto-network-throttling.md index 79c95ca76..611422776 100644 --- a/docs/app-auto-network-throttling.md +++ b/docs/app-auto-network-throttling.md @@ -143,7 +143,7 @@ To utilize the **networkProfile** capability, ensure that you include `network: driver.execute_script("updateNetworkProfile=offline") ``` -- For both iOS and android devicess you can use the offline/online mode API as well within the running test session: +- For both iOS and android devices you can use the offline/online mode API as well within the running test session: ```bash curl --location 'https://mobile-api.lambdatest.com/mobile-automation/api/v1/sessions//update_network' \ diff --git a/docs/kane-ai-api-testing.md b/docs/kane-ai-api-testing.md new file mode 100644 index 000000000..bf0fed23f --- /dev/null +++ b/docs/kane-ai-api-testing.md @@ -0,0 +1,112 @@ +--- +id: kane-ai-api-testing +title: KaneAI - API Testing +hide_title: false +sidebar_label: API Testing +description: Learn how to test api via kane ai +keywords: + - lambdatest automation + - lambdatest kaneai + - kaneai scroll elements + - kaneai sidebar scroll +url: https://www.lambdatest.com/support/docs/kane-ai-api-testing/ +site_name: LambdaTest +slug: kane-ai-api-testing/ +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; +import CodeBlock from '@theme/CodeBlock'; +import {YOUR_LAMBDATEST_USERNAME, YOUR_LAMBDATEST_ACCESS_KEY} from "@site/src/component/keys"; + + +This document provides a detailed guide to performing API testing using KaneAI. The API testing feature allows for comprehensive backend testing, complementing existing UI testing capabilities. Follow the instructions below to execute API tests using the PetStore API as an example. + +## 1. Adding an API in a Web Test + +To start API testing on KaneAI, create a web test using the PetStore API, a commonly available sample. This will allow you to demonstrate API testing capabilities effectively. + +- **Step**: Add an API through the slash command and navigate to the API module. + + kenai-jira integration + + +## 2. Adding a Curl Command + +Within the API module, you can input the curl command to configure the API settings automatically. + +- **Step**: Paste your curl command into the designated area. KaneAI will populate all necessary details. You may choose to validate the API response or add it directly to the test steps. + + kenai-jira integration + + +## 3. Validating API Response on KaneAI + +To ensure the API works as expected, use the validation feature. This step confirms that the API responds correctly and can be added to test steps. + +- **Step**: Click the 'validate' option to check the API response. A 200 response status indicates successful validation, automatically adding the API to your test steps. You can now proceed to submit multiple APIs simultaneously if needed. + + kenai-jira integration + + +## 4. Adding Non-Success APIs in Test Steps + +For APIs that do not return a 200 status, you can review the response body and manually add them to the test steps as required. + +- **Step**: If the API returns a 400 Bad Request or another error, it will not be added automatically. Review the response and add the API manually if needed. + + kenai-jira integration + + +## 5. Adding Multiple APIs in One Go + +KaneAI allows batch processing of multiple APIs to streamline testing. This feature is helpful for scenarios requiring the execution of several API calls in succession. + +- **Step**: Add multiple APIs by clicking the plus icon and selecting each API, or paste multiple curl commands to add them automatically to the test steps. + + kenai-jira integration + + +## 6. Handling Different HTTP Methods + +KaneAI supports various HTTP methods like POST, PUT, GET, and DELETE, allowing you to test diverse API interactions. + +- **Step**: Add APIs using different HTTP methods, such as a PUT or DELETE command. Validate each API as before, and if successful, they will be automatically included in the test steps. + + + kenai-jira integration + + kenai-jira integration + +## 7. Executing and Reviewing Test Steps + +Once all APIs are added, KaneAI enables simultaneous execution, with details available on methods used, response statuses, and execution times. + +- **Step**: Click to execute all added APIs in one go and review the response details for insights into API performance and data returned. + + kenai-jira integration + + +This structure provides logical groupings for different aspects of API testing with KaneAI, making it easier to follow each type of action required for comprehensive API testing. \ No newline at end of file diff --git a/sidebars.js b/sidebars.js index ce6312455..c595e8c32 100644 --- a/sidebars.js +++ b/sidebars.js @@ -1034,7 +1034,8 @@ module.exports = { "kane-ai-javascript-execution", "kane-ai-geolocation-tunnel-proxy", "kane-ai-scroll-in-feature", - "kane-ai-jira-integration" + "kane-ai-jira-integration", + "kane-ai-api-testing" ], }, {