今日から俺は

都内で働くエンジニア。調べて学んだことを蓄積していきます。

Appium 2

内容

phpunitでテストケースを書くにあたって、困ったことを書きます。

Appiumとphpunit

特にphpunit-seleniumがappium-php-clientとうまくマッチしなくて、 masterブランチしかマッチしない (最新のリリースバージョンは、うまくいかない)

どううまくいかない?

こんな感じ

$seleniumServerUrl = PHPUnit_Extensions_Selenium2TestCase_URL::fromHostAndPort($parameters['host'], $parameters['port'], $parameters['secure'])
/**
     * @param string $host
     * @param int port
     * @return PHPUnit_Extensions_Selenium2TestCase_URL
     */
    public static function fromHostAndPort($host, $port)
    {
        return new self("http://{$host}:{$port}");
    }

パラメータ数が合わず

で、どう解決させた?

composer.jsonでほしいブランチ指定

{
  "name": "ios_unittest_appium",
  "repositories": [
      {
          "type": "vcs",
          "url": "https://github.com/appium/php-client"
      }
  ],
  "require": {
      "appium/php-client": "dev-master"
  },
  "require-dev": {
        "phpunit/phpunit-selenium": "dev-master#6cd8b2acadd13d3f16b0e8cc41f8bbf50f4d1dec"
  }
}

これでも良いけど、未確認

v0.3.0 which is the latest php-client has no secure parameter. https://github.com/appium/php-client/releases/tag/v0.3.0
After the release, the secure parameter has been added. #46