Skip to content

Commit 67c83d9

Browse files
committed
Refactoring-AdminSimpleProductSetEditContentTest
1 parent 207c959 commit 67c83d9

7 files changed

+140
-18
lines changed
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+
9+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="AdminFillInProductDescriptionActionGroup">
12+
<arguments>
13+
<argument name="description" type="string"/>
14+
</arguments>
15+
<fillField selector="{{AdminProductContentSection.descriptionTextArea}}" userInput="{{description}}" stepKey="fillLongDescription"/>
16+
</actionGroup>
17+
</actionGroups>
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+
9+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="AdminFillInProductShortDescriptionActionGroup">
12+
<arguments>
13+
<argument name="shortDescription" type="string"/>
14+
</arguments>
15+
<fillField selector="{{AdminProductContentSection.shortDescriptionTextArea}}" userInput="{{shortDescription}}" stepKey="fillShortDescription"/>
16+
</actionGroup>
17+
</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="AdminOpenContentSectionOnProductPageActionGroup">
12+
<scrollTo selector="{{AdminProductContentSection.sectionHeader}}" x="0" y="-100" stepKey="scrollToContentSection"/>
13+
<click selector="{{AdminProductContentSection.sectionHeader}}" stepKey="openContentSection"/>
14+
</actionGroup>
15+
</actionGroups>
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+
9+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="AssertAdminProductShortDescriptionOnProductEditFormActionGroup">
12+
<arguments>
13+
<argument name="productShortDescription" type="string"/>
14+
</arguments>
15+
<seeInField selector="{{AdminProductContentSection.shortDescriptionTextArea}}" userInput="{{productShortDescription}}" stepKey="seeProductShortDescription"/>
16+
</actionGroup>
17+
</actionGroups>
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+
9+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="AssertStorefrontProductDescriptionActionGroup">
12+
<arguments>
13+
<argument name="productDescription" type="string"/>
14+
</arguments>
15+
<see selector="{{StorefrontProductInfoMainSection.productDescription}}" userInput="{{productDescription}}" stepKey="seeLongDescriptionAtStorefront"/>
16+
</actionGroup>
17+
</actionGroups>
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+
9+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="AssertStorefrontShortProductDescriptionActionGroup">
12+
<arguments>
13+
<argument name="productShortDescription" type="string"/>
14+
</arguments>
15+
<see selector="{{StorefrontProductInfoMainSection.productShortDescription}}" userInput="{{productShortDescription}}" stepKey="seeShortDescriptionAtStorefront"/>
16+
</actionGroup>
17+
</actionGroups>

app/code/Magento/Catalog/Test/Mftf/Test/AdminSimpleProductSetEditContentTest.xml

Lines changed: 40 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -44,35 +44,57 @@
4444

4545
<!--Add content-->
4646
<!--A generic scroll scrolls past this element, in doing this it fails to execute certain actions on the element and others below it. By scrolling slightly above it it resolves this issue.-->
47-
<scrollTo selector="{{AdminProductContentSection.sectionHeader}}" x="0" y="-100" stepKey="scrollTo"/>
48-
<click selector="{{AdminProductContentSection.sectionHeader}}" stepKey="openDescriptionDropDown"/>
49-
<fillField selector="{{AdminProductContentSection.descriptionTextArea}}" userInput="This is the long description" stepKey="fillLongDescription"/>
50-
<fillField selector="{{AdminProductContentSection.shortDescriptionTextArea}}" userInput="This is the short description" stepKey="fillShortDescription"/>
47+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="scrollTo"/>
48+
<actionGroup ref="AdminOpenContentSectionOnProductPageActionGroup" stepKey="openDescriptionDropDown"/>
49+
<actionGroup ref="AdminFillInProductDescriptionActionGroup" stepKey="fillLongDescription">
50+
<argument name="description" value="This is the long description"/>
51+
</actionGroup>
52+
<actionGroup ref="AdminFillInProductShortDescriptionActionGroup" stepKey="fillShortDescription">
53+
<argument name="shortDescription" value="This is the short description"/>
54+
</actionGroup>
5155

5256
<!--save the product-->
5357
<actionGroup ref="AdminProductFormSaveActionGroup" stepKey="clickSaveButton"/>
54-
<see selector="{{AdminCategoryMessagesSection.SuccessMessage}}" userInput="You saved the product." stepKey="messageYouSavedTheProductIsShown"/>
58+
<actionGroup ref="AssertMessageInAdminPanelActionGroup" stepKey="messageYouSavedTheProductIsShown">
59+
<argument name="message" value="You saved the product."/>
60+
</actionGroup>
5561

