Skip to content

Commit c0728b8

Browse files
committed
AdminConfigDefaultProductLayoutFromConfigurationSettingTest refactored
1 parent f472536 commit c0728b8

File tree

5 files changed

+79
-13
lines changed

5 files changed

+79
-13
lines changed

app/code/Magento/AdminAnalytics/Test/Mftf/Test/AdminCheckAnalyticsTrackingTest.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
<actionGroup ref="AdminLoginActionGroup" stepKey="LoginAsAdmin"/>
2121
<magentoCLI command="config:set admin/usage/enabled 1" stepKey="enableAdminUsageTracking"/>
2222
<actionGroup ref="CliCacheCleanActionGroup" stepKey="cleanInvalidatedCaches">
23-
<argument name="tags" value="config full_page"/>
23+
value="config full_page"/>
2424
</actionGroup>
2525
<reloadPage stepKey="pageReload"/>
2626
</before>
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="AdminExpandProductDesignSectionActionGroup">
12+
<annotations>
13+
<description>Expand the Design section on the Product Details page in Admin.</description>
14+
</annotations>
15+
16+
<click selector="{{ProductDesignSection.DesignTab}}" stepKey="clickDesignTab"/>
17+
<waitForPageLoad stepKey="waitForTabOpen"/>
18+
19+
</actionGroup>
20+
</actionGroups>

app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateSimpleProductTest/AdminConfigDefaultProductLayoutFromConfigurationSettingTest.xml

Lines changed: 33 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -21,18 +21,39 @@
2121
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>
2222
</before>
2323
<after>
24-
<actionGroup ref="RestoreLayoutSetting" stepKey="sampleActionGroup"/>
24+
<actionGroup ref="NavigateToDefaultLayoutsSettingActionGroup" stepKey="navigateToWebConfigurationPage1"/>
25+
26+
<actionGroup ref="AdminSetProductLayoutSettingsActionGroup" stepKey="sampleActionGroup">
27+
<argument name="layout" value="1 column"/>
28+
</actionGroup>
29+
30+
<actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCacheBeforeTestFinishes">
31+
<argument name="tags" value="config"/>
32+
</actionGroup>
33+
2534
<actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/>
2635
</after>
27-
<actionGroup ref="AdminOpenWebConfigurationPageActionGroup" stepKey="navigateToWebConfigurationPage"/>
28-
<conditionalClick stepKey="expandDefaultLayouts" selector="{{WebSection.DefaultLayoutsTab}}" dependentSelector="{{WebSection.CheckIfTabExpand}}" visible="true"/>
29-
<waitForElementVisible selector="{{DefaultLayoutsSection.productLayout}}" stepKey="DefaultProductLayout"/>
30-
<selectOption selector="{{DefaultLayoutsSection.productLayout}}" userInput="3 columns" stepKey="select3ColumnsLayout"/>
31-
<click selector="{{ContentManagementSection.Save}}" stepKey="clickSaveConfig"/>
32-
<amOnPage url="{{AdminProductCreatePage.url(AddToDefaultSet.attributeSetId, 'simple')}}" stepKey="navigateToNewProduct"/>
33-
<waitForPageLoad stepKey="wait1"/>
34-
<click selector="{{ProductDesignSection.DesignTab}}" stepKey="clickOnDesignTab"/>
35-
<waitForElementVisible selector="{{ProductDesignSection.LayoutDropdown}}" stepKey="waitForLayoutDropDown"/>
36-
<seeOptionIsSelected selector="{{ProductDesignSection.LayoutDropdown}}" userInput="3 columns" stepKey="see3ColumnsSelected"/>
36+
37+
<actionGroup ref="NavigateToDefaultLayoutsSettingActionGroup" stepKey="navigateToWebConfigurationPage"/>
38+
39+
<comment userInput="Set default layout to 3 columns" stepKey="expandDefaultLayouts"/>
40+
41+
<actionGroup ref="AdminSetProductLayoutSettingsActionGroup" stepKey="select3ColumnsLayout">
42+
<argument name="layout" value="3 columns"/>
43+
</actionGroup>
44+
<comment userInput="Default layout has been updated" stepKey="DefaultProductLayout"/>
45+
46+
<actionGroup ref="CliCacheFlushActionGroup" stepKey="clickSaveConfig">
47+
<argument name="tags" value="config"/>
48+
</actionGroup>
49+
50+
<actionGroup ref="AdminOpenNewProductFormPageActionGroup" stepKey="navigateToNewProduct"/>
51+
<comment userInput="Default layout has been updated" stepKey="wait1"/>
52+
53+
<actionGroup ref="AdminExpandProductDesigSectionActionGroup" stepKey="clickOnDesignTab"/>
54+
55+
<comment userInput="Checking if settings have been applied" stepKey="waitForLayoutDropDown"/>
56+
<seeOptionIsSelected selector="{{ProductDesignSection.LayoutDropdown}}" userInput="3 columns" stepKey="see3ColumnsSelected"/>
57+
3758
</test>
38-
</tests>
59+
</tests>
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
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="AdminSetProductLayoutSettingsActionGroup">
12+
<annotations>
13+
<description>Sets the 'Default Product Layout' to requested value.</description>
14+
</annotations>
15+
<arguments>
16+
<argument name="layout" type="string"/>
17+
</arguments>
18+
19+
<waitForElementVisible selector="{{DefaultLayoutsSection.productLayout}}" stepKey="waittForDefaultProductLayout"/>
20+
<selectOption selector="{{DefaultLayoutsSection.productLayout}}" userInput="{{layout}}" stepKey="selectLayout"/>
21+
<click selector="{{ContentManagementSection.Save}}" stepKey="clickSaveConfig"/>
22+
23+
</actionGroup>
24+
</actionGroups>

app/code/Magento/Cms/Test/Mftf/ActionGroup/RestoreLayoutSettingActionGroup.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,6 @@
1515

1616
<waitForElementVisible selector="{{DefaultLayoutsSection.pageLayout}}" stepKey="waittForDefaultCMSLayout" after="expandDefaultLayouts"/>
1717
<selectOption selector="{{DefaultLayoutsSection.pageLayout}}" userInput="1 column" stepKey="selectOneColumn" before="clickSaveConfig"/>
18+
<click selector="{{ContentManagementSection.Save}}" stepKey="clickSaveConfig"/>
1819
</actionGroup>
1920
</actionGroups>

0 commit comments

Comments
 (0)