Skip to content

Commit 8a2288e

Browse files
committed
Merge remote-tracking branch 'origin/MC-24236' into 2.4-develop-pr11
2 parents 9fac520 + 343ea61 commit 8a2288e

6 files changed

+125
-42
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/Catalog/Test/Mftf/Section/StorefrontCategoryProductSection.xml

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

2222
<element name="ProductTitleByName" type="button" selector="//main//li//a[contains(text(), '{{var1}}')]" parameterized="true"/>
2323
<element name="ProductPriceByName" type="text" selector="//main//li[.//a[contains(text(), '{{var1}}')]]//span[@class='price']" parameterized="true"/>
24-
<element name="ProductCatalogRuleSpecialPriceTitleByName" type="text" selector="//div[descendant::*[contains(text(), '{{var1}}')]]//*[contains(@class, 'special-price')]" parameterized="true"/>
24+
<element name="ProductCatalogRuleSpecialPriceTitleByName" type="text" selector="//div[contains(@class, 'product-item-info')][.//a[contains(text(), '{{productName}}')]]//span[@class='special-price']/span" parameterized="true"/>
2525
<element name="ProductCatalogRulePriceTitleByName" type="text" selector="//div[descendant::*[contains(text(), '{{var1}}')]]//*[contains(@class, 'price-label')]" parameterized="true"/>
2626
<element name="ProductImageByName" type="text" selector="//main//li[.//a[contains(text(), '{{var1}}')]]//img[@class='product-image-photo']" parameterized="true"/>
2727
<element name="ProductImageBySrc" type="text" selector=".products-grid img[src*='{{pattern}}']" parameterized="true"/>

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

Lines changed: 56 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -15,71 +15,88 @@
1515
<title value="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"/>
18-
<testCaseId value="MAGETWO-69455"/>
18+
<testCaseId value="MC-27571"/>
1919
<group value="persistent"/>
2020
</annotations>
2121
<before>
22-
<createData entity="PersistentConfigEnabled" stepKey="enablePersistent"/>
23-
<createData entity="PersistentLogoutClearDisable" stepKey="persistentLogoutClearDisable"/>
22+
23+
<createData entity="PersistentConfigSettings" stepKey="enablePersistent"/>
2424
<createData entity="_defaultCategory" stepKey="createCategory"/>
25-
<createData entity="_defaultProduct" stepKey="createProduct">
25+
<createData entity="productWithHTMLEntityOne" stepKey="createProduct">
2626
<requiredEntity createDataKey="createCategory"/>
27-
<field key="price">50</field>
28-
</createData>
29-
<createData entity="Simple_US_Customer" stepKey="createCustomer">
30-
<field key="group_id">1</field>
3127
</createData>
28+
<createData entity="Simple_US_Customer" stepKey="createCustomer"/>
29+
30+
<!--Delete all Catalog Price Rule if exist-->
31+
<actionGroup ref="LoginAsAdmin" stepKey="loginToAdminPanel"/>
32+
<actionGroup ref="AdminCatalogPriceRuleDeleteAllActionGroup" stepKey="deleteAllCatalogPriceRule"/>
33+
3234

33-
<actionGroup ref="LoginAsAdmin" stepKey="login"/>
3435
<!--Create Catalog Rule-->
35-
<actionGroup ref="NewCatalogPriceRuleByUIWithConditionIsCategoryActionGroup" stepKey="createCatalogPriceRule">
36-
<argument name="catalogRule" value="_defaultCatalogRule"/>
37-
<argument name="categoryId" value="$$createCategory.id$$"/>
36+
<actionGroup ref="AdminOpenNewCatalogPriceRuleFormPageActionGroup" stepKey="startCreatingFirstPriceRule"/>
37+
<actionGroup ref="AdminCatalogPriceRuleFillMainInfoActionGroup" stepKey="fillMainInfoForFirstPriceRule">
38+
<argument name="groups" value="'General'"/>
39+
</actionGroup>
40+
<actionGroup ref="AdminFillCatalogRuleConditionActionGroup" stepKey="createCatalogPriceRule">
41+
<argument name="conditionValue" value="$createCategory.id$"/>
3842
</actionGroup>
39-
<actionGroup ref="SelectGeneralCustomerGroupActionGroup" stepKey="selectCustomerGroup"/>
40-
<click selector="{{AdminNewCatalogPriceRule.saveAndApply}}" stepKey="clickSaveAndApplyRules"/>
41-
<see selector="{{AdminCategoryMessagesSection.SuccessMessage}}" userInput="You saved the rule." stepKey="assertSuccess"/>
42-
<magentoCLI command="indexer:reindex" stepKey="reindex"/>
43-
<magentoCLI command="cache:flush" stepKey="flushCache"/>
43+
<actionGroup ref="AdminCatalogPriceRuleFillActionsActionGroup" stepKey="fillActionsForThirdPriceRule"/>
44+
<actionGroup ref="AdminCatalogPriceRuleSaveAndApplyActionGroup" stepKey="clickSaveAndApplyRule"/>
45+
46+
<!-- Perform reindex -->
47+
<magentoCLI command="indexer:reindex" arguments="catalogrule_rule" stepKey="reindex"/>
4448
</before>
4549
<after>
46-
<!-- Delete the rule -->
47-
<amOnPage url="{{CatalogRulePage.url}}" stepKey="goToCatalogPriceRulePage"/>
48-
<actionGroup ref="deleteEntitySecondaryGrid" stepKey="deletePriceRule">
49-
<argument name="name" value="{{_defaultCatalogRule.name}}"/>
50-
<argument name="searchInput" value="{{AdminSecondaryGridSection.catalogRuleIdentifierSearch}}"/>
51-
</actionGroup>
52-
<actionGroup ref="logout" stepKey="logout"/>
5350
<createData entity="PersistentConfigDefault" stepKey="setDefaultPersistentState"/>
5451
<createData entity="PersistentLogoutClearEnabled" stepKey="persistentLogoutClearEnabled"/>
5552
<deleteData createDataKey="createCategory" stepKey="deleteCategory"/>
5653
<deleteData createDataKey="createProduct" stepKey="deleteProduct"/>
5754
<deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/>
55+
<!-- Delete the rule -->
56+
<actionGroup ref="AdminCatalogPriceRuleDeleteAllActionGroup" stepKey="deleteAllCatalogPriceRule"/>
57+
<actionGroup ref="logout" stepKey="logout"/>
5858
</after>
5959

6060
<!--Go to category and check price-->
61-
<amOnPage url="{{StorefrontCategoryPage.url($$createCategory.name$$)}}" stepKey="onStorefrontCategoryPage"/>
62-
<see selector="{{StorefrontCategoryProductSection.ProductPriceByNumber('1')}}" userInput="$$createProduct.price$$" stepKey="checkPriceSimpleProduct"/>
61+
<actionGroup ref="AssertStorefrontProductPriceInCategoryPageActionGroup" stepKey="assertProductPriceInCategoryPage">
62+
<argument name="categoryUrl" value="$createCategory.custom_attributes[url_key]$"/>
63+
<argument name="productName" value="$createProduct.name$"/>
64+
</actionGroup>
6365

6466
<!--Login to storefront from customer and check price-->
6567
<actionGroup ref="LoginToStorefrontActionGroup" stepKey="logInFromCustomer">
66-
<argument name="Customer" value="$$createCustomer$$"/>
68+
<argument name="Customer" value="$createCustomer$"/>
69+
</actionGroup>
70+
<actionGroup ref="AssertCustomerWelcomeMessageActionGroup" stepKey="seeWelcomeMessageForJohnDoeCustomer">
71+
<argument name="customerFullName" value="{{Simple_Customer_Without_Address.fullname}}"/>
72+
</actionGroup>
73+
74+
<!--Go to category and check special price-->
75+
<actionGroup ref="AssertStorefrontProductSpecialPriceInCategoryPageActionGroup" stepKey="assertProductSpecialPriceInCategoryPage">
76+
<argument name="categoryUrl" value="$createCategory.custom_attributes[url_key]$"/>
77+
<argument name="productName" value="$createProduct.name$"/>
6778
</actionGroup>
68-
<amOnPage url="{{StorefrontCategoryPage.url($$createCategory.name$$)}}" stepKey="onStorefrontCategoryPage2"/>
69-
<see userInput="Welcome, $$createCustomer.firstname$$ $$createCustomer.lastname$$!" selector="{{StorefrontPanelHeaderSection.WelcomeMessage}}" stepKey="homeCheckWelcome"/>
70-
<see selector="{{StorefrontCategoryProductSection.ProductSpecialPriceByNumber('1')}}" userInput="45.00" stepKey="checkPriceSimpleProduct2"/>
7179

