lib/vr-client.js
function sendScreenshot (name, runId, metaData, properties, compareSettings, png) {
	return _callServer('post', 'runs/' + runId + '/screenshots', null, {
		meta: JSON.stringify(metaData),
		properties: JSON.stringify(properties),
		compareSettings: JSON.stringify(compareSettings),
		screenshotName: name,
		file: {
			value: new Buffer(png, 'base64'),
			options: {
				filename: 'file.png',
				contentType: 'image/png'
			}
		}
	}).catch(function (error) {
		return q.reject('an error occured while sending a screenshot to the VisualReview server: ' + error);
	});
}
function sendScreenshot (name, runId, metaData, properties, compareSettings, png) {
	return _callServer('post', 'runs/' + runId + '/screenshots', null, {
		meta: JSON.stringify(metaData),
		properties: JSON.stringify(properties),
		compareSettings: JSON.stringify(compareSettings),
		screenshotName: name,
		file: {
			value: new Buffer(png, 'base64'),
			options: {
				filename: 'file.png',
				contentType: 'image/png'
			}
		}
	}).catch(function (error) {
		return q.reject('an error occured while sending a screenshot to the VisualReview server: ' + error);
	});
}
function sendScreenshot ( name , runId , metaData , properties , compareSettings , png ) { return _callServer ( 'post' , 'runs/' + runId + '/screenshots' , null , { meta : JSON . stringify ( metaData ) , properties : JSON . stringify ( properties ) , compareSettings : JSON . stringify ( compareSettings ) , screenshotName : name , file : { value : new Buffer ( png , 'base64' ) , options : { filename : 'file.png' , contentType : 'image/png' } } } ) . catch ( function ( error ) { return q . reject ( 'an error occured while sending a screenshot to the VisualReview server: ' + error ) ; } ) ; }
Uploads an new screenshot to the given run.
@param name
@param runId
@param metaData
@param properties
@param png
@returns {Promise} a promise. If an error has occured, the promise will reject with a string containing an error message.
Uploads an new screenshot to the given run .