question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Support for chrome --headless

See original GitHub issue

As of version 57 Google Chrome can run headless. Chromium has been able to for a while too.

I’m using Testem 1.15.0 on Ubuntu 16.04 with an ember 2.11 project.

When I run ember test I can see via ps aux that Testem started running the tests with the right args but it still boots up a full desktop browser window:

/opt/google/chrome/chrome --headless --disable-gpu --user-data-dir=/tmp/testem-3394 --no-default-browser-check --no-first-run --ignore-certificate-errors --test-type --disable-renderer-backgrounding --disable-background-timer-throttling http://localhost:7357/3394/tests/index.html?hidepassed

When I start /opt/google/chrome/chrome --headless --disable-gpu... manually or with another test framework like Watir then it works headless.

My testem.js looks like this:

module.exports = {
  "framework": "qunit",
  "test_page": "tests/index.html?hidepassed",
  "disable_watching": true,
  "launch_in_ci": [
    "Chrome"
  ],
  "launch_in_dev": [
    "Chrome"
  ],
  "browser_args": {
    "Chrome": [
      "--headless --disable-gpu"
    ]
  }
};

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:20 (7 by maintainers)

github_iconTop GitHub Comments

3reactions
joshuataylorcommented, May 3, 2017

Sorry for necro, but just for anyone looking for a reference, take a look at https://developers.google.com/web/updates/2017/04/headless-chrome .

chrome \
  --headless \                   # Runs Chrome in headless mode.
  --disable-gpu \                # Temporarily needed for now.
  --remote-debugging-port=9222 \

So the right params are here 👍

3reactions
calderascommented, Apr 14, 2017

This is working fine for me locally on a Mac with the latest Chrome Canary

Version 59.0.3071.0 (Official Build) canary (64-bit)

brew install Caskroom/versions/google-chrome-canary

Testem config:

module.exports = {
  framework: 'qunit',
  test_page: 'tests/index.html?hidepassed',
  disable_watching: true,
  launch_in_ci: [ 'Chrome Canary' ],
  launch_in_dev: [ 'Chrome Canary' ],
  browser_args: {
    'Chrome Canary': [ '--headless', '--disable-gpu', '--remote-debugging-port=9222' ],
  },
};

When running you can navigate to this url to inspect http://localhost:9222/

Read more comments on GitHub >

github_iconTop Results From Across the Web

Getting Started with Headless Chrome - Chrome Developers
Headless Chrome is shipping in Chrome 59. It's a way to run the Chrome browser in a headless environment. Essentially, running Chrome ......
Read more >
Headless Chromium
Headless Chromium allows running Chromium in a headless/server environment. Expected use cases include loading web pages, extracting metadata (e.g., ...
Read more >
What is Google Chrome Headless Mode - Debug Bar
The Headless mode is a feature which allows the execution of a full version of the Chrome Browser. It provides the ability to...
Read more >
The Beginner's Guide to Chrome Headless
The major advantage of using Headless Chrome is that users can write script to run the browser programmatically, doing tasks like scraping, analyzing,...
Read more >
Headless Chrome: DevOps Love It, So Do Hackers, Here's Why
There are several reasons for Headless Chrome's popularity; one being the support for Chrome's new “out of the box” features, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found