From c6f93f687039ba09792d3c5bed42e9282cc4a257 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jaros=C5=82aw=20Sadzi=C5=84ski?= Date: Fri, 22 Sep 2023 13:26:32 +0200 Subject: [PATCH] (core) Fixing theme switch helper Summary: Fixing flakiness in the test helper. Test Plan: Existing Reviewers: georgegevoian Reviewed By: georgegevoian Subscribers: georgegevoian Differential Revision: https://phab.getgrist.com/D4051 --- test/nbrowser/gristUtils.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/test/nbrowser/gristUtils.ts b/test/nbrowser/gristUtils.ts index 7f98b836..ac503075 100644 --- a/test/nbrowser/gristUtils.ts +++ b/test/nbrowser/gristUtils.ts @@ -3141,14 +3141,15 @@ export async function setGristTheme(options: { await openProfileSettingsPage(); } - const syncWithOSCheckbox = await driver.find('.test-theme-config-sync-with-os'); - const isSyncWithOSChecked = await syncWithOSCheckbox.getAttribute('checked') === 'true'; + await scrollIntoView(driver.find('.test-theme-config-sync-with-os')); + const isSyncWithOSChecked = await driver.find('.test-theme-config-sync-with-os').getAttribute('checked') === 'true'; if (syncWithOS !== isSyncWithOSChecked) { - await syncWithOSCheckbox.click(); + await driver.find('.test-theme-config-sync-with-os').click(); await waitForServer(); } if (!syncWithOS) { + await scrollIntoView(driver.find('.test-theme-config-appearance .test-select-open')); await driver.find('.test-theme-config-appearance .test-select-open').click(); await driver.findContent('.test-select-menu li', appearance === 'light' ? 'Light' : 'Dark') .click();