Skip to content

Commit 9f0a31c

Browse files
committed
MC-3413: Fix Map Tests
- Unskipping map tests - Adding action group to close map error modal - Adding supporting selectors
1 parent 7e43bb1 commit 9f0a31c

9 files changed

+121
-209
lines changed

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

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,15 @@
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="closeGoogleMapsErrorModal">
12+
<arguments>
13+
<argument name="section" defaultValue="AddLocationForm"/>
14+
<argument name="index" defaultValue="1" type="string"/>
15+
</arguments>
16+
<waitForElementVisible selector="{{section.googleModalOkButton(index)}}" stepKey="waitForOkButton"/>
17+
<click selector="{{section.googleModalOkButton(index)}}" stepKey="clickOkButton"/>
18+
<waitForElementNotVisible selector="{{section.googleModalOkButton(index)}}" stepKey="waitForOkButtonNotVisible"/>
19+
</actionGroup>
1120
<actionGroup name="clickAddLocationButton">
1221
<comment userInput="clickAddLocationButton" stepKey="comment"/>
1322
<waitForPageLoad stepKey="waitForPageLoad1"/>
@@ -16,8 +25,6 @@
1625
<waitForPageLoad stepKey="waitForPageLoad2"/>
1726
<waitForElementVisible selector="{{AddLocationForm.form}}" stepKey="waitForForm"/>
1827
<see userInput="Add Location" selector="{{AddLocationForm.formTitle}}" stepKey="seeFormTitle"/>
19-
<waitForElementVisible selector="{{AddLocationForm.base}}" stepKey="waitForLocationMap"/>
20-
<waitForElementVisible selector="{{AddLocationForm.pegman('1')}}" stepKey="waitForLocationMapPegman"/>
2128
</actionGroup>
2229
<actionGroup name="saveLocationForm">
2330
<comment userInput="saveLocationForm" stepKey="comment"/>
@@ -46,8 +53,6 @@
4653
<waitForPageLoad stepKey="waitForPageLoad"/>
4754
<waitForElementVisible selector="{{AddLocationForm.form}}" stepKey="waitForForm"/>
4855
<see userInput="Add Location" selector="{{AddLocationForm.formTitle}}" stepKey="seeFormTitle"/>
49-
<waitForElementVisible selector="{{AddLocationForm.base}}" stepKey="waitForLocationMap"/>
50-
<waitForElementVisible selector="{{AddLocationForm.pegman('1')}}" stepKey="waitForLocationMapPegman"/>
5156
</actionGroup>
5257
<actionGroup name="clickEditButtonOnLocationGrid">
5358
<arguments>
@@ -61,8 +66,6 @@
6166
<waitForPageLoad stepKey="waitForPageLoad"/>
6267
<waitForElementVisible selector="{{AddLocationForm.form}}" stepKey="waitForForm"/>
6368
<see userInput="Add Location" selector="{{AddLocationForm.formTitle}}" stepKey="seeFormTitle"/>
64-
<waitForElementVisible selector="{{AddLocationForm.base}}" stepKey="waitForLocationMap"/>
65-
<waitForElementVisible selector="{{AddLocationForm.pegman('1')}}" stepKey="waitForLocationMapPegman"/>
6669
</actionGroup>
6770
<actionGroup name="deleteLocationFromGrid">
6871
<arguments>

