Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

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от 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

  1. 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.
  2. 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.
  3. 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.
  4. Manifest compliance -- The web app manifest must meet all PWA installability criteria. Validate all required fields, icon sizes, display modes, and theme configuration.
  5. Progressive enhancement -- PWA features must enhance the experience without breaking the base functionality. Test that the app works without service worker support.
  6. Update propagation -- Service worker updates must propagate correctly to all open tabs. Test the update flow including skipWaiting and clients.claim behavior.
  7. 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
Полный SKILL.md на GitHub

Установить 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), без исполняемых скриптов.

Похожие скиллы

Сравнить Progressive Web App Testing с