我正在使用量角器進行端到端測試與非角度應用程序。所以,當我寫在conf.js文件原樣directConnect:true與在量角器中的某個端口啓動seleniumServer
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
}
};
Then it works fine for me.
After that I have made some changes like-
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
}
};
然後,它開始與硒服務器端口和測試案例成功運行。
所以我的問題是, 這兩種方式之間有什麼不同?我知道當我們使用directConnect:true
時,它不啓動selenium服務器,然後直接使用chrome驅動程序,並且測試用例比其他方式運行得更快?
當量角器可以在沒有硒服務器的情況下進行測試時,爲什麼我們需要它? 什麼硒服務器做protrator測試?