Skip to content

Commit 2f7c608

Browse files
committed
MC-5450: Product Contents Are Ordered Incorrectly On Storefront
- Resolve CR comments
1 parent 7121e9c commit 2f7c608

File tree

4 files changed

+26
-10
lines changed

4 files changed

+26
-10
lines changed

app/code/Magento/PageBuilder/Test/Mftf/ActionGroup/AdminProductActionGroup.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
-->
88
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
99
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
10+
<!-- Consider moving action group to core, or utilising core action group if one is added at a later date -->
1011
<actionGroup name="addUpSellProductBySku" extends="addRelatedProductBySku">
1112
<click selector="{{AdminProductFormRelatedUpSellCrossSellSection.AddUpSellProductsButton}}" stepKey="clickAddRelatedProductButton"/>
1213
<conditionalClick selector="{{AdminAddUpSellProductsModalSection.Modal}} {{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminAddUpSellProductsModalSection.Modal}} {{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFilters"/>
@@ -16,5 +17,6 @@
1617
<waitForPageLoad stepKey="waitForPageToLoad"/>
1718
<click selector="{{AdminAddUpSellProductsModalSection.Modal}}{{AdminProductModalSlideGridSection.productGridXRowYColumnButton('1', '1')}}" stepKey="selectProduct"/>
1819
<click selector="{{AdminAddUpSellProductsModalSection.AddSelectedProductsButton}}" stepKey="addRelatedProductSelected"/>
20+
<waitForPageLoad stepKey="waitForPageToLoad1"/>
1921
</actionGroup>
2022
</actionGroups>

app/code/Magento/PageBuilder/Test/Mftf/Section/AdminProductRelatedUpSellCrossSellSection.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
1010
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
11+
<!-- Consider moving to core, when up-sell tests are implemented -->
1112
<section name="AdminProductFormRelatedUpSellCrossSellSection">
1213
<element name="AddUpSellProductsButton" type="button" selector="button[data-index='button_upsell']" timeout="30"/>
1314
</section>

app/code/Magento/PageBuilder/Test/Mftf/Section/CatalogSection.xml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,12 @@
1212
<element name="openPageBuilder" type="button" selector="[data-index='description'] button.action-default"/>
1313
</section>
1414
<section name="StorefrontProductFullWidth">
15-
<element name="infoMain" type="button" selector=".product-info-main"/>
16-
<element name="media" type="button" selector=".product.media"/>
1715
<element name="description" type="button" selector=".page-main-description"/>
1816
<element name="attributes" type="button" selector=".page-main-pagebuilder-attributes"/>
17+
<element name="moreInformation" type="button" selector=".additional-attributes-wrapper"/>
18+
<!-- Consider moving the below to core -->
19+
<element name="infoMain" type="button" selector=".product-info-main"/>
20+
<element name="media" type="button" selector=".product.media"/>
1921
<element name="reviews" type="button" selector=".block.review-add"/>
2022
<element name="related" type="button" selector=".block.related"/>
2123
<element name="upsell" type="button" selector=".block.upsell"/>

