Skip to content

Commit 8afcf3e

Browse files
committed
PB-173: Add Carousel Settings to Product Appearance
- Adding tests for product carousel continuous mode
1 parent c868e1a commit 8afcf3e

File tree

3 files changed

+401
-7
lines changed

3 files changed

+401
-7
lines changed

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

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,17 @@
196196
<waitForPageLoad stepKey="waitForProductPageToLoad"/>
197197
<see selector="{{StorefrontProductInfoMainSection.productName}}" userInput="{{product}}" stepKey="seeProductName"/>
198198
</actionGroup>
199+
<actionGroup name="clickProductImageInContinuousProductsCarouselOnStorefront">
200+
<arguments>
201+
<argument name="product" type="string"/>
202+
<argument name="productItemIndex" defaultValue="1" type="string"/>
203+
<argument name="productGroupIndex" defaultValue="1" type="string"/>
204+
</arguments>
205+
<waitForElementVisible selector="{{ProductsOnStorefront.productImageInCarouselBySlickSlideIndex(productGroupIndex, productItemIndex)}}" stepKey="waitForProductImage"/>
206+
<click selector="{{ProductsOnStorefront.productImageInCarouselBySlickSlideIndex(productGroupIndex, productItemIndex)}}" stepKey="clickProductImage"/>
207+
<waitForPageLoad stepKey="waitForProductPageToLoad"/>
208+
<see selector="{{StorefrontProductInfoMainSection.productName}}" userInput="{{product}}" stepKey="seeProductName"/>
209+
</actionGroup>
199210
<actionGroup name="clickProductNameInProductsOnStorefront">
200211
<arguments>
201212
<argument name="product" type="string"/>
@@ -205,33 +216,83 @@
205216
<waitForPageLoad stepKey="waitForProductPageToLoad"/>
206217
<see selector="{{StorefrontProductInfoMainSection.productName}}" userInput="{{product}}" stepKey="seeProductName"/>
207218
</actionGroup>
219+
<actionGroup name="clickProductNameInContinuousProductsCarouselOnStorefront">
220+
<arguments>
221+
<argument name="product" type="string"/>
222+
<argument name="productItemIndex" defaultValue="1" type="string"/>
223+
<argument name="productGroupIndex" defaultValue="1" type="string"/>
224+
</arguments>
225+
<waitForElementVisible selector="{{ProductsOnStorefront.productNameInCarouselBySlickSlideIndex(productGroupIndex, productItemIndex, product)}}" stepKey="waitForProductName"/>
226+
<click selector="{{ProductsOnStorefront.productNameInCarouselBySlickSlideIndex(productGroupIndex, productItemIndex, product)}}" stepKey="clickProductName"/>
227+
<waitForPageLoad stepKey="waitForProductPageToLoad"/>
228+
<see selector="{{StorefrontProductInfoMainSection.productName}}" userInput="{{product}}" stepKey="seeProductName"/>
229+
</actionGroup>
208230
<actionGroup name="clickProductAddToCartInProductsOnStorefront">
209231
<arguments>
210232
<argument name="product" type="string"/>
211233
</arguments>
234+
<waitForElementVisible selector="{{ProductsOnStorefront.productImageByProductName(product)}}" stepKey="waitForProductImage"/>
212235
<moveMouseOver selector="{{ProductsOnStorefront.productImageByProductName(product)}}" stepKey="moveMouseOverProduct"/>
213236
<click selector="{{ProductsOnStorefront.productAddToCartByProductName(product)}}" stepKey="clickProductAddToCart"/>
214237
<waitForPageLoad stepKey="waitForProductPageToLoad"/>
215238
<see userInput="You added {{product}} to your shopping cart." stepKey="seeAddToCartSuccessMessage"/>
216239
</actionGroup>
240+
<actionGroup name="clickProductAddToCartInContinuousProductsCarouselOnStorefront">
241+
<arguments>
242+
<argument name="product" type="string"/>
243+
<argument name="productItemIndex" defaultValue="1" type="string"/>
244+
<argument name="productGroupIndex" defaultValue="1" type="string"/>
245+
</arguments>
246+
<waitForElementVisible selector="{{ProductsOnStorefront.productImageInCarouselBySlickSlideIndex(productGroupIndex, productItemIndex)}}" stepKey="waitForProductImage"/>
247+
<moveMouseOver selector="{{ProductsOnStorefront.productImageInCarouselBySlickSlideIndex(productGroupIndex, productItemIndex)}}" stepKey="moveMouseOverProduct"/>
248+
<click selector="{{ProductsOnStorefront.productAddToCartInCarouselBySlickSlideIndex(productGroupIndex, productItemIndex)}}" stepKey="clickProductAddToCart"/>
249+
<waitForPageLoad stepKey="waitForProductPageToLoad"/>
250+
<see userInput="You added {{product}} to your shopping cart." stepKey="seeAddToCartSuccessMessage"/>
251+
</actionGroup>
217252
<actionGroup name="clickProductAddToCompareInProductsOnStorefront">
218253
<arguments>
219254
<argument name="product" type="string"/>
220255
</arguments>
256+
<waitForElementVisible selector="{{ProductsOnStorefront.productImageByProductName(product)}}" stepKey="waitForProductImage"/>
221257
<moveMouseOver selector="{{ProductsOnStorefront.productImageByProductName(product)}}" stepKey="moveMouseOverProduct"/>
222258
<click selector="{{ProductsOnStorefront.productAddToCompareByProductName(product)}}" stepKey="clickProductAddToCompare"/>
223259
<waitForPageLoad stepKey="waitForProductPageToLoad"/>
224260
<see userInput="You added product {{product}} to the comparison list." stepKey="seeComparisonListSuccessMessage"/>
225261
</actionGroup>
262+
<actionGroup name="clickProductAddToCompareInContinuousProductsCarouselOnStorefront">
263+
<arguments>
264+
<argument name="product" type="string"/>
265+
<argument name="productItemIndex" defaultValue="1" type="string"/>
266+
<argument name="productGroupIndex" defaultValue="1" type="string"/>
267+
</arguments>
268+
<waitForElementVisible selector="{{ProductsOnStorefront.productImageInCarouselBySlickSlideIndex(productGroupIndex, productItemIndex)}}" stepKey="waitForProductImage"/>
269+
<moveMouseOver selector="{{ProductsOnStorefront.productImageInCarouselBySlickSlideIndex(productGroupIndex, productItemIndex)}}" stepKey="moveMouseOverProduct"/>
270+
<click selector="{{ProductsOnStorefront.productAddToCompareInCarouselBySlickSlideIndex(productGroupIndex, productItemIndex)}}" stepKey="clickProductAddToCompare"/>
271+
<waitForPageLoad stepKey="waitForProductPageToLoad"/>
272+
<see userInput="You added product {{product}} to the comparison list." stepKey="seeComparisonListSuccessMessage"/>
273+
</actionGroup>
226274
<actionGroup name="clickProductAddToWishListInProductsOnStorefront">
227275
<arguments>
228276
<argument name="product" type="string"/>
229277
</arguments>
278+
<waitForElementVisible selector="{{ProductsOnStorefront.productImageByProductName(product)}}" stepKey="waitForProductImage"/>
230279
<moveMouseOver selector="{{ProductsOnStorefront.productImageByProductName(product)}}" stepKey="moveMouseOverProduct"/>
231280
<click selector="{{ProductsOnStorefront.productAddToWishListByProductName(product)}}" stepKey="clickProductAddToWishList"/>
232281
<waitForPageLoad stepKey="waitForProductPageToLoad"/>
233282
<see userInput="You must login or register to add items to your wishlist." stepKey="seeWishListSuccessMessage"/>
234283
</actionGroup>
284+
<actionGroup name="clickProductAddToWishListInContinuousProductsCarouselOnStorefront">
285+
<arguments>
286+
<argument name="product" type="string"/>
287+
<argument name="productItemIndex" defaultValue="1" type="string"/>
288+
<argument name="productGroupIndex" defaultValue="1" type="string"/>
289+
</arguments>
290+
<waitForElementVisible selector="{{ProductsOnStorefront.productImageInCarouselBySlickSlideIndex(productGroupIndex, productItemIndex)}}" stepKey="waitForProductImage"/>
291+
<moveMouseOver selector="{{ProductsOnStorefront.productImageInCarouselBySlickSlideIndex(productGroupIndex, productItemIndex)}}" stepKey="moveMouseOverProduct"/>
292+
<click selector="{{ProductsOnStorefront.productAddToWishListInCarouselBySlickSlideIndex(productGroupIndex, productItemIndex)}}" stepKey="clickProductAddToWishList"/>
293+
<waitForPageLoad stepKey="waitForProductPageToLoad"/>
294+
<see userInput="You must login or register to add items to your wishlist." stepKey="seeWishListSuccessMessage"/>
295+
</actionGroup>
235296
<actionGroup name="clickProductCarouselNavigationDot">
236297
<arguments>
237298
<argument name="page" defaultValue="ProductsCarouselOnStage"/>

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,7 @@
119119
<element name="productImage" type="text" parameterized="true" selector="(//div[contains(@data-content-type,'products')]//ol//li[contains(@class,'product-item')])[{{indexOfProductItem}}]//img[@class='product-image-photo']"/>
120120
<element name="productImageCSS" type="text" selector="div[data-content-type=products] ol li.product-item img.product-image-photo"/>
121121
<element name="productImageByProductName" type="text" parameterized="true" selector="//div[contains(@data-content-type,'products')]//ol//li[contains(@class,'product-item')]//a[contains(.,'{{productName}}')]//ancestor::li[contains(@class,'product-item')]//img[@class='product-image-photo']"/>
122+
<element name="productImageInCarouselBySlickSlideIndex" type="text" parameterized="true" selector="(//div[contains(@data-content-type,'products')])[{{indexOfProductGroup}}]//ol//*[@data-slick-index='{{indexOfSlickSlide}}']//li[contains(@class,'product-item')]//img[@class='product-image-photo']"/>
122123
<element name="productName" type="text" parameterized="true" selector="(//div[contains(@data-content-type,'products')]//ol//li[contains(@class,'product-item')])[{{indexOfProductItem}}]//strong//a[@class='product-item-link' and @href and contains(.,'{{productName}}')]"/>
123124
<element name="productNameInProductGroup" type="text" parameterized="true" selector="(//div[contains(@data-content-type,'products')])[{{indexOfProductGroup}}]//ol//li[contains(@class,'product-item')]//strong//a[@class='product-item-link' and @href and contains(.,'{{productName}}')]"/>
124125
<element name="productNameInCarouselNotClonedBySlick" type="text" parameterized="true" selector="(//div[contains(@data-content-type,'products')])[{{indexOfProductGroup}}]//ol//*[contains(@class,'slick-slide') and not(contains(@class,'slick-cloned'))]//li[contains(@class,'product-item')]//strong//a[@class='product-item-link' and @href and contains(.,'{{productName}}')]"/>
@@ -128,10 +129,13 @@
128129
<element name="productPriceContainer" type="text" selector="div[data-content-type=products] ol li.product-item div.price-box"/>
129130
<element name="productAddToCart" type="text" parameterized="true" selector="(//div[contains(@data-content-type,'products')]//ol//li[contains(@class,'product-item')])[{{indexOfProductItem}}]//button[contains(@class,'tocart') and @title='Add to Cart']"/>
130131
<element name="productAddToCartByProductName" type="text" parameterized="true" selector="//div[contains(@data-content-type,'products')]//ol//li[contains(@class,'product-item')]//a[contains(.,'{{productName}}')]//ancestor::li[contains(@class,'product-item')]//button[contains(@class,'tocart') and @title='Add to Cart']"/>
132+
<element name="productAddToCartInCarouselBySlickSlideIndex" type="text" parameterized="true" selector="(//div[contains(@data-content-type,'products')])[{{indexOfProductGroup}}]//ol//*[@data-slick-index='{{indexOfSlickSlide}}']//li[contains(@class,'product-item')]//button[contains(@class,'tocart') and @title='Add to Cart']"/>
131133
<element name="productAddToWishList" type="text" parameterized="true" selector="(//div[contains(@data-content-type,'products')]//ol//li[contains(@class,'product-item')])[{{indexOfProductItem}}]//a[contains(@class,'towishlist') and @title='Add to Wish List']"/>
132134
<element name="productAddToWishListByProductName" type="text" parameterized="true" selector="//div[contains(@data-content-type,'products')]//ol//li[contains(@class,'product-item')]//a[contains(.,'{{productName}}')]//ancestor::li[contains(@class,'product-item')]//a[contains(@class,'towishlist') and @title='Add to Wish List']"/>
135+
<element name="productAddToWishListInCarouselBySlickSlideIndex" type="text" parameterized="true" selector="(//div[contains(@data-content-type,'products')])[{{indexOfProductGroup}}]//ol//*[@data-slick-index='{{indexOfSlickSlide}}']//li[contains(@class,'product-item')]//a[contains(@class,'towishlist') and @title='Add to Wish List']"/>
133136
<element name="productAddToCompare" type="text" parameterized="true" selector="(//div[contains(@data-content-type,'products')]//ol//li[contains(@class,'product-item')])[{{indexOfProductItem}}]//a[contains(@class,'tocompare') and @title='Add to Compare']"/>
134137
<element name="productAddToCompareByProductName" type="text" parameterized="true" selector="//div[contains(@data-content-type,'products')]//ol//li[contains(@class,'product-item')]//a[contains(.,'{{productName}}')]//ancestor::li[contains(@class,'product-item')]//a[contains(@class,'tocompare') and @title='Add to Compare']"/>
138+
<element name="productAddToCompareInCarouselBySlickSlideIndex" type="text" parameterized="true" selector="(//div[contains(@data-content-type,'products')])[{{indexOfProductGroup}}]//ol//*[@data-slick-index='{{indexOfSlickSlide}}']//li[contains(@class,'product-item')]//a[contains(@class,'tocompare') and @title='Add to Compare']"/>
135139
<element name="productActions" type="text" selector="div[data-content-type=products] ol li.product-item div.product-item-actions"/>
136140
<!-- Carousel Settings Configuration -->
137141
<element name="carouselMode" type="button" parameterized="true" selector="(//div[contains(@data-content-type,'products')])[{{indexOfProductGroup}}][@data-carousel-mode='{{carouselMode}}']"/>

0 commit comments

Comments
 (0)