Skip to content

Commit 37186ef

Browse files
committed
MQE-2143: [chrome81] dragAndDrop with x and y offsets no longer works
1 parent b6a2dc6 commit 37186ef

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

src/Magento/FunctionalTestingFramework/Module/MagentoWebDriver.php

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -745,21 +745,21 @@ public function _before(TestInterface $test)
745745
*/
746746
public function dragAndDrop($source, $target, $xOffset = null, $yOffset = null)
747747
{
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);
751750

752-
$targetX = intval($tnodes->getLocation()->getX() + $xOffset);
753-
$targetY = intval($tnodes->getLocation()->getY() + $yOffset);
751+
$targetX = $tnodes->getLocation()->getX();
752+
$targetY = $tnodes->getLocation()->getY();
754753

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());
757756

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);
762760
}
761+
$action = new WebDriverActions($this->webDriver);
762+
$action->dragAndDropBy($snodes, $travelX, $travelY)->perform();
763763
}
764764

765765
/**

0 commit comments

Comments
 (0)