Skip to content

Commit 46b4e37

Browse files
committed
Covering the system dependency by MFTF
1 parent 8223649 commit 46b4e37

7 files changed

+131
-0
lines changed
Lines changed: 17 additions & 0 deletions
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="AdminTogglesEnabledConfigActionGroup">
12+
<arguments>
13+
<argument name="state" type="string"/>
14+
</arguments>
15+
<selectOption selector="{{AdminNewRelicConfigSystemSection.status}}" userInput="{{state}}" stepKey="switchActiveState"/>
16+
</actionGroup>
17+
</actionGroups>
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
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="AdminUnchecksUseSystemValueActionGroup">
12+
<uncheckOption selector="{{AdminNewRelicConfigSystemSection.useSystemValueForEnabled}}" stepKey="uncheckCheckbox"/>
13+
</actionGroup>
14+
</actionGroups>
Lines changed: 17 additions & 0 deletions
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="AssertAdminDoesntSeeConfigFieldActionGroup">
12+
<arguments>
13+
<argument name="config" type="string"/>
14+
</arguments>
15+
<dontSeeElement selector="{{config}}" stepKey="dontSeeConfigField"/>
16+
</actionGroup>
17+
</actionGroups>
Lines changed: 17 additions & 0 deletions
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="AssertAdminSeesConfigFieldActionGroup">
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: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
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="useSystemValueForEnabled" type="checkbox" selector="#newrelicreporting_general_enable_inherit"/>
14+
<element name="apiUrl" type="select" selector="input#newrelicreporting_general_api_url"/>
15+
</section>
16+
</sections>
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
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="AdminChecksSystemConfigDependencyTest">
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="CRITICAL"/>
18+
<group value="NewRelicReporting"/>
19+
</annotations>
20+
<before>
21+
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/>
22+
<amOnPage url="{{AdminNewRelicConfigPage.url}}" stepKey="navigateToNewRelicConfigurationPage"/>
23+
</before>
24+
<after>
25+
<actionGroup ref="logout" stepKey="logoutOfAdmin"/>
26+
</after>
27+
<actionGroup ref="AssertAdminDoesntSeeConfigFieldActionGroup" stepKey="checkIfApiUrlIsNotVisible">
28+
<argument name="config" value="{{AdminNewRelicConfigSystemSection.apiUrl}}"/>
29+
</actionGroup>
30+
<actionGroup ref="AdminUnchecksUseSystemValueActionGroup" stepKey="uncheckUseSystemValue"/>
31+
<actionGroup ref="AdminTogglesEnabledConfigActionGroup" stepKey="enableNewRelic">
32+
<argument name="state" value="Yes"/>
33+
</actionGroup>
34+
<actionGroup ref="AssertAdminSeesConfigFieldActionGroup" stepKey="checkIfApiUrlIsVisible">
35+
<argument name="config" value="{{AdminNewRelicConfigSystemSection.apiUrl}}"/>
36+
</actionGroup>
37+
</test>
38+
</tests>

0 commit comments

Comments
 (0)