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

Improve SelenideAddons.wrapAssertionError #142

Closed
oomelianchuk opened this issue Sep 23, 2020 · 3 comments
Closed

Improve SelenideAddons.wrapAssertionError #142

oomelianchuk opened this issue Sep 23, 2020 · 3 comments
Assignees
Labels
bug codeDone The issue is rechecked for development branch codeReadyForRecheck The issue is fixed/implemented AND merged into development, but needs to be rechecked there High Priority
Milestone

Comments

@oomelianchuk
Copy link
Contributor

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.

@oomelianchuk
Copy link
Contributor Author

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?

@occupant23 occupant23 added this to the v4.1.0 milestone Sep 24, 2020
@occupant23 occupant23 self-assigned this Oct 7, 2020
@occupant23
Copy link
Contributor

@oomelianchuk: adjusted the method. please review

@occupant23 occupant23 added the codeReadyForRecheck The issue is fixed/implemented AND merged into development, but needs to be rechecked there label Oct 7, 2020
@oomelianchuk
Copy link
Contributor Author

Wonderful! Now the allure report with wrapped asserts looks like this. Thanks

@occupant23 occupant23 added the codeDone The issue is rechecked for development branch label Oct 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug codeDone The issue is rechecked for development branch codeReadyForRecheck The issue is fixed/implemented AND merged into development, but needs to be rechecked there High Priority
Projects
None yet
Development

No branches or pull requests

2 participants