app/code/Magento/PageBuilder/Test/Mftf/Test/AdminCreateProductTest.xml

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -432,6 +432,10 @@
432432
<createData stepKey="addToDefaultSetSortOrder" entity="AddToDefaultSetSortOrder1">
433433
<requiredEntity createDataKey="createPageBuilderAttribute"/>
434434
</createData>
435+
<createData stepKey="createTextAttribute" entity="productAttributeText"/>
436+
<createData stepKey="addToDefaultSetSortOrder1" entity="AddToDefaultSetSortOrder1">
437+
<requiredEntity createDataKey="createTextAttribute"/>
438+
</createData>
435439
<createData stepKey="createPreReqCategory" entity="_defaultCategory"/>
436440
<createData stepKey="relatedSimpleProduct" entity="SimpleProduct2"/>
437441
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/>
@@ -440,6 +444,7 @@
440444
<actionGroup ref="logout" stepKey="logout"/>
441445
<deleteData createDataKey="createPreReqCategory" stepKey="deletePreReqCategory"/>
442446
<deleteData createDataKey="createPageBuilderAttribute" stepKey="deleteAttribute1"/>
447+
<deleteData createDataKey="createTextAttribute" stepKey="deleteAttribute2"/>
443448
<deleteData createDataKey="relatedSimpleProduct" stepKey="deleteRelatedProduct"/>
444449
</after>
445450
<!-- Update created attribute to enable Page Builder -->
@@ -471,14 +476,11 @@
471476
<waitForPageLoad stepKey="waitForPageLoadExitFullScreen"/>
472477
<!-- Add PageBuilder description -->
473478
<comment userInput="Add PageBuilder description" stepKey="commentAddDescription"/>
474-
<click selector="{{AdminProductContentSection.sectionHeader}}" stepKey="openContentSection"/>
479+
<conditionalClick selector="{{AdminProductContentSection.sectionHeader}}" dependentSelector="{{AdminProductContentSection.sectionHeaderIfNotShowing}}" visible="false" stepKey="openContentSection"/>
475480
<waitForPageLoad stepKey="waitForPageLoadContentSection"/>
476-
<waitForElementVisible selector="{{PageBuilderCatalog.openPageBuilder}}" stepKey="waitForPageBuilderBtn" />
477-
<see userInput="{{EditWithPageBuilderButton.value}}" stepKey="seePageBuilderBtn"/>
478-
<click selector="{{PageBuilderCatalog.openPageBuilder}}" stepKey="clickOnPageBuilderBtn" />
479-
<waitForPageLoad stepKey="waitForPageLoadPageBuilder"/>
480-
<waitForElementVisible selector="{{PageBuilderPanel.layoutGroup}}" stepKey="waiForPageBuilderVisible" />
481-
<waitForElementVisible selector="{{PageBuilderStage.stageWrapperFullScreen}}" stepKey="seePageBuilderFullSizeScreen" />
481+
<actionGroup ref="openPageBuilderForAttribute" stepKey="openPageBuilderForDescription">
482+
<argument name="attributeCode" value="description"/>
483+
</actionGroup>
482484
<!-- Set background color of row -->
483485
<comment userInput="Set background color of row" stepKey="commentSetRowBackgroundColor"/>
484486
<actionGroup ref="openPageBuilderEditPanel" stepKey="openEditMenuOnStage1">
@@ -490,6 +492,9 @@
490492
<actionGroup ref="saveEditPanelSettingsFullScreen" stepKey="saveEditPanelSettings1"/>
491493
<click selector="{{PageBuilderStage.exitFullScreen}}" stepKey="exitPageBuilderFullScreen1" />
492494
<waitForPageLoad stepKey="waitForPageLoadExitFullScreen1"/>
495+
<!-- Update new text attribute, to be shown in More Information -->
496+
<comment userInput="Update new text attribute, to be shown in More Information" stepKey="commentTextAttribute"/>
497+
<fillField selector="{{PageBuilderProductAttribute.attributeTextInput($$createTextAttribute.attribute_code$$)}}" userInput="{{PageBuilderTextProperty.value}}" stepKey="fillCustomContentTextarea"/>
493498
<!-- Add our related product -->
494499
<comment userInput="Add our related product" stepKey="commentAddRelatedProduct"/>
495500
<actionGroup ref="addRelatedProductBySku" stepKey="addRelatedProduct">
@@ -519,6 +524,7 @@
519524
<seeElement selector="{{StorefrontProductFullWidth.media}}" stepKey="seeMedia" />
520525
<seeElement selector="{{StorefrontProductFullWidth.description}}" stepKey="seeDescription" />
521526
<seeElement selector="{{StorefrontProductFullWidth.attributes}}" stepKey="seeAttributes" />
527+
<seeElement selector="{{StorefrontProductFullWidth.moreInformation}}" stepKey="seeMoreInformation" />
522528
<seeElement selector="{{StorefrontProductFullWidth.reviews}}" stepKey="seeReviews" />
523529
<seeElement selector="{{StorefrontProductFullWidth.related}}" stepKey="seeRelated" />
524530
<seeElement selector="{{StorefrontProductFullWidth.upsell}}" stepKey="seeUpsell" />
@@ -528,6 +534,7 @@
528534
<executeJS function="return document.querySelectorAll('{{StorefrontProductFullWidth.media}}')[0].getBoundingClientRect().y" stepKey="mediaPosition"/>
529535
<executeJS function="return document.querySelectorAll('{{StorefrontProductFullWidth.description}}')[0].getBoundingClientRect().y" stepKey="descriptionPosition"/>
530536
<executeJS function="return document.querySelectorAll('{{StorefrontProductFullWidth.attributes}}')[0].getBoundingClientRect().y" stepKey="attributesPosition"/>
537+
<executeJS function="return document.querySelectorAll('{{StorefrontProductFullWidth.moreInformation}}')[0].getBoundingClientRect().y" stepKey="moreInformationPosition"/>
531538
<executeJS function="return document.querySelectorAll('{{StorefrontProductFullWidth.reviews}}')[0].getBoundingClientRect().y" stepKey="reviewsPosition"/>
532539
<executeJS function="return document.querySelectorAll('{{StorefrontProductFullWidth.related}}')[0].getBoundingClientRect().y" stepKey="relatedPosition"/>
533540
<executeJS function="return document.querySelectorAll('{{StorefrontProductFullWidth.upsell}}')[0].getBoundingClientRect().y" stepKey="upsellPosition"/>
@@ -543,8 +550,12 @@
543550
<expectedResult type="variable">descriptionPosition</expectedResult>
544551
<actualResult type="variable">attributesPosition</actualResult>
545552
</assertGreaterThan>
546-
<assertGreaterThan stepKey="assertReviewsBelowAttributes">
553+
<assertGreaterThan stepKey="assertMoreInformationBelowAttributes">
547554
<expectedResult type="variable">attributesPosition</expectedResult>
555+
<actualResult type="variable">moreInformationPosition</actualResult>
556+
</assertGreaterThan>
557+
<assertGreaterThan stepKey="assertReviewsBelowMoreInformation">
558+
<expectedResult type="variable">moreInformationPosition</expectedResult>
548559
<actualResult type="variable">reviewsPosition</actualResult>
549560
</assertGreaterThan>
550561
<assertGreaterThan stepKey="assertRelatedBelowReviews">

0 commit comments

Comments
 (0)