First time asking a question on SO. Please be kind. I will graciously accept question feedback.
I have a Jenkins instance running on an openSUSE Linux machine that I do not have root access to. I have configured Jenkins with a custom tool installation that pulls in Firefox 56.0.1 from https://ftp.mozilla.org/pub/firefox/releases/56.0.1/linux-x86_64/en-US/firefox-56.0.1.tar.bz2
I have an Angular app that's built on the Angular CLI. Here is the relevant section of my karma.conf.js:
browsers: ['FirefoxHeadless'],
singleRun: true,
customLaunchers: {
'FirefoxHeadless': {
base: 'Firefox',
flags: [
'-headless',
],
}
My Jenkins has a job that pulls the Angular app and runs ng test
using Firefox 56.0.1 with the -headless
flag. However, it fails with the following feedback:
ERROR [launcher]: [39mCannot start Firefox
(process:3050): GLib-CRITICAL **: g_slice_set_config: assertion
'sys_page_size == 0' failed
Error: no display specified
Research into this error points to xvfb needing to be run for Selenium and a DISPLAY
environment variable being set so that Firefox can connect to that display. Since this is supposed to be headless, I don't believe that xvfb should be required since running headless should not require a graphical display (I do not want to go through the work of trying to install xvfb on a machine I do not have root access to). Adding the DISPLAY
environment variable only changes the error to cannot open display: :10
.
How do I get my jenkins instance to run karma tests in a headless version of Firefox?