72-
<!--Click *Sign Out* and check the price of the Simple Product-->
80+
81+
<!--Click *Sign Out*-->
7382
<actionGroup ref="StorefrontSignOutActionGroup" stepKey="storefrontSignOut"/>
74-
<amOnPage url="{{StorefrontCategoryPage.url($$createCategory.name$$)}}" stepKey="onStorefrontCategoryPage3"/>
75-
<see userInput="Welcome, $$createCustomer.firstname$$ $$createCustomer.lastname$$!" selector="{{StorefrontPanelHeaderSection.WelcomeMessage}}" stepKey="homeCheckWelcome2"/>
76-
<seeElement selector="{{StorefrontPanelHeaderSection.notYouLink}}" stepKey="checkLinkNotYoy"/>
77-
<see selector="{{StorefrontCategoryProductSection.ProductSpecialPriceByNumber('1')}}" userInput="45.00" stepKey="checkPriceSimpleProduct3"/>
83+
<actionGroup ref="StorefrontAssertPersistentCustomerWelcomeMessageActionGroup" stepKey="seeWelcomeForJohnDoeCustomer">
84+
<argument name="customerFullName" value="{{Simple_Customer_Without_Address.fullname}}"/>
85+
</actionGroup>
86+
87+
<!--Go to category and check special price-->
88+
<actionGroup ref="AssertStorefrontProductSpecialPriceInCategoryPageActionGroup" stepKey="assertProductSpecialPriceInCategoryPageAfterLogout">
89+
<argument name="categoryUrl" value="$createCategory.custom_attributes[url_key]$"/>
90+
<argument name="productName" value="$createProduct.name$"/>
91+
</actionGroup>
7892

7993
<!--Click the *Not you?* link and check the price for Simple Product-->
80-
<click selector="{{StorefrontPanelHeaderSection.notYouLink}}" stepKey="clickNext"/>
81-
<amOnPage url="{{StorefrontCategoryPage.url($$createCategory.name$$)}}" stepKey="onStorefrontCategoryPage4"/>
82-
<see userInput="Default welcome msg!" selector="{{StorefrontPanelHeaderSection.WelcomeMessage}}" stepKey="homeCheckWelcome3"/>
83-
<see selector="{{StorefrontCategoryProductSection.ProductPriceByNumber('1')}}" userInput="$$createProduct.price$$" stepKey="checkPriceSimpleProduct4"/>
94+
<click selector="{{StorefrontPanelHeaderSection.notYouLink}}" stepKey="clickNotYouLink"/>
95+
<actionGroup ref="AssertStorefrontDefaultWelcomeMessageActionGroup" stepKey="seeWelcomeMessageForJohnDoeCustomerAfterLogout"/>
96+
<actionGroup ref="AssertStorefrontProductPriceInCategoryPageActionGroup" stepKey="assertProductPriceInCategoryPageAfterLogout">
97+
<argument name="categoryUrl" value="$createCategory.custom_attributes[url_key]$"/>
98+
<argument name="productName" value="$createProduct.name$"/>
99+
</actionGroup>
100+
<dontSeeElement selector="{{StorefrontCategoryProductSection.ProductCatalogRuleSpecialPriceTitleByName($createProduct.name$)}}" stepKey="dontSeeSpecialPrice"/>
84101
</test>
85102
</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>

app/code/Magento/Customer/Test/Mftf/ActionGroup/StorefrontCustomerLogoutActionGroup.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424

2525
<click selector="{{StoreFrontSignOutSection.customerAccount}}" stepKey="clickCustomerButton"/>
2626
<click selector="{{StoreFrontSignOutSection.signOut}}" stepKey="clickToSignOut"/>
27-
<waitForPageLoad stepKey="waitForPageLoad"/>
28-
<see userInput="You are signed out" stepKey="signOut"/>
27+
<waitForText selector="{{StorefrontCMSPageSection.mainTitle}}" userInput="You are signed out" stepKey="signOut"/>
28+
<waitForText selector="{{StorefrontCMSPageSection.mainTitle}}" userInput="Home Page" stepKey="waitForHomePageLoad"/>
2929
</actionGroup>
3030
</actionGroups>

0 commit comments

Comments
 (0)