Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

XpathResultMatchers to support Hamcrest Matcher<NodeList> [SPR-17529] #22061

spring-projects-issues opened this issue Nov 22, 2018 · 2 comments
in: test status: superseded type: enhancement


Copy link

@spring-projects-issues spring-projects-issues commented Nov 22, 2018

Pat Turner opened SPR-17529 and commented

While org.springframework.test.web.servlet.result.XpathResultMatchers supports Hamcrest matcher against a single org.w3c.dom.Node, it doesn't allow matching against multiple nodes via the org.w3c.dom.NodeList.


Suggest addition of a new ResultMatcher method in XpathResultMatchers and supporting XpathExpectationsHelper:

public ResultMatcher nodeList(final Matcher<? super NodeList> matcher)


My motivation for this is to allow checking that XHTML element IDs are unique across the document, and to do this, I need to match all elements with an ID.




Happy to contribute if you think this is worthwhile adding to framework.

Affects: 5.1.2

Referenced from: pull request #2023

Copy link
Collaborator Author

@spring-projects-issues spring-projects-issues commented Nov 22, 2018

Pat Turner commented

Maybe jumping the gun, but I've submitted a pull request with my proposed change:


@spring-projects-issues spring-projects-issues added in: test type: enhancement labels Jan 11, 2019
@spring-projects-issues spring-projects-issues added this to the 5.x Backlog milestone Jan 11, 2019
@rstoyanchev rstoyanchev self-assigned this Nov 11, 2019
@rstoyanchev rstoyanchev added the status: superseded label Nov 11, 2019
@rstoyanchev rstoyanchev removed this from the 5.x Backlog milestone Nov 11, 2019
Copy link

@rstoyanchev rstoyanchev commented Nov 11, 2019

This is superseded by #2023.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
in: test status: superseded type: enhancement
None yet

No branches or pull requests

2 participants