Skip to content

Commit a2e0ef1

Browse files
Merge pull request #8921 from magento-gl/ACQE-6354_mainline_PR_deployment
[Bengals Team] Test Fixes and Automation Tasks
2 parents cfed47e + 038ddf9 commit a2e0ef1

File tree

69 files changed

+2182
-6
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

69 files changed

+2182
-6
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,191 @@
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="StorefrontCheckPriceForDynamicBundleProductWithMixedDiscountsTest">
12+
<annotations>
13+
<features value="Bundle"/>
14+
<stories value="View bundle product"/>
15+
<title value="Check mixed discount prices for bundle product"/>
16+
<description value="The testcase purpose to verify mixed discount prices for bundle product on storefront"/>
17+
<testCaseId value="AC-4571"/>
18+
<severity value="MAJOR"/>
19+
</annotations>
20+
<before>
21+
<!-- create three categories-->
22+
<createData entity="_defaultCategory" stepKey="category1"/>
23+
<createData entity="_defaultCategory" stepKey="category2"/>
24+
<createData entity="_defaultCategory" stepKey="category3"/>
25+
<!-- login to backend -->
26+
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>
27+
<actionGroup ref="AdminCatalogPriceRuleDeleteAllActionGroup" stepKey="clearExistingCatalogPriceRules"/>
28+
<!-- create two catalog rules for categories -->
29+
<!-- first catalog rule -->
30+
<actionGroup ref="AdminOpenNewCatalogPriceRuleFormPageActionGroup" stepKey="openNewCatalogPriceRulePage"/>
31+
<actionGroup ref="AdminCatalogPriceRuleFillMainInfoActionGroup" stepKey="fillMainInfoForCatalogPriceRule"/>
32+
<actionGroup ref="AdminFillCatalogRuleConditionActionGroup" stepKey="fillConditionsForCatalogPriceRule">
33+
<argument name="conditionValue" value="$category2.id$"/>
34+
</actionGroup>
35+
<actionGroup ref="AdminCatalogPriceRuleFillActionsActionGroup" stepKey="fillActionsForCatalogPriceRule">
36+
<argument name="apply" value="by_percent"/>
37+
<argument name="discountAmount" value="100"/>
38+
</actionGroup>
39+
<actionGroup ref="AdminCatalogPriceRuleSaveAndApplyActionGroup" stepKey="saveAndApplyFirstPriceRule"/>
40+
<!-- second catalog rule -->
41+
<actionGroup ref="AdminOpenNewCatalogPriceRuleFormPageActionGroup" stepKey="openAgainNewCatalogPriceRulePage"/>
42+
<actionGroup ref="AdminCatalogPriceRuleFillMainInfoActionGroup" stepKey="fillMainInfoForSecondCatalogPriceRule"/>
43+
<actionGroup ref="AdminFillCatalogRuleConditionActionGroup" stepKey="fillConditionsForSecondCatalogPriceRule">
44+
<argument name="conditionValue" value="$category3.id$"/>
45+
</actionGroup>
46+
<actionGroup ref="AdminCatalogPriceRuleFillActionsActionGroup" stepKey="fillActionsForSecondCatalogPriceRule">
47+
<argument name="apply" value="by_percent"/>
48+
<argument name="discountAmount" value="70"/>
49+
</actionGroup>
50+
<actionGroup ref="AdminCatalogPriceRuleSaveAndApplyActionGroup" stepKey="saveAndApplySecondPriceRule"/>
51+
<!-- create 6 simple products -->
52+
<!-- create first product -->
53+
<createData entity="_defaultProduct" stepKey="firstProduct">
54+
<field key="price">10.5</field>
55+
<field key="quantity">1000</field>
56+
<requiredEntity createDataKey="category1"/>
57+
</createData>
58+
<createData entity="tierPriceForSimpleProduct" stepKey="addTierPrice">
59+
<requiredEntity createDataKey="firstProduct"/>
60+
</createData>
61+
<!-- create second product -->
62+
<createData entity="SimpleProduct4" stepKey="secondProduct">
63+
<field key="price">15</field>
64+
<requiredEntity createDataKey="category2"/>
65+
</createData>
66+
<!-- create third product -->
67+
<createData entity="_defaultProduct" stepKey="thirdProduct">
68+
<field key="price">23.40</field>
69+
<field key="quantity">1000</field>
70+
<requiredEntity createDataKey="category1"/>
71+
</createData>
72+
<createData entity="specialProductPriceForProduct" stepKey="addSpecialPrice">
73+
<requiredEntity createDataKey="thirdProduct"/>
74+
</createData>
75+
<!-- create fourth product -->
76+
<createData entity="_defaultProduct" stepKey="fourthProduct">
77+
<field key="price">30</field>
78+
<field key="quantity">1000</field>
79+
<requiredEntity createDataKey="category3"/>
80+
</createData>
81+
<!-- create fifth product -->
82+
<createData entity="_defaultProduct" stepKey="fifthProduct">
83+
<field key="price">25</field>
84+
<field key="status">0</field>
85+
<field key="quantity">1000</field>
86+
<requiredEntity createDataKey="category1"/>
87+
</createData>
88+
<!-- create sixth product -->
89+
<createData entity="_defaultProduct" stepKey="sixthProduct">
90+
<field key="price">25</field>
91+
<field key="quantity">1000</field>
92+
<requiredEntity createDataKey="category1"/>
93+
</createData>
94+
<createData entity="specialProductPriceForSimpleProduct" stepKey="addSpecialPriceForSixthProduct">
95+
<requiredEntity createDataKey="sixthProduct"/>
96+
</createData>
97+
<!--Create Bundle product -->
98+
<createData entity="ApiBundleProductPriceViewRange" stepKey="createBundleProduct">
99+
<requiredEntity createDataKey="category1"/>
100+
</createData>
101+
<!-- Add options to the product -->
102+
<createData entity="MultipleSelectOption" stepKey="createBundleOption1_1">
103+
<requiredEntity createDataKey="createBundleProduct"/>
104+
<field key="required">false</field>
105+
</createData>
106+
<createData entity="DropDownBundleOption" stepKey="createBundleOption1_2">
107+
<requiredEntity createDataKey="createBundleProduct"/>
108+
<field key="required">false</field>
109+
</createData>
110+
<!-- add products to checkbox option -->
111+
<createData entity="ApiBundleLink" stepKey="linkOptionToFifthProduct">
112+
<requiredEntity createDataKey="createBundleProduct"/>
113+
<requiredEntity createDataKey="createBundleOption1_2"/>
114+
<requiredEntity createDataKey="fifthProduct"/>
115+
<field key="qty">1</field>
116+
</createData>
117+
<createData entity="ApiBundleLink" stepKey="linkOptionToFourthProduct">
118+
<requiredEntity createDataKey="createBundleProduct"/>
119+
<requiredEntity createDataKey="createBundleOption1_2"/>
120+
<requiredEntity createDataKey="fourthProduct"/>
121+
<field key="qty">3</field>
122+
</createData>
123+
<createData entity="ApiBundleLink" stepKey="linkOptionToSixthProduct">
124+
<requiredEntity createDataKey="createBundleProduct"/>
125+
<requiredEntity createDataKey="createBundleOption1_2"/>
126+
<requiredEntity createDataKey="sixthProduct"/>
127+
<field key="qty">1</field>
128+
</createData>
129+
<!-- add products to multiselect option -->
130+
<createData entity="ApiBundleLink" stepKey="linkOptionToSecondProduct">
131+
<requiredEntity createDataKey="createBundleProduct"/>
132+
<requiredEntity createDataKey="createBundleOption1_1"/>
133+
<requiredEntity createDataKey="secondProduct"/>
134+
<field key="qty">3</field>
135+
</createData>
136+
<createData entity="ApiBundleLink" stepKey="linkOptionToFirstProduct">
137+
<requiredEntity createDataKey="createBundleProduct"/>
138+
<requiredEntity createDataKey="createBundleOption1_1"/>
139+
<requiredEntity createDataKey="firstProduct"/>
140+
<field key="qty">2</field>
141+
</createData>
142+
<createData entity="ApiBundleLink" stepKey="linkOptionToThirdProduct">
143+
<requiredEntity createDataKey="createBundleProduct"/>
144+
<requiredEntity createDataKey="createBundleOption1_1"/>
145+
<requiredEntity createDataKey="thirdProduct"/>
146+
<field key="qty">1</field>
147+
</createData>
148+
<!-- Add advanced pricing to bundle product -->
149+
<actionGroup ref="AdminProductPageOpenByIdActionGroup" stepKey="openProductForEdit">
150+
<argument name="productId" value="$createBundleProduct.id$"/>
151+
</actionGroup>
152+
<actionGroup ref="AdminBundleProductSetAdvancedPricingActionGroup" stepKey="addProductTierPrice">
153+
<argument name="quantity" value="1"/>
154+
<argument name="price" value="Discount"/>
155+
<argument name="amount" value="75"/>
156+
<argument name="priceView" value="Price Range"/>
157+
</actionGroup>
158+
<!-- Reindex invalidated indices after product attribute has been created/deleted -->
159+
<actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindexInvalidatedIndices">
160+
<argument name="indices" value="catalogsearch_fulltext catalog_category_product catalog_product_price catalogrule_rule"/>
161+
</actionGroup>
162+
<actionGroup ref="CliCacheCleanActionGroup" stepKey="cleanCache">
163+
<argument name="tags" value="full_page"/>
164+
</actionGroup>
165+
</before>
166+
<after>
167+
<!-- delete created data -->
168+
<deleteData createDataKey="firstProduct" stepKey="deleteFirstProduct"/>
169+
<deleteData createDataKey="secondProduct" stepKey="deleteSecondProduct"/>
170+
<deleteData createDataKey="thirdProduct" stepKey="deleteThirdProduct"/>
171+
<deleteData createDataKey="fourthProduct" stepKey="deleteFourthProduct"/>
172+
<deleteData createDataKey="fifthProduct" stepKey="deleteFifthProduct"/>
173+
<deleteData createDataKey="sixthProduct" stepKey="deleteSixthProduct"/>
174+
<deleteData createDataKey="createBundleProduct" stepKey="deleteBundleProduct"/>
175+
<actionGroup ref="AdminCatalogPriceRuleDeleteAllActionGroup" stepKey="deleteCatalogPriceRules"/>
176+
<actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/>
177+
</after>
178+
<!-- Go to storefront category page -->
179+
<!-- check product prices on category and product page -->
180+
<actionGroup ref="StorefrontNavigateCategoryPageActionGroup" stepKey="amOnCategoryPage">
181+
<argument name="category" value="$$category1$$"/>
182+
</actionGroup>
183+
<waitForText userInput="From $4.69 Regular Price $21.00" selector="{{StorefrontCategoryProductSection.priceFromByProductId($$createBundleProduct.id$$)}}" stepKey="seePriceFromInCategoryBundle"/>
184+
<waitForText userInput="To $16.44 Regular Price $134.40" selector="{{StorefrontCategoryProductSection.priceToByProductId($$createBundleProduct.id$$)}}" stepKey="seePriceToInCategoryBundle"/>
185+
<actionGroup ref="StorefrontOpenProductPageActionGroup" stepKey="openBundleProductPage">
186+
<argument name="productUrl" value="$$createBundleProduct.custom_attributes[url_key]$$"/>
187+
</actionGroup>
188+
<waitForElement selector="{{StorefrontProductInfoMainSection.priceFrom('From $4.69 Regular Price $21.00')}}" stepKey="seePriceFromBundle"/>
189+
<waitForElement selector="{{StorefrontProductInfoMainSection.priceTo('To $16.44 Regular Price $134.40')}}" stepKey="seePriceToBundle"/>
190+
</test>
191+
</tests>
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
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+
<actionGroup name="ScrollToUpSellSectionAtStorefrontActionGroup">
12+
<annotations>
13+
<description>Admin scroll to upsell section on storefront preview page.</description>
14+
</annotations>
15+
<scrollTo selector="{{StorefrontProductUpSellProductsSection.upSellSection}}" stepKey="scrollToUpSellSection" />
16+
<waitForText selector="{{StorefrontProductUpSellProductsSection.upSellHeading}}" userInput="We found other products you might like!" stepKey="seeTheUpSellHeading"/>
17+
</actionGroup>
18+
</actionGroups>

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

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,14 @@
2323
<data key="store_id">0</data>
2424
<var key="sku" entityType="product" entityKey="sku" />
2525
</entity>
26+
<entity name="specialProductPriceForProduct" type="catalogSpecialPrice">
27+
<data key="price">18.77</data>
28+
<data key="store_id">0</data>
29+
<var key="sku" entityType="product" entityKey="sku" />
30+
</entity>
31+
<entity name="specialProductPriceForSimpleProduct" type="catalogSpecialPrice">
32+
<data key="price">19.99</data>
33+
<data key="store_id">0</data>
34+
<var key="sku" entityType="product" entityKey="sku" />
35+
</entity>
2636
</entities>

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

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -465,5 +465,15 @@
465465
<data key="frontend_input">price</data>
466466
<data key="used_for_sort_by">false</data>
467467
</entity>
468+
<entity name="productAttributeFPT" type="ProductAttribute">
469+
<data key="default_frontend_label">FPT</data>
470+
<data key="attribute_code">fpt</data>
471+
<data key="frontend_input">weee</data>
472+
<data key="scope">global</data>
473+
<data key="is_used_in_grid">true</data>
474+
<data key="is_visible_in_grid">true</data>
475+
<data key="is_filterable_in_grid">true</data>
476+
<requiredEntity type="FrontendLabel">ProductAttributeFrontendLabel</requiredEntity>
477+
</entity>
468478
</entities>
469479

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,4 +100,12 @@
100100
<data key="customer_group">General</data>
101101
<data key="quantity">3</data>
102102
</entity>
103+
<entity name="tierPriceForSimpleProduct" type="catalogTierPrice">
104+
<data key="price">9.99</data>
105+
<data key="price_type">fixed</data>
106+
<data key="website_id">0</data>
107+
<data key="customer_group">ALL GROUPS</data>
108+
<data key="quantity">1</data>
109+
<var key="sku" entityType="product" entityKey="sku" />
110+
</entity>
103111
</entities>

app/code/Magento/Catalog/Test/Mftf/Section/AdminProductFormSection/AdminAddRelatedProductsModalSection.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,6 @@
1010
<section name="AdminAddRelatedProductsModalSection">
1111
<element name="AddSelectedProductsButton" type="button" selector="//aside[contains(@class, 'related_modal')]//button[contains(@class, 'action-primary')]" timeout="30"/>
1212
<element name="AddUpSellProductsButton" type="button" selector="//aside[contains(@class, 'upsell_modal')]//button[contains(@class, 'action-primary')]" timeout="30"/>
13+
<element name="AddCrossSellProductsButton" type="button" selector="//aside[contains(@class, 'crosssell_modal')]//button[contains(@class, 'action-primary')]" timeout="30"/>
1314
</section>
1415
</sections>

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,5 +41,7 @@
4141
<element name="storeViewOptions" type="text" selector=".admin__data-grid-outer-wrap select[name='store_id'] > option[value='{{value}}']" parameterized="true"/>
4242
<element name="viewColumnOptionName" type="text" selector="//div[contains(@class, '_active')]//div[contains(@class, 'admin__data-grid-action-columns-menu')]//div[@class='admin__field-option']//label[text()='{{col}}']" parameterized="true"/>
4343
<element name="customAttribute" type="text" selector="input.admin__control-text[name='{{var}}']" parameterized="true"/>
44+
<element name="crossSellFilters" type="button" selector="//*[contains(@class, 'crosssell_product')]//button[text()='Filters']"/>
45+
<element name="upSellFilters" type="button" selector="//*[contains(@class, 'upsell_product')]//button[text()='Filters']"/>
4446
</section>
4547
</sections>

