From dd0db4914c29c747be17975457b241fc93e8ee0b Mon Sep 17 00:00:00 2001 From: xue <> Date: Thu, 26 Jan 2006 05:56:58 +0000 Subject: Added TCheckBoxList and TRadioButtonList FT. --- .gitattributes | 2 + .../Controls/CheckBoxListTestCase.php | 54 ++++++++++++++++++++++ .../Controls/RadioButtonListTestCase.php | 54 ++++++++++++++++++++++ 3 files changed, 110 insertions(+) create mode 100644 tests/FunctionalTests/quickstart_tests/Controls/CheckBoxListTestCase.php create mode 100644 tests/FunctionalTests/quickstart_tests/Controls/RadioButtonListTestCase.php diff --git a/.gitattributes b/.gitattributes index 2a51d82e..645acbff 100644 --- a/.gitattributes +++ b/.gitattributes @@ -646,6 +646,7 @@ tests/FunctionalTests/protected/pages/ViewSource.page -text tests/FunctionalTests/protected/pages/ViewSource.php -text tests/FunctionalTests/protected/pages/config.xml -text tests/FunctionalTests/quickstart_tests/Controls/ButtonTestCase.php -text +tests/FunctionalTests/quickstart_tests/Controls/CheckBoxListTestCase.php -text tests/FunctionalTests/quickstart_tests/Controls/CheckBoxTestCase.php -text tests/FunctionalTests/quickstart_tests/Controls/DropDownListTestCase.php -text tests/FunctionalTests/quickstart_tests/Controls/HyperLinkTestCase.php -text @@ -655,6 +656,7 @@ tests/FunctionalTests/quickstart_tests/Controls/LabelTestCase.php -text tests/FunctionalTests/quickstart_tests/Controls/LinkButtonTestCase.php -text tests/FunctionalTests/quickstart_tests/Controls/ListBoxTestCase.php -text tests/FunctionalTests/quickstart_tests/Controls/PanelTestCase.php -text +tests/FunctionalTests/quickstart_tests/Controls/RadioButtonListTestCase.php -text tests/FunctionalTests/quickstart_tests/Controls/RadioButtonTestCase.php -text tests/FunctionalTests/quickstart_tests/Controls/TableTestCase.php -text tests/FunctionalTests/quickstart_tests/Controls/TextBoxTestCase.php -text diff --git a/tests/FunctionalTests/quickstart_tests/Controls/CheckBoxListTestCase.php b/tests/FunctionalTests/quickstart_tests/Controls/CheckBoxListTestCase.php new file mode 100644 index 00000000..4ac07ee2 --- /dev/null +++ b/tests/FunctionalTests/quickstart_tests/Controls/CheckBoxListTestCase.php @@ -0,0 +1,54 @@ +open("../../demos/quickstart/index.php?page=Controls.Samples.TCheckBoxList.Home&functionaltest=true", ""); + + // Check box list with default settings: + $this->click("//input[@name='ctl0\$body\$ctl0\$0' and @value='value 1']", ""); + + // Check box list with customized cellpadding, cellspacing, color and text alignment: + $this->click("//input[@name='ctl0\$body\$ctl1\$1' and @value='value 2']", ""); + + // *** Currently unable to test the following cases: + // Check box list with vertical (default) repeat direction + // Check box list with horizontal repeat direction + // Check box list with flow layout and vertical (default) repeat direction + // Check box list with flow layout and horizontal repeat direction: + + // Check box list's behavior upon postback + $this->click("//input[@name='ctl0\$body\$CheckBoxList\$2' and @value='value 3']", ""); + $this->clickAndWait("//input[@type='submit' and @value='Submit']", ""); + $this->verifyTextPresent("Your selection is: (Index: 1, Value: value 2, Text: item 2)(Index: 2, Value: value 3, Text: item 3)(Index: 4, Value: value 5, Text: item 5)", ""); + + // Auto postback check box list + $this->clickAndWait("//input[@name='ctl0\$body\$ctl7\$1' and @value='value 2']", ""); + $this->verifyTextPresent("Your selection is: (Index: 4, Value: value 5, Text: item 5)", ""); + + // Databind to an integer-indexed array + $this->clickAndWait("//input[@name='ctl0\$body\$DBCheckBoxList1\$1' and @value='item 2']", ""); + $this->verifyTextPresent("Your selection is: (Index: 1, Value: item 2, Text: item 2)", ""); + + // Databind to an associative array: + $this->clickAndWait("//input[@name='ctl0\$body\$DBCheckBoxList2\$1' and @value='key 2']", ""); + $this->verifyTextPresent("Your selection is: (Index: 1, Value: key 2, Text: item 2)", ""); + + // Databind with DataTextField and DataValueField specified + $this->clickAndWait("//input[@name='ctl0\$body\$DBCheckBoxList3\$2' and @value='003']", ""); + $this->verifyTextPresent("Your selection is: (Index: 2, Value: 003, Text: Cary)", ""); + + // CheckBox list causing validation + $this->verifyNotVisible('ctl0_body_ctl8'); + $this->click("//input[@name='ctl0\$body\$ctl9$0' and @value='Agree']", ""); + $this->pause(1000); + $this->verifyVisible('ctl0_body_ctl8'); + $this->type("ctl0\$body\$TextBox", "test"); + $this->clickAndWait("//input[@name='ctl0\$body\$ctl9$0' and @value='Agree']", ""); + $this->verifyNotVisible('ctl0_body_ctl8'); + } +} + +?> \ No newline at end of file diff --git a/tests/FunctionalTests/quickstart_tests/Controls/RadioButtonListTestCase.php b/tests/FunctionalTests/quickstart_tests/Controls/RadioButtonListTestCase.php new file mode 100644 index 00000000..b7156932 --- /dev/null +++ b/tests/FunctionalTests/quickstart_tests/Controls/RadioButtonListTestCase.php @@ -0,0 +1,54 @@ +open("../../demos/quickstart/index.php?page=Controls.Samples.TRadioButtonList.Home&functionaltest=true", ""); + + // RadioButton list with default settings: + $this->click("//input[@name='ctl0\$body\$ctl0' and @value='value 3']", ""); + + // RadioButton list with customized cellpadding, cellspacing, color and text alignment: + $this->click("//input[@name='ctl0\$body\$ctl1' and @value='value 1']", ""); + + // *** Currently unable to test the following cases: + // RadioButton list with vertical (default) repeat direction + // RadioButton list with horizontal repeat direction + // RadioButton list with flow layout and vertical (default) repeat direction + // RadioButton list with flow layout and horizontal repeat direction: + + // RadioButton list's behavior upon postback + $this->click("//input[@name='ctl0\$body\$RadioButtonList' and @value='value 3']", ""); + $this->clickAndWait("//input[@type='submit' and @value='Submit']", ""); + $this->verifyTextPresent("Your selection is: (Index: 2, Value: value 3, Text: item 3)", ""); + + // Auto postback check box list + $this->clickAndWait("//input[@name='ctl0\$body\$ctl7' and @value='value 5']", ""); + $this->verifyTextPresent("Your selection is: (Index: 4, Value: value 5, Text: item 5)", ""); + + // Databind to an integer-indexed array + $this->clickAndWait("//input[@name='ctl0\$body\$DBRadioButtonList1' and @value='item 1']", ""); + $this->verifyTextPresent("Your selection is: (Index: 0, Value: item 1, Text: item 1)", ""); + + // Databind to an associative array: + $this->clickAndWait("//input[@name='ctl0\$body\$DBRadioButtonList2' and @value='key 2']", ""); + $this->verifyTextPresent("Your selection is: (Index: 1, Value: key 2, Text: item 2)", ""); + + // Databind with DataTextField and DataValueField specified + $this->clickAndWait("//input[@name='ctl0\$body\$DBRadioButtonList3' and @value='003']", ""); + $this->verifyTextPresent("Your selection is: (Index: 2, Value: 003, Text: Cary)", ""); + + // RadioButton list causing validation + $this->verifyNotVisible('ctl0_body_ctl8'); + $this->click("//input[@name='ctl0\$body\$ctl9' and @value='Agree']", ""); + $this->pause(1000); + $this->verifyVisible('ctl0_body_ctl8'); + $this->type("ctl0\$body\$TextBox", "test"); + $this->clickAndWait("//input[@name='ctl0\$body\$ctl9' and @value='Disagree']", ""); + $this->verifyNotVisible('ctl0_body_ctl8'); + } +} + +?> \ No newline at end of file -- cgit v1.2.3