summaryrefslogtreecommitdiff
path: root/tests/FunctionalTests/validators/tests
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/tests
parentfc38326ea80e73717fb1d187a16421f7bc1b1b04 (diff)
Merge from 3.0 branch till 924
Diffstat (limited to 'tests/FunctionalTests/validators/tests')
-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
4 files changed, 261 insertions, 0 deletions
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