Token导航 LogoToken导航TokenDH.com
前端设计操作浏览器github未标认证来源可访问许可证需确认审计提醒

playwright-responsive-screenshotsPlaywright responsive screenshots 测试

Agent Skill

用于辅助测试设计、自动化测试、用例整理和回归验证。它适合让 Agent 编写单元测试、端到端测试、测试计划或根据失败日志定位问题。使用时需要确认项目测试框架、运行命令和夹具数据,避免为了通过测试而改坏真实逻辑;涉及浏览器或外部服务时,应区分本地模拟、测试环境和生产环境。

总安装

212

周安装

9

GitHub Stars

1

下载量

74
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:playwright-responsive-screenshots(Playwright responsive screenshots 测试)
来源仓库:https://github.com/dawiddutoit/custom-claude
仓库路径:skills/playwright-responsive-screenshots
安装命令:
npx skills add https://github.com/dawiddutoit/custom-claude --skill playwright-responsive-screenshots
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/dawiddutoit/custom-claude --skill playwright-responsive-screenshots

简介

用于辅助前端设计中的响应式布局检查与视觉一致性验证。

  • 适合生成多设备截图并对比排版、对齐和文本溢出情况。
  • 使用时需结合现有品牌规范,通过截图预览检查结果。
  • 避免仅堆砌装饰元素,应聚焦功能与体验优化。
  • playwright-responsive-screenshots 属于前端设计类 Skill,可作为该场景下的辅助能力补充。

SKILL.md

Playwright Responsive Screenshots

Quick Start

Capture screenshots across standard breakpoints in one command:

Capture responsive screenshots of https://example.com at mobile, tablet, and desktop breakpoints

This skill automates:

  • Browser window resizing to standard breakpoints
  • Layout settling wait times
  • Full-page screenshot capture
  • Organized file naming with breakpoint identifiers
  • Optional comparison report generation

Table of Contents

  1. When to Use This Skill
  2. What This Skill Does
  3. Standard Breakpoints
  4. Instructions 4.1. Basic Screenshot Capture 4.2. Custom Breakpoints 4.3. Multiple Pages 4.4. With Comparison Report
  5. Supporting Files
  6. Expected Outcomes
  7. Requirements
  8. Red Flags to Avoid

When to Use This Skill

Explicit Triggers:

  • "Test responsive design for [URL]"
  • "Screenshot at breakpoints"
  • "Capture mobile and desktop views of [page]"
  • "Validate responsive layout"
  • "Generate screenshots for design review"

Implicit Triggers:

  • User mentions testing across devices
  • Request for multi-device validation
  • Need to document responsive behavior
  • Visual regression testing setup
  • Design system breakpoint validation

Debugging Scenarios:

  • Layout breaks at certain viewport widths
  • Media query verification needed
  • CSS breakpoint testing
  • Responsive component validation

What This Skill Does

This skill provides an automated workflow for capturing screenshots at multiple viewport sizes:

  1. Define breakpoints - Use standard or custom viewport dimensions
  2. Navigate to target - Open the URL in Playwright browser
  3. Resize and capture - For each breakpoint: resize window, wait for layout, screenshot
  4. Organize output - Name files with breakpoint identifiers (e.g., homepage-mobile.png)
  5. Generate report - Optional comparison table with screenshot paths

Key Benefits:

  • Consistent viewport sizes across captures
  • Proper layout settling before screenshots
  • Organized file naming convention
  • Full-page screenshots by default
  • Reproducible test results

Standard Breakpoints

This skill uses industry-standard breakpoints by default:

Device CategoryWidth × HeightCommon Devices
Mobile375 × 667iPhone SE, iPhone 12/13/14
Tablet768 × 1024iPad, iPad Mini, Android tablets
Desktop1920 × 1080Standard HD desktop/laptop

Breakpoint Selection Rationale:

  • Mobile: Most common iPhone viewport (covers ~40% of mobile traffic)
  • Tablet: Standard iPad portrait orientation
  • Desktop: 1080p standard (most common desktop resolution)

