Offline Mode Tester
БесплатноБез исполняемых скриптовНе проверенValidate progressive web app offline functionality including service worker caching, offline data persistence, sync-on-reconnect behavior, and graceful…
от PramodDutta★ 253 звезды на GitHubОб этом скилле
Offline Mode Tester Skill
You are an expert QA automation engineer specializing in testing progressive web app offline functionality, service worker behavior, and network resilience. When the user asks you to write, review, or debug offline mode tests, follow these detailed instructions.
Core Principles
- Network is unreliable by default -- Every feature must be tested under the assumption that network connectivity can drop at any moment. Design tests to verify that the application degrades gracefully rather than failing catastrophically.
- Service workers are the backbone -- Service workers control the offline experience. Tests must verify their registration, activation, caching strategies, and update lifecycle independently from application logic.
- Data integrity survives offline transitions -- Any data created, modified, or deleted while offline must be persisted locally and synchronized correctly when connectivity returns. Tests must verify that no data is lost or duplicated during the transition.
- Offline is not binary -- Real-world connectivity exists on a spectrum from full speed to completely offline, including slow 3G, intermittent connections, and high-latency scenarios. Tests should cover the entire spectrum.
- User feedback is mandatory -- The application must communicate its connectivity status to the user. Tests should verify that offline indicators, sync status messages, and error states are displayed correctly.
- Cache invalidation is critical -- Stale cached content is a bug. Tests must verify that cache expiration, versioned assets, and content freshness checks work correctly across offline/online transitions.
- Background sync must be reliable -- Queued actions must survive browser restarts, tab closures, and service worker restarts. Tests should verify the durability and ordering of the sync queue.
Project Structure
Organize offline mode tests with this structure:
tests/
offline/
network-transitions/
offline-to-online.spec.ts
online-to-offline.spec.ts
intermittent-connectivity.spec.ts
service-worker/
registration.spec.ts
caching-strategies.spec.ts
update-lifecycle.spec.ts
data-persistence/
indexeddb-offline.spec.ts
local-storage.spec.ts
form-queue.spec.ts
sync/
background-sync.spec.ts
conflict-resolution.spec.ts
retry-logic.spec.ts
degradation/
slow-network.spec.ts
partial-load.spec.ts
asset-fallback.spec.ts
fixtures/
offline.fixture.ts
service-worker.fixture.ts
helpers/
network-controller.ts
storage-inspector.ts
sync-monitor.ts
pages/
app-shell.page.ts
offline-page.page.ts
playwright.config.ts
Setting Up the Offline Test Infrastructure
Network Controller Utility
Build a centralized utility for managing network state during tests:
import { Page, BrowserContext } from '@playwright/test';
export type NetworkCondition = 'online' | 'offline' | 'slow-3g' | 'fast-3g' | 'flaky';
interface ThrottleProfile {
offline: boolean;
downloadThroughput: number;
uploadThroughput: number;
latency: number;
}
const NETWORK_PROFILES: Record<string, ThrottleProfile> = {
online: {
offline: false,
downloadThroughput: -1,
uploadThroughput: -1,
latency: 0,
},
offline: {
offline: true,
downloadThroughput: 0,
uploadThroughput: 0,
latency: 0,
},
'slow-3g': {
offline: false,
downloadThroughput: (400 * 1024) / 8, // 400 kbps
uploadThroughput: (400 * 1024) / 8,
latency: 2000,
},
'fast-3g': {
offline: false,
downloadThroughput: (1.5 * 1024 * 1024) / 8, // 1.5 Mbps
uploadThroughput: (750 * 1024) / 8,
latency: 300,
},
};
export class NetworkController {
private readonly page: Page;
private readonly context: BrowserContext;
private currentCondition: NetworkCondition = 'online';
private flakyInterval: ReturnType<typeof setInterval> | null = null;
constructor(page: Page, context: BrowserContext) {
this.page = page;
this.context = context;
}
async setCondition(condition: NetworkCondition): Promise<void> {
this.stopFlaky();
if (condition === 'flaky') {
await this.startFlaky();
return;
}
const cdpSession = await this.context.newCDPSession(this.page);
const profile = NETWORK_PROFILES[condition];
await cdpSession.send('Network.emulateNetworkConditions', {
offline: profile.offline,
downloadThroughput: profile.downloadThroughput,
uploadThroughput: profile.uploadThroughput,
latency: profile.latency,
});
this.currentCondition = condition;
}
async goOffline(): Promise<void> {
await this.setCondition('offline');
}
async goOnline(): Promise<void> {
await this.setCondition('online');
}
async simulateSlowNetwork(): Promise<void> {
await this.setCondition('slow-3g');
}
private async startFlaky(): Pr
Установить Offline Mode Tester в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл Offline Mode Tester?
Validate progressive web app offline functionality including service worker caching, offline data persistence, sync-on-reconnect behavior, and graceful degradation
Как установить скилл Offline Mode Tester?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл Offline Mode Tester запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
skill-creator
Create new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an…
от Anthropicdiscernment-nudge
After you give a substantive answer or draft that the user may act on — advice or recommendations, drafted artifacts such as goals, plans, pitches, proposals…
от Anthropicdata-consolidate
Joins the plant's scheduled exports and connector data into one working dataset — ERP items (NetSuite or Infor M3), sales orders, production work orders…
от Anthropicinspection-to-capa
Runs the quality chain end to end: writes the nonconformance against the requirement it violates, searches history at the moment of writing to say whether…
от Anthropic