Skip to content

Commit b709ae4

Browse files
committed
Merge branch '2.4-develop' of https://github.com/magento-commerce/magento2ce into PR-05242023
2 parents 5b69df9 + 827073a commit b709ae4

File tree

62 files changed

+2256
-26
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

62 files changed

+2256
-26
lines changed

app/code/Magento/Backend/Test/Mftf/Section/LocaleOptionsSection.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,8 @@
1818
<element name="defaultLocale" type="checkbox" selector="#general_locale_code_inherit"/>
1919
<element name="checkIfTabExpand" type="button" selector="#general_locale-head:not(.open)"/>
2020
<element name="timeZoneDropdown" type="select" selector="//select[@id='general_locale_timezone']"/>
21+
<element name="changeStoreConfigButton" type="button" selector="//button[@id='store-change-button']"/>
22+
<element name="changeStoreConfigToSpecificWebsite" type="select" selector="//a[contains(text(),'{{var}}')]" parameterized="true"/>
23+
<element name="changeWebsiteConfirmButton" type="button" selector="//button[@class='action-primary action-accept']/span"/>
2124
</section>
2225
</sections>
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
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="AdminDeleteCreatedColorSpecificAttributeActionGroup" >
12+
<annotations>
13+
<description>Delete the created new colors in color attribute</description>
14+
</annotations>
15+
<arguments>
16+
<argument name="Color" type="string"/>
17+
</arguments>
18+
<amOnPage url="{{AdminProductAttributeGridPage.url}}" stepKey="navigateToProductAttributeGrid"/>
19+
<conditionalClick selector="{{AdminDataGridHeaderSection.clearFilters}}" dependentSelector="{{AdminDataGridHeaderSection.clearFilters}}" visible="true" stepKey="clearExistingFilters"/>
20+
<fillField selector="{{AdminProductAttributeGridSection.FilterByAttributeCode}}" userInput="Color" stepKey="setAttributeCode"/>
21+
<click selector="{{AdminProductAttributeGridSection.Search}}" stepKey="searchForAttributeFromTheGrid"/>
22+
<click selector="{{AdminProductAttributeGridSection.FirstRow}}" stepKey="clickOnAttributeRow"/>
23+
<waitForPageLoad stepKey="waitForPageLoad2"/>
24+
<click selector="{{AdminProductAttributeGridSection.deleteSpecificColorAttribute(Color)}}" stepKey="deleteColor"/>
25+
<waitForPageLoad stepKey="waitForPageLoad3"/>
26+
<click selector="{{AttributePropertiesSection.Save}}" stepKey="saveTheDeletedColor"/>
27+
<see userInput="You saved the product attribute." stepKey="seeSuccessMessage"/>
28+
</actionGroup>
29+
</actionGroups>

app/code/Magento/Catalog/Test/Mftf/Section/AdminProductAttributeGridSection.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
<element name="isSearchableColumn" type="text" selector="//div[@id='attributeGrid']//td[contains(@class,'a-center col-is_searchable')]"/>
2525
<element name="isComparableColumn" type="text" selector="//div[@id='attributeGrid']//td[contains(@class,'a-center col-is_comparable')]"/>
2626
<element name="addSelected" type="button" selector="//*[contains(text(),'Add Selected')]" timeout="30"/>
27+
<element name="deleteSpecificColorAttribute" type="button" selector="//input[@value='{{var}}']/../..//button[@class='action- scalable delete delete-option']" parameterized="true"/>
2728
</section>
2829
</sections>
2930

app/code/Magento/Catalog/Test/Mftf/Section/AdminProductFormSection/AdminProductFormSection.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,5 +83,9 @@
8383
<element name="newAddedAttributeValue" type="text" selector="//option[contains(@data-title,'{{attributeValue}}')]" parameterized="true"/>
8484
<element name="country_Of_Manufacture" type="select" selector="//td[contains(text(), 'country_of_manufacture')]"/>
8585
<element name="textArea" type="text" selector="//textarea[@name='product[test_custom_attribute]']" timeout="30"/>
86+
<element name="assignedSourcesQty" type="input" selector="//input[@name='sources[assigned_sources][0][quantity]']"/>
87+
<element name="btnAdvancedInventory" type="button" selector="//button//span[text()='Advanced Inventory']/.."/>
88+
<element name="saveCategory" type="button" selector="//button[@data-action='close-advanced-select']" timeout="30"/>
89+
<element name="attributeRequiredInputField" type="select" selector="//select[contains(@name, 'product[{{attributeCode}}]')]" parameterized="true"/>
8690
</section>
8791
</sections>

