summaryrefslogtreecommitdiff
path: root/tests/FunctionalTests/active-controls/tests/ActiveRadioButtonTestCase.php
blob: 7606e46b44e96f515b45a6ff95e43ea670bf081c (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
<?php

class ActiveRadioButtonTestCase extends PradoGenericSelenium2Test
{
	function test()
	{
		$base='ctl0_Content_';
		$this->url("active-controls/index.php?page=ActiveRadioButtonTest");
		$this->assertContains("Active Radio Button Test", $this->source());
		$this->assertText("{$base}label1", 'Label 1');

		$this->assertFalse($this->byId("{$base}radio1")->selected());
		$this->assertFalse($this->byId("{$base}radio2")->selected());
		$this->assertFalse($this->byId("{$base}radio3")->selected());

		$this->assertText("{$base}radio1_label", 'Radio Button 1');
		$this->assertText("{$base}radio2_label", 'Radio Button 2');
		$this->assertText("{$base}radio3_label", 'Radio Button 3');

		$this->byId("{$base}change_text1")->click();
		$this->pause(800);
		$this->assertText("{$base}radio1_label", 'Hello Radio Button 1');
		$this->assertText("{$base}radio2_label", 'Radio Button 2');
		$this->assertText("{$base}radio3_label", 'Radio Button 3');

		$this->byId("{$base}change_text2")->click();
		$this->pause(800);
		$this->assertText("{$base}radio1_label", 'Hello Radio Button 1');
		$this->assertText("{$base}radio2_label", 'Radio Button 2 World');
		$this->assertText("{$base}radio3_label", 'Radio Button 3');

		$this->byId("{$base}change_radio1")->click();
		$this->pause(800);
		$this->assertTrue($this->byId("{$base}radio1")->selected());
		$this->assertFalse($this->byId("{$base}radio2")->selected());
		$this->assertFalse($this->byId("{$base}radio3")->selected());

		$this->byId("{$base}change_radio2")->click();
		$this->pause(800);
		$this->assertFalse($this->byId("{$base}radio1")->selected());
		$this->assertTrue($this->byId("{$base}radio2")->selected());
		$this->assertFalse($this->byId("{$base}radio3")->selected());


		$this->byId("{$base}radio3")->click();
		$this->pause(800);
		$this->assertFalse($this->byId("{$base}radio1")->selected());
		$this->assertTrue($this->byId("{$base}radio2")->selected());
		$this->assertTrue($this->byId("{$base}radio3")->selected());
		$this->assertText("{$base}label1", 'Label 1:Radio Button 3 Checked');


	}
}