Skip to content

Releases: bbc/wraith

Improve error handling (gallery generation) and verbose mode

16 May 15:44
Compare
Choose a tag to compare
v3.1.8

improved error handling and verbose mode

Improved validation/error-checking

16 May 12:44
Compare
Choose a tag to compare

Check config file exists, throw error if not.

Check that directory property exists

13 May 20:28
Compare
Choose a tag to compare
v3.1.6

check that directory property exists

Fix bug in determining config filepath

29 Feb 22:10
Compare
Choose a tag to compare

Thanks to @gserrg for spotting and fixing the error.

Windows bug fixes, more robust image cropping, better text output

28 Feb 18:53
Compare
Choose a tag to compare

Fixes #369 (Windows absolute file path calculation)
Fixes #374 (better text output than simply 'cropping images')
Removes pointless thumbnails folder from history dir (#373)
Crop task copes with differences in height and now width (#296)
history image filenames now end in 'base' (#368)
#390 added in better file locating too, so Wraith now detects both .yml and .yaml files automatically.

Bug fixes, async support, debug/verbose mode

24 Dec 13:43
Compare
Choose a tag to compare
  • significant bug fixes for PhantomJS users
  • bug fix for Windows users (no longer directly use pwd commands)
  • bug fix for CasperJS users (can now use ID selectors - the hashtag symbol is escaped before being passed to CLI)
  • validation, giving users helpful error messages if they try to misuse Wraith
  • expanded test suite (construct_command tests, validation tests)
  • better default example configs and before_capture hooks
  • asynchronous support for the before_capture hook. This introduces a breaking change (see next section)
  • verbose mode (just add verbose: true to your config. Easier debugging)
  • all logging moved to a logger class
  • 'debug' functionality (built into verbose mode). Starts off the output of all commands with system-specific information which should help with debugging, e.g.
#################################################
  Wraith version:     3.0.4
  Ruby version:       ruby 2.0.0p353 (2013-11-22 revision 43784) [x86_64-darwin13.1.0]
  ImageMagick:        Version: ImageMagick 6.9.1-3 Q16 x86_64 2015-05-25 http://www.imagemagick.org
  PhantomJS version:  1.9.8
  CasperJS version:   1.0.0
#################################################

Breaking changes

The new before_capture hook was great, but didn't support asynchronous actions such as AJAXing in content, etc, as Wraith's internal snap file would simply run the before_capture module and then continue, assuming the code was executed instantly.

Now, an additional parameter (the ready callback function) is passed to the before_capture module, which explicitly requires the module to call the callback before Phantom/Casper will continue. This means the user can put in arbitrary wait times, or perform any other asynchronous action, only calling the callback when they're ready.

module.exports = function (casper, ready) {
    // make Wraith wait a bit longer before taking the screenshot
    casper.wait(2000, ready); // you MUST call the ready() callback for Wraith to continue
}

Fixed resize_or_reload for PhantomJS configs

03 Dec 15:34
Compare
Choose a tag to compare

Fixed command line argument processing

02 Dec 17:04
Compare
Choose a tag to compare

Also added path-level resize_or_reload property.

Fixed before_capture path resolution

02 Dec 09:22
Compare
Choose a tag to compare

Makes the before_capture and snap_file config options absolute so that, in theory, there should be no issues with Wraith finding paths.

Fixes #338.

Abstracted JS files away. Added efficient mode

01 Dec 15:49
Compare
Choose a tag to compare

This PR consists of:

  • #330 (Abstract CasperJS/PhantomJS files away)
  • #333 (Prompt user to open gallery)
  • #335 (Enable 'efficient' capture mode)
  • also fixes the spider.yaml example config.

Changes to API:

  • snap_file property is NO LONGER NEEDED - it is abstracted away inside the Wraith gem itself. You can still specify your own snap_file if you wish (it will take precedence), but the default should now be to remove the property altogether and allow Wraith to select its own internal snap file.
  • new resize_or_reload property, with values either 'resize' or 'reload'. Up to version 2.8.1, Wraith uses 'reload' behaviour, i.e. it reloads the browser for every screen width screenshot. For the time being, that is still the default. But those who wish to run much faster Wraith tests can switch to the new 'resize' mode, which resizes the current browser instance to take screenshots, rather than firing up the browser again and again.