app/code/Magento/Catalog/Test/Mftf/Section/AdminProductRelatedUpSellCrossSellSection/AdminProductFormRelatedUpSellCrossSellSection.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,6 @@
2222
<element name="selectedProductSku" type="text" selector="//div[@data-index='{{section}}']//span[@data-index='sku']" parameterized="true" timeout="30"/>
2323
<element name="removeCrossSellProduct" type="button" selector="//span[text()='Cross-Sell Products']//..//..//..//span[text()='{{productName}}']//..//..//..//..//..//button[@class='action-delete']" parameterized="true"/>
2424
<element name="removeUpsellProduct" type="button" selector="//span[text()='Up-Sell Products']//..//..//..//span[text()='{{productName}}']//..//..//..//..//..//button[@class='action-delete']" parameterized="true"/>
25+
<element name="relatedUpSellCrossSellProductStagingSectionText" type="text" selector=".fieldset-wrapper.admin__fieldset-section[data-index='{{catalogStagingSection}}']" parameterized="true"/>
2526
</section>
2627
</sections>

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
<element name="listedProduct" type="block" selector="ol li:nth-child({{productPositionInList}}) img" parameterized="true"/>
1919
<element name="ProductImageByNumber" type="button" selector="//main//li[{{var1}}]//img" parameterized="true"/>
2020
<element name="categoryListView" type="button" selector="a[title='List']" timeout="30"/>
21-
2221
<element name="ProductTitleByName" type="button" selector="//main//li//a[contains(text(), '{{var1}}')]" parameterized="true"/>
2322
<element name="ProductPriceByName" type="text" selector="//main//li[.//a[contains(text(), '{{var1}}')]]//span[@class='price']" parameterized="true"/>
2423
<element name="ProductCatalogRuleSpecialPriceTitleByName" type="text" selector="//div[contains(@class, 'product-item-info')][.//a[contains(text(), '{{productName}}')]]//span[@class='special-price']/span" parameterized="true"/>
@@ -36,5 +35,10 @@
3635
<element name="ProductImageByNameAndSrc" type="text" selector="//main//li[.//a[contains(text(), '{{var1}}')]]//img[contains(@src, '{{src}}')]" parameterized="true"/>
3736
<element name="ProductStockUnavailable" type="text" selector="//*[text()='Out of stock']"/>
3837
<element name="listedProductOnProductPage" type="block" selector="//div[contains(@aria-labelledBy,'{{attribute_code}}')]//div[@aria-label='{{attribute_name}}']" parameterized="true"/>
38+
<element name="productCurrencyByProductName" type="text" selector="//strong[@class='product name product-item-name']//a[contains(text(),'{{productName}}')]/parent::strong/following-sibling::div[@class='price-box price-final_price']//span[@class='price' and contains(text(),'{{currencySymbol}}')]" parameterized="true"/>
39+
<element name="productPriceByProductName" type="text" selector="//strong[@class='product name product-item-name']//a[contains(text(),'{{productName}}')]/parent::strong/following-sibling::div[@class='price-box price-final_price']//span[@class='price' and contains(text(),'{{productPrice}}')]" parameterized="true"/>
40+
<element name="filterOptionCurrencySymbol" type="text" selector="//div[@class='filter-options-content']//a//span[@class='price' and contains(text(),'{{currencySymbol}}')]" parameterized="true"/>
41+
<element name="priceDropdown" type="button" selector="//div[@class='filter-options-title']"/>
42+
<element name="priceBlockShoppingOptions" type="block" selector="//div[@class='filter-options-content']"/>
3943
</section>
4044
</sections>

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,6 @@
1515
<element name="relatedProductName" type="button" selector="//*[@class='block related']//a[contains(text(), '{{productName}}')]" parameterized="true"/>
1616
<element name="relatedProductCheckBoxButton" type="button" selector="//*[@class='block related']//a[contains(text(), '{{productName}}')]/parent::*/parent::*//input[@class='checkbox related']" parameterized="true"/>
1717
<element name="selectAll" type="button" selector="//div[@class='block-actions']/button"/>
18+
<element name="relatedSection" type="text" selector=".related"/>
1819
</section>
1920
</sections>

0 commit comments

Comments
 (0)