Meteor-Community-Packages / meteor-mocha

A Mocha test driver package for Meteor 1.3+. This package reports server AND client test results in the server console and can be used for running tests on a CI server or locally.
https://packosphere.com/meteortesting/mocha
MIT License
67 stars 40 forks source link

Can't run client tests with Chrome on Ubuntu #71

Open eric-burel opened 6 years ago

eric-burel commented 6 years ago

Hi, When running this command: TEST_BROWSER_DRIVER=chrome TEST_WATCH=1 meteor test-packages ./packages/* --driver-package meteortesting:mocha --raw-logs, I get the error below. This seems to be a config issue when setting up the Chrome driver.

TypeError: options.toCapabilities is not a function
    at startChrome (packages/meteortesting:browser-tests/browser/chromedriver.js:46:82)
    at startBrowser (packages/meteortesting:browser-tests/server.js:23:7)
    at clientTests (packages/meteortesting:mocha/server.js:138:3)
    at serverTests (packages/meteortesting:mocha/server.js:168:7)
    at mochaInstance.run.failureCount (packages/meteortesting:mocha/server.js:118:13)
    at done (/home/eric-burel/.meteor/packages/practicalmeteor_mocha-core/.1.0.1.12nygdi.uqn4++os+web.browser+web.cordova/npm/node_modules/mocha/lib/mocha.js:497:13)
    at Runner.<anonymous> (/home/eric-burel/.meteor/packages/practicalmeteor_mocha-core/.1.0.1.12nygdi.uqn4++os+web.browser+web.cordova/npm/node_modules/mocha/lib/runner.js:804:5)
    at emitNone (events.js:111:20)
    at Runner.emit (events.js:208:7)
    at /home/eric-burel/.meteor/packages/practicalmeteor_mocha-core/.1.0.1.12nygdi.uqn4++os+web.browser+web.cordova/npm/node_modules/mocha/lib/runner.js:791:12
    at /home/eric-burel/.meteor/packages/practicalmeteor_mocha-core/.1.0.1.12nygdi.uqn4++os+web.browser+web.cordova/npm/node_modules/mocha/lib/runner.js:644:9
    at next (/home/eric-burel/.meteor/packages/practicalmeteor_mocha-core/.1.0.1.12nygdi.uqn4++os+web.browser+web.cordova/npm/node_modules/mocha/lib/runner.js:284:14)
    at Immediate._onImmediate (/home/eric-burel/.meteor/packages/practicalmeteor_mocha-core/.1.0.1.12nygdi.uqn4++os+web.browser+web.cordova/npm/node_modules/mocha/lib/runner.js:320:5)
    at runCallback (timers.js:810:20)
    at tryOnImmediate (timers.js:768:5)
    at processImmediate [as _immediateCallback] (timers.js:745:5)
aldeed commented 6 years ago

Maybe related to the fact that this package doesn't work with test-packages due to Meteor issue: https://github.com/meteor/meteor/issues/8577

Floriferous commented 6 years ago

Seeing this as well. From what I can see, playing around with different versions of selenium-webdriver and chromedriver might temporarily fix this. But that's a real pain, haven't found a working combo yet.

SimonSimCity commented 6 years ago

Looks like this issue is part of https://github.com/meteortesting/meteor-browser-tests or even further down the line - haven't looked into it yet.

@Floriferous since you want to use chrome, can you take a look at Puppeteer? https://github.com/meteortesting/meteor-browser-tests#puppeteer It's a headless version of chrome which doesn't use selenium but directly communicates with a headless version of chrome.

hexsprite commented 6 years ago

Not sure if this helps but I'm using TEST_BROWSER_DRIVER=chrome on OSX with these versions:

"chromedriver": "^2.41.0",
"selenium-webdriver": "^3.6.0",
DanielDornhardt commented 6 years ago

Thx @hexsprite , "selenium-webdriver": "^3.6.0" did it for me.

It was "selenium-webdriver": "^4.0.0-alpha.1" before which might not be compatible (?)

SimonSimCity commented 6 years ago

So I guess this issue is closed then. If not, please create a new issue on https://github.com/meteortesting/meteor-browser-tests which is used by this package to start up the browsers.

But I rather see this as an issue with the selenium driver than a problem with either this or the named package.

Nomeasmo commented 6 years ago

I think you can close if the documentation is updated.

SimonSimCity commented 6 years ago

Thanks, I'm adding a cross-reference to https://github.com/meteortesting/meteor-mocha/issues/80