From a2a030c3cfbb0249762fffa4159107bc13f8952d Mon Sep 17 00:00:00 2001 From: wei <> Date: Thu, 2 Feb 2006 05:04:50 +0000 Subject: Fixed #19 --- .../protected/pages/I18N/BasicI18N.page | 2 +- tests/FunctionalTests/protected/pages/Layout.tpl | 5 +-- .../protected/pages/UI/DatePicker.page | 2 -- .../pages/UI/TestTPanelDefaultButton.page | 13 ++++---- .../protected/pages/UI/TestTPanelDefaultButton.php | 15 +++++++-- .../protected/pages/UI/testLabeledTextBox.page | 2 -- .../protected/pages/UI/testOnClickAttribute.page | 7 +++++ .../protected/pages/UI/testOnClickAttribute.php | 36 ++++++++++++++++++++++ .../protected/pages/Validation/CheckBox.page | 4 --- .../pages/Validation/RequiredFieldValidator.page | 3 -- .../pages/Validation/testInitialValueRequired.page | 11 +++++++ .../pages/Validation/testInitialValueRequired.php | 25 +++++++++++++++ 12 files changed, 102 insertions(+), 23 deletions(-) create mode 100644 tests/FunctionalTests/protected/pages/UI/testOnClickAttribute.page create mode 100644 tests/FunctionalTests/protected/pages/UI/testOnClickAttribute.php create mode 100644 tests/FunctionalTests/protected/pages/Validation/testInitialValueRequired.page create mode 100644 tests/FunctionalTests/protected/pages/Validation/testInitialValueRequired.php (limited to 'tests/FunctionalTests/protected/pages') diff --git a/tests/FunctionalTests/protected/pages/I18N/BasicI18N.page b/tests/FunctionalTests/protected/pages/I18N/BasicI18N.page index 24cb9831..e13eecf2 100644 --- a/tests/FunctionalTests/protected/pages/I18N/BasicI18N.page +++ b/tests/FunctionalTests/protected/pages/I18N/BasicI18N.page @@ -1,4 +1,4 @@ -<%@ Title="Basic I18N Test" Culture="zh_CN" %> +<%@ Title="Basic I18N Test" Application.Globalization.Culture="zh_CN" %>

Basic I18N Test

diff --git a/tests/FunctionalTests/protected/pages/Layout.tpl b/tests/FunctionalTests/protected/pages/Layout.tpl index 8fd64429..d58acd5d 100644 --- a/tests/FunctionalTests/protected/pages/Layout.tpl +++ b/tests/FunctionalTests/protected/pages/Layout.tpl @@ -20,9 +20,10 @@ - + - + +
Validate XHTML 1.0 diff --git a/tests/FunctionalTests/protected/pages/UI/DatePicker.page b/tests/FunctionalTests/protected/pages/UI/DatePicker.page index c6204408..5c826a85 100644 --- a/tests/FunctionalTests/protected/pages/UI/DatePicker.page +++ b/tests/FunctionalTests/protected/pages/UI/DatePicker.page @@ -1,5 +1,4 @@ -
@@ -43,5 +42,4 @@ d
asd
a
sd
-
\ No newline at end of file diff --git a/tests/FunctionalTests/protected/pages/UI/TestTPanelDefaultButton.page b/tests/FunctionalTests/protected/pages/UI/TestTPanelDefaultButton.page index 753550d8..68b5445e 100644 --- a/tests/FunctionalTests/protected/pages/UI/TestTPanelDefaultButton.page +++ b/tests/FunctionalTests/protected/pages/UI/TestTPanelDefaultButton.page @@ -1,17 +1,16 @@ +<%@ Title="Test DefaultButton On Panel" %> - +

Test DefaultButton On Panel

This is panel content with a and two buttons:
- - - + + +
When you change focus to the panel and hit 'enter' key, button2 will be clicked because it is set as the default button of the panel.
- - -
+
\ No newline at end of file diff --git a/tests/FunctionalTests/protected/pages/UI/TestTPanelDefaultButton.php b/tests/FunctionalTests/protected/pages/UI/TestTPanelDefaultButton.php index 2b0ba466..49418efd 100644 --- a/tests/FunctionalTests/protected/pages/UI/TestTPanelDefaultButton.php +++ b/tests/FunctionalTests/protected/pages/UI/TestTPanelDefaultButton.php @@ -26,8 +26,19 @@ class DefaultButtonTest extends SeleniumTestCase function testClick() { - $this->clickAndWait("ctl0_Content_Button2"); - $this->assertTextPresent("You have clicked on 'button2'."); + $this->verifyTitle("Test DefaultButton On Panel", ""); + $this->assertTextNotPresent("You have clicked on", ""); + $this->clickAndWait("link=button 3", ""); + $this->verifyTextPresent("You have clicked on 'button 3'.", ""); + $this->clickAndWait("//input[@type='submit' and @value='button1']", ""); + $this->verifyTextPresent("You have clicked on 'button1'. ", ""); + $this->clickAndWait("//input[@type='submit' and @value='button2']", ""); + $this->verifyTextPresent("You have clicked on 'button2'. ", ""); + $this->clickAndWait("link=button 3", ""); + $this->verifyTextPresent("You have clicked on 'button 3'. ", ""); + $this->click("ctl0_Content_check1", ""); + $this->clickAndWait("//input[@type='submit' and @value='button2']", ""); + $this->verifyTextPresent("You have clicked on 'button2'. ", ""); } } ?> \ No newline at end of file diff --git a/tests/FunctionalTests/protected/pages/UI/testLabeledTextBox.page b/tests/FunctionalTests/protected/pages/UI/testLabeledTextBox.page index f1e46544..248e0cc5 100644 --- a/tests/FunctionalTests/protected/pages/UI/testLabeledTextBox.page +++ b/tests/FunctionalTests/protected/pages/UI/testLabeledTextBox.page @@ -1,6 +1,4 @@ - - \ No newline at end of file diff --git a/tests/FunctionalTests/protected/pages/UI/testOnClickAttribute.page b/tests/FunctionalTests/protected/pages/UI/testOnClickAttribute.page new file mode 100644 index 00000000..31381c40 --- /dev/null +++ b/tests/FunctionalTests/protected/pages/UI/testOnClickAttribute.page @@ -0,0 +1,7 @@ +<%@ Title="Test Attributes.OnClick" %> + +

