Implements web driver test suite and simple test.
This commit is contained in:
parent
770b5cddab
commit
c6ed9e80c9
8 changed files with 183 additions and 29 deletions
29
tests/browsertests/scenario1.nim
Normal file
29
tests/browsertests/scenario1.nim
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
import unittest, options, os
|
||||
|
||||
import webdriver
|
||||
|
||||
proc waitForLoad(session: Session) =
|
||||
sleep(2000)
|
||||
|
||||
while true:
|
||||
let loading = session.findElement(".loading")
|
||||
if loading.isNone: return
|
||||
sleep(1000)
|
||||
|
||||
proc test*(session: Session, baseUrl: string) =
|
||||
session.navigate(baseUrl)
|
||||
|
||||
waitForLoad(session)
|
||||
|
||||
# Sanity checks
|
||||
test "shows sign up":
|
||||
let signUp = session.findElement("#signup-btn")
|
||||
check signUp.get().getText() == "Sign up"
|
||||
|
||||
test "shows log in":
|
||||
let signUp = session.findElement("#login-btn")
|
||||
check signUp.get().getText() == "Log in"
|
||||
|
||||
test "is empty":
|
||||
let thread = session.findElement("tr > td.thread-title")
|
||||
check thread.isNone()
|
||||
Loading…
Add table
Add a link
Reference in a new issue