Try to appease travis
This commit is contained in:
parent
b2fc4dfbe0
commit
0050ad42f5
3 changed files with 11 additions and 3 deletions
|
|
@ -44,6 +44,10 @@ template check*(session: Session, element: string,
|
|||
let el = session.findElement(element, strategy)
|
||||
check function(el)
|
||||
|
||||
template checkIsNone*(session: Session, element: string, strategy=CssSelector) =
|
||||
let el = session.findElement(element, strategy)
|
||||
check el.isNone()
|
||||
|
||||
template checkText*(session: Session, element, expectedValue: string) =
|
||||
let el = session.findElement(element)
|
||||
check el.isSome()
|
||||
|
|
@ -70,8 +74,9 @@ proc wait*(session: Session, msTimeout: int) =
|
|||
|
||||
proc logout*(session: Session) =
|
||||
with session:
|
||||
wait(5000)
|
||||
click "#profile-btn"
|
||||
click "#logout-btn"
|
||||
click "#profile-btn #logout-btn"
|
||||
wait(5000)
|
||||
|
||||
proc login*(session: Session, user, password: string) =
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ proc test*(session: Session, baseUrl: string) =
|
|||
session.checkText("#login-btn", "Log in")
|
||||
|
||||
test "is empty":
|
||||
session.check("tr > td.thread-title", isNone)
|
||||
session.checkIsNone("tr > td.thread-title")
|
||||
|
||||
# Logging in
|
||||
test "can login/logout":
|
||||
|
|
|
|||
|
|
@ -80,6 +80,7 @@ proc test*(session: Session, baseUrl: string) =
|
|||
|
||||
test "can delete thread":
|
||||
with session:
|
||||
wait()
|
||||
click titleStr, LinkTextSelector
|
||||
wait()
|
||||
|
||||
|
|
@ -90,6 +91,8 @@ proc test*(session: Session, baseUrl: string) =
|
|||
click "#delete-modal .delete-btn"
|
||||
|
||||
# Make sure the forum post is gone
|
||||
check titleStr, LinkTextSelector, isNone
|
||||
checkIsNone titleStr, LinkTextSelector
|
||||
|
||||
session.navigate(baseUrl)
|
||||
waitForLoad(session)
|
||||
logout(session)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue