diff options
author | Fabio Bas <ctrlaltca@gmail.com> | 2014-02-28 10:39:25 +0100 |
---|---|---|
committer | David <ottodavid@gmx.net> | 2014-08-21 17:28:52 +0200 |
commit | 32dfd8233520261483bdf30f23425e3b50f05d17 (patch) | |
tree | 3e0287adbe64f07e4c04615c8f26a3b9db397b18 /tests/FunctionalTests/validators | |
parent | 3db08b4d991c02870d04f7198d65fd926805709c (diff) |
Ported all tests from Selenium1 (RC) to Selenium2 (WebDriver) using a compatibility layer
(cherry picked from commit 82774aa0a41562a325f31c901584ec01c8238573)
Conflicts:
tests/FunctionalTests/active-controls/tests/AutoCompleteTestCase.php
tests/FunctionalTests/active-controls/tests/CustomTemplateTestCase.php
tests/FunctionalTests/tickets/tests/Ticket220TestCase.php
tests/FunctionalTests/tickets/tests/Ticket719TestCase.php
tests/FunctionalTests/tickets/tests/Ticket769TestCase.php
tests/FunctionalTests/validators/tests/DataTypeValidatorTestCase.php
Diffstat (limited to 'tests/FunctionalTests/validators')
16 files changed, 218 insertions, 217 deletions
diff --git a/tests/FunctionalTests/validators/protected/pages/ListControl.page b/tests/FunctionalTests/validators/protected/pages/ListControl.page index 1429e184..a75dc3ff 100755 --- a/tests/FunctionalTests/validators/protected/pages/ListControl.page +++ b/tests/FunctionalTests/validators/protected/pages/ListControl.page @@ -1,58 +1,58 @@ <com:TContent ID="Content">
- <h1>List Control Required Field Validation Test</h1>
+ <h1>List Control Required Field Validation Test</h1>
<com:TCheckBoxList ID="list1">
<com:TListItem Text="Select a color below" Value="" />
<com:TListItem Text="Red" />
<com:TListItem Text="Blue" />
<com:TListItem Text="Green" />
</com:TCheckBoxList>
-
+
<com:TRequiredFieldValidator ID="validator1"
ControlToValidate="list1"
InitialValue="Select a color below"
ErrorMessage="*" />
-
+
<hr />
-
+
<com:TDropDownList ID="list2">
<com:TListItem Text="--- Select a color ---" />
<com:TListItem Text="Red" />
<com:TListItem Text="Blue" />
<com:TListItem Text="Green" />
</com:TDropDownList>
-
+
<com:TRequiredFieldValidator ID="validator2"
ControlToValidate="list2"
InitialValue="--- Select a color ---"
ErrorMessage="*" />
-
+
<hr />
-
+
<com:TListBox ID="list3">
- <com:TListItem Text="Don't select this one" />
+ <com:TListItem Text="Dont select this one" />
<com:TListItem Text="Red" />
<com:TListItem Text="Blue" />
<com:TListItem Text="Green" />
</com:TListBox>
-
+
<com:TRequiredFieldValidator ID="validator3"
ControlToValidate="list3"
- InitialValue="Don't select this one"
+ InitialValue="Dont select this one"
ErrorMessage="*" />
-
+
<hr />
-
+
<com:TRadioButtonList ID="list4">
<com:TListItem Text="Select something else" />
<com:TListItem Text="Red" />
<com:TListItem Text="Blue" />
<com:TListItem Text="Green" />
</com:TRadioButtonList>
-
+
<com:TRequiredFieldValidator ID="validator4"
ControlToValidate="list4"
InitialValue="Select something else"
ErrorMessage="*" />
-
+
<com:TButton ID="submit1" Text="Submit!" />
</com:TContent>
\ No newline at end of file diff --git a/tests/FunctionalTests/validators/tests/ButtonTestCase.php b/tests/FunctionalTests/validators/tests/ButtonTestCase.php index 58001322..898c6ff3 100755 --- a/tests/FunctionalTests/validators/tests/ButtonTestCase.php +++ b/tests/FunctionalTests/validators/tests/ButtonTestCase.php @@ -1,63 +1,63 @@ <?php -class ButtonTestCase extends PradoGenericSeleniumTest +class ButtonTestCase extends PradoGenericSelenium2Test { function test() { - $this->open('validators/index.php?page=Button'); + $this->url('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'); + $this->assertNotVisible('ctl0_Content_ctl0'); + $this->assertNotVisible('ctl0_Content_ctl2'); + $this->assertNotVisible('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'); + $this->assertVisible('ctl0_Content_ctl0'); + $this->assertNotVisible('ctl0_Content_ctl2'); + $this->assertNotVisible('ctl0_Content_ctl4'); // verify the first validation is passed $this->pause(500); - $this->verifyTextNotPresent('Button1 is clicked'); + $this->assertTextNotPresent('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'); + $this->assertNotVisible('ctl0_Content_ctl0'); + $this->assertNotVisible('ctl0_Content_ctl2'); + $this->assertNotVisible('ctl0_Content_ctl4'); + $this->assertTextPresent('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'); + $this->assertNotVisible('ctl0_Content_ctl0'); + $this->assertVisible('ctl0_Content_ctl2'); + $this->assertNotVisible('ctl0_Content_ctl4'); // verify the second validation is passed $this->pause(500); - $this->verifyTextNotPresent('Button2 is clicked'); + $this->assertTextNotPresent('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'); + $this->assertNotVisible('ctl0_Content_ctl0'); + $this->assertNotVisible('ctl0_Content_ctl2'); + $this->assertNotVisible('ctl0_Content_ctl4'); + $this->assertTextPresent('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'); + $this->assertNotVisible('ctl0_Content_ctl0'); + $this->assertNotVisible('ctl0_Content_ctl2'); + $this->assertVisible('ctl0_Content_ctl4'); // verify the third validation is passed - $this->verifyTextPresent('Button3 is clicked'); - $this->verifyTextNotPresent('Button3 is clicked and valid'); + $this->assertTextPresent('Button3 is clicked'); + $this->assertTextNotPresent('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'); + $this->assertNotVisible('ctl0_Content_ctl0'); + $this->assertNotVisible('ctl0_Content_ctl2'); + $this->assertNotVisible('ctl0_Content_ctl4'); + $this->assertTextPresent('Button3 is clicked and valid'); } } diff --git a/tests/FunctionalTests/validators/tests/CheckBoxTestCase.php b/tests/FunctionalTests/validators/tests/CheckBoxTestCase.php index 847cbc9a..ebcffd00 100755 --- a/tests/FunctionalTests/validators/tests/CheckBoxTestCase.php +++ b/tests/FunctionalTests/validators/tests/CheckBoxTestCase.php @@ -1,65 +1,65 @@ <?php -class CheckBoxTestCase extends PradoGenericSeleniumTest +class CheckBoxTestCase extends PradoGenericSelenium2Test { function test() { - $this->open('validators/index.php?page=CheckBox'); + $this->url('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'); + $this->assertNotVisible('ctl0_Content_ctl0'); + $this->assertNotVisible('ctl0_Content_ctl2'); + $this->assertNotVisible('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'); + $this->assertVisible('ctl0_Content_ctl0'); + $this->assertNotVisible('ctl0_Content_ctl2'); + $this->assertNotVisible('ctl0_Content_ctl4'); // verify the first validation is passed $this->pause(500); - $this->verifyTextNotPresent('Button1 is clicked'); + $this->assertTextNotPresent('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'); + $this->assertNotVisible('ctl0_Content_ctl0'); + $this->assertNotVisible('ctl0_Content_ctl2'); + $this->assertNotVisible('ctl0_Content_ctl4'); + $this->assertTextPresent('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'); + $this->assertNotVisible('ctl0_Content_ctl0'); + $this->assertVisible('ctl0_Content_ctl2'); + $this->assertNotVisible('ctl0_Content_ctl4'); // verify the second validation is passed $this->pause(500); - $this->verifyTextNotPresent('Button2 is clicked'); + $this->assertTextNotPresent('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'); + $this->assertNotVisible('ctl0_Content_ctl0'); + $this->assertNotVisible('ctl0_Content_ctl2'); + $this->assertNotVisible('ctl0_Content_ctl4'); + $this->assertTextPresent('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'); + $this->assertNotVisible('ctl0_Content_ctl0'); + $this->assertNotVisible('ctl0_Content_ctl2'); + $this->assertVisible('ctl0_Content_ctl4'); // verify the third validation is passed - $this->verifyTextPresent('Button3 is clicked'); - $this->verifyTextNotPresent('Button3 is clicked and valid'); + $this->assertTextPresent('Button3 is clicked'); + $this->assertTextNotPresent('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'); + $this->assertNotVisible('ctl0_Content_ctl0'); + $this->assertNotVisible('ctl0_Content_ctl2'); + $this->assertNotVisible('ctl0_Content_ctl4'); + $this->assertTextPresent('Button3 is clicked and valid'); } } diff --git a/tests/FunctionalTests/validators/tests/CompareValidatorTestCase.php b/tests/FunctionalTests/validators/tests/CompareValidatorTestCase.php index 187351c1..5c45f49a 100755 --- a/tests/FunctionalTests/validators/tests/CompareValidatorTestCase.php +++ b/tests/FunctionalTests/validators/tests/CompareValidatorTestCase.php @@ -1,19 +1,19 @@ <?php //New Test -class CompareValidatorTestCase extends PradoGenericSeleniumTest +class CompareValidatorTestCase extends PradoGenericSelenium2Test { function test() { $base = "ctl0_Content_"; - - $this->open("validators/index.php?page=CompareValidator", ""); - $this->verifyTextPresent("Prado CompareValidator Tests", ""); + + $this->url("validators/index.php?page=CompareValidator"); + $this->assertTextPresent("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"); @@ -24,19 +24,19 @@ class CompareValidatorTestCase extends PradoGenericSeleniumTest $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"); diff --git a/tests/FunctionalTests/validators/tests/ConditionalValidationTestCase.php b/tests/FunctionalTests/validators/tests/ConditionalValidationTestCase.php index 02b174ef..d9981eb8 100755 --- a/tests/FunctionalTests/validators/tests/ConditionalValidationTestCase.php +++ b/tests/FunctionalTests/validators/tests/ConditionalValidationTestCase.php @@ -1,12 +1,12 @@ <?php -class ConditionalValidationTestCase extends PradoGenericSeleniumTest +class ConditionalValidationTestCase extends PradoGenericSelenium2Test { function test() { $base = "ctl0_Content_"; - $this->open("validators/index.php?page=ConditionalValidation", ""); - $this->verifyTextPresent("Conditional Validation (clientside + server side)", ""); + $this->url("validators/index.php?page=ConditionalValidation"); + $this->assertTextPresent("Conditional Validation (clientside + server side)", ""); $this->assertNotVisible("{$base}validator1", ""); $this->assertNotVisible("{$base}validator2", ""); diff --git a/tests/FunctionalTests/validators/tests/CustomValidatorTestCase.php b/tests/FunctionalTests/validators/tests/CustomValidatorTestCase.php index 106f7a00..c7bb6f9c 100755 --- a/tests/FunctionalTests/validators/tests/CustomValidatorTestCase.php +++ b/tests/FunctionalTests/validators/tests/CustomValidatorTestCase.php @@ -1,18 +1,18 @@ <?php //New Test -class CustomValidatorTestCase extends PradoGenericSeleniumTest +class CustomValidatorTestCase extends PradoGenericSelenium2Test { function test() { $base = "ctl0_Content_"; - $this->open("validators/index.php?page=CustomValidator", ""); + $this->url("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"); diff --git a/tests/FunctionalTests/validators/tests/DataTypeValidatorTestCase.php b/tests/FunctionalTests/validators/tests/DataTypeValidatorTestCase.php index 7ec220f0..c70549d0 100755 --- a/tests/FunctionalTests/validators/tests/DataTypeValidatorTestCase.php +++ b/tests/FunctionalTests/validators/tests/DataTypeValidatorTestCase.php @@ -3,16 +3,16 @@ * Created on 25/04/2006 */ -class DataTypeValidatorTestCase extends PradoGenericSeleniumTest +class DataTypeValidatorTestCase extends PradoGenericSelenium2Test { function test() { $this->setSpeed(500); $base = "ctl0_Content_"; - $this->open("validators/index.php?page=DataTypeValidator", ""); - $this->verifyTextPresent("Data Type Validator Tests", ""); + $this->url("validators/index.php?page=DataTypeValidator"); + $this->assertTextPresent("Data Type Validator Tests", ""); $this->click("//input[@type='submit' and @value='submit!']", ""); - + $this->assertNotVisible("{$base}validator1"); $this->assertNotVisible("{$base}validator2"); $this->assertNotVisible("{$base}validator3"); @@ -25,26 +25,26 @@ class DataTypeValidatorTestCase extends PradoGenericSeleniumTest $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"); $this->setSpeed(0); } - -} + +} diff --git a/tests/FunctionalTests/validators/tests/DatePickerTestCase.php b/tests/FunctionalTests/validators/tests/DatePickerTestCase.php index a80ff254..81c24aca 100755 --- a/tests/FunctionalTests/validators/tests/DatePickerTestCase.php +++ b/tests/FunctionalTests/validators/tests/DatePickerTestCase.php @@ -1,14 +1,14 @@ <?php -class DatePickerTestCase extends PradoGenericSeleniumTest +class DatePickerTestCase extends PradoGenericSelenium2Test { function test() { $year=2012; $year2=2013; $base = "ctl0_Content_"; - $this->open("validators/index.php?page=DatePicker", ""); - $this->verifyTextPresent("Date Picker validation Test", ""); + $this->url("validators/index.php?page=DatePicker"); + $this->assertTextPresent("Date Picker validation Test", ""); $this->assertNotVisible("{$base}validator1", ""); $this->assertNotVisible("{$base}validator2", ""); $this->assertNotVisible("{$base}validator4", ""); diff --git a/tests/FunctionalTests/validators/tests/ImageButtonTestCase.php b/tests/FunctionalTests/validators/tests/ImageButtonTestCase.php index e6b5d6d8..ef086baa 100755 --- a/tests/FunctionalTests/validators/tests/ImageButtonTestCase.php +++ b/tests/FunctionalTests/validators/tests/ImageButtonTestCase.php @@ -1,63 +1,63 @@ <?php -class ImageButtonTestCase extends PradoGenericSeleniumTest +class ImageButtonTestCase extends PradoGenericSelenium2Test { function test() { - $this->open('validators/index.php?page=ImageButton'); + $this->url('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'); + $this->assertNotVisible('ctl0_Content_ctl0'); + $this->assertNotVisible('ctl0_Content_ctl2'); + $this->assertNotVisible('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'); + $this->assertVisible('ctl0_Content_ctl0'); + $this->assertNotVisible('ctl0_Content_ctl2'); + $this->assertNotVisible('ctl0_Content_ctl4'); // verify the first validation is passed $this->pause(500); - $this->verifyTextNotPresent('Button1 is clicked'); + $this->assertTextNotPresent('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'); + $this->assertNotVisible('ctl0_Content_ctl0'); + $this->assertNotVisible('ctl0_Content_ctl2'); + $this->assertNotVisible('ctl0_Content_ctl4'); + $this->assertTextPresent('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'); + $this->assertNotVisible('ctl0_Content_ctl0'); + $this->assertVisible('ctl0_Content_ctl2'); + $this->assertNotVisible('ctl0_Content_ctl4'); // verify the second validation is passed $this->pause(500); - $this->verifyTextNotPresent('Button2 is clicked'); + $this->assertTextNotPresent('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'); + $this->assertNotVisible('ctl0_Content_ctl0'); + $this->assertNotVisible('ctl0_Content_ctl2'); + $this->assertNotVisible('ctl0_Content_ctl4'); + $this->assertTextPresent('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'); + $this->assertNotVisible('ctl0_Content_ctl0'); + $this->assertNotVisible('ctl0_Content_ctl2'); + $this->assertVisible('ctl0_Content_ctl4'); // verify the third validation is passed - $this->verifyTextPresent('Button3 is clicked'); - $this->verifyTextNotPresent('Button3 is clicked and valid'); + $this->assertTextPresent('Button3 is clicked'); + $this->assertTextNotPresent('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'); + $this->assertNotVisible('ctl0_Content_ctl0'); + $this->assertNotVisible('ctl0_Content_ctl2'); + $this->assertNotVisible('ctl0_Content_ctl4'); + $this->assertTextPresent('Button3 is clicked and valid'); } } diff --git a/tests/FunctionalTests/validators/tests/LinkButtonTestCase.php b/tests/FunctionalTests/validators/tests/LinkButtonTestCase.php index b523452c..66e2fc61 100755 --- a/tests/FunctionalTests/validators/tests/LinkButtonTestCase.php +++ b/tests/FunctionalTests/validators/tests/LinkButtonTestCase.php @@ -1,62 +1,62 @@ <?php -class LinkButtonTestCase extends PradoGenericSeleniumTest +class LinkButtonTestCase extends PradoGenericSelenium2Test { function test() { - $this->open('validators/index.php?page=LinkButton'); + $this->url('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'); + $this->assertNotVisible('ctl0_Content_ctl0'); + $this->assertNotVisible('ctl0_Content_ctl2'); + $this->assertNotVisible('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'); + $this->assertVisible('ctl0_Content_ctl0'); + $this->assertNotVisible('ctl0_Content_ctl2'); + $this->assertNotVisible('ctl0_Content_ctl4'); // verify the first validation is passed $this->pause(500); - $this->verifyTextNotPresent('Button1 is clicked'); + $this->assertTextNotPresent('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'); + $this->assertNotVisible('ctl0_Content_ctl0'); + $this->assertNotVisible('ctl0_Content_ctl2'); + $this->assertNotVisible('ctl0_Content_ctl4'); + $this->assertTextPresent('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'); + $this->assertNotVisible('ctl0_Content_ctl0'); + $this->assertVisible('ctl0_Content_ctl2'); + $this->assertNotVisible('ctl0_Content_ctl4'); // verify the second validation is passed $this->pause(500); - $this->verifyTextNotPresent('Button2 is clicked'); + $this->assertTextNotPresent('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'); + $this->assertNotVisible('ctl0_Content_ctl0'); + $this->assertNotVisible('ctl0_Content_ctl2'); + $this->assertNotVisible('ctl0_Content_ctl4'); + $this->assertTextPresent('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'); + $this->assertNotVisible('ctl0_Content_ctl0'); + $this->assertNotVisible('ctl0_Content_ctl2'); + $this->assertVisible('ctl0_Content_ctl4'); // verify the third validation is passed - $this->verifyTextPresent('Button3 is clicked'); - $this->verifyTextNotPresent('Button3 is clicked and valid'); + $this->assertTextPresent('Button3 is clicked'); + $this->assertTextNotPresent('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'); + $this->assertNotVisible('ctl0_Content_ctl0'); + $this->assertNotVisible('ctl0_Content_ctl2'); + $this->assertNotVisible('ctl0_Content_ctl4'); + $this->assertTextPresent('Button3 is clicked and valid'); } } diff --git a/tests/FunctionalTests/validators/tests/ListControlTestCase.php b/tests/FunctionalTests/validators/tests/ListControlTestCase.php index 68feee84..a8aca64b 100755 --- a/tests/FunctionalTests/validators/tests/ListControlTestCase.php +++ b/tests/FunctionalTests/validators/tests/ListControlTestCase.php @@ -3,13 +3,13 @@ * Created on 24/04/2006 */ -class ListControlTestCase extends PradoGenericSeleniumTest +class ListControlTestCase extends PradoGenericSelenium2Test { function test() { $base = "ctl0_Content_"; - $this->open("validators/index.php?page=ListControl", ""); - $this->verifyTextPresent("List Control Required Field Validation Test", ""); + $this->url("validators/index.php?page=ListControl"); + $this->assertTextPresent("List Control Required Field Validation Test", ""); $this->click("//input[@type='submit' and @value='Submit!']", ""); $this->assertVisible("{$base}validator1"); @@ -28,7 +28,8 @@ class ListControlTestCase extends PradoGenericSeleniumTest $this->assertNotVisible("{$base}validator3"); $this->assertNotVisible("{$base}validator4"); - $this->select("{$base}list3", "label=Don't select this one"); + //invalid selector: Unable to locate an element with the xpath expression .//option[.='Don\'t select this one'] because of the following error: SyntaxError: Failed to execute 'evaluate' on 'Document': The string './/option[.='Don\'t select this one']' is not a valid XPath expression. + $this->select("{$base}list3", "label=Dont select this one"); $this->click("{$base}list4_c0"); $this->select("{$base}list2", "label=--- Select a color ---"); $this->click("//input[@type='submit' and @value='Submit!']", ""); diff --git a/tests/FunctionalTests/validators/tests/RangeValidatorTestCase.php b/tests/FunctionalTests/validators/tests/RangeValidatorTestCase.php index 022ee7f6..668260ad 100755 --- a/tests/FunctionalTests/validators/tests/RangeValidatorTestCase.php +++ b/tests/FunctionalTests/validators/tests/RangeValidatorTestCase.php @@ -1,14 +1,14 @@ <?php //New Test -class RangeValidatorTestCase extends PradoGenericSeleniumTest +class RangeValidatorTestCase extends PradoGenericSelenium2Test { function testIntegerRange() { $base = "ctl0_Content_"; - $this->open("validators/index.php?page=RangeValidatorInteger", ""); - $this->verifyTextPresent("Prado RangeValidator Tests Integer", ""); - + $this->url("validators/index.php?page=RangeValidatorInteger"); + $this->assertTextPresent("Prado RangeValidator Tests Integer", ""); + //between 1 and 4 $this->type("{$base}text1", "ad"); $this->assertNotVisible("{$base}validator1", ""); @@ -21,8 +21,8 @@ class RangeValidatorTestCase extends PradoGenericSeleniumTest $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"); @@ -42,13 +42,13 @@ class RangeValidatorTestCase extends PradoGenericSeleniumTest $this->assertNotVisible("{$base}validator3", ""); } - + function testFloatRange() { $base = "ctl0_Content_"; - $this->open("validators/index.php?page=RangeValidatorFloat", ""); - $this->verifyTextPresent("Prado RangeValidator Tests Float", ""); - + $this->url("validators/index.php?page=RangeValidatorFloat"); + $this->assertTextPresent("Prado RangeValidator Tests Float", ""); + //between 1 and 4 $this->type("{$base}text1", "ad"); $this->assertNotVisible("{$base}validator1", ""); @@ -61,8 +61,8 @@ class RangeValidatorTestCase extends PradoGenericSeleniumTest $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"); @@ -81,13 +81,13 @@ class RangeValidatorTestCase extends PradoGenericSeleniumTest $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", ""); - + $this->url("validators/index.php?page=RangeValidatorDate"); + $this->assertTextPresent("Prado RangeValidator Tests Date", ""); + //between 22/1/2005 and 3/2/2005 $this->type("{$base}text1", "ad"); $this->assertNotVisible("{$base}validator1", ""); @@ -101,8 +101,8 @@ class RangeValidatorTestCase extends PradoGenericSeleniumTest $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"); @@ -122,14 +122,14 @@ class RangeValidatorTestCase extends PradoGenericSeleniumTest $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", ""); - + $this->url("validators/index.php?page=RangeValidatorString"); + $this->assertTextPresent("Prado RangeValidator Tests String", ""); + //between 'd' and 'y' $this->type("{$base}text1", "a"); $this->assertNotVisible("{$base}validator1", ""); @@ -142,8 +142,8 @@ class RangeValidatorTestCase extends PradoGenericSeleniumTest $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"); @@ -161,6 +161,6 @@ class RangeValidatorTestCase extends PradoGenericSeleniumTest $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 f269bf3b..b45ebcf3 100755 --- a/tests/FunctionalTests/validators/tests/RegExpValidatorTestCase.php +++ b/tests/FunctionalTests/validators/tests/RegExpValidatorTestCase.php @@ -1,13 +1,13 @@ <?php //New Test -class RegExpValidatorTestCase extends PradoGenericSeleniumTest +class RegExpValidatorTestCase extends PradoGenericSelenium2Test { function test() { $base = "ctl0_Content_"; - $this->open("validators/index.php?page=RegularExpressionValidator", ""); - $this->verifyTextPresent("Prado RegularExpressionValidator Tests", ""); + $this->url("validators/index.php?page=RegularExpressionValidator"); + $this->assertTextPresent("Prado RegularExpressionValidator Tests", ""); $this->assertNotVisible("{$base}validator1", ""); $this->assertNotVisible("{$base}validator2", ""); $this->type("{$base}text1", "1"); diff --git a/tests/FunctionalTests/validators/tests/RequiredFieldTestCase.php b/tests/FunctionalTests/validators/tests/RequiredFieldTestCase.php index 8ee278f8..4dd645b4 100755 --- a/tests/FunctionalTests/validators/tests/RequiredFieldTestCase.php +++ b/tests/FunctionalTests/validators/tests/RequiredFieldTestCase.php @@ -1,11 +1,11 @@ <?php -class RequiredFieldTestCase extends PradoGenericSeleniumTest +class RequiredFieldTestCase extends PradoGenericSelenium2Test { function test() { $base = "ctl0_Content_"; - $this->open("validators/index.php?page=RequiredFieldValidator"); + $this->url("validators/index.php?page=RequiredFieldValidator"); $this->assertTextPresent("RequiredFieldValidator Tests"); $this->assertNotVisible("{$base}validator1"); $this->assertNotVisible("{$base}validator2"); @@ -73,7 +73,7 @@ class RequiredFieldTestCase extends PradoGenericSeleniumTest function testInitialValue() { $base = "ctl0_Content_"; - $this->open("validators/index.php?page=RequiredFieldValidator"); + $this->url("validators/index.php?page=RequiredFieldValidator"); $this->assertTextPresent("InitialValue Test"); $this->assertNotVisible("{$base}validator9"); $this->click("{$base}submit5"); diff --git a/tests/FunctionalTests/validators/tests/RequiredListTestCase.php b/tests/FunctionalTests/validators/tests/RequiredListTestCase.php index 2662c721..6fbb1905 100755 --- a/tests/FunctionalTests/validators/tests/RequiredListTestCase.php +++ b/tests/FunctionalTests/validators/tests/RequiredListTestCase.php @@ -1,12 +1,12 @@ <?php -class RequiredListTestCase extends PradoGenericSeleniumTest +class RequiredListTestCase extends PradoGenericSelenium2Test { function test() { $base = "ctl0_Content_"; - $this->open("validators/index.php?page=RequiredListValidator"); + $this->url("validators/index.php?page=RequiredListValidator"); $this->click("{$base}submit1"); $this->assertVisible("{$base}validator1"); $this->assertVisible("{$base}validator2"); diff --git a/tests/FunctionalTests/validators/tests/ValidationSummaryTestCase.php b/tests/FunctionalTests/validators/tests/ValidationSummaryTestCase.php index 7dc1d6b1..0ee8c27c 100755 --- a/tests/FunctionalTests/validators/tests/ValidationSummaryTestCase.php +++ b/tests/FunctionalTests/validators/tests/ValidationSummaryTestCase.php @@ -1,46 +1,46 @@ <?php //New Test -class ValidationSummaryTestCase extends PradoGenericSeleniumTest +class ValidationSummaryTestCase extends PradoGenericSelenium2Test { 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->url("validators/index.php?page=ValidationSummary"); + $this->assertTextPresent("Validation Summary Test", ""); + //$this->assertText("{$base}summary1", ""); + //$this->assertText("{$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->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->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->assertText("{$base}summary1", ""); + //$this->assertText("{$base}summary2", ""); $this->clickAndWait("//input[@type='submit' and @value='Create New Account']", ""); - //$this->verifyText("{$base}summary1", ""); - //$this->verifyText("{$base}summary2", ""); + //$this->assertText("{$base}summary1", ""); + //$this->assertText("{$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"); */ |