Skip to content

assert inline multiline response #50

@staabm

Description

@staabm

the docs at https://blackfire.io/docs/player/index#visiting-a-page-with-visit mention a request notation using a long inline string:

scenario
    visit url('/login')
        method 'POST'
        body
        """
        {
            "user": "john",
            "password": "doe"
        }
        """

we tried using the very same notation for asserting the response body, but were not able to get a result without a syntax error within the config file.

could you describe a small example on how to expect body() using a long multiline response body string?

we tried things like

scenario
    visit url('/login')
        method 'POST'
        body
        """
        {
            "user": "john",
            "password": "doe"
        }
        """
        expect status_code() == 200
        expect body
        """
        {
            "status": "success"
        }
        """

and also tried

scenario
    visit url('/login')
        method 'POST'
        body
        """
        {
            "user": "john",
            "password": "doe"
        }
        """
        expect status_code() == 200
        expect body()
        """
        {
            "status": "success"
        }
        """

.. both dont work

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions