Skip to content

Commit d8e9bbd

Browse files
committed
MC-5373: Product couldn't be pulled to CMS Page when it was assigned to a specific website
Add ProductFromDifferentWebsiteShowsOnStage
1 parent cf34c53 commit d8e9bbd

File tree

1 file changed

+117
-1
lines changed

1 file changed

+117
-1
lines changed

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

Lines changed: 117 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656
</actionGroup>
5757
<!-- Validate Storefront -->
5858
<comment userInput="Validate Storefront" stepKey="commentValidateStorefront"/>
59-
<grabMultiple selector="{{ProductsOnStage.product('1')}}" stepKey="grabStorefrontProducts"/>
59+
<grabMultiple selector="{{ProductsOnStorefront.product('1')}}" stepKey="grabStorefrontProducts"/>
6060
<assertCount expected="0" expectedType="int" actualType="variable" actual="grabStorefrontProducts" stepKey="assertStorefrontCountIs0" />
6161
</test>
6262
<test name="AdminPageBuilderProductsCanSaveConditionTest">
@@ -1359,4 +1359,120 @@
13591359
<expectedResult type="variable">productActionsWidthFrontend</expectedResult>
13601360
</assertGreaterThan>
13611361
</test>
1362+
<test name="ProductFromDifferentWebsiteShowsOnStage">
1363+
<annotations>
1364+
<features value="PageBuilder"/>
1365+
<stories value="Products"/>
1366+
<title value="Product from Different Website Shows on Stage"/>
1367+
<description value="As a product manager I want to be able to see products from all store views on stage in admin so that I don't get worried that conditions are being applied incorrectly"/>
1368+
<severity value="CRITICAL"/>
1369+
<useCaseId value="MC-5373"/>
1370+
<testCaseId value="MC-6294"/>
1371+
<group value="pagebuilder"/>
1372+
<group value="pagebuilder-products"/>
1373+
<group value="pagebuilder-storeView"/>
1374+
</annotations>
1375+
<before>
1376+
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/>
1377+
<createData entity="customWebsite" stepKey="createCustomWebsite"/>
1378+
<createData entity="SimpleSubCategory" stepKey="createCategory"/>
1379+
<actionGroup ref="AdminStoreGroupCreateActionGroup" stepKey="createNewStore">
1380+
<argument name="Website" value="customWebsite"/>
1381+
<argument name="storeGroup" value="customStoreGroup"/>
1382+
</actionGroup>
1383+
<actionGroup ref="AdminCreateStoreViewActionGroup" stepKey="createCustomStoreView">
1384+
<argument name="StoreGroup" value="customStoreGroup"/>
1385+
<argument name="customStore" value="customStore"/>
1386+
</actionGroup>
1387+
</before>
1388+
<after>
1389+
<actionGroup ref="DeleteCustomWebsiteActionGroup" stepKey="deleteWebsite">
1390+
<argument name="websiteName" value="$createCustomWebsite.website[name]$"/>
1391+
</actionGroup>
1392+
<actionGroup ref="DeleteCategory" stepKey="deleteCategory">
1393+
<argument name="categoryEntity" value="SimpleSubCategory"/>
1394+
</actionGroup>
1395+
<actionGroup ref="deleteProductBySku" stepKey="deleteProduct">
1396+
<argument name="sku" value="{{SimpleProduct.sku}}"/>
1397+
</actionGroup>
1398+
<actionGroup ref="logout" stepKey="logoutOfAdmin"/>
1399+
</after>
1400+
<!-- Create product and assign to store view -->
1401+
<comment userInput="Create product and assign to store view" stepKey="createProductAndAssignToStoreView"/>
1402+
<actionGroup ref="FillAdminSimpleProductForm" stepKey="createProduct">
1403+
<argument name="category" value="SimpleSubCategory"/>
1404+
<argument name="simpleProduct" value="SimpleProduct"/>
1405+
</actionGroup>
1406+
<actionGroup ref="SelectProductInWebsitesActionGroup" stepKey="setWebsite2">
1407+
<argument name="website" value="$createCustomWebsite.website[name]$"/>
1408+
</actionGroup>
1409+
<uncheckOption selector="{{ProductInWebsitesSection.website('Main Website')}}" stepKey="uncheckMainWebsite"/>
1410+
<click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="clickSaveProduct"/>
1411+
<waitForPageLoad stepKey="waitForProductToSave"/>
1412+
<see userInput="You saved the product." stepKey="seeSuccessfulProductSaveMessage"/>
1413+
<!-- Create CMS Page with product -->
1414+
<comment userInput="Create CMS Page with product" stepKey="createCMSPageWithProduct"/>
1415+
<actionGroup ref="navigateToAPageWithPageBuilder" stepKey="navigateToAPageWithPageBuilder"/>
1416+
<actionGroup ref="addPageBuilderPageTitle" stepKey="enterPageTitle">
1417+
<argument name="contentType" value="PageBuilderProductsContentType"/>
1418+
</actionGroup>
1419+
<actionGroup ref="switchToPageBuilderStage" stepKey="switchToPageBuilderStage"/>
1420+
<actionGroup ref="expandPageBuilderPanelGroup" stepKey="expandPageBuilderPanelGroup">
1421+
<argument name="group" value="PageBuilderProductsContentType"/>
1422+
</actionGroup>
1423+
<actionGroup ref="dragContentTypeToStage" stepKey="dragContentTypeToStage">
1424+
<argument name="contentType" value="PageBuilderProductsContentType"/>
1425+
</actionGroup>
1426+
<actionGroup ref="openPageBuilderEditPanel" stepKey="openEditAfterDrop">
1427+
<argument name="contentType" value="PageBuilderProductsContentType"/>
1428+
</actionGroup>
1429+
<actionGroup ref="addCategoryConditionToProductsBlock" stepKey="addCategory">
1430+
<argument name="page" value="ProductsContentTypeForm"/>
1431+
<argument name="category" value="$$createCategory.id$$"/>
1432+
</actionGroup>
1433+
<actionGroup ref="saveEditPanelSettings" stepKey="saveEditPanelSettings"/>
1434+
<!-- Validate Stage -->
1435+
<comment userInput="Validate Stage" stepKey="commentValidateStage"/>
1436+
<actionGroup ref="validateProductCountInProducts" stepKey="validateProductsCountStage1">
1437+
<argument name="page" value="ProductsOnStage"/>
1438+
<argument name="count" value="1"/>
1439+
</actionGroup>
1440+
<actionGroup ref="validateProductInProductsOnStage" stepKey="validateProductsStage">
1441+
<argument name="page" value="ProductsOnStage"/>
1442+
<argument name="product" value="SimpleProduct"/>
1443+
</actionGroup>
1444+
<actionGroup ref="saveAndContinueEditCmsPage" stepKey="saveAndContinueEditCmsPage2"/>
1445+
<actionGroup ref="switchToPageBuilderStage" stepKey="switchToPageBuilderStage2"/>
1446+
<!-- Validate Stage After Save -->
1447+
<comment userInput="Validate Stage After Save" stepKey="commentValidateStageAfterSave"/>
1448+
<actionGroup ref="validateProductCountInProducts" stepKey="validateProductsCountStage2">
1449+
<argument name="page" value="ProductsOnStage"/>
1450+
<argument name="count" value="1"/>
1451+
</actionGroup>
1452+
<actionGroup ref="validateProductInProductsOnStage" stepKey="validateProductsStage2">
1453+
<argument name="page" value="ProductsOnStage"/>
1454+
<argument name="product" value="SimpleProduct"/>
1455+
</actionGroup>
1456+
<!-- Validate Storefront with incorrect store view -->
1457+
<comment userInput="Validate Storefront with incorrect Store View does not show product" stepKey="commentValidateStorefrontWithIncorrectStoreView"/>
1458+
<actionGroup ref="navigateToStoreFront" stepKey="navigateToStoreFront">
1459+
<argument name="contentType" value="PageBuilderProductsContentType"/>
1460+
</actionGroup>
1461+
<grabMultiple selector="{{ProductsOnStorefront.product('1')}}" stepKey="grabStorefrontProducts"/>
1462+
<assertCount stepKey="assertStorefrontCountIs0">
1463+
<expectedResult type="int">0</expectedResult>
1464+
<actualResult type="variable">$grabStorefrontProducts</actualResult>
1465+
</assertCount>
1466+
<!-- Validate Storefront with correct store view -->
1467+
<comment userInput="Validate Storefront with correct Store View shows product" stepKey="commentValidateStorefrontWithCorrectStoreView"/>
1468+
<actionGroup ref="navigateToStoreFrontWithStoreView" stepKey="navigateToStoreFrontWithStoreView">
1469+
<argument name="contentType" value="PageBuilderProductsContentType"/>
1470+
<argument name="storeView" value="customStore"/>
1471+
</actionGroup>
1472+
<grabMultiple selector="{{ProductsOnStorefront.product('1')}}" stepKey="grabStorefrontProducts2"/>
1473+
<assertCount stepKey="assertStorefrontCountIs1">
1474+
<expectedResult type="int">1</expectedResult>
1475+
<actualResult type="variable">$grabStorefrontProducts2</actualResult>
1476+
</assertCount>
1477+
</test>
13621478
</tests>

0 commit comments

Comments
 (0)