コード例 #1
0
 /**
  * @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()));
 }
コード例 #2
0
ファイル: CreatePage.php プロジェクト: loic425/Sylius
    /**
     * {@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;
        });
    }