1
我一直在試圖測試,如果某個文件下載後點擊按鈕。這個過程是有效的,但是在測試中下載的文件就像這個.com.google.Chrome.uAjWNN
,但是當我從我的應用下載文件時,下載的文件是05456342.txt
。我的想法是檢查文件擴展名,但因爲下載的文件沒有,所以這是不可能的。量角器下載的文件名
爲什麼會發生這種情況?
我量角器的conf文件
module.exports.config = {
specs: [
'test/e2e/features/*.feature'
],
allScriptsTimeout: 60000,
framework: 'custom',
frameworkPath: require.resolve('protractor-cucumber-framework'),
cucumberOpts: {
require: ['test/e2e/support/*.js', 'test/e2e/step_definitions/*_steps.js'],
format: 'pretty',
keepAlive: false
},
capabilities: {
'browserName': 'chrome',
'chromeOptions': {
'args': ['show-fps-counter=true'],
'prefs': {
'download': {
'prompt_for_download': false,
'default_directory': 'test/e2e/downloads/',
}
}
}
},
onPrepare: function() {
browser.driver.manage().window().maximize();
}
};
哦,這是我用來檢查文件是否被下載的方式,但我的想法是檢查下載的文件的擴展名。 –