Codeception / module-rest

REST module for Codeception
MIT License
53 stars 27 forks source link

compare result of evaluated xpath expression to value #85

Closed pamoller closed 2 years ago

pamoller commented 2 years ago

See https://github.com/Codeception/Codeception/issues/6546

Evaluate Xpath and compare their values. Youn can also use the xpath count function like checking id is unique:

$this->module->seeResponseJsonXpathEvaluatesTo('count(//id) = 1', true);
Naktibalda commented 2 years ago

If count returns 1.0, then it looks like a good idea to use assertEquals

Naktibalda commented 2 years ago

In the module too.

Naktibalda commented 2 years ago

Released as 3.2.0 https://github.com/Codeception/module-rest/releases/tag/3.2.0