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

class ReplaceContentTestCase extends SeleniumTestCase
{
	function test()
	{
		$this->open('active-controls/index.php?page=ReplaceContentTest');
		$this->assertTextPresent('Callback Replace Content Test');

		$this->assertText('subpanel', 'Sub Panel');
		$this->assertText('panel1', 'Main Panel Sub Panel');

		$this->type('content', 'something');

		$this->click('btn_append');
		$this->pause(800);

		$this->assertText('subpanel', 'Sub Panel something');
		$this->assertText('panel1', 'Main Panel Sub Panel something');

		$this->type('content', 'more');
		$this->click('btn_prepend');
		$this->pause(800);

		$this->assertText('subpanel', 'more Sub Panel something');
		$this->assertText('panel1', 'Main Panel more Sub Panel something');


		$this->type('content', 'prado');
		$this->click('btn_before');
		$this->pause(800);

		$this->assertText('subpanel', 'more Sub Panel something');
		$this->assertText('panel1', 'Main Panel pradomore Sub Panel something');

		$this->type('content', ' php ');
		$this->click('btn_after');
		$this->pause(800);

		$this->type('content', 'mauahahaha');
		$this->click('btn_replace');
		$this->pause(1000);

		$this->assertText('panel1', 'Main Panel pradomauahahahaphp');
	}
}

?>