summaryrefslogtreecommitdiff
path: root/tests/test_tools
diff options
context:
space:
mode:
authorFabio Bas <ctrlaltca@gmail.com>2014-01-06 22:34:49 +0100
committerDavid <ottodavid@gmx.net>2014-08-21 17:18:50 +0200
commit48577f63f414dc3078abc4bdc93bde932fe666a6 (patch)
treec17d333a28c4a8e1167ec90d56f4a79da797d4c1 /tests/test_tools
parent2b11341614ac4a15be697fa8acad07055154ac54 (diff)
Fixed some function tests; start working on porting them to Selenium2 interface
(cherry picked from commit 5d9f6fc77131d75e6c73a7e57df8d967b6b09215) Conflicts: tests/FunctionalTests/validators/tests/DatePickerTestCase.php
Diffstat (limited to 'tests/test_tools')
-rw-r--r--tests/test_tools/PradoGenericSelenium2Test.php49
-rw-r--r--tests/test_tools/PradoGenericSeleniumTest.php25
-rw-r--r--tests/test_tools/phpunit_bootstrap.php3
3 files changed, 52 insertions, 25 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
diff --git a/tests/test_tools/PradoGenericSeleniumTest.php b/tests/test_tools/PradoGenericSeleniumTest.php
index 2c9ceb21..9a60f95a 100644
--- a/tests/test_tools/PradoGenericSeleniumTest.php
+++ b/tests/test_tools/PradoGenericSeleniumTest.php
@@ -1,7 +1,6 @@
<?php
require_once 'PHPUnit/Extensions/SeleniumTestCase.php';
-require_once 'PHPUnit/Extensions/Selenium2TestCase.php';
-
+
class PradoGenericSeleniumTest extends PHPUnit_Extensions_SeleniumTestCase
{
static $browser='*googlechrome';
@@ -17,26 +16,4 @@ class PradoGenericSeleniumTest extends PHPUnit_Extensions_SeleniumTestCase
protected function tearDown()
{
}
-}
-
-// TODO: stub
-class PradoGenericSelenium2Test extends PHPUnit_Extensions_Selenium2TestCase
-{
- static $browser='chrome';
- static $baseurl='http://127.0.0.1/prado-3.2/tests/FunctionalTests/';
-
- protected function setUp()
- {
- $this->setBrowser(static::$browser);
- $this->setBrowserUrl(static::$baseurl);
- }
-
- protected function open($url)
- {
- $this->setBrowserUrl(static::$baseurl.$url);
- }
-
- protected function tearDown()
- {
- }
} \ No newline at end of file
diff --git a/tests/test_tools/phpunit_bootstrap.php b/tests/test_tools/phpunit_bootstrap.php
index 1154e5fc..23e25a1c 100644
--- a/tests/test_tools/phpunit_bootstrap.php
+++ b/tests/test_tools/phpunit_bootstrap.php
@@ -22,4 +22,5 @@ if (!@include_once VENDOR_DIR.'/autoload.php') {
require_once(PRADO_FRAMEWORK_DIR.'/prado.php');
// for FunctionalTests
-require_once(__DIR__.'/PradoGenericSeleniumTest.php'); \ No newline at end of file
+require_once(__DIR__.'/PradoGenericSeleniumTest.php');
+require_once(__DIR__.'/PradoGenericSelenium2Test.php'); \ No newline at end of file