cypress-drag-drop

A cypress child command for drag'n'drop support.

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
cypress-drag-drop
152481.1.15 years ago5 years agoMinified + gzip package size for cypress-drag-drop in KB

Readme

cypress-drag-drop
A cypress child command for drag'n'drop support.
Usage
The drag command is a child command. The command only accepts elements. As the drop target simply pass a selector as string.
In your cypress spec use the command as follows:
describe('Dragtest', () => {
  it('should dragndrop', () => {
    cy.visit('/yourpage');

    cy.get('.sourceitem').drag('.targetitem');
  });
});

position

The drag command also accepts a position argument to decide at which position the element should be dropped.
Possible values are topLeft, top, topRight, left, center, right, bottomLeft, bottom, and bottomRight.
The default position is top.
describe('Dragtest', () => {
  it('should dragndrop', () => {
    cy.visit('/yourpage');

    cy.get('.sourceitem').drag('.targetitem', 'bottom');
  });
});