Skip to content

Is it possible to trigger mouse events on the pixi canvas element using cypress for automation testing? #10161

Answered by fakob
fakob asked this question in Q&A
Discussion options

You must be logged in to vote

Seems that I have found a solution for it. Using the following plugin worked. https://github.com/dmtrKovalenko/cypress-real-events
I still had to fiddle a bit with the timings, but this is how a drag action looked like:

  const dragFromAtoB = (startX, startY, endX, endY) => {
    cy.get('body')
      .realMouseMove(startX, startY)
      .realMouseDown({ x: startX, y: startY })
      .realMouseMove(endX, endY)
      .realMouseUp({ x: endX, y: endY });
    cy.wait(1000);
  };

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by fakob
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant