@@ -745,21 +745,21 @@ public function _before(TestInterface $test)
745
745
*/
746
746
public function dragAndDrop ($ source , $ target , $ xOffset = null , $ yOffset = null )
747
747
{
748
- if ($ xOffset !== null || $ yOffset !== null ) {
749
- $ snodes = $ this ->matchFirstOrFail ($ this ->baseElement , $ source );
750
- $ tnodes = $ this ->matchFirstOrFail ($ this ->baseElement , $ target );
748
+ $ snodes = $ this ->matchFirstOrFail ($ this ->baseElement , $ source );
749
+ $ tnodes = $ this ->matchFirstOrFail ($ this ->baseElement , $ target );
751
750
752
- $ targetX = intval ( $ tnodes ->getLocation ()->getX () + $ xOffset );
753
- $ targetY = intval ( $ tnodes ->getLocation ()->getY () + $ yOffset );
751
+ $ targetX = $ tnodes ->getLocation ()->getX ();
752
+ $ targetY = $ tnodes ->getLocation ()->getY ();
754
753
755
- $ travelX = intval ($ targetX - $ snodes ->getLocation ()->getX ());
756
- $ travelY = intval ($ targetY - $ snodes ->getLocation ()->getY ());
754
+ $ travelX = intval ($ targetX - $ snodes ->getLocation ()->getX ());
755
+ $ travelY = intval ($ targetY - $ snodes ->getLocation ()->getY ());
757
756
758
- $ action = new WebDriverActions ($ this ->webDriver );
759
- $ action ->dragAndDropBy ($ snodes , $ travelX , $ travelY )->perform ();
760
- } else {
761
- parent ::dragAndDrop ($ source , $ target );
757
+ if ($ xOffset !== null || $ yOffset !== null ) {
758
+ $ travelX = intval ($ travelX + $ xOffset );
759
+ $ travelY = intval ($ travelY + $ yOffset );
762
760
}
761
+ $ action = new WebDriverActions ($ this ->webDriver );
762
+ $ action ->dragAndDropBy ($ snodes , $ travelX , $ travelY )->perform ();
763
763
}
764
764
765
765
/**
0 commit comments