parent
22fa00a7b3
commit
cfc0571c1a
@ -836,8 +836,10 @@ class WaitTask {
|
||||
});
|
||||
// Since page navigation requires us to re-install the pageScript, we should track
|
||||
// timeout on our end.
|
||||
if (timeout)
|
||||
this._timeoutTimer = setTimeout(() => this.terminate(new Error(`waiting for ${title} failed: timeout ${timeout}ms exceeded`)), timeout);
|
||||
if (timeout) {
|
||||
const timeoutError = new Error(`waiting for ${title} failed: timeout ${timeout}ms exceeded`);
|
||||
this._timeoutTimer = setTimeout(() => this.terminate(timeoutError), timeout);
|
||||
}
|
||||
this.rerun();
|
||||
}
|
||||
|
||||
|
@ -332,6 +332,11 @@ module.exports.addTests = function({testRunner, expect}) {
|
||||
await page.setContent(`<div class='zombo'>anything</div>`);
|
||||
expect(await page.evaluate(x => x.textContent, await waitForSelector)).toBe('anything');
|
||||
});
|
||||
it('should have correct stack trace for timeout', async({page, server}) => {
|
||||
let error;
|
||||
await page.waitForSelector('.zombo', {timeout: 10}).catch(e => error = e);
|
||||
expect(error.stack).toContain('frame.spec.js');
|
||||
});
|
||||
});
|
||||
|
||||
describe('Frame.waitForXPath', function() {
|
||||
|
Loading…
Reference in New Issue
Block a user