playwright-pwa-offline

Validate offline deep-link routing against a prerendered Workbox shell.

1|Updated Apr 26, 2026
One-click install
npx skills add https://github.com/matthewharwood/dean-stack --skill playwright-pwa-offline
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: playwright-pwa-offline
Source: https://github.com/matthewharwood/dean-stack/tree/main/.claude/skills/playwright-pwa-offline
Command: npx skills add https://github.com/matthewharwood/dean-stack --skill playwright-pwa-offline

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

The offline-deep-link contract ensures a Workbox service worker can precache and serve the prerendered SPA shell offline, enabling client-side routing to resolve deep links without a server round-trip while reading from IndexedDB.

Core Features & Use Cases

  • End-to-end offline verification of deep-link routing against a prerendered shell in the dean-stack PWA.
  • Guarantees that the Workbox SW is installed, the shell is cached, and navigation resolves client-side when offline.
  • Suitable for CI gating, offline scenario testing, and validating IDB hydration in offline mode.

Quick Start

Run the offline-deep-link Playwright contract to verify that a navigated deep URL loads from the prerendered shell while offline.

Frequently Asked Questions about playwright-pwa-offline

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

FAQPage Schema
How do I test offline deep-link routing with Playwright for a PWA?

To test offline deep-link routing with Playwright, the Skill validates that a Workbox service worker serves a prerendered SPA shell, enabling client-side routing to resolve deep links without a server round-trip. It verifies the SW is installed and the shell is cached.

Can I verify IndexedDB hydration during offline e2e-testing scenarios?

Yes, offline e2e-testing can verify IndexedDB hydration. The Skill supports optional IDB seeding to validate offline mode, ensuring the prerendered shell correctly reads from IndexedDB when navigating deep links while the network is disconnected.

How does a service worker serve a prerendered shell when offline in Playwright?

A Workbox service worker precaches the prerendered shell during installation. When offline, the SW intercepts navigation requests and serves the cached shell, allowing the SPA router to resolve the deep link client-side without requiring a server round-trip.

What's the best way to gate CI on offline PWA navigation fallbacks?

The best way to gate CI on offline PWA navigation fallbacks is running a Playwright contract that asserts the service worker intercepts requests and serves the prerendered shell. This guarantees offline routing and IDB hydration succeed before deployment.

Does this offline Playwright test require a configured service worker lifecycle?

Yes, proper service worker lifecycle handling is required. The Playwright tests must be configured for offline mode to validate the Workbox SW installation, shell precaching, and navigation fallback behavior for deep links.

Why does offline deep-link routing fail without a prerendered shell in a PWA?

Offline deep-link routing fails without a prerendered shell because the service worker has no cached HTML to serve. Without the precached shell, client-side routing cannot initialize to resolve the deep link, causing navigation to fail when offline.