Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions PHPUnit/Extensions/AppiumTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
5 changes: 2 additions & 3 deletions PHPUnit/Extensions/AppiumTestCase/Element.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ class MySuperTests extends PHPUnit_Extensions_AppiumTestCase
* `endTestCoverage`
* `lock`
* `shake`
* `getDeviceTime`
* `hideKeyboard`
* `initiateTouchAction`
* `initiateMultiAction`
Expand Down
5 changes: 5 additions & 0 deletions test/functional/ios/appium_tests.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,11 @@ public function testHideKeyboardNoKeyname()
$this->assertFalse($keyboard->displayed());
}

public function testGetDeviceTime()
{
$this->getDeviceTime();
}

public static $browsers = array(
array(
'local' => true,
Expand Down