Currently stepler uses step execution results as output provider without any processing (only json_encode in controller which is not so flexible).
What can be done is that we can add ResultCollector component, which will support custom filters for step results and so on:
class FeatureContext implements KernelAwareInterface, ResultCollectorAware
{
public function setResultCollector(ResultCollector $results)
{
$this->results = $results;
$this->results->resultsProcessor(function ($result, array $options) {
// options can be used for configuring JMS serializer context or something like that.
return $this->container->get('jms_serailizer')->serialize($result);
});
}
/**
* @Givne I have registered user
* @CollectResult(options={"groups": {"profile", "friends"}})
*/
function iHaveRegisteredUser()
{
$user = $this->container->get('user_registrator')->registerUser();
return $user;
}
}
Also it would be nice to collect all results by default with ability to register custom filters in config...
Currently stepler uses step execution results as output provider without any processing (only
json_encodein controller which is not so flexible).What can be done is that we can add
ResultCollectorcomponent, which will support custom filters for step results and so on:Also it would be nice to collect all results by default with ability to register custom filters in config...