DashboardsE2E: Add E2E tests for Auto grid (#106171)
* add auto grid e2e tests * remove unnecessary clean up in grouping tests * refaactor repeated code * Refactor some repeated blocks --------- Co-authored-by: kay delaney <kay@grafana.com>
This commit is contained in:
co-authored by
kay delaney
parent
5c268c1734
commit
bc076f27ff
@@ -12,6 +12,14 @@ export const selectRowsLayout = () => {
|
||||
clickGroupLayoutButton('Rows');
|
||||
};
|
||||
|
||||
export const selectCustomGridLayout = () => {
|
||||
clickGroupLayoutButton('Custom');
|
||||
};
|
||||
|
||||
export const selectAutoGridLayout = () => {
|
||||
clickGroupLayoutButton('Auto grid');
|
||||
};
|
||||
|
||||
const editPaneCopyOrDuplicate = (buttonLabel: string) => {
|
||||
e2e.components.EditPaneHeader.copyDropdown().click();
|
||||
cy.get('[role="menu"]').within(() => {
|
||||
|
||||
@@ -8,3 +8,4 @@ export * from './saveDashboard';
|
||||
export * from './importDashboard';
|
||||
export * from './editPaneActions';
|
||||
export * from './selectPanel';
|
||||
export * from './panelPosition';
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
import { e2e } from '../..';
|
||||
|
||||
export const verifyPanelsStackedVertically = () => {
|
||||
let initialOffset = 0;
|
||||
e2e.components.Panels.Panel.title('New panel').each((el) => {
|
||||
if (!initialOffset) {
|
||||
initialOffset = el.offset().top;
|
||||
} else {
|
||||
const elOffset = el.offset().top;
|
||||
expect(elOffset).to.be.greaterThan(initialOffset);
|
||||
initialOffset = elOffset;
|
||||
}
|
||||
});
|
||||
};
|
||||
Reference in New Issue
Block a user