Appium tests written in PHP

Appium tests written in PHP are detected by looking for a PHPUnit configuration XML that is named nevercode-phpunit.xml. You can learn more about the file format from the official documentation here.

Android

Specify the location of your .apk that's going to be tested, this should be the relative path from the test file to the .apk as in the following example:

<?php
...
define("APP_PATH", realpath(dirname(__FILE__).'/../../App/build/outputs/apk/Gh-android-debug.apk'));

class BaseTest extends Sauce\Sausage\WebDriverTestCase {
    ...
    public static $browsers = array(
        array(
         ...
        'desiredCapabilities' => array(
            ...
            'app' => APP_PATH)

iOS

Specify the location of your .app directory that's going to be tested, for this we export an environment variable called NEVERCODE_SYMROOT. This will hold the path of the current build's SYMROOT. Your tests should use this variable as in the following example:

<?php
...
define("APP_PATH", realpath(getenv("NEVERCODE_SYMROOT")."/Debug-iphonesimulator/gh-ios.app"));

class BaseTest extends Sauce\Sausage\WebDriverTestCase {
    ...
    public static $browsers = array(
        array(
        ...
        'desiredCapabilities' => array(
            ...
            'app' => APP_PATH)

Example

Example test projects are available for both Android and iOS.

Updated 3 years ago

Appium tests written in PHP


Suggested Edits are limited on API Reference Pages

You can only suggest edits to Markdown body content, but not to the API spec.