diff options
author | wei <> | 2006-06-24 05:46:22 +0000 |
---|---|---|
committer | wei <> | 2006-06-24 05:46:22 +0000 |
commit | a6be5564823be40670e0cad8dc758557dbd37549 (patch) | |
tree | 13083fe7ea207b5426c9ee29afc36654e1ed623d /tests/FunctionalTests/active-controls/tests | |
parent | cb8b23aca4c682c58323f432aa38a88c7a695377 (diff) |
Update active controls.
Diffstat (limited to 'tests/FunctionalTests/active-controls/tests')
3 files changed, 116 insertions, 0 deletions
diff --git a/tests/FunctionalTests/active-controls/tests/ActiveCheckBoxListTestCase.php b/tests/FunctionalTests/active-controls/tests/ActiveCheckBoxListTestCase.php new file mode 100644 index 00000000..af7ea1f0 --- /dev/null +++ b/tests/FunctionalTests/active-controls/tests/ActiveCheckBoxListTestCase.php @@ -0,0 +1,57 @@ +<?php + +class ActiveCheckBoxListTestCase extends SeleniumTestCase +{ + function test() + { + $this->open("active-controls/index.php?page=TActiveCheckBoxListTest"); + $this->verifyTextPresent("TActiveCheckBoxList Test Case"); + + $this->assertText("label1", "Label 1"); + + $this->click("button1"); + $this->pause(500); + $this->assertCheckBoxes(array(1,2,3)); + + $this->click("button2"); + $this->pause(500); + $this->assertCheckBoxes(array()); + + + $this->click("button3"); + $this->pause(500); + $this->assertCheckBoxes(array(0)); + + + $this->click("button4"); + $this->pause(500); + $this->assertCheckBoxes(array(4)); + + + $this->click("button5"); + $this->pause(500); + $this->assertCheckBoxes(array(1,4)); + + $this->click("list1_c2"); + $this->pause(500); + $this->assertText("label1", "Selection: value 2, value 3, value 5"); + + $this->click("list1_c2"); + $this->pause(500); + $this->assertText("label1", "Selection: value 2, value 5"); + + } + + function assertCheckBoxes($checks, $total = 5) + { + for($i = 0; $i < $total; $i++) + { + if(in_array($i, $checks)) + $this->assertChecked("list1_c{$i}"); + else + $this->assertNotChecked("list1_c{$i}"); + } + } +} + +?>
\ No newline at end of file diff --git a/tests/FunctionalTests/active-controls/tests/ActiveDropDownListTestCase.php b/tests/FunctionalTests/active-controls/tests/ActiveDropDownListTestCase.php new file mode 100644 index 00000000..5806a3ec --- /dev/null +++ b/tests/FunctionalTests/active-controls/tests/ActiveDropDownListTestCase.php @@ -0,0 +1,41 @@ +<?php + +class ActiveDropDownListTestCase extends SeleniumTestCase +{ + function test() + { + $this->open("active-controls/index.php?page=ActiveDropDownList"); + $this->assertTextPresent('Active Drop Down List Test Case'); + + $this->assertText("label1", "Label 1"); + + $this->click("button1"); + $this->pause(500); + $this->assertSelected("list1", "item 4"); + + $this->click("button2"); + $this->pause(500); + $this->assertEmptySelection("list1"); + + $this->click("button3"); + $this->pause(500); + $this->assertSelected("list1", "item 2"); + + // due to clearing selection and then updating the selection + // otherwise it should not fire the changed event (fired by js because of change to options). + $this->assertText("label1", "Selection 1: value 1"); + + $this->select("list2", "value 1 - item 4"); + $this->pause(500); + $this->assertText("label1", "Selection 2: value 1 - item 4"); + + $this->select("list1", "item 3"); + $this->pause(500); + $this->select("list2", "value 3 - item 5"); + $this->pause(500); + $this->assertText("label1", "Selection 2: value 3 - item 5"); + + } +} + +?>
\ No newline at end of file diff --git a/tests/FunctionalTests/active-controls/tests/ActiveHyperLinkTestCase.php b/tests/FunctionalTests/active-controls/tests/ActiveHyperLinkTestCase.php new file mode 100644 index 00000000..53198806 --- /dev/null +++ b/tests/FunctionalTests/active-controls/tests/ActiveHyperLinkTestCase.php @@ -0,0 +1,18 @@ +<?php + +class ActiveHyperLinkTestCase extends SeleniumTestCase +{ + function test() + { + $this->open("active-controls/index.php?page=ActiveHyperLinkTest"); + $this->assertTextPresent("Active HyperLink Test Case"); + + $this->assertText("link1", "Link 1"); + + $this->click("button1"); + $this->pause(500); + $this->assertText("link1", "Pradosoft.com"); + } +} + +?>
\ No newline at end of file |