How to fix the behavior sendAjaxPostRequest()?

Hi all. Write functional test under YII2, for "clicking" the button using sendAjaxPostRequest():
$I->sendAjaxPostRequest('/some/action', ['id' => $id]);
$I->amOnPage('/');
$I->seeElement('body');

In the end, the test crashes:
Test tests\functional\myСest.php:tryToTest
See Step element "body"
Fail Element located either by name, CSS or XPath of element with 'body' was not found.

After sendAjaxPostRequest() all the pages begin to read in a json string. Example output myСest.php.tryToTest.fail.html:
"<!DOCTYPE html>\r\n<html lang=\"EN-us\">\r\n <head>\r\n <meta charset=\"UTF-8\">\r\n... "

Please tell me how to get the behaviour of test to normal view? Thanks in advance.
April 3rd 20 at 17:31
0 answer

Find more questions by tags YiiCodeception