Skip to content

Commit 0a0ebd3

Browse files
committed
MC-15297: Selecting "Conditions Combination" For Product List Condition Will Throw 500 Error & Redirect User To Broken Page
Add part of ProductCombinedConditionRuleWorksProperly
1 parent f5cadb6 commit 0a0ebd3

File tree

2 files changed

+104
-0
lines changed

2 files changed

+104
-0
lines changed

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

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,4 +87,18 @@
8787
<click selector="{{page.conditionsListConditionPlaceholder}}" stepKey="revealCategoryInput"/>
8888
<fillField selector="{{page.conditionsListConditionInput}}" userInput="{{category}}" stepKey="fillCategoryField"/>
8989
</actionGroup>
90+
<actionGroup name="addCategoryConditionViaConditionsCombinationToProducts">
91+
<arguments>
92+
<argument name="page" defaultValue="ProductsContentTypeForm"/>
93+
<argument name="category" defaultValue="" type="string"/>
94+
<argument name="aggregatorType" defaultValue="ALL" type="string"/>
95+
<argument name="booleanValueForAggregator" defaultValue="TRUE" type="string"/>
96+
</arguments>
97+
<waitForElementVisible selector="{{page.conditionsList}}" stepKey="waitForConditionsToLoad"/>
98+
<click selector="{{page.conditionsListAddButton}}" stepKey="addCondition"/>
99+
<selectOption selector="{{page.conditionsListAddTypeSelect}}" userInput="Magento\CatalogWidget\Model\Rule\Condition\Combine" stepKey="selectCombineOption"/>
100+
<waitForLoadingMaskToDisappear stepKey="waitForConditionsCombinationTemplateToLoad"/>
101+
<click selector="{{page.conditionsListConditionPlaceholder}}" stepKey="revealCategoryInput"/>
102+
<fillField selector="{{page.conditionsListConditionInput}}" userInput="{{category}}" stepKey="fillCategoryField"/>
103+
</actionGroup>
90104
</actionGroups>

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

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1526,4 +1526,94 @@
15261526
</actionGroup>
15271527
<dontSeeJsError stepKey="doNotSeeAnyJSErrorsOnStorefront"/>
15281528
</test>
1529+
<test name="ProductCombinedConditionRuleWorksProperly">
1530+
<annotations>
1531+
<features value="PageBuilder"/>
1532+
<stories value="Products"/>
1533+
<title value="Product Content Type combined condition rule works properly"/>
1534+
<description value="As a Content Manager I want Product Content Type's combined condition rule to function properly so that it does not raise 500 server error and redirect on failure on admin and storefront"/>
1535+
<severity value="CRITICAL"/>
1536+
<useCaseId value="MC-15297"/>
1537+
<testCaseId value="MC-15312"/>
1538+
<group value="pagebuilder"/>
1539+
<group value="pagebuilder-products"/>
1540+
</annotations>
1541+
<before>
1542+
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/>
1543+
<createData entity="SimpleSubCategory" stepKey="createCategory"/>
1544+
</before>
1545+
<after>
1546+
<actionGroup ref="DeleteCategory" stepKey="deleteCategory">
1547+
<argument name="categoryEntity" value="SimpleSubCategory"/>
1548+
</actionGroup>
1549+
<actionGroup ref="deleteProductBySku" stepKey="deleteProduct">
1550+
<argument name="sku" value="{{SimpleProduct.sku}}"/>
1551+
</actionGroup>
1552+
<actionGroup ref="logout" stepKey="logoutOfAdmin"/>
1553+
</after>
1554+
<actionGroup ref="FillAdminSimpleProductForm" stepKey="createProduct">
1555+
<argument name="category" value="SimpleSubCategory"/>
1556+
<argument name="simpleProduct" value="SimpleProduct"/>
1557+
</actionGroup>
1558+
<click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="clickSaveProduct"/>
1559+
<waitForPageLoad stepKey="waitForProductToSave"/>
1560+
<see userInput="You saved the product." stepKey="seeSuccessfulProductSaveMessage"/>
1561+
<!-- Create CMS Page with product content types -->
1562+
<comment userInput="Create CMS Page with product content types" stepKey="createCMSPageWithProduct"/>
1563+
<actionGroup ref="navigateToAPageWithPageBuilder" stepKey="navigateToAPageWithPageBuilder"/>
1564+
<actionGroup ref="addPageBuilderPageTitle" stepKey="enterPageTitle">
1565+
<argument name="contentType" value="PageBuilderProductsContentType"/>
1566+
</actionGroup>
1567+
<actionGroup ref="switchToPageBuilderStage" stepKey="switchToPageBuilderStage"/>
1568+
<actionGroup ref="expandPageBuilderPanelMenuSection" stepKey="expandPageBuilderPanelGroup">
1569+
<argument name="contentType" value="PageBuilderProductsContentType"/>
1570+
</actionGroup>
1571+
<actionGroup ref="dragContentTypeToStage" stepKey="dragContentTypeToStage">
1572+
<argument name="contentType" value="PageBuilderProductsContentType"/>
1573+
</actionGroup>
1574+
<actionGroup ref="openPageBuilderEditPanel" stepKey="openEditAfterDrop">
1575+
<argument name="contentType" value="PageBuilderProductsContentType"/>
1576+
</actionGroup>
1577+
1578+
<actionGroup ref="addCategoryConditionViaConditionsCombinationToProducts" stepKey="addCategoryWrappedInConditionalCombineWithTrueValue">
1579+
<argument name="page" value="ProductsContentTypeForm"/>
1580+
<argument name="category" value="$$createCategory.id$$"/>
1581+
</actionGroup>
1582+
1583+
<actionGroup ref="saveEditPanelSettings" stepKey="saveEditPanelSettings"/>
1584+
1585+
<!-- Validate Stage -->
1586+
<comment userInput="Validate Stage" stepKey="commentValidateStage"/>
1587+
<actionGroup ref="validateProductCountInProducts" stepKey="validateProductsCountStage1">
1588+
<argument name="page" value="ProductsOnStage"/>
1589+
<argument name="count" value="1"/>
1590+
</actionGroup>
1591+
<actionGroup ref="saveAndContinueEditCmsPage" stepKey="saveAndContinueEditCmsPage2"/>
1592+
<actionGroup ref="switchToPageBuilderStage" stepKey="switchToPageBuilderStage2"/>
1593+
1594+
<actionGroup ref="expandPageBuilderPanelMenuSection" stepKey="expandPageBuilderPanelGroup2">
1595+
<argument name="contentType" value="PageBuilderProductsContentType"/>
1596+
</actionGroup>
1597+
<actionGroup ref="dragContentTypeToStage" stepKey="dragContentTypeToStage2">
1598+
<argument name="contentType" value="PageBuilderProductsContentType"/>
1599+
</actionGroup>
1600+
<actionGroup ref="openPageBuilderEditPanel" stepKey="openEditAfterDrop2">
1601+
<argument name="contentType" value="PageBuilderProductsContentType"/>
1602+
</actionGroup>
1603+
1604+
<actionGroup ref="addCategoryConditionViaConditionsCombinationToProducts" stepKey="addCategoryWrappedInConditionalCombineWithFalseValue">
1605+
<argument name="page" value="ProductsContentTypeForm"/>
1606+
<argument name="category" value="$$createCategory.id$$"/>
1607+
<argument name="aggregatorType" value="ALL"/>
1608+
<argument name="booleanValueForAggregator" value="FALSE"/>
1609+
</actionGroup>
1610+
1611+
<actionGroup ref="saveEditPanelSettings" stepKey="saveEditPanelSettings2"/>
1612+
<!-- Validate Stage -->
1613+
<comment userInput="Validate Stage" stepKey="commentValidateStage"/>
1614+
<actionGroup ref="validateProductCountInProducts" stepKey="validateProductsCountStage1">
1615+
<argument name="page" value="ProductsOnStage"/>
1616+
<argument name="count" value="1"/>
1617+
</actionGroup>
1618+
</test>
15291619
</tests>

0 commit comments

Comments
 (0)