/** * Fill in the option specified for the product * * @param FixtureInterface $product * @return void */ public function fillOptions(FixtureInterface $product) { if ($product instanceof InjectableFixture) { /** @var \Magento\Bundle\Test\Fixture\CatalogProductBundle $product */ $checkoutData = $product->getCheckoutData(); $bundleCheckoutData = isset($checkoutData['bundle_options']) ? $checkoutData['bundle_options'] : []; } else { // TODO: Removed after refactoring(removed) old product fixture. /** @var \Magento\Bundle\Test\Fixture\BundleFixed $product */ $bundleCheckoutData = $product->getSelectionData(); } $this->_rootElement->find($this->customizeButton)->click(); $this->getBundleBlock()->fillBundleOptions($bundleCheckoutData); parent::fillOptions($product); }
/** * Fill in the option specified for the product * * @param FixtureInterface $product * @return void */ public function fillOptions(FixtureInterface $product) { $configureButton = $this->_rootElement->find($this->customizeButton); $configureSection = $this->_rootElement->find('.product-options-wrapper'); if ($configureButton->isVisible()) { $configureButton->click(); $bundleOptions = $product->getSelectionData(); $this->getBundleBlock()->fillBundleOptions($bundleOptions); } if ($configureSection->isVisible()) { $productOptions = $product->getProductOptions(); $this->getCustomOptionsBlock()->fillProductOptions($productOptions); } }