无法使用插件cypress-drag-drop进行拖放操作



这是我的一段代码:

it.only('KDM: Should drag and drop Clinical Form section from the settings of the patient case', function () {
cy.get('[href="/patient-case/7772/13391/settings"] > .MuiTab-wrapper').as('settings')
cy.get('@settings').should('contain', 'Settings').click({force: true})
cy.contains('Settings')
cy.get('.MuiBox-root-382 > .MuiButtonBase-root > .MuiButton-label').click({force: true})
cy.contains('Create template')
cy.get('#name').clear().type(testTemplate).should('have.value', testTemplate)
//Drag from here
cy.get('[data-rbd-draggable-id="clinical_form"] > .MuiListItem-container > .MuiListItem-root >           .MuiListItemText-root > .MuiTypography-root')
.then( ($el) => {
cy.wrap($el)
//To here
.drag(':nth-child(2) > .makeStyles-column-441', {
force: true,
})
})

})

通过使用Cypress插件Cypress -drag-drop,我不能执行简单的拖放。
是否有特定的选项可以使用(多于{force: true})

你有一些示例代码来分享吗?

安装npm包:https://www.npmjs.com/package/@4tw cypress-drag-drop

cy.get('.sourceName).drag('.targetName')

最新更新