Skip to content

Commit 9a3d147

Browse files
committed
Refactoring the test coverage
1 parent a738307 commit 9a3d147

File tree

6 files changed

+39
-26
lines changed

6 files changed

+39
-26
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="#{{element}} > .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>

app/code/Magento/NewRelicReporting/Test/Mftf/ActionGroup/AdminExpandNewRelicConfigTabActionGroup.xml

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

app/code/Magento/NewRelicReporting/Test/Mftf/ActionGroup/AdminUncheckNewRelicUseSystemValueActionGroup.xml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,11 @@
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="AdminUncheckNewRelicUseSystemValueActionGroup">
12-
<uncheckOption selector="{{AdminNewRelicConfigSystemSection.useSystemValueForEnabled}}" stepKey="uncheckCheckbox"/>
11+
<actionGroup name="AdminUncheckUseSystemValueActionGroup">
12+
<arguments>
13+
<argument name="rowId" type="string"/>
14+
</arguments>
15+
16+
<uncheckOption selector="{{AdminConfigSection.useSystemValue(rowId)}}" stepKey="uncheckCheckbox"/>
1317
</actionGroup>
1418
</actionGroups>

app/code/Magento/NewRelicReporting/Test/Mftf/Section/AdminNewRelicConfigSystemSection.xml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,8 @@
99
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
1010
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
1111
<section name="AdminNewRelicConfigSystemSection">
12-
<element name="tab" type="button" selector="#newrelicreporting_{{tab}}-head" parameterized="true"/>
12+
<element name="statusRowId" type="text" selector="#row_newrelicreporting_general_enable"/>
1313
<element name="status" type="select" selector="#row_newrelicreporting_general_enable [data-ui-id='select-groups-general-fields-enable-value']"/>
14-
<element name="useSystemValueForEnabled" type="checkbox" selector="#newrelicreporting_general_enable_inherit"/>
1514
<element name="apiUrl" type="select" selector="input#newrelicreporting_general_api_url"/>
1615
</section>
1716
</sections>

app/code/Magento/NewRelicReporting/Test/Mftf/Test/AdminChecksSystemConfigDependencyTest.xml renamed to app/code/Magento/NewRelicReporting/Test/Mftf/Test/AdminCheckNewRelicSystemConfigDependencyTest.xml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,20 +8,20 @@
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="AdminChecksSystemConfigDependencyTest">
11+
<test name="AdminCheckNewRelicSystemConfigDependencyTest">
1212
<annotations>
1313
<features value="NewRelicReporting"/>
1414
<stories value="Admin is able to see the configuration fields only after enabling the feature"/>
1515
<title value="Admin can see the configuration fields only after enabling the feature"/>
1616
<description value="The system configs should be available only after enabling the New Relic feature."/>
17-
<severity value="CRITICAL"/>
17+
<severity value="MINOR"/>
1818
<group value="NewRelicReporting"/>
1919
</annotations>
2020
<before>
2121
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/>
2222
<actionGroup ref="AdminNavigateToNewRelicConfigurationActionGroup" stepKey="goToConfigPage"/>
23-
<actionGroup ref="AdminExpandNewRelicConfigTabActionGroup" stepKey="expandingGeneralTab">
24-
<argument name="tabName" value="general"/>
23+
<actionGroup ref="AdminExpandConfigSectionActionGroup" stepKey="expandingGeneralSection">
24+
<argument name="sectionName" value="General"/>
2525
</actionGroup>
2626
</before>
2727
<after>
@@ -30,7 +30,9 @@
3030
<actionGroup ref="AssertAdminNewRelicConfigFieldIsNotVisibleActionGroup" stepKey="checkingIfApiUrlIsNotVisible">
3131
<argument name="config" value="{{AdminNewRelicConfigSystemSection.apiUrl}}"/>
3232
</actionGroup>
33-
<actionGroup ref="AdminUncheckNewRelicUseSystemValueActionGroup" stepKey="uncheckUseSystemValue"/>
33+
<actionGroup ref="AdminUncheckUseSystemValueActionGroup" stepKey="uncheckUseSystemValue">
34+
<argument name="rowId" value="row_newrelicreporting_general_enable"/>
35+
</actionGroup>
3436
<actionGroup ref="AdminToggleNewRelicReportingEnabledActionGroup" stepKey="enablingNewRelicReporting">
3537
<argument name="state" value="Yes"/>
3638
</actionGroup>

0 commit comments

Comments
 (0)