summaryrefslogtreecommitdiff
path: root/tests/FunctionalTests/validators/tests/ConditionalValidationTestCase.php
blob: 1629578ba401492de025203851c736ec95872845 (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
49
50
51
52
53
54
55
<?php

class ConditionalValidationTestCase extends PradoGenericSelenium2Test
{
	function test()
	{
		$base = "ctl0_Content_";
		$this->url("validators/index.php?page=ConditionalValidation");
		$this->assertSourceContains("Conditional Validation (clientside + server side)");
		$this->assertNotVisible("{$base}validator1");
		$this->assertNotVisible("{$base}validator2");

		$this->byId("{$base}submit1")->click();
		$this->assertVisible("{$base}validator1");
		$this->assertNotVisible("{$base}validator2");

		$this->byId("{$base}check1")->click();
		$this->byId("{$base}submit1")->click();
		$this->assertVisible("{$base}validator1");
		$this->assertVisible("{$base}validator2");

		$this->byId("{$base}check1")->click();
		$this->byId("{$base}submit1")->click();
		$this->pause(50);
		$this->assertVisible("{$base}validator1");
		$this->assertNotVisible("{$base}validator2");

		$this->type("{$base}text1", "testing");
		$this->byId("{$base}submit1")->click();
		$this->assertNotVisible("{$base}validator1");
		$this->assertNotVisible("{$base}validator2");

		$this->type("{$base}text1" ,"");
		$this->byId("{$base}check1")->click();
		$this->byId("{$base}submit1")->click();
		$this->assertVisible("{$base}validator1");
		$this->assertVisible("{$base}validator2");

		$this->type("{$base}text1", "test");
		$this->type("{$base}text2", "123");
		$this->byId("{$base}submit1")->click();
		$this->assertNotVisible("{$base}validator1");
		$this->assertNotVisible("{$base}validator2");

		$this->byId("{$base}check1")->click();
		$this->type("{$base}text1", "");
		$this->type("{$base}text2", "");
		$this->byId("{$base}submit1")->click();
		$this->assertVisible("{$base}validator1");
		$this->assertNotVisible("{$base}validator2");

	}

}