Skip to content

Instantly share code, notes, and snippets.

@ryanhanks-wf
Created December 30, 2014 19:06
Show Gist options
  • Select an option

  • Save ryanhanks-wf/43302cbfcf06cc911f64 to your computer and use it in GitHub Desktop.

Select an option

Save ryanhanks-wf/43302cbfcf06cc911f64 to your computer and use it in GitHub Desktop.
test for add pdf to legacy binder manager
'add a pdf to existing binder manager': function () {
var binder = {
name: 'Add a PDF to existing binder manager'
};
return this.remote
.buildBinder(binder)
.then(function(val) {
this.get(require.toUrl('http://localhost:8010/books/' + val.contentKey));
})
.sleep(1000)
.execute(function () {
fileInput = window.$('<input/>').attr({id: 'fileUploadHelper', type: 'file'}).appendTo('body');
})
.findById('fileUploadHelper')
.type(intern.args.testDocumentsDirectory + '/doc1.pdf')
.end()
.execute(function() {
console.log(fileInput.get(0).files);
var e = $.Event('drop');
e.originalEvent = {dataTransfer : { files : fileInput.get(0).files } }; $('.drop-area').trigger(e);
})
.then(pollUntil(function () {
return $('.status-text').text() == 'Document updated' ? true : null;
}));
},
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment