Skip to content

Commit 3b82e8c

Browse files
authored
Merge pull request #3563 from magento-tsg-csl3/2.2-develop-pr15
[TSG-CSL3] For 2.2 (pr15)
2 parents 6b109f4 + c1c2fc8 commit 3b82e8c

File tree

19 files changed

+460
-24
lines changed

19 files changed

+460
-24
lines changed

app/code/Magento/Catalog/Model/Indexer/Product/Flat/FlatTableBuilder.php

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -352,12 +352,20 @@ protected function _updateTemporaryTableByStoreValues(
352352
}
353353

354354
//Update not simple attributes (eg. dropdown)
355-
if (isset($flatColumns[$attributeCode . $valueFieldSuffix])) {
356-
$select = $this->_connection->select()->joinInner(
357-
['t' => $this->_productIndexerHelper->getTable('eav_attribute_option_value')],
358-
't.option_id = et.' . $attributeCode . ' AND t.store_id=' . $storeId,
359-
[$attributeCode . $valueFieldSuffix => 't.value']
360-
);
355+
$columnName = $attributeCode . $valueFieldSuffix;
356+
if (isset($flatColumns[$columnName])) {
357+
$select = $this->_connection->select();
358+
$select->joinLeft(
359+
['t0' => $this->_productIndexerHelper->getTable('eav_attribute_option_value')],
360+
't0.option_id = et.' . $attributeCode . ' AND t0.store_id = 0',
361+
[]
362+
)->joinLeft(
363+
['ts' => $this->_productIndexerHelper->getTable('eav_attribute_option_value')],
364+
'ts.option_id = et.' . $attributeCode . ' AND ts.store_id = ' . $storeId,
365+
[]
366+
)->columns(
367+
[$columnName => $this->_connection->getIfNullSql('ts.value', 't0.value')]
368+
)->where($attributeCode . ' IS NOT NULL');
361369
if (!empty($changedIds)) {
362370
$select->where($this->_connection->quoteInto('et.entity_id IN (?)', $changedIds));
363371
}
@@ -381,6 +389,8 @@ protected function _getTemporaryTableName($tableName)
381389
}
382390

383391
/**
392+
* Get MetadataPool
393+
*
384394
* @return \Magento\Framework\EntityManager\MetadataPool
385395
*/
386396
private function getMetadataPool()

app/code/Magento/Catalog/Test/Mftf/Data/ProductData.xml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,17 @@
113113
<requiredEntity type="product_extension_attribute">EavStockItem</requiredEntity>
114114
<requiredEntity type="custom_attributes">CustomAttributeProductAttribute</requiredEntity>
115115
</entity>
116+
<entity name="SimpleTwo" type="product2">
117+
<data key="sku" unique="suffix">SimpleTwo</data>
118+
<data key="type_id">simple</data>
119+
<data key="attribute_set_id">4</data>
120+
<data key="name" unique="suffix">SimpleProduct</data>
121+
<data key="price">1.23</data>
122+
<data key="visibility">4</data>
123+
<data key="status">1</data>
124+
<requiredEntity type="product_extension_attribute">EavStockItem</requiredEntity>
125+
<requiredEntity type="custom_attribute">CustomAttributeProductUrlKey</requiredEntity>
126+
</entity>
116127
<entity name="SimpleOption" type="product2">
117128
<data key="sku" unique="suffix">SimpleOne</data>
118129
<data key="type_id">simple</data>
@@ -124,6 +135,9 @@
124135
<requiredEntity type="product_extension_attribute">EavStockItem</requiredEntity>
125136
<requiredEntity type="custom_attribute">CustomAttributeProductAttribute</requiredEntity>
126137
</entity>
138+
<entity name="SetProductVisibilityHidden" type="product2">
139+
<data key="visibility">1</data>
140+
</entity>
127141
<entity name="ProductImage" type="uploadImage">
128142
<data key="title" unique="suffix">Image1</data>
129143
<data key="price">1.00</data>

app/code/Magento/Checkout/CustomerData/Cart.php

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ public function __construct(
8282
}
8383

8484
/**
85-
* {@inheritdoc}
85+
* @inheritdoc
8686
*/
8787
public function getSectionData()
8888
{
@@ -158,11 +158,10 @@ protected function getRecentItems()
158158
: $item->getProduct();
159159

160160
$products = $this->catalogUrl->getRewriteByProductStore([$product->getId() => $item->getStoreId()]);
161-
if (!isset($products[$product->getId()])) {
162-
continue;
161+
if (isset($products[$product->getId()])) {
162+
$urlDataObject = new \Magento\Framework\DataObject($products[$product->getId()]);
163+
$item->getProduct()->setUrlDataObject($urlDataObject);
163164
}
164-
$urlDataObject = new \Magento\Framework\DataObject($products[$product->getId()]);
165-
$item->getProduct()->setUrlDataObject($urlDataObject);
166165
}
167166
$items[] = $this->itemPoolInterface->getItemData($item);
168167
}

app/code/Magento/Checkout/Test/Mftf/ActionGroup/CheckoutActionGroup.xml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,15 @@
2222
<waitForLoadingMaskToDisappear stepKey="waitForLoadingMaskForNextButton"/>
2323
</actionGroup>
2424

25+
<!-- Go to checkout from cart -->
26+
<actionGroup name="GoToCheckoutFromCartActionGroup">
27+
<waitForElementNotVisible selector="{{StorefrontMinicartSection.emptyCart}}" stepKey="waitUpdateQuantity" />
28+
<click selector="{{StorefrontMinicartSection.showCart}}" stepKey="clickCart"/>
29+
<waitForLoadingMaskToDisappear stepKey="waitForLoadingMask"/>
30+
<seeInCurrentUrl url="{{CheckoutCartPage.url}}" stepKey="assertCheckoutCartUrl"/>
31+
<click selector="{{StorefrontCheckoutCartSummarySection.proceedToCheckout}}" stepKey="goToCheckout"/>
32+
</actionGroup>
33+
2534
<!-- Checkout place order -->
2635
<actionGroup name="CheckoutPlaceOrderActionGroup">
2736
<arguments>
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
9+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
10+
<actionGroup name="clickViewAndEditCartFromMiniCart">
11+
<conditionalClick selector="{{StorefrontMinicartSection.showCart}}" dependentSelector="{{StorefrontMinicartSection.miniCartOpened}}" visible="false" stepKey="openMiniCart"/>
12+
<waitForElementVisible selector="{{StorefrontMinicartSection.viewAndEditCart}}" stepKey="waitForViewAndEditCartVisible"/>
13+
<click selector="{{StorefrontMinicartSection.viewAndEditCart}}" stepKey="viewAndEditCart"/>
14+
<seeInCurrentUrl url="checkout/cart" stepKey="seeInCurrentUrl"/>
15+
</actionGroup>
16+
<actionGroup name="assertOneProductNameInMiniCart">
17+
<arguments>
18+
<argument name="productName"/>
19+
</arguments>
20+
<conditionalClick selector="{{StorefrontMinicartSection.showCart}}" dependentSelector="{{StorefrontMinicartSection.miniCartOpened}}" visible="false" stepKey="openMiniCart"/>
21+
<waitForElementVisible selector="{{StorefrontMinicartSection.viewAndEditCart}}" stepKey="waitForViewAndEditCartVisible"/>
22+
<see selector="{{StorefrontMinicartSection.miniCartItemsText}}" userInput="{{productName}}" stepKey="seeInMiniCart"/>
23+
</actionGroup>
24+
25+
<!--Remove an item from the cart using minicart-->
26+
<actionGroup name="removeProductFromMiniCart">
27+
<arguments>
28+
<argument name="productName" type="string"/>
29+
</arguments>
30+
<conditionalClick selector="{{StorefrontMinicartSection.showCart}}" dependentSelector="{{StorefrontMinicartSection.miniCartOpened}}" visible="false" stepKey="openMiniCart"/>
31+
<waitForElementVisible selector="{{StorefrontMinicartSection.viewAndEditCart}}" stepKey="waitForMiniCartOpen"/>
32+
<click selector="{{StorefrontMinicartSection.deleteMiniCartItemByName(productName)}}" stepKey="clickDelete"/>
33+
<waitForElementVisible selector="{{StoreFrontRemoveItemModalSection.message}}" stepKey="waitForConfirmationModal"/>
34+
<see selector="{{StoreFrontRemoveItemModalSection.message}}" userInput="Are you sure you would like to remove this item from the shopping cart?" stepKey="seeDeleteConfirmationMessage"/>
35+
<click selector="{{StoreFrontRemoveItemModalSection.ok}}" stepKey="confirmDelete"/>
36+
<waitForPageLoad stepKey="waitForDeleteToFinish"/>
37+
</actionGroup>
38+
</actionGroups>

app/code/Magento/Checkout/Test/Mftf/Section/StorefrontMinicartSection.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,6 @@
2222
<element name="viewAndEditCart" type="button" selector=".action.viewcart" timeout="30"/>
2323
<element name="miniCartItemsText" type="text" selector=".minicart-items"/>
2424
<element name="miniCartSubtotalField" type="text" selector=".block-minicart .amount span.price"/>
25+
<element name="emptyCart" type="text" selector=".counter.qty.empty"/>
2526
</section>
2627
</sections>
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
9+
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
11+
<test name="CheckNotVisibleProductInMinicartTest">
12+
<annotations>
13+
<features value="Checkout"/>
14+
<stories value="MAGETWO-96422: Hidden Products are absent in Storefront Mini-Cart" />
15+
<title value="Not visible individually product in mini-shopping cart."/>
16+
<description value="To be sure that product in mini-shopping cart remains visible after admin makes it not visible individually"/>
17+
<severity value="MAJOR"/>
18+
<group value="checkout"/>
19+
</annotations>
20+
21+
<!--Create simple product1 and simple product2-->
22+
<createData entity="SimpleTwo" stepKey="createSimpleProduct1"/>
23+
<createData entity="SimpleTwo" stepKey="createSimpleProduct2"/>
24+
25+
<!--Go to simple product1 page-->
26+
<amOnPage url="$$createSimpleProduct1.custom_attributes[url_key]$$.html" stepKey="navigateToSimpleProductPage1"/>
27+
<waitForPageLoad stepKey="waitForCatalogPageLoad"/>
28+
29+
<!--Add simple product1 to Shopping Cart-->
30+
<actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addToCartFromStorefrontProductPage1">
31+
<argument name="productName" value="$$createSimpleProduct1.name$$"/>
32+
</actionGroup>
33+
34+
<!--Check simple product1 in minicart-->
35+
<comment userInput="Check simple product 1 in minicart" stepKey="commentCheckSimpleProduct1InMinicart" after="addToCartFromStorefrontProductPage1"/>
36+
<actionGroup ref="assertOneProductNameInMiniCart" stepKey="assertProduct1NameInMiniCart">
37+
<argument name="productName" value="$$createSimpleProduct1.name$$"/>
38+
</actionGroup>
39+
40+
<!--Make simple product1 not visible individually-->
41+
<updateData entity="SetProductVisibilityHidden" createDataKey="createSimpleProduct1" stepKey="updateSimpleProduct1">
42+
<requiredEntity createDataKey="createSimpleProduct1"/>
43+
</updateData>
44+
45+
<!--Go to simple product2 page-->
46+
<amOnPage url="$$createSimpleProduct2.custom_attributes[url_key]$$.html" stepKey="navigateToSimpleProductPage2"/>
47+
<waitForPageLoad stepKey="waitForCatalogPageLoad2"/>
48+
49+
<!--Add simple product2 to Shopping Cart for updating cart items-->
50+
<actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addToCartFromStorefrontProductPage2">
51+
<argument name="productName" value="$$createSimpleProduct2.name$$"/>
52+
</actionGroup>
53+
54+
<!--Check simple product1 in minicart-->
55+
<comment userInput="Check hidden simple product 1 in minicart" stepKey="commentCheckHiddenSimpleProduct1InMinicart" after="addToCartFromStorefrontProductPage2"/>
56+
<actionGroup ref="assertOneProductNameInMiniCart" stepKey="assertHiddenProduct1NameInMiniCart">
57+
<argument name="productName" value="$$createSimpleProduct1.name$$"/>
58+
</actionGroup>
59+
60+
<!--Check simple product2 in minicart-->
61+
<comment userInput="Check hidden simple product 2 in minicart" stepKey="commentCheckSimpleProduct2InMinicart" after="addToCartFromStorefrontProductPage2"/>
62+
<actionGroup ref="assertOneProductNameInMiniCart" stepKey="assertProduct2NameInMiniCart">
63+
<argument name="productName" value="$$createSimpleProduct2.name$$"/>
64+
</actionGroup>
65+
66+
<!--Delete simple product1 and simple product2-->
67+
<deleteData createDataKey="createSimpleProduct1" stepKey="deleteProduct1"/>
68+
<deleteData createDataKey="createSimpleProduct2" stepKey="deleteProduct2"/>
69+
</test>
70+
</tests>

app/code/Magento/Checkout/Test/Mftf/Test/StorefrontGuestCheckoutTest.xml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@
5050
<click selector="{{GuestCheckoutShippingSection.firstShippingMethod}}" stepKey="selectFirstShippingMethod"/>
5151
<waitForElement selector="{{GuestCheckoutShippingSection.next}}" time="30" stepKey="waitForNextButton"/>
5252
<click selector="{{GuestCheckoutShippingSection.next}}" stepKey="clickNext"/>
53+
<actionGroup ref="CheckoutSelectCheckMoneyOrderPaymentActionGroup" stepKey="checkPaymentMethod"/>
5354
<waitForElement selector="{{GuestCheckoutPaymentSection.placeOrder}}" time="30" stepKey="waitForPlaceOrderButton"/>
5455
<conditionalClick selector="{{GuestCheckoutPaymentSection.cartItemsArea}}" dependentSelector="{{GuestCheckoutPaymentSection.cartItemsAreaActive}}" visible="false" stepKey="exposeMiniCart"/>
5556
<see selector="{{GuestCheckoutPaymentSection.cartItems}}" userInput="{{_defaultProduct.name}}" stepKey="seeProductInCart"/>
@@ -75,4 +76,23 @@
7576
<see selector="{{OrderDetailsInformationSection.shippingAddress}}" userInput="{{CustomerAddressSimple.street[0]}}" stepKey="seeAdminOrderShippingAddress"/>
7677
<see selector="{{OrderDetailsInformationSection.itemsOrdered}}" userInput="{{_defaultProduct.name}}" stepKey="seeAdminOrderProduct"/>
7778
</test>
79+
<test name="StorefrontGuestCheckoutWithSidebarDisabledTest" extends="StorefrontGuestCheckoutTest">
80+
<annotations>
81+
<features value="Checkout"/>
82+
<stories value="Checkout via Guest Checkout"/>
83+
<title value="Guest Checkout when Cart sidebar disabled"/>
84+
<description value="Should be able to place an order as a Guest when Cart sidebar is disabled"/>
85+
<severity value="CRITICAL"/>
86+
<testCaseId value="MAGETWO-97155"/>
87+
<group value="checkout"/>
88+
</annotations>
89+
<before>
90+
<magentoCLI command="config:set checkout/sidebar/display 0" stepKey="disableSidebar" />
91+
</before>
92+
<after>
93+
<magentoCLI command="config:set checkout/sidebar/display 1" stepKey="enableSidebar" />
94+
</after>
95+
<remove keyForRemoval="addProductNavigateToCheckout" />
96+
<actionGroup ref="GoToCheckoutFromCartActionGroup" stepKey="guestGoToCheckoutFromCart" after="seeCartQuantity" />
97+
</test>
7898
</tests>

app/code/Magento/Checkout/view/frontend/templates/cart/minicart.phtml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,14 @@
4141
</div>
4242
<?= $block->getChildHtml('minicart.addons') ?>
4343
</div>
44+
<?php else: ?>
45+
<script>
46+
require(['jquery'], function ($) {
47+
$('a.action.showcart').click(function() {
48+
$(document.body).trigger('processStart');
49+
});
50+
});
51+
</script>
4452
<?php endif ?>
4553
<script>
4654
window.checkout = <?= /* @escapeNotVerified */ $block->getSerializedConfig() ?>;

dev/tests/functional/tests/app/Magento/Analytics/Test/TestCase/NavigateMenuTest.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<variation name="NavigateMenuTestBIEssentials" summary="Navigate through BI Essentials admin menu to Sign Up page" ticketId="MAGETWO-63700">
1111
<data name="menuItem" xsi:type="string">Reports > BI Essentials</data>
1212
<data name="waitMenuItemNotVisible" xsi:type="boolean">false</data>
13-
<data name="businessIntelligenceLink" xsi:type="string">https://dashboard.rjmetrics.com/v2/magento/signup</data>
13+
<data name="businessIntelligenceLink" xsi:type="string">https://account.magento.com/onboarding/steps/view/step/gmv/</data>
1414
<constraint name="Magento\Analytics\Test\Constraint\AssertBIEssentialsLink" />
1515
</variation>
1616
<variation name="NavigateMenuTestAdvancedReporting" summary="Navigate through Advanced Reporting admin menu to BI Reports page" ticketId="MAGETWO-65748">

0 commit comments

Comments
 (0)