Skip to content

Commit 27243d5

Browse files
authored
Merge pull request #194 from magento-obsessive-owls/cms-team-1-delivery
[Owls] Beta Release 5
2 parents ece4477 + c1127cd commit 27243d5

File tree

198 files changed

+3139
-1048
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

198 files changed

+3139
-1048
lines changed

.gitignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,5 @@
66
static-error-log.xml
77
.DS_Store
88
.vscode
9-
.history/
9+
.history/
10+
/yarn-error.log

app/code/Magento/PageBuilder/Model/Stage/Config/UiComponentConfig.php

+32-9
Original file line numberDiff line numberDiff line change
@@ -49,21 +49,44 @@ public function getFields($componentName) : array
4949
function ($item, $key) {
5050
// Determine if this item has a formElement key
5151
if (isset($item[Converter::DATA_ARGUMENTS_KEY]['data']['config']['formElement'])) {
52-
$elementConfig
53-
= $item[Converter::DATA_ARGUMENTS_KEY]['data']['config'];
54-
return [
55-
$key => [
56-
'default' => (isset($elementConfig['default'])
57-
? $elementConfig['default'] : '')
58-
]
59-
];
52+
$elementConfig = $item[Converter::DATA_ARGUMENTS_KEY]['data']['config'];
53+
// If the field has a dataScope use that for the key instead of the name
54+
if (isset($elementConfig['dataScope'])) {
55+
$key = $elementConfig['dataScope'];
56+
}
57+
$field = [];
58+
// Generate our nested field array with defaults supporting dot notation within the key
59+
$this->generateFieldArray(
60+
$field,
61+
$key . ".default",
62+
(isset($elementConfig['default']) ? $elementConfig['default'] : '')
63+
);
64+
return $field;
6065
}
6166
}
6267
);
6368

6469
return $fields;
6570
}
6671

