From 5311b01df9271f1dbcb7f1cc078c85911d977f89 Mon Sep 17 00:00:00 2001 From: Zhongwei Li Date: Sun, 30 Nov 2025 08:23:16 +0800 Subject: [PATCH] Initial commit --- .claude-plugin/plugin.json | 15 ++ README.md | 3 + commands/mobile-test.md | 209 ++++++++++++++++++ plugin.lock.json | 61 +++++ skills/mobile-app-tester/SKILL.md | 53 +++++ skills/mobile-app-tester/assets/README.md | 8 + skills/mobile-app-tester/references/README.md | 10 + skills/mobile-app-tester/scripts/README.md | 7 + 8 files changed, 366 insertions(+) create mode 100644 .claude-plugin/plugin.json create mode 100644 README.md create mode 100644 commands/mobile-test.md create mode 100644 plugin.lock.json create mode 100644 skills/mobile-app-tester/SKILL.md create mode 100644 skills/mobile-app-tester/assets/README.md create mode 100644 skills/mobile-app-tester/references/README.md create mode 100644 skills/mobile-app-tester/scripts/README.md diff --git a/.claude-plugin/plugin.json b/.claude-plugin/plugin.json new file mode 100644 index 0000000..4ed6a94 --- /dev/null +++ b/.claude-plugin/plugin.json @@ -0,0 +1,15 @@ +{ + "name": "mobile-app-tester", + "description": "Mobile app test automation with Appium, Detox, XCUITest - test iOS and Android apps", + "version": "1.0.0", + "author": { + "name": "Claude Code Plugin Hub", + "email": "[email protected]" + }, + "skills": [ + "./skills" + ], + "commands": [ + "./commands" + ] +} \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..65c6da1 --- /dev/null +++ b/README.md @@ -0,0 +1,3 @@ +# mobile-app-tester + +Mobile app test automation with Appium, Detox, XCUITest - test iOS and Android apps diff --git a/commands/mobile-test.md b/commands/mobile-test.md new file mode 100644 index 0000000..69cda75 --- /dev/null +++ b/commands/mobile-test.md @@ -0,0 +1,209 @@ +--- +description: Mobile app test automation for iOS and Android +shortcut: mt +--- + +# Mobile App Tester + +Automated testing for mobile applications using Appium, Detox, XCUITest (iOS), and Espresso (Android) with support for simulators, emulators, and real devices. + +## What You Do + +1. **Generate Mobile Tests** + - Create E2E tests for mobile flows + - Set up page object models for mobile screens + - Handle platform-specific elements (iOS/Android) + +2. **Device Configuration** + - Configure simulators/emulators + - Set up device farms (AWS Device Farm, BrowserStack) + - Test across multiple devices and OS versions + +3. **Mobile-Specific Testing** + - Gestures (swipe, tap, pinch, rotate) + - Permissions handling + - Push notifications + - Deep linking + - Offline mode + +4. **Performance Testing** + - App launch time + - Memory usage + - Battery consumption + - Network efficiency + +## Usage Pattern + +When invoked, you should: + +1. Identify the mobile platform (iOS, Android, or both) +2. Analyze app structure and key user flows +3. Generate appropriate tests using the right framework +4. Configure test environment (simulators/devices) +5. Provide test execution commands +6. Include screenshot/video capture setup + +## Output Format + +```markdown +## Mobile App Test Suite + +### Platform: [iOS / Android / Both] +**Framework:** [Detox / Appium / XCUITest / Espresso] +**Test Cases:** [N] + +### Device Configuration + +\`\`\`yaml +# .detoxrc.js +devices: { + simulator: { + type: 'ios.simulator', + device: { type: 'iPhone 15 Pro' } + }, + emulator: { + type: 'android.emulator', + device: { avdName: 'Pixel_7_API_34' } + } +} +\`\`\` + +### Test Implementation + +\`\`\`javascript +describe('Login Flow', () => { + beforeAll(async () => { + await device.launchApp(); + }); + + it('should login successfully', async () => { + // Wait for login screen + await expect(element(by.id('loginScreen'))).toBeVisible(); + + // Enter credentials + await element(by.id('emailInput')).typeText('[email protected]'); + await element(by.id('passwordInput')).typeText('password123'); + + // Tap login button + await element(by.id('loginButton')).tap(); + + // Verify navigation to home + await expect(element(by.id('homeScreen'))).toBeVisible(); + await expect(element(by.text('Welcome'))).toBeVisible(); + }); + + it('should handle gestures', async () => { + // Swipe gesture + await element(by.id('scrollView')).swipe('up', 'fast'); + + // Long press + await element(by.id('menuItem')).longPress(); + + // Multi-touch + await element(by.id('map')).pinch(1.5); // zoom in + }); + + it('should handle permissions', async () => { + await element(by.id('requestLocation')).tap(); + + // Handle iOS permission alert + if (device.getPlatform() === 'ios') { + await expect(element(by.label('Allow'))).toBeVisible(); + await element(by.label('Allow While Using App')).tap(); + } + }); +}); +\`\`\` + +### Platform-Specific Tests + +#### iOS-Specific +\`\`\`javascript +// XCUITest +it('should handle iOS-specific features', async () => { + // Test Face ID + await element(by.id('faceIdButton')).tap(); + await device.matchFace(); + + // Test 3D Touch + await element(by.id('homeIcon')).forceTouchAndSwipe('up'); +}); +\`\`\` + +#### Android-Specific +\`\`\`javascript +// Espresso +it('should handle Android-specific features', async () => { + // Test back button + await device.pressBack(); + + // Test app switching + await device.sendToHome(); + await device.launchApp(); +}); +\`\`\` + +### Performance Tests + +\`\`\`javascript +it('should launch within 2 seconds', async () => { + const start = Date.now(); + await device.launchApp(); + const launchTime = Date.now() - start; + + expect(launchTime).toBeLessThan(2000); +}); +\`\`\` + +### Test Execution + +\`\`\`bash +# iOS Simulator +detox test --configuration ios.sim.debug + +# Android Emulator +detox test --configuration android.emu.debug + +# Real Device +detox test --configuration ios.device + +# With screenshots +detox test --take-screenshots all + +# With video recording +detox test --record-videos all +\`\`\` + +### Device Farm Integration + +\`\`\`yaml +# AWS Device Farm +- Platform: iOS 17, Android 14 +- Devices: iPhone 15, Pixel 7, Samsung S23 +- Test Package: [uploaded] +- Results: [URL] +\`\`\` + +### Next Steps +- [ ] Run tests on simulators +- [ ] Test on real devices +- [ ] Add screenshot assertions +- [ ] Set up CI/CD mobile testing +- [ ] Test offline scenarios +``` + +## Supported Frameworks + +- **Detox** (React Native) +- **Appium** (Cross-platform) +- **XCUITest** (iOS native) +- **Espresso** (Android native) +- **Maestro** (Mobile UI testing) + +## Device Testing + +- iOS Simulator +- Android Emulator +- AWS Device Farm +- BrowserStack Mobile +- Sauce Labs Real Devices diff --git a/plugin.lock.json b/plugin.lock.json new file mode 100644 index 0000000..2762bab --- /dev/null +++ b/plugin.lock.json @@ -0,0 +1,61 @@ +{ + "$schema": "internal://schemas/plugin.lock.v1.json", + "pluginId": "gh:jeremylongshore/claude-code-plugins-plus:plugins/testing/mobile-app-tester", + "normalized": { + "repo": null, + "ref": "refs/tags/v20251128.0", + "commit": "b1e0c25ab00e39d42a9b15d5bbccc2b2796b33c3", + "treeHash": "025a9c4afabef221b0af10ed4ded5ce9c0e898fd517433bc0495823f94e368cb", + "generatedAt": "2025-11-28T10:18:34.724738Z", + "toolVersion": "publish_plugins.py@0.2.0" + }, + "origin": { + "remote": "git@github.com:zhongweili/42plugin-data.git", + "branch": "master", + "commit": "aa1497ed0949fd50e99e70d6324a29c5b34f9390", + "repoRoot": "/Users/zhongweili/projects/openmind/42plugin-data" + }, + "manifest": { + "name": "mobile-app-tester", + "description": "Mobile app test automation with Appium, Detox, XCUITest - test iOS and Android apps", + "version": "1.0.0" + }, + "content": { + "files": [ + { + "path": "README.md", + "sha256": "87b93dbd8e453de0c1ca83eb5bd32a2b09f0782fe654d9965e994c53030d7529" + }, + { + "path": ".claude-plugin/plugin.json", + "sha256": "490b0955688852b1931f6948289201700cf1311c5fce724f69435f937b4ba779" + }, + { + "path": "commands/mobile-test.md", + "sha256": "ae23ba75aefe29340e637aaa4cd12f81c26017c1a2e72740849a78062c531b2a" + }, + { + "path": "skills/mobile-app-tester/SKILL.md", + "sha256": "4f946674ac551bd99cd4ea6e3b33ac7bf25150dad267b4a077d79fc160f1e2de" + }, + { + "path": "skills/mobile-app-tester/references/README.md", + "sha256": "3f9b5533d28591f30c412fb1836ed878a7f5b1c2fcfe5a58b0d3618c3dadad04" + }, + { + "path": "skills/mobile-app-tester/scripts/README.md", + "sha256": "a47c54872c7e6349a2e157d2b6199695ebe78cbbd0677c6a9ddb7bcaf426cd29" + }, + { + "path": "skills/mobile-app-tester/assets/README.md", + "sha256": "aa28f9af64f431c82c88f1b935a2fe2e40dd890080f43bf845f486b1b8ef1dca" + } + ], + "dirSha256": "025a9c4afabef221b0af10ed4ded5ce9c0e898fd517433bc0495823f94e368cb" + }, + "security": { + "scannedAt": null, + "scannerVersion": null, + "flags": [] + } +} \ No newline at end of file diff --git a/skills/mobile-app-tester/SKILL.md b/skills/mobile-app-tester/SKILL.md new file mode 100644 index 0000000..8d73f61 --- /dev/null +++ b/skills/mobile-app-tester/SKILL.md @@ -0,0 +1,53 @@ +--- +name: automating-mobile-app-testing +description: | + This skill enables automated testing of mobile applications on iOS and Android platforms using frameworks like Appium, Detox, XCUITest, and Espresso. It generates end-to-end tests, sets up page object models, and handles platform-specific elements. Use this skill when the user requests mobile app testing, test automation for iOS or Android, or needs assistance with setting up device farms and simulators. The skill is triggered by terms like "mobile testing", "appium", "detox", "xcuitest", "espresso", "android test", "ios test". +allowed-tools: Read, Write, Edit, Grep, Glob, Bash +version: 1.0.0 +--- + +## Overview + +This skill empowers Claude to automate mobile app testing across iOS and Android, leveraging popular frameworks. It handles test generation, device configuration, and platform-specific adjustments, streamlining the mobile testing process. + +## How It Works + +1. **Test Generation**: Claude creates end-to-end tests based on user-defined flows and requirements. +2. **Page Object Modeling**: The skill sets up page object models to represent mobile screens and their elements. +3. **Device Configuration**: It configures simulators, emulators, or device farms (e.g., AWS Device Farm, BrowserStack) for testing. +4. **Platform Adaptation**: The skill handles platform-specific differences between iOS and Android for robust cross-platform testing. + +## When to Use This Skill + +This skill activates when you need to: +- Automate mobile app testing for iOS and/or Android. +- Generate end-to-end tests for mobile applications. +- Configure testing environments, including simulators, emulators, and device farms. + +## Examples + +### Example 1: Automating iOS App Testing + +User request: "Create Appium tests for my iOS app." + +The skill will: +1. Generate Appium tests tailored for the iOS app. +2. Configure an iOS simulator for test execution. + +### Example 2: Generating Detox Tests for a React Native App + +User request: "Generate Detox tests for my React Native app's login flow." + +The skill will: +1. Create Detox tests specifically targeting the login flow of the React Native app. +2. Set up the necessary environment for Detox testing. + +## Best Practices + +- **Specificity**: Provide detailed information about the app's functionality and desired test coverage. +- **Framework Selection**: Specify the preferred testing framework (Appium, Detox, XCUITest, Espresso) if you have a preference. +- **Platform Targeting**: Clearly indicate the target platforms (iOS, Android, or both). + +## Integration + +This skill can be used in conjunction with other skills related to code generation and deployment to create a comprehensive mobile app development workflow. \ No newline at end of file diff --git a/skills/mobile-app-tester/assets/README.md b/skills/mobile-app-tester/assets/README.md new file mode 100644 index 0000000..fc1b1b4 --- /dev/null +++ b/skills/mobile-app-tester/assets/README.md @@ -0,0 +1,8 @@ +# Assets + +Bundled resources for mobile-app-tester skill + +- [ ] test_template.py Template for creating new test cases. +- [ ] page_object_template.py Template for creating page object models. +- [ ] sample_app_ios.ipa Sample iOS app for testing. +- [ ] sample_app_android.apk Sample Android app for testing. diff --git a/skills/mobile-app-tester/references/README.md b/skills/mobile-app-tester/references/README.md new file mode 100644 index 0000000..2c32145 --- /dev/null +++ b/skills/mobile-app-tester/references/README.md @@ -0,0 +1,10 @@ +# References + +Bundled resources for mobile-app-tester skill + +- [ ] appium_commands.md Documentation of common Appium commands. +- [ ] detox_best_practices.md Best practices for Detox framework. +- [ ] xcuitest_tutorial.md Tutorial on XCUITest framework. +- [ ] espresso_guide.md Guide on Espresso framework. +- [ ] aws_device_farm_setup.md Instructions on setting up AWS Device Farm. +- [ ] browserstack_mobile_setup.md Instructions on setting up BrowserStack Mobile. diff --git a/skills/mobile-app-tester/scripts/README.md b/skills/mobile-app-tester/scripts/README.md new file mode 100644 index 0000000..8de022a --- /dev/null +++ b/skills/mobile-app-tester/scripts/README.md @@ -0,0 +1,7 @@ +# Scripts + +Bundled resources for mobile-app-tester skill + +- [ ] setup_appium.sh Script to automate Appium server setup. +- [ ] run_tests.sh Script to execute tests on specified devices/emulators. +- [ ] generate_report.py Python script to generate detailed test reports.