diff options
author | Fabio Bas <ctrlaltca@gmail.com> | 2014-03-05 23:02:18 +0100 |
---|---|---|
committer | David <ottodavid@gmx.net> | 2014-08-21 17:30:13 +0200 |
commit | 94e54d3023ed89281f89125f3ad0553afb9312cb (patch) | |
tree | 688470329e8b837252b523b6341fe5e10fe34b95 /tests/test_tools/PradoGenericSelenium2Test.php | |
parent | 32dfd8233520261483bdf30f23425e3b50f05d17 (diff) |
Started cleaning tests' selenium2 compatibility layer
(cherry picked from commit 4ce02f6973aa40c313364b5ff7990f2244309790)
Conflicts:
tests/FunctionalTests/tickets/tests/Ticket220TestCase.php
tests/FunctionalTests/tickets/tests/Ticket719TestCase.php
tests/FunctionalTests/tickets/tests/Ticket769TestCase.php
tests/FunctionalTests/validators/tests/CompareValidatorTestCase.php
tests/FunctionalTests/validators/tests/DataTypeValidatorTestCase.php
tests/FunctionalTests/validators/tests/DatePickerTestCase.php
Diffstat (limited to 'tests/test_tools/PradoGenericSelenium2Test.php')
-rw-r--r-- | tests/test_tools/PradoGenericSelenium2Test.php | 90 |
1 files changed, 4 insertions, 86 deletions
diff --git a/tests/test_tools/PradoGenericSelenium2Test.php b/tests/test_tools/PradoGenericSelenium2Test.php index ec948f7f..c81f6e9a 100644 --- a/tests/test_tools/PradoGenericSelenium2Test.php +++ b/tests/test_tools/PradoGenericSelenium2Test.php @@ -39,7 +39,6 @@ class PradoGenericSelenium2Test extends PHPUnit_Extensions_Selenium2TestCase static $baseurl='http://127.0.0.1/prado-master/tests/FunctionalTests/'; static $timeout=5; //seconds - static $wait=1000; //msecs protected function setUp() { @@ -48,22 +47,7 @@ class PradoGenericSelenium2Test extends PHPUnit_Extensions_Selenium2TestCase $this->setSeleniumServerRequestsTimeout(static::$timeout); } - protected function verifyTitle($txt) - { - $this->assertEquals($txt, $this->title()); - } - - protected function assertTextPresent($txt) - { - if(strpos($txt, 'regexp:')===0) - { - $this->assertRegExp('/'.substr($txt, 7).'/', $this->source()); - } else { - $this->assertContains($txt, $this->source()); - } - } - - protected function verifyAttribute($idattr, $txt) + protected function assertAttribute($idattr, $txt) { list($id, $attr) = explode('@', $idattr); @@ -78,21 +62,6 @@ class PradoGenericSelenium2Test extends PHPUnit_Extensions_Selenium2TestCase } } - protected function assertTextNotPresent($txt) - { - $this->assertNotContains($txt, $this->source()); - } - - protected function assertChecked($id) - { - $this->assertTrue($this->getElement($id)->selected()); - } - - protected function assertNotChecked($id) - { - $this->assertFalse($this->getElement($id)->selected()); - } - protected function getElement($id) { if(strpos($id, 'xpath=')===0) @@ -140,23 +109,6 @@ class PradoGenericSelenium2Test extends PHPUnit_Extensions_Selenium2TestCase $this->assertTrue($this->getElement($id)!==null); } - protected function assertAlert($txt) - { - $this->assertEquals($txt, $this->alertText()); - $this->acceptAlert(); - } - - protected function verifyConfirmation($txt) - { - $this->assertAlert($txt); - } - - protected function verifyConfirmationDismiss($txt) - { - $this->assertEquals($txt, $this->alertText()); - $this->dismissAlert(); - } - protected function assertElementNotPresent($id) { try { @@ -193,24 +145,7 @@ class PradoGenericSelenium2Test extends PHPUnit_Extensions_Selenium2TestCase $element->value($txt); // trigger onblur() event - $this->clickAt('css=body', '1,1'); - } - - protected function click($id, $foo='bar') - { - $this->getElement($id)->click(); - } - - protected function clickAt($id, $coords) - { -// list($x, $y) = explode(',', $coords); - $this->moveto(array( - 'element' => $this->getElement($id), -// 'xoffset' => intval($x), -// 'yoffset' => intval($y), - )); - - parent::click(); + $this->byCssSelector('body')->click(); } protected function mouseOver($id) @@ -231,22 +166,12 @@ class PradoGenericSelenium2Test extends PHPUnit_Extensions_Selenium2TestCase )); } - protected function clickAndWait($id, $foo='bar') - { - $this->click($id, $foo); - } - protected function select($id, $value) { $select = parent::select($this->getElement($id)); $select->clearSelectedOptions(); - if(strpos($value, 'label=')===0) - { - $select->selectOptionByLabel(substr($value, 6)); - } else { - $select->selectOptionByLabel($value); - } + $select->selectOptionByLabel($value); } protected function selectAndWait($id, $value) @@ -256,14 +181,7 @@ class PradoGenericSelenium2Test extends PHPUnit_Extensions_Selenium2TestCase protected function addSelection($id, $value) { - $select = parent::select($this->getElement($id)); - - if(strpos($value, 'label=')===0) - { - $select->selectOptionByLabel(substr($value, 6)); - } else { - $select->selectOptionByLabel($value); - } + parent::select($this->getElement($id))->selectOptionByLabel($value); } protected function getSelectedLabels($id) |