Test Attributes.OnClick

+ + +
\ No newline at end of file diff --git a/tests/FunctionalTests/protected/pages/UI/testOnClickAttribute.php b/tests/FunctionalTests/protected/pages/UI/testOnClickAttribute.php new file mode 100644 index 00000000..3d9fc840 --- /dev/null +++ b/tests/FunctionalTests/protected/pages/UI/testOnClickAttribute.php @@ -0,0 +1,36 @@ + + * @version $Revision: $ $Date: $ + * @package System.Web.UI.WebControls + * @since 3.0 + */ +class testOnClickAttribute extends TPage +{ + function doClick() + { + $this->clickState->setText("Post Back clicked!"); + } +} + +class OnClickAttributeTestCase extends SeleniumTestCase +{ + function test() + { + $page = Prado::getApplication()->getTestPage(__FILE__); + $this->open($page); + $this->assertTitle("Test Attributes.OnClick"); + $this->click("link=Click me"); + $this->assertConfirmation("Are you sure?"); + $this->chooseCancelOnNextConfirmation(); + $this->assertTextNotPresent("Post Back clicked!"); + $this->clickAndWait("link=Click me"); + $this->assertConfirmation("Are you sure?"); + $this->assertTextPresent("Post Back clicked!"); + } +} + +?> \ No newline at end of file diff --git a/tests/FunctionalTests/protected/pages/Validation/CheckBox.page b/tests/FunctionalTests/protected/pages/Validation/CheckBox.page index 109710fb..0653a0c2 100644 --- a/tests/FunctionalTests/protected/pages/Validation/CheckBox.page +++ b/tests/FunctionalTests/protected/pages/Validation/CheckBox.page @@ -1,6 +1,5 @@ <%@ Title="An AutoPostBack CheckBox" %> -

An AutoPostBack CheckBox

@@ -33,7 +32,4 @@ Input: ID="validator1" />
- - -
\ No newline at end of file diff --git a/tests/FunctionalTests/protected/pages/Validation/RequiredFieldValidator.page b/tests/FunctionalTests/protected/pages/Validation/RequiredFieldValidator.page index e6b67c8d..5447b834 100644 --- a/tests/FunctionalTests/protected/pages/Validation/RequiredFieldValidator.page +++ b/tests/FunctionalTests/protected/pages/Validation/RequiredFieldValidator.page @@ -1,6 +1,5 @@ <%@ Title="Basic TRequiredFieldValidator" %> -

Basic TRequiredFieldValidator Test1

- -
\ No newline at end of file diff --git a/tests/FunctionalTests/protected/pages/Validation/testInitialValueRequired.page b/tests/FunctionalTests/protected/pages/Validation/testInitialValueRequired.page new file mode 100644 index 00000000..62cf761c --- /dev/null +++ b/tests/FunctionalTests/protected/pages/Validation/testInitialValueRequired.page @@ -0,0 +1,11 @@ +<%@ Title="InitialValue Validation Test" %> + +

InitialValue Validation Test

+ + + + +
\ No newline at end of file diff --git a/tests/FunctionalTests/protected/pages/Validation/testInitialValueRequired.php b/tests/FunctionalTests/protected/pages/Validation/testInitialValueRequired.php new file mode 100644 index 00000000..cc35accc --- /dev/null +++ b/tests/FunctionalTests/protected/pages/Validation/testInitialValueRequired.php @@ -0,0 +1,25 @@ +getTestPage(__FILE__); + $this->open($page); + $this->assertTitle("InitialValue Validation Test"); + $this->assertNotVisible("ctl0_Content_validator1"); + $this->type("ctl0_Content_text1", "hello"); + $this->clickAndWait("ctl0_Content_submit"); + $this->assertNotVisible("ctl0_Content_validator1"); + $this->type("ctl0_Content_text1", "test"); + $this->click("ctl0_Content_submit"); + $this->assertVisible("ctl0_Content_validator1"); + } +} + +?> \ No newline at end of file -- cgit v1.2.3