# Capacitor App Testing

> Adds unit, end to end and on device tests to your Capacitor app and plugins, with mocked native features.

- Page: https://youraiskill.com/skill/cap-go-capacitor-testing
- What it does: Testing guide for Capacitor apps and plugins. Covers web-layer unit and component tests with Vitest and mocked Capacitor plugins (`vi.mock('@capacitor/core')`, `registerPlugin`), Playwright for the web build, Appium E2E with NATIVE_APP / WEBVIEW context switching, native plugin unit tests with Swift Testing vs XCTest (what can migrate, `CAPPluginCall` patterns, `xcodebuild test` on a simulator) and Android JUnit, plus an agent-driven verification loop on simulators and devices (build, install, launch, screenshot, UI hierarchy, tap, logs) with `xcrun simctl`, `xcrun devicectl`, `adb`, Xcode MCP device tools, and live reload via `npx cap run --url` (Capacitor 9) or `-l --host --port` (Capacitor 8). Use when adding tests, mocking plugins, "does it work on device", verifying a UI change on a simulator, migrating XCTest to Swift Testing, or setting up test CI. Do not use for crash log capture (ios-android-logs), WebView debugging sessions (debugging-capacitor), or build pipelines (capacitor-ci-cd).
- Niches: testing, mobile-apps
- Licence: MIT
- Status: Checked: open licence, author credited, passed the YourAISkill safety scan. Can be added to a paid pack.
- Contents: instructions and reference files only (7 files)

To add it, see https://youraiskill.com/guides/how-to-add-a-skill-to-claude
