mirror of
https://github.com/puppeteer/puppeteer
synced 2024-06-14 14:02:48 +00:00
feat(firefox): support page.setDefaultNavigationTimeout (#3969)
This patch supports: - page.setDefaultNavigationTimeout - page.setDefaultTimeout
This commit is contained in:
@@ -131,7 +131,7 @@ module.exports.addTests = function({testRunner, expect, Errors, CHROME}) {
|
||||
expect(error.message).toContain('Navigation Timeout Exceeded: 1ms');
|
||||
expect(error).toBeInstanceOf(TimeoutError);
|
||||
});
|
||||
it_fails_ffox('should fail when exceeding default maximum navigation timeout', async({page, server}) => {
|
||||
it('should fail when exceeding default maximum navigation timeout', async({page, server}) => {
|
||||
// Hang for request to the empty.html
|
||||
server.setRoute('/empty.html', (req, res) => { });
|
||||
let error = null;
|
||||
@@ -140,7 +140,7 @@ module.exports.addTests = function({testRunner, expect, Errors, CHROME}) {
|
||||
expect(error.message).toContain('Navigation Timeout Exceeded: 1ms');
|
||||
expect(error).toBeInstanceOf(TimeoutError);
|
||||
});
|
||||
it_fails_ffox('should fail when exceeding default maximum timeout', async({page, server}) => {
|
||||
it('should fail when exceeding default maximum timeout', async({page, server}) => {
|
||||
// Hang for request to the empty.html
|
||||
server.setRoute('/empty.html', (req, res) => { });
|
||||
let error = null;
|
||||
@@ -149,7 +149,7 @@ module.exports.addTests = function({testRunner, expect, Errors, CHROME}) {
|
||||
expect(error.message).toContain('Navigation Timeout Exceeded: 1ms');
|
||||
expect(error).toBeInstanceOf(TimeoutError);
|
||||
});
|
||||
it_fails_ffox('should prioritize default navigation timeout over default timeout', async({page, server}) => {
|
||||
it('should prioritize default navigation timeout over default timeout', async({page, server}) => {
|
||||
// Hang for request to the empty.html
|
||||
server.setRoute('/empty.html', (req, res) => { });
|
||||
let error = null;
|
||||
|
||||
@@ -173,13 +173,12 @@ module.exports.addTests = function({testRunner, expect, product, Errors}) {
|
||||
expect(error.message).toContain('waiting for function failed: timeout');
|
||||
expect(error).toBeInstanceOf(TimeoutError);
|
||||
});
|
||||
it_fails_ffox('should respect default timeout', async({page}) => {
|
||||
it('should respect default timeout', async({page}) => {
|
||||
page.setDefaultTimeout(1);
|
||||
let error = null;
|
||||
await page.waitForFunction('false').catch(e => error = e);
|
||||
expect(error).toBeTruthy();
|
||||
expect(error.message).toContain('waiting for function failed: timeout');
|
||||
expect(error).toBeInstanceOf(TimeoutError);
|
||||
expect(error.message).toContain('waiting for function failed: timeout');
|
||||
});
|
||||
it('should disable timeout when its set to 0', async({page}) => {
|
||||
const watchdog = page.waitForFunction(() => {
|
||||
|
||||
Reference in New Issue
Block a user