From 15161da7755a8d74853ccae0966afa22d9830b07 Mon Sep 17 00:00:00 2001 From: "Christophe.Boulain" <> Date: Sat, 8 Nov 2008 17:41:48 +0000 Subject: Issue#36: Refactored TRatingList/TActiveRatingList, and added some docs. --- .../pages/ActiveRatingListAllowInputTest.page | 14 ++ .../pages/ActiveRatingListAllowInputTest.php | 27 +++ .../pages/ActiveRatingListAutoPostBackTest.page | 16 ++ .../pages/ActiveRatingListAutoPostBackTest.php | 27 +++ .../pages/ActiveRatingListCheckBoxesTest.page | 12 + .../pages/ActiveRatingListCheckBoxesTest.php | 23 ++ .../pages/ActiveRatingListEnabledTest.page | 17 ++ .../pages/ActiveRatingListEnabledTest.php | 37 +++ .../pages/ActiveRatingListHoverCaptionTest.page | 14 ++ .../pages/ActiveRatingListHoverCaptionTest.php | 27 +++ .../pages/ActiveRatingListRatingTest.page | 17 ++ .../protected/pages/ActiveRatingListRatingTest.php | 32 +++ .../pages/ActiveRatingListReadOnlyTest.page | 17 ++ .../pages/ActiveRatingListReadOnlyTest.php | 38 ++++ .../pages/ActiveRatingListSelectedIndexTest.page | 17 ++ .../pages/ActiveRatingListSelectedIndexTest.php | 32 +++ .../protected/pages/RatingList.page | 13 +- .../ActiveRatingListTestCase.php | 253 +++++++++++++++++++++ 18 files changed, 621 insertions(+), 12 deletions(-) create mode 100644 tests/FunctionalTests/active-controls/protected/pages/ActiveRatingListAllowInputTest.page create mode 100644 tests/FunctionalTests/active-controls/protected/pages/ActiveRatingListAllowInputTest.php create mode 100644 tests/FunctionalTests/active-controls/protected/pages/ActiveRatingListAutoPostBackTest.page create mode 100644 tests/FunctionalTests/active-controls/protected/pages/ActiveRatingListAutoPostBackTest.php create mode 100644 tests/FunctionalTests/active-controls/protected/pages/ActiveRatingListCheckBoxesTest.page create mode 100644 tests/FunctionalTests/active-controls/protected/pages/ActiveRatingListCheckBoxesTest.php create mode 100644 tests/FunctionalTests/active-controls/protected/pages/ActiveRatingListEnabledTest.page create mode 100644 tests/FunctionalTests/active-controls/protected/pages/ActiveRatingListEnabledTest.php create mode 100644 tests/FunctionalTests/active-controls/protected/pages/ActiveRatingListHoverCaptionTest.page create mode 100644 tests/FunctionalTests/active-controls/protected/pages/ActiveRatingListHoverCaptionTest.php create mode 100644 tests/FunctionalTests/active-controls/protected/pages/ActiveRatingListRatingTest.page create mode 100644 tests/FunctionalTests/active-controls/protected/pages/ActiveRatingListRatingTest.php create mode 100644 tests/FunctionalTests/active-controls/protected/pages/ActiveRatingListReadOnlyTest.page create mode 100644 tests/FunctionalTests/active-controls/protected/pages/ActiveRatingListReadOnlyTest.php create mode 100644 tests/FunctionalTests/active-controls/protected/pages/ActiveRatingListSelectedIndexTest.page create mode 100644 tests/FunctionalTests/active-controls/protected/pages/ActiveRatingListSelectedIndexTest.php create mode 100644 tests/FunctionalTests/active-controlstests/ActiveRatingListTestCase.php (limited to 'tests/FunctionalTests') diff --git a/tests/FunctionalTests/active-controls/protected/pages/ActiveRatingListAllowInputTest.page b/tests/FunctionalTests/active-controls/protected/pages/ActiveRatingListAllowInputTest.page new file mode 100644 index 00000000..35fcadc7 --- /dev/null +++ b/tests/FunctionalTests/active-controls/protected/pages/ActiveRatingListAllowInputTest.page @@ -0,0 +1,14 @@ + + +

