cap-go avatar

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-code

Installs 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
1davila7 avatarsenior-qadavila7/claude-code-templatesComprehensive QA and testing skill for quality assurance, test automation, and testing strategies for ReactJS, NextJS, NodeJS applications. Includes test suite 1.2Kskills.sh installs
2alirezarezvani avatarsenior-qaalirezarezvani/claude-skillsGenerates unit tests, integration tests, and E2E tests for React/Next.js applications. Scans components to create Jest + React Testing Library test stubs, analy1.2Kskills.sh installs
3pproenca avatarplaywrightpproenca/dot-skillsPlaywright testing best practices for Next.js applications (formerly test-playwright). This skill should be used when writing, reviewing, or debugging E2E tests1.2Kskills.sh installs
4mindrally avatarplaywrightmindrally/skillsPlaywright end-to-end testing best practices for web applications, covering test design, locator strategies, and assertion patterns.1.1Kskills.sh installs
5secondsky avatarplaywrightsecondsky/claude-skillsBrowser automation and E2E testing with Playwright. Auto-detects dev servers, writes clean test scripts. Test pages, fill forms, take screenshots, check respons1.1Kskills.sh installs
6alirezarezvani avatartdd-guidealirezarezvani/claude-skillsTest-driven development skill for writing unit tests, generating test fixtures and mocks, analyzing coverage gaps, and guiding red-green-refactor workflows acro1Kskills.sh installs