Refactored Selenium setup into a setUpClass method, which dramatically
improves run-time since the Selenium session overhead is massive
Allow baseline-capture to be requested by NEEDLE_CAPTURE env. variable
Select a browser other than Firefox using the NEEDLE_BROWSER env.
variable
Store screenshots in screenshots/ subdirectory; allow overriding
by setting the NEEDLE_OUTPUT_DIR and NEEDLE_BASELINE_DIR env.
variables
Automatically create output/baseline directories if they do not exist
Refactor assertScreenshot core into compareScreenshot context
manager which allows the check for a baseline image to be done before
actually loading the page in a browser which is much faster when
only a small percentage of the baseline images need to be re-captured
Set NEEDLE_USE_PERCEPTUALDIFF to use http://pdiff.sf.net instead of
the built-in comparison
Force the Selenium browser viewport to be a specific size (defined as
the TestCaseviewport_height and viewport_width class
properties) which makes cross-browser/platform image comparison more
realistic as e.g. scrollbar dimensions won't cause all of the images
to be different width.
This is my working branch with various changes:
NEEDLE_CAPTURE
env. variableNEEDLE_BROWSER
env. variablescreenshots/
subdirectory; allow overriding by setting theNEEDLE_OUTPUT_DIR
andNEEDLE_BASELINE_DIR
env. variablesassertScreenshot
core intocompareScreenshot
context manager which allows the check for a baseline image to be done before actually loading the page in a browser which is much faster when only a small percentage of the baseline images need to be re-capturedNEEDLE_USE_PERCEPTUALDIFF
to use http://pdiff.sf.net instead of the built-in comparisonTestCase
viewport_height
andviewport_width
class properties) which makes cross-browser/platform image comparison more realistic as e.g. scrollbar dimensions won't cause all of the images to be different width.