2017 © Pedro Peláez
 

appium-php php-client

PHP client for Selenium 3.0/Appium 1.0

image

appium/php-client

PHP client for Selenium 3.0/Appium 1.0

  • Thursday, July 13, 2017
  • by imurchie
  • Repository
  • 17 Watchers
  • 37 Stars
  • 377,321 Installations
  • PHP
  • 4 Dependents
  • 0 Suggesters
  • 27 Forks
  • 10 Open issues
  • 5 Versions
  • 5 % Grown

The README.md

Appium PHP Client

An extension library to add Selenium 3 features to Appium., (*1)

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:, (*2)

{
    "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:, (*3)

composer install
vendor/phpunit/phpunit/phpunit <mytest.php>

For more details about your tests add the --verbose flag to phpunit, (*4)

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., (*5)

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

  • byIOSUIAutomation
  • byAndroidUIAutomator
  • byAccessibilityId
  • keyEvent
  • pullFile
  • pushFile
  • backgroundApp
  • isAppInstalled
  • installApp
  • removeApp
  • launchApp
  • closeApp
  • endTestCoverage
  • lock
  • shake
  • getDeviceTime
  • hideKeyboard
  • initiateTouchAction
  • initiateMultiAction
  • scroll
  • dragAndDrop
  • swipe
  • tap
  • pinch
  • zoom
  • startActivity
  • getSettings
  • setSettings

Methods in PHPUnit_Extensions_AppiumTestCase_Element

  • byIOSUIAutomation
  • byAndroidUIAutomator
  • byAccessibilityId
  • setImmediateValue

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:, (*6)

  • tap
  • press
  • longPress
  • moveTo
  • wait
  • release

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., (*7)

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., (*8)

The Versions

13/07 2017

dev-master

9999999-dev http://github.com/appium/appium-php

PHP client for Selenium 3.0/Appium 1.0

  Sources   Download

Apache-2.0

The Requires

 

phpunit selenium appium

13/07 2017

v0.3.0

0.3.0.0 http://github.com/appium/appium-php

PHP client for Selenium 3.0/Appium 1.0

  Sources   Download

Apache-2.0

The Requires

 

phpunit selenium appium

21/12 2016

v0.2.1

0.2.1.0 http://github.com/appium/appium-php

PHP client for Selenium 3.0/Appium 1.0

  Sources   Download

Apache-2.0

The Requires

 

phpunit selenium appium

09/11 2016

v0.2.0

0.2.0.0 http://github.com/appium/appium-php

PHP client for Selenium 3.0/Appium 1.0

  Sources   Download

Apache-2.0

The Requires

 

phpunit selenium appium

22/09 2014

v0.1.0

0.1.0.0 http://github.com/appium/appium-php

PHP client for Selenium 3.0/Appium 1.0

  Sources   Download

Apache-2.0

The Requires

 

phpunit selenium appium