Reload fixtures for tests and finish testing home

This commit is contained in:
Rowan Manning
2013-11-21 13:54:52 +00:00
parent a47fb38d7f
commit b5735b7f05
4 changed files with 42 additions and 6 deletions

View File

@@ -1,9 +1,10 @@
/* global before */
/* jshint maxlen: 200 */
/* global afterEach, before */
/* jshint maxlen: false, maxstatements: false */
'use strict';
var config = require('../../config/test.json');
var createNavigator = require('./helper/navigate');
var loadFixtures = require('pa11y-webservice/data/fixture/load');
var request = require('request');
// Run before all tests
@@ -11,7 +12,14 @@ before(function (done) {
this.baseUrl = 'http://localhost:' + config.port;
this.last = {};
this.navigate = createNavigator(this.baseUrl, this.last);
assertTestAppIsRunning(this.baseUrl, done);
assertTestAppIsRunning(this.baseUrl, function () {
loadFixtures('test', config.webservice, done);
});
});
// Run after each test
afterEach(function (done) {
loadFixtures('test', config.webservice, done);
});
// Check that the test application is running, and exit if not