Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Continuous integration with karma #1560

Closed
f-jost opened this issue Aug 13, 2015 · 2 comments
Closed

Continuous integration with karma #1560

f-jost opened this issue Aug 13, 2015 · 2 comments
Labels

Comments

@f-jost
Copy link

f-jost commented Aug 13, 2015

Hi,

What is the best practice to use karma for continuous integration?

Should we use xvfb, selenium?

I found this package npm:
https://www.npmjs.com/package/karma-selenium-webdriver-launcher

but doesn't seem to work :

karma.conf.js
'use strict';

var By = require('selenium-webdriver').By,
    until = require('selenium-webdriver').until,
    firefox = require('selenium-webdriver/firefox');

module.exports = function(config) {
    config.set({
    frameworks: ['jasmine'],

    // define browsers 
    customLaunchers: {
      swd_firefox: {
        base: 'SeleniumWebdriver',
        browserName: 'Firefox',
        getDriver: function(){
          // example from https://www.npmjs.com/package/selenium-webdriver#usage 
          var driver = new firefox.Driver();
          return driver;
        }
      },
    },

browsers: ['swd_firefox']
  });
};

13 08 2015 11:47:57.972:INFO [karma]: Karma v0.13.9 server started at http://localhost:9876/
changed name to Firefox via Selenium Webdriver
13 08 2015 11:47:58.010:INFO [launcher.selenium-webdriver]: SeleniumWebdriverBrowser (kid:94515610) created
13 08 2015 11:47:58.011:INFO [launcher]: Starting browser Firefox via Selenium Webdriver
13 08 2015 11:47:58.012:INFO [launcher.selenium-webdriver]: starting Firefox via Selenium Webdriver
13 08 2015 11:47:58.046:INFO [launcher.selenium-webdriver]: sending driver to url http://localhost:9876/?id=94515610
13 08 2015 11:48:43.840:ERROR [karma]: [Error: Timed out waiting for the WebDriver server at http://127.0.0.1:51217/hub]
Error: Timed out waiting for the WebDriver server at http://127.0.0.1:51217/hub

Thanks

EDIT :
npm install xvfb resolved my problem. Then in my karma.conf.js:

module.exports = function(config) {

var Xvfb = require('xvfb');
var xvfb = new Xvfb();
xvfb.startSync();
@Krinkle
Copy link
Contributor

Krinkle commented Aug 24, 2015

See #1320 and karma-runner/karma-chrome-launcher#20 (comment).

In the current system you're expected to set up Xvfb before running Karma. E.g. ensure an xvfb deamon is running and run export DISPLAY=.. (with your display number) before invoking karma or npm test.

@devoto13
Copy link
Collaborator

Closing as answered and resolved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants