HI,
I am trying to write test cases using Robot for right click of the node, but it doesn’t trigger the click.
Here is my code for it.
Cypress.Commands.add('workflowDiagramContextClickNode', nodeId => {
cy.workflowDiagramNode(nodeId).then(node => {
cy.workflowDiagramRobot().then(robot => {
const { centerX, centerY } = node.getDocumentBounds();
robot.mouseDown(centerX, centerY, 0, { right: true });
robot.mouseUp(centerX, centerY, 0, { right: true });
});
});
cy.wait(100);
});
Cypress.Commands.add('workflowDiagramRobot', () => {
cy.workflowDiagram().then(diagram => {
cy.wrap(new Robot(diagram));
});
});
Cypress.Commands.add('workflowDiagramNode', nodeId => {
cy.workflowDiagram().then(diagram => {
cy.wrap(diagram.findNodeForKey(nodeId));
});
});
so it adds a command called workflowDiagramContextClickNode.