dev-master
9999999-dev https://github.com/DigitalProducts/codeception-module-visualceptionA module for Codeception to test visual changes on web pages
Apache-2.0
The Requires
- php >=5.3.0
A module for Codeception to test visual changes on web pages
Visual regression tests integrated in Codeception., (*1)
This module can be used to compare the current representation of a website element with an expeted. It was written on the shoulders of codeception and integrates in a very easy way., (*3)
Example, (*4)
, (*5)
VisualCeption uses a combination of the "make a screenshot" feature in webdriver, imagick and jquery to compare visual elements on a website. This comparison is done in five steps:, (*6)
VisualCeption needs the following components to run:, (*7)
Add the module to _bootstrap.php
., (*8)
include_once "/path/to/module/VisualCeption.php";
include_once "/path/to/module/ImageDeviationException.php";
, (*9)
To use the VisualCeption module you have to configure it., (*10)
Example Configuration, (*11)
modules: enabled: [WebDriver, VisualCeption] VisualCeption: referenceImageDir: /home/codeception/referenceImages/ # Path to the reference folder (optional, standard is # <datadir>/VisualCeption/) maximumDeviation: 5 # deviation in percent saveCurrentImageIfFailure: true # if true, VisualCeption saves the current # image in debug dir (default: false)
VisualCeption is really easy to use. There are only two method that will be added to your WebGuy seeVisualChanges
and dontSeeVisualChanges
., (*12)
$I->seeVisualChanges( "uniqueIdentifier1", "elementId1" ); $I->dontSeeVisualChanges( "uniqueIdentifier2", "elementId2" ); $I->dontSeeVisualChanges( "uniqueIdentifier3", "elementId3" [, array("excludeElement1", "excludeElement2")] );
Example Usage, (*13)
$I->seeVisualChanges( "subNavigation", "#subNav" ); $I->dontSeeVisualChanges("content", "div.content", array("#intro"));
If you need more information about the test run please use the command line debug option (-d)., (*14)
VisualCeption uses the WebDriver module for making the screenshots. As a consequence we are not able to take screenshots via google chrome as the chromedriver does not allow full page screenshots., (*15)
A module for Codeception to test visual changes on web pages
Apache-2.0