diff options
Diffstat (limited to 'tests/FunctionalTests/validators/tests/RangeValidatorTestCase.php')
-rwxr-xr-x | tests/FunctionalTests/validators/tests/RangeValidatorTestCase.php | 198 |
1 files changed, 99 insertions, 99 deletions
diff --git a/tests/FunctionalTests/validators/tests/RangeValidatorTestCase.php b/tests/FunctionalTests/validators/tests/RangeValidatorTestCase.php index 022ee7f6..485c6a24 100755 --- a/tests/FunctionalTests/validators/tests/RangeValidatorTestCase.php +++ b/tests/FunctionalTests/validators/tests/RangeValidatorTestCase.php @@ -1,166 +1,166 @@ <?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->assertContains("Prado RangeValidator Tests Integer", $this->source()); + //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->assertNotVisible("{$base}validator1"); + $this->byXPath("//input[@type='submit' and @value='Test']")->click(); + $this->assertVisible("{$base}validator1"); $this->type("{$base}text1", "12"); - $this->click("//input[@type='submit' and @value='Test']", ""); - $this->assertVisible("{$base}validator1", ""); + $this->byXPath("//input[@type='submit' and @value='Test']")->click(); + $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", ""); - - + $this->assertNotVisible("{$base}validator1"); + $this->byXPath("//input[@type='submit' and @value='Test']")->click(); + $this->assertNotVisible("{$base}validator1"); + + // >= 2 - $this->assertNotVisible("{$base}validator2", ""); + $this->assertNotVisible("{$base}validator2"); $this->type("{$base}text2", "1"); - $this->click("//input[@type='submit' and @value='Test']", ""); - $this->assertVisible("{$base}validator2", ""); + $this->byXPath("//input[@type='submit' and @value='Test']")->click(); + $this->assertVisible("{$base}validator2"); $this->type("{$base}text2", "10"); - $this->clickAndWait("//input[@type='submit' and @value='Test']", ""); - $this->assertNotVisible("{$base}validator2", ""); + $this->byXPath("//input[@type='submit' and @value='Test']")->click(); + $this->assertNotVisible("{$base}validator2"); // <= 20 - $this->assertNotVisible("{$base}validator3", ""); + $this->assertNotVisible("{$base}validator3"); $this->type("{$base}text3", "100"); - $this->click("//input[@type='submit' and @value='Test']", ""); - $this->assertVisible("{$base}validator3", ""); + $this->byXPath("//input[@type='submit' and @value='Test']")->click(); + $this->assertVisible("{$base}validator3"); $this->type("{$base}text3", "10"); - $this->clickAndWait("//input[@type='submit' and @value='Test']", ""); - $this->assertNotVisible("{$base}validator3", ""); + $this->byXPath("//input[@type='submit' and @value='Test']")->click(); + $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->assertContains("Prado RangeValidator Tests Float", $this->source()); + //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->assertNotVisible("{$base}validator1"); + $this->byXPath("//input[@type='submit' and @value='Test']")->click(); + $this->assertVisible("{$base}validator1"); $this->type("{$base}text1", "12"); - $this->click("//input[@type='submit' and @value='Test']", ""); - $this->assertVisible("{$base}validator1", ""); + $this->byXPath("//input[@type='submit' and @value='Test']")->click(); + $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", ""); - - + $this->assertNotVisible("{$base}validator1"); + $this->byXPath("//input[@type='submit' and @value='Test']")->click(); + $this->assertNotVisible("{$base}validator1"); + + // >= 2 - $this->assertNotVisible("{$base}validator2", ""); + $this->assertNotVisible("{$base}validator2"); $this->type("{$base}text2", "1"); - $this->click("//input[@type='submit' and @value='Test']", ""); - $this->assertVisible("{$base}validator2", ""); + $this->byXPath("//input[@type='submit' and @value='Test']")->click(); + $this->assertVisible("{$base}validator2"); $this->type("{$base}text2", "10"); - $this->clickAndWait("//input[@type='submit' and @value='Test']", ""); - $this->assertNotVisible("{$base}validator2", ""); + $this->byXPath("//input[@type='submit' and @value='Test']")->click(); + $this->assertNotVisible("{$base}validator2"); // <= 20 - $this->assertNotVisible("{$base}validator3", ""); + $this->assertNotVisible("{$base}validator3"); $this->type("{$base}text3", "100"); - $this->click("//input[@type='submit' and @value='Test']", ""); - $this->assertVisible("{$base}validator3", ""); + $this->byXPath("//input[@type='submit' and @value='Test']")->click(); + $this->assertVisible("{$base}validator3"); $this->type("{$base}text3", "10"); - $this->clickAndWait("//input[@type='submit' and @value='Test']", ""); - $this->assertNotVisible("{$base}validator3", ""); + $this->byXPath("//input[@type='submit' and @value='Test']")->click(); + $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->assertContains("Prado RangeValidator Tests Date", $this->source()); + //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->assertNotVisible("{$base}validator1"); + $this->byXPath("//input[@type='submit' and @value='Test']")->click(); + $this->assertVisible("{$base}validator1"); $this->type("{$base}text1", "27/2/2005"); - $this->click("//input[@type='submit' and @value='Test']", ""); - $this->assertVisible("{$base}validator1", ""); + $this->byXPath("//input[@type='submit' and @value='Test']")->click(); + $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", ""); - - + $this->byXPath("//input[@type='submit' and @value='Test']")->click(); + $this->assertNotVisible("{$base}validator1"); + $this->byXPath("//input[@type='submit' and @value='Test']")->click(); + $this->assertNotVisible("{$base}validator1"); + + // >= 22/1/2005 - $this->assertNotVisible("{$base}validator2", ""); + $this->assertNotVisible("{$base}validator2"); $this->type("{$base}text2", "1/1/2005"); - $this->click("//input[@type='submit' and @value='Test']", ""); + $this->byXPath("//input[@type='submit' and @value='Test']")->click(); $this->pause(250); - $this->assertVisible("{$base}validator2", ""); + $this->assertVisible("{$base}validator2"); $this->type("{$base}text2", "1/4/2005"); - $this->clickAndWait("//input[@type='submit' and @value='Test']", ""); - $this->assertNotVisible("{$base}validator2", ""); + $this->byXPath("//input[@type='submit' and @value='Test']")->click(); + $this->assertNotVisible("{$base}validator2"); // <= 3/2/2005 - $this->assertNotVisible("{$base}validator3", ""); + $this->assertNotVisible("{$base}validator3"); $this->type("{$base}text3", "4/5/2005"); - $this->click("//input[@type='submit' and @value='Test']", ""); + $this->byXPath("//input[@type='submit' and @value='Test']")->click(); $this->pause(250); - $this->assertVisible("{$base}validator3", ""); + $this->assertVisible("{$base}validator3"); $this->type("{$base}text3", "1/2/2005"); - $this->clickAndWait("//input[@type='submit' and @value='Test']", ""); - $this->assertNotVisible("{$base}validator3", ""); - } - + $this->byXPath("//input[@type='submit' and @value='Test']")->click(); + $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->assertContains("Prado RangeValidator Tests String", $this->source()); + //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->assertNotVisible("{$base}validator1"); + $this->byXPath("//input[@type='submit' and @value='Test']")->click(); + $this->assertVisible("{$base}validator1"); $this->type("{$base}text1", "b"); - $this->click("//input[@type='submit' and @value='Test']", ""); - $this->assertVisible("{$base}validator1", ""); + $this->byXPath("//input[@type='submit' and @value='Test']")->click(); + $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", ""); - - + $this->assertNotVisible("{$base}validator1"); + $this->byXPath("//input[@type='submit' and @value='Test']")->click(); + $this->assertNotVisible("{$base}validator1"); + + // >= 'd' - $this->assertNotVisible("{$base}validator2", ""); + $this->assertNotVisible("{$base}validator2"); $this->type("{$base}text2", "a"); - $this->click("//input[@type='submit' and @value='Test']", ""); - $this->assertVisible("{$base}validator2", ""); + $this->byXPath("//input[@type='submit' and @value='Test']")->click(); + $this->assertVisible("{$base}validator2"); $this->type("{$base}text2", "g"); - $this->clickAndWait("//input[@type='submit' and @value='Test']", ""); - $this->assertNotVisible("{$base}validator2", ""); + $this->byXPath("//input[@type='submit' and @value='Test']")->click(); + $this->assertNotVisible("{$base}validator2"); // <= 'y' - $this->assertNotVisible("{$base}validator3", ""); + $this->assertNotVisible("{$base}validator3"); $this->type("{$base}text3", "z"); - $this->click("//input[@type='submit' and @value='Test']", ""); - $this->assertVisible("{$base}validator3", ""); + $this->byXPath("//input[@type='submit' and @value='Test']")->click(); + $this->assertVisible("{$base}validator3"); $this->type("{$base}text3", "t"); - $this->clickAndWait("//input[@type='submit' and @value='Test']", ""); - $this->assertNotVisible("{$base}validator3", ""); - } + $this->byXPath("//input[@type='submit' and @value='Test']")->click(); + $this->assertNotVisible("{$base}validator3"); + } } |