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
* Issue #60 - Prepare all baselines of test by setting parameter in config (#65)
Co-authored-by: Jonatas Kirsch <[email protected]>
* Update Dependecies, Fix Fatal Error with mkdirp and Mac (#66)
* Update Dependencies
* Fix Error on Mac
* Avoid failing the test for a given threshold but yet generating the difference image (#63)
* Option bypassFailure allowing the user to avoid failing the test for a given threshold but yet generating the difference image
* Renamed option to skipFailure
Co-authored-by: Jonatas Kirsch <[email protected]>
* feat(testcafe): add the support for testcafe (#62)
* passing through output settings to resemble.js (#59)
Co-authored-by: JANK Michael <[email protected]>
* Issue 48 - Add custom assert message (#64)
Co-authored-by: Jonatas Kirsch <[email protected]>
Co-authored-by: Jonatas Kirsch <[email protected]>
Co-authored-by: Jonatas Kirsch <[email protected]>
Co-authored-by: Guillaume Camus <[email protected]>
Co-authored-by: yankydoo <[email protected]>
Co-authored-by: JANK Michael <[email protected]>
Copy file name to clipboardExpand all lines: README.md
+36-7
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.
}elsethrownewError("Method only works with Puppeteer and WebDriver helpers.");
133
+
}elseif(this.helpers['TestCafe']){
134
+
awaithelper.waitForVisible(selector);
135
+
constels=awaithelper._locate(selector);
136
+
if(!awaitels.count)thrownewError(`Element ${selector} couldn't be located`);
137
+
const{ t }=this.helpers['TestCafe'];
138
+
139
+
awaitt.takeElementScreenshot(els,name);
140
+
}elsethrownewError("Method only works with Puppeteer, WebDriver or TestCafe helpers.");
129
141
}
130
142
131
143
/**
@@ -177,7 +189,7 @@ class ResembleHelper extends Helper {
177
189
* @param region
178
190
* @param bucketName
179
191
* @param baseImage
180
-
* @param ifBaseImage - tells if the prepareBaseImage is true or false. If false, then it won't upload the baseImage.
192
+
* @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
193
* @returns {Promise<void>}
182
194
*/
183
195
@@ -296,32 +308,32 @@ class ResembleHelper extends Helper {
0 commit comments