Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

In package.json, testee should not use Firefox, but use puppeteer and headless chromium #267

Open
mjstahl opened this issue Oct 23, 2017 · 2 comments

Comments

@mjstahl
Copy link
Contributor

mjstahl commented Oct 23, 2017

Description:
Currently the test task in package.json, looks like so:

testee test.html --browsers firefox --reporter Spec

Personally I think donejs, as meta-project, should be a kitchen-sink -- meaning, that we generate all you need to get up and running. I think this includes running tests from the command line. Currently, we also require them to have FF install, and we don't tell the User that its a pre-requisite.

I was one of those Users without FF installed.

I recommend the following change:

Add "puppeteer": "^0.12.0" to the devDependencies of package.json.
Change the test task to:

testee test.html --config config/test.js --reporter Spec

Add a config directory (this will be for all the applications configuration) at the top level and include a test.js file (thanks @nlundquist).

const puppeteer = require('puppeteer');

// set chromium to node_modules local chromium supplied by puppeteer
process.env.LAUNCHPAD_CHROMIUM = `${puppeteer.executablePath()}`;

module.exports = {
  browsers: [{ browser: 'chromium', args: ['--headless', '--disable-gpu', '--remote-debugging-port=9222'] }],
};

This also requires a version change of testee from ^0.3.0 to ^0.7.0 so that it can except JS files as configuration (and not just JSON files).

Environment:

Software Version
donejs -V 1.0.1
npm ls generator-donejs 1.0.7
@matthewp
Copy link
Contributor

matthewp commented Feb 9, 2018

This would be great. Would this work in CI without any additional stuff to add?

@nlundquist
Copy link
Contributor

nlundquist commented Feb 9, 2018

It works great in CI but there are still some system dependencies on Linux.

On Linux systems there are typical libs that the downloaded Chrome binary depends on (even when running headless) but fewer than if you ran non-headless mode or built Chrome from source.

We had to ensure the presence of the following libraries in a minimal Ubuntu 14.x LTS environment:

libpango-1.0-0
libpangocairo-1.0-0
libx11-xcb1
libxcomposite1
libxcursor1
libxdamage1
libxi6
libxtst6
libnss3
libcups2
libxss1
libxrandr2
libgconf-2-4
libatk1.0-0
libgtk-3-0

ldd chrome | grep not is the recommended way of seeing what dependencies may be missing from a particular distribution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants