summaryrefslogtreecommitdiff
path: root/tests/FunctionalTests/validators/tests/ButtonTestCase.php
blob: 580013223bc77c0929a1773e67c518fe92f4a2b4 (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
56
57
58
59
60
61
62
63
<?php

class ButtonTestCase extends PradoGenericSeleniumTest
{
	function test()
	{
		$this->open('validators/index.php?page=Button');


		// verify all error messages are invisible
		$this->verifyNotVisible('ctl0_Content_ctl0');
		$this->verifyNotVisible('ctl0_Content_ctl2');
		$this->verifyNotVisible('ctl0_Content_ctl4');

		// verify the first validator shows the error
		$this->click("ctl0_Content_ctl1");
		$this->verifyVisible('ctl0_Content_ctl0');
		$this->verifyNotVisible('ctl0_Content_ctl2');
		$this->verifyNotVisible('ctl0_Content_ctl4');

		// verify the first validation is passed
		$this->pause(500);
		$this->verifyTextNotPresent('Button1 is clicked');
		$this->type("ctl0_Content_TextBox1", "test");
		$this->clickAndWait("ctl0_Content_ctl1");
		$this->verifyNotVisible('ctl0_Content_ctl0');
		$this->verifyNotVisible('ctl0_Content_ctl2');
		$this->verifyNotVisible('ctl0_Content_ctl4');
		$this->verifyTextPresent('Button1 is clicked and valid');

		// verify the second validator shows the error
		$this->click("ctl0_Content_ctl3");
		$this->verifyNotVisible('ctl0_Content_ctl0');
		$this->verifyVisible('ctl0_Content_ctl2');
		$this->verifyNotVisible('ctl0_Content_ctl4');

		// verify the second validation is passed
		$this->pause(500);
		$this->verifyTextNotPresent('Button2 is clicked');
		$this->type("ctl0_Content_TextBox2", "test");
		$this->clickAndWait("ctl0_Content_ctl3");
		$this->verifyNotVisible('ctl0_Content_ctl0');
		$this->verifyNotVisible('ctl0_Content_ctl2');
		$this->verifyNotVisible('ctl0_Content_ctl4');
		$this->verifyTextPresent('Button2 is clicked and valid');

		// verify the third validator shows the error
		$this->clickAndWait("ctl0_Content_ctl5");
		$this->verifyNotVisible('ctl0_Content_ctl0');
		$this->verifyNotVisible('ctl0_Content_ctl2');
		$this->verifyVisible('ctl0_Content_ctl4');

		// verify the third validation is passed
		$this->verifyTextPresent('Button3 is clicked');
		$this->verifyTextNotPresent('Button3 is clicked and valid');
		$this->type("ctl0_Content_TextBox3", "test");
		$this->clickAndWait("ctl0_Content_ctl5");
		$this->verifyNotVisible('ctl0_Content_ctl0');
		$this->verifyNotVisible('ctl0_Content_ctl2');
		$this->verifyNotVisible('ctl0_Content_ctl4');
		$this->verifyTextPresent('Button3 is clicked and valid');
	}
}