Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add examples to waitUntil and waitFor #750

Merged
merged 3 commits into from
Feb 5, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions API.md
Original file line number Diff line number Diff line change
Expand Up @@ -503,6 +503,12 @@ interim DOM states (e.g. loading states, pending promises, etc).

Returns **[Promise][54]<([Element][53] \| [Array][64]<[Element][53]>)>** resolves when the element(s) appear on the page

#### Examples

```javascript
await waitFor('.my-selector', { timeout: 2000 })
```

### waitUntil

Wait for the provided callback to return a truthy value.
Expand All @@ -519,6 +525,14 @@ while _not_ settled (e.g. "loading" or "pending" states).

Returns **[Promise][54]** resolves with the callback value when it returns a truthy value

#### Examples

```javascript
await waitUntil(function() {
return find('.my-selector').textContent.includes('something')
}, { timeout: 2000 })
```

### settled

Returns a promise that resolves when in a settled state (see `isSettled` for
Expand Down