page.waitFor should send ...args to page.waitForFunction (#775)

This lets the user pass `...args` into `page.waitFor`. It also clarifies that the docs that `options` is not optional if `...args` are specified.

Fixes #770
This commit is contained in:
JoelEinbinder
2017-09-15 14:28:15 -07:00
committed by Andrey Lushnikov
parent d562db3140
commit e2cad568d6
4 changed files with 21 additions and 14 deletions

View File

@@ -530,6 +530,9 @@ describe('Page', function() {
await page.waitFor({foo: 'bar'}).catch(e => error = e);
expect(error.message).toContain('Unsupported target type');
}));
it('should wait for predicate with arguments', SX(async function() {
await page.waitFor((arg1, arg2) => arg1 !== arg2, {}, 1, 2);
}));
});
describe('Page.Events.Console', function() {