Git Product home page Git Product logo

karma-firefox-launcher's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

karma-firefox-launcher's Issues

Cannot load extension

I cannot find any way with 0.1.4 of the launcher to load an extension into the browser. I need this because I am running functional tests that require the extension to be present. From the looks of the mozilla docs, the best way to do this is to point firefox at a profile that has the extension already in it. However, this project currently does not allow you to specify a custom profile directory.

Does not work by the latest Firefox on Windows

Firefox just updated to 48.0.1 and the launcher stopped working... :S

23 08 2016 01:47:25.504:WARN [Firefox 48.0.0 (Windows 7 0.0.0)]: Disconnected (1 times), because no message in 10000 ms.

The previous version was 48.0.x either.

Disabling multi-process does not work

The 1.0.1 cl says "disable multi-process firefox " in 9f28aa9.

However, I've noticed in FF53 and FF51 that about:config looks like this in FF:
browser.tabs.remote.autostart user-defined false
browser.tabs.remote.autostart.2 user-defined true

So the first one works, but the second one seems to get overwritten. Is it because Firefox itself sets this value somewhere?
I've tested with a clean FF51 installation.

I can also confirm that the second flag is definitely needed because after I manually set it to false, the behavior in my tests changes.

Release a new version?

The last release was 2 years ago and since then quite a few commits have been merged into the repo, is there any chance of a release?

Random errors : cannot start Firefox/FirefoxHeadless

Firefox : v67.0.3
OS : Ubuntu 19.04 and Windows 10
Karma : v4.1.0
Firefox launcher : v1.1.0
Node.js : v12.4.0

I've some projects whose Karma tests work as expected when I'm using the Chrome launcher. But when I use the Firefox launcher, I get the following error:

0 06 2019 19:37:21.060:INFO [karma-server]: Karma v4.1.0 server started at http://0.0.0.0:9876/
20 06 2019 19:37:21.062:INFO [launcher]: Launching browsers Firefox with concurrency unlimited
20 06 2019 19:37:21.067:INFO [launcher]: Starting browser Firefox
20 06 2019 19:37:21.124:ERROR [launcher]: Cannot start Firefox
	
20 06 2019 19:37:21.124:ERROR [launcher]: Firefox stdout: 
20 06 2019 19:37:21.124:ERROR [launcher]: Firefox stderr: 
20 06 2019 19:37:21.127:INFO [launcher]: Trying to start Firefox again (1/2).
20 06 2019 19:37:21.181:ERROR [launcher]: Cannot start Firefox
	
20 06 2019 19:37:21.181:ERROR [launcher]: Firefox stdout: 
20 06 2019 19:37:21.181:ERROR [launcher]: Firefox stderr: 
20 06 2019 19:37:21.183:INFO [launcher]: Trying to start Firefox again (2/2).
20 06 2019 19:37:21.237:ERROR [launcher]: Cannot start Firefox
	
20 06 2019 19:37:21.238:ERROR [launcher]: Firefox stdout: 
20 06 2019 19:37:21.238:ERROR [launcher]: Firefox stderr: 
20 06 2019 19:37:21.239:ERROR [launcher]: Firefox failed 2 times (cannot start). Giving up.
[19:37:21] 'test:browser' errored after 585 ms
[19:37:21] Error: karma: 1
    at ChildProcess.<anonymous> (/repo/js/enum.js/gulpfile.esm.js:93:40)
    at ChildProcess.emit (events.js:200:13)
    at ChildProcess.EventEmitter.emit (domain.js:494:23)
    at maybeClose (internal/child_process.js:1021:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:283:5)

