Skip to content

Commit

Permalink
Merge pull request #4548 from magento-tsg/2.3-develop-mftf-pr20
Browse files Browse the repository at this point in the history
[TSG] MFTF for 2.3 (pr20) (2.3-develop)
  • Loading branch information
zakdma authored Jul 30, 2019
2 parents 50209dd + a0bcc52 commit 0b6385f
Show file tree
Hide file tree
Showing 18 changed files with 824 additions and 51 deletions.
31 changes: 31 additions & 0 deletions app/code/Magento/Bundle/Test/Mftf/Data/ProductData.xml
Original file line number Diff line number Diff line change
Expand Up @@ -107,4 +107,35 @@
<requiredEntity type="custom_attribute">CustomAttributeDynamicPrice</requiredEntity>
<requiredEntity type="custom_attribute">CustomAttributePriceViewRange</requiredEntity>
</entity>
<entity name="DynamicBundleProductCustomDescription" type="product2">
<data key="name" unique="suffix">Test 123 Dynamic </data>
<data key="sku" unique="suffix">test-dynamic-bundle-product</data>
<data key="type_id">bundle</data>
<data key="attribute_set_id">4</data>
<data key="visibility">4</data>
<data key="status">1</data>
<data key="urlKey" unique="suffix">test-dynamic-bundle-product</data>
<requiredEntity type="product_extension_attribute">EavStockItem</requiredEntity>
<requiredEntity type="custom_attribute">CustomDynamicProductDescription</requiredEntity>
<requiredEntity type="custom_attribute">CustomDynamicProductShortDescription</requiredEntity>
<requiredEntity type="custom_attribute">CustomAttributeDynamicPrice</requiredEntity>
<requiredEntity type="custom_attribute">CustomAttributePriceViewRange</requiredEntity>
</entity>
<entity name="FixedBundleProductCustomDescription" type="product2">
<data key="name" unique="suffix">Test 123 Fixed </data>
<data key="sku" unique="suffix">test-fixed-bundle-product</data>
<data key="type_id">bundle</data>
<data key="attribute_set_id">4</data>
<data key="price">10</data>
<data key="visibility">4</data>
<data key="status">1</data>
<data key="urlKey" unique="suffix">api-fixed-bundle-product</data>
<requiredEntity type="product_extension_attribute">EavStockItem</requiredEntity>
<requiredEntity type="custom_attribute">CustomFixedProductDescription</requiredEntity>
<requiredEntity type="custom_attribute">CustomFixedProductShortDescription</requiredEntity>
<requiredEntity type="custom_attribute">CustomAttributePriceView</requiredEntity>
<requiredEntity type="custom_attribute">CustomAttributeFixPrice</requiredEntity>
<requiredEntity type="custom_attribute">CustomAttributeFixWeight</requiredEntity>
<requiredEntity type="custom_attribute">CustomAttributeFixSku</requiredEntity>
</entity>
</entities>
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->

<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
<test name="AdminShouldBeAbleToMassUpdateAttributesForBundleProductsTest">
<annotations>
<features value="Bundle"/>
<stories value="Admin list bundle products"/>
<title value="Admin should be able to mass update attributes for bundle products"/>
<description value="Admin should be able to mass update attributes for bundle products"/>
<severity value="CRITICAL"/>
<testCaseId value="MC-219"/>
<group value="bundle"/>
<group value="WYSIWYGDisabled"/>
</annotations>
<before>
<!-- Create Simple Product -->
<createData entity="SimpleProduct2" stepKey="createSimpleProduct"/>
<!-- Create Fixed Bundle Product -->
<createData entity="ApiFixedBundleProduct" stepKey="createFixedBundleProduct"/>
<!-- Create DropDown Bundle Option -->
<createData entity="DropDownBundleOption" stepKey="createBundleOption">
<requiredEntity createDataKey="createFixedBundleProduct"/>
</createData>
<!-- Link Simple Product -->
<createData entity="ApiBundleLink" stepKey="createNewBundleLink">
<requiredEntity createDataKey="createFixedBundleProduct"/>
<requiredEntity createDataKey="createBundleOption"/>
<requiredEntity createDataKey="createSimpleProduct"/>
</createData>
</before>
<after>
<!-- Delete Simple Product -->
<deleteData createDataKey="createSimpleProduct" stepKey="deleteSimpleProduct"/>
<!-- Delete Fixed Bundle Product -->
<deleteData createDataKey="createFixedBundleProduct" stepKey="deleteBundleProduct"/>
<!-- Clear Filter -->
<actionGroup ref="ClearProductsFilterActionGroup" stepKey="clearProductFilter"/>
<!--Log Out Admin-->
<actionGroup ref="logout" stepKey="logoutAsAdmin"/>
</after>
<!-- Login as Admin -->
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/>
<!-- Go to Catalog -> Catalog -> Products and Search created product in precondition and choose it -->
<actionGroup ref="SearchForProductOnBackendActionGroup" stepKey="searchProduct">
<argument name="product" value="$$createFixedBundleProduct$$"/>
</actionGroup>
<!-- Choose "Update attributes" and Change any product data -->
<actionGroup ref="AdminUpdateProductNameAndDescriptionAttributes" stepKey="updateProductAttribute">
<argument name="product" value="UpdateAttributeNameAndDescription"/>
</actionGroup>
<!--Run cron twice-->
<magentoCLI command="cron:run" stepKey="cronRun"/>
<magentoCLI command="cron:run" stepKey="cronRunTwice"/>
<!-- Search for a product with a new name and Open Product -->
<actionGroup ref="filterProductGridByName" stepKey="searchWithNewProductName">
<argument name="product" value="UpdateAttributeNameAndDescription"/>
</actionGroup>
<actionGroup ref="OpenEditProductOnBackendActionGroup" stepKey="openProductPage">
<argument name="product" value="$$createFixedBundleProduct$$"/>
</actionGroup>
<!-- Assert product name and description -->
<actionGroup ref="AssertProductNameInProductEditForm" stepKey="assertProductName">
<argument name="productName" value="{{UpdateAttributeNameAndDescription.name}}"/>
</actionGroup>
<actionGroup ref="AssertProductDescriptionInProductEditForm" stepKey="assertProductDescription">
<argument name="productDescription" value="{{UpdateAttributeNameAndDescription.description}}"/>
</actionGroup>
</test>
</tests>
Original file line number Diff line number Diff line change
@@ -0,0 +1,137 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->