TActiveRatingList AllowInput Test Case

+ + + + + + + + + +
\ No newline at end of file diff --git a/tests/FunctionalTests/active-controls/protected/pages/ActiveRatingListAllowInputTest.php b/tests/FunctionalTests/active-controls/protected/pages/ActiveRatingListAllowInputTest.php new file mode 100644 index 00000000..c825f3f8 --- /dev/null +++ b/tests/FunctionalTests/active-controls/protected/pages/ActiveRatingListAllowInputTest.php @@ -0,0 +1,27 @@ + + * @version Creation Date: Oct 13, 2008 + */ + +/** + * TRatingListTest.php class + * + * + * + * Properties + * - + * + * @author Bradley Booms + * @version Modified Date: Oct 13, 2008 + * + * Modifications: + */ +class ActiveRatingListAllowInputTest extends TPage{ + public function ratingChanged($sender, $param){ + $this->Status->setText($sender->getRating().' : '.$sender->getSelectedValue()); + } +} +?> \ No newline at end of file diff --git a/tests/FunctionalTests/active-controls/protected/pages/ActiveRatingListAutoPostBackTest.page b/tests/FunctionalTests/active-controls/protected/pages/ActiveRatingListAutoPostBackTest.page new file mode 100644 index 00000000..84ce4ef3 --- /dev/null +++ b/tests/FunctionalTests/active-controls/protected/pages/ActiveRatingListAutoPostBackTest.page @@ -0,0 +1,16 @@ + + +

TActiveRatingList AutoPostBack Test Case

+ + + + + + + + + +
+ +
\ No newline at end of file diff --git a/tests/FunctionalTests/active-controls/protected/pages/ActiveRatingListAutoPostBackTest.php b/tests/FunctionalTests/active-controls/protected/pages/ActiveRatingListAutoPostBackTest.php new file mode 100644 index 00000000..4b087b76 --- /dev/null +++ b/tests/FunctionalTests/active-controls/protected/pages/ActiveRatingListAutoPostBackTest.php @@ -0,0 +1,27 @@ + + * @version Creation Date: Oct 13, 2008 + */ + +/** + * TRatingListTest.php class + * + * + * + * Properties + * - + * + * @author Bradley Booms + * @version Modified Date: Oct 13, 2008 + * + * Modifications: + */ +class ActiveRatingListAutoPostBackTest extends TPage{ + public function ratingChanged($sender, $param){ + $this->Status->setText($sender->getRating().' : '.$sender->getSelectedValue()); + } +} +?> \ No newline at end of file diff --git a/tests/FunctionalTests/active-controls/protected/pages/ActiveRatingListCheckBoxesTest.page b/tests/FunctionalTests/active-controls/protected/pages/ActiveRatingListCheckBoxesTest.page new file mode 100644 index 00000000..36f4404d --- /dev/null +++ b/tests/FunctionalTests/active-controls/protected/pages/ActiveRatingListCheckBoxesTest.page @@ -0,0 +1,12 @@ + + +

TActiveRatingList Check Boxes Test Case

+ + + + + + + + +
\ No newline at end of file diff --git a/tests/FunctionalTests/active-controls/protected/pages/ActiveRatingListCheckBoxesTest.php b/tests/FunctionalTests/active-controls/protected/pages/ActiveRatingListCheckBoxesTest.php new file mode 100644 index 00000000..5c6dfa70 --- /dev/null +++ b/tests/FunctionalTests/active-controls/protected/pages/ActiveRatingListCheckBoxesTest.php @@ -0,0 +1,23 @@ + + * @version Creation Date: Oct 13, 2008 + */ + +/** + * TRatingListTest.php class + * + * + * + * Properties + * - + * + * @author Bradley Booms + * @version Modified Date: Oct 13, 2008 + * + * Modifications: + */ +class ActiveRatingListCheckBoxesTest extends TPage{ } +?> \ No newline at end of file diff --git a/tests/FunctionalTests/active-controls/protected/pages/ActiveRatingListEnabledTest.page b/tests/FunctionalTests/active-controls/protected/pages/ActiveRatingListEnabledTest.page new file mode 100644 index 00000000..5f732e0d --- /dev/null +++ b/tests/FunctionalTests/active-controls/protected/pages/ActiveRatingListEnabledTest.page @@ -0,0 +1,17 @@ + + +

