appium
Scannednpx machina-cli add skill partme-ai/full-stack-skills/appium --openclawFiles (1)
SKILL.md
679 B
When to use this skill
Use this skill whenever the user wants to:
- [待完善:根据具体工具添加使用场景]
How to use this skill
[待完善:根据具体工具添加使用指南]
Best Practices
[待完善:根据具体工具添加最佳实践]
Keywords
[待完善:根据具体工具添加关键词]
Source
git clone https://github.com/partme-ai/full-stack-skills/blob/main/skills/appium/SKILL.mdView on GitHub Overview
Appium enables automated testing of mobile apps on iOS and Android using a single WebDriver API. It supports native, hybrid, and mobile web apps, simplifying cross-platform test scripts and CI integration.
How This Skill Works
Appium runs as a server and translates WebDriver commands into platform-specific automation frameworks (UIAutomator2 for Android, XCUITest for iOS). Test scripts connect via WebDriver, specify desired capabilities, and interact with native or web views by switching contexts as needed.
When to Use It
- You need to automate tests for both iOS and Android apps with a single codebase.
- You want to automate native, hybrid, or mobile web apps using a WebDriver API.
- You’re integrating mobile tests into CI/CD pipelines for faster release cycles.
- You need to simulate gestures like taps, swipes, and long-presses reliably.
- You require stable element location strategies (e.g., accessibilityId) that work across platforms.
Quick Start
- Step 1: Install Appium and necessary drivers (e.g., UIAutomator2, XCUITest) and start the Appium server.
- Step 2: Create a test script with desired capabilities (platformName, deviceName, app or appPackage/appActivity) and a WebDriver client.
- Step 3: Run the test against the Appium server and iterate to add steps for element interaction and gestures.
Best Practices
- Prefer robust locators (accessibilityId) and minimize XPath usage to improve reliability.
- Use explicit waits instead of fixed sleeps to handle app latency gracefully.
- Configure appropriate desired capabilities and keep Appium drivers up to date.
- Adopt the Page Object Model to organize selectors and actions for reuse.
- Run tests on real devices and emulators/simulators, and parallelize where possible in CI.
Example Use Cases
- Automating login and onboarding flows on both iOS and Android with a single test suite.
- Switching from a native context to a webview in a hybrid app to verify content.
- Implementing swipe-to-refresh and long-press gestures to trigger UI actions.
- Setting up Appium tests in GitHub Actions to run across multiple OS/device combos.
- Locating elements with accessibilityId to improve cross‑platform stability.
Frequently Asked Questions
Add this skill to your agents