Skip to content

Commit

Permalink
Merge pull request #1201 from ezsystems/EZEE-2950-use-webpack
Browse files Browse the repository at this point in the history
EZEE-2950: Removed drag-mock injection
  • Loading branch information
micszo authored Jan 24, 2020
2 parents 6e0693f + 32f171b commit e97001e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 44 deletions.
17 changes: 3 additions & 14 deletions src/lib/Behat/Helper/UtilityContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -333,22 +333,11 @@ private function isDraggingLibraryLoaded(): bool

public function moveWithHover(string $startExpression, string $hoverExpression, string $placeholderExpression): void
{
$this->loadDraggingLibrary();
if (!$this->isDraggingLibraryLoaded()) {
throw new \Exception('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);', $startExpression, $hoverExpression, $placeholderExpression);
$this->getSession()->getDriver()->executeScript($movingScript);
}

private function loadDraggingLibrary(): void
{
if ($this->isDraggingLibraryLoaded()) {
return;
}

$script = file_get_contents(__DIR__ . '/../lib/drag-mock.js');
$this->getSession()->getDriver()->executeScript($script);
$this->waitUntil(10, function () {
return $this->isDraggingLibraryLoaded();
});
}
}
30 changes: 0 additions & 30 deletions src/lib/Behat/lib/drag-mock.js

This file was deleted.

0 comments on commit e97001e

Please sign in to comment.