summaryrefslogtreecommitdiff
path: root/tests/FunctionalTests/validators/tests/DataTypeValidatorTestCase.php
blob: cad00f1ff7c8ef971df55e6d0d6bfb06ad3a0f19 (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
45
46
47
48
<?php
/*
 * Created on 25/04/2006
 */

class DataTypeValidatorTestCase extends PradoGenericSelenium2Test
{
	function test()
	{
		$base = "ctl0_Content_";
		$this->url("validators/index.php?page=DataTypeValidator");
		$this->assertContains("Data Type Validator Tests", $this->source());
		$this->byXPath("//input[@type='submit' and @value='submit!']")->click();

		$this->assertNotVisible("{$base}validator1");
		$this->assertNotVisible("{$base}validator2");
		$this->assertNotVisible("{$base}validator3");

		$this->type("{$base}textbox1", "a");
		$this->type("{$base}textbox2", "b");
		$this->type("{$base}textbox3", "c");
		$this->byXPath("//input[@type='submit' and @value='submit!']")->click();

		$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->byXPath("//input[@type='submit' and @value='submit!']")->click();

		$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->byXPath("//input[@type='submit' and @value='submit!']")->click();

		$this->assertVisible("{$base}validator1");
		$this->assertNotVisible("{$base}validator2");
		$this->assertVisible("{$base}validator3");
	}

}