Fix tests and merge

This commit is contained in:
Joey Yakimowich-Payne 2018-07-22 20:10:41 +09:00
commit 465ba1e024
5 changed files with 36 additions and 43 deletions

View file

@ -9,6 +9,11 @@ let
adminTitleStr = "This is a thread title!"
adminContentStr = "This is content"
proc banUser(session: Session, baseUrl: string) =
with session:
login baseUrl, "admin", "admin"
setUserRank baseUrl, "user", "banned"
logout baseUrl
proc userTests(session: Session, baseUrl: string) =
suite "user thread tests":
@ -34,6 +39,21 @@ proc userTests(session: Session, baseUrl: string) =
session.logout(baseUrl)
proc anonymousTests(session: Session, baseUrl: string) =
suite "anonymous user tests":
with session:
navigate baseUrl
wait()
test "can view banned thread":
with session:
ensureExists userTitleStr, LinkTextSelector
with session:
navigate baseUrl
wait()
proc bannedTests(session: Session, baseUrl: string) =
suite "banned user thread tests":
session.login(baseUrl, "banned", "banned")
@ -143,4 +163,5 @@ proc test*(session: Session, baseUrl: string) =
banUser(session, baseUrl)
bannedTests(session, baseUrl)
anonymousTests(session, baseUrl)
adminTests(session, baseUrl)