Skip to content

Commit c350872

Browse files
author
Hwashiang Yu
committed
MC-4057: Fix attached mftf skipped tests
- Fixed failing test due to scrollto event - Updated panel sticky logic to use subscription to prevent errors
1 parent fd76ed2 commit c350872

File tree

4 files changed

+27
-9
lines changed

4 files changed

+27
-9
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@
4848
<argument name="offsetXCoordinate" defaultValue="null" type="string"/>
4949
<argument name="offsetYCoordinate" defaultValue="null" type="string"/>
5050
</arguments>
51+
<scrollTo selector="{{CmsNewPagePageActionsSection.pageTitle}}" stepKey="scrollToTop"/>
5152
<click selector="{{PageBuilderPanel.searchPanel}}" stepKey="lostFocus"/>
5253
<waitForElementVisible time="30" selector="{{PageBuilderPanel.draggableContentTypeInPanel(contentType.name)}}" stepKey="waitForContentTypeInPanel"/>
5354
<dragAndDrop selector1="{{PageBuilderPanel.draggableContentTypeInPanel(contentType.name)}}" selector2="{{PageBuilderStage.contentTypeContainer(containerTargetType.role, containerTargetIndex)}}" x="{{offsetXCoordinate}}" y="{{offsetYCoordinate}}" stepKey="dropContentTypeIntoStage"/>

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,7 @@
324324
<actionGroup ref="fillSlideOutPanelField" stepKey="enterMinHeightPropertySecondRow">
325325
<argument name="property" value="PageBuilderMinHeightProperty_300"/>
326326
</actionGroup>
327-
<actionGroup ref="chooseVisualSelectOption" stepKey="enterVerticalAlignmenCenterProperty">
327+
<actionGroup ref="chooseVisualSelectOption" stepKey="enterVerticalAlignmentCenterProperty">
328328
<argument name="property" value="PageBuilderVerticalAlignmentPropertyCenter"/>
329329
</actionGroup>
330330
<actionGroup ref="saveEditPanelSettings" stepKey="saveEditPanelSettingsSecondRow"/>
@@ -351,7 +351,7 @@
351351
<argument name="property" value="PageBuilderVerticalAlignmentPropertyBottom"/>
352352
</actionGroup>
353353
<actionGroup ref="saveEditPanelSettings" stepKey="saveEditPanelSettingsThirdColumn"/>
354-
<scrollTo selector="{{PageBuilderPanel.searchPanel}}" stepKey="scrollToSearchPanel"/>
354+
<scrollTo selector="{{CmsNewPagePageActionsSection.pageTitle}}" stepKey="scrollToTop2"/>
355355
<actionGroup ref="dragContentTypeToContainer" stepKey="dragHeadingToThirdRow">
356356
<argument name="contentType" value="PageBuilderHeadingContentType"/>
357357
<argument name="containerTargetType" value="PageBuilderRowContentType"/>

app/code/Magento/PageBuilder/view/adminhtml/web/js/panel.js

Lines changed: 14 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/code/Magento/PageBuilder/view/adminhtml/web/ts/js/panel.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,13 @@ import PageBuilder from "./page-builder";
1717
import PanelInterface from "./panel.d";
1818
import {Group} from "./panel/group";
1919
import {ContentType as GroupContentType} from "./panel/group/content-type";
20+
import {DataObject} from "./data-store";
2021

2122
/**
2223
* @api
2324
*/
2425
export default class Panel implements PanelInterface {
26+
public stageReady: KnockoutObservable<boolean> = ko.observable(false);
2527
public groups: KnockoutObservableArray<any> = ko.observableArray([]);
2628
public searchResults: KnockoutObservableArray<any> = ko.observableArray([]);
2729
public isCollapsed: KnockoutObservable<boolean> = ko.observable(false);
@@ -52,6 +54,13 @@ export default class Panel implements PanelInterface {
5254
*/
5355
public afterRender(element: Element): void {
5456
this.element = element;
57+
this.stageReady.subscribe(
58+
(data: boolean) => {
59+
if (data) {
60+
this.onScroll();
61+
}
62+
},
63+
);
5564
}
5665

5766
/**
@@ -60,7 +69,7 @@ export default class Panel implements PanelInterface {
6069
public initListeners(): void {
6170
events.on("stage:" + this.id + ":readyAfter", () => {
6271
this.populateContentTypes();
63-
this.onScroll();
72+
this.stageReady(true);
6473
this.isVisible(true);
6574
});
6675
}

0 commit comments

Comments
 (0)