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 will only work when the [`screenshotPath`](#screenshotpath) is set through the plugin options, and **WILL NOT WORK** when you set the folders in the methods
130
130
:::
131
131
132
+
### `createJsonReportFiles`**(NEW)**
133
+
134
+
-**Type:**`boolean`
135
+
-**Mandatory:** No
136
+
-**Default:**`false`
137
+
138
+
You now have the option to export the compare results into a JSON report file. By providing the option `createJsonReportFiles: true`, each image that is compared will create a report stored in the `actual` folder, next to each `actual` image result. The output will look like this:
When all tests are executed, a new JSON file with the collection of the comparisons will be generated and can be found in the root of your `actual` folder. The data is grouped by:
202
+
203
+
-`describe` for Jasmine/Mocha or `Feature` for CucumberJS
204
+
-`it` for Jasmine/Mocha or `Scenario` for CucumberJS
205
+
and then sorted by:
206
+
-`commandName`, which are the compare method names used to compare the images
207
+
-`instanceData`, browser first, then device, then platform
208
+
it will look like this
209
+
210
+
```json
211
+
[
212
+
{
213
+
"description": "check methods",
214
+
"data": [
215
+
{
216
+
"test": "should fail comparing with a baseline",
217
+
"data": [
218
+
{
219
+
"tag": "examplePageFail",
220
+
"instanceData": {},
221
+
"commandName": "checkScreen",
222
+
"framework": "mocha",
223
+
"boundingBoxes": {
224
+
"diffBoundingBoxes": [],
225
+
"ignoredBoxes": []
226
+
},
227
+
"fileData": {},
228
+
"misMatchPercentage": "14.34",
229
+
"rawMisMatchPercentage": 14.335403703025868
230
+
},
231
+
{
232
+
"tag": "exampleElementFail",
233
+
"instanceData": {},
234
+
"commandName": "checkElement",
235
+
"framework": "mocha",
236
+
"boundingBoxes": {
237
+
"diffBoundingBoxes": [],
238
+
"ignoredBoxes": []
239
+
},
240
+
"fileData": {},
241
+
"misMatchPercentage": "1.34",
242
+
"rawMisMatchPercentage": 1.335403703025868
243
+
}
244
+
]
245
+
}
246
+
]
247
+
}
248
+
]
249
+
```
250
+
251
+
The report data will give you the opportunity to build your own visual report without doing all the magic and data collection yourself.
252
+
253
+
:::info NOTE
254
+
You need to use `@wdio/visual-testing` version `5.2.0` or higher
255
+
:::
256
+
132
257
### `disableCSSAnimation`
133
258
134
259
-**Type:**`boolean`
@@ -146,12 +271,12 @@ and reset when done
146
271
-**Default:**`false`
147
272
-**Supported:** Web
148
273
149
-
This will hide all text on a page so only the layout will be used for comparison. Hiding will be done by adding the style `'color': 'transparent !important'` to __each__ element.
274
+
This will hide all text on a page so only the layout will be used for comparison. Hiding will be done by adding the style `'color': 'transparent !important'` to **each** element.
150
275
151
276
For the output see [Test Output](./test-output#enablelayouttesting)
152
277
153
278
:::info
154
-
By using this flag each element that contains text (so not only `p, h1, h2, h3, h4, h5, h6, span, a, li`, but also `div|button|..`) will get this property. There is __no__ option to tailor this.
279
+
By using this flag each element that contains text (so not only `p, h1, h2, h3, h4, h5, h6, span, a, li`, but also `div|button|..`) will get this property. There is **no** option to tailor this.
0 commit comments