
Capacitor Testing
If you're building Capacitor apps and need to test them properly, this covers the full pyramid: unit tests with Vitest, component tests with React Testing Library or Vue Test Utils, E2E tests with Playwright for web and Appium for native. The plugin mocking setup is especially useful since Capacitor's native APIs are a pain to test otherwise. It shows you how to mock everything from basic Capacitor.getPlatform() calls to third-party plugins like biometric auth. The guide assumes you know your way around testing in general and jumps straight into the Capacitor-specific challenges. It's thorough on the web side but the Appium section cuts off, so you'll want other resources for complete native E2E coverage.
- skills.sh installs
- 1.4K
- GitHub stars
- 77
- last updated
- Aug 21, 2026
Install
$ npx -y skills add cap-go/capgo-skills --skill capacitor-testing --agent claude-codeInstalls into .claude/skills of the current project.
Files
Testing Capacitor Apps and Plugins
A Capacitor app has three layers to test: the web app (most logic), the native bridge and plugins (Swift/Kotlin), and the running app on a device. Pick the cheapest layer that can catch the bug.
When to Use
TRIGGER when:
- Adding unit, component or E2E tests to a Capacitor app
- Mocking Capacitor or plugin APIs in Vitest / Jest
- Writing or modernizing native unit tests for a plugin (Swift Testing, XCTest, JUnit)
- Verifying a change on a simulator, emulator or device ("test this", "does it work", "check on device")
- E2E tests that cannot find web elements in the app (WebView context)
- Setting up test jobs in CI
Do not use:
- Reading device or crash logs:
ios-android-logs - Safari Web Inspector / Chrome DevTools debugging:
debugging-capacitor - Build, signing and release pipelines:
capacitor-ci-cd - App Intents tests:
capacitor-app-intents(AppIntentsTesting)
Choose the layer
Sponsors
Details
- Repository
- github.com/cap-go/capgo-skills
- Categories
- Testing & QA, Documentation, Mobile Development
- First seen
- Jun 3, 2026
More from cap-go/capgo-skills
All 41- Capacitor Deep Linking1.3K
- Ios Android Logs1.3K
- Capacitor Security1.3K
- Capacitor Accessibility1.3K
- Capacitor Performance1.3K
- Capacitor App Store1.2K
- Capacitor Splash Screen1.2K
- Capacitor Push Notifications1.2K
- Capacitor Offline First1.1K
- Capacitor Keyboard1.1K
- Capacitor Ci Cd1K
- Tailwind Capacitor1K
- Capacitor Mcp961
- Capacitor Apple Review Preflight956
- Framework To Capacitor912
- Capgo Live Updates897
- Konsta Ui874
- Cocoapods To Spm836
- Capacitor App Upgrades815
- Cordova To Capacitor807
- Capgo Cli Usage773
- Capacitor Plugin Upgrades772
- Capacitor Plugin Spm Support756
- Capgo Native Builds754