From 85a8e37118107312b971aba4065be4e850441866 Mon Sep 17 00:00:00 2001 From: xue <> Date: Tue, 24 Jan 2006 05:13:51 +0000 Subject: Added TRadioButton demo and FT. --- .../quickstart_tests/Controls/CheckBoxTestCase.php | 6 +-- .../Controls/HyperLinkTestCase.php | 3 +- .../Controls/RadioButtonTestCase.php | 58 ++++++++++++++++++++++ 3 files changed, 62 insertions(+), 5 deletions(-) create mode 100644 tests/FunctionalTests/quickstart_tests/Controls/RadioButtonTestCase.php (limited to 'tests') diff --git a/tests/FunctionalTests/quickstart_tests/Controls/CheckBoxTestCase.php b/tests/FunctionalTests/quickstart_tests/Controls/CheckBoxTestCase.php index 80158343..b68f22d3 100644 --- a/tests/FunctionalTests/quickstart_tests/Controls/CheckBoxTestCase.php +++ b/tests/FunctionalTests/quickstart_tests/Controls/CheckBoxTestCase.php @@ -38,16 +38,16 @@ class CheckBoxTestCase extends SeleniumTestCase $this->click("//input[@type='submit' and @value='Submit']", ""); $this->pause(1000); $this->verifyVisible('ctl0_body_ctl6'); - $this->click("//input[@name='ctl0\$body\$CheckBox' and @value='CheckBox']", ""); + $this->click("//input[@name='ctl0\$body\$CheckBox' and @value='ctl0\$body\$CheckBox']", ""); $this->clickAndWait("//input[@type='submit' and @value='Submit']", ""); $this->verifyNotVisible('ctl0_body_ctl6'); // a checkbox validated by a required field validator using AutoPostBack $this->verifyNotVisible('ctl0_body_ctl7'); - $this->click("//input[@name='ctl0\$body\$CheckBox2' and @value='CheckBox2']", ""); + $this->click("//input[@name='ctl0\$body\$CheckBox2' and @value='ctl0\$body\$CheckBox2']", ""); $this->pause(1000); $this->verifyVisible('ctl0_body_ctl7'); - $this->clickAndWait("//input[@name='ctl0\$body\$CheckBox2' and @value='CheckBox2']", ""); + $this->clickAndWait("//input[@name='ctl0\$body\$CheckBox2' and @value='ctl0\$body\$CheckBox2']", ""); $this->verifyNotVisible('ctl0_body_ctl7'); } } diff --git a/tests/FunctionalTests/quickstart_tests/Controls/HyperLinkTestCase.php b/tests/FunctionalTests/quickstart_tests/Controls/HyperLinkTestCase.php index 7fb22b04..5ef103f0 100644 --- a/tests/FunctionalTests/quickstart_tests/Controls/HyperLinkTestCase.php +++ b/tests/FunctionalTests/quickstart_tests/Controls/HyperLinkTestCase.php @@ -6,8 +6,7 @@ class HyperLinkTestCase extends SeleniumTestCase { $this->open("../../demos/quickstart/index.php?page=Controls.Samples.THyperLink.Home&functionaltest=true", ""); $this->verifyTitle("PRADO QuickStart Sample", ""); - //$this->verifyAttribute("//a[@href=\"http://www.pradosoft.com/\"]/@target","_blank"); - $this->verifyHTMLPresent('PradoSoft.com'); + $this->verifyElementPresent("//a[@href=\"http://www.pradosoft.com/\" and @target=\"_blank\"]"); $this->verifyTextPresent("Welcome to", ""); $this->verifyTextPresent("Body contents", ""); $this->verifyElementPresent("//a[img/@alt='Hello World']"); diff --git a/tests/FunctionalTests/quickstart_tests/Controls/RadioButtonTestCase.php b/tests/FunctionalTests/quickstart_tests/Controls/RadioButtonTestCase.php new file mode 100644 index 00000000..24b5f6c9 --- /dev/null +++ b/tests/FunctionalTests/quickstart_tests/Controls/RadioButtonTestCase.php @@ -0,0 +1,58 @@ +open("../../demos/quickstart/index.php?page=Controls.Samples.TRadioButton.Home&functionaltest=true", ""); + + $this->verifyTitle("PRADO QuickStart Sample", ""); + + // a regular radiobutton + $this->click("//input[@name='ctl0\$body\$ctl0' and @value='ctl0\$body\$ctl0']", ""); + + // a radiobutton with customized value + $this->click("//input[@name='ctl0\$body\$ctl1' and @value='value']", ""); + + // an auto postback radiobutton + $this->verifyTextNotPresent("I'm clicked"); + $this->clickAndWait("//input[@name='ctl0\$body\$ctl2' and @value='ctl0\$body\$ctl2']", ""); + $this->verifyTextPresent("I'm clicked"); + $this->clickAndWait("//input[@name='ctl0\$body\$ctl2' and @value='ctl0\$body\$ctl2']", ""); + $this->verifyTextPresent("I'm clicked"); + + // a radiobutton causing validation on a textbox + $this->verifyNotVisible('ctl0_body_ctl3'); + $this->click("//input[@name='ctl0\$body\$ctl4' and @value='ctl0\$body\$ctl4']", ""); + $this->pause(1000); + $this->verifyVisible('ctl0_body_ctl3'); + $this->click("//input[@name='ctl0\$body\$ctl4' and @value='ctl0\$body\$ctl4']", ""); + $this->pause(1000); + $this->verifyVisible('ctl0_body_ctl3'); + $this->type("ctl0\$body\$TextBox", "test"); + $this->clickAndWait("//input[@name='ctl0\$body\$ctl4' and @value='ctl0\$body\$ctl4']", ""); + $this->verifyNotVisible('ctl0_body_ctl3'); + + // a radiobutton validated by a required field validator + $this->verifyNotVisible('ctl0_body_ctl6'); + $this->click("//input[@type='submit' and @value='Submit']", ""); + $this->pause(1000); + $this->verifyVisible('ctl0_body_ctl6'); + $this->click("//input[@name='ctl0\$body\$RadioButton' and @value='ctl0\$body\$RadioButton']", ""); + $this->clickAndWait("//input[@type='submit' and @value='Submit']", ""); + $this->verifyNotVisible('ctl0_body_ctl6'); + + // a radiobutton group + $this->clickAndWait("name=ctl0\$body\$ctl7", ""); + $this->verifyTextPresent("Your selection is empty"); + $this->click("//input[@name='ctl0\$body\$RadioGroup' and @value='ctl0\$body\$Radio2']", ""); + $this->clickAndWait("name=ctl0\$body\$ctl7", ""); + $this->verifyTextPresent("Your selection is 2"); + $this->click("//input[@name='ctl0\$body\$RadioGroup' and @value='ctl0\$body\$Radio3']", ""); + $this->click("//input[@name='ctl0\$body\$Radio4' and @value='ctl0\$body\$Radio4']", ""); + $this->clickAndWait("name=ctl0\$body\$ctl7", ""); + $this->verifyTextPresent("Your selection is 34"); + } +} + +?> \ No newline at end of file -- cgit v1.2.3