Skip to content
Discussion options

You must be logged in to vote

Leaving this here for anyone who needs to do this.

cy.get('[data-cy=drag-target]')
  .eq(0)
  .then(($el) => {
    const el = $el[0];
    const rect = el.getBoundingClientRect();
    cy.wrap($el).trigger('pointerdown', {
      clientX: rect.left + rect.width / 2,
      clientY: rect.top + rect.height / 2,
      button: 0,
    });
  });

cy.get('[data-cy=drag-target]')
  .eq(1)
  .then(($el) => {
    const el = $el[0];
    const rect = el.getBoundingClientRect();
    cy.wrap($el).trigger('pointermove', {
      clientX: rect.left + rect.width / 2,
      clientY: rect.top + rect.height / 2,
      button: 0,
    });
    cy.wrap($el).trigger('pointerup', {
      clientX: rect.left + rect.width / 

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by jamesvec
Comment options

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