diff options
author | xue <> | 2006-07-02 18:05:42 +0000 |
---|---|---|
committer | xue <> | 2006-07-02 18:05:42 +0000 |
commit | 7e002c23edc5fb5db70935591aa6adeda25fc7fb (patch) | |
tree | 846feb337405448cc1559c2e7b4ed6f85798e0c7 /tests | |
parent | 618293517861b69334cd470068199394120cd20a (diff) |
Merge from 3.0 branch till 1224.
Diffstat (limited to 'tests')
17 files changed, 282 insertions, 1 deletions
diff --git a/tests/FunctionalTests/index.php b/tests/FunctionalTests/index.php index ceba599a..c4b3123b 100644 --- a/tests/FunctionalTests/index.php +++ b/tests/FunctionalTests/index.php @@ -14,4 +14,4 @@ Prado Functional Test Suites <li><a href="features.php">Tests of New Features</a> (<a href="features/index.php">list of new features</a>)</li> </ul> </body> -</html>
\ No newline at end of file +</html> diff --git a/tests/FunctionalTests/tickets/protected/pages/Home.page b/tests/FunctionalTests/tickets/protected/pages/Home.page new file mode 100755 index 00000000..d4ac162c --- /dev/null +++ b/tests/FunctionalTests/tickets/protected/pages/Home.page @@ -0,0 +1,3 @@ +<com:TContent ID="Content"> +<com:TBulletedList ID="List" DisplayMode="HyperLink"/> +</com:TContent>
\ No newline at end of file diff --git a/tests/FunctionalTests/tickets/protected/pages/Home.php b/tests/FunctionalTests/tickets/protected/pages/Home.php new file mode 100755 index 00000000..37804419 --- /dev/null +++ b/tests/FunctionalTests/tickets/protected/pages/Home.php @@ -0,0 +1,34 @@ +<?php + +class Home extends TPage +{ + public function onLoad($param) + { + parent::onLoad($param); + $list=$this->getPageList(dirname(__FILE__),''); + $this->List->DataSource=$list; + $this->List->dataBind(); + } + + protected function getPageList($directory,$basePath) + { + $list=array(); + $folder=@opendir($directory); + while($entry=@readdir($folder)) + { + if($entry[0]==='.') + continue; + else if(is_file($directory.'/'.$entry)) + { + if(($page=basename($entry,'.page'))!==$entry && strpos($page,'.')===false) + $list['?page='.$basePath.$page]=$basePath.$page; + } + else + $list=array_merge($list,$this->getPageList($directory.'/'.$entry,$basePath.$entry.'.')); + } + closedir($folder); + return $list; + } +} + +?>
\ No newline at end of file diff --git a/tests/FunctionalTests/tickets/protected/pages/Ticket200.page b/tests/FunctionalTests/tickets/protected/pages/Ticket200.page new file mode 100644 index 00000000..76c60f40 --- /dev/null +++ b/tests/FunctionalTests/tickets/protected/pages/Ticket200.page @@ -0,0 +1,6 @@ +<com:TContent ID="Content"> + <com:TLinkButton ID="linkButton1" Text="Click Me" OnClick="linkButton1_Clicked" /> + <p style="height:500px"><br /></p> + <com:TLinkButton ID="linkButton2" Text="Click Me" OnClick="linkButton2_Clicked" /> + <p style="height:500px"></br></p> +</com:TContent>
\ No newline at end of file diff --git a/tests/FunctionalTests/tickets/protected/pages/Ticket200.php b/tests/FunctionalTests/tickets/protected/pages/Ticket200.php new file mode 100644 index 00000000..a80a3b8a --- /dev/null +++ b/tests/FunctionalTests/tickets/protected/pages/Ticket200.php @@ -0,0 +1,16 @@ +<?php + +class Ticket200 extends TPage +{ + function linkButton1_Clicked() + { + + } + + function linkButton2_Clicked() + { + + } +} + +?>
\ No newline at end of file diff --git a/tests/FunctionalTests/tickets/protected/pages/Ticket202.page b/tests/FunctionalTests/tickets/protected/pages/Ticket202.page new file mode 100644 index 00000000..ae984c2d --- /dev/null +++ b/tests/FunctionalTests/tickets/protected/pages/Ticket202.page @@ -0,0 +1,19 @@ +<%@ MasterPage="" %> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" > + +<com:THead ID="Head"> + <meta http-equiv="content-language" content="en"/> + <meta http-equiv="Expires" content="0"> +</com:THead> + +<body> +<com:TForm> +<com:TTextBox MaxLength="50" /> +<com:TTextBox ID="CustomerNumber" /> +<com:TButton Text="Search" /> +<com:TDataTypeValidator DataType="Integer" ControlToValidate="CustomerNumber" ErrorMessage="Customernumber must be a number." /> + +</com:TForm> +</body> +</html>
\ No newline at end of file diff --git a/tests/FunctionalTests/tickets/protected/pages/Ticket205.page b/tests/FunctionalTests/tickets/protected/pages/Ticket205.page new file mode 100644 index 00000000..1481a227 --- /dev/null +++ b/tests/FunctionalTests/tickets/protected/pages/Ticket205.page @@ -0,0 +1,26 @@ +<com:TContent ID="Content"> + <h3>TCustomValidator not enabling ControlCssClass or prop:ClientSide.OnError after postback.</h3> + <style> + .required + { + border: 1px solid red; + background-color: pink; + } + </style> + <script type="text/javascript"> + function clientSideCustomValidate(sender, param) + { + return param == "Prado"; + } + </script> + <com:TTextBox ID="textbox1" /> + <com:TCustomValidator + ID="validator1" + ControlToValidate="textbox1" + ControlCssClass="required" + OnServerValidate="customValidate" + ClientValidationFunction="clientSideCustomValidate" + ClientSide.OnError="alert('error')" + ErrorMessage="must equal to 'Prado'" /> + <com:TButton ID="button1" Text="Submit!" /> +</com:TContent>
\ No newline at end of file diff --git a/tests/FunctionalTests/tickets/protected/pages/Ticket205.php b/tests/FunctionalTests/tickets/protected/pages/Ticket205.php new file mode 100644 index 00000000..6145af9a --- /dev/null +++ b/tests/FunctionalTests/tickets/protected/pages/Ticket205.php @@ -0,0 +1,11 @@ +<?php + +class Ticket205 extends TPage +{ + function customValidate($sender, $param) + { + $param->IsValid = $this->textbox1->Text == "Prado"; + } +} + +?>
\ No newline at end of file diff --git a/tests/FunctionalTests/tickets/protected/pages/Ticket207.page b/tests/FunctionalTests/tickets/protected/pages/Ticket207.page new file mode 100644 index 00000000..556c5aae --- /dev/null +++ b/tests/FunctionalTests/tickets/protected/pages/Ticket207.page @@ -0,0 +1,24 @@ +<com:TContent ID="Content"> + <h2>Validators ClientSide.OnError triggered twice</h2> + <h3>Use ClientSide.ObseveChanges="false"</h3> + <com:TTextBox ID="text1" /><br /> + <com:TRequiredFieldValidator + id="validator1" + ControlToValidate="text1" Text="Error" + ClientSide.ObserveChanges="false" + ClientSide.OnError="alert('error on text1 fired')" /> + <br /> + <com:TTextBox ID="text2" /><br /> + <com:TRequiredFieldValidator id="validator2" ControlToValidate="text2" Text="Error" /> + <br /> + <com:TButton id="button1" Text="submit" /> + <h3>Conditions</h3> +<pre> + (TextBox? B is just there to prevent server submission) + To verify try exactly this: + + 1. Enter nothing and click on submit : 1 error event will be triggered + 2. Enter something into TextBox? T and click on submit : no error event (ok) + 3. Delete your text from TextBox? T again and click on submit : error event will be triggered twice +</pre> +</com:TContent>
\ No newline at end of file diff --git a/tests/FunctionalTests/tickets/protected/pages/Ticket227.page b/tests/FunctionalTests/tickets/protected/pages/Ticket227.page new file mode 100644 index 00000000..ab481fa2 --- /dev/null +++ b/tests/FunctionalTests/tickets/protected/pages/Ticket227.page @@ -0,0 +1,4 @@ +<com:TContent ID="Content"> + <h2>Disabled HTMLArea</h2> + <com:THtmlArea ID="htmlArea1" Width="500px" Height="250px" Enabled="false"/> +</com:TContent>
\ No newline at end of file diff --git a/tests/FunctionalTests/tickets/protected/pages/Ticket246.page b/tests/FunctionalTests/tickets/protected/pages/Ticket246.page new file mode 100644 index 00000000..e25a484b --- /dev/null +++ b/tests/FunctionalTests/tickets/protected/pages/Ticket246.page @@ -0,0 +1,17 @@ +<com:TContent ID="Content"> + <h2>TDatePicker inside absolute DIV with scrollbar</h2> + + <div style="position:absolute; top:100px; + width: 400px; background-color: #fee; + overflow: scroll; + border:1px solid red; height:350px; text-align:center"> + <p style="height:200px; background-color: #eef;"></p> + <com:TDatePicker ID="datePicker1" DateFormat="dd/MM/yyyy" InputMode="DropDownList" /> + <br /><br /> + <com:TDropDownList ID="dropDownList1"> + <com:TListItem Value="value 1" Text="item 1" /> + <com:TListItem Value="value 2" Text="item 2" /> + </com:TDropDownList> + <p style="height:400px; width:600px; background-color:#efe;"></p> + </div> +</com:TContent>
\ No newline at end of file diff --git a/tests/FunctionalTests/tickets/tests/Ticket205TestCase.php b/tests/FunctionalTests/tickets/tests/Ticket205TestCase.php new file mode 100644 index 00000000..85785697 --- /dev/null +++ b/tests/FunctionalTests/tickets/tests/Ticket205TestCase.php @@ -0,0 +1,23 @@ +<?php + +class Ticket205TestCase extends SeleniumTestCase +{ + function test() + { + $base = 'ctl0_Content_'; + $this->open("tickets/index.php?page=Ticket205"); + $this->assertTitle("Verifying Ticket 205"); + $this->assertNotVisible("{$base}validator1"); + + $this->type("{$base}textbox1", "test"); + $this->click("{$base}button1"); + $this->assertVisible("{$base}validator1"); + $this->assertAlert("error"); + + $this->type("{$base}textbox1", "Prado"); + $this->clickAndWait("{$base}button1"); + $this->assertNotVisible("{$base}validator1"); + } +} + +?>
\ No newline at end of file diff --git a/tests/FunctionalTests/tickets/tests/Ticket207TestCase.php b/tests/FunctionalTests/tickets/tests/Ticket207TestCase.php new file mode 100644 index 00000000..53ae6528 --- /dev/null +++ b/tests/FunctionalTests/tickets/tests/Ticket207TestCase.php @@ -0,0 +1,37 @@ +<?php + +class Ticket207TestCase extends SeleniumTestCase +{ + function test() + { + $base = 'ctl0_Content_'; + $this->open('tickets/index.php?page=Ticket207'); + $this->assertTitle("Verifying Ticket 207"); + $this->assertNotVisible("{$base}validator1"); + $this->assertNotVisible("{$base}validator2"); + + $this->click("{$base}button1"); + $this->assertAlert('error on text1 fired'); + $this->assertVisible("{$base}validator1"); + $this->assertVisible("{$base}validator2"); + + $this->type("{$base}text1", 'test'); + $this->assertVisible("{$base}validator1"); + $this->assertVisible("{$base}validator2"); + + $this->click("{$base}button1"); + $this->assertNotVisible("{$base}validator1"); + $this->assertVisible("{$base}validator2"); + + $this->type("{$base}text1", ''); + $this->assertNotVisible("{$base}validator1"); + $this->assertVisible("{$base}validator2"); + + $this->click("{$base}button1"); + $this->assertAlert('error on text1 fired'); + $this->assertVisible("{$base}validator1"); + $this->assertVisible("{$base}validator2"); + } +} + +?>
\ No newline at end of file diff --git a/tests/FunctionalTests/tickets/tests/Ticket227TestCase.php b/tests/FunctionalTests/tickets/tests/Ticket227TestCase.php new file mode 100644 index 00000000..c0dd2a98 --- /dev/null +++ b/tests/FunctionalTests/tickets/tests/Ticket227TestCase.php @@ -0,0 +1,12 @@ +<?php + +class Ticket227TestCase extends SeleniumTestCase +{ + function test() + { + $this->open('tickets/index.php?page=Ticket227'); + $this->assertTitle('Verifying Ticket 227'); + } +} + +?>
\ No newline at end of file diff --git a/tests/FunctionalTests/tickets/tests/Ticket246TestCase.php b/tests/FunctionalTests/tickets/tests/Ticket246TestCase.php new file mode 100644 index 00000000..8f07790e --- /dev/null +++ b/tests/FunctionalTests/tickets/tests/Ticket246TestCase.php @@ -0,0 +1,12 @@ +<?php + +class Ticket246TestCase extends SeleniumTestCase +{ + function test() + { + $this->open('tickets/index.php?page=Ticket246'); + $this->assertTitle('Verifying Ticket 246'); + } +} + +?>
\ No newline at end of file diff --git a/tests/FunctionalTests/validators/protected/pages/Home.page b/tests/FunctionalTests/validators/protected/pages/Home.page new file mode 100755 index 00000000..d4ac162c --- /dev/null +++ b/tests/FunctionalTests/validators/protected/pages/Home.page @@ -0,0 +1,3 @@ +<com:TContent ID="Content"> +<com:TBulletedList ID="List" DisplayMode="HyperLink"/> +</com:TContent>
\ No newline at end of file diff --git a/tests/FunctionalTests/validators/protected/pages/Home.php b/tests/FunctionalTests/validators/protected/pages/Home.php new file mode 100755 index 00000000..37804419 --- /dev/null +++ b/tests/FunctionalTests/validators/protected/pages/Home.php @@ -0,0 +1,34 @@ +<?php + +class Home extends TPage +{ + public function onLoad($param) + { + parent::onLoad($param); + $list=$this->getPageList(dirname(__FILE__),''); + $this->List->DataSource=$list; + $this->List->dataBind(); + } + + protected function getPageList($directory,$basePath) + { + $list=array(); + $folder=@opendir($directory); + while($entry=@readdir($folder)) + { + if($entry[0]==='.') + continue; + else if(is_file($directory.'/'.$entry)) + { + if(($page=basename($entry,'.page'))!==$entry && strpos($page,'.')===false) + $list['?page='.$basePath.$page]=$basePath.$page; + } + else + $list=array_merge($list,$this->getPageList($directory.'/'.$entry,$basePath.$entry.'.')); + } + closedir($folder); + return $list; + } +} + +?>
\ No newline at end of file |