Make 5000 ms default wait
This commit is contained in:
parent
c361fda523
commit
80558b6bfb
3 changed files with 8 additions and 11 deletions
|
|
@ -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()
|
||||
|
|
|
|||
|
|
@ -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"
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue