-
-
Notifications
You must be signed in to change notification settings - Fork 41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
(feat): add visual matcher #141
Conversation
🦋 Changeset detectedLatest commit: 540311a The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
@wswebcreation let me know what you think! |
Add docs for them in webdriverio/expect-webdriverio#1409 |
Done this one, added comments to it |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks!
I would like the ability the expectation in the service settings so that I do not have to pass 0 every time I do a comparison, so making the number an optional instead of required argument. What do you think? |
Great idea, will add the feature. |
Improved the matcher failing message:
|
Assertions can now be written without an expected result, it defaults to await expect($('.hero__title-logo')).toMatchElementSnapshot('wdioLogo', {
removeElements: [await $('nav.navbar')]
})
// or just
await expect($('.hero__title-logo')).toMatchElementSnapshot('wdioLogo') |
Let me know what you all think! |
/** | ||
* overwrite `returnAllCompareData` to allow us to provide a better assertion message | ||
*/ | ||
options.returnAllCompareData = true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
if (typeof expected === 'number') { | ||
return { | ||
pass: result.misMatchPercentage === expected, | ||
message: () => ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❤️
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks
First draft of visual matchers. Needs some testing and documentation.
I decided for this interface:
implements #140