mirror of
https://github.com/DeviceFarmer/stf.git
synced 2026-04-21 16:25:13 +02:00
Try to clean up after logging in.
This commit is contained in:
@@ -4,6 +4,7 @@ module.exports = function LoginPage() {
|
||||
this.get = function () {
|
||||
return browser.get(this.login.url)
|
||||
}
|
||||
|
||||
this.username = element(by.model('username'))
|
||||
|
||||
if (this.login.method === 'ldap') {
|
||||
@@ -12,6 +13,7 @@ module.exports = function LoginPage() {
|
||||
this.email = element(by.model('email'))
|
||||
}
|
||||
|
||||
|
||||
this.setName = function (username) {
|
||||
return this.username.sendKeys(username)
|
||||
}
|
||||
@@ -32,6 +34,18 @@ module.exports = function LoginPage() {
|
||||
} else {
|
||||
this.setEmail(this.login.email)
|
||||
}
|
||||
return this.submit()
|
||||
|
||||
this.submit()
|
||||
|
||||
return browser.driver.wait(function () {
|
||||
return browser.driver.getCurrentUrl().then(function (url) {
|
||||
return /devices/.test(url)
|
||||
})
|
||||
})
|
||||
}
|
||||
this.cleanUp = function () {
|
||||
this.username = null
|
||||
this.password = null
|
||||
this.email = null
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user