Given a list of DOM nodes with texts, we'd like to assert that the texts of the elements matches an array of strings we have in Java.
For attributes, there is extractingAttribute which makes this easy for attributes.
We'd like to have an extractingText there to do the same for element texts.
We would like to write the following test (we are testing an XSL-FO document):
assertThat(letterDocument)
.withNamespaceContext(XSL_FO_NAMESPACE_CONTEXT)
.nodesByXPath("//fo:block[@id='recipient-address']/fo:block")
.extractingText()
.containsExactly("John Doo",
"Street 213423",
"2944 AA Amsterdam",
"The Netherlands");
So far I am unable to write well-written assertions to test this.
Maybe I am missing something?
Would you accept a PR for such an extractingText() method?
Given a list of DOM nodes with texts, we'd like to assert that the texts of the elements matches an array of strings we have in Java.
For attributes, there is extractingAttribute which makes this easy for attributes.
We'd like to have an
extractingTextthere to do the same for element texts.We would like to write the following test (we are testing an XSL-FO document):
So far I am unable to write well-written assertions to test this.
Maybe I am missing something?
Would you accept a PR for such an extractingText() method?