TActiveRatingList Enabled Test Case

+ + + + + + + + + +
+ + +
\ No newline at end of file diff --git a/tests/FunctionalTests/active-controls/protected/pages/ActiveRatingListEnabledTest.php b/tests/FunctionalTests/active-controls/protected/pages/ActiveRatingListEnabledTest.php new file mode 100644 index 00000000..0cac7418 --- /dev/null +++ b/tests/FunctionalTests/active-controls/protected/pages/ActiveRatingListEnabledTest.php @@ -0,0 +1,37 @@ + + * @version Creation Date: Oct 13, 2008 + */ + +/** + * TRatingListTest.php class + * + * + * + * Properties + * - + * + * @author Bradley Booms + * @version Modified Date: Oct 13, 2008 + * + * Modifications: + */ +class ActiveRatingListEnabledTest extends TPage{ + public function ratingChanged($sender, $param){ + $this->Status->setText($sender->getRating().' : '.$sender->getSelectedValue()); + } + + public function enable($sender, $param){ + $this->RatingList->setEnabled(true); + $this->Status->setText('Enabled=true'); + } + + public function disable($sender, $param){ + $this->RatingList->setEnabled(false); + $this->Status->setText('Enabled=false'); + } +} +?> \ No newline at end of file diff --git a/tests/FunctionalTests/active-controls/protected/pages/ActiveRatingListHoverCaptionTest.page b/tests/FunctionalTests/active-controls/protected/pages/ActiveRatingListHoverCaptionTest.page new file mode 100644 index 00000000..01e47a34 --- /dev/null +++ b/tests/FunctionalTests/active-controls/protected/pages/ActiveRatingListHoverCaptionTest.page @@ -0,0 +1,14 @@ + + +

TActiveRatingList Hover Caption Test Case

+ + + + + + + + + +
\ No newline at end of file diff --git a/tests/FunctionalTests/active-controls/protected/pages/ActiveRatingListHoverCaptionTest.php b/tests/FunctionalTests/active-controls/protected/pages/ActiveRatingListHoverCaptionTest.php new file mode 100644 index 00000000..06d82d39 --- /dev/null +++ b/tests/FunctionalTests/active-controls/protected/pages/ActiveRatingListHoverCaptionTest.php @@ -0,0 +1,27 @@ + + * @version Creation Date: Oct 13, 2008 + */ + +/** + * TRatingListTest.php class + * + * + * + * Properties + * - + * + * @author Bradley Booms + * @version Modified Date: Oct 13, 2008 + * + * Modifications: + */ +class ActiveRatingListHoverCaptionTest extends TPage{ + public function ratingChanged($sender, $param){ + $sender->setCaption($sender->getRating().' : '.$sender->getSelectedValue()); + } +} +?> \ No newline at end of file diff --git a/tests/FunctionalTests/active-controls/protected/pages/ActiveRatingListRatingTest.page b/tests/FunctionalTests/active-controls/protected/pages/ActiveRatingListRatingTest.page new file mode 100644 index 00000000..942a5b45 --- /dev/null +++ b/tests/FunctionalTests/active-controls/protected/pages/ActiveRatingListRatingTest.page @@ -0,0 +1,17 @@ + + +

TActiveRatingList Rating Test Case

