Nightwatch: Support for Chrome Puppeteer

Created on 19 Aug 2017  路  11Comments  路  Source: nightwatchjs/nightwatch

How can we implement support for https://github.com/GoogleChrome/puppeteer ?

stale

Most helpful comment

@odrzutowiec

Considering that Nightwatch calls the chrome binaries for you, and that Nightwatch allows JS files for config, you can do the following to get puppeteer to work.

nightwatch.js

process.env.CHROME_BIN = require('puppeteer').executablePath();
module.exports = {
...
}

When the config is read, it will change the path within the terminal of where the binary for google-chrome is, then it will proceed to launch it from that directory. you can combo it with the headless flags for CI.

All 11 comments

Maybe u can use nightwatch inside of pupeteer.
But whats do u exactly want to do ?

puppeteer is headless chrome, Clearly what he want is test in chrome but in headless mode.
surely i also want this feature and also want to make a PR. But looks like the maintainer are offline recently.

Any updated on this?

Looking for this to. Wonder if we can use its API (https://github.com/GoogleChrome/puppeteer/blob/master/docs/api.md) inside the test.

Closing as stale.

@beatfactor What do you mean by stale? Is this already implemented?

No. We have no plans to implement this and no one else seems to be willing to do so, and it's been open long enough.

Ahh bummer :( I could really use Puppeteer

@odrzutowiec

Considering that Nightwatch calls the chrome binaries for you, and that Nightwatch allows JS files for config, you can do the following to get puppeteer to work.

nightwatch.js

process.env.CHROME_BIN = require('puppeteer').executablePath();
module.exports = {
...
}

When the config is read, it will change the path within the terminal of where the binary for google-chrome is, then it will proceed to launch it from that directory. you can combo it with the headless flags for CI.

This issue has been automatically marked as stale because it has not had any recent activity.
If possible, please retry using the latest Nightwatch version and update the issue with any relevant details. If no further activity occurs, it will be closed. Thank you for your contributions.

Above solution with CHROME_BIN didn't work for me (although it works with Karma), but I managed to make it work by adding binary Chrome option:

        chromeOptions: {
          binary: require('puppeteer').executablePath(),
          args: [
            '--no-sandbox'
          ]
        }

You can find full config file here.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

dakebl picture dakebl  路  4Comments

bushev picture bushev  路  4Comments

Pieras2 picture Pieras2  路  3Comments

gary5 picture gary5  路  4Comments

lgaticaq picture lgaticaq  路  3Comments