0

Here is a piece of my code :

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,
     })
  })

})

By using the Cypress plugin cypress-drag-drop, I am not able to perform a simple drag and drop.
Are there specifics options to utilize (more than {force: true})

Do you have some sample code to share?

kegne
  • 583
  • 1
  • 8

1 Answers1

0

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

cy.get('.sourceName).drag('.targetName')
Tyler2P
  • 2,324
  • 26
  • 22
  • 31