如何使用 Selenium 和 SauceLabs 为 Javascript 应用程序对 iPhone 进行端到端测试?我使用 wd.js 作为 Selenium 客户端库。
成为browser
的结果require("wd").remote(..., "promiseChain")
:
browser.init({
browserName: "iphone",
version: "4",
platform: "OS X 10.6",
deviceName: "iPhone",
"device-orientation": "portrait"
})
.sessionCapabilities()
.then(console.log.bind(console), console.log.bind(console))
.quit()
这导致:
{ [Error: [init({"browserName":"iphone","version":"4","platform":"OS X 10.6","deviceName":"iPhone","device-orientation":"portrait","record-video":false,"record-screenshots":false})] The environment you requested was unavailable.] data: 'Invalid device name specified: iPhone' }
然而,该组合直接取自https://saucelabs.com/platforms
一切都适用于所有其他组合,包括 Android 组合。