summaryrefslogtreecommitdiff
path: root/tests/FunctionalTests/tickets
diff options
context:
space:
mode:
authorwei <>2007-04-02 06:19:55 +0000
committerwei <>2007-04-02 06:19:55 +0000
commit1ba083b9bf77b334b773b84d4d9e5f44319d17a2 (patch)
treeab9b36010b61f22019bb99270b3d4c2aa7381ab7 /tests/FunctionalTests/tickets
parent183b4fefb355d0c607ea4b7cc270035bcc1ffd9e (diff)
Fixed #585, #586
Diffstat (limited to 'tests/FunctionalTests/tickets')
-rw-r--r--tests/FunctionalTests/tickets/protected/pages/Ticket585.page19
-rw-r--r--tests/FunctionalTests/tickets/protected/pages/Ticket585.php18
-rw-r--r--tests/FunctionalTests/tickets/protected/pages/Ticket586.page13
-rw-r--r--tests/FunctionalTests/tickets/protected/pages/Ticket586.php11
-rw-r--r--tests/FunctionalTests/tickets/tests/Ticket585TestCase.php27
-rw-r--r--tests/FunctionalTests/tickets/tests/Ticket586TestCase.php21
6 files changed, 109 insertions, 0 deletions
diff --git a/tests/FunctionalTests/tickets/protected/pages/Ticket585.page b/tests/FunctionalTests/tickets/protected/pages/Ticket585.page
new file mode 100644
index 00000000..f5e26f24
--- /dev/null
+++ b/tests/FunctionalTests/tickets/protected/pages/Ticket585.page
@@ -0,0 +1,19 @@
+<com:TContent ID="Content">
+
+<com:TDatePicker id="test" />
+<com:TActiveCustomValidator
+ ID="validator1"
+ ControlToValidate="test"
+ OnServerValidate="ChkDate"
+ ErrorMessage="*">
+ <prop:ClientSide
+ OnValidationError="$('error').innerHTML='Error'"
+ OnValidationSuccess="$('error').innerHTML='Success'"
+ ObserveChanges="false"
+
+ />
+</com:TActiveCustomValidator>
+<span id="error"></span>
+<com:TButton ID="button1" Text="ok"/>
+
+</com:TContent> \ No newline at end of file
diff --git a/tests/FunctionalTests/tickets/protected/pages/Ticket585.php b/tests/FunctionalTests/tickets/protected/pages/Ticket585.php
new file mode 100644
index 00000000..5932146d
--- /dev/null
+++ b/tests/FunctionalTests/tickets/protected/pages/Ticket585.php
@@ -0,0 +1,18 @@
+<?php
+Prado::using('System.Web.UI.ActiveControls.*');
+class Ticket585 extends TPage
+{
+
+ public function ChkDate ($sender, $param)
+ {
+ if ($param->Value == "15-03-2007")
+ {
+ $param->IsValid=false;
+ }
+ else
+ $param->IsValid=true;
+ }
+
+}
+
+?> \ No newline at end of file
diff --git a/tests/FunctionalTests/tickets/protected/pages/Ticket586.page b/tests/FunctionalTests/tickets/protected/pages/Ticket586.page
new file mode 100644
index 00000000..93c27385
--- /dev/null
+++ b/tests/FunctionalTests/tickets/protected/pages/Ticket586.page
@@ -0,0 +1,13 @@
+<com:TContent ID="Content">
+
+<com:TPanel DefaultButton="button2" Style="border:1px solid #ccc; padding:2em;">
+
+<com:TTextBox ID="text1" />
+<com:TButton ID="button1" Text="Button 1" OnClick="button_clicked"/>
+<com:TButton ID="button2" Text="Button 2 (default)" OnClick="button_clicked"/>
+<com:TButton ID="button3" Text="Button 3" OnClick="button_clicked" />
+
+<com:TLabel ID="label1" Text="Status" />
+</com:TPanel>
+
+</com:TContent> \ No newline at end of file
diff --git a/tests/FunctionalTests/tickets/protected/pages/Ticket586.php b/tests/FunctionalTests/tickets/protected/pages/Ticket586.php
new file mode 100644
index 00000000..d6fafd0d
--- /dev/null
+++ b/tests/FunctionalTests/tickets/protected/pages/Ticket586.php
@@ -0,0 +1,11 @@
+<?php
+
+class Ticket586 extends TPage
+{
+ function button_clicked($sender, $param)
+ {
+ $this->label1->Text = $sender->Text . ' Clicked!';
+ }
+}
+
+?> \ No newline at end of file
diff --git a/tests/FunctionalTests/tickets/tests/Ticket585TestCase.php b/tests/FunctionalTests/tickets/tests/Ticket585TestCase.php
new file mode 100644
index 00000000..cbcb7bb2
--- /dev/null
+++ b/tests/FunctionalTests/tickets/tests/Ticket585TestCase.php
@@ -0,0 +1,27 @@
+<?php
+
+class Ticket585TestCase extends SeleniumTestCase
+{
+ function test()
+ {
+ $base = 'ctl0_Content_';
+ $this->open('tickets/index.php?page=Ticket585');
+ $this->verifyTitle("Verifying Ticket 585", "");
+
+ $this->assertText("error", "");
+ $this->assertNotVisible("{$base}validator1");
+
+ $this->click("{$base}button1");
+ $this->pause(800);
+ $this->assertText("error", "Success");
+ $this->assertNotVisible("{$base}validator1");
+
+ $this->type("{$base}test", "15-03-2007");
+ $this->click("{$base}button1");
+ $this->pause(800);
+ $this->assertText("error", "Error");
+ $this->assertVisible("{$base}validator1");
+ }
+}
+
+?> \ No newline at end of file
diff --git a/tests/FunctionalTests/tickets/tests/Ticket586TestCase.php b/tests/FunctionalTests/tickets/tests/Ticket586TestCase.php
new file mode 100644
index 00000000..4b5619cd
--- /dev/null
+++ b/tests/FunctionalTests/tickets/tests/Ticket586TestCase.php
@@ -0,0 +1,21 @@
+<?php
+
+class Ticket586TestCase extends SeleniumTestCase
+{
+ function test()
+ {
+ $base = 'ctl0_Content_';
+ $this->open('tickets/index.php?page=Ticket586');
+ $this->verifyTitle("Verifying Ticket 586", "");
+
+ $this->assertText("{$base}label1", "Status");
+ $this->clickAndWait("{$base}button1");
+ $this->assertText("{$base}label1", "Button 1 Clicked!");
+
+ $this->type("{$base}text1", "testing");
+ $this->keyDownAndWait("{$base}text1", '\13');
+ $this->assertText("{$base}label1", "Button 2 (default) Clicked!");
+ }
+}
+
+?> \ No newline at end of file