Skip to content

Commit 4c2c385

Browse files
author
Nils Langner
committed
Merge branch 'master' of github.com:phmLabs/codeception-module-visualception
2 parents 1ed90d4 + 3c89706 commit 4c2c385

File tree

1 file changed

+15
-6
lines changed

1 file changed

+15
-6
lines changed

readme.md

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,21 @@
11
# VisualCeption
22
Visual regression tests integrated in [Codeception](http://codeception.com/).
33

4-
## Documenation todo
5-
* run twice
6-
* phantom css
7-
* example image
8-
* license
9-
* how it works
4+
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.
5+
6+
**Example**
7+
8+
![](http://www.thewebhatesme.com/VisualCeption/compare.png)
9+
10+
## How it works
11+
12+
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 four steps:
13+
14+
1. **Take a screenshot** of the full page using webdriver.
15+
2. **Calculate the position** and size of the selected element using jquery.
16+
3. **Crop the element** out of the full screenshot using imagick.
17+
4. **Compare the element** with an older version of the screenshot that has been proofed as valid using imagick. If no previous image exists the current image will be used fur future comparions. As an effect of this approach the test has to be **run twice** before it works.
18+
5. If the deviation is too high **throw an exception** that is caught by Codeception.
1019

1120
## Requirements
1221

0 commit comments

Comments
 (0)