You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In certain cases, for example, if we want to verify an id or a date generated by a fixture, it would be useful to have the possibility of using methods in the response expectations the same way as in the request uri parameters or in the request body.
In this request, defined in a yaml file, I would like to expect an id in the response, but it's not possible at present:
requests:
Success (200):
uri:
base: /api/institutions/agreement-templates/{agreementTemplate}parameters:
'{agreementTemplate}': '<agreementTemplateUid("Agreement Template Ronald Reagan UCLA Medical Center", ["HU"])>'method: PUTheaders:
<<: *headersbody:
uid: '<agreementTemplateUid("Agreement Template Ronald Reagan UCLA Medical Center", ["HU"])>'name: MyAgreementTemplatefile: '<mediaIdFromName("file-not-taken.pdf")>'filename: file-not-taken.pdfgeographicalRestrictions:
- FR
- USstatusCode: 200valuesNeedsToMatch:
# This is not possible -> "[data][attributes][uid]": '<agreementTemplateUid("Agreement Template Ronald Reagan UCLA Medical Center", ["HU"])>'"[data][attributes][name]": MyAgreementTemplate"[data][attributes][filename]": file-not-taken.pdf"[data][attributes][geographicalRestrictions]":
- FR
- US"[data][relationships][media][data][attributes][name]": file-not-taken.pdf
I was not able to come up with an alternative solution. I use static values in the fixtures or I just leave out dynamic values from the response expectations.
The text was updated successfully, but these errors were encountered:
I think that's interesting, what about defining variable in the YAML then using those variable inside the response and the query. This way we'll have the ability to use those information everywhere we want.
What I've in mind is adding a root level variables entry, that will be interpreted then injected in all the relevant selection during the test execution.
In certain cases, for example, if we want to verify an id or a date generated by a fixture, it would be useful to have the possibility of using methods in the response expectations the same way as in the request uri parameters or in the request body.
In this request, defined in a yaml file, I would like to expect an id in the response, but it's not possible at present:
I was not able to come up with an alternative solution. I use static values in the fixtures or I just leave out dynamic values from the response expectations.
The text was updated successfully, but these errors were encountered: