Search code examples
fitnessefitnesse-slim

Can fitnesse validate non-xml output


I am using Rest Fixture with Fitnesse to make a GET request to url which returns non-xml response. Is there a way I could verify text/string (without xpath) in the content returned?


Solution

  • I found this solution. TEXT is a supported content handler along XML and JSON. It is possible to override the content handler as TEXT and expect the content. Regular expression can also be used to expect content.

    | Table:smartrics.rest.fitnesse.fixture.RestFixtureConfig | overridesContentHandlerConfig|
    | restfixture.content.handlers.map | application/smil=TEXT |
    !| Table:smartrics.rest.fitnesse.fixture.RestFixture | ${host} ||overridesContentHandlerConfig |
    | GET | www.someurl.com | 200 | | [\s\w\d<>/=\:'.]*stringtoverify[\s\w\d<>/=\:'.]* |