test: Update e2e tests for canvas specific actions (no-changelog) (#12614)

This commit is contained in:
Alex Grozav
2025-01-21 10:30:27 +02:00
committed by GitHub
parent ac2f6476c1
commit 2d3b643f6e
9 changed files with 281 additions and 93 deletions

View File

@@ -172,6 +172,7 @@ Cypress.Commands.add('drag', (selector, pos, options) => {
};
if (options?.realMouse) {
element.realMouseDown();
element.realMouseMove(0, 0);
element.realMouseMove(newPosition.x, newPosition.y);
element.realMouseUp();
} else {
@@ -218,8 +219,15 @@ Cypress.Commands.add('draganddrop', (draggableSelector, droppableSelector, optio
const pageY = coords.top + coords.height / 2;
if (draggableSelector) {
// We can't use realMouseDown here because it hangs headless run
cy.get(draggableSelector).trigger('mousedown');
cy.ifCanvasVersion(
() => {
// We can't use realMouseDown here because it hangs headless run
cy.get(draggableSelector).trigger('mousedown');
},
() => {
cy.get(draggableSelector).realMouseDown();
},
);
}
// We don't chain these commands to make sure cy.get is re-trying correctly
cy.get(droppableSelector).realMouseMove(0, 0);