app/code/Magento/Catalog/Test/Mftf/Section/StorefrontCategorySidebarSection/StorefrontCategorySidebarSection.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,5 +27,9 @@
2727
<element name="expandPriceLayeredNavigationButton" type="button" selector="//div[@class='filter-options-title'][text()='Price']"/>
2828
<element name="seeLayeredNavigationFirstPriceRange" type="button" selector="//a//span[@class='price' and text()='${{minPrice}}']/..//span[@class='price' and text()='${{maxPrice}}']/..//span[@class='count' and text()=({{count}})]" parameterized="true"/>
2929
<element name="seeLayeredNavigationSecondPriceRange" type="button" selector="//a//span[@class='price' and text()='${{minPrice2}}']/../..//a[text()='{{maxPrice2}}']/..//span[@class='count' and text()=({{count}})]" parameterized="true"/>
30+
<element name="seeLayeredNavigationCategoryTextSwatch" type="text" selector="//div[@class='filter-options-title' and contains(text(),'TextSwatch')]"/>
31+
<element name="seeLayeredNavigationCategoryVisualSwatch" type="text" selector="//div[@class='filter-options-title' and contains(text(),'attribute')]"/>
32+
<element name="seeTextSwatchOption" type="text" selector="//div[@class='swatch-option text ' and contains(text(),'textSwatchOption1')]"/>
33+
<element name="seeVisualSwatchOption" type="text" selector="//div[@class='swatch-option image ']/..//div[@data-option-label='visualSwatchOption2']"/>
3034
</section>
3135
</sections>

app/code/Magento/Catalog/Test/Mftf/Section/StorefrontProductInfoMainSection.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
<element name="productOptionAreaInput" type="textarea" selector="//*[@id='product-options-wrapper']//div[@class='fieldset']//label[contains(.,'{{var1}}')]/../div[@class='control']//textarea" parameterized="true"/>
3131
<element name="productOptionFile" type="file" selector="//*[@id='product-options-wrapper']//div[@class='fieldset']//label[contains(.,'OptionFile')]/../div[@class='control']//input[@type='file']" parameterized="true"/>
3232
<element name="productOptionSelect" type="select" selector="//*[@id='product-options-wrapper']//div[@class='fieldset']//label[contains(.,'{{var1}}')]/../div[@class='control']//select" parameterized="true"/>
33+
<element name="productOptionSelectByColor" type="select" selector=".//option[text()='Choose an Option...']/../../select" />
3334
<element name="asLowAs" type="input" selector="span[class='price-wrapper '] "/>
3435
<element name="asLowAsLabel" type="input" selector="//strong[@id='block-related-heading']/following::span[@class='price-label'][1]"/>
3536
<element name="asLowAsLabelAgain" type="input" selector="//strong[@id='block-related-heading']/following::span[@class='price-label'][2]"/>

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
<actionGroup ref="AdminLoginActionGroup" stepKey="login"/>
2424
<actionGroup ref="AdminOpenProductIndexPageActionGroup" stepKey="openProductIndexPageBefore"/>
2525
<!-- remove the Filter From the page-->
26+
<amOnPage url="{{AdminProductIndexPage.url}}" stepKey="visitAdminProductPage"/>
2627
<actionGroup ref="ClearFiltersAdminProductGridActionGroup" stepKey="clearFilterFromProductIndex"/>
2728
<!--Create Category-->
2829
<createData entity="SimpleSubCategory" stepKey="createCategory"/>
@@ -100,11 +101,11 @@
100101

