<commit_before>/*
Notes:
- phantomjs and caspar via homebrew
- npm install phantomcss
- bower install phantomcss

[note i installed these locally via npm. @filtercake]
*/


/*
	Require and initialise PhantomCSS module
	Paths are relative to CasperJs directory
*/
var phantomcss = require('./../../phantomcss/phantomcss.js');

phantomcss.init({
	screenshotRoot: './test/visual/screenshots',
	failedComparisonsRoot: './test/visual/failures',
	/*
	casper: specific_instance_of_casper,
	*/
	// libraryRoot: './../../phantomcss'
	libraryRoot: './node_modules/phantomcss'
	/*
	fileNameGetter: function overide_file_naming(){},
	onPass: function passCallback(){},
	onFail: function failCallback(){},
	onTimeout: function timeoutCallback(){},
	onComplete: function completeCallback(){},
	hideElements: '#thing.selector',
	addLabelToFailedImage: true,
	outputSettings: {
		errorColor: {
			red: 255,
			green: 255,
			blue: 0
		},
		errorType: 'movement',
		transparency: 0.3
	}
	*/
});


/*
	The test scenario
*/
// casper.start( './demo/coffeemachine.html' );
casper.start( 'http://localhost:9000/#notes' );

casper.viewport(1024, 768);

casper.then(function(){
	phantomcss.screenshot('#header-title', '001-header-title');
});

// casper.then(function(){
// 	phantomcss.screenshot('#coffee-machine-button', '001.1 coffee machine button, button only');
// });

// casper.then(function(){
// 	casper.click('#coffee-machine-button');
	
// 	// wait for modal to fade-in 
// 	casper.waitForSelector('#myModal:not([style*="display: none"])',
// 		function success(){
// 			phantomcss.screenshot('#myModal', '002 coffee machine dialog');<commit_msg>add visual test for welcome page. #1<commit_after>/*
Notes:
- phantomjs and caspar via homebrew
- npm install phantomcss
- bower install phantomcss

[note i installed these locally via npm. @filtercake]
*/


/*
	Require and initialise PhantomCSS module
	Paths are relative to CasperJs directory
*/
var phantomcss = require('./../../phantomcss/phantomcss.js');

phantomcss.init({
	screenshotRoot: './test/visual/screenshots',
	failedComparisonsRoot: './test/visual/failures',
	/*
	casper: specific_instance_of_casper,
	*/
	// libraryRoot: './../../phantomcss'
	libraryRoot: './node_modules/phantomcss'
	/*
	fileNameGetter: function overide_file_naming(){},
	onPass: function passCallback(){},
	onFail: function failCallback(){},
	onTimeout: function timeoutCallback(){},
	onComplete: function completeCallback(){},
	hideElements: '#thing.selector',
	addLabelToFailedImage: true,
	outputSettings: {
		errorColor: {
			red: 255,
			green: 255,
			blue: 0
		},
		errorType: 'movement',
		transparency: 0.3
	}
	*/
});


/*
	The test scenario
*/
// casper.start( './demo/coffeemachine.html' );
casper.start( 'http://localhost:9000/#notes' );

casper.viewport(1024, 768);

casper.then(function(){
	phantomcss.screenshot('#header-title', '001-header-title');
});

casper.thenOpen('http://localhost:9000/welcome.html', function() {
    phantomcss.screenshot('.welcome-body', '000-welcome-page');
});

// casper.then(function(){
// 	phantomcss.screenshot('#coffee-machine-button', '001.1 coffee machine button, button only');
// });

// casper.then(function(){
// 	casper.click('#coffee-machine-button');
	
// 	// wait for modal to fade-in 
// 	casper.waitForSelector('#myModal:not([style*="display: none"])',
// 		function success(){
// 			phantomcss.screenshot('#myModal', '002 coffee machine dialog');
{'fraction_non_alphanumeric': 0.17381160688247302, 'fraction_numerical': 0.019830854476523767, 'mean_word_length': 4.384615384615385, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2099543', 'n_tokens_mistral': 1254, 'n_tokens_neox': 1123, 'n_words': 235}