首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >黑猩猩测试已停止工作,引发错误:缺少或无效的'entry.level‘

黑猩猩测试已停止工作,引发错误:缺少或无效的'entry.level‘
EN

Stack Overflow用户
提问于 2017-12-09 17:48:00
回答 1查看 630关注 0票数 1

我正在尝试运行测试(Chimp/),昨天有工作,今天没有。下面是黑猩猩的配置:

代码语言:javascript
复制
module.exports = {
  // - - - - CHIMP - - - -
  watch: false,
  watchWithPolling: false,
  sync: true,

  // - - - - WEBDRIVER-IO  - - - -
  webdriverio: {
    coloredLogs: true,
    logLevel: 'silent',
    screenshotPath: './tests/logs/screenshots',
    waitforTimeout: 20000,
    waitforInterval: 250
  },

  // - - - - MOCHA  - - - -
  mocha: true,
  mochaConfig: {
    timeout: 20000,
  },
  chai: true,
  // path: './tests/spec',
  path: './tests/spec/shop/configurator/products',
  format: 'dot',

 // - - - - SELENIUM  - - - -
  browser: 'chrome',
  platform: 'ANY',
  name: '',
  user: '',
  key: '',
  port: null,
  host: null,

  // - - - - METEOR  - - - -
  ddp: 'http://localhost:3000',
  serverExecuteTimeout: 20000,

  // - - - - PHANTOM  - - - -
  phantom_w: 1920,
  phantom_h: 1280
};

这是报告输出,甚至在第一次测试开始之前,它都失败了。

代码语言:javascript
复制
[chimp] Running...


  Configurator @watch
    1) "before all" hook


  0 passing (10s)
  1 failing

  1) Configurator @watch "before all" hook:
     Uncaught unknown error: cannot determine loading status
from unknown error: missing or invalid 'entry.level'

当在浏览器堆栈中运行时,它可以工作。以下是浏览器堆栈配置:

代码语言:javascript
复制
var browserstack = require('browserstack-local');
var bs_local = new browserstack.Local();
var bs_local_args = {/* ... */};

// starts the Local instance with the required arguments
bs_local.start(bs_local_args, function () {
    console.log("Started BrowserStackLocal");
});

module.exports = {
    // - - - - CHIMP - - - -
    watch: false,
    watchWithPolling: false,
    sync: true,

    // - - - - WEBDRIVER-IO  - - - -
    webdriverio: {
        baseUrl: 'http://localhost:3000',
        coloredLogs: true,
        desiredCapabilities: {
            os: 'OS X',
            os_version: 'El Capitan',
            browser: 'Chrome',
            browser_version: '58.0',
            resolution: '1280x1024',
            project: 'project',
            build: 'build',
            'browserstack.local': true
        },
        logLevel: 'silent',
        screenshotPath: './tests/logs/screenshots',
        waitforTimeout: 50000,
        waitforInterval: 250
    },

    // - - - - MOCHA  - - - -
    mocha: true,
    mochaConfig: {
        timeout: 60001, 
    },
    chai: true,
    path: './tests/spec',
    format: 'dots',

    // - - - - Screenshots - - - -
    screenshotsOnError: true,
    screenshotPath: './tests/logs/screenshots',
    captureAllStepScreenshots: false,
    saveScreenshotsToDisk: true,
    saveScreenshotsToReport: false,

    // - - - - SELENIUM  - - - -
    name: 'project',
    browser: 'Chrome',
    user: '...',
    key: '...',
    host: 'hub.browserstack.com',
    port: 80,

    // - - - - METEOR  - - - -
    ddp: 'http://localhost:3000',
    serverExecuteTimeout: 30000,

    // - - - - PHANTOM  - - - -
    phantom_w: 1280,
    phantom_h: 1024
};

我试图修复它的是更新黑猩猩(0.50.2),重新安装node_modules,在火狐上运行它,没有任何帮助。我在不同的环境(OS / Ubuntu 16.04)中尝试了一下,结果是一样的。

EN

回答 1

Stack Overflow用户

发布于 2017-12-11 20:19:19

黑猩猩对你隐藏了大量的Selenium配置。例如,它会在安装时为您下载驱动程序二进制文件。然而,您的本地环境通常比这复杂一点。你应该检查的第一件事是-你的浏览器是否在你没有注意到的情况下更新了它们的版本。如果你没有锁定你的browser-driver-chimp版本,这种情况就会发生。据我所知,您可以将其用于云运行:

代码语言:javascript
复制
 browser: 'Chrome',
 browser_version: '58.0', 

这似乎是可行的。因此,显式地锁定它们的版本(包括禁用浏览器更新)是一个很好的做法。我在0.50.2上也看不到黑猩猩本身有什么显著的变化。

检查兼容的驱动程序浏览器版本的一种方法是查看ChromeDriver的当前发行说明。如果这仍然没有帮助-降级驱动程序或浏览器对,直到它工作。看起来你需要使用Chrome版本的ChromeDriver v2.31 (2017-07-21),而黑猩猩版本是pinned to 2.28

有几次我不得不自己玩猜谜游戏,直到它再次工作。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/47727311

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档