Dashboards/E2E: Add tests for drag and drop (#105066)
This commit is contained in:
@@ -2,5 +2,6 @@ export * from './addPanel';
|
||||
export * from './configurePanel';
|
||||
export * from './removePanel';
|
||||
export * from './toggleEditMode';
|
||||
export * from './movePanel';
|
||||
export * from './groupPanels';
|
||||
export * from './saveDashboard';
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
import { e2e } from '../..';
|
||||
|
||||
/** Drags and drops the panel with title `sourcePanel` to the location of the panel with title `targetPanel` */
|
||||
export const movePanel = (sourcePanel: string | RegExp, targetPanel: string | RegExp) => {
|
||||
e2e.components.Panels.Panel.headerContainer()
|
||||
.contains(targetPanel)
|
||||
.then((el) => {
|
||||
const rect = el.offset();
|
||||
e2e.components.Panels.Panel.headerContainer()
|
||||
.contains(sourcePanel)
|
||||
.trigger('mousedown', { which: 1 })
|
||||
.trigger('mousemove', { clientX: rect.left, clientY: rect.top })
|
||||
.trigger('mouseup', { force: true });
|
||||
});
|
||||
};
|
||||
Reference in New Issue
Block a user