You can use the following html page to create the json base64 version of your file, then copy the textarea into a js file and read that into your testcase:
<!doctype html>
<html>
<head>
<title>Convert files to base64</title>
</head>
<body>
<input type="file" id="files" multiple />
<br>
<textarea id="output" cols="120" rows="40"></textarea>
<script>
function handleFileSelect(evt) {
var files = evt.target.files;
for (var i = 0; i < files.length; i++) {
var reader = new FileReader();
reader.onload = (function(theFile) {
return function(e) {
document.getElementById("output").innerHTML += "//" + theFile.name + "\nvar file" + i + " = \"" + btoa(e.target.result) + "\";\n\n";
}
})(files[i]);
reader.readAsBinaryString(files[i]);
}
}
document.getElementById('files').addEventListener('change', handleFileSelect, false);
</script>
</body>
</html>