Make 5000 ms default wait

This commit is contained in:
Joey Yakimowich-Payne 2018-07-17 22:32:38 +09:00
commit 80558b6bfb
3 changed files with 8 additions and 11 deletions

View file

@ -66,18 +66,15 @@ proc waitForLoad*(session: Session, timeout=20000) =
if waitTime > timeout:
doAssert false, "Wait for load time exceeded"
proc wait*(session: Session) =
session.waitForLoad()
proc wait*(session: Session, msTimeout: int) =
proc wait*(session: Session, msTimeout: int = 5000) =
session.waitForLoad(msTimeout)
proc logout*(session: Session) =
with session:
wait(5000)
wait()
click "#profile-btn"
click "#profile-btn #logout-btn"
wait(5000)
wait()
proc login*(session: Session, user, password: string) =
with session:
@ -88,4 +85,4 @@ proc login*(session: Session, user, password: string) =
sendKeys "#login-form input[name='password']", Key.Enter
wait(5000)
wait()

View file

@ -26,7 +26,7 @@ proc test*(session: Session, baseUrl: string) =
sendKeys "#login-form input[name='password']", "admin"
sendKeys "#login-form input[name='password']", Key.Enter
wait 5000
wait()
# Verify that the user menu has been initialised properly.
click "#profile-btn"
@ -46,7 +46,7 @@ proc test*(session: Session, baseUrl: string) =
sendKeys "#signup-form input[name='password']", "test"
click "#signup-modal .create-account-btn"
wait 5000
wait()
# Verify that the user menu has been initialised properly.
click "#profile-btn"

View file

@ -80,7 +80,6 @@ proc test*(session: Session, baseUrl: string) =
test "can delete thread":
with session:
wait()
click titleStr, LinkTextSelector
wait()
@ -89,10 +88,11 @@ proc test*(session: Session, baseUrl: string) =
# click delete confirmation
click "#delete-modal .delete-btn"
wait()
# Make sure the forum post is gone
checkIsNone titleStr, LinkTextSelector
session.navigate(baseUrl)
waitForLoad(session)
session.wait()
logout(session)