Skip to content

Commit fa5b871

Browse files
committed
Merge branch '278-locale-developer-config-visibility' of https://github.com/rogyar/magento-functional-tests-migration into 2.3-develop
2 parents d9d4b82 + c9ca1ec commit fa5b871

File tree

6 files changed

+76
-0
lines changed

6 files changed

+76
-0
lines changed

app/code/Magento/Backend/Test/Mftf/Section/LocaleOptionsSection.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@
1111
<section name="LocaleOptionsSection">
1212
<element name="sectionHeader" type="text" selector="#general_locale-head"/>
1313
<element name="timezone" type="select" selector="#general_locale_timezone"/>
14+
<element name="locale" type="select" selector="#general_locale_code"/>
15+
<element name="localeEnabled" type="select" selector="#general_locale_code:enabled"/>
16+
<element name="localeDisabled" type="select" selector="#general_locale_code[disabled=disabled]"/>
1417
<element name="useDefault" type="checkbox" selector="#general_locale_timezone_inherit"/>
1518
</section>
1619
</sections>
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
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="AdminCheckLocaleAndDeveloperConfigInDeveloperModeTest">
12+
<annotations>
13+
<features value="Backend"/>
14+
<title value="Check locale dropdown and developer configuration page are available in developer mode"/>
15+
<description value="Check locale dropdown and developer configuration page are available in developer mode"/>
16+
<group value="backend"/>
17+
<group value="mtf_migrated"/>
18+
</annotations>
19+
<before>
20+
<magentoCLI command="deploy:mode:set developer" stepKey="enableDeveloperMode"/>
21+
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/>
22+
</before>
23+
24+
<!-- Go to the general configuration and make sure the locale dropdown is available and enabled -->
25+
<actionGroup ref="NavigateToConfigurationGeneralPage" stepKey="navigateToGeneralConfigurationPage"/>
26+
<conditionalClick selector="{{LocaleOptionsSection.sectionHeader}}" dependentSelector="{{LocaleOptionsSection.timezone}}" visible="false" stepKey="openLocaleSection"/>
27+
<seeElement selector="{{LocaleOptionsSection.localeEnabled}}" stepKey="seeEnabledLocaleDropdown"/>
28+
29+
<!-- Go to the developer configuration and make sure the page is available -->
30+
<actionGroup ref="NavigateToConfigurationDeveloperPage" stepKey="goToDeveloperConfigPage"/>
31+
<seeInCurrentUrl url="{{AdminConfigDeveloperPage.url}}" stepKey="seeDeveloperConfigUrl"/>
32+
</test>
33+
</tests>
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
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="AdminCheckLocaleAndDeveloperConfigInProductionMode">
12+
<annotations>
13+
<features value="Backend"/>
14+
<title value="Check locale dropdown and developer configuration page are not available in production mode"/>
15+
<description value="Check locale dropdown and developer configuration page are not available in production mode"/>
16+
<group value="backend"/>
17+
<group value="mtf_migrated"/>
18+
</annotations>
19+
<before>
20+
<magentoCLI command="deploy:mode:set production" stepKey="enableDeveloperMode"/>
21+
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/>
22+
</before>
23+
24+
<!-- Go to the general configuration and make sure the locale dropdown is disabled -->
25+
<actionGroup ref="NavigateToConfigurationGeneralPage" stepKey="navigateToGeneralConfigurationPage"/>
26+
<conditionalClick selector="{{LocaleOptionsSection.sectionHeader}}" dependentSelector="{{LocaleOptionsSection.timezone}}" visible="false" stepKey="openLocaleSection"/>
27+
<seeElement selector="{{LocaleOptionsSection.localeDisabled}}" stepKey="seeEnabledLocaleDropdown"/>
28+
29+
<!-- Go to the developer configuration and make sure the redirect to the configuration page takes place -->
30+
<actionGroup ref="NavigateToConfigurationDeveloperPage" stepKey="goToDeveloperConfigPage"/>
31+
<seeInCurrentUrl url="{{AdminConfigPage.url}}index/" stepKey="seeConfigurationIndexUrl"/>
32+
</test>
33+
</tests>

app/code/Magento/Config/Test/Mftf/ActionGroup/GeneralConfigurationActionGroup.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,11 @@
2828
<waitForPageLoad stepKey="waitForConfigPageLoad"/>
2929
</actionGroup>
3030

31+
<actionGroup name="NavigateToConfigurationDeveloperPage">
32+
<amOnPage url="{{AdminConfigDeveloperPage.url}}" stepKey="navigateToConfigDeveloperPage"/>
33+
<waitForPageLoad stepKey="waitForConfigPageLoad"/>
34+
</actionGroup>
35+
3136
<actionGroup name="SelectTopDestinationsCountry">
3237
<annotations>
3338
<description>Selects the provided Countries under 'Top destinations' on the 'General' section of the 'Configuration' page. Clicks on the Save button.</description>

app/code/Magento/Config/Test/Mftf/Page/AdminConfigPage.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,5 @@
2121
<page name="AdminConfigGeneralPage" url="admin/system_config/edit/section/general/" area="admin" module="Magento_Config">
2222
<section name="GeneralSection"/>
2323
</page>
24+
<page name="AdminConfigDeveloperPage" url="admin/system_config/edit/section/dev/" area="admin" module="Magento_Config"/>
2425
</pages>

dev/tests/functional/tests/app/Magento/Backend/Test/TestCase/ConfigPageVisibilityTest.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
<testCase name="Magento\Backend\Test\TestCase\ConfigPageVisibilityTest" summary="Check Developer section and Locale field">
1010
<variation name="VisibilityOfDeveloperSectionAndLocaleField" summary="Check Developer section and Locale field" ticketId="MAGETWO-63625, MAGETWO-63624">
1111
<data name="tag" xsi:type="string">severity:S1</data>
12+
<data name="tag" xsi:type="string">mftf_migrated:yes</data>
1213
<constraint name="Magento\Backend\Test\Constraint\AssertLocaleCodeVisibility" />
1314
<constraint name="Magento\Backend\Test\Constraint\AssertDeveloperSectionVisibility" />
1415
</variation>

0 commit comments

Comments
 (0)