Skip to content

Commit dc92784

Browse files
author
Erwan de FERRIERES
committed
Make the SimpleTest working with appium 1.4.8 / iOS 8.4
1 parent 5699bb7 commit dc92784

1 file changed

Lines changed: 8 additions & 8 deletions

File tree

sample-code/examples/php/SimpleTest.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
// vendor/bin/phpunit SimpleTest.php
55

66
require_once "vendor/autoload.php";
7-
define("APP_PATH", realpath(dirname(__FILE__).'/../../apps/TestApp/build/Release-iphonesimulator/TestApp.app'));
7+
define("APP_PATH", realpath(dirname(__FILE__).'/../../apps/TestApp/build/release-iphonesimulator/TestApp.app'));
88
if (!APP_PATH) {
99
die("App did not exist!");
1010
}
@@ -20,22 +20,22 @@ class SimpleTest extends Sauce\Sausage\WebDriverTestCase
2020
'port' => 4723,
2121
'browserName' => '',
2222
'desiredCapabilities' => array(
23-
'device' => 'iPhone Simulator',
24-
'version' => '6.0',
25-
'platform' => 'Mac',
23+
'deviceName' => '=iPhone 5s',
24+
'version' => '8.4 Simulator',
25+
'platformName' => 'iOS',
2626
'app' => APP_PATH
2727
)
2828
)
2929
);
3030

3131
public function elemsByTag($tag)
3232
{
33-
return $this->elements($this->using('tag name')->value($tag));
33+
return $this->elements($this->using('class name')->value($tag));
3434
}
3535

3636
protected function populate()
3737
{
38-
$elems = $this->elemsByTag('textField');
38+
$elems = $this->elemsByTag('UIATextField');
3939
foreach ($elems as $elem) {
4040
$randNum = rand(0, 10);
4141
$elem->value($randNum);
@@ -46,9 +46,9 @@ protected function populate()
4646
public function testUiComputation()
4747
{
4848
$this->populate();
49-
$buttons = $this->elemsByTag('button');
49+
$buttons = $this->elemsByTag('UIAButton');
5050
$buttons[0]->click();
51-
$texts = $this->elemsByTag('staticText');
51+
$texts = $this->elemsByTag('UIAStaticText');
5252
$this->assertEquals(array_sum($this->numValues), (int)($texts[0]->text()));
5353
}
5454
}

0 commit comments

Comments
 (0)