Drawing tests structure cleanup
This commit is contained in:
parent
35d4be5d3e
commit
b2ab504422
22 changed files with 21 additions and 20 deletions
|
@ -26,16 +26,16 @@ module.exports = function(grunt) {
|
|||
var piskelStyles = require('./src/piskel-style-list.js').styles.map(mapToSrcFolder);
|
||||
|
||||
var mapToCasperFolder = function (path) {
|
||||
return "test/integration/casperjs/" + path;
|
||||
return "test/casperjs/" + path;
|
||||
};
|
||||
|
||||
var casperEnvironments = {
|
||||
'local' : {
|
||||
suite : './test/integration/casperjs/LocalTestSuite.js',
|
||||
suite : './test/casperjs/LocalTestSuite.js',
|
||||
delay : 50
|
||||
},
|
||||
'travis' : {
|
||||
suite : './test/integration/casperjs/TravisTestSuite.js',
|
||||
suite : './test/casperjs/TravisTestSuite.js',
|
||||
delay : 5000
|
||||
}
|
||||
};
|
||||
|
|
|
@ -72,5 +72,5 @@ var Constants = {
|
|||
EMPTY_FUNCTION : function () {},
|
||||
|
||||
// TESTS
|
||||
BASE_TEST_FOLDER : 'integration/casperjs/drawing-records'
|
||||
DRAWING_TEST_FOLDER : 'drawing'
|
||||
};
|
|
@ -3,7 +3,7 @@
|
|||
|
||||
ns.DrawingTestSuiteController = function (suitePath) {
|
||||
if (suitePath.indexOf('/') === -1) {
|
||||
suitePath = [Constants.BASE_TEST_FOLDER, suitePath].join('/');
|
||||
suitePath = [Constants.DRAWING_TEST_FOLDER, suitePath].join('/');
|
||||
}
|
||||
this.suitePath = suitePath;
|
||||
this.testSuiteRunner = null;
|
||||
|
@ -41,7 +41,7 @@
|
|||
ns.DrawingTestSuiteController.prototype.onTestSuiteLoaded_ = function (response) {
|
||||
var testPaths = JSON.parse(response.responseText).tests;
|
||||
testPaths = testPaths.map(function (path) {
|
||||
return this.suitePath.replace(/\/([^\/]+\.json)/i, '/' + path);
|
||||
return [Constants.DRAWING_TEST_FOLDER, 'tests', path].join('/');
|
||||
}.bind(this));
|
||||
this.testSuiteRunner = new ns.DrawingTestSuiteRunner(testPaths);
|
||||
this.testSuiteRunner.start();
|
||||
|
|
|
@ -70,7 +70,7 @@
|
|||
};
|
||||
|
||||
ns.TestRecordController.prototype.onTestRecordEnd_ = function (evt, success) {
|
||||
console.log('test finished : ', success);
|
||||
window.alert('Test finished : ', success);
|
||||
};
|
||||
|
||||
})();
|
|
@ -1,15 +1,5 @@
|
|||
(function () {
|
||||
var 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 tests = require('./test/drawing/DrawingTests.casper.js').tests;
|
||||
|
||||
var baseUrl = casper.cli.get('baseUrl')+"?debug";
|
||||
var resultSelector = '#drawing-test-result';
|
||||
|
@ -17,7 +7,7 @@
|
|||
casper.start();
|
||||
|
||||
var runTest = function (index) {
|
||||
var test = 'integration/casperjs/drawing-records/' + tests[index];
|
||||
var test = 'drawing/tests/' + tests[index];
|
||||
|
||||
casper.open(baseUrl + "&test-run=" + test);
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
{ "tests" : [
|
||||
{"tests" : [
|
||||
"pen.drawing.json",
|
||||
"bucket.drawing.json",
|
||||
"color.picker.json",
|
11
test/drawing/DrawingTests.casper.js
Normal file
11
test/drawing/DrawingTests.casper.js
Normal 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"
|
||||
];
|
Loading…
Reference in a new issue