Skip to content

Commit a8bc8f2

Browse files
author
Bohdan Shevchenko
committed
MC-20397: [MFTF Test] Unskip MFTF test MC-13607 "Verify that Catalog Price Rule and Customer Group Membership are persisted under long-term cookie"
1 parent 8dc4a67 commit a8bc8f2

5 files changed

+170
-1
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
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="AssertStorefrontProductPriceInCategoryPageActionGroup">
12+
<annotations>
13+
<description>Goes to Storefront Category page for the provided Category. Validates that the Product price is present and correct.</description>
14+
</annotations>
15+
<arguments>
16+
<argument name="categoryUrl" type="string" defaultValue="{{SimpleRootSubCategory.url_key}}"/>
17+
<argument name="productName" type="string" defaultValue="{{productWithHTMLEntityOne.name}}"/>
18+
<argument name="productPrice" type="string" defaultValue="{{productWithHTMLEntityOne.price}}"/>
19+
</arguments>
20+
21+
<amOnPage url="{{StorefrontCategoryPage.url(categoryUrl)}}" stepKey="navigateToCategoryPage"/>
22+
<waitForPageLoad stepKey="waitForProductPageLoad"/>
23+
<see userInput="{{productPrice}}" selector="{{StorefrontCategoryProductSection.ProductPriceByName(productName)}}" stepKey="assertProductPrice"/>
24+
</actionGroup>
25+
</actionGroups>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
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="AssertStorefrontProductSpecialPriceInCategoryPageActionGroup" extends="AssertStorefrontProductPriceInCategoryPageActionGroup">
12+
<annotations>
13+
<description>Goes to Storefront Category page for the provided Category. Validates that the Product price and special price are correct.</description>
14+
</annotations>
15+
<arguments>
16+
<argument name="productSpecialPrice" type="string" defaultValue="{{updateVirtualProductSpecialPrice.special_price}}"/>
17+
</arguments>
18+
19+
<see userInput="{{productSpecialPrice}}" selector="{{StorefrontCategoryProductSection.ProductCatalogRuleSpecialPriceTitleByName(productName)}}" after="assertProductPrice" stepKey="assertProductSpecialPrice"/>
20+
</actionGroup>
21+
</actionGroups>

