summaryrefslogtreecommitdiff
path: root/tests/FunctionalTests/tickets/tests/Ticket205TestCase.php
blob: 35274e6f0e5484c03b8c2d2b8294b252e9aac52c (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 Ticket205TestCase extends PradoGenericSelenium2Test
{
	function test()
	{
		$base = 'ctl0_Content_';
		$this->url("tickets/index.php?page=Ticket205");
		$this->assertEquals($this->title(), "Verifying Ticket 205");

		$validator=$this->byId("{$base}validator1");
		$this->assertFalse($validator->displayed());

		$this->type("{$base}textbox1", "test");
		$this->byId("{$base}button1")->click();

		$this->assertEquals("error", $this->alertText());
		$this->acceptAlert();

		$this->assertTrue($validator->displayed());

		// type() calls clear() that triggers a focus change and thus a second alert
		$this->typeSpecial("{$base}textbox1", "Prado");

		$this->byId("{$base}button1")->click();
		$validator=$this->byId("{$base}validator1");
		$this->assertFalse($validator->displayed());
	}
}