From 234c5ce6053b69742330358c3bc7854a6c9d8796 Mon Sep 17 00:00:00 2001 From: Miklos Mandoki Date: Tue, 7 Apr 2026 15:15:53 +1000 Subject: [PATCH 1/2] fix: click whatever you can on chrome first open sometimes the account use screen has been processed but the notifications screen has not --- run/test/utils/handle_first_open.ts | 32 +++++++++++++++++++---------- 1 file changed, 21 insertions(+), 11 deletions(-) diff --git a/run/test/utils/handle_first_open.ts b/run/test/utils/handle_first_open.ts index aee80a8bc..54bcb4fb5 100644 --- a/run/test/utils/handle_first_open.ts +++ b/run/test/utils/handle_first_open.ts @@ -2,19 +2,29 @@ import { DeviceWrapper } from '../../types/DeviceWrapper'; import { ChromeNotificationsNegativeButton, ChromeUseWithoutAnAccount } from '../locators/browsers'; import { iOSPhotosContinuebutton } from '../locators/external'; -// First time open of Chrome triggers an account check and a notifications modal +// First time open of Chrome triggers an account check and a notifications modal. +// If the account check appears, notifications will follow after dismissing it (not detectable upfront). +// If someone already pressed the "Use without an account" button, only the notifications prompt may appear. export async function handleChromeFirstTimeOpen(device: DeviceWrapper) { - const chromeUseWithoutAnAccount = await device.doesElementExist({ - ...new ChromeUseWithoutAnAccount(device).build(), - maxWait: 5_000, - }); - if (!chromeUseWithoutAnAccount) { - device.log('Chrome opened without an account check, proceeding'); - } else { - device.log( - 'Chrome has been opened for the first time, dismissing account use and notifications' - ); + const [useWithoutAccount, notifications] = await Promise.all([ + device.doesElementExist({ ...new ChromeUseWithoutAnAccount(device).build(), maxWait: 5_000 }), + device.doesElementExist({ + ...new ChromeNotificationsNegativeButton(device).build(), + maxWait: 5_000, + }), + ]); + + if (!useWithoutAccount && !notifications) { + device.log('Chrome opened normally, proceeding'); + return; + } + + device.log('Chrome has been opened for the first time, dismissing modals'); + if (useWithoutAccount) { await device.clickOnElementAll(new ChromeUseWithoutAnAccount(device)); + // Notifications prompt appears after dismissing the account check + await device.clickOnElementAll(new ChromeNotificationsNegativeButton(device)); + } else if (notifications) { await device.clickOnElementAll(new ChromeNotificationsNegativeButton(device)); } } From e558fbb2f8ed5a39e6514b72323cf6baa2cb6930 Mon Sep 17 00:00:00 2001 From: Miklos Mandoki Date: Tue, 7 Apr 2026 15:29:00 +1000 Subject: [PATCH 2/2] fix: simplify logic --- run/test/utils/handle_first_open.ts | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/run/test/utils/handle_first_open.ts b/run/test/utils/handle_first_open.ts index 54bcb4fb5..cd638517a 100644 --- a/run/test/utils/handle_first_open.ts +++ b/run/test/utils/handle_first_open.ts @@ -22,11 +22,8 @@ export async function handleChromeFirstTimeOpen(device: DeviceWrapper) { device.log('Chrome has been opened for the first time, dismissing modals'); if (useWithoutAccount) { await device.clickOnElementAll(new ChromeUseWithoutAnAccount(device)); - // Notifications prompt appears after dismissing the account check - await device.clickOnElementAll(new ChromeNotificationsNegativeButton(device)); - } else if (notifications) { - await device.clickOnElementAll(new ChromeNotificationsNegativeButton(device)); } + await device.clickOnElementAll(new ChromeNotificationsNegativeButton(device)); } export async function handlePhotosFirstTimeOpen(device: DeviceWrapper) {