While conducting a system test using nightwatch and selenium, I encountered an issue with dragging and dropping elements that are implemented with Knockout-draggable. Manually, the drag and drop functionality works perfectly. Below is the code snippet from the system test attempting to drag and drop a draggable box:
this.moveToElement('@box', 0, 0);
c.mouseButtonDown(0);
this.moveToElement('@box2', 0, 40);
c.mouseButtonUp(0);
Here, this
refers to the page containing the xpath elements and c
represents the client.
Despite my efforts, the code does not successfully move the box below the second box, which is approximately 40 pixels high. I have experimented with varying values, but the box remains undragged. This issue occurs specifically in Firefox.
For clarity, both @box
and @box2
contain valid xpaths that have been used in numerous other tests without any problems.