Git Product home page Git Product logo

Comments (6)

sasanikolic90 avatar sasanikolic90 commented on August 31, 2024 1

I am still experiencing this issue. Any idea why?

/Library/Ruby/Gems/2.3.0/gems/wraith-4.2.3/lib/wraith/crop.rb:48:in "initialize": no implicit conversion of nil into String (TypeError)

from wraith.

sbelyea avatar sbelyea commented on August 31, 2024

I think this is actually related to Issue #122 and looks like it was closed a few days ago. Don't believe the gem is updated, though.

from wraith.

dblooman avatar dblooman commented on August 31, 2024

I started a PR #123, but there is a better way of doing it. The bug is actually to do with Phantom, if the process dies or anything else goes wrong, it just skips over to the next image. This means the cropping occurs when there are an incorrect amount of images.
The solution is to find a folder where the image(s) are missing, then add a placeholder to prevent the whole process from failing. Simply raising as exception and moving on instead wouldn't work as the images would then be out of order when comparing.

from wraith.

dblooman avatar dblooman commented on August 31, 2024

This will be fixed by #112

from wraith.

trodrigues avatar trodrigues commented on August 31, 2024

Completely missed these notifications.

Yeah, I assumed this would be related to Phantom because I started using Slimer and the problem doesn't happen anymore. Need to give a try to the latest version with Phantom.

from wraith.

crs1138 avatar crs1138 commented on August 31, 2024

Using chrome and having the same problems when running wraith latests history_config.yml.

$ wraith info
DEBUG: #################################################
DEBUG:   Command run:        info
DEBUG:   Wraith version:     4.2.3
DEBUG:   Ruby version:       ruby 2.3.7p456 (2018-03-28 revision 63024) [universal.x86_64-darwin18]
DEBUG:   ImageMagick:        Version: ImageMagick 7.0.8-12 Q16 x86_64 2018-09-23 https://imagemagick.org
DEBUG:   PhantomJS version:  2.1.1
DEBUG:   chromedriver version:  ChromeDriver 72.0.3626.69 (3c16f8a135abc0d4da2dff33804db79b849a7c38)
DEBUG:   CasperJS version:   CasperJS not installed
DEBUG: #################################################

and my history_config.yml file…

##############################################################
##############################################################
# 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 'history' mode, which is best suited to
# making sure your site's appearance remains consistent over
# time.
#
# `wraith history history.yaml` # generate base screenshots
# `wraith latest history.yaml`  # take new shots and compare
#
##############################################################
##############################################################

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

# (required) The domain to take screenshots of.
domains:
  acompalia: 'https://domain.com'

# (required) The paths to capture. This particular config is using casperjs, so we can take screenshots of selectors rather than the entire page.
paths:
  home: /
  esp_home: /es

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

# (optional) Resize to each screen width (efficient), or reload at each screen width (costly). Default: 'reload'
resize_or_reload: 'resize'

# (required for history mode, otherwise optional) The directory that your base screenshots will be stored in.
history_dir: 'shots_base'

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

# (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:  400
  thumb_height: 400

# (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

# (optional) Color to highlight the image diff. Default: 'blue'
highlight_color: red

========
Results in…

