Open HerbertsVaadin opened 5 months ago
The HasText.getText()
Javadoc states that the method does not return null
, so probably PrettyPrinter fails because it assumes it will get a non-null value.
Anyway, it makes sense that PrettyPrinter
should not fail, even if the component does not fulfill Javadocs requirement. It should instead print the representation and possibly highlight unexpected values.
I'm trying to query an extended Vaadin Button by attribute. Now, the extended button is a bit special, but the exception is quite unclear. You'll see in my example
myButton3
has no text set, and that is what causes the exception. The button itself is working just fine on frontend.Exception:
The extended button:
RichTextSpan.java:
The view,
myButton3
is the one causing the problem:Test fails as expected, but doesn't doesn't provide useful message, and doesn't show the view structure because of the exception. Seems like pretty print should be able to handle text null cases. It seems to not to fall apart with not extended Button.
In the specific case, a the exception occurs when a button is not found, but there is a button somewhere with no text. Took me a while to find that button, since it was in a parent layout.