diff --git a/PHPUnit/Extensions/AppiumTestCase.php b/PHPUnit/Extensions/AppiumTestCase.php index fd9f95e..5876fea 100644 --- a/PHPUnit/Extensions/AppiumTestCase.php +++ b/PHPUnit/Extensions/AppiumTestCase.php @@ -253,6 +253,16 @@ public function shake() $session->getDriver()->curl('POST', $url, null); } + public function touchId($match) + { + $session = $this->prepareSession(); + $data = array( + 'match' => $match + ); + $url = $this->getSessionUrl()->descend('appium')->descend('simulator')->descend('touch_id'); + $session->getDriver()->curl('POST', $url, $data); + } + public function getDeviceTime() { $session = $this->prepareSession(); diff --git a/test/functional/ios/appium_tests.php b/test/functional/ios/appium_tests.php index 534d347..440b85f 100644 --- a/test/functional/ios/appium_tests.php +++ b/test/functional/ios/appium_tests.php @@ -11,8 +11,8 @@ class AppiumTests extends PHPUnit_Extensions_AppiumTestCase { public function testSetImmediateValue() { - $this->byAccessibilityId('TextFields, Uses of UITextField')->click(); - $el = $this->byClassName('UIATextField'); + $this->byAccessibilityId('Uses of UITextField')->click(); + $el = $this->byClassName('XCUIElementTypeTextField'); $el->click(); $el->setImmediateValue('Testing'); @@ -38,9 +38,15 @@ public function testShake() $this->shake(); } + public function testTouchId() + { + $this->touchId(true); + $this->touchId(false); + } + public function testHideKeyboard() { - $this->byName('TextFields, Uses of UITextField')->click(); + $this->byName('Uses of UITextField')->click(); # get focus on text field, so keyboard comes up $el = $this->byClassName('UIATextField'); @@ -77,13 +83,13 @@ public function testHideKeyboardPressKeyStrategy() public function testHideKeyboardNoKeyname() { - $this->byName('TextFields, Uses of UITextField')->click(); + $this->byName('Uses of UITextField')->click(); # get focus on text field, so keyboard comes up - $el = $this->byClassName('UIATextField'); + $el = $this->byClassName('XCUIElementTypeTextField'); $el->value('Testing'); - $keyboard = $this->byClassName('UIAKeyboard'); + $keyboard = $this->byClassName('XCUIElementTypeKeyboard'); $this->assertTrue($keyboard->displayed()); $this->hideKeyboard(); @@ -92,6 +98,7 @@ public function testHideKeyboardNoKeyname() $this->assertFalse($keyboard->displayed()); } + public function testGetDeviceTime() { $this->getDeviceTime(); @@ -105,7 +112,7 @@ public function testGetDeviceTime() 'desiredCapabilities' => array( 'app' => APP_PATH, 'platformName' => 'iOS', - 'platformVersion' => '7.1', + 'platformVersion' => '10.1', 'deviceName' => 'iPhone Simulator' ) )