9 use Magento\Catalog\Test\Page\Product\CatalogProductView;
10 use Magento\Mtf\Client\BrowserInterface;
27 CatalogProductView $catalogProductView,
29 BrowserInterface $browser
34 $browser->open($_ENV[
'app_frontend_url'] .
$product->getUrlKey() .
'.html');
36 $bundleViewBlock = $catalogProductView->getBundleViewBlock();
37 $configuredPriceBlock = $bundleViewBlock->getBundleSummaryBlock()->getConfiguredPriceBlock();
39 foreach ($bundleOption[
'assigned_products'] as $assignedProduct) {
40 $bundleViewBlock->fillOptionsWithCustomData([
42 'title' => $bundleOption[
'title'],
43 'type' => $bundleOption[
'type'],
44 'frontend_type' => $bundleOption[
'type'],
46 'name' => $assignedProduct[
'search_data'][
'name']
50 $assignedProductPrice = (double)$assignedProduct[
'data'][
'selection_price_value'];
51 $assignedProductQty = (double)$assignedProduct[
'data'][
'selection_qty'];
53 foreach ($bundleViewBlock->getBundleSummaryBlock()->getSummaryItems() as $bundleSummaryItem) {
54 $bundleSummaryItemText = $bundleSummaryItem->getText();
55 if (strpos($bundleSummaryItemText, $assignedProduct[
'search_data'][
'name']) !==
false) {
56 $optionData = $this->getBundleOptionData($bundleSummaryItemText);
57 $optionData[
'price'] = (double)$configuredPriceBlock->getPrice();
63 'qty' => $assignedProduct[
'data'][
'selection_qty'],
64 'name' => $assignedProduct[
'search_data'][
'name'],
65 'price' => $assignedProductQty * $assignedProductPrice + (double)
$product->getPrice()
70 \PHPUnit\Framework\Assert::assertEquals(
73 'Bundle Summary Section does not contain correct bundle options data.' 83 private function getBundleOptionData($rowItem)
86 $rowItem = explode(
' x ', $rowItem);
100 return 'Bundle options are displayed correctly in the summary section.';
processAssert(CatalogProductView $catalogProductView, BundleProduct $product, BrowserInterface $browser)