Skip to content

Commit 1f54eb1

Browse files
committed
Merge branch '514_content-snapshot-category-admin-page' of magento/magento2-page-builder into 514__7_content-snapshot-category-admin-page
2 parents cb0ec8f + 135b5eb commit 1f54eb1

File tree

36 files changed

+855
-109
lines changed

36 files changed

+855
-109
lines changed

app/code/Magento/PageBuilder/Model/WidgetInitializerConfig.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,8 @@ public function getConfig(): array
4747
{
4848
$resultConfig = [];
4949
foreach ($this->config as $contentTypeName => $config) {
50-
$selector = sprintf('[data-content-type="%s"]', $contentTypeName);
5150
foreach ($config as $item) {
51+
$selector = sprintf('[data-content-type="%s"]', $contentTypeName);
5252
if (!isset($item['component'])) {
5353
continue;
5454
}
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="AdminOpenPageBuilderFromContentPreviewOverlayActionGroup">
11+
<annotations>
12+
<description>Click Page Builder preview overlay to open Page Builder stage.</description>
13+
</annotations>
14+
<waitForElementVisible selector="{{PageBuilderStage.stageOverlay}}" stepKey="waitForStageOverlay"/>
15+
<click selector="{{PageBuilderStage.stageOverlay}}" stepKey="clickOnStageOverlayOnStage"/>
16+
<waitForPageLoad stepKey="waitForPageLoadPageBuilder"/>
17+
<waitForElementVisible selector="{{PageBuilderPanel.layoutMenuSection}}" stepKey="waitForPageBuilderLayoutMenu"/>
18+
<waitForElementVisible selector="{{PageBuilderStage.stageWrapperFullScreen}}" stepKey="waitForPageBuilderFullScreen"/>
19+
</actionGroup>
20+
</actionGroups>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
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="ValidatePageBuilderPreviewActionGroup">
11+
<annotations>
12+
<description>Verifies Page Builder preview has the 'Edit with Page Builder' button, has an overlay, does not have the Page Builder left panel, does not have the Page Builder template buttons, and does not open content type option menus.</description>
13+
</annotations>
14+
<arguments>
15+
<argument name="pageBuilderArea" defaultValue="" type="string"/>
16+
</arguments>
17+
<waitForElementVisible selector="{{pageBuilderArea}}{{PageBuilderStage.editWithPageBuilderButton}}" stepKey="waitForEditWithPageBuilderButton"/>
18+
<see userInput="Edit with Page Builder" selector="{{pageBuilderArea}}{{PageBuilderStage.editWithPageBuilderButton}}" stepKey="seeEditWithPageBuilderButton"/>
19+
<dontSeeElementInDOM selector="{{PageBuilderPanel.leftPanel}}" stepKey="dontSeePageBuilderContentTypePanel"/>
20+
<dontSeeElementInDOM selector="{{pageBuilderArea}}{{PageBuilderStage.applyTemplateButton}}" stepKey="dontSeePageBuilderApplyTemplateButton"/>
21+
<dontSeeElementInDOM selector="{{pageBuilderArea}}{{PageBuilderStage.saveAsTemplateButton}}" stepKey="dontSeePageBuilderSaveAsTemplateButton"/>
22+
<waitForElementVisible selector="{{PageBuilderStage.stageOverlay}}" stepKey="waitForStageOverlay"/>
23+
<moveMouseOver selector="{{PageBuilderStage.stageOverlay}}" stepKey="mouseOverStageOverlay"/>
24+
<waitForElementVisible selector="{{PageBuilderStage.stageOverlayOnHover}}" stepKey="waitForStageOverlayOnHover"/>
25+
<dontSeeElement selector="{{PageBuilderContentTypeOptionsMenu.contentTypeOptionsMenu(PageBuilderRowContentType.role)}}" stepKey="dontSeeRowOptionMenu"/>
26+
</actionGroup>
27+
</actionGroups>

app/code/Magento/PageBuilder/Test/Mftf/ActionGroup/StageActionGroup/VerifyEmptyStageActionGroup.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
<waitForPageLoad stepKey="waitForStageLoad"/>
1919
<waitForElementVisible selector="{{RowOnStage.empty(rowIndex)}}" stepKey="waitForEmptyRow"/>
2020
<seeElement selector="{{RowOnStage.empty(rowIndex)}}" stepKey="seeEmptyRow"/>
21+
<see userInput="Drag content types or columns here" selector="{{RowOnStage.emptyPlaceholder(rowIndex)}}" stepKey="seeEmptyRowPlaceholderMessage"/>
2122
<seeNumberOfElements userInput="1" selector="{{pageBuilderArea}}{{RowOnStage.allRows}}" stepKey="seeOnlyOneRow"/>
2223
</actionGroup>
2324
</actionGroups>

app/code/Magento/PageBuilder/Test/Mftf/ActionGroup/WYSIWYGActionGroup/AddPageLinkWidgetToTinyMCEActionGroup.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
<waitForLoadingMaskToDisappear stepKey="waitForSelectPageModal"/>
2424
<waitForElementVisible selector="{{WidgetSection.SelectPageFilterInput('chooser_title')}}" stepKey="waitForGrid"/>
2525
<fillField selector="{{WidgetSection.SelectPageFilterInput('chooser_identifier')}}" userInput="{{page}}" stepKey="enterPageName"/>
26-
<click selector="{{AdminProductGridFilterSection.applyFilters}}" stepKey="clickSearch"/>
26+
<click selector=".modal-slide._show {{AdminProductGridFilterSection.applyFilters}}" stepKey="clickSearch"/>
2727
<waitForLoadingMaskToDisappear stepKey="waitForLoadingMaskToDisappear3"/>
2828
<waitForElementVisible selector="//td[contains(@class,'col-url')][contains(text(),'{{page}}')]" stepKey="waitForSearchResult"/>
2929
<click selector="//td[contains(@class,'col-url')][contains(text(),'{{page}}')]" stepKey="clickCmsPageLinkRow"/>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
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="ClickTinyMCEInsertImageButtonActionGroup">
11+
<annotations>
12+
<description>Clicks the Insert Link button from the TinyMCE.</description>
13+
</annotations>
14+
<arguments>
15+
<argument name="section" defaultValue="TinyMCESection"/>
16+
<argument name="wysiwygArea" defaultValue="{{WYSIWYGOnPageBuilderInline.notCss}}" type="string"/>
17+
</arguments>
18+
<waitForElementVisible selector="{{wysiwygArea}} {{section.InsertLink}}" stepKey="waitForTinyMCEInsertLinkButton"/>
19+
<click selector="{{wysiwygArea}} {{section.InsertLink}}" stepKey="clickTinyMCEInsertLinkButton"/>
20+
<waitForElementVisible selector="{{WYSIWYGInsertLinkModal.modal}}" stepKey="waitForWYSIWYGInsertLinkModal"/>
21+
</actionGroup>
22+
</actionGroups>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
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="FillTinyMCEInsertImageModalAndSaveActionGroup">
11+
<annotations>
12+
<description>Adds text to Text To Display field from the TinyMCE Insert Link Modal window.</description>
13+
</annotations>
14+
<arguments>
15+
<argument name="textToDisplay" defaultValue="" type="string"/>
16+
</arguments>
17+
<waitForElementVisible selector="{{WYSIWYGInsertLinkModal.textToDisplayInput}}" stepKey="waitForTinyMCELinkModalTextToDisplayInput"/>
18+
<fillField selector="{{WYSIWYGInsertLinkModal.textToDisplayInput}}" userInput="{{textToDisplay}}" stepKey="insertTinyMCELinkModalTextToDisplayInput"/>
19+
<waitForElementVisible selector="{{WYSIWYGInsertLinkModal.okButton}}" stepKey="waitForTinyMCEInsertLinkModalOkButton"/>
20+
<click selector="{{WYSIWYGInsertLinkModal.okButton}}" stepKey="clickTinyMCEInsertLinkModalOkButton"/>
21+
<waitForElementNotVisible selector="{{WYSIWYGInsertLinkModal.modal}}" stepKey="waitForTinyMCEInsertLinkModalNotVisible"/>
22+
</actionGroup>
23+
</actionGroups>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
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="GoToMediaGalleryFromTinyMCEImageModalActionGroup">
11+
<annotations>
12+
<description>Clicks the Browse Media Gallery button from the TinyMCE Insert Link Modal window.</description>
13+
</annotations>
14+
<waitForElementVisible selector="{{WYSIWYGInsertLinkModal.browseMediaGalleryButton}}" stepKey="waitForWYSIWYGInsertLinkModalBrowseMediaGalleryButton"/>
15+
<click selector="{{WYSIWYGInsertLinkModal.browseMediaGalleryButton}}" stepKey="clickWYSIWYGInsertLinkModalBrowseMediaGalleryButton"/>
16+
<waitForPageLoad stepKey="waitForTinyMCEImageSelectorBrowseModal"/>
17+
</actionGroup>
18+
</actionGroups>

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

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,13 @@
3838
<data key="errorMessage">Adding link in both content and outer element is not allowed.</data>
3939
<data key="stageErrorMessage">We are unable to support links within the content field whilst having a link set on the content type. Please remove the content type link if you'd like to set a link within the content. We will automatically remove the links within the content field.</data>
4040
</entity>
41+
<entity name="PageBuilderBannerMessageInvalidWidgetProperty" type="pagebuilder_banner_message_property">
42+
<data key="name">Message Text</data>
43+
<data key="section">contents</data>
44+
<data key="fieldName">message</data>
45+
<data key="errorMessage">Adding widget in content and link in outer element is not allowed.</data>
46+
<data key="stageErrorMessage">We are unable to support widget within the content field whilst having a link set on the content type. Please remove the content type link if you'd like to set a widget within the content. We will automatically remove the widget within the content field.</data>
47+
</entity>
4148
<!-- Background Color -->
4249
<entity name="PageBuilderBannerBackgroundColor_Empty" type="pagebuilder_banner_background_color_property">
4350
<data key="name">Background Color</data>
@@ -82,6 +89,12 @@
8289
<data key="fieldName">link_url</data>
8390
<data key="errorMessage">Adding link in both content and outer element is not allowed.</data>
8491
</entity>
92+
<entity name="PageBuilderBannerLinkUrlInvalidWidgetProperty" type="pagebuilder_banner_linkUrl_property">
93+
<data key="name">Link</data>
94+
<data key="section">contents</data>
95+
<data key="fieldName">link_url</data>
96+
<data key="errorMessage">Adding link in outer element and widget in content is not allowed.</data>
97+
</entity>
8598
<!-- Show Button -->
8699
<entity name="PageBuilderBannerShowButtonDefaultProperty" type="pagebuilder_banner_show_button_property">
87100
<data key="name">Show Button</data>

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

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,12 @@
7070
<data key="fieldName">link_url</data>
7171
<data key="errorMessage">Adding link in both content and outer element is not allowed.</data>
7272
</entity>
73+
<entity name="PageBuilderSlideItemLinkUrlInvalidWidgetProperty" type="pagebuilder_slide_item_link_url_property">
74+
<data key="name">Link</data>
75+
<data key="section">general</data>
76+
<data key="fieldName">link_url</data>
77+
<data key="errorMessage">Adding link in outer element and widget in content is not allowed.</data>
78+
</entity>
7379
<!-- Show Button -->
7480
<entity name="PageBuilderSlideItemShowButton_Always" type="pagebuilder_slide_item_show_button_property">
7581
<data key="name">Show Button</data>
@@ -240,4 +246,11 @@
240246
<data key="errorMessage">Adding link in both content and outer element is not allowed.</data>
241247
<data key="stageErrorMessage">We are unable to support links within the content field whilst having a link set on the content type. Please remove the content type link if you'd like to set a link within the content. We will automatically remove the links within the content field.</data>
242248
</entity>
249+
<entity name="PageBuilderSlideItemMessageInvalidWidgetProperty" type="pagebuilder_slide_item_message__property">
250+
<data key="name">Message Text</data>
251+
<data key="section">general</data>
252+
<data key="fieldName">content</data>
253+
<data key="errorMessage">Adding widget in content and link in outer element is not allowed.</data>
254+
<data key="stageErrorMessage">We are unable to support widget within the content field whilst having a link set on the content type. Please remove the content type link if you'd like to set a widget within the content. We will automatically remove the widget within the content field.</data>
255+
</entity>
243256
</entities>

0 commit comments

Comments
 (0)