summaryrefslogtreecommitdiff
path: root/tests/FunctionalTests/validators
diff options
context:
space:
mode:
authorxue <>2006-04-16 18:02:31 +0000
committerxue <>2006-04-16 18:02:31 +0000
commit9db90898be134c9f70c0b334ec071223e60ed76c (patch)
treec499036f6ca4b350b3f4ae48b0d55cf8308b385d /tests/FunctionalTests/validators
parentfc38326ea80e73717fb1d187a16421f7bc1b1b04 (diff)
Merge from 3.0 branch till 924
Diffstat (limited to 'tests/FunctionalTests/validators')
-rw-r--r--tests/FunctionalTests/validators/index.php8
-rw-r--r--tests/FunctionalTests/validators/protected/pages/Button.page37
-rw-r--r--tests/FunctionalTests/validators/protected/pages/Button.php27
-rw-r--r--tests/FunctionalTests/validators/protected/pages/CheckBox.page40
-rw-r--r--tests/FunctionalTests/validators/protected/pages/CheckBox.php27
-rw-r--r--tests/FunctionalTests/validators/protected/pages/ImageButton.page37
-rw-r--r--tests/FunctionalTests/validators/protected/pages/ImageButton.php27
-rw-r--r--tests/FunctionalTests/validators/protected/pages/Layout.php7
-rw-r--r--tests/FunctionalTests/validators/protected/pages/Layout.tpl34
-rw-r--r--tests/FunctionalTests/validators/protected/pages/LinkButton.page37
-rw-r--r--tests/FunctionalTests/validators/protected/pages/LinkButton.php27
-rw-r--r--tests/FunctionalTests/validators/protected/pages/config.xml5
-rw-r--r--tests/FunctionalTests/validators/tests/ButtonTestCase.php65
-rw-r--r--tests/FunctionalTests/validators/tests/CheckBoxTestCase.php67
-rw-r--r--tests/FunctionalTests/validators/tests/ImageButtonTestCase.php65
-rw-r--r--tests/FunctionalTests/validators/tests/LinkButtonTestCase.php64
16 files changed, 574 insertions, 0 deletions
diff --git a/tests/FunctionalTests/validators/index.php b/tests/FunctionalTests/validators/index.php
new file mode 100644
index 00000000..fe127639
--- /dev/null
+++ b/tests/FunctionalTests/validators/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/validators/protected/pages/Button.page b/tests/FunctionalTests/validators/protected/pages/Button.page
new file mode 100644
index 00000000..5acc596b
--- /dev/null
+++ b/tests/FunctionalTests/validators/protected/pages/Button.page
@@ -0,0 +1,37 @@
+<com:TContent ID="Content">
+<h1>Validations Triggered by TButton</h1>
+
+<com:TTextBox ID="TextBox1" />
+<com:TRequiredFieldValidator
+ Text="Textbox1 required"
+ ControlToValidate="TextBox1"
+ ValidationGroup="Group1" />
+<com:TButton Text="Submit1"
+ ValidationGroup="Group1"
+ OnClick="button1Clicked" />
+<com:TLabel ID="Result1" />
+
+<hr/>
+
+<com:TTextBox ID="TextBox2" />
+<com:TRequiredFieldValidator
+ Text="Textbox2 required"
+ ControlToValidate="TextBox2" />
+<com:TButton Text="Submit2"
+ OnClick="button2Clicked" />
+<com:TLabel ID="Result2" />
+
+<hr/>
+
+<com:TTextBox ID="TextBox3" />
+<com:TRequiredFieldValidator
+ Text="Textbox3 required"
+ EnableClientScript="false"
+ ControlToValidate="TextBox3"
+ ValidationGroup="Group3" />
+<com:TButton Text="Submit3"
+ ValidationGroup="Group3"
+ OnClick="button3Clicked" />
+<com:TLabel ID="Result3" />
+
+</com:TContent> \ No newline at end of file
diff --git a/tests/FunctionalTests/validators/protected/pages/Button.php b/tests/FunctionalTests/validators/protected/pages/Button.php
new file mode 100644
index 00000000..3dbbc7d6
--- /dev/null
+++ b/tests/FunctionalTests/validators/protected/pages/Button.php
@@ -0,0 +1,27 @@
+<?php
+
+class Button extends TPage
+{
+ public function button1Clicked($sender,$param)
+ {
+ $this->Result1->Text="Button1 is clicked";
+ if($this->IsValid)
+ $this->Result1->Text.=' and valid';
+ }
+
+ public function button2Clicked($sender,$param)
+ {
+ $this->Result2->Text="Button2 is clicked";
+ if($this->IsValid)
+ $this->Result2->Text.=' and valid';
+ }
+
+ public function button3Clicked($sender,$param)
+ {
+ $this->Result3->Text="Button3 is clicked";
+ if($this->IsValid)
+ $this->Result3->Text.=' and valid';
+ }
+}
+
+?> \ No newline at end of file
diff --git a/tests/FunctionalTests/validators/protected/pages/CheckBox.page b/tests/FunctionalTests/validators/protected/pages/CheckBox.page
new file mode 100644
index 00000000..e5cb39ff
--- /dev/null
+++ b/tests/FunctionalTests/validators/protected/pages/CheckBox.page
@@ -0,0 +1,40 @@
+<com:TContent ID="Content">
+<h1>Validations Triggered by TCheckBox</h1>
+
+<com:TTextBox ID="TextBox1" />
+<com:TRequiredFieldValidator
+ Text="Textbox1 required"
+ ControlToValidate="TextBox1"
+ ValidationGroup="Group1" />
+<com:TCheckBox Text="Submit1"
+ AutoPostBack="true"
+ ValidationGroup="Group1"
+ OnCheckedChanged="button1Clicked" />
+<com:TLabel ID="Result1" />
+
+<hr/>
+
+<com:TTextBox ID="TextBox2" />
+<com:TRequiredFieldValidator
+ Text="Textbox2 required"
+ ControlToValidate="TextBox2" />
+<com:TCheckBox Text="Submit2"
+ AutoPostBack="true"
+ OnCheckedChanged="button2Clicked" />
+<com:TLabel ID="Result2" />
+
+<hr/>
+
+<com:TTextBox ID="TextBox3" />
+<com:TRequiredFieldValidator
+ Text="Textbox3 required"
+ EnableClientScript="false"
+ ControlToValidate="TextBox3"
+ ValidationGroup="Group3" />
+<com:TCheckBox Text="Submit3"
+ AutoPostBack="true"
+ ValidationGroup="Group3"
+ OnCheckedChanged="button3Clicked" />
+<com:TLabel ID="Result3" />
+
+</com:TContent> \ No newline at end of file
diff --git a/tests/FunctionalTests/validators/protected/pages/CheckBox.php b/tests/FunctionalTests/validators/protected/pages/CheckBox.php
new file mode 100644
index 00000000..700ac171
--- /dev/null
+++ b/tests/FunctionalTests/validators/protected/pages/CheckBox.php
@@ -0,0 +1,27 @@
+<?php
+
+class CheckBox extends TPage
+{
+ public function button1Clicked($sender,$param)
+ {
+ $this->Result1->Text="Button1 is clicked";
+ if($this->IsValid)
+ $this->Result1->Text.=' and valid';
+ }
+
+ public function button2Clicked($sender,$param)
+ {
+ $this->Result2->Text="Button2 is clicked";
+ if($this->IsValid)
+ $this->Result2->Text.=' and valid';
+ }
+
+ public function button3Clicked($sender,$param)
+ {
+ $this->Result3->Text="Button3 is clicked";
+ if($this->IsValid)
+ $this->Result3->Text.=' and valid';
+ }
+}
+
+?> \ No newline at end of file
diff --git a/tests/FunctionalTests/validators/protected/pages/ImageButton.page b/tests/FunctionalTests/validators/protected/pages/ImageButton.page
new file mode 100644
index 00000000..d1fae361
--- /dev/null
+++ b/tests/FunctionalTests/validators/protected/pages/ImageButton.page
@@ -0,0 +1,37 @@
+<com:TContent ID="Content">
+<h1>Validations Triggered by TImageButton</h1>
+
+<com:TTextBox ID="TextBox1" />
+<com:TRequiredFieldValidator
+ Text="Textbox1 required"
+ ControlToValidate="TextBox1"
+ ValidationGroup="Group1" />
+<com:TImageButton ImageUrl="http://www.pradosoft.com/images/powered.gif"
+ ValidationGroup="Group1"
+ OnClick="button1Clicked" />
+<com:TLabel ID="Result1" />
+
+<hr/>
+
+<com:TTextBox ID="TextBox2" />
+<com:TRequiredFieldValidator
+ Text="Textbox2 required"
+ ControlToValidate="TextBox2" />
+<com:TImageButton ImageUrl="http://www.pradosoft.com/images/powered.gif"
+ OnClick="button2Clicked" />
+<com:TLabel ID="Result2" />
+
+<hr/>
+
+<com:TTextBox ID="TextBox3" />
+<com:TRequiredFieldValidator
+ Text="Textbox3 required"
+ EnableClientScript="false"
+ ControlToValidate="TextBox3"
+ ValidationGroup="Group3" />
+<com:TImageButton ImageUrl="http://www.pradosoft.com/images/powered.gif"
+ ValidationGroup="Group3"
+ OnClick="button3Clicked" />
+<com:TLabel ID="Result3" />
+
+</com:TContent> \ No newline at end of file
diff --git a/tests/FunctionalTests/validators/protected/pages/ImageButton.php b/tests/FunctionalTests/validators/protected/pages/ImageButton.php
new file mode 100644
index 00000000..ecedd5bf
--- /dev/null
+++ b/tests/FunctionalTests/validators/protected/pages/ImageButton.php
@@ -0,0 +1,27 @@
+<?php
+
+class ImageButton extends TPage
+{
+ public function button1Clicked($sender,$param)
+ {
+ $this->Result1->Text="Button1 is clicked";
+ if($this->IsValid)
+ $this->Result1->Text.=' and valid';
+ }
+
+ public function button2Clicked($sender,$param)
+ {
+ $this->Result2->Text="Button2 is clicked";
+ if($this->IsValid)
+ $this->Result2->Text.=' and valid';
+ }
+
+ public function button3Clicked($sender,$param)
+ {
+ $this->Result3->Text="Button3 is clicked";
+ if($this->IsValid)
+ $this->Result3->Text.=' and valid';
+ }
+}
+
+?> \ No newline at end of file
diff --git a/tests/FunctionalTests/validators/protected/pages/Layout.php b/tests/FunctionalTests/validators/protected/pages/Layout.php
new file mode 100644
index 00000000..ba96038b
--- /dev/null
+++ b/tests/FunctionalTests/validators/protected/pages/Layout.php
@@ -0,0 +1,7 @@
+<?php
+
+class Layout extends TTemplateControl
+{
+}
+
+?> \ No newline at end of file
diff --git a/tests/FunctionalTests/validators/protected/pages/Layout.tpl b/tests/FunctionalTests/validators/protected/pages/Layout.tpl
new file mode 100644
index 00000000..224481e1
--- /dev/null
+++ b/tests/FunctionalTests/validators/protected/pages/Layout.tpl
@@ -0,0 +1,34 @@
+<!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>
+<com:TContentPlaceHolder ID="Content" />
+<hr style="margin-top: 2em" />
+<com:TJavascriptLogger />
+</com:TForm>
+</body>
+</html> \ No newline at end of file
diff --git a/tests/FunctionalTests/validators/protected/pages/LinkButton.page b/tests/FunctionalTests/validators/protected/pages/LinkButton.page
new file mode 100644
index 00000000..8ed1c338
--- /dev/null
+++ b/tests/FunctionalTests/validators/protected/pages/LinkButton.page
@@ -0,0 +1,37 @@
+<com:TContent ID="Content">
+<h1>Validations Triggered by TLinkButton</h1>
+
+<com:TTextBox ID="TextBox1" />
+<com:TRequiredFieldValidator
+ Text="Textbox1 required"
+ ControlToValidate="TextBox1"
+ ValidationGroup="Group1" />
+<com:TLinkButton Text="Submit1"
+ ValidationGroup="Group1"
+ OnClick="button1Clicked" />
+<com:TLabel ID="Result1" />
+
+<hr/>
+
+<com:TTextBox ID="TextBox2" />
+<com:TRequiredFieldValidator
+ Text="Textbox2 required"
+ ControlToValidate="TextBox2" />
+<com:TLinkButton Text="Submit2"
+ OnClick="button2Clicked" />
+<com:TLabel ID="Result2" />
+
+<hr/>
+
+<com:TTextBox ID="TextBox3" />
+<com:TRequiredFieldValidator
+ Text="Textbox3 required"
+ EnableClientScript="false"
+ ControlToValidate="TextBox3"
+ ValidationGroup="Group3" />
+<com:TLinkButton Text="Submit3"
+ ValidationGroup="Group3"
+ OnClick="button3Clicked" />
+<com:TLabel ID="Result3" />
+
+</com:TContent> \ No newline at end of file
diff --git a/tests/FunctionalTests/validators/protected/pages/LinkButton.php b/tests/FunctionalTests/validators/protected/pages/LinkButton.php
new file mode 100644
index 00000000..5130dd01
--- /dev/null
+++ b/tests/FunctionalTests/validators/protected/pages/LinkButton.php
@@ -0,0 +1,27 @@
+<?php
+
+class LinkButton extends TPage
+{
+ public function button1Clicked($sender,$param)
+ {
+ $this->Result1->Text="Button1 is clicked";
+ if($this->IsValid)
+ $this->Result1->Text.=' and valid';
+ }
+
+ public function button2Clicked($sender,$param)
+ {
+ $this->Result2->Text="Button2 is clicked";
+ if($this->IsValid)
+ $this->Result2->Text.=' and valid';
+ }
+
+ public function button3Clicked($sender,$param)
+ {
+ $this->Result3->Text="Button3 is clicked";
+ if($this->IsValid)
+ $this->Result3->Text.=' and valid';
+ }
+}
+
+?> \ No newline at end of file
diff --git a/tests/FunctionalTests/validators/protected/pages/config.xml b/tests/FunctionalTests/validators/protected/pages/config.xml
new file mode 100644
index 00000000..83bb5791
--- /dev/null
+++ b/tests/FunctionalTests/validators/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/validators/tests/ButtonTestCase.php b/tests/FunctionalTests/validators/tests/ButtonTestCase.php
new file mode 100644
index 00000000..46e037dc
--- /dev/null
+++ b/tests/FunctionalTests/validators/tests/ButtonTestCase.php
@@ -0,0 +1,65 @@
+<?php
+
+class ButtonTestCase extends SeleniumTestCase
+{
+ function test()
+ {
+ $this->open('validators/index.php?page=Button');
+
+
+ // verify all error messages are invisible
+ $this->verifyNotVisible('ctl0_Content_ctl0');
+ $this->verifyNotVisible('ctl0_Content_ctl2');
+ $this->verifyNotVisible('ctl0_Content_ctl4');
+
+ // verify the first validator shows the error
+ $this->click("ctl0_Content_ctl1");
+ $this->verifyVisible('ctl0_Content_ctl0');
+ $this->verifyNotVisible('ctl0_Content_ctl2');
+ $this->verifyNotVisible('ctl0_Content_ctl4');
+
+ // verify the first validation is passed
+ $this->pause(500);
+ $this->verifyTextNotPresent('Button1 is clicked');
+ $this->type("ctl0_Content_TextBox1", "test");
+ $this->clickAndWait("ctl0_Content_ctl1");
+ $this->verifyNotVisible('ctl0_Content_ctl0');
+ $this->verifyNotVisible('ctl0_Content_ctl2');
+ $this->verifyNotVisible('ctl0_Content_ctl4');
+ $this->verifyTextPresent('Button1 is clicked and valid');
+
+ // verify the second validator shows the error
+ $this->click("ctl0_Content_ctl3");
+ $this->verifyNotVisible('ctl0_Content_ctl0');
+ $this->verifyVisible('ctl0_Content_ctl2');
+ $this->verifyNotVisible('ctl0_Content_ctl4');
+
+ // verify the second validation is passed
+ $this->pause(500);
+ $this->verifyTextNotPresent('Button2 is clicked');
+ $this->type("ctl0_Content_TextBox2", "test");
+ $this->clickAndWait("ctl0_Content_ctl3");
+ $this->verifyNotVisible('ctl0_Content_ctl0');
+ $this->verifyNotVisible('ctl0_Content_ctl2');
+ $this->verifyNotVisible('ctl0_Content_ctl4');
+ $this->verifyTextPresent('Button2 is clicked and valid');
+
+ // verify the third validator shows the error
+ $this->clickAndWait("ctl0_Content_ctl5");
+ $this->verifyNotVisible('ctl0_Content_ctl0');
+ $this->verifyNotVisible('ctl0_Content_ctl2');
+ $this->verifyVisible('ctl0_Content_ctl4');
+
+ // verify the third validation is passed
+ $this->verifyTextPresent('Button3 is clicked');
+ $this->verifyTextNotPresent('Button3 is clicked and valid');
+ $this->type("ctl0_Content_TextBox3", "test");
+ $this->clickAndWait("ctl0_Content_ctl5");
+ $this->verifyNotVisible('ctl0_Content_ctl0');
+ $this->verifyNotVisible('ctl0_Content_ctl2');
+ $this->verifyNotVisible('ctl0_Content_ctl4');
+ $this->verifyTextPresent('Button3 is clicked and valid');
+ }
+}
+
+?> \ No newline at end of file
diff --git a/tests/FunctionalTests/validators/tests/CheckBoxTestCase.php b/tests/FunctionalTests/validators/tests/CheckBoxTestCase.php
new file mode 100644
index 00000000..6783572d
--- /dev/null
+++ b/tests/FunctionalTests/validators/tests/CheckBoxTestCase.php
@@ -0,0 +1,67 @@
+<?php
+
+class CheckBoxTestCase extends SeleniumTestCase
+{
+ function test()
+ {
+ $this->open('validators/index.php?page=CheckBox');
+
+
+ // verify all error messages are invisible
+ $this->verifyNotVisible('ctl0_Content_ctl0');
+ $this->verifyNotVisible('ctl0_Content_ctl2');
+ $this->verifyNotVisible('ctl0_Content_ctl4');
+
+ // verify the first validator shows the error
+ $this->click("ctl0_Content_ctl1");
+ $this->verifyVisible('ctl0_Content_ctl0');
+ $this->verifyNotVisible('ctl0_Content_ctl2');
+ $this->verifyNotVisible('ctl0_Content_ctl4');
+
+ // verify the first validation is passed
+ $this->pause(500);
+ $this->verifyTextNotPresent('Button1 is clicked');
+ $this->type("ctl0_Content_TextBox1", "test");
+ $this->clickAndWait("ctl0_Content_ctl1");
+ $this->clickAndWait("ctl0_Content_ctl1");
+ $this->verifyNotVisible('ctl0_Content_ctl0');
+ $this->verifyNotVisible('ctl0_Content_ctl2');
+ $this->verifyNotVisible('ctl0_Content_ctl4');
+ $this->verifyTextPresent('Button1 is clicked and valid');
+
+ // verify the second validator shows the error
+ $this->click("ctl0_Content_ctl3");
+ $this->verifyNotVisible('ctl0_Content_ctl0');
+ $this->verifyVisible('ctl0_Content_ctl2');
+ $this->verifyNotVisible('ctl0_Content_ctl4');
+
+ // verify the second validation is passed
+ $this->pause(500);
+ $this->verifyTextNotPresent('Button2 is clicked');
+ $this->type("ctl0_Content_TextBox2", "test");
+ $this->clickAndWait("ctl0_Content_ctl3");
+ $this->clickAndWait("ctl0_Content_ctl3");
+ $this->verifyNotVisible('ctl0_Content_ctl0');
+ $this->verifyNotVisible('ctl0_Content_ctl2');
+ $this->verifyNotVisible('ctl0_Content_ctl4');
+ $this->verifyTextPresent('Button2 is clicked and valid');
+
+ // verify the third validator shows the error
+ $this->clickAndWait("ctl0_Content_ctl5");
+ $this->verifyNotVisible('ctl0_Content_ctl0');
+ $this->verifyNotVisible('ctl0_Content_ctl2');
+ $this->verifyVisible('ctl0_Content_ctl4');
+
+ // verify the third validation is passed
+ $this->verifyTextPresent('Button3 is clicked');
+ $this->verifyTextNotPresent('Button3 is clicked and valid');
+ $this->type("ctl0_Content_TextBox3", "test");
+ $this->clickAndWait("ctl0_Content_ctl5");
+ $this->verifyNotVisible('ctl0_Content_ctl0');
+ $this->verifyNotVisible('ctl0_Content_ctl2');
+ $this->verifyNotVisible('ctl0_Content_ctl4');
+ $this->verifyTextPresent('Button3 is clicked and valid');
+ }
+}
+
+?> \ No newline at end of file
diff --git a/tests/FunctionalTests/validators/tests/ImageButtonTestCase.php b/tests/FunctionalTests/validators/tests/ImageButtonTestCase.php
new file mode 100644
index 00000000..1a4d88c1
--- /dev/null
+++ b/tests/FunctionalTests/validators/tests/ImageButtonTestCase.php
@@ -0,0 +1,65 @@
+<?php
+
+class ImageButtonTestCase extends SeleniumTestCase
+{
+ function test()
+ {
+ $this->open('validators/index.php?page=ImageButton');
+
+
+ // verify all error messages are invisible
+ $this->verifyNotVisible('ctl0_Content_ctl0');
+ $this->verifyNotVisible('ctl0_Content_ctl2');
+ $this->verifyNotVisible('ctl0_Content_ctl4');
+
+ // verify the first validator shows the error
+ $this->click("ctl0_Content_ctl1");
+ $this->verifyVisible('ctl0_Content_ctl0');
+ $this->verifyNotVisible('ctl0_Content_ctl2');
+ $this->verifyNotVisible('ctl0_Content_ctl4');
+
+ // verify the first validation is passed
+ $this->pause(500);
+ $this->verifyTextNotPresent('Button1 is clicked');
+ $this->type("ctl0_Content_TextBox1", "test");
+ $this->clickAndWait("ctl0_Content_ctl1");
+ $this->verifyNotVisible('ctl0_Content_ctl0');
+ $this->verifyNotVisible('ctl0_Content_ctl2');
+ $this->verifyNotVisible('ctl0_Content_ctl4');
+ $this->verifyTextPresent('Button1 is clicked and valid');
+
+ // verify the second validator shows the error
+ $this->click("ctl0_Content_ctl3");
+ $this->verifyNotVisible('ctl0_Content_ctl0');
+ $this->verifyVisible('ctl0_Content_ctl2');
+ $this->verifyNotVisible('ctl0_Content_ctl4');
+
+ // verify the second validation is passed
+ $this->pause(500);
+ $this->verifyTextNotPresent('Button2 is clicked');
+ $this->type("ctl0_Content_TextBox2", "test");
+ $this->clickAndWait("ctl0_Content_ctl3");
+ $this->verifyNotVisible('ctl0_Content_ctl0');
+ $this->verifyNotVisible('ctl0_Content_ctl2');
+ $this->verifyNotVisible('ctl0_Content_ctl4');
+ $this->verifyTextPresent('Button2 is clicked and valid');
+
+ // verify the third validator shows the error
+ $this->clickAndWait("ctl0_Content_ctl5");
+ $this->verifyNotVisible('ctl0_Content_ctl0');
+ $this->verifyNotVisible('ctl0_Content_ctl2');
+ $this->verifyVisible('ctl0_Content_ctl4');
+
+ // verify the third validation is passed
+ $this->verifyTextPresent('Button3 is clicked');
+ $this->verifyTextNotPresent('Button3 is clicked and valid');
+ $this->type("ctl0_Content_TextBox3", "test");
+ $this->clickAndWait("ctl0_Content_ctl5");
+ $this->verifyNotVisible('ctl0_Content_ctl0');
+ $this->verifyNotVisible('ctl0_Content_ctl2');
+ $this->verifyNotVisible('ctl0_Content_ctl4');
+ $this->verifyTextPresent('Button3 is clicked and valid');
+ }
+}
+
+?> \ No newline at end of file
diff --git a/tests/FunctionalTests/validators/tests/LinkButtonTestCase.php b/tests/FunctionalTests/validators/tests/LinkButtonTestCase.php
new file mode 100644
index 00000000..47122442
--- /dev/null
+++ b/tests/FunctionalTests/validators/tests/LinkButtonTestCase.php
@@ -0,0 +1,64 @@
+<?php
+
+class LinkButtonTestCase extends SeleniumTestCase
+{
+ function test()
+ {
+ $this->open('validators/index.php?page=LinkButton');
+
+ // verify all error messages are invisible
+ $this->verifyNotVisible('ctl0_Content_ctl0');
+ $this->verifyNotVisible('ctl0_Content_ctl2');
+ $this->verifyNotVisible('ctl0_Content_ctl4');
+
+ // verify the first validator shows the error
+ $this->click("ctl0_Content_ctl1");
+ $this->verifyVisible('ctl0_Content_ctl0');
+ $this->verifyNotVisible('ctl0_Content_ctl2');
+ $this->verifyNotVisible('ctl0_Content_ctl4');
+
+ // verify the first validation is passed
+ $this->pause(500);
+ $this->verifyTextNotPresent('Button1 is clicked');
+ $this->type("ctl0_Content_TextBox1", "test");
+ $this->clickAndWait("ctl0_Content_ctl1");
+ $this->verifyNotVisible('ctl0_Content_ctl0');
+ $this->verifyNotVisible('ctl0_Content_ctl2');
+ $this->verifyNotVisible('ctl0_Content_ctl4');
+ $this->verifyTextPresent('Button1 is clicked and valid');
+
+ // verify the second validator shows the error
+ $this->click("ctl0_Content_ctl3");
+ $this->verifyNotVisible('ctl0_Content_ctl0');
+ $this->verifyVisible('ctl0_Content_ctl2');
+ $this->verifyNotVisible('ctl0_Content_ctl4');
+
+ // verify the second validation is passed
+ $this->pause(500);
+ $this->verifyTextNotPresent('Button2 is clicked');
+ $this->type("ctl0_Content_TextBox2", "test");
+ $this->clickAndWait("ctl0_Content_ctl3");
+ $this->verifyNotVisible('ctl0_Content_ctl0');
+ $this->verifyNotVisible('ctl0_Content_ctl2');
+ $this->verifyNotVisible('ctl0_Content_ctl4');
+ $this->verifyTextPresent('Button2 is clicked and valid');
+
+ // verify the third validator shows the error
+ $this->clickAndWait("ctl0_Content_ctl5");
+ $this->verifyNotVisible('ctl0_Content_ctl0');
+ $this->verifyNotVisible('ctl0_Content_ctl2');
+ $this->verifyVisible('ctl0_Content_ctl4');
+
+ // verify the third validation is passed
+ $this->verifyTextPresent('Button3 is clicked');
+ $this->verifyTextNotPresent('Button3 is clicked and valid');
+ $this->type("ctl0_Content_TextBox3", "test");
+ $this->clickAndWait("ctl0_Content_ctl5");
+ $this->verifyNotVisible('ctl0_Content_ctl0');
+ $this->verifyNotVisible('ctl0_Content_ctl2');
+ $this->verifyNotVisible('ctl0_Content_ctl4');
+ $this->verifyTextPresent('Button3 is clicked and valid');
+ }
+}
+
+?> \ No newline at end of file