Codeception / Codeception/module-webdriver

Suggestion: Make `amOnPage()` wait for JavaScript to finish by default

Đang mở
#151 1 bình luận 0 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
PHP
Star
39
Fork
25
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

Starting point: Everybody always wants JavaScript to finish, before performing any action/assertion on the page, right?
At least my usual pattern is:
```php
$I->amOnPage('/');
$I->waitForJS('return document.readyState === "complete";', 5); // https://gist.github.com/pastuhov/43674b195dc293ffd847
```

So I thought about ways to simplify this. My first idea was to introduce a new method, something like `waitForJSToComplete()`.

But now, I think it's even better to include this in `amOnPage()`, by introducing a second parameter:
```php
public function amOnPage($page, bool $waitTillJSIsComplete = true): void
```
This would be a BC break.

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.