Skip to content

Commit

Permalink
Merge remote-tracking branch 'mainline/2.4-develop' into 2.4-develop-…
Browse files Browse the repository at this point in the history
…pr12
  • Loading branch information
serhii-balko committed Feb 10, 2020
2 parents 44e85b0 + f9a487d commit 43a4696
Show file tree
Hide file tree
Showing 45 changed files with 966 additions and 416 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?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="AssertStorefrontProductDetailPageNameAndUrlActionGroup">
<annotations>
<description>Validates that the Product name and Url are correct.</description>
</annotations>
<arguments>
<argument name="productName" defaultValue="{{ApiSimpleProduct.name}}" type="string"/>
<argument name="productUrl" defaultValue="{{ApiSimpleProduct.urlKey}}" type="string"/>
</arguments>

<seeInCurrentUrl url="{{StorefrontProductPage.url(productUrl)}}" stepKey="checkUrl"/>
<seeInTitle userInput="{{productName}}" stepKey="assertProductNameTitle"/>
<see userInput="{{productName}}" selector="{{StorefrontProductInfoMainSection.productName}}" stepKey="assertProductName"/>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,10 @@
<argument name="product"/>
</arguments>

<waitForElementVisible selector="{{StorefrontCategoryProductSection.ProductTitleByName(product.name)}}" stepKey="waitForProduct"/>
<seeElement selector="{{StorefrontCategoryProductSection.ProductTitleByName(product.name)}}" stepKey="assertProductName"/>
<see userInput="${{product.price}}.00" selector="{{StorefrontCategoryProductSection.ProductPriceByName(product.name)}}" stepKey="AssertProductPrice"/>
<!-- @TODO: MAGETWO-80272 Move to Magento_Checkout -->
<moveMouseOver selector="{{StorefrontCategoryProductSection.ProductInfoByName(product.name)}}" stepKey="moveMouseOverProduct"/>
<!-- @TODO: MAGETWO-80272 Move to Magento_Checkout -->
<seeElement selector="{{StorefrontCategoryProductSection.ProductAddToCartByName(product.name)}}" stepKey="AssertAddToCart"/>
</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="StorefrontOpenProductFromCategoryPageActionGroup">
<annotations>
<description>Click on the provided product on category page.</description>
</annotations>
<arguments>
<argument name="productName" type="string" defaultValue="{{ApiSimpleProduct.name}}"/>
</arguments>

<click selector="{{StorefrontCategoryMainSection.specifiedProductItemInfo(productName)}}" stepKey="openProductPage"/>
<waitForPageLoad stepKey="waitForProductPageLoad"/>
</actionGroup>
</actionGroups>
2 changes: 2 additions & 0 deletions app/code/Magento/Catalog/Test/Mftf/Data/ConstData.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,7 @@
<entity name="prodNameWithSpecChars">
<data key="trademark">"Pursuit Lumaflex™ Tone Band"</data>
<data key="skumark">"x™"</data>
<data key="trademark_without_quotes">Pursuit Lumaflex™ Tone Band</data>
<data key="skumark_without_quotes">x™</data>
</entity>
</entities>
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,7 @@
<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"/>
</section>
</sections>
</sections>
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,14 @@
<testCaseId value="MC-14714"/>
<severity value="CRITICAL"/>
<group value="mtf_migrated"/>
<skip>
<issueId value="MC-30409"/>
</skip>
</annotations>

<before>
<createData entity="SubCategory" stepKey="category"/>
<createData entity="Two_nested_categories" stepKey="subCategory">
<requiredEntity createDataKey="category"/>
</createData>
<magentoCLI command="config:set catalog/seo/generate_category_product_rewrites 1" stepKey="enableGenerateUrlRewrite"/>
<actionGroup ref="LoginAsAdmin" stepKey="login"/>
</before>

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?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="AdminCatalogPriceRuleAddSkuConditionActionGroup">
<annotations>
<description>Create new product SKU based condition in Catalog Price Rule form.</description>
</annotations>
<arguments>
<argument name="productSku" type="string" defaultValue="{{ApiSimpleTwo.sku}}"/>
</arguments>

