dsfdf
This commit is contained in:
@@ -18,6 +18,10 @@ class NavigateService {
|
||||
return this[params.anchor](params)
|
||||
}
|
||||
|
||||
page(params) {
|
||||
return this._getDriver(params).then(driver => driver.findElement(By.css('body')).then(body => body.getAttribute('innerHTML')))
|
||||
}
|
||||
|
||||
login(params) {
|
||||
return this._getDriver(params).then(driver => {
|
||||
return driver.get(params.uri).then(() => driver.wait(until.elementLocated(By.css(params.css.password)), 5000)).then(async () => {
|
||||
@@ -38,11 +42,11 @@ class NavigateService {
|
||||
}
|
||||
|
||||
_getDriver(params) {
|
||||
return params.sessionId ? this._getDriverExists(params).catch(err => this._getNewDriver()) : this._getNewDriver()
|
||||
return params.sessionId ? this._getDriverExists(params) : this._getNewDriver()
|
||||
}
|
||||
|
||||
async _getDriverExists(params) {
|
||||
return new WebDriver(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))))
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user