Skip to content

Commit 8a5efae

Browse files
authored
Merge pull request #5620 from magento-tsg/2.3-develop-pr129
[TSG] TESTs Fixes for 2.3 (pr129) (2.3-develop)
2 parents d1ea23a + e108aad commit 8a5efae

6 files changed

+139
-7
lines changed

app/code/Magento/Translation/Test/Mftf/ActionGroup/AdminTranslateElementActionGroup.xml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,15 @@
88

99
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
1010
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11-
<actionGroup name="AdminTranslateElementActionGroup">
11+
<actionGroup name="AdminTranslateElementActionGroup" deprecated="Avoid using super-ActionGroups. Use StorefrontOpenInlineTranslationPopupActionGroup, StorefrontFillCustomTranslationFieldActionGroup and StorefrontSubmitInlineTranslationFormActionGroup">
12+
<annotations>
13+
<description>DEPRECATED. Avoid using super-ActionGroups. Use StorefrontOpenInlineTranslationPopupActionGroup, StorefrontFillCustomTranslationFieldActionGroup and StorefrontSubmitInlineTranslationFormActionGroup.</description>
14+
</annotations>
1215
<arguments>
1316
<argument name="elementSelector" type="string"/>
1417
<argument name="translateText" type="string"/>
1518
</arguments>
16-
19+
1720
<executeJS function="jQuery('{{elementSelector}}').mousemove()" stepKey="moveMouseOverSelector"/>
1821
<executeJS function="jQuery('{{InlineTranslationModeSection.bookIcon}}').click()" stepKey="clickBookIcon"/>
1922
<waitForPageLoad stepKey="waitForLoadWindow"/>
@@ -23,4 +26,4 @@
2326
<fillField userInput="{{translateText}}" selector="{{InlineTranslationModeSection.inputCustomTranslate}}" stepKey="addTranslate"/>
2427
<click selector="{{InlineTranslationModeSection.buttonSubmit}}" stepKey="clickSubmitButton"/>
2528
</actionGroup>
26-
</actionGroups>
29+
</actionGroups>
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="StorefrontFillCustomTranslationFieldActionGroup">
12+
<annotations>
13+
<description>Fill the field in the Inline Translation form by provided text on Storefront.</description>
14+
</annotations>
15+
<arguments>
16+
<argument name="translateText" type="string" defaultValue="Translated"/>
17+
</arguments>
18+
19+
<clearField selector="{{InlineTranslationModeSection.inputCustomTranslate}}" stepKey="clearCustomTranslateField"/>
20+
<fillField selector="{{InlineTranslationModeSection.inputCustomTranslate}}" userInput="{{translateText}}" stepKey="fillCustomTranslateField"/>
21+
</actionGroup>
22+
</actionGroups>
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
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="StorefrontOpenInlineTranslationPopupActionGroup">
12+
<annotations>
13+
<description>Open the Inline Translation popup for provided element on Storefront.</description>
14+
</annotations>
15+
<arguments>
16+
<argument name="elementSelector" type="string" defaultValue="{{StorefrontHeaderSection.welcomeMessage}}"/>
17+
</arguments>
18+
19+
<executeJS function="jQuery('{{elementSelector}}').mousemove()" stepKey="moveMouseOverSelector"/>
20+
<executeJS function="jQuery('{{InlineTranslationModeSection.bookIcon}}').click()" stepKey="clickBookIcon"/>
21+
<waitForElementVisible selector="{{InlineTranslationModeSection.popUpTranslate}}" stepKey="waitForTranslationPopupAppear"/>
22+
<seeElement selector="{{InlineTranslationModeSection.popUpTranslate}}" stepKey="seeTranslateForm"/>
23+
</actionGroup>
24+
</actionGroups>
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="StorefrontSubmitInlineTranslationFormActionGroup">
12+
<annotations>
13+
<description>Click on the Inline Translation form submit button on Storefront.</description>
14+
</annotations>
15+
16+
<click selector="{{InlineTranslationModeSection.buttonSubmit}}" stepKey="clickSubmitButton"/>
17+
<waitForElementNotVisible selector="{{InlineTranslationModeSection.popUpTranslate}}" stepKey="waitForTranslationPopupDisappear"/>
18+
<dontSeeElement selector="{{InlineTranslationModeSection.popUpTranslate}}" stepKey="dontSeeTranslateForm"/>
19+
</actionGroup>
20+
</actionGroups>
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
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="StorefrontButtonsInlineTranslation2Test">
12+
<annotations>
13+
<features value="Translation"/>
14+
<stories value="Inline Translation"/>
15+
<title value="Buttons inline translation"/>
16+
<description value="A merchant should be able to translate buttons by an inline translation tool"/>
17+
<severity value="CRITICAL"/>
18+
<testCaseId value="MC-12735"/>
19+
<useCaseId value="MC-20127"/>
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="{{StorefrontCategoryPage.url($createCategory.custom_attributes[url_key]$)}}" stepKey="goToCategoryPage"/>
45+
<waitForPageLoad stepKey="waitForCategoryPageLoad"/>
46+
<actionGroup ref="StorefrontAddProductToCartFromCategoryActionGroup" stepKey="addProductToCart">
47+
<argument name="productName" value="$createProduct.name$"/>
48+
</actionGroup>
49+
50+
<!-- Open Mini Cart -->
51+
<actionGroup ref="StorefrontOpenMiniCartActionGroup" stepKey="openMiniCart"/>
52+
53+
<!-- Check button "Proceed to Checkout". There must be red borders and "book" icons on labels that can be translated. -->
54+
<actionGroup ref="AssertElementInTranslateInlineModeActionGroup" stepKey="assertRedBordersAndBookIcon">
55+
<argument name="elementSelector" value="{{StorefrontMinicartSection.goToCheckout}}"/>
56+
</actionGroup>
57+
58+
<!-- Open Inline Translation popup -->
59+
<actionGroup ref="StorefrontOpenInlineTranslationPopupActionGroup" stepKey="openInlineTranslationPopup">
60+
<argument name="elementSelector" value="{{StorefrontMinicartSection.goToCheckout}}"/>
61+
</actionGroup>
62+
</test>
63+
</tests>

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,17 @@
88

99
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
1010
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
11-
<test name="StorefrontButtonsInlineTranslationTest">
11+
<test name="StorefrontButtonsInlineTranslationTest" deprecated="Use StorefrontButtonsInlineTranslation2Test instead.">
1212
<annotations>
1313
<features value="Translation"/>
1414
<stories value="Inline Translation"/>
15-
<title value="[Inline Translation] Buttons inline translation"/>
16-
<description value="[Inline Translation] Buttons inline translation"/>
15+
<title value="DEPRECATED [Inline Translation] Buttons inline translation"/>
16+
<description value="DEPRECATED [Inline Translation] Buttons inline translation"/>
1717
<severity value="CRITICAL"/>
1818
<testCaseId value="MC-12735"/>
1919
<group value="translation"/>
2020
<skip>
21-
<issueId value="MC-20127"/>
21+
<issueId value="DEPRECATED">Use StorefrontButtonsInlineTranslation2Test instead.</issueId>
2222
</skip>
2323
</annotations>
2424
<before>

0 commit comments

Comments
 (0)