test: apply test workaround only for Firefox (#12552)

This commit is contained in:
Alex Rudenko 2024-06-07 14:50:42 +02:00 committed by GitHub
parent de42e20d85
commit b74addd452
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -223,7 +223,7 @@ describe('Mouse', function () {
});
});
it('should set ctrlKey on the wheel event', async () => {
const {page, server} = await getTestState();
const {page, server, isFirefox} = await getTestState();
await page.goto(server.EMPTY_PAGE);
const ctrlKey = page.evaluate(() => {
return new Promise(resolve => {
@ -242,7 +242,9 @@ describe('Mouse', function () {
await page.mouse.wheel({deltaY: -100});
// Scroll back to work around
// https://bugzilla.mozilla.org/show_bug.cgi?id=1901211.
await page.mouse.wheel({deltaY: 100});
if (isFirefox) {
await page.mouse.wheel({deltaY: 100});
}
await page.keyboard.up('Control');
expect(await ctrlKey).toBeTruthy();
});