Skip to content
This repository was archived by the owner on Apr 29, 2019. It is now read-only.

Commit f710f9b

Browse files
author
Alexander Akimov
authored
Merge pull request #3282 from magento-tsg/2.3-develop-mftf-pr7
[TSG] MFTF for 2.3 (pr7) (2.3.1)
2 parents 515218f + 1e501f2 commit f710f9b

13 files changed

+410
-9
lines changed

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

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -257,11 +257,10 @@
257257
<arguments>
258258
<argument name="website" type="string"/>
259259
</arguments>
260-
<scrollTo selector="{{CreateProductSection.productInWebsite}}" stepKey="ScrollToWebsites"/>
261-
<click selector="{{CreateProductSection.productInWebsite}}" stepKey="ClickTpOpenProductInWebsite"/>
260+
<scrollTo selector="{{ProductInWebsitesSection.sectionHeader}}" stepKey="scrollToWebsites"/>
261+
<click selector="{{ProductInWebsitesSection.sectionHeader}}" stepKey="clickToOpenProductInWebsite"/>
262262
<waitForPageLoad stepKey="waitForPageOpened"/>
263-
<click selector="{{CreateProductSection.isSelected(website)}}" stepKey="SelectWebsite"/>
264-
<click selector="{{CreateProductSection.saveButton}}" stepKey="clickSaveProduct"/>
263+
<checkOption selector="{{ProductInWebsitesSection.website(website)}}" stepKey="selectWebsite"/>
265264
</actionGroup>
266265

267266
<!--Switch to New Store view-->

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

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,26 @@
2020
<click selector="{{AdminProductAttributeGridSection.FirstRow}}" stepKey="clickOnAttributeRow"/>
2121
<waitForPageLoad stepKey="waitForPageLoad2" />
2222
</actionGroup>
23+
<actionGroup name="navigateToEditProductAttribute">
24+
<arguments>
25+
<argument name="ProductAttribute" type="string"/>
26+
</arguments>
27+
<amOnPage url="{{AdminProductAttributeGridPage.url}}" stepKey="navigateToProductAttributeGrid"/>
28+
<waitForPageLoad stepKey="waitForPageLoad1"/>
29+
<fillField selector="{{AdminProductAttributeGridSection.GridFilterFrontEndLabel}}" userInput="{{ProductAttribute}}" stepKey="navigateToAttributeEditPage1" />
30+
<click selector="{{AdminProductAttributeGridSection.Search}}" stepKey="navigateToAttributeEditPage2" />
31+
<waitForPageLoad stepKey="waitForPageLoad2" />
32+
<click selector="{{AdminProductAttributeGridSection.FirstRow}}" stepKey="navigateToAttributeEditPage3" />
33+
<waitForPageLoad stepKey="waitForPageLoad3" />
34+
</actionGroup>
35+
<actionGroup name="changeUseForPromoRuleConditionsProductAttribute">
36+
<arguments>
37+
<argument name="option" type="string"/>
38+
</arguments>
39+
<click selector="{{StorefrontPropertiesSection.StoreFrontPropertiesTab}}" stepKey="clickStoreFrontPropertiesTab"/>
40+
<waitForPageLoad stepKey="waitForPageLoad"/>
41+
<selectOption selector="{{StorefrontPropertiesSection.useForPromoRuleConditions}}" userInput="{{option}}" stepKey="changeOption"/>
42+
<click selector="{{AttributePropertiesSection.Save}}" stepKey="saveAttribute"/>
43+
<see selector="{{AdminMessagesSection.success}}" userInput="You saved the product attribute." stepKey="successMessage"/>
44+
</actionGroup>
2345
</actionGroups>

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,10 @@
1515
<argument name="mode" type="string"/>
1616
<argument name="numOfProductsPerPage" type="string"/>
1717
<argument name="sortBy" type="string" defaultValue="position"/>
18+
<argument name="sort" type="string" defaultValue="asc"/>
1819
</arguments>
1920
<!-- Go to storefront category page -->
20-
<amOnPage url="{{StorefrontCategoryPage.url(category)}}?product_list_limit={{numOfProductsPerPage}}&amp;product_list_mode={{mode}}&amp;product_list_order={{sortBy}}" stepKey="onCategoryPage"/>
21+
<amOnPage url="{{StorefrontCategoryPage.url(category)}}?product_list_limit={{numOfProductsPerPage}}&amp;product_list_mode={{mode}}&amp;product_list_order={{sortBy}}&amp;product_list_dir={{sort}}" stepKey="onCategoryPage"/>
2122
<waitForPageLoad stepKey="waitForPageLoad"/>
2223
</actionGroup>
2324

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,8 @@
1616
<data key="store_id">0</data>
1717
<data key="label" unique="suffix">attributeTwo</data>
1818
</entity>
19+
<entity name="ProductAttributeFrontendLabelThree" type="FrontendLabel">
20+
<data key="store_id">0</data>
21+
<data key="label" unique="suffix">attributeThree</data>
22+
</entity>
1923
</entities>

app/code/Magento/Catalog/Test/Mftf/Page/StorefrontProductPage.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
<pages xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
1010
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/PageObject.xsd">
11-
<page name="StorefrontProductPage" url="/{{var1}}.html" area="storefront" module="Catalog" parameterized="true">
11+
<page name="StorefrontProductPage" url="/{{var1}}.html" area="storefront" module="Magento_Catalog" parameterized="true">
1212
<section name="StorefrontProductInfoMainSection" />
1313
<section name="StorefrontProductInfoDetailsSection" />
1414
<section name="WYSIWYGToolbarSection"/>

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,6 @@
1414
<element name="rowProductSku" type="text" selector="#catalog_category_products_table tbody tr:nth-of-type({{row}}) .col-sku" parameterized="true"/>
1515
<element name="rowPrice" type="text" selector="#catalog_category_products_table tbody tr:nth-of-type({{row}}) .col-price" parameterized="true"/>
1616
<element name="rowPosition" type="input" selector="#catalog_category_products_table tbody tr:nth-of-type({{row}}) .col-position .position input" timeout="30" parameterized="true"/>
17+
<element name="productGridNameProduct" type="text" selector="//table[@id='catalog_category_products_table']//td[contains(., '{{productName}}')]" parameterized="true"/>
1718
</section>
18-
</sections>
19+
</sections>
Lines changed: 172 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,172 @@
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="AdminFilteringCategoryProductsUsingScopeSelectorTest">
12+
<annotations>
13+
<features value="Catalog"/>
14+
<title value="Filtering Category Products using scope selector"/>
15+
<description value="Filtering Category Products using scope selector"/>
16+
<severity value="MAJOR"/>
17+
<testCaseId value="MAGETWO-48850"/>
18+
<group value="catalog"/>
19+
</annotations>
20+
<before>
21+
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/>
22+
<!--Create website, Sore adn Store View-->
23+
<actionGroup ref="AdminCreateWebsiteActionGroup" stepKey="adminCreateWebsite">
24+
<argument name="newWebsiteName" value="secondWebsite"/>
25+
<argument name="websiteCode" value="second_website"/>
26+
</actionGroup>
27+
<actionGroup ref="AdminCreateNewStoreGroupActionGroup" stepKey="adminCreateStore">
28+
<argument name="website" value="secondWebsite"/>
29+
<argument name="storeGroupName" value="secondStore"/>
30+
<argument name="storeGroupCode" value="second_store"/>
31+
</actionGroup>
32+
<actionGroup ref="AdminCreateStoreViewActionGroup" stepKey="adminCreateStoreView">
33+
<argument name="StoreGroup" value="customStoreTierPrice"/>
34+
<argument name="customStore" value="customStoreView"/>
35+
</actionGroup>
36+
37+
<!--Create Simple Product and Category -->
38+
<createData entity="_defaultCategory" stepKey="createCategory"/>
39+
<createData entity="_defaultProduct" stepKey="createProduct0">
40+
<requiredEntity createDataKey="createCategory"/>
41+
</createData>
42+
<createData entity="_defaultProduct" stepKey="createProduct1">
43+
<requiredEntity createDataKey="createCategory"/>
44+
</createData>
45+
<createData entity="_defaultProduct" stepKey="createProduct2">
46+
<requiredEntity createDataKey="createCategory"/>
47+
</createData>
48+
<createData entity="_defaultProduct" stepKey="createProduct12">
49+
<requiredEntity createDataKey="createCategory"/>
50+
</createData>
51+
52+
<!-- Set filter to product name and product0 not assigned to any website-->
53+
<actionGroup ref="SearchForProductOnBackendActionGroup" stepKey="filterGroupedProductOptions">
54+
<argument name="product" value="_defaultProduct"/>
55+
</actionGroup>
56+
57+
<click selector="{{AdminProductGridSection.productGridNameProduct('$$createProduct0.name$$')}}"
58+
stepKey="clickOpenProductForEdit"/>
59+
<waitForPageLoad time="30" stepKey="waitForProductEditOpen"/>
60+
61+
<scrollTo selector="{{ProductInWebsitesSection.sectionHeader}}" stepKey="scrollToWebsitesSection"/>
62+
<click selector="{{ProductInWebsitesSection.sectionHeader}}" stepKey="clickToOpenWebsiteSection"/>
63+
<waitForPageLoad stepKey="waitForToOpenedWebsiteSection"/>
64+
<uncheckOption selector="{{ProductInWebsitesSection.website('Main Website')}}" stepKey="uncheckWebsite"/>
65+
<click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="clickSaveProduct"/>
66+
<see selector="{{AdminProductMessagesSection.successMessage}}" userInput="You saved the product."
67+
stepKey="seeSuccessMessage"/>
68+
69+
<!-- Set filter to product name and product2 in website 2 only -->
70+
<amOnPage url="{{AdminProductIndexPage.url}}" stepKey="navigateToProductIndex"/>
71+
<waitForPageLoad time="30" stepKey="waitForProductsPageToLoad"/>
72+
<click selector="{{AdminProductGridSection.productGridNameProduct('$$createProduct2.name$$')}}"
73+
stepKey="clickOpenProductForEdit1"/>
74+
<waitForPageLoad time="30" stepKey="waitForProductEditOpen1"/>
75+
76+
<actionGroup ref="SelectProductInWebsitesActionGroup" stepKey="selectProductInWebsites">
77+
<argument name="website" value="secondWebsite"/>
78+
</actionGroup>
79+
<uncheckOption selector="{{ProductInWebsitesSection.website('Main Website')}}" stepKey="uncheckWebsite1"/>
80+
<click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="clickSaveProduct1"/>
81+
<see selector="{{AdminProductMessagesSection.successMessage}}" userInput="You saved the product."
82+
stepKey="seeSuccessMessage1"/>
83+
84+
<!-- Set filter to product name and product12 assigned to both websites 1 and 2 -->
85+
<amOnPage url="{{AdminProductIndexPage.url}}" stepKey="navigateToProductIndex1"/>
86+
<waitForPageLoad time="30" stepKey="waitForProductsPageToLoad1"/>
87+
<click selector="{{AdminProductGridSection.productGridNameProduct('$$createProduct12.name$$')}}"
88+
stepKey="clickOpenProductForEdit2"/>
89+
<waitForPageLoad time="30" stepKey="waitForProductEditOpen2"/>
90+
91+
<actionGroup ref="SelectProductInWebsitesActionGroup" stepKey="selectProductInWebsites1">
92+
<argument name="website" value="secondWebsite"/>
93+
</actionGroup>
94+
<click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="clickSaveProduct2"/>
95+
<see selector="{{AdminProductMessagesSection.successMessage}}" userInput="You saved the product."
96+
stepKey="seeSuccessMessage2"/>
97+
</before>
98+
<after>
99+
<actionGroup ref="AdminDeleteWebsiteActionGroup" stepKey="deleteWebsite">
100+
<argument name="websiteName" value="secondWebsite"/>
101+
</actionGroup>
102+
<actionGroup ref="ClearProductsFilterActionGroup" stepKey="clearProductsFilter"/>
103+
<deleteData createDataKey="createProduct0" stepKey="deleteProduct"/>
104+
<deleteData createDataKey="createProduct1" stepKey="deleteProduct1"/>
105+
<deleteData createDataKey="createProduct2" stepKey="deleteProduct2"/>
106+
<deleteData createDataKey="createProduct12" stepKey="deleteProduct3"/>
107+
<deleteData createDataKey="createCategory" stepKey="deleteCategory"/>
108+
<actionGroup ref="logout" stepKey="logout"/>
109+
</after>
110+
<!-- Step 1-2: Open Category page and Set scope selector to All Store Views-->
111+
<amOnPage url="{{AdminCategoryPage.url}}" stepKey="goToCategoryPage"/>
112+
<waitForPageLoad stepKey="waitForCategoryPageLoad"/>
113+
<click selector="{{AdminCategorySidebarTreeSection.categoryInTree($$createCategory.name$$)}}"
114+
stepKey="clickCategoryName"/>
115+
<click selector="{{AdminCategoryProductsSection.sectionHeader}}" stepKey="openProductSection"/>
116+
<see selector="{{AdminCategoryProductsGridSection.productGridNameProduct($$createProduct0.name$$)}}"
117+
userInput="$$createProduct0.name$$" stepKey="seeProductName"/>
118+
<see selector="{{AdminCategoryProductsGridSection.productGridNameProduct($$createProduct1.name$$)}}"
119+
userInput="$$createProduct1.name$$" stepKey="seeProductName1"/>
120+
<see selector="{{AdminCategoryProductsGridSection.productGridNameProduct($$createProduct2.name$$)}}"
121+
userInput="$$createProduct2.name$$" stepKey="seeProductName2"/>
122+
<see selector="{{AdminCategoryProductsGridSection.productGridNameProduct($$createProduct12.name$$)}}"
123+
userInput="$$createProduct12.name$$" stepKey="seeProductName3"/>
124+
125+
<!-- Step 3: Set scope selector to Website1( Storeview for the Website 1) -->
126+
<scrollToTopOfPage stepKey="scrollToTopOfPage"/>
127+
<click selector="{{AdminCategoryMainActionsSection.CategoryStoreViewDropdownToggle}}"
128+
stepKey="clickStoresList"/>
129+
<waitForPageLoad stepKey="waitForCategoryPageLoad1"/>
130+
<click selector="{{AdminCategoryMainActionsSection.CategoryStoreViewOption('Default Store View')}}"
131+
stepKey="clickStoreView"/>
132+
<waitForElement selector="{{AdminCategoryMainActionsSection.CategoryStoreViewModalAccept}}"
133+
stepKey="waitForModalAccept"/>
134+
<click selector="{{AdminCategoryMainActionsSection.CategoryStoreViewModalAccept}}" stepKey="clickActionAccept"/>
135+
<waitForElementNotVisible selector="{{AdminCategoryMainActionsSection.CategoryStoreViewModalAccept}}"
136+
stepKey="waitForNotVisibleModalAccept"/>
137+
<waitForPageLoad stepKey="waitForCategoryPageLoad2"/>
138+
<click selector="{{AdminCategoryProductsSection.sectionHeader}}" stepKey="openProductSection1"/>
139+
<see selector="{{AdminCategoryProductsGridSection.productGridNameProduct($$createProduct1.name$$)}}"
140+
userInput="$$createProduct1.name$$" stepKey="seeProductName4"/>
141+
<see selector="{{AdminCategoryProductsGridSection.productGridNameProduct($$createProduct12.name$$)}}"
142+
userInput="$$createProduct12.name$$" stepKey="seeProductName5"/>
143+
<dontSee selector="{{AdminCategoryProductsGridSection.productGridNameProduct($$createProduct0.name$$)}}"
144+
userInput="$$createProduct0.name$$" stepKey="dontSeeProductName"/>
145+
<dontSee selector="{{AdminCategoryProductsGridSection.productGridNameProduct($$createProduct2.name$$)}}"
146+
userInput="$$createProduct2.name$$" stepKey="dontSeeProductName1"/>
147+
148+
<!-- Step 4: Set scope selector to Website2 ( StopreView for Website 2) -->
149+
<scrollToTopOfPage stepKey="scrollToTopOfPage1"/>
150+
<click selector="{{AdminCategoryMainActionsSection.CategoryStoreViewDropdownToggle}}"
151+
stepKey="clickStoresList1"/>
152+
<waitForPageLoad stepKey="waitForCategoryPageLoad3"/>
153+
<click selector="{{AdminCategoryMainActionsSection.CategoryStoreViewOption('secondStoreView')}}"
154+
stepKey="clickStoreView1"/>
155+
<waitForElement selector="{{AdminCategoryMainActionsSection.CategoryStoreViewModalAccept}}"
156+
stepKey="waitForModalAccept1"/>
157+
<click selector="{{AdminCategoryMainActionsSection.CategoryStoreViewModalAccept}}"
158+
stepKey="clickActionAccept1"/>
159+
<waitForElementNotVisible selector="{{AdminCategoryMainActionsSection.CategoryStoreViewModalAccept}}"
160+
stepKey="waitForNotVisibleModalAccept1"/>
161+
<waitForPageLoad stepKey="waitForCategoryPageLoad4"/>
162+
<click selector="{{AdminCategoryProductsSection.sectionHeader}}" stepKey="openProductSection2"/>
163+
<see selector="{{AdminCategoryProductsGridSection.productGridNameProduct($$createProduct2.name$$)}}"
164+
userInput="$$createProduct2.name$$" stepKey="seeProductName6"/>
165+
<see selector="{{AdminCategoryProductsGridSection.productGridNameProduct($$createProduct12.name$$)}}"
166+
userInput="$$createProduct12.name$$" stepKey="seeProductName7"/>
167+
<dontSee selector="{{AdminCategoryProductsGridSection.productGridNameProduct($$createProduct0.name$$)}}"
168+
userInput="$$createProduct0.name$$" stepKey="dontSeeProductName2"/>
169+
<dontSee selector="{{AdminCategoryProductsGridSection.productGridNameProduct($$createProduct2.name$$)}}"
170+
userInput="$$createProduct1.name$$" stepKey="dontSeeProductName3"/>
171+
</test>
172+
</tests>

app/code/Magento/CatalogRule/Test/Mftf/ActionGroup/CatalogPriceRuleActionGroup.xml

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
<amOnPage stepKey="goToPriceRulePage" url="{{CatalogRulePage.url}}"/>
1818
<waitForPageLoad stepKey="waitForPriceRulePage"/>
1919
<click stepKey="addNewRule" selector="{{AdminGridMainControls.add}}"/>
20-
<waitForPageLoad stepKey="waitForIndividualRulePage"/>
2120

2221
<!-- Fill the form according the attributes of the entity -->
2322
<fillField stepKey="fillName" selector="{{AdminNewCatalogPriceRule.ruleName}}" userInput="{{catalogRule.name}}"/>
@@ -44,4 +43,19 @@
4443
<click stepKey="applyRules" selector="{{AdminCatalogPriceRuleGrid.applyRules}}"/>
4544
<see stepKey="assertSuccess" selector="{{AdminCategoryMessagesSection.SuccessMessage}}" userInput="Updated rules applied."/>
4645
</actionGroup>
46+
47+
<!--Add Catalog Rule Condition With product SKU-->
48+
<actionGroup name="newCatalogPriceRuleByUIWithConditionIsSKU" extends="newCatalogPriceRuleByUI">
49+
<arguments>
50+
<argument name="productSku"/>
51+
</arguments>
52+
<click selector="{{AdminNewCatalogPriceRule.conditionsTab}}" after="discardSubsequentRules" stepKey="openConditionsTab"/>
53+
<waitForPageLoad after="openConditionsTab" stepKey="waitForConditionTabOpened"/>
54+
<click selector="{{AdminNewCatalogPriceRuleConditions.newCondition}}" after="waitForConditionTabOpened" stepKey="addNewCondition"/>
55+
<selectOption selector="{{AdminNewCatalogPriceRuleConditions.conditionSelect('1')}}" userInput="Magento\CatalogRule\Model\Rule\Condition\Product|sku" after="addNewCondition" stepKey="selectTypeCondition"/>
56+
<waitForPageLoad after="selectTypeCondition" stepKey="waitForConditionChosed"/>
57+
<click selector="{{AdminNewCatalogPriceRuleConditions.targetEllipsis('1')}}" after="waitForConditionChosed" stepKey="clickEllipsis"/>
58+
<fillField selector="{{AdminNewCatalogPriceRuleConditions.targetInput('1', '1')}}" userInput="{{productSku}}" after="clickEllipsis" stepKey="fillProductSku"/>
59+
<click selector="{{AdminNewCatalogPriceRuleConditions.applyButton('1', '1')}}" after="fillProductSku" stepKey="clickApply"/>
60+
</actionGroup>
4761
</actionGroups>

app/code/Magento/CatalogRule/Test/Mftf/Data/CatalogRuleData.xml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,4 +63,18 @@
6363
<data key="simple_action">to_fixed</data>
6464
<data key="discount_amount">110.7</data>
6565
</entity>
66+
67+
<entity name="CatalogRuleByPercentWith96Amount" type="catalogRule">
68+
<data key="name" unique="suffix">CatalogPriceRule</data>
69+
<data key="description">Catalog Price Rule Description</data>
70+
<data key="is_active">1</data>
71+
<array key="customer_group_ids">
72+
<item>0</item>
73+
</array>
74+
<array key="website_ids">
75+
<item>1</item>
76+
</array>
77+
<data key="simple_action">by_percent</data>
78+
<data key="discount_amount">96</data>
79+
</entity>
6680
</entities>

0 commit comments

Comments
 (0)