<conditionalClick selector="{{AdminNewCatalogPriceRule.conditionsTabTitle}}" dependentSelector="{{AdminNewCatalogPriceRule.conditionsTabBody}}" visible="false" stepKey="openConditionsSectionIfNeeded"/>
<scrollTo selector="{{AdminNewCatalogPriceRule.conditionsTabTitle}}" stepKey="scrollToConditionsFieldset"/>
<waitForElementVisible selector="{{AdminNewCatalogPriceRuleConditions.newCondition}}" stepKey="waitForNewConditionButton"/>
<click selector="{{AdminNewCatalogPriceRuleConditions.newCondition}}" stepKey="clickAddNewConditionButton"/>
<selectOption selector="{{AdminNewCatalogPriceRuleConditions.conditionSelect('1')}}" userInput="Magento\CatalogRule\Model\Rule\Condition\Product|sku" stepKey="selectConditionTypeSku"/>
<waitForPageLoad stepKey="waitConditionFormRefresh"/>
<click selector="{{AdminNewCatalogPriceRuleConditions.targetEllipsis('1')}}" stepKey="clickEllipsis"/>
<fillField selector="{{AdminNewCatalogPriceRuleConditions.targetInput('1', '1')}}" userInput="{{productSku}}" stepKey="fillProductSku"/>
<click selector="{{AdminNewCatalogPriceRuleConditions.applyButton('1', '1')}}" stepKey="clickApply"/>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
<!-- action group to create a new catalog price rule giving a catalogRule entity -->
<actionGroup name="NewCatalogPriceRuleByUIActionGroup">
<annotations>
<description>Goes to the Catalog Price Rule grid. Clicks on Add. Fills in the provided Catalog Rule details.</description>
<description>DEPRECATED. Please use set of AG: AdminOpenNewCatalogPriceRuleFormPageActionGroup, AdminCatalogPriceRuleFillMainInfoActionGroup, AdminCatalogPriceRuleFillActionsActionGroup, AdminCatalogPriceRuleSaveAndApplyActionGroup
Goes to the Catalog Price Rule grid. Clicks on Add. Fills in the provided Catalog Rule details.</description>
</annotations>
<arguments>
<argument name="catalogRule" defaultValue="_defaultCatalogRule"/>
Expand Down
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="NewCatalogPriceRuleByUIWithConditionIsSKUActionGroup" extends="NewCatalogPriceRuleByUIActionGroup">
<annotations>
<description>EXTENDS: newCatalogPriceRuleByUI. Add a Catalog Price Rule Condition based on the provided SKU.</description>
<description>DEPRECATED. Please use set of AG: AdminOpenNewCatalogPriceRuleFormPageActionGroup, AdminCatalogPriceRuleFillMainInfoActionGroup, AdminCatalogPriceRuleFillActionsActionGroup, AdminCatalogPriceRuleAddSkuConditionActionGroup, AdminCatalogPriceRuleSaveAndApplyActionGroup
EXTENDS: newCatalogPriceRuleByUI. Add a Catalog Price Rule Condition based on the provided SKU.</description>
</annotations>
<arguments>
<argument name="productSku"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
<element name="targetEllipsisSelect" type="select" selector="select#conditions__{{var1}}--{{var2}}__value" parameterized="true" timeout="30"/>
<element name="targetSelect" type="select" selector="//ul[@id='conditions__{{var}}__children']//select" parameterized="true" timeout="30"/>
<element name="targetInput" type="input" selector="input#conditions__{{var1}}--{{var2}}__value" parameterized="true"/>
<element name="applyButton" type="button" selector="#conditions__{{var1}}__children li:nth-of-type({{var2}}) a.rule-param-apply" parameterized="true"/>
<element name="applyButton" type="button" selector="#conditions__{{var1}}__children li:nth-of-type({{var2}}) a.rule-param-apply" parameterized="true" timeout="30"/>
<element name="condition" type="text" selector="//span[@class='rule-param']/a[text()='{{condition}}']" parameterized="true"/>
<element name="activeOperatorSelect" type="select" selector=".rule-param-edit select[name*='[operator]']"/>
<element name="activeValueInput" type="input" selector=".rule-param-edit [name*='[value]']"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -603,101 +603,4 @@
<argument name="value" value="$simpleProduct1.name$"/>
</actionGroup>
</test>

<test name="QuickSearchConfigurableChildren">
<annotations>
<stories value="Search Product on Storefront"/>
<title value="User should be able to use Quick Search to a configurable product's child products"/>
<description value="Use Quick Search to find a configurable product with enabled/disable children"/>
<severity value="MAJOR"/>
<testCaseId value="MC-14798"/>
<group value="CatalogSearch"/>
<group value="mtf_migrated"/>
<skip>
<issueId value="MC-15101"/>
</skip>
</annotations>
<before>
<!-- Create the category -->
<createData entity="ApiCategory" stepKey="createCategory"/>

