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
Copy file name to clipboardExpand all lines: README.md
+12-6Lines changed: 12 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,5 @@
1
1
# codeceptjs-resemblehelper
2
-
Helper for resemble.js, used for image comparison in tests with WebdriverIO.
2
+
Helper for resemble.js, used for image comparison in tests with WebdriverIO or Puppeteer.
3
3
4
4
codeceptjs-resemblehelper is a [CodeceptJS](https://codecept.io/) helper which can be used to compare screenshots and make the tests fail/pass based on the tolerance allowed.
5
5
@@ -21,19 +21,25 @@ Example:
21
21
"ResembleHelper" : {
22
22
"require": "codeceptjs-resemblehelper",
23
23
"baseFolder": "./tests/screenshots/base/",
24
-
"diffFolder": "./tests/screenshots/diff/"
24
+
"diffFolder": "./tests/screenshots/diff/",
25
+
"prepareBaseImage": true
25
26
}
26
27
}
27
28
}
28
29
```
29
30
30
-
To use the Helper, users must provide the two parameters:
31
+
To use the Helper, users may provide the parameters:
31
32
32
-
`baseFolder`: This is the folder for base images, which will be used with screenshot for comparison.
33
+
`baseFolder`: Mandatory. This is the folder for base images, which will be used with screenshot for comparison.
33
34
34
-
`diffFolder`: This will the folder where resemble would try to store the difference image, which can be viewed later.
35
+
`diffFolder`: Mandatory. This will the folder where resemble would try to store the difference image, which can be viewed later.
35
36
36
-
Usage, these are major functions that help in visual testing
37
+
`prepareBaseImage`: Optional. When `true` then the system replaces all of the baselines related to the test case(s) you ran. This is equivalent of setting the option `prepareBaseImage: true` in all verifications of the test file.
38
+
39
+
40
+
### Usage
41
+
42
+
These are the major functions that help in visual testing:
37
43
38
44
First one is the `seeVisualDiff` which basically takes two parameters
39
45
1)`baseImage` Name of the base image, this will be the image used for comparison with the screenshot image. It is mandatory to have the same image file names for base and screenshot image.
@@ -177,7 +178,7 @@ class ResembleHelper extends Helper {
177
178
* @param region
178
179
* @param bucketName
179
180
* @param baseImage
180
-
* @param ifBaseImage - tells if the prepareBaseImage is true or false. If false, then it won't upload the baseImage.
181
+
* @param ifBaseImage - tells if the prepareBaseImage is true or false. If false, then it won't upload the baseImage. However, this parameter is not considered if the config file has a prepareBaseImage set to true.
181
182
* @returns {Promise<void>}
182
183
*/
183
184
@@ -296,6 +297,10 @@ class ResembleHelper extends Helper {
0 commit comments