Skip to content

Commit 492d9a8

Browse files
committed
B2B-2126: [S3 MFTF] Flaky test AdminMediaGalleryPopupUploadImagesWithoutErrorTest
- Fixing flaky test
1 parent cff8851 commit 492d9a8

File tree

5 files changed

+10
-3
lines changed

5 files changed

+10
-3
lines changed

app/code/Magento/Cms/Test/Mftf/ActionGroup/ClickBrowseBtnOnUploadPopupActionGroup.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,10 @@
1313
<description>Clicks on the Browse button in the 'Insert/edit image' model.</description>
1414
</annotations>
1515

16+
<waitForElementVisible selector="{{MediaGallerySection.Browse}}" stepKey="waitForBrowseButton"/>
1617
<click selector="{{MediaGallerySection.Browse}}" stepKey="clickBrowse"/>
1718
<waitForPageLoad stepKey="waitForPageLoad1"/>
19+
<waitForElementVisible selector="{{MediaGallerySection.mediaGalleryModal}}" stepKey="waitForMediaGallery"/>
20+
<waitForPageLoad stepKey="waitForPageLoad2"/>
1821
</actionGroup>
1922
</actionGroups>

app/code/Magento/Cms/Test/Mftf/ActionGroup/ClickInsertEditImageTinyMCEButtonActionGroup.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
<description>Clicks on the 'Insert/edit image' TinyMCE button.</description>
1414
</annotations>
1515

16+
<waitForElementVisible selector="{{TinyMCESection.InsertImageIcon}}" stepKey="waitForInsertImageBtn" />
1617
<click selector="{{TinyMCESection.InsertImageIcon}}" stepKey="clickInsertImageBtn" />
1718
<waitForPageLoad stepKey="waitForPageLoad"/>
1819
</actionGroup>

app/code/Magento/Cms/Test/Mftf/ActionGroup/NavigateToCreatedCMSBlockPageActionGroup.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,14 @@
2121
<conditionalClick selector="{{CmsPagesPageActionsSection.clearAllButton}}" dependentSelector="{{CmsPagesPageActionsSection.activeFilters}}" stepKey="clickToResetFilter" visible="true"/>
2222
<waitForPageLoad stepKey="waitForPageLoad2"/>
2323
<conditionalClick selector="{{BlockPageActionsSection.idColumn}}" dependentSelector="//span[contains(text(), 'ID')]/parent::th[not(contains(@class, '_descend'))]/parent::tr/parent::thead/parent::table/parent::div[contains(@data-role, 'grid-wrapper')]" stepKey="clickToAttemptSortByIdDescending" visible="true"/>
24-
<waitForLoadingMaskToDisappear stepKey="waitForFirstIdSortDescendingToFinish"/>
24+
<waitForPageLoad stepKey="waitForFirstIdSortDescendingToFinish"/>
2525

2626
<!-- Conditional Click again in case it goes from default state to ascending on first click -->
2727
<conditionalClick selector="{{BlockPageActionsSection.idColumn}}" dependentSelector="//span[contains(text(), 'ID')]/parent::th[not(contains(@class, '_descend'))]/parent::tr/parent::thead/parent::table/parent::div[contains(@data-role, 'grid-wrapper')]" stepKey="secondClickToAttemptSortByIdDescending" visible="true"/>
28-
<waitForLoadingMaskToDisappear stepKey="waitForSecondIdSortDescendingToFinish"/>
28+
<waitForPageLoad stepKey="waitForSecondIdSortDescendingToFinish"/>
2929
<click selector="{{BlockPageActionsSection.select(CMSBlockPage.identifier)}}" stepKey="clickSelectCreatedCMSBlock"/>
3030
<click selector="{{BlockPageActionsSection.edit(CMSBlockPage.identifier)}}" stepKey="navigateToCreatedCMSBlock"/>
3131
<waitForPageLoad stepKey="waitForPageLoad3"/>
32-
<waitForLoadingMaskToDisappear stepKey="waitForLoadingMaskOfStagingSection"/>
32+
<waitForPageLoad stepKey="waitForLoadingMaskOfStagingSection"/>
3333
</actionGroup>
3434
</actionGroups>

app/code/Magento/Cms/Test/Mftf/Section/TinyMCESection/MediaGallerySection.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,5 +39,6 @@
3939
<element name="insertEditImageModalWindow" type="block" selector=".mce-floatpanel.mce-window[aria-label='Insert/edit image']"/>
4040
<element name="mediaGalleryFolderTreeIconCollapsed" type="button" parameterized="true" selector="//li[a[text()='{{folderName}}' and @aria-expanded='false']]/i"/>
4141
<element name="mediaGalleryFolderTreeIconExpanded" type="button" parameterized="true" selector="//li[a[text()='{{folderName}}' and @aria-expanded='true']]/i"/>
42+
<element name="mediaGalleryModal" type="block" selector="//aside[contains(@class,'_show')]//div[@class='media-gallery-container' or @class='media-gallery-modal']"/>
4243
</section>
4344
</sections>

app/code/Magento/Cms/Test/Mftf/Test/AdminMediaGalleryPopupUploadImagesWithoutErrorTest.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,13 +69,15 @@
6969
<actionGroup ref="SaveImageActionGroup" stepKey="insertImage"/>
7070
<actionGroup ref="AdminMediaGalleryClickOkButtonTinyMceActionGroup" stepKey="clickOk"/>
7171
<click selector="{{TinyMCESection.ShowHideBtn}}" stepKey="clickShowHideBtnFirstTime"/>
72+
<waitForPageLoad stepKey="waitForPageLoad1"/>
7273
<click selector="{{TinyMCESection.ShowHideBtn}}" stepKey="clickShowHideBtnSecondTime"/>
7374
<waitForPageLoad stepKey="waitForPageLoad"/>
7475
<!--Switch to content frame and click on image-->
7576
<comment userInput="Switch to content frame and click on image" stepKey="commentSwitchToIframe"/>
7677
<switchToIFrame selector="{{TinyMCESection.EditAreaIframe}}" stepKey="switchToContentFrame"/>
7778
<click selector="{{TinyMCESection.IframeContent}} {{BlockContentSection.image}}" stepKey="clickImage"/>
7879
<switchToIFrame stepKey="switchBack"/>
80+
<waitForPageLoad stepKey="waitForPageLoad2"/>
7981
<!--Add image second time and assert-->
8082
<comment userInput="Add image second time and assert" stepKey="commentAddImageAndAssert"/>
8183
<comment userInput="BIC workaround" stepKey="addImageSecondTime"/>

0 commit comments

Comments
 (0)