Skip to content

Commit 4c3caaa

Browse files
authored
chore: re-enable tests for Firefox related to fixed Input.dispatchMouseEvent issues (#7776)
Issues: #7115
1 parent 9f9b4ed commit 4c3caaa

3 files changed

Lines changed: 32 additions & 41 deletions

File tree

test/click.spec.ts

Lines changed: 17 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -238,8 +238,7 @@ describe('Page.click', function () {
238238
)
239239
).toBe('clicked');
240240
});
241-
// See https://github.com/puppeteer/puppeteer/issues/7175
242-
itFailsFirefox('should double click the button', async () => {
241+
it('should double click the button', async () => {
243242
const { page, server } = getTestState();
244243

245244
await page.goto(server.PREFIX + '/input/button.html');
@@ -292,7 +291,7 @@ describe('Page.click', function () {
292291
// This await should not hang.
293292
await page.click('a');
294293
});
295-
itFailsFirefox('should click the button inside an iframe', async () => {
294+
it('should click the button inside an iframe', async () => {
296295
const { page, server } = getTestState();
297296

298297
await page.goto(server.EMPTY_PAGE);
@@ -328,25 +327,20 @@ describe('Page.click', function () {
328327
await frame.click('button');
329328
expect(await frame.evaluate(() => globalThis.result)).toBe('Clicked');
330329
});
331-
itFailsFirefox(
332-
'should click the button with deviceScaleFactor set',
333-
async () => {
334-
const { page, server } = getTestState();
330+
it('should click the button with deviceScaleFactor set', async () => {
331+
const { page, server } = getTestState();
335332

336-
await page.setViewport({ width: 400, height: 400, deviceScaleFactor: 5 });
337-
expect(await page.evaluate(() => window.devicePixelRatio)).toBe(5);
338-
await page.setContent(
339-
'<div style="width:100px;height:100px">spacer</div>'
340-
);
341-
await utils.attachFrame(
342-
page,
343-
'button-test',
344-
server.PREFIX + '/input/button.html'
345-
);
346-
const frame = page.frames()[1];
347-
const button = await frame.$('button');
348-
await button.click();
349-
expect(await frame.evaluate(() => globalThis.result)).toBe('Clicked');
350-
}
351-
);
333+
await page.setViewport({ width: 400, height: 400, deviceScaleFactor: 5 });
334+
expect(await page.evaluate(() => window.devicePixelRatio)).toBe(5);
335+
await page.setContent('<div style="width:100px;height:100px">spacer</div>');
336+
await utils.attachFrame(
337+
page,
338+
'button-test',
339+
server.PREFIX + '/input/button.html'
340+
);
341+
const frame = page.frames()[1];
342+
const button = await frame.$('button');
343+
await button.click();
344+
expect(await frame.evaluate(() => globalThis.result)).toBe('Clicked');
345+
});
352346
});

test/elementhandle.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ describe('ElementHandle specs', function () {
258258
});
259259

260260
describe('ElementHandle.hover', function () {
261-
itFailsFirefox('should work', async () => {
261+
it('should work', async () => {
262262
const { page, server } = getTestState();
263263

264264
await page.goto(server.PREFIX + '/input/scrollable.html');

test/mouse.spec.ts

Lines changed: 14 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ describe('Mouse', function () {
7171
expect(event.isTrusted).toBe(true);
7272
expect(event.button).toBe(0);
7373
});
74-
itFailsFirefox('should resize the textarea', async () => {
74+
it('should resize the textarea', async () => {
7575
const { page, server } = getTestState();
7676

7777
await page.goto(server.PREFIX + '/input/textarea.html');
@@ -87,7 +87,7 @@ describe('Mouse', function () {
8787
expect(newDimensions.width).toBe(Math.round(width + 104));
8888
expect(newDimensions.height).toBe(Math.round(height + 104));
8989
});
90-
itFailsFirefox('should select the text with mouse', async () => {
90+
it('should select the text with mouse', async () => {
9191
const { page, server } = getTestState();
9292

9393
await page.goto(server.PREFIX + '/input/textarea.html');
@@ -220,23 +220,20 @@ describe('Mouse', function () {
220220
]);
221221
});
222222
// @see https://crbug.com/929806
223-
itFailsFirefox(
224-
'should work with mobile viewports and cross process navigations',
225-
async () => {
226-
const { page, server } = getTestState();
223+
it('should work with mobile viewports and cross process navigations', async () => {
224+
const { page, server } = getTestState();
227225

228-
await page.goto(server.EMPTY_PAGE);
229-
await page.setViewport({ width: 360, height: 640, isMobile: true });
230-
await page.goto(server.CROSS_PROCESS_PREFIX + '/mobile.html');
231-
await page.evaluate(() => {
232-
document.addEventListener('click', (event) => {
233-
globalThis.result = { x: event.clientX, y: event.clientY };
234-
});
226+
await page.goto(server.EMPTY_PAGE);
227+
await page.setViewport({ width: 360, height: 640, isMobile: true });
228+
await page.goto(server.CROSS_PROCESS_PREFIX + '/mobile.html');
229+
await page.evaluate(() => {
230+
document.addEventListener('click', (event) => {
231+
globalThis.result = { x: event.clientX, y: event.clientY };
235232
});
233+
});
236234

237-
await page.mouse.click(30, 40);
235+
await page.mouse.click(30, 40);
238236

239-
expect(await page.evaluate('result')).toEqual({ x: 30, y: 40 });
240-
}
241-
);
237+
expect(await page.evaluate('result')).toEqual({ x: 30, y: 40 });
238+
});
242239
});

0 commit comments

Comments
 (0)