我正在尝试运行测试(黑猩猩/),昨天有工作,今天没有。这是黑猩猩的配置:
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
};
这是报告输出,在首次测试开始之前,它失败了。
[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'
在Browserstack中运行时,它可以正常工作。这是Browserstack配置:
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,用firefox运行它,没有任何帮助。我在不同的环境(OS/Ubuntu 16.04)中尝试过,结果是相同的。
黑猩猩隐藏了您的许多硒配置。例如,它在安装时为您下载驱动程序二进制文件。但是,您的本地环境通常比这复杂得多。您应该检查的第一件事是 - 进行浏览器更新了其版本,而无需注意。如果您还没有锁定browser-driver-chimp
版本,则实际上会发生这种情况。到目前为止,我可以看到您用于云运行:
browser: 'Chrome',
browser_version: '58.0',
这似乎有效。因此,最好明确锁定其版本(这包括禁用浏览器更新)。我也没有看到黑猩猩本身为0.50.2。
的重大变化。检查兼容驱动程序浏览器版本的一种方法是浏览Chromedriver的当前发行说明。如果这仍然无济于事 - 降级驱动程序或浏览器对,直到工作。看来您需要使用该镀铬版本的ChromeDriver v2.31 (2017-07-21)
,而Chimp One则固定为2.28。
几次我必须自己玩猜测游戏,直到再次起作用为止。