DashboardE2E: Add more cases to grouping E2E (#105598)
* add more row grouping e2e * refactor dashboard create with dashboard import to speed up tests * add more tests for tabs layout * adjust flaky test
This commit is contained in:
@@ -2,7 +2,7 @@ import { e2e } from '../..';
|
||||
|
||||
export const addPanel = () => {
|
||||
e2e.components.DashboardEditPaneSplitter.primaryBody().scrollTo('bottom', { ensureScrollable: false });
|
||||
e2e.components.CanvasGridAddActions.addPanel().should('be.visible').click();
|
||||
e2e.components.CanvasGridAddActions.addPanel().last().should('be.visible').click();
|
||||
};
|
||||
|
||||
export const addFirstPanel = () => {
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
import { e2e } from '../..';
|
||||
|
||||
export const clickGroupLayoutButton = (buttonLabel: string) => {
|
||||
cy.get(`[aria-label='layout-selection-option-${buttonLabel}']`).click();
|
||||
};
|
||||
|
||||
export const selectTabsLayout = () => {
|
||||
clickGroupLayoutButton('Tabs');
|
||||
};
|
||||
|
||||
export const selectRowsLayout = () => {
|
||||
clickGroupLayoutButton('Rows');
|
||||
};
|
||||
|
||||
const editPaneCopyOrDuplicate = (buttonLabel: string) => {
|
||||
e2e.components.EditPaneHeader.copyDropdown().click();
|
||||
cy.get('[role="menu"]').within(() => {
|
||||
cy.contains(buttonLabel).click();
|
||||
});
|
||||
};
|
||||
|
||||
export const editPaneCopy = () => editPaneCopyOrDuplicate('Copy');
|
||||
export const editPaneDuplicate = () => editPaneCopyOrDuplicate('Duplicate');
|
||||
@@ -0,0 +1,21 @@
|
||||
import { e2e } from '../..';
|
||||
import testV2Dashboard from '../../../dashboards/TestV2Dashboard.json';
|
||||
|
||||
export interface ImportDashboardConfig {
|
||||
title?: string;
|
||||
}
|
||||
|
||||
export const importV2Dashboard = ({ title }: ImportDashboardConfig) => {
|
||||
e2e.pages.ImportDashboard.visit();
|
||||
e2e.components.DashboardImportPage.textarea().type(JSON.stringify(testV2Dashboard), {
|
||||
delay: 0,
|
||||
parseSpecialCharSequences: false,
|
||||
});
|
||||
|
||||
e2e.components.DashboardImportPage.submit().click();
|
||||
|
||||
if (title) {
|
||||
e2e.components.ImportDashboardForm.name().clear().type(title);
|
||||
}
|
||||
e2e.components.ImportDashboardForm.submit().click();
|
||||
};
|
||||
@@ -5,4 +5,6 @@ export * from './toggleEditMode';
|
||||
export * from './movePanel';
|
||||
export * from './groupPanels';
|
||||
export * from './saveDashboard';
|
||||
export * from './importDashboard';
|
||||
export * from './editPaneActions';
|
||||
export * from './selectPanel';
|
||||
|
||||
Reference in New Issue
Block a user