Codeception / Codeception/module-webdriver

Example of `executeAsyncJs()`

未關閉
#130 0 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視
主要語言
PHP
星號
39
分支
25
PR 合併指標
30 天內沒有已合併 PR

描述

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)

貢獻指南

這個儲存庫沒有索引到貢獻指南

研究方向

Start with the executeAsyncJS() entry point and the linked Stack Overflow question to understand the expected asynchronous return value. Add a documentation example showing a fetch, XHR, or API response returned to PHP and checked with assertContains(); the example should avoid errors and empty-array results.

由索引模型根據 Issue 內容生成。

評估

技術堆疊
javascript, php
領域
documentation, testing
Issue 類型
文件
難度
2/5
預估耗時
1-3 小時
活躍度
停滯
描述清晰度
基本清楚
新手友好度
38/100

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。