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-projects-issues opened this issue Nov 22, 2018 · 2 comments
Assignees
Labels
in: test Issues in the test module status: superseded An issue that has been superseded by another type: enhancement A general enhancement

Comments

@spring-projects-issues
Copy link
Collaborator

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-projects-issues
Copy link
Collaborator Author

Pat Turner commented

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

#2023

@spring-projects-issues spring-projects-issues added in: test Issues in the test module type: enhancement A general 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 An issue that has been superseded by another label Nov 11, 2019
@rstoyanchev rstoyanchev removed this from the 5.x Backlog milestone Nov 11, 2019
@rstoyanchev
Copy link
Contributor

This is superseded by #2023.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: test Issues in the test module status: superseded An issue that has been superseded by another type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

2 participants