ovh / venom

🐍 Manage and run your integration tests with efficiency - Venom run executors (script, HTTP Request, web, imap, etc... ) and assertions

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Create a new assertion ShouldJsonContain for arrays

floriancazals opened this issue · comments

I have the following case, an array baz containing two elements. Each of the element is an object with the attribute attr
For example:

{
        "baz": [
                {
                        "attr": "foo"
                },
                {
                        "attr": "bar"
                }
        ]
}

I would like to make an assertion like this one

        assertions:
        - result.bodyjson.baz.attr ShouldJsonContain foo

Avoiding to have to specify the index of the array which.

Indeed the attrubute foo may be on index 1 instead of index 0 in my case.