summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorFabio Bas <ctrlaltca@gmail.com>2013-09-28 17:05:05 +0200
committerFabio Bas <ctrlaltca@gmail.com>2013-09-28 17:05:05 +0200
commit6b73f119a4e12c8e4b09f95463eec9be7626dec5 (patch)
treed11ff8342d3fff4ccf77b854681ba49fbab33841 /tests
parente3a4bc286206a7cb11e78e80fd42980e5a298cd1 (diff)
More functional test porting
Diffstat (limited to 'tests')
-rwxr-xr-xtests/FunctionalTests/active-controls/tests/AutoCompleteTestCase.php40
-rwxr-xr-xtests/FunctionalTests/active-controls/tests/CalculatorTestCase.php2
-rwxr-xr-xtests/FunctionalTests/active-controlstests/ActiveRatingListTestCase.php58
3 files changed, 48 insertions, 52 deletions
diff --git a/tests/FunctionalTests/active-controls/tests/AutoCompleteTestCase.php b/tests/FunctionalTests/active-controls/tests/AutoCompleteTestCase.php
index 063e3d08..2033d6ff 100755
--- a/tests/FunctionalTests/active-controls/tests/AutoCompleteTestCase.php
+++ b/tests/FunctionalTests/active-controls/tests/AutoCompleteTestCase.php
@@ -4,43 +4,39 @@ class AutoCompleteTestCase extends PradoGenericSeleniumTest
{
function test()
{
- $this->disabled();
-
$this->open("active-controls/index.php?page=AutoCompleteTest");
$this->verifyTextPresent("TAutoComplete Test");
$this->assertText("label1", "Label 1");
- $this->keyPress("textbox3", 'a');
- $this->pause(1000);
+ $this->type("textbox3", 'a');
+ $this->runScript('Prado.Registry.get(\'textbox3\').onKeyPress({})');
+ $this->pause(500);
$this->verifyTextPresent('Andorra');
- $this->keyPress("textbox3", 'u');
- $this->pause(1000);
+ $this->assertText("label1", "suggestion for a");
+
+ $this->type("textbox3", 'au');
+ $this->runScript('Prado.Registry.get(\'textbox3\').onKeyPress({})');
+ $this->pause(500);
$this->verifyTextPresent('Australia');
- $this->click("heading"); //click somewhere else.
- $this->pause(800);
$this->assertText("label1", "suggestion for au");
+
$this->click("css=#textbox3_result ul li");
- $this->pause(800);
+ $this->pause(500);
$this->assertText("label1", "Label 1: Austria");
- $this->keyPress("textbox2", "c");
- $this->pause(800);
- $this->keyPress("textbox2", "u");
- $this->pause(800);
+ $this->type("textbox2", "cu");
+ $this->runScript('Prado.Registry.get(\'textbox2\').onKeyPress({})');
+ $this->pause(500);
$this->click('css=#textbox2_result ul li');
- $this->pause(800);
+ $this->pause(500);
$this->assertText("label1", "Label 1: Cuba");
- $this->keyPress("textbox2", ",");
-
- $this->keyPress("textbox2", "m");
- $this->pause(800);
-
- $this->keyPress("textbox2", "e");
- $this->pause(800);
+ $this->type("textbox2", "Cuba,me");
+ $this->runScript('Prado.Registry.get(\'textbox2\').onKeyPress({})');
+ $this->pause(500);
$this->click('css=#textbox2_result ul li');
- $this->pause(800);
+ $this->pause(500);
$this->assertText("label1", "Label 1: Cuba,Mexico");
}
}
diff --git a/tests/FunctionalTests/active-controls/tests/CalculatorTestCase.php b/tests/FunctionalTests/active-controls/tests/CalculatorTestCase.php
index 5e5e4daa..48960d39 100755
--- a/tests/FunctionalTests/active-controls/tests/CalculatorTestCase.php
+++ b/tests/FunctionalTests/active-controls/tests/CalculatorTestCase.php
@@ -15,7 +15,7 @@ class CalculatorTestCase extends PradoGenericSeleniumTest
$this->type("b", "5");
$this->click("sum");
- $this->pause(250);
+ $this->pause(500);
$this->assertNotVisible("summary");
$this->assertValue("c", "7");
diff --git a/tests/FunctionalTests/active-controlstests/ActiveRatingListTestCase.php b/tests/FunctionalTests/active-controlstests/ActiveRatingListTestCase.php
index 8034d6b2..ef82eaa3 100755
--- a/tests/FunctionalTests/active-controlstests/ActiveRatingListTestCase.php
+++ b/tests/FunctionalTests/active-controlstests/ActiveRatingListTestCase.php
@@ -184,40 +184,40 @@ class ActiveRatingListTestCase extends PradoGenericSeleniumTest
$this->assertText("Status", "Enabled=false");
$this->assertCheckBoxes("RatingList", array(3), 6);
}
-
+
function testHoverCaption()
{
// Verify we're on the right page.
$this->open("active-controls/index.php?page=ActiveRatingListHoverCaptionTest");
$this->verifyTextPresent("TActiveRatingList Hover Caption Test Case");
$this->assertText("Status", "CaptionID='Status'");
- $this->assertElementPresent("//input[@id='RatingList_c0']/../..[contains(@class, 'rating_selected')]");
- $this->assertElementPresent("//input[@id='RatingList_c1']/../..[contains(@class, 'rating_selected')]");
- $this->assertElementPresent("//input[@id='RatingList_c2']/../..[contains(@class, 'rating_selected')]");
- $this->assertElementPresent("//input[@id='RatingList_c3']/../..[contains(@class, 'rating_half')]");
- $this->assertElementPresent("//input[@id='RatingList_c3']/../..[contains(@class, 'rating')]");
- $this->assertElementPresent("//input[@id='RatingList_c4']/../..[contains(@class, 'rating')]");
- $this->assertElementPresent("//input[@id='RatingList_c5']/../..[contains(@class, 'rating')]");
+ $this->assertElementPresent("//input[@id='RatingList_c0']/../../../td[contains(@class, 'rating_selected')]");
+ $this->assertElementPresent("//input[@id='RatingList_c1']/../../../td[contains(@class, 'rating_selected')]");
+ $this->assertElementPresent("//input[@id='RatingList_c2']/../../../td[contains(@class, 'rating_selected')]");
+ $this->assertElementPresent("//input[@id='RatingList_c3']/../../../td[contains(@class, 'rating_half')]");
+ $this->assertElementPresent("//input[@id='RatingList_c3']/../../../td[contains(@class, 'rating')]");
+ $this->assertElementPresent("//input[@id='RatingList_c4']/../../../td[contains(@class, 'rating')]");
+ $this->assertElementPresent("//input[@id='RatingList_c5']/../../../td[contains(@class, 'rating')]");
$this->mouseOver("//input[@id='RatingList_c4']/../../");
$this->assertText("Status", "Excellent");
- $this->assertElementPresent("//input[@id='RatingList_c0']/../..[contains(@class, 'rating_hover')]");
- $this->assertElementPresent("//input[@id='RatingList_c1']/../..[contains(@class, 'rating_hover')]");
- $this->assertElementPresent("//input[@id='RatingList_c2']/../..[contains(@class, 'rating_hover')]");
- $this->assertElementPresent("//input[@id='RatingList_c3']/../..[contains(@class, 'rating_hover')]");
- $this->assertElementPresent("//input[@id='RatingList_c4']/../..[contains(@class, 'rating_hover')]");
- $this->assertElementNotPresent("//input[@id='RatingList_c5']/../..[contains(@class, 'rating_hover')]");
- $this->assertElementPresent("//input[@id='RatingList_c5']/../..[contains(@class, 'rating')]");
+ $this->assertElementPresent("//input[@id='RatingList_c0']/../../../td[contains(@class, 'rating_hover')]");
+ $this->assertElementPresent("//input[@id='RatingList_c1']/../../../td[contains(@class, 'rating_hover')]");
+ $this->assertElementPresent("//input[@id='RatingList_c2']/../../../td[contains(@class, 'rating_hover')]");
+ $this->assertElementPresent("//input[@id='RatingList_c3']/../../../td[contains(@class, 'rating_hover')]");
+ $this->assertElementPresent("//input[@id='RatingList_c4']/../../../td[contains(@class, 'rating_hover')]");
+ $this->assertElementPresent("//input[@id='RatingList_c5']/../../../td[not(contains(@class, 'rating_hover'))]");
+ $this->assertElementPresent("//input[@id='RatingList_c5']/../../../td[contains(@class, 'rating')]");
$this->mouseOut("//input[@id='RatingList_c4']/../../");
$this->assertText("Status", "CaptionID='Status'");
- $this->assertElementPresent("//input[@id='RatingList_c0']/../..[contains(@class, 'rating_selected')]");
- $this->assertElementPresent("//input[@id='RatingList_c1']/../..[contains(@class, 'rating_selected')]");
- $this->assertElementPresent("//input[@id='RatingList_c2']/../..[contains(@class, 'rating_selected')]");
- $this->assertElementNotPresent("//input[@id='RatingList_c3']/../..[contains(@class, 'rating_selected')]");
- $this->assertElementPresent("//input[@id='RatingList_c3']/../..[contains(@class, 'rating')]");
- $this->assertElementPresent("//input[@id='RatingList_c4']/../..[contains(@class, 'rating')]");
- $this->assertElementPresent("//input[@id='RatingList_c5']/../..[contains(@class, 'rating')]");
+ $this->assertElementPresent("//input[@id='RatingList_c0']/../../../td[contains(@class, 'rating_selected')]");
+ $this->assertElementPresent("//input[@id='RatingList_c1']/../../../td[contains(@class, 'rating_selected')]");
+ $this->assertElementPresent("//input[@id='RatingList_c2']/../../../td[contains(@class, 'rating_selected')]");
+ $this->assertElementPresent("//input[@id='RatingList_c3']/../../../td[not(contains(@class, 'rating_selected'))]");
+ $this->assertElementPresent("//input[@id='RatingList_c3']/../../../td[contains(@class, 'rating')]");
+ $this->assertElementPresent("//input[@id='RatingList_c4']/../../../td[contains(@class, 'rating')]");
+ $this->assertElementPresent("//input[@id='RatingList_c5']/../../../td[contains(@class, 'rating')]");
$this->mouseOver("//input[@id='RatingList_c1']/../../");
@@ -226,13 +226,13 @@ class ActiveRatingListTestCase extends PradoGenericSeleniumTest
$this->click("//input[@id='RatingList_c1']/../../");
$this->pause(800);
$this->assertText("Status", "2 : Fair");
- $this->assertElementPresent("//input[@id='RatingList_c0']/../..[contains(@class, 'rating_selected')]");
- $this->assertElementPresent("//input[@id='RatingList_c1']/../..[contains(@class, 'rating_selected')]");
- $this->assertElementNotPresent("//input[@id='RatingList_c2']/../..[contains(@class, 'rating_selected')]");
- $this->assertElementPresent("//input[@id='RatingList_c2']/../..[contains(@class, 'rating')]");
- $this->assertElementPresent("//input[@id='RatingList_c3']/../..[contains(@class, 'rating')]");
- $this->assertElementPresent("//input[@id='RatingList_c4']/../..[contains(@class, 'rating')]");
- $this->assertElementPresent("//input[@id='RatingList_c5']/../..[contains(@class, 'rating')]");
+ $this->assertElementPresent("//input[@id='RatingList_c0']/../../../td[contains(@class, 'rating_selected')]");
+ $this->assertElementPresent("//input[@id='RatingList_c1']/../../../td[contains(@class, 'rating_selected')]");
+ $this->assertElementPresent("//input[@id='RatingList_c2']/../../../td[not(contains(@class, 'rating_selected'))]");
+ $this->assertElementPresent("//input[@id='RatingList_c2']/../../../td[contains(@class, 'rating')]");
+ $this->assertElementPresent("//input[@id='RatingList_c3']/../../../td[contains(@class, 'rating')]");
+ $this->assertElementPresent("//input[@id='RatingList_c4']/../../../td[contains(@class, 'rating')]");
+ $this->assertElementPresent("//input[@id='RatingList_c5']/../../../td[contains(@class, 'rating')]");
}
function clickTD($clientID){