_generated\AcceptanceTesterActions::seeResponseJsonMatchesXpath PHP Method

seeResponseJsonMatchesXpath() public method

Checks if json structure in response matches the xpath provided. JSON is not supposed to be checked against XPath, yet it can be converted to xml and used with XPath. This assertion allows you to check the structure of response json. * json { "store": { "book": [ { "category": "reference", "author": "Nigel Rees", "title": "Sayings of the Century", "price": 8.95 }, { "category": "fiction", "author": "Evelyn Waugh", "title": "Sword of Honour", "price": 12.99 } ], "bicycle": { "color": "red", "price": 19.95 } } } php seeResponseJsonMatchesXpath('//store/book/author'); first book in store has author $I->seeResponseJsonMatchesXpath('//store/book[1]/author'); at least one item in store has price $I->seeResponseJsonMatchesXpath('/store//price'); ?>
See also: Codeception\Module\REST::seeResponseJsonMatchesXpath()
public seeResponseJsonMatchesXpath ( $xpath )
    public function seeResponseJsonMatchesXpath($xpath)
    {
        return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeResponseJsonMatchesXpath', func_get_args()));
    }
AcceptanceTesterActions