Skip to content

Commit 384b09c

Browse files
authored
ENGCOM-8135: System configuration Validation #29486
2 parents d4c4bf1 + 4af8e64 commit 384b09c

File tree

4 files changed

+67
-2
lines changed

4 files changed

+67
-2
lines changed
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="AdminConfigServicesOauthPage" url="admin/system_config/edit/section/oauth/" area="admin" module="Magento_Integration">
10+
<section name="AdminConfigAccessTokenExpirationSection"/>
11+
</page>
12+
</pages>
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+
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
9+
<section name="AdminConfigAccessTokenExpirationSection">
10+
<element name="tabAccessTokenLifetime" type="select" selector="#oauth_access_token_lifetime-head"/>
11+
<element name="CheckIfTabExpand" type="button" selector="#oauth_access_token_lifetime-head:not(.open)"/>
12+
<element name="valueForTokenLifetime" type="input" selector="#oauth_access_token_lifetime_customer"/>
13+
<element name="systemValueForTokenLifetime" type="checkbox" selector="#oauth_access_token_lifetime_customer_inherit"/>
14+
<element name="valueForTokenLifetimeAdmin" type="input" selector="#oauth_access_token_lifetime_admin"/>
15+
<element name="systemValueForTokenLifetimeAdmin" type="checkbox" selector="#oauth_access_token_lifetime_admin_inherit"/>
16+
</section>
17+
</sections>
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
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="AdminConfigSaveEmptySettingsTest">
11+
<annotations>
12+
<features value="Configuration"/>
13+
<stories value="Save settings 'Access Token Expiration'."/>
14+
<title value="Save settings 'Access Token Expiration' with empty values."/>
15+
<description value="Save settings 'Customer Token Lifetime' and 'Admin Token Lifetime' with empty values without validations."/>
16+
<severity value="AVERAGE"/>
17+
<testCaseId value="MC-37382"/>
18+
<group value="configuration"/>
19+
</annotations>
20+
<before>
21+
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>
22+
</before>
23+
<after>
24+
<actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/>
25+
</after>
26+
<amOnPage url="{{AdminConfigServicesOauthPage.url}}" stepKey="navigateToConfigurationPage"/>
27+
<waitForPageLoad stepKey="waitForPageLoad"/>
28+
<conditionalClick selector="{{AdminConfigAccessTokenExpirationSection.tabAccessTokenLifetime}}" dependentSelector="{{AdminConfigAccessTokenExpirationSection.CheckIfTabExpand}}" visible="true" stepKey="expandTab"/>
29+
<waitForAjaxLoad stepKey="waitForAjax"/>
30+
<uncheckOption selector="{{AdminConfigAccessTokenExpirationSection.systemValueForTokenLifetime}}" stepKey="uncheckUseSystemValue"/>
31+
<fillField selector="{{AdminConfigAccessTokenExpirationSection.valueForTokenLifetime}}" userInput="" stepKey="valueForTokenLifetime"/>
32+
<uncheckOption selector="{{AdminConfigAccessTokenExpirationSection.systemValueForTokenLifetimeAdmin}}" stepKey="uncheckUseSystemValueAdmin"/>
33+
<fillField selector="{{AdminConfigAccessTokenExpirationSection.valueForTokenLifetimeAdmin}}" userInput="" stepKey="valueForTokenLifetimeAdmin"/>
34+
<actionGroup ref="AdminSaveConfigActionGroup" stepKey="saveConfig"/>
35+
</test>
36+
</tests>

app/code/Magento/Integration/etc/adminhtml/system.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,12 @@
1616
<field id="customer" translate="label comment" type="text" sortOrder="30" showInDefault="1" canRestore="1">
1717
<label>Customer Token Lifetime (hours)</label>
1818
<comment>We will disable this feature if the value is empty.</comment>
19-
<validate>required-entry validate-zero-or-greater validate-number</validate>
19+
<validate>validate-zero-or-greater validate-number</validate>
2020
</field>
2121
<field id="admin" translate="label comment" type="text" sortOrder="60" showInDefault="1" canRestore="1">
2222
<label>Admin Token Lifetime (hours)</label>
2323
<comment>We will disable this feature if the value is empty.</comment>
24-
<validate>required-entry validate-zero-or-greater validate-number</validate>
24+
<validate>validate-zero-or-greater validate-number</validate>
2525
</field>
2626
</group>
2727
<group id="cleanup" translate="label" type="text" sortOrder="300" showInDefault="1">

0 commit comments

Comments
 (0)