Skip to content

Commit d7ac52b

Browse files
authored
Merge pull request #3586 from magento-tsg/2.3-develop-pr39
[TSG] Upporting for 2.3 (pr39) (2.3.1)
2 parents e62d140 + 706aec8 commit d7ac52b

File tree

35 files changed

+658
-334
lines changed

35 files changed

+658
-334
lines changed

app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminProductGridActionGroup.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,7 @@
243243
<click selector="{{AdminProductGridSection.bulkActionDropdown}}" stepKey="clickActionDropdown"/>
244244
<click selector="{{AdminProductGridSection.bulkActionOption('Change status')}}" stepKey="clickChangeStatusAction"/>
245245
<click selector="{{AdminProductGridSection.changeStatus('status')}}" stepKey="clickChangeStatusDisabled" parameterized="true"/>
246+
<waitForPageLoad stepKey="waitForStatusToBeChanged"/>
246247
<see selector="{{AdminMessagesSection.success}}" userInput="A total of 1 record(s) have been updated." stepKey="seeSuccessMessage"/>
247248
<waitForLoadingMaskToDisappear stepKey="waitForMaskToDisappear"/>
248249
<conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFiltersInitial2"/>

app/code/Magento/Catalog/Test/Mftf/Test/AdminFilteringCategoryProductsUsingScopeSelectorTest.xml

Lines changed: 23 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -19,19 +19,19 @@
1919
</annotations>
2020
<before>
2121
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/>
22-
<!--Create website, Sore adn Store View-->
23-
<actionGroup ref="AdminCreateWebsiteActionGroup" stepKey="adminCreateWebsite">
24-
<argument name="newWebsiteName" value="secondWebsite"/>
25-
<argument name="websiteCode" value="second_website"/>
22+
<!--Create website, Store and Store View-->
23+
<actionGroup ref="AdminCreateWebsiteActionGroup" stepKey="createSecondWebsite">
24+
<argument name="newWebsiteName" value="{{secondCustomWebsite.name}}"/>
25+
<argument name="websiteCode" value="{{secondCustomWebsite.code}}"/>
2626
</actionGroup>
27-
<actionGroup ref="AdminCreateNewStoreGroupActionGroup" stepKey="adminCreateStore">
28-
<argument name="website" value="secondWebsite"/>
29-
<argument name="storeGroupName" value="secondStore"/>
30-
<argument name="storeGroupCode" value="second_store"/>
27+
<actionGroup ref="AdminCreateNewStoreGroupActionGroup" stepKey="createSecondStoreGroup">
28+
<argument name="website" value="{{secondCustomWebsite.name}}"/>
29+
<argument name="storeGroupName" value="{{SecondStoreGroupUnique.name}}"/>
30+
<argument name="storeGroupCode" value="{{SecondStoreGroupUnique.code}}"/>
3131
</actionGroup>
32-
<actionGroup ref="AdminCreateStoreViewActionGroup" stepKey="adminCreateStoreView">
33-
<argument name="StoreGroup" value="customStoreTierPrice"/>
34-
<argument name="customStore" value="customStoreView"/>
32+
<actionGroup ref="AdminCreateStoreViewActionGroup" stepKey="createSecondStoreView">
33+
<argument name="StoreGroup" value="SecondStoreGroupUnique"/>
34+
<argument name="customStore" value="SecondStoreUnique"/>
3535
</actionGroup>
3636

3737
<!--Create Simple Product and Category -->
@@ -60,9 +60,7 @@
6060
<click selector="{{ProductInWebsitesSection.sectionHeader}}" stepKey="clickToOpenWebsiteSection"/>
6161
<waitForPageLoad stepKey="waitForToOpenedWebsiteSection"/>
6262
<uncheckOption selector="{{ProductInWebsitesSection.website('Main Website')}}" stepKey="uncheckWebsite"/>
63-
<click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="clickSaveProduct"/>
64-
<see selector="{{AdminProductMessagesSection.successMessage}}" userInput="You saved the product."
65-
stepKey="seeSuccessMessage"/>
63+
<actionGroup ref="saveProductForm" stepKey="saveProduct1"/>
6664

6765
<!-- Set filter to product name and product2 in website 2 only -->
6866
<actionGroup ref="SearchForProductOnBackendActionGroup" stepKey="searchForProduct2">
@@ -72,12 +70,10 @@
7270
<argument name="product" value="$$createProduct2$$"/>
7371
</actionGroup>
7472
<actionGroup ref="SelectProductInWebsitesActionGroup" stepKey="selectProductInWebsites">
75-
<argument name="website" value="secondWebsite"/>
73+
<argument name="website" value="{{secondCustomWebsite.name}}"/>
7674
</actionGroup>
7775
<uncheckOption selector="{{ProductInWebsitesSection.website('Main Website')}}" stepKey="uncheckWebsite1"/>
78-
<click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="clickSaveProduct1"/>
79-
<see selector="{{AdminProductMessagesSection.successMessage}}" userInput="You saved the product."
80-
stepKey="seeSuccessMessage1"/>
76+
<actionGroup ref="saveProductForm" stepKey="saveProduct2"/>
8177

8278
<!-- Set filter to product name and product12 assigned to both websites 1 and 2 -->
8379
<actionGroup ref="SearchForProductOnBackendActionGroup" stepKey="searchForProduct12">
@@ -87,15 +83,13 @@
8783
<argument name="product" value="$$createProduct12$$"/>
8884
</actionGroup>
8985
<actionGroup ref="SelectProductInWebsitesActionGroup" stepKey="selectProductInWebsites1">
90-
<argument name="website" value="secondWebsite"/>
86+
<argument name="website" value="{{secondCustomWebsite.name}}"/>
9187
</actionGroup>
92-
<click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="clickSaveProduct2"/>
93-
<see selector="{{AdminProductMessagesSection.successMessage}}" userInput="You saved the product."
94-
stepKey="seeSuccessMessage2"/>
88+
<actionGroup ref="saveProductForm" stepKey="saveProduct3"/>
9589
</before>
9690
<after>
9791
<actionGroup ref="AdminDeleteWebsiteActionGroup" stepKey="deleteWebsite">
98-
<argument name="websiteName" value="secondWebsite"/>
92+
<argument name="websiteName" value="{{secondCustomWebsite.name}}"/>
9993
</actionGroup>
10094
<actionGroup ref="ClearProductsFilterActionGroup" stepKey="clearProductsFilter"/>
10195
<deleteData createDataKey="createProduct0" stepKey="deleteProduct"/>
@@ -107,7 +101,6 @@
107101
</after>
108102
<!-- Step 1-2: Open Category page and Set scope selector to All Store Views-->
109103
<amOnPage url="{{AdminCategoryPage.url}}" stepKey="goToCategoryPage"/>
110-
<waitForPageLoad stepKey="waitForCategoryPageLoad"/>
111104
<click selector="{{AdminCategorySidebarTreeSection.categoryInTree($$createCategory.name$$)}}"
112105
stepKey="clickCategoryName"/>
113106
<click selector="{{AdminCategoryProductsSection.sectionHeader}}" stepKey="openProductSection"/>
@@ -126,17 +119,9 @@
126119

127120
<!-- Step 3: Set scope selector to Website1( Storeview for the Website 1) -->
128121
<scrollToTopOfPage stepKey="scrollToTopOfPage"/>
129-
<click selector="{{AdminCategoryMainActionsSection.CategoryStoreViewDropdownToggle}}"
130-
stepKey="clickStoresList"/>
131-
<waitForPageLoad stepKey="waitForCategoryPageLoad1"/>
132-
<click selector="{{AdminCategoryMainActionsSection.CategoryStoreViewOption('Default Store View')}}"
133-
stepKey="clickStoreView"/>
134-
<waitForElementVisible selector="{{AdminCategoryMainActionsSection.CategoryStoreViewModalAccept}}"
135-
stepKey="waitForPopup1"/>
136-
<click selector="{{AdminCategoryMainActionsSection.CategoryStoreViewModalAccept}}" stepKey="clickActionAccept"/>
137-
<waitForElementNotVisible selector="{{AdminCategoryMainActionsSection.CategoryStoreViewModalAccept}}"
138-
stepKey="waitForNotVisibleModalAccept"/>
139-
<waitForPageLoad stepKey="waitForCategoryPageLoad2"/>
122+
<actionGroup ref="AdminSwitchStoreViewActionGroup" stepKey="swichToDefaultStoreView">
123+
<argument name="storeView" value="_defaultStore.name"/>
124+
</actionGroup>
140125
<grabTextFrom selector="{{AdminCategorySidebarTreeSection.categoryInTree($$createCategory.name$$)}}"
141126
stepKey="grabTextFromCategory1"/>
142127
<assertRegExp expected="/\(2\)$/" expectedType="string" actual="$grabTextFromCategory1" actualType="variable"
@@ -154,18 +139,9 @@
154139

