2022-12-15 07:39:59 -08:00
|
|
|
import { BasePage } from '../base';
|
2022-11-24 14:22:09 -08:00
|
|
|
|
|
|
|
export class MainSidebar extends BasePage {
|
|
|
|
getters = {
|
2022-12-15 07:39:59 -08:00
|
|
|
menuItem: (menuLabel: string) =>
|
|
|
|
cy.getByTestId('menu-item').filter(`:contains("${menuLabel}")`),
|
2022-12-07 09:16:38 -08:00
|
|
|
settings: () => this.getters.menuItem('Settings'),
|
|
|
|
templates: () => this.getters.menuItem('Templates'),
|
|
|
|
workflows: () => this.getters.menuItem('Workflows'),
|
|
|
|
credentials: () => this.getters.menuItem('Credentials'),
|
|
|
|
executions: () => this.getters.menuItem('Executions'),
|
2023-02-08 12:41:35 -08:00
|
|
|
userMenu: () => cy.getByTestId('main-sidebar-user-menu'),
|
2022-11-24 14:22:09 -08:00
|
|
|
};
|
|
|
|
actions = {
|
2022-12-07 09:16:38 -08:00
|
|
|
goToSettings: () => {
|
|
|
|
this.getters.settings().should('be.visible');
|
|
|
|
// We must wait before ElementUI menu is done with its animations
|
|
|
|
cy.get('[data-old-overflow]').should('not.exist');
|
|
|
|
this.getters.settings().click();
|
|
|
|
},
|
|
|
|
goToCredentials: () => {
|
|
|
|
this.getters.credentials().should('be.visible');
|
|
|
|
cy.get('[data-old-overflow]').should('not.exist');
|
2022-12-15 07:39:59 -08:00
|
|
|
this.getters.credentials().click();
|
2022-12-07 09:16:38 -08:00
|
|
|
},
|
2023-02-08 12:41:35 -08:00
|
|
|
openUserMenu: () => {
|
|
|
|
this.getters.userMenu().find('[role="button"]').last().click();
|
|
|
|
},
|
2022-11-24 14:22:09 -08:00
|
|
|
};
|
|
|
|
}
|