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

Wraith crops the screenshot and missing images (logo) #417

Closed
dgiddins opened this issue Apr 11, 2016 · 2 comments
Closed

Wraith crops the screenshot and missing images (logo) #417

dgiddins opened this issue Apr 11, 2016 · 2 comments

Comments

@dgiddins
Copy link

I have a very basic setup for wraith (to get it working in CI) and noticed that its cropping the bottom of my pages. Its also not loading some images. The config file is below, can anybody point out whats wrong?

browser: "phantomjs"

# (required) The domains to take screenshots of.
domains:
  current:  "http://ci-test.site.com"

# (required) The paths to capture. All paths should exist for both of the domains specified above.
paths:
  feedback:     /Feedback/

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

history_dir: 'shots_base'

# (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 for history mode, otherwise optional) The directory that your base screenshots will be stored in.
history_dir: 'shots_base'

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

verbose: true
@ChrisBAshton
Copy link
Contributor

Hi @daffers

First issue - the missing images - this sounds like Wraith is taking pictures before all the assets have downloaded (this is especially likely if images are added in afterwards at runtime using JavaScript). To make Wraith wait before taking images, use the before_capture hook to wait for a few seconds before capturing - an example is available here: http://bbc-news.github.io/wraith/#PhantomJSbefore_capturemodule

Second issue - cropping - is a known issue (#318) which we hope to fix in a future release. Until then, the fix is to specify a large height to accommodate the page, e.g. 1280x5000.

@dgiddins
Copy link
Author

Thanks, I had tried to set page height before with the * rather than the x (i.e. 1280*3000). RTFM

Am having problems with the before capture call as described here: #420

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

2 participants