mirror of
https://github.com/puppeteer/puppeteer
synced 2024-06-14 14:02:48 +00:00
test: cleanup tests (#4078)
- move Connection test into CDPSession.spec.js - remove a nasty test that was reaching into implementation details
This commit is contained in:
parent
dae998ec06
commit
e8a49633d9
@ -69,5 +69,15 @@ module.exports.addTests = function({testRunner, expect}) {
|
||||
}
|
||||
expect(error.message).toContain('Session closed.');
|
||||
});
|
||||
it('should throw nice errors', async function({page}) {
|
||||
const client = await page.target().createCDPSession();
|
||||
const error = await theSourceOfTheProblems().catch(error => error);
|
||||
expect(error.stack).toContain('theSourceOfTheProblems');
|
||||
expect(error.message).toContain('ThisCommand.DoesNotExist');
|
||||
|
||||
async function theSourceOfTheProblems() {
|
||||
await client.send('ThisCommand.DoesNotExist');
|
||||
}
|
||||
});
|
||||
});
|
||||
};
|
||||
|
@ -34,16 +34,5 @@ module.exports.addTests = function({testRunner, expect}) {
|
||||
return promise.then(() => reader.result);
|
||||
}, input)).toBe('contents of the file');
|
||||
});
|
||||
it_fails_ffox('keyboard.modifiers()', async({page, server}) => {
|
||||
const keyboard = page.keyboard;
|
||||
expect(keyboard._modifiers).toBe(0);
|
||||
await keyboard.down('Shift');
|
||||
expect(keyboard._modifiers).toBe(8);
|
||||
await keyboard.down('Alt');
|
||||
expect(keyboard._modifiers).toBe(9);
|
||||
await keyboard.up('Shift');
|
||||
await keyboard.up('Alt');
|
||||
expect(keyboard._modifiers).toBe(0);
|
||||
});
|
||||
});
|
||||
};
|
||||
|
@ -1078,17 +1078,6 @@ module.exports.addTests = function({testRunner, expect, headless, Errors, Device
|
||||
});
|
||||
});
|
||||
|
||||
describe_fails_ffox('Connection', function() {
|
||||
it('should throw nice errors', async function({page}) {
|
||||
const error = await theSourceOfTheProblems().catch(error => error);
|
||||
expect(error.stack).toContain('theSourceOfTheProblems');
|
||||
expect(error.message).toContain('ThisCommand.DoesNotExist');
|
||||
async function theSourceOfTheProblems() {
|
||||
await page._client.send('ThisCommand.DoesNotExist');
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
describe('Page.Events.Close', function() {
|
||||
it('should work with window.close', async function({ page, context, server }) {
|
||||
const newPagePromise = new Promise(fulfill => context.once('targetcreated', target => fulfill(target.page())));
|
||||
|
Loading…
Reference in New Issue
Block a user