Skip to content

Conversation

pamoller
Copy link
Contributor

@pamoller pamoller commented Aug 9, 2022

See Codeception/Codeception#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 Naktibalda requested a review from DavertMik August 11, 2022 12:22
@pamoller pamoller requested a review from Naktibalda August 11, 2022 14:01
@Naktibalda
Copy link
Member

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

@Naktibalda
Copy link
Member

In the module too.

because float can be returned when integer is expected
@Naktibalda Naktibalda merged commit 2535889 into Codeception:master Aug 13, 2022
@Naktibalda
Copy link
Member

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants