headless chrome not finding specs
Closed this issue · 5 comments
Hi there
I am unable to make the headless feature work with chrome driver and the example specs shipped with the standalone distribution of jasmine 2.8.
Remark that everything is green aka working fine in browser (or red if any test gets wrong, of course), using the jasmineBrowser.server(...)
method. I've found #44 to be related with this issue happening to me, but no light was provided by it as we don't have any TS or ES2105+ code to transpile (the jasmine example spec is just a normal vanilla JS classic function).
I am using Ubuntu 16.04 VM runing on VirtualBox on Windows10 (:-S) and the issue is the same with either node 8.9.0 and 6.11.5, both LTS. The output I just get is:
[16:46:10] Using gulpfile ~/things/180001/SOURCE/TEST/gulpfile.js
[16:46:10] Starting 'jasmine'...
[16:46:10] Jasmine server listening on port 8889
undefined specs, 0 failures
Finished in NaN seconds
Any help is very appreciate!!!
Thanks!!
I’ll try this out in a VM but it could be due to some difference with headless chrome, have you tried it with phantom? I’m planning on replacing simple chrome driver with puppeteer now that it is out. The chrome driver path is very new in comparison to phantom. If it works under phantom that migh give me some time to rework the implementation with the latest headlesss chrome.
Ok, thanks for the reply! I will try with phantom (:-S) and let you know. Also, I will try in a native linux box, but it will be a more challenging issue (they are a scarce resource 😩 )
Yeah, it seems it is working inside de VM with phantomjs. Thanks for the hint.
What I don't figure out is how to make it work along with watching changes. With a full browser, you just reload the page and get the new changes, but no point with headless. Maybe should I have to make another task to watch files in addition to the test task?
Thank you!!!
I’ll try to work out the issues with chrome but I’ll need to reimplement with a better driver headless chrome driver (puppeteer).
Ok 👍 👏
Just in the case someone falls here, I got to make it work with kind of livereloade by using gulp.watch
as follows:
gulp.task('default', () => {
gulp.watch(files, ['jasmine-headless']);
});
gulp.task('jasmine-headless', function () {
var watchCfg = {
ignoreInitial: false,
usePolling: true,
verbose: true,
};
return gulp.src(files)
.pipe(jasmineBrowser.specRunner({
console: true
}))
.pipe(jasmineBrowser.headless({
driver: 'phantomjs',
port: 8889
})
);
});