You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
$this->assertTrue(false, "The deviation of the taken screenshot is too high (" . $deviationResult["deviation"] . "%).\nSee $compareScreenshotPath for a deviation screenshot.");
75
+
}
76
+
}
77
+
}
78
+
79
+
/**
80
+
* Compare the reference image with a current screenshot, identified by their indentifier name
81
+
* and their element ID.
82
+
*
83
+
* @param string $identifier identifies your test object
84
+
* @param string $elementID DOM ID of the element, which should be screenshotted
$this->assertTrue(false, "The deviation of the taken screenshot is too low (" . $deviationResult["deviation"] . "%).\nSee $compareScreenshotPath for a deviation screenshot.");
94
+
}
95
+
}
96
+
}
97
+
45
98
/**
46
-
* Initialize the module and read the config. Throws a runtime exception, if the
99
+
* Initialize the module and read the config.
100
+
* Throws a runtime exception, if the
47
101
* reference image dir is not set in the config
48
102
*
49
103
* @throws \RuntimeException
@@ -67,7 +121,8 @@ private function init ()
67
121
}
68
122
69
123
/**
70
-
* Find the position and proportion of a DOM element, specified by it's ID. The method inject the
124
+
* Find the position and proportion of a DOM element, specified by it's ID.
125
+
* The method inject the
71
126
* JQuery Framework and uses the "noConflict"-mode to get the width, height and offset params.
72
127
*
73
128
* @param $elementId DOM ID of the element, which should be screenshotted
@@ -80,7 +135,7 @@ private function getCoordinates ($elementId)
$this->assertTrue(false, "The deviation of the taken screenshot is too high (".$deviation."%).\nSee $compareScreenshotPath for a deviation screenshot.");
191
-
}
192
-
}
193
-
194
223
/**
195
224
* Returns the image path including the filename of a deviation image
196
225
*
@@ -204,7 +233,8 @@ private function getDeviationScreenshotPath ($identifier)
204
233
}
205
234
206
235
/**
207
-
* Compare two images by its identifiers. If the reference image doesn't exists
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
7
6
8
**Example**
@@ -52,20 +54,23 @@ VisualCeption:
52
54
53
55
## Usage
54
56
55
-
VisualCeption is really easy to use. There is only one method that will be added to your WebGuy <code>compareScreenshot</code>. This will be used to name the screenshot and identify the elements that has to be screenshot.
57
+
VisualCeption is really easy to use. There are only two method that will be added to your WebGuy <code>seeVisualChanges</code>and <code>dontSeeVisualChanges</code>.
***uniqueIdentifier** For comparing the images it is important to have a stable name. This is the corresponding name.
62
65
***elementId** It is possible to only compare a special div container. The element id can be passed. *You can use all locators that can be used in jQuery*.
If you need more information about the test run please use the command line debug option (-d).
73
+
69
74
## Restriction
70
75
71
76
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.
0 commit comments