forked from janodvarko/harviewer
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtestExamples.php
More file actions
36 lines (29 loc) · 1.1 KB
/
testExamples.php
File metadata and controls
36 lines (29 loc) · 1.1 KB
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
<?php
require_once("HARTestCase.php");
/**
* Click on all four HAR log examples and verify they are properly displayed.
*/
class HAR_TestExamples extends HAR_TestCase
{
public function testExamples()
{
print "\ntestExamples.php";
$this->loadAndVerify("example1", "Cuzillion");
$this->loadAndVerify("example2", "Cuzillion");
$this->loadAndVerify("example3", "Software is hard | Firebug 1.6 beta 1 Released");
$this->loadAndVerify("example4", "Google");
}
protected function loadAndVerify($exampleId, $expected)
{
$this->open($GLOBALS["harviewer_base"]);
$this->assertElementExists("id=".$exampleId);
// The third example takes some time to parse.
$this->setSleep(3);
// Click on the example link
$this->clickAndWait("id=".$exampleId);
// The Preview tab must be selected and example HAR file loaded.
$this->assertElementContainsText("css=.PreviewTab.selected", "Preview");
$this->assertElementContainsText("css=.previewList", $expected);
}
}
?>