Web Application Testing Skill
完整提示词
--- name: web-application-testing-skill description: A toolkit for interacting with and testing local web applications using Playwright. --- # Web Application Testing This skill enables comprehensive testing and debugging of local web applications using Playwright automation. ## When to Use This Skill Use this skill when you need to: - Test frontend functionality in a real browser - Verify UI behavior and interactions - Debug web application issues - Capture screenshots for documentation or debugging - Inspect browser console logs - Validate form submissions and user flows - Check responsive design across viewports ## Prerequisites - Node.js installed on the system - A locally running web application (or accessible URL) - Playwright will be installed automatically if not present ## Core Capabilities ### 1. Browser Automation - Navigate to URLs - Click buttons and links - Fill form fields - Select dropdowns - Handle dialogs and alerts ### 2. Verification - Assert element presence - Verify text content - Check element visibility - Validate URLs - Test responsive behavior ### 3. Debugging - Capture screenshots - View console logs - Inspect network requests - Debug failed tests ## Usage Examples ### Example 1: Basic Navigation Test ```javascript // Navigate to a page and verify title await page.goto('http://localhost:3000'); const title = await page.title(); console.log('Page title:', title); ``` ### Example 2: Form Interaction ```javascript // Fill out and submit a form await page.fill('#username', 'testuser'); await page.fill('#password', 'password123'); await page.click('button[type="submit"]'); await page.waitForURL('**/dashboard'); ``` ### Example 3: Screenshot Capture ```javascript // Capture a screenshot for debugging await page.screenshot({ path: 'debug.png', fullPage: true }); ``` ## Guidelines 1. **Always verify the app is running** - Check that the local server is accessible before running tests 2. **Use explicit waits** - Wait for elements or navigation to complete before interacting 3. **Capture screenshots on failure** - Take screenshots to help debug issues 4. **Clean up resources** - Always close the browser when done 5. **Handle timeouts gracefully** - Set reasonable timeouts for slow operations 6. **Test incrementally** - Start with simple interactions before complex flows 7. **Use selectors wisely** - Prefer data-testid or role-based selectors over CSS classes ## Common Patterns ### Pattern: Wait for Element ```javascript await page.waitForSelector('#element-id', { state: 'visible' }); ``` ### Pattern: Check if Element Exists ```javascript const exists = await page.locator('#element-id').count() > 0; ``` ### Pattern: Get Console Logs ```javascript page.on('console', msg => console.log('Browser log:', msg.text())); ``` ### Pattern: Handle Errors ```javascript try { await page.click('#button'); } catch (error) { await page.screenshot({ path: 'error.png' }); throw error; } ``` ## Limitations - Requires Node.js environment - Cannot test native mobile apps (use React Native Testing Library instead) - May have issues with complex authentication flows - Some modern frameworks may require specific configuration
使用说明
复制全文后,按自己的场景替换占位变量(方括号 / 双花括号包裹的字段)再使用。 部分提示词依赖特定模型或工具(如 GPT / Claude / Copilot),请根据实际情况调整。
反向发现
这个提示词用过的相关论文与工具相关论文
- cs.HC已译
CRM-Agent-Bench:面向有状态企业环境的工具型智能体基准
2610.32004 - cs.CY已译
PersonaMem-v3:迈向全平台个人智能,实现整体用户理解、推荐与智能体任务
2608.21381
相关工具
- agentnews独立开发者用 AIPass 构建持久化 AI 智能体团队独立开发者以 AIPass 构建由 DevPulse 统领的持久化 AI 智能体团队,用于规划、执行、测试和持续维护项目。各智能体拥有独立身份、记忆、邮箱、代码、测试与历史,DevPulse 负责分派任务、审查结果和集成改动,并按 CPU 容量安排工作;系统正整合 Codex 与 Claude Code,让同一智能体跨模型提供商保持身份和知识。查看工具
- agentnews独立开发者用 AIPass 构建持久化 AI 智能体团队独立开发者以 AIPass 构建由 DevPulse 统领的持久化 AI 智能体团队,用于规划、执行、测试和持续维护项目。各智能体拥有独立身份、记忆、邮箱、代码、测试与历史,DevPulse 负责分派任务、审查结果和集成改动,并按 CPU 容量安排工作;系统正整合 Codex 与 Claude Code,让同一智能体跨模型提供商保持身份和知识。查看工具
- productivitynewsAnthropic 推出 Claude for Google Workspace 公测版Anthropic 在所有付费 Claude 套餐中公测 Claude for Google Workspace,在 Google Docs、Sheets 和 Slides 侧边栏中直接调用 Claude,可就地修改文档、写入公式、构建数据透视表和新幻灯片,并支持 Ask before edits 与 Accept all edits 两种模式。查看工具
- productivitynewsAnthropic 推出 Claude for Google Workspace 公测版Anthropic 在所有付费 Claude 套餐中公测 Claude for Google Workspace,在 Google Docs、Sheets 和 Slides 侧边栏中直接调用 Claude,可就地修改文档、写入公式、构建数据透视表和新幻灯片,并支持 Ask before edits 与 Accept all edits 两种模式。查看工具
- agentnewsAtticus:按住快捷键说话即可跨 App 操作的智能体工具Atticus 是一款按住快捷键说话、松手即可让 AI 替你执行操作的智能体工具,支持打开应用、代为购物、填写表单并回答屏幕内容相关问题;在涉及购买或发送等动作前会向用户确认,简单的任务不调用 AI,复杂任务则走用户自己的 Claude 计划。该项目免费开源。查看工具
- agentnewsAtticus:按住快捷键说话即可跨 App 操作的智能体工具Atticus 是一款按住快捷键说话、松手即可让 AI 替你执行操作的智能体工具,支持打开应用、代为购物、填写表单并回答屏幕内容相关问题;在涉及购买或发送等动作前会向用户确认,简单的任务不调用 AI,复杂任务则走用户自己的 Claude 计划。该项目免费开源。查看工具