101102
<!--Click on Go Back button -->
102103
<click selector="{{AdminProductFormActionSection.backButton}}" stepKey="clickBackToGridSimple"/>
103-
104+
<!--Clear filter if available -->
105+
<conditionalClick selector="{{AdminGridFilterControls.clearAll}}" dependentSelector="{{AdminGridFilterControls.clearAll}}" visible="true" stepKey="clearTheFiltersIfPresent"/>
104106
<actionGroup ref="SearchForProductOnBackendActionGroup" stepKey="searchProductOnProductGridPage">
105107
<argument name="product" value="SimpleProduct"/>
106108
</actionGroup>
107-
108109
<!-- Select created attribute as an column -->
109110
<actionGroup ref="ToggleAdminProductGridColumnsDropdownActionGroup" stepKey="openColumnsDropdown"/>
110111
<actionGroup ref="CheckAdminProductGridColumnOptionActionGroup" stepKey="checkCreatedAttributeColumn">
Lines changed: 147 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,147 @@
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="StorefrontVerifyCategoryPageNotCachedTest">
12+
<annotations>
13+
<features value="Catalog"/>
14+
<title value="Verify category page is not cached"/>
15+
<stories value="Product Categories Indexer"/>
16+
<description value="Verify that the category page is NOT cached for customers with different tax rates"/>
17+
<severity value="AVERAGE"/>
18+
<group value="Catalog"/>
19+
<group value="indexer"/>
20+
</annotations>
21+
<before>
22+
<!--Login to Admin Panel-->
23+
<actionGroup ref="AdminLoginActionGroup" stepKey="logInAsAdmin"/>
24+
<!-- Create tax rate for CA -->
25+
<createData entity="US_CA_Rate_1" stepKey="createTaxRateCA"/>
26+
<!-- Create tax rate for TX -->
27+
<createData entity="ThirdTaxRateTexas" stepKey="createTaxRateTX"/>
28+
<!-- Create Tax Rules -->
29+
<actionGroup ref="AdminCreateTaxRuleActionGroup" stepKey="createTaxRule1">
30+
<argument name="taxRate" value="$$createTaxRateCA$$"/>
31+
<argument name="taxRule" value="SimpleTaxRule"/>
32+
</actionGroup>
33+
<actionGroup ref="AdminCreateTaxRuleActionGroup" stepKey="createTaxRule2">
34+
<argument name="taxRate" value="$$createTaxRateTX$$"/>
35+
<argument name="taxRule" value="SimpleTaxRule2"/>
36+
</actionGroup>
37+
<!--Create Customers-->
38+
<createData entity="Simple_US_CA_Customer" stepKey="createCustomerCA"/>
39+
<createData entity="Simple_US_Customer" stepKey="createCustomerTX"/>
40+
<!--Create Category-->
41+
<createData entity="_defaultCategory" stepKey="createCategory"/>
42+
<!--Create Products-->
43+
<createData entity="SimpleProduct" stepKey="simpleProduct">
44+
<field key="price">100</field>
45+
<requiredEntity createDataKey="createCategory"/>
46+
</createData>
47+
<createData entity="SimpleProduct" stepKey="simpleProduct2">
48+
<field key="price">200</field>
49+
<requiredEntity createDataKey="createCategory"/>
50+
</createData>
51+
<!--Display product price including and excluding tax in catalog-->
52+
<magentoCLI command="config:set tax/display/type 3" stepKey="enableShowIncludingExcludingTax"/>
53+
</before>
54+
<after>
55+
<magentoCLI command="config:set tax/display/type 0" stepKey="disableShowIncludingExcludingTax"/>
56+
<!--Delete Products-->
57+
<deleteData createDataKey="simpleProduct" stepKey="deleteProductOne"/>
58+
<deleteData createDataKey="simpleProduct2" stepKey="deleteProductTwo"/>
59+
<!--Delete Category-->
60+
<deleteData createDataKey="createCategory" stepKey="deleteCategory"/>
61+
<!--Delete Tax Rules-->
62+
<actionGroup ref="AdminDeleteTaxRule" stepKey="deleteTaxRule1">
63+
<argument name="taxRuleCode" value="{{SimpleTaxRule.code}}"/>
64+
</actionGroup>
65+
<actionGroup ref="AdminDeleteTaxRule" stepKey="deleteTaxRule2">
66+
<argument name="taxRuleCode" value="{{SimpleTaxRule2.code}}"/>
67+
</actionGroup>
68+
<!--Delete Tax Rates-->
69+
<deleteData createDataKey="createTaxRateCA" stepKey="deleteTaxRate1"/>
70+
<deleteData createDataKey="createTaxRateTX" stepKey="deleteTaxRate2"/>
71+
<!--Delete Customers-->
72+
<deleteData createDataKey="createCustomerCA" stepKey="deleteCustomer1"/>
73+
<deleteData createDataKey="createCustomerTX" stepKey="deleteCustomer2"/>
74+
<!--Logout Admin-->
75+
<actionGroup ref="AdminLogoutActionGroup" stepKey="logoutAdmin"/>
76+
</after>
77+
78+
<!-- Login as customer 1-->
79+
<actionGroup ref="LoginToStorefrontActionGroup" stepKey="storefrontCustomer1Login">
80+
<argument name="Customer" value="$$createCustomerCA$$"/>
81+
</actionGroup>
82+
<!-- Assert Customer Name -->
83+
<actionGroup ref="AssertCustomerWelcomeMessageActionGroup" stepKey="assertCustomerName">
84+
<argument name="customerFullName" value="$$createCustomerCA.firstname$$ $$createCustomerCA.lastname$$" />
85+
</actionGroup>
86+
<!-- Navigate to category page -->
87+
<actionGroup ref="StorefrontNavigateCategoryPageActionGroup" stepKey="navigateToCategoryPage">
88+
<argument name="category" value="$$createCategory$$"/>
89+
</actionGroup>
90+
<!-- Assert Product Prices -->
91+
<actionGroup ref="StorefrontAssertProductPriceOnCategoryPageActionGroup" stepKey="seeProduct1TaxInclusivePriceCustomer1">
92+
<argument name="productName" value="$$simpleProduct.name$$"/>
93+
<argument name="productPrice" value="$108.25"/>
94+
</actionGroup>
95+
<actionGroup ref="StorefrontAssertProductPriceOnCategoryPageActionGroup" stepKey="seeProduct2TaxInclusivePriceCustomer1">
96+
<argument name="productName" value="$$simpleProduct2.name$$"/>
97+
<argument name="productPrice" value="$216.50"/>
98+
</actionGroup>
99+
<!--Add first product to compare list and cart -->
100+
<actionGroup ref="StorefrontOpenProductPageActionGroup" stepKey="openFirstProductPage">
101+
<argument name="productUrl" value="$$simpleProduct.custom_attributes[url_key]$$"/>
102+
</actionGroup>
103+
<actionGroup ref="StorefrontAddProductToCompareActionGroup" stepKey="addFirstProductToCompare">
104+
<argument name="productVar" value="$$simpleProduct$$"/>
105+
</actionGroup>
106+
<actionGroup ref="StorefrontClickAddToCartOnProductPageActionGroup" stepKey="addFirstProductToCart"/>
107+
<!--Add second product to compare list -->
108+
<actionGroup ref="StorefrontOpenProductPageActionGroup" stepKey="openSecondProductPage">
109+
<argument name="productUrl" value="$$simpleProduct2.custom_attributes[url_key]$$"/>
110+
</actionGroup>
111+
<actionGroup ref="StorefrontAddProductToCompareActionGroup" stepKey="addSecondProductToCompare">
112+
<argument name="productVar" value="$$simpleProduct2$$"/>
113+
</actionGroup>
114+
<!--Add second product to wishlist -->
115+
<actionGroup ref="StorefrontCustomerAddProductToWishlistActionGroup" stepKey="addSecondProductToWishlist">
116+
<argument name="productVar" value="$$simpleProduct2$$"/>
117+
</actionGroup>
118+
<!-- Customer 1 logout -->
119+
<actionGroup ref="StorefrontCustomerLogoutActionGroup" stepKey="customer1Logout"/>
120+
<!-- Customer 2 login -->
121+
<actionGroup ref="LoginToStorefrontActionGroup" stepKey="storefrontCustomer2Login">
122+
<argument name="Customer" value="$$createCustomerTX$$"/>
123+
</actionGroup>
124+
<!-- Assert Wishlist is empty -->
125+
<actionGroup ref="NavigateThroughCustomerTabsActionGroup" stepKey="navigateToWishlist">
126+
<argument name="navigationItemName" value="My Wish List"/>
127+
</actionGroup>
128+
<actionGroup ref="StorefrontAssertCustomerWishlistIsEmptyActionGroup" stepKey="assertNoItemsInWishlist"/>
129+
<!-- Assert minicart is empty -->
130+
<actionGroup ref="AssertMiniCartEmptyActionGroup" stepKey="assertMiniCartIsEmpty"/>
131+
<!-- Navigate to category page -->
132+
<actionGroup ref="StorefrontNavigateCategoryPageActionGroup" stepKey="navigateToCategoryPage2">
133+
<argument name="category" value="$$createCategory$$"/>
134+
</actionGroup>
135+
<!-- Assert Compare list is empty -->
136+
<seeElement selector="{{StorefrontComparisonSidebarSection.NoItemsMessage}}" stepKey="assertCompareListIsEmpty"/>
137+
<!-- Assert Product Prices -->
138+
<actionGroup ref="StorefrontAssertProductPriceOnCategoryPageActionGroup" stepKey="seeProduct1TaxInclusivePriceCustomer2">
139+
<argument name="productName" value="$$simpleProduct.name$$"/>
140+
<argument name="productPrice" value="$120"/>
141+
</actionGroup>
142+
<actionGroup ref="StorefrontAssertProductPriceOnCategoryPageActionGroup" stepKey="seeProduct2TaxInclusivePriceCustomer2">
143+
<argument name="productName" value="$$simpleProduct2.name$$"/>
144+
<argument name="productPrice" value="$240"/>
145+
</actionGroup>
146+
</test>
147+
</tests>

