summaryrefslogtreecommitdiff
path: root/tests/FunctionalTests/active-controls/tests/CallbackAdapterTestCase.php
blob: d5d112d80ebc39561742a88983393badafab53c1 (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
55
56
57
58
59
60
61
62
63
64
65
66
<?php

class CallbackAdapterTestCase extends PradoGenericSelenium2Test
{
	function test()
	{
		$base='ctl0_Content_';
		$this->url("active-controls/index.php?page=ControlAdapterTest");
		$this->assertContains('Control Adapter - State Tracking Tests', $this->source());

		$this->byId("{$base}button2")->click();
		$this->assertEquals('ok', $this->alertText());
		$this->acceptAlert();

		$this->byId("{$base}test6")->click();
		$this->pause(800);
		$this->byId("{$base}test7")->click();
		$this->pause(800);
		$this->byId("{$base}test8")->click();
		$this->pause(800);
		$this->byId("{$base}test9")->click();
		$this->pause(800);

		$this->byId("{$base}button1")->click();
		$this->assertEquals('haha!', $this->alertText());
		$this->acceptAlert();

		$this->byId("{$base}button2")->click();
		$this->assertEquals('ok', $this->alertText());
		$this->acceptAlert();
    $this->pause(500);
		$this->assertEquals('baz!', $this->alertText());
		$this->acceptAlert();
	}
/*
	function testIE()
	{
		$this->url("active-controls/index.php?page=ControlAdapterTest");
		$this->assertContains('Control Adapter - State Tracking Tests', $this->source());

		$this->byId("{$base}button2")->click();
		$this->assertEquals('ok', $this->alertText());
		$this->acceptAlert();

		$this->byId('test6')->click();
		$this->pause(800);
		$this->byId('test7')->click();
		$this->pause(800);
		$this->byId('test8')->click();
		$this->pause(800);
		$this->byId('test9')->click();
		$this->pause(800);

		$this->byId("{$base}button1")->click();
		$this->assertEquals('haha!', $this->alertText());
		$this->acceptAlert();

		//IE alerts in diffrent order
		$this->byId("{$base}button2")->click();
		$this->assertEquals('baz!', $this->alertText());
		$this->acceptAlert();
		$this->assertEquals('ok', $this->alertText());
		$this->acceptAlert();
	}
*/
}