summaryrefslogtreecommitdiff
path: root/tests/FunctionalTests/active-controls/tests/AutoCompleteTestCase.php
blob: 2033d6ff04183c545a3fcbe11bb93d2a1d0028eb (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
<?php

class AutoCompleteTestCase extends PradoGenericSeleniumTest
{
	function test()
	{
		$this->open("active-controls/index.php?page=AutoCompleteTest");
		$this->verifyTextPresent("TAutoComplete Test");

		$this->assertText("label1", "Label 1");

		$this->type("textbox3", 'a');
		$this->runScript('Prado.Registry.get(\'textbox3\').onKeyPress({})');
		$this->pause(500);
		$this->verifyTextPresent('Andorra');
		$this->assertText("label1", "suggestion for a");

		$this->type("textbox3", 'au');
		$this->runScript('Prado.Registry.get(\'textbox3\').onKeyPress({})');
		$this->pause(500);
		$this->verifyTextPresent('Australia');
		$this->assertText("label1", "suggestion for au");

		$this->click("css=#textbox3_result ul li");
		$this->pause(500);
		$this->assertText("label1", "Label 1: Austria");

		$this->type("textbox2", "cu");
		$this->runScript('Prado.Registry.get(\'textbox2\').onKeyPress({})');
		$this->pause(500);
		$this->click('css=#textbox2_result ul li');
		$this->pause(500);
		$this->assertText("label1", "Label 1: Cuba");

		$this->type("textbox2", "Cuba,me");
		$this->runScript('Prado.Registry.get(\'textbox2\').onKeyPress({})');
		$this->pause(500);
		$this->click('css=#textbox2_result ul li');
		$this->pause(500);
		$this->assertText("label1", "Label 1: Cuba,Mexico");
	}
}