When to Use Custom Breakpoints:

  • Testing specific device models
  • Validating custom media query breakpoints
  • Client-specific device requirements
  • Edge case viewport testing (ultra-wide, small tablets, etc.)

Instructions

4.1. Basic Screenshot Capture

Workflow:

  1. Define target and breakpoints URL: https://example.com/page Breakpoints: mobile, tablet, desktop (standard)
  2. Navigate to page

- Use browser_navigate to open URL - Verify page loads successfully

  1. For each breakpoint:

- Resize browser window using browser_resize - Wait for layout to settle using browser_wait_for (1 second minimum) - Capture full-page screenshot using browser_take_screenshot with fullPage: true - Name file descriptively: {page-name}-{breakpoint}.png

  1. Organize screenshots

- Save to predictable location (e.g., screenshots/) - Group by page or breakpoint as appropriate

  1. Confirm completion

- Report number of screenshots captured - List file paths for user verification

Example:

User: "Capture responsive screenshots of https://myapp.dev/dashboard"

Assistant workflow:
1. browser_navigate to https://myapp.dev/dashboard
2. browser_resize(375, 667) → wait 1s → browser_take_screenshot("dashboard-mobile.png", fullPage: true)
3. browser_resize(768, 1024) → wait 1s → browser_take_screenshot("dashboard-tablet.png", fullPage: true)
4. browser_resize(1920, 1080) → wait 1s → browser_take_screenshot("dashboard-desktop.png", fullPage: true)
5. Report: "Captured 3 screenshots: dashboard-mobile.png, dashboard-tablet.png, dashboard-desktop.png"

4.2. Custom Breakpoints

When user specifies custom viewport sizes:

  1. Parse breakpoint specifications

- Accept formats: "414x896" or "414 x 896" or "width: 414, height: 896" - Validate dimensions are reasonable (width 200-3840, height 200-2160)

  1. Name custom breakpoints descriptively

- Use width for identifier: "homepage-414w.png" - Or use user-provided labels: "homepage-iphone14pro.png"

  1. Follow same workflow

- Navigate → Resize → Wait → Capture - Apply 1-second wait minimum after resize

Example:

User: "Screenshot https://app.com at 414x896 (iPhone 14 Pro) and 393x851 (Pixel 7)"

Assistant workflow:
1. browser_navigate to https://app.com
2. browser_resize(414, 896) → wait 1s → browser_take_screenshot("app-iphone14pro.png", fullPage: true)
3. browser_resize(393, 851) → wait 1s → browser_take_screenshot("app-pixel7.png", fullPage: true)

4.3. Multiple Pages

For testing multiple pages at standard breakpoints:

  1. Create page list

- Extract page names from URLs for file naming - Examples: "/dashboard" → "dashboard", "/settings/profile" → "settings-profile"

  1. Nested loop structure

- Outer loop: pages - Inner loop: breakpoints - Alternative: breakpoints outer, pages inner (user preference)

  1. Naming convention

- {page-name}-{breakpoint}.png - Example: dashboard-mobile.png, dashboard-tablet.png, settings-mobile.png

  1. Optimize navigation

- Navigate once per page (before breakpoint loop) - Resize/capture without re-navigating

Example:

User: "Capture responsive screenshots for /home, /products, and /about pages on https://shop.com"

Assistant workflow:
For each page in ["/home", "/products", "/about"]:
  1. browser_navigate to https://shop.com{page}
  2. For each breakpoint in [mobile, tablet, desktop]:
     - browser_resize(width, height)
     - browser_wait_for(1 second)
     - browser_take_screenshot("{page-name}-{breakpoint}.png", fullPage: true)

Result: 9 screenshots (3 pages × 3 breakpoints)

4.4. With Comparison Report

Generate markdown report after screenshot capture:

  1. Capture screenshots (as above)
  2. Create markdown table with embedded images and metadata
  3. Save to screenshots/report.md (or user-specified location)
  4. Include timestamp, URL, dimensions, and layout notes

See examples/examples.md for full report template example.

