mobile-app-testing · secondsky — Claude Code skill: mobile app testing
A skill for testing mobile apps: unit tests, UI automation, E2E and performance. Useful when you need to set up test infrastructure.
npx skills add secondsky/claude-skills --skill mobile-app-testing -a claude-codeWhat mobile-app-testing does
The skill lays out a testing pyramid for mobile apps: unit level on Jest, XCTest and JUnit, integration on Detox and Espresso, E2E on Appium and Detox. Inside are ready examples for React Native, iOS and Android. For React Native it shows a unit test for a cart service and a Detox login E2E flow, for iOS an XCTest case, for Android an Espresso one.
Alongside the code there is a list of practices: test business logic first, mock external dependencies, cover both success and failure paths, automate critical user flows. It also lists what to avoid: testing implementation details, hardcoded test data, interdependent tests. It advises keeping coverage above 80% and running tests on real devices periodically.
The skill does not replace the frameworks themselves: for the examples to run, Jest, Detox, XCTest or Espresso have to be in place already. That is worth checking before you ask the agent to write tests.
What it helps with
- split tests across the pyramid levels
- write a Detox E2E login flow
- cover cart business logic with unit tests
- move UI checks from manual runs to Espresso
- break the coupling between tests
Example prompts for the agent
- set up React Native tests: Jest unit and Detox E2E
- write a Detox E2E login test for our app
- map our tests to the pyramid and tell me what is missing
How to install mobile-app-testing
1Skills CLI (Vercel)
npx skills add secondsky/claude-skills --skill mobile-app-testing -a claude-code2Manually: put the files in place
~/.claude/skills/mobile-app-testing/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/mobile-app-testing/
1Skills CLI (Vercel)
npx skills add secondsky/claude-skills --skill mobile-app-testing -a codex2Manually: put the files in place
.agents/skills/mobile-app-testing/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add secondsky/claude-skills --skill mobile-app-testing -a cursor2Manually: put the files in place
.cursor/skills/mobile-app-testing/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install secondsky/claude-skills mobile-app-testing2Manually: put the files in place
.github/skills/mobile-app-testing/SKILL.md1Skills CLI (Vercel)
npx skills add secondsky/claude-skills --skill mobile-app-testing -a gemini-cli2Platform CLI
gemini skills install https://github.com/secondsky/claude-skills --path plugins/mobile-app-testing/skills/mobile-app-testingManually: put the files in place
.devin/skills/mobile-app-testing/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add secondsky/claude-skills --skill mobile-app-testing -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: How to install skills in Claude Code: five ways
Questions about mobile-app-testing
How do I install mobile-app-testing in Claude?
Run npx skills add secondsky/claude-skills --skill mobile-app-testing -a claude-code. The skill then lives at ~/.claude/skills/mobile-app-testing/SKILL.md.
What does mobile-app-testing do?
It describes a testing strategy for mobile apps: unit, integration and E2E tests, with examples for React Native, iOS and Android.
Which test frameworks does the skill cover?
The examples use Jest and Detox for React Native, XCTest for iOS, Espresso and Appium for Android. Those frameworks need to be set up in your project first.
Source text
SKILL.md · MIT
---
name: mobile-app-testing
description: Mobile app testing with unit tests, UI automation, performance testing. Use for test infrastructure, E2E tests, testing standards, or encountering test framework setup, device farms, flaky tests, platform-specific test errors.
metadata:
keywords: "mobile testing, unit testing, UI automation, E2E testing, Jest, XCTest, JUnit, Detox, Espresso, Appium, React Native testing, iOS testing, Android testing, test framework, device farms, flaky tests, mobile test automation, integration testing, testing pyramid, test coverage"
license: MIT
---
# Mobile App Testing
Implement comprehensive testing strategies for mobile applications.
## Testing Pyramid
| Level | Tools | Coverage |
|-------|-------|----------|
| Unit | Jest, XCTest, JUnit | 70% |
| Integration | Detox, Espresso | 20% |
| E2E | Appium, Detox | 10% |
## React Native (Jest + Detox)
```javascript
// Unit test
describe('CartService', () => {
it('calculates total correctly', () => {
const cart = new CartService();
cart.addItem({ price: 10, quantity: 2 });
expect(cart.getTotal()).toBe(20);
});
});
// E2E test (Detox)
describe('Login flow', () => {
beforeEach(async () => {
await device.reloadReactNative();
});
it('should login successfully', async () => {
await element(by.id('email-input')).typeText('[email protected]');
await element(by.id('password-input')).typeText('password123');
await element(by.id('login-button')).tap();
await expect(element(by.id('dashboard'))).toBeVisible();
});
});
```
## iOS (XCTest)
```swift
func testLoginSuccess() {
let app = XCUIApplication()
app.launch()
app.textFields["email"].tap()
app.textFields["email"].typeText("[email protected]")
app.secureTextFields["password"].typeText("password123")
app.buttons["Login"].tap()
XCTAssertTrue(app.staticTexts["Welcome"].exists)
}
```
## Android (Espresso)
```kotlin
@Test
fun loginSuccess() {
onView(withId(R.id.email)).perform(typeText("[email protected]"))
onView(withId(R.id.password)).perform(typeText("password123"))
onView(withId(R.id.loginButton)).perform(click())
onView(withId(R.id.dashboard)).check(matches(isDisplayed()))
}
```
## Best Practices
- Test business logic first (unit tests)
- Mock external dependencies
- Test both success and failure paths
- Automate critical user flows
- Maintain >80% code coverage
- Test on real devices periodically
## Avoid
- Testing implementation details
- Hardcoded test data
- Interdependent tests
- Skipping error case testing
© secondsky · MIT · secondsky/claude-skills
Similar skills
All skills for Testing and QA →mobile-app-testing by other authors comes first.