webapp-testing by sickn33/antigravity-awesome-skills
npx skills add https://github.com/sickn33/antigravity-awesome-skills --skill webapp-testing要测试本地 Web 应用,请编写原生的 Python Playwright 脚本。
可用的辅助脚本:
scripts/with_server.py - 管理服务器生命周期(支持多个服务器)请务必先使用 --help 参数运行脚本以查看用法。除非您先尝试运行脚本并发现绝对需要定制化解决方案,否则请不要阅读源代码。这些脚本可能非常庞大,从而污染您的上下文窗口。它们的存在是为了作为黑盒脚本直接调用,而不是被摄入您的上下文窗口。
User task → Is it static HTML?
├─ Yes → Read HTML file directly to identify selectors
│ ├─ Success → Write Playwright script using selectors
│ └─ Fails/Incomplete → Treat as dynamic (below)
│
└─ No (dynamic webapp) → Is the server already running?
├─ No → Run: python scripts/with_server.py --help
│ Then use the helper + write simplified Playwright script
│
└─ Yes → Reconnaissance-then-action:
1. Navigate and wait for networkidle
2. Take screenshot or inspect DOM
3. Identify selectors from rendered state
4. Execute actions with discovered selectors
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
要启动服务器,请先运行 --help,然后使用辅助脚本:
单个服务器:
python scripts/with_server.py --server "npm run dev" --port 5173 -- python your_automation.py
多个服务器(例如,后端 + 前端):
python scripts/with_server.py \
--server "cd backend && python server.py" --port 3000 \
--server "cd frontend && npm run dev" --port 5173 \
-- python your_automation.py
要创建自动化脚本,请仅包含 Playwright 逻辑(服务器会自动管理):
from playwright.sync_api import sync_playwright
with sync_playwright() as p:
browser = p.chromium.launch(headless=True) # Always launch chromium in headless mode
page = browser.new_page()
page.goto('http://localhost:5173') # Server already running and ready
page.wait_for_load_state('networkidle') # CRITICAL: Wait for JS to execute
# ... your automation logic
browser.close()
检查渲染后的 DOM:
page.screenshot(path='/tmp/inspect.png', full_page=True)
content = page.content()
page.locator('button').all()
根据检查结果识别选择器
使用发现的选择器执行操作
❌ 不要在动态应用上等待 networkidle 之前检查 DOM
✅ 务必在检查之前等待 page.wait_for_load_state('networkidle')
scripts/ 目录中可用的脚本是否有所帮助。这些脚本可靠地处理常见且复杂的工作流,而不会使上下文窗口混乱。使用 --help 查看用法,然后直接调用。sync_playwright()text=、role=、CSS 选择器或 IDpage.wait_for_selector() 或 page.wait_for_timeout()element_discovery.py - 在页面上发现按钮、链接和输入框static_html_automation.py - 为本地 HTML 使用 file:// URLconsole_logging.py - 在自动化过程中捕获控制台日志此技能适用于执行概述中描述的工作流或操作。
每周安装次数
295
代码仓库
GitHub 星标数
26.9K
首次出现时间
Jan 19, 2026
安全审计
安装于
opencode239
gemini-cli237
claude-code229
antigravity221
codex208
cursor200
To test local web applications, write native Python Playwright scripts.
Helper Scripts Available :
scripts/with_server.py - Manages server lifecycle (supports multiple servers)Always run scripts with--help first to see usage. DO NOT read the source until you try running the script first and find that a customized solution is abslutely necessary. These scripts can be very large and thus pollute your context window. They exist to be called directly as black-box scripts rather than ingested into your context window.
User task → Is it static HTML?
├─ Yes → Read HTML file directly to identify selectors
│ ├─ Success → Write Playwright script using selectors
│ └─ Fails/Incomplete → Treat as dynamic (below)
│
└─ No (dynamic webapp) → Is the server already running?
├─ No → Run: python scripts/with_server.py --help
│ Then use the helper + write simplified Playwright script
│
└─ Yes → Reconnaissance-then-action:
1. Navigate and wait for networkidle
2. Take screenshot or inspect DOM
3. Identify selectors from rendered state
4. Execute actions with discovered selectors
To start a server, run --help first, then use the helper:
Single server:
python scripts/with_server.py --server "npm run dev" --port 5173 -- python your_automation.py
Multiple servers (e.g., backend + frontend):
python scripts/with_server.py \
--server "cd backend && python server.py" --port 3000 \
--server "cd frontend && npm run dev" --port 5173 \
-- python your_automation.py
To create an automation script, include only Playwright logic (servers are managed automatically):
from playwright.sync_api import sync_playwright
with sync_playwright() as p:
browser = p.chromium.launch(headless=True) # Always launch chromium in headless mode
page = browser.new_page()
page.goto('http://localhost:5173') # Server already running and ready
page.wait_for_load_state('networkidle') # CRITICAL: Wait for JS to execute
# ... your automation logic
browser.close()
Inspect rendered DOM :
page.screenshot(path='/tmp/inspect.png', full_page=True)
content = page.content()
page.locator('button').all()
Identify selectors from inspection results
Execute actions using discovered selectors
❌ Don't inspect the DOM before waiting for networkidle on dynamic apps ✅ Do wait for page.wait_for_load_state('networkidle') before inspection
scripts/ can help. These scripts handle common, complex workflows reliably without cluttering the context window. Use --help to see usage, then invoke directly.sync_playwright() for synchronous scriptstext=, role=, CSS selectors, or IDspage.wait_for_selector() or page.wait_for_timeout()element_discovery.py - Discovering buttons, links, and inputs on a pagestatic_html_automation.py - Using file:// URLs for local HTMLconsole_logging.py - Capturing console logs during automationThis skill is applicable to execute the workflow or actions described in the overview.
Weekly Installs
295
Repository
GitHub Stars
26.9K
First Seen
Jan 19, 2026
Security Audits
Gen Agent Trust HubWarnSocketPassSnykPass
Installed on
opencode239
gemini-cli237
claude-code229
antigravity221
codex208
cursor200
Skills CLI 使用指南:AI Agent 技能包管理器安装与管理教程
27,400 周安装
阿里云Data Lake Formation管理工具 - 使用OpenAPI和SDK管理数据湖资源
242 周安装
Go Context 使用指南:最佳实践、常见模式与错误处理
242 周安装
Google Gemini 多模态AI技能:音频转录、图像分析、视频处理、文档提取与生成
242 周安装
代码评审与质量分析工具 - 多智能体并行评审,提升开发效率与代码质量
242 周安装
OpenClaw Cron Helper:自动化任务调度与定时提醒技能使用指南
242 周安装
Agentic Workflow 多智能体流水线模式:AI任务编排与自动化实施架构
242 周安装