Information:
"chromedriver": "^87.0.7",
"geckodriver": "^1.22.1",
"html-dnd": "^1.2.1",
"nightwatch": "^1.5.1",
Expectation
Utilize the Nightwatch
framework in JavaScript
to perform a drag and drop action on an SVG element with another SVG element.
Reality
The test is marked as passed but the actual movement between elements did not take place.
Scenario I attempted the following approach:
browser.moveToElement(locator, dragElement, 1, 1);
browser.mouseButtonDown(0);
browser.moveToElement(locator, dropElement, 1, 1);
browser.mouseButtonUp(0);
During testing, I noticed that manually moving the mouse while the test was running enabled successful drag and drop functionality for SVG elements.
Despite trying out html-dnd
, there was no change in outcome.
const dragAndDrop = require('html-dnd').codeForSelectors;
"Drag and Drop": function (browser) {
browser.url(myurl);
browser.useXpath();
browser.execute(dragAndDrop, [svgDragElement, svgDropElement]);
browser.end();
}