blob: d6cac6d1502a1216a87535a5f61ec2f3e1de1d9c (
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
|
<?php
require_once 'PHPUnit/Extensions/Selenium2TestCase.php';
// TODO: stub
class PradoGenericSelenium2Test extends PHPUnit_Extensions_Selenium2TestCase
{
static $browser='firefox';
static $baseurl='http://127.0.0.1/prado-master/tests/FunctionalTests/';
static $timeout=5; //seconds
static $wait=1000; //msecs
protected function setUp()
{
$this->setBrowser(static::$browser);
$this->setBrowserUrl(static::$baseurl);
$this->setSeleniumServerRequestsTimeout(static::$timeout);
}
public function setUpPage()
{
$this->timeouts()->implicitWait(static::$wait);
}
protected function open($url)
{
$this->url($url);
}
protected function tearDown()
{
}
protected function verifyTextPresent($txt)
{
$this->assertContains($txt, $this->source());
}
protected function assertText($id, $txt)
{
$element = $this->byId($id);
$this->assertEquals($txt, $element->text());
}
protected function pause($msec)
{
usleep($msec*1000);
}
}
|