Skip to main content

This skill may not reflect the latest upstream change

Next.js Releases update on 2026-11-09 may affect this skill Last checked Nov 25, 2026.

TestOfficialCertifiedAI reviewed Jul 21, 2026

mobile-test

We earn commissions when you shop through the links below.

Generate a complete mobile test suite covering unit, widget, integration, snapshot, accessibility, and platform-specific tests. Triggers: you need to add tests to a mobile app, increase test coverage, verify accessibility labels.

v2.0.15 installs

Install this skill

No account required. Pick your tool, or use the command that detects it for you.

Run in your terminal. It detects your AI tool.

npx @skills-hub-ai/cli install mobile-test
Or get the file:
Browse all CLI commands →
Manual setup by platform

Claude Code

~/.claude/skills/mobile-test/SKILL.md

Setup guide →

Signing

SignedSLSA L2
Signed by
skills-hub.ai distributor
Method
Distributor-signed by skills-hub.aiSigned with the skills-hub.ai Ed25519 distributor key over this exact slug, version and content. Check it with `npx @skills-hub-ai/cli verify`.
Key
skills-hub-ed25519-2026-11
Signed
0Save

Instructions

You are an autonomous mobile test generation agent. You auto-detect the mobile framework,
generate comprehensive tests across all layers, run them, and fix failures.
Do NOT ask the user questions. Detect the framework and generate tests accordingly.

INPUT: $ARGUMENTS (optional)
If provided, focus on specific test areas (e.g., "unit tests only", "UI tests",
"accessibility", "specific feature name").
If not provided, generate the complete test suite.


PHASE 1: FRAMEWORK DETECTION & TEST INVENTORY


  1. Detect the mobile framework:

    • pubspec.yaml with flutter SDK -> Flutter
    • package.json with react-native -> React Native
    • package.json with expo -> React Native (Expo)
    • *.xcodeproj (no cross-platform) -> Native iOS (XCTest)
    • build.gradle.kts (no cross-platform) -> Native Android (JUnit + Espresso)
  2. Detect existing test infrastructure:

    • Flutter: test/, integration_test/, flutter_test in pubspec.yaml.
    • React Native: tests/, jest.config., detox.config..
    • iOS: *Tests/, *UITests/ targets.
    • Android: test/, androidTest/ directories.
  3. Catalog existing tests:

    FileTypeFrameworkTest CountPassing
  4. Identify all testable code:

    • Models / DTOs.
    • Services / repositories.
    • ViewModels / controllers / providers / blocs.
    • Screens / widgets / composables / views.
    • Utility functions.
    • Navigation routes.
    • Form validation logic.

PHASE 2: UNIT TESTS


Generate unit tests for every testable class/function.

MODELS:

  • Serialization: fromJson / toJson round-trip.
  • Equality: instances with same data are equal.
  • Copy/clone: modifications do not affect original.
  • Validation: required fields, default values.
  • Edge cases: null fields, empty strings, boundary values.

SERVICES / REPOSITORIES:

  • Happy path: correct input -> expected output.
  • Error handling: network error, server error, timeout.
  • Edge cases: empty response, malformed response.
  • Caching: cached data returned when available, refreshed when stale.
  • Authentication: token attached, 401 handling.

VIEWMODELS / STATE MANAGEMENT:

  • Initial state is correct.
  • State transitions on successful data load.
  • State transitions on error.
  • State transitions on user actions.
  • Loading state management.
  • Dispose/cleanup behavior.

UTILITY FUNCTIONS:

  • Input validation (valid, invalid, edge cases, null/empty).
  • Formatting functions (dates, currency, phone numbers).
  • Calculation functions (boundary values, precision).

TEST FRAMEWORK SPECIFICS:

Flutter:

// test/models/user_model_test.dart
import 'package:flutter_test/flutter_test.dart';

void main() {
  group('UserModel', () {
    test('fromJson creates correct instance', () { /* ... */ });
    test('toJson produces correct map', () { /* ... */ });
    test('equality works for same data', () { /* ... */ });
  });
}

React Native:

// __tests__/models/UserModel.test.ts
describe('UserModel', () => {
  it('serializes correctly', () => { /* ... */ });
  it('deserializes correctly', () => { /* ... */ });
});

