mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 17:59:23 -04:00
* [visualize] update breadcrumbs when updating visualization * [ftr] auto-scroll elements passed the fixed header if necessary * [uiSettings] enable the k7design by default * [ftr/services/flyout] add ensureClosed() and ensureAllClosed() * [ftr/services/globalNav] implement globalNav service * [ftr/services/appsMenu] implement service for using app menu * [ftr/services/userMenu] add service for using user menu * [ftr/discover+visualize] update assertions that are based on the app width * [ftr/monitoring] pass test subjects to new breadcrumbs * [headerGlobalNav] don't offset the app container in embed mode * update heights for slightly smaller header
42 lines
1.2 KiB
JavaScript
42 lines
1.2 KiB
JavaScript
/*
|
|
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
* or more contributor license agreements. Licensed under the Elastic License;
|
|
* you may not use this file except in compliance with the Elastic License.
|
|
*/
|
|
|
|
export function UserMenuProvider({ getService }) {
|
|
const testSubjects = getService('testSubjects');
|
|
const retry = getService('retry');
|
|
|
|
return new class UserMenu {
|
|
async clickLogoutButton() {
|
|
await this._ensureMenuOpen();
|
|
await testSubjects.click('userMenu logoutLink');
|
|
}
|
|
|
|
async clickProvileLink() {
|
|
await this._ensureMenuOpen();
|
|
await testSubjects.click('userMenu profileLink');
|
|
}
|
|
|
|
async logoutLinkExists() {
|
|
if (!await testSubjects.exists('userMenuButton')) {
|
|
return;
|
|
}
|
|
|
|
await this._ensureMenuOpen();
|
|
return await testSubjects.exists('userMenu logoutLink');
|
|
}
|
|
|
|
async _ensureMenuOpen() {
|
|
if (await testSubjects.exists('userMenu')) {
|
|
return;
|
|
}
|
|
|
|
await testSubjects.click('userMenuButton');
|
|
await retry.waitFor('user menu opened', async () => (
|
|
await testSubjects.exists('userMenu')
|
|
));
|
|
}
|
|
};
|
|
}
|