summaryrefslogtreecommitdiff
path: root/tests/FunctionalTests
diff options
context:
space:
mode:
authorxue <>2006-04-21 12:36:06 +0000
committerxue <>2006-04-21 12:36:06 +0000
commite392ecbf6e422825083bc7204eacb7090619a47c (patch)
tree8f2dcc8302f223ac2c71efd762417eddf84d62aa /tests/FunctionalTests
parentc54a230a5926086ff1b69a0dd7e6352dbc0b40ff (diff)
Merge from 3.0 branch till 953.
Diffstat (limited to 'tests/FunctionalTests')
-rw-r--r--tests/FunctionalTests/validators/protected/pages/CausesValidation.page11
-rw-r--r--tests/FunctionalTests/validators/protected/pages/CompareValidator.page31
-rw-r--r--tests/FunctionalTests/validators/protected/pages/CustomValidator.page26
-rw-r--r--tests/FunctionalTests/validators/protected/pages/CustomValidator.php14
-rw-r--r--tests/FunctionalTests/validators/protected/pages/RangeValidatorDate.page48
-rw-r--r--tests/FunctionalTests/validators/protected/pages/RangeValidatorFloat.page45
-rw-r--r--tests/FunctionalTests/validators/protected/pages/RangeValidatorInteger.page45
-rw-r--r--tests/FunctionalTests/validators/protected/pages/RangeValidatorString.page45
-rw-r--r--tests/FunctionalTests/validators/protected/pages/RegularExpressionValidator.page22
-rw-r--r--tests/FunctionalTests/validators/protected/pages/RequiredFieldValidator.page108
-rw-r--r--tests/FunctionalTests/validators/protected/pages/RequiredListValidator.page57
-rw-r--r--tests/FunctionalTests/validators/protected/pages/ValidationSummary.page83
-rw-r--r--tests/FunctionalTests/validators/tests/CompareValidatorTestCase.php47
-rw-r--r--tests/FunctionalTests/validators/tests/CustomValidatorTestCase.php31
-rw-r--r--tests/FunctionalTests/validators/tests/RangeValidatorTestCase.php167
-rw-r--r--tests/FunctionalTests/validators/tests/RegExpValidatorTestCase.php34
-rw-r--r--tests/FunctionalTests/validators/tests/RequiredFieldTestCase.php87
-rw-r--r--tests/FunctionalTests/validators/tests/RequiredListTestCase.php40
-rw-r--r--tests/FunctionalTests/validators/tests/ValidationSummaryTestCase.php50
19 files changed, 991 insertions, 0 deletions
diff --git a/tests/FunctionalTests/validators/protected/pages/CausesValidation.page b/tests/FunctionalTests/validators/protected/pages/CausesValidation.page
new file mode 100644
index 00000000..c6748b9a
--- /dev/null
+++ b/tests/FunctionalTests/validators/protected/pages/CausesValidation.page
@@ -0,0 +1,11 @@
+<com:TContent ID="Content">
+
+<h1>Test for CausesValidation="false"</h1>
+<div>
+<com:TTextBox ID="TestTextBox" />
+<com:TRequiredFieldValidator ID="TestRFValidator" ControlToValidate="TestTextBox" ErrorMessage="Field Required." />
+<com:TButton ID="TestButton" OnCommand="Page.onTest" Text="Test" CausesValidation="false" />
+<com:TLabel ID="Label1" />
+</div>
+
+</com:TContent> \ No newline at end of file
diff --git a/tests/FunctionalTests/validators/protected/pages/CompareValidator.page b/tests/FunctionalTests/validators/protected/pages/CompareValidator.page
new file mode 100644
index 00000000..679d2e8e
--- /dev/null
+++ b/tests/FunctionalTests/validators/protected/pages/CompareValidator.page
@@ -0,0 +1,31 @@
+<com:TContent ID="Content">
+<h1>Prado CompareValidator Tests</h1>
+<div>
+ <div>
+ <com:TTextBox ID="text1" />
+ <com:TTextBox ID="text2" />
+ <com:TCompareValidator
+ ID="validator1"
+ ControlToValidate="text1"
+ ControlToCompare="text2"
+ ErrorMessage="Must match"
+ ControlCssClass="required" />
+ </div>
+
+ <div>
+ <com:TTextBox ID="text3" />
+ <com:TCompareValidator
+ ID="validator2"
+ ControlToValidate="text3"
+ ValueToCompare="12/1/2005"
+ DataType="Date"
+ DateFormat="d/M/yyyy"
+ ErrorMessage="Must be a date 12/1/2005"
+ ControlCssClass="required" />
+ </div>
+
+ <com:TButton ID="submit1" Text="Test" />
+</div>
+
+
+</com:TContent> \ No newline at end of file
diff --git a/tests/FunctionalTests/validators/protected/pages/CustomValidator.page b/tests/FunctionalTests/validators/protected/pages/CustomValidator.page
new file mode 100644
index 00000000..2d0d490b
--- /dev/null
+++ b/tests/FunctionalTests/validators/protected/pages/CustomValidator.page
@@ -0,0 +1,26 @@
+<com:TContent ID="Content">
+<h1>Prado CustomValidator Tests</h1>
+
+<script type="text/javascript">
+var MyCustomValidator =
+{
+ validate : function(sender, value)
+ {
+ return value == "Prado";
+ }
+}
+</script>
+<div>
+ <com:TTextBox ID="text1" />
+ <com:TCustomValidator
+ ID="validator1"
+ ControlToValidate="text1"
+ ErrorMessage="Enter 'Prado'"
+ ControlCssClass="required"
+ ClientValidationFunction="MyCustomValidator.validate"
+ OnServerValidate="CustomValidation"
+ />
+ <com:TButton ID="submit1" Text="Test" />
+</div>
+
+</com:TContent> \ No newline at end of file
diff --git a/tests/FunctionalTests/validators/protected/pages/CustomValidator.php b/tests/FunctionalTests/validators/protected/pages/CustomValidator.php
new file mode 100644
index 00000000..ed1f9433
--- /dev/null
+++ b/tests/FunctionalTests/validators/protected/pages/CustomValidator.php
@@ -0,0 +1,14 @@
+<?php
+/*
+ * Created on 16/04/2006
+ */
+
+class CustomValidator extends TPage
+{
+ function CustomValidation($sender, $params)
+ {
+ $params->isValid = $this->text1->Text == "Prado";
+ }
+}
+
+?>
diff --git a/tests/FunctionalTests/validators/protected/pages/RangeValidatorDate.page b/tests/FunctionalTests/validators/protected/pages/RangeValidatorDate.page
new file mode 100644
index 00000000..f7f65460
--- /dev/null
+++ b/tests/FunctionalTests/validators/protected/pages/RangeValidatorDate.page
@@ -0,0 +1,48 @@
+<com:TContent ID="Content">
+<h1>Prado RangeValidator Tests Date</h1>
+<div>
+ <p>Dates between 22/1/2005 and 3/2/2005</p>
+ <div>
+ <com:TTextBox ID="text1" />
+ <com:TRangeValidator
+ ID="validator1"
+ ControlToValidate="text1"
+ ErrorMessage="Dates between 22/1/2005 and 3/2/2005"
+ MinValue="22/1/2005"
+ MaxValue="3/2/2005"
+ DataType="Date"
+ DateFormat="d/M/yyyy"
+ ControlCssClass="required" />
+ </div>
+ <p>Dates &gt;= 22/1/2005</p>
+ <div>
+ <com:TTextBox ID="text2" />
+ <com:TRangeValidator
+ ID="validator2"
+ ControlToValidate="text2"
+ ErrorMessage="Dates &gt;= 22/1/2005"
+ MinValue="22/1/2005"
+ DataType="Date"
+ DateFormat="d/M/yyyy"
+ ControlCssClass="required" />
+ </div>
+
+ <p>Dates &lt;= 3/2/2005</p>
+ <div>
+ <com:TTextBox ID="text3" />
+ <com:TRangeValidator
+ ID="validator3"
+ ControlToValidate="text3"
+ ErrorMessage="Dates &lt;= 3/2/2005"
+ MaxValue="3/2/2005"
+ DataType="Date"
+ DateFormat="d/M/yyyy"
+ ControlCssClass="required" />
+ </div>
+
+ <com:TButton ID="submit1"Text="Test" />
+</div>
+
+
+
+</com:TContent> \ No newline at end of file
diff --git a/tests/FunctionalTests/validators/protected/pages/RangeValidatorFloat.page b/tests/FunctionalTests/validators/protected/pages/RangeValidatorFloat.page
new file mode 100644
index 00000000..18c476c7
--- /dev/null
+++ b/tests/FunctionalTests/validators/protected/pages/RangeValidatorFloat.page
@@ -0,0 +1,45 @@
+<com:TContent ID="Content">
+<h1>Prado RangeValidator Tests Float</h1>
+<div>
+ <p>Float between 1.4 and 4.4</p>
+ <div>
+ <com:TTextBox ID="text1" />
+ <com:TRangeValidator
+ ID="validator1"
+ ControlToValidate="text1"
+ ErrorMessage="Numbers between 1.4 and 4.4"
+ MinValue="1.4"
+ MaxValue="4.4"
+ DataType="Float"
+ ControlCssClass="required" />
+ </div>
+ <p>Float &gt;= 2.2</p>
+ <div>
+ <com:TTextBox ID="text2" />
+ <com:TRangeValidator
+ ID="validator2"
+ ControlToValidate="text2"
+ ErrorMessage="Numbers &gt;= 2.2"
+ MinValue="2.2"
+ DataType="Float"
+ ControlCssClass="required" />
+ </div>
+
+ <p>Float &lt;= 20.2</p>
+ <div>
+ <com:TTextBox ID="text3" />
+ <com:TRangeValidator
+ ID="validator3"
+ ControlToValidate="text3"
+ ErrorMessage="Numbers &lt;= 20.2"
+ MaxValue="20.2"
+ DataType="Float"
+ ControlCssClass="required" />
+ </div>
+
+ <com:TButton ID="submit1"Text="Test" />
+</div>
+
+
+
+</com:TContent> \ No newline at end of file
diff --git a/tests/FunctionalTests/validators/protected/pages/RangeValidatorInteger.page b/tests/FunctionalTests/validators/protected/pages/RangeValidatorInteger.page
new file mode 100644
index 00000000..922236e5
--- /dev/null
+++ b/tests/FunctionalTests/validators/protected/pages/RangeValidatorInteger.page
@@ -0,0 +1,45 @@
+<com:TContent ID="Content">
+<h1>Prado RangeValidator Tests Integer</h1>
+<div>
+ <p>Integers between 1 and 4</p>
+ <div>
+ <com:TTextBox ID="text1" />
+ <com:TRangeValidator
+ ID="validator1"
+ ControlToValidate="text1"
+ ErrorMessage="Numbers between 1 and 4"
+ MinValue="1"
+ MaxValue="4"
+ DataType="Integer"
+ ControlCssClass="required" />
+ </div>
+ <p>Integers &gt;= 2</p>
+ <div>
+ <com:TTextBox ID="text2" />
+ <com:TRangeValidator
+ ID="validator2"
+ ControlToValidate="text2"
+ ErrorMessage="Numbers &gt;= 2"
+ MinValue="2"
+ DataType="Integer"
+ ControlCssClass="required" />
+ </div>
+
+ <p>Integers &lt;= 20</p>
+ <div>
+ <com:TTextBox ID="text3" />
+ <com:TRangeValidator
+ ID="validator3"
+ ControlToValidate="text3"
+ ErrorMessage="Numbers &lt;= 20"
+ MaxValue="20"
+ DataType="Integer"
+ ControlCssClass="required" />
+ </div>
+
+ <com:TButton ID="submit1" Text="Test" />
+</div>
+
+
+
+</com:TContent> \ No newline at end of file
diff --git a/tests/FunctionalTests/validators/protected/pages/RangeValidatorString.page b/tests/FunctionalTests/validators/protected/pages/RangeValidatorString.page
new file mode 100644
index 00000000..64e596d6
--- /dev/null
+++ b/tests/FunctionalTests/validators/protected/pages/RangeValidatorString.page
@@ -0,0 +1,45 @@
+<com:TContent ID="Content">
+<h1>Prado RangeValidator Tests String</h1>
+<div>
+ <p>Strings between 'd' and 'y'</p>
+ <div>
+ <com:TTextBox ID="text1" />
+ <com:TRangeValidator
+ ID="validator1"
+ ControlToValidate="text1"
+ ErrorMessage="Strings between 'd' and 'y'"
+ MinValue="d"
+ MaxValue="y"
+ DataType="String"
+ ControlCssClass="required" />
+ </div>
+ <p>Strings &gt;= 'd'</p>
+ <div>
+ <com:TTextBox ID="text2" />
+ <com:TRangeValidator
+ ID="validator2"
+ ControlToValidate="text2"
+ ErrorMessage="Strings &gt;= 'd'"
+ MinValue="d"
+ DataType="String"
+ ControlCssClass="required" />
+ </div>
+
+ <p>Strings &lt;= 'y'</p>
+ <div>
+ <com:TTextBox ID="text3" />
+ <com:TRangeValidator
+ ID="validator3"
+ ControlToValidate="text3"
+ ErrorMessage="Strings &lt;= 'y'"
+ MaxValue="y"
+ DataType="String"
+ ControlCssClass="required" />
+ </div>
+
+ <com:TButton ID="submit1"Text="Test" />
+</div>
+
+
+
+</com:TContent> \ No newline at end of file
diff --git a/tests/FunctionalTests/validators/protected/pages/RegularExpressionValidator.page b/tests/FunctionalTests/validators/protected/pages/RegularExpressionValidator.page
new file mode 100644
index 00000000..ac24cd0d
--- /dev/null
+++ b/tests/FunctionalTests/validators/protected/pages/RegularExpressionValidator.page
@@ -0,0 +1,22 @@
+<com:TContent ID="Content">
+<h1>Prado RegularExpressionValidator Tests</h1>
+<div>
+ <div>
+ <com:TTextBox ID="text1" />
+ <com:TRegularExpressionValidator
+ ID="validator1"
+ ControlToValidate="text1"
+ ErrorMessage="5 digits"
+ RegularExpression="\d{5}"
+ ControlCssClass="required" />
+ <com:TTextBox ID="text2" />
+ <com:TEmailAddressValidator
+ ID="validator2"
+ ControlToValidate="text2"
+ ErrorMessage="Email Address!"
+ ControlCssClass="required" />
+ </div>
+ <com:TButton ID="submit1" Text="Test" />
+</div>
+
+</com:TContent> \ No newline at end of file
diff --git a/tests/FunctionalTests/validators/protected/pages/RequiredFieldValidator.page b/tests/FunctionalTests/validators/protected/pages/RequiredFieldValidator.page
new file mode 100644
index 00000000..f8a1c4ca
--- /dev/null
+++ b/tests/FunctionalTests/validators/protected/pages/RequiredFieldValidator.page
@@ -0,0 +1,108 @@
+<com:TContent ID="Content">
+<h1>RequiredFieldValidator Tests</h1>
+<div>
+<!-- group 1 -->
+<com:TValidationSummary ID="summary1" ValidationGroup="group1" AutoUpdate="False" />
+<div>
+ <com:TTextBox ID="text1" />
+ <com:TRequiredFieldValidator
+ ID="validator1"
+ ControlToValidate="text1"
+ ControlCssClass="required"
+ Display="Dynamic"
+ CssClass="message"
+ ValidationGroup="group1"
+ ErrorMessage="text1!"/>
+
+ <com:TCheckBox ID="check1" />
+ <com:TRequiredFieldValidator
+ ID="validator2"
+ ControlToValidate="check1"
+ ControlCssClass="required"
+ Display="Dynamic"
+ CssClass="message"
+ ValidationGroup="group1"
+ ErrorMessage="check 1!" />
+ <com:TButton ID="submit1" Text="Group1" ValidationGroup="group1" />
+</div>
+<!-- group 2 -->
+<com:TValidationSummary ID="summary2" ValidationGroup="group2" />
+<div>
+ <com:TTextBox ID="text2" />
+ <com:TRequiredFieldValidator
+ ID="validator3"
+ ControlToValidate="text2"
+ ControlCssClass="required"
+ CssClass="message"
+ ValidationGroup="group2"
+ ErrorMessage="text2!"/>
+
+ <com:TCheckBox ID="check2" />
+ <com:TRequiredFieldValidator
+ ID="validator4"
+ ControlToValidate="check2"
+ ControlCssClass="required"
+ CssClass="message"
+ ValidationGroup="group2"
+ ErrorMessage="check 2!" />
+ <com:TButton ID="submit2" Text="Group2" ValidationGroup="group2"/>
+</div>
+
+<!-- no group -->
+<com:TValidationSummary ID="summary3" />
+
+<div>
+ <com:TTextBox ID="text3" />
+ <com:TRequiredFieldValidator
+ ID="validator5"
+ ControlToValidate="text3"
+ ControlCssClass="required"
+ CssClass="message"
+ ErrorMessage="text3!"/>
+
+ <com:TCheckBox ID="check3" />
+ <com:TRequiredFieldValidator
+ ID="validator6"
+ ControlToValidate="check3"
+ ControlCssClass="required"
+ CssClass="message"
+ ErrorMessage="check 3!" />
+</div>
+<div>
+ <com:TTextBox ID="text4" />
+ <com:TRequiredFieldValidator
+ ID="validator7"
+ ControlToValidate="text4"
+ ControlCssClass="required"
+ CssClass="message"
+ ErrorMessage="text4!"/>
+
+ <com:TCheckBox ID="check4" />
+ <com:TRequiredFieldValidator
+ ID="validator8"
+ ControlToValidate="check4"
+ ControlCssClass="required"
+ CssClass="message"
+ ErrorMessage="check 4!" />
+
+</div>
+ <com:TButton ID="submit3" Text="No Group" />
+
+
+
+<com:TButton ID="submit4" Text="Submit By Pass" CausesValidation="False" />
+
+</div>
+
+<div><h2>InitialValue Test</h2>
+ <com:TTextBox id="text5" Text="test"/>
+ <com:TRequiredFieldValidator
+ id="validator9"
+ ValidationGroup="group4"
+ ControlToValidate="text5"
+ InitialValue="test"
+ ErrorMessage="change 'test' to something else" />
+ <com:TButton id="submit5" Text="initial value" ValidationGroup="group4" />
+</div>
+
+</com:TContent> \ No newline at end of file
diff --git a/tests/FunctionalTests/validators/protected/pages/RequiredListValidator.page b/tests/FunctionalTests/validators/protected/pages/RequiredListValidator.page
new file mode 100644
index 00000000..9bbd9d5a
--- /dev/null
+++ b/tests/FunctionalTests/validators/protected/pages/RequiredListValidator.page
@@ -0,0 +1,57 @@
+<com:TContent ID="Content">
+
+<div>
+ <div class="lista">
+ <com:TCheckBoxList ID="list1">
+ <com:TListItem Value="1" Text="One" />
+ <com:TListItem Value="2" Text="Two" />
+ <com:TListItem Value="3" Text="Three" />
+ <com:TListItem Value="4" Text="Four" />
+ </com:TCheckBoxList>
+ <com:TRequiredListValidator
+ ID="validator1"
+ ControlToValidate="list1"
+ ErrorMessage="Must select at least 1 and no more than 3"
+ ControlCssClass="required"
+ MinSelection="1"
+ MaxSelection="3" />
+
+ </div>
+ <div>
+ <com:TListBox ID="list2" SelectionMode="Multiple" Rows="5" Style="width:10em">
+ <com:TListItem Value="1" Text="One" />
+ <com:TListItem Value="2" Text="Two" />
+ <com:TListItem Value="3" Text="Three" />
+ <com:TListItem Value="4" Text="Four" />
+ <com:TListItem Value="5" Text="Five" />
+ </com:TListBox>
+ <com:TRequiredListValidator
+ ID="validator2"
+ ControlToValidate="list2"
+ ErrorMessage='Must select at least 2 and no more than 3 and value "two"'
+ MinSelection="2"
+ MaxSelection="3"
+ RequiredSelections="2" />
+ </div>
+
+ <div class="lista">
+ <com:TCheckBoxList ID="list3">
+ <com:TListItem Value="1" Text="One" />
+ <com:TListItem Value="2" Text="Two" />
+ <com:TListItem Value="3" Text="Three" />
+ <com:TListItem Value="4" Text="Four" />
+ </com:TCheckBoxList>
+ <com:TRequiredListValidator
+ ID="validator3"
+ ControlToValidate="list3"
+ ErrorMessage="Must select at least 1"
+ ControlCssClass="required"
+ MinSelection="1"/>
+
+ </div>
+
+
+ <com:TButton ID="submit1" Text="Test" />
+</div>
+
+</com:TContent> \ No newline at end of file
diff --git a/tests/FunctionalTests/validators/protected/pages/ValidationSummary.page b/tests/FunctionalTests/validators/protected/pages/ValidationSummary.page
new file mode 100644
index 00000000..d260a93a
--- /dev/null
+++ b/tests/FunctionalTests/validators/protected/pages/ValidationSummary.page
@@ -0,0 +1,83 @@
+<com:TContent ID="Content">
+
+<h1>Validation Summary Test</h1>
+<fieldset id="quickRegistration">
+ <legend>Create New Account</legend>
+
+<div class="username">
+ Username:
+ <com:TTextBox ID="Username" />
+ <com:TRequiredFieldValidator
+ ID="UsernameVal"
+ ControlToValidate="Username"
+ Display="None"
+ ValidationGroup="registration"
+ ErrorMessage="a username is required." />
+</div>
+<div class="password">
+ Password
+ <com:TTextBox ID="Password" TextMode="Password" />
+</div>
+<com:TRequiredFieldValidator
+ ID="PasswordVal"
+ ControlToValidate="Password"
+ Display="None"
+ ValidationGroup="registration"
+ ErrorMessage="a password is required." />
+
+<div class="create">
+ <com:TButton ID="Create" ValidationGroup="registration" Text="Create New Account"/>
+</div>
+
+<div class="registrationSummary">
+ <com:TValidationSummary
+ ID="summary1"
+ ValidationGroup="registration"
+ AutoUpdate="false"
+ HeaderText="<p>Unable to create new account because</p>" />
+</div>
+
+</fieldset>
+
+
+<fieldset id="LoginForm">
+ <legend>Sign In</legend>
+
+<div class="username">
+ Login Name:
+ <com:TTextBox ID="UserID" />
+
+ <com:TRequiredFieldValidator
+ ID="UserVal1"
+ ControlToValidate="UserID"
+ Display="None"
+ ValidationGroup="signin"
+ ErrorMessage="the username or email was not provided" />
+</div>
+
+<div class="password" >
+ Password:
+ <com:TTextBox ID="Pass" TextMode="Password" />
+ <com:TRequiredFieldValidator
+ ID="loginValidator3"
+ ControlToValidate="Pass"
+ Display="None"
+ ValidationGroup="signin"
+ ErrorMessage="the password was not provided" />
+</div>
+
+
+<com:TButton ID="login" ValidationGroup="signin" CssClass="button" Text="Sign In" />
+
+<div class="validation">
+ <com:TValidationSummary
+ ID="summary2"
+ ValidationGroup="signin"
+ AutoUpdate="false"
+ HeaderText="<p>You could not login because</p>" />
+</div>
+
+</fieldset>
+
+
+</com:TContent> \ No newline at end of file
diff --git a/tests/FunctionalTests/validators/tests/CompareValidatorTestCase.php b/tests/FunctionalTests/validators/tests/CompareValidatorTestCase.php
new file mode 100644
index 00000000..5107a89f
--- /dev/null
+++ b/tests/FunctionalTests/validators/tests/CompareValidatorTestCase.php
@@ -0,0 +1,47 @@
+<?php
+
+//New Test
+class CompareValidatorTestCase extends SeleniumTestCase
+{
+ function test()
+ {
+ $base = "ctl0_Content_";
+
+ $this->open("validators/index.php?page=CompareValidator", "");
+ $this->verifyTextPresent("Prado CompareValidator Tests", "");
+
+ $this->type("{$base}text1", "qwe");
+ $this->assertNotVisible("{$base}validator1");
+ $this->assertNotVisible("{$base}validator2");
+
+ $this->click("//input[@type='submit' and @value='Test']", "");
+
+ $this->type("{$base}text2", "1234");
+ $this->click("//input[@type='submit' and @value='Test']", "");
+ $this->assertVisible("{$base}validator1");
+
+ $this->type("{$base}text2", "qwe");
+ $this->assertNotVisible("{$base}validator1");
+ $this->clickAndWait("//input[@type='submit' and @value='Test']", "");
+ $this->assertNotVisible("{$base}validator1");
+ $this->assertNotVisible("{$base}validator2");
+
+
+ $this->type("{$base}text3", "12312");
+ $this->click("//input[@type='submit' and @value='Test']", "");
+ $this->assertVisible("{$base}validator2");
+
+ $this->type("{$base}text3", "13/1/2005");
+ $this->assertVisible("{$base}validator2");
+
+
+ $this->type("{$base}text3", "12/1/2005");
+ $this->clickAndWait("//input[@type='submit' and @value='Test']", "");
+
+ $this->assertNotVisible("{$base}validator1");
+ $this->assertNotVisible("{$base}validator2");
+
+ }
+}
+
+?> \ No newline at end of file
diff --git a/tests/FunctionalTests/validators/tests/CustomValidatorTestCase.php b/tests/FunctionalTests/validators/tests/CustomValidatorTestCase.php
new file mode 100644
index 00000000..3a5daa6a
--- /dev/null
+++ b/tests/FunctionalTests/validators/tests/CustomValidatorTestCase.php
@@ -0,0 +1,31 @@
+<?php
+
+//New Test
+class CustomValidatorTestCase extends SeleniumTestCase
+{
+ function test()
+ {
+ $base = "ctl0_Content_";
+ $this->open("validators/index.php?page=CustomValidator", "");
+ $this->assertTextPresent("Prado CustomValidator Tests", "");
+ $this->assertNotVisible("{$base}validator1");
+
+ $this->click("//input[@type='submit' and @value='Test']", "");
+ $this->assertVisible("{$base}validator1");
+
+ $this->type("{$base}text1", "Prado");
+ $this->pause(250);
+ $this->assertNotVisible("{$base}validator1");
+ $this->type("{$base}text1", "Testing");
+ $this->pause(250);
+ $this->assertVisible("{$base}validator1");
+ $this->type("{$base}text1", "Prado");
+ $this->pause(250);
+ $this->assertNotVisible("{$base}validator1");
+ $this->clickAndWait("//input[@type='submit' and @value='Test']", "");
+ $this->assertNotVisible("{$base}validator1");
+
+ }
+}
+
+?> \ No newline at end of file
diff --git a/tests/FunctionalTests/validators/tests/RangeValidatorTestCase.php b/tests/FunctionalTests/validators/tests/RangeValidatorTestCase.php
new file mode 100644
index 00000000..69d4cc07
--- /dev/null
+++ b/tests/FunctionalTests/validators/tests/RangeValidatorTestCase.php
@@ -0,0 +1,167 @@
+<?php
+
+//New Test
+class RangeValidatorTestCase extends SeleniumTestCase
+{
+ function testIntegerRange()
+ {
+ $base = "ctl0_Content_";
+ $this->open("validators/index.php?page=RangeValidatorInteger", "");
+ $this->verifyTextPresent("Prado RangeValidator Tests Integer", "");
+
+ //between 1 and 4
+ $this->type("{$base}text1", "ad");
+ $this->assertNotVisible("{$base}validator1", "");
+ $this->click("//input[@type='submit' and @value='Test']", "");
+ $this->assertVisible("{$base}validator1", "");
+ $this->type("{$base}text1", "12");
+ $this->click("//input[@type='submit' and @value='Test']", "");
+ $this->assertVisible("{$base}validator1", "");
+ $this->type("{$base}text1", "2");
+ $this->assertNotVisible("{$base}validator1", "");
+ $this->clickAndWait("//input[@type='submit' and @value='Test']", "");
+ $this->assertNotVisible("{$base}validator1", "");
+
+
+ // >= 2
+ $this->assertNotVisible("{$base}validator2", "");
+ $this->type("{$base}text2", "1");
+ $this->click("//input[@type='submit' and @value='Test']", "");
+ $this->assertVisible("{$base}validator2", "");
+ $this->type("{$base}text2", "10");
+ $this->clickAndWait("//input[@type='submit' and @value='Test']", "");
+ $this->assertNotVisible("{$base}validator2", "");
+
+ // <= 20
+ $this->assertNotVisible("{$base}validator3", "");
+ $this->type("{$base}text3", "100");
+ $this->click("//input[@type='submit' and @value='Test']", "");
+ $this->assertVisible("{$base}validator3", "");
+ $this->type("{$base}text3", "10");
+ $this->clickAndWait("//input[@type='submit' and @value='Test']", "");
+ $this->assertNotVisible("{$base}validator3", "");
+
+ }
+
+ function testFloatRange()
+ {
+ $base = "ctl0_Content_";
+ $this->open("validators/index.php?page=RangeValidatorFloat", "");
+ $this->verifyTextPresent("Prado RangeValidator Tests Float", "");
+
+ //between 1 and 4
+ $this->type("{$base}text1", "ad");
+ $this->assertNotVisible("{$base}validator1", "");
+ $this->click("//input[@type='submit' and @value='Test']", "");
+ $this->assertVisible("{$base}validator1", "");
+ $this->type("{$base}text1", "12");
+ $this->click("//input[@type='submit' and @value='Test']", "");
+ $this->assertVisible("{$base}validator1", "");
+ $this->type("{$base}text1", "2");
+ $this->assertNotVisible("{$base}validator1", "");
+ $this->clickAndWait("//input[@type='submit' and @value='Test']", "");
+ $this->assertNotVisible("{$base}validator1", "");
+
+
+ // >= 2
+ $this->assertNotVisible("{$base}validator2", "");
+ $this->type("{$base}text2", "1");
+ $this->click("//input[@type='submit' and @value='Test']", "");
+ $this->assertVisible("{$base}validator2", "");
+ $this->type("{$base}text2", "10");
+ $this->clickAndWait("//input[@type='submit' and @value='Test']", "");
+ $this->assertNotVisible("{$base}validator2", "");
+
+ // <= 20
+ $this->assertNotVisible("{$base}validator3", "");
+ $this->type("{$base}text3", "100");
+ $this->click("//input[@type='submit' and @value='Test']", "");
+ $this->assertVisible("{$base}validator3", "");
+ $this->type("{$base}text3", "10");
+ $this->clickAndWait("//input[@type='submit' and @value='Test']", "");
+ $this->assertNotVisible("{$base}validator3", "");
+ }
+
+ function testDateRange()
+ {
+ $base = "ctl0_Content_";
+ $this->open("validators/index.php?page=RangeValidatorDate", "");
+ $this->verifyTextPresent("Prado RangeValidator Tests Date", "");
+
+ //between 22/1/2005 and 3/2/2005
+ $this->type("{$base}text1", "ad");
+ $this->assertNotVisible("{$base}validator1", "");
+ $this->click("//input[@type='submit' and @value='Test']", "");
+ $this->assertVisible("{$base}validator1", "");
+ $this->type("{$base}text1", "27/2/2005");
+ $this->click("//input[@type='submit' and @value='Test']", "");
+ $this->assertVisible("{$base}validator1", "");
+ $this->type("{$base}text1", "1/2/2005");
+ $this->click("//input[@type='submit' and @value='Test']", "");
+ $this->assertNotVisible("{$base}validator1", "");
+ $this->clickAndWait("//input[@type='submit' and @value='Test']", "");
+ $this->assertNotVisible("{$base}validator1", "");
+
+
+ // >= 22/1/2005
+ $this->assertNotVisible("{$base}validator2", "");
+ $this->type("{$base}text2", "1/1/2005");
+ $this->click("//input[@type='submit' and @value='Test']", "");
+ $this->pause(250);
+ $this->assertVisible("{$base}validator2", "");
+ $this->type("{$base}text2", "1/4/2005");
+ $this->clickAndWait("//input[@type='submit' and @value='Test']", "");
+ $this->assertNotVisible("{$base}validator2", "");
+
+ // <= 3/2/2005
+ $this->assertNotVisible("{$base}validator3", "");
+ $this->type("{$base}text3", "4/5/2005");
+ $this->click("//input[@type='submit' and @value='Test']", "");
+ $this->pause(250);
+ $this->assertVisible("{$base}validator3", "");
+ $this->type("{$base}text3", "1/2/2005");
+ $this->clickAndWait("//input[@type='submit' and @value='Test']", "");
+ $this->assertNotVisible("{$base}validator3", "");
+ }
+
+ function testStringRange()
+ {
+ $base = "ctl0_Content_";
+ $this->open("validators/index.php?page=RangeValidatorString", "");
+ $this->verifyTextPresent("Prado RangeValidator Tests String", "");
+
+ //between 'd' and 'y'
+ $this->type("{$base}text1", "a");
+ $this->assertNotVisible("{$base}validator1", "");
+ $this->click("//input[@type='submit' and @value='Test']", "");
+ $this->assertVisible("{$base}validator1", "");
+ $this->type("{$base}text1", "b");
+ $this->click("//input[@type='submit' and @value='Test']", "");
+ $this->assertVisible("{$base}validator1", "");
+ $this->type("{$base}text1", "f");
+ $this->assertNotVisible("{$base}validator1", "");
+ $this->clickAndWait("//input[@type='submit' and @value='Test']", "");
+ $this->assertNotVisible("{$base}validator1", "");
+
+
+ // >= 'd'
+ $this->assertNotVisible("{$base}validator2", "");
+ $this->type("{$base}text2", "a");
+ $this->click("//input[@type='submit' and @value='Test']", "");
+ $this->assertVisible("{$base}validator2", "");
+ $this->type("{$base}text2", "g");
+ $this->clickAndWait("//input[@type='submit' and @value='Test']", "");
+ $this->assertNotVisible("{$base}validator2", "");
+
+ // <= 'y'
+ $this->assertNotVisible("{$base}validator3", "");
+ $this->type("{$base}text3", "z");
+ $this->click("//input[@type='submit' and @value='Test']", "");
+ $this->assertVisible("{$base}validator3", "");
+ $this->type("{$base}text3", "t");
+ $this->clickAndWait("//input[@type='submit' and @value='Test']", "");
+ $this->assertNotVisible("{$base}validator3", "");
+ }
+}
+
+?> \ No newline at end of file
diff --git a/tests/FunctionalTests/validators/tests/RegExpValidatorTestCase.php b/tests/FunctionalTests/validators/tests/RegExpValidatorTestCase.php
new file mode 100644
index 00000000..751ab80a
--- /dev/null
+++ b/tests/FunctionalTests/validators/tests/RegExpValidatorTestCase.php
@@ -0,0 +1,34 @@
+<?php
+
+//New Test
+class RegExpValidatorTestCase extends SeleniumTestCase
+{
+ function test()
+ {
+ $base = "ctl0_Content_";
+ $this->open("validators/index.php?page=RegularExpressionValidator", "");
+ $this->verifyTextPresent("Prado RegularExpressionValidator Tests", "");
+ $this->assertNotVisible("{$base}validator1", "");
+ $this->assertNotVisible("{$base}validator2", "");
+ $this->type("{$base}text1", "1");
+ $this->type("{$base}text2", "2");
+ $this->click("//input[@type='submit' and @value='Test']", "");
+ $this->assertVisible("{$base}validator1", "");
+ $this->assertVisible("{$base}validator2", "");
+ $this->type("{$base}text1", "asdasd");
+ $this->click("//input[@type='submit' and @value='Test']", "");
+ $this->assertVisible("{$base}validator1", "");
+ $this->type("{$base}text1", "12345");
+ $this->assertNotVisible("{$base}validator1", "");
+ $this->assertVisible("{$base}validator2", "");
+ $this->type("{$base}text2", "wei@gmail.com");
+ $this->assertNotVisible("{$base}validator1", "");
+ $this->assertNotVisible("{$base}validator2", "");
+ $this->clickAndWait("//input[@type='submit' and @value='Test']", "");
+ $this->assertNotVisible("{$base}validator1", "");
+ $this->assertNotVisible("{$base}validator2", "");
+
+ }
+}
+
+?> \ No newline at end of file
diff --git a/tests/FunctionalTests/validators/tests/RequiredFieldTestCase.php b/tests/FunctionalTests/validators/tests/RequiredFieldTestCase.php
new file mode 100644
index 00000000..41372b93
--- /dev/null
+++ b/tests/FunctionalTests/validators/tests/RequiredFieldTestCase.php
@@ -0,0 +1,87 @@
+<?php
+
+class RequiredFieldTestCase extends SeleniumTestCase
+{
+ function test()
+ {
+ $base = "ctl0_Content_";
+ $this->open("validators/index.php?page=RequiredFieldValidator");
+ $this->assertTextPresent("RequiredFieldValidator Tests");
+ $this->assertNotVisible("{$base}validator1");
+ $this->assertNotVisible("{$base}validator2");
+ $this->click("{$base}submit1");
+ $this->assertVisible("{$base}validator1");
+ $this->assertVisible("{$base}validator2");
+ $this->type("{$base}text1", "testing");
+ $this->click("{$base}submit1");
+ $this->assertNotVisible("{$base}validator1");
+ $this->click("{$base}submit2");
+ $this->assertNotVisible("{$base}validator1");
+ $this->assertNotVisible("{$base}validator2");
+ $this->assertVisible("{$base}validator3");
+ $this->assertVisible("{$base}validator4");
+ $this->type("{$base}text2", "testing2");
+ $this->click("{$base}submit2");
+ $this->assertNotVisible("{$base}validator3");
+ $this->click("{$base}submit3");
+ $this->assertVisible("{$base}summary3");
+ $this->clickAndWait("{$base}submit4");
+ $this->assertNotVisible("{$base}validator1");
+ $this->assertNotVisible("{$base}validator2");
+ $this->assertNotVisible("{$base}validator3");
+ $this->assertNotVisible("{$base}validator4");
+ $this->click("{$base}submit1");
+ $this->assertVisible("{$base}validator2");
+ $this->click("{$base}check1");
+ $this->click("{$base}submit2");
+ $this->assertVisible("{$base}validator4");
+ $this->clickAndWait("{$base}submit1");
+ $this->assertNotVisible("{$base}validator1");
+ $this->assertNotVisible("{$base}validator2");
+ $this->type("{$base}text1");
+ $this->click("{$base}check1");
+ $this->click("{$base}submit1");
+ $this->assertVisible("{$base}validator1");
+ $this->assertVisible("{$base}validator2");
+ $this->click("{$base}check2");
+ $this->clickAndWait("{$base}submit2");
+
+ $this->type("{$base}text1", "Hello");
+ $this->click("{$base}check1");
+ $this->click("{$base}submit2");
+
+ $this->assertNotVisible("{$base}validator5");
+ $this->assertNotVisible("{$base}validator6");
+ $this->assertNotVisible("{$base}validator7");
+ $this->assertNotVisible("{$base}validator8");
+ $this->type("{$base}text1");
+ $this->type("{$base}text2");
+ $this->click("{$base}check1");
+ $this->click("{$base}check2");
+ $this->click("{$base}submit3");
+ $this->assertVisible("{$base}validator5");
+ $this->assertVisible("{$base}validator6");
+ $this->assertVisible("{$base}validator7");
+ $this->assertVisible("{$base}validator8");
+ $this->clickAndWait("{$base}submit4");
+ $this->assertNotVisible("{$base}validator5");
+ $this->assertNotVisible("{$base}validator6");
+ $this->assertNotVisible("{$base}validator7");
+ $this->assertNotVisible("{$base}validator8");
+ }
+
+ function testInitialValue()
+ {
+ $base = "ctl0_Content_";
+ $this->open("validators/index.php?page=RequiredFieldValidator");
+ $this->assertTextPresent("InitialValue Test");
+ $this->assertNotVisible("{$base}validator9");
+ $this->click("{$base}submit5");
+ $this->pause(250);
+ $this->assertVisible("{$base}validator9");
+ $this->type("{$base}text5", "adasd");
+ $this->pause(250);
+ $this->assertNotVisible("{$base}validator9");
+ }
+}
+?> \ No newline at end of file
diff --git a/tests/FunctionalTests/validators/tests/RequiredListTestCase.php b/tests/FunctionalTests/validators/tests/RequiredListTestCase.php
new file mode 100644
index 00000000..1eab60d4
--- /dev/null
+++ b/tests/FunctionalTests/validators/tests/RequiredListTestCase.php
@@ -0,0 +1,40 @@
+<?php
+
+class RequiredListTestCase extends SeleniumTestCase
+{
+
+ function test()
+ {
+ $this->open("validators/index.php?page=RequiredListValidator");
+ $this->assertLocation("index.php?page=RequiredListValidator");
+ $this->click("submit1");
+ $this->assertVisible("validator1");
+ $this->assertVisible("validator2");
+ $this->assertVisible("validator3");
+ $this->click("list1:0");
+ $this->select("list2", "label=One");
+ $this->select("list2", "label=Two");
+ $this->click("list3:3");
+ $this->clickAndWait("submit1");
+ $this->assertNotVisible("validator1");
+ $this->assertNotVisible("validator2");
+ $this->assertNotVisible("validator3");
+ $this->click("list1:1");
+ $this->click("list1:2");
+ $this->click("list1:3");
+ $this->select("list2", "label=Two");
+ $this->click("list1:3");
+ $this->click("submit1");
+ $this->assertNotVisible("validator1");
+ $this->assertNotVisible("validator2");
+ $this->assertNotVisible("validator3");
+ $this->click("list3:3");
+ $this->click("submit1");
+ $this->pause(200);
+ $this->assertNotVisible("validator1");
+ $this->assertNotVisible("validator2");
+ $this->assertVisible("validator3");
+ }
+}
+
+?> \ No newline at end of file
diff --git a/tests/FunctionalTests/validators/tests/ValidationSummaryTestCase.php b/tests/FunctionalTests/validators/tests/ValidationSummaryTestCase.php
new file mode 100644
index 00000000..3b6225f3
--- /dev/null
+++ b/tests/FunctionalTests/validators/tests/ValidationSummaryTestCase.php
@@ -0,0 +1,50 @@
+<?php
+
+//New Test
+class ValidationSummaryTestCase extends SeleniumTestCase
+{
+ function test()
+ {
+ $base = "ctl0_Content_";
+
+ $this->open("validators/index.php?page=ValidationSummary", "");
+ $this->verifyTextPresent("Validation Summary Test", "");
+ //$this->verifyText("{$base}summary1", "");
+ //$this->verifyText("{$base}summary2", "");
+
+ $this->click("//input[@type='submit' and @value='Create New Account']", "");
+ $this->assertVisible("{$base}summary1");
+ $this->assertNotVisible("{$base}summary2");
+
+ $this->click("//input[@type='submit' and @value='Sign In']", "");
+ $this->assertNotVisible("{$base}summary1");
+ $this->assertVisible("{$base}summary2");
+
+ $this->type("{$base}Username", "qwe");
+ $this->type("{$base}Password", "ewwq");
+ $this->click("//input[@type='submit' and @value='Sign In']", "");
+ $this->assertNotVisible("{$base}summary1");
+ $this->assertVisible("{$base}summary2");
+
+ /*$this->clickAndWait("//input[@type='submit' and @value='Create New Account']", "");
+ $this->type("{$base}UserID", "123");
+ $this->type("{$base}Pass", "123");
+ $this->clickAndWait("//input[@type='submit' and @value='Sign In']", "");
+ //$this->verifyText("{$base}summary1", "");
+ //$this->verifyText("{$base}summary2", "");
+ $this->clickAndWait("//input[@type='submit' and @value='Create New Account']", "");
+ //$this->verifyText("{$base}summary1", "");
+ //$this->verifyText("{$base}summary2", "");
+
+ $this->type("{$base}Password", "");
+ $this->click("//input[@type='submit' and @value='Create New Account']", "");
+ $this->assertVisible("{$base}summary1");
+ $this->assertNotVisible("{$base}summary2");
+
+ $this->type("{$base}Password", "12312");
+ $this->assertVisible("{$base}summary1");
+ */
+ }
+}
+
+?> \ No newline at end of file