Documentation ¶
Overview ¶
Package webassert contains test helpers to the check the rooms web pages for certain aspects.
Index ¶
- func CSRFTokenPresent(t *testing.T, sel *goquery.Selection) url.Values
- func ElementsInForm(t *testing.T, form *goquery.Selection, elems []FormElement)
- func HasFlashMessages(t *testing.T, client *tester.Tester, url *url.URL, labels ...string)
- func Localized(t *testing.T, html *goquery.Document, elems []LocalizedElement)
- type FormElement
- type LocalizedElement
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CSRFTokenPresent ¶
CSRFTokenPresent checks a CSRF token is in side the passed selection (ususally a form). The function returns a url.Values map with the token, which can be used to craft further requests.
func ElementsInForm ¶
func ElementsInForm(t *testing.T, form *goquery.Selection, elems []FormElement)
ElementsInForm checks a list of defined elements. It tries to find them by input[name=$name] and then proceeds with asserting their value, type or placeholder (if the fields in FormElement are not "")
func HasFlashMessages ¶
Types ¶
type FormElement ¶
type FormElement struct {
Tag, Name, Value, Type, Placeholder string
}
type LocalizedElement ¶
type LocalizedElement struct {
Selector, Label string
}
Click to show internal directories.
Click to hide internal directories.