parent
d1ae4f1b21
commit
4eaa87a3a9
29
test.js
29
test.js
|
@ -5,7 +5,7 @@ var phantomcss = require('phantomcss');
|
|||
casper.test.begin('jspaint visual tests', function(test){
|
||||
|
||||
phantomcss.init({
|
||||
rebase: casper.cli.get( "rebase" ),
|
||||
rebase: casper.cli.get('rebase'),
|
||||
// SlimerJS needs explicit knowledge of this Casper, and lots of absolute paths
|
||||
casper: casper,
|
||||
libraryRoot: fs.absolute(fs.workingDirectory + '/node_modules/phantomcss'), //module._getFilename('phantomcss'), //require.resolve('phantomcss'),
|
||||
|
@ -14,10 +14,10 @@ casper.test.begin( 'jspaint visual tests', function ( test ) {
|
|||
addLabelToFailedImage: false,
|
||||
/*
|
||||
fileNameGetter: function overide_file_naming(){},
|
||||
onPass: function passCallback(){},
|
||||
onFail: function failCallback(){},
|
||||
onTimeout: function timeoutCallback(){},
|
||||
onComplete: function completeCallback(){},
|
||||
onPass: function pass_callback(){},
|
||||
onFail: function fail_callback(){},
|
||||
onTimeout: function timeout_callback(){},
|
||||
onComplete: function complete_callback(){},
|
||||
hideElements: '#thing.selector',
|
||||
addLabelToFailedImage: true,
|
||||
outputSettings: {
|
||||
|
@ -58,7 +58,6 @@ casper.test.begin( 'jspaint visual tests', function ( test ) {
|
|||
});
|
||||
|
||||
var screenshot_and_close_window = function(screenshot_name){
|
||||
// var after = function(ms, fn){ setTimeout(fn, ms); };
|
||||
// var window_title = "Attributes";
|
||||
// var selector = {
|
||||
// type: "xpath",
|
||||
|
@ -76,7 +75,7 @@ casper.test.begin( 'jspaint visual tests', function ( test ) {
|
|||
// casper.thenEvaluate(function(selector){
|
||||
// $(selector).find(".jspaint-window-close-button").click();
|
||||
// }, selector);
|
||||
casper.then( function () {
|
||||
casper.then(function close_the_window(){
|
||||
casper.click(selector + " .jspaint-window-close-button");
|
||||
});
|
||||
};
|
||||
|
@ -101,26 +100,10 @@ casper.test.begin( 'jspaint visual tests', function ( test ) {
|
|||
});
|
||||
screenshot_and_close_window('help window');
|
||||
|
||||
// casper.then( function () {
|
||||
// // casper.sendKeys( 'body', 'e', { modifiers: 'ctrl' } )
|
||||
//
|
||||
//
|
||||
// // casper.click(".jspaint-edit-menu");
|
||||
//
|
||||
// casper.evaluate(function() {
|
||||
// image_attributes();
|
||||
// });
|
||||
//
|
||||
// } );
|
||||
|
||||
casper.then(function now_check_the_screenshots(){
|
||||
// compare screenshots
|
||||
phantomcss.compareAll();
|
||||
});
|
||||
|
||||
/*
|
||||
Casper runs tests
|
||||
*/
|
||||
casper.run(function(){
|
||||
console.log('\nTHE END.');
|
||||
// phantomcss.getExitStatus() // pass or fail?
|
||||
|
|
Loading…
Reference in New Issue