Skip to content

Commit

Permalink
(core) Fixing theme switch helper
Browse files Browse the repository at this point in the history
Summary: Fixing flakiness in the test helper.

Test Plan: Existing

Reviewers: georgegevoian

Reviewed By: georgegevoian

Subscribers: georgegevoian

Differential Revision: https://phab.getgrist.com/D4051
  • Loading branch information
berhalak committed Sep 22, 2023
1 parent e01ebe1 commit c6f93f6
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions test/nbrowser/gristUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit c6f93f6

Please sign in to comment.