我使用量角器来测试我的角度应用程序。当我手动启动量角器时,它可以正常工作并测试一切,但是当我尝试通过grunt启动它时会出现问题。
当我启动我的grunt任务进行测试时,量角器会找到conf文件(它会显示正确的测试数量),但只需在奇怪的“数据”上打开镀铬驱动程序不到一秒钟; url,立即关闭它并将所有测试标记为“通过”。
这是我的用于量角器的gruntfile.js:
protractor: {
options: {
configFile: "e2e-tests/protractor.conf.js", // Default config file
keepAlive: false, // If false, the grunt process stops when the test fails.
noColor: false, // If true, protractor will not use colors in its output.
args: {
verbose: true,
}
},
all: {}
}
和我的量角器conf文件:
exports.config = {
allScriptsTimeout: 11000,
seleniumAddress: 'http://localhost:4444/wd/hub',
specs: [
'*.js'
],
capabilities: {
'browserName': 'chrome'
},
baseUrl: 'http://localhost:8000/',
framework: 'jasmine',
jasmineNodeOpts: {
defaultTimeoutInterval: 30000
}
};
同样,如果我在同一个conf文件上手动启动量角器,它可以工作(即使我在本地node_modules目录中使用本地量角器),我真的不明白发生了什么。
非常感谢你们!
答案 0 :(得分:1)
找到解决方案。似乎grunt-protractor-runner需要节点> = 4.2.0而我运行的是4.1.x.但是找不到任何指向它的日志。