-
-
Notifications
You must be signed in to change notification settings - Fork 403
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
Assertions using json schema v3 or v4 #126
Comments
This feature looks interesting. Do we have it already? @dinesh76in |
Are we having Json Schema validation or we have to include it from scratch. |
Currently it does a kind of schema validation(data types, values etc at basic level) with respect to the response it receives from the API. But it doesn't do a validation against an external schema file. Also there is no mechanism currently to pass an external schema file name to the DSL/framework. If you are trying to implement this external file based validation, it will be a nice feature and very helpful for the automation journey. |
Ok so i will be working on this. Could you also provide with some test case from your side. |
This comment was marked as resolved.
This comment was marked as resolved.
Hello @Yash-cor , appreciate you're trying trying to dev this. I think we need a schema file against which the response can be validated, it should be W3 standard imo. |
This is the link of the PR that i've raised. |
Hello I've raised PR and attached the link above. |
Apologies for late reply @Yash-cor . Now I have captured the ACs(see AC2 mostly) , have a look please. Also, don't delete this current PR. Keep it as it is and do not change it. You can decline or close to avoid accidental merge if that's allowed). |
AC1:
GIVEN-The JSON
schema
of the API responseWHEN-I assert the API response using the schema with version as parameter
THEN-I should be able to get the desired result as PASS or FAIL to determine the test status.
AND-If failed, it should display or log(WARN or ERROR level) list the failure reasons in a pretty format.
AC2:
Have mechanism to pass the Schema file for the API response in the DSL.
Note:
"responseSchema" : (* new field which you can introduce) : Keep it optional. If supplied by the user, only then validate against it(the "body" of the response).
I think only the "body" should match the Schema definition, right?
Definitely not the "status" I mean. Have a look at the Schema definition file.
If yes, then implement the field as "responseBodySchema" (instead of "responseSchema")
Example:
AC3: (Future purpose - Implement via a new ticket if there is a Usecase for this, otherwise not needed now as AC2 shd cover most usecases)
GIVEN-I want to assert the API response using a given
schema
of v3 or v4(parameterised)WHEN-I receive the API response
THEN-I should be able to get the desired result as PASS or FAIL to determine the test status
The text was updated successfully, but these errors were encountered: