Skip to content

Commit dc14a72

Browse files
Covered using MFTF test
1 parent a3d0010 commit dc14a72

6 files changed

+117
-0
lines changed
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
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="AdminFillCookieLifetimeActionGroup">
12+
<annotations>
13+
<description>Fills the cookie lifetime field with sample data.</description>
14+
</annotations>
15+
<arguments>
16+
<argument name="cookieLifetime" type="string"/>
17+
</arguments>
18+
<fillField selector="{{AdminDefaultCookieSettingsSection.DefaultCookieLifetime}}" userInput="{{cookieLifetime}}" stepKey="fillFieldCookieLifetime"/>
19+
</actionGroup>
20+
</actionGroups>
Lines changed: 18 additions & 0 deletions
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="AdminNavigateToDefaultCookieSettingsActionGroup">
12+
<amOnPage url="{{AdminConfigurationDefaultCookieSettingsPage.url}}" stepKey="navigateToDefaultCookieSettings"/>
13+
<waitForPageLoad stepKey="waitForWebConfigurationPageLoad"/>
14+
<scrollTo selector="{{AdminDefaultCookieSettingsSection.DefaultCookieSettingsTab}}" x="-150" y="-150" stepKey="scrollToDefaultCookieSettingsSection"/>
15+
<conditionalClick stepKey="expandDefaultCookieSettingsTab" selector="{{AdminDefaultCookieSettingsSection.DefaultCookieSettingsTab}}" dependentSelector="{{AdminDefaultCookieSettingsSection.DefaultCookieLifetime}}" visible="false"/>
16+
<waitForElementVisible selector="{{AdminDefaultCookieSettingsSection.DefaultCookieSettingsTab}}" stepKey="waitForElementsAppeared"/>
17+
</actionGroup>
18+
</actionGroups>
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+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="AdminValidateNumberValidationActionGroup">
12+
<click selector="{{AdminConfigSection.saveButton}}" stepKey="clickSaveConfigBtn"/>
13+
<see selector="{{AdminDefaultCookieSettingsSection.ErrorMessageSectionCookieLifetime}}" userInput="Please enter a valid number in this field." stepKey="seeErrorMessage"/>
14+
</actionGroup>
15+
</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+
<pages xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/PageObject.xsd">
11+
<page name="AdminConfigurationDefaultCookieSettingsPage" url="admin/system_config/edit/section/web/" module="Cookie" area="admin">
12+
<section name="AdminDefaultCookieSettingsSection"/>
13+
</page>
14+
</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="AdminDefaultCookieSettingsSection">
12+
<element name="DefaultCookieSettingsTab" type="button" selector="#web_cookie-head"/>
13+
<element name="DefaultCookieLifetime" type="input" selector="#web_cookie_cookie_lifetime"/>
14+
<element name="ErrorMessageSectionCookieLifetime" type="text" selector="label#web_cookie_cookie_lifetime-error"/>
15+
</section>
16+
</sections>
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
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="AdminValidateCookieLifetimeTest">
12+
<annotations>
13+
<features value="Cookie"/>
14+
<stories value="Validate cookie lifetime field in Magento admin"/>
15+
<title value="Admin should not able to enter text in cookie lifetime filed"/>
16+
<description value="Admin can only be able type numbers in cookie lifetime filed in Magento admin"/>
17+
<group value="Cookie"/>
18+
</annotations>
19+
<before>
20+
<actionGroup ref="AdminLoginActionGroup" stepKey="loginGetFromGeneralFile"/>
21+
</before>
22+
<after>
23+
<actionGroup ref="AdminLogoutActionGroup" stepKey="adminLogout"/>
24+
</after>
25+
<actionGroup ref="AdminNavigateToDefaultCookieSettingsActionGroup" stepKey="navigateToDefaultCookieSettingsPage"/>
26+
<actionGroup ref="AdminUncheckUseSystemValueActionGroup" stepKey="uncheckUseSystemValue">
27+
<argument name="rowId" value="row_web_cookie_cookie_lifetime"/>
28+
</actionGroup>
29+
<actionGroup ref="AdminFillCookieLifetimeActionGroup" stepKey="fillCookieLifetimeField">
30+
<argument name="cookieLifetime" value="cookie"/>
31+
</actionGroup>
32+
<actionGroup ref="AdminValidateNumberValidationActionGroup" stepKey="validateCookieLifetimeSettings"/>
33+
</test>
34+
</tests>

0 commit comments

Comments
 (0)