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

Can't open phantom.js - double single quotes in path #441

Closed
theguythatrepeatedit opened this issue Jun 24, 2016 · 9 comments
Closed

Can't open phantom.js - double single quotes in path #441

theguythatrepeatedit opened this issue Jun 24, 2016 · 9 comments

Comments

@theguythatrepeatedit
Copy link

theguythatrepeatedit commented Jun 24, 2016

Hi there, I am losing my mind. My setup is vanilla wraith on Windows - I have tried running with all versions of Ruby. Every time I launch it outputs Can't open ''XXX:/Ruby22/lib/ruby/gems/2.2.0/gems/wraith-3.2.0/lib/wraith/javascript/phantom.js'' (note the double single quotes)

The file is definitively there! I even tried hardcoding it form inside wraith without success

How can I get out of this situation ?


YAML is valid

OUTPUT:

X:\XXX>wraith capture configs/capture.yaml -verbose
Config validated. No serious issues found.
Creating Folders
SAVING IMAGES
Can't open ''XXX:/Ruby22/lib/ruby/gems/2.2.0/gems/wraith-3.2.0/lib/wraith/javascript/phantom.js''
  • CONFIG:
##############################################################
##############################################################
# This is an example configuration provided by Wraith.
# Feel free to amend for your own requirements.
# ---
# This particular config is intended to demonstrate how
# to use Wraith in 'capture' mode, which is best suited to
# comparing a test and live version of the same website.
#
# `wraith capture capture.yaml`
#
##############################################################
##############################################################

# (required) The engine to run Wraith with. Examples: 'phantomjs', 'casperjs', 'slimerjs'
browser: "phantomjs"

# (required) The domains to take screenshots of.
domains:
  current:  "http://www.example.com"
  new:      "http://develop.example.com"

# (required) The paths to capture. All paths should exist for both of the domains specified above.
paths:
  home:     /
  about:    /about
  contact:  /get-in-touch

# (required) Screen widths (and optional height) to resize the browser to before taking the screenshot.
screen_widths:
  - 320
  - 600x768
  - 768
  - 1024
  - 1280

# (optional) JavaScript file to execute before taking screenshot of every path. Default: nil
before_capture: 'javascript/disable_javascript--phantom.js'

# (required) The directory that your screenshots will be stored in
directory: 'shots'

# (required) Amount of fuzz ImageMagick will use when comparing images. A higher fuzz makes the comparison less strict.
fuzz: '20%'

# (optional) The maximum acceptable level of difference (in %) between two images before Wraith reports a failure. Default: 0
threshold: 5

# (optional) Specify the template (and generated thumbnail sizes) for the gallery output.
gallery:
  template: 'slideshow_template' # Examples: 'basic_template' (default), 'slideshow_template'
  thumb_width:  200
  thumb_height: 200

# (optional) Choose which results are displayed in the gallery, and in what order. Default: alphanumeric
# Options:
#   alphanumeric - all paths (with or without a difference) are shown, sorted by path
#   diffs_first - all paths (with or without a difference) are shown, sorted by difference size (largest first)
#   diffs_only - only paths with a difference are shown, sorted by difference size (largest first)
# Note: different screen widths are always grouped together.
mode: diffs_first

@ChrisBAshton
Copy link
Contributor

Hi @theguythatrepeatedit it looks like when you passed -verbose as a command line parameter, it didn't actually run it in verbose mode (verbose mode should tell me what version of Ruby, Phantom, Wraith you have, etc).

Can you try adding verbose: true to your yml file and then paste the output of your command here?

Thanks

@theguythatrepeatedit
Copy link
Author

Good day!

DEBUG: #################################################
DEBUG: Command run: capture configs/capture.yaml
DEBUG: Wraith version: 3.2.0
DEBUG: Ruby version: ruby 2.2.4p230 (2015-12-16 revision 53155) [i386-mingw32]

DEBUG: ImageMagick: Version: ImageMagick 6.9.3-8 Q16 x64 2016-04-10 http://www.imagemagick.org

DEBUG: PhantomJS version: 2.1.1

DEBUG: CasperJS version: CasperJS not installed
DEBUG: #################################################
DEBUG:
Config validated. No serious issues found.
Creating Folders
SAVING IMAGES

[...]

@ChrisBAshton
Copy link
Contributor

Does XXX:/Ruby22/lib/ruby/gems/2.2.0/gems/wraith-3.2.0/lib/wraith/javascript/phantom.js definitely exist?

If you run more XXX:/Ruby22/lib/ruby/gems/2.2.0/gems/wraith-3.2.0/lib/wraith/javascript/phantom.js you should see output like this: https://github.com/BBC-News/wraith/blob/master/lib/wraith/javascript/phantom.js

If more doesn't give you the file contents, it probably can't find the file. Let's just check that first.

@theguythatrepeatedit
Copy link
Author

theguythatrepeatedit commented Jun 24, 2016

Interesting!

more C:/Ruby22/lib/ruby/gems/2.2.0/gems/wraith-3.2.0/lib/wraith/javascript/phantom.js
Invalid parameter - /Ruby22

Then I flip the slashes around:
more C:\Ruby22\lib\ruby\gems\2.2.0\gems\wraith-3.2.0\lib\wraith\javascript\phantom.js
// modules
var system = require('system'),
page = require('webpage').create(),
helper = require('./_helper.js')(system.args[2]);
.......
.................

I hardcoded it now in wraith.rb and ran into the exact same problem on the next opportunity 😃

Thanks alot Chris ! I probably should have spotted that myself hehe, will probably get around the other ones my self ;)

Have a good weekend

@SimonKeep
Copy link

Hi,

I am now getting this issue having upgraded PhantomJs to 2.0 from 1.9.

I have been successfully running Wraith with 1.9 for a while. If I switch back to 1.9 everything starts working again.

I am on windows.

Any ideas?

@ChrisBAshton
Copy link
Contributor

Could you raise a new issue please, @SimonKeep ?

There are some instructions in the 'New Issue' screen for giving us some useful debug information.

Thanks

@stevenbriscoeca
Copy link

stevenbriscoeca commented Jul 8, 2016

I am getting the same error

C:\Projets\Tests\wraith>wraith capture configs/capture.yaml
Config validated. No serious issues found.
Creating Folders
SAVING IMAGES
Can't open ''C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/wraith-3.2.0/lib/wraith/javascript/phantom.js''
Can't open ''C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/wraith-3.2.0/lib/wraith/javascript/phantom.js''
Can't open ''C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/wraith-3.2.0/lib/wraith/javascript/phantom.js''
Can't open ''C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/wraith-3.2.0/lib/wraith/javascript/phantom.js''

The file really exists :
clover_2016-07-08_10-15-14

I get the same error as @theguythatrepeatedit when I do the command
more C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/wraith-3.2.0/lib/wraith/javascript

I get this error :
Invalid parameter - /Ruby22

Because of this error I cannot get wraith to work

Windows 10

@SimonKeep
Copy link

Which version of PhantomJS are you using? You may need to use 1.9 with windows. See #444.

@stevenbriscoeca
Copy link

stevenbriscoeca commented Jul 8, 2016

@SimonKeep It is working now thank you

If this helps anyone :
npm install -g phantomjs@1.9.19 and it works on windows

This should be documented because anyone that is on windows won't be able to use wraith

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

No branches or pull requests

4 participants