Speedup and simplify tests

This drastically speeds up tests and simplifies test writing by making
it so that no explicit calls for waiting are needed. Elements that are
queried for now implicitly waits for them to be available.

On my machine, tests used to take 3-4 minutes to complete. Now they take
~1 minute to complete.
This commit is contained in:
Joey Yakimowich-Payne 2020-02-16 19:19:21 -07:00 • committed by Andreas Rumpf
commit 5a4f44b4ee
7 changed files with 40 additions and 83 deletions

View file

@ -5,8 +5,6 @@ import webdriver
proc test*(session: Session, baseUrl: string) =
session.navigate(baseUrl)
waitForLoad(session)
test "can see banned posts":
with session:
register("issue181", "issue181")
@ -19,7 +17,6 @@ proc test*(session: Session, baseUrl: string) =
login("issue181", "issue181")
navigate(baseUrl)
wait()
const title = "Testing issue 181."
createThread(title, "Test for issue #181")
@ -33,7 +30,6 @@ proc test*(session: Session, baseUrl: string) =
# Make sure the banned user's thread is still visible.
navigate(baseUrl)
wait()
ensureExists("tr.banned")
checkText("tr.banned .thread-title > a", title)
logout()