<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
<test name="StorefrontCustomerSearchBundleProductsByKeywordsTest">
<annotations>
<features value="Bundle"/>
<stories value="Bundle products list on Storefront"/>
<title value="Customer should be able to see search results when searching for bundle products by keyword"/>
<description value="Customer should be able to see search results when searching for bundle products by keyword"/>
<severity value="CRITICAL"/>
<testCaseId value="MC-227"/>
<group value="bundle"/>
</annotations>
<before>
<createData entity="SimpleProductNotVisibleIndividually" stepKey="createSimpleProduct"/>
<createData entity="DynamicBundleProductCustomDescription" stepKey="createDynamicBundle"/>
<createData entity="DropDownBundleOption" stepKey="dynamicBundleOption">
<requiredEntity createDataKey="createDynamicBundle"/>
</createData>
<createData entity="ApiBundleLink" stepKey="createDynamicBundleLink">
<requiredEntity createDataKey="createDynamicBundle"/>
<requiredEntity createDataKey="dynamicBundleOption"/>
<requiredEntity createDataKey="createSimpleProduct"/>
</createData>
<createData entity="SimpleProductNotVisibleIndividually" stepKey="createSimpleProductTwo"/>
<createData entity="FixedBundleProductCustomDescription" stepKey="createFixedBundle"/>
<createData entity="DropDownBundleOption" stepKey="fixedBundleOption">
<requiredEntity createDataKey="createFixedBundle"/>
</createData>
<createData entity="ApiBundleLink" stepKey="createFixedBundleLink">
<requiredEntity createDataKey="createFixedBundle"/>
<requiredEntity createDataKey="fixedBundleOption"/>
<requiredEntity createDataKey="createSimpleProductTwo"/>
</createData>
<magentoCLI command="indexer:reindex" arguments="cataloginventory_stock catalogsearch_fulltext" stepKey="reindex"/>
</before>
<after>
<deleteData createDataKey="createDynamicBundle" stepKey="deleteDynamicBundleProduct"/>
<deleteData createDataKey="createFixedBundle" stepKey="deleteFixedBundleProduct"/>
<deleteData createDataKey="createSimpleProduct" stepKey="deleteSimpleProduct"/>
<deleteData createDataKey="createSimpleProductTwo" stepKey="createSimpleProductTwo"/>
</after>
<!-- 1. Go to storefront home page -->
<amOnPage url="{{StorefrontHomePage.url}}" stepKey="goToStorefrontPage"/>
<!-- 2. Fill quick search bar with test values unique for dynamic bundle product and click search -->
<actionGroup ref="StorefrontCheckQuickSearchStringActionGroup" stepKey="quickSearchDynamic">
<argument name="phrase" value="Dynamic"/>
</actionGroup>
<actionGroup ref="StorefrontQuickSearchSeeProductByName" stepKey="assertDynamicBundleInSearchResultByDynamic">
<argument name="productName" value="$createDynamicBundle.name$"/>
</actionGroup>
<actionGroup ref="StorefrontQuickSearchCheckProductNameNotInGrid" stepKey="assertFixedBundleInSearchResultByDynamic">
<argument name="productName" value="$createFixedBundle.name$"/>
</actionGroup>
<actionGroup ref="StorefrontCheckQuickSearchStringActionGroup" stepKey="quickSearchByDescription">
<argument name="phrase" value="Dynamicscription"/>
</actionGroup>
<actionGroup ref="StorefrontQuickSearchSeeProductByName" stepKey="assertDynamicBundleInSearchResultByDescription">
<argument name="productName" value="$createDynamicBundle.name$"/>
</actionGroup>
<actionGroup ref="StorefrontQuickSearchCheckProductNameNotInGrid" stepKey="dontSeeFixedBundleInSearchResultByDescription">
<argument name="productName" value="$createFixedBundle.name$"/>
</actionGroup>
<actionGroup ref="StorefrontCheckQuickSearchStringActionGroup" stepKey="quickSearchShortDescription">
<argument name="phrase" value="Dynamictest"/>
</actionGroup>
<actionGroup ref="StorefrontQuickSearchSeeProductByName" stepKey="assertDynamicBundleInSearchResultByShortDescription">
<argument name="productName" value="$createDynamicBundle.name$"/>
</actionGroup>
<actionGroup ref="StorefrontQuickSearchCheckProductNameNotInGrid" stepKey="dontSeeFixedBundleInSearchResultByShortDescription">
<argument name="productName" value="$createFixedBundle.name$"/>
</actionGroup>
<!-- 3. Fill quick search bar with test values mutual for both products and click search -->
<actionGroup ref="StorefrontCheckQuickSearchStringActionGroup" stepKey="quickSearchTest123">
<argument name="phrase" value="Test 123"/>
</actionGroup>
<actionGroup ref="StorefrontQuickSearchSeeProductByName" stepKey="seeDynamicBundleByTest123">
<argument name="productName" value="$createDynamicBundle.name$"/>
</actionGroup>
<actionGroup ref="StorefrontQuickSearchSeeProductByName" stepKey="seeFixedBundleByTest123">
<argument name="productName" value="$createFixedBundle.name$"/>
</actionGroup>
<actionGroup ref="StorefrontCheckQuickSearchStringActionGroup" stepKey="quickSearchTesting321">
<argument name="phrase" value="Testing 321"/>
</actionGroup>
<actionGroup ref="StorefrontQuickSearchSeeProductByName" stepKey="seeDynamicBundleByTesting321">
<argument name="productName" value="$createDynamicBundle.name$"/>
</actionGroup>
<actionGroup ref="StorefrontQuickSearchSeeProductByName" stepKey="seeFixedBundleByTesting321">
<argument name="productName" value="$createFixedBundle.name$"/>
</actionGroup>
<actionGroup ref="StorefrontCheckQuickSearchStringActionGroup" stepKey="quickSearchShort555">
<argument name="phrase" value="Short 555"/>
</actionGroup>
<actionGroup ref="StorefrontQuickSearchSeeProductByName" stepKey="seeDynamicBundleByShort555">
<argument name="productName" value="$createDynamicBundle.name$"/>
</actionGroup>
<actionGroup ref="StorefrontQuickSearchSeeProductByName" stepKey="seeFixedBundleByShort555">
<argument name="productName" value="$createFixedBundle.name$"/>
</actionGroup>
<!-- 4. Fill quick search bar with test values unique for fixed bundle product and click search -->
<actionGroup ref="StorefrontCheckQuickSearchStringActionGroup" stepKey="quickSearchByFixed">
<argument name="phrase" value="Fixed"/>
</actionGroup>
<actionGroup ref="StorefrontQuickSearchSeeProductByName" stepKey="seeFixedBundleByFixed">
<argument name="productName" value="$createFixedBundle.name$"/>
</actionGroup>
<actionGroup ref="StorefrontQuickSearchCheckProductNameNotInGrid" stepKey="dontSeeDynamicBundleByFixed">
<argument name="productName" value="$createDynamicBundle.name$"/>
</actionGroup>
<actionGroup ref="StorefrontCheckQuickSearchStringActionGroup" stepKey="quickSearchByDescriptionForFixed">
<argument name="phrase" value="Fixedscription"/>
</actionGroup>
<actionGroup ref="StorefrontQuickSearchSeeProductByName" stepKey="seeFixedBundleByDescriptionForFixed">
<argument name="productName" value="$createFixedBundle.name$"/>
</actionGroup>
<actionGroup ref="StorefrontQuickSearchCheckProductNameNotInGrid" stepKey="dontSeeDynamicProductByDescriptionForFixed">
<argument name="productName" value="$createDynamicBundle.name$"/>
</actionGroup>
<actionGroup ref="StorefrontCheckQuickSearchStringActionGroup" stepKey="quickSearchByShortDescriptionForFixed">
<argument name="phrase" value="Fixedtest"/>
</actionGroup>
<actionGroup ref="StorefrontQuickSearchSeeProductByName" stepKey="seeFixedBundleByShortDescriptionForFixed">
<argument name="productName" value="$createFixedBundle.name$"/>
</actionGroup>
<actionGroup ref="StorefrontQuickSearchCheckProductNameNotInGrid" stepKey="dontSeeDynamicBundleByShortDescriptionForFixed">
<argument name="productName" value="$createDynamicBundle.name$"/>
</actionGroup>
</test>
</tests>
Original file line number Diff line number Diff line change
Expand Up @@ -557,4 +557,23 @@
<remove keyForRemoval="seeCheckboxForWebsite"/>
<dontSeeCheckboxIsChecked selector="{{ProductInWebsitesSection.website(website)}}" after="expandProductWebsitesSection" stepKey="seeCustomWebsiteIsNotChecked"/>
</actionGroup>

<!-- You are on product Edit Page -->
<!-- Assert Product Name in admin Product page -->
<actionGroup name="AssertProductNameInProductEditForm">
<arguments>
<argument name="productName" type="string"/>
</arguments>
<seeInField selector="{{AdminProductFormSection.productName}}" userInput="{{productName}}" stepKey="seeProductNameOnEditProductPage"/>
</actionGroup>

<!-- You are on product Edit Page -->
<!-- Assert Product Description in admin Product page -->
<actionGroup name="AssertProductDescriptionInProductEditForm">
<arguments>
<argument name="productDescription" type="string"/>
</arguments>
<conditionalClick selector="{{AdminProductContentSection.sectionHeader}}" dependentSelector="{{AdminProductContentSection.sectionHeaderShow}}" visible="false" stepKey="expandContentSection"/>
<seeInField selector="{{AdminProductContentSection.descriptionTextArea}}" userInput="{{productDescription}}" stepKey="seeProductDescription"/>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<?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">
<!-- Update Product Name and Description attribute -->
<actionGroup name="AdminUpdateProductNameAndDescriptionAttributes">
<arguments>
<argument name="product"/>
</arguments>
<click selector="{{AdminProductGridSection.productGridCheckboxOnRow('1')}}" stepKey="clickCheckbox"/>
<click selector="{{AdminProductGridSection.bulkActionDropdown}}" stepKey="clickDropdown"/>
<click selector="{{AdminProductGridSection.bulkActionOption('Update attributes')}}" stepKey="clickOption"/>
<waitForPageLoad stepKey="waitForUploadPage"/>
<seeInCurrentUrl url="{{ProductAttributesEditPage.url}}" stepKey="seeAttributePageEditUrl"/>
<click selector="{{AdminUpdateAttributesSection.toggleName}}" stepKey="clickToChangeName"/>
<fillField selector="{{AdminUpdateAttributesSection.name}}" userInput="{{product.name}}" stepKey="fillFieldName"/>
<click selector="{{AdminUpdateAttributesSection.toggleDescription}}" stepKey="clickToChangeDescription"/>
<fillField selector="{{AdminUpdateAttributesSection.description}}" userInput="{{product.description}}" stepKey="fillFieldDescription"/>
<click selector="{{AdminUpdateAttributesSection.saveButton}}" stepKey="save"/>
<waitForElementVisible selector="{{AdminMessagesSection.successMessage}}" stepKey="waitVisibleSuccessMessage"/>
<see selector="{{AdminMessagesSection.successMessage}}" userInput="Message is added to queue" stepKey="seeSuccessMessage"/>
</actionGroup>
</actionGroups>
16 changes: 16 additions & 0 deletions app/code/Magento/Catalog/Test/Mftf/Data/CustomAttributeData.xml
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,20 @@
<data key="attribute_code">news_from_date</data>
<data key="value">2018-05-17 00:00:00</data>
</entity>
<entity name="CustomDynamicProductDescription" type="custom_attribute">
<data key="attribute_code">description</data>
<data key="value">Dynamicscription testing 321</data>
</entity>
<entity name="CustomDynamicProductShortDescription" type="custom_attribute">
<data key="attribute_code">short_description</data>
<data key="value">Short dynamictest 555</data>
</entity>
<entity name="CustomFixedProductDescription" type="custom_attribute">
<data key="attribute_code">description</data>
<data key="value">Fixedscription testing 321</data>
</entity>
<entity name="CustomFixedProductShortDescription" type="custom_attribute">
<data key="attribute_code">short_description</data>
<data key="value">Short Fixedtest 555</data>
</entity>
</entities>
Loading

0 comments on commit 0b6385f

Please sign in to comment.