mirror of
https://github.com/piskelapp/piskel.git
synced 2023-08-10 21:12:52 +03:00
Issue #315 : Implement custom replay for transform tools + add drawing test support
This commit is contained in:
@ -17,11 +17,11 @@
|
||||
});
|
||||
|
||||
casper.then(function () {
|
||||
this.echo('Waiting for test result : ' + resultSelector);
|
||||
this.echo('... Waiting for test result : ' + resultSelector);
|
||||
this.waitForSelector(resultSelector, function () {
|
||||
// then
|
||||
var result = this.getHTML(resultSelector);
|
||||
this.echo('Test finished : ' + result);
|
||||
this.echo('... Test finished : ' + result);
|
||||
this.test.assertEquals(result, 'OK');
|
||||
}, function () {
|
||||
// onTimeout
|
||||
|
@ -14,5 +14,11 @@
|
||||
"squares.circles.json",
|
||||
"stroke.json",
|
||||
"verticalpen.drawing.json",
|
||||
"dithering.basic.json"
|
||||
"dithering.basic.json",
|
||||
"transform.clone.once.json",
|
||||
"transform.clone.twice.undo.once.json",
|
||||
"transform.rotate.once.alt.json",
|
||||
"transform.rotate.twice.undo.once.json",
|
||||
"transform.mirror.once.alt.json",
|
||||
"transform.mirror.twice.undo.once.json"
|
||||
]}
|
@ -5,6 +5,7 @@
|
||||
"history.basic.json",
|
||||
"layers.fun.json",
|
||||
"layers.merge.json",
|
||||
"lighten.darken.json",
|
||||
"move.json",
|
||||
"move-alllayers-allframes.json",
|
||||
"pen.secondary.color.json",
|
||||
@ -12,5 +13,11 @@
|
||||
"squares.circles.json",
|
||||
"stroke.json",
|
||||
"verticalpen.drawing.json",
|
||||
"dithering.basic.json"
|
||||
"dithering.basic.json",
|
||||
"transform.clone.once.json",
|
||||
"transform.clone.twice.undo.once.json",
|
||||
"transform.rotate.once.alt.json",
|
||||
"transform.rotate.twice.undo.once.json",
|
||||
"transform.mirror.once.alt.json",
|
||||
"transform.mirror.twice.undo.once.json"
|
||||
];
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
86
test/drawing/tests/transform.clone.once.json
Normal file
86
test/drawing/tests/transform.clone.once.json
Normal file
@ -0,0 +1,86 @@
|
||||
{
|
||||
"events": [{
|
||||
"type": "instrumented-event",
|
||||
"methodName": "duplicateFrameAt",
|
||||
"args": [0]
|
||||
}, {
|
||||
"type": "instrumented-event",
|
||||
"methodName": "createLayer",
|
||||
"args": []
|
||||
}, {
|
||||
"event": {
|
||||
"type": "mousedown",
|
||||
"button": 0,
|
||||
"shiftKey": false,
|
||||
"altKey": false,
|
||||
"ctrlKey": false
|
||||
},
|
||||
"coords": {
|
||||
"x": 1,
|
||||
"y": 0
|
||||
},
|
||||
"type": "mouse-event"
|
||||
}, {
|
||||
"event": {
|
||||
"type": "mouseup",
|
||||
"button": 0,
|
||||
"shiftKey": false,
|
||||
"altKey": false,
|
||||
"ctrlKey": false
|
||||
},
|
||||
"coords": {
|
||||
"x": 1,
|
||||
"y": 0
|
||||
},
|
||||
"type": "mouse-event"
|
||||
}, {
|
||||
"type": "instrumented-event",
|
||||
"methodName": "setCurrentLayerIndex",
|
||||
"args": [0]
|
||||
}, {
|
||||
"event": {
|
||||
"type": "mousedown",
|
||||
"button": 0,
|
||||
"shiftKey": false,
|
||||
"altKey": false,
|
||||
"ctrlKey": false
|
||||
},
|
||||
"coords": {
|
||||
"x": 0,
|
||||
"y": 1
|
||||
},
|
||||
"type": "mouse-event"
|
||||
}, {
|
||||
"event": {
|
||||
"type": "mouseup",
|
||||
"button": 0,
|
||||
"shiftKey": false,
|
||||
"altKey": false,
|
||||
"ctrlKey": false
|
||||
},
|
||||
"coords": {
|
||||
"x": 0,
|
||||
"y": 1
|
||||
},
|
||||
"type": "mouse-event"
|
||||
}, {
|
||||
"type": "transformtool-event",
|
||||
"toolId": "tool-clone",
|
||||
"event": {
|
||||
"shiftKey": false,
|
||||
"altKey": false,
|
||||
"ctrlKey": false
|
||||
}
|
||||
}],
|
||||
"initialState": {
|
||||
"size": {
|
||||
"width": 2,
|
||||
"height": 2
|
||||
},
|
||||
"primaryColor": "#000000",
|
||||
"secondaryColor": "rgba(0, 0, 0, 0)",
|
||||
"selectedTool": "tool-pen",
|
||||
"step" : 100
|
||||
},
|
||||
"png": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAACCAYAAAB/qH1jAAAAFklEQVQIW2NkQAX/GRkYGP4zMDDAaQAkOwMC7/zdVgAAAABJRU5ErkJggg=="
|
||||
}
|
187
test/drawing/tests/transform.clone.twice.undo.once.json
Normal file
187
test/drawing/tests/transform.clone.twice.undo.once.json
Normal file
@ -0,0 +1,187 @@
|
||||
{
|
||||
"events": [{
|
||||
"type": "instrumented-event",
|
||||
"methodName": "duplicateFrameAt",
|
||||
"args": [0]
|
||||
}, {
|
||||
"type": "instrumented-event",
|
||||
"methodName": "createLayer",
|
||||
"args": []
|
||||
}, {
|
||||
"type": "instrumented-event",
|
||||
"methodName": "createLayer",
|
||||
"args": []
|
||||
}, {
|
||||
"event": {
|
||||
"type": "mousedown",
|
||||
"button": 0,
|
||||
"shiftKey": false,
|
||||
"altKey": false,
|
||||
"ctrlKey": false
|
||||
},
|
||||
"coords": {
|
||||
"x": 1,
|
||||
"y": 0
|
||||
},
|
||||
"type": "mouse-event"
|
||||
}, {
|
||||
"event": {
|
||||
"type": "mouseup",
|
||||
"button": 0,
|
||||
"shiftKey": false,
|
||||
"altKey": false,
|
||||
"ctrlKey": false
|
||||
},
|
||||
"coords": {
|
||||
"x": 1,
|
||||
"y": 0
|
||||
},
|
||||
"type": "mouse-event"
|
||||
}, {
|
||||
"type": "instrumented-event",
|
||||
"methodName": "setCurrentLayerIndex",
|
||||
"args": [1]
|
||||
}, {
|
||||
"event": {
|
||||
"type": "mousedown",
|
||||
"button": 0,
|
||||
"shiftKey": false,
|
||||
"altKey": false,
|
||||
"ctrlKey": false
|
||||
},
|
||||
"coords": {
|
||||
"x": 0,
|
||||
"y": 0
|
||||
},
|
||||
"type": "mouse-event"
|
||||
}, {
|
||||
"event": {
|
||||
"type": "mouseup",
|
||||
"button": 0,
|
||||
"shiftKey": false,
|
||||
"altKey": false,
|
||||
"ctrlKey": false
|
||||
},
|
||||
"coords": {
|
||||
"x": 0,
|
||||
"y": 0
|
||||
},
|
||||
"type": "mouse-event"
|
||||
}, {
|
||||
"type": "instrumented-event",
|
||||
"methodName": "setCurrentLayerIndex",
|
||||
"args": [0]
|
||||
}, {
|
||||
"event": {
|
||||
"type": "mousedown",
|
||||
"button": 0,
|
||||
"shiftKey": false,
|
||||
"altKey": false,
|
||||
"ctrlKey": false
|
||||
},
|
||||
"coords": {
|
||||
"x": 0,
|
||||
"y": 1
|
||||
},
|
||||
"type": "mouse-event"
|
||||
}, {
|
||||
"event": {
|
||||
"type": "mouseup",
|
||||
"button": 0,
|
||||
"shiftKey": false,
|
||||
"altKey": false,
|
||||
"ctrlKey": false
|
||||
},
|
||||
"coords": {
|
||||
"x": 0,
|
||||
"y": 1
|
||||
},
|
||||
"type": "mouse-event"
|
||||
}, {
|
||||
"type": "transformtool-event",
|
||||
"toolId": "tool-clone",
|
||||
"event": {
|
||||
"shiftKey": false,
|
||||
"altKey": false,
|
||||
"ctrlKey": false
|
||||
}
|
||||
}, {
|
||||
"type": "instrumented-event",
|
||||
"methodName": "setCurrentLayerIndex",
|
||||
"args": [1]
|
||||
}, {
|
||||
"type": "transformtool-event",
|
||||
"toolId": "tool-clone",
|
||||
"event": {
|
||||
"shiftKey": false,
|
||||
"altKey": false,
|
||||
"ctrlKey": false
|
||||
}
|
||||
}, {
|
||||
"type": "keyboard-event",
|
||||
"event": {
|
||||
"which": 90,
|
||||
"shiftKey": false,
|
||||
"altKey": false,
|
||||
"ctrlKey": true,
|
||||
"target": {
|
||||
"nodeName": "BODY"
|
||||
}
|
||||
}
|
||||
}, {
|
||||
"type": "keyboard-event",
|
||||
"event": {
|
||||
"which": 38,
|
||||
"shiftKey": false,
|
||||
"altKey": false,
|
||||
"ctrlKey": false,
|
||||
"target": {
|
||||
"nodeName": "BODY"
|
||||
}
|
||||
}
|
||||
}, {
|
||||
"type": "tool-event",
|
||||
"toolId": "tool-stroke"
|
||||
}, {
|
||||
"type": "color-event",
|
||||
"color": "#ff0000",
|
||||
"isPrimary": true
|
||||
}, {
|
||||
"event": {
|
||||
"type": "mousedown",
|
||||
"button": 0,
|
||||
"shiftKey": false,
|
||||
"altKey": false,
|
||||
"ctrlKey": false
|
||||
},
|
||||
"coords": {
|
||||
"x": 0,
|
||||
"y": 0
|
||||
},
|
||||
"type": "mouse-event"
|
||||
}, {
|
||||
"event": {
|
||||
"type": "mouseup",
|
||||
"button": 0,
|
||||
"shiftKey": false,
|
||||
"altKey": false,
|
||||
"ctrlKey": false
|
||||
},
|
||||
"coords": {
|
||||
"x": 0,
|
||||
"y": 0
|
||||
},
|
||||
"type": "mouse-event"
|
||||
}],
|
||||
"initialState": {
|
||||
"size": {
|
||||
"width": 2,
|
||||
"height": 2
|
||||
},
|
||||
"primaryColor": "#000000",
|
||||
"secondaryColor": "rgba(0, 0, 0, 0)",
|
||||
"selectedTool": "tool-pen",
|
||||
"step" : 100
|
||||
},
|
||||
"png": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAACCAYAAAB/qH1jAAAAHElEQVQIW2P8z8Dwn5GBgZGBgeE/AwOCARNgBABnLwUCTlSTegAAAABJRU5ErkJggg=="
|
||||
}
|
1
test/drawing/tests/transform.mirror.once.alt.json
Normal file
1
test/drawing/tests/transform.mirror.once.alt.json
Normal file
@ -0,0 +1 @@
|
||||
{"events":[{"event":{"type":"mousedown","button":0,"shiftKey":false,"altKey":false,"ctrlKey":false},"coords":{"x":0,"y":0},"type":"mouse-event"},{"event":{"type":"mouseup","button":0,"shiftKey":false,"altKey":false,"ctrlKey":false},"coords":{"x":0,"y":0},"type":"mouse-event"},{"type":"transformtool-event","toolId":"tool-flip","event":{"shiftKey":false,"altKey":true,"ctrlKey":false}}],"initialState":{"size":{"width":2,"height":2},"primaryColor":"#000000","secondaryColor":"rgba(0, 0, 0, 0)","selectedTool":"tool-pen"},"png":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAIAAAACCAYAAABytg0kAAAAFElEQVQIW2NkgAJGBgaG/wwMDIwABSkBAyQtNbwAAAAASUVORK5CYII="}
|
100
test/drawing/tests/transform.mirror.twice.undo.once.json
Normal file
100
test/drawing/tests/transform.mirror.twice.undo.once.json
Normal file
@ -0,0 +1,100 @@
|
||||
{
|
||||
"events": [{
|
||||
"event": {
|
||||
"type": "mousedown",
|
||||
"button": 0,
|
||||
"shiftKey": false,
|
||||
"altKey": false,
|
||||
"ctrlKey": false
|
||||
},
|
||||
"coords": {
|
||||
"x": 0,
|
||||
"y": 0
|
||||
},
|
||||
"type": "mouse-event"
|
||||
}, {
|
||||
"event": {
|
||||
"type": "mouseup",
|
||||
"button": 0,
|
||||
"shiftKey": false,
|
||||
"altKey": false,
|
||||
"ctrlKey": false
|
||||
},
|
||||
"coords": {
|
||||
"x": 0,
|
||||
"y": 0
|
||||
},
|
||||
"type": "mouse-event"
|
||||
}, {
|
||||
"type": "transformtool-event",
|
||||
"toolId": "tool-flip",
|
||||
"event": {
|
||||
"shiftKey": false,
|
||||
"altKey": false,
|
||||
"ctrlKey": false
|
||||
}
|
||||
}, {
|
||||
"type": "transformtool-event",
|
||||
"toolId": "tool-flip",
|
||||
"event": {
|
||||
"shiftKey": false,
|
||||
"altKey": false,
|
||||
"ctrlKey": false
|
||||
}
|
||||
}, {
|
||||
"type": "keyboard-event",
|
||||
"event": {
|
||||
"which": 90,
|
||||
"shiftKey": false,
|
||||
"altKey": false,
|
||||
"ctrlKey": true,
|
||||
"target": {
|
||||
"nodeName": "BODY"
|
||||
}
|
||||
}
|
||||
}, {
|
||||
"type": "tool-event",
|
||||
"toolId": "tool-stroke"
|
||||
}, {
|
||||
"type": "color-event",
|
||||
"color": "#ff0000",
|
||||
"isPrimary": true
|
||||
}, {
|
||||
"event": {
|
||||
"type": "mousedown",
|
||||
"button": 0,
|
||||
"shiftKey": false,
|
||||
"altKey": false,
|
||||
"ctrlKey": false
|
||||
},
|
||||
"coords": {
|
||||
"x": 0,
|
||||
"y": 0
|
||||
},
|
||||
"type": "mouse-event"
|
||||
}, {
|
||||
"event": {
|
||||
"type": "mouseup",
|
||||
"button": 0,
|
||||
"shiftKey": false,
|
||||
"altKey": false,
|
||||
"ctrlKey": false
|
||||
},
|
||||
"coords": {
|
||||
"x": 0,
|
||||
"y": 0
|
||||
},
|
||||
"type": "mouse-event"
|
||||
}],
|
||||
"initialState": {
|
||||
"size": {
|
||||
"width": 2,
|
||||
"height": 2
|
||||
},
|
||||
"primaryColor": "#000000",
|
||||
"secondaryColor": "rgba(0, 0, 0, 0)",
|
||||
"selectedTool": "tool-pen",
|
||||
"step" : 100
|
||||
},
|
||||
"png": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAIAAAACCAYAAABytg0kAAAAFElEQVQIW2P8z8Dwn5GBgQGEwQAAHxsCAoill14AAAAASUVORK5CYII="
|
||||
}
|
1
test/drawing/tests/transform.rotate.once.alt.json
Normal file
1
test/drawing/tests/transform.rotate.once.alt.json
Normal file
@ -0,0 +1 @@
|
||||
{"events":[{"event":{"type":"mousedown","button":0,"shiftKey":false,"altKey":false,"ctrlKey":false},"coords":{"x":0,"y":0},"type":"mouse-event"},{"event":{"type":"mouseup","button":0,"shiftKey":false,"altKey":false,"ctrlKey":false},"coords":{"x":0,"y":0},"type":"mouse-event"},{"type":"transformtool-event","toolId":"tool-rotate","event":{"shiftKey":false,"altKey":true,"ctrlKey":false}}],"initialState":{"size":{"width":2,"height":2},"primaryColor":"#ff0000","secondaryColor":"rgba(0, 0, 0, 0)","selectedTool":"tool-stroke"},"png":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAIAAAACCAYAAABytg0kAAAAFUlEQVQIW2NkYGBg+M/A8J8RxAABABcWAgFMzp95AAAAAElFTkSuQmCC"}
|
100
test/drawing/tests/transform.rotate.twice.undo.once.json
Normal file
100
test/drawing/tests/transform.rotate.twice.undo.once.json
Normal file
@ -0,0 +1,100 @@
|
||||
{
|
||||
"events": [{
|
||||
"event": {
|
||||
"type": "mousedown",
|
||||
"button": 0,
|
||||
"shiftKey": false,
|
||||
"altKey": false,
|
||||
"ctrlKey": false
|
||||
},
|
||||
"coords": {
|
||||
"x": 0,
|
||||
"y": 0
|
||||
},
|
||||
"type": "mouse-event"
|
||||
}, {
|
||||
"event": {
|
||||
"type": "mouseup",
|
||||
"button": 0,
|
||||
"shiftKey": false,
|
||||
"altKey": false,
|
||||
"ctrlKey": false
|
||||
},
|
||||
"coords": {
|
||||
"x": 0,
|
||||
"y": 0
|
||||
},
|
||||
"type": "mouse-event"
|
||||
}, {
|
||||
"type": "transformtool-event",
|
||||
"toolId": "tool-rotate",
|
||||
"event": {
|
||||
"shiftKey": false,
|
||||
"altKey": false,
|
||||
"ctrlKey": false
|
||||
}
|
||||
}, {
|
||||
"type": "transformtool-event",
|
||||
"toolId": "tool-rotate",
|
||||
"event": {
|
||||
"shiftKey": false,
|
||||
"altKey": false,
|
||||
"ctrlKey": false
|
||||
}
|
||||
}, {
|
||||
"type": "keyboard-event",
|
||||
"event": {
|
||||
"which": 90,
|
||||
"shiftKey": false,
|
||||
"altKey": false,
|
||||
"ctrlKey": true,
|
||||
"target": {
|
||||
"nodeName": "BODY"
|
||||
}
|
||||
}
|
||||
}, {
|
||||
"type": "tool-event",
|
||||
"toolId": "tool-stroke"
|
||||
}, {
|
||||
"type": "color-event",
|
||||
"color": "#ff0000",
|
||||
"isPrimary": true
|
||||
}, {
|
||||
"event": {
|
||||
"type": "mousedown",
|
||||
"button": 0,
|
||||
"shiftKey": false,
|
||||
"altKey": false,
|
||||
"ctrlKey": false
|
||||
},
|
||||
"coords": {
|
||||
"x": 1,
|
||||
"y": 1
|
||||
},
|
||||
"type": "mouse-event"
|
||||
}, {
|
||||
"event": {
|
||||
"type": "mouseup",
|
||||
"button": 0,
|
||||
"shiftKey": false,
|
||||
"altKey": false,
|
||||
"ctrlKey": false
|
||||
},
|
||||
"coords": {
|
||||
"x": 1,
|
||||
"y": 1
|
||||
},
|
||||
"type": "mouse-event"
|
||||
}],
|
||||
"initialState": {
|
||||
"size": {
|
||||
"width": 2,
|
||||
"height": 2
|
||||
},
|
||||
"primaryColor": "#000000",
|
||||
"secondaryColor": "rgba(0, 0, 0, 0)",
|
||||
"selectedTool": "tool-pen",
|
||||
"step" : 100
|
||||
},
|
||||
"png": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAIAAAACCAYAAABytg0kAAAAE0lEQVQIW2NkgAJGBgaG//+BHAAJJAIBS+4zcQAAAABJRU5ErkJggg=="
|
||||
}
|
Reference in New Issue
Block a user