-
-
Notifications
You must be signed in to change notification settings - Fork 84
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
Implement steps for visual check using image out of file #3043
base: master
Are you sure you want to change the base?
Conversation
Codecov Report
@@ Coverage Diff @@
## master #3043 +/- ##
============================================
+ Coverage 96.80% 96.81% +0.01%
- Complexity 5859 5879 +20
============================================
Files 823 825 +2
Lines 16622 16679 +57
Branches 1076 1076
============================================
+ Hits 16091 16148 +57
Misses 419 419
Partials 112 112
📣 Codecov can now indicate which changes are the most critical in Pull Requests. Learn more |
|
||
[source,gherkin] | ||
---- | ||
When I $actionType baseline with name `$name` from image out of file `$filePath` |
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.
syntax is needed to be discussed, for me it looks a bit awkward
* @param filePath The path to the image file. | ||
*/ | ||
@When(value = "I $actionType baseline with name `$name` from image out of file `$filePath`", priority = 1) | ||
public void runVisualTestsUsingImageFile(VisualActionType actionType, String baselineName, String filePath) |
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.
public void runVisualTestsUsingImageFile(VisualActionType actionType, String baselineName, String filePath) | |
public void runVisualTestsUsingImageFile(VisualActionType actionType, String baselineName, Path imageFile) |
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.
the same for all other steps
imageTool.when(() -> ImageIO.read(new File(getImageFilePath()))).thenThrow(new IOException()); | ||
assertThrows(UncheckedIOException.class, | ||
() -> visualSteps.runVisualTestsUsingImageFile(VisualActionType.COMPARE_AGAINST, BASELINE, | ||
getImageFilePath())); |
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.
extract getImageFilePath()
to a local variable
|
||
private static String getImageFilePath() | ||
{ | ||
return ResourceUtils.findResource(FileSystemBaselineStorage.class, "/baselines/baseline.png").getPath(); |
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.
return ResourceUtils.findResource(FileSystemBaselineStorage.class, "/baselines/baseline.png").getPath(); | |
return ResourceUtils.findResource(VisualStepsTests.class, "/baselines/baseline.png").getPath(); |
Also, I think it makes to deprecate steps accepting |
When I compare_against baseline with name `context` from image out of file `src/main/resources/baselines/context.png` | ||
When I compare_against baseline with name `context` from image out of file `src/main/resources/baselines/context.png` using storage `filesystem` |
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.
The steps should work for the absolute path and for the 'resources' (/baselines/context.png))
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.
I'm ok with absolute path, but I don't agree for 'resources' as it can confuse users
No description provided.