This project demonstrates a multi-agent QA workflow.
The agents cooperate to:
- analyze requirements;
- design test scenarios;
| import json | |
| import subprocess | |
| from pathlib import Path | |
| # ============================================================= | |
| # PATHS | |
| # ============================================================= | |
| # Корень проекта QAI-05_adv1 |
| import json | |
| import subprocess | |
| from pathlib import Path | |
| from evaluator import evaluate_response | |
| # ============================================================= | |
| # PATHS | |
| # ============================================================= |
| import { tool } from "@opencode-ai/plugin" | |
| export default tool({ | |
| description: "Получить страницу Confluence по pageId", | |
| args: { | |
| pageId: tool.schema.string() | |
| }, | |
| async execute(args) { |
| import com.google.gson.Gson; | |
| import io.restassured.http.ContentType; | |
| import static io.restassured.RestAssured.given; | |
| public class MistralGenerator { | |
| public static String generatePetJson() { | |
| String prompt = """ |
| import com.applitools.eyes.selenium.Eyes; | |
| import com.applitools.eyes.selenium.fluent.Target; | |
| import org.openqa.selenium.By; | |
| import org.openqa.selenium.JavascriptException; | |
| import org.openqa.selenium.JavascriptExecutor; | |
| import org.openqa.selenium.WebDriver; | |
| import org.openqa.selenium.chrome.ChromeDriver; | |
| import org.testng.annotations.AfterMethod; | |
| import org.testng.annotations.BeforeMethod; | |
| import org.testng.annotations.Test; |
| // Этап 11. Формируем промпт для bug report только по логу прогона и данным Allure. | |
| System.out.println("[Этап 11] Сборка промпта для bug report"); | |
| String bugPrompt = FilesUtil.read("prompts/05_bug_report.txt") | |
| .replace("{{TEST_RUN_LOG}}", testRunLog) | |
| .replace("{{ALLURE_RESULTS}}", allureResults); | |
| FilesUtil.write("generated/bug_report_prompt.txt", bugPrompt); | |
| // Этап 12. Получаем от LLM структурированный bug report и сохраняем его как JSON. | |
| System.out.println("[Этап 12] Генерация bug report через LLM"); | |
| MistralClient.LlmResponse bugResponse = MistralClient.call(bugPrompt); |
| name: AI QA Pipeline | |
| on: | |
| push: | |
| branches: [ "main", "master" ] | |
| workflow_dispatch: | |
| jobs: | |
| ai-qa: | |
| runs-on: ubuntu-latest |
| Ты QA-инженер. | |
| На основе лога прогона и результатов Allure определи подтверждённые дефекты. Не выдумывай причины, шаги или ожидаемое поведение, если их нет в переданных данных. | |
| Если дефектов нет, верни: | |
| { "status": "NO_BUGS_FOUND" } | |
| Если найдены один или несколько дефектов, верни СТРОГО валидный JSON следующего формата: |
| // Этап 9. Запускаем сгенерированные тесты и сохраняем лог выполнения. | |
| System.out.println("[Этап 9] Запуск сгенерированных тестов"); | |
| String testRunLog = TestRunExecutor.runTests(); | |
| FilesUtil.write("generated/test_run.log", testRunLog); | |
| // Этап 10. Строим Allure-отчет и собираем результаты из target/allure-results. | |
| System.out.println("[Этап 10] Сборка Allure и чтение результатов"); | |
| String allureReportLog = TestRunExecutor.buildAllureReport(); | |
| FilesUtil.write("generated/allure_report.log", allureReportLog); | |
| String allureResults = FilesUtil.readFilesBySuffix("target/allure-results", "-result.json"); |