Modification of zodyac/behat-perceptual-diff-extension which supports SilverStripe CMS ajax handling
Open Issues: 1
This package is auto-updated.
Last update: 2021-10-21 13:51:05 UTC
Enables visual diff regression testing for SilverStripe CMS, through the existing Behat test coverage.
Builds on the awesome BehatPerceptualDiff extension,
which is based on concepts from Huxley.
Customizes the extension's
StepTester class to wait
for jQuery ajax requests to complete before taking the screenshot,
which makes the logic a lot more useful to the SilverStripe CMS UI,
and avoids error-prone static sleep periods.
This extension is only required for perceptual diff testing in the SilverStripe CMS UI. For perceptual diffs on websites running SilverStripe, use the underlying BehatPerceptualDiff extension directly.
Preview of a visual diff from the SilverStripe CMS UI (added buttons in TinyMCE editor)
Follow the SilverStripe Behat Extension install instructions to get a basic project set up with Behat.
Add the perceptual diff extension
composer require silverstripe/behat-perceptual-diff
behat.yml in your project root with the following content.
It is important that
is set reasonably high (around 0.3s), in order to give
the CMS UI time to process ajax responses and render the UI.
Run your behat tests as usual, each step will generate a screenshot
pdiff/ folder. The first run will create a
folder, additional runs will compare against that.