Speed ​​up tests running in Chrome

This is based on this question , where it was discovered that when Chrome is not in the foreground, tests run very slowly. Does anyone know how to get around this so that I can continue to use Chrome, but don't have to keep it in the foreground?

+2
source share
3 answers

There is currently no way to do this, but there is a problem to get it back. Follow the updates.

+1
source

Run chrome in silent mode. I saw a fantastic performance improvement.

gulp.task('test-headless-chrome', function (done) {
  process.env.DISPLAY=':95';

  withXvfb(function(stop) {
    server.start({
      configFile: __dirname + '/../karma/karma.conf.js',
      singleRun: true
    }, function() {
      stop();
      done();
    });
  });
});

function withXvfb(op) {
    var child = spawn('Xvfb', [':95', '-ac', '-screen', '0', '1600x1200x24'], {
            stdio: 'inherit'
    });

    setTimeout(op(function() {
        console.log("Killing Xvfb...")
        child.kill();
    }),3000);
}
+2
source

, Mac, , .

An additional click is required each time the test suite is run, but if you are watching the tests, you need to do this once. You get all the performance improvements and don't have to worry about keeping chrome in the foreground.

+2
source

All Articles