playwright-whileinview-screenshots

Automates Playwright screenshots by scrolling to trigger animations before capture.

Updated Mar 4, 2026
One-click install
npx skills add https://github.com/hubeiqiao/skills --skill playwright-whileinview-screenshots
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: playwright-whileinview-screenshots
Source: https://github.com/hubeiqiao/skills/tree/main/playwright-whileinview-screenshots
Command: npx skills add https://github.com/hubeiqiao/skills --skill playwright-whileinview-screenshots

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve?

This Skill addresses the issue of blank or invisible sections appearing in Playwright full-page screenshots when animations are triggered by scroll events, ensuring accurate visual captures of dynamic web content.

Core Features & Use Cases

  • Animation Triggering: Programmatically scrolls through a webpage to ensure animations (like Framer Motion's whileInView) are triggered before capturing screenshots.
  • Reliable Screenshots: Captures accurate full-page or per-section screenshots of dynamic content that would otherwise appear blank.
  • Use Case: When using Playwright to test a marketing website with animated hero sections that only appear on scroll, this skill ensures those sections are visible and correctly captured in automated screenshots.

Quick Start

Use the playwright-whileinview-screenshots skill to capture a screenshot of the 'features' section from the provided URL.

Frequently Asked Questions about playwright-whileinview-screenshots

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
Why are my Playwright full-page screenshots blank for sections using Framer Motion whileInView?▼

Playwright screenshots are blank because IntersectionObserver-based scroll animations do not fire during automated capture. The page must be programmatically scrolled first to trigger these animations and reveal the dynamic content before taking the screenshot.

How do I capture full-page screenshots of scroll-triggered animations in Playwright?▼

To capture scroll-triggered animations in Playwright, programmatically scroll through the webpage to trigger IntersectionObserver events before capturing the screenshot. This ensures dynamic content from libraries like Framer Motion or GSAP ScrollTrigger is fully visible.

Does this approach work with GSAP ScrollTrigger animations or only Framer Motion?▼

Yes, this approach works with GSAP ScrollTrigger animations as well as Framer Motion. It handles any web page employing scroll-triggered animations driven by the IntersectionObserver API, ensuring accurate visual captures of the dynamic content.

What is the best way to automate screenshots of a marketing website with animated hero sections?▼

The best way to automate screenshots of marketing websites with animated hero sections is to programmatically scroll the page to trigger visibility events before capturing. This ensures scroll-triggered animations are fully rendered and captured accurately.

Can I capture per-section screenshots instead of full-page captures for animated content?▼

Yes, you can capture accurate per-section screenshots of dynamic content. By programmatically scrolling to ensure animations are triggered before screenshotting, both full-page and specific section captures will correctly show the animated elements.

Playwright screenshot not working for dynamic content, do I need to scroll the page manually?▼

No, manual scrolling is not needed. The skill automates the scrolling process programmatically, triggering IntersectionObserver-based animations before the screenshot is taken, ensuring dynamic content is reliably captured without blank sections.