Supporting Files

references/playwright-api.md

Playwright MCP tool reference for screenshot operations:

  • browser_navigate - Navigation and URL handling
  • browser_resize - Viewport dimension control
  • browser_wait_for - Waiting strategies for layout settling
  • browser_take_screenshot - Screenshot capture options

examples/examples.md

Comprehensive screenshot capture examples:

  • Standard breakpoint captures
  • Custom device viewports
  • Multi-page workflows
  • Report generation
  • Edge cases (ultra-wide, mobile landscape, etc.)

scripts/validate_screenshots.py

Python utility to validate screenshot dimensions match expected breakpoints.

Expected Outcomes

Successful Screenshot Capture

✅ Responsive Screenshots Captured

URL: https://example.com/homepage
Breakpoints: mobile, tablet, desktop
Pages: 1

Screenshots:
  ✓ homepage-mobile.png (375×667, 234KB)
  ✓ homepage-tablet.png (768×1024, 512KB)
  ✓ homepage-desktop.png (1920×1080, 1.2MB)

Location: /Users/username/screenshots/
Total time: 8.3 seconds

All screenshots captured successfully. Full-page screenshots enabled.

With Comparison Report

✅ Responsive Screenshots Captured with Report

URL: https://shop.com
Breakpoints: mobile, tablet, desktop
Pages: 3 (/home, /products, /about)

Screenshots: 9 total
  ✓ home-mobile.png, home-tablet.png, home-desktop.png
  ✓ products-mobile.png, products-tablet.png, products-desktop.png
  ✓ about-mobile.png, about-tablet.png, about-desktop.png

Report: screenshots/report.md

View comparison report for side-by-side layout analysis.

Validation Failure

❌ Screenshot Capture Failed

URL: https://broken-site.com
Issue: Page failed to load (timeout after 30s)

Breakpoint progress:
  ✗ mobile - not attempted (navigation failed)
  ✗ tablet - not attempted
  ✗ desktop - not attempted

Recommendation: Verify URL is accessible and site is responding.

Requirements

Playwright MCP Tools:

  • browser_navigate - Navigate to URLs
  • browser_resize - Set viewport dimensions
  • browser_wait_for - Wait for layout settling
  • browser_take_screenshot - Capture screenshots

Browser Requirements:

  • Playwright browser installed and configured
  • Sufficient viewport size support (minimum 200×200, maximum 3840×2160)

File System:

  • Write permissions for screenshot output directory
  • Sufficient disk space (estimate ~1-2MB per desktop screenshot)

Network:

  • Access to target URLs
  • Stable connection for page loading

Red Flags to Avoid

  1. Skipping layout settling wait - Always wait minimum 1s after resize
  2. Not using fullPage: true - Missing content below fold
  3. Inconsistent file naming - Use {page-name}-{breakpoint}.png
  4. Unreasonable viewport dimensions - Validate 200-3840 width, 200-2160 height
  5. Re-navigating for each breakpoint - Navigate once, resize in loop
  6. Ignoring page load failures - Verify navigation success first
  7. Missing screenshot organization - Use dedicated output directory
  8. Not reporting file locations - Provide absolute paths
  9. Forgetting viewport height - Always specify both width and height
  10. Not validating custom breakpoints - Parse and validate dimensions

Notes

Performance: Adjust wait times (500ms static, 1s standard, 2-3s SPAs). Navigate once per page. Breakpoints: Use actual device viewports, not arbitrary sizes. Document custom breakpoints. Quality: PNG for UI (lossless), JPEG for photos (smaller). Screenshots serve as visual regression baselines.

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

35.08%
按下载量换算26

Claude

27.91%
按下载量换算21

Cursor

18.5%
按下载量换算14

Gemini CLI

9.96%
按下载量换算7

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

可疑

权限和风险

操作浏览器

该 Skill 可能涉及浏览器控制能力,使用时可能读取或操作网页内容,需要在受控环境中确认权限边界。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在 warning/failed 结果,不能写成本站确认安全。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills