Skip to content

Commit 0b6385f

Browse files
authored
Merge pull request magento#4548 from magento-tsg/2.3-develop-mftf-pr20
[TSG] MFTF for 2.3 (pr20) (2.3-develop)
2 parents 50209dd + a0bcc52 commit 0b6385f

18 files changed

+824
-51
lines changed

app/code/Magento/Bundle/Test/Mftf/Data/ProductData.xml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,4 +107,35 @@
107107
<requiredEntity type="custom_attribute">CustomAttributeDynamicPrice</requiredEntity>
108108
<requiredEntity type="custom_attribute">CustomAttributePriceViewRange</requiredEntity>
109109
</entity>
110+
<entity name="DynamicBundleProductCustomDescription" type="product2">
111+
<data key="name" unique="suffix">Test 123 Dynamic </data>
112+
<data key="sku" unique="suffix">test-dynamic-bundle-product</data>
113+
<data key="type_id">bundle</data>
114+
<data key="attribute_set_id">4</data>
115+
<data key="visibility">4</data>
116+
<data key="status">1</data>
117+
<data key="urlKey" unique="suffix">test-dynamic-bundle-product</data>
118+
<requiredEntity type="product_extension_attribute">EavStockItem</requiredEntity>
119+
<requiredEntity type="custom_attribute">CustomDynamicProductDescription</requiredEntity>
120+
<requiredEntity type="custom_attribute">CustomDynamicProductShortDescription</requiredEntity>
121+
<requiredEntity type="custom_attribute">CustomAttributeDynamicPrice</requiredEntity>
122+
<requiredEntity type="custom_attribute">CustomAttributePriceViewRange</requiredEntity>
123+
</entity>
124+
<entity name="FixedBundleProductCustomDescription" type="product2">
125+
<data key="name" unique="suffix">Test 123 Fixed </data>
126+
<data key="sku" unique="suffix">test-fixed-bundle-product</data>
127+
<data key="type_id">bundle</data>
128+
<data key="attribute_set_id">4</data>
129+
<data key="price">10</data>
130+
<data key="visibility">4</data>
131+
<data key="status">1</data>
132+
<data key="urlKey" unique="suffix">api-fixed-bundle-product</data>
133+
<requiredEntity type="product_extension_attribute">EavStockItem</requiredEntity>
134+
<requiredEntity type="custom_attribute">CustomFixedProductDescription</requiredEntity>
135+
<requiredEntity type="custom_attribute">CustomFixedProductShortDescription</requiredEntity>
136+
<requiredEntity type="custom_attribute">CustomAttributePriceView</requiredEntity>
137+
<requiredEntity type="custom_attribute">CustomAttributeFixPrice</requiredEntity>
138+
<requiredEntity type="custom_attribute">CustomAttributeFixWeight</requiredEntity>
139+
<requiredEntity type="custom_attribute">CustomAttributeFixSku</requiredEntity>
140+
</entity>
110141
</entities>
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
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="AdminShouldBeAbleToMassUpdateAttributesForBundleProductsTest">
12+
<annotations>
13+
<features value="Bundle"/>
14+
<stories value="Admin list bundle products"/>
15+
<title value="Admin should be able to mass update attributes for bundle products"/>
16+
<description value="Admin should be able to mass update attributes for bundle products"/>
17+
<severity value="CRITICAL"/>
18+
<testCaseId value="MC-219"/>
19+
<group value="bundle"/>
20+
<group value="WYSIWYGDisabled"/>
21+
</annotations>
22+
<before>
23+
<!-- Create Simple Product -->
24+
<createData entity="SimpleProduct2" stepKey="createSimpleProduct"/>
25+
<!-- Create Fixed Bundle Product -->
26+
<createData entity="ApiFixedBundleProduct" stepKey="createFixedBundleProduct"/>
27+
<!-- Create DropDown Bundle Option -->
28+
<createData entity="DropDownBundleOption" stepKey="createBundleOption">
29+
<requiredEntity createDataKey="createFixedBundleProduct"/>
30+
</createData>
31+
<!-- Link Simple Product -->
32+
<createData entity="ApiBundleLink" stepKey="createNewBundleLink">
33+
<requiredEntity createDataKey="createFixedBundleProduct"/>
34+
<requiredEntity createDataKey="createBundleOption"/>
35+
<requiredEntity createDataKey="createSimpleProduct"/>
36+
</createData>
37+
</before>
38+
<after>
39+
<!-- Delete Simple Product -->
40+
<deleteData createDataKey="createSimpleProduct" stepKey="deleteSimpleProduct"/>
41+
<!-- Delete Fixed Bundle Product -->
42+
<deleteData createDataKey="createFixedBundleProduct" stepKey="deleteBundleProduct"/>
43+
<!-- Clear Filter -->
44+
<actionGroup ref="ClearProductsFilterActionGroup" stepKey="clearProductFilter"/>
45+
<!--Log Out Admin-->
46+
<actionGroup ref="logout" stepKey="logoutAsAdmin"/>
47+
</after>
48+
<!-- Login as Admin -->
49+
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/>
50+
<!-- Go to Catalog -> Catalog -> Products and Search created product in precondition and choose it -->
51+
<actionGroup ref="SearchForProductOnBackendActionGroup" stepKey="searchProduct">
52+
<argument name="product" value="$$createFixedBundleProduct$$"/>
53+
</actionGroup>
54+
<!-- Choose "Update attributes" and Change any product data -->
55+
<actionGroup ref="AdminUpdateProductNameAndDescriptionAttributes" stepKey="updateProductAttribute">
56+
<argument name="product" value="UpdateAttributeNameAndDescription"/>
57+
</actionGroup>
58+
<!--Run cron twice-->
59+
<magentoCLI command="cron:run" stepKey="cronRun"/>
60+
<magentoCLI command="cron:run" stepKey="cronRunTwice"/>
61+
<!-- Search for a product with a new name and Open Product -->
62+
<actionGroup ref="filterProductGridByName" stepKey="searchWithNewProductName">
63+
<argument name="product" value="UpdateAttributeNameAndDescription"/>
64+
</actionGroup>
65+
<actionGroup ref="OpenEditProductOnBackendActionGroup" stepKey="openProductPage">
66+
<argument name="product" value="$$createFixedBundleProduct$$"/>
67+
</actionGroup>
68+
<!-- Assert product name and description -->
69+
<actionGroup ref="AssertProductNameInProductEditForm" stepKey="assertProductName">
70+
<argument name="productName" value="{{UpdateAttributeNameAndDescription.name}}"/>
71+
</actionGroup>
72+
<actionGroup ref="AssertProductDescriptionInProductEditForm" stepKey="assertProductDescription">
73+
<argument name="productDescription" value="{{UpdateAttributeNameAndDescription.description}}"/>
74+
</actionGroup>
75+
</test>
76+
</tests>
Lines changed: 137 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,137 @@
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="StorefrontCustomerSearchBundleProductsByKeywordsTest">
12+
<annotations>
13+
<features value="Bundle"/>
14+
<stories value="Bundle products list on Storefront"/>
15+
<title value="Customer should be able to see search results when searching for bundle products by keyword"/>
16+
<description value="Customer should be able to see search results when searching for bundle products by keyword"/>
17+
<severity value="CRITICAL"/>
18+
<testCaseId value="MC-227"/>
19+
<group value="bundle"/>
20+
</annotations>
21+
<before>
22+
<createData entity="SimpleProductNotVisibleIndividually" stepKey="createSimpleProduct"/>
23+
<createData entity="DynamicBundleProductCustomDescription" stepKey="createDynamicBundle"/>
24+
<createData entity="DropDownBundleOption" stepKey="dynamicBundleOption">
25+
<requiredEntity createDataKey="createDynamicBundle"/>
26+
</createData>
27+
<createData entity="ApiBundleLink" stepKey="createDynamicBundleLink">
28+
<requiredEntity createDataKey="createDynamicBundle"/>
29+
<requiredEntity createDataKey="dynamicBundleOption"/>
30+
<requiredEntity createDataKey="createSimpleProduct"/>
31+
</createData>
32+
<createData entity="SimpleProductNotVisibleIndividually" stepKey="createSimpleProductTwo"/>
33+
<createData entity="FixedBundleProductCustomDescription" stepKey="createFixedBundle"/>
34+
<createData entity="DropDownBundleOption" stepKey="fixedBundleOption">
35+
<requiredEntity createDataKey="createFixedBundle"/>
36+
</createData>
37+
<createData entity="ApiBundleLink" stepKey="createFixedBundleLink">
38+
<requiredEntity createDataKey="createFixedBundle"/>
39+
<requiredEntity createDataKey="fixedBundleOption"/>
40+
<requiredEntity createDataKey="createSimpleProductTwo"/>
41+
</createData>
42+
<magentoCLI command="indexer:reindex" arguments="cataloginventory_stock catalogsearch_fulltext" stepKey="reindex"/>
43+
</before>
44+
<after>
45+
<deleteData createDataKey="createDynamicBundle" stepKey="deleteDynamicBundleProduct"/>
46+
<deleteData createDataKey="createFixedBundle" stepKey="deleteFixedBundleProduct"/>
47+
<deleteData createDataKey="createSimpleProduct" stepKey="deleteSimpleProduct"/>
48+
<deleteData createDataKey="createSimpleProductTwo" stepKey="createSimpleProductTwo"/>
49+
</after>
50+
<!-- 1. Go to storefront home page -->
51+
<amOnPage url="{{StorefrontHomePage.url}}" stepKey="goToStorefrontPage"/>
52+
<!-- 2. Fill quick search bar with test values unique for dynamic bundle product and click search -->
53+
<actionGroup ref="StorefrontCheckQuickSearchStringActionGroup" stepKey="quickSearchDynamic">
54+
<argument name="phrase" value="Dynamic"/>
55+
</actionGroup>
56+
<actionGroup ref="StorefrontQuickSearchSeeProductByName" stepKey="assertDynamicBundleInSearchResultByDynamic">
57+
<argument name="productName" value="$createDynamicBundle.name$"/>
58+
</actionGroup>
59+
<actionGroup ref="StorefrontQuickSearchCheckProductNameNotInGrid" stepKey="assertFixedBundleInSearchResultByDynamic">
60+
<argument name="productName" value="$createFixedBundle.name$"/>
61+
</actionGroup>
62+
<actionGroup ref="StorefrontCheckQuickSearchStringActionGroup" stepKey="quickSearchByDescription">
63+
<argument name="phrase" value="Dynamicscription"/>
64+
</actionGroup>
65+
<actionGroup ref="StorefrontQuickSearchSeeProductByName" stepKey="assertDynamicBundleInSearchResultByDescription">
66+
<argument name="productName" value="$createDynamicBundle.name$"/>
67+
</actionGroup>
68+
<actionGroup ref="StorefrontQuickSearchCheckProductNameNotInGrid" stepKey="dontSeeFixedBundleInSearchResultByDescription">
69+
<argument name="productName" value="$createFixedBundle.name$"/>
70+
</actionGroup>
71+
<actionGroup ref="StorefrontCheckQuickSearchStringActionGroup" stepKey="quickSearchShortDescription">
72+
<argument name="phrase" value="Dynamictest"/>
73+
</actionGroup>
74+
<actionGroup ref="StorefrontQuickSearchSeeProductByName" stepKey="assertDynamicBundleInSearchResultByShortDescription">
75+
<argument name="productName" value="$createDynamicBundle.name$"/>
76+
</actionGroup>
77+
<actionGroup ref="StorefrontQuickSearchCheckProductNameNotInGrid" stepKey="dontSeeFixedBundleInSearchResultByShortDescription">
78+
<argument name="productName" value="$createFixedBundle.name$"/>
79+
</actionGroup>
80+
<!-- 3. Fill quick search bar with test values mutual for both products and click search -->
81+
<actionGroup ref="StorefrontCheckQuickSearchStringActionGroup" stepKey="quickSearchTest123">
82+
<argument name="phrase" value="Test 123"/>
83+
</actionGroup>
84+
<actionGroup ref="StorefrontQuickSearchSeeProductByName" stepKey="seeDynamicBundleByTest123">
85+
<argument name="productName" value="$createDynamicBundle.name$"/>
86+
</actionGroup>
87+
<actionGroup ref="StorefrontQuickSearchSeeProductByName" stepKey="seeFixedBundleByTest123">
88+
<argument name="productName" value="$createFixedBundle.name$"/>
89+
</actionGroup>
90+
<actionGroup ref="StorefrontCheckQuickSearchStringActionGroup" stepKey="quickSearchTesting321">
91+
<argument name="phrase" value="Testing 321"/>
92+
</actionGroup>
93+
<actionGroup ref="StorefrontQuickSearchSeeProductByName" stepKey="seeDynamicBundleByTesting321">
94+
<argument name="productName" value="$createDynamicBundle.name$"/>
95+
</actionGroup>
96+
<actionGroup ref="StorefrontQuickSearchSeeProductByName" stepKey="seeFixedBundleByTesting321">
97+
<argument name="productName" value="$createFixedBundle.name$"/>
98+
</actionGroup>
99+
<actionGroup ref="StorefrontCheckQuickSearchStringActionGroup" stepKey="quickSearchShort555">
100+
<argument name="phrase" value="Short 555"/>
101+
</actionGroup>
102+
<actionGroup ref="StorefrontQuickSearchSeeProductByName" stepKey="seeDynamicBundleByShort555">
103+
<argument name="productName" value="$createDynamicBundle.name$"/>
104+
</actionGroup>
105+
<actionGroup ref="StorefrontQuickSearchSeeProductByName" stepKey="seeFixedBundleByShort555">
106+
<argument name="productName" value="$createFixedBundle.name$"/>
107+
</actionGroup>
108+
<!-- 4. Fill quick search bar with test values unique for fixed bundle product and click search -->
109+
<actionGroup ref="StorefrontCheckQuickSearchStringActionGroup" stepKey="quickSearchByFixed">
110+
<argument name="phrase" value="Fixed"/>
111+
</actionGroup>
112+
<actionGroup ref="StorefrontQuickSearchSeeProductByName" stepKey="seeFixedBundleByFixed">
113+
<argument name="productName" value="$createFixedBundle.name$"/>
114+
</actionGroup>
115+
<actionGroup ref="StorefrontQuickSearchCheckProductNameNotInGrid" stepKey="dontSeeDynamicBundleByFixed">
116+
<argument name="productName" value="$createDynamicBundle.name$"/>
117+
</actionGroup>
118+
<actionGroup ref="StorefrontCheckQuickSearchStringActionGroup" stepKey="quickSearchByDescriptionForFixed">
119+
<argument name="phrase" value="Fixedscription"/>
120+
</actionGroup>
121+
<actionGroup ref="StorefrontQuickSearchSeeProductByName" stepKey="seeFixedBundleByDescriptionForFixed">
122+
<argument name="productName" value="$createFixedBundle.name$"/>
123+
</actionGroup>
124+
<actionGroup ref="StorefrontQuickSearchCheckProductNameNotInGrid" stepKey="dontSeeDynamicProductByDescriptionForFixed">
125+
<argument name="productName" value="$createDynamicBundle.name$"/>
126+
</actionGroup>
127+
<actionGroup ref="StorefrontCheckQuickSearchStringActionGroup" stepKey="quickSearchByShortDescriptionForFixed">
128+
<argument name="phrase" value="Fixedtest"/>
129+
</actionGroup>
130+
<actionGroup ref="StorefrontQuickSearchSeeProductByName" stepKey="seeFixedBundleByShortDescriptionForFixed">
131+
<argument name="productName" value="$createFixedBundle.name$"/>
132+
</actionGroup>
133+
<actionGroup ref="StorefrontQuickSearchCheckProductNameNotInGrid" stepKey="dontSeeDynamicBundleByShortDescriptionForFixed">
134+
<argument name="productName" value="$createDynamicBundle.name$"/>
135+
</actionGroup>
136+
</test>
137+
</tests>

app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminProductActionGroup.xml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -557,4 +557,23 @@
557557
<remove keyForRemoval="seeCheckboxForWebsite"/>
558558
<dontSeeCheckboxIsChecked selector="{{ProductInWebsitesSection.website(website)}}" after="expandProductWebsitesSection" stepKey="seeCustomWebsiteIsNotChecked"/>
559559
</actionGroup>
560+
561+
<!-- You are on product Edit Page -->
562+
<!-- Assert Product Name in admin Product page -->
563+
<actionGroup name="AssertProductNameInProductEditForm">
564+
<arguments>
565+
<argument name="productName" type="string"/>
566+
</arguments>
567+
<seeInField selector="{{AdminProductFormSection.productName}}" userInput="{{productName}}" stepKey="seeProductNameOnEditProductPage"/>
568+
</actionGroup>
569+
570+
<!-- You are on product Edit Page -->
571+
<!-- Assert Product Description in admin Product page -->
572+
<actionGroup name="AssertProductDescriptionInProductEditForm">
573+
<arguments>
574+
<argument name="productDescription" type="string"/>
575+
</arguments>
576+
<conditionalClick selector="{{AdminProductContentSection.sectionHeader}}" dependentSelector="{{AdminProductContentSection.sectionHeaderShow}}" visible="false" stepKey="expandContentSection"/>
577+
<seeInField selector="{{AdminProductContentSection.descriptionTextArea}}" userInput="{{productDescription}}" stepKey="seeProductDescription"/>
578+
</actionGroup>
560579
</actionGroups>
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+
<!-- Update Product Name and Description attribute -->
12+
<actionGroup name="AdminUpdateProductNameAndDescriptionAttributes">
13+
<arguments>
14+
<argument name="product"/>
15+
</arguments>
16+
<click selector="{{AdminProductGridSection.productGridCheckboxOnRow('1')}}" stepKey="clickCheckbox"/>
17+
<click selector="{{AdminProductGridSection.bulkActionDropdown}}" stepKey="clickDropdown"/>
18+
<click selector="{{AdminProductGridSection.bulkActionOption('Update attributes')}}" stepKey="clickOption"/>
19+
<waitForPageLoad stepKey="waitForUploadPage"/>
20+
<seeInCurrentUrl url="{{ProductAttributesEditPage.url}}" stepKey="seeAttributePageEditUrl"/>
21+
<click selector="{{AdminUpdateAttributesSection.toggleName}}" stepKey="clickToChangeName"/>
22+
<fillField selector="{{AdminUpdateAttributesSection.name}}" userInput="{{product.name}}" stepKey="fillFieldName"/>
23+
<click selector="{{AdminUpdateAttributesSection.toggleDescription}}" stepKey="clickToChangeDescription"/>
24+
<fillField selector="{{AdminUpdateAttributesSection.description}}" userInput="{{product.description}}" stepKey="fillFieldDescription"/>
25+
<click selector="{{AdminUpdateAttributesSection.saveButton}}" stepKey="save"/>
26+
<waitForElementVisible selector="{{AdminMessagesSection.successMessage}}" stepKey="waitVisibleSuccessMessage"/>
27+
<see selector="{{AdminMessagesSection.successMessage}}" userInput="Message is added to queue" stepKey="seeSuccessMessage"/>
28+
</actionGroup>
29+
</actionGroups>

app/code/Magento/Catalog/Test/Mftf/Data/CustomAttributeData.xml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,4 +35,20 @@
3535
<data key="attribute_code">news_from_date</data>
3636
<data key="value">2018-05-17 00:00:00</data>
3737
</entity>
38+
<entity name="CustomDynamicProductDescription" type="custom_attribute">
39+
<data key="attribute_code">description</data>
40+
<data key="value">Dynamicscription testing 321</data>
41+
</entity>
42+
<entity name="CustomDynamicProductShortDescription" type="custom_attribute">
43+
<data key="attribute_code">short_description</data>
44+
<data key="value">Short dynamictest 555</data>
45+
</entity>
46+
<entity name="CustomFixedProductDescription" type="custom_attribute">
47+
<data key="attribute_code">description</data>
48+
<data key="value">Fixedscription testing 321</data>
49+
</entity>
50+
<entity name="CustomFixedProductShortDescription" type="custom_attribute">
51+
<data key="attribute_code">short_description</data>
52+
<data key="value">Short Fixedtest 555</data>
53+
</entity>
3854
</entities>

0 commit comments

Comments
 (0)