I am using https://github.com/danialfarid/ng-file-upload for file upload. I have to test it so I wrote protractor test case but it not working.
Code
<div class="col-lg-12 up-buttons">
<div ng-file-select="" ng-model="files" ng-model-rejected="rejFiles" class="btn btn-default" ng-multiple="false" ng-accept="'text/csv,application/vnd.ms-excel,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'" ng-model-rejected="rejFiles" tabindex="0">Choose file</div>
</div>
Test case
it('upload file', function(){
var fileToUpload = 'C:/Users/Anusha/Desktop/demo.csv';
var absolutePath = path.resolve(fileToUpload);
$('input[type="file"]').sendKeys(absolutePath);
browser.sleep(1500);
})
I can upload file but it is received in rejFiles model instead of files model eventhough file format is correct one. Could anyone please suggest me how to do this?