Closed oomelianchuk closed 4 years ago
The issue can probably be fixed by replacing the SelenideLogger.commitStep(new SelenideLog("Assertion error", message), e);
in the SelenideAddons.wrapAssertionError
with the SelenideLogger.commitStep(SelenideLogger.beginStep("Assertion error", message), e);
Can we also attach stack trace to message
here?
@oomelianchuk: adjusted the method. please review
Wonderful! Now the allure report with wrapped asserts looks like this. Thanks
The aim of the SelenideAddons.wrapAssertionError is to make JUnit assertion to be alike the Selenide assertions. This is currently not completely fulfilled, as Selenide assertions supply the Allure report with a screenshot and code snippet, which causes the failure (as you can see in this report), but the wrapped assertions only take a screenshot (example).
This wouldn't be such a problem if the error message from after hook didn't overwrite the one from the test. Such a report with selenide assertion even if makes it a bit more difficult to figure out the failure reason by not supplying the stack trace, but at least leaves some hints in form of code snippet in the step annotation. The wrapped assertion instead doesn't have any own step annotation, which makes it difficult to figure out the failure reason, especially if the assertion was made about something, which doesn't have an impact on the currently opened page (makes screenshot irrelevant)
Please improve the SelenideAddons.wrapAssertionError method by making it to add the failure message to the Allure report. The method could be even better if the stack trace could also be attached to the Allure report, so if there is an option to do it, please also add this functionality.