Skip to content

Commit

Permalink
test: add test for multiline waittask (#3753)
Browse files Browse the repository at this point in the history
References #3723
  • Loading branch information
aslushnikov committed Jan 11, 2019
1 parent f731973 commit 0505c81
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions test/waittask.spec.js
Expand Up @@ -53,6 +53,12 @@ module.exports.addTests = function({testRunner, expect, product}) {
await page.waitFor(timeout);
expect(Date.now() - startTime).not.toBeLessThan(timeout / 2);
});
it('should work with multiline body', async({page, server}) => {
const result = await page.waitForFunction(`
(() => true)()
`);
expect(await result.jsonValue()).toBe(true);
});
it('should wait for predicate', async({page, server}) => {
const watchdog = page.waitFor(() => window.innerWidth < 100);
page.setViewport({width: 10, height: 10});
Expand Down

0 comments on commit 0505c81

Please sign in to comment.