From db5602a7598da5fb4d6ecde23358b912a32207bb Mon Sep 17 00:00:00 2001 From: Quint Stoffers Date: Wed, 8 Oct 2014 18:11:46 +0200 Subject: [PATCH 1/4] Fixed getting one or more children of an element through an element's "elements" method --- PHPUnit/Extensions/AppiumTestCase/Element.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/PHPUnit/Extensions/AppiumTestCase/Element.php b/PHPUnit/Extensions/AppiumTestCase/Element.php index 9d4c154..a7343b8 100644 --- a/PHPUnit/Extensions/AppiumTestCase/Element.php +++ b/PHPUnit/Extensions/AppiumTestCase/Element.php @@ -84,13 +84,12 @@ public function element(PHPUnit_Extensions_Selenium2TestCase_ElementCriteria $cr public function elements(PHPUnit_Extensions_Selenium2TestCase_ElementCriteria $criteria) { - $session = $this->prepareSession(); - $values = $session->postCommand('elements', $criteria); + $values = $this->postCommand('elements', $criteria); $elements = array(); foreach ($values as $value) { $elements[] = PHPUnit_Extensions_AppiumTestCase_Element::fromResponseValue( - $value, $session->getSessionUrl()->descend('element'), $session->driver); + $value, $this->getSessionUrl()->descend('element'), $this->driver); } return $elements; } From 5146a85f99eb5e15039584052b1fd3c582af8eaf Mon Sep 17 00:00:00 2001 From: Scott Dixon Date: Fri, 19 Feb 2016 12:40:42 -0800 Subject: [PATCH 2/4] Add getDeviceTime method --- PHPUnit/Extensions/AppiumTestCase.php | 8 ++++++++ test/functional/ios/appium_tests.php | 5 +++++ 2 files changed, 13 insertions(+) diff --git a/PHPUnit/Extensions/AppiumTestCase.php b/PHPUnit/Extensions/AppiumTestCase.php index 73e17f0..fd9f95e 100644 --- a/PHPUnit/Extensions/AppiumTestCase.php +++ b/PHPUnit/Extensions/AppiumTestCase.php @@ -253,6 +253,14 @@ public function shake() $session->getDriver()->curl('POST', $url, null); } + public function getDeviceTime() + { + $session = $this->prepareSession(); + $url = $this->getSessionUrl()->descend('appium')->descend('device')->descend('system_time'); + $response = $session->getDriver()->curl('GET', $url); + return $response->getValue(); + } + public function hideKeyboard($args=array('strategy' => 'tapOutside')) { $data = array(); diff --git a/test/functional/ios/appium_tests.php b/test/functional/ios/appium_tests.php index e70e12b..534d347 100644 --- a/test/functional/ios/appium_tests.php +++ b/test/functional/ios/appium_tests.php @@ -92,6 +92,11 @@ public function testHideKeyboardNoKeyname() $this->assertFalse($keyboard->displayed()); } + public function testGetDeviceTime() + { + $this->getDeviceTime(); + } + public static $browsers = array( array( 'local' => true, From f01d0c156d548b83524efee0a6eb3412615828f2 Mon Sep 17 00:00:00 2001 From: Scott Dixon Date: Fri, 19 Feb 2016 16:33:20 -0800 Subject: [PATCH 3/4] Added getDeviceTime to readme changed multiaction_tests file format --- README.md | 1 + .../android/{multiaction_tests.html => multiaction_tests.php} | 0 2 files changed, 1 insertion(+) rename test/functional/android/{multiaction_tests.html => multiaction_tests.php} (100%) diff --git a/README.md b/README.md index de609f6..984f520 100644 --- a/README.md +++ b/README.md @@ -78,6 +78,7 @@ class MySuperTests extends PHPUnit_Extensions_AppiumTestCase * `endTestCoverage` * `lock` * `shake` +* `getDeviceTime` * `hideKeyboard` * `initiateTouchAction` * `initiateMultiAction` diff --git a/test/functional/android/multiaction_tests.html b/test/functional/android/multiaction_tests.php similarity index 100% rename from test/functional/android/multiaction_tests.html rename to test/functional/android/multiaction_tests.php From 1665cee6248ddacb0a72cc365e248b5d2a1db0d3 Mon Sep 17 00:00:00 2001 From: Sai Krishna Date: Mon, 23 May 2016 11:45:56 +0530 Subject: [PATCH 4/4] changed multiaction_tests file format