Browserstack App Automate 需要很长时间才能启动

Browserstack App Automate takes a very long time to start

我正在使用 WebdriverIO 将我的 Appium 测试脚本连接到 Browserstack。我的项目结构与这里的示例基本相同:https://github.com/browserstack/webdriverio-appium-app-browserstack/tree/master/ios

使用我们自己的应用程序,测试大约需要 6-9 分钟才能开始。调查录像时,应用程序立即打开,它只是在第一屏停留几分钟,然后才执行命令。

[12:03:32]  COMMAND     POST     "/wd/hub/session"
[12:03:32]  DATA                {"desiredCapabilities":{"javascriptEnabled":true,"locationContextEnabled":true,"handlesAlerts":true,"rotatable":true,"name":"Sign_Up","build":"PBA_iOS","device":"iPhone 7 Plus","app":"XXXXXXXX","browserstack.debug":true,"requestOrigins":{"url":"http://webdriver.io","version":"4.13.2","name":"webdriverio"}}}
[12:09:20]  INFO        SET SESSION ID 2be9267fe9bae10f3fef233698954493bb33fdc7
[12:09:20]  RESULT              {"webStorageEnabled":false,"locationContextEnabled":true,"browserName":"","platform":"MAC","javascriptEnabled":true,"databaseEnabled":false,"takesScreenshot":true,"networkConnectionEnabled":false,"han ... (1268 more bytes)
[12:09:20]  COMMAND     POST     "/wd/hub/session/2be9267fe9bae10f3fef233698954493bb33fdc7/elements"
[12:09:20]  DATA                {"using":"accessibility id","value":"OK"}
[12:09:20]  RESULT              [{"ELEMENT":"D4CDA7B7-2EC7-422B-AD3C-1BF40E73ECBA"}]

您可以在控制台日志中看到,在发送所需功能后发生了漫长的等待。有没有办法加快速度?

我的配置文件:

exports.config = {
  user: 'XXXXXXXXXXX',
  key: 'XXXXXXXXXXXXXXXXX',

  updateJob: false,
  specs: [
    './tests/signup.spec.js'
  ],
  exclude: [],

  capabilities: [{
    name: 'Sign_Up',
    build: 'PBA_iOS',
    device: 'iPhone 7 Plus',
    app: 'XXXXXXXX',
    'browserstack.debug': true
  }],

  logLevel: 'verbose',
  coloredLogs: true,
  screenshotPath: './errorShots/',
  baseUrl: '',
  waitforTimeout: 10000,
  connectionRetryTimeout: 90000,
  connectionRetryCount: 3,

  framework: 'mocha',
  mochaOpts: {
    ui: 'bdd',
    timeout: 40000
  }
};

以防万一,我仍在试用中(这个问题特别烦人,因为 10 秒的测试用例耗尽了试用计时器等待的时间)。

如果您的应用在启动时有一些弹出窗口增加了启动时间,通常会发生这种情况。添加功能 waitForQuiescence: false 并重试。