Native iOS (XCTest):

class UserModelTests: XCTestCase {
    func testJsonDecoding() { /* ... */ }
    func testJsonEncoding() { /* ... */ }
    func testEquality() { /* ... */ }
}

Native Android (JUnit):

class UserModelTest {
    @Test
    fun `fromJson creates correct instance`() { /* ... */ }
    @Test
    fun `toJson produces correct JSON`() { /* ... */ }
}

PHASE 3: WIDGET / UI COMPONENT TESTS


Generate component-level tests for every reusable widget/component.

Flutter widget tests:

  • Widget renders correctly with required data.
  • Widget handles null/empty data gracefully.
  • Widget responds to tap events.
  • Widget displays loading state.
  • Widget displays error state.
  • Widget matches golden image (snapshot test).

React Native component tests:

  • Component renders correctly with props.
  • Component handles missing props gracefully.
  • Component responds to press events.
  • Component accessibility properties correct.
  • Snapshot test matches expected output.

Native iOS (SwiftUI previews + XCTest):

  • View renders without crashing.
  • View responds to state changes.
  • Accessibility identifiers present.

Native Android (Compose testing):

  • Composable renders with required parameters.
  • Composable handles click events.
  • Composable displays correct content for state.

PHASE 4: SCREEN / INTEGRATION TESTS


For every screen, generate tests covering:

SCREEN RENDERING:

  • Screen renders without crashing.
  • Screen displays correct title/header.
  • Screen shows loading state initially.
  • Screen shows content after data loads.
  • Screen shows error state on failure.
  • Screen shows empty state when no data.

NAVIGATION:

  • Navigation to this screen works.
  • Navigation from this screen works.
  • Back navigation returns to correct previous screen.
  • Route parameters are consumed correctly.
  • Deep link to this screen works.

FORMS:

  • All form fields present and editable.
  • Validation triggers on submit with empty required fields.
  • Validation error messages displayed correctly.
  • Successful submission triggers correct action.
  • Form data preserved on validation failure.
  • Keyboard dismiss on tap outside.

DATA INTERACTIONS:

  • List items render correctly.
  • Pull-to-refresh triggers data reload.
  • Pagination loads next page.
  • Create/update/delete operations update the UI.
  • Optimistic updates revert on error.

PHASE 5: ACCESSIBILITY TESTS


Generate accessibility-focused tests:

  • All interactive elements have accessibility labels.
  • All images have content descriptions.
  • Touch targets meet minimum size (44pt iOS, 48dp Android).
  • Screen reader navigation order is logical.
  • Color contrast meets WCAG AA standards.
  • Text scales with system font size settings.
  • Custom components expose correct accessibility roles.

Flutter:

testWidgets('HomeScreen has correct semantics', (tester) async {
  await tester.pumpWidget(const MaterialApp(home: HomeScreen()));
  expect(find.bySemanticsLabel('Search'), findsOneWidget);
  // ... verify all semantic labels
});

React Native:

it('has correct accessibility labels', () => {
  const { getByLabelText } = render(<HomeScreen />);
  expect(getByLabelText('Search')).toBeTruthy();
});

PHASE 6: SNAPSHOT / GOLDEN TESTS


Generate visual regression tests:

Flutter golden tests:

testWidgets('ItemCard matches golden', (tester) async {
  await tester.pumpWidget(/* widget with test data */);
  await expectLater(find.byType(ItemCard), matchesGoldenFile('goldens/item_card.png'));
});

React Native snapshots:

it('matches snapshot', () => {
  const tree = renderer.create(<ItemCard item={mockItem} />).toJSON();
  expect(tree).toMatchSnapshot();
});

Generate goldens/snapshots for:

  • Every reusable component (light and dark mode).
  • Every screen in loaded state.
  • Every screen in empty state.
  • Every screen in error state.

PHASE 7: PLATFORM-SPECIFIC TESTS


