Skip to content

Commit 4f1fb9b

Browse files
authored
Merge branch '2.4-develop' into 115_Users_can_see_sales_orders_from_other_company
2 parents 51fd401 + 90ab6fc commit 4f1fb9b

File tree

11 files changed

+310
-10
lines changed

11 files changed

+310
-10
lines changed

app/code/Magento/Backend/Test/Mftf/Test/AdminLoginAfterJSMinificationTest.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,15 @@
2424
<actionGroup ref="CliCacheCleanActionGroup" stepKey="cleanCache">
2525
<argument name="tags" value="config"/>
2626
</actionGroup>
27+
<magentoCLI command="setup:static-content:deploy -f" stepKey="deployStaticContent"/>
2728
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>
2829
</before>
2930
<after>
3031
<magentoCLI command="config:set {{MinifyJavaScriptFilesDisableConfigData.path}} {{MinifyJavaScriptFilesDisableConfigData.value}}" stepKey="disableJsMinification"/>
3132
<actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/>
3233
</after>
33-
<see userInput="Dashboard" selector="{{AdminHeaderSection.pageTitle}}" stepKey="seeDashboardTitle"/>
3434
<waitForPageLoad stepKey="waitForPageLoadOnDashboard"/>
35+
<see userInput="Dashboard" selector="{{AdminHeaderSection.pageTitle}}" stepKey="seeDashboardTitle"/>
3536
<actionGroup ref="AssertAdminSuccessLoginActionGroup" stepKey="loggedInSuccessfully"/>
3637
<actionGroup ref="AssertAdminPageIsNot404ActionGroup" stepKey="dontSee404Page"/>
3738
</test>
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
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+
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
9+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
10+
<test name="AdminUpdateCategoryWithProductsDefaultSortingTest">
11+
<annotations>
12+
<features value="Catalog"/>
13+
<stories value="Update categories"/>
14+
<title value="Update category, sort products by default sorting"/>
15+
<description value="Login as admin, update category and sort products"/>
16+
<testCaseId value="MC-25667"/>
17+
<severity value="CRITICAL"/>
18+
<group value="catalog"/>
19+
<group value="mtf_migrated"/>
20+
</annotations>
21+
<before>
22+
<createData entity="defaultSimpleProduct" stepKey="simpleProduct" />
23+
<createData entity="_defaultCategory" stepKey="createCategory"/>
24+
<actionGroup ref="AdminLoginActionGroup" stepKey="loginToAdminPanel"/>
25+
</before>
26+
<after>
27+
<deleteData createDataKey="createCategory" stepKey="deleteCategory"/>
28+
<deleteData createDataKey="simpleProduct" stepKey="deleteSimpleProduct"/>
29+
<actionGroup ref="AdminLogoutActionGroup" stepKey="logoutFromAdmin"/>
30+
<magentoCron groups="index" stepKey="reindexInvalidatedIndices"/>
31+
</after>
32+
33+
<!--Open Category Page-->
34+
<actionGroup ref="GoToAdminCategoryPageByIdActionGroup" stepKey="goToAdminCategoryPage">
35+
<argument name="id" value="$createCategory.id$"/>
36+
</actionGroup>
37+
38+
<!--Update Product Display Setting-->
39+
<waitForElementVisible selector="{{AdminCategoryDisplaySettingsSection.settingsHeader}}" stepKey="waitForDisplaySettingsSection"/>
40+
<conditionalClick selector="{{AdminCategoryDisplaySettingsSection.settingsHeader}}" dependentSelector="{{AdminCategoryDisplaySettingsSection.displayMode}}" visible="false" stepKey="openDisplaySettingsSection"/>
41+
<waitForElementVisible selector="{{CategoryDisplaySettingsSection.productListCheckBox}}" stepKey="waitForAvailableProductListCheckbox"/>
42+
<click selector="{{CategoryDisplaySettingsSection.productListCheckBox}}" stepKey="enableTheAvailableProductList"/>
43+
<selectOption selector="{{CategoryDisplaySettingsSection.productList}}" parameterArray="['Product Name', 'Price']" stepKey="selectPrice"/>
44+
<waitForElementVisible selector="{{CategoryDisplaySettingsSection.defaultProductLisCheckBox}}" stepKey="waitForDefaultProductList"/>
45+
<click selector="{{CategoryDisplaySettingsSection.defaultProductLisCheckBox}}" stepKey="enableTheDefaultProductList"/>
46+
<selectOption selector="{{CategoryDisplaySettingsSection.defaultProductList}}" userInput="name" stepKey="selectProductName"/>
47+
48+
<!--Add Products in Category-->
49+
<actionGroup ref="AdminCategoryAssignProductActionGroup" stepKey="assignSimpleProductToCategory">
50+
<argument name="productSku" value="$simpleProduct.sku$"/>
51+
</actionGroup>
52+
<actionGroup ref="AdminSaveCategoryFormActionGroup" stepKey="saveCategory"/>
53+
54+
<!--Verify Category Title-->
55+
<see selector="{{AdminCategoryContentSection.categoryPageTitle}}" userInput="{{_defaultCategory.name}}" stepKey="seeCategoryNamePageTitle" />
56+
57+
<!--Verify Category in store front page-->
58+
<amOnPage url="{{StorefrontCategoryPage.url($createCategory.custom_attributes[url_key]$)}}" stepKey="openStorefrontCategoryPage"/>
59+
60+
<!--Verify Product in Category-->
61+
<actionGroup ref="AssertStorefrontProductIsPresentOnCategoryPageActionGroup" stepKey="assertSimpleProductOnCategoryPage">
62+
<argument name="productName" value="$simpleProduct.name$"/>
63+
</actionGroup>
64+
65+
<!--Verify product name and sku on Store Front-->
66+
<actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKeyActionGroup" stepKey="assertProductOnStorefrontProductPage">
67+
<argument name="product" value="$simpleProduct$"/>
68+
</actionGroup>
69+
</test>
70+
</tests>
71+

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

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,18 @@
77
-->
88
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
99
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
10-
<test name="AdminUpdateCategoryWithProductsTest">
10+
<test name="AdminUpdateCategoryWithProductsTest" deprecated="Use AdminUpdateCategoryWithProductsDefaultSortingTest instead">
1111
<annotations>
1212
<stories value="Update categories"/>
13-
<title value="Update category, sort products by default sorting"/>
13+
<title value="DEPRECATED. Update category, sort products by default sorting"/>
1414
<description value="Login as admin, update category and sort products"/>
1515
<testCaseId value="MC-6059"/>
1616
<severity value="BLOCKER"/>
1717
<group value="Catalog"/>
1818
<group value="mtf_migrated"/>
19+
<skip>
20+
<issueId value="DEPRECATED">Use AdminUpdateCategoryWithProductsDefaultSortingTest instead</issueId>
21+
</skip>
1922
</annotations>
2023
<before>
2124
<actionGroup ref="AdminLoginActionGroup" stepKey="loginToAdminPanel"/>

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,11 @@
1313
<argument name="address" defaultValue="US_Address_TX" type="entity"/>
1414
</arguments>
1515
<conditionalClick selector="{{CheckoutCartSummarySection.estimateShippingAndTax}}" dependentSelector="{{CheckoutCartSummarySection.estimateShippingAndTaxSummary}}" visible="false" stepKey="openShippingDetails"/>
16+
<waitForElementVisible selector="{{CheckoutCartSummarySection.country}}" stepKey="waitForSummarySectionLoad"/>
1617
<selectOption selector="{{CheckoutCartSummarySection.country}}" userInput="{{address.country_id}}" stepKey="selectCountry"/>
1718
<selectOption selector="{{CheckoutCartSummarySection.stateProvince}}" userInput="{{address.state}}" stepKey="selectState"/>
1819
<waitForElementVisible selector="{{CheckoutCartSummarySection.postcode}}" stepKey="waitForPostCodeVisible"/>
1920
<fillField selector="{{CheckoutCartSummarySection.postcode}}" userInput="{{address.postcode}}" stepKey="selectPostCode"/>
2021
<waitForLoadingMaskToDisappear stepKey="waitForLoadingMaskToDiappear"/>
2122
</actionGroup>
22-
</actionGroups>
23+
</actionGroups>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
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+
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
9+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
10+
<test name="StorefrontCheckoutWithDifferentShippingAndBillingAddressAndCreateCustomerAfterCheckoutTest">
11+
<annotations>
12+
<stories value="Checkout"/>
13+
<title value="Verify UK customer checkout with different billing and shipping address and register customer after checkout"/>
14+
<description value="Checkout as UK customer with different shipping/billing address and register checkout method"/>
15+
<severity value="CRITICAL"/>
16+
<testCaseId value="MC-28288"/>
17+
<group value="mtf_migrated"/>
18+
<group value="checkout"/>
19+
</annotations>
20+
21+
<before>
22+
<actionGroup ref="AdminLoginActionGroup" stepKey="loginToAdminPanel"/>
23+
<createData entity="SimpleProduct2" stepKey="simpleProduct">
24+
<field key="price">50.00</field>
25+
</createData>
26+
</before>
27+
<after>
28+
<!-- Sign out Customer from storefront -->
29+
<actionGroup ref="StorefrontCustomerLogoutActionGroup" stepKey="logoutCustomer"/>
30+
<deleteData createDataKey="simpleProduct" stepKey="deleteProduct"/>
31+
<actionGroup ref="AdminDeleteCustomerActionGroup" stepKey="deleteCustomer">
32+
<argument name="customerEmail" value="UKCustomer.email"/>
33+
</actionGroup>
34+
<actionGroup ref="ClearFiltersAdminDataGridActionGroup" stepKey="clearCustomersGridFilter"/>
35+
<actionGroup ref="AdminLogoutActionGroup" stepKey="logoutFromAdmin"/>
36+
</after>
37+
38+
<!--Open Product page in StoreFront and assert product and price range -->
39+
<actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKeyActionGroup" stepKey="openProductPageAndVerifyProduct">
40+
<argument name="product" value="$simpleProduct$"/>
41+
</actionGroup>
42+
43+
<!--Add product to the cart -->
44+
<actionGroup ref="AddSimpleProductToCartActionGroup" stepKey="addProductToCart">
45+
<argument name="product" value="$simpleProduct$"/>
46+
</actionGroup>
47+
48+
<!--Open View and edit -->
49+
<actionGroup ref="ClickViewAndEditCartFromMiniCartActionGroup" stepKey="openCartFromMiniCart"/>
50+
51+
<!-- Fill the Estimate Shipping and Tax section -->
52+
<actionGroup ref="CheckoutFillEstimateShippingAndTaxActionGroup" stepKey="fillEstimateShippingAndTaxFields"/>
53+
<click selector="{{CheckoutCartSummarySection.proceedToCheckout}}" stepKey="goToCheckout"/>
54+
<waitForPageLoad stepKey="waitForPageToLoad"/>
55+
56+
<!-- Fill the guest form -->
57+
<actionGroup ref="FillGuestCheckoutShippingAddressFormActionGroup" stepKey="fillGuestShippingAddress">
58+
<argument name="customer" value="UKCustomer"/>
59+
<argument name="customerAddress" value="updateCustomerUKAddress"/>
60+
</actionGroup>
61+
<actionGroup ref="CheckoutSelectFlatRateShippingMethodActionGroup" stepKey="selectFlatRateShipping"/>
62+
<actionGroup ref="StorefrontCheckoutClickNextOnShippingStepActionGroup" stepKey="goToBillingStep"/>
63+
<waitForElementVisible selector="{{CheckoutPaymentSection.billingAddressNotSameCheckbox}}" stepKey="waitForSameBillingAndShippingAddressCheckboxVisible"/>
64+
<uncheckOption selector="{{CheckoutPaymentSection.billingAddressNotSameCheckbox}}" stepKey="uncheckSameBillingAndShippingAddress"/>
65+
<conditionalClick selector="{{CheckoutShippingSection.editAddressButton}}" dependentSelector="{{CheckoutShippingSection.editAddressButton}}" visible="true" stepKey="clickEditBillingAddressButton"/>
66+
67+
<!-- Fill Billing Address -->
68+
<actionGroup ref="StorefrontFillBillingAddressActionGroup" stepKey="fillBillingAddressForm"/>
69+
<click selector="{{CheckoutPaymentSection.update}}" stepKey="clickOnUpdateBillingAddressButton"/>
70+
71+
<!--Place order -->
72+
<actionGroup ref="ClickPlaceOrderActionGroup" stepKey="clickOnPlaceOrder"/>
73+
<seeElement selector="{{StorefrontMinicartSection.emptyMiniCart}}" stepKey="assertEmptyCart" />
74+
<grabTextFrom selector="{{CheckoutSuccessMainSection.orderNumberWithoutLink}}" stepKey="orderId"/>
75+
76+
<!-- Register customer after checkout -->
77+
<actionGroup ref="StorefrontRegisterCustomerAfterCheckoutActionGroup" stepKey="registerCustomer"/>
78+
79+
<!-- Open Order Page in admin -->
80+
<actionGroup ref="OpenOrderByIdActionGroup" stepKey="openOrder">
81+
<argument name="orderId" value="{$orderId}"/>
82+
</actionGroup>
83+
84+
<!-- Assert Grand Total -->
85+
<see selector="{{AdminOrderTotalSection.grandTotal}}" userInput="$55.00" stepKey="seeGrandTotal"/>
86+
<see selector="{{AdminOrderDetailsInformationSection.orderStatus}}" userInput="Pending" stepKey="seeOrderStatus"/>
87+
88+
<!-- Ship the order and assert the status -->
89+
<actionGroup ref="GoToShipmentIntoOrderActionGroup" stepKey="goToShipment"/>
90+
<actionGroup ref="SubmitShipmentIntoOrderActionGroup" stepKey="submitShipment"/>
91+
92+
<!-- Assert order buttons -->
93+
<actionGroup ref="AdminAssertOrderAvailableButtonsActionGroup" stepKey="assertOrderButtons"/>
94+
</test>
95+
</tests>

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

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,17 @@
77
-->
88
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
99
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
10-
<test name="StorefrontCheckoutWithDifferentShippingAndBillingAddressAndRegisterCustomerAfterCheckoutTest">
10+
<test name="StorefrontCheckoutWithDifferentShippingAndBillingAddressAndRegisterCustomerAfterCheckoutTest" deprecated="Use StorefrontCheckoutWithDifferentShippingAndBillingAddressAndCreateCustomerAfterCheckoutTest instead">
1111
<annotations>
1212
<stories value="Checkout"/>
13-
<title value="Verify UK customer checkout with different billing and shipping address and register customer after checkout"/>
13+
<title value="DEPRECATED. Verify UK customer checkout with different billing and shipping address and register customer after checkout"/>
1414
<description value="Checkout as UK customer with different shipping/billing address and register checkout method"/>
1515
<severity value="CRITICAL"/>
1616
<testCaseId value="MC-14712"/>
1717
<group value="mtf_migrated"/>
18+
<skip>
19+
<issueId value="DEPRECATED">Use StorefrontCheckoutWithDifferentShippingAndBillingAddressAndCreateCustomerAfterCheckoutTest instead</issueId>
20+
</skip>
1821
</annotations>
1922

