codeceptjs / codeceptjs/codeceptjs-resemblehelper

Setting needsSameDimension flag to false isn't validating the difference of text between two locales.

Open
#114 5 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
27
Forks
55
PR merge metrics
No merged PRs in 30d

Description

We are using `codeceptjs-resemblehelper` to perform visual regression testing for our application that supports multiple locales. We are logging in with users mapped to these locales to achieve this.

Since our page is dynamic and it contains data. We are using `I.seeVisualDiffForElement` method and find the diff only for the elements that are static in the application. Some translations are rendering elements tad bigger than others.

On executing a negative case where the user belongs to the locale `en-GB` and compares the image for `fr-FR`, we see the below error -
` The base image is of 65 X 156 and actual image is of 62 X 156. Please use images of same dimensions so as to avoid any unexpected results.`

![searchBar-en-GB](https://user-images.githubusercontent.com/25933070/182240325-cccd090c-7e0f-4501-b54a-dc3e28aab23c.png)

![searchBar-fr-FR](https://user-images.githubusercontent.com/25933070/182240364-717099b3-024a-4a7b-83b6-7d4c39fb91c1.png)

In order to ignore image size, we used the attribute `needSameDimensions: false`. But unfortunately, after using this attribute in our tests, the screen comparison is not working. The diff is not considered, and the tests are passing even though the locale is completely different.

Can you take a look at this issue?

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.