我正在尝试在iOS模拟器/ Genymotion Android模拟器上使用Appium运行Protractor测试。对于这个问题,让我们坚持使用iOS,不管吗?
webdriver-manager update --ios
webdriver-manager start --ios
,它将自动启动appium `
'use strict';
exports.config = {
seleniumAddress: 'http://localhost:4723/wd/hub',
capabilities: {
app: '/Users/aaa/Projects/bbb/platforms/ios/build/emulator/mobileCRM.app',
browserName: 'safari',
platformName: 'iOS',
platformVersion: '9.3',
deviceName: 'IPad Simulator',
},
baseUrl: 'http://10.0.2.2:3000',
// Spec patterns are relative to the current working directly when
// protractor is called.
specs: ['./test/protractor/**/*.js'],
/* configuring wd in onPrepare
* wdBridge helps to bridge wd driver with other selenium clients
* See https://github.com/sebv/wd-bridge/blob/master/README.md
*/
onPrepare: function () {
var wd = require('wd'),
protractor = require('protractor'),
wdBridge = require('wd-bridge')(protractor, wd);
wdBridge.initFromProtractor(exports.config);
}
};
`
./node_modules/protractor/bin/protractor protractor.conf.js
预期? 应该启动iOS模拟器,
会发生什么? 量角器测试始终在Chrome中开始。那么,我做错了什么?
加成: `
./node_modules/protractor/bin/webdriver-manager status
[13:01:05] I/status - selenium standalone version available: 2.53.1 [default] [last]
[13:01:05] I/status - chromedriver version available: 2.26 [default] [last]
[13:01:05] I/status - geckodriver version available: v0.12.0 [default] [last]
[13:01:05] I/status - appium version available: 1.6.0 [default] [last]
[13:01:05] I/status - android-sdk is not present
`
答案 0 :(得分:1)
在Setting Up Protractor with Appium - iOS / Safari部分的底部,它注意到以下内容:
baseUrl is localhost (not 10.0.2.2)