Skip to content

Commit dd98a99

Browse files
committed
Merge branch 'develop' of github.com:magento-commerce/magento2-page-builder into column-group-story
2 parents 6dd33b0 + b6ff823 commit dd98a99

File tree

21 files changed

+223
-18
lines changed

21 files changed

+223
-18
lines changed

app/code/Magento/AwsS3PageBuilder/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"description": "Aws S3 Page Builder module",
44
"require": {
55
"magento/framework": "*",
6-
"php": "~7.4.0||~8.0.0||~8.1.0"
6+
"php": "~7.4.0||~8.1.0"
77
},
88
"suggest": {
99
"magento/module-page-builder": "*",

app/code/Magento/CatalogPageBuilderAnalytics/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"magento/module-page-builder-analytics": "*",
99
"magento/module-catalog": "*",
1010
"magento/framework": "*",
11-
"php": "~7.4.0||~8.0.0||~8.1.0"
11+
"php": "~7.4.0||~8.1.0"
1212
},
1313
"type": "magento2-module",
1414
"license": [

app/code/Magento/CmsPageBuilderAnalytics/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"magento/module-page-builder-analytics": "*",
99
"magento/module-cms": "*",
1010
"magento/framework": "*",
11-
"php": "~7.4.0||~8.0.0||~8.1.0"
11+
"php": "~7.4.0||~8.1.0"
1212
},
1313
"type": "magento2-module",
1414
"license": [
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
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"
9+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
10+
<actionGroup name="addTextToHtmlCodeWYSIWYGActionGroup">
11+
<arguments>
12+
<argument name="selector" type="string"/>
13+
<argument name="text" type="string"/>
14+
</arguments>
15+
<waitForPageLoad stepKey="waitForPageLoad"/>
16+
<waitForElement time="2" selector="{{selector}}" stepKey="waitForElementVisible"/>
17+
<!-- Workaround to insert UTF8 MB4 characters -->
18+
<executeJS function="node=document.evaluate('{{selector}}', document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue; node.value += '{{text}}'; node.dispatchEvent(new Event('change')); return 1;" stepKey="testVariable"/>
19+
</actionGroup>
20+
</actionGroups>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
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"
9+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
10+
<actionGroup name="removeTextFromHtmlCodeWYSIWYGActionGroup">
11+
<arguments>
12+
<argument name="selector" type="string"/>
13+
<argument name="text" type="string"/>
14+
</arguments>
15+
<waitForPageLoad stepKey="waitForPageLoad"/>
16+
<waitForElement time="2" selector="{{selector}}" stepKey="waitForElementVisible"/>
17+
<!-- Workaround to remove UTF8 MB4 characters -->
18+
<executeJS function="node=document.evaluate('{{selector}}', document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue;node.value = node.value.replace(new RegExp('{{text}}'), ''); node.dispatchEvent(new Event('change')); return 1;" stepKey="testVariable"/>
19+
</actionGroup>
20+
</actionGroups>

app/code/Magento/PageBuilder/Test/Mftf/Section/PageBuilderHtmlSection/HtmlOnStageSection.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
<element name="allHtml" type="text" selector="[data-content-type=html]"/>
1212
<element name="base" type="text" selector="(//div[contains(@class,'pagebuilder-html')]//div[contains(@data-bind,'text: data.main.html') or contains(@class,'placeholder-html-empty')])[{{arg1}}]" parameterized="true"/>
1313
<element name="baseCSS" type="text" selector="[data-content-type=html][data-element=main]"/>
14+
<element name="baseErrorLabel" type="text" selector="//aside//div[@data-index='general']/descendant::*[@name='html']/following-sibling::label"/>
1415
<element name="hidden" type="text" selector="(//*[@data-content-type='html'])[{{arg1}}]/ancestor::*[contains(@class, 'pagebuilder-content-type-wrapper') and contains(@class, 'pagebuilder-content-type-hidden')]" parameterized="true"/>
1516
<element name="notHidden" type="text" selector="(//div[contains(@class,'pagebuilder-html')])[{{arg1}}]/parent::*[contains(@class, 'pagebuilder-content-type-wrapper') and not(contains(@class, 'pagebuilder-content-type-hidden'))][1]" parameterized="true"/>
1617
<element name="empty" type="text" selector="(//div[contains(@class,'placeholder-html-empty')])[{{arg1}}]" parameterized="true"/>

app/code/Magento/PageBuilder/Test/Mftf/Section/PageBuilderTabsSection/TabOnStageSection.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
<element name="all" type="button" selector=".pagebuilder-tab-item"/>
1515
<element name="moveHandle" type="button" selector="(//div[@data-content-type='tabs'])[{{arg1}}]//li[@role='tab'][{{arg2}}]//span[contains(@class, 'tab-drag-handle')]" parameterized="true"/>
1616
<element name="tabHeader" type="button" selector="(//ul[contains(@class, 'tabs-navigation')]//a[contains(@class, 'tab-title')])[{{arg1}}]" parameterized="true"/>
17-
<element name="tabHeaderCSS" type="button" selector="[data-content-type=tabs] [role=presentation]"/>
17+
<element name="tabHeaderCSS" type="button" selector="[data-content-type=tabs] .tab-header"/>
1818
<element name="tabHeaderEditableTitle" type="button" selector="(//ul[contains(@class, 'tabs-navigation')]//a[contains(@class, 'tab-title')])[{{arg1}}]//span[contains(@contenteditable, 'true')]" parameterized="true"/>
1919
<element name="tabHeaderItem" type="button" selector="//ul[contains(@class, &quot;tabs-navigation&quot;)]/li[{{arg1}}]" parameterized="true"/>
2020
<element name="tabHeaderItemDefault" type="button" selector="//ul[contains(@class, 'tabs-navigation')]/li[contains(@style, 'border-radius: {{arg1}}px;') and contains(@style, 'border-width: 1px;')]" parameterized="true"/>

app/code/Magento/PageBuilder/Test/Mftf/Section/PageBuilderTabsSection/TabOnStorefrontSection.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
<element name="baseJS" type="text" selector="document.querySelectorAll('[data-content-type=tab-item]')[{{arg1}} - 1]" parameterized="true"/>
1616
<element name="elementChildren" type="button" selector="(//div[@class=&quot;tabs-content&quot;]//div[@data-content-type=&quot;tab-item&quot;])[{{arg1}}]" parameterized="true"/>
1717
<element name="tabHeader" type="button" selector="(//li[contains(@role, 'tab')])[{{arg1}}]" parameterized="true"/>
18-
<element name="tabHeaderCSS" type="button" selector="[data-content-type=tabs] [role=presentation]"/>
18+
<element name="tabHeaderCSS" type="button" selector="[data-content-type=tabs] .tab-header"/>
1919
<element name="tabHeaderItemActive" type="button" selector="(//div[@data-content-type='tabs']//descendant::*[@role='tablist'])/li[{{arg1}}][contains(@class, 'ui-state-active')]" parameterized="true"/>
2020
<element name="tabPanel" type="button" selector="(//div[@class='tabs-content']//div[@role='tabpanel'])[{{arg1}}]" parameterized="true"/>
2121
<element name="tabContent" type="button" selector="div.tabs-content div[data-content-type=tab-item]:nth-child({{arg1}})" parameterized="true"/>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,132 @@
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"
9+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
10+
<test name="PageBuilderCMSPageContentValidationTest">
11+
<annotations>
12+
<features value="PageBuilder"/>
13+
<stories value="HTML Code"/>
14+
<title value="Validate UTF-8 MB4 does not break HTML content"/>
15+
<description value="Validate that updating the General form for Html with UTF-8 MB4 will not break the text after on the Stage and Storefront."/>
16+
<severity value="AVERAGE"/>
17+
<useCaseId value="ACP2E-103"/>
18+
<testCaseId value="AC-1539"/>
19+
<group value="pagebuilder"/>
20+
<group value="pagebuilder-html"/>
21+
</annotations>
22+
<before>
23+
<magentoCLI command="config:set cms/wysiwyg/enabled disabled" stepKey="disableWYSIWYG"/>
24+
<createData entity="_emptyCmsPage" stepKey="createCMSPage"/>
25+
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>
26+
<actionGroup ref="NavigateToCreatedCMSPageActionGroup" stepKey="navigateToCreatedCMSPage">
27+
<argument name="CMSPage" value="$$createCMSPage$$"/>
28+
</actionGroup>
29+
<actionGroup ref="switchToPageBuilderStage" stepKey="switchToPageBuilderStage"/>
30+
<actionGroup ref="dragContentTypeToStage" stepKey="dragRowToRootContainer">
31+
<argument name="contentType" value="PageBuilderRowContentType"/>
32+
<argument name="containerTargetType" value="PageBuilderRootContainerContentType"/>
33+
</actionGroup>
34+
</before>
35+
<after>
36+
<deleteData createDataKey="createCMSPage" stepKey="deleteCMSPage"/>
37+
<actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/>
38+
<magentoCLI command="config:set cms/wysiwyg/enabled enabled" stepKey="enableWYSIWYG"/>
39+
</after>
40+
<actionGroup ref="expandPageBuilderPanelMenuSection" stepKey="expandPageBuilderPanelMenuSection">
41+
<argument name="contentType" value="PageBuilderHtmlContentType"/>
42+
</actionGroup>
43+
<actionGroup ref="dragContentTypeToStage" stepKey="dragHtmlIntoStage">
44+
<argument name="contentType" value="PageBuilderHtmlContentType"/>
45+
</actionGroup>
46+
<actionGroup ref="openPageBuilderEditPanel" stepKey="openEditMenuOnStage">
47+
<argument name="contentType" value="PageBuilderHtmlContentType"/>
48+
</actionGroup>
49+
<actionGroup ref="fillSlideOutPanelTextArea" stepKey="enterHtmlContent">
50+
<argument name="property" value="PageBuilderHtmlPropertyButton"/>
51+
</actionGroup>
52+
<actionGroup ref="addTextToHtmlCodeWYSIWYGActionGroup" stepKey="enterWrongHtmlContent">
53+
<argument name="selector" value="{{EditPanelForm.panelFieldControl('general', 'html')}}"/>
54+
<argument name="text" value="\u{1F600}"/>
55+
</actionGroup>
56+
<click selector="{{EditPanelForm.editFormSave}}" stepKey="clickSaveButton"/>
57+
<waitForElementVisible selector="{{HtmlOnStage.baseErrorLabel}}" stepKey="waitForHtmlBaseErrorLabelStage1"/>
58+
<grabTextFrom selector="{{HtmlOnStage.baseErrorLabel}}" stepKey="grabTextFromErrorLabel"/>
59+
<assertStringContainsString stepKey="assertErrorMessage">
60+
<expectedResult type="string">Please remove invalid characters</expectedResult>
61+
<actualResult type="variable">grabTextFromErrorLabel</actualResult>
62+
</assertStringContainsString>
63+
<actionGroup ref="removeTextFromHtmlCodeWYSIWYGActionGroup" stepKey="removeWrongHtmlContent">
64+
<argument name="selector" value="{{EditPanelForm.panelFieldControl('general', 'html')}}"/>
65+
<argument name="text" value="\u{1F600}"/>
66+
</actionGroup>
67+
<actionGroup ref="saveEditPanelSettings" stepKey="saveEditPanelSettings"/>
68+
<waitForElementNotVisible selector="{{HtmlOnStage.baseErrorLabel}}" stepKey="waitForHtmlBaseErrorLabelRemovedStage1"/>
69+
70+
<actionGroup ref="dragContentTypeToStage" stepKey="dragTextOntoStage">
71+
<argument name="contentType" value="PageBuilderTextContentType"/>
72+
</actionGroup>
73+
<actionGroup ref="openPageBuilderEditPanel" stepKey="openTextEditMenuOnStage">
74+
<argument name="contentType" value="PageBuilderTextContentType"/>
75+
</actionGroup>
76+
<fillField selector="{{TextOnConfiguration.textArea}}" userInput="Hello Page From PageBuilder" stepKey="addTextToEditor"/>
77+
<actionGroup ref="addTextToHtmlCodeWYSIWYGActionGroup" stepKey="enterWrongTextContent">
78+
<argument name="selector" value="//textarea[@id=&quot;{{TextOnConfiguration.textAreaId}}&quot;][1]"/>
79+
<argument name="text" value="\u{1F600}"/>
80+
</actionGroup>
81+
82+
<actionGroup ref="saveEditPanelSettingsFullScreen" stepKey="saveTextEditPanelSettings"/>
83+
84+
<!-- Validate Stage -->
85+
<comment userInput="Validate Stage" stepKey="commentValidateStage"/>
86+
<waitForElementVisible selector="{{HtmlOnStage.base('1')}}" stepKey="waitForHtmlBaseStage1"/>
87+
<waitForElementVisible selector="{{HtmlOnStage.html('1', PageBuilderHtmlPropertyButton.selector)}}" stepKey="waitForHtmlStage1"/>
88+
<executeJS function="return document.querySelectorAll('{{HtmlOnStage.baseCSS}}')[0].innerText;" stepKey="actualTextFromHtmlCode"/>
89+
<assertStringContainsString stepKey="assertButtonOnStage">
90+
<expectedResult type="string">{{PageBuilderHtmlPropertyButton.value}}</expectedResult>
91+
<actualResult type="variable">actualTextFromHtmlCode</actualResult>
92+
</assertStringContainsString>
93+
<actionGroup ref="exitPageBuilderFullScreen" stepKey="exitPageBuilderFullScreen"/>
94+
95+
<!-- Cannot save invalid text-->
96+
<actionGroup ref="SaveAndContinueEditCmsPageActionGroup" stepKey="saveAndContinueEditCmsPage"/>
97+
<waitForElementVisible selector="//div[contains(@class, &quot;field-page-builder&quot;)]//label[@class=&quot;admin__field-error&quot;]" stepKey="waitForErrorLabelVisible"/>
98+
<grabTextFrom selector="//div[contains(@class, &quot;field-page-builder&quot;)]//label[@class=&quot;admin__field-error&quot;]" stepKey="grabTextFromErrorLabel2"/>
99+
<assertStringContainsString stepKey="assertErrorMessage2">
100+
<expectedResult type="string">Please remove invalid characters</expectedResult>
101+
<actualResult type="variable">grabTextFromErrorLabel2</actualResult>
102+
</assertStringContainsString>
103+
104+
<!-- Fix error and save again -->
105+
<actionGroup ref="switchToPageBuilderStage" stepKey="switchToPageBuilderStageToFixText"/>
106+
<actionGroup ref="openPageBuilderEditPanel" stepKey="openTextEditMenuOnStageToFixText">
107+
<argument name="contentType" value="PageBuilderTextContentType"/>
108+
</actionGroup>
109+
<actionGroup ref="removeTextFromHtmlCodeWYSIWYGActionGroup" stepKey="removeWrongTextContent">
110+
<argument name="selector" value="//textarea[@id=&quot;{{TextOnConfiguration.textAreaId}}&quot;][1]"/>
111+
<argument name="text" value="\u{1F600}"/>
112+
</actionGroup>
113+
<actionGroup ref="saveEditPanelSettingsFullScreen" stepKey="saveTextEditPanelSettings2"/>
114+
<actionGroup ref="exitPageBuilderFullScreen" stepKey="exitPageBuilderFullScreen2"/>
115+
<waitForElementNotVisible selector="//div[contains(@class, &quot;field-page-builder&quot;)]//label[@class=&quot;admin__field-error&quot;]" stepKey="waitForErrorLabelNotVisible"/>
116+
<actionGroup ref="SaveAndContinueEditCmsPageActionGroup" stepKey="saveAndContinueEditCmsPage2"/>
117+
118+
<actionGroup ref="NavigateToStorefrontForCreatedPageActionGroup" stepKey="navigateToCMSPageStorefront">
119+
<argument name="page" value="$$createCMSPage.identifier$$"/>
120+
</actionGroup>
121+
<!-- Validate Storefront -->
122+
<comment userInput="Validate Storefront" stepKey="commentValidateStorefront"/>
123+
<waitForElementVisible selector="{{HtmlOnStorefront.base('1')}}" stepKey="waitForHtmlBaseStorefront"/>
124+
<waitForElementVisible selector="{{HtmlOnStorefront.html('1', PageBuilderHtmlPropertyButton.selectorOnFrontend)}}" stepKey="waitForHtmlStorefront"/>
125+
<waitForElementVisible selector="{{TextOnStorefront.allText}}" stepKey="waitForTextStorefront"/>
126+
<grabTextFrom selector="{{TextOnStorefront.allText}}" stepKey="grabTextFromText"/>
127+
<assertStringContainsString stepKey="assertTextOnStoreFront">
128+
<expectedResult type="string">Hello Page From PageBuilder</expectedResult>
129+
<actualResult type="variable">grabTextFromText</actualResult>
130+
</assertStringContainsString>
131+
</test>
132+
</tests>

app/code/Magento/PageBuilder/Test/Mftf/Test/AdminPageBuilderProductsGridTest/AdminPageBuilderVerifySwatchDisplayedInPreviewGridTest.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,10 @@
3232
<actionGroup ref="AdminDeleteProductAttributeByLabelActionGroup" stepKey="deleteAttribute">
3333
<argument name="productAttributeLabel" value="{{visualSwatchAttribute.default_label}}"/>
3434
</actionGroup>
35+
<!-- Reindex after deleting product attribute -->
36+
<actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex">
37+
<argument name="indices" value=""/>
38+
</actionGroup>
3539
<actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/>
3640
</after>
3741
<!-- Create a configurable swatch product via the UI -->

0 commit comments

Comments
 (0)