appium/php-client
Composer 安装命令:
composer require appium/php-client
包简介
PHP client for Selenium 3.0/Appium 1.0
README 文档
README
An extension library to add Selenium 3 features to Appium.
The library is installable using the Composer dependency manager. Just add "appium/appium-php": "dev-master" (or any other branch/tag you might like) to your composer.json file's requires, and the repository on GitHub to the repositories:
{
"name": "username/my-php-project",
"repositories": [
{
"type": "vcs",
"url": "https://github.com/appium/php-client"
}
],
"require": {
"appium/php-client": "dev-master"
}
}
Have an instance of Appium running in the background at port 4723. Then install the dependencies and run your tests:
composer install vendor/phpunit/phpunit/phpunit <mytest.php>
For more details about your tests add the --verbose flag to phpunit
Usage and changes
There are a number of methods added to Selenium 3/Appium 1. The central change is in the test case that serves as the base of your tests, and the elements with which you interact. Both are subclasses of the PHPUnit Selenium classes. Your tests should be subclasses of PHPUnit_Extensions_AppiumTestCase, and all elements that get returned will be of the class PHPUnit_Extensions_AppiumTestCase_Element.
require_once('PHPUnit/Extensions/AppiumTestCase.php'); require_once('PHPUnit/Extensions/AppiumTestCase/Element.php'); class MySuperTests extends PHPUnit_Extensions_AppiumTestCase { public static $browsers = array( array( 'local' => true, 'port' => 4723, 'browserName' => '', 'desiredCapabilities' => array( 'app' => APP_PATH ) ) ); public function testStuff() { $element = $this->byAccessibilityId('Element on screen'); $this->assertInstanceOf('PHPUnit_Extensions_AppiumTestCase_Element', $element); } }
Methods added
Methods in PHPUnit_Extensions_AppiumTestCase
byIOSUIAutomationbyAndroidUIAutomatorbyAccessibilityIdkeyEventpullFilepushFilebackgroundAppisAppInstalledinstallAppremoveApplaunchAppcloseAppendTestCoveragelockshakegetDeviceTimehideKeyboardinitiateTouchActioninitiateMultiActionscrolldragAndDropswipetappinchzoomstartActivitygetSettingssetSettings
Methods in PHPUnit_Extensions_AppiumTestCase_Element
byIOSUIAutomationbyAndroidUIAutomatorbyAccessibilityIdsetImmediateValue
Methods for Touch Actions and Multi Gesture Touch Actions
Appium 1.0 allows for much more complex ways of interacting with your app through Touch Actions and Multi Gesture Touch Actions. The PHPUnit_Extensions_AppiumTestCase_TouchAction class allows for the following events:
tappresslongPressmoveTowaitrelease
All of these except tap and release can be chained together to create arbitrarily complex actions. Instances of the PHPUnit_Extensions_AppiumTestCase_TouchAction class are obtained through the Test Class's initiateTouchAction method, and dispatched through the perform method.
The Multi Gesture Touch Action API allows for adding an arbitrary number of Touch Actions to be run in parallel on the device. Individual actions created as above are added to the multi action object (an instance of PHPUnit_Extensions_AppiumTestCase_MultiAction obtained from the Test Class's initiateMultiAction method) through the add method, and the whole thing is dispatched using perform.
appium/php-client 适用场景与选型建议
appium/php-client 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 675.6k 次下载、GitHub Stars 达 71, 最近一次更新时间为 2014 年 09 月 30 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「phpunit」 「selenium」 「appium」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 appium/php-client 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 appium/php-client 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 appium/php-client 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
PHP version of the Sauce Labs API
API for JSON Wire Protocol, support Selenium, Selendroid, Appium
HiDev plugin for PHPUnit
Testing Suite For Lumen like Laravel does.
A cli tool which generates unit tests.
PHP client for the TestingBot API (cross-browser & device testing, screenshots, tunnels, storage, codeless tests).
统计信息
- 总下载量: 675.6k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 73
- 点击次数: 23
- 依赖项目数: 4
- 推荐数: 0
其他信息
- 授权协议: Apache-2.0
- 更新时间: 2014-09-30