Skip to content

Allow matching extracted XPath #33

Open
@Rhobal

Description

I'm trying to verify content that has been rendered in XHTML.
I can do that by looking for an XPath that contains the content, e.g.

assertThat(xhtml, XhtmlMatchers.hasXPath("//ns1:div[@id='content'][text()='Somecontent']", NS1));

However, if the structure is right but the content is wrong, I'm just informed that the XPath was not found. It would be much more comfortable, if I could add matchers to check the xpath result:

assertThat(xhtml, XhtmlMatchers.hasXPath("//ns1:div[@id='content']/text()", NS1, equalTo("Somecontent"));

An error would then show that the content that is wrong.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions