Skip to content

Commit 2fccee1

Browse files
ENGCOM-6314: [New Relic] Making system configs dependent by Enabled field #25697
- Merge Pull Request #25697 from eduard13/magento2:2.3-develop-new-relic-dependency - Merged commits: 1. 8223649 2. 46b4e37 3. 66fddf2 4. ce088ac 5. a738307 6. 9a3d147 7. d504f54 8. f78f0c1 9. ff92deb 10. f64cd49
2 parents c7a2450 + f64cd49 commit 2fccee1

11 files changed

+203
-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="AdminExpandConfigSectionActionGroup">
12+
<annotations>
13+
<description>Expands configuration section passed via argument as Section Name.</description>
14+
</annotations>
15+
<arguments>
16+
<argument name="sectionName" type="string"/>
17+
</arguments>
18+
19+
<conditionalClick selector="{{AdminConfigSection.collapsibleSectionByTitle(sectionName)}}" dependentSelector="{{AdminConfigSection.expandedSectionByTitle(sectionName)}}" visible="false" stepKey="expandSection" />
20+
<waitForElement selector="{{AdminConfigSection.expandedSectionByTitle(sectionName)}}" stepKey="waitOpenedSection"/>
21+
</actionGroup>
22+
</actionGroups>

app/code/Magento/Config/Test/Mftf/Section/AdminConfigSection.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,8 @@
1919
<element name="defaultConfigButton" type="button" selector="#store-change-button" timeout="30"/>
2020
<element name="defaultConfigDropdown" type="button" selector="//ul[@class='dropdown-menu']" timeout="30"/>
2121
<element name="fieldError" type="text" selector="label.mage-error"/>
22+
<element name="useSystemValue" type="checkbox" selector="#{{configRowId}} > .use-default > input" parameterized="true"/>
23+
<element name="collapsibleSectionByTitle" type="text" selector="//form[@id='config-edit-form']//div[@class='section-config'][contains(.,'{{sectionTitle}}')]" parameterized="true" />
24+
<element name="expandedSectionByTitle" type="text" selector="//form[@id='config-edit-form']//div[@class='section-config active'][contains(.,'{{sectionTitle}}')]" parameterized="true" />
2225
</section>
2326
</sections>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
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="AdminNavigateToNewRelicConfigurationActionGroup">
12+
<amOnPage url="{{AdminNewRelicConfigPage.url}}" stepKey="navigateToNewRelicConfigurationPage"/>
13+
<waitForPageLoad stepKey="waitForPageLoad"/>
14+
</actionGroup>
15+
</actionGroups>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
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="AdminToggleNewRelicReportingEnabledActionGroup">
12+
<arguments>
13+
<argument name="state" type="string"/>
14+
</arguments>
15+
<selectOption selector="{{AdminNewRelicConfigSystemSection.status}}" userInput="{{state}}" stepKey="switchActiveState"/>
16+
</actionGroup>
17+
</actionGroups>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
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="AdminUncheckUseSystemValueActionGroup">
12+
<arguments>
13+
<argument name="rowId" type="string"/>
14+
</arguments>
15+
16+
<uncheckOption selector="{{AdminConfigSection.useSystemValue(rowId)}}" stepKey="uncheckCheckbox"/>
17+
</actionGroup>
18+
</actionGroups>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
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="AssertAdminNewRelicConfigFieldIsNotVisibleActionGroup">
12+
<arguments>
13+
<argument name="config" type="string"/>
14+
</arguments>
15+
<dontSeeElement selector="{{config}}" stepKey="dontSeeConfigField"/>
16+
</actionGroup>
17+
</actionGroups>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
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="AssertAdminNewRelicConfigFieldIsVisibleActionGroup">
12+
<arguments>
13+
<argument name="config" type="string"/>
14+
</arguments>
15+
<seeElement selector="{{config}}" stepKey="seeConfigField"/>
16+
</actionGroup>
17+
</actionGroups>
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
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+
<pages xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/PageObject.xsd">
9+
<page name="AdminNewRelicConfigPage" url="admin/system_config/edit/section/newrelicreporting/" area="admin" module="Magento_Config">
10+
<section name="AdminNewRelicConfigSystemSection"/>
11+
</page>
12+
</pages>
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
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="AdminNewRelicConfigSystemSection">
12+
<element name="status" type="select" selector="#row_newrelicreporting_general_enable [data-ui-id='select-groups-general-fields-enable-value']"/>
13+
<element name="apiUrl" type="input" selector="input#newrelicreporting_general_api_url"/>
14+
</section>
15+
</sections>
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
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="AdminCheckNewRelicSystemConfigDependencyTest">
12+
<annotations>
13+
<features value="NewRelicReporting"/>
14+
<stories value="Admin is able to see the configuration fields only after enabling the feature"/>
15+
<title value="Admin can see the configuration fields only after enabling the feature"/>
16+
<description value="The system configs should be available only after enabling the New Relic feature."/>
17+
<severity value="MINOR"/>
18+
<group value="NewRelicReporting"/>
19+
</annotations>
20+
<before>
21+
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/>
22+
<actionGroup ref="AdminNavigateToNewRelicConfigurationActionGroup" stepKey="goToConfigPage"/>
23+
<actionGroup ref="AdminExpandConfigSectionActionGroup" stepKey="expandingGeneralSection">
24+
<argument name="sectionName" value="General"/>
25+
</actionGroup>
26+
</before>
27+
<after>
28+
<actionGroup ref="logout" stepKey="logoutOfAdmin"/>
29+
</after>
30+
<actionGroup ref="AssertAdminNewRelicConfigFieldIsNotVisibleActionGroup" stepKey="checkingIfApiUrlIsNotVisible">
31+
<argument name="config" value="{{AdminNewRelicConfigSystemSection.apiUrl}}"/>
32+
</actionGroup>
33+
<actionGroup ref="AdminUncheckUseSystemValueActionGroup" stepKey="uncheckUseSystemValue">
34+
<argument name="rowId" value="row_newrelicreporting_general_enable"/>
35+
</actionGroup>
36+
<actionGroup ref="AdminToggleNewRelicReportingEnabledActionGroup" stepKey="enablingNewRelicReporting">
37+
<argument name="state" value="Yes"/>
38+
</actionGroup>
39+
<actionGroup ref="AssertAdminNewRelicConfigFieldIsVisibleActionGroup" stepKey="checkingIfApiUrlIsVisible">
40+
<argument name="config" value="{{AdminNewRelicConfigSystemSection.apiUrl}}"/>
41+
</actionGroup>
42+
</test>
43+
</tests>

0 commit comments

Comments
 (0)