Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I set up remote browsers in Karma?

I'm having trouble wrapping my head around Karma. I'd like to:

  • Set up multiple hosts on my network, running Linux, Mac and Windows
  • Preferably also run on Android and iPhone
  • Have these be available for running end-to-end tests through Karma
  • Have them run tests on a remote location, not locally

The goal: being able to automate tests which ensures that our site works on all platforms and browsers, not only the ones available to me locally.

Is this possible? I'm struggling to find any good guides for setting this stuff up.

like image 356
KarmaNightmare Avatar asked Jul 08 '13 11:07

KarmaNightmare


People also ask

How do I run a karma test without a browser?

Correct - Karma requires a browser to run. BUT - you can run Chrome in Headless mode, which means although you do need the browser installed, it will not open it's UI, and you can therefore run the tests purely through an SSH session for example.

How do I run a karma test in Chrome?

To launch Chrome from karma, we need to use karma-chrome-launcher. Run the command npm install karma-chrome-launcher --save to install to the application. Add the karma-chrome-launcher plugin to the plugins list in your karma.


1 Answers

You can start a webdriver server on your remote servers and configure karma to use the karma-webdriver-launcher to run the tests on the browsers from your webdriver servers.

  • WebDriver : http://code.google.com/p/selenium/wiki/RemoteWebDriverServer
  • karma-webdriver-launcher : https://github.com/karma-runner/karma-webdriver-launcher
like image 145
josketres Avatar answered Nov 04 '22 15:11

josketres