Skip to content

Commit

Permalink
waitFor -> one line
Browse files Browse the repository at this point in the history
  • Loading branch information
jperl committed Mar 10, 2020
1 parent 0704395 commit bdc549b
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions docs/docs/add_assertions.md
Expand Up @@ -10,9 +10,7 @@ In this guide we show you how to add assertions to your tests. We assume that yo
- [Use the Playwright API](#use-the-playwright-api) to create assertions:

```js
await page.waitFor(() => {
return document.body.innerText.includes('Clear completed');
});
await page.waitFor(() => document.body.innerText.includes('Clear completed'));

await page.waitFor(() => !document.querySelector('.todo-list li'));
```
Expand All @@ -38,9 +36,7 @@ test('myFirstTest', async () => {
await page.press(selectors['2_what_needs_to_b_input'], 'Enter');
await page.click(selectors['3_input']);
// custom code starts
await page.waitFor(() => {
return document.body.innerText.includes('Clear completed');
});
await page.waitFor(() => document.body.innerText.includes('Clear completed'));
// custom code ends
await page.click(selectors['4_button']);
});
Expand All @@ -63,9 +59,7 @@ test('myFirstTest', async () => {
await page.press(selectors['2_what_needs_to_b_input'], 'Enter');
await page.click(selectors['3_input']);
// custom code starts
await page.waitFor(() => {
return document.body.innerText.includes('Clear completed');
});
await page.waitFor(() => document.body.innerText.includes('Clear completed'));
// custom code ends
await page.click(selectors['4_button']);
// custom code starts
Expand Down

0 comments on commit bdc549b

Please sign in to comment.