Skip to content

Commit 14dfb9a

Browse files
author
Hanna Hnida
committed
Merge branch '557_user-access-row-action-panel' of hannahnida/magento2-page-builder into 557_user-access-row-action-panel
2 parents 416f833 + 82c8a13 commit 14dfb9a

File tree

5 files changed

+133
-5
lines changed

5 files changed

+133
-5
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
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+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
9+
<actionGroup name="VerifyAffordanceSizeActionGroup">
10+
<annotations>
11+
<description>Verifies the size of the affordance on Container content types.</description>
12+
</annotations>
13+
<arguments>
14+
<argument name="affordanceSize" defaultValue="{{PageBuilderRowAffordanceWidth.borderWidth}}" type="string"/>
15+
<argument name="index" defaultValue="1" type="string"/>
16+
<argument name="section" defaultValue="RowOnStage"/>
17+
</arguments>
18+
<waitForElementVisible selector="{{section.affordance(index)}}" stepKey="waitForElementVisible"/>
19+
<executeJS function="return parseInt(window.getComputedStyle({{section.affordanceJS(index)}}).borderWidth, 10)" stepKey="executeJS"/>
20+
<assertEquals stepKey="assertEquals">
21+
<expectedResult type="int">{{affordanceSize}}</expectedResult>
22+
<actualResult type="variable">executeJS</actualResult>
23+
</assertEquals>
24+
</actionGroup>
25+
</actionGroups>

app/code/Magento/PageBuilder/Test/Mftf/Data/RowData.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
<data key="value">300</data>
1111
</entity>
1212
<entity name="PageBuilderRowAffordanceWidth" type="pagebuilder_row">
13+
<data key="borderWidth">15</data>
1314
<data key="bottom">15</data>
1415
<data key="left">15</data>
1516
<data key="right">15</data>

app/code/Magento/PageBuilder/Test/Mftf/Section/PageBuilderRowSection/RowOnStageSection.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@
55
* See COPYING.txt for license details.
66
*/
77
-->
8-
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
9-
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
8+
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
109
<section name="RowOnStage">
1110
<element name="allRows" type="text" selector="//div[contains(@class,'pagebuilder-content-type') and contains(@class,'pagebuilder-row')]"/>
1211
<element name="base" type="text" selector="(//div[contains(@class,&quot;pagebuilder-content-type&quot;) and contains(@class,&quot;pagebuilder-row&quot;)])[{{arg1}}]" parameterized="true"/>
@@ -18,7 +17,8 @@
1817
<element name="empty" type="button" selector="(//div[contains(@class,'pagebuilder-content-type') and contains(@class,'pagebuilder-row')])[{{arg1}}][contains(@class,'empty-container')]//div[contains(@class,'element-children') and contains(@class,'row-container')]" parameterized="true"/>
1918
<element name="emptyPlaceholder" type="button" selector="(//div[contains(@class,'pagebuilder-content-type') and contains(@class,'pagebuilder-row')])[{{arg1}}][contains(@class,'empty-container')]//div[contains(@class,'empty-placeholder')]" parameterized="true"/>
2019
<element name="affordance" type="text" selector="(//div[contains(@class,&quot;pagebuilder-affordance-row&quot;) and contains(@class,&quot;pagebuilder-content-type&quot;)])[{{arg1}}]" parameterized="true"/>
21-
<element name="affordanceCSS" type="text" selector="div.pagebuilder-content-type-affordance.pagebuilder-affordance-row"/>
20+
<element name="affordanceCSS" type="text" selector="div.pagebuilder-affordance-row.pagebuilder-content-type"/>
21+
<element name="affordanceJS" type="text" selector="document.querySelectorAll('div.pagebuilder-affordance-row.pagebuilder-content-type')[{{arg1}} - 1]" parameterized="true"/>
2222
<element name="displayLabel" type="text" selector="(//div[contains(@class,'pagebuilder-affordance-row') and contains(@class,'pagebuilder-content-type')])[{{arg1}}]//div[contains(@class,'pagebuilder-display-label')]" parameterized="true"/>
2323
<element name="rowChildrenStyle" type="text" selector="(//div[contains(@class, 'pagebuilder-row')])[{{arg1}}]//div[contains(@class, 'element-children') and contains(@class, 'row-container')][contains(@style, '{{arg2}}')]" parameterized="true" deprecated="Styles are not inline"/>
2424
<element name="rowChildrenPath" type="text" selector="(//div[contains(@class, &quot;pagebuilder-row&quot;)])[{{arg1}}]//div[contains(@class, &quot;element-children&quot;) and contains(@class, &quot;row-container&quot;)]" parameterized="true"/>

