diff options
Diffstat (limited to 'tests/FunctionalTests/validators')
22 files changed, 1086 insertions, 1086 deletions
diff --git a/tests/FunctionalTests/validators/protected/pages/Button.php b/tests/FunctionalTests/validators/protected/pages/Button.php index 3dbbc7d6..94aaf6c8 100644 --- a/tests/FunctionalTests/validators/protected/pages/Button.php +++ b/tests/FunctionalTests/validators/protected/pages/Button.php @@ -1,27 +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';
- }
-}
-
+<?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.php b/tests/FunctionalTests/validators/protected/pages/CheckBox.php index 700ac171..f29792e0 100644 --- a/tests/FunctionalTests/validators/protected/pages/CheckBox.php +++ b/tests/FunctionalTests/validators/protected/pages/CheckBox.php @@ -1,27 +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';
- }
-}
-
+<?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/ConditionalValidation.php b/tests/FunctionalTests/validators/protected/pages/ConditionalValidation.php index 7756566c..83546617 100644 --- a/tests/FunctionalTests/validators/protected/pages/ConditionalValidation.php +++ b/tests/FunctionalTests/validators/protected/pages/ConditionalValidation.php @@ -1,20 +1,20 @@ -<?php
-/*
- * Created on 27/03/2007
- */
-
-class ConditionalValidation extends TPage
-{
- function check_validate($sender, $params)
- {
- $sender->enabled = $this->check1->checked;
- }
-
- function onPreRender($param)
- {
- //always re-enable the validator2 so as to display the client-side validator
- $this->validator2->enabled=true;
- }
-}
-
-?>
+<?php +/* + * Created on 27/03/2007 + */ + +class ConditionalValidation extends TPage +{ + function check_validate($sender, $params) + { + $sender->enabled = $this->check1->checked; + } + + function onPreRender($param) + { + //always re-enable the validator2 so as to display the client-side validator + $this->validator2->enabled=true; + } +} + +?> diff --git a/tests/FunctionalTests/validators/protected/pages/CustomValidator.php b/tests/FunctionalTests/validators/protected/pages/CustomValidator.php index ed1f9433..b56a9d8b 100644 --- a/tests/FunctionalTests/validators/protected/pages/CustomValidator.php +++ b/tests/FunctionalTests/validators/protected/pages/CustomValidator.php @@ -1,14 +1,14 @@ -<?php
-/*
- * Created on 16/04/2006
- */
-
-class CustomValidator extends TPage
-{
- function CustomValidation($sender, $params)
- {
- $params->isValid = $this->text1->Text == "Prado";
- }
-}
-
-?>
+<?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/ImageButton.php b/tests/FunctionalTests/validators/protected/pages/ImageButton.php index ecedd5bf..65392b75 100644 --- a/tests/FunctionalTests/validators/protected/pages/ImageButton.php +++ b/tests/FunctionalTests/validators/protected/pages/ImageButton.php @@ -1,27 +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';
- }
-}
-
+<?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 index ba96038b..7f5e5802 100644 --- a/tests/FunctionalTests/validators/protected/pages/Layout.php +++ b/tests/FunctionalTests/validators/protected/pages/Layout.php @@ -1,7 +1,7 @@ -<?php
-
-class Layout extends TTemplateControl
-{
-}
-
+<?php + +class Layout extends TTemplateControl +{ +} + ?>
\ No newline at end of file diff --git a/tests/FunctionalTests/validators/protected/pages/LinkButton.php b/tests/FunctionalTests/validators/protected/pages/LinkButton.php index 5130dd01..2b5a3c23 100644 --- a/tests/FunctionalTests/validators/protected/pages/LinkButton.php +++ b/tests/FunctionalTests/validators/protected/pages/LinkButton.php @@ -1,27 +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';
- }
-}
-
+<?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/tests/ButtonTestCase.php b/tests/FunctionalTests/validators/tests/ButtonTestCase.php index 46e037dc..99ebf4a4 100644 --- a/tests/FunctionalTests/validators/tests/ButtonTestCase.php +++ b/tests/FunctionalTests/validators/tests/ButtonTestCase.php @@ -1,65 +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');
- }
-}
-
+<?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 index 41c588ee..957a7cbf 100644 --- a/tests/FunctionalTests/validators/tests/CheckBoxTestCase.php +++ b/tests/FunctionalTests/validators/tests/CheckBoxTestCase.php @@ -1,70 +1,70 @@ -<?php
-
-class CheckBoxTestCase extends SeleniumTestCase
-{
- function test()
- {
- //problem with test runner clicking on radio buttons
- $this->skipBrowsers(self::OPERA);
-
- $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');
- }
-}
-
+<?php + +class CheckBoxTestCase extends SeleniumTestCase +{ + function test() + { + //problem with test runner clicking on radio buttons + $this->skipBrowsers(self::OPERA); + + $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/CompareValidatorTestCase.php b/tests/FunctionalTests/validators/tests/CompareValidatorTestCase.php index b0f7c407..5a7dbc80 100644 --- a/tests/FunctionalTests/validators/tests/CompareValidatorTestCase.php +++ b/tests/FunctionalTests/validators/tests/CompareValidatorTestCase.php @@ -1,46 +1,46 @@ -<?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->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");
-
- }
-}
-
+<?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->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/ConditionalValidationTestCase.php b/tests/FunctionalTests/validators/tests/ConditionalValidationTestCase.php index 7191ff9f..0c0ffc51 100644 --- a/tests/FunctionalTests/validators/tests/ConditionalValidationTestCase.php +++ b/tests/FunctionalTests/validators/tests/ConditionalValidationTestCase.php @@ -1,55 +1,55 @@ -<?php
-
-class ConditionalValidationTestCase extends SeleniumTestCase
-{
- function test()
- {
- $base = "ctl0_Content_";
- $this->open("validators/index.php?page=ConditionalValidation", "");
- $this->verifyTextPresent("Conditional Validation (clientside + server side)", "");
- $this->assertNotVisible("{$base}validator1", "");
- $this->assertNotVisible("{$base}validator2", "");
-
- $this->click("{$base}submit1");
- $this->assertVisible("{$base}validator1", "");
- $this->assertNotVisible("{$base}validator2", "");
-
- $this->click("{$base}check1");
- $this->click("{$base}submit1");
- $this->assertVisible("{$base}validator1", "");
- $this->assertVisible("{$base}validator2", "");
-
- $this->click("{$base}check1");
- $this->click("{$base}submit1");
- $this->assertVisible("{$base}validator1", "");
- $this->assertNotVisible("{$base}validator2", "");
-
- $this->type("{$base}text1", "testing");
- $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->type("{$base}text1", "test");
- $this->type("{$base}text2", "123");
- $this->clickAndWait("{$base}submit1");
- $this->assertNotVisible("{$base}validator1", "");
- $this->assertNotVisible("{$base}validator2", "");
-
- $this->click("{$base}check1");
- $this->type("{$base}text1", "");
- $this->type("{$base}text2", "");
- $this->click("{$base}submit1");
- $this->assertVisible("{$base}validator1", "");
- $this->assertNotVisible("{$base}validator2", "");
-
- }
-
-}
-
-?>
+<?php + +class ConditionalValidationTestCase extends SeleniumTestCase +{ + function test() + { + $base = "ctl0_Content_"; + $this->open("validators/index.php?page=ConditionalValidation", ""); + $this->verifyTextPresent("Conditional Validation (clientside + server side)", ""); + $this->assertNotVisible("{$base}validator1", ""); + $this->assertNotVisible("{$base}validator2", ""); + + $this->click("{$base}submit1"); + $this->assertVisible("{$base}validator1", ""); + $this->assertNotVisible("{$base}validator2", ""); + + $this->click("{$base}check1"); + $this->click("{$base}submit1"); + $this->assertVisible("{$base}validator1", ""); + $this->assertVisible("{$base}validator2", ""); + + $this->click("{$base}check1"); + $this->click("{$base}submit1"); + $this->assertVisible("{$base}validator1", ""); + $this->assertNotVisible("{$base}validator2", ""); + + $this->type("{$base}text1", "testing"); + $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->type("{$base}text1", "test"); + $this->type("{$base}text2", "123"); + $this->clickAndWait("{$base}submit1"); + $this->assertNotVisible("{$base}validator1", ""); + $this->assertNotVisible("{$base}validator2", ""); + + $this->click("{$base}check1"); + $this->type("{$base}text1", ""); + $this->type("{$base}text2", ""); + $this->click("{$base}submit1"); + $this->assertVisible("{$base}validator1", ""); + $this->assertNotVisible("{$base}validator2", ""); + + } + +} + +?> diff --git a/tests/FunctionalTests/validators/tests/CustomValidatorTestCase.php b/tests/FunctionalTests/validators/tests/CustomValidatorTestCase.php index 3a5daa6a..c5cbae8e 100644 --- a/tests/FunctionalTests/validators/tests/CustomValidatorTestCase.php +++ b/tests/FunctionalTests/validators/tests/CustomValidatorTestCase.php @@ -1,31 +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");
-
- }
-}
-
+<?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/DataTypeValidatorTestCase.php b/tests/FunctionalTests/validators/tests/DataTypeValidatorTestCase.php index 153be373..c7c4bdb6 100644 --- a/tests/FunctionalTests/validators/tests/DataTypeValidatorTestCase.php +++ b/tests/FunctionalTests/validators/tests/DataTypeValidatorTestCase.php @@ -1,49 +1,49 @@ -<?php
-/*
- * Created on 25/04/2006
- */
-
-class DataTypeValidatorTestCase extends SeleniumTestCase
-{
- function test()
- {
- $base = "ctl0_Content_";
- $this->open("validators/index.php?page=DataTypeValidator", "");
- $this->verifyTextPresent("Data Type Validator Tests", "");
- $this->click("//input[@type='submit' and @value='submit!']", "");
-
- $this->assertNotVisible("{$base}validator1");
- $this->assertNotVisible("{$base}validator2");
- $this->assertNotVisible("{$base}validator3");
-
- $this->type("{$base}textbox1", "a");
- $this->type("{$base}textbox2", "b");
- $this->type("{$base}textbox3", "c");
- $this->click("//input[@type='submit' and @value='submit!']", "");
-
- $this->assertVisible("{$base}validator1");
- $this->assertVisible("{$base}validator2");
- $this->assertVisible("{$base}validator3");
-
- $this->type("{$base}textbox1", "12");
- $this->type("{$base}textbox2", "12.5");
- $this->type("{$base}textbox3", "2/10/2005");
- $this->clickAndWait("//input[@type='submit' and @value='submit!']", "");
-
- $this->assertNotVisible("{$base}validator1");
- $this->assertNotVisible("{$base}validator2");
- $this->assertNotVisible("{$base}validator3");
-
- $this->type("{$base}textbox1", "12.2");
- $this->type("{$base}textbox2", "-12.5");
- $this->type("{$base}textbox3", "2/13/2005");
- $this->click("//input[@type='submit' and @value='submit!']", "");
-
- $this->assertVisible("{$base}validator1");
- $this->assertNotVisible("{$base}validator2");
- $this->assertVisible("{$base}validator3");
- }
-
-}
-
-?>
+<?php +/* + * Created on 25/04/2006 + */ + +class DataTypeValidatorTestCase extends SeleniumTestCase +{ + function test() + { + $base = "ctl0_Content_"; + $this->open("validators/index.php?page=DataTypeValidator", ""); + $this->verifyTextPresent("Data Type Validator Tests", ""); + $this->click("//input[@type='submit' and @value='submit!']", ""); + + $this->assertNotVisible("{$base}validator1"); + $this->assertNotVisible("{$base}validator2"); + $this->assertNotVisible("{$base}validator3"); + + $this->type("{$base}textbox1", "a"); + $this->type("{$base}textbox2", "b"); + $this->type("{$base}textbox3", "c"); + $this->click("//input[@type='submit' and @value='submit!']", ""); + + $this->assertVisible("{$base}validator1"); + $this->assertVisible("{$base}validator2"); + $this->assertVisible("{$base}validator3"); + + $this->type("{$base}textbox1", "12"); + $this->type("{$base}textbox2", "12.5"); + $this->type("{$base}textbox3", "2/10/2005"); + $this->clickAndWait("//input[@type='submit' and @value='submit!']", ""); + + $this->assertNotVisible("{$base}validator1"); + $this->assertNotVisible("{$base}validator2"); + $this->assertNotVisible("{$base}validator3"); + + $this->type("{$base}textbox1", "12.2"); + $this->type("{$base}textbox2", "-12.5"); + $this->type("{$base}textbox3", "2/13/2005"); + $this->click("//input[@type='submit' and @value='submit!']", ""); + + $this->assertVisible("{$base}validator1"); + $this->assertNotVisible("{$base}validator2"); + $this->assertVisible("{$base}validator3"); + } + +} + +?> diff --git a/tests/FunctionalTests/validators/tests/DatePickerTestCase.php b/tests/FunctionalTests/validators/tests/DatePickerTestCase.php index cdab46ab..12368448 100644 --- a/tests/FunctionalTests/validators/tests/DatePickerTestCase.php +++ b/tests/FunctionalTests/validators/tests/DatePickerTestCase.php @@ -1,72 +1,72 @@ -<?php
-
-class DatePickerTestCase extends SeleniumTestCase
-{
- function test()
- {
- $year=2012;
- $year2=2013;
- $base = "ctl0_Content_";
- $this->open("validators/index.php?page=DatePicker", "");
- $this->verifyTextPresent("Date Picker validation Test", "");
- $this->assertNotVisible("{$base}validator1", "");
- $this->assertNotVisible("{$base}validator2", "");
- $this->assertNotVisible("{$base}validator4", "");
- $this->assertNotVisible("{$base}validator5", "");
- $this->assertNotVisible("{$base}validator6", "");
- $this->assertNotVisible("{$base}validator8", "");
-
- $this->click("{$base}submit1");
- $this->assertVisible("{$base}validator1", "");
- $this->assertNotVisible("{$base}validator2", "");
-
- //the range validator is visible because the date is a drop down list
- //thus has default value != ""
- $this->assertVisible("{$base}validator4", "");
- $this->assertVisible("{$base}validator5", "");
- $this->assertNotVisible("{$base}validator6", "");
- $this->assertVisible("{$base}validator8", "");
-
- $this->click("{$base}submit1");
- $this->pause(250);
- $this->type("{$base}picker1", "13/4/$year");
- $this->select("{$base}picker2_month", "label=9");
- $this->select("{$base}picker2_day", "label=10");
- $this->select("{$base}picker2_year", "label=$year");
- $this->pause(250);
- $this->type("{$base}picker3", "14/4/$year");
- $this->pause(250);
- $this->type("{$base}picker4", "7/4/$year");
- $this->select("{$base}picker5_day", "label=6");
- $this->select("{$base}picker5_month", "label=3");
- $this->select("{$base}picker5_year", "label=$year2");
- $this->select("{$base}picker6_month", "label=3");
- $this->select("{$base}picker6_year", "label=$year2");
- $this->select("{$base}picker6_day", "label=5");
-
- $this->click("{$base}submit1");
-
- $this->assertNotVisible("{$base}validator1", "");
- $this->assertVisible("{$base}validator2", "");
- $this->assertNotVisible("{$base}validator4", "");
- $this->assertNotVisible("{$base}validator5", "");
- $this->assertVisible("{$base}validator6", "");
- $this->assertVisible("{$base}validator8", "");
-
- $this->type("{$base}picker1", "20/4/$year2");
- $this->type("{$base}picker4", "29/4/$year");
- $this->select("{$base}picker6_day", "label=10");
-
- $this->clickAndWait("{$base}submit1");
-
- $this->assertNotVisible("{$base}validator1", "");
- $this->assertNotVisible("{$base}validator2", "");
- $this->assertNotVisible("{$base}validator4", "");
- $this->assertNotVisible("{$base}validator5", "");
- $this->assertNotVisible("{$base}validator6", "");
- $this->assertNotVisible("{$base}validator8", "");
- }
-
-}
-
-?>
+<?php + +class DatePickerTestCase extends SeleniumTestCase +{ + function test() + { + $year=2012; + $year2=2013; + $base = "ctl0_Content_"; + $this->open("validators/index.php?page=DatePicker", ""); + $this->verifyTextPresent("Date Picker validation Test", ""); + $this->assertNotVisible("{$base}validator1", ""); + $this->assertNotVisible("{$base}validator2", ""); + $this->assertNotVisible("{$base}validator4", ""); + $this->assertNotVisible("{$base}validator5", ""); + $this->assertNotVisible("{$base}validator6", ""); + $this->assertNotVisible("{$base}validator8", ""); + + $this->click("{$base}submit1"); + $this->assertVisible("{$base}validator1", ""); + $this->assertNotVisible("{$base}validator2", ""); + + //the range validator is visible because the date is a drop down list + //thus has default value != "" + $this->assertVisible("{$base}validator4", ""); + $this->assertVisible("{$base}validator5", ""); + $this->assertNotVisible("{$base}validator6", ""); + $this->assertVisible("{$base}validator8", ""); + + $this->click("{$base}submit1"); + $this->pause(250); + $this->type("{$base}picker1", "13/4/$year"); + $this->select("{$base}picker2_month", "label=9"); + $this->select("{$base}picker2_day", "label=10"); + $this->select("{$base}picker2_year", "label=$year"); + $this->pause(250); + $this->type("{$base}picker3", "14/4/$year"); + $this->pause(250); + $this->type("{$base}picker4", "7/4/$year"); + $this->select("{$base}picker5_day", "label=6"); + $this->select("{$base}picker5_month", "label=3"); + $this->select("{$base}picker5_year", "label=$year2"); + $this->select("{$base}picker6_month", "label=3"); + $this->select("{$base}picker6_year", "label=$year2"); + $this->select("{$base}picker6_day", "label=5"); + + $this->click("{$base}submit1"); + + $this->assertNotVisible("{$base}validator1", ""); + $this->assertVisible("{$base}validator2", ""); + $this->assertNotVisible("{$base}validator4", ""); + $this->assertNotVisible("{$base}validator5", ""); + $this->assertVisible("{$base}validator6", ""); + $this->assertVisible("{$base}validator8", ""); + + $this->type("{$base}picker1", "20/4/$year2"); + $this->type("{$base}picker4", "29/4/$year"); + $this->select("{$base}picker6_day", "label=10"); + + $this->clickAndWait("{$base}submit1"); + + $this->assertNotVisible("{$base}validator1", ""); + $this->assertNotVisible("{$base}validator2", ""); + $this->assertNotVisible("{$base}validator4", ""); + $this->assertNotVisible("{$base}validator5", ""); + $this->assertNotVisible("{$base}validator6", ""); + $this->assertNotVisible("{$base}validator8", ""); + } + +} + +?> diff --git a/tests/FunctionalTests/validators/tests/ImageButtonTestCase.php b/tests/FunctionalTests/validators/tests/ImageButtonTestCase.php index 1a4d88c1..a83c4f89 100644 --- a/tests/FunctionalTests/validators/tests/ImageButtonTestCase.php +++ b/tests/FunctionalTests/validators/tests/ImageButtonTestCase.php @@ -1,65 +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');
- }
-}
-
+<?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 index 47122442..fa9508fb 100644 --- a/tests/FunctionalTests/validators/tests/LinkButtonTestCase.php +++ b/tests/FunctionalTests/validators/tests/LinkButtonTestCase.php @@ -1,64 +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');
- }
-}
-
+<?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 diff --git a/tests/FunctionalTests/validators/tests/ListControlTestCase.php b/tests/FunctionalTests/validators/tests/ListControlTestCase.php index 37f35d1b..e4281794 100644 --- a/tests/FunctionalTests/validators/tests/ListControlTestCase.php +++ b/tests/FunctionalTests/validators/tests/ListControlTestCase.php @@ -1,51 +1,51 @@ -<?php
-/*
- * Created on 24/04/2006
- */
-
-class ListControlTestCase extends SeleniumTestCase
-{
- function test()
- {
- //problem with test runner clicking on radio buttons
- $this->skipBrowsers(self::OPERA);
-
- $base = "ctl0_Content_";
- $this->open("validators/index.php?page=ListControl", "");
- $this->verifyTextPresent("List Control Required Field Validation Test", "");
- $this->click("//input[@type='submit' and @value='Submit!']", "");
-
- $this->assertVisible("{$base}validator1");
- $this->assertVisible("{$base}validator2");
- $this->assertVisible("{$base}validator3");
- $this->assertVisible("{$base}validator4");
-
- $this->click("//input[@id='{$base}list1_c1' and @value='Red']", "");
- $this->select("{$base}list2", "label=Red");
- $this->select("{$base}list3", "label=Blue");
- $this->click("{$base}list4_c3", "");
- $this->clickAndWait("//input[@type='submit' and @value='Submit!']", "");
-
- $this->assertNotVisible("{$base}validator1");
- $this->assertNotVisible("{$base}validator2");
- $this->assertNotVisible("{$base}validator3");
- $this->assertNotVisible("{$base}validator4");
-
- $this->select("{$base}list3", "label=Don't select this one");
- $this->click("{$base}list4_c0");
- $this->select("{$base}list2", "label=--- Select a color ---");
- $this->click("//input[@type='submit' and @value='Submit!']", "");
- $this->click("//input[@id='{$base}list1_c1' and @value='Red']", "");
- $this->click("//input[@id='{$base}list1_c0' and @value='Select a color below']", "");
- $this->click("//input[@type='submit' and @value='Submit!']", "");
-
- $this->assertVisible("{$base}validator1");
- $this->assertVisible("{$base}validator2");
- $this->assertVisible("{$base}validator3");
- $this->assertVisible("{$base}validator4");
-
- }
-
-}
-
-?>
+<?php +/* + * Created on 24/04/2006 + */ + +class ListControlTestCase extends SeleniumTestCase +{ + function test() + { + //problem with test runner clicking on radio buttons + $this->skipBrowsers(self::OPERA); + + $base = "ctl0_Content_"; + $this->open("validators/index.php?page=ListControl", ""); + $this->verifyTextPresent("List Control Required Field Validation Test", ""); + $this->click("//input[@type='submit' and @value='Submit!']", ""); + + $this->assertVisible("{$base}validator1"); + $this->assertVisible("{$base}validator2"); + $this->assertVisible("{$base}validator3"); + $this->assertVisible("{$base}validator4"); + + $this->click("//input[@id='{$base}list1_c1' and @value='Red']", ""); + $this->select("{$base}list2", "label=Red"); + $this->select("{$base}list3", "label=Blue"); + $this->click("{$base}list4_c3", ""); + $this->clickAndWait("//input[@type='submit' and @value='Submit!']", ""); + + $this->assertNotVisible("{$base}validator1"); + $this->assertNotVisible("{$base}validator2"); + $this->assertNotVisible("{$base}validator3"); + $this->assertNotVisible("{$base}validator4"); + + $this->select("{$base}list3", "label=Don't select this one"); + $this->click("{$base}list4_c0"); + $this->select("{$base}list2", "label=--- Select a color ---"); + $this->click("//input[@type='submit' and @value='Submit!']", ""); + $this->click("//input[@id='{$base}list1_c1' and @value='Red']", ""); + $this->click("//input[@id='{$base}list1_c0' and @value='Select a color below']", ""); + $this->click("//input[@type='submit' and @value='Submit!']", ""); + + $this->assertVisible("{$base}validator1"); + $this->assertVisible("{$base}validator2"); + $this->assertVisible("{$base}validator3"); + $this->assertVisible("{$base}validator4"); + + } + +} + +?> diff --git a/tests/FunctionalTests/validators/tests/RangeValidatorTestCase.php b/tests/FunctionalTests/validators/tests/RangeValidatorTestCase.php index c22ecf8b..31ad6c23 100644 --- a/tests/FunctionalTests/validators/tests/RangeValidatorTestCase.php +++ b/tests/FunctionalTests/validators/tests/RangeValidatorTestCase.php @@ -1,167 +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->clickAndWait("//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", "");
- }
-}
-
-?>
+<?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->clickAndWait("//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", ""); + } +} + +?> diff --git a/tests/FunctionalTests/validators/tests/RegExpValidatorTestCase.php b/tests/FunctionalTests/validators/tests/RegExpValidatorTestCase.php index 751ab80a..40719cf3 100644 --- a/tests/FunctionalTests/validators/tests/RegExpValidatorTestCase.php +++ b/tests/FunctionalTests/validators/tests/RegExpValidatorTestCase.php @@ -1,34 +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", "");
-
- }
-}
-
+<?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 index 5ba23133..69765238 100644 --- a/tests/FunctionalTests/validators/tests/RequiredFieldTestCase.php +++ b/tests/FunctionalTests/validators/tests/RequiredFieldTestCase.php @@ -1,90 +1,90 @@ -<?php
-
-class RequiredFieldTestCase extends SeleniumTestCase
-{
- function test()
- {
- //problem with test runner clicking on radio buttons
- $this->skipBrowsers(self::OPERA);
-
- $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");
- }
-}
+<?php + +class RequiredFieldTestCase extends SeleniumTestCase +{ + function test() + { + //problem with test runner clicking on radio buttons + $this->skipBrowsers(self::OPERA); + + $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 index 9f652583..2151e492 100644 --- a/tests/FunctionalTests/validators/tests/RequiredListTestCase.php +++ b/tests/FunctionalTests/validators/tests/RequiredListTestCase.php @@ -1,43 +1,43 @@ -<?php
-
-class RequiredListTestCase extends SeleniumTestCase
-{
-
- function test()
- {
- //problem with test runner clicking on radio buttons
- $this->skipBrowsers(self::OPERA);
-
- $base = "ctl0_Content_";
- $this->open("validators/index.php?page=RequiredListValidator");
- $this->click("{$base}submit1");
- $this->assertVisible("{$base}validator1");
- $this->assertVisible("{$base}validator2");
- $this->assertVisible("{$base}validator3");
- $this->click("{$base}list1_c0");
- $this->addSelection("{$base}list2", "label=One");
- $this->addSelection("{$base}list2", "label=Two");
- $this->click("{$base}list3_c3");
- $this->clickAndWait("{$base}submit1");
- $this->assertNotVisible("{$base}validator1");
- $this->assertNotVisible("{$base}validator2");
- $this->assertNotVisible("{$base}validator3");
- $this->click("{$base}list1_c1");
- $this->click("{$base}list1_c2");
- $this->click("{$base}list1_c3");
- $this->addSelection("{$base}list2", "label=Two");
- $this->click("{$base}list1_c3");
- $this->clickAndWait("{$base}submit1");
- $this->assertNotVisible("{$base}validator1");
- $this->assertNotVisible("{$base}validator2");
- $this->assertNotVisible("{$base}validator3");
- $this->click("{$base}list3_c3");
- $this->clickAndWait("{$base}submit1");
- $this->pause(200);
- $this->assertNotVisible("{$base}validator1");
- $this->assertNotVisible("{$base}validator2");
- $this->assertNotVisible("{$base}validator3");
- }
-}
-
+<?php + +class RequiredListTestCase extends SeleniumTestCase +{ + + function test() + { + //problem with test runner clicking on radio buttons + $this->skipBrowsers(self::OPERA); + + $base = "ctl0_Content_"; + $this->open("validators/index.php?page=RequiredListValidator"); + $this->click("{$base}submit1"); + $this->assertVisible("{$base}validator1"); + $this->assertVisible("{$base}validator2"); + $this->assertVisible("{$base}validator3"); + $this->click("{$base}list1_c0"); + $this->addSelection("{$base}list2", "label=One"); + $this->addSelection("{$base}list2", "label=Two"); + $this->click("{$base}list3_c3"); + $this->clickAndWait("{$base}submit1"); + $this->assertNotVisible("{$base}validator1"); + $this->assertNotVisible("{$base}validator2"); + $this->assertNotVisible("{$base}validator3"); + $this->click("{$base}list1_c1"); + $this->click("{$base}list1_c2"); + $this->click("{$base}list1_c3"); + $this->addSelection("{$base}list2", "label=Two"); + $this->click("{$base}list1_c3"); + $this->clickAndWait("{$base}submit1"); + $this->assertNotVisible("{$base}validator1"); + $this->assertNotVisible("{$base}validator2"); + $this->assertNotVisible("{$base}validator3"); + $this->click("{$base}list3_c3"); + $this->clickAndWait("{$base}submit1"); + $this->pause(200); + $this->assertNotVisible("{$base}validator1"); + $this->assertNotVisible("{$base}validator2"); + $this->assertNotVisible("{$base}validator3"); + } +} + ?>
\ No newline at end of file diff --git a/tests/FunctionalTests/validators/tests/ValidationSummaryTestCase.php b/tests/FunctionalTests/validators/tests/ValidationSummaryTestCase.php index 3b6225f3..802392ac 100644 --- a/tests/FunctionalTests/validators/tests/ValidationSummaryTestCase.php +++ b/tests/FunctionalTests/validators/tests/ValidationSummaryTestCase.php @@ -1,50 +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");
- */
- }
-}
-
+<?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 |