summaryrefslogtreecommitdiff
path: root/tests/test_tools/PradoGenericSelenium2Test.php
diff options
context:
space:
mode:
authorFabio Bas <ctrlaltca@gmail.com>2014-01-06 22:34:49 +0100
committerFabio Bas <ctrlaltca@gmail.com>2014-01-06 22:34:49 +0100
commit5d9f6fc77131d75e6c73a7e57df8d967b6b09215 (patch)
tree6dc4083ddb2e40b3616e5be795725f901df42fc5 /tests/test_tools/PradoGenericSelenium2Test.php
parentc09ff85baefcd84e399ca7987c738a76865732ab (diff)
Fixed some function tests; start working on porting them to Selenium2 interface
Diffstat (limited to 'tests/test_tools/PradoGenericSelenium2Test.php')
-rw-r--r--tests/test_tools/PradoGenericSelenium2Test.php49
1 files changed, 49 insertions, 0 deletions
diff --git a/tests/test_tools/PradoGenericSelenium2Test.php b/tests/test_tools/PradoGenericSelenium2Test.php
new file mode 100644
index 00000000..66350e11
--- /dev/null
+++ b/tests/test_tools/PradoGenericSelenium2Test.php
@@ -0,0 +1,49 @@
+<?php
+require_once 'PHPUnit/Extensions/Selenium2TestCase.php';
+
+// TODO: stub
+class PradoGenericSelenium2Test extends PHPUnit_Extensions_Selenium2TestCase
+{
+ static $browser='chrome';
+ static $baseurl='http://127.0.0.1/prado-3.2/tests/FunctionalTests/';
+ static $timeout=5; //seconds
+ static $wait=1000; //msecs
+
+ protected function setUp()
+ {
+ $this->setBrowser(static::$browser);
+ $this->setBrowserUrl(static::$baseurl);
+ $this->setSeleniumServerRequestsTimeout(static::$timeout);
+ }
+
+ public function setUpPage()
+ {
+ $this->timeouts()->implicitWait(static::$wait);
+ }
+
+ protected function open($url)
+ {
+ $this->url($url);
+ }
+
+ protected function tearDown()
+ {
+ }
+
+ protected function verifyTextPresent($txt)
+ {
+ $this->assertContains($txt, $this->source());
+ }
+
+ protected function assertText($id, $txt)
+ {
+ $element = $this->byId($id);
+ $this->assertEquals($txt, $element->text());
+ }
+
+ protected function pause($msec)
+ {
+ usleep($msec*1000);
+ }
+
+} \ No newline at end of file