Serenity-core: Assert messages are corrupted in HTML report

Created on 23 Jun 2016  Â·  3Comments  Â·  Source: serenity-bdd/serenity-core

Assert messages from org.junit.Assert asserts like assertEquals() or assertThat() are not displayed in HTML report ‒ they are interpreted as part of HTML markup, please have a look at the screen below.
Original assert message (displayed in console):
Password validation error message is incorect! expected:<Sorry, we don[Тt recognize that e-mail address. Please try a different e-mail address].> but was:<Sorry, we don['t recognize that email address. Please try again].>
Generated HTML report page:
screen

Used versions:
Serenity core: 1.1.36 1.1.37-rc.5 (switched from 1.1.21)
Serenity-Jbehave: 1.13.0
Java: 1.8.0_65
OS: WIndows 7x64

bug

Most helpful comment

@scormaq, @hazmeister sure it is as bug and it will be fixed.

Thanks for this ticket!!!

All 3 comments

Was this working previously? I moved from Hamcrest to AssertJ because it works better with the reports (and actually offers a reasonable syntax for asserts).

Hi @hazmeister,

Was this working previously?

As I can see, stack trace wasn't displayed well either in 1.1.21 version, but there was a helping preview message (so I didn't worry about stack trace a lot):
Report for version 1.1.21
(this one is same for 1.1.36 version - I was confused a little bit with new versions, original post contains screen for 1.1.37-rc.5)

_But_ in 1.1.37-rc.5 version this message has gone, so I have to view stack trace to find out failure cause:
Report for version 1.1.37-rc.5

I moved from Hamcrest to AssertJ because it works better with the reports

I agree, the issue is not reproducible for AssertJ, because it generates slightly different message:
AssertJ:
[Password validation error message is incorect!] expected:<"Sorry, we don[]t recognize that ema...> but was:<"Sorry, we don[']t recognize that ema...>`

JUnit:
Password validation error message is incorect! expected:<Sorry, we don[]t recognize that ema...> but was: Unfortunately, for big projects like mine there not always a possibility to replace Hamcrest with AssertJ just for having nice stack traces in Serenity reports.

@scormaq, @hazmeister sure it is as bug and it will be fixed.

Thanks for this ticket!!!

Was this page helpful?
0 / 5 - 0 ratings