summaryrefslogtreecommitdiff
path: root/tests/FunctionalTests/protected/pages/UI
diff options
context:
space:
mode:
authorwei <>2006-02-02 05:04:50 +0000
committerwei <>2006-02-02 05:04:50 +0000
commita2a030c3cfbb0249762fffa4159107bc13f8952d (patch)
treee8b2f97068cf92a314df360ccf8dfb1d37b92bd6 /tests/FunctionalTests/protected/pages/UI
parent93f6933c39b2e1896ff781a8f839a3c73a7e56b1 (diff)
Fixed #19
Diffstat (limited to 'tests/FunctionalTests/protected/pages/UI')
-rw-r--r--tests/FunctionalTests/protected/pages/UI/DatePicker.page2
-rw-r--r--tests/FunctionalTests/protected/pages/UI/TestTPanelDefaultButton.page13
-rw-r--r--tests/FunctionalTests/protected/pages/UI/TestTPanelDefaultButton.php15
-rw-r--r--tests/FunctionalTests/protected/pages/UI/testLabeledTextBox.page2
-rw-r--r--tests/FunctionalTests/protected/pages/UI/testOnClickAttribute.page7
-rw-r--r--tests/FunctionalTests/protected/pages/UI/testOnClickAttribute.php36
6 files changed, 62 insertions, 13 deletions
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 @@
<com:TContent ID="Content">
-<com:TForm>
<com:TDatePicker Mode="Button"/>
<br />
<select style="width: 200px; height: 50px"><option value="1">One</option></select>
@@ -43,5 +42,4 @@ d<br/>
asd<br/>
a<br/>
sd<br/>
-</com:TForm>
</com:TContent> \ 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" %>
<com:TContent ID="Content">
-<com:TForm>
+ <h1>Test DefaultButton On Panel</h1>
<com:TPanel DefaultButton="Button2" Width="400px">
This is panel content with a <com:TLabel Text="label" Font.Italic="true" />
and two buttons: <br/>
- <com:TCheckBox />
- <com:TButton ID="Button1" Text="button1" Click="buttonClicked" />
- <com:TButton ID="Button2" Text="button2" Click="buttonClicked" />
+ <com:TCheckBox id="check1"/>
+ <com:TButton ID="Button1" Text="button1" OnClick="buttonClicked" />
+ <com:TButton ID="Button2" Text="button2" OnClick="buttonClicked" />
<com:TLabel ID="Result" ForeColor="red" />
<br/>
When you change focus to the panel and hit 'enter' key, <tt>button2</tt>
will be clicked because it is set as the default button of the panel.
</com:TPanel>
- <com:TLinkButton Text="button 3" Click="buttonClicked" />
- <com:TJavascriptLogger />
-</com:TForm>
+ <com:TLinkButton Text="button 3" OnClick="buttonClicked" />
</com:TContent> \ 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 @@
<com:TContent ID="Content">
-<com:TForm>
<com:LabeledTextBox Label.Text="username:"/>
<com:LabeledTextBox Label.Text="password:"/>
-</com:TForm>
</com:TContent> \ 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" %>
+<com:TContent ID="Content">
+<h1>Test Attributes.OnClick</h1>
+ <com:TLinkButton OnClick="doClick" Text="Click me"
+ Attributes.OnClick="if(!confirm('Are you sure?')) return false;" />
+ <com:TLabel ID="clickState" />
+</com:TContent> \ 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 @@
+<?php
+
+/**
+ * testOnClickAttribute
+ *
+ * @author Wei Zhuo <weizhuo[at]gmail[dot]com>
+ * @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