app/code/Magento/CatalogInventory/Test/Mftf/Section/AdminProductFormAdvancedInventorySection.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,5 +36,7 @@
3636
<element name="maxiQtyAllowedInCartError" type="text" selector="[name='product[stock_data][max_sale_qty]'] + label.admin__field-error"/>
3737
<element name="backorders" type="select" selector="//*[@name='product[stock_data][backorders]']"/>
3838
<element name="useConfigSettingsForBackorders" type="checkbox" selector="//input[@name='product[stock_data][use_config_backorders]']"/>
39+
<element name="checkConfigSettingsAdvancedInventory" type="checkbox" selector="//input[@name='product[stock_data][{{args}}]']/..//label[text()='Use Config Settings']/..//input[@type='checkbox']" parameterized="true"/>
40+
<element name="selectManageStockOption" type="select" selector="//select[@name='product[stock_data][manage_stock]']"/>
3941
</section>
4042
</sections>

app/code/Magento/CatalogSearch/Model/Autocomplete/DataProvider.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,9 @@ class DataProvider implements DataProviderInterface
2121
/**
2222
* Autocomplete limit
2323
*/
24-
const CONFIG_AUTOCOMPLETE_LIMIT = 'catalog/search/autocomplete_limit';
24+
public const CONFIG_AUTOCOMPLETE_LIMIT = 'catalog/search/autocomplete_limit';
2525

