feat(firefox): roll FF Stable & Beta to 1433 (#28543)

Fixes #28495
This commit is contained in:
Andrey Lushnikov 2023-12-08 10:48:44 -08:00 committed by GitHub
parent 736c0efd43
commit 8d3a931377
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 17 additions and 27 deletions

View File

@ -21,19 +21,19 @@
}, },
{ {
"name": "firefox", "name": "firefox",
"revision": "1430", "revision": "1433",
"installByDefault": true, "installByDefault": true,
"browserVersion": "120.0.1" "browserVersion": "120.0.1"
}, },
{ {
"name": "firefox-asan", "name": "firefox-asan",
"revision": "1430", "revision": "1433",
"installByDefault": false, "installByDefault": false,
"browserVersion": "120.0.1" "browserVersion": "120.0.1"
}, },
{ {
"name": "firefox-beta", "name": "firefox-beta",
"revision": "1430", "revision": "1433",
"installByDefault": false, "installByDefault": false,
"browserVersion": "121.0b8" "browserVersion": "121.0b8"
}, },

View File

@ -62,10 +62,6 @@ export class RawKeyboardImpl implements input.RawKeyboard {
} }
async keydown(modifiers: Set<types.KeyboardModifier>, code: string, keyCode: number, keyCodeWithoutLocation: number, key: string, location: number, autoRepeat: boolean, text: string | undefined): Promise<void> { async keydown(modifiers: Set<types.KeyboardModifier>, code: string, keyCode: number, keyCodeWithoutLocation: number, key: string, location: number, autoRepeat: boolean, text: string | undefined): Promise<void> {
if (code === 'MetaLeft')
code = 'OSLeft';
if (code === 'MetaRight')
code = 'OSRight';
// Firefox will figure out Enter by itself // Firefox will figure out Enter by itself
if (text === '\r') if (text === '\r')
text = ''; text = '';
@ -81,10 +77,6 @@ export class RawKeyboardImpl implements input.RawKeyboard {
} }
async keyup(modifiers: Set<types.KeyboardModifier>, code: string, keyCode: number, keyCodeWithoutLocation: number, key: string, location: number): Promise<void> { async keyup(modifiers: Set<types.KeyboardModifier>, code: string, keyCode: number, keyCodeWithoutLocation: number, key: string, location: number): Promise<void> {
if (code === 'MetaLeft')
code = 'OSLeft';
if (code === 'MetaRight')
code = 'OSRight';
await this._client.send('Page.dispatchKeyEvent', { await this._client.send('Page.dispatchKeyEvent', {
type: 'keyup', type: 'keyup',
key, key,

View File

@ -326,6 +326,16 @@ it('should handle selectAll', async ({ page, server, isMac }) => {
expect(await page.$eval('textarea', textarea => textarea.value)).toBe(''); expect(await page.$eval('textarea', textarea => textarea.value)).toBe('');
}); });
it('pressing Meta should not result in any text insertion on any platform', async ({ page, server, isMac }) => {
it.info().annotations.push({ type: 'issue', description: 'https://github.com/microsoft/playwright/issues/28495' });
await page.setContent('<input type="text" value="hello world">');
const input = page.locator('input');
await expect(input).toHaveValue('hello world');
await input.focus();
await page.keyboard.press('Meta');
await expect(input).toHaveValue('hello world');
});
it('should be able to prevent selectAll', async ({ page, server, isMac }) => { it('should be able to prevent selectAll', async ({ page, server, isMac }) => {
await page.goto(server.PREFIX + '/input/textarea.html'); await page.goto(server.PREFIX + '/input/textarea.html');
const textarea = await page.$('textarea'); const textarea = await page.$('textarea');
@ -358,25 +368,13 @@ it('should support MacOS shortcuts', async ({ page, server, platform, browserNam
expect(await page.$eval('textarea', textarea => textarea.value)).toBe('some '); expect(await page.$eval('textarea', textarea => textarea.value)).toBe('some ');
}); });
it('should press the meta key', async ({ page, browserName, isMac, browserMajorVersion }) => { it('should press the meta key', async ({ page }) => {
const lastEvent = await captureLastKeydown(page); const lastEvent = await captureLastKeydown(page);
await page.keyboard.press('Meta'); await page.keyboard.press('Meta');
const { key, code, metaKey } = await lastEvent.jsonValue(); const { key, code, metaKey } = await lastEvent.jsonValue();
if (browserName === 'firefox' && !isMac) expect(key).toBe('Meta');
expect(key).toBe('OS'); expect(code).toBe('MetaLeft');
else expect(metaKey).toBe(true);
expect(key).toBe('Meta');
if (browserName === 'firefox' && browserMajorVersion <= 117)
expect(code).toBe('OSLeft');
else
expect(code).toBe('MetaLeft');
if (browserName === 'firefox' && !isMac)
expect(metaKey).toBe(false);
else
expect(metaKey).toBe(true);
}); });
it('should work with keyboard events with empty.html', async ({ page, server }) => { it('should work with keyboard events with empty.html', async ({ page, server }) => {