forked from janodvarko/harviewer
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtestSearchHAR.php
More file actions
39 lines (33 loc) · 1.29 KB
/
Copy pathtestSearchHAR.php
File metadata and controls
39 lines (33 loc) · 1.29 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
37
38
39
<?php
require_once("HARTestCase.php");
/**
* Check search feature on the HAR tab.
*/
class HAR_TestSearchHAR extends HAR_TestCase
{
public function testPhases()
{
print "\ntestSearchHAR.php";
$viewer_base = $GLOBALS["harviewer_base"];
$test_base = $GLOBALS["test_base"];
$url = $viewer_base."?path=".$test_base."tests/hars/searchHAR.har";
$this->open($url);
// Select the DOM tab
$this->click("css=.DOMTab");
$this->assertElementExists("css=.DOMTab.selected");
// Type text into the search field and press enter.
// From some reason the viewer doesn't receive "keyDown" events so, incremental
// search isn't tested.
$this->focus("css=.tabDOMBody .searchInput");
$this->keyPress("css=.tabDOMBody .searchInput", "f");
$this->keyPress("css=.tabDOMBody .searchInput", "i");
$this->keyPress("css=.tabDOMBody .searchInput", "r");
$this->keyPress("css=.tabDOMBody .searchInput", "e");
$this->keyDown("css=.tabDOMBody .searchInput", "\\13");
// Check selection on the page.
$this->waitForCondition(
"selenium.browserbot.getCurrentWindow().getSelection().toString() == 'Fire'",
10000);
}
}
?>