app/code/Magento/PageBuilder/Test/Mftf/Section/PageBuilderMapSection.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
<element name="margins" type="text" selector="(//div[contains(@class,'pagebuilder-map')])[{{arg1}}]/div[contains(@style,'margin: {{arg2}}px;')]" parameterized="true"/>
4242
<element name="padding" type="text" selector="(//div[contains(@class,'pagebuilder-map')])[{{arg1}}]/div[contains(@style,'padding: {{arg2}}px;')]" parameterized="true"/>
4343
<!-- Map Buttons -->
44+
<element name="googleModalOkButton" type="button" selector="(//div[@data-role='map'])[{{arg1}}]//button[@class='dismissButton' and .='OK']" parameterized="true"/>
4445
<element name="fullScreen" type="button" selector="(//div[contains(@class,'pagebuilder-map')])[{{arg1}}]//button[@title='Toggle fullscreen view']" parameterized="true"/>
4546
<element name="allPegmen" type="button" selector="(//div[contains(@class,'pagebuilder-map')])[{{arg1}}]//div[@aria-label='Street View Pegman Control']" parameterized="true"/>
4647
<element name="pegman" type="button" selector="(//div[contains(@class,'pagebuilder-map')])[{{arg1}}]//div[@aria-label='Street View Pegman Control' and not(contains(@style,'visibility: hidden;'))]" parameterized="true"/>
@@ -87,6 +88,7 @@
8788
<element name="margins" type="text" selector="(//div[@data-role='map'])[{{arg1}}][contains(@style,'margin: {{arg2}}px;')]" parameterized="true"/>
8889
<element name="padding" type="text" selector="(//div[@data-role='map'])[{{arg1}}][contains(@style,'padding: {{arg2}}px;')]" parameterized="true"/>
8990
<!-- Map Buttons -->
91+
<element name="googleModalOkButton" type="button" selector="(//div[@data-role='map'])[{{arg1}}]//button[@class='dismissButton' and .='OK']" parameterized="true"/>
9092
<element name="fullScreen" type="button" selector="(//div[@data-role='map'])[{{arg1}}]//button[@title='Toggle fullscreen view']" parameterized="true"/>
9193
<element name="allPegmen" type="button" selector="(//div[@data-role='map'])[{{arg1}}]//div[@aria-label='Street View Pegman Control']" parameterized="true"/>
9294
<element name="pegman" type="button" selector="(//div[@data-role='map'])[{{arg1}}]//div[@aria-label='Street View Pegman Control' and not(contains(@style,'visibility: hidden;'))]" parameterized="true"/>
@@ -119,6 +121,7 @@
119121
<element name="warningMessageLink" type="button" selector="//div[contains(@class, 'pagebuilder_modal_form_pagebuilder_modal_form_modal')]//div[contains(@class, 'message-warning')]//a"/>
120122
<element name="renderedMap" type="button" selector="//div[@data-index='position']//div[@class='map-field']/div/div[contains(@class, 'gm-style')]"/>
121123
<!-- Map Buttons -->
124+
<element name="googleModalOkButton" type="button" selector="//aside//button[@class='dismissButton' and .='OK'][{{arg1}}]" parameterized="true"/>
122125
<element name="fullScreen" type="button" selector="(//div[@data-index='position']//div[@class='map-field']//button[@title='Toggle fullscreen view'])[{{arg1}}]" parameterized="true"/>
123126
<element name="pegman" type="button" selector="(//div[@data-index='position']//div[@class='map-field']//div[@aria-label='Street View Pegman Control' and not(contains(@style,'visibility: hidden;'))])[{{arg1}}]" parameterized="true"/>
124127
<element name="satelliteView" type="button" selector="(//div[@data-index='position']//div[@class='map-field']//div[@title='Show satellite imagery'])[{{arg1}}]" parameterized="true"/>

app/code/Magento/PageBuilder/Test/Mftf/Suite/suite.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<suite name="PageBuilderWithWYSIWYG">
1010
<before>
1111
<createData stepKey="enablePageBuilderAndWYSIWYG" entity="enablePageBuilderAndWYSIWYGForm"/>
12-
<magentoCLI command="config:set cms/pagebuilder/google_maps_api_key AIzaSyCw10cOO31cpxb2bcwnHPHKtxov8oUbxJw" stepKey="setGoogleMapsAPIKey"/>
12+
<magentoCLI command="config:set cms/pagebuilder/google_maps_api_key {{googleMapsAPIKey.valid}}" stepKey="setGoogleMapsAPIKey"/>
1313
</before>
1414
<after>
1515
<createData stepKey="DisabledWYSIWYG" entity="disableWYSYWYGForm"/>

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