app/code/Magento/PageBuilder/Test/Mftf/Section/PageBuilderRowSection/RowOnStorefrontSection.xml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,14 @@
55
* See COPYING.txt for license details.
66
*/
77
-->
8-
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
9-
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
8+
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
109
<section name="RowOnStorefront">
1110
<element name="allRows" type="text" selector="div[data-content-type='row']"/>
1211
<element name="base" type="text" selector="(//div[@data-content-type=&quot;row&quot;])[{{arg1}}]/div" parameterized="true"/>
1312
<element name="baseCSS" type="text" selector="[data-content-type=row]"/>
1413
<element name="baseJS" type="text" selector="(document.querySelectorAll('[data-content-type=row]')[{{arg1}} - 1]).querySelector('div')" parameterized="true"/>
14+
<element name="affordance" type="text" selector="(//div[contains(@class,'pagebuilder-affordance-row') and contains(@class,'pagebuilder-content-type')])[{{arg1}}]" parameterized="true"/>
15+
<element name="affordanceCSS" type="text" selector="div.pagebuilder-affordance-row.pagebuilder-content-type"/>
1516
<element name="elementChildren" type="text" selector="(//div[@data-content-type=&quot;row&quot;])[{{arg1}}]/div" parameterized="true"/>
1617
<element name="innerCSS" type="text" selector="[data-content-type=row] [data-element=inner]"/>
1718
<element name="inner" type="text" selector="(//div[@data-content-type=&quot;row&quot;])[{{arg1}}]//div[@data-element=&quot;inner&quot;]" parameterized="true"/>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
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+
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
9+
<test name="PageBuilderVerifyContainerAffordanceTest">
10+
<annotations>
11+
<features value="PageBuilder"/>
12+
<stories value="Affordance"/>
13+
<title value="Verify Container Content Types' Affordance"/>
14+
<description value="Verify that the Container content types have the correct size affordance in admin. Verify that the affordance is not present in admin when rendering Container content types through a Block, or when rendering the Container content types on the storefront."/>
15+
<severity value="MAJOR"/>
16+
<group value="pagebuilder"/>
17+
<group value="pagebuilder-affordance"/>
18+
<group value="pagebuilder-block"/>
19+
</annotations>
20+
<before>
21+
<createData entity="_emptyCmsBlock" stepKey="createCMSBlock"/>
22+
<createData entity="_emptyCmsPage" stepKey="createCMSPage"/>
23+
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>
24+
<actionGroup ref="NavigateToCreatedCMSBlockPageActionGroup" stepKey="navigateToCreatedCMSBlockPage">
25+
<argument name="CMSBlockPage" value="$$createCMSBlock$$"/>
26+
</actionGroup>
27+
<actionGroup ref="switchToPageBuilderStage" stepKey="switchToPageBuilderStage"/>
28+
</before>
29+
<after>
30+
<deleteData createDataKey="createCMSBlock" stepKey="deleteCMSBlock"/>
31+
<deleteData createDataKey="createCMSPage" stepKey="deleteCMSPage"/>
32+
<actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/>
33+
</after>
34+
<actionGroup ref="expandPageBuilderPanelMenuSection" stepKey="expandPageBuilderPanelMenuSection">
35+
<argument name="contentType" value="PageBuilderColumnContentType"/>
36+
</actionGroup>
37+
<actionGroup ref="dragContentTypeToStage" stepKey="dragColumnToStage">
38+
<argument name="contentType" value="PageBuilderColumnContentType"/>
39+
</actionGroup>
40+
<actionGroup ref="duplicateContentType" stepKey="duplicateContentType">
41+
<argument name="contentType" value="PageBuilderRowContentType"/>
42+
</actionGroup>
43+
<actionGroup ref="duplicateContentType" stepKey="duplicateContentType2">
44+
<argument name="contentType" value="PageBuilderRowContentType"/>
45+
</actionGroup>
46+
<actionGroup ref="openPageBuilderEditPanelByIndex" stepKey="openEditMenuOnStage">
47+
<argument name="contentType" value="PageBuilderRowContentType"/>
48+
<argument name="contentTypeIndex" value="2"/>
49+
</actionGroup>
50+
<actionGroup ref="chooseVisualSelectOption" stepKey="enterAppearance">
51+
<argument name="property" value="PageBuilderRowAppearance_FullWidth"/>
52+
</actionGroup>
53+
<actionGroup ref="saveEditPanelSettings" stepKey="saveEditPanelSettings"/>
54+
<actionGroup ref="openPageBuilderEditPanelByIndex" stepKey="openEditMenuOnStage2">
55+
<argument name="contentType" value="PageBuilderRowContentType"/>
56+
<argument name="contentTypeIndex" value="3"/>
57+
</actionGroup>
58+
<actionGroup ref="chooseVisualSelectOption" stepKey="enterAppearance2">
59+
<argument name="property" value="PageBuilderRowAppearance_FullBleed"/>
60+
</actionGroup>
61+
<actionGroup ref="saveEditPanelSettings" stepKey="saveEditPanelSettings2"/>
62+
<!-- Validate Stage for CMS Block -->
63+
<actionGroup ref="VerifyAffordanceSizeActionGroup" stepKey="verifyAffordanceSizeActionGroup"/>
64+
<actionGroup ref="VerifyAffordanceSizeActionGroup" stepKey="verifyAffordanceSizeActionGroup2">
65+
<argument name="index" value="2"/>
66+
</actionGroup>
67+
<actionGroup ref="VerifyAffordanceSizeActionGroup" stepKey="verifyAffordanceSizeActionGroup3">
68+
<argument name="index" value="3"/>
69+
</actionGroup>
70+
<seeNumberOfElements selector="{{RowOnStage.affordanceCSS}}" userInput="3" stepKey="seeNumberOfAffordance"/>
71+
<actionGroup ref="exitPageBuilderFullScreen" stepKey="exitPageBuilderFullScreen"/>
72+
<actionGroup ref="SaveCMSBlockActionGroup" stepKey="saveCMSBlock"/>
73+
<actionGroup ref="NavigateToCreatedCMSPageActionGroup" stepKey="navigateToCreatedCMSPage">
74+
<argument name="CMSPage" value="$$createCMSPage$$"/>
75+
</actionGroup>
76+
<actionGroup ref="switchToPageBuilderStage" stepKey="switchToPageBuilderStage"/>
77+
<actionGroup ref="expandPageBuilderPanelMenuSection" stepKey="expandPageBuilderPanelMenuSection2">
78+
<argument name="contentType" value="PageBuilderBlockContentType"/>
79+
</actionGroup>
80+
<actionGroup ref="dragContentTypeToStage" stepKey="dragBlockToStage">
81+
<argument name="contentType" value="PageBuilderBlockContentType"/>
82+
</actionGroup>
83+
<actionGroup ref="openPageBuilderEditPanel" stepKey="openPageBuilderEditPanel">
84+
<argument name="contentType" value="PageBuilderBlockContentType"/>
85+
</actionGroup>
86+
<actionGroup ref="searchBlockInGrid" stepKey="searchBlockInGrid">
87+
<argument name="block" value="$$createCMSBlock$$"/>
88+
</actionGroup>
89+
<actionGroup ref="saveEditPanelSettings" stepKey="saveEditPanelSettings3"/>
90+
<!-- Validate Stage for CMS Page -->
91+
<actionGroup ref="VerifyAffordanceSizeActionGroup" stepKey="verifyAffordanceSizeActionGroup4"/>
92+
<seeNumberOfElements selector="{{RowOnStage.affordanceCSS}}" userInput="1" stepKey="seeNumberOfAffordance2"/>
93+
<actionGroup ref="exitPageBuilderFullScreen" stepKey="exitPageBuilderFullScreen2"/>
94+
<actionGroup ref="SaveAndContinueEditCmsPageActionGroup" stepKey="saveAndContinueEditCmsPage"/>
95+
<!-- Validate Storefront -->
96+
<actionGroup ref="NavigateToStorefrontForCreatedPageActionGroup" stepKey="navigateToStorefrontForCreatedPage">
97+
<argument name="page" value="$$createCMSPage.identifier$$"/>
98+
</actionGroup>
99+
<dontSeeElementInDOM selector="{{RowOnStorefront.affordanceCSS}}" stepKey="dontSeeAffordanceInDOM"/>
100+
</test>
101+
</tests>

0 commit comments

Comments
 (0)