summaryrefslogtreecommitdiff
path: root/tests/FunctionalTests/protected/pages/UI/testOnClickAttribute.php
blob: 3d9fc8406aad91c9b40819ea8f72fb1504e9e86f (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
<?php

/**
 * testOnClickAttribute
 *
 * @author Wei Zhuo <weizhuo[at]gmail[dot]com>
 * @version $Revision: $  $Date: $
 * @package System.Web.UI.WebControls
 * @since 3.0
 */
class testOnClickAttribute extends TPage
{
	function doClick()
	{
		$this->clickState->setText("Post Back clicked!");
	}
}

class OnClickAttributeTestCase extends SeleniumTestCase
{
	function test()
	{
		$page = Prado::getApplication()->getTestPage(__FILE__);
		$this->open($page);
		$this->assertTitle("Test Attributes.OnClick");
		$this->click("link=Click me");
		$this->assertConfirmation("Are you sure?");
		$this->chooseCancelOnNextConfirmation();
		$this->assertTextNotPresent("Post Back clicked!");
		$this->clickAndWait("link=Click me");
		$this->assertConfirmation("Are you sure?");
		$this->assertTextPresent("Post Back clicked!");
	}
}

?>