Codeception / Codeception/module-webdriver

Example of `executeAsyncJs()`

Open
#130 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
PHP
Stars
39
Forks
25
PR merge metrics
No merged PRs in 30d

Description

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:

```php
$response = $I->executeAsyncJS(<<assertContains('needle', $response);
```

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](https://stackoverflow.com/questions/60108844/get-a-response-from-codeception-i-executeasyncjs)

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.