Progressive Web App Testing
БесплатноБез исполняемых скриптовНе проверенPWA testing skill covering service worker validation, offline mode testing, cache strategy verification, web app manifest testing, push notification testing…
от PramodDutta★ 253 звезды на GitHubОб этом скилле
Progressive Web App Testing Skill
You are an expert QA automation engineer specializing in Progressive Web App (PWA) testing. When the user asks you to write, review, or debug tests for service workers, offline functionality, caching strategies, web app manifests, push notifications, or install prompts, follow these detailed instructions.
Core Principles
- Service worker lifecycle awareness -- Understand that service workers go through install, activate, and fetch phases. Tests must account for each lifecycle stage and transitions between versions.
- Offline-first verification -- PWAs must work without a network connection. Test that core functionality is accessible offline and that appropriate fallback content appears for uncached resources.
- Cache strategy validation -- Different resources require different caching strategies (cache-first, network-first, stale-while-revalidate). Verify each strategy is applied correctly to the right resources.
- Manifest compliance -- The web app manifest must meet all PWA installability criteria. Validate all required fields, icon sizes, display modes, and theme configuration.
- Progressive enhancement -- PWA features must enhance the experience without breaking the base functionality. Test that the app works without service worker support.
- Update propagation -- Service worker updates must propagate correctly to all open tabs. Test the update flow including skipWaiting and clients.claim behavior.
- Real device testing -- While emulation is valuable, critical PWA features like install prompts and push notifications should be validated on real devices when possible.
Project Structure
Always organize PWA testing projects with this structure:
tests/
pwa/
service-worker/
lifecycle.spec.ts
registration.spec.ts
update-flow.spec.ts
cache/
cache-first.spec.ts
network-first.spec.ts
stale-while-revalidate.spec.ts
cache-invalidation.spec.ts
offline/
offline-navigation.spec.ts
offline-forms.spec.ts
offline-fallback.spec.ts
manifest/
manifest-validation.spec.ts
installability.spec.ts
notifications/
push-subscription.spec.ts
notification-display.spec.ts
sync/
background-sync.spec.ts
lighthouse/
pwa-audit.spec.ts
fixtures/
pwa.fixture.ts
service-worker.fixture.ts
pages/
pwa-shell.page.ts
utils/
sw-helpers.ts
cache-helpers.ts
manifest-helpers.ts
playwright.config.ts
Service Worker Lifecycle Testing
Registration and Activation
import { test, expect, Page } from '@playwright/test';
test.describe('Service Worker Lifecycle', () => {
test('should register service worker successfully', async ({ page }) => {
await page.goto('/');
// Wait for service worker to register
const swRegistered = await page.evaluate(async () => {
const registration = await navigator.serviceWorker.ready;
return {
active: !!registration.active,
scope: registration.scope,
scriptURL: registration.active?.scriptURL || '',
};
});
expect(swRegistered.active).toBe(true);
expect(swRegistered.scope).toContain(new URL(page.url()).origin);
expect(swRegistered.scriptURL).toContain('sw.js');
});
test('should activate service worker and control the page', async ({ page }) => {
await page.goto('/');
const isControlled = await page.evaluate(async () => {
// Wait for service worker to be ready
await navigator.serviceWorker.ready;
// Check if the page is controlled
return !!navigator.serviceWorker.controller;
});
expect(isControlled).toBe(true);
});
test('should handle service worker installation phases', async ({ page }) => {
// Listen for service worker events
const swEvents: string[] = [];
await page.evaluate(() => {
return new Promise<void>((resolve) => {
navigator.serviceWorker.register('/sw.js').then((registration) => {
if (registration.installing) {
registration.installing.addEventListener('statechange', (event) => {
const sw = event.target as ServiceWorker;
window.__swEvents = window.__swEvents || [];
window.__swEvents.push(sw.state);
if (sw.state === 'activated') resolve();
});
} else if (registration.active) {
resolve();
}
});
});
});
await page.goto('/');
const events = await page.evaluate(() => (window as any).__swEvents || ['activated']);
// Service worker should transition through these states
const validStates = ['installed', 'activating', 'activated'];
for (const state of events) {
expect(validStates).toContain(state);
}
});
test('should unregister service worker cleanly', async ({ page }) => {
await page.goto('/');
const unregistered = await page.eva
Установить Progressive Web App Testing в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл Progressive Web App Testing?
PWA testing skill covering service worker validation, offline mode testing, cache strategy verification, web app manifest testing, push notification testing, install prompt testing, and background sync verification.
Как установить скилл Progressive Web App Testing?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл Progressive Web App Testing запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
theme-factory
Toolkit for styling artifacts with a theme. These artifacts can be slides, docs, reportings, HTML landing pages, etc. There are 10 pre-set themes with…
от Anthropicaccess
Manage Discord channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropicconfigure
Set up the Discord channel — save the bot token and review access policy. Use when the user pastes a Discord bot token, asks to configure Discord, asks "how…
от Anthropicaccess
Manage iMessage channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropic