Skip to content

Commit 6157833

Browse files
committed
MC-5373: Product couldn't be pulled to CMS Page when it was assigned to a specific website
Move ProductFromDifferentWebsiteInsideBlockShowsOnStage from AdminPageBuilderProductsTest.xml to AdminPageBuilderBlockTest.xml
1 parent 5945cd9 commit 6157833

File tree

2 files changed

+148
-148
lines changed

2 files changed

+148
-148
lines changed

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

Lines changed: 148 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1845,4 +1845,152 @@
18451845
<argument name="containerTargetIndex" value="1"/>
18461846
</actionGroup>
18471847
</test>
1848+
<test name="ProductFromDifferentWebsiteInsideBlockShowsOnStage">
1849+
<annotations>
1850+
<features value="PageBuilder"/>
1851+
<stories value="Products"/>
1852+
<title value="Product from Different Website Shows on Stage"/>
1853+
<description value="As a product manager I want to be able to see products from all store views rendered inside blocks on stage in admin so that I don't get worried that conditions are being applied incorrectly"/>
1854+
<severity value="CRITICAL"/>
1855+
<useCaseId value="MC-5373"/>
1856+
<testCaseId value="MC-11890"/>
1857+
<group value="pagebuilder"/>
1858+
<group value="pagebuilder-products"/>
1859+
<group value="pagebuilder-block"/>
1860+
<group value="pagebuilder-storeView"/>
1861+
</annotations>
1862+
<before>
1863+
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/>
1864+
<createData entity="customWebsite" stepKey="createCustomWebsite"/>
1865+
<createData entity="_defaultBlock" stepKey="createPreReqBlock" />
1866+
<createData entity="SimpleSubCategory" stepKey="createCategory"/>
1867+
<actionGroup ref="AdminStoreGroupCreateActionGroup" stepKey="createNewStore">
1868+
<argument name="Website" value="customWebsite"/>
1869+
<argument name="storeGroup" value="customStoreGroup"/>
1870+
</actionGroup>
1871+
<actionGroup ref="AdminCreateStoreViewActionGroup" stepKey="createCustomStoreView">
1872+
<argument name="StoreGroup" value="customStoreGroup"/>
1873+
<argument name="customStore" value="customStore"/>
1874+
</actionGroup>
1875+
</before>
1876+
<after>
1877+
<actionGroup ref="DeleteCustomWebsiteActionGroup" stepKey="deleteWebsite">
1878+
<argument name="websiteName" value="$createCustomWebsite.website[name]$"/>
1879+
</actionGroup>
1880+
<deleteData createDataKey="createPreReqBlock" stepKey="deletePreReqBlock" />
1881+
<actionGroup ref="DeleteCategory" stepKey="deleteCategory">
1882+
<argument name="categoryEntity" value="SimpleSubCategory"/>
1883+
</actionGroup>
1884+
<actionGroup ref="deleteProductBySku" stepKey="deleteProduct">
1885+
<argument name="sku" value="{{SimpleProduct.sku}}"/>
1886+
</actionGroup>
1887+
<actionGroup ref="logout" stepKey="logoutOfAdmin"/>
1888+
</after>
1889+
<!-- Create product and assign to store view -->
1890+
<comment userInput="Create product and assign to store view" stepKey="commentCreateProductAndAssignToStoreView"/>
1891+
<actionGroup ref="FillAdminSimpleProductForm" stepKey="createProduct">
1892+
<argument name="category" value="SimpleSubCategory"/>
1893+
<argument name="simpleProduct" value="SimpleProduct"/>
1894+
</actionGroup>
1895+
<actionGroup ref="SelectProductInWebsitesActionGroup" stepKey="setWebsite2">
1896+
<argument name="website" value="$createCustomWebsite.website[name]$"/>
1897+
</actionGroup>
1898+
<uncheckOption selector="{{ProductInWebsitesSection.website('Main Website')}}" stepKey="uncheckMainWebsite"/>
1899+
<click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="clickSaveProduct"/>
1900+
<waitForPageLoad stepKey="waitForProductToSave"/>
1901+
<see userInput="You saved the product." stepKey="seeSuccessfulProductSaveMessage"/>
1902+
<!-- Create block with product inside -->
1903+
<comment userInput="Create block with product inside" stepKey="commentCreateBlockWithProductInside"/>
1904+
<actionGroup ref="navigateToCreatedCMSBlockPage" stepKey="navigateToCreatedCMSBlockPage">
1905+
<argument name="CMSBlockPage" value="$$createPreReqBlock$$"/>
1906+
</actionGroup>
1907+
<selectOption selector="{{BlockNewPageBasicFieldsSection.storeView}}" userInput="All Store Views" stepKey="assignAllStoreViewsToBlock" />
1908+
<actionGroup ref="expandPageBuilderPanelGroup" stepKey="expandPageBuilderPanelGroup">
1909+
<argument name="group" value="PageBuilderProductsContentType"/>
1910+
</actionGroup>
1911+
<actionGroup ref="dragContentTypeToStage" stepKey="dragContentTypeToStage">
1912+
<argument name="contentType" value="PageBuilderProductsContentType"/>
1913+
</actionGroup>
1914+
<actionGroup ref="openPageBuilderEditPanel" stepKey="openEditAfterDrop">
1915+
<argument name="contentType" value="PageBuilderProductsContentType"/>
1916+
</actionGroup>
1917+
<actionGroup ref="addCategoryConditionToProductsBlock" stepKey="addCategory">
1918+
<argument name="page" value="ProductsContentTypeForm"/>
1919+
<argument name="category" value="$$createCategory.id$$"/>
1920+
</actionGroup>
1921+
<actionGroup ref="saveEditPanelSettings" stepKey="saveEditPanelSettings"/>
1922+
<actionGroup ref="validateProductCountInProducts" stepKey="validateProductsCountStage">
1923+
<argument name="page" value="ProductsOnStage"/>
1924+
<argument name="count" value="1"/>
1925+
</actionGroup>
1926+
<actionGroup ref="validateProductInProductsOnStage" stepKey="validateProductsStage">
1927+
<argument name="page" value="ProductsOnStage"/>
1928+
<argument name="product" value="SimpleProduct"/>
1929+
</actionGroup>
1930+
<click selector="{{BlockNewPagePageActionsSection.expandSplitButton}}" stepKey="expandSplitButton"/>
1931+
<click selector="{{BlockNewPagePageActionsSection.saveAndClose}}" stepKey="clickSaveBlock"/>
1932+
<!-- Add block with product inside to CMS Page -->
1933+
<comment userInput="Add block with product inside to CMS Page" stepKey="commentAddBlockWithProductInsideToCmsPage"/>
1934+
<actionGroup ref="navigateToAPageWithPageBuilder" stepKey="navigateToAPageWithPageBuilder"/>
1935+
<actionGroup ref="addPageBuilderPageTitle" stepKey="enterPageTitle">
1936+
<argument name="contentType" value="PageBuilderProductsContentType"/>
1937+
</actionGroup>
1938+
<actionGroup ref="switchToPageBuilderStage" stepKey="switchToPageBuilderStage" />
1939+
<actionGroup ref="expandPageBuilderPanelGroup" stepKey="expandPageBuilderPanelGroup2">
1940+
<argument name="group" value="PageBuilderBlockContentType"/>
1941+
</actionGroup>
1942+
<actionGroup ref="dragContentTypeToStage" stepKey="dragBlockContentTypeToStage">
1943+
<argument name="contentType" value="PageBuilderBlockContentType"/>
1944+
</actionGroup>
1945+
<actionGroup ref="openPageBuilderEditPanel" stepKey="openEditAfterDrop2">
1946+
<argument name="contentType" value="PageBuilderBlockContentType"/>
1947+
</actionGroup>
1948+
<actionGroup ref="searchBlockInGrid" stepKey="searchBlockInGrid">
1949+
<argument name="block" value="$$createPreReqBlock$$"/>
1950+
</actionGroup>
1951+
<actionGroup ref="saveEditPanelSettings" stepKey="saveEditPanelSettings2"/>
1952+
<!-- Validate Stage -->
1953+
<comment userInput="Validate Stage" stepKey="commentValidateStage"/>
1954+
<actionGroup ref="validateProductCountInProducts" stepKey="validateProductsCountStage2">
1955+
<argument name="page" value="ProductsOnStorefront"/>
1956+
<argument name="count" value="1"/>
1957+
</actionGroup>
1958+
<actionGroup ref="validateProductInProductsOnStage" stepKey="validateProductsStage2">
1959+
<argument name="page" value="ProductsOnStorefront"/>
1960+
<argument name="product" value="SimpleProduct"/>
1961+
</actionGroup>
1962+
<actionGroup ref="saveAndContinueEditCmsPage" stepKey="saveAndContinueEditCmsPage2"/>
1963+
<actionGroup ref="switchToPageBuilderStage" stepKey="switchToPageBuilderStage2"/>
1964+
<!-- Validate Stage After Save -->
1965+
<comment userInput="Validate Stage After Save" stepKey="commentValidateStageAfterSave"/>
1966+
<actionGroup ref="validateProductCountInProducts" stepKey="validateProductsCountStage3">
1967+
<argument name="page" value="ProductsOnStorefront"/>
1968+
<argument name="count" value="1"/>
1969+
</actionGroup>
1970+
<actionGroup ref="validateProductInProductsOnStage" stepKey="validateProductsStage3">
1971+
<argument name="page" value="ProductsOnStorefront"/>
1972+
<argument name="product" value="SimpleProduct"/>
1973+
</actionGroup>
1974+
<!-- Validate Storefront with incorrect store view -->
1975+
<comment userInput="Validate Storefront with incorrect Store View does not show product" stepKey="commentValidateStorefrontWithIncorrectStoreView"/>
1976+
<actionGroup ref="navigateToStoreFront" stepKey="navigateToStoreFront">
1977+
<argument name="contentType" value="PageBuilderProductsContentType"/>
1978+
</actionGroup>
1979+
<grabMultiple selector="{{ProductsOnStorefront.product('1')}}" stepKey="grabStorefrontProducts"/>
1980+
<assertCount stepKey="assertStorefrontCountIs0">
1981+
<expectedResult type="int">0</expectedResult>
1982+
<actualResult type="variable">$grabStorefrontProducts</actualResult>
1983+
</assertCount>
1984+
<!-- Validate Storefront with correct store view -->
1985+
<comment userInput="Validate Storefront with correct Store View shows product" stepKey="commentValidateStorefrontWithCorrectStoreView"/>
1986+
<actionGroup ref="navigateToStoreFrontWithStoreView" stepKey="navigateToStoreFrontWithStoreView">
1987+
<argument name="contentType" value="PageBuilderProductsContentType"/>
1988+
<argument name="storeView" value="customStore"/>
1989+
</actionGroup>
1990+
<grabMultiple selector="{{ProductsOnStorefront.product('1')}}" stepKey="grabStorefrontProducts2"/>
1991+
<assertCount stepKey="assertStorefrontCountIs1">
1992+
<expectedResult type="int">1</expectedResult>
1993+
<actualResult type="variable">$grabStorefrontProducts2</actualResult>
1994+
</assertCount>
1995+
</test>
18481996
</tests>

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

Lines changed: 0 additions & 148 deletions
Original file line numberDiff line numberDiff line change
@@ -1359,154 +1359,6 @@
13591359
<expectedResult type="variable">productActionsWidthFrontend</expectedResult>
13601360
</assertGreaterThan>
13611361
</test>
1362-
<test name="ProductFromDifferentWebsiteInsideBlockShowsOnStage">
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 rendered inside blocks 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-11890"/>
1371-
<group value="pagebuilder"/>
1372-
<group value="pagebuilder-products"/>
1373-
<group value="pagebuilder-block"/>
1374-
<group value="pagebuilder-storeView"/>
1375-
</annotations>
1376-
<before>
1377-
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/>
1378-
<createData entity="customWebsite" stepKey="createCustomWebsite"/>
1379-
<createData entity="_defaultBlock" stepKey="createPreReqBlock" />
1380-
<createData entity="SimpleSubCategory" stepKey="createCategory"/>
1381-
<actionGroup ref="AdminStoreGroupCreateActionGroup" stepKey="createNewStore">
1382-
<argument name="Website" value="customWebsite"/>
1383-
<argument name="storeGroup" value="customStoreGroup"/>
1384-
</actionGroup>
1385-
<actionGroup ref="AdminCreateStoreViewActionGroup" stepKey="createCustomStoreView">
1386-
<argument name="StoreGroup" value="customStoreGroup"/>
1387-
<argument name="customStore" value="customStore"/>
1388-
</actionGroup>
1389-
</before>
1390-
<after>
1391-
<actionGroup ref="DeleteCustomWebsiteActionGroup" stepKey="deleteWebsite">
1392-
<argument name="websiteName" value="$createCustomWebsite.website[name]$"/>
1393-
</actionGroup>
1394-
<deleteData createDataKey="createPreReqBlock" stepKey="deletePreReqBlock" />
1395-
<actionGroup ref="DeleteCategory" stepKey="deleteCategory">
1396-
<argument name="categoryEntity" value="SimpleSubCategory"/>
1397-
</actionGroup>
1398-
<actionGroup ref="deleteProductBySku" stepKey="deleteProduct">
1399-
<argument name="sku" value="{{SimpleProduct.sku}}"/>
1400-
</actionGroup>
1401-
<actionGroup ref="logout" stepKey="logoutOfAdmin"/>
1402-
</after>
1403-
<!-- Create product and assign to store view -->
1404-
<comment userInput="Create product and assign to store view" stepKey="commentCreateProductAndAssignToStoreView"/>
1405-
<actionGroup ref="FillAdminSimpleProductForm" stepKey="createProduct">
1406-
<argument name="category" value="SimpleSubCategory"/>
1407-
<argument name="simpleProduct" value="SimpleProduct"/>
1408-
</actionGroup>
1409-
<actionGroup ref="SelectProductInWebsitesActionGroup" stepKey="setWebsite2">
1410-
<argument name="website" value="$createCustomWebsite.website[name]$"/>
1411-
</actionGroup>
1412-
<uncheckOption selector="{{ProductInWebsitesSection.website('Main Website')}}" stepKey="uncheckMainWebsite"/>
1413-
<click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="clickSaveProduct"/>
1414-
<waitForPageLoad stepKey="waitForProductToSave"/>
1415-
<see userInput="You saved the product." stepKey="seeSuccessfulProductSaveMessage"/>
1416-
<!-- Create block with product inside -->
1417-
<comment userInput="Create block with product inside" stepKey="commentCreateBlockWithProductInside"/>
1418-
<actionGroup ref="navigateToCreatedCMSBlockPage" stepKey="navigateToCreatedCMSBlockPage">
1419-
<argument name="CMSBlockPage" value="$$createPreReqBlock$$"/>
1420-
</actionGroup>
1421-
<selectOption selector="{{BlockNewPageBasicFieldsSection.storeView}}" userInput="All Store Views" stepKey="assignAllStoreViewsToBlock" />
1422-
<actionGroup ref="expandPageBuilderPanelGroup" stepKey="expandPageBuilderPanelGroup">
1423-
<argument name="group" value="PageBuilderProductsContentType"/>
1424-
</actionGroup>
1425-
<actionGroup ref="dragContentTypeToStage" stepKey="dragContentTypeToStage">
1426-
<argument name="contentType" value="PageBuilderProductsContentType"/>
1427-
</actionGroup>
1428-
<actionGroup ref="openPageBuilderEditPanel" stepKey="openEditAfterDrop">
1429-
<argument name="contentType" value="PageBuilderProductsContentType"/>
1430-
</actionGroup>
1431-
<actionGroup ref="addCategoryConditionToProductsBlock" stepKey="addCategory">
1432-
<argument name="page" value="ProductsContentTypeForm"/>
1433-
<argument name="category" value="$$createCategory.id$$"/>
1434-
</actionGroup>
1435-
<actionGroup ref="saveEditPanelSettings" stepKey="saveEditPanelSettings"/>
1436-
<actionGroup ref="validateProductCountInProducts" stepKey="validateProductsCountStage">
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-
<click selector="{{BlockNewPagePageActionsSection.expandSplitButton}}" stepKey="expandSplitButton"/>
1445-
<click selector="{{BlockNewPagePageActionsSection.saveAndClose}}" stepKey="clickSaveBlock"/>
1446-
<!-- Add block with product inside to CMS Page -->
1447-
<comment userInput="Add block with product inside to CMS Page" stepKey="commentAddBlockWithProductInsideToCmsPage"/>
1448-
<actionGroup ref="navigateToAPageWithPageBuilder" stepKey="navigateToAPageWithPageBuilder"/>
1449-
<actionGroup ref="addPageBuilderPageTitle" stepKey="enterPageTitle">
1450-
<argument name="contentType" value="PageBuilderProductsContentType"/>
1451-
</actionGroup>
1452-
<actionGroup ref="switchToPageBuilderStage" stepKey="switchToPageBuilderStage" />
1453-
<actionGroup ref="expandPageBuilderPanelGroup" stepKey="expandPageBuilderPanelGroup2">
1454-
<argument name="group" value="PageBuilderBlockContentType"/>
1455-
</actionGroup>
1456-
<actionGroup ref="dragContentTypeToStage" stepKey="dragBlockContentTypeToStage">
1457-
<argument name="contentType" value="PageBuilderBlockContentType"/>
1458-
</actionGroup>
1459-
<actionGroup ref="openPageBuilderEditPanel" stepKey="openEditAfterDrop2">
1460-
<argument name="contentType" value="PageBuilderBlockContentType"/>
1461-
</actionGroup>
1462-
<actionGroup ref="searchBlockInGrid" stepKey="searchBlockInGrid">
1463-
<argument name="block" value="$$createPreReqBlock$$"/>
1464-
</actionGroup>
1465-
<actionGroup ref="saveEditPanelSettings" stepKey="saveEditPanelSettings2"/>
1466-
<!-- Validate Stage -->
1467-
<comment userInput="Validate Stage" stepKey="commentValidateStage"/>
1468-
<actionGroup ref="validateProductCountInProducts" stepKey="validateProductsCountStage2">
1469-
<argument name="page" value="ProductsOnStorefront"/>
1470-
<argument name="count" value="1"/>
1471-
</actionGroup>
1472-
<actionGroup ref="validateProductInProductsOnStage" stepKey="validateProductsStage2">
1473-
<argument name="page" value="ProductsOnStorefront"/>
1474-
<argument name="product" value="SimpleProduct"/>
1475-
</actionGroup>
1476-
<actionGroup ref="saveAndContinueEditCmsPage" stepKey="saveAndContinueEditCmsPage2"/>
1477-
<actionGroup ref="switchToPageBuilderStage" stepKey="switchToPageBuilderStage2"/>
1478-
<!-- Validate Stage After Save -->
1479-
<comment userInput="Validate Stage After Save" stepKey="commentValidateStageAfterSave"/>
1480-
<actionGroup ref="validateProductCountInProducts" stepKey="validateProductsCountStage3">
1481-
<argument name="page" value="ProductsOnStorefront"/>
1482-
<argument name="count" value="1"/>
1483-
</actionGroup>
1484-
<actionGroup ref="validateProductInProductsOnStage" stepKey="validateProductsStage3">
1485-
<argument name="page" value="ProductsOnStorefront"/>
1486-
<argument name="product" value="SimpleProduct"/>
1487-
</actionGroup>
1488-
<!-- Validate Storefront with incorrect store view -->
1489-
<comment userInput="Validate Storefront with incorrect Store View does not show product" stepKey="commentValidateStorefrontWithIncorrectStoreView"/>
1490-
<actionGroup ref="navigateToStoreFront" stepKey="navigateToStoreFront">
1491-
<argument name="contentType" value="PageBuilderProductsContentType"/>
1492-
</actionGroup>
1493-
<grabMultiple selector="{{ProductsOnStorefront.product('1')}}" stepKey="grabStorefrontProducts"/>
1494-
<assertCount stepKey="assertStorefrontCountIs0">
1495-
<expectedResult type="int">0</expectedResult>
1496-
<actualResult type="variable">$grabStorefrontProducts</actualResult>
1497-
</assertCount>
1498-
<!-- Validate Storefront with correct store view -->
1499-
<comment userInput="Validate Storefront with correct Store View shows product" stepKey="commentValidateStorefrontWithCorrectStoreView"/>
1500-
<actionGroup ref="navigateToStoreFrontWithStoreView" stepKey="navigateToStoreFrontWithStoreView">
1501-
<argument name="contentType" value="PageBuilderProductsContentType"/>
1502-
<argument name="storeView" value="customStore"/>
1503-
</actionGroup>
1504-
<grabMultiple selector="{{ProductsOnStorefront.product('1')}}" stepKey="grabStorefrontProducts2"/>
1505-
<assertCount stepKey="assertStorefrontCountIs1">
1506-
<expectedResult type="int">1</expectedResult>
1507-
<actualResult type="variable">$grabStorefrontProducts2</actualResult>
1508-
</assertCount>
1509-
</test>
15101362
<test name="ProductFromDifferentWebsiteShowsOnStage">
15111363
<annotations>
15121364
<features value="PageBuilder"/>

0 commit comments

Comments
 (0)