Skip to content
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

[Feature Request]: Improving matchesReferenceImage() #1604

Open
rsaveanu-salt opened this issue Apr 28, 2024 · 1 comment
Open

[Feature Request]: Improving matchesReferenceImage() #1604

rsaveanu-salt opened this issue Apr 28, 2024 · 1 comment
Assignees
Labels
enhancement New feature or request triage needs to be looked at

Comments

@rsaveanu-salt
Copy link

Summary:

In the current implementation of visual testing (image recognition) within Shaft Engine, reference images are named using a concatenation of the calling Java class method name and the element's xPath. This naming strategy ensures uniqueness but can lead to very long file names when dealing with complex xPaths, potentially exceeding the maximum character limit imposed by some operating systems

Feature Description:
I propose two potential solutions to this issue:

  1. Hashing the Concatenated Name: Automatically generate a fixed-length hash (e.g., SHA-256) of the concatenation of the Java class method name and the path. This would significantly reduce the length of the file name while maintaining uniqueness.
  2. Allow Custom Naming via Method Parameter: Overloading the image validation method (public ValidationsExecutor matchesReferenceImage()) to accept an optional parameter representing the desired name for the image file. This would provide flexibility when necessary, particularly in complex testing frameworks. And it would allow for an improved organization of the image resources.
@rsaveanu-salt rsaveanu-salt added enhancement New feature or request triage needs to be looked at labels Apr 28, 2024
@MohabMohie
Copy link
Contributor

We want to proceed with the hashing implementation. Would you like to contribute?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request triage needs to be looked at
Projects
None yet
Development

No branches or pull requests

2 participants