我正在尝试在量角器中使用设备命令。
我有这样的配置
if (process.argv.indexOf('android') > -1) {
var wd = require('wd'),
protractor = require('protractor');
var wdBridge;
try {
wdBridge = require('wd-bridge')(protractor, wd);
} catch (ign) {
// just so that it runs locally
wdBridge = require('../..')(protractor, wd);
}
}
export let config: Config = {
onPrepare() {
wdBridge.initFromProtractor(config);
}
}
并且在我的规范中:
this.passwordFld.sendKeys(password).then(() => {
wdBrowser.hideDeviceKeyboard();
this.signInBtn.click();
});
但是随后它说未定义wdBrowser。如何安装?