From 0ae73a906bb382b2766ccc81ae8515287d7258f7 Mon Sep 17 00:00:00 2001 From: Naresh Date: Sat, 6 Feb 2021 16:01:29 +0530 Subject: [PATCH] fix(android): added buttons Added new android keys for playwright-android - AppSwitch, Assist, Cut, Copy, Paste Modified a android key from 'At' to '@' Fixes #5216 --- src/dispatchers/androidDispatcher.ts | 7 ++++++- types/types.d.ts | 9 +++++++-- utils/generate_types/overrides.d.ts | 9 +++++++-- 3 files changed, 20 insertions(+), 5 deletions(-) diff --git a/src/dispatchers/androidDispatcher.ts b/src/dispatchers/androidDispatcher.ts index c98c1085e8d61..b049596fad213 100644 --- a/src/dispatchers/androidDispatcher.ts +++ b/src/dispatchers/androidDispatcher.ts @@ -281,6 +281,7 @@ const keyMap = new Map([ ['Slash', 76], ['/', 76], ['At', 77], + ['@', 77], ['Num', 78], ['HeadsetHook', 79], ['Focus', 80], @@ -288,5 +289,9 @@ const keyMap = new Map([ ['Menu', 82], ['Notification', 83], ['Search', 84], - ['RecentApps', 187], + ['AppSwitch', 187], + ['Assist', 219], + ['Cut', 277], + ['Copy', 278], + ['Paste', 279], ]); diff --git a/types/types.d.ts b/types/types.d.ts index d0bfc22c99ae6..e82c661fa6b25 100644 --- a/types/types.d.ts +++ b/types/types.d.ts @@ -7290,7 +7290,7 @@ export type AndroidKey = 'Semicolon' | ';' | 'Apostrophe' | '`' | 'Slash' | '/' | - 'At' | + 'At' | '@' | 'Num' | 'HeadsetHook' | 'Focus' | @@ -7298,7 +7298,12 @@ export type AndroidKey = 'Menu' | 'Notification' | 'Search' | - 'RecentApps'; + 'RecentApps' | + 'AppSwitch' | + 'Assist' | + 'Cut' | + 'Copy' | + 'Paste'; // This is required to not export everything by default. See https://github.com/Microsoft/TypeScript/issues/19545#issuecomment-340490459 export {}; diff --git a/utils/generate_types/overrides.d.ts b/utils/generate_types/overrides.d.ts index b6b8c30a2c1df..0f10b187c1f1a 100644 --- a/utils/generate_types/overrides.d.ts +++ b/utils/generate_types/overrides.d.ts @@ -303,7 +303,7 @@ export type AndroidKey = 'Semicolon' | ';' | 'Apostrophe' | '`' | 'Slash' | '/' | - 'At' | + 'At' | '@' | 'Num' | 'HeadsetHook' | 'Focus' | @@ -311,7 +311,12 @@ export type AndroidKey = 'Menu' | 'Notification' | 'Search' | - 'RecentApps'; + 'RecentApps' | + 'AppSwitch' | + 'Assist' | + 'Cut' | + 'Copy' | + 'Paste'; // This is required to not export everything by default. See https://github.com/Microsoft/TypeScript/issues/19545#issuecomment-340490459 export {};