Behat / CommonContexts

Common FeatureContext classes for Behat
116 stars 34 forks source link

implement some rudiment json part test #47

Closed dready closed 5 years ago

dready commented 11 years ago

while testing a list resource (get all items) i found it hard to check if specific parts of items are present. The simple theResponseShouldContainJson does not allow you to check for part of the data and the theResponseShouldContain does not work well with json data structure.

this allows you to use a PyStringNode to check for. It is not perfect but works for me.

For Example: And response should contain data: """ {"foo":null,"bar":null,"baz":1,"text":"My good text","description":null,"id":1} """

Theoretically you can test any data with it, not just json (no parsing/decoding included)