summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorwei <>2006-10-21 02:46:12 +0000
committerwei <>2006-10-21 02:46:12 +0000
commit68eb20ae56e35cc48982be6f15c0738a276c3684 (patch)
tree520ce7d2d4f72ae3bd326b586be6f0cc1a38afb6 /tests
parent5d6b7068de8768d56c4731cc7301438b69354d57 (diff)
update ajax callback to be quequed
Diffstat (limited to 'tests')
-rw-r--r--tests/FunctionalTests/active-controls/protected/pages/DelayedCallback.page7
-rw-r--r--tests/FunctionalTests/active-controls/protected/pages/DelayedCallback.php21
-rw-r--r--tests/FunctionalTests/active-controls/protected/pages/Sessioned/PageStateTest.page45
-rw-r--r--tests/FunctionalTests/active-controls/protected/pages/Sessioned/PageStateTest.php11
-rw-r--r--tests/FunctionalTests/active-controls/protected/pages/Sessioned/config.xml4
-rw-r--r--tests/FunctionalTests/active-controls/tests/AutoCompleteTestCase.php4
-rw-r--r--tests/FunctionalTests/active-controls/tests/DelayedCallbackTestCase.php22
-rw-r--r--tests/FunctionalTests/validators/tests/DatePickerTestCase.php26
8 files changed, 126 insertions, 14 deletions
diff --git a/tests/FunctionalTests/active-controls/protected/pages/DelayedCallback.page b/tests/FunctionalTests/active-controls/protected/pages/DelayedCallback.page
new file mode 100644
index 00000000..b8fba648
--- /dev/null
+++ b/tests/FunctionalTests/active-controls/protected/pages/DelayedCallback.page
@@ -0,0 +1,7 @@
+<com:TForm>
+<h1>Delayed Callback Test</h1>
+<com:TActiveButton ID="button1" Text="Delayed 4000" OnCallback="callback1" />
+<com:TActiveButton ID="button2" Text="Delayed 2000" OnCallback="callback2" />
+<com:TActiveLabel ID="status" />
+<com:TJavascriptLogger />
+</com:TForm> \ No newline at end of file
diff --git a/tests/FunctionalTests/active-controls/protected/pages/DelayedCallback.php b/tests/FunctionalTests/active-controls/protected/pages/DelayedCallback.php
new file mode 100644
index 00000000..7e9195dc
--- /dev/null
+++ b/tests/FunctionalTests/active-controls/protected/pages/DelayedCallback.php
@@ -0,0 +1,21 @@
+<?php
+
+class DelayedCallback extends TPage
+{
+ function callback1($sender, $param)
+ {
+ $ms = 4;
+ sleep($ms);
+ $this->status->Text="Callback 1 returned after {$ms}s";
+ }
+
+ function callback2($sender, $param)
+ {
+ $ms = 2;
+ sleep($ms);
+ $this->status->Text="Callback 2 delayed {$ms}s";
+ }
+
+}
+
+?> \ No newline at end of file
diff --git a/tests/FunctionalTests/active-controls/protected/pages/Sessioned/PageStateTest.page b/tests/FunctionalTests/active-controls/protected/pages/Sessioned/PageStateTest.page
new file mode 100644
index 00000000..c68be7ca
--- /dev/null
+++ b/tests/FunctionalTests/active-controls/protected/pages/Sessioned/PageStateTest.page
@@ -0,0 +1,45 @@
+<com:THead />
+<com:TForm>
+
+<com:TActiveButton ID="button1" Text="Click Me!" OnCallback="button1_oncallback" />
+<com:TActiveLabel ID="label1" />
+
+<com:TActiveRatingList RepeatColumns="2" RepeatDirection="Vertical">
+ <com:TListItem Text="1 Star" />
+ <com:TListItem Text="2 Stars" />
+ <com:TListItem Text="3 Stars" />
+ <com:TListItem Text="4 Stars" />
+ <com:TListItem Text="5 Stars" />
+ <com:TListItem Text="6 Stars" />
+ <com:TListItem Text="7 Stars" />
+ <com:TListItem Text="8 Stars" />
+ <com:TListItem Text="9 Stars" />
+ <com:TListItem Text="10 Stars" />
+ <prop:ClientSide
+ OnLoading="Element.show('status')"
+ OnComplete="Element.hide('status')" />
+</com:TActiveRatingList>
+<br />
+
+<com:TActiveRatingList ID="list4" Rating="3.5" Attributes.title="3.5 Stars" ReadOnly="true">
+ <com:TListItem Text="1 Star" />
+ <com:TListItem Text="2 Stars" />
+ <com:TListItem Text="3 Stars" />
+ <com:TListItem Text="4 Stars" />
+ <com:TListItem Text="5 Stars" />
+</com:TActiveRatingList>
+
+<br />
+
+ <div id="status" style="margin:1em; padding:0.5em;
+ text-align:center;
+ background-color:#900;
+ color:white; display: none;
+ position: absolute; right: 0; top: 0">
+ Loading...
+ </div>
+
+
+<com:TJavascriptLogger />
+
+</com:TForm> \ No newline at end of file
diff --git a/tests/FunctionalTests/active-controls/protected/pages/Sessioned/PageStateTest.php b/tests/FunctionalTests/active-controls/protected/pages/Sessioned/PageStateTest.php
new file mode 100644
index 00000000..3291189c
--- /dev/null
+++ b/tests/FunctionalTests/active-controls/protected/pages/Sessioned/PageStateTest.php
@@ -0,0 +1,11 @@
+<?php
+
+class PageStateTest extends TPage
+{
+ function button1_oncallback($sender, $param)
+ {
+ $this->label1->Text .= " button1 clicked ";
+ }
+}
+
+?> \ No newline at end of file
diff --git a/tests/FunctionalTests/active-controls/protected/pages/Sessioned/config.xml b/tests/FunctionalTests/active-controls/protected/pages/Sessioned/config.xml
new file mode 100644
index 00000000..754e9bc5
--- /dev/null
+++ b/tests/FunctionalTests/active-controls/protected/pages/Sessioned/config.xml
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="utf-8"?>
+<configuration>
+ <pages StatePersisterClass="System.Web.UI.TSessionPageStatePersister" />
+</configuration> \ No newline at end of file
diff --git a/tests/FunctionalTests/active-controls/tests/AutoCompleteTestCase.php b/tests/FunctionalTests/active-controls/tests/AutoCompleteTestCase.php
index 96c0fb4b..59b266d8 100644
--- a/tests/FunctionalTests/active-controls/tests/AutoCompleteTestCase.php
+++ b/tests/FunctionalTests/active-controls/tests/AutoCompleteTestCase.php
@@ -4,6 +4,8 @@ class AutoCompleteTestCase extends SeleniumTestCase
{
function test()
{
+ $this->skipBrowsers(self::INTERNET_EXPLORER);
+
$this->open("active-controls/index.php?page=AutoCompleteTest");
$this->verifyTextPresent("TAutoComplete Test");
@@ -16,7 +18,7 @@ class AutoCompleteTestCase extends SeleniumTestCase
$this->pause(1000);
$this->verifyTextPresent('Australia');
$this->click("heading"); //click somewhere else.
- $this->waitForText("label1", "suggestion for au");
+ $this->pause(800);
$this->assertText("label1", "suggestion for au");
$this->click("css=#textbox3_result ul li");
$this->pause(800);
diff --git a/tests/FunctionalTests/active-controls/tests/DelayedCallbackTestCase.php b/tests/FunctionalTests/active-controls/tests/DelayedCallbackTestCase.php
new file mode 100644
index 00000000..3653dae1
--- /dev/null
+++ b/tests/FunctionalTests/active-controls/tests/DelayedCallbackTestCase.php
@@ -0,0 +1,22 @@
+<?php
+
+class DelayedCallbackTestCase extends SeleniumTestCase
+{
+ function test()
+ {
+ $this->open("active-controls/index.php?page=DelayedCallback");
+ $this->verifyTextPresent("Delayed Callback Test");
+
+ $this->assertText("status", "");
+ $this->click("button1");
+ $this->click("button2");
+
+ $this->pause("5000");
+ $this->assertText("status", "Callback 1 returned after 4s");
+ $this->pause("3000");
+ $this->assertText("status", "Callback 2 delayed 2s");
+
+ }
+}
+
+?> \ No newline at end of file
diff --git a/tests/FunctionalTests/validators/tests/DatePickerTestCase.php b/tests/FunctionalTests/validators/tests/DatePickerTestCase.php
index 8c40ee65..297756c2 100644
--- a/tests/FunctionalTests/validators/tests/DatePickerTestCase.php
+++ b/tests/FunctionalTests/validators/tests/DatePickerTestCase.php
@@ -3,7 +3,7 @@
class DatePickerTestCase extends SeleniumTestCase
{
function test()
- {
+ {
$base = "ctl0_Content_";
$this->open("validators/index.php?page=DatePicker", "");
$this->verifyTextPresent("Date Picker validation Test", "");
@@ -13,15 +13,15 @@ class DatePickerTestCase extends SeleniumTestCase
$this->assertNotVisible("{$base}validator5", "");
$this->assertNotVisible("{$base}validator6", "");
$this->assertNotVisible("{$base}validator8", "");
-
+
$this->click("{$base}submit1");
$this->assertVisible("{$base}validator1", "");
$this->assertNotVisible("{$base}validator2", "");
- $this->assertNotVisible("{$base}validator4", "");
+ $this->assertVisible("{$base}validator4", "");
$this->assertVisible("{$base}validator5", "");
$this->assertNotVisible("{$base}validator6", "");
$this->assertVisible("{$base}validator8", "");
-
+
$this->click("{$base}submit1");
$this->type("{$base}picker1", "13/4/2006");
$this->select("{$base}picker2_month", "label=9");
@@ -34,30 +34,30 @@ class DatePickerTestCase extends SeleniumTestCase
$this->select("{$base}picker6_month", "label=3");
$this->select("{$base}picker6_year", "label=2007");
$this->select("{$base}picker6_day", "label=5");
-
+
$this->click("{$base}submit1");
-
+
$this->assertNotVisible("{$base}validator1", "");
$this->assertVisible("{$base}validator2", "");
$this->assertNotVisible("{$base}validator4", "");
$this->assertNotVisible("{$base}validator5", "");
$this->assertVisible("{$base}validator6", "");
- $this->assertVisible("{$base}validator8", "");
-
+ $this->assertVisible("{$base}validator8", "");
+
$this->type("{$base}picker1", "20/4/2007");
$this->type("{$base}picker4", "29/4/2006");
- $this->select("{$base}picker6_day", "label=10");
-
+ $this->select("{$base}picker6_day", "label=10");
+
$this->clickAndWait("{$base}submit1");
-
+
$this->assertNotVisible("{$base}validator1", "");
$this->assertNotVisible("{$base}validator2", "");
$this->assertNotVisible("{$base}validator4", "");
$this->assertNotVisible("{$base}validator5", "");
$this->assertNotVisible("{$base}validator6", "");
- $this->assertNotVisible("{$base}validator8", "");
+ $this->assertNotVisible("{$base}validator8", "");
}
-
+
}
?> \ No newline at end of file