Skip to content

Commit 09d2fb8

Browse files
Merge pull request #524 from magento/425_slider-infinite-loop-fix
#425: Infinite Loop Disabled on Slider Does Not Work Correctly
2 parents a5d7366 + cf80c91 commit 09d2fb8

File tree

13 files changed

+285
-10
lines changed

13 files changed

+285
-10
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
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" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
9+
<actionGroup name="nextSlide">
10+
<annotations>
11+
<description>Clicks the "Next" arrow on a slider instance (irrespective of the arrow's state).</description>
12+
</annotations>
13+
<arguments>
14+
<argument name="sliderSection" defaultValue="SliderOnStage"/>
15+
<argument name="slideSection" defaultValue="SlideOnBackend"/>
16+
<argument name="sliderIndex" defaultValue="1" type="string"/>
17+
<argument name="slideIndex" defaultValue="1" type="string"/>
18+
</arguments>
19+
<waitForElementVisible selector="{{sliderSection.nextSlideArrow(sliderIndex)}}" stepKey="waitForNextSlideArrow"/>
20+
<click selector="{{sliderSection.nextSlideArrow(sliderIndex)}}" stepKey="clickNextSlideArrow"/>
21+
<waitForPageLoad stepKey="waitForPageLoad"/>
22+
<waitForElementVisible selector="{{slideSection.base(slideIndex)}}" stepKey="waitForSlide"/>
23+
</actionGroup>
24+
</actionGroups>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
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" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
9+
<actionGroup name="validateSliderAttributesActionGroup">
10+
<annotations>
11+
<description>Validates a slider instance based on its HTML attributes.</description>
12+
</annotations>
13+
<arguments>
14+
<argument name="sliderSection" defaultValue="SliderOnStage"/>
15+
<argument name="sliderIndex" defaultValue="1" type="string"/>
16+
<argument name="sliderAutoplay" defaultValue="{{PageBuilderSliderAutoPlay_Disabled.value}}" type="string"/>
17+
<argument name="sliderAutoplaySpeed" defaultValue="{{PageBuilderSliderAutoPlaySpeed_Default.value}}" type="string"/>
18+
<argument name="sliderFade" defaultValue="{{PageBuilderSliderFade_Disabled.value}}" type="string"/>
19+
<argument name="sliderInfiniteLoop" defaultValue="{{PageBuilderSliderInfiniteLoop_Disabled.value}}" type="string"/>
20+
<argument name="sliderShowArrows" defaultValue="{{PageBuilderSliderShowArrows_Disabled.value}}" type="string"/>
21+
<argument name="sliderShowDots" defaultValue="{{PageBuilderSliderShowDots_Enabled.value}}" type="string"/>
22+
</arguments>
23+
<waitForElementVisible selector="{{sliderSection.autoPlay(sliderIndex, sliderAutoplay)}}" stepKey="seeAutoplay"/>
24+
<waitForElementVisible selector="{{sliderSection.autoPlaySpeed(sliderIndex, sliderAutoplaySpeed)}}" stepKey="seeAutoplaySpeed"/>
25+
<waitForElementVisible selector="{{sliderSection.fade(sliderIndex, sliderFade)}}" stepKey="seeFade"/>
26+
<waitForElementVisible selector="{{sliderSection.infiniteLoop(sliderIndex, sliderInfiniteLoop)}}" stepKey="seeInfiniteLoop"/>
27+
<waitForElementVisible selector="{{sliderSection.showArrows(sliderIndex, sliderShowArrows)}}" stepKey="seeShowArrows"/>
28+
<waitForElementVisible selector="{{sliderSection.showDots(sliderIndex, sliderShowDots)}}" stepKey="seeShowDots"/>
29+
</actionGroup>
30+
</actionGroups>

app/code/Magento/PageBuilder/Test/Mftf/Section/PageBuilderSliderSection/SliderOnFrontendSection.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,11 @@
1414
<element name="notHidden" type="button" selector="(//div[@data-content-type='slider'])[{{sliderIndex}}][not(contains(@style,'display: none'))]" parameterized="true"/>
1515
<element name="slideNavigationDot" type="button" selector="((//div[@data-content-type='slider'])[{{sliderIndex}}]//ul[@class='slick-dots']//button)[{{navigationDotIndex}}]" parameterized="true"/>
1616
<element name="previousSlideArrow" type="button" selector="(//div[@data-content-type='slider'])[{{sliderIndex}}]//button[contains(@class,'slick-arrow') and contains(@class,'slick-prev')]" parameterized="true"/>
17+
<element name="previousSlideArrowDisabled" type="button" selector="(//div[@data-content-type='slider'])[{{sliderIndex}}]//button[contains(@class,'slick-arrow') and contains(@class,'slick-prev') and contains(@class,'slick-disabled')]" parameterized="true"/>
18+
<element name="previousSlideArrowEnabled" type="button" selector="(//div[@data-content-type='slider'])[{{sliderIndex}}]//button[contains(@class,'slick-arrow') and contains(@class,'slick-prev') and not(contains(@class,'slick-disabled'))]" parameterized="true"/>
1719
<element name="nextSlideArrow" type="button" selector="(//div[@data-content-type='slider'])[{{sliderIndex}}]//button[contains(@class,'slick-arrow') and contains(@class,'slick-next')]" parameterized="true"/>
20+
<element name="nextSlideArrowDisabled" type="button" selector="(//div[@data-content-type='slider'])[{{sliderIndex}}]//button[contains(@class,'slick-arrow') and contains(@class,'slick-next') and contains(@class,'slick-disabled')]" parameterized="true"/>
21+
<element name="nextSlideArrowEnabled" type="button" selector="(//div[@data-content-type='slider'])[{{sliderIndex}}]//button[contains(@class,'slick-arrow') and contains(@class,'slick-next') and not(contains(@class,'slick-disabled'))]" parameterized="true"/>
1822
<!-- Settings Configuration -->
1923
<element name="autoPlay" type="button" selector="(//div[@data-content-type='slider'])[{{sliderIndex}}][@data-autoplay='{{autoplay}}']" parameterized="true"/>
2024
<element name="autoPlaySpeed" type="button" selector="(//div[@data-content-type='slider'])[{{sliderIndex}}][@data-autoplay-speed='{{autoplaySpeed}}']" parameterized="true"/>

app/code/Magento/PageBuilder/Test/Mftf/Section/PageBuilderTabsSection/TabOnStageSection.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@
1919
<element name="tabHeaderItemActive" type="button" selector="//ul[contains(@class, 'tabs-navigation')]/li[{{arg1}}][contains(@class, 'ui-state-active')]" parameterized="true"/>
2020
<element name="tabHeaderItemAdvancedStyles" type="button" selector="(//div[contains(@class,'pagebuilder-tabs')]//descendant::*[contains(@class,'tabs-navigation')]/li[contains(@style, 'border-style: solid; border-radius: 12px; border-color: rgb(0, 0, 0); border-width: 10px; margin-bottom: -10px; margin-left: -10px;')])"/>
2121
<element name="tab1ContentAdvancedStyles" type="button" selector="(//div[contains(@class,'pagebuilder-tabs')]//div[contains(@class,'ui-tabs-panel')])[1]//div[contains(@class, 'pagebuilder-tab-item') and contains(@style, 'text-align: center;') and contains(@style, 'border-style: solid;') and contains(@style, 'border-color: rgb(0, 0, 0);') and contains(@style, 'border-width: 10px;') and contains(@style, 'border-radius: 12px;') and contains(@style, 'margin: 5px;') and contains(@style, 'padding: 5px;')]"/>
22-
<element name="tab2ContentAdvancedStyles" type="button" selector="(//div[contains(@class,'pagebuilder-tabs')]//div[contains(@class,'ui-tabs-panel')])[2]//div[contains(@class, 'pagebuilder-tab-item') and contains(@style, 'text-align: right;') and contains(@style, 'border-style: dotted;') and contains(@style, 'border-color: rgb(255, 0, 0);') and contains(@style, 'border-width: 500px;') and contains(@style, 'border-radius: 500px;') and contains(@style, 'margin: 1px 2px 3px 4px;') and contains(@style, 'padding: 1px 2px 3px 4px;')]"/>
22+
<element name="tab2ContentAdvancedStyles" type="button" selector="(//div[contains(@class,'pagebuilder-tabs')]//div[contains(@class,'ui-tabs-panel')])[2]//div[contains(@class, 'pagebuilder-tab-item')][not(contains(@style, 'border-width:'))][not(contains(@style, 'border-radius:'))]"/>
23+
<element name="tab3ContentAdvancedStyles" type="button" selector="(//div[contains(@class,'pagebuilder-tabs')]//div[contains(@class,'ui-tabs-panel')])[3]//div[contains(@class, 'pagebuilder-tab-item') and contains(@style, 'text-align: right;') and contains(@style, 'border-style: dotted;') and contains(@style, 'border-color: rgb(255, 0, 0);') and contains(@style, 'border-width: 500px;') and contains(@style, 'border-radius: 500px;') and contains(@style, 'margin: 1px 2px 3px 4px;') and contains(@style, 'padding: 1px 2px 3px 4px;')]"/>
2324
<element name="empty" type="button" selector="(//div[contains(@class, 'pagebuilder-tabs')]//div[contains(@class, 'pagebuilder-tab-item') and contains(@class, 'empty-container')])"/>
2425
<element name="openOptionsMenu" type="button" selector="(//ul[contains(@class,'tabs-navigation')]//a[contains(@class,'tab-title')])[{{arg1}}]" parameterized="true"/>
2526
<element name="optionsMenu" type="button" selector="(//ul[contains(@class,'tabs-navigation')]//div[contains(@class,'pagebuilder-options-wrapper')])[{{arg1}}]" parameterized="true"/>

app/code/Magento/PageBuilder/Test/Mftf/Section/PageBuilderTabsSection/TabOnStorefrontSection.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
<element name="tabContentType" type="button" selector="(//div[@class='tabs-content']//div[@data-content-type='tab-item'])[{{arg1}}]/div[1]/hr" parameterized="true"/>
2727
<element name="tabContentText" type="button" selector="(//div[@class='tabs-content']//div[@data-content-type='tab-item'])[{{arg1}}]//div[contains(@data-content-type, 'text')][1]" parameterized="true"/>
2828
<element name="tabContentAdvancedStylesBorder" type="button" selector="(//div[@class='tabs-content']//div[@data-content-type='tab-item'])[{{arg1}}][contains(@style, 'border-style: {{arg2}}') and contains(@style, 'border-color: {{arg3}}') and contains(@style, 'border-width: {{arg4}}px') and contains(@style, 'border-radius: {{arg5}}px')]" parameterized="true"/>
29+
<element name="tabContentAdvancedStylesBorderEmpty" type="button" selector="(//div[@class='tabs-content']//div[@data-content-type='tab-item'])[{{arg1}}][contains(@style, 'border-style: {{arg2}}') and contains(@style, 'border-color: {{arg3}}')][not(contains(@style, 'border-width:'))][not(contains(@style, 'border-radius:'))]" parameterized="true"/>
2930
<element name="tabContentAdvancedStyles" type="button" selector="(//div[@class='tabs-content']//div[@data-content-type='tab-item'])[{{arg1}}][contains(@style, 'text-align: {{arg2}}') and contains(@style, 'margin: {{arg3}}px') and contains(@style, 'padding: {{arg4}}px')]" parameterized="true"/>
3031
<element name="tabContentAdvancedClass" type="button" selector="(//div[@class='tabs-content']//div[@data-content-type='tab-item'])[{{arg1}}][contains(@class, '{{arg2}}')]" parameterized="true"/>
3132
<!-- Background Configuration -->

app/code/Magento/PageBuilder/Test/Mftf/Test/AdminCMSBlockPageBuilderTest/PageBuilderCmsBlockAddAndEditRowColumnSlideTest.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@
6868
<seeElement selector="{{RowOnStorefront.backgroundColor('3', PageBuilderBackgroundColor_Hex_Grey.rgb)}}" stepKey="seeBackgroundColorRowCMSPageStage" after="see3RowsCMSPageStage"/>
6969
<seeNumberOfElements selector="{{ColumnOnFrontend.allColumns}}" userInput="2" stepKey="see2ColumnsCMSPageStage" after="seeBackgroundColorRowCMSPageStage"/>
7070
<seeElement selector="{{ColumnOnFrontend.backgroundColor('2', PageBuilderBackgroundColor_Hex_White.rgb)}}" stepKey="seeBackgroundColorColumnCMSPageStage" after="see2ColumnsCMSPageStage"/>
71-
<seeElement selector="{{SlideOnFrontend.backgroundColor('2', PageBuilderBackgroundColor_Plaintext_Green.rgb)}}" stepKey="seeBackgroundColorSlide1CMSPageStage" after="seeBackgroundColorColumnCMSPageStage"/>
71+
<seeElement selector="{{SlideOnFrontend.backgroundColor('1', PageBuilderBackgroundColor_Plaintext_Green.rgb)}}" stepKey="seeBackgroundColorSlide1CMSPageStage" after="seeBackgroundColorColumnCMSPageStage"/>
7272
<actionGroup ref="SaveAndContinueEditCmsPageActionGroup" stepKey="saveAndContinueEditCmsPage" after="seeBackgroundColorSlide1CMSPageStage"/>
7373
<!-- Validate CMS Page Storefront -->
7474
<actionGroup ref="NavigateToStorefrontForCreatedPageActionGroup" stepKey="navigateToProductStorefront">

app/code/Magento/PageBuilder/Test/Mftf/Test/AdminCatalogProductPageBuilderTest/PageBuilderCatalogProductAddAndEditRowColumnSlideTest.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,12 +150,12 @@
150150
<seeElement selector="{{RowOnStorefront.backgroundColor('2', PageBuilderBackgroundColor_Hex_Grey.rgb)}}" stepKey="seeBackgroundColorRowStorefront"/>
151151
<seeNumberOfElements selector="{{ColumnOnFrontend.allColumns}}" userInput="2" stepKey="see2ColumnsStorefront"/>
152152
<seeElement selector="{{ColumnOnFrontend.backgroundColor('2', PageBuilderBackgroundColor_Hex_White.rgb)}}" stepKey="seeBackgroundColorColumnStorefront"/>
153-
<seeElement selector="{{SlideOnFrontend.backgroundColor('2', PageBuilderBackgroundColor_Plaintext_Green.rgb)}}" stepKey="seeBackgroundColorSlide1Storefront"/>
153+
<seeElement selector="{{SlideOnFrontend.backgroundColor('1', PageBuilderBackgroundColor_Plaintext_Green.rgb)}}" stepKey="seeBackgroundColorSlide1Storefront"/>
154154
<actionGroup ref="switchSlide" stepKey="switchSlideStorefront">
155155
<argument name="sliderSection" value="SliderOnFrontend"/>
156156
<argument name="slideSection" value="SlideOnFrontend"/>
157157
<argument name="slideIndex" value="2"/>
158158
</actionGroup>
159-
<seeElement selector="{{SlideOnFrontend.backgroundColor('3', PageBuilderBackgroundColor_RGB_Blue.rgb)}}" stepKey="seeBackgroundColorSlide2Storefront"/>
159+
<seeElement selector="{{SlideOnFrontend.backgroundColor('2', PageBuilderBackgroundColor_RGB_Blue.rgb)}}" stepKey="seeBackgroundColorSlide2Storefront"/>
160160
</test>
161161
</tests>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
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+
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
9+
<test name="SliderValidateInfiniteLoopDisabled" extends="SliderValidateInfiniteLoopEnabled">
10+
<annotations>
11+
<features value="PageBuilder"/>
12+
<stories value="Slider"/>
13+
<title value="Slider - Validate Infinite Looping (Disabled)"/>
14+
<description value="A user should not be able to navigate before the first slide, or after the last slide when Infinite Loop is disabled."/>
15+
<severity value="BLOCKER"/>
16+
<group value="pagebuilder"/>
17+
<group value="pagebuilder-slide"/>
18+
<group value="pagebuilder-sliderCommon"/>
19+
</annotations>
20+
<!-- Open Slider Settings -->
21+
<actionGroup ref="conditionalClickSlideOutPanelFieldGeneral" stepKey="enterInfiniteLoop">
22+
<argument name="property" value="PageBuilderSliderInfiniteLoop_Disabled"/>
23+
</actionGroup>
24+
<!-- Validate Stage: Slider Settings -->
25+
<actionGroup ref="validateSliderAttributesActionGroup" stepKey="seeSliderStage">
26+
<argument name="sliderFade" value="{{PageBuilderSliderFade_Enabled.value}}"/>
27+
<argument name="sliderShowArrows" value="{{PageBuilderSliderShowArrows_Enabled.value}}"/>
28+
</actionGroup>
29+
<!-- Validate Storefront: Slider Settings -->
30+
<actionGroup ref="validateSliderAttributesActionGroup" stepKey="seeSliderStorefront">
31+
<argument name="sliderFade" value="{{PageBuilderSliderFade_Enabled.value}}"/>
32+
<argument name="sliderShowArrows" value="{{PageBuilderSliderShowArrows_Enabled.value}}"/>
33+
</actionGroup>
34+
<!-- Validate Storefront: Slide 1 -->
35+
<waitForElementVisible selector="{{SliderOnFrontend.previousSlideArrowDisabled('1')}}" stepKey="seePreviousSlideArrow"/>
36+
<!-- Validate Storefront: Slide 2 -->
37+
<waitForElementVisible selector="{{SliderOnFrontend.nextSlideArrowDisabled('1')}}" stepKey="seeNextSlideArrow2"/>
38+
</test>
39+
</tests>

0 commit comments

Comments
 (0)