summaryrefslogtreecommitdiff
path: root/tests/FunctionalTests/tickets
diff options
context:
space:
mode:
Diffstat (limited to 'tests/FunctionalTests/tickets')
-rw-r--r--tests/FunctionalTests/tickets/application.xml4
-rw-r--r--tests/FunctionalTests/tickets/index.php8
-rw-r--r--tests/FunctionalTests/tickets/protected/pages/Layout.php14
-rw-r--r--tests/FunctionalTests/tickets/protected/pages/Layout.tpl45
-rw-r--r--tests/FunctionalTests/tickets/protected/pages/Ticket21.page10
-rw-r--r--tests/FunctionalTests/tickets/protected/pages/Ticket21.php22
-rw-r--r--tests/FunctionalTests/tickets/protected/pages/Ticket27.page17
-rw-r--r--tests/FunctionalTests/tickets/protected/pages/config.xml5
-rw-r--r--tests/FunctionalTests/tickets/tests/Ticket21TestCase.php16
-rw-r--r--tests/FunctionalTests/tickets/tests/Ticket27TestCase.php18
10 files changed, 159 insertions, 0 deletions
diff --git a/tests/FunctionalTests/tickets/application.xml b/tests/FunctionalTests/tickets/application.xml
new file mode 100644
index 00000000..e973d37d
--- /dev/null
+++ b/tests/FunctionalTests/tickets/application.xml
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="utf-8"?>
+
+<application id="FunctionTests" Mode="Debug">
+</application> \ No newline at end of file
diff --git a/tests/FunctionalTests/tickets/index.php b/tests/FunctionalTests/tickets/index.php
new file mode 100644
index 00000000..fe127639
--- /dev/null
+++ b/tests/FunctionalTests/tickets/index.php
@@ -0,0 +1,8 @@
+<?php
+
+require_once(dirname(__FILE__).'/../../../framework/prado.php');
+
+$app=new TApplication;
+$app->run();
+
+?> \ No newline at end of file
diff --git a/tests/FunctionalTests/tickets/protected/pages/Layout.php b/tests/FunctionalTests/tickets/protected/pages/Layout.php
new file mode 100644
index 00000000..64b0aebe
--- /dev/null
+++ b/tests/FunctionalTests/tickets/protected/pages/Layout.php
@@ -0,0 +1,14 @@
+<?php
+
+class Layout extends TTemplateControl
+{
+ public function onLoad($param)
+ {
+ $num = str_replace('Ticket','',get_class($this->getPage()));
+ $this->getPage()->setTitle("Verifying Ticket $num");
+ $this->ticketlink->setText("Verifying Ticket $num");
+ $this->ticketlink->setNavigateUrl("http://trac.pradosoft.com/ticket/{$num}");
+ }
+}
+
+?> \ No newline at end of file
diff --git a/tests/FunctionalTests/tickets/protected/pages/Layout.tpl b/tests/FunctionalTests/tickets/protected/pages/Layout.tpl
new file mode 100644
index 00000000..bf2f8fab
--- /dev/null
+++ b/tests/FunctionalTests/tickets/protected/pages/Layout.tpl
@@ -0,0 +1,45 @@
+<!DOCTYPE html PUBLIC
+ "-//W3C//DTD XHTML 1.0 Strict//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<com:THead Title="PRADO Functional Tests">
+ <meta http-equiv="Content-type" content="text/html; charset=UTF-8" />
+ <style type="text/css">
+ /*<![CDATA[*/
+ .defect
+ {
+ color: #c00;
+ font-size: 1.15em;
+ }
+ body
+ {
+ font-family: Georgia, "Times New Roman", Times, serif;
+ }
+ .w3c
+ {
+ margin-top: 2em;
+ display: block;
+ }
+ /*]]>*/
+ </style>
+</com:THead>
+<body>
+<com:TForm>
+<h1><com:THyperLink ID="ticketlink" /></h1>
+
+<com:TContentPlaceHolder ID="Content" />
+<hr style="margin-top: 2em" />
+<com:TJavascriptLogger />
+</com:TForm>
+<div class="w3c">
+<a href="http://validator.w3.org/check?uri=referer">
+ Validate XHTML 1.0
+</a>
+<a href="?page=ViewSource&amp;path=<%= str_replace('.','/', $this->Request->ServiceParameter) %>.page"
+ style="margin: 0 1em;"
+ onclick="window.open(this.href); return false;"
+ onkeypress="window.open(this.href); return false;">View Source</a>
+</div>
+</body>
+</html> \ No newline at end of file
diff --git a/tests/FunctionalTests/tickets/protected/pages/Ticket21.page b/tests/FunctionalTests/tickets/protected/pages/Ticket21.page
new file mode 100644
index 00000000..e0619ea1
--- /dev/null
+++ b/tests/FunctionalTests/tickets/protected/pages/Ticket21.page
@@ -0,0 +1,10 @@
+<com:TContent ID="Content">
+<h2 class="defect">TRadioButton always postback if AutoPostBack=true</h2>
+
+<com:TRadioButton ID="button1"
+ AutoPostBack="true"
+ OnCheckedChanged="doClick" />
+<com:TLabel ForControl="button1" Text="radio button 1" /> <br>
+
+<com:TLabel ID="label1" />
+</com:TContent> \ No newline at end of file
diff --git a/tests/FunctionalTests/tickets/protected/pages/Ticket21.php b/tests/FunctionalTests/tickets/protected/pages/Ticket21.php
new file mode 100644
index 00000000..041ba4b7
--- /dev/null
+++ b/tests/FunctionalTests/tickets/protected/pages/Ticket21.php
@@ -0,0 +1,22 @@
+<?php
+
+class Ticket21 extends TPage
+{
+ public function onLoad($param)
+ {
+ parent::onLoad($param);
+
+ if(!$this->IsPostBack)
+ $this->setViewState("clicks", 0);
+ }
+
+ public function doClick($sender, $param)
+ {
+ $clicks = $this->getViewState("clicks");
+ $clicks++;
+ $this->label1->setText("Radio button clicks: $clicks");
+ $this->setViewState("clicks", $clicks);
+ }
+}
+
+?> \ No newline at end of file
diff --git a/tests/FunctionalTests/tickets/protected/pages/Ticket27.page b/tests/FunctionalTests/tickets/protected/pages/Ticket27.page
new file mode 100644
index 00000000..f92511c7
--- /dev/null
+++ b/tests/FunctionalTests/tickets/protected/pages/Ticket27.page
@@ -0,0 +1,17 @@
+<com:TContent ID="Content">
+<h2 class="defect">TCheckBoxList demo js error on IE</h2>
+
+<com:TTextBox ID="TextBox" />
+<com:TRequiredFieldValidator
+ ID="validator1"
+ ControlToValidate="TextBox"
+ ErrorMessage="You must enter a value"
+ Display="Dynamic"
+ ValidationGroup="Group2" />
+<com:TCheckBoxList AutoPostBack="true" ValidationGroup="Group2">
+ <com:TListItem Text="Agree" />
+ <com:TListItem Text="Disagree" />
+</com:TCheckBoxList>
+
+
+</com:TContent> \ No newline at end of file
diff --git a/tests/FunctionalTests/tickets/protected/pages/config.xml b/tests/FunctionalTests/tickets/protected/pages/config.xml
new file mode 100644
index 00000000..83bb5791
--- /dev/null
+++ b/tests/FunctionalTests/tickets/protected/pages/config.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+
+<configuration>
+ <pages MasterClass="Application.pages.Layout" />
+</configuration> \ No newline at end of file
diff --git a/tests/FunctionalTests/tickets/tests/Ticket21TestCase.php b/tests/FunctionalTests/tickets/tests/Ticket21TestCase.php
new file mode 100644
index 00000000..d9677779
--- /dev/null
+++ b/tests/FunctionalTests/tickets/tests/Ticket21TestCase.php
@@ -0,0 +1,16 @@
+<?php
+
+class Ticket21TestCase extends SeleniumTestCase
+{
+ function test()
+ {
+ $this->open('tickets/index.php?page=Ticket21');
+ $this->assertTitle("Verifying Ticket 21");
+ $this->clickAndWait("ctl0_Content_button1");
+ $this->verifyTextPresent("Radio button clicks: 1", "");
+ $this->click("ctl0_Content_button1");
+ $this->verifyTextPresent("Radio button clicks: 1", "");
+ }
+}
+
+?> \ No newline at end of file
diff --git a/tests/FunctionalTests/tickets/tests/Ticket27TestCase.php b/tests/FunctionalTests/tickets/tests/Ticket27TestCase.php
new file mode 100644
index 00000000..6a5ccdb9
--- /dev/null
+++ b/tests/FunctionalTests/tickets/tests/Ticket27TestCase.php
@@ -0,0 +1,18 @@
+<?php
+
+class Ticket27TestCase extends SeleniumTestCase
+{
+ function test()
+ {
+ $this->open('tickets/index.php?page=Ticket27');
+ $this->verifyTitle("Verifying Ticket 27", "");
+ $this->click("//input[@value='Agree']", "");
+ $this->assertVisible("ctl0_Content_validator1", "");
+ $this->type("ctl0_Content_TextBox", "122");
+ $this->assertNotVisible("ctl0_Content_validator1", "");
+ $this->clickAndWait("//input[@value='Disagree']", "");
+ $this->assertNotVisible("ctl0_Content_validator1", "");
+ }
+}
+
+?> \ No newline at end of file