Skip to content

Commit 2ca8121

Browse files
committed
MC-33747: [MFTF] Flaky StorefrontButtonsInlineTranslationTest
1 parent 84491b3 commit 2ca8121

File tree

2 files changed

+70
-4
lines changed

2 files changed

+70
-4
lines changed
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
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="StorefrontButtonsInlineTranslationOnProductPageTest">
12+
<annotations>
13+
<features value="Translation"/>
14+
<stories value="Inline Translation"/>
15+
<title value="Buttons inline translation on product page"/>
16+
<description value="A merchant should be able to translate buttons by an inline translation tool"/>
17+
<severity value="CRITICAL"/>
18+
<testCaseId value="MC-27118"/>
19+
<useCaseId value="MC-24186"/>
20+
<group value="translation"/>
21+
<group value="catalog"/>
22+
<group value="developer_mode_only"/>
23+
</annotations>
24+
<before>
25+
<!-- Enable Translate Inline For Storefront -->
26+
<magentoCLI command="config:set {{EnableTranslateInlineForStorefront.path}} {{EnableTranslateInlineForStorefront.value}}" stepKey="enableTranslateInlineForStorefront"/>
27+
<!-- Create Category -->
28+
<createData entity="ApiCategory" stepKey="createCategory"/>
29+
<!-- Create Simple Product -->
30+
<createData entity="ApiSimpleProduct" stepKey="createProduct">
31+
<requiredEntity createDataKey="createCategory"/>
32+
</createData>
33+
</before>
34+
<after>
35+
<!-- Disable Translate Inline For Storefront -->
36+
<magentoCLI command="config:set {{DisableTranslateInlineForStorefront.path}} {{DisableTranslateInlineForStorefront.value}}" stepKey="disableTranslateInlineForStorefront"/>
37+
<!-- Delete Simple Product -->
38+
<deleteData createDataKey="createProduct" stepKey="deleteProduct"/>
39+
<!-- Delete Category -->
40+
<deleteData createDataKey="createCategory" stepKey="deleteCategory"/>
41+
</after>
42+
43+
<!-- Add product to cart on storefront -->
44+
<amOnPage url="{{StorefrontProductPage.url($createProduct.custom_attributes[url_key]$)}}" stepKey="goToProductPage"/>
45+
<waitForPageLoad stepKey="waitForProductPageLoad"/>
46+
<waitForElementVisible selector="{{StorefrontProductActionSection.addToCartEnabledWithTranslation}}" stepKey="waitForAddToCartButtonEnabled"/>
47+
<actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addProductToCart">
48+
<argument name="productName" value="$createProduct.name$"/>
49+
</actionGroup>
50+
51+
<!-- Open Mini Cart -->
52+
<actionGroup ref="StorefrontOpenMiniCartActionGroup" stepKey="openMiniCart"/>
53+
54+
<!-- Check button "Proceed to Checkout". There must be red borders and "book" icons on labels that can be translated. -->
55+
<actionGroup ref="AssertElementInTranslateInlineModeActionGroup" stepKey="assertRedBordersAndBookIcon">
56+
<argument name="elementSelector" value="{{StorefrontMinicartSection.goToCheckout}}"/>
57+
</actionGroup>
58+
59+
<!-- Open Inline Translation popup -->
60+
<actionGroup ref="StorefrontOpenInlineTranslationPopupActionGroup" stepKey="openInlineTranslationPopup">
61+
<argument name="elementSelector" value="{{StorefrontMinicartSection.goToCheckout}}"/>
62+
</actionGroup>
63+
</test>
64+
</tests>

app/code/Magento/Translation/Test/Mftf/Test/StorefrontButtonsInlineTranslationTest.xml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@
2020
<group value="translation"/>
2121
<group value="catalog"/>
2222
<group value="developer_mode_only"/>
23+
<skip>
24+
<issueId value="DEPRECATED">Use StorefrontButtonsInlineTranslationOnProductPageTest instead</issueId>
25+
</skip>
2326
</annotations>
2427
<before>
2528
<!-- Enable Translate Inline For Storefront -->
@@ -41,10 +44,9 @@
4144
</after>
4245

4346
<!-- Add product to cart on storefront -->
44-
<amOnPage url="{{StorefrontProductPage.url($createProduct.custom_attributes[url_key]$)}}" stepKey="goToProductPage"/>
45-
<waitForPageLoad stepKey="waitForProductPageLoad"/>
46-
<waitForElementVisible selector="{{StorefrontProductActionSection.addToCartEnabledWithTranslation}}" stepKey="waitForAddToCartButtonEnabled"/>
47-
<actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addProductToCart">
47+
<amOnPage url="{{StorefrontCategoryPage.url($createCategory.custom_attributes[url_key]$)}}" stepKey="goToCategoryPage"/>
48+
<waitForPageLoad stepKey="waitForCategoryPageLoad"/>
49+
<actionGroup ref="StorefrontAddProductToCartFromCategoryActionGroup" stepKey="addProductToCart">
4850
<argument name="productName" value="$createProduct.name$"/>
4951
</actionGroup>
5052

0 commit comments

Comments
 (0)