From f19732f37a1a00b4792df14f6682fa5bd433ebca Mon Sep 17 00:00:00 2001 From: kirillzyusko Date: Tue, 7 May 2024 18:52:04 +0200 Subject: [PATCH] fix: e2e tests flakiness (due to permission popup) --- tests/e2e/utils/installApp.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/e2e/utils/installApp.ts b/tests/e2e/utils/installApp.ts index dc6a9d64053f..82d0066c885b 100644 --- a/tests/e2e/utils/installApp.ts +++ b/tests/e2e/utils/installApp.ts @@ -19,7 +19,8 @@ export default function (packageName: string, path: string, platform = 'android' // Ignore errors Logger.warn('Failed to uninstall app:', error.message); }) + // install and grant push notifications permissions right away (the popup may block e2e tests sometimes) // eslint-disable-next-line @typescript-eslint/no-misused-promises - .finally(() => execAsync(`adb install ${path}`)) + .finally(() => execAsync(`adb install ${path}`).then(() => execAsync(`adb shell pm grant ${packageName.split('/')[0]} android.permission.POST_NOTIFICATIONS`))) ); }