bbc / wraith

Wraith — A responsive screenshot comparison tool
http://bbc-news.github.io/wraith/
Apache License 2.0
4.84k stars 356 forks source link

Can't open javascript/phantom.js #317

Closed msafta closed 8 years ago

msafta commented 8 years ago

Hi,

I've apparently installed Wraith (and all prereqs) successfully on Windows, but there is a problem when I try to actually get images: Can't open ''javascript/phantom.js''. This is the js used as snap_file in the config. I have only changed the domains and snap_file in the multiple_domains.yaml config file found after installation in the configs folder. Initially the snap_file was phantom--nojs.js. The same error appeared for both snap files. I have checked and both files are under that relative path.

Can you please help? I am trying to make a POC at work for automated screenshot comparison using Wraith. Let me know if you need additional information.

Thanks in advance :)

wildlyinaccurate commented 8 years ago

Could you show how you're running Wraith? Also see #288 (and my solution) which sounds like it might be the same issue.

msafta commented 8 years ago

Hi,

Thanks for your reply.

Wraith's folder is C:\wraith-master. I've tried both ways presented in the thread you linked, with same results using an unchanged config file:

wraith capture multiple_domains wraith01

wraith capture configs/multiple_domains.yaml wraith02

ChrisBAshton commented 8 years ago

Hi @msafta, do you have a phantom--nojs.js somewhere in your project? Perhaps try moving your javascript folder inside your configs folder.

This issue should go away when we've implemented #305, which abstracts the JS files away so that you don't have to worry about them.

msafta commented 8 years ago

Hi,

The phantom--nojs.js file is in the javascript folder (same goes for phantom.js) inside the wraith folder: folder

I have tried moving the javascript folder under configs, but to no avail...

phanib commented 8 years ago

I'm having the same issue, I keep getting the same error.

lesleyblankendal commented 8 years ago

Same issue here... Also seeing the quotes messed up in the cmd prompt:

Can't open ''javascript/phantom.js''
CanC'atn 'otp eonp e'n' j'a'vjaasvcarsicprti\ppth\apnhtaonmt.ojms.'j's
ghuygens-zz commented 8 years ago

I had the same issue on windows I switched phantomjs version 2.0 with version 1.9.2 and it is working fine now.

lesleyblankendal commented 8 years ago

Thanks! that fixes my issue...

msafta commented 8 years ago

Hi,

Yes, 1.9.2 worked for me too :) Now I have to deal with Process.fork is not supported by this ruby which is outside the scope of Wraith: https://github.com/BBC-News/wraith/issues/195

ChrisBAshton commented 8 years ago

With the release of Wraith 3.0.0, the snap files have been abstracted away and you should no longer have to maintain them yourselves.

In addition, I've updated the docs to warn against using PhantomJS 2 with Wraith for the time being.

vinodmadhav commented 8 years ago

1.9 did the magic for me too. Thanks!!

but now i am stuck with "Error Cannot find module javascript/disable_javascript--ph antom.js" and the execution is stuck at this error. doesn't move forward.

here is the error from command

phantomjs://bootstrap.js:289

phantomjs://bootstrap.js:254 in require

C:/Ruby200/lib/ruby/gems/2.0.0/gems/wraith-3.1.0/lib/wraith/javascript/phantom js:103 in runSetupJavaScriptThen

C:/Ruby200/lib/ruby/gems/2.0.0/gems/wraith-3.1.0/lib/wraith/javascript/phantom js:87 in markPageAsLoaded

C:/Ruby200/lib/ruby/gems/2.0.0/gems/wraith-3.1.0/lib/wraith/javascript/phantom js:81 in checkStatusOfAssets