【发布时间】:2021-12-30 13:45:51
【问题描述】:
我需要同时在 2 个不同的浏览器中运行测试 - 1 个 Web + 1 个移动 Web。 我正在尝试设置 wdio 以使用 Multiremote 设置,但没有运气。 我正在获取重试日志:
...
[0-0] 2021-12-30T13:36:26.056Z INFO webdriver: [POST] https://ondemand.eu-central-1.saucelabs.com:4723/wd/hub/session
[0-0] 2021-12-30T13:36:26.056Z INFO webdriver: DATA {
[0-0] capabilities: {
[0-0] alwaysMatch: {
...
然后它失败并出现错误:
0-0] 2021-12-30T13:37:41.062Z ERROR webdriver: Request failed with status undefined due to RequestError: connect ETIMEDOUT my-ip:4723 when running "https://ondemand.eu-central-1.saucelabs.com:4723/wd/hub/session" with method "POST" and args "{"capabilities":{"alwaysMatch":{"browserName":"chrome","browserVersion":"latest","platformName":"macOS 11","sauce:options":{"extendedDebugging":true}},"firstMatch":[{}]},"desiredCapabilities":{"browserName":"chrome","browserVersion":"latest","platformName":"macOS 11","sauce:options":{"extendedDebugging":true}}}"
[0-0] 2021-12-30T13:37:41.062Z ERROR webdriver: RequestError: connect ETIMEDOUT my-ip:4723 when running "https://ondemand.eu-central-1.saucelabs.com:4723/wd/hub/session" with method "POST" and args "{"capabilities":{"alwaysMatch":{"browserName":"chrome","browserVersion":"latest","platformName":"macOS 11","sauce:options":{"extendedDebugging":true}},"firstMatch":[{}]},"desiredCapabilities":{"browserName":"chrome","browserVersion":"latest","platformName":"macOS 11","sauce:options":{"extendedDebugging":true}}}"
[0-0] at getTimeoutError (/Users/admin/Documents/Work/new-runner/node_modules/webdriver/build/utils.js:295:24)
...
我的测试只包括我在描述和测试块中使用browser.url('url') 命令打开一个网址。
使用yarn create wdio . 命令从零开始创建整个项目。
我的配置文件是:
export const config: WebdriverIO.Config = {
port: 4723,
user: "my_user_name",
key: "my_key",
region: 'eu',
specs: [
'./tests/**/*.ts'
],
exclude: [
],
maxInstances: 6,
capabilities: {
webBrowser: {
capabilities: {
browserName: 'chrome',
browserVersion: 'latest',
platformName: 'macOS 12',
'sauce:options': {}
}
},
appBrowser: {
capabilities: {
browserName: 'Safari',
'appium:deviceName': 'iPhone 13',
platformName: 'iOS',
'appium:platformVersion': '15.0',
'sauce:options': {},
}
}
},
logLevel: 'info',
bail: 0,
baseUrl: 'http://localhost',
waitforTimeout: 10000,
connectionRetryTimeout: 120000,
connectionRetryCount: 3,
services: ['sauce', 'appium', 'selenium-standalone'],
framework: 'mocha',
reporters: ['spec'],
mochaOpts: {
ui: 'bdd',
timeout: 60000
},
}
我也无法访问测试文件中的浏览器,就像他们的指南中显示的那样,例如browser["webBrowser"].url('...').
请帮忙,非常感谢非常!
【问题讨论】:
标签: typescript automation webdriver-io saucelabs