var TestSuites []interface{} // Array of structs that embed TestSuite
type TestSuite struct { Client *http.Client Response *http.Response ResponseBody []byte Session Session }
func NewTestSuite() TestSuite
NewTestSuite returns an initialized TestSuite ready for use. It is invoked by the test harness to initialize the embedded field in application tests.
func (t *TestSuite) Assert(exp bool)
func (t *TestSuite) AssertContains(s string)
Assert that the response contains the given string.
func (t *TestSuite) AssertContainsRegex(regex string)
Assert that the response matches the given regular expression.BUG
func (t *TestSuite) AssertContentType(contentType string)
func (t *TestSuite) AssertEqual(expected, actual interface{})
func (t *TestSuite) AssertHeader(name, value string)
func (t *TestSuite) AssertNotFound()
func (t *TestSuite) AssertOk()
func (t *TestSuite) AssertStatus(status int)
func (t *TestSuite) Assertf(exp bool, formatStr string, args ...interface{})
func (t *TestSuite) BaseUrl() string
Return the base http/https URL of the server, e.g. "http://127.0.0.1:8557". The scheme is set to https if http.ssl is set to true in the configuration file.
func (t *TestSuite) Delete(path string)
Issue a DELETE request to the given path and store the result in Request and RequestBody.
func (t *TestSuite) Get(path string)
Issue a GET request to the given path and store the result in Request and RequestBody.
func (t *TestSuite) Host() string
Return the address and port of the server, e.g. "127.0.0.1:8557"
func (t *TestSuite) MakeRequest(req *http.Request)
Issue any request and read the response. If successful, the caller may examine the Response and ResponseBody properties. You will need to manage session / cookie data manually
func (t *TestSuite) MakeRequestSession(req *http.Request)
Issue any request and read the response. If successful, the caller may examine the Response and ResponseBody properties. Session data will be added to the request cookies for you.
func (t *TestSuite) Post(path string, contentType string, reader io.Reader)
Issue a POST request to the given path, sending the given Content-Type and data, and store the result in Request and RequestBody. "data" may be nil.
func (t *TestSuite) PostForm(path string, data url.Values)
Issue a POST request to the given path as a form post of the given key and values, and store the result in Request and RequestBody.
func (t *TestSuite) WebSocket(path string) *websocket.Conn
Create a websocket connection to the given path and return the connection
func (t *TestSuite) WebSocketUrl() string
Return the base websocket URL of the server, e.g. "ws://127.0.0.1:8557"