This error seems to be random: on some projects, the launcher works as expected (for example: https://github.com/cedx/lcov.js). On other projects, the launcher triggers the error (for example: https://github.com/cedx/enum.js).

For the projects that fail, it also seems to be random: the error is triggered on Ubuntu 19.04 and Windows 10, but not on TravisCI with Ubuntu 16.04 (for example: https://travis-ci.com/cedx/enum.js/jobs/209733946).

My Karma config (which is the same on the two mentioned projects):

module.exports = config => config.set({
  basePath: require('path').resolve(__dirname, '..'),
  browsers: ['FirefoxHeadless'],
  files: [
    {pattern: 'lib/**/*.js', type: 'module'},
    {pattern: 'test/**/*.js', type: 'module'}
  ],
  frameworks: ['mocha', 'chai'],
  reporters: ['progress'],
  singleRun: true
});

Using Firefox, instead of FirefoxHeadless, does not change anything (i.e. same error).

Unknown Error

I'm trying to execute karma test with jasmine on firefox. I installed karma-firefox-launcher and was working before, but now I'm getting a strange error:

{ [Error: spawn UNKNOWN] code: 'UNKNOWN', errno: 'UNKNOWN', syscall: 'spawn' } Error: spawn UNKNOWN at exports._errnoException (util.js:870:11) at ChildProcess.spawn (internal/child_process.js:298:11) at exports.spawn (child_process.js:362:9) at Object._execCommand (C:\stash\scripts\node_modules\karma\lib\launchers\process.js:63:21) at Object._start (C:\stash\scripts\node_modules\karma-firefox-launcher\index.js:96:10) at Object.<anonymous> (C:\stash\scripts\node_modules\karma\lib\launchers\process.js:14:10) at emitOne (events.js:82:20) at Object.emit (events.js:169:7) at Object.start (C:\stash\scripts\node_modules\karma\lib\launchers\base.js:42:10) at C:\stash\scripts\node_modules\karma\lib\launcher.js:94:17 at next (C:\stash\scripts\node_modules\karma\node_modules\batch\index.js:118:7) at Batch.end (C:\stash\scripts\node_modules\karma\node_modules\batch\index.js:154:5) at launch (C:\stash\scripts\node_modules\karma\lib\launcher.js:111:11) at invoke (C:\stash\scripts\node_modules\karma\node_modules\di\lib\injector.js:75:15) at Server.<anonymous> (C:\stash\scripts\node_modules\karma\lib\server.js:171:24) at Server.g (events.js:260:16)

Any one know what can be?

Thanks a lot!

Error during loading "karma-firefox-launcher" plugin: Cannot read property 'substr' of undefined

We face the following error in our CI infrastructure on Windows Servers with your new 1.0.1 release:

ERROR [plugin]: Error during loading "karma-firefox-launcher" plugin:
  Cannot read property 'substr' of undefined

This happens as you access the "PATH" variable in a way, not every bash support:
var paden = process.env.Path.split(';')

Please use "PATH" or ["PATH"], to be able to run also on Windows machines using gitbash or cygwin.

Failures with require-css

Started getting failures after adding require-css to my project. Dug in with the debugger and figured out the problem.

require-css adds a link tag and then fires a callback when the css is actually loaded. The detection uses a load event callback if it thinks the browser supports it and polls otherwise. The logic is pretty simple, it prefers using the load event but polls with webkit and older versions. This seems to be fine for normal operation with firefox but fails in karma. For some reason the load event never fires. Hacking require-css to force it to poll got my tests green again.

So is there anything that can be done in the launcher or karma to fix this?

Firefox begin update when karma launch it

Of course because of it tests are not runned. I think, there shall be a method to forbid auto update of the browser when test starts. I get following output to the console:

D:\Projects\other\structured-diff>npm run browser

> [email protected] browser D:\Projects\other\structured-diff
> karma start

04 04 2018 22:34:36.038:DEBUG [config]: Loading config D:\Projects\other\structured-diff\karma.conf.js
04 04 2018 22:34:36.082:DEBUG [plugin]: Loading karma-* from D:\Projects\other\structured-diff\node_modules
04 04 2018 22:34:36.095:DEBUG [plugin]: Loading plugin D:\Projects\other\structured-diff\node_modules/karma-browserify.
04 04 2018 22:34:36.500:DEBUG [plugin]: Loading plugin D:\Projects\other\structured-diff\node_modules/karma-chrome-launcher.
04 04 2018 22:34:36.547:DEBUG [plugin]: Loading plugin D:\Projects\other\structured-diff\node_modules/karma-firefox-launcher.
04 04 2018 22:34:36.562:DEBUG [plugin]: Loading plugin D:\Projects\other\structured-diff\node_modules/karma-mocha.
04 04 2018 22:34:36.576:DEBUG [plugin]: Loading plugin D:\Projects\other\structured-diff\node_modules/karma-mocha-reporter.
04 04 2018 22:34:36.821:DEBUG [plugin]: Loading plugin D:\Projects\other\structured-diff\node_modules/karma-opera-launcher.
04 04 2018 22:34:36.833:DEBUG [plugin]: Loading plugin D:\Projects\other\structured-diff\node_modules/karma-sauce-launcher.
04 04 2018 22:34:38.608:DEBUG [framework.browserify]: created browserify bundle: C:\Users\mingun\AppData\Local\Temp\39d0116d299ec0c95803c09842d37005.browserify
04 04 2018 22:34:38.731:DEBUG [framework.browserify]: add bundle to config.files at position 0
04 04 2018 22:34:38.762:DEBUG [web-server]: Instantiating middleware
04 04 2018 22:34:38.770:DEBUG [reporter]: Trying to load reporter: mocha
04 04 2018 22:34:38.785:DEBUG [reporter]: Trying to load color-version of reporter: mocha (mocha_color)
04 04 2018 22:34:38.792:DEBUG [reporter]: Couldn't load color-version.

START:
04 04 2018 22:34:39.065:DEBUG [framework.browserify]: building bundle
04 04 2018 22:34:39.073:DEBUG [framework.browserify]: updating lib\diff.js in bundle
04 04 2018 22:34:39.077:DEBUG [framework.browserify]: updating lib\hunk.js in bundle
04 04 2018 22:34:39.114:DEBUG [framework.browserify]: updating lib\inline.js in bundle
04 04 2018 22:34:39.118:DEBUG [framework.browserify]: updating lib\object.js in bundle
04 04 2018 22:34:39.195:DEBUG [framework.browserify]: updating lib\word-diff.js in bundle
04 04 2018 22:34:39.249:DEBUG [framework.browserify]: updating lib\unified.js in bundle
04 04 2018 22:34:39.262:DEBUG [framework.browserify]: updating test\diff.js in bundle
04 04 2018 22:34:39.269:DEBUG [framework.browserify]: updating test\hunk.js in bundle
04 04 2018 22:34:39.314:DEBUG [framework.browserify]: updating test\inline.js in bundle
04 04 2018 22:34:39.318:DEBUG [framework.browserify]: updating test\unified.js in bundle
04 04 2018 22:34:40.040:DEBUG [framework.browserify]: bundling
04 04 2018 22:34:44.039:INFO [framework.browserify]: bundle built
04 04 2018 22:34:44.095:INFO [karma]: Karma v2.0.0 server started at http://0.0.0.0:9876/
04 04 2018 22:34:44.104:INFO [launcher]: Launching browser Firefox with unlimited concurrency
04 04 2018 22:34:44.146:INFO [launcher]: Starting browser Firefox
04 04 2018 22:34:44.158:DEBUG [temp-dir]: Creating temp dir at C:\Users\mingun\AppData\Local\Temp\karma-11747892
04 04 2018 22:34:44.168:DEBUG [launcher]: D:\Полезные программы\Mozilla Firefox\firefox.exe http://localhost:9876/?id=11747892 -profile C:\Users\mingun\AppData\Local\Temp\karma-11747892 -no-remote
04 04 2018 22:34:44.999:DEBUG [launcher]: Process Firefox exited with code 0
04 04 2018 22:34:45.001:ERROR [launcher]: Cannot start Firefox

04 04 2018 22:34:45.002:ERROR [launcher]: Firefox stdout:
04 04 2018 22:34:45.002:ERROR [launcher]: Firefox stderr:
04 04 2018 22:34:45.005:DEBUG [temp-dir]: Cleaning temp dir C:\Users\mingun\AppData\Local\Temp\karma-11747892
04 04 2018 22:34:45.026:INFO [launcher]: Trying to start Firefox again (1/2).
04 04 2018 22:34:45.029:DEBUG [launcher]: Restarting Firefox
04 04 2018 22:34:45.030:DEBUG [temp-dir]: Creating temp dir at C:\Users\mingun\AppData\Local\Temp\karma-11747892
04 04 2018 22:34:45.035:DEBUG [launcher]: D:\Полезные программы\Mozilla Firefox\firefox.exe http://localhost:9876/?id=11747892 -profile C:\Users\mingun\AppData\Local\Temp\karma-11747892 -no-remote
04 04 2018 22:34:46.194:DEBUG [launcher]: Process Firefox exited with code 0
04 04 2018 22:34:46.196:ERROR [launcher]: Cannot start Firefox

04 04 2018 22:34:46.197:ERROR [launcher]: Firefox stdout:
04 04 2018 22:34:46.198:ERROR [launcher]: Firefox stderr:
04 04 2018 22:34:46.199:DEBUG [temp-dir]: Cleaning temp dir C:\Users\mingun\AppData\Local\Temp\karma-11747892
04 04 2018 22:34:46.219:INFO [launcher]: Trying to start Firefox again (2/2).
04 04 2018 22:34:46.221:DEBUG [launcher]: Restarting Firefox
04 04 2018 22:34:46.223:DEBUG [temp-dir]: Creating temp dir at C:\Users\mingun\AppData\Local\Temp\karma-11747892
04 04 2018 22:34:46.228:DEBUG [launcher]: D:\Полезные программы\Mozilla Firefox\firefox.exe http://localhost:9876/?id=11747892 -profile C:\Users\mingun\AppData\Local\Temp\karma-11747892 -no-remote
04 04 2018 22:34:47.817:DEBUG [launcher]: Process Firefox exited with code 0
04 04 2018 22:34:47.820:ERROR [launcher]: Cannot start Firefox

04 04 2018 22:34:47.822:ERROR [launcher]: Firefox stdout:
04 04 2018 22:34:47.823:ERROR [launcher]: Firefox stderr:
04 04 2018 22:34:47.826:DEBUG [temp-dir]: Cleaning temp dir C:\Users\mingun\AppData\Local\Temp\karma-11747892
04 04 2018 22:34:47.836:ERROR [launcher]: Firefox failed 2 times (cannot start). Giving up.

Finished in 0 secs / 0 secs @ 22:34:47 GMT+0500 (Уральское время (зима))

04 04 2018 22:34:47.846:DEBUG [karma]: Run complete, exiting.
04 04 2018 22:34:47.849:DEBUG [launcher]: Disconnecting all browsers
04 04 2018 22:34:47.852:DEBUG [framework.browserify]: cleaning up

npm ERR! Windows_NT 6.0.6001
npm ERR! argv "D:\\Scripts\\JavaScript\\node.exe" "D:\\Scripts\\JavaScript\\node_modules\\npm\\bin\\npm-cli.js" "run" "browser"
npm ERR! node v5.12.0
npm ERR! npm  v3.10.10
npm ERR! code ELIFECYCLE
npm ERR! [email protected] browser: `karma start`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] browser script 'karma start'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the structured-diff package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     karma start
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs structured-diff
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls structured-diff
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     D:\Projects\other\structured-diff\npm-debug.log

D:\Projects\other\structured-diff>

karma-firefox-launcher 0.1.1 partially missing from npm

A trivial package.json

{
    "name": "example",
    "version": "0.0.0",

    "private": true,
    "devDependencies": {
        "karma": "0.11.5",
        "karma-junit-reporter": "0.1.0",
        "xmlbuilder": "0.4.2"
    }
}

causes Karma to fail to install:

$ npm install
[...]
npm http 304 https://registry.npmjs.org/karma-firefox-launcher
npm http GET https://registry.npmjs.org/karma-firefox-launcher/-/karma-firefox-launcher-0.1.1.tgz
npm http 404 https://registry.npmjs.org/karma-firefox-launcher/-/karma-firefox-launcher-0.1.1.tgz
npm ERR! fetch failed https://registry.npmjs.org/karma-firefox-launcher/-/karma-firefox-launcher-0.1.1.tgz

Digging into the NPM metadata, it looks like https://registry.npmjs.org/karma-firefox-launcher claims that 0.1.1 is available from "." but the actual download is missing.

How to disable extensions when launching?

When using the default config (not setting any prefs or flags) when I launch my karma tests in firefox It also opens 2 other tabs which i have to close to see my tests. One is the "first run" privacy notice from Firefox, and the other is a "welcome" URL for an extension I have installed.

This is what I see

I eventually found a preference to disable the "first run" privacy notice tab:

customLaunchers: {
    firefox_custom: {
        base: 'Firefox',
        prefs: {
            'toolkit.telemetry.reportingpolicy.firstRun': false,
        }
    },
}

That works for the one tab, but now I still have the extension tab showing. How can I disable extensions when launching this?

I know that I can set flags: ["-safe-mode"] which does work, but that forces a dialog to show, which requires a click-though - and this is arguably even more annoying than closing a tab.

Default Preferences update

I had some unrelated problems when launching tests using FF 64, but thought that 2 extra tabs when Firefox loaded were my issue - I was theorizing a loss of focus.

While this ultimately wasn't my issue, I'd like to propose a cleaner start to the launcher.

One tab is a privacy notice:
'toolkit.telemetry.reportingpolicy.firstRun': false

The other is a forced load of the Acrobat add-on, which oddly happens if the build ID and app version aren't specified:
'extensions.lastAppBuildId':'20181206201918',
'extensions.lastAppVersion': '64.0',

Both of these are easily added to the karma.conf.js, but took a long time to track down, so would be nice if they were default prefs.

Allow developers to set custom user preferences

In the karma config file, for the firefox launcher, I would like to be able to add on my own user preferences when I am creating a custom launcher in the config.

Example of how it looks:

customerLaunchers: {
  FirefoxCustomerLauncher: {
    base: 'Firefox',
    prefs: {
       "media.navigator.permission.disabled": true, 
       "media.getusermedia.screensharing.enabled": true
    }
  },
}

This gives more expandability in testing especially in cases where you require to configure the user preferences.

Thanks.

Allow height and width to be given to allow responsive testing

Both PhantomJS and Chrome allow you to give the initial dimensions of the browser to allow responsive testing, but not firefox.

I thought it would be trivial but it turns out not to be simple.

Modifying this line to the following should work, but doesn't?

self._execCommand(command, [url, '-profile', self._tempDir, '-no-remote -width 335 -height 670']);

This is what I did get working, but it's not pretty - Add the following before this line:

fs.writeFileSync(self._tempDir + '/xulstore.json', '{"chrome://browser/content/browser.xul":{"main-window":{"width":"335","height":"670"}}}');

Obviously, the height and width should be passed in (I was just tinkering to try to get it to work)

Maybe something else altogether?

Error "Your Firefox profile cannot be loaded. It may be missing or inaccessible."

Running under Xvfb on Ubuntu 14.04 (Trusty).

This doesn't happen often, but it sometimes does:

INFO [karma]: Karma v0.12.31 server started at http://localhost:9876/
INFO [launcher]: Starting browser Chrome
INFO [launcher]: Starting browser Firefox
INFO [Chromium 41.0.2272 (Ubuntu)]: Connected on socket zQbHgwVpW95eCoI6HxQX with id 25180188
......................................
Chromium 41.0.2272 (Ubuntu): Executed 38 of 38 SUCCESS (0.245 secs / 0.231 secs)

WARN [launcher]: Firefox have not captured in 90000 ms, killing.
INFO [launcher]: Trying to start Firefox again (1/2).
WARN [launcher]: Firefox have not captured in 90000 ms, killing.
INFO [launcher]: Trying to start Firefox again (2/2).
WARN [launcher]: Firefox have not captured in 90000 ms, killing.
ERROR [launcher]: Firefox failed 2 times (timeout). Giving up.
jenkins+ 10879  0.3  0.4 842804 38356 pts/1    Sl+  23:57   0:00 npm test                      
jenkins+ 10885  0.0  0.0   4444   660 pts/1    S+   23:57   0:00 sh -c grunt test
jenkins+ 10886  3.1  1.5 1040152 129264 pts/1  Sl+  23:57   0:04 grunt                   
jenkins+ 11886  0.4  0.6 390864 51300 pts/1    Sl+  23:58   0:00 /usr/lib/firefox/firefox http://localhost:9876/?id=26795693 -profile /tmp/karma-26795693 -no-remote

It seems to be blocked on this popup: (Captured from Xvfb using ImageMagic's import.)
image

Does not handle timeout properly

I have captureTimeout: 6000, in my karma configuration. By the firefox launcher it certainly does not wait that long before retrying. My operating system is Windows 7 x64. I use the latest versions from everything. I don't experience the same problem by the phantomjs launcher. This behavior appears to be random on my system, it is hard to reproduce.

Immediate disconnection on io.js 1.0.3

Steps to reproduce:

  1. git clone https://github.com/mzgol/grunt-ng-annotate.git
  2. cd karma-ng-json2js-preprocessor
  3. npm install [email protected] (currently the latest version).
  4. Add 'Firefox' to the array in line 92 (https://github.com/EE/karma-ng-json2js-preprocessor/blob/b10cd52939e814ab499fc97c507c3738221ca167/karma.conf.js#L92)
  5. Run npm test.

Effect: Chrome passes, Firefox immediately disconnects, hanging the whole process; screenshot:
screen shot 2015-01-21 at 06 14 24

It works fine on Node 0.10.35 & 0.11.15. All attempts were made using the same npm version, 2.3.0 (that shouldn't matter, though).

Launcher does not work with Firefox 61

It seems like something has changed in Firefox 61 which has resulted in karma-firefox-launcher to be unable to properly start firefox. The following configuration works fine for firefox 60.

karma.conf
....
        browsers: ['FirefoxHeadless'],
        customLaunchers: {
            FirefoxHeadless: {
                base: 'Firefox',
                flags: [
                    '-headless'
                ],
            },
        },
....
> ng test --browsers FirefoxHeadless

 10% building modules 1/1 modules 0 active(node:70) DeprecationWarning: Tapable.plugin is deprecated. Use new API on `.hooks` instead
19 07 2018 16:28:03.691:INFO [karma]: Karma v1.7.1 server started at http://0.0.0.0:9876/
19 07 2018 16:28:03.693:INFO [launcher]: Launching browser FirefoxHeadless with unlimited concurrency
19 07 2018 16:28:03.698:INFO [launcher]: Starting browser Firefox
 20% building modules 91/105 modules 14 active …s/form-plugin/fesm5/ngxs-form-plugin.js19 07 2018 16:28:05.106:ERROR [launcher]: Cannot start Firefox	*** You are running in headless mode.

19 07 2018 16:28:05.107:ERROR [launcher]: Firefox stdout: 
19 07 2018 16:28:05.107:ERROR [launcher]: Firefox stderr: *** You are running in headless mode.

 24% building modules 120/147 modules 27 active …modules/core-js/modules/_string-trim.js19 07 2018 16:28:05.483:INFO [launcher]: Trying to start Firefox again (1/2).
 54% building modules 370/398 modules 28 active …nal/observable/ConnectableObservable.js19 07 2018 16:28:06.468:ERROR [launcher]: Cannot start Firefox
	*** You are running in headless mode.

19 07 2018 16:28:06.468:ERROR [launcher]: Firefox stdout: 
19 07 2018 16:28:06.469:ERROR [launcher]: Firefox stderr: *** You are running in headless mode.

 59% building modules 415/435 modules 20 active …modules/core-js/modules/es6.array.of.js19 07 2018 16:28:06.570:INFO [launcher]: Trying to start Firefox again (2/2).
 95% emitting CopyPlugin19 07 2018 16:28:12.559:ERROR [launcher]: Cannot start Firefox    
	*** You are running in headless mode.

19 07 2018 16:28:12.559:ERROR [launcher]: Firefox stdout: 
19 07 2018 16:28:12.559:ERROR [launcher]: Firefox stderr: *** You are running in headless mode.

19 07 2018 16:28:12.681:ERROR [launcher]: Firefox failed 2 times (cannot start). Giving up.

No README data

When I npm install this package I get the error:

npm WARN package.json [email protected] No README data

Normally I only see that when a package doesn't have a README.md file, but this one has one, so I'm not sure what the problem is. You'll notice that it doesn't have any README.md data on the package listing on npmjs.org. But I'd really like to get rid of this warning as it clutters up my warnings and makes it difficult for me to find real issues.

Karma outputs unspecified verbose info

Since Node.js 12 with Firefox. This info is also outputted with test errors and it is very annoying. A maintainer of Karma said this problem is not caused by karma-runner as karma-runner/karma#3301.

Expected behaviour

Output only the specified data.

Actual behaviour

Browser {
  id: '96848431',
  fullName: 'Mozilla/5.0 (X11; Linux x86_64; rv:66.0) Gecko/20100101 Firefox/66.0',
  name: 'Firefox 66.0.0 (Linux 0.0.0)',
  lastResult: [BrowserResult],
  disconnectsCount: 0,
  activeSockets: [Array],
  noActivityTimeout: 100000,
  collection: [BrowserCollection],
  emitter: [Server],
  socket: [Socket],
  timer: [Object],
  disconnectDelay: 2000,
  log: [Logger],
  noActivityTimeoutId: Timeout {
    _idleTimeout: 100000,
    _idlePrev: [TimersList],
    _idleNext: [TimersList],
    _idleStart: 34033,
    _onTimeout: [Function],
    _timerArgs: undefined,
    _repeat: null,
    _destroyed: false,
    [Symbol(refed)]: true,
    [Symbol(asyncId)]: 28047,
    [Symbol(triggerId)]: 28045
  },
  pendingDisconnect: null,
  state: 'EXECUTING'
}

Environment Details

Steps to reproduce the behaviour

https://travis-ci.org/falsandtru/spica/jobs/524330826#L508-L537

firefox launcher clobbers provided profile

I need to include a plugin (not an extension) when running my tests. Something in this block of code seems to corrupt the profile I'm providing as part of my test suite.

I'm happy to provide a PR, but I'm open to suggestions for solutions. Would it be reasonable to skip that block if args.profile is provided?

Firefox binary not included in package

After installing karma-firefox-launcher and adding 'Firefox' to my karma config browser list, I get the following error:

No binary for Firefox browser on your platform.
  Please, set "FIREFOX_BIN" env variable.

It looks like the firefox binary file is not included in this package. How do I get it?

Firefox 50 not launching

I updated Firefox to current version 50. Unit tests started from a command prompt are working fine.
If unit tests are run in TeamCity on an agent, I get the following error:

[JavaScript Unit Tests] [2016-11-17 16:19:00.167] [WARN] launcher - Firefox have not captured in 60000 ms, killing.

I am running grunt with karma 1.3.0, karma-firefox-launcher 1.0.0 and grunt-karma 2.0.0.

Karma and Selenium GRID 3.11

Hi,

When im executing test code on "Selenium Grid" in version 3.11 i'm having an error

22 05 2018 15:08:57.971:DEBUG [launcher]: Finished all browsers
Error: [init({"platform":"LINUX","testName":"Karma test","tags":[],"version":"59","base":"WebDriver","browserName":"firefox"})] The environment you requested was unavailable.
undefined
    at /tmp/<MY_PROJECT>/node_modules/wd/lib/webdriver.js:134:15
    at Request._callback (/tmp/<MY_PROJECT>/node_modules/wd/lib/http-utils.js:89:7)
    at Request.self.callback (/tmp/<MY_PROJECT>/node_modules/wd/node_modules/request/request.js:186:22)
    at emitTwo (events.js:125:13)
    at Request.emit (events.js:213:7)
    at Request.<anonymous> (/tmp/<MY_PROJECT>/node_modules/wd/node_modules/request/request.js:1163:10)
    at emitOne (events.js:115:13)
    at Request.emit (events.js:210:7)
    at IncomingMessage.<anonymous> (/tmp/<MY_PROJECT>/node_modules/wd/node_modules/request/request.js:1085:12)
    at Object.onceWrapper (events.js:312:19)
    at emitNone (events.js:110:20)
    at IncomingMessage.emit (events.js:207:7)
    at endReadableNT (_stream_readable.js:1045:12)
    at _combinedTickCallback (internal/process/next_tick.js:102:11)
    at process._tickCallback (internal/process/next_tick.js:161:9)
npm ERR! code ELIFECYCLE
npm ERR! errno 1

My test file:

        ....
        browsers: ['FirefoxHeadlessBrowser'],
        customLaunchers: {
            FirefoxHeadlessBrowser: {
                base: 'WebDriver',
                platform: 'LINUX',
                config: seleniumGridConfig,
                browserName: 'firefox',
                flags: ['-headless'],
                version: '59',
          ....

Json on Grid site:

14:52:01.015 INFO [RequestHandler.process] - Got a request to create a new session: Capabilities {base: WebDriver, browserName: firefox, flags: [-headless], javascriptEnabled: true, platform: LINUX, tags: [], testName: Karma test, version: 59}
14:52:01.017 INFO [TestSlot.getNewSession] - Trying to create a new session on test slot {server:CONFIG_UUID=7b519250-c385-4008-81b4-80c9f4f16f84, seleniumProtocol=WebDriver, marionette=true, cleanSession=true, version=59, platform=LINUX, acceptSslCerts=true, acceptInsecureCerts=true, browserName=firefox, takesScreenshot=true, javascriptEnabled=true, maxInstances=8, platformName=LINUX}
2018-05-22 14:52:03.278:WARN:osjs.HttpChannel:qtp330382173-6937: /wd/hub/session java.io.IOException: org.openqa.grid.common.exception.GridException: Cannot extract a capabilities from the request:

On Selenium Grid 2.x everything is ok, is karma-firefox-launcher compatible with Grid 3.x?
Maybe my config is missing something? But for chrome browser it is working fine.

Thx!

Could use more detail about how to use an existing Firefox extension

The section about using a Firefox extension is helpful, but it could use a little more detail.

For instance, this specifies the path to a firefox extension. Where would I have gotten this file from? There are ".xpi" files in my ~/.mozilla tree, including the one I want to use. Can I just copy that ".xpi" file to my local project tree, or what? It would be helpful if this section covered that.

It seems likely to me that one of the most common extensions someone would want to use for this is Firebug. An example using that exact extension would help.

ability to change Firefox location

it would be nice to have the ability to select a custom location for firefox.

For example, it could be done by replacing line 31 on index.js, with something like:

if( process.env.KARMABROWSERLOC !== null ) {
  return process.env.KARMABROWSERLOC + \\firefox.exe
}

return 'C:\\Program Files' + suffix /* or maybe even better return firefox.exe and assume it's present on PATH */

this would allow to use a portable Firefox, or to use a Firefox instance installed elsewhere (f.ex., due to admin restrictions on some folders)

firefox runs test then it crashes while its being closed

Hi Im new to Single Page App developement so Ive not done a lot of javascript testing so Ive used yo generator so I can work out the right way to test js code any way I then install the 3 web browser launchers and when I run test they open all three browser and tests pass with no errors but as the firefox launcher is finishing it closes firefox and when that happen I get a os x crash notification saying firefox plugin content (shockwave plugin) has crashed and I only ever get this error when running tests .

Paste Bin of crash report
http://laravel.io/bin/PXdBv

Exception Type: EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: KERN_INVALID_ADDRESS at 0x0000000000000000

firefox : 34
[email protected]
[email protected]

Mention/list all available browser launch configs

The file karma.conf.js is configured for the browser configs Firefox and FirefoxHeadless whilst the Readme features an example karma config using Firefox, FirefoxDeveloper, FirefoxAurora and FirefoxNightly.
Only diving into the code made me find the full list.

module.exports = {
  'launcher:Firefox': ['type', FirefoxBrowser],
  'launcher:FirefoxHeadless': ['type', FirefoxHeadlessBrowser],
  'launcher:FirefoxDeveloper': ['type', FirefoxDeveloperBrowser],
  'launcher:FirefoxDeveloperHeadless': ['type', FirefoxDeveloperHeadlessBrowser],
  'launcher:FirefoxAurora': ['type', FirefoxAuroraBrowser],
  'launcher:FirefoxAuroraHeadless': ['type', FirefoxAuroraHeadlessBrowser],
  'launcher:FirefoxNightly': ['type', FirefoxNightlyBrowser],
  'launcher:FirefoxNightlyHeadless': ['type', FirefoxNightlyHeadlessBrowser]
}

IMHO it would be very useful to list these various configurations in the readme. It's been done for the Chrome-Launcher as well. Might eventually create a PR if approveable.

Focus/Blur

Currently any tests using focus/blur events in Firefox will currently fail unless the window has focus. I am currently running multiple launchers and have an event listener to trigger a method when an input looses focus. I have a test that works similar to this:

it('Should trigger the blur event', function () {
   var input = document.getElementById('text-input');
   spyOn(form, 'blurHandler');
   input.focus();
   input.blur();
   expect(form.blurHandler).toHaveBeenCalled();
});

This runs in chrome, but Firefox will not run the text case unless I manually focus the window and refresh the page

I had found a little bit of information on a user_pref "focusmanager.testmode" which was related to selenium testing, so I have tried adding a custom launcher to my karma config like so:

{
   browsers: ['Chrome', 'FirefoxAllowFocus'],
   customLaunchers: {
      FirefoxAllowFocus: {
         base: 'Firefox',
         prefs: {
            'focusmanager.testmode': true
         }
      }
   }
}

Unfortunately this also does not have any effect on the failing unit tests.

Karma Firefox Doesn't Work With HTTPS

When I run Karma tests they fail as Firefox (as ran by Karma) won't except my certificate (i'm using https).

I'm using Karma to run integration tests on a NodeJs Firefox add-on. I'm testing it on my localhost machine using XAMPP's Apache. I've created ssl local keys, configured Apache to use the keys and when i'm trying it manually everything looks good. The problem only appears when Karma runs a FF profile. I tried installing the certificate globally on all profiles but that wasn't an option.

Thanks in advance!

Beautiful Tests

Nice Testing!

/* eslint-env mocha */
'use strict'

describe('FirefoxLauncher', function () {
  it('works', function () {
    var result = 1 + 1

    if (result !== 2) {
      throw new Error('fail')
    }
  })
})

Need a way to deal with self-signed certs

hi,

I've imported a self-signed cert for my local (intranet) web server into my windows certificate store and also imported it into the 'servers' section of the Options => Advanced => Certificates of the Firefox running in the context of the currently logged in user, however when I launch the Firefox via karma it seems to run in a brand new/temporary Firefox user profile and all my manual steps seem to have no effect - i.e. test fails due to

myhost.foo.bar.com:7443 uses an invalid security certificate. The certificate is not trusted because it is self-signed. (Error code: sec_error_unknown_issuer)

Tips/suggestions welcome - I couldn't find anything from quick googling on how to tell Karma to launch Firefox using a specific user profile or using specific set of 'permanent' exceptions that have been configured...

Firefox hangs after opening Karma Server URL in Docker

Context
I have always been running my Karma tests locally in PhantomJS, Google Chrome and Firefox without any problems. Currently, I'm looking to run the Karma tests in Docker and have been having problems with running the Karma tests in Firefox inside a Docker container although the Docker container can run the Karma tests in Google Chrome without any problems.

Problem
When I created a Docker container that contains Google Chrome, Firefox, JS libraries (node, npm, grunt ... etc), and VNC utilities (Xvfb, x11vnc). I started the VNC server and ran the tests. Firefox was started and the socket was created with a unique ID. When I entered a VNC session, I could see that firefox was started, the URL was loaded to the URL bar, and the Karma page was loaded. However, after about 2 seconds, the webpage would freeze and the Firefox is hanged. Therefore I could not see LOG: 'INFO[2015-10-16 20:19:15]: Router Started' message as well.

Interesting Find while Reproducing this Manually
I've tired commenting the lines that starts Firefox, so that will only start the karma server when I run the Karma tests. I then tried to run the tests with the following 2 methods -

  1. Start a Bash session through docker exec -it <container_tag>, execute firefox, and typed the server url with the corresponding ID of the test run. Firefox didn't hang in this case and proceeded to start the test run.
  2. Start a Bash session through docker exec -it <container_tag>, execute firefox <server_url_with_coresponding_id>. Firefox didn't hang in this case and proceeded to start the test run.

I believe that this is a problem relating to the karma-firefox-launcher or karma main library. If anyone can give me some pointers and ideas, that would be great!

FireFox profiles should be purged after use

Hadn't cracked open FireFox in a while.... just did, and found hundreds (thousands?) of left-over Testacular profiles in there.

Not sure if this will end up causing issues, but it doesn't seem like a good thing.

FireFox-Profiles

Also note that FireFox doesn't allow me to do multiple selections on the list -- so I would have to delete these things one by one (and there is a multiple dialog deletion confirmation process - yuck). Not sure if a third party tool can help here.

I would suggest that when Testacular creates a new FF profile, that it also flushes all the existing ones before doing so.

Unable to Kill Firefox with SIGKILL

I'm getting the following error:

$ karma start karma.conf.js --single-run
01 02 2018 15:33:25.918:INFO [compiler.karma-typescript]: Compiling project using Typescript 2.7.1
01 02 2018 15:33:27.348:INFO [compiler.karma-typescript]: Compiled 3 files in 1405 ms.
01 02 2018 15:33:27.998:INFO [karma]: Karma v2.0.0 server started at http://0.0.0.0:9876/
01 02 2018 15:33:28.000:INFO [launcher]: Launching browser Firefox with unlimited concurrency
01 02 2018 15:33:28.007:INFO [launcher]: Starting browser Firefox
01 02 2018 15:33:29.744:INFO [Firefox 58.0.0 (Mac OS X 10.13.0)]: Connected on socket FhlkdW2MQL1nzDBAAAAA with id 37588375
Firefox 58.0.0 (Mac OS X 10.13.0): Executed 1 of 2 SUCCESS (0 secs / 0 secs)
Firefox 58.0.0 (Mac OS X 10.13.0): Executed 2 of 2 SUCCESS (0.225 secs / 0 secs)
01 02 2018 15:33:32.791:WARN [launcher]: Firefox was not killed in 2000 ms, sending SIGKILL.
01 02 2018 15:33:34.794:WARN [launcher]: Firefox was not killed by SIGKILL in 2000 ms, continuing.
✨  Done in 11.24s.

(Despite what the console says) I'm running:
Firefox 58.0.1
macOS High Sierra 10.13.3

The kill script is managing to close the window, but the process still hangs about and so does the icon in the dash.

Not sure how it affects things but I'm also running karma-typescript.

Only started using karma today, not sure where to look for this, or if this belonds in the karma repo instead. Just let me know!

Thanks,
Tim

Pull Request Testing Fails

Hi,

I've created a pull request and it had failed the CI testing. Out of curiosity it tried running the tests on the original code and surprise surprise - it breaks the build as well.

It seems to be an internal problem with the CI configs (error appended at the end).
Please look into it.

Thank you!

--Barak

Worker information
hostname: travis-worker-gce-org-prod-4:846ab6e9-397e-4ce8-bc02-0d98ebfc9d50
version: v2.0.0-24-g8f5b41a https://github.com/travis-ci/worker/tree/8f5b41a07b602643e7ee8cf307787f9ca8f4b00b
instance: testing-gce-3393c64d-ffe0-4fd5-9672-c3a69b7606e5:travis-ci-ruby-precise-1450195856
startup: 23.708292799s
Could not find .travis.yml, using standard configuration.
system_info
Build system information
Build language: ruby
Build group: stable
Build dist: precise
Build image provisioning date and time
Tue Dec 15 16:36:18 UTC 2015
Operating System Details
Distributor ID: Ubuntu
Description: Ubuntu 12.04.5 LTS
Release: 12.04
Codename: precise
Linux Version
3.13.0-63-generic
Cookbooks Version
fad6c97 https://github.com/travis-ci/travis-cookbooks/tree/fad6c97
Git version
git version 1.8.5.6
bash version
GNU bash, version 4.2.25(1)-release (x86_64-pc-linux-gnu)
Copyright (C) 2011 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html
This is free software; you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
GCC version
gcc (Ubuntu/Linaro 4.6.3-1ubuntu5) 4.6.3
Copyright (C) 2011 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
LLVM version
clang version 3.4 (tags/RELEASE_34/final)
Target: x86_64-unknown-linux-gnu
Thread model: posix
Pre-installed Ruby versions
ree-1.8.7-2012.02
ruby-1.8.7-p374
ruby-1.9.2-p330
ruby-1.9.3-p551
ruby-2.0.0-p647-clang
ruby-2.1.2
ruby-2.1.3
ruby-2.1.4
ruby-2.1.5
ruby-2.2.0
Pre-installed Node.js versions
v0.10.36
Pre-installed Go versions
1.4.2
mysql --version
mysql Ver 14.14 Distrib 5.5.46, for debian-linux-gnu (x86_64) using readline 6.2
Pre-installed PostgreSQL versions
9.1.19
9.2.14
9.3.10
9.4.5
Redis version
redis-server 3.0.5
riak version
2.1.3
MongoDB version
MongoDB 2.4.14
CouchDB version
couchdb 1.6.1
Neo4j version
1.9.4
Cassandra version
2.0.9
ElasticSearch version
1.4.0
Installed Sphinx versions
2.0.10
2.1.9
2.2.6
Default Sphinx version
2.2.6
Installed Firefox version
firefox 38.4.0esr
PhantomJS version
1.9.8
ant -version
Apache Ant(TM) version 1.8.2 compiled on December 3 2011
mvn -version
Apache Maven 3.2.5 (12a6b3acb947671f09b81f49094c53f426d8cea1; 2014-12-14T17:29:23+00:00)
Maven home: /usr/local/maven
Java version: 1.7.0_80, vendor: Oracle Corporation
Java home: /usr/lib/jvm/java-7-oracle/jre
Default locale: en, platform encoding: UTF-8
OS name: "linux", version: "3.13.0-63-generic", arch: "amd64", family: "unix"
git.checkout
NaNs$ git clone --depth=50 https://github.com/karma-runner/karma-firefox-launcher.git karma-runner/karma-firefox-launcher
Cloning into 'karma-runner/karma-firefox-launcher'...
remote: Counting objects: 192, done.
remote: Compressing objects: 100% (9/9), done.
remote: Total 192 (delta 0), reused 9 (delta 0), pack-reused 183
Receiving objects: 100% (192/192), 31.35 KiB | 0 bytes/s, done.
Resolving deltas: 100% (96/96), done.
Checking connectivity... done.
$ cd karma-runner/karma-firefox-launcher
0.54s$ git fetch origin +refs/pull/47/merge:
remote: Counting objects: 7, done.
remote: Compressing objects: 100% (4/4), done.
remote: Total 7 (delta 2), reused 2 (delta 2), pack-reused 1
Unpacking objects: 100% (7/7), done.
From https://github.com/karma-runner/karma-firefox-launcher

  • branch refs/pull/47/merge -> FETCH_HEAD
    $ git checkout -qf FETCH_HEAD
    0.00s
    rvm
    0.11s$ rvm use default
    Using /home/travis/.rvm/gems/ruby-1.9.3-p551
    $ ruby --version
    ruby 1.9.3p551 (2014-11-13 revision 48407) [x86_64-linux]
    $ rvm --version
    rvm 1.26.10 (1.26.10) by Wayne E. Seguin [email protected], Michal Papis [email protected] [https://rvm.io/]
    $ bundle --version
    Bundler version 1.7.6
    $ gem --version
    2.5.1
    0.11s$ rake
    rake aborted!
    No Rakefile found (looking for: rakefile, Rakefile, rakefile.rb, Rakefile.rb)
    /home/travis/.rvm/gems/ruby-1.9.3-p551/bin/ruby_executable_hooks:15:in eval' /home/travis/.rvm/gems/ruby-1.9.3-p551/bin/ruby_executable_hooks:15:in'
    (See full trace by running task with --trace)
    The command "rake" exited with 1.
    Done. Your build exited with 1.

Let's allow setting FF profile props or pick up the entire profile?

I am making the first forays to implement template framework based on Jasmine and FuncUnit for UI testing. I am launching browsers using karma-*-launcher(s) and now I run into "blocked popups" issue. To be more detailed, default browser profile has popups blocker enabled, that results into "FuncUnit.win is null" error in FF and similar errors in other browsers when running FuncUnit (cause browser blocks opening both new tabs and new windows).

The problem can be workarounded by adding
+'user_pref("dom.disable_open_during_load", false);\n';
as a 8th string of firefox-launcher's index.js file.
The same issue occurs in other browser launchers as well (Chrome).
Sample project that reproduces the issue attached.

It would be fine if you do one of the following to fix the issue:

  1. Just include the string above and similar to index.js of the correspondent launchers
  2. Add functionality to load profile PROPS from external file
  3. Add functionality to pick up profiles in FF launcher

Would you?

Firefox can't be run by defining FIREFOX_BIN under Linux

Hi,

I run Debian/GNULinux and installed Firefox from the official web site.

Firefox is installed in a folder on my user home.

I cannot run tests under Firefox by defining FIREFOX_BIN to the firefox binary location.

Otherwise i could manage to run Firefox by adding the Firefox binary folder to my PATH env var.

Those information can maybe help :
node -v //v0.10.15
npm -v //v1.3.5

Can't start Firefox Nightly

OS: Ubuntu 17.10
Node: 8.9.3
npm: 5.6
@angular/cli: 1.6.1
Karma: 1.7.1
"karma-firefox-launcher": "~1.1.0"

firefox-trunk: Mozilla Firefox 59.0a1
was installed by following commands
sudo add-apt-repository ppa:ubuntu-mozilla-daily/ppa
sudo apt-get update
sudo apt-get install firefox-trunk

>ng test

10% building modules 1/1 modules 0 active
16 12 2017 17:27:28.126:WARN [karma]: No captured browser, open http://localhost:9876/
16 12 2017 17:27:28.132:INFO [karma]: Karma v1.7.1 server started at http://0.0.0.0:9876/
16 12 2017 17:27:28.132:INFO [launcher]: Launching browser FirefoxNightly with unlimited concurrency
16 12 2017 17:27:28.137:INFO [launcher]: Starting browser FirefoxNightly
16 12 2017 17:27:31.051:WARN [karma]: No captured browser, open http://localhost:9876/

EACCESS spawn error with Firefox Developer Edition

Hi,
while updating the dependencies of my Angular project I wanted to change the browser of my Karma tests to Firefox Developer Edition. Unfortunately this lead to this error.
Please let me know if I can provide any more information.

Cheers!

Expected behaviour

Launch Karma with Firefox Developer Edition

Actual behaviour

Launcher crashes after creating the temp dir. (Same with headless)
Interestingly with the standard Firefox I have no trouble launching the tests.

This is the crash log:

�[36m08 04 2018 16:00:44.000:DEBUG [config]: �[39mLoading config /Users/cab/Workspace/shard/lunar-shard/karma.conf.js
�[36m08 04 2018 16:00:44.003:DEBUG [plugin]: �[39mLoading inlined plugin (defining framework:jasmine).
�[36m08 04 2018 16:00:44.003:DEBUG [plugin]: �[39mLoading inlined plugin (defining launcher:Chrome, launcher:ChromeHeadless, launcher:ChromeCanary, launcher:ChromeCanaryHeadless, launcher:Chromium, launcher:ChromiumHeadless, launcher:Dartium, test).
�[36m08 04 2018 16:00:44.003:DEBUG [plugin]: �[39mLoading inlined plugin (defining launcher:Firefox, launcher:FirefoxHeadless, launcher:FirefoxDeveloper, launcher:FirefoxDeveloperHeadless, launcher:FirefoxAurora, launcher:FirefoxAuroraHeadless, launcher:FirefoxNightly, launcher:FirefoxNightlyHeadless).
�[36m08 04 2018 16:00:44.003:DEBUG [plugin]: �[39mLoading inlined plugin (defining reporter:kjhtml).
�[36m08 04 2018 16:00:44.003:DEBUG [plugin]: �[39mLoading inlined plugin (defining reporter:coverage-istanbul).
�[36m08 04 2018 16:00:44.003:DEBUG [plugin]: �[39mLoading inlined plugin (defining framework:@angular/cli, preprocessor:@angular/cli, reporter:@angular/cli, middleware:angularCliBlocker).
�[36m08 04 2018 16:00:44.105:DEBUG [web-server]: �[39mInstantiating middleware
�[36m08 04 2018 16:00:44.106:DEBUG [reporter]: �[39mTrying to load reporter: @angular/cli
�[36m08 04 2018 16:00:44.106:DEBUG [reporter]: �[39mTrying to load color-version of reporter: @angular/cli (@angular/cli_color)
�[36m08 04 2018 16:00:44.106:DEBUG [reporter]: �[39mCouldn't load color-version.
�[36m08 04 2018 16:00:44.111:DEBUG [reporter]: �[39mTrying to load reporter: kjhtml
�[36m08 04 2018 16:00:44.111:DEBUG [reporter]: �[39mTrying to load color-version of reporter: kjhtml (kjhtml_color)
�[36m08 04 2018 16:00:44.114:DEBUG [reporter]: �[39mCouldn't load color-version.
�[36m08 04 2018 16:00:50.445:DEBUG [karma]: �[39mList of files has changed, trying to execute
�[33m08 04 2018 16:00:50.445:WARN [karma]: �[39mNo captured browser, open http://localhost:9876/
�[36m08 04 2018 16:00:50.448:DEBUG [watcher]: �[39mWatching "/Users/cab/Workspace/shard/lunar-shard/src/favicon.ico"
�[32m08 04 2018 16:00:50.449:INFO [karma]: �[39mKarma v2.0.0 server started at http://0.0.0.0:9876/
�[32m08 04 2018 16:00:50.450:INFO [launcher]: �[39mLaunching browser FirefoxDeveloper with unlimited concurrency
�[32m08 04 2018 16:00:50.452:INFO [launcher]: �[39mStarting browser FirefoxDeveloper
�[36m08 04 2018 16:00:50.453:DEBUG [temp-dir]: �[39mCreating temp dir at /var/folders/ms/zrp2qb3j1fb51pbhmjst8vr40000gn/T/karma-29876120
�[36m08 04 2018 16:00:50.453:DEBUG [launcher]: �[39m/usr/local/Caskroom/firefox-developer-edition/latest http://localhost:9876/?id=29876120 -profile /var/folders/ms/zrp2qb3j1fb51pbhmjst8vr40000gn/T/karma-29876120 -no-remote
�[31m08 04 2018 16:00:50.464:ERROR [karma]: �[39m{ Error: spawn EACCES
    at _errnoException (util.js:1022:11)
    at ChildProcess.spawn (internal/child_process.js:323:11)
    at exports.spawn (child_process.js:502:9)
    at spawnWithoutOutput (/Users/cab/Workspace/shard/lunar-shard/node_modules/karma/lib/launchers/process.js:168:24)
    at Object.ProcessLauncher._execCommand (/Users/cab/Workspace/shard/lunar-shard/node_modules/karma/lib/launchers/process.js:76:21)
    at Object.FirefoxBrowser._start (/Users/cab/Workspace/shard/lunar-shard/node_modules/karma-firefox-launcher/index.js:146:10)
    at Object.<anonymous> (/Users/cab/Workspace/shard/lunar-shard/node_modules/karma/lib/launchers/process.js:19:10)
    at emitOne (events.js:121:20)
    at Object.emit (events.js:211:7)
    at Object.BaseLauncher.start (/Users/cab/Workspace/shard/lunar-shard/node_modules/karma/lib/launchers/base.js:42:10)
    at Object.j (/Users/cab/Workspace/shard/lunar-shard/node_modules/karma/lib/launcher.js:117:17)
    at Object.setTimeout.bind.j (/Users/cab/Workspace/shard/lunar-shard/node_modules/qjobs/qjobs.js:143:18)
    at ontimeout (timers.js:482:11)
    at tryOnTimeout (timers.js:317:5)
    at Timer.listOnTimeout (timers.js:277:5) code: 'EACCES', errno: 'EACCES', syscall: 'spawn' }
�[36m08 04 2018 16:00:50.467:DEBUG [launcher]: �[39mDisconnecting all browsers

This is the log with the standard Firefox edition:

08 04 2018 16:08:26.130:DEBUG [config]: Loading config /Users/cab/Workspace/shard/lunar-shard/karma.conf.js
08 04 2018 16:08:26.134:DEBUG [plugin]: Loading inlined plugin (defining framework:jasmine).
08 04 2018 16:08:26.134:DEBUG [plugin]: Loading inlined plugin (defining launcher:Chrome, launcher:ChromeHeadless, launcher:ChromeCanary, launcher:ChromeCanaryHeadless, launcher:Chromium, launcher:ChromiumHeadless, launcher:Dartium, test).
08 04 2018 16:08:26.134:DEBUG [plugin]: Loading inlined plugin (defining launcher:Firefox, launcher:FirefoxHeadless, launcher:FirefoxDeveloper, launcher:FirefoxDeveloperHeadless, launcher:FirefoxAurora, launcher:FirefoxAuroraHeadless, launcher:FirefoxNightly, launcher:FirefoxNightlyHeadless).
08 04 2018 16:08:26.134:DEBUG [plugin]: Loading inlined plugin (defining reporter:kjhtml).
08 04 2018 16:08:26.134:DEBUG [plugin]: Loading inlined plugin (defining reporter:coverage-istanbul).
08 04 2018 16:08:26.134:DEBUG [plugin]: Loading inlined plugin (defining framework:@angular/cli, preprocessor:@angular/cli, reporter:@angular/cli, middleware:angularCliBlocker).
 10% building modules 1/1 modules 0 active08 04 2018 16:08:26.236:DEBUG [web-server]: Instantiating middleware
08 04 2018 16:08:26.237:DEBUG [reporter]: Trying to load reporter: @angular/cli
08 04 2018 16:08:26.237:DEBUG [reporter]: Trying to load color-version of reporter: @angular/cli (@angular/cli_color)
08 04 2018 16:08:26.237:DEBUG [reporter]: Couldn't load color-version.
08 04 2018 16:08:26.242:DEBUG [reporter]: Trying to load reporter: kjhtml
08 04 2018 16:08:26.243:DEBUG [reporter]: Trying to load color-version of reporter: kjhtml (kjhtml_color)
08 04 2018 16:08:26.243:DEBUG [reporter]: Couldn't load color-version.
08 04 2018 16:08:32.651:DEBUG [karma]: List of files has changed, trying to execute
08 04 2018 16:08:32.651:WARN [karma]: No captured browser, open http://localhost:9876/
08 04 2018 16:08:32.654:DEBUG [watcher]: Watching "/Users/cab/Workspace/shard/lunar-shard/src/favicon.ico"
08 04 2018 16:08:32.656:INFO [karma]: Karma v2.0.0 server started at http://0.0.0.0:9876/
08 04 2018 16:08:32.656:INFO [launcher]: Launching browser Firefox with unlimited concurrency
08 04 2018 16:08:32.659:INFO [launcher]: Starting browser Firefox
08 04 2018 16:08:32.659:DEBUG [temp-dir]: Creating temp dir at /var/folders/ms/zrp2qb3j1fb51pbhmjst8vr40000gn/T/karma-22664961
08 04 2018 16:08:32.660:DEBUG [launcher]: /Applications/Firefox.app/Contents/MacOS/firefox-bin http://localhost:9876/?id=22664961 -profile /var/folders/ms/zrp2qb3j1fb51pbhmjst8vr40000gn/T/karma-22664961 -no-remote
08 04 2018 16:08:39.405:DEBUG [web-server]: serving: /Users/cab/Workspace/shard/lunar-shard/node_modules/karma/static/client.html
...

Environment Details

  • node: v8.11.1
  • Karma: 2.0.0
  • karma-firefox-launcher: 1.1.0
  • Angular CLI: 1.6.8
  • OS: macOS 10.12.6
  • Relevant part of your karma.config.js file:
// Karma configuration file, see link for more information
// https://karma-runner.github.io/0.13/config/configuration-file.html

module.exports = function (config) {
  config.set({
    basePath: '',
    frameworks: ['jasmine', '@angular/cli'],
    plugins: [
      require('karma-jasmine'),
      require('karma-chrome-launcher'),
      require('karma-firefox-launcher'),
      require('karma-jasmine-html-reporter'),
      require('karma-coverage-istanbul-reporter'),
      require('@angular/cli/plugins/karma')
    ],
    client:{
      clearContext: false // leave Jasmine Spec Runner output visible in browser
    },
    coverageIstanbulReporter: {
      reports: [ 'html', 'lcovonly' ],
      fixWebpackSourcePaths: true
    },
    angularCli: {
      environment: 'dev'
    },
    reporters: ['progress', 'kjhtml'],
    port: 9876,
    colors: true,
    logLevel: config.LOG_DEBUG,
    autoWatch: true,
    browsers: ['FirefoxDeveloper'],
    singleRun: false
  });
};

Steps to reproduce the behaviour

  1. Install dependency and require karma-firefox-launcher in Karma config file
  2. Set browsers: ['FirefoxDeveloper'] in Karma config file
  3. Run Karma (in my case the Angular CLI does that)

Launcher doesn't kill Firefox 68

Firefox : v68.0.1
OS : Window7 and Windows 10
Karma : v1.7.1 || v3.1.4 || 4.2.0
Firefox launcher : v1.1.0
Node.js : v8 || v10

Launcher doesn't kill my Firefox 68, I tested with several version of nodejs
without success.
Maybe it's cause of Electrolyse (e10s) maybe not.
I tried to disable e10s for a moment with set MOZ_FORCE_DISABLE_E10S variable but unsuccessful, I created a little standalone
code to test.

const spawn = require('child_process').spawn;
let firefox = spawn("pathToFirefox\\firefox.exe, [
    "http://localhost:9876/?id=anid",
    "-profile",
    "C:\\temp\karma-2456",
    "-no-remote",
    "-wait-for-browser"
]);
setTimeout(function killFirefox(){
    firefox.kill();
}, 10000)
firefox.on('exit', function(code, signal){
    console.log('Firefox exit');
});

Result: firefox is always running.

I tried with this version How to kill child processes that spawn their own child processes in Node.js but it doesn't work for me.

has anybody an idea ?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.