155140
<!-- Step 4: Set scope selector to Website2 ( StoreView for Website 2) -->
156141
<scrollToTopOfPage stepKey="scrollToTopOfPage1"/>
157-
<click selector="{{AdminCategoryMainActionsSection.CategoryStoreViewDropdownToggle}}"
158-
stepKey="clickStoresList1"/>
159-
<waitForPageLoad stepKey="waitForCategoryPageLoad3"/>
160-
<click selector="{{AdminCategoryMainActionsSection.CategoryStoreViewOption('secondStoreView')}}"
161-
stepKey="clickStoreView1"/>
162-
<waitForElementVisible selector="{{AdminCategoryMainActionsSection.CategoryStoreViewModalAccept}}"
163-
stepKey="waitForPopup2"/>
164-
<click selector="{{AdminCategoryMainActionsSection.CategoryStoreViewModalAccept}}"
165-
stepKey="clickActionAccept1"/>
166-
<waitForElementNotVisible selector="{{AdminCategoryMainActionsSection.CategoryStoreViewModalAccept}}"
167-
stepKey="waitForNotVisibleModalAccept1"/>
168-
<waitForPageLoad stepKey="waitForCategoryPageLoad4"/>
142+
<actionGroup ref="AdminSwitchStoreViewActionGroup" stepKey="swichToSecondStoreView">
143+
<argument name="storeView" value="SecondStoreUnique.name"/>
144+
</actionGroup>
169145
<click selector="{{AdminCategoryProductsSection.sectionHeader}}" stepKey="openProductSection2"/>
170146
<grabTextFrom selector="{{AdminCategorySidebarTreeSection.categoryInTree($$createCategory.name$$)}}"
171147
stepKey="grabTextFromCategory2"/>

app/code/Magento/CatalogImportExport/Model/Export/Product.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1158,7 +1158,7 @@ protected function collectMultiselectValues($item, $attrCode, $storeId)
11581158
}
11591159

