I have a case in which I request a API call via fetch/XHR (in execute async js method) grab its response and want to check that its response contains specific string.
Example:
$response = $I->executeAsyncJS(<<<JS
do fetch call/API call/XHR
wait for its response return its response as string to PHP var $response
JS
);
$I->assertContains('needle', $response);
I have made several attempts but unable to achieve the desired result. Sometimes I get errors or sometime empty array []
I have a case in which I request a API call via fetch/XHR (in execute async js method) grab its response and want to check that its response contains specific string.
Example:
I have made several attempts but unable to achieve the desired result. Sometimes I get errors or sometime empty array
[]
It would be glad if such example is provided.
Note that there is also a unanswered question on Stack Overflow