contexts icon indicating copy to clipboard operation
contexts copied to clipboard

behatch json with drupal extension

Open Trogie opened this issue 10 years ago • 2 comments

Hello,

Im trying to make a scenario where I first have to do some drupal things (with the drupal extension for behat) and after that check the output of a json call.

The problem is that I need a browser for the drupal things and then the call doesnt get validated as correct json in the browser (ff, chrome, ie,...)

Anybody a solution?

Trogie avatar Jul 15 '15 12:07 Trogie

Looks like every browser is putting html tags in front and after the json... As the Json class constructor is decoding the json string this always fails...

I tried to add a strip_tags in the contstructor but then I'll have problems as some json call I have to test include html from time to time.

Trogie avatar Jul 16 '15 08:07 Trogie

I've combined them without noticing a problem. I perform Drupal operations via the DrupalContext, and retrieve via the RestContext/JsonContext. In some cases, I've created custom steps using cross-context requests.

grayside avatar Jun 21 '16 01:06 grayside