use of com.github.timurstrekalov.saga.core.FileServer in project saga by timurstrekalov.
the class InstrumentingProxyServerIT method setUp.
@Before
public void setUp() throws Exception {
final InstanceFieldPerPropertyConfig config = new InstanceFieldPerPropertyConfig();
proxyServer = new InstrumentingProxyServer(new HtmlUnitBasedScriptInstrumenter(config));
fileServer = new FileServer(new File(getClass().getResource("/tests").toURI()).getAbsolutePath());
proxyServerPort = proxyServer.start();
fileServerPort = fileServer.start();
final String proxyUrl = "localhost:" + proxyServerPort;
final Proxy proxy = new Proxy().setProxyType(Proxy.ProxyType.MANUAL).setHttpProxy(proxyUrl).setSslProxy(proxyUrl);
final DesiredCapabilities desiredCapabilities = new DesiredCapabilities();
desiredCapabilities.setCapability(CapabilityType.PROXY, proxy);
desiredCapabilities.setCapability(CapabilityType.SUPPORTS_JAVASCRIPT, true);
desiredCapabilities.setBrowserName(BrowserType.FIREFOX);
driver = new HtmlUnitDriver(desiredCapabilities) {
@Override
protected WebClient newWebClient(final BrowserVersion version) {
config.setBrowserVersion(version);
return WebClientFactory.newInstance(config);
}
};
}
Aggregations