Drawing tests structure cleanup

This commit is contained in:
jdescottes 2014-08-26 08:21:58 +02:00
parent 35d4be5d3e
commit b2ab504422
22 changed files with 21 additions and 20 deletions

View file

@ -26,16 +26,16 @@ module.exports = function(grunt) {
var piskelStyles = require('./src/piskel-style-list.js').styles.map(mapToSrcFolder); var piskelStyles = require('./src/piskel-style-list.js').styles.map(mapToSrcFolder);
var mapToCasperFolder = function (path) { var mapToCasperFolder = function (path) {
return "test/integration/casperjs/" + path; return "test/casperjs/" + path;
}; };
var casperEnvironments = { var casperEnvironments = {
'local' : { 'local' : {
suite : './test/integration/casperjs/LocalTestSuite.js', suite : './test/casperjs/LocalTestSuite.js',
delay : 50 delay : 50
}, },
'travis' : { 'travis' : {
suite : './test/integration/casperjs/TravisTestSuite.js', suite : './test/casperjs/TravisTestSuite.js',
delay : 5000 delay : 5000
} }
}; };

View file

@ -72,5 +72,5 @@ var Constants = {
EMPTY_FUNCTION : function () {}, EMPTY_FUNCTION : function () {},
// TESTS // TESTS
BASE_TEST_FOLDER : 'integration/casperjs/drawing-records' DRAWING_TEST_FOLDER : 'drawing'
}; };

View file

@ -3,7 +3,7 @@
ns.DrawingTestSuiteController = function (suitePath) { ns.DrawingTestSuiteController = function (suitePath) {
if (suitePath.indexOf('/') === -1) { if (suitePath.indexOf('/') === -1) {
suitePath = [Constants.BASE_TEST_FOLDER, suitePath].join('/'); suitePath = [Constants.DRAWING_TEST_FOLDER, suitePath].join('/');
} }
this.suitePath = suitePath; this.suitePath = suitePath;
this.testSuiteRunner = null; this.testSuiteRunner = null;
@ -41,7 +41,7 @@
ns.DrawingTestSuiteController.prototype.onTestSuiteLoaded_ = function (response) { ns.DrawingTestSuiteController.prototype.onTestSuiteLoaded_ = function (response) {
var testPaths = JSON.parse(response.responseText).tests; var testPaths = JSON.parse(response.responseText).tests;
testPaths = testPaths.map(function (path) { testPaths = testPaths.map(function (path) {
return this.suitePath.replace(/\/([^\/]+\.json)/i, '/' + path); return [Constants.DRAWING_TEST_FOLDER, 'tests', path].join('/');
}.bind(this)); }.bind(this));
this.testSuiteRunner = new ns.DrawingTestSuiteRunner(testPaths); this.testSuiteRunner = new ns.DrawingTestSuiteRunner(testPaths);
this.testSuiteRunner.start(); this.testSuiteRunner.start();

View file

@ -70,7 +70,7 @@
}; };
ns.TestRecordController.prototype.onTestRecordEnd_ = function (evt, success) { ns.TestRecordController.prototype.onTestRecordEnd_ = function (evt, success) {
console.log('test finished : ', success); window.alert('Test finished : ', success);
}; };
})(); })();

View file

@ -1,15 +1,5 @@
(function () { (function () {
var tests = [ var tests = require('./test/drawing/DrawingTests.casper.js').tests;
"pen.drawing.json",
"color.picker.json",
"frames.fun.json",
"layers.fun.json",
"move.json",
"pen.secondary.color.json",
"squares.circles.json",
"stroke.json",
"verticalpen.drawing.json"
];
var baseUrl = casper.cli.get('baseUrl')+"?debug"; var baseUrl = casper.cli.get('baseUrl')+"?debug";
var resultSelector = '#drawing-test-result'; var resultSelector = '#drawing-test-result';
@ -17,7 +7,7 @@
casper.start(); casper.start();
var runTest = function (index) { var runTest = function (index) {
var test = 'integration/casperjs/drawing-records/' + tests[index]; var test = 'drawing/tests/' + tests[index];
casper.open(baseUrl + "&test-run=" + test); casper.open(baseUrl + "&test-run=" + test);

View file

@ -1,4 +1,4 @@
{ "tests" : [ {"tests" : [
"pen.drawing.json", "pen.drawing.json",
"bucket.drawing.json", "bucket.drawing.json",
"color.picker.json", "color.picker.json",

View file

@ -0,0 +1,11 @@
(typeof exports != "undefined" ? exports : pskl_exports).tests = [
"pen.drawing.json",
"color.picker.json",
"frames.fun.json",
"layers.fun.json",
"move.json",
"pen.secondary.color.json",
"squares.circles.json",
"stroke.json",
"verticalpen.drawing.json"
];