-
Notifications
You must be signed in to change notification settings - Fork 78
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
Please add support for JS expectations using XPATH-like expressions or jsonpath #157
Comments
DefiantJS has a problem: it assumes it runs in a web browser. See hbi99/defiant.js#71 |
I was able to make it work with https://github.com/s3u/JSONPath , after patching it for JSONPath-Plus/JSONPath#67 . This is how it can be used:
|
Thanks I would be happy to review and possibly merge a pull request
|
I commented on the pull request - closing this issue now as we can discuss how best to implement it in the pull request comments section. thanks for the contribution |
DefiantJS allows one to use xpath-like expressions with JSON results. This is very useful with REST calls that return an array of objects and one wants to assert on a given property of a given object with a given id, for example. This involves searching in the array. See: http://defiantjs.com
I imagine the patch is to inject the DefiantJS lib. It looks like it should be done here:
Maybe a generalization of this ticket is to allow people to inject the JS libs they want to use in the snippets. This way you don't need to hardcode any specific lib.
The text was updated successfully, but these errors were encountered: