"""Run the V2 advanced test suite directly (without MCP server).""" import sys import json from pathlib import Path sys.path.insert(0, str(Path(__file__).parent / "src")) from client_v2 import load_env, load_accounts, load_testcases_v2, run_full_suite_v2 def main(): env = load_env() accounts = load_accounts() testcases = load_testcases_v2() sys.stderr.write(f"Starting V2 suite with {len(testcases)} tests...\n") results = run_full_suite_v2( accounts=accounts, testcases=testcases, env=env, headless=True, timeout_per_test=180, ) # Save results out_path = Path(__file__).parent / "reports" / "suite_results_v2.json" out_path.parent.mkdir(parents=True, exist_ok=True) out_path.write_text(json.dumps(results, indent=2, ensure_ascii=False), encoding="utf-8") sys.stderr.write(f"Results saved to {out_path}\n") # Print summary for r in results: status = "OK" if not r.get("error") else "ERR" resp_preview = r.get("response", "")[:80].replace("\n", " ") sys.stderr.write(f" [{status}] {r['id']}: {resp_preview}...\n") if __name__ == "__main__": main()