summaryrefslogtreecommitdiff
path: root/tests/FunctionalTests/tickets/tests/Ticket578TestCase.php
blob: f95af91b678b23e7e4a983cce59d3065e66957e7 (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
<?php

class Ticket578TestCase extends SeleniumTestCase
{
	function test()
	{
		$base = 'ctl0_Content_';
		$this->open('tickets/index.php?page=Ticket578');
		$this->verifyTitle("Verifying Ticket 578", "");

		$this->assertText("{$base}label1", "Label 1");
		$this->click("{$base}button1", "");
		$this->pause(800);
		$this->assertText("{$base}label1", "Button 1 was clicked : ");

		$this->store($this->setTinymceHtml("{$base}text1", "helloworld"),"t2");
		$this->click("{$base}button1", "");
		$this->pause(800);
		$this->assertText("{$base}label1", "Button 1 was clicked : helloworld");
	}

	function setTinymceHtml($id, $text)
	{
		$tinymce = "this.browserbot.getCurrentWindow().tinyMCE.getInstanceById('{$id}')";
		return 'javascript{'."{$tinymce}.setHTML('{$text}') ? 0 : 1".'}';
	}
}

?>