diff --git a/test/nbrowser/gristUtils.ts b/test/nbrowser/gristUtils.ts index 1df8a3de..acdf5c29 100644 --- a/test/nbrowser/gristUtils.ts +++ b/test/nbrowser/gristUtils.ts @@ -42,7 +42,6 @@ export const removeLogin = homeUtil.removeLogin.bind(homeUtil); export const setValue = homeUtil.setValue.bind(homeUtil); export const isOnLoginPage = homeUtil.isOnLoginPage.bind(homeUtil); export const checkLoginPage = homeUtil.checkLoginPage.bind(homeUtil); -export const openUserProfile = homeUtil.openUserProfile.bind(homeUtil); export const fixturesRoot: string = testUtils.fixturesRoot; @@ -1613,6 +1612,14 @@ export function addSamplesForSuite() { }); } +export async function openUserProfile() { + await driver.findWait('.test-dm-account', 1000).click(); + // Since the AccountWidget loads orgs and the user data asynchronously, the menu + // can expand itself causing the click to land on a wrong button. + await waitForServer(); + await driver.findContent('.grist-floating-menu li', 'Profile Settings').click(); + await driver.findWait('.test-login-method', 5000); +} } // end of namespace gristUtils diff --git a/test/nbrowser/homeUtil.ts b/test/nbrowser/homeUtil.ts index 9321a798..f01b0ff3 100644 --- a/test/nbrowser/homeUtil.ts +++ b/test/nbrowser/homeUtil.ts @@ -243,12 +243,6 @@ export class HomeUtil { ); } - public async openUserProfile() { - await this.driver.findWait('.test-dm-account', 1000).click(); - await this.driver.findContent('.grist-floating-menu li', 'Profile Settings').click(); - await this.driver.findWait('.test-login-method', 5000); - } - /** * Returns whether we are currently on the Cognito login page. */