summaryrefslogtreecommitdiff
path: root/tests/test_tools
diff options
context:
space:
mode:
authorFabio Bas <ctrlaltca@gmail.com>2014-03-25 22:41:33 +0100
committerDavid <ottodavid@gmx.net>2014-08-21 17:32:09 +0200
commit94e34ad61868dc6a28de6f1a708d63ae0b6b4cf9 (patch)
tree79c298bb04c06c2d3673ceec9f8ae81968be5295 /tests/test_tools
parent2f2a18b9ccf154543ca02e9c189f23cc2862017d (diff)
More selenium2 tests porting
(cherry picked from commit 68bbb645ba5be61c2e3024ac3943c7346b30f1f2) Conflicts: tests/FunctionalTests/tickets/tests/Ticket587TestCase.php tests/FunctionalTests/tickets/tests/Ticket719TestCase.php
Diffstat (limited to 'tests/test_tools')
-rwxr-xr-x[-rw-r--r--]tests/test_tools/PradoGenericSelenium2Test.php44
1 files changed, 10 insertions, 34 deletions
diff --git a/tests/test_tools/PradoGenericSelenium2Test.php b/tests/test_tools/PradoGenericSelenium2Test.php
index c81f6e9a..23dfeb61 100644..100755
--- a/tests/test_tools/PradoGenericSelenium2Test.php
+++ b/tests/test_tools/PradoGenericSelenium2Test.php
@@ -64,15 +64,8 @@ class PradoGenericSelenium2Test extends PHPUnit_Extensions_Selenium2TestCase
protected function getElement($id)
{
- if(strpos($id, 'xpath=')===0)
- {
- return $this->byXPath(substr($id, 6));
- } elseif(strpos($id, 'css=')===0) {
- return $this->byCssSelector(substr($id, 4));
- } elseif(strpos($id, 'id=')===0) {
+ if(strpos($id, 'id=')===0) {
return $this->byId(substr($id, 3));
- } elseif(strpos($id, 'link=')===0) {
- return $this->byLinkText(substr($id, 5));
} elseif(strpos($id, 'name=')===0) {
return $this->byName(substr($id, 5));
} elseif(strpos($id, '//')===0) {
@@ -123,6 +116,15 @@ class PradoGenericSelenium2Test extends PHPUnit_Extensions_Selenium2TestCase
protected function type($id, $txt='')
{
$element = $this->getElement($id);
+ $element->clear();
+ $element->value($txt);
+ // trigger onblur() event
+ $this->byCssSelector('body')->click();
+ }
+
+ protected function typeSpecial($id, $txt='')
+ {
+ $element = $this->getElement($id);
// clear the textbox without using clear() that triggers onchange()
// the idea is to focus the input, move to the end of the text and hit
// backspace until the input is empty.
@@ -148,24 +150,6 @@ class PradoGenericSelenium2Test extends PHPUnit_Extensions_Selenium2TestCase
$this->byCssSelector('body')->click();
}
- protected function mouseOver($id)
- {
- $this->moveto(array(
- 'element' => $this->getElement($id),
-// 'xoffset' => 1,
-// 'yoffset' => 1,
- ));
- }
-
- protected function mouseOut($id)
- {
- $this->moveto(array(
- 'element' => $this->getElement('css=body'),
-// 'xoffset' => 0,
-// 'yoffset' => 0,
- ));
- }
-
protected function select($id, $value)
{
$select = parent::select($this->getElement($id));
@@ -227,14 +211,6 @@ class PradoGenericSelenium2Test extends PHPUnit_Extensions_Selenium2TestCase
$this->assertSame($index, parent::select($this->getElement($id))->selectedValue());
}
- protected function runScript($script)
- {
- $this->execute(array(
- 'script' => $script,
- 'args' => array()
- ));
- }
-
protected function assertAlertNotPresent()
{
try {