{"action":"created","issue":{"url":"https://api.github.com/repos/BBC-News/wraith/issues/455","repository_url":"https://api.github.com/repos/BBC-News/wraith","labels_url":"https://api.github.com/repos/BBC-News/wraith/issues/455/labels{/name}","comments_url":"https://api.github.com/repos/BBC-News/wraith/issues/455/comments","events_url":"https://api.github.com/repos/BBC-News/wraith/issues/455/events","html_url":"https://github.com/BBC-News/wraith/issues/455","id":168043874,"number":455,"title":"Couldn't get CasperJS to work with HTTPS with the command --ssl-protocol=tlsv1","user":{"login":"renettarenula","id":724458,"avatar_url":"https://avatars.githubusercontent.com/u/724458?v=3","gravatar_id":"","url":"https://api.github.com/users/renettarenula","html_url":"https://github.com/renettarenula","followers_url":"https://api.github.com/users/renettarenula/followers","following_url":"https://api.github.com/users/renettarenula/following{/other_user}","gists_url":"https://api.github.com/users/renettarenula/gists{/gist_id}","starred_url":"https://api.github.com/users/renettarenula/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/renettarenula/subscriptions","organizations_url":"https://api.github.com/users/renettarenula/orgs","repos_url":"https://api.github.com/users/renettarenula/repos","events_url":"https://api.github.com/users/renettarenula/events{/privacy}","received_events_url":"https://api.github.com/users/renettarenula/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-07-28T08:47:57Z","updated_at":"2016-07-28T09:11:32Z","closed_at":null,"body":"I am having trouble making Wraith to work with CasperJS on sites with HTTPS protocol. I do not have this problem when I am running test on sites with HTTP protocol but only HTTPS with CasperJS. PhantomJS works fine on both protocols. And yes, I do have this option on: \r\n\r\n```\r\nphantomjs_options: --ssl-protocol=tlsv1 --ignore-ssl-errors=yes\r\n```\r\n\r\nThis is the error that I received running the above command.\r\n\r\n```\r\nDEBUG: #################################################\r\nDEBUG:   Command run:        latest configs/history.yaml\r\nDEBUG:   Wraith version:     3.2.0\r\nDEBUG:   Ruby version:       ruby 2.1.1p76 (2014-02-24 revision 45161) [x86_64-darwin12.0]\r\n\r\nDEBUG:   ImageMagick:        Version: ImageMagick 6.9.2-5 Q16 x86_64 2015-11-01 http://www.imagemagick.org\r\n\r\nDEBUG:   PhantomJS version:  1.9.7\r\n\r\nDEBUG:   CasperJS version:   1.0.0\r\n\r\nDEBUG: #################################################\r\nDEBUG: \r\nConfig validated. No serious issues found.\r\nSAVING IMAGES\r\nDEBUG: casperjs --ssl-protocol=tlsv1 --ignore-ssl-errors=yes '/Users/viki/.rvm/gems/ruby-2.1.1/gems/wraith-3.2.0/lib/wraith/javascript/casper.js' 'https://smackaho.st:3022/' '320x10000,600x10000,768x10000,1024x10000,1280x10000' 'shots_latest/home/MULTI_casperjs_english_latest.png' 'body' '/Users/viki/workspace/raynor/javascript/wait--casper.js' 'false'\r\nCasperError: CasperJS couldn't find module /Users/viki/workspace/raynor/_helper.js\r\n\r\n  /Users/viki/.rvm/gems/ruby-2.1.1/gems/casperjs-1.0.0/bin/bootstrap.js:126 in _require\r\n\r\n  /Users/viki/.rvm/gems/ruby-2.1.1/gems/wraith-3.2.0/lib/wraith/javascript/casper.js:24 in requireRelative\r\n\r\n  /Users/viki/.rvm/gems/ruby-2.1.1/gems/wraith-3.2.0/lib/wraith/javascript/casper.js:4\r\n\r\nCOPYING BASE IMAGES\r\nCopying shots_base/home to shots_latest\r\nCROPPING IMAGES\r\nDEBUG: Cropping both images to 600x1500. (shots_latest/home/320x1500_phantomjs_english.png, shots_latest/home/600x768_phantomjs_english.png)\r\nDEBUG: Cropping both images to 1280x1500. (shots_latest/home/1024x1500_phantomjs_english.png, shots_latest/home/1280x1500_phantomjs_english.png)\r\n/Users/viki/.rvm/gems/ruby-2.1.1/gems/wraith-3.2.0/lib/wraith/crop.rb:48:in `initialize': no implicit conversion of nil into String (TypeError)\r\n\tfrom /Users/viki/.rvm/gems/ruby-2.1.1/gems/wraith-3.2.0/lib/wraith/crop.rb:48:in `open'\r\n\tfrom /Users/viki/.rvm/gems/ruby-2.1.1/gems/wraith-3.2.0/lib/wraith/crop.rb:48:in `image_dimensions'\r\n\tfrom /Users/viki/.rvm/gems/ruby-2.1.1/gems/wraith-3.2.0/lib/wraith/crop.rb:26:in `crop_if_necessary'\r\n\tfrom /Users/viki/.rvm/gems/ruby-2.1.1/gems/wraith-3.2.0/lib/wraith/crop.rb:19:in `block in crop_images'\r\n\tfrom /Users/viki/.rvm/gems/ruby-2.1.1/gems/parallel-1.9.0/lib/parallel.rb:453:in `call'\r\n\tfrom /Users/viki/.rvm/gems/ruby-2.1.1/gems/parallel-1.9.0/lib/parallel.rb:453:in `call_with_index'\r\n\tfrom /Users/viki/.rvm/gems/ruby-2.1.1/gems/parallel-1.9.0/lib/parallel.rb:422:in `process_incoming_jobs'\r\n\tfrom /Users/viki/.rvm/gems/ruby-2.1.1/gems/parallel-1.9.0/lib/parallel.rb:404:in `block in worker'\r\n\tfrom /Users/viki/.rvm/gems/ruby-2.1.1/gems/parallel-1.9.0/lib/parallel.rb:395:in `fork'\r\n\tfrom /Users/viki/.rvm/gems/ruby-2.1.1/gems/parallel-1.9.0/lib/parallel.rb:395:in `worker'\r\n\tfrom /Users/viki/.rvm/gems/ruby-2.1.1/gems/parallel-1.9.0/lib/parallel.rb:386:in `block in create_workers'\r\n\tfrom /Users/viki/.rvm/gems/ruby-2.1.1/gems/parallel-1.9.0/lib/parallel.rb:385:in `each'\r\n\tfrom /Users/viki/.rvm/gems/ruby-2.1.1/gems/parallel-1.9.0/lib/parallel.rb:385:in `each_with_index'\r\n\tfrom /Users/viki/.rvm/gems/ruby-2.1.1/gems/parallel-1.9.0/lib/parallel.rb:385:in `create_workers'\r\n\tfrom /Users/viki/.rvm/gems/ruby-2.1.1/gems/parallel-1.9.0/lib/parallel.rb:327:in `work_in_processes'\r\n\tfrom /Users/viki/.rvm/gems/ruby-2.1.1/gems/parallel-1.9.0/lib/parallel.rb:241:in `map'\r\n\tfrom /Users/viki/.rvm/gems/ruby-2.1.1/gems/parallel-1.9.0/lib/parallel.rb:203:in `each'\r\n\tfrom /Users/viki/.rvm/gems/ruby-2.1.1/gems/wraith-3.2.0/lib/wraith/crop.rb:18:in `crop_images'\r\n\tfrom /Users/viki/.rvm/gems/ruby-2.1.1/gems/wraith-3.2.0/lib/wraith/cli.rb:98:in `block in crop_images'\r\n\tfrom /Users/viki/.rvm/gems/ruby-2.1.1/gems/wraith-3.2.0/lib/wraith/cli.rb:28:in `within_acceptable_limits'\r\n\tfrom /Users/viki/.rvm/gems/ruby-2.1.1/gems/wraith-3.2.0/lib/wraith/cli.rb:95:in `crop_images'\r\n\tfrom /Users/viki/.rvm/gems/ruby-2.1.1/gems/wraith-3.2.0/lib/wraith/cli.rb:173:in `block in latest'\r\n\tfrom /Users/viki/.rvm/gems/ruby-2.1.1/gems/wraith-3.2.0/lib/wraith/cli.rb:28:in `within_acceptable_limits'\r\n\tfrom /Users/viki/.rvm/gems/ruby-2.1.1/gems/wraith-3.2.0/lib/wraith/cli.rb:168:in `latest'\r\n\tfrom /Users/viki/.rvm/gems/ruby-2.1.1/gems/thor-0.19.1/lib/thor/command.rb:27:in `run'\r\n\tfrom /Users/viki/.rvm/gems/ruby-2.1.1/gems/thor-0.19.1/lib/thor/invocation.rb:126:in `invoke_command'\r\n\tfrom /Users/viki/.rvm/gems/ruby-2.1.1/gems/thor-0.19.1/lib/thor.rb:359:in `dispatch'\r\n\tfrom /Users/viki/.rvm/gems/ruby-2.1.1/gems/thor-0.19.1/lib/thor/base.rb:440:in `start'\r\n\tfrom /Users/viki/.rvm/gems/ruby-2.1.1/gems/wraith-3.2.0/bin/wraith:5:in `<top (required)>'\r\n\tfrom /Users/viki/.rvm/gems/ruby-2.1.1/bin/wraith:23:in `load'\r\n\tfrom /Users/viki/.rvm/gems/ruby-2.1.1/bin/wraith:23:in `<main>'\r\n\tfrom /Users/viki/.rvm/gems/ruby-2.1.1/bin/ruby_executable_hooks:15:in `eval'\r\n\tfrom /Users/viki/.rvm/gems/ruby-2.1.1/bin/ruby_executable_hooks:15:in `<main>'\r\n```\r\n\r\nWhen I exclude `--ssl-protocol=tlsv1 `, the test runs normally and gallery is successfully generated but all of the screenshots taken is blank. Including `--ssl-protocol=tlsv1` will give the error above.\r\n\r\nThis is my config/history.yaml file\r\n\r\n```\r\n##############################################################\r\n##############################################################\r\n# This is an example configuration provided by Wraith.\r\n# Feel free to amend for your own requirements.\r\n# ---\r\n# This particular config is intended to demonstrate how\r\n# to use Wraith in 'history' mode, which is best suited to\r\n# making sure your site's appearance remains consistent over\r\n# time.\r\n#\r\n# `wraith history history.yaml` # generate base screenshots\r\n# `wraith latest history.yaml`  # take new shots and compare\r\n#\r\n##############################################################\r\n##############################################################\r\n\r\n# (required) The engine to run Wraith with. Examples: 'phantomjs', 'casperjs', 'slimerjs'\r\nbrowser: \"casperjs\"\r\n\r\n# (required) The domain to take screenshots of.\r\ndomains:\r\n  english: \"https://smackaho.st:3022\"\r\n\r\n# (required) The paths to capture. This particular config is using casperjs, so we can take screenshots of selectors rather than the entire page.\r\npaths:\r\n  home:\r\n    path: /\r\n    selector: 'body'\r\n\r\n# (optional) JavaScript file to execute before taking screenshot of every path. Default: nil\r\n\r\n# (required) Screen widths (and optional height) to resize the browser to before taking the screenshot.\r\nscreen_widths:\r\n  - 320x10000\r\n  - 600x10000\r\n  - 768x10000\r\n  - 1024x10000\r\n  - 1280x10000\r\n\r\n# (optional) JavaScript file to execute before taking screenshot of every path. Default: nil\r\nbefore_capture: 'javascript/wait--casper.js'\r\n\r\n# (optional) Resize to each screen width (efficient), or reload at each screen width (costly). Default: 'reload'\r\nresize_or_reload: 'resize'\r\n\r\n# (required for history mode, otherwise optional) The directory that your base screenshots will be stored in.\r\nhistory_dir: 'shots_base'\r\n\r\n# (required) The directory that your latest screenshots will be stored in\r\ndirectory: 'shots_latest'\r\n\r\n# (required) Amount of fuzz ImageMagick will use when comparing images. A higher fuzz makes the comparison less strict.\r\nfuzz: '20%'\r\n\r\n# (optional) The maximum acceptable level of difference (in %) between two images before Wraith reports a failure. Default: 0\r\nthreshold: 5\r\n\r\n# (optional) Specify the template (and generated thumbnail sizes) for the gallery output.\r\ngallery:\r\n  template: 'slideshow_template' # Examples: 'basic_template' (default), 'slideshow_template'\r\n  thumb_width:  200\r\n  thumb_height: 200\r\n\r\n# (optional) Choose which results are displayed in the gallery, and in what order. Default: alphanumeric\r\n# Options:\r\n#   alphanumeric - all paths (with or without a difference) are shown, sorted by path\r\n#   diffs_first - all paths (with or without a difference) are shown, sorted by difference size (largest first)\r\n#   diffs_only - only paths with a difference are shown, sorted by difference size (largest first)\r\n# Note: different screen widths are always grouped together.\r\nmode: diffs_first\r\n\r\n# (optional) Choose to run Wraith in verbose mode, for easier debugging. Default: false\r\nverbose: true\r\n\r\n# (optional) Color to highlight the image diff. Default: 'blue'\r\nhighlight_color: red\r\n\r\n# (optional) Parameters to pass to Phantom/Casper command line. Default: '--ignore-ssl-errors=true --ssl-protocol=tlsv1'\r\nphantomjs_options: --ssl-protocol=tlsv1 --ignore-ssl-errors=yes\r\n\r\n```\r\n\r\nThis is run on history mode (wraith latest command). Is there a workaround for this in order to make CasperJS work properly with HTTPS sites? CasperJS gem is already deprecated and has never been updated for quite a while now. I have been using Wraith for quite some time and phantomJS mode works just fine for us. However, I wanna start using CasperJS for taking snapshots of components instead of whole sites. Thanks in advance for your help!\r\n"},"comment":{"url":"https://api.github.com/repos/BBC-News/wraith/issues/comments/235841822","html_url":"https://github.com/BBC-News/wraith/issues/455#issuecomment-235841822","issue_url":"https://api.github.com/repos/BBC-News/wraith/issues/455","id":235841822,"user":{"login":"renettarenula","id":724458,"avatar_url":"https://avatars.githubusercontent.com/u/724458?v=3","gravatar_id":"","url":"https://api.github.com/users/renettarenula","html_url":"https://github.com/renettarenula","followers_url":"https://api.github.com/users/renettarenula/followers","following_url":"https://api.github.com/users/renettarenula/following{/other_user}","gists_url":"https://api.github.com/users/renettarenula/gists{/gist_id}","starred_url":"https://api.github.com/users/renettarenula/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/renettarenula/subscriptions","organizations_url":"https://api.github.com/users/renettarenula/orgs","repos_url":"https://api.github.com/users/renettarenula/repos","events_url":"https://api.github.com/users/renettarenula/events{/privacy}","received_events_url":"https://api.github.com/users/renettarenula/received_events","type":"User","site_admin":false},"created_at":"2016-07-28T09:11:32Z","updated_at":"2016-07-28T09:11:32Z","body":"Alright, to verify if correctly linking to _helper.js would fix the issue, I just add _helper.js in the root of my current folder. The test seems to run normally but the screenshots generated is still empty and this is the logs that I got:\r\n\r\n```\r\nDEBUG: #################################################\r\nDEBUG:   Command run:        latest configs/history.yaml\r\nDEBUG:   Wraith version:     3.2.0\r\nDEBUG:   Ruby version:       ruby 2.1.1p76 (2014-02-24 revision 45161) [x86_64-darwin12.0]\r\n\r\nDEBUG:   ImageMagick:        Version: ImageMagick 6.9.2-5 Q16 x86_64 2015-11-01 http://www.imagemagick.org\r\n\r\nDEBUG:   PhantomJS version:  1.9.7\r\n\r\nDEBUG:   CasperJS version:   1.0.0\r\n\r\nDEBUG: #################################################\r\nDEBUG: \r\nConfig validated. No serious issues found.\r\nSAVING IMAGES\r\nDEBUG: casperjs --ignore-ssl-errors=true --ssl-protocol=tlsv1 '/Users/viki/.rvm/gems/ruby-2.1.1/gems/wraith-3.2.0/lib/wraith/javascript/casper.js' 'https://smackaho.st:3022/' '320x10000,600x10000,768x10000,1024x10000,1280x10000' 'shots_latest/home/MULTI_casperjs_english_latest.png' 'body' '/Users/viki/workspace/raynor/javascript/wait--casper.js' 'false'\r\nSnapping https://smackaho.st:3022/ at: 320x10000\r\n\r\nSnapping https://smackaho.st:3022/ at: 600x10000\r\n\r\nSnapping https://smackaho.st:3022/ at: 768x10000\r\n\r\nSnapping https://smackaho.st:3022/ at: 1024x10000\r\n\r\nSnapping https://smackaho.st:3022/ at: 1280x10000\r\n\r\nCOPYING BASE IMAGES\r\nCopying shots_base/home to shots_latest\r\nCROPPING IMAGES\r\nDEBUG: Both images are exactly 1008x9984 - no cropping required. (shots_latest/home/1024x10000_casperjs_english.png, shots_latest/home/1024x10000_casperjs_english_latest.png)\r\nDEBUG: Cropping both images to 1264x9984. (shots_latest/home/1024x1500_phantomjs_english.png, shots_latest/home/1280x10000_casperjs_english.png)\r\nDEBUG: Both images are exactly 304x9984 - no cropping required. (shots_latest/home/320x10000_casperjs_english.png, shots_latest/home/320x10000_casperjs_english_latest.png)\r\nDEBUG: Cropping both images to 1280x9984. (shots_latest/home/1280x10000_casperjs_english_latest.png, shots_latest/home/1280x1500_phantomjs_english.png)\r\nDEBUG: Cropping both images to 584x9984. (shots_latest/home/320x1500_phantomjs_english.png, shots_latest/home/600x10000_casperjs_english.png)\r\nDEBUG: Cropping both images to 600x9984. (shots_latest/home/600x10000_casperjs_english_latest.png, shots_latest/home/600x768_phantomjs_english.png)\r\nDEBUG: Both images are exactly 752x9984 - no cropping required. (shots_latest/home/768x10000_casperjs_english.png, shots_latest/home/768x10000_casperjs_english_latest.png)\r\n/Users/viki/.rvm/gems/ruby-2.1.1/gems/wraith-3.2.0/lib/wraith/crop.rb:48:in `initialize': no implicit conversion of nil into String (TypeError)\r\n\tfrom /Users/viki/.rvm/gems/ruby-2.1.1/gems/wraith-3.2.0/lib/wraith/crop.rb:48:in `open'\r\n\tfrom /Users/viki/.rvm/gems/ruby-2.1.1/gems/wraith-3.2.0/lib/wraith/crop.rb:48:in `image_dimensions'\r\n\tfrom /Users/viki/.rvm/gems/ruby-2.1.1/gems/wraith-3.2.0/lib/wraith/crop.rb:26:in `crop_if_necessary'\r\n\tfrom /Users/viki/.rvm/gems/ruby-2.1.1/gems/wraith-3.2.0/lib/wraith/crop.rb:19:in `block in crop_images'\r\n\tfrom /Users/viki/.rvm/gems/ruby-2.1.1/gems/parallel-1.9.0/lib/parallel.rb:453:in `call'\r\n\tfrom /Users/viki/.rvm/gems/ruby-2.1.1/gems/parallel-1.9.0/lib/parallel.rb:453:in `call_with_index'\r\n\tfrom /Users/viki/.rvm/gems/ruby-2.1.1/gems/parallel-1.9.0/lib/parallel.rb:422:in `process_incoming_jobs'\r\n\tfrom /Users/viki/.rvm/gems/ruby-2.1.1/gems/parallel-1.9.0/lib/parallel.rb:404:in `block in worker'\r\n\tfrom /Users/viki/.rvm/gems/ruby-2.1.1/gems/parallel-1.9.0/lib/parallel.rb:395:in `fork'\r\n\tfrom /Users/viki/.rvm/gems/ruby-2.1.1/gems/parallel-1.9.0/lib/parallel.rb:395:in `worker'\r\n\tfrom /Users/viki/.rvm/gems/ruby-2.1.1/gems/parallel-1.9.0/lib/parallel.rb:386:in `block in create_workers'\r\n\tfrom /Users/viki/.rvm/gems/ruby-2.1.1/gems/parallel-1.9.0/lib/parallel.rb:385:in `each'\r\n\tfrom /Users/viki/.rvm/gems/ruby-2.1.1/gems/parallel-1.9.0/lib/parallel.rb:385:in `each_with_index'\r\n\tfrom /Users/viki/.rvm/gems/ruby-2.1.1/gems/parallel-1.9.0/lib/parallel.rb:385:in `create_workers'\r\n\tfrom /Users/viki/.rvm/gems/ruby-2.1.1/gems/parallel-1.9.0/lib/parallel.rb:327:in `work_in_processes'\r\n\tfrom /Users/viki/.rvm/gems/ruby-2.1.1/gems/parallel-1.9.0/lib/parallel.rb:241:in `map'\r\n\tfrom /Users/viki/.rvm/gems/ruby-2.1.1/gems/parallel-1.9.0/lib/parallel.rb:203:in `each'\r\n\tfrom /Users/viki/.rvm/gems/ruby-2.1.1/gems/wraith-3.2.0/lib/wraith/crop.rb:18:in `crop_images'\r\n\tfrom /Users/viki/.rvm/gems/ruby-2.1.1/gems/wraith-3.2.0/lib/wraith/cli.rb:98:in `block in crop_images'\r\n\tfrom /Users/viki/.rvm/gems/ruby-2.1.1/gems/wraith-3.2.0/lib/wraith/cli.rb:28:in `within_acceptable_limits'\r\n\tfrom /Users/viki/.rvm/gems/ruby-2.1.1/gems/wraith-3.2.0/lib/wraith/cli.rb:95:in `crop_images'\r\n\tfrom /Users/viki/.rvm/gems/ruby-2.1.1/gems/wraith-3.2.0/lib/wraith/cli.rb:173:in `block in latest'\r\n\tfrom /Users/viki/.rvm/gems/ruby-2.1.1/gems/wraith-3.2.0/lib/wraith/cli.rb:28:in `within_acceptable_limits'\r\n\tfrom /Users/viki/.rvm/gems/ruby-2.1.1/gems/wraith-3.2.0/lib/wraith/cli.rb:168:in `latest'\r\n\tfrom /Users/viki/.rvm/gems/ruby-2.1.1/gems/thor-0.19.1/lib/thor/command.rb:27:in `run'\r\n\tfrom /Users/viki/.rvm/gems/ruby-2.1.1/gems/thor-0.19.1/lib/thor/invocation.rb:126:in `invoke_command'\r\n\tfrom /Users/viki/.rvm/gems/ruby-2.1.1/gems/thor-0.19.1/lib/thor.rb:359:in `dispatch'\r\n\tfrom /Users/viki/.rvm/gems/ruby-2.1.1/gems/thor-0.19.1/lib/thor/base.rb:440:in `start'\r\n\tfrom /Users/viki/.rvm/gems/ruby-2.1.1/gems/wraith-3.2.0/bin/wraith:5:in `<top (required)>'\r\n\tfrom /Users/viki/.rvm/gems/ruby-2.1.1/bin/wraith:23:in `load'\r\n\tfrom /Users/viki/.rvm/gems/ruby-2.1.1/bin/wraith:23:in `<main>'\r\n\tfrom /Users/viki/.rvm/gems/ruby-2.1.1/bin/ruby_executable_hooks:15:in `eval'\r\n\tfrom /Users/viki/.rvm/gems/ruby-2.1.1/bin/ruby_executable_hooks:15:in `<main>'\r\n```\r\n\r\nWith _helper.js found, screenshot generation is still empty and gallery failed to be created :("}}
{"actor":{"display_login":"renettarenula"}}