Macaca 求助:使用 node.js 编写的脚本执行时,总是第一次失败,第二次才能成功;发现原因是 webdriver 先于 App 安装到手机上就会失败,请问如何保证每次都是 App 先安装到手机上了?求解答,多谢!

Duke · 2017年03月18日 · 1838 次阅读

启动调用脚本如下:

var wd = require('macaca-wd');

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

var driver;

const config_info = require('./config.json');
describe('testcases', function() {
  this.timeout(30 * 60 * 1000);

   driver = wd.promiseChainRemote(remoteConfig);
   driver.configureHttp({
    timeout: 600 * 1000
   });

    before(function() {
        return driver
            .init({ 
            platformName: config_info.TestAppInfo.platform,
            udid:config_info.TestAppInfo.device_udid, 
            app:config_info.TestAppInfo.app_path  
          })

    });

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

  it('#0  verify login', function() {
  ...
 });

});

共收到 0 条回复 时间 点赞
Duke 关闭了讨论 03月28日 18:49
需要 登录 后方可回复, 如果你还没有账号请点击这里 注册