我正在为我的角度Web应用程序项目编写验收测试。他们通过量角器运行,并且在chrome上工作得很好。但是当我尝试在Internet Explorer 11上运行它们时,我得到了一个失败,抱怨说"驱动程序可执行文件的路径必须由webdriver.ie.driver系统设置"设置。但是,我将我的项目配置为将IE驱动程序下载到与chromedriver可执行文件相同的位置。
虽然我确定可以将IE驱动程序移动到存储在我的PATH env变量中的文件夹,但项目中的每个开发人员都必须执行相同操作或更新其PATH以指向驱动程序。
我的问题是 - 是否有一个简单的配置我想让这个IE驱动程序可用于量角器,就像Chrome驱动程序一样?
我的package.json:
{
//...
"scripts": {
"webdriver-update": "webdriver-manager update --ie",
"preacceptance-tests": "npm run webdriver:update -- --standalone",
"acceptance-tests": "protractor",
//...
}
我的protractor.conf.js:
exports.config = {
baseUrl: 'http://localhost:3000/',
specs: [
'src/**/**test.ts',
'src/**/*test.ts'
],
capabilities: {
'browserName': 'internet explorer' //If I put chrome here, the tests pass
},
onPrepare: function() {
browser.ignoreSynchronization = true;
},
seleniumServerJar: "node_modules/protractor/selenium/selenium-server-standalone-2.51.0.jar",
useAllAngular2AppRoots: true
};
我运行" npm运行验收测试",并将chromedriver.exe和IEDriverServer.exe下载到我的node_modules / protractor / selenium文件夹。量角器似乎意识到了chromedriver,但为什么它不能看到IEDriverServer呢?
除了手动将PATH指向此文件夹外,我似乎无法在任何地方找到答案。如果量角器能够找到chromedriver似乎我不应该......