Adds attempt to test issue #181. Moves procs to common too.
Sadly the attempt wasn't a success. I decided to commit what I've got so far and come back to it later. Out of time for this now.
This commit is contained in:
parent
9f9d16467f
commit
5714ad0c6a
5 changed files with 108 additions and 31 deletions
|
|
@ -20,39 +20,16 @@ proc test*(session: Session, baseUrl: string) =
|
|||
# Logging in
|
||||
test "can login/logout":
|
||||
with session:
|
||||
click "#login-btn"
|
||||
|
||||
sendKeys "#login-form input[name='username']", "admin"
|
||||
sendKeys "#login-form input[name='password']", "admin"
|
||||
|
||||
sendKeys "#login-form input[name='password']", Key.Enter
|
||||
wait()
|
||||
|
||||
# Verify that the user menu has been initialised properly.
|
||||
click "#profile-btn"
|
||||
checkText "#profile-btn #profile-name", "admin"
|
||||
login("admin", "admin")
|
||||
|
||||
# Check whether we can log out.
|
||||
click "#logout-btn"
|
||||
logout()
|
||||
# Verify we have logged out by looking for the log in button.
|
||||
ensureExists "#login-btn"
|
||||
|
||||
test "can register":
|
||||
with session:
|
||||
click "#signup-btn"
|
||||
|
||||
sendKeys "#signup-form input[name='email']", "test@test.com"
|
||||
sendKeys "#signup-form input[name='username']", "test"
|
||||
sendKeys "#signup-form input[name='password']", "test"
|
||||
|
||||
click "#signup-modal .create-account-btn"
|
||||
wait()
|
||||
|
||||
# Verify that the user menu has been initialised properly.
|
||||
click "#profile-btn"
|
||||
checkText "#profile-btn #profile-name", "test"
|
||||
# close menu
|
||||
click "#profile-btn"
|
||||
register("test", "test")
|
||||
|
||||
session.navigate(baseUrl)
|
||||
session.wait()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue