/** * @Then /^this taxon should (belongs to "[^"]+")$/ */ public function thisTaxonShouldBelongsTo(TaxonInterface $taxon) { Assert::true($this->updatePage->hasResourceValues(['parent' => $taxon->getId()]), sprintf('Current taxon should have %s parent taxon.', $taxon->getName())); }
/** * {@inheritDoc} */ public function insertBefore(TaxonInterface $draggableTaxon, TaxonInterface $targetTaxon) { $seleniumDriver = $this->getSeleniumDriver(); $draggableTaxonLocator = sprintf('.item[data-id="%s"]', $draggableTaxon->getId()); $targetTaxonLocator = sprintf('.item[data-id="%s"]', $targetTaxon->getId()); $script = <<<JS (function (\$) { \$('{$draggableTaxonLocator}').simulate('drag-n-drop',{ dragTarget: \$('{$targetTaxonLocator}'), interpolation: {stepWidth: 10, stepDelay: 30} }); })(jQuery); JS; $seleniumDriver->executeScript($script); $this->getDocument()->waitFor(5, function () { return false; }); }