【发布时间】:2019-02-07 13:32:40
【问题描述】:
我正在使用 Protractor 进行非角度应用程序的端到端测试。
所以一旦我写在 protractor.conf.js 文件中-
exports.config = {
directConnect: true,
// Capabilities to be passed to the webdriver instance.
capabilities: {
'browserName': 'chrome'
},
// Framework to use. Jasmine is recommended.
framework: 'jasmine',
// Spec patterns are relative to the current working directory when
// protractor is called.
specs: ['example_spec.js'],
// Options to be passed to Jasmine.
jasmineNodeOpts: {
defaultTimeoutInterval: 30000
}
};
然后它对我来说很好。
之后我做了一些改变,比如-
exports.config = {
seleniumAddress: 'http://localhost:4444/wd/hub',
// Capabilities to be passed to the webdriver instance.
capabilities: {
'browserName': 'chrome'
},
// Framework to use. Jasmine is recommended.
framework: 'jasmine',
// Spec patterns are relative to the current working directory when
// protractor is called.
specs: ['example_spec.js'],
// Options to be passed to Jasmine.
jasmineNodeOpts: {
defaultTimeoutInterval: 30000
}
};
然后它从带有端口的 selenium 服务器开始,测试用例运行成功。
所以我的问题是——
两种方式有什么区别?我知道当我们使用directConnect:true时,它不会启动selenium server,然后直接使用chrome驱动,测试用例运行速度比其他方式快吗?
当 protractor 可以在没有 selenium 服务器的情况下进行测试时,为什么我们需要它? selenium 服务器在量角器测试中做了什么?
【问题讨论】:
标签: protractor