From 32dfd8233520261483bdf30f23425e3b50f05d17 Mon Sep 17 00:00:00 2001 From: Fabio Bas Date: Fri, 28 Feb 2014 10:39:25 +0100 Subject: 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 --- .../validators/protected/pages/ListControl.page | 28 +++++----- .../validators/tests/ButtonTestCase.php | 60 +++++++++++----------- .../validators/tests/CheckBoxTestCase.php | 60 +++++++++++----------- .../validators/tests/CompareValidatorTestCase.php | 18 +++---- .../tests/ConditionalValidationTestCase.php | 6 +-- .../validators/tests/CustomValidatorTestCase.php | 6 +-- .../validators/tests/DataTypeValidatorTestCase.php | 20 ++++---- .../validators/tests/DatePickerTestCase.php | 6 +-- .../validators/tests/ImageButtonTestCase.php | 60 +++++++++++----------- .../validators/tests/LinkButtonTestCase.php | 60 +++++++++++----------- .../validators/tests/ListControlTestCase.php | 9 ++-- .../validators/tests/RangeValidatorTestCase.php | 52 +++++++++---------- .../validators/tests/RegExpValidatorTestCase.php | 6 +-- .../validators/tests/RequiredFieldTestCase.php | 6 +-- .../validators/tests/RequiredListTestCase.php | 4 +- .../validators/tests/ValidationSummaryTestCase.php | 34 ++++++------ 16 files changed, 218 insertions(+), 217 deletions(-) (limited to 'tests/FunctionalTests/validators') 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 @@ -

List Control Required Field Validation Test

+

List Control Required Field Validation Test

- + - +
- + - + - +
- + - + - + - +
- + - + - +
\ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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"); */ -- cgit v1.2.3