ddd
This commit is contained in:
@@ -9,6 +9,7 @@ class NavigateService {
|
||||
this.config = {
|
||||
browser: 'chrome',
|
||||
hub: 'http://spiduler-chrome:4444/wd/hub',
|
||||
capabilities: Capabilities.chrome(),
|
||||
browserArgs: ['--no-sandbox', '--headless', '--disable-dev-shm-usage']
|
||||
}
|
||||
}
|
||||
@@ -41,17 +42,16 @@ class NavigateService {
|
||||
}
|
||||
|
||||
_getDriverExists(params) {
|
||||
return new WebDriver(new Session(params.sessionId), new _http.Executor(Promise.resolve(this.config.hub)
|
||||
return new WebDriver(new Session(params.sessionId, this.config.capabilities), new _http.Executor(Promise.resolve(this.config.hub)
|
||||
.then(url => new _http.HttpClient(url, null, null))))
|
||||
}
|
||||
|
||||
_getNewDriver() {
|
||||
let capabilities = Capabilities.chrome()
|
||||
let opts = new Options;
|
||||
opts.addArguments(this.config.browserArgs)
|
||||
return new Builder()
|
||||
.usingServer(this.config.hub)
|
||||
.withCapabilities(capabilities)
|
||||
.withCapabilities(this.config.capabilities)
|
||||
.forBrowser(this.config.browser)
|
||||
.setChromeOptions(opts)
|
||||
.build();
|
||||
|
||||
Reference in New Issue
Block a user