From b7f95ce37ae577e95a81e64aa2aaf3e2e698109d Mon Sep 17 00:00:00 2001 From: xue <> Date: Sat, 5 Aug 2006 21:34:30 +0000 Subject: merge from 3.0 branch till 1329. --- .../features/protected/pages/FocusControl.page | 46 ++++++++++++++++++ .../features/protected/pages/FocusControl.php | 17 +++++++ .../tickets/protected/pages/Ticket274.page | 22 +++++++++ .../tickets/protected/pages/Ticket278.page | 42 +++++++++++++++++ .../tickets/protected/pages/Ticket278.php | 23 +++++++++ .../tickets/tests/Ticket274TestCase.php | 24 ++++++++++ .../tickets/tests/Ticket278TestCase.php | 54 ++++++++++++++++++++++ .../validators/tests/DataTypeValidatorTestCase.php | 2 +- 8 files changed, 229 insertions(+), 1 deletion(-) create mode 100644 tests/FunctionalTests/features/protected/pages/FocusControl.page create mode 100644 tests/FunctionalTests/features/protected/pages/FocusControl.php create mode 100644 tests/FunctionalTests/tickets/protected/pages/Ticket274.page create mode 100644 tests/FunctionalTests/tickets/protected/pages/Ticket278.page create mode 100644 tests/FunctionalTests/tickets/protected/pages/Ticket278.php create mode 100644 tests/FunctionalTests/tickets/tests/Ticket274TestCase.php create mode 100644 tests/FunctionalTests/tickets/tests/Ticket278TestCase.php (limited to 'tests') diff --git a/tests/FunctionalTests/features/protected/pages/FocusControl.page b/tests/FunctionalTests/features/protected/pages/FocusControl.page new file mode 100644 index 00000000..af414c3a --- /dev/null +++ b/tests/FunctionalTests/features/protected/pages/FocusControl.page @@ -0,0 +1,46 @@ + + + + + + + + + + + + +

+a + +

+ +

+b + +

+ +

+c + +

+ +

+d +

+ +

+e + +

+ +

+f +

+ +

+g + +