72+
/**
73+
* Recursively generate our field array, allowing for dot notation within the key
74+
*
75+
* @param array $array
76+
* @param string $path
77+
* @param string|array $value
78+
*/
79+
private function generateFieldArray(array &$array, string $path, $value)
80+
{
81+
$keys = explode(".", $path);
82+
83+
foreach ($keys as $key) {
84+
$array = &$array[$key];
85+
}
86+
87+
$array = $value;
88+
}
89+
6790
/**
6891
* Iterate over components within the configuration and run a defined callback function
6992
*
@@ -84,7 +107,7 @@ private function iterateComponents($config, $callback, $key = false) : array
84107
)
85108
) {
86109
foreach ($config[Converter::DATA_COMPONENTS_KEY] as $key => $child) {
87-
$values = array_merge(
110+
$values = array_merge_recursive(
88111
$values,
89112
$this->iterateComponents($child, $callback, $key) ?: []
90113
);

app/code/Magento/PageBuilder/Test/Mftf/ActionGroup/AdminActionGroup.xml

+8-3
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,17 @@
3636
<fillField selector="{{CmsNewPagePageActionsSection.pageTitle}}" userInput="{{contentType.name}}{{PageBuilderPageTitle.pageName}}" stepKey="enterPageTitle"/>
3737
</actionGroup>
3838
<actionGroup name="switchToPageBuilderStage">
39-
<waitForElementVisible time="30" selector="{{CmsNewPagePageContentSection.header}}" stepKey="waitForElementVisible"/>
40-
<click selector="{{CmsNewPagePageContentSection.header}}" stepKey="clickExpandContent"/>
39+
<arguments>
40+
<argument name="sectionSelector" defaultValue="{{CmsNewPagePageContentSection.header}}" type="string"/>
41+
<argument name="sectionDependentSelector" defaultValue="{{CmsNewPagePageContentSection.header}}._show" type="string"/>
42+
<argument name="rowIndex" defaultValue="1" type="string"/>
43+
</arguments>
44+
<waitForElementVisible time="30" selector="{{sectionSelector}}" stepKey="waitForSection"/>
45+
<conditionalClick selector="{{sectionSelector}}" dependentSelector="{{sectionDependentSelector}}" visible="false" stepKey="expandSection"/>
4146
<waitForPageLoad time="30" stepKey="waitForStageToLoad"/>
4247
<!-- Wait for the first row to be added into the stage for it to be "ready" -->
4348
<waitForElementNotVisible selector="{{PageBuilderStage.stageLoading}}" stepKey="waitForStageLoadingGraphicNotVisible"/>
44-
<waitForElementVisible time="30" selector="{{RowOnStage.base('1')}}" stepKey="waitForPageBuilderRow"/>
49+
<waitForElementVisible time="30" selector="{{RowOnStage.base(rowIndex)}}" stepKey="waitForPageBuilderRow"/>
4550
</actionGroup>
4651
<actionGroup name="saveAndContinueEditCmsPage">
4752
<waitForElementVisible time="10" selector="{{CmsNewPagePageActionsSection.saveAndContinueEdit}}" stepKey="waitForSaveAndContinueVisibility"/>

app/code/Magento/PageBuilder/Test/Mftf/ActionGroup/ContentTypeButtonActionGroup.xml

+2-21
Original file line numberDiff line numberDiff line change
@@ -8,26 +8,6 @@
88

99
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
1010
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11-
<actionGroup name="addButton">
12-
<arguments>
13-
<argument name="buttonGroupIndex" defaultValue="1" type="string"/>
14-
</arguments>
15-
<comment userInput="Adding Button" stepKey="comment"/>
16-
<executeJS function="return Math.round(document.getElementsByClassName('pagebuilder-button-item').length+1)" stepKey="initialNumberOfButtonsPlusOne"/>
17-
<click selector="{{PageBuilderPanel.searchPanel}}" stepKey="unfocusButtonLiveEdit1"/>
18-
<moveMouseOver selector="{{PageBuilderStage.contentTypeInStageByIndex(PageBuilderButtonsContentType.role, buttonGroupIndex)}}" stepKey="mouseOverButtonsGroup"/>
19-
<waitForPageLoad stepKey="waitForPageLoad"/>
20-
<waitForElementVisible time="10" selector="{{PageBuilderContentTypeOptionsMenu.contentTypeOptionsMenu(PageBuilderButtonsContentType.role)}}" stepKey="waitForOptionsMenu"/>
21-
<waitForElementVisible time="10" selector="{{ButtonGroupOnStage.addNewButtonItemOption(buttonGroupIndex)}}" stepKey="seeAddButton"/>
22-
<click selector="{{ButtonGroupOnStage.addNewButtonItemOption(buttonGroupIndex)}}" stepKey="clickAddButton"/>
23-
<waitForPageLoad stepKey="waitForPageLoad2"/>
24-
<executeJS function="return document.getElementsByClassName('pagebuilder-button-item').length" stepKey="numberOfButtonsAfterAdd"/>
25-
<assertEquals stepKey="assertOneMoreButton">
26-
<expectedResult type="variable">initialNumberOfButtonsPlusOne</expectedResult>
27-
<actualResult type="variable">numberOfButtonsAfterAdd</actualResult>
28-
</assertEquals>
29-
<click selector="{{PageBuilderPanel.searchPanel}}" stepKey="unfocusButtonLiveEdit2"/>
30-
</actionGroup>
3111
<actionGroup name="validateButtonItemContent">
3212
<arguments>
3313
<argument name="page"/>
@@ -48,14 +28,15 @@
4828
<arguments>
4929
<argument name="text"/>
5030
<argument name="index" defaultValue="1" type="string"/>
31+
<argument name="pageBuilderArea" defaultValue="" type="string"/>
5132
</arguments>
5233
<comment userInput="inlineEditButton" stepKey="comment"/>
5334
<waitForElementVisible selector="{{ButtonItemOnStage.base(index)}}" stepKey="waitForButton"/>
5435
<waitForElementVisible selector="{{ButtonItemOnStage.editableButtonItemElement(index)}}" stepKey="waitForButtonEditable"/>
5536
<fillField selector="{{ButtonItemOnStage.editableButtonItemElement(index)}}" userInput="{{text.value}}" stepKey="enterButtonText"/>
5637
<waitForPageLoad stepKey="waitForPageLoad"/>
5738
<seeElement selector="{{ButtonItemOnStage.buttonItemText(index, text.value)}}" stepKey="seeButtonText"/>
58-
<click selector="{{PageBuilderPanel.searchPanel}}" stepKey="unFocusLiveEdit"/>
39+
<click selector="{{pageBuilderArea}}{{PageBuilderPanel.searchPanel}}" stepKey="unFocusLiveEdit"/>
5940
<waitForPageLoad stepKey="waitForUnFocus"/>
6041
</actionGroup>
6142
<actionGroup name="moveButton">

app/code/Magento/PageBuilder/Test/Mftf/ActionGroup/ContentTypeSliderActionGroup.xml

-20
Original file line numberDiff line numberDiff line change
@@ -8,26 +8,6 @@
88

99
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
1010
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11-
<actionGroup name="addSlide">
12-
<arguments>
13-
<argument name="slideGroupIndex" defaultValue="1" type="string"/>
14-
</arguments>
15-
<comment userInput="Adding Slide" stepKey="comment"/>
16-
<executeJS function="return document.getElementsByClassName('pagebuilder-slide').length+1" stepKey="initialNumberOfSlidesPlusOne"/>
17-
<scrollTo selector="{{PageBuilderPanel.searchPanel}}" x="0" y="-150" stepKey="scrollToSearchPanel"/>
18-
<click selector="{{PageBuilderPanel.searchPanel}}" stepKey="unFocusSlide"/>
19-
<moveMouseOver selector="{{PageBuilderStage.contentTypeInStageByIndex(PageBuilderSliderContentType.role, slideGroupIndex)}}" stepKey="mouseOverSlider"/>
20-
<waitForPageLoad stepKey="waitForPageLoad1"/>
21-
<waitForElementVisible selector="{{PageBuilderContentTypeOptionsMenu.contentTypeOptionsMenu(PageBuilderSliderContentType.role)}}" stepKey="waitForOptionsMenu"/>
22-
<waitForElementVisible selector="{{PageBuilderContentTypeOptionsMenu.contentTypeAdd(PageBuilderSliderContentType.role)}}" stepKey="waitForAddSlideButton"/>
23-
<click selector="{{PageBuilderContentTypeOptionsMenu.contentTypeAdd(PageBuilderSliderContentType.role)}}" stepKey="clickAddSlideButton"/>
24-
<waitForPageLoad stepKey="waitForPageLoad2"/>
25-
<executeJS function="return document.getElementsByClassName('pagebuilder-slide').length" stepKey="numberOfSlidesAfterAdd"/>
26-
<assertEquals stepKey="assertOneMoreSlide">
27-
<expectedResult type="variable">initialNumberOfSlidesPlusOne</expectedResult>
28-
<actualResult type="variable">numberOfSlidesAfterAdd</actualResult>
29-
</assertEquals>
30-
</actionGroup>
3111
<actionGroup name="switchSlide">
3212
<arguments>
3313
<argument name="section" defaultValue="SliderOnFrontend"/>

app/code/Magento/PageBuilder/Test/Mftf/ActionGroup/ContentTypeTabsActionGroup.xml

-37
Original file line numberDiff line numberDiff line change
@@ -8,43 +8,6 @@
88

99
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
1010
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11-
<actionGroup name="addTab">
12-
<arguments>
13-
<argument name="x" defaultValue="10" type="string"/>
14-
<argument name="y" defaultValue="0" type="string"/>
15-
</arguments>
16-
<click selector="{{TabsOnStage.tabsContainer}}" stepKey="focusOnContentType"/>
17-
<waitForElementVisible time="10" selector="{{PageBuilderStage.contentTypeInStage(PageBuilderTabsContentType.role)}}" stepKey="waitForContentTypeInStageVisible" />
18-
<moveMouseOver selector="{{PageBuilderStage.contentTypeInStage(PageBuilderTabsContentType.role)}}" x="{{x}}" y="{{y}}" stepKey="onMouseOverContentTypeStage"/>
19-
<waitForPageLoad stepKey="waitForMouseOverAnimation" />
20-
<waitForElementVisible time="10" selector="{{PageBuilderContentTypeOptionsMenu.contentTypeOptionsMenu(PageBuilderTabsContentType.role)}}" stepKey="waitForOptions" />
21-
<click selector="{{PageBuilderContentTypeOptionsMenu.contentTypeAdd(PageBuilderTabsContentType.role)}}" stepKey="clickAddContentType"/>
22-
<waitForPageLoad stepKey="waitForNewTab" time="30"/>
23-
</actionGroup>
24-
<actionGroup name="addTabAndOpenNewTabOptions">
25-
<arguments>
26-
<argument name="from" defaultValue="1" type="string"/>
27-
<argument name="to" defaultValue="2" type="string"/>
28-
<argument name="x" defaultValue="10" type="string"/>
29-
<argument name="y" defaultValue="0" type="string"/>
30-
</arguments>
31-
<click selector="{{TabsOnStage.tabsContainer}}" stepKey="focusOnContentType"/>
32-
<waitForElementVisible time="10" selector="{{PageBuilderStage.contentTypeInStage(PageBuilderTabsContentType.role)}}" stepKey="waitForContentTypeInStageVisible" />
33-
<moveMouseOver selector="{{PageBuilderStage.contentTypeInStage(PageBuilderTabsContentType.role)}}" x="{{x}}" y="{{y}}" stepKey="onMouseOverContentTypeStage"/>
34-
<waitForPageLoad stepKey="waitForMouseOverAnimation" time="30"/>
35-
<waitForElementVisible time="10" selector="{{PageBuilderContentTypeOptionsMenu.contentTypeOptionsMenu(PageBuilderTabsContentType.role)}}" stepKey="waitForOptions" />
36-
<click selector="{{PageBuilderContentTypeOptionsMenu.contentTypeAdd(PageBuilderTabsContentType.role)}}" stepKey="clickAddContentType"/>
37-
<waitForPageLoad stepKey="waitForNewTab" time="30"/>
38-
<waitForElementVisible selector="{{TabOnStage.tabContent(to)}}" stepKey="waitForNewTabContent"/>
39-
<waitForElementVisible selector="{{TabOnStage.tabHeader(to)}}" stepKey="waitForNewTabHeader"/>
40-
<waitForElementVisible selector="{{TabOnStage.optionsMenu(to)}}" stepKey="waitForTabOptionsPanel"/>
41-
<waitForElementVisible selector="{{TabOnStage.optionsMenuButton(to, 'edit')}}" stepKey="seeTabOptionsEdit2"/>
42-
<click selector="{{TabOnStage.optionsMenuButton(to, 'edit')}}" stepKey="clickEditContentType2"/>
43-
<waitForElementVisible time="5" selector="{{EditPanelForm.editForm}}" stepKey="waitForEditForm" />
44-
<!-- Required time wait due to animation -->
45-
<waitForPageLoad stepKey="waitForAnimation" time="30"/>
46-
<see userInput="Edit Tab" selector="{{EditPanelForm.editFormTitle}}" stepKey="seeContentTypeNameInEditFormTitle"/>
47-
</actionGroup>
4811
<actionGroup name="switchTabs">
4912
<arguments>
5013
<argument name="section"/>

app/code/Magento/PageBuilder/Test/Mftf/ActionGroup/DragAndDropActionGroup.xml

+16-12
Original file line numberDiff line numberDiff line change
@@ -11,25 +11,27 @@
1111
<actionGroup name="dragContentTypeToStage">
1212
<arguments>
1313
<argument name="contentType"/>
14+
<argument name="containerTargetType" defaultValue="PageBuilderRowContentType"/>
15+
<argument name="containerTargetIndex" defaultValue="1" type="string"/>
1416
</arguments>
1517
<waitForElementVisible time="30" selector="{{PageBuilderPanel.draggableContentTypeInPanel(contentType.name)}}" stepKey="waitForContentTypeInPanel"/>
16-
<dragAndDrop selector1="{{PageBuilderPanel.draggableContentTypeInPanel(contentType.name)}}" selector2="{{PageBuilderStage.dropAreaInStage}}" stepKey="dropContentTypeIntoStage"/>
17-
<waitForPageLoad stepKey="waitForContentTypeToLoad" time="30"/>
18+
<dragAndDrop selector1="{{PageBuilderPanel.draggableContentTypeInPanel(contentType.name)}}" selector2="{{PageBuilderStage.contentTypeContainer(containerTargetType.role, containerTargetIndex)}}" stepKey="dropContentTypeIntoStage"/>
19+
<waitForPageLoad stepKey="waitForAnimation" time="30"/>
1820
<dontSeeJsError stepKey="doNotSeeJSErrorInConsole"/>
19-
<waitForLoadingMaskToDisappear stepKey="waitForAnimation" />
2021
<waitForElementVisible time="10" selector="{{PageBuilderStage.contentTypeInStage(contentType.role)}}" stepKey="waitForContentTypeInStage" />
21-
<waitForPageLoad stepKey="waitForToolbarsToLoad" time="30"/>
2222
</actionGroup>
2323
<actionGroup name="dragContentTypeToStageByIndex">
2424
<arguments>
2525
<argument name="contentType"/>
2626
<argument name="contentTypeNumber" defaultValue="1" type="string"/>
27+
<argument name="containerTargetType" defaultValue="PageBuilderRowContentType"/>
28+
<argument name="containerTargetIndex" defaultValue="1" type="string"/>
2729
</arguments>
28-
<dragAndDrop selector1="{{PageBuilderPanel.draggableContentTypeInPanel(contentType.name)}}" selector2="{{PageBuilderStage.dropAreaInStage}}" stepKey="dropContentTypeIntoStage"/>
30+
<waitForElementVisible time="30" selector="{{PageBuilderPanel.draggableContentTypeInPanel(contentType.name)}}" stepKey="waitForContentTypeInPanel"/>
31+
<dragAndDrop selector1="{{PageBuilderPanel.draggableContentTypeInPanel(contentType.name)}}" selector2="{{PageBuilderStage.contentTypeContainer(containerTargetType.role, containerTargetIndex)}}" stepKey="dropContentTypeIntoStage"/>
2932
<waitForPageLoad stepKey="waitForAnimation" time="30"/>
3033
<dontSeeJsError stepKey="doNotSeeJSErrorInConsole"/>
3134
<waitForElementVisible time="10" selector="{{PageBuilderStage.contentTypeInStageByIndex(contentType.role, contentTypeNumber)}}" stepKey="waitForContentTypeInStage" />
32-
<waitForPageLoad stepKey="waitForToolbarsToLoad" time="30"/>
3335
</actionGroup>
3436
<actionGroup name="dragContentTypeToContainer">
3537
<arguments>
@@ -39,10 +41,11 @@
3941
<argument name="containerTargetIndex" defaultValue="1" type="string"/>
4042
<argument name="offsetXCoordinate" defaultValue="null" type="string"/>
4143
<argument name="offsetYCoordinate" defaultValue="null" type="string"/>
44+
<argument name="pageBuilderArea" defaultValue="" type="string"/>
4245
</arguments>
43-
<click selector="{{PageBuilderPanel.searchPanel}}" stepKey="lostFocus"/>
44-
<waitForElementVisible time="30" selector="{{PageBuilderPanel.draggableContentTypeInPanel(contentType.name)}}" stepKey="waitForContentTypeInPanel"/>
45-
<dragAndDrop selector1="{{PageBuilderPanel.draggableContentTypeInPanel(contentType.name)}}" selector2="{{PageBuilderStage.contentTypeContainer(containerTargetType.role, containerTargetIndex)}}" x="{{offsetXCoordinate}}" y="{{offsetYCoordinate}}" stepKey="dropContentTypeIntoStage"/>
46+
<click selector="{{pageBuilderArea}}{{PageBuilderPanel.searchPanel}}" stepKey="lostFocus"/>
47+
<waitForElementVisible time="30" selector="{{pageBuilderArea}}{{PageBuilderPanel.draggableContentTypeInPanel(contentType.name)}}" stepKey="waitForContentTypeInPanel"/>
48+
<dragAndDrop selector1="{{pageBuilderArea}}{{PageBuilderPanel.draggableContentTypeInPanel(contentType.name)}}" selector2="{{PageBuilderStage.contentTypeContainer(containerTargetType.role, containerTargetIndex)}}" x="{{offsetXCoordinate}}" y="{{offsetYCoordinate}}" stepKey="dropContentTypeIntoStage"/>
4649
<waitForPageLoad stepKey="waitForAnimation" time="30"/>
4750
<dontSeeJsError stepKey="doNotSeeJSErrorInConsole"/>
4851
<waitForElementVisible time="10" selector="{{PageBuilderStage.contentTypeInStageByIndex(contentType.role, contentTypeIndex)}}" stepKey="waitForContentTypeInStage" />
@@ -89,10 +92,11 @@
8992
<argument name="dropZoneIndex" defaultValue="1" type="string"/>
9093
<argument name="offsetXCoordinate" defaultValue="null" type="string"/>
9194
<argument name="offsetYCoordinate" defaultValue="null" type="string"/>
95+
<argument name="pageBuilderArea" defaultValue="" type="string"/>
9296
</arguments>
93-
<scrollTo selector="{{CmsNewPagePageActionsSection.contentSectionName}}" stepKey="scrollToTopOfStage"/>
94-
<waitForElement time="30" selector="{{PageBuilderStage.dropZone(containerTargetType.role, containerTargetIndex, dropZoneIndex)}}" stepKey="waitForStageActive"/>
95-
<dragAndDrop selector1="{{PageBuilderPanel.draggableContentTypeInPanel(contentType.name)}}" selector2="{{PageBuilderStage.dropZone(containerTargetType.role, containerTargetIndex, dropZoneIndex)}}" x="{{offsetXCoordinate}}" y="{{offsetYCoordinate}}" stepKey="dropContentTypeIntoStage"/>
97+
<click selector="{{pageBuilderArea}}{{PageBuilderPanel.searchPanel}}" stepKey="loseFocus"/>
98+
<waitForElementVisible time="30" selector="{{pageBuilderArea}}{{PageBuilderPanel.draggableContentTypeInPanel(contentType.name)}}" stepKey="waitForContentTypeInPanel"/>
99+
<dragAndDrop selector1="{{pageBuilderArea}}{{PageBuilderPanel.draggableContentTypeInPanel(contentType.name)}}" selector2="{{PageBuilderStage.dropZone(containerTargetType.role, containerTargetIndex, dropZoneIndex)}}" x="{{offsetXCoordinate}}" y="{{offsetYCoordinate}}" stepKey="dropContentTypeIntoStage"/>
96100
<waitForPageLoad time="30" stepKey="waitForAnimation"/>
97101
<dontSeeJsError stepKey="doNotSeeJSErrorInConsole"/>
98102
<waitForElementVisible time="30" selector="{{PageBuilderStage.contentTypeInStageByIndex(contentType.role, contentTypeIndex)}}" stepKey="waitForContentTypeInStage"/>

0 commit comments

Comments
 (0)