Add basic categories test
This commit is contained in:
parent
d35f1e90cf
commit
2e42ede2ad
2 changed files with 54 additions and 1 deletions
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