Skip to content

Create a new assertion ShouldJsonContain for arrays #746

@floriancazals

Description

@floriancazals

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions