Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

assert http response body against files #48

Open
staabm opened this issue Dec 4, 2019 · 8 comments
Open

assert http response body against files #48

staabm opened this issue Dec 4, 2019 · 8 comments

Comments

@staabm
Copy link

staabm commented Dec 4, 2019

I wasnt able to find a example which shows how it is possible to assert a expected http response body against the contents of a local file.

I imagine something like

scenario
    visit url('/blog/')
        name "Blog homepage"
        assert main.peak_memory < 10M
        expect body() == file(/my/local/file/with/expected.html)

IMO this would enhance readability of my test-scenario file, as I dont have huge blobs of html in them (and maybe might even allow me to generated the expected http response body using other tools)
Is this kind of operation supported?

@fabpot
Copy link
Member

fabpot commented Dec 5, 2019

That's currently not possible. I'm working on implementing it though :)

@staabm
Copy link
Author

staabm commented Dec 5, 2019

It would also be great to use this local-file "thing" as a request body, not as an response assertion only feature.

@staabm
Copy link
Author

staabm commented Jan 7, 2020

any progress on this feature?

@fabpot
Copy link
Member

fabpot commented Jan 10, 2020

@staabm Implemented now. Waiting for reviews, merge, and release. Should happen in the next couple of weeks I would say.

@fabpot
Copy link
Member

fabpot commented Jan 10, 2020

/cc @iamluc

@romainneutron
Copy link
Member

@staabm It's been implemented as of 27fb227
Could you have a look and tell us if it fulfills your needs?

@staabm
Copy link
Author

staabm commented Feb 5, 2020

thx for noticing.

how to install the current dev-build? I am still getting the 1.7.0 build via curl -OLsS https://get.blackfire.io/blackfire-player.phar

@staabm
Copy link
Author

staabm commented Feb 5, 2020

is it also supported to provide the request body with this feature?

in curl e.g. I am using:

#!/bin/bash
blackfire curl \
    -H "Content-Type: text/xml; charset=utf-8" \
    -H "Accept: application/xml" \
    -d @artikel_request_6_sku.xml \
    -X POST https://myhost.com/example/url/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants