forked from janodvarko/harviewer
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtestSearchJsonQuery.php
More file actions
35 lines (28 loc) · 1.21 KB
/
Copy pathtestSearchJsonQuery.php
File metadata and controls
35 lines (28 loc) · 1.21 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
<?php
require_once("HARTestCase.php");
/**
* Test HAR Viewer Search using JSON Query
*/
class HAR_TestSearchJsonQuery extends HAR_TestCase
{
public function testCase()
{
print "\ntestSearchJsonQuery.php";
$viewerURL = $GLOBALS["test_base"]."tests/testSearchJsonQuery.html.php";
$harFileURL = $GLOBALS["test_base"]."tests/hars/searchHAR.har";
$this->open($viewerURL."?path=".$harFileURL);
$this->assertCookie("regexp:searchJsonQuery");
// Select the DOM tab
$this->click("css=.DOMTab");
$this->assertElementExists("css=.DOMTab.selected");
// Type JSON Query expression into the search field and press enter.
$this->focus("css=.tabDOMBody .searchInput");
$this->type("css=.tabDOMBody .searchInput", "$..request");
$this->keyDown("css=.tabDOMBody .searchInput", "\\13");
$this->assertElementExists("css=.tabDOMBody .domBox .results.visible");
$document = "selenium.browserbot.getCurrentWindow().document.";
$script = $document."querySelectorAll('.tabDOMBody .domBox .results .memberRow').length";
$this->assertEquals("8", $this->getEval($script));
}
}
?>