player
player copied to clipboard
assert http response body against files
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?
That's currently not possible. I'm working on implementing it though :)
It would also be great to use this local-file "thing" as a request body, not as an response assertion only feature.
any progress on this feature?
@staabm Implemented now. Waiting for reviews, merge, and release. Should happen in the next couple of weeks I would say.
/cc @iamluc
@staabm It's been implemented as of 27fb22764a62e58bbaf5c5ab6fa5ca687b71f76f Could you have a look and tell us if it fulfills your needs?
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
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/