Closed sargiss closed 8 years ago
Have you tried installing Phantom globally to see if that fixes the issue?
resorted to your advice and installed phantomjs also globally:
sudo npm install phantomjs -g
This did not change anything. Moreover I again get the same warning about that global phantom undefined
Ok. What version of the plugin are you running?
if you mean gulp-jasmine-phantom, 2.0.1
Just for confirmation you can run phantomjs -v
in your console and it is included in your $PATH
?
phantomjs -v 2.1.1
PATH contains phantomjs location
Sorry for getting back so late, I am having a hard time replicating this specifically. Would you mind pointing me to a repo or posting your spec? I have a Ubuntu VM setup that seems to run a simple example just fine. I realize that isn't helpful, but replicating this has been very difficult and any additional information would be great.
Also, Node version and NPM version would be super helpful as well :grimacing:
Thanks for your attention to issue. I ve had a lot of job past days, so I need some time to repeate all my steps and provide you with required information.
@sargiss I had an issue with hanging gulp-jasmine-phantom
due to phantomjs
not being able to load the file (it exited with an error status, and gulp-jasmine-phantom
haven't noticed it).
I did not find the exact reason, but the path that I was running everything in was long, contained non-latin chars, and (perhaps) contained symlinks. Moving everything to a nicer path solved things for me.
@dflynn15 gulp-jasmine-phantom
hanging on phantomjs
errors looks like a bug to me, perhaps fixing it would make things more easy to debug.
Update: That wasn't a phantomjs
error, that was an error thrown by jasmine-runner.js
being unable to load the file, see below.
I recently ran into an issue where I have it not exiting, however only on a separate project, not the example tasks provided in the repository. If you get the same hanging experience with the examples in the repository that would help to know.
Currently I am narrowing it down to the project specific tests and not the plugin. If you are able to share the specs that may help as well (obviously if it is client or sensitive job info don't share them).
@dflynn15, Try this:
function execPhantom(phantom, childArguments, onComplete) {
+ childArguments[2] += 'foo';
execFile(phantom, childArguments, function(error, stdout, stderr) {
var success = null;
You will see that jasmine-runner.js
errors with Couldn't load the page
error (as it did with my path), but gulp-jasmine-phantom
hangs. That error should bubble up somehow.
I think what's interesting is that taking that same list of childArguments
and executing phantomjs
directly the process never exits.
i.e.
phantomjs lib/jasmine-runner.js lib/specRunner.html '{"integration": true, "keepRunner": false} foo'
With the process never exiting I'm not sure what the plugin can do to safely exit. We could obviously test to see how long the process has run and attempt to exit, but if there is a long standing test we may cut it off. I'll look and see if there are any events that Phantom so that maybe internally we can intercept the error.
@dflynn15 This actually looks like a bug in lib/jasmine-runner.js
to me.
Btw, I made a mistype, I meant [1]
, not [2]
:
$ phantomjs ./node_modules/gulp-jasmine-phantom/lib/jasmine-runner.js ./node_modules/gulp-jasmine-phantom/lib/specRunner.htmlfoo '{"integration": true, "keepRunner": false}'
Couldn't load the page
^C
@dflynn15 Perhaps it needs a phantom.exit(1)
call after those messages?
Yep. Adding that phantom.exit(1)
will fix it. Putting in a bug update :+1:
This PR should fix it, but if you have time to test it out to see if it fixes your issue before I merge it that would be awesome!
call your plugin in following way:
gulp.task('test', function(){ return gulp.src('tests/elements.js') .pipe(jasmine({ integration: true, specHtml: 'tests/elements.html', includeStackTrace:true})); });
It comes till that state and stop working. Just blinking cursor.