Skip to content

Commit be757be

Browse files
committed
Refactored AdminConfigDefaultProductLayoutFromConfigurationSettingTesti
1 parent f472536 commit be757be

File tree

3 files changed

+78
-12
lines changed

3 files changed

+78
-12
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="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: 32 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
* See COPYING.txt for license details.
66
*/
77
-->
8-
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
9-
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
8+
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
9+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
1010
<test name="AdminConfigDefaultProductLayoutFromConfigurationSettingTest">
1111
<annotations>
1212
<features value="Catalog"/>
@@ -21,18 +21,38 @@
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+
37+
<actionGroup ref="NavigateToDefaultLayoutsSettingActionGroup" stepKey="navigateToWebConfigurationPage"/>
38+
39+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="expandDefaultLayouts"/>
40+
<comment userInput="Comment is added to preserve the step key for backward compatibilityr" stepKey="DefaultProductLayout"/>
41+
<actionGroup ref="AdminSetProductLayoutSettingsActionGroup" stepKey="select3ColumnsLayout">
42+
<argument name="layout" value="3 columns"/>
43+
</actionGroup>
44+
45+
<actionGroup ref="CliCacheFlushActionGroup" stepKey="clickSaveConfig">
46+
<argument name="tags" value="config"/>
47+
</actionGroup>
48+
49+
<actionGroup ref="AdminOpenNewProductFormPageActionGroup" stepKey="navigateToNewProduct"/>
50+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="wait1"/>
51+
52+
<actionGroup ref="AdminExpandProductDesignSectionActionGroup" stepKey="clickOnDesignTab"/>
53+
54+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForLayoutDropDown"/>
3655
<seeOptionIsSelected selector="{{ProductDesignSection.LayoutDropdown}}" userInput="3 columns" stepKey="see3ColumnsSelected"/>
56+
3757
</test>
3858
</tests>
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
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+
<waitForPageLoad stepKey="waitForSavingSystemConfiguration"/>
23+
<see userInput="You saved the configuration." stepKey="seeSuccessMessage"/>
24+
25+
</actionGroup>
26+
</actionGroups>

0 commit comments

Comments
 (0)