Skip to content

Commit

Permalink
Merge branch '2.4-develop' into 2.4-develop
Browse files Browse the repository at this point in the history
  • Loading branch information
antoninobonumore authored Feb 12, 2020
2 parents 4084004 + 03c84ec commit e785e7b
Show file tree
Hide file tree
Showing 117 changed files with 831 additions and 259 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
<actionGroup name="LoginActionGroup">
<annotations>
<description>Login to Backend Admin using ENV Admin credentials. PLEASE NOTE: This Action Group does NOT validate that you are Logged In.</description>
<description>DEPRECATED. Please use LoginAsAdmin instead.
Login to Backend Admin using ENV Admin credentials. PLEASE NOTE: This Action Group does NOT validate that you are Logged In.</description>
</annotations>

<amOnPage url="{{_ENV.MAGENTO_BACKEND_NAME}}" stepKey="navigateToAdmin"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2121,7 +2121,9 @@ private function getChildrenCategories(int $categoryId): array
if (in_array($category['parent_id'], $categoryIds)
&& in_array($category['parent_id'], $anchorCategory)) {
$categoryIds[] = (int)$category[$linkField];
if ($category['is_anchor'] == 1) {
// Storefront approach is to treat non-anchor children of anchor category as anchors.
// Adding their's IDs to $anchorCategory for consistency.
if ($category['is_anchor'] == 1 || in_array($category['parent_id'], $anchorCategory)) {
$anchorCategory[] = (int)$category[$linkField];
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->

<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
<actionGroup name="AdminCategoryPageOpenProductsInCategorySectionActionGroup">
<annotations>
<description>Open 'Products in Category' section on category edit page in Admin.</description>
</annotations>

<conditionalClick selector="{{AdminCategoryProductsSection.sectionHeader}}" dependentSelector="{{AdminCategoryProductsSection.sectionBody}}" visible="false" stepKey="openSectionIfHidden" />
<scrollTo selector="{{AdminCategoryProductsSection.sectionHeader}}" stepKey="scrollToSection" />
<waitForPageLoad stepKey="waitSectionFullyLoaded"/>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->

<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
<actionGroup name="AdminProductFormAdvancedPricingAddTierPriceActionGroup">
<annotations>
<description>Add new tier price on Advanced Pricing dialog on the Admin Product creation/edit page.</description>
</annotations>
<arguments>
<argument name="website" type="string" defaultValue="All Websites [USD]"/>
<argument name="customerGroup" type="string" defaultValue="ALL GROUPS"/>
<argument name="quantity" type="string" defaultValue="1"/>
<argument name="priceType" type="string" defaultValue="Fixed"/>
<argument name="amount" type="string" defaultValue="10"/>
</arguments>

<waitForElementVisible selector="{{AdminProductFormAdvancedPricingSection.customerGroupPriceAddButton}}" stepKey="waitForGroupPriceAddButtonAppears"/>
<click selector="{{AdminProductFormAdvancedPricingSection.customerGroupPriceAddButton}}" stepKey="clickCustomerGroupPriceAddButton"/>
<waitForElementVisible selector="{{AdminProductFormAdvancedPricingSection.lastTierPriceWebsite}}" stepKey="waitForPriceWebsiteInputAppears"/>
<selectOption selector="{{AdminProductFormAdvancedPricingSection.lastTierPriceWebsite}}" userInput="{{website}}" stepKey="selectWebsite"/>
<selectOption selector="{{AdminProductFormAdvancedPricingSection.lastTierPriceCustomerGroup}}" userInput="{{customerGroup}}" stepKey="selectCustomerGroup"/>
<fillField selector="{{AdminProductFormAdvancedPricingSection.lastTierPriceQty}}" userInput="{{quantity}}" stepKey="fillQuantity"/>
<selectOption selector="{{AdminProductFormAdvancedPricingSection.lastTierPriceType}}" userInput="{{priceType}}" stepKey="selectPriceType"/>
<executeJS function="return '{{priceType}}' == 'Discount' ? &quot;{{AdminProductFormAdvancedPricingSection.lastTierPriceDiscountAmount}}&quot; : &quot;{{AdminProductFormAdvancedPricingSection.lastTierPriceFixedAmount}}&quot;" stepKey="priceAmountSelector"/>
<waitForElementVisible selector="{$priceAmountSelector}" stepKey="waitPriceAmountFieldAppers"/>
<fillField selector="{$priceAmountSelector}" userInput="{{amount}}" stepKey="fillPriceAmount"/>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->

<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
<actionGroup name="AdminProductFormCloseAdvancedPricingDialogActionGroup">
<annotations>
<description>Close Advanced Pricing dialog from product form.</description>
</annotations>

<scrollToTopOfPage stepKey="scrollToTopOfThePage"/>
<click selector="{{AdminProductFormAdvancedPricingSection.advancedPricingCloseButton}}" stepKey="clickCloseButton"/>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->

<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
<actionGroup name="AdminProductFormDoneAdvancedPricingDialogActionGroup">
<annotations>
<description>Done Advanced Pricing dialog from product form.</description>
</annotations>

<scrollToTopOfPage stepKey="scrollToTopOfThePage"/>
<click selector="{{AdminProductFormAdvancedPricingSection.doneButton}}" stepKey="clickDoneButton"/>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->

<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
<actionGroup name="AdminProductFormOpenAdvancedPricingDialogActionGroup">
<annotations>
<description>Open Advanced Pricing dialog from product form.</description>
</annotations>

<click selector="{{AdminProductFormSection.advancedPricingLink}}" stepKey="clickAdvancedPricingLink"/>
<waitForElementVisible selector="{{AdminProductFormAdvancedPricingSection.modalTitle}}" stepKey="waitForModalTitleAppears"/>
<see selector="{{AdminProductFormAdvancedPricingSection.modalTitle}}" userInput="Advanced Pricing" stepKey="checkModalTitle"/>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->

<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
<actionGroup name="AdminSaveCategoryFormActionGroup">
<annotations>
<description>Save category edit form in Admin and check success message.</description>
</annotations>

<seeInCurrentUrl url="{{AdminCategoryPage.url}}" stepKey="seeOnCategoryPage"/>
<click selector="{{AdminMainActionsSection.save}}" stepKey="saveCategory"/>
<waitForElementVisible selector="{{AdminMessagesSection.success}}" stepKey="waitForSuccessMessageAppears"/>
<see userInput="You saved the category." selector="{{AdminMessagesSection.success}}" stepKey="assertSuccessMessage"/>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->

<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
<actionGroup name="AssertAdminProductFormAdvancedPricingCheckTierPriceActionGroup">
<annotations>
<description>Check AdvancedPricing tier price row.</description>
</annotations>
<arguments>
<argument name="rowNumber" type="string" defaultValue="0"/>
<argument name="website" type="string" defaultValue="All Websites [USD]"/>
<argument name="customerGroup" type="string" defaultValue="ALL GROUPS"/>
<argument name="quantity" type="string" defaultValue="1"/>
<argument name="priceType" type="string" defaultValue="Fixed"/>
<argument name="amount" type="string" defaultValue="10"/>
</arguments>

<waitForElementVisible selector="{{AdminProductFormAdvancedPricingSection.productTierPriceWebsiteSelect(rowNumber)}}" stepKey="waitForPricesGridAppears"/>
<seeInField selector="{{AdminProductFormAdvancedPricingSection.productTierPriceWebsiteSelect(rowNumber)}}" userInput="{{website}}" stepKey="seeWebsite"/>
<seeInField selector="{{AdminProductFormAdvancedPricingSection.productTierPriceCustGroupSelect(rowNumber)}}" userInput="{{customerGroup}}" stepKey="seeCustomerGroup"/>
<seeInField selector="{{AdminProductFormAdvancedPricingSection.productTierPriceQtyInput(rowNumber)}}" userInput="{{quantity}}" stepKey="seeQuantity"/>
<seeInField selector="{{AdminProductFormAdvancedPricingSection.productTierPriceValueTypeSelect(rowNumber)}}" userInput="{{priceType}}" stepKey="seePriceType"/>
<executeJS function="return '{{priceType}}' == 'Discount' ? &quot;{{AdminProductFormAdvancedPricingSection.productTierPricePercentageValuePriceInput(rowNumber)}}&quot; : &quot;{{AdminProductFormAdvancedPricingSection.productTierPriceFixedPriceInput(rowNumber)}}&quot;" stepKey="priceAmountSelector"/>
<seeInField selector="{$priceAmountSelector}" userInput="{{amount}}" stepKey="seePriceAmount"/>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
-->

<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
<!-- Check simple product on the category page -->
<actionGroup name="AssertStorefrontCategorySimpleProductShownActionGroup">
<annotations>
<description>Validate that the provided Simple Product is present and correct on a Category page.</description>
</annotations>
<arguments>
<argument name="productName" type="string" defaultValue="{{ApiSimpleOne.name}}"/>
<argument name="productPrice" type="string" defaultValue="{{ApiSimpleOne.price}}"/>
</arguments>

<waitForElementVisible selector="{{StorefrontCategoryProductSection.ProductTitleByName(productName)}}" stepKey="waitForProduct"/>
<seeElement selector="{{StorefrontCategoryProductSection.ProductTitleByName(productName)}}" stepKey="assertProductName"/>
<see userInput="${{productPrice}}" selector="{{StorefrontCategoryProductSection.ProductPriceByName(productName)}}" stepKey="assertProductPrice"/>
<moveMouseOver selector="{{StorefrontCategoryProductSection.ProductInfoByName(productName)}}" stepKey="moveMouseOverProduct"/>
<seeElement selector="{{StorefrontCategoryProductSection.ProductAddToCartByName(productName)}}" stepKey="assertAddToCartButton"/>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
</arguments>

<click selector="{{AdminProductFormSection.advancedPricingLink}}" stepKey="clickOnAdvancedPricingButton"/>
<waitForElement selector="{{AdminProductFormAdvancedPricingSection.customerGroupPriceAddButton}}" stepKey="waitForCustomerGroupPriceAddButton"/>
<waitForElementVisible selector="{{AdminProductFormAdvancedPricingSection.customerGroupPriceAddButton}}" stepKey="waitForCustomerGroupPriceAddButton"/>
<click selector="{{AdminProductFormAdvancedPricingSection.customerGroupPriceAddButton}}" stepKey="addCustomerGroupAllGroupsQty1PriceDiscountAnd10percent"/>
<waitForElement selector="{{AdminProductFormAdvancedPricingSection.productTierPriceCustGroupSelect('0')}}" stepKey="waitForSelectCustomerGroupNameAttribute2"/>
<selectOption selector="{{AdminProductFormAdvancedPricingSection.productTierPriceWebsiteSelect('0')}}" userInput="{{website}}" stepKey="selectProductWebsiteValue"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
<actionGroup name="SaveCategoryFormActionGroup">
<annotations>
<description>Requires navigation to the Category creation/edit page. Checks that the url contains the AdminCategoryPage url. Saves the Category.</description>
<description>DEPRECATED. Use AdminSaveCategoryFormActionGroup instead. Requires navigation to the Category creation/edit page. Checks that the url contains the AdminCategoryPage url. Saves the Category.</description>
</annotations>

<seeInCurrentUrl url="{{AdminCategoryPage.url}}" stepKey="seeOnCategoryPage"/>
<click selector="{{AdminCategoryMainActionsSection.SaveButton}}" stepKey="saveCategory"/>
<seeElement selector="{{AdminCategoryMessagesSection.SuccessMessage}}" stepKey="assertSuccess"/>
<click selector="{{AdminMainActionsSection.save}}" stepKey="saveCategory"/>
<seeElement selector="{{AdminMessagesSection.success}}" stepKey="assertSuccess"/>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<argument name="urlKey" type="string"/>
</arguments>

<click selector="{{AdminProductSEOSection.sectionHeader}}" stepKey="openSeoSection"/>
<conditionalClick selector="{{AdminProductSEOSection.sectionHeader}}" dependentSelector="{{AdminProductSEOSection.urlKeyInput}}" visible="false" stepKey="openSeoSection"/>
<fillField userInput="{{urlKey}}" selector="{{AdminProductSEOSection.urlKeyInput}}" stepKey="fillUrlKey"/>
</actionGroup>
</actionGroups>
1 change: 1 addition & 0 deletions app/code/Magento/Catalog/Test/Mftf/Data/ProductData.xml
Original file line number Diff line number Diff line change
Expand Up @@ -756,6 +756,7 @@
<data key="status">In Stock</data>
<data key="visibility">Catalog, Search</data>
<data key="urlKey" unique="suffix">virtual-product</data>
<data key="storefrontStatus">IN STOCK</data>
<data key="type_id">virtual</data>
</entity>
<entity name="virtualProductCustomImportOptions" type="product">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,7 @@
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
<section name="AdminCategoryProductsSection">
<element name="sectionHeader" type="button" selector="div[data-index='assign_products']" timeout="30"/>
<element name="addProducts" type="button" selector="#catalog_category_add_product_tabs" timeout="30"/>
<element name="addProductsDisabled" type="button" selector="#catalog_category_add_product_tabs[disabled]" timeout="30"/>
<element name="productsInCategorySectionTitle" type="text" selector="div[data-index='assign_products'] .fieldset-wrapper-title" timeout="10"/>
<element name="productsInCategorySectionBody" type="text" selector="div[data-index='assign_products'] .admin__fieldset-wrapper-content"/>
<element name="sectionHeader" type="button" selector="div[data-index='assign_products'] .fieldset-wrapper-title" timeout="30"/>
<element name="sectionBody" type="button" selector="div[data-index='assign_products'] .admin__fieldset-wrapper-content" timeout="30"/>
</section>
</sections>
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,13 @@
<element name="msrp" type="input" selector="//input[@name='product[msrp]']" timeout="30"/>
<element name="msrpType" type="select" selector="//select[@name='product[msrp_display_actual_price_type]']" timeout="30"/>
<element name="save" type="button" selector="#save-button" timeout="30"/>
<element name="modalTitle" type="text" selector="aside.product_form_product_form_advanced_pricing_modal h1.modal-title"/>
<!-- Last row tier price elements-->
<element name="lastTierPriceWebsite" type="select" selector="[data-index='tier_price'] table tbody tr.data-row:last-child [name*='[website_id]']"/>
<element name="lastTierPriceCustomerGroup" type="select" selector="[data-index='tier_price'] table tbody tr.data-row:last-child [name*='[cust_group]']"/>
<element name="lastTierPriceQty" type="input" selector="[data-index='tier_price'] table tbody tr.data-row:last-child [name*='[price_qty]']"/>
<element name="lastTierPriceType" type="select" selector="[data-index='tier_price'] table tbody tr.data-row:last-child [name*='[value_type]']"/>
<element name="lastTierPriceFixedAmount" type="input" selector="[data-index='tier_price'] table tbody tr.data-row:last-child [name*='[price]']"/>
<element name="lastTierPriceDiscountAmount" type="input" selector="[data-index='tier_price'] table tbody tr.data-row:last-child [name*='[percentage_value]']"/>
</section>
</sections>
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@
<after>
<deleteData createDataKey="attribute" stepKey="deleteAttribute"/>
<actionGroup ref="logout" stepKey="logout"/>

<!-- Reindex invalidated indices after product attribute has been created/deleted -->
<actionGroup ref="CliRunReindexUsingCronJobsActionGroup" stepKey="reindexInvalidatedIndices"/>
</after>

<!-- Go to default attribute set edit page -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@
<deleteData createDataKey="createProductAttribute" stepKey="deleteProductAttribute"/>
<deleteData createDataKey="createAttributeSet" stepKey="deleteAttributeSet"/>
<actionGroup ref="ClearProductsFilterActionGroup" stepKey="clearProductsFilter"/>

<!-- Reindex invalidated indices after product attribute has been created/deleted -->
<actionGroup ref="CliRunReindexUsingCronJobsActionGroup" stepKey="reindexInvalidatedIndices"/>
</after>

<actionGroup ref="SearchForProductOnBackendActionGroup" stepKey="searchForSimpleProduct">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,9 @@
<deleteData createDataKey="createConfigChildProduct3" stepKey="deleteConfigChildProduct3"/>
<deleteData createDataKey="createConfigProductAttribute" stepKey="deleteAttribute"/>
<actionGroup ref="logout" stepKey="logout"/>

<!-- Reindex invalidated indices after product attribute has been created/deleted -->
<actionGroup ref="CliRunReindexUsingCronJobsActionGroup" stepKey="reindexInvalidatedIndices"/>
</after>

<!-- Open Product in Store Front Page -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@
<deleteData createDataKey="createMultiSelectProductAttribute" stepKey="deleteMultiSelectProductAttribute"/>
<!-- Logout from Admin page -->
<actionGroup ref="logout" stepKey="logoutFromAdmin"/>

<!-- Reindex invalidated indices after product attribute has been created/deleted -->
<actionGroup ref="CliRunReindexUsingCronJobsActionGroup" stepKey="reindexInvalidatedIndices"/>
</after>

<!-- Open created product for edit -->
Expand Down
Loading

0 comments on commit e785e7b

Please sign in to comment.