+ +
\ No newline at end of file diff --git a/tests/FunctionalTests/features/protected/pages/FocusControl.php b/tests/FunctionalTests/features/protected/pages/FocusControl.php new file mode 100644 index 00000000..d78f28c4 --- /dev/null +++ b/tests/FunctionalTests/features/protected/pages/FocusControl.php @@ -0,0 +1,17 @@ +list->SelectedIndex; + if($selected >= 0) + { + $id = "button".($selected+1); + $controlID = $this->{$id}->ClientID; + $this->ClientScript->registerFocusControl($controlID); + } + } +} + +?> \ No newline at end of file diff --git a/tests/FunctionalTests/tickets/protected/pages/Ticket274.page b/tests/FunctionalTests/tickets/protected/pages/Ticket274.page new file mode 100644 index 00000000..4e1441ed --- /dev/null +++ b/tests/FunctionalTests/tickets/protected/pages/Ticket274.page @@ -0,0 +1,22 @@ + + + + + + + + + + \ No newline at end of file diff --git a/tests/FunctionalTests/tickets/protected/pages/Ticket278.page b/tests/FunctionalTests/tickets/protected/pages/Ticket278.page new file mode 100644 index 00000000..75aed4d9 --- /dev/null +++ b/tests/FunctionalTests/tickets/protected/pages/Ticket278.page @@ -0,0 +1,42 @@ + + + + + +
+ +
+ + + + + + + Event.OnLoad(function() + { + Event.observe("<%= $this->check1->ClientID %>", "click", function(ev) + { + $("<%= $this->panel1->ClientID %>").toggle(); + }); + }); + + +
\ No newline at end of file diff --git a/tests/FunctionalTests/tickets/protected/pages/Ticket278.php b/tests/FunctionalTests/tickets/protected/pages/Ticket278.php new file mode 100644 index 00000000..1aadee77 --- /dev/null +++ b/tests/FunctionalTests/tickets/protected/pages/Ticket278.php @@ -0,0 +1,23 @@ +Enabled = $this->check1->Checked; + } + + function validate2_onPostValidate($sender, $param) + { + $sender->Enabled = true; + } + + function onPreRender($param) + { + parent::onPreRender($param); + $this->panel1->Style = + $this->check1->Checked ? "display:block" : "display:none"; + } +} + +?> \ No newline at end of file diff --git a/tests/FunctionalTests/tickets/tests/Ticket274TestCase.php b/tests/FunctionalTests/tickets/tests/Ticket274TestCase.php new file mode 100644 index 00000000..ae976a7f --- /dev/null +++ b/tests/FunctionalTests/tickets/tests/Ticket274TestCase.php @@ -0,0 +1,24 @@ +open('tickets/index.php?page=Ticket274'); + $this->assertTitle('Verifying Ticket 274'); + $this->assertNotVisible($base.'validator1'); + $this->assertNotVisible($base.'validator2'); + + $this->click($base.'button1'); + $this->assertVisible($base.'validator1'); + $this->assertNotVisible($base.'validator2'); + + $this->type($base.'MyDate', 'asd'); + $this->click($base.'button1'); + $this->assertVisible($base.'validator1'); + $this->assertNotVisible($base.'validator2'); + } +} + +?> \ No newline at end of file diff --git a/tests/FunctionalTests/tickets/tests/Ticket278TestCase.php b/tests/FunctionalTests/tickets/tests/Ticket278TestCase.php new file mode 100644 index 00000000..bd631c14 --- /dev/null +++ b/tests/FunctionalTests/tickets/tests/Ticket278TestCase.php @@ -0,0 +1,54 @@ +open('tickets/index.php?page=Ticket278'); + $this->assertTitle('Verifying Ticket 278'); + $this->assertNotVisible($base.'validator1'); + $this->assertNotVisible($base.'validator2'); + $this->assertNotVisible($base.'panel1'); + + $this->click($base.'button1'); + $this->assertVisible($base.'validator1'); + $this->assertNotVisible($base.'validator2'); + + $this->type($base.'text1', 'asd'); + $this->clickAndWait($base.'button1'); + $this->assertNotVisible($base.'validator1'); + $this->assertNotVisible($base.'validator2'); + $this->assertNotVisible($base.'panel1'); + + $this->click($base.'check1'); + $this->click($base.'button1'); + $this->assertNotVisible($base.'validator1'); + $this->assertVisible($base.'validator2'); + $this->assertVisible($base.'panel1'); + + + $this->type($base.'text1', ''); + $this->type($base.'text2', 'asd'); + $this->click($base.'button1'); + $this->assertVisible($base.'validator1'); + $this->assertNotVisible($base.'validator2'); + $this->assertVisible($base.'panel1'); + + + $this->type($base.'text1', 'asd'); + $this->clickAndWait($base.'button1'); + $this->assertNotVisible($base.'validator1'); + $this->assertNotVisible($base.'validator2'); + $this->assertVisible($base.'panel1'); + + $this->type($base.'text1', ''); + $this->type($base.'text2', ''); + $this->click($base.'button1'); + $this->assertVisible($base.'validator1'); + $this->assertVisible($base.'validator2'); + $this->assertVisible($base.'panel1'); + } +} + +?> \ No newline at end of file diff --git a/tests/FunctionalTests/validators/tests/DataTypeValidatorTestCase.php b/tests/FunctionalTests/validators/tests/DataTypeValidatorTestCase.php index 1ca3de5d..153be373 100644 --- a/tests/FunctionalTests/validators/tests/DataTypeValidatorTestCase.php +++ b/tests/FunctionalTests/validators/tests/DataTypeValidatorTestCase.php @@ -10,7 +10,7 @@ class DataTypeValidatorTestCase extends SeleniumTestCase $base = "ctl0_Content_"; $this->open("validators/index.php?page=DataTypeValidator", ""); $this->verifyTextPresent("Data Type Validator Tests", ""); - $this->clickAndWait("//input[@type='submit' and @value='submit!']", ""); + $this->click("//input[@type='submit' and @value='submit!']", ""); $this->assertNotVisible("{$base}validator1"); $this->assertNotVisible("{$base}validator2"); -- cgit v1.2.3