summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFabio Bas <ctrlaltca@gmail.com>2013-09-24 15:10:25 +0200
committerFabio Bas <ctrlaltca@gmail.com>2013-09-24 15:10:25 +0200
commit315064cf9714cd1ae38ed5766a4f00299bd8be08 (patch)
treeff0ac57c2393a5524b1df69869d8af61f3683dc7
parent7c65b2f40ea9242260eac5a746863f5925423861 (diff)
Ported some failing functional tests to phpunit+selenium
-rwxr-xr-xtests/FunctionalTests/active-controls/tests/ActiveDatePickerTestCase.php48
-rwxr-xr-xtests/FunctionalTests/active-controls/tests/ActiveDropDownListTestCase.php2
-rwxr-xr-xtests/FunctionalTests/active-controls/tests/ActiveListBoxMasterTestCase.php12
-rwxr-xr-xtests/FunctionalTests/active-controls/tests/ActiveListBoxTestCase.php12
-rw-r--r--tests/test_tools/PradoGenericSeleniumTest.php30
-rw-r--r--tests/unit/Caching/temp/.gitignore2
6 files changed, 67 insertions, 39 deletions
diff --git a/tests/FunctionalTests/active-controls/tests/ActiveDatePickerTestCase.php b/tests/FunctionalTests/active-controls/tests/ActiveDatePickerTestCase.php
index 769dd356..be0a6fb4 100755
--- a/tests/FunctionalTests/active-controls/tests/ActiveDatePickerTestCase.php
+++ b/tests/FunctionalTests/active-controls/tests/ActiveDatePickerTestCase.php
@@ -39,39 +39,39 @@ class ActiveDatePickerTestCase extends PradoGenericSeleniumTest
$this->click("todayButton");
$this->pause(800);
- $this->verifySelected("datepicker_month", date('m'));
+ $this->assertSelected("datepicker_month", date('m'));
$this->verifyText("status", date('m-d-Y'));
$this->click("increaseButton");
$this->pause(800);
$dateToCheck=strtotime('+ 1 day');
- $this->verifySelected("datepicker_month", date('m', $dateToCheck));
- $this->verifySelected("datepicker_day", date('d', $dateToCheck));
- $this->verifySelected("datepicker_year", date('Y', $dateToCheck));
+ $this->assertSelected("datepicker_month", date('m', $dateToCheck));
+ $this->assertSelected("datepicker_day", date('d', $dateToCheck));
+ $this->assertSelected("datepicker_year", date('Y', $dateToCheck));
$this->verifyText("status", date('m-d-Y', $dateToCheck));
$this->click("increaseButton");
$this->pause(800);
$dateToCheck=strtotime('+ 2 day');
- $this->verifySelected("datepicker_month", date('m', $dateToCheck));
- $this->verifySelected("datepicker_day", date('d', $dateToCheck));
- $this->verifySelected("datepicker_year", date('Y', $dateToCheck));
+ $this->assertSelected("datepicker_month", date('m', $dateToCheck));
+ $this->assertSelected("datepicker_day", date('d', $dateToCheck));
+ $this->assertSelected("datepicker_year", date('Y', $dateToCheck));
$this->verifyText("status", date('m-d-Y', $dateToCheck));
$this->click("todayButton");
$this->pause(800);
$dateToCheck=time();
- $this->verifySelected("datepicker_month", date('m', $dateToCheck));
- $this->verifySelected("datepicker_day", date('d', $dateToCheck));
- $this->verifySelected("datepicker_year", date('Y', $dateToCheck));
+ $this->assertSelected("datepicker_month", date('m', $dateToCheck));
+ $this->assertSelected("datepicker_day", date('d', $dateToCheck));
+ $this->assertSelected("datepicker_year", date('Y', $dateToCheck));
$this->verifyText("status", date('m-d-Y', $dateToCheck));
$this->click("decreaseButton");
$this->pause(800);
$dateToCheck=strtotime('- 1 day');
- $this->verifySelected("datepicker_month", date('m', $dateToCheck));
- $this->verifySelected("datepicker_day", date('d', $dateToCheck));
- $this->verifySelected("datepicker_year", date('Y', $dateToCheck));
+ $this->assertSelected("datepicker_month", date('m', $dateToCheck));
+ $this->assertSelected("datepicker_day", date('d', $dateToCheck));
+ $this->assertSelected("datepicker_year", date('Y', $dateToCheck));
$this->verifyText("status", date('m-d-Y', $dateToCheck));
$this->click("datepickerbutton");
@@ -79,17 +79,17 @@ class ActiveDatePickerTestCase extends PradoGenericSeleniumTest
$this->click("css=input.todayButton");
$this->pause(800);
$dateToCheck=time();
- $this->verifySelected("datepicker_month", date('m', $dateToCheck));
- $this->verifySelected("datepicker_day", date('d', $dateToCheck));
- $this->verifySelected("datepicker_year", date('Y', $dateToCheck));
+ $this->assertSelected("datepicker_month", date('m', $dateToCheck));
+ $this->assertSelected("datepicker_day", date('d', $dateToCheck));
+ $this->assertSelected("datepicker_year", date('Y', $dateToCheck));
$this->verifyText("status", date('m-d-Y', $dateToCheck));
$this->click("css=input.nextMonthButton");
$this->pause(800);
$dateToCheck=strtotime('+ 1 month');
- $this->verifySelected("datepicker_month", date('m', $dateToCheck));
- $this->verifySelected("datepicker_day", date('d', $dateToCheck));
- $this->verifySelected("datepicker_year", date('Y', $dateToCheck));
+ $this->assertSelected("datepicker_month", date('m', $dateToCheck));
+ $this->assertSelected("datepicker_day", date('d', $dateToCheck));
+ $this->assertSelected("datepicker_year", date('Y', $dateToCheck));
$this->verifyText("status", date('m-d-Y', $dateToCheck));
$this->click('ctl1');
@@ -97,9 +97,9 @@ class ActiveDatePickerTestCase extends PradoGenericSeleniumTest
$this->verifyText("status2", "");
$dateToCheck=time();
- $this->verifySelected("datepicker2_month", date('m', $dateToCheck));
- $this->verifySelected("datepicker2_day", date('d', $dateToCheck));
- $this->verifySelected("datepicker2_year", date('Y', $dateToCheck));
+ $this->assertSelected("datepicker2_month", date('m', $dateToCheck));
+ $this->assertSelected("datepicker2_day", date('d', $dateToCheck));
+ $this->assertSelected("datepicker2_year", date('Y', $dateToCheck));
$this->select("datepicker2_year", date('Y')+1);
$this->pause(800);
$dateToCheck=mktime(0,0,0,(int)date('m'),(int)date('d'), date('Y')+1);
@@ -108,8 +108,8 @@ class ActiveDatePickerTestCase extends PradoGenericSeleniumTest
$this->verifyText("status3", "");
$dateToCheck=time();
- $this->verifySelected("datepicker3_month", date('F', $dateToCheck));
- $this->verifySelected("datepicker3_year", date('Y', $dateToCheck));
+ $this->assertSelected("datepicker3_month", date('F', $dateToCheck));
+ $this->assertSelected("datepicker3_year", date('Y', $dateToCheck));
$this->select("datepicker3_year", date('Y')+1);
$this->pause(800);
$dateToCheck=mktime(0,0,0,(int)date('m'),(int)date('d'), date('Y')+1);
diff --git a/tests/FunctionalTests/active-controls/tests/ActiveDropDownListTestCase.php b/tests/FunctionalTests/active-controls/tests/ActiveDropDownListTestCase.php
index d365c784..a54cbd75 100755
--- a/tests/FunctionalTests/active-controls/tests/ActiveDropDownListTestCase.php
+++ b/tests/FunctionalTests/active-controls/tests/ActiveDropDownListTestCase.php
@@ -15,7 +15,7 @@ class ActiveDropDownListTestCase extends PradoGenericSeleniumTest
$this->click("button2");
$this->pause(800);
- $this->assertEmptySelection("list1");
+ $this->assertSelectedIndex("list1", 0);
$this->click("button3");
$this->pause(800);
diff --git a/tests/FunctionalTests/active-controls/tests/ActiveListBoxMasterTestCase.php b/tests/FunctionalTests/active-controls/tests/ActiveListBoxMasterTestCase.php
index 555d9b25..911e3cc7 100755
--- a/tests/FunctionalTests/active-controls/tests/ActiveListBoxMasterTestCase.php
+++ b/tests/FunctionalTests/active-controls/tests/ActiveListBoxMasterTestCase.php
@@ -13,29 +13,29 @@ class ActiveListBoxMasterTestCase extends PradoGenericSeleniumTest
$this->click($base."button1");
$this->pause(800);
- $this->assertSelectedIndexes($base.'list1', '1,2,3');
+ $this->assertEquals($this->getSelectedLabels($base.'list1'), array('item 2', 'item 3', 'item 4'));
$this->click($base.'button3');
$this->pause(800);
- $this->assertSelectedIndexes($base.'list1', '0');
+ $this->assertEquals($this->getSelectedLabels($base.'list1'), array('item 1'));
$this->click($base.'button4');
$this->pause(800);
- $this->assertSelectedIndexes($base.'list1', '4');
+ $this->assertEquals($this->getSelectedLabels($base.'list1'), array('item 5'));
$this->click($base.'button5');
$this->pause(800);
- $this->assertSelectedIndexes($base.'list1', '1,4');
+ $this->assertEquals($this->getSelectedLabels($base.'list1'), array('item 2', 'item 5'));
$this->click($base.'button2');
$this->pause(800);
- $this->assertEmptySelection($base."list1");
+ $this->assertNotSomethingSelected($base."list1");
$this->click($base.'button6');
$this->pause(800);
$this->click($base."button1");
$this->pause(800);
- $this->assertSelectedIndexes($base.'list1', '1,2,3');
+ $this->assertEquals($this->getSelectedLabels($base.'list1'), array('item 2', 'item 3', 'item 4'));
$this->select($base."list1", "item 1");
$this->pause(800);
diff --git a/tests/FunctionalTests/active-controls/tests/ActiveListBoxTestCase.php b/tests/FunctionalTests/active-controls/tests/ActiveListBoxTestCase.php
index 9976211b..d45cb42c 100755
--- a/tests/FunctionalTests/active-controls/tests/ActiveListBoxTestCase.php
+++ b/tests/FunctionalTests/active-controls/tests/ActiveListBoxTestCase.php
@@ -11,29 +11,29 @@ class ActiveListBoxTestCase extends PradoGenericSeleniumTest
$this->click("button1");
$this->pause(800);
- $this->assertSelectedIndexes('list1', '1,2,3');
+ $this->assertEquals($this->getSelectedLabels('list1'), array('item 2', 'item 3', 'item 4'));
$this->click('button3');
$this->pause(800);
- $this->assertSelectedIndexes('list1', '0');
+ $this->assertEquals($this->getSelectedLabels('list1'), array('item 1'));
$this->click('button4');
$this->pause(800);
- $this->assertSelectedIndexes('list1', '4');
+ $this->assertEquals($this->getSelectedLabels('list1'), array('item 5'));
$this->click('button5');
$this->pause(800);
- $this->assertSelectedIndexes('list1', '1,4');
+ $this->assertEquals($this->getSelectedLabels('list1'), array('item 2', 'item 5'));
$this->click('button2');
$this->pause(800);
- $this->assertEmptySelection("list1");
+ $this->assertNotSomethingSelected("list1");
$this->click('button6');
$this->pause(800);
$this->click("button1");
$this->pause(800);
- $this->assertSelectedIndexes('list1', '1,2,3');
+ $this->assertEquals($this->getSelectedLabels('list1'), array('item 2', 'item 3', 'item 4'));
$this->select("list1", "item 1");
$this->pause(800);
diff --git a/tests/test_tools/PradoGenericSeleniumTest.php b/tests/test_tools/PradoGenericSeleniumTest.php
index 547ff2f0..922b9d87 100644
--- a/tests/test_tools/PradoGenericSeleniumTest.php
+++ b/tests/test_tools/PradoGenericSeleniumTest.php
@@ -1,12 +1,38 @@
<?php
require_once 'PHPUnit/Extensions/SeleniumTestCase.php';
+require_once 'PHPUnit/Extensions/Selenium2TestCase.php';
class PradoGenericSeleniumTest extends PHPUnit_Extensions_SeleniumTestCase
{
+ static $browser='*googlechrome';
+ 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 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('*googlechrome');
- $this->setBrowserUrl('http://127.0.0.1/prado-3.2/tests/FunctionalTests/');
+ $this->setBrowser(static::$browser);
+ $this->setBrowserUrl(static::$baseurl);
+ }
+
+ protected function open($url)
+ {
+ $this->setBrowserUrl(static::$baseurl.$url);
}
protected function tearDown()
diff --git a/tests/unit/Caching/temp/.gitignore b/tests/unit/Caching/temp/.gitignore
index e69de29b..d6b7ef32 100644
--- a/tests/unit/Caching/temp/.gitignore
+++ b/tests/unit/Caching/temp/.gitignore
@@ -0,0 +1,2 @@
+*
+!.gitignore