alibaba / alibaba/macaca

iOS真机测试Safari报错 TypeError: this.device.openURL is not a function

Open
#787 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
No language data
Stars
3.2k
Forks
418
PR merge metrics
No merged PRs in 30d

Description

* **Macaca Version**:
2.0.13

* **Macaca Doctor Logs**:
macaca-doctor version: 2.0.4

Node.js checklist:

node env: /usr/local/bin/node
node version: v8.9.3

iOS checklist:

Xcode Command Line Tools is ready, version: 2349.
xcodebuild version: 9.2
iproxy[usbmuxd] is installed at: `/usr/local/bin/iproxy`
ios_webkit_debug_proxy is installed at: `/usr/local/bin/ios_webkit_debug_proxy`
carthage is installed, version: 0.28.0

Android checklist:

JAVA version is `1.8.0_101`
JAVA_HOME is set to `/Library/Java/JavaVirtualMachines/jdk1.8.0_101.jdk/Contents/Home`
ANDROID_HOME is not set
Command Line Tools: gradle is uninstalled

Installed driver list:

ios: 2.0.30

* **Operate System**:
macOS 10.13.3
iphone 6 ios 11.2.5

* **Programming Language**:
node.js

* **脚本**:
``` js
var wd = require('macaca-wd');

var remoteConfig = {
host: 'localhost',
port: 4444
};

var driver = wd.promiseChainRemote(remoteConfig);

describe('Test', function () {

before(function () {
return driver.init({
platformName: 'iOS', // iOS, Android, Desktop
udid: '********',
bundleId: 'com.apple.mobilesafari',
});
});

after(function () {
return driver
.sleep(1000)
.quit();
});

it('url: https://www.baidu.com', async function () {
await driver.get('https://www.baidu.com');
});

});

```

* **问题**:
以上脚本在iOS模拟器运行正常。
但是,使用iOS真机Safari浏览器出现错误。

看到issues中有同样的问题,但是对应修改我没有解决。
ios真机,server报错 #517
请问如何解决。

* **macaca server日志**:

>> responseHandler.js:62:14 [master] pid:10916 TypeError: this.device.openURL is not a function
at IOS.get (/usr/local/lib/node_modules/macaca-ios/lib/macaca-ios.js:492:23)
at IOS.get.next ()
at onFulfilled (/usr/local/lib/node_modules/macaca-cli/node_modules/co/index.js:65:19)
at /usr/local/lib/node_modules/macaca-cli/node_modules/co/index.js:54:5
at new Promise ()
at Object.co (/usr/local/lib/node_modules/macaca-cli/node_modules/co/index.js:50:10)
at Object.toPromise (/usr/local/lib/node_modules/macaca-cli/node_modules/co/index.js:118:63)
at next (/usr/local/lib/node_modules/macaca-cli/node_modules/co/index.js:99:29)
at onFulfilled (/usr/local/lib/node_modules/macaca-cli/node_modules/co/index.js:69:7)
at /usr/local/lib/node_modules/macaca-cli/node_modules/co/index.js:54:5
at new Promise ()
at Object.co (/usr/local/lib/node_modules/macaca-cli/node_modules/co/index.js:50:10)
at Object.toPromise (/usr/local/lib/node_modules/macaca-cli/node_modules/co/index.js:118:63)
at next (/usr/local/lib/node_modules/macaca-cli/node_modules/co/index.js:99:29)
at onFulfilled (/usr/local/lib/node_modules/macaca-cli/node_modules/co/index.js:69:7)
at /usr/local/lib/node_modules/macaca-cli/node_modules/co/index.js:54:5
TypeError: this.device.openURL is not a function
at IOS.get (/usr/local/lib/node_modules/macaca-ios/lib/macaca-ios.js:492:23)
at IOS.get.next ()
at onFulfilled (/usr/local/lib/node_modules/macaca-cli/node_modules/co/index.js:65:19)
at /usr/local/lib/node_modules/macaca-cli/node_modules/co/index.js:54:5
at new Promise ()
at Object.co (/usr/local/lib/node_modules/macaca-cli/node_modules/co/index.js:50:10)
at Object.toPromise (/usr/local/lib/node_modules/macaca-cli/node_modules/co/index.js:118:63)
at next (/usr/local/lib/node_modules/macaca-cli/node_modules/co/index.js:99:29)
at onFulfilled (/usr/local/lib/node_modules/macaca-cli/node_modules/co/index.js:69:7)
at /usr/local/lib/node_modules/macaca-cli/node_modules/co/index.js:54:5
at new Promise ()
at Object.co (/usr/local/lib/node_modules/macaca-cli/node_modules/co/index.js:50:10)
at Object.toPromise (/usr/local/lib/node_modules/macaca-cli/node_modules/co/index.js:118:63)
at next (/usr/local/lib/node_modules/macaca-cli/node_modules/co/index.js:99:29)
at onFulfilled (/usr/local/lib/node_modules/macaca-cli/node_modules/co/index.js:69:7)
at /usr/local/lib/node_modules/macaca-cli/node_modules/co/index.js:54:5

Contributor guide

No contributing guide indexed for this repository

Research direction

Start at macaca-ios.js:492, where IOS.get calls this.device.openURL, and compare the provided macaca-ios and iOS simulator versus real-device setup. Reproduce with the supplied macaca-wd script on an iPhone running iOS 11.2.5, then verify that driver.get opens the URL without the TypeError.

Written by the indexing model from the issue text.

Assessment

Tech stack
ios, node.js
Domain
mobile, testing-qa
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.