summaryrefslogtreecommitdiff
path: root/tests/FunctionalTests/validators/tests/DatePickerTestCase.php
diff options
context:
space:
mode:
authorctrlaltca <ctrlaltca@gmail.com>2014-08-26 16:59:21 +0200
committerctrlaltca <ctrlaltca@gmail.com>2014-08-26 16:59:21 +0200
commit74b31be9515eddfa63005d6760614badfaba9fea (patch)
tree47c952901dcb5eccd6dd8b7c6ee7e0b6bf176510 /tests/FunctionalTests/validators/tests/DatePickerTestCase.php
parent2b11341614ac4a15be697fa8acad07055154ac54 (diff)
parent0c5026b55cde5c104f10686afd8b441568175d38 (diff)
Merge pull request #530 from pradosoft/prado-3.2.43.2.4prado-3.2
Backports for Prado 3.2.4
Diffstat (limited to 'tests/FunctionalTests/validators/tests/DatePickerTestCase.php')
-rwxr-xr-xtests/FunctionalTests/validators/tests/DatePickerTestCase.php84
1 files changed, 41 insertions, 43 deletions
diff --git a/tests/FunctionalTests/validators/tests/DatePickerTestCase.php b/tests/FunctionalTests/validators/tests/DatePickerTestCase.php
index e7425a33..ab68a619 100755
--- a/tests/FunctionalTests/validators/tests/DatePickerTestCase.php
+++ b/tests/FunctionalTests/validators/tests/DatePickerTestCase.php
@@ -1,70 +1,68 @@
<?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->assertNotVisible("{$base}validator1", "");
- $this->assertNotVisible("{$base}validator2", "");
- $this->assertNotVisible("{$base}validator4", "");
- $this->assertNotVisible("{$base}validator5", "");
- $this->assertNotVisible("{$base}validator6", "");
- $this->assertNotVisible("{$base}validator8", "");
+ $this->url("validators/index.php?page=DatePicker");
+ $this->assertContains("Date Picker validation Test", $this->source());
+ $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", "");
+ $this->byId("{$base}submit1")->click();
+ $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->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->select("{$base}picker2_month", "9");
+ $this->select("{$base}picker2_day", "10");
+ $this->select("{$base}picker2_year", "$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->select("{$base}picker5_day", "6");
+ $this->select("{$base}picker5_month", "3");
+ $this->select("{$base}picker5_year", "$year2");
+ $this->select("{$base}picker6_month", "3");
+ $this->select("{$base}picker6_year", "$year2");
+ $this->select("{$base}picker6_day", "5");
+ $this->byId("{$base}submit1")->click();
+ $this->pause(500);
- $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->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->select("{$base}picker6_day", "10");
- $this->clickAndWait("{$base}submit1");
+ $this->byId("{$base}submit1")->click();
- $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->assertNotVisible("{$base}validator1");
+ $this->assertNotVisible("{$base}validator2");
+ $this->assertNotVisible("{$base}validator4");
+ $this->assertNotVisible("{$base}validator5");
+ $this->assertNotVisible("{$base}validator6");
+ $this->assertNotVisible("{$base}validator8");
}
}