Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

compare result of evaluated xpath expression to value #85

Merged
merged 11 commits into from Aug 13, 2022

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);

src/Codeception/Module/REST.php Show resolved Hide resolved
src/Codeception/Module/REST.php Show resolved Hide resolved
@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.

None yet

2 participants