2626
/**
27-
* Query factory
28-
*
2927
* @var QueryFactory
3028
*/
3129
protected $queryFactory;
@@ -38,8 +36,6 @@ class DataProvider implements DataProviderInterface
3836
protected $itemFactory;
3937

4038
/**
41-
* Limit
42-
*
4339
* @var int
4440
*/
4541
protected $limit;
@@ -68,8 +64,12 @@ public function __construct(
6864
*/
6965
public function getItems()
7066
{
71-
$collection = $this->getSuggestCollection();
7267
$query = $this->queryFactory->get()->getQueryText();
68+
if (!$query) {
69+
return [];
70+
}
71+
72+
$collection = $this->getSuggestCollection();
7373
$result = [];
7474
foreach ($collection as $item) {
7575
$resultItem = $this->itemFactory->create([

app/code/Magento/CatalogSearch/Test/Unit/Model/Autocomplete/DataProviderTest.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,4 +147,17 @@ private function buildCollection(array $data)
147147
->method('getIterator')
148148
->willReturn(new \ArrayIterator($collectionData));
149149
}
150+
151+
public function testGetItemsWithEmptyQueryText()
152+
{
153+
$this->query->expects($this->once())
154+
->method('getQueryText')
155+
->willReturn('');
156+
$this->query->expects($this->never())
157+
->method('getSuggestCollection');
158+
$this->itemFactory->expects($this->never())
159+
->method('create');
160+
$result = $this->model->getItems();
161+
$this->assertEmpty($result);
162+
}
150163
}

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,6 @@
2121
<element name="printLink" type="button" selector=".print" timeout="30"/>
2222
<element name="orderNumberWithoutLink" type="text" selector="//div[contains(@class, 'checkout-success')]//p/span"/>
2323
<element name="orderLinkByOrderNumber" type="text" selector="//div[contains(@class,'success')]//a[contains(.,'{{orderNumber}}')]" parameterized="true" timeout="30"/>
24+
<element name="purchaseOrderNumber" type="text" selector="div.checkout-success > p:nth-child(1) > a span"/>
2425
</section>
2526
</sections>

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,9 @@
101101
<deleteData createDataKey="createConfigProduct" stepKey="deleteConfigProduct"/>
102102
<deleteData createDataKey="createConfigProductAttribute" stepKey="deleteProductAttribute"/>
103103
<deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/>
104+
<!--Remove Filter-->
105+
<actionGroup ref="AdminClearFiltersActionGroup" stepKey="clearProductsGridFilters"/>
106+
<waitForPageLoad stepKey="waitForClearProductsGridFilters"/>
104107
<actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/>
105108

106109
<!-- Reindex invalidated indices after product attribute has been created/deleted -->

0 commit comments

Comments
 (0)