Problem. SpanLocator has getText(). DialogLocator has open(),
close(), getComponent() — and no way to read what the dialog says. For a
modal editor test ("the live line total shows €37.50", "the error summary lists
this message") the natural assertion is on the dialog's text, and it needs the
component:
// Wanted (either shape)
assertThat(findDialog().getTextRecursively()).contains("€37.50");
assertThat(findDialog().getText()).contains("€37.50");
// Actual
assertThat(findDialog().getComponent().getElement().getTextRecursively())
.contains("€37.50");
Locator.inside(Locator) does let you scope a typed child lookup
(findSpan().inside(findDialog())), which covers some cases well — but it can't
express "assert over everything this container renders", and inside() isn't
mentioned anywhere an author would look (see ticket 6).
Ask. Add getText() / getTextRecursively() to locators for
container-shaped components (Dialog, ConfirmDialog, Popover, Details,
Notification, plus the layout locators from ticket 3). Alternatively expose
getElement() on the base Locator so the escape hatch is at least uniform.
Copied from https://github.com/vaadin/agentic-dx-improvement/issues/107
Problem.
SpanLocatorhasgetText().DialogLocatorhasopen(),close(),getComponent()— and no way to read what the dialog says. For amodal editor test ("the live line total shows €37.50", "the error summary lists
this message") the natural assertion is on the dialog's text, and it needs the
component:
Locator.inside(Locator)does let you scope a typed child lookup(
findSpan().inside(findDialog())), which covers some cases well — but it can'texpress "assert over everything this container renders", and
inside()isn'tmentioned anywhere an author would look (see ticket 6).
Ask. Add
getText()/getTextRecursively()to locators forcontainer-shaped components (
Dialog,ConfirmDialog,Popover,Details,Notification, plus the layout locators from ticket 3). Alternatively exposegetElement()on the baseLocatorso the escape hatch is at least uniform.Copied from https://github.com/vaadin/agentic-dx-improvement/issues/107