Skip to content

Commit 0f88e2d

Browse files
committed
Merge branch 'MC-160' into RE-develop
2 parents 907f586 + 1af0957 commit 0f88e2d

File tree

1 file changed

+98
-0
lines changed

1 file changed

+98
-0
lines changed
Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
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="AdminDeleteCatalogPriceRuleTest">
12+
<annotations>
13+
<features value="CatalogRule"/>
14+
<stories value="Delete Catalog Price Rule"/>
15+
<title value="Admin should be able to delete catalog price rule"/>
16+
<description value="Admin should be able to delete catalog price rule"/>
17+
<severity value="MAJOR"/>
18+
<testCaseId value="MC-160"/>
19+
<group value="CatalogRule"/>
20+
</annotations>
21+
<before>
22+
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/>
23+
<createData entity="ApiCategory" stepKey="createCategory"/>
24+
25+
<!-- Create a simple product -->
26+
<createData entity="ApiSimpleProduct" stepKey="createSimpleProduct">
27+
<requiredEntity createDataKey="createCategory"/>
28+
</createData>
29+
30+
<!-- Create a configurable product -->
31+
<actionGroup ref="createConfigurableProduct" stepKey="createConfigurableProduct">
32+
<argument name="product" value="_defaultProduct"/>
33+
<argument name="category" value="$$createCategory$$"/>
34+
</actionGroup>
35+
</before>
36+
<after>
37+
<amOnPage url="{{AdminLogoutPage.url}}" stepKey="amOnLogoutPage"/>
38+
<deleteData createDataKey="createCategory" stepKey="deleteCategory"/>
39+
<deleteData createDataKey="createSimpleProduct" stepKey="deleteSimpleProduct"/>
40+
</after>
41+
42+
<!-- Create a catalog price rule -->
43+
<actionGroup ref="newCatalogPriceRuleByUI" stepKey="createNewPriceRule"/>
44+
<actionGroup ref="selectNotLoggedInCustomerGroup" stepKey="selectNotLoggedInCustomerGroup"/>
45+
<click selector="{{AdminNewCatalogPriceRule.saveAndApply}}" stepKey="saveAndApply"/>
46+
<see selector="{{AdminCategoryMessagesSection.SuccessMessage}}" userInput="You saved the rule." stepKey="assertSuccess"/>
47+
48+
<!-- Verify that category page shows the discount -->
49+
<amOnPage url="$$createCategory.name$$.html" stepKey="goToCategoryPage1"/>
50+
<see selector="{{StorefrontCategoryProductSection.ProductTitleByName(ApiSimpleProduct.name)}}" userInput="$$createSimpleProduct.name$$" stepKey="seeSimpleProduct1"/>
51+
<see selector="{{StorefrontCategoryProductSection.ProductPriceByName(ApiSimpleProduct.name)}}" userInput="$110.70" stepKey="seeSimpleProductDiscount1"/>
52+
<see selector="{{StorefrontCategoryProductSection.ProductTitleByName(_defaultProduct.name)}}" userInput="{{_defaultProduct.name}}" stepKey="seeConfigurableProduct1"/>
53+
<see selector="{{StorefrontCategoryProductSection.ProductPriceByName(_defaultProduct.name)}}" userInput="$0.90" stepKey="seeConfigurableProductDiscount1"/>
54+
55+
<!-- Verify that the simple product page shows the discount -->
56+
<amOnPage url="$$createSimpleProduct.custom_attributes[url_key]$$.html" stepKey="goToSimpleProductPage1"/>
57+
<see selector="{{StorefrontProductInfoMainSection.productName}}" userInput="$$createSimpleProduct.name$$" stepKey="seeCorrectName1"/>
58+
<see selector="{{StorefrontProductInfoMainSection.productSku}}" userInput="$$createSimpleProduct.sku$$" stepKey="seeCorrectSku1"/>
59+
<see selector="{{StorefrontProductInfoMainSection.productPrice}}" userInput="$110.70" stepKey="seeCorrectPrice1"/>
60+
61+
<!-- Verify that the configurable product page the catalog price rule discount -->
62+
<amOnPage url="{{_defaultProduct.urlKey}}.html" stepKey="goToConfigurableProductPage1"/>
63+
<see selector="{{StorefrontProductInfoMainSection.productName}}" userInput="{{_defaultProduct.name}}" stepKey="seeCorrectName2"/>
64+
<see selector="{{StorefrontProductInfoMainSection.productSku}}" userInput="{{_defaultProduct.sku}}" stepKey="seeCorrectSku2"/>
65+
<see selector="{{StorefrontProductInfoMainSection.productPrice}}" userInput="$0.90" stepKey="seeCorrectPrice2"/>
66+
67+
<!-- Delete the rule -->
68+
<amOnPage url="{{CatalogRulePage.url}}" stepKey="goToPriceRulePage"/>
69+
<actionGroup ref="deleteEntitySecondaryGrid" stepKey="deletePriceRule">
70+
<argument name="name" value="{{_defaultCatalogRule.name}}"/>
71+
<argument name="searchInput" value="{{AdminSecondaryGridSection.catalogRuleIdentifierSearch}}"/>
72+
</actionGroup>
73+
74+
<!-- Apply and flush the cache -->
75+
<click selector="{{AdminCatalogPriceRuleGrid.applyRules}}" stepKey="clickApplyRules"/>
76+
<magentoCLI command="indexer:reindex" stepKey="reindex"/>
77+
<magentoCLI command="cache:flush" stepKey="flushCache"/>
78+
79+
<!-- Verify that category page shows the original prices -->
80+
<amOnPage url="$$createCategory.name$$.html" stepKey="goToCategoryPage2"/>
81+
<see selector="{{StorefrontCategoryProductSection.ProductTitleByName(ApiSimpleProduct.name)}}" userInput="$$createSimpleProduct.name$$" stepKey="seeSimpleProduct2"/>
82+
<see selector="{{StorefrontCategoryProductSection.ProductPriceByName(ApiSimpleProduct.name)}}" userInput="$123.00" stepKey="seeSimpleProductDiscount2"/>
83+
<see selector="{{StorefrontCategoryProductSection.ProductTitleByName(_defaultProduct.name)}}" userInput="{{_defaultProduct.name}}" stepKey="seeConfigurableProduct2"/>
84+
<see selector="{{StorefrontCategoryProductSection.ProductPriceByName(_defaultProduct.name)}}" userInput="$1.00" stepKey="seeConfigurableProductDiscount2"/>
85+
86+
<!-- Verify that the simple product page shows the original price -->
87+
<amOnPage url="$$createSimpleProduct.custom_attributes[url_key]$$.html" stepKey="goToSimpleProductPage2"/>
88+
<see selector="{{StorefrontProductInfoMainSection.productName}}" userInput="$$createSimpleProduct.name$$" stepKey="seeCorrectName3"/>
89+
<see selector="{{StorefrontProductInfoMainSection.productSku}}" userInput="$$createSimpleProduct.sku$$" stepKey="seeCorrectSku3"/>
90+
<see selector="{{StorefrontProductInfoMainSection.productPrice}}" userInput="$123.00" stepKey="seeCorrectPrice3"/>
91+
92+
<!-- Verify that the configurable product page shows the original price -->
93+
<amOnPage url="{{_defaultProduct.urlKey}}.html" stepKey="goToConfigurableProductPage2"/>
94+
<see selector="{{StorefrontProductInfoMainSection.productName}}" userInput="{{_defaultProduct.name}}" stepKey="seeCorrectName4"/>
95+
<see selector="{{StorefrontProductInfoMainSection.productSku}}" userInput="{{_defaultProduct.sku}}" stepKey="seeCorrectSku4"/>
96+
<see selector="{{StorefrontProductInfoMainSection.productPrice}}" userInput="$1.00" stepKey="seeCorrectPrice4"/>
97+
</test>
98+
</tests>

0 commit comments

Comments
 (0)