Skip to content

Commit fbc560f

Browse files
committed
MC-23989: Mini cart missing when you edit inline welcome message for guest and use special characters
1 parent 1588bed commit fbc560f

File tree

4 files changed

+138
-0
lines changed

4 files changed

+138
-0
lines changed
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
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="AssertStorefrontCustomWelcomeMessageActionGroup">
12+
<annotations>
13+
<description>Validates that the custom Welcome message is present on storefront header.</description>
14+
</annotations>
15+
<arguments>
16+
<argument name="customMessage" type="string" defaultValue="Welcome to &quot;Food &amp; Drinks&quot; store"/>
17+
</arguments>
18+
19+
<waitForElementVisible selector="{{StorefrontPanelHeaderSection.welcomeMessage}}" stepKey="waitForWelcomeMessage"/>
20+
<see userInput="{{customMessage}}" selector="{{StorefrontPanelHeaderSection.welcomeMessage}}" stepKey="verifyCustomMessage"/>
21+
</actionGroup>
22+
</actionGroups>

app/code/Magento/Translation/Test/Mftf/Data/TranslationData.xml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,4 +171,11 @@
171171
<data key="original">Shipping Method:</data>
172172
<data key="custom">Shipping Method:</data>
173173
</entity>
174+
<entity name="RevertWelcomeMessageTranslate" extends="CustomTranslationData">
175+
<requiredEntity type="translation_operation_translate">RevertWelcomeMessageTranslateData</requiredEntity>
176+
</entity>
177+
<entity name="RevertWelcomeMessageTranslateData" type="translation_operation_translate">
178+
<data key="original">Default welcome msg!</data>
179+
<data key="custom">Default welcome msg!</data>
180+
</entity>
174181
</entities>
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
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+
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
11+
<section name="StorefrontPanelHeaderTranslationSection">
12+
<element name="welcomeMessage" type="text" selector="header>.panel .greet.welcome span" />
13+
</section>
14+
</sections>
Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
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="StorefrontInlineTranslationWithQuoteSymbolsTest">
12+
<annotations>
13+
<features value="Translation"/>
14+
<stories value="Inline Translation"/>
15+
<title value="Inline translation with quote symbols"/>
16+
<description value="As merchant I want to be able to rename text labels using quote symbols in it"/>
17+
<severity value="CRITICAL"/>
18+
<testCaseId value="MC-"/>
19+
<useCaseId value="MC-23989"/>
20+
<group value="translation"/>
21+
<group value="developer_mode_only"/>
22+
</annotations>
23+
24+
<before>
25+
<createData entity="Simple_US_Customer_Multiple_Addresses" stepKey="createCustomer"/>
26+
<magentoCLI command="config:set {{EnableTranslateInlineForStorefront.path}} {{EnableTranslateInlineForStorefront.value}}" stepKey="enableTranslateInlineStorefront"/>
27+
<createData entity="RevertWelcomeMessageTranslate" stepKey="revertWelcomeMessageTranslation">
28+
<requiredEntity createDataKey="createCustomer"/>
29+
</createData>
30+
<createData entity="SimpleProduct2" stepKey="createProduct"/>
31+
<createData entity="SimpleProduct2" stepKey="createProductSecond"/>
32+
<actionGroup ref="CliCacheCleanActionGroup" stepKey="cleanCacheAfterTranslateEnabled">
33+
<argument name="tags" value=""/>
34+
</actionGroup>
35+
</before>
36+
37+
<after>
38+
<magentoCLI command="config:set {{EnableTranslateInlineForStorefront.path}} {{EnableTranslateInlineForStorefront.value}}" stepKey="enableTranslateInlineStorefront"/>
39+
<createData entity="RevertWelcomeMessageTranslate" stepKey="revertWelcomeMessageTranslation">
40+
<requiredEntity createDataKey="createCustomer"/>
41+
</createData>
42+
<magentoCLI command="config:set {{DisableTranslateInlineForStorefront.path}} {{DisableTranslateInlineForStorefront.value}}" stepKey="disableTranslateInlineForStorefront"/>
43+
<deleteData createDataKey="createProduct" stepKey="deleteProduct"/>
44+
<deleteData createDataKey="createProductSecond" stepKey="deleteProductSecond"/>
45+
<deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/>
46+
<actionGroup ref="CliCacheCleanActionGroup" stepKey="cleanCacheAfterTranslateDisabled">
47+
<argument name="tags" value=""/>
48+
</actionGroup>
49+
</after>
50+
51+
<actionGroup ref="StorefrontOpenProductPageActionGroup" stepKey="openProductPage">
52+
<argument name="productUrl" value="$createProduct.custom_attributes[url_key]$"/>
53+
</actionGroup>
54+
<actionGroup ref="AssertStorefrontDefaultWelcomeMessageActionGroup" stepKey="assertDefaultWelcomeMessage"/>
55+
<actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addProductToCart">
56+
<argument name="productName" value="$createProduct.name$"/>
57+
</actionGroup>
58+
<actionGroup ref="AssertOneProductNameInMiniCartActionGroup" stepKey="seeProductInMiniCart">
59+
<argument name="productName" value="$createProduct.name$"/>
60+
</actionGroup>
61+
62+
<actionGroup ref="AssertElementInTranslateInlineModeActionGroup" stepKey="assertWelcomeMessageInInlineTranslateMode">
63+
<argument name="elementSelector" value="{{StorefrontPanelHeaderTranslationSection.welcomeMessage}}"/>
64+
</actionGroup>
65+
<actionGroup ref="StorefrontOpenInlineTranslationPopupActionGroup" stepKey="openWelcomeMessageInlineTranslatePopup">
66+
<argument name="elementSelector" value="{{StorefrontPanelHeaderTranslationSection.welcomeMessage}}"/>
67+
</actionGroup>
68+
<actionGroup ref="StorefrontFillCustomTranslationFieldActionGroup" stepKey="fillInlineTranslateNewValue">
69+
<argument name="translateText" value="Welcome to &quot;Food &amp; Drinks&quot; store"/>
70+
</actionGroup>
71+
<actionGroup ref="StorefrontSubmitInlineTranslationFormActionGroup" stepKey="saveInlineTranslateNewValue"/>
72+
73+
<magentoCLI command="config:set {{DisableTranslateInlineForStorefront.path}} {{DisableTranslateInlineForStorefront.value}}" stepKey="disableTranslateInlineForStorefront"/>
74+
<actionGroup ref="CliCacheCleanActionGroup" stepKey="cleanCacheAfterTranslateDisabled">
75+
<argument name="tags" value=""/>
76+
</actionGroup>
77+
78+
<actionGroup ref="ReloadPageActionGroup" stepKey="reloadPage"/>
79+
<actionGroup ref="AssertStorefrontCustomWelcomeMessageActionGroup" stepKey="verifyTranslatedWelcomeMessage"/>
80+
<actionGroup ref="AssertOneProductNameInMiniCartActionGroup" stepKey="seeProductInMiniCartAgain">
81+
<argument name="productName" value="$createProduct.name$"/>
82+
</actionGroup>
83+
84+
<actionGroup ref="StorefrontOpenProductPageActionGroup" stepKey="openSecondProductPage">
85+
<argument name="productUrl" value="$createProductSecond.custom_attributes[url_key]$"/>
86+
</actionGroup>
87+
<actionGroup ref="AssertStorefrontCustomWelcomeMessageActionGroup" stepKey="verifyTranslatedWelcomeMessageForSecondProduct"/>
88+
<actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addSecondProductToCart">
89+
<argument name="productName" value="$createProductSecond.name$"/>
90+
</actionGroup>
91+
<actionGroup ref="AssertOneProductNameInMiniCartActionGroup" stepKey="seeSecondProductInMiniCart">
92+
<argument name="productName" value="$createProductSecond.name$"/>
93+
</actionGroup>
94+
</test>
95+
</tests>

0 commit comments

Comments
 (0)