From 8024b179ed3657b1e43e9684105a172a287700b9 Mon Sep 17 00:00:00 2001
From: tof <>
Date: Thu, 13 Mar 2008 15:37:41 +0000
Subject: Test case for #769

---
 .gitattributes                                     |  2 ++
 .../tickets/protected/pages/Ticket769.page         | 18 +++++++++++
 .../tickets/protected/pages/Ticket769.php          | 26 +++++++++++++++
 .../tickets/tests/Ticket769TestCase.php            | 37 ++++++++++++++++++++++
 4 files changed, 83 insertions(+)
 create mode 100644 tests/FunctionalTests/tickets/protected/pages/Ticket769.page
 create mode 100644 tests/FunctionalTests/tickets/protected/pages/Ticket769.php
 create mode 100644 tests/FunctionalTests/tickets/tests/Ticket769TestCase.php

diff --git a/.gitattributes b/.gitattributes
index 7329cd01..e1a21550 100644
--- a/.gitattributes
+++ b/.gitattributes
@@ -3014,6 +3014,7 @@ tests/FunctionalTests/tickets/protected/pages/Ticket719.page -text
 tests/FunctionalTests/tickets/protected/pages/Ticket72.page -text
 tests/FunctionalTests/tickets/protected/pages/Ticket72.php -text
 tests/FunctionalTests/tickets/protected/pages/Ticket722.page -text
+tests/FunctionalTests/tickets/protected/pages/Ticket769.page -text
 tests/FunctionalTests/tickets/protected/pages/Ticket785.page -text
 tests/FunctionalTests/tickets/protected/pages/Ticket93.page -text
 tests/FunctionalTests/tickets/protected/pages/Ticket93.php -text
@@ -3074,6 +3075,7 @@ tests/FunctionalTests/tickets/tests/Ticket700TestCase.php -text
 tests/FunctionalTests/tickets/tests/Ticket703TestCase.php -text
 tests/FunctionalTests/tickets/tests/Ticket708TestCase.php -text
 tests/FunctionalTests/tickets/tests/Ticket72TestCase.php -text
+tests/FunctionalTests/tickets/tests/Ticket769TestCase.php -text
 tests/FunctionalTests/tickets/tests/Ticket93TestCase.php -text
 tests/FunctionalTests/validators.php -text
 tests/FunctionalTests/validators/index.php -text
diff --git a/tests/FunctionalTests/tickets/protected/pages/Ticket769.page b/tests/FunctionalTests/tickets/protected/pages/Ticket769.page
new file mode 100644
index 00000000..aca51817
--- /dev/null
+++ b/tests/FunctionalTests/tickets/protected/pages/Ticket769.page
@@ -0,0 +1,18 @@
+<com:TContent ID="Content">
+
+<com:TActivePanel ID="Main">
+<com:TPanel ID="A" Visible="true">
+  <label>T1</label>
+  <com:TTextBox ID="T1" />
+  <com:TActiveButton Text="T1" ValidationGroup="G1" OnClick="clicked"  />
+  <com:TRequiredFieldValidator ControlToValidate="T1" Text="T1-error"
+    ValidationGroup="G1" />
+</com:TPanel>
+
+<com:TPanel ID="B" Visible="false">                                                                                                
+  This is B
+</com:TPanel>                                                                                                        
+<com:TActiveButton Text="showB" OnCallback="showBcallback" />                                                                
+<com:TActiveButton Text="showA" OnCallback="showAcallback" />
+</com:TActivePanel>
+</com:TContent>
\ No newline at end of file
diff --git a/tests/FunctionalTests/tickets/protected/pages/Ticket769.php b/tests/FunctionalTests/tickets/protected/pages/Ticket769.php
new file mode 100644
index 00000000..e1a86f0d
--- /dev/null
+++ b/tests/FunctionalTests/tickets/protected/pages/Ticket769.php
@@ -0,0 +1,26 @@
+<?php
+
+Prado::Using ('System.Web.UI.ActiveControls.*');
+
+class Ticket769 extends TPage
+{
+	public function showAcallback( $sender, $param ) 
+	{
+		$this->A->Visible = true;
+		$this->B->Visible = false;
+		$this->Main->render( $param->NewWriter );	
+	}
+	                                                                                                                           
+	public function showBcallback( $sender, $param )
+	{
+		$this->A->Visible = false;
+		$this->B->Visible = true;
+		$this->Main->render( $param->NewWriter );
+	}
+                                                                                                                                
+	public function clicked( $sender, $param )
+	{
+		$sender->Text = $sender->Text.' clicked';
+	}
+}
+?>
\ No newline at end of file
diff --git a/tests/FunctionalTests/tickets/tests/Ticket769TestCase.php b/tests/FunctionalTests/tickets/tests/Ticket769TestCase.php
new file mode 100644
index 00000000..3a993d87
--- /dev/null
+++ b/tests/FunctionalTests/tickets/tests/Ticket769TestCase.php
@@ -0,0 +1,37 @@
+<?php
+
+class Ticket769TestCase extends SeleniumTestCase
+{
+	function test()
+	{
+		$base="ctl0_Content_";
+		$this->open('tickets/index.php?page=Ticket769');
+		$this->assertTitle("Verifying Ticket 769");
+		
+		$this->click($base.'ctl0');
+		$this->assertVisible($base.'ctl1');
+		
+		$this->type($base.'T1', 'Prado');
+		$this->click($base.'ctl0');
+		$this->pause(800);
+		$this->assertNotVisible($base.'ctl1');
+		$this->verifyTextPresent($base.'ctl0', 'T1 clicked' );
+		
+		$this->click($base.'ctl2');
+		$this->pause(800);
+		$this->verifyTextPresent($base.'B', 'This is B');
+		$this->click($base.'ctl3');
+		$this->pause(800);
+		
+		$this->type($base.'T1', '');
+		$this->click($base.'ctl0');
+		$this->assertVisible($base.'ctl1');
+		$this->type($base.'T1', 'Prado');
+		$this->click($base.'ctl0');
+		$this->pause(800);
+		$this->assertNotVisible($base.'ctl1');
+		$this->verifyTextPresent($base.'ctl0', 'T1 clicked clicked' );
+		
+	}
+}
+?>
\ No newline at end of file
-- 
cgit v1.2.3