summaryrefslogtreecommitdiff
path: root/tests/FunctionalTests/active-controls/tests/ActiveCheckBoxTestCase.php
blob: 782b35be04a2e991019bd6d0013cd6483f09e027 (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
<?php

class ActiveCheckBoxTestCase extends PradoGenericSelenium2Test
{
	function test()
	{
		$base='ctl0_Content_';
		$this->url("active-controls/index.php?page=ActiveCheckBoxTest");
		$this->assertContains("Active CheckBox Test", $this->source());

		$this->assertText("{$base}checkbox1_label", "CheckBox 1");
		$this->assertText("{$base}checkbox2_label", "CheckBox 2");
		$this->assertText("{$base}label1", 'Label 1');

		$this->byId("{$base}change_text1")->click();
		$this->pause(800);
		$this->assertText("{$base}checkbox1_label", 'Hello CheckBox 1');

		$this->byId("{$base}change_text2")->click();
		$this->pause(800);
		$this->assertText("{$base}checkbox2_label", 'CheckBox 2 World');

		//check box 1
		$this->byId("{$base}change_checked1")->click();
		$this->pause(800);
		$this->assertTrue($this->byId("{$base}checkbox1")->selected());

		$this->byId("{$base}change_checked1")->click();
		$this->pause(800);
		$this->assertFalse($this->byId("{$base}checkbox1")->selected());

		//check box 2
		$this->byId("{$base}change_checked2")->click();
		$this->pause(800);
		$this->assertTrue($this->byId("{$base}checkbox2")->selected());

		$this->byId("{$base}change_checked2")->click();
		$this->pause(800);
		$this->assertFalse($this->byId("{$base}checkbox2")->selected());

		//click checkbox 1
		$this->byId("{$base}checkbox1")->click();
		$this->pause(800);
		$this->assertText("{$base}label1", "Label 1:Hello CheckBox 1 Checked");

		$this->byId("{$base}checkbox1")->click();
		$this->pause(800);
		$this->assertText("{$base}label1", "Label 1:Hello CheckBox 1 Not Checked");

		//click checkbox 2
		$this->byId("{$base}checkbox2")->click();
		$this->pause(800);
		$this->assertText("{$base}label1", "Label 1:CheckBox 2 World Checked");

		$this->byId("{$base}checkbox2")->click();
		$this->pause(800);
		$this->assertText("{$base}label1", "Label 1:CheckBox 2 World Not Checked");

	}
}