kibana/test/functional/services/management/management_menu.ts
Tyler Smalley 4681a80317
[DX] Upgrade prettier to v2.4.0 (#112359)
Signed-off-by: Tyler Smalley <tyler.smalley@elastic.co>
2021-09-19 22:34:30 -07:00

36 lines
1.1 KiB
TypeScript

/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0 and the Server Side Public License, v 1; you may not use this file except
* in compliance with, at your election, the Elastic License 2.0 or the Server
* Side Public License, v 1.
*/
import { FtrService } from '../../ftr_provider_context';
export class ManagementMenuService extends FtrService {
private readonly find = this.ctx.getService('find');
public async getSections() {
const sectionsElements = await this.find.allByCssSelector(
'.kbnPageTemplateSolutionNav .euiSideNavItem--root'
);
const sections = [];
for (const el of sectionsElements) {
const sectionId = await (
await el.findByClassName('euiSideNavItemButton')
).getAttribute('data-test-subj');
const sectionLinks = await Promise.all(
(
await el.findAllByCssSelector('.euiSideNavItem > a.euiSideNavItemButton')
).map((item) => item.getAttribute('data-test-subj'))
);
sections.push({ sectionId, sectionLinks });
}
return sections;
}
}