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

Closed
spring-issuemaster opened this issue Nov 22, 2018 · 2 comments

Comments

@spring-issuemaster
Copy link
Collaborator

@spring-issuemaster spring-issuemaster 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.

E.g. 

//*[@id]

 

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


Affects: 5.1.2

Referenced from: pull request #2023

@spring-issuemaster

This comment has been minimized.

Copy link
Collaborator Author

@spring-issuemaster spring-issuemaster commented Nov 22, 2018

Pat Turner commented

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

#2023

@rstoyanchev

This comment has been minimized.

Copy link
Contributor

@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
Projects
None yet
2 participants
You can’t perform that action at this time.