5662
<!--Edit content-->
57-
<click selector="{{AdminProductContentSection.sectionHeader}}" stepKey="openDescriptionDropDownEdit"/>
58-
<scrollTo selector="{{AdminProductContentSection.sectionHeader}}" stepKey="scrollToEdit"/>
59-
<fillField selector="{{AdminProductContentSection.descriptionTextArea}}" userInput="EDIT ~ This is the long description ~ EDIT" stepKey="editLongDescription"/>
60-
<fillField selector="{{AdminProductContentSection.shortDescriptionTextArea}}" userInput="EDIT ~ This is the short description ~ EDIT" stepKey="editShortDescription"/>
63+
<actionGroup ref="AdminOpenContentSectionOnProductPageActionGroup" stepKey="openDescriptionDropDownEdit"/>
64+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="scrollToEdit"/>
65+
<actionGroup ref="AdminFillInProductDescriptionActionGroup" stepKey="editLongDescription">
66+
<argument name="description" value="EDIT ~ This is the long description ~ EDIT"/>
67+
</actionGroup>
68+
<actionGroup ref="AdminFillInProductShortDescriptionActionGroup" stepKey="editShortDescription">
69+
<argument name="shortDescription" value="EDIT ~ This is the short description ~ EDIT"/>
70+
</actionGroup>
6171

6272
<!--save the product-->
6373
<actionGroup ref="AdminProductFormSaveActionGroup" stepKey="clickSaveButtonAfterEdit"/>
64-
<see selector="{{AdminCategoryMessagesSection.SuccessMessage}}" userInput="You saved the product." stepKey="messageYouSavedTheProductIsShownAgain"/>
74+
<actionGroup ref="AssertMessageInAdminPanelActionGroup" stepKey="messageYouSavedTheProductIsShownAgain">
75+
<argument name="message" value="You saved the product."/>
76+
</actionGroup>
6577

6678
<!--Checking content admin-->
67-
<click selector="{{AdminProductContentSection.sectionHeader}}" stepKey="openDescriptionDropDownAgain"/>
68-
<scrollTo selector="{{AdminProductContentSection.sectionHeader}}" stepKey="scrollToAgain"/>
69-
<seeInField selector="{{AdminProductContentSection.descriptionTextArea}}" userInput="EDIT ~ This is the long description ~ EDIT" stepKey="seeLongDescriptionAdmin"/>
70-
<seeInField selector="{{AdminProductContentSection.shortDescriptionTextArea}}" userInput="EDIT ~ This is the short description ~ EDIT" stepKey="seeShortDescriptionAdmin"/>
79+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="openDescriptionDropDownAgain"/>
80+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="scrollToAgain"/>
81+
<actionGroup ref="AssertProductDescriptionInProductEditFormActionGroup" stepKey="seeLongDescriptionAdmin">
82+
<argument name="productDescription" value="EDIT ~ This is the long description ~ EDIT"/>
83+
</actionGroup>
84+
<actionGroup ref="AssertAdminProductShortDescriptionOnProductEditFormActionGroup" stepKey="seeShortDescriptionAdmin">
85+
<argument name="productShortDescription" value="EDIT ~ This is the short description ~ EDIT"/>
86+
</actionGroup>
7187

7288
<!--Checking content storefront-->
73-
<amOnPage url="{{SimpleProduct.urlKey}}.html" stepKey="goToStorefront"/>
74-
<waitForPageLoad stepKey="waitForStorefront"/>
75-
<see selector="{{StorefrontProductInfoMainSection.productDescription}}" userInput="EDIT ~ This is the long description ~ EDIT" stepKey="seeLongDescriptionStorefront"/>
76-
<see selector="{{StorefrontProductInfoMainSection.productShortDescription}}" userInput="EDIT ~ This is the short description ~ EDIT" stepKey="seeShortDescriptionStorefront"/>
89+
<actionGroup ref="StorefrontOpenProductPageActionGroup" stepKey="goToStorefront">
90+
<argument name="productUrl" value="{{SimpleProduct.urlKey}}"/>
91+
</actionGroup>
92+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForStorefront"/>
93+
<actionGroup ref="AssertStorefrontProductDescriptionActionGroup" stepKey="seeLongDescriptionStorefront">
94+
<argument name="productDescription" value="EDIT ~ This is the long description ~ EDIT"/>
95+
</actionGroup>
96+
<actionGroup ref="AssertStorefrontShortProductDescriptionActionGroup" stepKey="seeShortDescriptionStorefront">
97+
<argument name="productShortDescription" value="EDIT ~ This is the short description ~ EDIT"/>
98+
</actionGroup>
7799
</test>
78100
</tests>

0 commit comments

Comments
 (0)