2023
<before>

app/code/Magento/Customer/view/adminhtml/web/js/form/components/insert-listing.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,9 @@ define([
6262
* @param {Object} data - customer address
6363
*/
6464
deleteMassaction: function (data) {
65-
var ids = _.map(data, function (val) {
65+
var ids = data.selected || this.selections().selected();
66+
67+
ids = _.map(ids, function (val) {
6668
return parseFloat(val);
6769
});
6870

app/code/Magento/Customer/view/base/ui_component/customer_form.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -511,7 +511,7 @@
511511
<imports>true</imports>
512512
</dataLinks>
513513
<externalProvider>customer_address_listing.customer_address_listing_data_source</externalProvider>
514-
<selectionsProvider>customer_address_listing.customer_address_listing.customer_address_listing_columns.ids</selectionsProvider>
514+
<selectionsProvider>customer_address_listing.customer_address_listing.customer_address_columns.ids</selectionsProvider>
515515
<autoRender>true</autoRender>
516516
<dataScope>customer_address_listing</dataScope>
517517
<ns>customer_address_listing</ns>

app/code/Magento/Sitemap/Model/Observer.php

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,15 @@
33
* Copyright © Magento, Inc. All rights reserved.
44
* See COPYING.txt for license details.
55
*/
6+
declare(strict_types=1);
7+
68
namespace Magento\Sitemap\Model;
79

8-
use Magento\Sitemap\Model\EmailNotification as SitemapEmail;
10+
use Magento\Framework\App\Area;
911
use Magento\Framework\App\Config\ScopeConfigInterface;
12+
use Magento\Sitemap\Model\EmailNotification as SitemapEmail;
1013
use Magento\Sitemap\Model\ResourceModel\Sitemap\CollectionFactory;
14+
use Magento\Store\Model\App\Emulation;
1115
use Magento\Store\Model\ScopeInterface;
1216

1317
/**
@@ -61,20 +65,28 @@ class Observer
6165
*/
6266
private $emailNotification;
6367

68+
/**
69+
* @var Emulation
70+
*/
71+
private $appEmulation;
72+
6473
/**
6574
* Observer constructor.
6675
* @param ScopeConfigInterface $scopeConfig
6776
* @param CollectionFactory $collectionFactory
6877
* @param EmailNotification $emailNotification
78+
* @param Emulation $appEmulation
6979
*/
7080
public function __construct(
7181
ScopeConfigInterface $scopeConfig,
7282
CollectionFactory $collectionFactory,
73-
SitemapEmail $emailNotification
83+
SitemapEmail $emailNotification,
84+
Emulation $appEmulation
7485
) {
7586
$this->scopeConfig = $scopeConfig;
7687
$this->collectionFactory = $collectionFactory;
7788
$this->emailNotification = $emailNotification;
89+
$this->appEmulation = $appEmulation;
7890
}
7991

8092
/**
@@ -105,9 +117,16 @@ public function scheduledGenerateSitemaps()
105117
foreach ($collection as $sitemap) {
106118
/* @var $sitemap \Magento\Sitemap\Model\Sitemap */
107119
try {
120+
$this->appEmulation->startEnvironmentEmulation(
121+
$sitemap->getStoreId(),
122+
Area::AREA_FRONTEND,
123+
true
124+
);
108125
$sitemap->generateXml();
109126
} catch (\Exception $e) {
110127
$errors[] = $e->getMessage();
128+
} finally {
129+
$this->appEmulation->stopEnvironmentEmulation();
111130
}
112131
}
113132
if ($errors && $recipient) {

app/code/Magento/Sitemap/Test/Unit/Model/ObserverTest.php

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,4 +142,39 @@ public function testScheduledGenerateSitemapsSendsExceptionEmail()
142142

143143
$this->observer->scheduledGenerateSitemaps();
144144
}
145+
146+
/**
147+
* Test if cron scheduled XML sitemap generation will start and stop the store environment emulation
148+
*
149+
* @throws \Exception
150+
*/
151+
public function testCronGenerateSitemapEnvironmentEmulation()
152+
{
153+
$storeId = 1;
154+
155+
$this->scopeConfigMock->expects($this->once())->method('isSetFlag')->willReturn(true);
156+
157+
$this->collectionFactoryMock->expects($this->once())
158+
->method('create')
159+
->willReturn($this->sitemapCollectionMock);
160+
161+
$this->sitemapCollectionMock->expects($this->any())
162+
->method('getIterator')
163+
->willReturn(new \ArrayIterator([$this->sitemapMock]));
164+
165+
$this->sitemapMock->expects($this->at(0))
166+
->method('getStoreId')
167+
->willReturn($storeId);
168+
169+
$this->sitemapMock->expects($this->once())
170+
->method('generateXml');
171+
172+
$this->appEmulationMock->expects($this->once())
173+
->method('startEnvironmentEmulation');
174+
175+
$this->appEmulationMock->expects($this->once())
176+
->method('stopEnvironmentEmulation');
177+
178+
$this->observer->scheduledGenerateSitemaps();
179+
}
145180
}

0 commit comments

Comments
 (0)