+ + + + + + + + + +
+ +
\ No newline at end of file diff --git a/tests/FunctionalTests/active-controls/protected/pages/ActiveRatingListRatingTest.php b/tests/FunctionalTests/active-controls/protected/pages/ActiveRatingListRatingTest.php new file mode 100644 index 00000000..fe5c8404 --- /dev/null +++ b/tests/FunctionalTests/active-controls/protected/pages/ActiveRatingListRatingTest.php @@ -0,0 +1,32 @@ + + * @version Creation Date: Oct 13, 2008 + */ + +/** + * TRatingListTest.php class + * + * + * + * Properties + * - + * + * @author Bradley Booms + * @version Modified Date: Oct 13, 2008 + * + * Modifications: + */ +class ActiveRatingListRatingTest extends TPage{ + public function ratingChanged($sender, $param){ + $this->Status->setText('Rating: '.$sender->getRating()); + } + + public function setRating($sender, $param){ + $this->RatingList->setRating(3); + $this->ratingChanged($this->RatingList, null); + } +} +?> \ No newline at end of file diff --git a/tests/FunctionalTests/active-controls/protected/pages/ActiveRatingListReadOnlyTest.page b/tests/FunctionalTests/active-controls/protected/pages/ActiveRatingListReadOnlyTest.page new file mode 100644 index 00000000..dad3fd6e --- /dev/null +++ b/tests/FunctionalTests/active-controls/protected/pages/ActiveRatingListReadOnlyTest.page @@ -0,0 +1,17 @@ + + +

TActiveRatingList ReadOnly Test Case

+ + + + + + + + + +
+ + +
\ No newline at end of file diff --git a/tests/FunctionalTests/active-controls/protected/pages/ActiveRatingListReadOnlyTest.php b/tests/FunctionalTests/active-controls/protected/pages/ActiveRatingListReadOnlyTest.php new file mode 100644 index 00000000..070fd13f --- /dev/null +++ b/tests/FunctionalTests/active-controls/protected/pages/ActiveRatingListReadOnlyTest.php @@ -0,0 +1,38 @@ + + * @version Creation Date: Oct 13, 2008 + */ + +/** + * TRatingListTest.php class + * + * + * + * Properties + * - + * + * @author Bradley Booms + * @version Modified Date: Oct 13, 2008 + * + * Modifications: + */ +class ActiveRatingListReadOnlyTest extends TPage{ + public function ratingChanged($sender, $param){ + $this->Status->setText($sender->getRating().' : '.$sender->getSelectedValue()); + } + + public function readOnly($sender, $param){ + $this->RatingList->setReadOnly(true); + $this->Status->setText('ReadOnly=true'); + } + + public function writable($sender, $param){ + $this->RatingList->setReadOnly(false); + $this->Status->setText('ReadOnly=false'); + } + +} +?> \ No newline at end of file diff --git a/tests/FunctionalTests/active-controls/protected/pages/ActiveRatingListSelectedIndexTest.page b/tests/FunctionalTests/active-controls/protected/pages/ActiveRatingListSelectedIndexTest.page new file mode 100644 index 00000000..6fb52822 --- /dev/null +++ b/tests/FunctionalTests/active-controls/protected/pages/ActiveRatingListSelectedIndexTest.page @@ -0,0 +1,17 @@ + + +

TActiveRatingList SelectedIndex Test Case

