我尝试将配置文件设置为不必转到mac终端并键入 webdriver-manager start 。是否可以让配置文件这样做?我在下面列出了我的代码,让您了解我的设置。我只是不知道是否可能。让我知道。我在macbook pro上。
exports.config = {
seleniumServerJar: './selenium/selenium-server-standalone-2.45.1.jar',
seleniumPort: null,
chromeDriver: './selenium/chromedriver.exe',
chromeDriver: null,
seleniumAddress: 'http://localhost:4444/wd/hub',
// ----- What tests to run -----
suites: {
CSRSmokeTest: '../smoke/deskTop/CSR.js'
DesktopSmokeTest: '../smoke/deskTop/**.js'
},
chromeOnly: false,
multiCapabilities: [
{
'browserName': 'chrome',
'chromeOptions': {
args: ['--lang=en',
'--window-size=1900,1200']
}
},
],
baseUrl: location + '/login/#/login',
rootElement: 'body',
onPrepare: function () {
browser.ignoreSynchronization = true;
browser.get(location + '/login/#/login');
},
params: {
user: {
//TEST******************************************
},
url: {
//some code
}
},
jasmineNodeOpts: {
// onComplete will be called just before the driver quits.
onComplete: null,
// If true, display spec names.
isVerbose: true,
// If true, print colors to the terminal.
showColors: true,
// If true, include stack traces in failures.
includeStackTrace: true,
// Default time to wait in ms before a test fails.
defaultTimeoutInterval: 6000000
}
};
答案 0 :(得分:2)
如果您只是不想输入终端,您有几种选择:
seleniumServerJar
选项,然后移除seleniumAddress
。但每次启动Selenium需要额外5-20秒(取决于硬件)。directConnect: true
。然后你根本不需要Selenium服务器。它适用于我,但它不是完全可移植的解决方案。