<!-- Create blank AttributeSet-->
<createData entity="CatalogAttributeSet" stepKey="attributeSet"/>

<!-- Create an attribute with two options to be used in the first child product -->
<createData entity="hiddenDropdownAttributeWithOptions" stepKey="createConfigProductAttribute"/>
<createData entity="productAttributeOption1" stepKey="createConfigProductAttributeOption1">
<requiredEntity createDataKey="createConfigProductAttribute"/>
</createData>

<!-- Assign attribute to set -->
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/>
<actionGroup ref="goToAttributeGridPage" stepKey="goToPage"/>
<actionGroup ref="GoToAttributeSetByNameActionGroup" stepKey="goToSet">
<argument name="name" value="$attributeSet.attribute_set_name$"/>
</actionGroup>
<actionGroup ref="AssignAttributeToGroupActionGroup" stepKey="assignToAttributeSetAndGroup">
<argument name="group" value="Product Details"/>
<argument name="attribute" value="$createConfigProductAttribute.attribute_code$"/>
</actionGroup>
<actionGroup ref="SaveAttributeSetActionGroup" stepKey="savePage"/>

<!-- Get the first option of the attribute we created -->
<getData entity="ProductAttributeOptionGetter" index="1" stepKey="getConfigAttributeOption1">
<requiredEntity createDataKey="createConfigProductAttribute"/>
</getData>

<!-- Create a simple product,give it the attributeSet and attribute with the first option -->
<createData entity="ApiSimpleOneHidden" stepKey="createConfigChildProduct1">
<field key="attribute_set_id">$attributeSet.attribute_set_id$</field>
<requiredEntity createDataKey="createConfigProductAttribute"/>
<requiredEntity createDataKey="getConfigAttributeOption1"/>
</createData>
<updateData entity="ApiSimpleProductUpdateDescription" stepKey="updateSimpleProduct1" createDataKey="createConfigChildProduct1"/>

<!-- Create the configurable product, give it the attributeSet and add it to the category -->
<createData entity="ApiConfigurableProduct" stepKey="createConfigProduct">
<field key="attribute_set_id">$attributeSet.attribute_set_id$</field>
<requiredEntity createDataKey="createCategory"/>
</createData>
<!-- Create the configurable product -->
<createData entity="ConfigurableProductOneOption" stepKey="createConfigProductOption">
<requiredEntity createDataKey="createConfigProduct"/>
<requiredEntity createDataKey="createConfigProductAttribute"/>
<requiredEntity createDataKey="getConfigAttributeOption1"/>
</createData>
<!-- Add the first simple product to the configurable product -->
<createData entity="ConfigurableProductAddChild" stepKey="createConfigProductAddChild1">
<requiredEntity createDataKey="createConfigProduct"/>
<requiredEntity createDataKey="createConfigChildProduct1"/>
</createData>

<!-- Perform reindex and flush cache -->
<magentoCLI command="indexer:reindex" stepKey="reindex"/>
<magentoCLI command="cache:flush" stepKey="flushCache"/>
</before>
<amOnPage url="{{StorefrontHomePage.url}}" stepKey="goToFrontPage"/>
<actionGroup ref="StorefrontCheckQuickSearchStringActionGroup" stepKey="searchStorefront">
<argument name="phrase" value="$createConfigProduct.name$"/>
</actionGroup>
<actionGroup ref="StorefrontQuickSearchCheckProductNameInGridActionGroup" stepKey="seeProductInGrid">
<argument name="productName" value="$createConfigProduct.name$"/>
<argument name="index" value="1"/>
</actionGroup>

<!-- Disable Child Product -->
<actionGroup ref="GoToProductPageViaIDActionGroup" stepKey="goToChildProduct">
<argument name="productId" value="$createConfigChildProduct1.id$"/>
</actionGroup>
<actionGroup ref="ToggleProductEnabledActionGroup" stepKey="disableProduct"/>
<actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct"/>

<amOnPage url="{{StorefrontHomePage.url}}" stepKey="goToFrontPageAgain"/>
<actionGroup ref="StorefrontCheckQuickSearchStringActionGroup" stepKey="searchStorefrontAgain">
<argument name="phrase" value="$createConfigProduct.name$"/>
</actionGroup>
<actionGroup ref="StorefrontQuickSearchCheckProductNameNotInGridActionGroup" stepKey="dontSeeProductAnymore">
<argument name="productName" value="$createConfigProduct.name$"/>
</actionGroup>
</test>
</tests>
Loading

0 comments on commit 43a4696

Please sign in to comment.