Config validated. No serious issues found.
Creating Folders
SAVING IMAGES
COPYING BASE IMAGES
Copying shots_base/home to shots_postupdates
Copying shots_base/donate to shots_postupdates
Copying shots_base/volunteers to shots_postupdates
Copying shots_base/members to shots_postupdates
Copying shots_base/news to shots_postupdates
Copying shots_base/grief_support to shots_postupdates
Copying shots_base/esp_home to shots_postupdates
Copying shots_base/esp_donate to shots_postupdates
Copying shots_base/esp_volunteers to shots_postupdates
Copying shots_base/esp_members to shots_postupdates
Copying shots_base/esp_news to shots_postupdates
Copying shots_base/esp_grief_support to shots_postupdates
CROPPING IMAGES
/Library/Ruby/Gems/2.3.0/gems/wraith-4.2.3/lib/wraith/crop.rb:48:in `initialize': no implicit conversion of nil into String (TypeError)
        from /Library/Ruby/Gems/2.3.0/gems/wraith-4.2.3/lib/wraith/crop.rb:48:in `open'
        from /Library/Ruby/Gems/2.3.0/gems/wraith-4.2.3/lib/wraith/crop.rb:48:in `image_dimensions'
        from /Library/Ruby/Gems/2.3.0/gems/wraith-4.2.3/lib/wraith/crop.rb:26:in `crop_if_necessary'
        from /Library/Ruby/Gems/2.3.0/gems/wraith-4.2.3/lib/wraith/crop.rb:19:in `block in crop_images'
        from /Library/Ruby/Gems/2.3.0/gems/parallel-1.12.1/lib/parallel.rb:486:in `call_with_index'
        from /Library/Ruby/Gems/2.3.0/gems/parallel-1.12.1/lib/parallel.rb:455:in `process_incoming_jobs'
        from /Library/Ruby/Gems/2.3.0/gems/parallel-1.12.1/lib/parallel.rb:437:in `block in worker'
        from /Library/Ruby/Gems/2.3.0/gems/parallel-1.12.1/lib/parallel.rb:428:in `fork'
        from /Library/Ruby/Gems/2.3.0/gems/parallel-1.12.1/lib/parallel.rb:428:in `worker'
        from /Library/Ruby/Gems/2.3.0/gems/parallel-1.12.1/lib/parallel.rb:419:in `block in create_workers'
        from /Library/Ruby/Gems/2.3.0/gems/parallel-1.12.1/lib/parallel.rb:418:in `each'
        from /Library/Ruby/Gems/2.3.0/gems/parallel-1.12.1/lib/parallel.rb:418:in `each_with_index'
        from /Library/Ruby/Gems/2.3.0/gems/parallel-1.12.1/lib/parallel.rb:418:in `create_workers'
        from /Library/Ruby/Gems/2.3.0/gems/parallel-1.12.1/lib/parallel.rb:358:in `work_in_processes'
        from /Library/Ruby/Gems/2.3.0/gems/parallel-1.12.1/lib/parallel.rb:264:in `map'
        from /Library/Ruby/Gems/2.3.0/gems/parallel-1.12.1/lib/parallel.rb:217:in `each'
        from /Library/Ruby/Gems/2.3.0/gems/wraith-4.2.3/lib/wraith/crop.rb:18:in `crop_images'
        from /Library/Ruby/Gems/2.3.0/gems/wraith-4.2.3/lib/wraith/cli.rb:87:in `block in crop_images'
        from /Library/Ruby/Gems/2.3.0/gems/wraith-4.2.3/lib/wraith/helpers/utilities.rb:4:in `within_acceptable_limits'
        from /Library/Ruby/Gems/2.3.0/gems/wraith-4.2.3/lib/wraith/cli.rb:84:in `crop_images'
        from /Library/Ruby/Gems/2.3.0/gems/wraith-4.2.3/lib/wraith/cli.rb:161:in `block in latest'
        from /Library/Ruby/Gems/2.3.0/gems/wraith-4.2.3/lib/wraith/helpers/utilities.rb:4:in `within_acceptable_limits'
        from /Library/Ruby/Gems/2.3.0/gems/wraith-4.2.3/lib/wraith/cli.rb:155:in `latest'
        from /Library/Ruby/Gems/2.3.0/gems/thor-0.20.0/lib/thor/command.rb:27:in `run'
        from /Library/Ruby/Gems/2.3.0/gems/thor-0.20.0/lib/thor/invocation.rb:126:in `invoke_command'
        from /Library/Ruby/Gems/2.3.0/gems/thor-0.20.0/lib/thor.rb:387:in `dispatch'
        from /Library/Ruby/Gems/2.3.0/gems/thor-0.20.0/lib/thor/base.rb:466:in `start'
        from /Library/Ruby/Gems/2.3.0/gems/wraith-4.2.3/bin/wraith:5:in `<top (required)>'
        from /usr/local/bin/wraith:22:in `load'
        from /usr/local/bin/wraith:22:in `<main>'

from wraith.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.