11601160
/**
1161-
* Check attribute is valid
1161+
* Check attribute is valid.
11621162
*
11631163
* @param string $code
11641164
* @param mixed $value
@@ -1175,6 +1175,10 @@ protected function isValidAttributeValue($code, $value)
11751175
$isValid = false;
11761176
}
11771177

1178+
if (is_array($value)) {
1179+
$isValid = false;
1180+
}
1181+
11781182
return $isValid;
11791183
}
11801184

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
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="StorefrontGuestCheckoutDataPersistTest">
12+
<annotations>
13+
<features value="Checkout"/>
14+
<stories value="MAGETWO-95068: Checkout data (shipping address etc) not persistant after cart update"/>
15+
<title value="Check that checkout data persist after cart update"/>
16+
<description value="Checkout data should be persist after updating cart"/>
17+
<severity value="CRITICAL"/>
18+
<testCaseId value="MAGETWO-96979"/>
19+
<group value="checkout"/>
20+
</annotations>
21+
<before>
22+
<createData entity="_defaultCategory" stepKey="createCategory"/>
23+
<createData entity="_defaultProduct" stepKey="createProduct">
24+
<requiredEntity createDataKey="createCategory"/>
25+
</createData>
26+
</before>
27+
<after>
28+
<deleteData createDataKey="createCategory" stepKey="deleteCategory"/>
29+
<deleteData createDataKey="createProduct" stepKey="deleteProduct"/>
30+
</after>
31+
32+
<!-- Add simple product to cart -->
33+
<actionGroup ref="AddSimpleProductToCart" stepKey="addProductToCart">
34+
<argument name="product" value="$$createProduct$$"/>
35+
</actionGroup>
36+
<!-- Navigate to checkout -->
37+
<actionGroup ref="GoToCheckoutFromMinicartActionGroup" stepKey="goToCheckoutFromMinicart"/>
38+
<!-- Fill shipping address -->
39+
<actionGroup ref="GuestCheckoutFillingShippingSectionActionGroup" stepKey="guestCheckoutFillingShipping">
40+
<argument name="shippingMethod" value="Flat Rate"/>
41+
</actionGroup>
42+
<!-- Add simple product to cart -->
43+
<actionGroup ref="AddSimpleProductToCart" stepKey="addProductToCart1">
44+
<argument name="product" value="$$createProduct$$"/>
45+
</actionGroup>
46+
<!-- Navigate to checkout -->
47+
<actionGroup ref="GoToCheckoutFromMinicartActionGroup" stepKey="goToCheckoutFromMinicart1"/>
48+
<seeInField selector="{{CheckoutShippingGuestInfoSection.email}}" userInput="{{CustomerEntityOne.email}}" stepKey="assertGuestEmail"/>
49+
<seeInField selector="{{CheckoutShippingGuestInfoSection.firstName}}" userInput="{{CustomerEntityOne.firstname}}" stepKey="assertGuestFirstName"/>
50+
<seeInField selector="{{CheckoutShippingGuestInfoSection.lastName}}" userInput="{{CustomerEntityOne.lastname}}" stepKey="assertGuestLastName"/>
51+
<seeInField selector="{{CheckoutShippingGuestInfoSection.street}}" userInput="{{CustomerAddressSimple.street[0]}}" stepKey="assertGuestStreet"/>
52+
<seeInField selector="{{CheckoutShippingGuestInfoSection.city}}" userInput="{{CustomerAddressSimple.city}}" stepKey="assertGuestCity"/>
53+
<seeInField selector="{{CheckoutShippingGuestInfoSection.region}}" userInput="{{CustomerAddressSimple.state}}" stepKey="assertGuestRegion"/>
54+
<seeInField selector="{{CheckoutShippingGuestInfoSection.postcode}}" userInput="{{CustomerAddressSimple.postcode}}" stepKey="assertGuestPostcode"/>
55+
<seeInField selector="{{CheckoutShippingGuestInfoSection.telephone}}" userInput="{{CustomerAddressSimple.telephone}}" stepKey="assertGuestTelephone"/>
56+
</test>
57+
</tests>
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
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+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="CustomerLogoutStorefrontByMenuItemsActionGroup">
12+
<conditionalClick selector="{{StorefrontPanelHeaderSection.customerWelcome}}"
13+
dependentSelector="{{StorefrontPanelHeaderSection.customerWelcomeMenu}}"
14+
visible="false"
15+
stepKey="clickHeaderCustomerMenuButton" />
16+
<click selector="{{StorefrontPanelHeaderSection.customerLogoutLink}}" stepKey="clickSignOutButton" />
17+
</actionGroup>
18+
</actionGroups>
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
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+
<pages xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
9+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/PageObject.xsd">
10+
<page name="StorefrontCustomerLogoutSuccessPage" url="customer/account/logoutSuccess/" area="storefront" module="Magento_Customer"/>
11+
</pages>

app/code/Magento/Customer/Test/Mftf/Section/StorefrontPanelHeaderSection.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,8 @@
1212
<element name="WelcomeMessage" type="text" selector=".greet.welcome span"/>
1313
<element name="createAnAccountLink" type="select" selector=".panel.header li:nth-child(3)" timeout="30"/>
1414
<element name="notYouLink" type="button" selector=".greet.welcome span a"/>
15+
<element name="customerWelcome" type="text" selector=".panel.header .customer-welcome"/>
16+
<element name="customerWelcomeMenu" type="text" selector=".panel.header .customer-welcome .customer-menu"/>
17+
<element name="customerLogoutLink" type="text" selector=".panel.header .customer-welcome .customer-menu .authorization-link a" timeout="30"/>
1518
</section>
1619
</sections>

app/code/Magento/Customer/view/frontend/web/js/customer-data.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,9 @@ define([
216216
$.cookieStorage.set(privateContentVersion, privateContent);
217217
}
218218
$.localStorage.set(privateContentVersion, privateContent);
219+
_.each(dataProvider.getFromStorage(storage.keys()), function (sectionData, sectionName) {
220+
buffer.notify(sectionName, sectionData);
221+
});
219222
this.reload([], false);
220223
isLoading = true;
221224
} else if (expiredSectionNames.length > 0) {

app/code/Magento/Persistent/Block/Header/Additional.php

Lines changed: 43 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@
55
*/
66
namespace Magento\Persistent\Block\Header;
77

