-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathtestProxy.js
47 lines (40 loc) · 1.32 KB
/
testProxy.js
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
"use strict";
test("Proxy subsystem", () => {
chunk("It should use URL via global proxy", async () => {
await $.restartBrowser();
await $.openUrl("https://opennet.ru");
});
chunk("It should manage global proxy inside test", async () => {
await $.restartBrowser();
await $.openUrl("https://opennet.ru");
await $.stopGlobalProxy();
await $.restartBrowser();
await $.openUrl("https://opennet.ru");
await $.startGlobalProxy();
});
chunk("It should open web URL via http proxy", async () => {
await $.restartBrowser();
await $.openApp();
});
chunk("It should activate proxy cache", async () => {
await $.restartBrowser();
$.enableCache();
await $.openApp(); // cache population
await $.openApp(); // cache usage
$.disableCache();
await $.openApp();
});
chunk("It should capture info about server responses", async () => {
await $.restartBrowser();
$.measureResponses();
await $.openApp();
$.getResponsesData();
});
chunk("It should limit proxy speed", async () => {
await $.restartBrowser();
$.limitProxySpeed(256 /* kb/s */);
await $.openApp();
$.unlimitProxySpeed();
await $.openApp();
});
});