From 68eb20ae56e35cc48982be6f15c0738a276c3684 Mon Sep 17 00:00:00 2001 From: wei <> Date: Sat, 21 Oct 2006 02:46:12 +0000 Subject: update ajax callback to be quequed --- .../protected/pages/DelayedCallback.page | 7 ++++ .../protected/pages/DelayedCallback.php | 21 ++++++++++ .../protected/pages/Sessioned/PageStateTest.page | 45 ++++++++++++++++++++++ .../protected/pages/Sessioned/PageStateTest.php | 11 ++++++ .../protected/pages/Sessioned/config.xml | 4 ++ .../active-controls/tests/AutoCompleteTestCase.php | 4 +- .../tests/DelayedCallbackTestCase.php | 22 +++++++++++ .../validators/tests/DatePickerTestCase.php | 26 ++++++------- 8 files changed, 126 insertions(+), 14 deletions(-) create mode 100644 tests/FunctionalTests/active-controls/protected/pages/DelayedCallback.page create mode 100644 tests/FunctionalTests/active-controls/protected/pages/DelayedCallback.php create mode 100644 tests/FunctionalTests/active-controls/protected/pages/Sessioned/PageStateTest.page create mode 100644 tests/FunctionalTests/active-controls/protected/pages/Sessioned/PageStateTest.php create mode 100644 tests/FunctionalTests/active-controls/protected/pages/Sessioned/config.xml create mode 100644 tests/FunctionalTests/active-controls/tests/DelayedCallbackTestCase.php (limited to 'tests/FunctionalTests') 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 @@ + +

Delayed Callback Test

+ + + + +
\ 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 @@ +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 @@ + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + +
+ + + + + + +
\ 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 @@ +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 @@ + + + + \ 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 @@ +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 -- cgit v1.2.3