User Description
Generating functional test scenarios using our AI based service Nova, through use case description. Below you can see how to generate test cases from description using both SDKs and APIs.
Usage 🚀
Refer to Setup Guide for installing dependecies for both Java and Python.
JAVA
There are 2 clients available with the Java SDK: SyncClient and AsyncClient
Java Client Code
# for async client
import org.qyrus.ai_sdk.Clients.AsyncClient;
AsyncClient client = new AsyncClient(<API_TOKEN>, null);
# for sync client
import org.qyrus.ai_sdk.Clients.SyncClient;
SyncClient client = new SyncClient(<API_TOKEN>, null);Using SyncClient
Here's an example of utilizing Nova via the user description to generate test scenarios with SyncClient.
Java SyncClient Code
private static void createTestScenariosWithDescription(){
SyncClient client = new SyncClient(<API_TOKEN>, null);
String use_case_description = <USE_CASE_DESCRIPTION>;
try {
NovaDescription.CreateScenariosResponse response = client.nova.from_description.create(use_case_description);
System.out.println("Creation Status: " + response.isOk());
System.out.println("Creation Status: " + response.getMessage());
//Show all the scenarios generated
if (response != null && response.isOk() == true && response.getScenarios() != null) {
System.out.println("Creation Status: " + response.getNovaRequestId());
List<NovaDescription.Scenario> scenarios = response.getScenarios();
// Loop over the list and print out scenarios
for (NovaDescription.Scenario scenario : scenarios) {
System.out.println("Test Script Name: " + scenario.getTestScriptName());
System.out.println("Test Script Objective: " + scenario.getTestScriptObjective());
System.out.println("Reason to Test: " + scenario.getReasonToTest());
System.out.println("Criticality Description: " + scenario.getCriticalityDescription());
System.out.println("Criticality Score: " + scenario.getCriticalityScore());
System.out.println("--------------------------------------");
}
}
} catch (Exception e) {
e.printStackTrace();
}
}Using AsyncClient
Here's an example of utilizing Nova via the user description to generate test scenarios with AsyncClient.
PYTHON
There are two clients available with the Python SDK: SyncQyrusAI and AsyncQyrusAI.
Using SyncQyrusAI
Here's an example of utilizing Nova via the user description to generate test scenarios with SyncQyrusAI.
Using AsyncQyrusAI
Here's an example of utilizing Nova via the user description to generate test scenarios with AsyncQyrusAI.
Rest APIs
This API allows users to generate test scenarios based on provided user description.
Endpoint
URL : POST {{GATEWAY_URL}}/nova-sdk/v1/api/nova_user
Headers
Authorization: [Your Authorization Token]
Custom: [Your Custom Header Value]
Request Body: { "user_description": "Create Tests for Login Page" }
Response:
Last updated