Closed grasshopper7 closed 4 years ago
@grasshopper7 Another user reported this issue here:
https://github.com/extent-framework/extentreports-cucumber4-adapter/issues/48#issuecomment-613152077
I referred to your screenshots above and this happens because the default way to save screenshots is by writing against a URL. See the official Cucumber HTML formatter. Any space would be replaced by %20 so I would advise you to not have any spaces, use - or _ where necessary. This is also why I was unable to reproduce the behavior you are.
Ability to add plain local path can be added via configuration, this will also ensure existing usage does not break for users who are using direct HTTP links to display images.
There is a check for 'file' or 'http' protocol before the File object is created. Any http linked images should work as before.
Ah. Thanks for reminding me. Yes, this would work. Can you send a pull request?
Thank you, merged PR.
Have a space in screenshot.dir setting, then it creates a folder with name 'test%20output'.
screenshot.dir=test output/
This is due to the below line of code in URLOutputStream which does not interpret the URI correctly.
https://github.com/extent-framework/extentreports-cucumber4-adapter/blob/26b6451dfee50f241f592c53a337ea55a62b6fc9/src/main/java/com/aventstack/extentreports/cucumber/adapter/URLOutputStream.java#L41
It works when this is changed to
File file = new File(url.toURI().getPath());
Let me know if this is correct, will make the same changes in the 5 and 6 versions