{"openapi":"3.0.0","info":{"title":"InsightJet Testing Platform API","version":"2.0.0","description":"Comprehensive web crawler and testing execution platform with BDD support, video recording, and visual regression testing","contact":{"name":"API Support","url":"https://github.com/your-repo"},"license":{"name":"MIT","url":"https://opensource.org/licenses/MIT"}},"servers":[{"url":"http://ec2-35-173-231-144.compute-1.amazonaws.com","description":"Production server"},{"url":"http://localhost:8443","description":"Development server"}],"tags":[{"name":"Crawler","description":"Original web crawling functionality"},{"name":"Testing","description":"Test execution and scenario management"},{"name":"Gherkin","description":"BDD (Behavior Driven Development) test execution"},{"name":"Video","description":"Video recording and management"},{"name":"Visual","description":"Visual regression testing"},{"name":"Monitoring","description":"Health checks and system monitoring"},{"name":"Smart QA","description":"Intelligent UI analysis and automated test case generation"}],"components":{"schemas":{"CrawlRequest":{"type":"object","required":["url"],"properties":{"url":{"type":"string","description":"Target URL to crawl (required)","example":"https://news.ycombinator.com","minLength":1},"streaming":{"type":"boolean","default":false,"description":"Enable real-time streaming via WebSocket"},"maxDepth":{"type":"integer","default":2,"minimum":1,"maximum":10,"description":"Maximum crawl depth"},"exploreNavigation":{"type":"boolean","default":false,"description":"Explore navigation elements"},"userAgent":{"type":"string","description":"Custom user agent string"},"delayAfterLoad":{"type":"integer","default":2000,"description":"Delay after page load in milliseconds"},"extractTooltips":{"type":"boolean","default":false,"description":"Extract tooltip information"},"includeAttributes":{"type":"boolean","default":false,"description":"Include element attributes in analysis"},"auth":{"$ref":"#/components/schemas/AuthConfig"},"actions":{"type":"array","items":{"$ref":"#/components/schemas/Action"}},"waitFor":{"$ref":"#/components/schemas/WaitConfig"},"extraHeaders":{"type":"object","additionalProperties":{"type":"string"}}}},"TestScenario":{"type":"object","required":["name","steps"],"properties":{"id":{"type":"string","description":"Unique test identifier"},"name":{"type":"string","description":"Test scenario name","example":"Login Flow Test"},"description":{"type":"string","description":"Test scenario description"},"steps":{"type":"array","items":{"$ref":"#/components/schemas/TestStep"},"description":"Array of test steps to execute"},"assertions":{"type":"array","items":{"$ref":"#/components/schemas/TestAssertion"},"description":"Array of assertions to verify"},"auth":{"$ref":"#/components/schemas/AuthConfig"}}},"TestStep":{"type":"object","required":["type"],"properties":{"type":{"type":"string","enum":["navigate","click","fill","wait","screenshot","extract","custom","authentication"],"description":"Type of test step"},"description":{"type":"string","description":"Step description"},"url":{"type":"string","description":"URL for navigate step"},"selector":{"type":"string","description":"CSS selector for element interaction"},"value":{"type":"string","description":"Value for fill step"},"script":{"type":"string","description":"JavaScript code for custom step"},"duration":{"type":"integer","description":"Duration in milliseconds for wait step"},"timeout":{"type":"integer","description":"Timeout in milliseconds"},"fullPage":{"type":"boolean","description":"Full page screenshot flag"},"extract":{"type":"string","enum":["text","html","attribute","all"],"description":"Data extraction type"},"authType":{"type":"string","enum":["form","basic","bearer","custom"],"description":"Authentication type for auth step"},"username":{"type":"string","description":"Username for authentication"},"password":{"type":"string","description":"Password for authentication"},"usernameSelector":{"type":"string","description":"Username field selector"},"passwordSelector":{"type":"string","description":"Password field selector"},"submitSelector":{"type":"string","description":"Submit button selector"}}},"TestAssertion":{"type":"object","required":["type"],"properties":{"type":{"type":"string","enum":["element_visible","element_text","page_title","url_contains","response_time","element_count","element_attribute"],"description":"Type of assertion"},"description":{"type":"string","description":"Assertion description"},"selector":{"type":"string","description":"CSS selector for element assertions"},"expected":{"oneOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}],"description":"Expected value"},"comparison":{"type":"string","enum":["equals","contains","startsWith","endsWith","matches"],"description":"Comparison type for text assertions"},"attribute":{"type":"string","description":"Attribute name for element_attribute assertion"}}},"TestExecutionRequest":{"type":"object","required":["test"],"properties":{"test":{"$ref":"#/components/schemas/TestScenario"},"streaming":{"type":"boolean","default":false,"description":"Enable real-time streaming"},"executionMode":{"type":"string","enum":["full","step-by-step","partial","validate-only"],"default":"full","description":"Test execution mode"},"stepRange":{"type":"object","properties":{"start":{"type":"integer","description":"Start step index for partial execution"},"end":{"type":"integer","description":"End step index for partial execution"}}},"continueOnFailure":{"type":"boolean","default":false,"description":"Continue execution on step failure"},"dryRun":{"type":"boolean","default":false,"description":"Validate without execution"},"auth":{"$ref":"#/components/schemas/AuthConfig"},"browserOptions":{"type":"object","description":"Browser configuration options"},"recordVideo":{"type":"boolean","default":false,"description":"Enable video recording"},"videoConfig":{"$ref":"#/components/schemas/VideoConfig"}}},"VideoConfig":{"type":"object","properties":{"enabled":{"type":"boolean","default":false},"fps":{"type":"integer","default":30,"description":"Frames per second"},"quality":{"type":"string","default":"1000k","description":"Video quality"},"scale":{"type":"string","default":"1920x1080","description":"Video resolution"},"generateHighlights":{"type":"boolean","default":true,"description":"Generate failure highlights"},"addAnnotations":{"type":"boolean","default":true,"description":"Add step annotations"}}},"GherkinRequest":{"type":"object","required":["gherkin"],"properties":{"gherkin":{"type":"string","description":"Gherkin feature text","example":"Feature: Login\n  Scenario: User login\n    Given I navigate to \"https://app.com/login\"\n    When I login with username \"user\" and password \"pass\"\n    Then I should see \"Dashboard\""},"streaming":{"type":"boolean","default":false,"description":"Enable real-time streaming"},"auth":{"$ref":"#/components/schemas/AuthConfig"},"browserOptions":{"type":"object","description":"Browser configuration options"}}},"VisualBaselineRequest":{"type":"object","required":["testName","url"],"properties":{"testName":{"type":"string","description":"Visual test name","example":"homepage-visual-test"},"url":{"type":"string","description":"URL to capture baseline","example":"https://app.com"},"fullPage":{"type":"boolean","default":true,"description":"Capture full page screenshot"},"selector":{"type":"string","description":"Element selector for partial screenshot"},"auth":{"$ref":"#/components/schemas/AuthConfig"}}},"VisualCompareRequest":{"type":"object","required":["testName","url"],"properties":{"testName":{"type":"string","description":"Visual test name","example":"homepage-visual-test"},"url":{"type":"string","description":"URL to compare","example":"https://app.com"},"threshold":{"type":"number","default":0.05,"minimum":0,"maximum":1,"description":"Visual difference threshold (0-1)"},"fullPage":{"type":"boolean","default":true,"description":"Compare full page"},"selector":{"type":"string","description":"Element selector for partial comparison"}}},"TestSuiteRequest":{"type":"object","required":["name","tests"],"properties":{"name":{"type":"string","description":"Test suite name","example":"User Authentication Suite"},"description":{"type":"string","description":"Test suite description"},"tests":{"type":"array","items":{"$ref":"#/components/schemas/TestScenario"},"description":"Array of test scenarios"},"executionMode":{"type":"string","enum":["sequential","parallel"],"default":"sequential","description":"Suite execution mode"},"batchMode":{"type":"string","enum":["continue-on-failure","stop-on-failure","fail-fast"],"default":"continue-on-failure","description":"Batch failure handling"},"maxParallel":{"type":"integer","default":3,"description":"Max parallel tests for parallel mode"},"auth":{"$ref":"#/components/schemas/AuthConfig"}}},"AuthConfig":{"type":"object","required":["type"],"properties":{"type":{"type":"string","enum":["form","basic","bearer","custom"],"description":"Authentication type"},"username":{"type":"string","description":"Username for form/basic auth"},"password":{"type":"string","description":"Password for form/basic auth"},"token":{"type":"string","description":"Bearer token"},"usernameSelector":{"type":"string","description":"Username field selector for form auth"},"passwordSelector":{"type":"string","description":"Password field selector for form auth"},"submitSelector":{"type":"string","description":"Submit button selector for form auth"},"script":{"type":"string","description":"Custom authentication script"},"optional":{"type":"boolean","default":false,"description":"Whether authentication is optional"},"skipIfNotFound":{"type":"boolean","default":false,"description":"Skip if auth elements not found"}}},"Action":{"type":"object","required":["type"],"properties":{"type":{"type":"string","enum":["click","fill","waitFor","waitForTimeout"],"description":"Action type"},"selector":{"type":"string","description":"CSS selector for element actions"},"value":{"type":"string","description":"Value for fill action"},"waitAfter":{"type":"integer","description":"Wait time after action in milliseconds"},"duration":{"type":"integer","description":"Duration for waitForTimeout"},"timeout":{"type":"integer","description":"Timeout in milliseconds"},"state":{"type":"string","enum":["visible","hidden","attached","detached"],"description":"Element state for waitFor"}}},"WaitConfig":{"type":"object","properties":{"selector":{"type":"string","description":"CSS selector to wait for"},"timeout":{"type":"integer","default":10000,"description":"Timeout in milliseconds"},"state":{"type":"string","enum":["visible","hidden","attached","detached"],"default":"visible","description":"Element state to wait for"}}},"CrawlResponse":{"type":"object","properties":{"sessionId":{"type":"string","description":"Session identifier"},"streamUrl":{"type":"string","description":"SSE stream URL"},"websocketUrl":{"type":"string","description":"WebSocket URL for real-time updates"},"status":{"type":"string","description":"Response status"},"message":{"type":"string","description":"Response message"},"nodes":{"type":"array","items":{"$ref":"#/components/schemas/CrawlNode"}},"edges":{"type":"array","items":{"$ref":"#/components/schemas/CrawlEdge"}},"totalNodes":{"type":"integer","description":"Total number of nodes discovered"},"totalEdges":{"type":"integer","description":"Total number of edges discovered"}}},"TestResult":{"type":"object","properties":{"id":{"type":"string","description":"Test execution ID"},"name":{"type":"string","description":"Test name"},"status":{"type":"string","enum":["passed","failed","running"],"description":"Test execution status"},"startTime":{"type":"string","format":"date-time","description":"Test start time"},"endTime":{"type":"string","format":"date-time","description":"Test end time"},"duration":{"type":"integer","description":"Test duration in milliseconds"},"steps":{"type":"array","items":{"$ref":"#/components/schemas/StepResult"}},"assertions":{"type":"array","items":{"$ref":"#/components/schemas/AssertionResult"}},"artifacts":{"$ref":"#/components/schemas/TestArtifacts"},"summary":{"$ref":"#/components/schemas/TestSummary"}}},"StepResult":{"type":"object","properties":{"type":{"type":"string","description":"Step type"},"description":{"type":"string","description":"Step description"},"status":{"type":"string","enum":["passed","failed"],"description":"Step execution status"},"startTime":{"type":"string","format":"date-time"},"endTime":{"type":"string","format":"date-time"},"input":{"type":"object","description":"Step input parameters"},"output":{"type":"object","description":"Step execution output"},"timing":{"type":"object","properties":{"duration":{"type":"integer","description":"Step duration in milliseconds"},"videoTimestamp":{"type":"integer","description":"Video timestamp in milliseconds"}}},"browser_state":{"type":"object","description":"Browser state after step execution"},"artifacts":{"type":"object","description":"Step artifacts (screenshots, extracted data)"},"errors":{"type":"array","items":{"type":"object"},"description":"Step execution errors"}}},"AssertionResult":{"type":"object","properties":{"type":{"type":"string","description":"Assertion type"},"description":{"type":"string","description":"Assertion description"},"passed":{"type":"boolean","description":"Whether assertion passed"},"expected":{"oneOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}],"description":"Expected value"},"actual":{"oneOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}],"description":"Actual value"},"comparison":{"type":"string","description":"Comparison type used"},"timing":{"type":"object","properties":{"duration":{"type":"integer","description":"Assertion duration in milliseconds"}}},"error":{"type":"string","description":"Error message if assertion failed"}}},"TestArtifacts":{"type":"object","properties":{"screenshots":{"type":"array","items":{"type":"object","properties":{"filename":{"type":"string"},"path":{"type":"string"},"url":{"type":"string"},"size":{"type":"integer"}}}},"videos":{"type":"array","items":{"type":"object","properties":{"filename":{"type":"string"},"path":{"type":"string"},"url":{"type":"string"},"streamUrl":{"type":"string"},"thumbnailUrl":{"type":"string"},"duration":{"type":"number"},"resolution":{"type":"string"}}}},"highlights":{"type":"array","items":{"type":"object","properties":{"start":{"type":"number"},"duration":{"type":"number"},"title":{"type":"string"},"description":{"type":"string"}}}}}},"TestSummary":{"type":"object","properties":{"status":{"type":"string","enum":["passed","failed"]},"stepsExecuted":{"type":"integer"},"stepsPassed":{"type":"integer"},"assertionsExecuted":{"type":"integer"},"assertionsPassed":{"type":"integer"}}},"CrawlNode":{"type":"object","properties":{"id":{"type":"string","description":"Node identifier"},"url":{"type":"string","description":"Page URL"},"title":{"type":"string","description":"Page title"},"type":{"type":"string","description":"Node type"},"depth":{"type":"integer","description":"Crawl depth"}}},"CrawlEdge":{"type":"object","properties":{"id":{"type":"string","description":"Edge identifier"},"source":{"type":"string","description":"Source node ID"},"target":{"type":"string","description":"Target node ID"},"label":{"type":"string","description":"Edge label"}}},"HealthResponse":{"type":"object","properties":{"status":{"type":"string","enum":["healthy","unhealthy"],"description":"Service health status"},"timestamp":{"type":"string","format":"date-time","description":"Health check timestamp"},"uptime":{"type":"number","description":"Service uptime in seconds"},"version":{"type":"string","description":"API version"},"features":{"type":"array","items":{"type":"string"},"description":"Available features"},"metrics":{"type":"object","description":"System metrics"}}},"Error":{"type":"object","required":["error"],"properties":{"error":{"type":"string","description":"Error message"},"type":{"type":"string","description":"Error type"},"sessionId":{"type":"string","description":"Session ID if applicable"},"details":{"type":"object","description":"Additional error details"}}}}},"paths":{"/health":{"get":{"tags":["Monitoring"],"summary":"Health Check","description":"Check if the API is running and healthy","responses":{"200":{"description":"API is healthy","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HealthResponse"}}}}}}},"/crawl":{"post":{"tags":["Crawler"],"summary":"Start Crawl Session","description":"Initiate a new web crawling session with optional streaming","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrawlRequest"}}}},"responses":{"200":{"description":"Crawl session started successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrawlResponse"}}}},"400":{"description":"Invalid request parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/sessions":{"get":{"tags":["Crawler"],"summary":"Get All Sessions","description":"Retrieve information about all active and persisted sessions","responses":{"200":{"description":"Sessions retrieved successfully","content":{"application/json":{"schema":{"type":"object","properties":{"activeSessions":{"type":"array","items":{"type":"object"}},"persistedSessions":{"type":"array","items":{"type":"object"}},"totalSessions":{"type":"integer"}}}}}}}}},"/test":{"post":{"tags":["Testing"],"summary":"Execute Test Scenario","description":"Execute a complete test scenario with steps and assertions","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TestExecutionRequest"}}}},"responses":{"200":{"description":"Test executed successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TestResult"}}}},"400":{"description":"Invalid test configuration","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/test/step":{"post":{"tags":["Testing"],"summary":"Execute Individual Test Step","description":"Execute a single test step and return detailed results","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["step"],"properties":{"step":{"$ref":"#/components/schemas/TestStep"},"sessionId":{"type":"string","description":"Optional session ID for context sharing"},"context":{"type":"object","description":"Browser context from previous steps"},"streaming":{"type":"boolean","default":false},"auth":{"$ref":"#/components/schemas/AuthConfig"},"browserOptions":{"type":"object"}}}}}},"responses":{"200":{"description":"Step executed successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StepResult"}}}}}}},"/test/steps":{"post":{"tags":["Testing"],"summary":"Execute Batch Test Steps","description":"Execute multiple test steps in sequence","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["steps"],"properties":{"steps":{"type":"array","items":{"$ref":"#/components/schemas/TestStep"}},"sessionId":{"type":"string"},"context":{"type":"object"},"streaming":{"type":"boolean","default":false},"continueOnFailure":{"type":"boolean","default":true},"auth":{"$ref":"#/components/schemas/AuthConfig"}}}}}},"responses":{"200":{"description":"Steps executed successfully","content":{"application/json":{"schema":{"type":"object","properties":{"sessionId":{"type":"string"},"results":{"type":"array","items":{"$ref":"#/components/schemas/StepResult"}},"summary":{"type":"object","properties":{"total":{"type":"integer"},"executed":{"type":"integer"},"passed":{"type":"integer"},"failed":{"type":"integer"}}}}}}}}}}},"/test-suite":{"post":{"tags":["Testing"],"summary":"Execute Test Suite","description":"Execute multiple test scenarios as a suite","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TestSuiteRequest"}}}},"responses":{"200":{"description":"Test suite executed successfully","content":{"application/json":{"schema":{"type":"object","properties":{"suiteName":{"type":"string"},"sessionId":{"type":"string"},"startTime":{"type":"string","format":"date-time"},"endTime":{"type":"string","format":"date-time"},"summary":{"type":"object","properties":{"total":{"type":"integer"},"passed":{"type":"integer"},"failed":{"type":"integer"},"duration":{"type":"integer"}}},"tests":{"type":"array","items":{"$ref":"#/components/schemas/TestResult"}}}}}}}}}},"/gherkin":{"post":{"tags":["Gherkin"],"summary":"Execute Gherkin Feature","description":"Execute BDD test scenarios written in Gherkin format","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GherkinRequest"}}}},"responses":{"200":{"description":"Gherkin feature executed successfully","content":{"application/json":{"schema":{"type":"object","properties":{"featureName":{"type":"string"},"description":{"type":"string"},"scenarios":{"type":"array","items":{"$ref":"#/components/schemas/TestResult"}},"summary":{"type":"object","properties":{"total":{"type":"integer"},"passed":{"type":"integer"},"failed":{"type":"integer"}}}}}}}},"400":{"description":"Invalid Gherkin syntax","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"errors":{"type":"array","items":{"type":"string"}},"warnings":{"type":"array","items":{"type":"string"}}}}}}}}}},"/video/list":{"get":{"tags":["Video"],"summary":"List Video Recordings","description":"Get list of all video recordings","responses":{"200":{"description":"Videos retrieved successfully","content":{"application/json":{"schema":{"type":"object","properties":{"videos":{"type":"array","items":{"type":"object","properties":{"filename":{"type":"string"},"sessionId":{"type":"string"},"duration":{"type":"number"},"size":{"type":"integer"},"createdAt":{"type":"string","format":"date-time"}}}}}}}}}}}},"/video/info/{sessionId}":{"get":{"tags":["Video"],"summary":"Get Video Information","description":"Get detailed information about a video recording","parameters":[{"name":"sessionId","in":"path","required":true,"schema":{"type":"string"},"description":"Session ID"}],"responses":{"200":{"description":"Video info retrieved successfully","content":{"application/json":{"schema":{"type":"object","properties":{"filename":{"type":"string"},"path":{"type":"string"},"url":{"type":"string"},"streamUrl":{"type":"string"},"thumbnailUrl":{"type":"string"},"duration":{"type":"number"},"size":{"type":"integer"},"resolution":{"type":"string"},"fps":{"type":"number"}}}}}},"404":{"description":"Video not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/visual/baseline":{"post":{"tags":["Visual"],"summary":"Capture Visual Baseline","description":"Capture baseline screenshot for visual regression testing","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VisualBaselineRequest"}}}},"responses":{"200":{"description":"Baseline captured successfully","content":{"application/json":{"schema":{"type":"object","properties":{"testName":{"type":"string"},"baselinePath":{"type":"string"},"url":{"type":"string"},"captured":{"type":"boolean"},"timestamp":{"type":"string","format":"date-time"}}}}}}}}},"/visual/compare":{"post":{"tags":["Visual"],"summary":"Compare with Baseline","description":"Compare current screenshot with baseline for visual regression detection","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VisualCompareRequest"}}}},"responses":{"200":{"description":"Visual comparison completed","content":{"application/json":{"schema":{"type":"object","properties":{"testName":{"type":"string"},"passed":{"type":"boolean"},"difference":{"type":"number"},"threshold":{"type":"number"},"pixelsDifferent":{"type":"integer"},"totalPixels":{"type":"integer"},"percentDifferent":{"type":"number"},"baselinePath":{"type":"string"},"currentPath":{"type":"string"},"diffPath":{"type":"string"}}}}}}}}},"/visual/cross-browser":{"post":{"tags":["Visual"],"summary":"Cross-Browser Visual Testing","description":"Compare visuals across different browsers","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["testName","url","browsers"],"properties":{"testName":{"type":"string","example":"cross-browser-homepage"},"url":{"type":"string","example":"https://app.com"},"browsers":{"type":"array","items":{"type":"string","enum":["chromium","firefox","webkit"]},"example":["chromium","firefox","webkit"]}}}}}},"responses":{"200":{"description":"Cross-browser testing completed","content":{"application/json":{"schema":{"type":"object","properties":{"testName":{"type":"string"},"results":{"type":"array","items":{"type":"object","properties":{"browser":{"type":"string"},"screenshot":{"type":"string"},"differences":{"type":"array","items":{"type":"object","properties":{"comparedWith":{"type":"string"},"difference":{"type":"number"},"diffPath":{"type":"string"}}}}}}}}}}}}}}},"/analyze-ui":{"post":{"tags":["Smart QA"],"summary":"Analyze UI Structure","description":"Analyze a webpage and extract UI structure, components, and context using DOM and/or visual detection","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["start_url"],"properties":{"start_url":{"type":"string","example":"https://www.buy.am","description":"Target URL to analyze"},"max_depth":{"type":"integer","default":1,"minimum":1,"maximum":5,"description":"Maximum analysis depth"},"visual_analysis_mode":{"type":"string","enum":["hybrid","minimal"],"default":"hybrid","description":"Analysis mode: Hybrid (balanced DOM+visual, recommended) or Minimal (lightweight, basic elements only)"},"interaction_scope":{"type":"object","properties":{"dropdowns":{"type":"boolean","default":true},"tooltips":{"type":"boolean","default":true},"scrolling":{"type":"boolean","default":true},"form_inputs":{"type":"boolean","default":true}}},"filters":{"type":"object","properties":{"exclude_components":{"type":"array","items":{"type":"string"},"example":["footer","ads"]}}},"selector_strategy":{"type":"string","enum":["auto","data-testid","css","text"],"default":"auto"}}}}}},"responses":{"200":{"description":"UI analysis completed successfully","content":{"application/json":{"schema":{"type":"object","properties":{"session_id":{"type":"string"},"timestamp":{"type":"string"},"analysis_metadata":{"type":"object","properties":{"visual_analysis_mode":{"type":"string"},"total_components":{"type":"integer"},"actionable_components":{"type":"integer"}}},"contexts":{"type":"array","items":{"type":"object","properties":{"context_id":{"type":"string","example":"page_home"},"url":{"type":"string"},"semantic_summary":{"type":"string","example":"Homepage with product search"},"confidence":{"type":"number"},"indicators":{"type":"array","items":{"type":"string"}}}}},"components":{"type":"array","items":{"type":"object","properties":{"component_id":{"type":"string","example":"input_search"},"type":{"type":"string","example":"input"},"selector":{"type":"string","example":"input[placeholder=\"Search\"]"},"context_id":{"type":"string"},"purpose":{"type":"string","example":"search bar"},"confidence":{"type":"number"},"source":{"type":"string","enum":["dom","visual","hybrid"]},"actions":{"type":"array","items":{"type":"string"}},"input_parameters":{"type":"object","properties":{"value":{"type":"object","properties":{"type":{"type":"string"},"example":{"type":"string"}}}}}}}}}}}}}}}},"/generate-test-cases":{"post":{"tags":["Smart QA"],"summary":"Generate Test Cases","description":"Generate test cases from previously analyzed UI and user intent","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["analyzed_ui","intent"],"properties":{"analyzed_ui":{"type":"object","description":"Output from /analyze-ui endpoint","properties":{"contexts":{"type":"array"},"components":{"type":"array"}}},"intent":{"type":"string","example":"User searches for a product","description":"Description of what the user wants to do"},"input_parameters":{"type":"object","example":{"query":"Laptop"},"description":"Input values for the test"},"test_type":{"type":"string","enum":["atomic","flow","contextual"],"default":"flow","description":"Type of test to generate"},"output_formats":{"type":"array","items":{"type":"string","enum":["json_dsl","gherkin","playwright_code"]},"default":["json_dsl","gherkin","playwright_code"],"description":"Desired output formats"}}}}}},"responses":{"200":{"description":"Test cases generated successfully","content":{"application/json":{"schema":{"type":"object","properties":{"sessionId":{"type":"string"},"timestamp":{"type":"string"},"test_generation_result":{"type":"object","properties":{"intent":{"type":"string"},"test_type":{"type":"string"},"input_parameters":{"type":"object"},"output_formats":{"type":"array","items":{"type":"string"}}}},"test_cases":{"type":"array","items":{"type":"object","properties":{"test_id":{"type":"string","example":"flow_001_search"},"name":{"type":"string","example":"Product Search Flow"},"type":{"type":"string"},"json_dsl":{"type":"object","properties":{"steps":{"type":"array","items":{"type":"object","properties":{"action":{"type":"string","example":"fill"},"component_id":{"type":"string","example":"input_search"},"value":{"type":"string","example":"Laptop"}}}}}},"gherkin":{"type":"object","properties":{"feature":{"type":"string"},"scenario":{"type":"string"},"steps":{"type":"array","items":{"type":"string"}}}},"playwright_code":{"type":"array","items":{"type":"string"},"example":["await page.fill(\"input[placeholder=\\\"Search\\\"]\", \"Laptop\");","await page.click(\"button:has-text(\\\"Search\\\")\");"]}}}}}}}}}}}},"/execute-test-case":{"post":{"tags":["Smart QA"],"summary":"Execute Single Test Case","description":"Run a single test case with video recording and detailed logging","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["test_case"],"properties":{"test_case":{"type":"object","required":["steps"],"properties":{"name":{"type":"string","example":"Search Test"},"steps":{"type":"array","items":{"type":"object","properties":{"action":{"type":"string","example":"fill"},"component_id":{"type":"string","example":"input_search"},"value":{"type":"string","example":"Laptop"}}}}}},"input_bindings":{"type":"object","example":{"query":"Laptop"},"description":"Variable bindings for test execution"},"options":{"type":"object","properties":{"record_video":{"type":"boolean","default":true},"collect_trace":{"type":"boolean","default":false},"timeout":{"type":"integer","default":30000}}}}}}}},"responses":{"200":{"description":"Test execution completed","content":{"application/json":{"schema":{"type":"object","properties":{"sessionId":{"type":"string"},"timestamp":{"type":"string"},"test_case_name":{"type":"string"},"result":{"type":"string","enum":["passed","failed","error"]},"duration":{"type":"string","example":"4.3s"},"video_url":{"type":"string","example":"videos/test_001.mp4"},"trace_url":{"type":"string"},"log":{"type":"array","items":{"type":"string"}},"step_results":{"type":"array"},"error_details":{"type":"string"},"screenshots":{"type":"array","items":{"type":"string"}}}}}}}}}},"/execute-test-cases":{"post":{"tags":["Smart QA"],"summary":"Execute Multiple Test Cases (Batch)","description":"Execute multiple test cases with parallel or sequential execution","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["test_cases"],"properties":{"test_cases":{"type":"array","items":{"type":"object","properties":{"test_id":{"type":"string"},"steps":{"type":"array"}}}},"input_bindings":{"type":"object"},"options":{"type":"object","properties":{"parallel":{"type":"boolean","default":false},"record_video":{"type":"boolean","default":true},"collect_trace":{"type":"boolean","default":false},"continue_on_failure":{"type":"boolean","default":true},"timeout":{"type":"integer","default":30000}}}}}}}},"responses":{"200":{"description":"Batch execution completed","content":{"application/json":{"schema":{"type":"object","properties":{"sessionId":{"type":"string"},"timestamp":{"type":"string"},"execution_mode":{"type":"string","enum":["parallel","sequential"]},"total_tests":{"type":"integer"},"passed_tests":{"type":"integer"},"failed_tests":{"type":"integer"},"error_tests":{"type":"integer"},"total_duration":{"type":"string"},"results":{"type":"array","items":{"type":"object","properties":{"test_id":{"type":"string"},"test_name":{"type":"string"},"result":{"type":"string"},"duration":{"type":"string"},"video_url":{"type":"string"}}}},"summary":{"type":"object","properties":{"total_tests":{"type":"integer"},"executed_tests":{"type":"integer"},"passed":{"type":"integer"},"failed":{"type":"integer"},"errors":{"type":"integer"},"success_rate":{"type":"string"},"execution_mode":{"type":"string"}}}}}}}}}}},"/ontology/components":{"get":{"tags":["Smart QA"],"summary":"Get Component Ontology","description":"Return current known components and verbs for test editing and autocomplete","responses":{"200":{"description":"Component ontology retrieved successfully","content":{"application/json":{"schema":{"type":"object","properties":{"timestamp":{"type":"string"},"version":{"type":"string"},"ontology":{"type":"object","properties":{"verbs":{"type":"array","items":{"type":"string"},"example":["fill","click","expect","hover","select","submit"]},"components":{"type":"array","items":{"type":"string"},"example":["input_search","btn_search","product_card","btn_buy_now"]},"element_types":{"type":"array","items":{"type":"string"},"example":["navigation_button","action_button","input_field","search_input"]},"test_types":{"type":"object","properties":{"atomic":{"type":"object","properties":{"description":{"type":"string"},"subtypes":{"type":"array","items":{"type":"string"}},"use_cases":{"type":"array","items":{"type":"string"}}}},"flow":{"type":"object","properties":{"description":{"type":"string"},"use_cases":{"type":"array","items":{"type":"string"}},"examples":{"type":"array","items":{"type":"string"}}}},"contextual":{"type":"object","properties":{"description":{"type":"string"},"use_cases":{"type":"array","items":{"type":"string"}},"examples":{"type":"array","items":{"type":"string"}}}}}},"visual_analysis_modes":{"type":"object","properties":{"dom_only":{"type":"object","properties":{"description":{"type":"string"},"use_case":{"type":"string"},"performance":{"type":"string"},"accuracy":{"type":"string"}}},"visual_only":{"type":"object","properties":{"description":{"type":"string"},"use_case":{"type":"string"},"performance":{"type":"string"},"accuracy":{"type":"string"}}},"hybrid":{"type":"object","properties":{"description":{"type":"string"},"use_case":{"type":"string"},"performance":{"type":"string"},"accuracy":{"type":"string"}}}}}}},"usage_examples":{"type":"object"}}}}}}}}}}}