forked from janodvarko/harviewer
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtestRequestBody.php
More file actions
62 lines (46 loc) · 1.98 KB
/
Copy pathtestRequestBody.php
File metadata and controls
62 lines (46 loc) · 1.98 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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
<?php
require_once("HARTestCase.php");
/**
* Test content of the Schema tab.
*/
class HAR_TestRequestBody extends HAR_TestCase
{
public function testUrlParams()
{
print "\ntestRequestBody.php (1)";
$viewer_base = $GLOBALS["harviewer_base"];
$test_base = $GLOBALS["test_base"];
$url = $viewer_base."?path=".$test_base."tests/hars/url-params.har";
$this->open($url);
// The Preview tab must be selected
$this->assertElementContainsText("css=.PreviewTab.selected", "Preview");
// There must be one page (expanded).
$this->assertElementContainsText("css=.pageRow.opened",
"Test Case for encoded ampersand in URL");
// Expand the only request entry.
$this->click("css=.netFullHrefLabel.netHrefLabel.netLabel");
$this->assertElementExists("css=.netInfoRow");
$this->click("css=.ParamsTab.tab");
$this->assertElementContainsText("css=.tabParamsBody.tabBody.selected ",
"value11value22value33");
}
public function testDataURL()
{
print "\ntestRequestBody.php (2)";
$viewer_base = $GLOBALS["harviewer_base"];
$test_base = $GLOBALS["test_base"];
$url = $viewer_base."?path=".$test_base."tests/hars/data-url.har";
$this->open($url);
// The Preview tab must be selected
$this->assertElementContainsText("css=.PreviewTab.selected", "Preview");
// There must be one page (expanded).
$this->assertElementContainsText("css=.pageRow.opened", "http://www.test.com/");
// Expand the only request entry.
$this->click("css=.netFullHrefLabel.netHrefLabel.netLabel");
$this->assertElementExists("css=.netInfoRow");
$this->click("css=.DataURLTab.tab");
$this->assertElementContainsText("css=.tabDataURLBody.tabBody.selected ",
"data:text/css;charset=utf-8,body{text-align:center;}");
}
}
?>