summaryrefslogtreecommitdiff
path: root/tests/FunctionalTests/tickets
diff options
context:
space:
mode:
authorwei <>2006-07-05 04:23:43 +0000
committerwei <>2006-07-05 04:23:43 +0000
commit8d8b6688cbbb1febe92012ccc2a4158fa594fcb3 (patch)
treea9f5d43ea3a6efa4a6590192e4ae7f08655310bb /tests/FunctionalTests/tickets
parent91c4292a8063dd2d7a27e7629c015faa4bf052d6 (diff)
Fixed #223 #225
Diffstat (limited to 'tests/FunctionalTests/tickets')
-rw-r--r--tests/FunctionalTests/tickets/protected/pages/Ticket220.page30
-rw-r--r--tests/FunctionalTests/tickets/protected/pages/Ticket225.page14
-rw-r--r--tests/FunctionalTests/tickets/protected/pages/Ticket225.php19
-rw-r--r--tests/FunctionalTests/tickets/protected/pages/test.js4
-rw-r--r--tests/FunctionalTests/tickets/tests/Ticket220TestCase.php18
-rw-r--r--tests/FunctionalTests/tickets/tests/Ticket225TestCase.php24
6 files changed, 109 insertions, 0 deletions
diff --git a/tests/FunctionalTests/tickets/protected/pages/Ticket220.page b/tests/FunctionalTests/tickets/protected/pages/Ticket220.page
new file mode 100644
index 00000000..d5b6e182
--- /dev/null
+++ b/tests/FunctionalTests/tickets/protected/pages/Ticket220.page
@@ -0,0 +1,30 @@
+<com:TContent ID="Content">
+ <h1>ClientScript Test</h1>
+
+ <com:TClientScript ScriptUrl=<%~ test.js %>>
+ if(typeof(ClientScriptInfo) == "undefined")
+ ClientScriptInfo = [];
+ ClientScriptInfo.push("ok 3?")
+ </com:TClientScript>
+
+ <com:TClientScript>
+ if(typeof(ClientScriptInfo) == "undefined")
+ ClientScriptInfo = [];
+ ClientScriptInfo.push("ok 2!")
+ </com:TClientScript>
+
+ <com:TLabel ID="label1" Text="Label 1" />
+ <input type="button" id="button1" value="update" />
+
+ <com:TClientScript UsingPradoScripts="prado">
+ Event.observe("button1", "click", function()
+ {
+ element = $("<%= $this->label1->ClientID %>");
+ if(element)
+ element.innerHTML = "Label 1: "+inspect(ClientScriptInfo);
+ else
+ alert("failed");
+ });
+ </com:TClientScript>
+
+</com:TContent> \ No newline at end of file
diff --git a/tests/FunctionalTests/tickets/protected/pages/Ticket225.page b/tests/FunctionalTests/tickets/protected/pages/Ticket225.page
new file mode 100644
index 00000000..362c4dce
--- /dev/null
+++ b/tests/FunctionalTests/tickets/protected/pages/Ticket225.page
@@ -0,0 +1,14 @@
+<com:TContent ID="Content">
+ <h1>RadioButton Group Tests</h1>
+ <com:TRadioButton ID="button1" Text="Button 1" GroupName="group1" />
+ <com:TRadioButton ID="button2" Text="Button 2" GroupName="group1" />
+ <com:TRadioButton ID="button3" Text="Button 3" GroupName="group1" />
+
+ <com:TRequiredFieldValidator id="validator1"
+ ControlToValidate="button1"
+ ErrorMessage="*" />
+
+ <com:TLabel ID="label1" Text="Label 1" />
+
+ <com:TButton ID="button4" Text="Show Groupings" OnClick="button4_Clicked" />
+</com:TContent> \ No newline at end of file
diff --git a/tests/FunctionalTests/tickets/protected/pages/Ticket225.php b/tests/FunctionalTests/tickets/protected/pages/Ticket225.php
new file mode 100644
index 00000000..2cc3fc38
--- /dev/null
+++ b/tests/FunctionalTests/tickets/protected/pages/Ticket225.php
@@ -0,0 +1,19 @@
+<?php
+
+class Ticket225 extends TPage
+{
+ function button4_Clicked()
+ {
+ $this->label1->setText($this->getGroupIDs($this->button1));
+ }
+
+ private function getGroupIDs($radio)
+ {
+ $ids = '';
+ foreach($radio->getRadioButtonsInGroup() as $control)
+ $ids .= " ".$control->getUniqueID();
+ return $ids;
+ }
+}
+
+?> \ No newline at end of file
diff --git a/tests/FunctionalTests/tickets/protected/pages/test.js b/tests/FunctionalTests/tickets/protected/pages/test.js
new file mode 100644
index 00000000..e8e80b19
--- /dev/null
+++ b/tests/FunctionalTests/tickets/protected/pages/test.js
@@ -0,0 +1,4 @@
+if(typeof(ClientScriptInfo) == "undefined")
+ ClientScriptInfo = [];
+
+ClientScriptInfo.push("ok") \ No newline at end of file
diff --git a/tests/FunctionalTests/tickets/tests/Ticket220TestCase.php b/tests/FunctionalTests/tickets/tests/Ticket220TestCase.php
new file mode 100644
index 00000000..0753f732
--- /dev/null
+++ b/tests/FunctionalTests/tickets/tests/Ticket220TestCase.php
@@ -0,0 +1,18 @@
+<?php
+
+class Ticket220TestCase extends SeleniumTestCase
+{
+ function test()
+ {
+ $base="ctl0_Content_";
+ $this->open('tickets/index.php?page=Ticket220');
+ $this->assertTextPresent('ClientScript Test');
+ $this->assertText("{$base}label1", "Label 1");
+
+ $this->click("button1");
+ $this->assertText("{$base}label1", 'Label 1: ["ok", "ok 3?", "ok 2!"]');
+ $this->assertAlertNotPresent();
+ }
+}
+
+?> \ No newline at end of file
diff --git a/tests/FunctionalTests/tickets/tests/Ticket225TestCase.php b/tests/FunctionalTests/tickets/tests/Ticket225TestCase.php
new file mode 100644
index 00000000..966e8383
--- /dev/null
+++ b/tests/FunctionalTests/tickets/tests/Ticket225TestCase.php
@@ -0,0 +1,24 @@
+<?php
+
+class Ticket225TestCase extends SeleniumTestCase
+{
+ function test()
+ {
+ $base="ctl0_Content_";
+ $this->open('tickets/index.php?page=Ticket225');
+ $this->assertTextPresent('RadioButton Group Tests');
+ $this->assertText("{$base}label1", "Label 1");
+
+ $this->assertNotVisible("{$base}validator1");
+ $this->click("{$base}button4");
+ $this->assertVisible("{$base}validator1");
+
+ $this->click("{$base}button2");
+ $this->clickAndWait("{$base}button4");
+
+ $this->assertText("{$base}label1", 'ctl0$Content$button1 ctl0$Content$button2 ctl0$Content$button3');
+ $this->assertNotVisible("{$base}validator1");
+ }
+}
+
+?> \ No newline at end of file