+ + + + + + + + + +
+ +
\ No newline at end of file diff --git a/tests/FunctionalTests/active-controls/protected/pages/ActiveRatingListSelectedIndexTest.php b/tests/FunctionalTests/active-controls/protected/pages/ActiveRatingListSelectedIndexTest.php new file mode 100644 index 00000000..4dbc6949 --- /dev/null +++ b/tests/FunctionalTests/active-controls/protected/pages/ActiveRatingListSelectedIndexTest.php @@ -0,0 +1,32 @@ + + * @version Creation Date: Oct 13, 2008 + */ + +/** + * TRatingListTest.php class + * + * + * + * Properties + * - + * + * @author Bradley Booms + * @version Modified Date: Oct 13, 2008 + * + * Modifications: + */ +class ActiveRatingListSelectedIndexTest extends TPage{ + public function ratingChanged($sender, $param){ + $this->Status->setText('SelectedIndex: '.$sender->getSelectedIndex()); + } + + public function setSelectedIndex($sender, $param){ + $this->RatingList->setSelectedIndex(5); + $this->ratingChanged($this->RatingList, null); + } +} +?> \ No newline at end of file diff --git a/tests/FunctionalTests/active-controls/protected/pages/RatingList.page b/tests/FunctionalTests/active-controls/protected/pages/RatingList.page index f9be4aee..ba9c2e5d 100644 --- a/tests/FunctionalTests/active-controls/protected/pages/RatingList.page +++ b/tests/FunctionalTests/active-controls/protected/pages/RatingList.page @@ -3,22 +3,11 @@ diff --git a/tests/FunctionalTests/active-controlstests/ActiveRatingListTestCase.php b/tests/FunctionalTests/active-controlstests/ActiveRatingListTestCase.php new file mode 100644 index 00000000..c6dc50c2 --- /dev/null +++ b/tests/FunctionalTests/active-controlstests/ActiveRatingListTestCase.php @@ -0,0 +1,253 @@ + + * @version Creation Date: Oct 22, 2008 + */ + +/** + * ActiveRatingListTestCase.php class + * + * + * + * Properties + * - + * + * @author Bradley Booms + * @version Modified Date: Oct 22, 2008 + * + * Modifications: + */ +class ActiveRatingListTestCase extends SeleniumTestCase +{ + function testCheckBoxes() + { + // Verify we're on the right page. + $this->open("active-controls/index.php?page=ActiveRatingListCheckBoxesTest"); + $this->verifyTextPresent("TActiveRatingList Check Boxes Test Case"); + $this->assertCheckBoxes("RatingList", array(2), 6); + + // Change the list and make sure the radio buttons get updated properly. + $this->clickTD("RatingList_c4"); + $this->pause(800); + $this->assertCheckBoxes("RatingList", array(4), 6); + + $this->clickTD("RatingList_c2"); + $this->pause(800); + $this->assertCheckBoxes("RatingList", array(2), 6); + } + + function testRating() + { + // Verify we're on the right page. + $this->open("active-controls/index.php?page=ActiveRatingListRatingTest"); + $this->verifyTextPresent("TActiveRatingList Rating Test Case"); + + // Check the list, make sure it starts out with 5 stars. + $this->assertText("Status", "Rating: 5"); + + // Click on 1 star and make sure the Rating property updates. + $this->clickTD("RatingList_c0"); + $this->pause(800); + $this->assertText("Status", "Rating: 1"); + + // Then set Rating to three on the server side and make sure it's correct. + $this->click("SetRating"); + $this->pause(800); + $this->assertText("Status", "Rating: 3"); + } + + function testSelectedIndex() + { + // Verify we're on the right page. + $this->open("active-controls/index.php?page=ActiveRatingListSelectedIndexTest"); + $this->verifyTextPresent("TActiveRatingList SelectedIndex Test Case"); + $this->assertText("Status", " SelectedIndex: 1"); + + // Click on 5 stars and make sure the SelectedIndex property updates. + $this->clickTD("RatingList_c4"); + $this->pause(800); + $this->assertText("Status", " SelectedIndex: 4"); + + // Then set SelectedIndex to 5 on the server side and make sure it's correct. + $this->click("SetSelectedIndex"); + $this->pause(800); + $this->assertText("Status", " SelectedIndex: 5"); + } + + function testAutoPostBack() + { + // Verify we're on the right page. + $this->open("active-controls/index.php?page=ActiveRatingListAutoPostBackTest"); + $this->verifyTextPresent("TActiveRatingList AutoPostBack Test Case"); + $this->assertText("Status", "AutoPostback=false"); + + // Make sure that it doesn't auto post when clicked. + $this->clickTD("RatingList_c3"); + $this->pause(800); + $this->assertText("Status", "AutoPostback=false"); + + // Then submit with an active button and make sure it updates. + $this->click("Submit"); + $this->pause(800); + $this->assertText("Status", "4 : Good"); + } + + function testAllowInput() + { + // Verify we're on the right page. + $this->open("active-controls/index.php?page=ActiveRatingListAllowInputTest"); + $this->verifyTextPresent("TActiveRatingList AllowInput Test Case"); + $this->assertText("Status", "AllowInput=false"); + $this->assertCheckBoxes("RatingList", array(3), 6); + + // Make sure that clicking doesn't change anything. + $this->clickTD("RatingList_c5"); + $this->pause(800); + $this->assertText("Status", "AllowInput=false"); + $this->assertCheckBoxes("RatingList", array(3), 6); + } + + function testReadOnly() + { + // Verify we're on the right page. + $this->open("active-controls/index.php?page=ActiveRatingListReadOnlyTest"); + $this->verifyTextPresent("TActiveRatingList ReadOnly Test Case"); + $this->assertText("Status", "ReadOnly=true"); + $this->assertCheckBoxes("RatingList", array(0), 6); + + $this->clickTD("RatingList_c4"); + $this->pause(800); + $this->assertText("Status", "ReadOnly=true"); + $this->assertCheckBoxes("RatingList", array(0), 6); + + // Then set ReadOnly to false, and make sure it works. + $this->click("Writable"); + $this->pause(800); + $this->assertText("Status", "ReadOnly=false"); + $this->assertCheckBoxes("RatingList", array(0), 6); + + + $this->clickTD("RatingList_c1"); + $this->pause(800); + $this->assertText("Status", "2 : Fair"); + $this->assertCheckBoxes("RatingList", array(1), 6); + + // Then set ReadOnly to true, and make sure it doesn't work anymore. + $this->click("ReadOnly"); + $this->pause(800); + $this->assertText("Status", "ReadOnly=true"); + $this->assertCheckBoxes("RatingList", array(1), 6); + + + $this->clickTD("RatingList_c2"); + $this->pause(800); + $this->assertText("Status", "ReadOnly=true"); + $this->assertCheckBoxes("RatingList", array(1), 6); + } + + function testEnabled() + { + // Verify we're on the right page. + $this->open("active-controls/index.php?page=ActiveRatingListEnabledTest"); + $this->verifyTextPresent("TActiveRatingList Enabled Test Case"); + $this->assertText("Status", "Enabled=false"); + $this->assertCheckBoxes("RatingList", array(5), 6); + + $this->clickTD("RatingList_c4"); + $this->pause(800); + $this->assertText("Status", "Enabled=false"); + $this->assertCheckBoxes("RatingList", array(5), 6); + + // Then set Enable to true, and make sure it works. + $this->click("Enable"); + $this->pause(800); + $this->assertText("Status", "Enabled=true"); + $this->assertCheckBoxes("RatingList", array(5), 6); + + + $this->clickTD("RatingList_c3"); + $this->pause(800); + $this->assertText("Status", "4 : Good"); + $this->assertCheckBoxes("RatingList", array(3), 6); + + // Then set Enable to false, and make sure it doesn't work anymore. + $this->click("Disable"); + $this->pause(800); + $this->assertText("Status", "Enabled=false"); + $this->assertCheckBoxes("RatingList", array(3), 6); + + + $this->clickTD("RatingList_c5"); + $this->pause(800); + $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->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->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->mouseOver("//input[@id='RatingList_c1']/../../"); + $this->assertText("Status", "Fair"); + + $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')]"); + } + + function clickTD($clientID){ + $this->click("//input[@id='{$clientID}']/../.."); + } + + function assertCheckBoxes($clientID, $checks, $total = 5) + { + for($i = 0; $i < $total; $i++) + { + if(in_array($i, $checks)) + $this->assertChecked("{$clientID}_c{$i}"); + else + $this->assertNotChecked("{$clientID}_c{$i}"); + } + } +} +?> \ No newline at end of file -- cgit v1.2.3