exports.config = {
seleniumAddress: 'http://localhost:4444/wd/hub' ,
specs: ['../../NG-Experience/uee/src/ main/webapp/test/pc/**/pro. file.js'],
capabilities: {
'browserName': 'internet explorer',
'platform': 'ANY',
},
baseUrl: 'http://localhost:8080',
onPrepare: function(){
require('jasmine-reporters');
var capsPromise = browser.getCapabilities();
browser.driver.manage(). window().maximize();
capsPromise.then(function( caps){
var browserName = caps.caps_.browserName. toUpperCase();
var browserVersion = caps.caps_.version;
var prePendStr = browserName + "-" + browserVersion + "-";
jasmine.getEnv().addReporter( new
jasmine.JUnitXmlReporter(" protractor_output", true, true,"protractor-"+ browserName,true));
});
},
}
test case is :
var filepath = "D:\\TestTools\\fileupload\\";
describe('file组件文件上传', function() {
it('001.单文件上传,file单独使用, 并进行require校验', function() {
browser.get('/uee/test/pc/ file.business.html#/file');
browser.driver.manage(). window().maximize();
$("#upload-single1").click();
expect($("#fileSingle1-file- value").getAttribute(" ueevstatus")).toBe("fail");
expect($("#fileSingle1-file- value").getAttribute("ueevmsg" )).toBe("必填项。");
$("#fileSingle1-file"). sendKeys(filepath+"file01.gif" );
$("#upload-single1").click();
expect($("#fileSingle1_name input").getAttribute("value")) .toBe("file01.gif");
expect($("#fileSingle1_tmpfile input").getAttribute("value")) .not.toBe("");
expect($("#fileSingle1_size input").getAttribute("value")) .toBe("3836KB");
});
});
question:it work well in chrome and firefox , but it can't select file in it . the sendKeys does't work.
댓글 없음:
댓글 쓰기