diff --git a/dev/tests/functional/tests/app/Magento/Bundle/Test/Block/Catalog/Product/CustomizedPrice.php b/dev/tests/functional/tests/app/Magento/Bundle/Test/Block/Catalog/Product/CustomizedPrice.php deleted file mode 100644 index f82bc0b83e59c28c707378ab29783eae3b3e04d4..0000000000000000000000000000000000000000 --- a/dev/tests/functional/tests/app/Magento/Bundle/Test/Block/Catalog/Product/CustomizedPrice.php +++ /dev/null @@ -1,34 +0,0 @@ -<?php -/** - * Copyright © 2016 Magento. All rights reserved. - * See COPYING.txt for license details. - */ -namespace Magento\Bundle\Test\Block\Catalog\Product; - -/** - * This class is used to access the price related information from the storefront. - */ -class CustomizedPrice extends \Magento\Catalog\Test\Block\AbstractPriceBlock -{ - /** - * Mapping for different type of price. - * - * @var array - */ - protected $mapTypePrices = [ - 'final_price' => [ - 'selector' => '.price', - ] - ]; - - /** - * This method returns the price represented by the block. - * - * @param string $currency - * @return string|null - */ - public function getFinalPrice($currency = '$') - { - return $this->getTypePrice('final_price', $currency); - } -} diff --git a/dev/tests/functional/tests/app/Magento/Bundle/Test/Block/Catalog/Product/View.php b/dev/tests/functional/tests/app/Magento/Bundle/Test/Block/Catalog/Product/View.php index 327fea6b8c702e7c6d91a779edbd569797227f77..a688ffac5ac019627c137fcb678c56f374599c8b 100644 --- a/dev/tests/functional/tests/app/Magento/Bundle/Test/Block/Catalog/Product/View.php +++ b/dev/tests/functional/tests/app/Magento/Bundle/Test/Block/Catalog/Product/View.php @@ -78,19 +78,6 @@ class View extends \Magento\Catalog\Test\Block\Product\View ); } - /** - * Get Bundle customized Price block. - * - * @return \Magento\Bundle\Test\Block\Catalog\Product\CustomizedPrice - */ - public function getCustomizedPriceBlock() - { - return $this->blockFactory->create( - \Magento\Bundle\Test\Block\Catalog\Product\CustomizedPrice::class, - ['element' => $this->_rootElement->find($this->customizedBundlePriceSelector)] - ); - } - /** * Click "Customize and add to cart button". * diff --git a/dev/tests/functional/tests/app/Magento/Bundle/Test/Block/Catalog/Product/View/Summary.php b/dev/tests/functional/tests/app/Magento/Bundle/Test/Block/Catalog/Product/View/Summary.php index 76a46bfe3088a47f79dafa7f8c71d649e324b130..03c0aeadd85bbb9bc69572eeb2cba026cb7c0bac 100644 --- a/dev/tests/functional/tests/app/Magento/Bundle/Test/Block/Catalog/Product/View/Summary.php +++ b/dev/tests/functional/tests/app/Magento/Bundle/Test/Block/Catalog/Product/View/Summary.php @@ -20,6 +20,13 @@ class Summary extends \Magento\Catalog\Test\Block\Product\View */ private $configuredPriceBlockSelector = '.price-configured_price'; + /** + * Summary items selector. + * + * @var string + */ + private $summaryItemsSelector = '.bundle li div div'; + /** * Get configured price block. * @@ -32,4 +39,14 @@ class Summary extends \Magento\Catalog\Test\Block\Product\View ['element' => $this->_rootElement->find($this->configuredPriceBlockSelector)] ); } + + /** + * Get Bundle Summary row items. + * + * @return \Magento\Mtf\Client\ElementInterface[] + */ + public function getSummaryItems() + { + return $this->_rootElement->getElements($this->summaryItemsSelector); + } } diff --git a/dev/tests/functional/tests/app/Magento/Bundle/Test/Constraint/AssertBundleItemsSummaryOnProductPage.php b/dev/tests/functional/tests/app/Magento/Bundle/Test/Constraint/AssertBundleItemsSummaryOnProductPage.php index 36895dd2548a52023ce2b320f807e8dd0839d13a..e60e08e3c9b9aa755734b21e3ef05a040b8d87d2 100644 --- a/dev/tests/functional/tests/app/Magento/Bundle/Test/Constraint/AssertBundleItemsSummaryOnProductPage.php +++ b/dev/tests/functional/tests/app/Magento/Bundle/Test/Constraint/AssertBundleItemsSummaryOnProductPage.php @@ -33,14 +33,15 @@ class AssertBundleItemsSummaryOnProductPage extends AbstractAssertForm $browser->open($_ENV['app_frontend_url'] . $product->getUrlKey() . '.html'); $bundleOptions = $product->getData()['bundle_selections']['bundle_options']; - $optionsBlock = $catalogProductView->getBundleViewBlock(); - $customizedPriceBlock = $optionsBlock->getCustomizedPriceBlock(); + $bundleViewBlock = $catalogProductView->getBundleViewBlock(); + $configuredPriceBlock = $bundleViewBlock->getBundleSummaryBlock()->getConfiguredPriceBlock(); foreach ($bundleOptions as $bundleOption) { foreach ($bundleOption['assigned_products'] as $assignedProduct) { - $optionsBlock->fillOptionsWithCustomData([ + $bundleViewBlock->fillOptionsWithCustomData([ [ 'title' => $bundleOption['title'], 'type' => $bundleOption['type'], + 'frontend_type' => $bundleOption['type'], 'value' => [ 'name' => $assignedProduct['search_data']['name'] ] @@ -49,11 +50,11 @@ class AssertBundleItemsSummaryOnProductPage extends AbstractAssertForm $assignedProductPrice = (double)$assignedProduct['data']['selection_price_value']; $assignedProductQty = (double)$assignedProduct['data']['selection_qty']; - foreach ($optionsBlock->getBundleSummary() as $bundleSummaryItem) { + foreach ($bundleViewBlock->getBundleSummaryBlock()->getSummaryItems() as $bundleSummaryItem) { $bundleSummaryItemText = $bundleSummaryItem->getText(); if (strpos($bundleSummaryItemText, $assignedProduct['search_data']['name']) !== false) { $optionData = $this->getBundleOptionData($bundleSummaryItemText); - $optionData['price'] = (double)$customizedPriceBlock->getFinalPrice(); + $optionData['price'] = (double)$configuredPriceBlock->getPrice(); $actualResult[] = $optionData; } } diff --git a/dev/tests/functional/tests/app/Magento/Bundle/Test/Repository/BundleProduct/BundleSelections.xml b/dev/tests/functional/tests/app/Magento/Bundle/Test/Repository/BundleProduct/BundleSelections.xml index 4a4bd5878ce6c350d5205dffe855b606be8d7a82..a297891ba085ce99ea3391176efa38a8d325e775 100644 --- a/dev/tests/functional/tests/app/Magento/Bundle/Test/Repository/BundleProduct/BundleSelections.xml +++ b/dev/tests/functional/tests/app/Magento/Bundle/Test/Repository/BundleProduct/BundleSelections.xml @@ -628,6 +628,7 @@ <item name="0" xsi:type="array"> <item name="title" xsi:type="string">Drop-down Option</item> <item name="type" xsi:type="string">Drop-down</item> + <item name="frontend_type" xsi:type="string">Drop-down</item> <item name="required" xsi:type="string">Yes</item> <item name="assigned_products" xsi:type="array"> <item name="0" xsi:type="array">