[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-76103":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":15,"contributorsCount":16,"subscribersCount":16,"size":16,"stars1d":16,"stars7d":16,"stars30d":17,"stars90d":16,"forks30d":16,"starsTrendScore":16,"compositeScore":18,"rankGlobal":10,"rankLanguage":10,"license":19,"archived":20,"fork":20,"defaultBranch":21,"hasWiki":22,"hasPages":22,"topics":23,"createdAt":10,"pushedAt":10,"updatedAt":24,"readmeContent":25,"aiSummary":26,"trendingCount":16,"starSnapshotCount":16,"syncStatus":27,"lastSyncTime":28,"discoverSource":29},76103,"Skiritai","Ktovoz\u002FSkiritai","Ktovoz","AI-powered test automation framework that explores test paths with AI and generates replayable scripts for 30x faster execution.","https:\u002F\u002Fktovoz.github.io\u002FSkiritai\u002F",null,"Python",380,16,1,4,0,156,53.69,"MIT License",false,"main",true,[],"2026-06-12 04:01:20","\u003Cdiv align=\"center\">\n\n# Skiritai\n\n**AI-Powered Test Automation Agent**\n\n\u003Cem>Named after the Skiritai — Sparta's elite reconnaissance troops who scouted the path ahead of the main army.\u003C\u002Fem>\n\n\u003Cbr>\n\n[![Python 3.11+](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FPython-3.11+-3776AB?logo=python&logoColor=white)](https:\u002F\u002Fwww.python.org\u002F)\n[![Playwright](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FPlaywright-1.40+-2EAD33?logo=playwright&logoColor=white)](https:\u002F\u002Fplaywright.dev\u002F)\n[![License: MIT](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FLicense-MIT-yellow.svg)](LICENSE)\n\n[![Test Status](https:\u002F\u002Fimg.shields.io\u002Fgithub\u002Factions\u002Fworkflow\u002Fstatus\u002FKtovoz\u002FSkiritai\u002Ftest.yml?branch=main&label=test%20status)](https:\u002F\u002Fgithub.com\u002FKtovoz\u002FSkiritai\u002Factions\u002Fworkflows\u002Ftest.yml)\n[![Publish](https:\u002F\u002Fimg.shields.io\u002Fgithub\u002Factions\u002Fworkflow\u002Fstatus\u002FKtovoz\u002FSkiritai\u002Fpublish.yml?branch=main&label=publish)](https:\u002F\u002Fgithub.com\u002FKtovoz\u002FSkiritai\u002Factions\u002Fworkflows\u002Fpublish.yml)\n\n[English](README.md) | [中文](README_zh.md)\n\n\u003C\u002Fdiv>\n\n---\n\n## What is Skiritai?\n\nSkiritai is an AI-driven browser test automation framework that **scouts automation paths before executing them**.\n\nLike the ancient Skiritai who reconnoitered the terrain before the Spartan army advanced, Skiritai's agent first *\n*explores** the target application — navigating pages, discovering UI elements, and figuring out the correct sequence of\nactions — then **generates replayable scripts** that can execute the same path at 30x speed without any AI inference.\n\n```\nExplore Mode (Scout the path)\n  AI Agent → analyze page → decide actions → generate scripts\n         ↓\nReplay Mode (Execute the proven path)\n  Script → direct execution → no AI needed → 30x faster\n```\n\n## Key Features\n\n| Feature                   | Description                                                                               |\n|---------------------------|-------------------------------------------------------------------------------------------|\n| **Explore → Replay Loop** | AI explores and generates scripts on first run; replays them instantly on subsequent runs |\n| **30x Performance**       | Replay mode skips AI inference entirely — 74s → 2.5s                                      |\n| **Flow API**               | Functional, no-subclass API — `async with flow() as ai:`                                  |\n| **YAML Cases**             | Define test steps in YAML, run via CLI or `run_yaml_case()`                              |\n| **Python-native Cases**   | Define test cases as Python classes with decorators                                       |\n| **Auto-Solidification**   | Successful explorations are automatically saved as replayable scripts                     |\n| **Multi-level Fallback**  | `fill` → `click_force` → `eval_js` for resilient element interaction                      |\n| **Flexible LLM**          | Supports OpenAI, Anthropic, Qwen, and any compatible API                                  |\n| **Optional Web UI**       | FastAPI backend with REST + WebSocket for external frontends                              |\n| **Visual Reports**        | Standalone HTML report built with Vue 3 + Ant Design — screenshots, assertions, step details |\n| **CLI**                   | `skiritai run\u002Fserve\u002Flist\u002Fbrowser` commands                                                |\n\n## How It Works\n\n```python\nfrom skiritai import BaseCase, step_mode\n\n\nclass SearchTest(BaseCase):\n    async def setup(self):\n        await self.launch_browser()\n\n    async def teardown(self):\n        await self.close_browser()\n\n    async def open_site(self):\n        await self.ai.action(\"Navigate to https:\u002F\u002Fexample.com\")\n\n    @step_mode(\"explore\")  # Force AI exploration for this step\n    async def search(self):\n        await self.ai.action(\"Search for 'automation testing'\")\n\n    async def verify(self):\n        await self.ai.action(\"Verify search results are displayed\")\n```\n\n**First run** — AI explores each step, generates scripts:\n\n```\n[Step] open_site   (explore)  → 20s  → scripts\u002Fopen_site.py   ✓\n[Step] search      (explore)  → 30s  → scripts\u002Fsearch.py      ✓\n[Step] verify      (explore)  → 24s  → scripts\u002Fverify.py      ✓\nTotal: 74s\n```\n\n**Second run** — scripts replay directly, no AI:\n\n```\n[Step] open_site   (replay)   → 0.8s → direct execution       ✓\n[Step] search      (replay)   → 0.8s → direct execution       ✓\n[Step] verify      (replay)   → 0.8s → direct execution       ✓\nTotal: 2.5s\n```\n\n### Flow API (Functional, No Subclass)\n\n```python\nfrom skiritai import flow\n\nasync with flow() as ai:\n    await ai.action(\"Navigate to https:\u002F\u002Fexample.com\")\n    await ai.screenshot(\"homepage\")\n    await ai.verify(\"Page title contains 'Example'\")\n```\n\n`flow()` is a functional context manager — no subclass, no decorators. Just `ai.action()`, `ai.verify()`, `ai.screenshot()`, `ai.analyze_page()`, and `ai.get_page_info()`.\n\n### YAML Cases (No Code)\n\n```yaml\n# case.yaml\nname: Search Test\nsteps:\n  - action: Open https:\u002F\u002Fwww.baidu.com\n  - action: Search for \"Playwright\"\n  - verify: Search results are displayed\n  - screenshot: result\n```\n\n```bash\nskiritai run examples\u002Fbeginner\u002Fbaidu_search\u002F03_yaml\n```\n\nYAML cases are perfect for QA teams who want AI-driven testing without writing Python. Supports `action`, `verify`, `screenshot`, `analyze`, `page_info` steps, with per-step `on_failure: skip | abort` policies.\n\n## Quick Start\n\n### 1. Install\n\n```bash\npip install skiritai\nplaywright install chromium\n```\n\n### 2. Configure\n\n```bash\n# .env\nOPENAI_API_KEY=your-api-key\nOPENAI_BASE_URL=https:\u002F\u002Fapi.openai.com\u002Fv1\nLLM_MODEL=gpt-4o\n```\n\n### 3. Run\n\n```bash\n# Run an example case\nskiritai run examples\u002Ftutorial\u002Fminimal\n\n# List available cases\nskiritai list examples\u002F\n```\n\nOr programmatically:\n\n```python\nimport asyncio\nfrom pathlib import Path\nfrom skiritai import run_case\n\nreport = asyncio.run(run_case(Path(\"examples\u002Fminimal\")))\nprint(report)\n```\n\n### 4. (Optional) Start Web Server\n\n```bash\npip install skiritai[web]\nskiritai serve --host 0.0.0.0 --port 8000\n```\n\n## Development\n\n```bash\n# Clone and install\ngit clone https:\u002F\u002Fgithub.com\u002FKtovoz\u002FSkiritai.git\ncd Skiritai\n\n# Install uv (one-time)\ncurl -LsSf https:\u002F\u002Fastral.sh\u002Fuv\u002Finstall.sh | sh\n\n# Sync dependencies and set up dev environment\nuv sync\n\n# Run tests\nuv run pytest\n```\n\n## Project Structure\n\n```\nskiritai\u002F\n├── core\u002F                      # Core engine (always installed)\n│   ├── agent_loop.py          # LangGraph ReAct Agent\n│   ├── ai_context.py          # Explore\u002FReplay execution context\n│   ├── base_case.py           # Test case base class\n│   ├── runner.py              # Case discovery and execution\n│   ├── flow.py                # Functional no-subclass API\n│   ├── yaml_runner.py         # YAML case loader and runner\n│   ├── tools.py               # Playwright tool set (14 tools)\n│   ├── browser.py             # Browser lifecycle management\n│   └── ...\n├── llm\u002F                       # LLM provider abstraction\n│   ├── openai_provider.py\n│   └── anthropic_provider.py\n├── events\u002F                    # Event bus\n├── web\u002F                       # [optional] FastAPI server (pip install skiritai[web])\n│   ├── app.py                 # Application factory\n│   ├── routers\u002F               # REST + WebSocket endpoints\n│   └── ws_manager.py          # Event → WebSocket bridge\n└── cli.py                     # CLI entry point\n\nreport\u002F                        # Visual report project (Vue 3 + Ant Design)\n├── src\u002F                       #   Components: ReportHeader, SummaryBar, StepCard, ScreenshotViewer\n├── dist\u002F                      #   Build output (single-file HTML, data injected by _render_html)\n└── package.json               #   skiritai-report\n\nexamples\u002F                      # Sample test cases\n├── tutorial\u002F                  # Teaching examples (learn framework features)\n│   ├── minimal\u002F               #   Pure Playwright, no AI needed\n│   ├── step_modes\u002F            #   auto\u002Fexplore\u002Freplay execution modes\n│   ├── failure_policies\u002F      #   ABORT\u002FSKIP\u002FRETRY failure strategies\n│   ├── hooks_demo\u002F            #   before_step\u002Fafter_step\u002Fon_step_error hooks\n│   └── context_demo\u002F          #   Cross-step context sharing via self.ctx\n├── baidu_search\u002F              # [First Try] Full E2E AI-driven test + replay scripts\n├── beginner\u002F                  # Beginner examples — 3 usage patterns for Baidu search\n│   └── baidu_search\u002F          #   01_basecase, 02_flow, 03_yaml\n├── advanced\u002F                  # Advanced examples — 3 usage patterns for ktovoz blog\n│   └── ktovoz_blog\u002F           #   01_basecase, 02_flow, 03_yaml\n└── ktovoz_blog\u002F               # [Advanced] 11-step long-range blog test\n\ntests\u002F                         # Framework tests\n├── unit\u002F\n├── functional\u002F\n├── acceptance\u002F\n└── e2e\u002F\n```\n\n## Examples\n\nExamples are organized into three tiers:\n\n### Beginner — Baidu Search (3 usage patterns × 3 LLM configs)\n\n| Example | Description |\n|---|---|\n| `beginner\u002Fbaidu_search\u002F01_basecase\u002F` | BaseCase class + .env auto-detect |\n| `beginner\u002Fbaidu_search\u002F02_flow\u002F` | flow() functional API + explicit OpenAIProvider |\n| `beginner\u002Fbaidu_search\u002F03_yaml\u002F` | YAML declarative + skiritai.toml config file |\n\n### Advanced — ktovoz Blog (3 usage patterns × 3 LLM configs)\n\n| Example | Description |\n|---|---|\n| `advanced\u002Fktovoz_blog\u002F01_basecase\u002F` | BaseCase class + .env (full 11-step blog test) |\n| `advanced\u002Fktovoz_blog\u002F02_flow\u002F` | flow() functional API + explicit Provider |\n| `advanced\u002Fktovoz_blog\u002F03_yaml\u002F` | YAML declarative + skiritai.toml config file |\n\n### Teaching (learn framework features)\n\n| Example | What It Teaches |\n|---|---|\n| `minimal\u002F` | BaseCase structure — pure Playwright, no LLM required |\n| `step_modes\u002F` | `auto` \u002F `explore` \u002F `replay` execution modes via `@step_mode` |\n| `failure_policies\u002F` | `@on_failure(SKIP)` \u002F `@on_failure(RETRY)` error handling |\n| `hooks_demo\u002F` | `before_step` \u002F `after_step` \u002F `on_step_error` lifecycle hooks |\n| `context_demo\u002F` | Cross-step data sharing with `self.ctx.store` |\n\n### First Try (real-world end-to-end)\n\n| Example | Description |\n|---|---|\n| `baidu_search\u002F` | Complete E2E: open Baidu → search → verify results. Demonstrates Explore→Replay loop in a real scenario. |\n\n### Advanced (long-range testing)\n\n| Example | Description |\n|---|---|\n| `ktovoz_blog\u002F` | 11-step blog test: homepage, articles, tags, about, footer, search, summary. Demonstrates the framework's capability for complex multi-step scenarios. |\n\n```bash\n# Beginner — Baidu search (3 patterns)\nskiritai run examples\u002Fbeginner\u002Fbaidu_search\u002F01_basecase\npython examples\u002Fbeginner\u002Fbaidu_search\u002F02_flow\u002Fdemo.py\nskiritai run examples\u002Fbeginner\u002Fbaidu_search\u002F03_yaml\n\n# Advanced — ktovoz blog (3 patterns)\nskiritai run examples\u002Fadvanced\u002Fktovoz_blog\u002F01_basecase\npython examples\u002Fadvanced\u002Fktovoz_blog\u002F02_flow\u002Fdemo.py\nskiritai run examples\u002Fadvanced\u002Fktovoz_blog\u002F03_yaml\n\n# Start with a teaching example (no AI needed)\nskiritai run examples\u002Ftutorial\u002Fminimal\n```\n\n## Roadmap\n\n### Vision Perception Layer\n\nCurrent AI exploration relies on DOM analysis and CSS selectors. The next evolution adds **visual perception** — the agent will \"see\" the page like a human tester, enabling:\n\n- **Visual-based AI exploration** — interpret screenshots, identify UI elements by appearance, and interact with canvas\u002FWebGL-based interfaces that lack accessible DOM\n- **Multimodal model support** — leverage vision-language models (GPT-4o, Claude 3.5 Sonnet, Gemini) and native multimodal models for richer page understanding\n- **Visual regression detection** — compare screenshots across runs to catch unexpected UI changes\n\n### Multi-Platform Testing\n\nSkiritai currently supports **Web** (Playwright\u002FChromium). We plan to extend to:\n\n| Platform | Planned Approach | Status |\n|----------|-----------------|--------|\n| **Mobile (iOS\u002FAndroid)** | Appium \u002F browser-use mobile integration | Planned |\n| **API Testing** | HTTP request tools for the AI agent | Planned |\n| **Desktop (Electron, native)** | Playwright Electron \u002F OS-level automation | Under investigation |\n\nThe goal is a unified test framework where the same Explore → Replay workflow works across Web, Mobile, and API — write once, test everywhere.\n\n---\n\n## CLI Commands\n\n```bash\nskiritai run \u003Ccase_dir>               # Run a test case\nskiritai serve [--host] [--port]       # Start web server\nskiritai list [cases_root]            # List available cases\nskiritai browser status [case_dir]    # Check persistent browser session\nskiritai browser cleanup [case_dir]   # Kill orphan browser process\n```\n\n## Tool Set\n\n14 Playwright tools available to the AI agent:\n\n| Tool            | Description                           |\n|-----------------|---------------------------------------|\n| `navigate`      | Navigate to URL                       |\n| `click`         | Click element                         |\n| `click_force`   | Force click (for hidden elements)     |\n| `fill`          | Fill input field                      |\n| `type_text`     | Type character by character           |\n| `focus`         | Focus on element                      |\n| `get_text`      | Get element text content              |\n| `get_page_info` | Get page title, URL, and text summary |\n| `wait_for`      | Wait for element to appear            |\n| `scroll`        | Scroll page                           |\n| `eval_js`       | Execute JavaScript                    |\n| `select_option` | Select dropdown option                |\n| `hover`         | Hover over element                    |\n| `screenshot`    | Capture page screenshot               |\n\n## Execution Modes\n\nControl how each step executes via `ai.action()` or the `@step_mode` decorator:\n\n| Mode             | Behavior                                   | Use Case                     |\n|------------------|--------------------------------------------|------------------------------|\n| `auto` (default) | Replay if script exists, otherwise explore | Most steps                   |\n| `explore`        | Always use AI, overwrite existing script   | New features, re-exploration |\n| `replay`         | Always replay, error if no script          | CI\u002FCD regression             |\n\n```python\n# Via decorator\n@step_mode(\"explore\")\nasync def my_step(self, ai):\n    await ai.action(\"...\")\n\n\n# Via parameter (overrides decorator)\nawait ai.action(\"...\", mode=\"replay\")\n```\n\n\u003Cdiv align=\"center\">\n\n---\n\n### Author\n\n**Joe Shen**\n\n[![GitHub](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FGitHub-@Ktovoz-181717?logo=github&logoColor=white)](https:\u002F\u002Fgithub.com\u002FKtovoz)\n\n\u003C\u002Fdiv>\n\n\u003Cdiv align=\"center\">\n\n---\n\n### License\n\n[![MIT](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FLicense-MIT-yellow.svg)](LICENSE)\n\n### Contributing\n\n[![PRs Welcome](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FPRs-Welcome-2EA44F?logo=github&logoColor=white)](https:\u002F\u002Fgithub.com\u002FKtovoz\u002FSkiritai\u002Fpulls)\n\nContributions, issues, and feature requests are welcome!\n\n\u003C\u002Fdiv>\n","Skiritai 是一个基于人工智能的浏览器测试自动化框架，它通过AI探索测试路径并生成可重放脚本以实现30倍速执行。其核心功能包括使用AI在首次运行时探索和生成测试脚本，在后续运行中直接重放这些脚本而无需再次进行AI推理，从而显著提高执行速度。此外，项目支持多种定义测试用例的方式（如YAML文件、Python类等），提供灵活的语言模型选择，并具备自动固化成功探索结果的能力。Skiritai特别适合需要快速迭代和频繁回归测试的Web应用开发场景，帮助开发者和测试工程师大幅节省时间成本。",2,"2026-06-11 03:54:30","CREATED_QUERY"]