diff --git a/src/lib/Browser/Element/RootElement.php b/src/lib/Browser/Element/RootElement.php index 1a0ec0c7..d4201fd7 100644 --- a/src/lib/Browser/Element/RootElement.php +++ b/src/lib/Browser/Element/RootElement.php @@ -31,7 +31,7 @@ public function dragAndDrop(string $from, string $hover, string $to): void throw new RuntimeException('drag-mock library has to be added to the page in order to use this method. Refer to README in BehatBundle for more information.'); } - $movingScript = sprintf('dragMock.dragStart(%s).dragOver(%s).delay(100).drop(%s);', $from, $hover, $to); + $movingScript = sprintf('{ const dragMockTmp = dragMock.dragStart(%s).delay(50).dragOver(%s).delay(50); setTimeout(() => dragMockTmp.drop(%s), 100); }', $from, $hover, $to); $this->session->getDriver()->executeScript($movingScript); }