From a26837b0990f65b7091263026296d2aff68d9838 Mon Sep 17 00:00:00 2001 From: "ctrlaltca@gmail.com" <> Date: Wed, 18 Jan 2012 09:35:07 +0000 Subject: fixed #380 (TCustomValidator's ControlToValidate should be optional); added a quickstart example, updated 2 tests that were broken + HISTORY --- .../validators/protected/pages/DatePicker.page | 10 +++++----- .../validators/tests/DatePickerTestCase.php | 18 ++++++++++-------- .../validators/tests/RangeValidatorTestCase.php | 4 ++-- 3 files changed, 17 insertions(+), 15 deletions(-) (limited to 'tests/FunctionalTests/validators') diff --git a/tests/FunctionalTests/validators/protected/pages/DatePicker.page b/tests/FunctionalTests/validators/protected/pages/DatePicker.page index fdbbbeb1..7dfd2788 100644 --- a/tests/FunctionalTests/validators/protected/pages/DatePicker.page +++ b/tests/FunctionalTests/validators/protected/pages/DatePicker.page @@ -10,8 +10,8 @@ ControlToValidate="picker1" DataType="Date" DateFormat="d/M/yyyy" - ErrorMessage="Please enter a date greater than 17/4/2007" - MinValue="17/4/2007" /> + ErrorMessage="Please enter a date greater than 17/4/2013" + MinValue="17/4/2013" />
@@ -21,9 +21,9 @@ ControlToValidate="picker2" DataType="Date" DateFormat="d/M/yyyy" - ErrorMessage="Please enter a date between 9/9/2006 and 8/10/2006" - MinValue="9/9/2006" - MaxValue="8/10/2006" /> + ErrorMessage="Please enter a date between 9/9/2012 and 8/10/2012" + MinValue="9/9/2012" + MaxValue="8/10/2012" />
Date 1: diff --git a/tests/FunctionalTests/validators/tests/DatePickerTestCase.php b/tests/FunctionalTests/validators/tests/DatePickerTestCase.php index 320802e4..4d848ec8 100644 --- a/tests/FunctionalTests/validators/tests/DatePickerTestCase.php +++ b/tests/FunctionalTests/validators/tests/DatePickerTestCase.php @@ -4,6 +4,8 @@ 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", ""); @@ -26,17 +28,17 @@ class DatePickerTestCase extends SeleniumTestCase $this->assertVisible("{$base}validator8", ""); $this->click("{$base}submit1"); - $this->type("{$base}picker1", "13/4/2006"); + $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=2006"); - $this->type("{$base}picker3", "14/4/2006"); - $this->type("{$base}picker4", "7/4/2006"); + $this->select("{$base}picker2_year", "label=$year"); + $this->type("{$base}picker3", "14/4/$year"); + $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=2007"); + $this->select("{$base}picker5_year", "label=$year2"); $this->select("{$base}picker6_month", "label=3"); - $this->select("{$base}picker6_year", "label=2007"); + $this->select("{$base}picker6_year", "label=$year2"); $this->select("{$base}picker6_day", "label=5"); $this->click("{$base}submit1"); @@ -48,8 +50,8 @@ class DatePickerTestCase extends SeleniumTestCase $this->assertVisible("{$base}validator6", ""); $this->assertVisible("{$base}validator8", ""); - $this->type("{$base}picker1", "20/4/2007"); - $this->type("{$base}picker4", "29/4/2006"); + $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"); diff --git a/tests/FunctionalTests/validators/tests/RangeValidatorTestCase.php b/tests/FunctionalTests/validators/tests/RangeValidatorTestCase.php index 69d4cc07..c22ecf8b 100644 --- a/tests/FunctionalTests/validators/tests/RangeValidatorTestCase.php +++ b/tests/FunctionalTests/validators/tests/RangeValidatorTestCase.php @@ -97,7 +97,7 @@ class RangeValidatorTestCase extends SeleniumTestCase $this->click("//input[@type='submit' and @value='Test']", ""); $this->assertVisible("{$base}validator1", ""); $this->type("{$base}text1", "1/2/2005"); - $this->click("//input[@type='submit' and @value='Test']", ""); + $this->clickAndWait("//input[@type='submit' and @value='Test']", ""); $this->assertNotVisible("{$base}validator1", ""); $this->clickAndWait("//input[@type='submit' and @value='Test']", ""); $this->assertNotVisible("{$base}validator1", ""); @@ -164,4 +164,4 @@ class RangeValidatorTestCase extends SeleniumTestCase } } -?> \ No newline at end of file +?> -- cgit v1.2.3