Fix phantomjs invocation for Ubuntu 16.04

This commit is contained in:
Richard Gibson
2017-05-25 09:52:06 -04:00
parent 2ddad07fc7
commit e0f3656629

View File

@@ -28,7 +28,12 @@ function execPhantomjsToLoadHtmlSaveScreenshotPng (html, verify) {
function execCmd (cmd, verify) {
console.log('cmd: ', cmd)
exec(cmd,
{ env: { PATH: './node_modules/.bin' + path.delimiter + process.env.PATH } },
{ env: {
PATH: './node_modules/.bin' + path.delimiter + process.env.PATH,
// https://github.com/ariya/phantomjs/issues/14376
QT_QPA_PLATFORM: 'offscreen'
} },
function (error, stdout, stderr) {
console.log('error:', error, '\nstdout:\n', stdout, '\nstderr:\n', stderr)
verify(error, stdout, stderr)