summaryrefslogtreecommitdiff
path: root/tests/FunctionalTests/quickstart/Controls/ImageButtonTestCase.php
blob: 4b2813a7ed5c135bdf46902181baa1223f4eaac5 (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
<?php

class QuickstartImageButtonTestCase extends PradoGenericSelenium2Test
{
	function test ()
	{
		$this->url("../../demos/quickstart/index.php?page=Controls.Samples.TImageButton.Home&amp;notheme=true&amp;lang=en");

		$this->assertEquals("PRADO QuickStart Sample", $this->title());

		// a click button
		$this->byXPath("//input[@type='image' and @alt='hello world']")->click();
		$this->assertSourceContains("You clicked at ");

		// a command button
		$this->byName("ctl0\$body\$ctl1")->click();
		$this->assertSourceContains("Command name: test, Command parameter: value");

		// a button causing validation
		$this->assertNotVisible('ctl0_body_ctl2');
		$this->byId("ctl0_body_ctl3")->click();
//		$this->pause(1000);
		$this->assertVisible('ctl0_body_ctl2');
		$this->type("ctl0\$body\$TextBox", "test");
		$this->byId("ctl0_body_ctl3")->click();
		$this->assertNotVisible('ctl0_body_ctl2');
	}
}