README
Functional tests extension for BusterJS. Adds helper functions to simulate basic user interactions.
Expects: jQuery to be present on the test target page.
Install
npm install buster-functional --save-dev
Add following snippet to your project's package.json
to allow buster-server
support
proxying without session prefixes.
"scripts":
{
"postinstall": "test ! -d ./node_modules/buster-functional || ./node_modules/buster-functional/bin/install_wrapper"
},
You might need to run npm run-script postinstall
for the first time.
Examples
Config
Just include buster-functional
as extension,
list proxied paths as resources, see Proxy resources.
'Functional tests':
{
environment: 'browser',
tests:
[
'tests/functional/**/*.js'
],
resources:
[
// provide proxy paths, "/" is occupied by buster itself
// so provide some alternative, like "/index"
{path: '/index', backend: 'http://localhost:3030/'},
{path: '/js', backend: 'http://localhost:3030/js'},
{path: '/css', backend: 'http://localhost:3030/css'},
{path: '/api', backend: 'http://localhost:3030/api'},
],
extensions:
[
require('buster-functional')
],
'buster-functional':
{
timeout: 120 // seconds
}
}
.load(uri, [callback])
Loads requested page into iframe.
Note: When page is loaded, references to it's window
, document
and $
are attached to the test's context.
setUp: function(done)
{
// load new app's homepage for each test
this.load('/index').waitForVar('