问题描述
有人可以建议如何设置量角器以远程运行测试吗?
Could anyone please advice how to setup protractor to run tests remotely ?
我的protractor.conf.js:
My protractor.conf.js:
exports.config = {
chromeOnly: true,
chromeDriver: '../node_modules/.bin/chromedriver',
framework: 'jasmine2',
capabilities: {
'browserName': 'chrome',
shardTestFiles: true,
maxInstances: 3
},
specs: ['../e2e/protractor/spec/*.js'],
jasmineNodeOpts: {
showColors: true,
defaultTimeoutInterval: 30000
},
jasmineNodeOpts: {
isVerbose: true
},
onPrepare: function () {
global.dv = browser.driver;
browser.ignoreSynchronization = true;
},
seleniumServerJar: '../node_modules/selenium-server/lib/runner/selenium-server-standalone-2.47.1.jar',
baseUrl: 'www.google.com'
};
我的protractor.json:
My protractor.json:
{
"options": {
"configFile": "./config/protractor.conf.js",
"noColor": false,
"args": {},
"webdriverManagerUpdate": true
},
"e2e": {
"options": {
"keepAlive": false
}
},
"continuous": {
"options": {
"keepAlive": true
}
}
}
现在我正在通过命令protractor protractor.conf.js
从./config位置在本地运行测试.我已经配置了虚拟机和主机的硒网格.还有要用于与主机连接的IP地址.
For now I am running tests locally from ./config location by command protractor protractor.conf.js
.I have already selenium grid configured with vm's and hosts. Have as well IP address which I'll be using to connect with host.
推荐答案
您只需要在protractor.conf.js或grunt/gulp运行程序中设置seleniumAddress: 'http://<IP>:4444/wd/hub',
.
You just need to setup seleniumAddress: 'http://<IP>:4444/wd/hub',
inside either protractor.conf.js, or your grunt/gulp runner.
所有设置都在这里: https://github.com/angular/protractor/blob/master/lib/config.ts#L89
All settings is here:https://github.com/angular/protractor/blob/master/lib/config.ts#L89
这篇关于带有硒栅的量角器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!