Example #1
0
script.steps.forEach(function(step){

	stepName = step.name;

	console.log('\nStep ' + stepNumber + " - " + stepName);
	if (step.authentication){
		horseman.authentication(step.authentication.username, step.authentication.password);
	}
	if (step.url){
		horseman.open(step.url);
	}
	
	if (step.switchToTab){
		horseman.switchToTab(step.switchToTab);
	}
	if (step.reloadPage){
		horseman.open(horseman.url());
	}

	if (step.upload){
		horseman.upload(step.upload.selector, step.upload.path);
	}
	if (step.js){
		horseman.manipulate(step.js);
	}
	horseman.manipulate(function(){
		$('html').css({backgroundColor: '#FFFFFF'});
	}
	);
	if (step.delay){
		horseman.wait(step.delay);
	} else {
		horseman.waitForNextPage();
	}

	console.log(horseman.url());

	

	if (step.description){
		console.log('Description:', step.description);
	}
	if (step.expectedUrl) {
		if (horseman.url() != step.expectedUrl){
			errorCount++;
			console.warn('Error: expected url does not match. Expected:', step.expectedUrl);
		}
	}

	if (step.screenshotStep !== false){
		sizeCount = 1;
		script.sizes.forEach(processSizes);
		if (step.sizes){
			step.sizes.forEach(processSizes);
		}
	}


	stepNumber++;
});
Example #2
0
script.steps.forEach(function(step){
	numSteps++;
	if (step.screenshotStep !== false){
		script.sizes.forEach(function(){
			imageCount++;
		});
		if (step.sizes){
			step.sizes.forEach(function(){
				imageCount++;
			});
		}
	}
});