summaryrefslogtreecommitdiff
path: root/tests/FunctionalTests/validators/tests/CompareValidatorTestCase.php
blob: 187351c1a07b436055d154994335d6d49a8b6c16 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
<?php

//New Test
class CompareValidatorTestCase extends PradoGenericSeleniumTest
{
	function test()
	{
		$base = "ctl0_Content_";
		
		$this->open("validators/index.php?page=CompareValidator", "");
		$this->verifyTextPresent("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");
		$this->click("//input[@type='submit' and @value='Test']", "");
		$this->assertVisible("{$base}validator1");

		$this->type("{$base}text2", "qwe");
		$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");

	}
}