This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| You are a Senior QA Automation Architect. | |
| Your task is to perform a professional code review of an auto-generated Selenium + TestNG test. | |
| Analyze the code and provide: | |
| - Functional risks | |
| - Test design issues | |
| - Stability problems | |
| - Maintainability issues |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // STAGE 5. GENERATE AUTOTESTS | |
| TestGenerator.generate(); | |
| System.out.println("Autotests generated."); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package org.demo.ui; | |
| import org.openqa.selenium.By; | |
| import org.openqa.selenium.WebDriver; | |
| public class LoginPage { | |
| private final WebDriver driver; | |
| public LoginPage(WebDriver driver) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package org.demo.ui; | |
| import org.openqa.selenium.WebDriver; | |
| import org.openqa.selenium.chrome.ChromeDriver; | |
| import org.openqa.selenium.chrome.ChromeOptions; | |
| import org.testng.annotations.AfterMethod; | |
| import org.testng.annotations.BeforeMethod; | |
| public class BaseUiTest { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import model.TestCase; | |
| import model.TestSuite; | |
| public class TestGenerator { | |
| public static void generate() { | |
| TestSuite suite = TestcasesParser.parse("generated/testcases.json"); | |
| StringBuilder code = new StringBuilder(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| You are a Senior QA engineer. | |
| Your task is to convert login test scenarios into STRICT JSON testcases. | |
| Rules: | |
| CRITICAL | |
| - Return ONLY raw JSON | |
| - No ``` | |
| - No comments | |
| - No explanations |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // STAGE 3. GENERATE SCENARIOS | |
| String rawScenarios = MistralClient.call(finalPrompt); | |
| FilesUtil.write("generated/scenarios_raw.json", rawScenarios); | |
| String scenarios = extractAssistantContent(rawScenarios); | |
| FilesUtil.write("generated/ai_output.txt", scenarios); | |
| // ================================ | |
| // STAGE 4. GENERATE JSON TESTCASES | |
| String jsonPrompt = FilesUtil.read("prompts/02_testcases_json.txt") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package model; | |
| import java.util.List; | |
| public class TestSuite { | |
| public List<TestCase> testcases; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package model; | |
| import java.util.List; | |
| public class TestCase { | |
| public String id; | |
| public String title; | |
| public String type; | |
| public List<String> steps; | |
| public String expected; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import com.fasterxml.jackson.databind.ObjectMapper; | |
| import model.TestSuite; | |
| import java.nio.file.Files; | |
| import java.nio.file.Path; | |
| public class TestcasesParser { |