Drag an element to the given position or destination element.

Usage

                    browser.element(selector).dragAndDrop({x, y})
                
                    browser.element(selector).dragAndDrop()
                

Example

export default {
  demoTest(browser: NightwatchAPI): void {
    browser.element.find('.section').dragAndDrop({ x: 100, y: 100 });
  },
  async demoTestAsync(browser: NightwatchAPI): Promise<void> {
    // using destination coordinates
    browser.element.find('.section').dragAndDrop({ x: 0, y: 500 });

    // using WebElement of destination
    const destWebElement = await browser.element.find('.dest-section');
    browser.element.find('.section').dragAndDrop(destWebElement);
  }
}

Returns

Type description
ScopedWebElement