For all of you old fogies working on angular 1 apps and are running browser tests with karma you can run your tests in firefox with headless mode with a customer launcher. Add the snippet below to your karma conf ``` browsers: ['FirefoxHeadless'], customLaunchers: { FirefoxHeadless: { base: 'Firefox', flags: [ '-headless', ], }, }, ``` Note you need to be running the beta version of firefox, I needed to download it f…
Does this offer any real benefit over Xvfb?
Headless mode in Firefox
41–50 of 191 posts
Re: Headless mode in Firefox
#42This is very nice. What's the recommended way to run end-to-end tests in headless firefox _and_ headless chrome? Can't wait for a cross-platform headless Edge :-)
I'm currently evaluating testcafe which is pretty nice, and headless chrome was easy to setup. I'm interested to see what people recommend for browser testing, I'm also using preact.
Re: Headless mode in Firefox
#43For all of you old fogies working on angular 1 apps and are running browser tests with karma you can run your tests in firefox with headless mode with a customer launcher. Add the snippet below to your karma conf ``` browsers: ['FirefoxHeadless'], customLaunchers: { FirefoxHeadless: { base: 'Firefox', flags: [ '-headless', ], }, }, ``` Note you need to be running the beta version of firefox, I needed to download it f…
Do you have any advice on how to get off of Karma with Angular 1 apps?
That's what we currently do, karma and browser testing are useful but sometimes you can get away with not using them.
One thing we are trying is using JSDom to run browser based tests in node
Re: Headless mode in Firefox
#44Earlier quoted context omitted.
Don't know about performance numbers, but one reason for headless browsers is so that you can run your tests on cheap small headless Linux servers.
Adding to ^. You don't need to have the Xorg stuff running to run tests.
"xvfb-run firefox" and "firefox -headless" should be functionally equivalent. But I would still be interested in performance comparison with numbers.
Re: Headless mode in Firefox
#45For all of you old fogies working on angular 1 apps and are running browser tests with karma you can run your tests in firefox with headless mode with a customer launcher. Add the snippet below to your karma conf ``` browsers: ['FirefoxHeadless'], customLaunchers: { FirefoxHeadless: { base: 'Firefox', flags: [ '-headless', ], }, }, ``` Note you need to be running the beta version of firefox, I needed to download it f…
Does this offer any real benefit over Xvfb?
Re: Headless mode in Firefox
#46Can you tell Firefox to print in headless mode? I want to write reports using HTML and JS, but printing is always an issue.
Remember that if you pass through any data from an outside source, you're running their code on your browser when you thought you were just printing a document. The security issues don't apply in all circumstances, of course, but if you feel like taking a shortcut to PDF generation and printing through a headless browser, you need to keep them in mind.
Re: Headless mode in Firefox
#47This is very nice. What's the recommended way to run end-to-end tests in headless firefox _and_ headless chrome? Can't wait for a cross-platform headless Edge :-)
I'm currently evaluating testcafe which is pretty nice, and headless chrome was easy to setup. I'm interested to see what people recommend for browser testing, I'm also using preact.
My general rule of thumb is to try having as few end-to-end tests as possible. It's fine for an e2e test to cover multiple aspects of your application. Trying to write e2e tests as if they were unit tests just leads to sadness and infinite CI builds.
I don't think there's any value to running all your tests on the browser. It's much faster and simpler to run the bulk of your tests on node, with a fake DOM environment.
If you're interacting directly with the DOM, you might want to consider breaking that off as a separate lib. From the lib's repo you can have all of its tests run on a real browser.
Re: Headless mode in Firefox
#48Re: Headless mode in Firefox
#49Can you tell Firefox to print in headless mode? I want to write reports using HTML and JS, but printing is always an issue.
It also supports page-oriented CSS declarations and variables, like headers, footers, page numbers, etc.
Re: Headless mode in Firefox
#50For all of you old fogies working on angular 1 apps and are running browser tests with karma you can run your tests in firefox with headless mode with a customer launcher. Add the snippet below to your karma conf ``` browsers: ['FirefoxHeadless'], customLaunchers: { FirefoxHeadless: { base: 'Firefox', flags: [ '-headless', ], }, }, ``` Note you need to be running the beta version of firefox, I needed to download it f…
Also note that that's only the case on Windows and OS X (it's already released for Linux), and only as long as Firefox 56 hasn't been released yet :)