You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Matchers.hasXPath should handle valueMatcher against multiple elements #323
will not be accpeted by the assert assertThat(xml, hasXPath("/books/book/isbn", is(equalTo("B-ISBN"))));
Expected: an XML document with XPath /books/book/isbn is "B-ISBN"
but: mismatches were: [an XML document with XPath /books/book/isbn is "B-ISBN" was "A-ISBN"
But this should match because the book with B-ISBN exists.
A workaround would be to leave out the valueMatcher and put the value into the XPath assertThat(actualDocument, hasXPath("/books/book/isbn[text()='B-ISBN']"));
which will correctly match the existence but at costs of a poorly explaining error message. This makes it harder identify whether your test is broken or your system-under-test.
changed the title [-]Make hasXPath apply valueMatcher against multiple elements[/-][+]Matchers.hasXPath should handle valueMatcher against multiple elements[/+]on Jan 4, 2021
Activity
[-]Make hasXPath apply valueMatcher against multiple elements[/-][+]Matchers.hasXPath should handle valueMatcher against multiple elements[/+]night-gale commentedon Apr 25, 2021
Hi, I am currently working on this issue @nhojpatrick , and had a PR