Generate tests for platform-specific behavior:

  • Platform-adaptive widgets render correctly per platform.
  • Permissions handling: granted, denied, restricted.
  • Deep link handling: valid, invalid, malformed URLs.
  • Push notification handling: foreground, background, terminated.
  • Lifecycle events: background, foreground, terminate.
  • Orientation changes: portrait to landscape.
  • Keyboard appearance: fields scroll into view.

PHASE 8: TEST EXECUTION & SELF-HEALING


Run all generated tests:

Flutter:

flutter test --coverage
flutter test integration_test/ --device-id <device_id>

React Native:

npx jest --coverage --verbose
npx detox test --configuration ios.sim.release

Native iOS:

xcodebuild test -scheme AppName -destination 'platform=iOS Simulator,name=iPhone 15 Pro'

Native Android:

./gradlew test
./gradlew connectedAndroidTest

SELF-HEALING (max 5 iterations):
For each failing test:

  1. Determine if test bug or app bug.
  2. Fix the appropriate code.
  3. Re-run only failing tests.
  4. Commit fixes with descriptive messages.

OUTPUT


Mobile Test Suite Report

Framework: {detected framework}

Test Frameworks: {flutter_test / Jest / XCTest / JUnit + Espresso}

Test Generation Summary

CategoryGeneratedPre-existingTotal
Unit (models){N}{N}{N}
Unit (services){N}{N}{N}
Unit (ViewModels){N}{N}{N}
Unit (utilities){N}{N}{N}
Widget/Component{N}{N}{N}
Screen/Integration{N}{N}{N}
Accessibility{N}{N}{N}
Snapshot/Golden{N}{N}{N}
Platform-specific{N}{N}{N}
Total{N}{N}{N}

Test Results

CategoryPassFailErrorCoverage
Unit{N}{N}{N}{%}
Widget/UI{N}{N}{N}{%}
Integration{N}{N}{N}{%}
Total{N}{N}{N}{%}

Bugs Found & Fixed

BugTypeFileFixCommit
{description}{app/test}{file}{fix}{hash}

Coverage by Feature

FeatureUnitWidget/UIIntegrationTotal
{feature}{%}{%}{%}{%}

DO NOT:

  • Generate tests that assert nothing (every test must verify meaningful behavior).
  • Delete failing tests to make the suite green.
  • Weaken assertions to make tests pass.
  • Use real API endpoints in unit tests -- always mock.
  • Skip running the tests -- generation without execution is incomplete.
  • Generate duplicate tests for code already covered by existing tests.
  • Use hardcoded test data that only works once (use unique generators).
  • Write tests that depend on execution order.

NEXT STEPS:

  • "Run /device-matrix to execute tests across multiple devices and OS versions."
  • "Run /mobile-ci-cd to integrate the test suite into CI."
  • "Run /mobile-qa for functional QA testing beyond automated tests."
  • "Run /mobile-performance to add performance regression tests."

SELF-EVOLUTION TELEMETRY


After producing output, record execution metadata for the /evolve pipeline.

Check if a project memory directory exists:

  • Look for the project path in ~/.claude/projects/
  • If found, append to skill-telemetry.md in that memory directory

Entry format:

### /mobile-test — {{YYYY-MM-DD}}
- Outcome: {{SUCCESS | PARTIAL | FAILED}}
- Self-healed: {{yes — what was healed | no}}
- Iterations used: {{N}} / {{N max}}
- Bottleneck: {{phase that struggled or "none"}}
- Suggestion: {{one-line improvement idea for /evolve, or "none"}}

Only log if the memory directory exists. Skip silently if not found.
Keep entries concise — /evolve will parse these for skill improvement signals.

This skill doesn’t include stateful context yet, instructions only. Learn about stateful skills.

Security

Loading security scan...

Reviews (0)

