Add test to reproduce handing touch events (#208)

References #161.
This commit is contained in:
Andrey Lushnikov 2017-08-03 22:51:51 -07:00 committed by GitHub
parent 13327f3303
commit af2b790227

View File

@ -918,6 +918,13 @@ describe('Page', function() {
expect(error.message).toBe('No node found for selector: button.does-not-exist'); expect(error.message).toBe('No node found for selector: button.does-not-exist');
} }
})); }));
// @see https://github.com/GoogleChrome/puppeteer/issues/161
xit('should not hang with touch-enabled viewports', SX(async function() {
await page.setViewport(iPhone.viewport);
await page.mouse.down();
await page.mouse.move(100, 10);
await page.mouse.up();
}));
it('should type into the textarea', SX(async function() { it('should type into the textarea', SX(async function() {
await page.navigate(PREFIX + '/input/textarea.html'); await page.navigate(PREFIX + '/input/textarea.html');
await page.focus('textarea'); await page.focus('textarea');
@ -1159,6 +1166,7 @@ describe('Page', function() {
await page.press('a'); await page.press('a');
expect(await page.evaluate(() => window.lastEvent.repeat)).toBe(true); expect(await page.evaluate(() => window.lastEvent.repeat)).toBe(true);
})); }));
// @see https://github.com/GoogleChrome/puppeteer/issues/206
xit('should click links which cause navigation', SX(async function() { xit('should click links which cause navigation', SX(async function() {
await page.setContent(`<a href="${EMPTY_PAGE}">empty.html</a>`); await page.setContent(`<a href="${EMPTY_PAGE}">empty.html</a>`);
// This await should not hang. // This await should not hang.