Fix user/password combo
This commit is contained in:
parent
d7f3a038a9
commit
3c93224817
1 changed files with 8 additions and 2 deletions
|
|
@ -39,6 +39,11 @@ template check*(session: Session, element: string, function: untyped) =
|
|||
let el = session.findElement(element)
|
||||
check function(el)
|
||||
|
||||
template check*(session: Session, element: string,
|
||||
strategy: LocationStrategy, function: untyped) =
|
||||
let el = session.findElement(element, strategy)
|
||||
check function(el)
|
||||
|
||||
template checkText*(session: Session, element, expectedValue: string) =
|
||||
let el = session.findElement(element)
|
||||
check el.isSome()
|
||||
|
|
@ -67,13 +72,14 @@ proc logout*(session: Session) =
|
|||
with session:
|
||||
click "#profile-btn"
|
||||
click "#logout-btn"
|
||||
wait(5000)
|
||||
|
||||
proc login*(session: Session, user, password: string) =
|
||||
with session:
|
||||
click "#login-btn"
|
||||
|
||||
sendKeys "#login-form input[name='username']", "admin"
|
||||
sendKeys "#login-form input[name='password']", "admin"
|
||||
sendKeys "#login-form input[name='username']", user
|
||||
sendKeys "#login-form input[name='password']", password
|
||||
|
||||
sendKeys "#login-form input[name='password']", Key.Enter
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue