Add basic categories test
This commit is contained in:
parent
d35f1e90cf
commit
2e42ede2ad
2 changed files with 54 additions and 1 deletions
|
|
@ -43,7 +43,7 @@ template withBackend(body: untyped): untyped =
|
||||||
|
|
||||||
body
|
body
|
||||||
|
|
||||||
import browsertests/[scenario1, threads, issue181]
|
import browsertests/[scenario1, threads, issue181, categories]
|
||||||
|
|
||||||
when isMainModule:
|
when isMainModule:
|
||||||
spawn runProcess("geckodriver -p 4444 --log config")
|
spawn runProcess("geckodriver -p 4444 --log config")
|
||||||
|
|
@ -64,6 +64,7 @@ when isMainModule:
|
||||||
withBackend:
|
withBackend:
|
||||||
scenario1.test(session, baseUrl)
|
scenario1.test(session, baseUrl)
|
||||||
threads.test(session, baseUrl)
|
threads.test(session, baseUrl)
|
||||||
|
categories.test(session, baseUrl)
|
||||||
issue181.test(session, baseUrl)
|
issue181.test(session, baseUrl)
|
||||||
|
|
||||||
session.close()
|
session.close()
|
||||||
|
|
|
||||||
52
tests/browsertests/categories.nim
Normal file
52
tests/browsertests/categories.nim
Normal file
|
|
@ -0,0 +1,52 @@
|
||||||
|
import unittest, options, os, common
|
||||||
|
|
||||||
|
import webdriver
|
||||||
|
|
||||||
|
proc selectCategory(session: Session, name: string) =
|
||||||
|
with session:
|
||||||
|
click "#category-selection .dropdown-toggle"
|
||||||
|
|
||||||
|
click "#category-selection ." & name
|
||||||
|
|
||||||
|
|
||||||
|
proc categoriesTests(session: Session, baseUrl: string) =
|
||||||
|
let
|
||||||
|
title = "Category Test"
|
||||||
|
content = "Choosing category test"
|
||||||
|
|
||||||
|
with session:
|
||||||
|
navigate baseUrl
|
||||||
|
wait()
|
||||||
|
login "user", "user"
|
||||||
|
|
||||||
|
test "can create category thread":
|
||||||
|
with session:
|
||||||
|
click "#new-thread-btn"
|
||||||
|
wait()
|
||||||
|
|
||||||
|
sendKeys "#thread-title", title
|
||||||
|
|
||||||
|
selectCategory "fun"
|
||||||
|
|
||||||
|
sendKeys "#reply-textarea", content
|
||||||
|
|
||||||
|
click "#create-thread-btn"
|
||||||
|
wait()
|
||||||
|
|
||||||
|
checkText "#thread-title .category", "Fun"
|
||||||
|
|
||||||
|
navigate baseUrl
|
||||||
|
wait()
|
||||||
|
|
||||||
|
ensureExists title, LinkTextSelector
|
||||||
|
|
||||||
|
session.logout()
|
||||||
|
|
||||||
|
proc test*(session: Session, baseUrl: string) =
|
||||||
|
session.navigate(baseUrl)
|
||||||
|
session.wait()
|
||||||
|
|
||||||
|
categoriesTests(session, baseUrl)
|
||||||
|
|
||||||
|
session.navigate(baseUrl)
|
||||||
|
session.wait()
|
||||||
Loading…
Add table
Add a link
Reference in a new issue