app/code/Magento/CatalogRule/Test/Mftf/Test/CatalogPriceRuleAndCustomerGroupMembershipArePersistedUnderLongTermCookieTest.xml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,14 @@
1212
<annotations>
1313
<features value="Persistent"/>
1414
<stories value="Check the price"/>
15-
<title value="Verify that Catalog Price Rule and Customer Group Membership are persisted under long-term cookie"/>
15+
<title value="DEPRECATED. Verify that Catalog Price Rule and Customer Group Membership are persisted under long-term cookie"/>
1616
<description value="Verify that Catalog Price Rule and Customer Group Membership are persisted under long-term cookie"/>
1717
<severity value="CRITICAL"/>
1818
<testCaseId value="MAGETWO-69455"/>
1919
<group value="persistent"/>
20+
<skip>
21+
<issueId value="DEPRECATED">Use StorefrontCatalogPriceRuleAndCustomerGroupMembershipArePersistedUnderLongTermCookieTest instead</issueId>
22+
</skip>
2023
</annotations>
2124
<before>
2225
<createData entity="PersistentConfigEnabled" stepKey="enablePersistent"/>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
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="StorefrontCatalogPriceRuleAndCustomerGroupMembershipArePersistedUnderLongTermCookieTest">
12+
<annotations>
13+
<features value="Persistent"/>
14+
<stories value="Check the price"/>
15+
<title value="Verify that Catalog Price Rule and Customer Group Membership are persisted under long-term cookie"/>
16+
<description value="Verify that Catalog Price Rule and Customer Group Membership are persisted under long-term cookie"/>
17+
<severity value="CRITICAL"/>
18+
<testCaseId value="MC-13607"/>
19+
<group value="persistent"/>
20+
</annotations>
21+
<before>
22+
<createData entity="PersistentConfigSettings" stepKey="enablePersistent"/>
23+
<createData entity="_defaultCategory" stepKey="createCategory"/>
24+
<createData entity="productWithHTMLEntityOne" stepKey="createProduct">
25+
<requiredEntity createDataKey="createCategory"/>
26+
</createData>
27+
<createData entity="Simple_US_Customer" stepKey="createCustomer"/>
28+
29+
<!--Delete all Catalog Price Rule if exist-->
30+
<actionGroup ref="LoginAsAdmin" stepKey="loginToAdminPanel"/>
31+
<actionGroup ref="AdminCatalogPriceRuleDeleteAllActionGroup" stepKey="deleteAllCatalogPriceRule"/>
32+
33+
<!--Create Catalog Rule-->
34+
<actionGroup ref="AdminOpenNewCatalogPriceRuleFormPageActionGroup" stepKey="startCreatingFirstPriceRule"/>
35+
<actionGroup ref="AdminCatalogPriceRuleFillMainInfoActionGroup" stepKey="fillMainInfoForFirstPriceRule">
36+
<argument name="groups" value="'General'"/>
37+
</actionGroup>
38+
<actionGroup ref="AdminFillCatalogRuleConditionActionGroup" stepKey="createCatalogPriceRule">
39+
<argument name="conditionValue" value="$createCategory.id$"/>
40+
</actionGroup>
41+
<actionGroup ref="AdminCatalogPriceRuleFillActionsActionGroup" stepKey="fillActionsForThirdPriceRule"/>
42+
<actionGroup ref="AdminCatalogPriceRuleSaveAndApplyActionGroup" stepKey="clickSaveAndApplyRule"/>
43+
44+
<!-- Perform reindex -->
45+
<magentoCLI command="indexer:reindex" arguments="catalogrule_rule" stepKey="reindex"/>
46+
</before>
47+
<after>
48+
<createData entity="PersistentConfigDefault" stepKey="setDefaultPersistentState"/>
49+
<createData entity="PersistentLogoutClearEnabled" stepKey="persistentLogoutClearEnabled"/>
50+
<deleteData createDataKey="createCategory" stepKey="deleteCategory"/>
51+
<deleteData createDataKey="createProduct" stepKey="deleteProduct"/>
52+
<deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/>
53+
<!-- Delete the rule -->
54+
<actionGroup ref="AdminCatalogPriceRuleDeleteAllActionGroup" stepKey="deleteAllCatalogPriceRule"/>
55+
<actionGroup ref="logout" stepKey="logout"/>
56+
</after>
57+
58+
<!--Go to category and check price-->
59+
<actionGroup ref="AssertStorefrontProductPriceInCategoryPageActionGroup" stepKey="assertProductPriceInCategoryPage">
60+
<argument name="categoryUrl" value="$createCategory.custom_attributes[url_key]$"/>
61+
<argument name="productName" value="$createProduct.name$"/>
62+
</actionGroup>
63+
64+
<!--Login to storefront from customer and check price-->
65+
<actionGroup ref="LoginToStorefrontActionGroup" stepKey="logInFromCustomer">
66+
<argument name="Customer" value="$createCustomer$"/>
67+
</actionGroup>
68+
<actionGroup ref="AssertCustomerWelcomeMessageActionGroup" stepKey="seeWelcomeMessageForJohnDoeCustomer">
69+
<argument name="customerFullName" value="{{Simple_Customer_Without_Address.fullname}}"/>
70+
</actionGroup>
71+
72+
<!--Go to category and check special price-->
73+
<actionGroup ref="AssertStorefrontProductSpecialPriceInCategoryPageActionGroup" stepKey="assertProductSpecialPriceInCategoryPage">
74+
<argument name="categoryUrl" value="$createCategory.custom_attributes[url_key]$"/>
75+
<argument name="productName" value="$createProduct.name$"/>
76+
</actionGroup>
77+
78+
79+
<!--Click *Sign Out*-->
80+
<actionGroup ref="StorefrontSignOutActionGroup" stepKey="storefrontSignOut"/>
81+
<actionGroup ref="StorefrontAssertPersistentCustomerWelcomeMessageActionGroup" stepKey="seeWelcomeForJohnDoeCustomer">
82+
<argument name="customerFullName" value="{{Simple_Customer_Without_Address.fullname}}"/>
83+
</actionGroup>
84+
85+
<!--Go to category and check special price-->
86+
<actionGroup ref="AssertStorefrontProductSpecialPriceInCategoryPageActionGroup" stepKey="assertProductSpecialPriceInCategoryPageAfterLogout">
87+
<argument name="categoryUrl" value="$createCategory.custom_attributes[url_key]$"/>
88+
<argument name="productName" value="$createProduct.name$"/>
89+
</actionGroup>
90+
91+
<!--Click the *Not you?* link and check the price for Simple Product-->
92+
<click selector="{{StorefrontPanelHeaderSection.notYouLink}}" stepKey="clickNotYouLink"/>
93+
<actionGroup ref="AssertStorefrontDefaultWelcomeMessageActionGroup" stepKey="seeWelcomeMessageForJohnDoeCustomerAfterLogout"/>
94+
<actionGroup ref="AssertStorefrontProductPriceInCategoryPageActionGroup" stepKey="assertProductPriceInCategoryPageAfterLogout">
95+
<argument name="categoryUrl" value="$createCategory.custom_attributes[url_key]$"/>
96+
<argument name="productName" value="$createProduct.name$"/>
97+
</actionGroup>
98+
<dontSeeElement selector="{{StorefrontCategoryProductSection.ProductCatalogRuleSpecialPriceTitleByName($createProduct.name$)}}" stepKey="dontSeeSpecialPrice"/>
99+
</test>
100+
</tests>
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
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="AssertStorefrontDefaultWelcomeMessageActionGroup">
12+
<annotations>
13+
<description>Validates that the Welcome message is present and correct and not you link absent.</description>
14+
</annotations>
15+
16+
<waitForElementVisible selector="{{StorefrontPanelHeaderSection.WelcomeMessage}}" stepKey="waitDefaultMessage"/>
17+
<see userInput="Default welcome msg!" selector="{{StorefrontPanelHeaderSection.WelcomeMessage}}" stepKey="verifyDefaultMessage"/>
18+
<dontSeeElement selector="{{StorefrontPanelHeaderSection.notYouLink}}" stepKey="checkAbsenceLinkNotYou"/>
19+
</actionGroup>
20+
</actionGroups>

0 commit comments

Comments
 (0)