From b43c8b4c9f3973eb5482298ed8283e33c1f426e1 Mon Sep 17 00:00:00 2001
From: mikl <>
Date: Mon, 7 Apr 2008 21:56:09 +0000
Subject: Added test case for #595

---
 .../tickets/protected/pages/Ticket595.page         | 18 ++++++++++
 .../tickets/tests/Ticket595TestCase.php            | 39 ++++++++++++++++++++++
 2 files changed, 57 insertions(+)
 create mode 100644 tests/FunctionalTests/tickets/protected/pages/Ticket595.page
 create mode 100644 tests/FunctionalTests/tickets/tests/Ticket595TestCase.php

(limited to 'tests')

diff --git a/tests/FunctionalTests/tickets/protected/pages/Ticket595.page b/tests/FunctionalTests/tickets/protected/pages/Ticket595.page
new file mode 100644
index 00000000..11a926fa
--- /dev/null
+++ b/tests/FunctionalTests/tickets/protected/pages/Ticket595.page
@@ -0,0 +1,18 @@
+<com:TContent ID="Content">
+
+<com:TTextBox ID="A" />
+<com:TRequiredFieldValidator ControlToValidate="A" Text="Required!" ControlCssClass="errorclassA" ValidationGroup="A"/>
+<com:TEmailAddressValidator ControlToValidate="A" Text="No Email!" ControlCssClass="errorclassA" ValidationGroup="A"/>
+<com:TButton Text="Click" ValidationGroup="A" />
+
+<br />
+
+<com:TTextBox ID="B" />
+<com:TRequiredFieldValidator ControlToValidate="B" Text="Required!" ControlCssClass="errorclassB" 
+        ValidationGroup="B" EnableClientScript="False" />
+<com:TEmailAddressValidator ControlToValidate="B" Text="No Email!" ControlCssClass="errorclassB" 
+    ValidationGroup="B" EnableClientScript="False" />
+<com:TButton Text="Click" ValidationGroup="B" />
+
+</com:TContent>
+
diff --git a/tests/FunctionalTests/tickets/tests/Ticket595TestCase.php b/tests/FunctionalTests/tickets/tests/Ticket595TestCase.php
new file mode 100644
index 00000000..df462c8d
--- /dev/null
+++ b/tests/FunctionalTests/tickets/tests/Ticket595TestCase.php
@@ -0,0 +1,39 @@
+<?php
+
+class Ticket595TestCase extends SeleniumTestCase
+{
+	function test()
+	{
+		$base="ctl0_Content_";
+		$this->open('tickets/index.php?page=Ticket595');
+		$this->assertTitle("Verifying Ticket 595");
+		
+		$this->click($base.'ctl2');
+        $this->assertAttribute($base.'A@class','errorclassA');
+		
+		$this->type($base.'A', 'Prado');
+		$this->click($base.'ctl2');
+        $this->assertAttribute($base.'A@class','errorclassA');
+		
+		$this->type($base.'A', 'test@example.com');
+		$this->click($base.'ctl2');
+		$this->pause(800);
+        $this->assertAttribute($base.'A@class','');
+
+
+		$this->click($base.'ctl5');
+		$this->pause(800);
+        $this->assertAttribute($base.'B@class','errorclassB');
+		
+		$this->type($base.'B', 'Prado');
+		$this->click($base.'ctl5');
+		$this->pause(800);
+        $this->assertAttribute($base.'B@class','errorclassB');
+		
+		$this->type($base.'B', 'test@example.com');
+		$this->click($base.'ctl5');
+		$this->pause(800);
+        $this->assertAttribute($base.'B@class','');
+	}
+}
+?>
-- 
cgit v1.2.3