8+
use Magento\Framework\App\ObjectManager;
9+
use Magento\Framework\Serialize\Serializer\Json;
10+
use Magento\Persistent\Helper\Data;
11+
812
/**
913
* Remember Me block
1014
*
@@ -30,27 +34,46 @@ class Additional extends \Magento\Framework\View\Element\Html\Link
3034
protected $customerRepository;
3135

3236
/**
33-
* Constructor
34-
*
37+
* @var string
38+
*/
39+
protected $_template = 'Magento_Persistent::additional.phtml';
40+
41+
/**
42+
* @var Json
43+
*/
44+
private $jsonSerializer;
45+
46+
/**
47+
* @var Data
48+
*/
49+
private $persistentHelper;
50+
51+
/**
3552
* @param \Magento\Framework\View\Element\Template\Context $context
3653
* @param \Magento\Customer\Helper\View $customerViewHelper
3754
* @param \Magento\Persistent\Helper\Session $persistentSessionHelper
3855
* @param \Magento\Customer\Api\CustomerRepositoryInterface $customerRepository
3956
* @param array $data
57+
* @param Json|null $jsonSerializer
58+
* @param Data|null $persistentHelper
4059
*/
4160
public function __construct(
4261
\Magento\Framework\View\Element\Template\Context $context,
4362
\Magento\Customer\Helper\View $customerViewHelper,
4463
\Magento\Persistent\Helper\Session $persistentSessionHelper,
4564
\Magento\Customer\Api\CustomerRepositoryInterface $customerRepository,
46-
array $data = []
65+
array $data = [],
66+
Json $jsonSerializer = null,
67+
Data $persistentHelper = null
4768
) {
4869
$this->isScopePrivate = true;
4970
$this->_customerViewHelper = $customerViewHelper;
5071
$this->_persistentSessionHelper = $persistentSessionHelper;
5172
$this->customerRepository = $customerRepository;
5273
parent::__construct($context, $data);
5374
$this->_isScopePrivate = true;
75+
$this->jsonSerializer = $jsonSerializer ?: ObjectManager::getInstance()->get(Json::class);
76+
$this->persistentHelper = $persistentHelper ?: ObjectManager::getInstance()->get(Data::class);
5477
}
5578

5679
/**
@@ -64,17 +87,26 @@ public function getHref()
6487
}
6588

6689
/**
67-
* Render additional header html
90+
* Get customer id.
6891
*
69-
* @return string
92+
* @return int
7093
*/
71-
protected function _toHtml()
94+
public function getCustomerId(): int
7295
{
73-
if ($this->_persistentSessionHelper->getSession()->getCustomerId()) {
74-
return '<span><a ' . $this->getLinkAttributes() . ' >' . __('Not you?')
75-
. '</a></span>';
76-
}
96+
return $this->_persistentSessionHelper->getSession()->getCustomerId();
97+
}
7798

78-
return '';
99+
/**
100+
* Get persistent config.
101+
*
102+
* @return string
103+
*/
104+
public function getConfig(): string
105+
{
106+
return $this->jsonSerializer->serialize(
107+
[
108+
'expirationLifetime' => $this->persistentHelper->getLifeTime(),
109+
]
110+
);
79111
}
80112
}

0 commit comments

Comments
 (0)