summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorwei <>2006-09-16 01:09:33 +0000
committerwei <>2006-09-16 01:09:33 +0000
commit6bc7f2812ec16d5b46e2b75b1ae5172f7f778bcf (patch)
tree21bd449d8ce1bb01c2a57999316d0aa82a0ab805
parentb196ea0e2e9ab9078022e88326edecf1ba5b2f9f (diff)
Test for ticket #364
-rw-r--r--.gitattributes3
-rw-r--r--tests/FunctionalTests/active-controls/protected/pages/PostLoadingTest.page24
-rw-r--r--tests/FunctionalTests/active-controls/protected/pages/PostLoadingTest.php44
-rw-r--r--tests/FunctionalTests/active-controls/tests/PostLoadingTestCase.php22
4 files changed, 93 insertions, 0 deletions
diff --git a/.gitattributes b/.gitattributes
index c9758170..24aa6eb6 100644
--- a/.gitattributes
+++ b/.gitattributes
@@ -1910,6 +1910,8 @@ tests/FunctionalTests/active-controls/protected/pages/CustomTemplateControlTest.
tests/FunctionalTests/active-controls/protected/pages/CustomTemplateControlTest.php -text
tests/FunctionalTests/active-controls/protected/pages/EventTriggeredCallback.page -text
tests/FunctionalTests/active-controls/protected/pages/EventTriggeredCallback.php -text
+tests/FunctionalTests/active-controls/protected/pages/PostLoadingTest.page -text
+tests/FunctionalTests/active-controls/protected/pages/PostLoadingTest.php -text
tests/FunctionalTests/active-controls/protected/pages/ReplaceContentTest.page -text
tests/FunctionalTests/active-controls/protected/pages/ReplaceContentTest.php -text
tests/FunctionalTests/active-controls/protected/pages/TInPlaceTextBoxTest.page -text
@@ -1931,6 +1933,7 @@ tests/FunctionalTests/active-controls/tests/ActiveRadioButtonListTestCase.php -t
tests/FunctionalTests/active-controls/tests/ActiveRadioButtonTestCase.php -text
tests/FunctionalTests/active-controls/tests/CustomTemplateTestCase.php -text
tests/FunctionalTests/active-controls/tests/EventTriggerTestCase.php -text
+tests/FunctionalTests/active-controls/tests/PostLoadingTestCase.php -text
tests/FunctionalTests/active-controls/tests/ReplaceContentTestCase.php -text
tests/FunctionalTests/active-controls/tests/TextBoxGroupValidationTestCase.php -text
tests/FunctionalTests/active-controls/tests/ValueTriggerCallbackTestCase.php -text
diff --git a/tests/FunctionalTests/active-controls/protected/pages/PostLoadingTest.page b/tests/FunctionalTests/active-controls/protected/pages/PostLoadingTest.page
new file mode 100644
index 00000000..6dd58d48
--- /dev/null
+++ b/tests/FunctionalTests/active-controls/protected/pages/PostLoadingTest.page
@@ -0,0 +1,24 @@
+<com:TForm>
+
+ <h1>PostLoading Test</h1>
+ <com:TCallback ID="callback1" OnCallback="Page.callback1_requested" />
+
+ <com:TActivePanel ID="panel1" />
+
+ <div id="div1" style="border:1px solid #666; background-color: #ffe; text-align: center; padding:3em">
+ Click Me!
+ </div>
+
+ <script type="text/javascript">
+ Event.OnLoad(function()
+ {
+ Event.observe($("div1"), "click", function()
+ {
+ Prado.Callback("<%= $this->callback1->UniqueID %>")
+ })
+ })
+ </script>
+
+ <com:TJavascriptLogger />
+
+</com:TForm> \ No newline at end of file
diff --git a/tests/FunctionalTests/active-controls/protected/pages/PostLoadingTest.php b/tests/FunctionalTests/active-controls/protected/pages/PostLoadingTest.php
new file mode 100644
index 00000000..a8c409e7
--- /dev/null
+++ b/tests/FunctionalTests/active-controls/protected/pages/PostLoadingTest.php
@@ -0,0 +1,44 @@
+<?php
+
+class PostLoadingTest extends TPage
+{
+ public function onInit($param)
+ {
+ parent::onInit($param);
+
+ // Text Box
+ $textBox=new TTextBox();
+ $textBox->setVisible(false);
+ $textBox->setID("MyTextBox");
+ $this->panel1->getControls()->add($textBox);
+ $this->registerObject("MyTextBox", $textBox);
+
+
+ // Submit button
+ $button=new TActiveButton();
+ $button->setVisible(false);
+ $button->setID("MyButton");
+ $button->setText("Submit");
+ $button->attachEventHandler("OnCallback", array($this, "clickedButton"));
+ $this->panel1->getControls()->add($button);
+ $this->registerObject("MyButton", $button);
+
+ }
+
+
+ function callback1_requested($sender, $param)
+ {
+ $this->MyTextBox->visible = true;
+ $this->MyButton->ActiveControl->EnableUpdate=false;
+ $this->MyButton->visible = true;
+ $this->panel1->render($param->NewWriter);
+ }
+
+ function clickedButton($sender, $param)
+ {
+ $this->panel1->getControls()->add('Result is '.$this->MyTextBox->getText());
+ $this->panel1->render($param->NewWriter);
+ }
+}
+
+?> \ No newline at end of file
diff --git a/tests/FunctionalTests/active-controls/tests/PostLoadingTestCase.php b/tests/FunctionalTests/active-controls/tests/PostLoadingTestCase.php
new file mode 100644
index 00000000..3b4d0ce9
--- /dev/null
+++ b/tests/FunctionalTests/active-controls/tests/PostLoadingTestCase.php
@@ -0,0 +1,22 @@
+<?php
+
+class PostLoadingTestCase extends SeleniumTestCase
+{
+ function test()
+ {
+ $this->open('active-controls/index.php?page=PostLoadingTest');
+ $this->assertTextPresent('PostLoading Test');
+
+ $this->assertTextNotPresent('Hello World');
+
+ $this->click('div1');
+ $this->pause(800);
+ $this->type('MyTextBox', 'Hello World');
+ $this->click('MyButton');
+
+ $this->pause(800);
+ $this->assertTextPresent('Result is Hello World');
+ }
+}
+
+?> \ No newline at end of file