E2Eテスト用の分度器を使用しています。自動化中に、自分のシステムのC:\ Automationフォルダにファイルをダウンロードする必要があります。しかし、以下のコードは機能しません。ファイルをダウンロードして絶対パスにファイルをダウンロードしてください。
注:自動実行中に[名前を付けて保存]ポップアップが開きます(ただし、これを無効にする必要があります)。手動で[保存]オプションをクリックします。それはデフォルトの場所、すなわちダウンロードフォルダに保存されます。私はそれを私の与えられたパスに保存しますか?
let profile = require('firefox-profile');
let firefoxProfile = new profile();
//_browser = 'chrome';
_browser = 'firefox';
// _browser = 'internet explorer';
firefoxProfile.setPreference("browser.download.folderList", 2);
firefoxProfile.setPreference('browser.download.dir', "C:\\Automation");
exports.config = {
framework: 'custom',
frameworkPath: require.resolve('protractor-cucumber-framework'),
capabilities: {
'browserName': _browser,
'shardTestFiles': false,
'maxInstances': 1,
'acceptInsecureCerts': true,
'moz:firefoxOptions': {
'profile': firefoxProfile
}},
beforeLaunch: function() {...}
}