Browse all →
design-animateAdd purposeful motion to interfaces using modern CSS — scroll-driven animations, view transitions, @starting-style, and GPU-accelerated transforms. Triggers: 'add animation', 'animate', 'add motion', 'transitions', 'scroll animation'.78 installsdesign-auditComprehensive autonomous design quality audit across accessibility (WCAG 2.2), performance, theming, responsive/adaptive design, and anti-pattern detection. Triggers: 'audit design', 'check accessibility', 'a11y audit', 'design review', 'UI quality check'.61 installsdiagramGenerate Mermaid architecture diagrams from your codebase. Produces C4 context and container diagrams, sequence diagrams for key flows, ER diagrams from database schemas, and module dependency graphs. Use when you need architecture diagrams, system diagrams, database ERD, sequence diagrams, dependency visualization, or C4 model diagrams.56 installssecureFull-stack security posture assessment with 0-100 risk scoring. Scans dependency vulnerabilities (npm audit, pip-audit, cargo audit, govulncheck), dangerous code patterns (SQL injection, eval, command injection, ReDoS, innerHTML, XSS vectors), authentication gaps (missing auth middleware.56 installsdesign-polishFinal autonomous quality pass before shipping. Fixes alignment, spacing, consistency, typography hierarchy, color harmony, motion timing, and every micro-detail that separates good from great..55 installsresponsiveAudit and fix responsive design issues across all breakpoints. Scans for fixed widths that cause mobile overflow, missing media query variants, non-responsive images, undersized touch targets below 48px, unreadable typography, and horizontal scroll violations..49 installs

More from Skills Hub

View source →
security-reviewSecurity audit and vulnerability assessment for any codebase. Scans for authentication bypasses, missing auth middleware, broken JWT validation (algorithm confusion, weak secrets, missing expiry), OAuth state and PKCE flaws, IDOR and horizontal privilege escalation.197 installsunit-testGenerate comprehensive unit tests with edge cases, error paths, and boundary values. Triggers: you need to add unit tests, increase code coverage, test edge cases, or verify error handling paths.164 installsweb-gameScaffolds a browser-based game with Phaser 3, PixiJS, or Three.js including game loop, asset pipeline, responsive canvas, input handling, audio, save/load, and deployment to itch.io or web. Triggers: on: "web game", "browser game", "html5 game", "phaser game", "pixi game".134 installshumanizerMulti-pass editor that removes AI-writing tells from drafted content — eliminates filler phrases, balances sentence length, restores opinion and voice, and strips em-dash overuse so posts sound human and opinionated rather than ChatGPT-generic..131 installsflutterBuilds Flutter applications from videos, screenshots, descriptions, or app clone requests. Triggers on: flutter app, build a mobile app, replicate this app in Flutter, build from video, build from screenshots, clone this app, build an app, make an app like, recreate this UI.127 installsdesign-to-codeTurn a design into production-quality frontend code: extract a design system with tokens and components, make layouts responsive across breakpoints, add dark mode with WCAG-compliant theming, then run a UX audit to validate everything..124 installs

More Test skills

Browse category →

Frequently asked questions about mobile-test

What does the mobile-test skill do?

Generate a complete mobile test suite covering unit, widget, integration, snapshot, accessibility, and platform-specific tests. Triggers: you need to add tests to a mobile app, increase test coverage, verify accessibility labels. It's a reusable SKILL.md instruction set that loads into your AI coding assistant on demand, no prompt engineering, no copy-pasting every session.

How do I install the mobile-test skill?

Run `npx @skills-hub-ai/cli install mobile-test` from your terminal. The CLI writes the SKILL.md to the correct location for your AI tool (e.g. ~/.claude/skills/mobile-test/ for Claude Code or ~/.cursor/skills/ for Cursor with --target cursor) and adds it to your project's .skills.json lockfile.

Which AI tools does mobile-test work with?

mobile-test runs in Claude Code. It follows the open Agent Skills standard (SKILL.md), so the same skill works in every supported tool without modification.

Is the mobile-test skill free?

Yes. Every skill on skills-hub.ai is free and open-source. There are no premium tiers, paywalls, or usage limits. You only pay for whatever AI assistant you're already using.

How do I use mobile-test after installing it?

In Claude Code, type `/mobile-test` (or whatever slash command the skill registers) and the AI follows the skill's instructions immediately. You can also reference it by name in natural language, your AI loads the skill into context when relevant.

Can I share the mobile-test skill with my team?

Yes. Commit your project's .skills.json lockfile and teammates run `npx @skills-hub-ai/cli install` (no args) to install every skill at the exact version you pinned. Organization-scoped installs work via skills-hub.ai organizations.