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: if waitTime > timeout:
doAssert false, "Wait for load time exceeded" doAssert false, "Wait for load time exceeded"
proc wait*(session: Session) = proc wait*(session: Session, msTimeout: int = 5000) =
session.waitForLoad()
proc wait*(session: Session, msTimeout: int) =
session.waitForLoad(msTimeout) session.waitForLoad(msTimeout)
proc logout*(session: Session) = proc logout*(session: Session) =
with session: with session:
wait(5000) wait()
click "#profile-btn" click "#profile-btn"
click "#profile-btn #logout-btn" click "#profile-btn #logout-btn"
wait(5000) wait()
proc login*(session: Session, user, password: string) = proc login*(session: Session, user, password: string) =
with session: with session:
@ -88,4 +85,4 @@ proc login*(session: Session, user, password: string) =
sendKeys "#login-form input[name='password']", Key.Enter 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']", "admin"
sendKeys "#login-form input[name='password']", Key.Enter sendKeys "#login-form input[name='password']", Key.Enter
wait 5000 wait()
# Verify that the user menu has been initialised properly. # Verify that the user menu has been initialised properly.
click "#profile-btn" click "#profile-btn"
@ -46,7 +46,7 @@ proc test*(session: Session, baseUrl: string) =
sendKeys "#signup-form input[name='password']", "test" sendKeys "#signup-form input[name='password']", "test"
click "#signup-modal .create-account-btn" click "#signup-modal .create-account-btn"
wait 5000 wait()
# Verify that the user menu has been initialised properly. # Verify that the user menu has been initialised properly.
click "#profile-btn" click "#profile-btn"

View file

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