summaryrefslogtreecommitdiff
path: root/tests/FunctionalTests/active-controls/tests/ActiveDropDownListTestCase.php
blob: 5806a3eca1f25dfc965eeded7d739a4b9ecd1ac8 (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
<?php

class ActiveDropDownListTestCase extends SeleniumTestCase
{
	function test()
	{
		$this->open("active-controls/index.php?page=ActiveDropDownList");
		$this->assertTextPresent('Active Drop Down List Test Case');
		
		$this->assertText("label1", "Label 1");
		
		$this->click("button1");
		$this->pause(500);
		$this->assertSelected("list1", "item 4");
		
		$this->click("button2");
		$this->pause(500);
		$this->assertEmptySelection("list1");
		
		$this->click("button3");
		$this->pause(500);
		$this->assertSelected("list1", "item 2");
		
		// due to clearing selection and then updating the selection
		// otherwise it should not fire the changed event (fired by js because of change to options).
		$this->assertText("label1", "Selection 1: value 1"); 
		
		$this->select("list2", "value 1 - item 4");
		$this->pause(500);		
		$this->assertText("label1", "Selection 2: value 1 - item 4");
		
		$this->select("list1", "item 3");
		$this->pause(500);
		$this->select("list2", "value 3 - item 5");
		$this->pause(500);
		$this->assertText("label1", "Selection 2: value 3 - item 5");

	}
}

?>