appium
安装方式
先用 Prompt 核对来源与依赖。也可下载安装包。
用 AI 助手安装
复制提示词,让助手先核对固定版本和依赖。
查看 Prompt收起 Prompt
先检查当前 Agent 是否已安装 SkillPI Skill Finder。如果尚未安装,请按官方仓库的说明安装并启用:https://github.com/Findskills/skillpi。然后使用 Skill Finder 打开此 SkillPI 详情页并定位 "appium":https://skillpi.com/zh/skills/deepskill-89a356fd46d405affd51c84f5b2d3a738fedb220d0bf1fb0b0b0113a18089895。安装前核对上游来源和版本:https://github.com/TerminalSkills/skills。来源不一致时停止并说明差异。核对通过后,用 Skill Finder 安装目标 Skill,并报告安装路径和来源版本。
来源与配置
github.com
配置方式待核实
请查看原始来源中的适用工具、依赖和权限要求。
安装实测待补充
在 iOS 和 Android 上使用 Appium 自动化移动应用测试。适用于提到“appium”、“移动自动化”、“iOS 测试”、“Android 测试”、“移动 WebDriver”、“XCUITest”或“UiAutomator”的场景。对于 React Native 特定测试,请参见 detox。
介绍来源: third_party · TerminalSkills · 1.0.0 参考来源
SkillPi 解读
- 能完成的任务
- 翻译待完成,请参阅来源文档。
- 软件、账号及付费要求
- 贝什
- 实测状态
- 未测试
文件浏览
Frontmatter
name: appium
description: When the user wants to automate mobile app testing on iOS and Android using Appium. Also use when the user mentions "appium," "mobile automation," "iOS testing," "Android testing," "mobile WebDriver," "XCUITest," or "UiAutomator." For React Native-specific testing, see detox.
metadata:
author: terminal-skills
version: "1.0.0"
category: development
tags:
- mobile-testing
- ios
- android
- automationAppium
Overview
You are an expert in Appium, the cross-platform mobile automation framework built on the WebDriver protocol. You help users set up Appium for iOS and Android testing, write reliable test scripts, configure desired capabilities, handle mobile-specific gestures, and integrate mobile tests into CI. You understand the differences between XCUITest (iOS) and UiAutomator2 (Android) drivers.
Instructions
Initial Assessment
- Platform — iOS, Android, or both?
- App type — Native, hybrid, or mobile web?
- Language — JavaScript, Python, Java, or Ruby?
- Environment — Real devices or simulators/emulators?
Setup
# setup-appium.sh — Install Appium and verify the environment.
# Checks that all required dependencies are available.
# Install Appium
npm install -g appium
# Install platform drivers
appium driver install uiautomator2
appium driver install xcuitest
# Verify setup
appium driver list --installed
# Check environment requirements
npx appium-doctor --android
npx appium-doctor --ios
Capabilities Configuration
// capabilities.js — Appium desired capabilities for iOS and Android.
// Defines which device, OS version, and app to test.
const androidCaps = {
platformName: 'Android',
'appium:automationName': 'UiAutomator2',
'appium:deviceName': 'Pixel 7',
'appium:platformVersion': '14',
'appium:app': '/path/to/app.apk',
'appium:autoGrantPermissions': true,
'appium:noReset': false,
};
const iosCaps = {
platformName: 'iOS',
'appium:automationName': 'XCUITest',
'appium:deviceName': 'iPhone 15',
'appium:platformVersion': '17.4',
'appium:app': '/path/to/app.ipa',
'appium:autoAcceptAlerts': true,
};
Test Script (JavaScript with WebDriverIO)
// tests/login.spec.js — Appium test for mobile login flow.
// Tests both successful login and error handling.
describe('Login Screen', () => {
it('should login with valid credentials', async () => {
const emailField = await $('~email-input');
await emailField.setValue('user@example.com');
const passwordField = await $('~password-input');
await passwordField.setValue('password123');
const loginButton = await $('~login-button');
await loginButton.click();
const welcomeText = await $('~welcome-message');
await welcomeText.waitForDisplayed({ timeout: 10000 });
await expect(welcomeText).toHaveText('Welcome back');
});
it('should show error on invalid credentials', async () => {
const emailField = await $('~email-input');
await emailField.setValue('wrong@example.com');
const passwordField = await $('~password-input');
await passwordField.setValue('wrongpass');
const loginButton = await $('~login-button');
await loginButton.click();
const errorMsg = await $('~error-message');
await errorMsg.waitForDisplayed({ timeout: 5000 });
await expect(errorMsg).toHaveText('Invalid credentials');
});
});
Python Test
# tests/test_app.py — Appium test using Python and pytest.
# Demonstrates element finding, gestures, and assertions.
import pytest
from appium import webdriver
from appium.options.android import UiAutomator2Options
from appium.webdriver.common.appiumby import AppiumBy
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
@pytest.fixture
def driver():
options = UiAutomator2Options()
options.platform_name = "Android"
options.device_name = "emulator-5554"
options.app = "./app-debug.apk"
d = webdriver.Remote("http://localhost:4723", options=options)
yield d
d.quit()
def test_add_item(driver):
wait = WebDriverWait(driver, 10)
add_button = wait.until(
EC.presence_of_element_located((AppiumBy.ACCESSIBILITY_ID, "add-item"))
)
add_button.click()
name_field = driver.find_element(AppiumBy.ACCESSIBILITY_ID, "item-name")
name_field.send_keys("Test Item")
save_button = driver.find_element(AppiumBy.ACCESSIBILITY_ID, "save-button")
save_button.click()
item = wait.until(
EC.presence_of_element_located((AppiumBy.ACCESSIBILITY_ID, "item-Test Item"))
)
assert item.is_displayed()
Mobile Gestures
// gestures.js — Common mobile gestures in Appium.
// Scroll, swipe, long-press, and pinch-to-zoom.
// Scroll down
await driver.execute('mobile: scrollGesture', {
left: 100, top: 500, width: 200, height: 500,
direction: 'down', percent: 1.0,
});
// Swipe left (e.g., dismiss card)
const card = await $('~card-element');
await driver.execute('mobile: swipeGesture', {
elementId: card.elementId,
direction: 'left', percent: 0.75,
});
// Long press
const item = await $('~list-item');
await driver.execute('mobile: longClickGesture', {
elementId: item.elementId, duration: 2000,
});
WebDriverIO Config
// wdio.conf.js — WebDriverIO configuration for Appium mobile tests.
// Configures both Android and iOS test suites.
exports.config = {
runner: 'local',
port: 4723,
specs: ['./tests/**/*.spec.js'],
capabilities: [{
platformName: 'Android',
'appium:automationName': 'UiAutomator2',
'appium:deviceName': 'Pixel_7_API_34',
'appium:app': './app/build/outputs/apk/debug/app-debug.apk',
}],
framework: 'mocha',
mochaOpts: { timeout: 60000 },
services: ['appium'],
};当前收录版本
1.0.0
安全与评测信息
质量评测
满分100 · 来自 SkillPi LAB 实验室的评测报告。
亮点
- 提供完整的 Appium 移动自动化测试端到端解决方案
- 支持 iOS 和 Android 双平台,覆盖 Native/Hybrid/Web 应用类型
- 包含 JavaScript 和 Python 两种主流语言的测试示例
亮点
- 触发词覆盖全面且精准,包括核心术语和平台特定驱动名称
- 明确区分 React Native 场景并引导至 detox Skill
亮点
- 结构清晰,分阶段引导用户从评估到执行
- 提供完整的可运行代码示例和配置文件
- frontmatter 元数据完整规范
亮点
- 工具安装命令明确,依赖检查完整
- 测试脚本包含合理的等待和断言机制
- 能力配置参数符合 Appium 官方规范
取前四项原始分值的算术平均,四舍五入取整。可通过收录报告核对各项评分与说明,运行记录需单独查证。
正文静态检测
100 / 100 · skillpi-20261123-no-r3-v1
正文未命中当前规则。
分数仅反映正文中的规则命中,供使用前参考。附件与运行行为不在此评分范围内。
权限与使用前检查
根据当前主文档自动整理,命中内容可能是示例或防护说明;不是实际权限声明,也未覆盖附件、外部依赖或运行行为。
-
安装或获取外部依赖
使用官方来源并锁定版本,在隔离环境检查安装脚本。当前文档检查不覆盖后续下载的代码。
主文档提及 · 第 37, 47, 48 行 -
账号、密钥或授权
使用专用、最小权限账号,不把密钥粘贴到公开内容或命令日志;核对接收数据的服务与租户。
主文档提及 · 第 82, 97, 109 行
文档引用的域名或地址
这些地址可能用于文档链接或示例,不是已批准的联网清单。使用前核对实际目的地及发送的数据。
- localhost
安全评级与访问范围
safe · 静态证据核验,不代表运行安全保证。
贝什
使用前请由宿主核对并授权实际文件读写、外部服务和联网目的地;本站的核验不会授予任何运行权限。
用户讨论
还没有已核实的点评。