Cypress 拖放一个 'react sortable tree' 元素

Cypress drag and drop a 'react sortable tree' element

我正在尝试使用 Cypress 从“react sortable tree”库中拖放一个元素 https://github.com/frontend-collective/react-sortable-tree#troubleshooting

但是,通常的做法并不奏效。我尝试过的事情:

    cy.get(subject).trigger("mousedown", { which: 1, force: true })
                .trigger("mousemove", { pageX: xPos, pageY: yPos, force: true })
                .trigger("mouseup", { force: true })

    cy.get(subject).trigger("mousedown", { button: 0, force: true })
    cy.get(target).trigger("mousemove")
              .trigger("mouseup")

有人在 React 可排序树上使用 Cypress 成功测试过拖放吗?

    cy.get(subject).trigger("dragstart")
    cy.get(target).trigger("drop")
              .trigger("dragend")

以上对我有用