Lines changed: 15 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,6 @@
2020
<group value="pagebuilder"/>
2121
<group value="pagebuilder-map"/>
2222
<group value="pagebuilder-mapCommon"/>
23-
<skip>
24-
<issueId value="MC-3413"/>
25-
</skip>
2623
</annotations>
2724
<before>
2825
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/>
@@ -57,6 +54,7 @@
5754
<!-- Validate Edit Panel: Add Location Form -->
5855
<comment userInput="Validate Edit Panel: Add Location Form" stepKey="commentValidateEditPanelAddLocationForm"/>
5956
<actionGroup ref="clickAddLocationButton" stepKey="clickAddLocationButton1"/>
57+
<actionGroup ref="closeGoogleMapsErrorModal" stepKey="closeGoogleMapsErrorModal"/>
6058
<actionGroup ref="validateSlideOutPanelField" stepKey="seePositionAttribute">
6159
<argument name="property" value="PageBuilderMapPositionDefaultProperty"/>
6260
</actionGroup>
@@ -142,7 +140,7 @@
142140
<!-- Validate Edit Panel: Add Location Form 2 -->
143141
<comment userInput="Validate Edit Panel: Add Location Form 2" stepKey="commentValidateEditPanelAddLocationForm2"/>
144142
<actionGroup ref="clickAddLocationButton" stepKey="clickAddLocationButton2"/>
145-
<waitForElementVisible selector="{{AddLocationForm.base}}" stepKey="waitForMapVisible2"/>
143+
<actionGroup ref="closeGoogleMapsErrorModal" stepKey="closeGoogleMapsErrorModal2"/>
146144
<actionGroup ref="validateMapButtons" stepKey="validateMapButtonsEditPanel2">
147145
<argument name="page" value="AddLocationForm"/>
148146
</actionGroup>
@@ -357,9 +355,6 @@
357355
<group value="pagebuilder"/>
358356
<group value="pagebuilder-map"/>
359357
<group value="pagebuilder-mapCommon"/>
360-
<skip>
361-
<issueId value="MC-3413"/>
362-
</skip>
363358
</annotations>
364359
<before>
365360
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/>
@@ -381,6 +376,7 @@
381376
<!-- Add Location -->
382377
<comment userInput="Add Location" stepKey="commentAddLocation"/>
383378
<actionGroup ref="clickAddLocationButton" stepKey="clickAddLocationButton1"/>
379+
<actionGroup ref="closeGoogleMapsErrorModal" stepKey="closeGoogleMapsErrorModal"/>
384380
<actionGroup ref="clickMapToAddOrMovePin" stepKey="addMapPin"/>
385381
<actionGroup ref="fillSlideOutPanelFieldGeneral" stepKey="enterLocationName">
386382
<argument name="property" value="PageBuilderMapLocationName_TestLocation"/>
@@ -532,9 +528,6 @@
532528
<group value="pagebuilder"/>
533529
<group value="pagebuilder-map"/>
534530
<group value="pagebuilder-mapCommon"/>
535-
<skip>
536-
<issueId value="MC-3413"/>
537-
</skip>
538531
</annotations>
539532
<before>
540533
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/>
@@ -556,6 +549,7 @@
556549
<!-- Add Location 1 -->
557550
<comment userInput="Add Location 1" stepKey="commentAddLocation1"/>
558551
<actionGroup ref="clickAddLocationButton" stepKey="clickAddLocationButton1"/>
552+
<actionGroup ref="closeGoogleMapsErrorModal" stepKey="closeGoogleMapsErrorModal"/>
559553
<actionGroup ref="clickMapToAddOrMovePin" stepKey="addMapPin"/>
560554
<!-- Location Form: Get Initial Coordinates -->
561555
<comment userInput="Location Form: Get Initial Coordinates" stepKey="commentLocationFormGetCoordinates"/>
@@ -593,6 +587,7 @@
593587
<!-- Add 2nd Location -->
594588
<comment userInput="Add 2nd Location" stepKey="commentAddLocation2"/>
595589
<actionGroup ref="clickAddLocationButton" stepKey="clickAddLocationButton2"/>
590+
<actionGroup ref="closeGoogleMapsErrorModal" stepKey="closeGoogleMapsErrorModal2"/>
596591
<actionGroup ref="fillSlideOutPanelFieldGeneral" stepKey="enterLatitude">
597592
<argument name="property" value="PageBuilderMapLatitude_Positive39_74"/>
598593
</actionGroup>
@@ -683,6 +678,7 @@
683678
<actionGroup ref="saveEditPanelSettings" stepKey="saveEditPanelSettings"/>
684679
<!-- Validate Stage -->
685680
<comment userInput="Validate Stage" stepKey="commentValidateStage1"/>
681+
<actionGroup ref="closeGoogleMapsErrorModal" stepKey="closeGoogleMapsErrorModal3"/>
686682
<actionGroup ref="validateMapSettings" stepKey="validateMapStage1">
687683
<argument name="page" value="MapOnStage"/>
688684
<argument name="height" value="PageBuilderMapHeightProperty350"/>
@@ -734,6 +730,7 @@
734730
<actionGroup ref="switchToPageBuilderStage" stepKey="switchToPageBuilderStage"/>
735731
<!-- Validate Stage After Save -->
736732
<comment userInput="Validate Stage After Save" stepKey="commentValidateStage2"/>
733+
<actionGroup ref="closeGoogleMapsErrorModal" stepKey="closeGoogleMapsErrorModal4"/>
737734
<actionGroup ref="validateMapSettings" stepKey="validateMapStage2">
738735
<argument name="page" value="MapOnStage"/>
739736
<argument name="height" value="PageBuilderMapHeightProperty350"/>
@@ -941,6 +938,7 @@
941938
<actionGroup ref="navigateToStoreFront" stepKey="navigateToStoreFront">
942939
<argument name="contentType" value="PageBuilderMapContentType"/>
943940
</actionGroup>
941+
<actionGroup ref="closeGoogleMapsErrorModal" stepKey="closeGoogleMapsErrorModal5"/>
944942
<actionGroup ref="validateMapSettings" stepKey="validateMapStoreFront">
945943
<argument name="page" value="MapOnStorefront"/>
946944
<argument name="height" value="PageBuilderMapHeightProperty350"/>
@@ -1001,9 +999,6 @@
1001999
<group value="pagebuilder"/>
10021000
<group value="pagebuilder-map"/>
10031001
<group value="pagebuilder-mapCommon"/>
1004-
<skip>
1005-
<issueId value="MC-3413"/>
1006-
</skip>
10071002
</annotations>
10081003
<before>
10091004
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/>
@@ -1025,6 +1020,7 @@
10251020
<!-- Add Location 1 -->
10261021
<comment userInput="Add Location 1" stepKey="commentAddLocation1"/>
10271022
<actionGroup ref="clickAddLocationButton" stepKey="clickAddLocationButton1"/>
1023+
<actionGroup ref="closeGoogleMapsErrorModal" stepKey="closeGoogleMapsErrorModal"/>
10281024
<actionGroup ref="clickMapToAddOrMovePin" stepKey="addMapPin"/>
10291025
<!-- Location 1 Form: Get Initial Coordinates -->
10301026
<comment userInput="Location 1 Form: Get Initial Coordinates" stepKey="commentLocationFormGetCoordinates"/>
@@ -1062,6 +1058,7 @@
10621058
<!-- Add 2nd Location -->
10631059
<comment userInput="Add 2nd Location" stepKey="commentAddLocation2"/>
10641060
<actionGroup ref="clickAddLocationButton" stepKey="clickAddLocationButton2"/>
1061+
<actionGroup ref="closeGoogleMapsErrorModal" stepKey="closeGoogleMapsErrorModal2"/>
10651062
<actionGroup ref="fillSlideOutPanelFieldGeneral" stepKey="enterLatitude">
10661063
<argument name="property" value="PageBuilderMapLatitude_Positive39_74"/>
10671064
</actionGroup>
@@ -1167,6 +1164,7 @@
11671164
</actionGroup>
11681165
<!-- Stage: Verify Map Pin Positions On Duplicate -->
11691166
<comment userInput="Stage: Verify Map Pin Positions On Duplicate" stepKey="commentValidateStagePin"/>
1167+
<actionGroup ref="closeGoogleMapsErrorModal" stepKey="closeGoogleMapsErrorModal3"/>
11701168
<waitForElementVisible selector="{{MapOnStage.pinLocations('2')}}" stepKey="waitForPinLocationStage2"/>
11711169
<grabAttributeFrom selector="{{MapOnStage.pinLocations('2')}}" userInput="style" stepKey="duplicatePinLocationStage"/>
11721170
<assertEquals stepKey="assertPinLocationTheSameStage1">
@@ -1388,6 +1386,7 @@
13881386
</actionGroup>
13891387
<!-- Stage: Verify Map Pin Positions On Duplicate After Save -->
13901388
<comment userInput="Stage: Verify Map Pin Positions On Duplicate After Save" stepKey="commentValidateStagePinAfterSave"/>
1389+
<actionGroup ref="closeGoogleMapsErrorModal" stepKey="closeGoogleMapsErrorModal4"/>
13911390
<waitForElementVisible selector="{{MapOnStage.pinLocations('2')}}" stepKey="waitForPinLocationStage3"/>
13921391
<grabAttributeFrom selector="{{MapOnStage.pinLocations('2')}}" userInput="style" stepKey="duplicatePinLocationStage2"/>
13931392
<assertEquals stepKey="assertPinLocationTheSameStage2">
@@ -1607,6 +1606,7 @@
16071606
</actionGroup>
16081607
<!-- Storefront: Verify Map Pin Positions On Duplicate -->
16091608
<comment userInput="Storefront: Verify Map Pin Positions On Duplicate" stepKey="commentValidateStorefrontPin"/>
1609+
<actionGroup ref="closeGoogleMapsErrorModal" stepKey="closeGoogleMapsErrorModal5"/>
16101610
<waitForElementVisible selector="{{MapOnStorefront.pinLocations('2')}}" stepKey="waitForPinLocationStoreFront2"/>
16111611
<grabAttributeFrom selector="{{MapOnStorefront.pinLocations('2')}}" userInput="style" stepKey="duplicatePinLocationStoreFront"/>
16121612
<assertEquals stepKey="assertPinLocationTheSameStorefront">
@@ -1740,9 +1740,6 @@
17401740
<group value="pagebuilder"/>
17411741
<group value="pagebuilder-column"/>
17421742
<group value="pagebuilder-map"/>
1743-
<skip>
1744-
<issueId value="MC-3413"/>
1745-
</skip>
17461743
</annotations>
17471744
<before>
17481745
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/>
@@ -1771,6 +1768,7 @@
17711768
<!-- Update Edit Panel -->
17721769
<comment userInput="Update Edit Panel" stepKey="commentEdit"/>
17731770
<actionGroup ref="clickAddLocationButton" stepKey="clickAddLocationButton"/>
1771+
<actionGroup ref="closeGoogleMapsErrorModal" stepKey="closeGoogleMapsErrorModal"/>
17741772
<actionGroup ref="clickMapToAddOrMovePin" stepKey="addMapPin"/>
17751773
<!-- Add Fill Required Fields -->
17761774
<comment userInput="Add Fill Required Fields" stepKey="commentAddFillRequiredFields"/>
@@ -1829,9 +1827,6 @@
18291827
<group value="pagebuilder"/>
18301828
<group value="pagebuilder-map"/>
18311829
<group value="pagebuilder-column"/>
1832-
<skip>
1833-
<issueId value="MC-3413"/>
1834-
</skip>
18351830
</annotations>
18361831
<before>
18371832
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/>
@@ -1876,6 +1871,7 @@
18761871
<!-- Update Edit Panel -->
18771872
<comment userInput="Update Edit Panel" stepKey="commentEdit"/>
18781873
<actionGroup ref="clickAddLocationButton" stepKey="clickAddLocationButton"/>
1874+
<actionGroup ref="closeGoogleMapsErrorModal" stepKey="closeGoogleMapsErrorModal"/>
18791875
<actionGroup ref="clickMapToAddOrMovePin" stepKey="addMapPin"/>
18801876
<!-- Fill Required Fields -->
18811877
<comment userInput="Fill Required Fields" stepKey="commentFillRequiredFields"/>

0 commit comments

Comments
 (0)