feat: add Mouse#wheel (#6141)

This commit is contained in:
Christian Bromann
2020-07-06 09:27:17 +02:00
committed by GitHub
parent 5049b83186
commit e67a860eb0
11 changed files with 222 additions and 0 deletions

View File

@@ -173,6 +173,29 @@ describe('Mouse', function () {
throw new Error(modifiers[modifier] + ' should be false');
}
});
itFailsFirefox('should send mouse wheel events', async () => {
const { page, server } = getTestState();
await page.goto(server.PREFIX + '/input/wheel.html');
const elem = await page.$('div');
const boundingBoxBefore = await elem.boundingBox();
expect(boundingBoxBefore).toMatchObject({
width: 115,
height: 115,
});
await page.mouse.move(
boundingBoxBefore.x + boundingBoxBefore.width / 2,
boundingBoxBefore.y + boundingBoxBefore.height / 2
);
await page.mouse.wheel({ deltaY: -100 });
const boundingBoxAfter = await elem.boundingBox();
expect(boundingBoxAfter).toMatchObject({
width: 230,
height: 230,
});
});
itFailsFirefox('should tween mouse movement', async () => {
const { page } = getTestState();