NickMitricka
6 years agoOccasional Contributor
ReadyAPI 2.8 - Using Smart Assertion for data coming in different order
I'm testing a webservice that has the potential to return values in different order depending on execution.
Example below shows an array for the email object, where email[0] is not always the type = home.
{ "emails" : [ { "type" : "home", "value" : "testEmailHome@gmail.com" }, { "type" : "work", "value" : "testEmailWork@gmail.com", "primary" : true } ] }
Is it possible to utilize Smart Assertions to validate this scenario:
emails[*][type] == "home" emails[*][type] == "work"
I know that I should always get 2 emails, but need to validate I'm getting one with type==work and one with type==home.
*Note - I know this can be done with other assertions, but I'm curious specifically about the Smart Assertion feature.