Skip to content

Commit a70e814

Browse files
committed
MAGETWO-95819: Customer registration fields not translated
- Add automated test
1 parent 44770fe commit a70e814

File tree

7 files changed

+70
-15
lines changed

7 files changed

+70
-15
lines changed

app/code/Magento/Cms/Test/Mftf/Section/StorefrontHeaderSection.xml

Lines changed: 0 additions & 13 deletions
This file was deleted.

app/code/Magento/Customer/Test/Mftf/Section/StorefrontCustomerCreateFormSection.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
<section name="StorefrontCustomerCreateFormSection">
1212
<element name="firstnameField" type="input" selector="#firstname"/>
1313
<element name="lastnameField" type="input" selector="#lastname"/>
14+
<element name="lastnameLabel" type="text" selector="//label[@for='lastname']"/>
1415
<element name="emailField" type="input" selector="#email_address"/>
1516
<element name="passwordField" type="input" selector="#password"/>
1617
<element name="confirmPasswordField" type="input" selector="#password-confirmation"/>
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
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" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
10+
<test name="StoreFrontSwitchStoreViewTest">
11+
<annotations>
12+
<title value="Managing labels for customer attribute while creation new account"/>
13+
<description value="Managing labels for customer attribute while creation new account"/>
14+
<features value="Module/ Eav"/>
15+
<severity value="MAJOR"/>
16+
<testCaseId value="MAGETWO-95997"/>
17+
<stories value="Guest should be able to switch store view"/>
18+
<group value="eav"/>
19+
</annotations>
20+
<before>
21+
<actionGroup ref="LoginAsAdmin" stepKey="loginToAdmin"/>
22+
<actionGroup ref="AdminCreateStoreViewActionGroup" stepKey="createSwedishStoreView">
23+
<argument name="customStore" value="swedishStoreGroup"/>
24+
</actionGroup>
25+
<actionGroup ref="AdminCreateStoreViewActionGroup" stepKey="createFinnishStoreView">
26+
<argument name="customStore" value="finnishStoreGroup"/>
27+
</actionGroup>
28+
</before>
29+
<after>
30+
<actionGroup ref="AdminDeleteStoreViewActionGroup" stepKey="deleteSwedishStoreView">
31+
<argument name="customStore" value="swedishStoreGroup"/>
32+
</actionGroup>
33+
<actionGroup ref="AdminDeleteStoreViewActionGroup" stepKey="deleteFinnishStoreView">
34+
<argument name="customStore" value="finnishStoreGroup"/>
35+
</actionGroup>
36+
<actionGroup ref="logout" stepKey="logout"/>
37+
</after>
38+
<amOnPage url="{{CustomerAttributesLastNamePage.url}}" stepKey="amOnPageCustomerAttributePage"/>
39+
<see stepKey="seeLastNamePage" userInput="Last Name"/>
40+
<click stepKey="clickOnManageLabelTab" selector="{{AdminCustomerAttributeSection.manageLabel}}"/>
41+
<fillField stepKey="fillSwedishLastName" selector="{{AdminCustomerLastNameAttributeSection.secondLastNameInput}}" userInput="{{AttributeLastName.swedish}}"/>
42+
<fillField stepKey="fillFinnishLastName" selector="{{AdminCustomerLastNameAttributeSection.thirdLastNameInput}}" userInput="{{AttributeLastName.finnish}}"/>
43+
<click stepKey="save" selector="{{CustomerAccountSection.save}}"/>
44+
<magentoCLI command="cache:flush" stepKey="flushCache"/>
45+
<amOnPage url="{{StorefrontCustomerCreatePage.url}}" stepKey="goToStoreFront"/>
46+
<waitForPageLoad stepKey="waitForAccountCreationPage"/>
47+
<reloadPage stepKey="refreshPage"/>
48+
<actionGroup ref="StorefrontSwitchStoreViewActionGroup" stepKey="switchStoreView">
49+
<argument name="storeView" value="swedishStoreGroup"/>
50+
</actionGroup>
51+
<see stepKey="seeLastNameInSwedish" selector="{{StorefrontCustomerCreateFormSection.lastnameLabel}}" userInput="{{AttributeLastName.swedish}}"/>
52+
</test>
53+
</tests>

app/code/Magento/Store/Test/Mftf/ActionGroup/AdminDeleteStoreViewActionGroup.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
<click selector="{{AdminNewStoreViewActionsSection.delete}}" stepKey="clickDeleteStoreViewAgain"/>
2424
<waitForElementVisible selector="{{AdminConfirmationModalSection.title}}" stepKey="waitingForWarningModal"/>
2525
<click selector="{{AdminConfirmationModalSection.ok}}" stepKey="confirmStoreDelete"/>
26-
<wait time="10" stepKey="extraWait"/>
26+
<waitForPageLoad stepKey="waitForSuccessMessage"/>
2727
<see userInput="You deleted the store view." stepKey="seeDeleteMessage"/>
2828
</actionGroup>
2929
</actionGroups>

app/code/Magento/Store/Test/Mftf/ActionGroup/StorefrontSwitchStoreViewActionGroup.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
</arguments>
1515
<click selector="{{StorefrontHeaderSection.storeViewSwitcher}}" stepKey="clickStoreViewSwitcher"/>
1616
<waitForElementVisible selector="{{StorefrontHeaderSection.storeViewDropdown}}" stepKey="waitForStoreViewDropdown"/>
17-
<click selector="{{StorefrontHeaderSection.storeViewOption(storeView.name)}}" stepKey="clickSelectStoreView"/>
17+
<click selector="{{StorefrontHeaderSection.storeView(storeView.name)}}" stepKey="clickSelectStoreView"/>
1818
<waitForPageLoad stepKey="waitForPageLoad"/>
1919
</actionGroup>
2020
</actionGroups>

app/code/Magento/Store/Test/Mftf/Data/StoreGroupData.xml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,19 @@
2727
<data key="root_category_id">2</data>
2828
<data key="website_id">1</data>
2929
</entity>
30+
<entity name="finnishStoreGroup" type="group">
31+
<data key="name">Finnish</data>
32+
<data key="code">fin</data>
33+
<data key="root_category_id">2</data>
34+
<data key="website_id">1</data>
35+
</entity>
36+
<entity name="swedishStoreGroup" type="group">
37+
<data key="name">Swedish</data>
38+
<data key="code">swd</data>
39+
<data key="root_category_id">2</data>
40+
<data key="website_id">1</data>
41+
</entity>
42+
3043
<entity name="staticFirstStoreGroup" extends="staticStoreGroup">
3144
<data key="name">NewStore</data>
3245
<data key="code">Base1</data>

app/code/Magento/Store/Test/Mftf/Section/StorefrontHeaderSection.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,6 @@
1111
<element name="storeViewSwitcher" type="button" selector="#switcher-language-trigger"/>
1212
<element name="storeViewDropdown" type="button" selector="ul.switcher-dropdown"/>
1313
<element name="storeViewOption" type="button" selector="li.view-{{var1}}>a" parameterized="true"/>
14+
<element name="storeView" type="button" selector="//div[@class='actions dropdown options switcher-options active']//ul//li//a[contains(text(),'{{var}}')]" parameterized="true"/>
1415
</section>
1516
</sections>

0 commit comments

Comments
 (0)