Karma cannot start Firefox with Jenkins and Ubuntu 12.04

后端 未结 2 759
野性不改
野性不改 2021-02-10 07:37

I have set up a Jenkins job that should run Firefox. Signed in to Ubuntu with the Jenkins user, I can manually launch Firefox without any problem. However, when I run the job in

相关标签:
2条回答
  • 2021-02-10 08:19

    Got it. It turns out the problem originated from a misconception on how to run karma in the first place.

    The Jenkins task was doing karma start, with autowatch set to true. Instead, I fired up karma with autowatch false in rc.local (script ran on boot) and the Jenkins task executes karma run instead. This solved the problem entirely.

    Edit: Installing the xvnc plugin, and activating it for build works for karma start and karma run.

    Edit: The problem came back when I upgraded to 14.04. The fix was to make sure the environment variables injected in the build pointed to the X11 versions.

    FIREFOX_BIN=/usr/bin/X11/firefox
    CHROME_BIN=/usr/bin/X11/google-chrome
    
    0 讨论(0)
  • 2021-02-10 08:29

    Would you mind running karma with --log-level debug and also --no-colors so we can have a better idea of the reason why it fails?

    I you also tried with another browser? I often encounter issues while running a GUI tool within Jenkins.

    You might want to try running your test suite with PhantomJS (http://phantomjs.org/) just to see if a headless browser would solve the problem

    0 讨论(0)
提交回复
热议问题