Skip to content

Commit

Permalink
Merge pull request #6397 from magento-tsg/2.4-develop-sidecar-pr8
Browse files Browse the repository at this point in the history
[Sidecar] Fixes for 2.4 (pr8)
  • Loading branch information
zakdma authored Dec 1, 2020
2 parents 479f304 + 8ce46f9 commit 297728f
Show file tree
Hide file tree
Showing 22 changed files with 1,335 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
-->

<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
<actionGroup name="AssertStorefrontProductPageGalleryChangingFullscreenImageByRibbonActionGroup">
<annotations>
<description>On the product page change main image by clicking on the images in the ribbon. Fullscreen</description>
</annotations>
<arguments>
<argument name="startImage" type="string" />
<argument name="expectedImage" type="string" />
</arguments>
<waitForElementVisible selector="{{StorefrontProductMediaSection.productImageFullscreen(startImage)}}" stepKey="seeStartFullscreenImage"/>
<seeElement selector="{{StorefrontProductMediaSection.imgSelectedInThumbnail(startImage)}}" stepKey="seeActiveImageInThumbnail"/>
<click selector="{{StorefrontProductMediaSection.productImageInFotorama(expectedImage)}}" stepKey="clickOnExpectedImage"/>
<seeElement selector="{{StorefrontProductMediaSection.productImageFullscreen(expectedImage)}}" stepKey="seeExpectedImageAfterClick"/>
<seeElement selector="{{StorefrontProductMediaSection.imgSelectedInThumbnail(expectedImage)}}" stepKey="seeExpectedImageActiveInThumbnailAfterChange"/>
<click selector="{{StorefrontProductMediaSection.productImageInFotorama(startImage)}}" stepKey="clickOnStartImageInRibbon"/>
<seeElement selector="{{StorefrontProductMediaSection.productImageFullscreen(startImage)}}" stepKey="seeStartImageAfterSecondChange"/>
<seeElement selector="{{StorefrontProductMediaSection.imgSelectedInThumbnail(startImage)}}" stepKey="seeStartImageActiveInThumbnailAfterSecondChange"/>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
-->

<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
<actionGroup name="AssertStorefrontProductPageGalleryChangingMainImageByRibbonActionGroup">
<annotations>
<description>Changing main image on product page media gallery by clicking on the images in the fotorama ribbon</description>
</annotations>
<arguments>
<argument name="startImage" type="string" />
<argument name="expectedImage" type="string" />
</arguments>
<waitForElementVisible selector="{{StorefrontProductMediaSection.productImage(startImage)}}" stepKey="waitActiveImageDefault"/>
<seeElement selector="{{StorefrontProductMediaSection.imgSelectedInThumbnail(startImage)}}" stepKey="seeActiveImageThumbnail"/>
<click selector="{{StorefrontProductMediaSection.productImageInFotorama(expectedImage)}}" stepKey="firstClickOnImageInRibbon"/>
<seeElement selector="{{StorefrontProductMediaSection.imgSelectedInThumbnail(expectedImage)}}" stepKey="seeExpectedImageSelectedInRibbon"/>
<seeElement selector="{{StorefrontProductMediaSection.productImage(expectedImage)}}" stepKey="seeChangedImageAfterFirstClick"/>
<click selector="{{StorefrontProductMediaSection.productImageInFotorama(startImage)}}" stepKey="secondClickOnImageInRibbon"/>
<seeElement selector="{{StorefrontProductMediaSection.imgSelectedInThumbnail(startImage)}}" stepKey="seeStartImageSelectedInRibbonAfterSecondClick"/>
<seeElement selector="{{StorefrontProductMediaSection.productImage(startImage)}}" stepKey="seeChangedImageAfterSecondClick"/>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->

<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
<actionGroup name="AssertStorefrontProductPageGalleryFullscreenThumbnailDragActionGroup">
<annotations>
<description>On the product page check functional of drag actions in the fotorama ribbon during fullscreen</description>
</annotations>
<arguments>
<argument name="dragPointImage" type="string" />
<argument name="currentImage" type="string"/>
<argument name="firstImage" type="string" />
</arguments>
<waitForElementVisible selector="{{StorefrontProductMediaSection.productImageFullscreen(currentImage)}}" stepKey="seeFullscreenImage"/>
<seeElement selector="{{StorefrontProductMediaSection.productImageInFotorama(firstImage)}}" stepKey="seeFirstImageInRibbon"/>
<dragAndDrop selector1="{{StorefrontProductMediaSection.productImageInFotorama(dragPointImage)}}" selector2="{{StorefrontProductMediaSection.productImageInFotorama(dragPointImage)}}" x="-300" y="0" stepKey="dragRibbon"/>
<seeElement selector="{{StorefrontProductMediaSection.productImageFullscreen(currentImage)}}" stepKey="seeFullscreenImageAfterDrag"/>
<dontSeeElement selector="{{StorefrontProductMediaSection.productImageInFotorama(firstImage)}}" stepKey="dontSeeFirstImageInRibbonAfterDrag"/>
<dragAndDrop selector1="{{StorefrontProductMediaSection.productImageInFotorama(dragPointImage)}}" selector2="{{StorefrontProductMediaSection.productImageInFotorama(dragPointImage)}}" x="300" y="0" stepKey="dragBackRibbon"/>
<seeElement selector="{{StorefrontProductMediaSection.productImageFullscreen(currentImage)}}" stepKey="seeMainImageAfterBackDrag"/>
<seeElement selector="{{StorefrontProductMediaSection.productImageInFotorama(firstImage)}}" stepKey="seeFirstImageInRibbonAfterBackDrag"/>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
-->

<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
<actionGroup name="AssertStorefrontProductPageGalleryImageDimensionsActionGroup">
<annotations>
<description>On the product page grab dimensions of the displayed product image, and image section. Assert that image is less or equals</description>
</annotations>
<arguments>
<argument name="imageSource" defaultValue="{{StorefrontProductMediaSection.mainImageForJsActions}}" type="string"/>
</arguments>
<executeJS function="var img=document.querySelector('{{imageSource}}');
return img.clientHeight;" stepKey="getImageHeight"/>
<executeJS function="var img=document.querySelector('{{imageSource}}');
return img.clientWidth;" stepKey="getImageWidth"/>
<executeJS function="var img=document.querySelector('{{StorefrontProductMediaSection.imageSectionForJsActions}}');
return img.clientHeight;" stepKey="getSectionHeight"/>
<executeJS function="var img=document.querySelector('{{StorefrontProductMediaSection.imageSectionForJsActions}}');
return img.clientWidth;" stepKey="getSectionWidth"/>
<assertLessThanOrEqual stepKey="checkHeightIsCorrect">
<actualResult type="variable">getImageHeight</actualResult>
<expectedResult type="variable">getSectionHeight</expectedResult>
</assertLessThanOrEqual>
<assertLessThanOrEqual stepKey="checkWidthIsCorrect">
<actualResult type="variable">getImageWidth</actualResult>
<expectedResult type="variable">getSectionWidth</expectedResult>
</assertLessThanOrEqual>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
<actionGroup name="AssertStorefrontProductPageGalleryImagePositionInThumbnailRibbonActionGroup">
<annotations>
<description>Check the expected image position in the fotorama ribbon on the product page</description>
</annotations>
<arguments>
<argument name="image" defaultValue="Magento2.filename" type="string"/>
<argument name="extension" defaultValue="Magento2.file_extension" type="string"/>
<argument name="position" defaultValue="0" type="string" />
</arguments>
<grabAttributeFrom userInput="src" selector="{{StorefrontProductMediaSection.fotoramaImageThumbnailImgByNumber(position)}}" stepKey="grabSrcFromThumbnailImageByPosition"/>
<assertRegExp stepKey="checkImagePositionInThumbnail">
<actualResult type="variable">$grabSrcFromThumbnailImageByPosition</actualResult>
<expectedResult type="string">|{{image}}[_\d]*.{{extension}}|</expectedResult>
</assertRegExp>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
-->

<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
<actionGroup name="AssertStorefrontProductPageGalleryMainImageButtonsActionGroup">
<annotations>
<description>Assert the buttons functionality "change image" on the product media gallery on the product page</description>
</annotations>
<arguments>
<argument name="startImage" type="string" />
<argument name="expectedImage" type="string" />
</arguments>
<moveMouseOver selector="{{StorefrontProductMediaSection.mainImageForJsActions}}" stepKey="hoverOverImage"/>
<waitForElementVisible selector="{{StorefrontProductMediaSection.imageNextButton}}" stepKey="waitForButtons"/>
<seeElement selector="{{StorefrontProductMediaSection.productImage(startImage)}}" stepKey="seeProductImageBeforeActions"/>
<click selector="{{StorefrontProductMediaSection.imageNextButton}}" stepKey="clickOnNextImageButton"/>
<seeElement selector="{{StorefrontProductMediaSection.imgSelectedInThumbnail(expectedImage)}}" stepKey="seeExpectedImageSelectedInRibbon"/>
<seeElement selector="{{StorefrontProductMediaSection.productImage(expectedImage)}}" stepKey="seeExpectedImageOnPreview"/>
<click selector="{{StorefrontProductMediaSection.imagePrevButton}}" stepKey="clickOnPrevImageButton"/>
<seeElement selector="{{StorefrontProductMediaSection.imgSelectedInThumbnail(startImage)}}" stepKey="seeActiveImageSelectedInRibbonAfterSecondChange"/>
<seeElement selector="{{StorefrontProductMediaSection.productImage(startImage)}}" stepKey="seeMainProductImageAfterSecondChange"/>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->

<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
<actionGroup name="AssertStorefrontProductPageGalleryThumbnailDragActionGroup">
<annotations>
<description>Check functional of drag actions in the thumbnail ribbon on the product page</description>
</annotations>
<arguments>
<argument name="dragPointImage" type="string" />
<argument name="currentImage" type="string"/>
<argument name="firstImage" type="string" />
</arguments>
<waitForElementVisible selector="{{StorefrontProductMediaSection.productImage(currentImage)}}" stepKey="seeMainImageBeforeDragActions"/>
<dontSeeElement selector="{{StorefrontProductMediaSection.fotoramaPrevButton}}" stepKey="dontSeePrevButtonBeforeDragActions"/>
<dragAndDrop selector1="{{StorefrontProductMediaSection.productImageInFotorama(dragPointImage)}}" selector2="{{StorefrontProductMediaSection.productImageInFotorama(dragPointImage)}}" x="-300" y="0" stepKey="dragRibbonForward"/>
<seeElement selector="{{StorefrontProductMediaSection.productImage(currentImage)}}" stepKey="seeMainImageDontChangeAfterDrag"/>
<waitForElementVisible selector="{{StorefrontProductMediaSection.fotoramaPrevButton}}" stepKey="waitPrevButton"/>
<seeElement selector="{{StorefrontProductMediaSection.fotoramaPrevButton}}" stepKey="seePrevButton"/>
<dontSeeElement selector="{{StorefrontProductMediaSection.productImageInFotorama(firstImage)}}" stepKey="dontSeeFirstImageInRibbonAfterDrag"/>
<dragAndDrop selector1="{{StorefrontProductMediaSection.productImageInFotorama(dragPointImage)}}" selector2="{{StorefrontProductMediaSection.productImageInFotorama(dragPointImage)}}" x="300" y="0" stepKey="dragBackRibbon"/>
<seeElement selector="{{StorefrontProductMediaSection.productImage(currentImage)}}" stepKey="seeMainImageDontChangeAfterBackDrag"/>
<seeElement selector="{{StorefrontProductMediaSection.productImageInFotorama(firstImage)}}" stepKey="seeFirstImageInRibbonAfterBackDrag"/>
<dontSeeElement selector="{{StorefrontProductMediaSection.fotoramaPrevButton}}" stepKey="dontSeePrevButtonAfterBackDrag"/>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->

<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
<actionGroup name="StorefrontProductPageGalleryDragMainImageBackActionGroup">
<annotations>
<description>Drag back main image in the media gallery of product page</description>
</annotations>
<moveMouseOver selector="{{StorefrontProductMediaSection.mainImageForJsActions}}" stepKey="hoverOnProductImage"/>
<waitForElementVisible selector="{{StorefrontProductMediaSection.imageNextButton}}" stepKey="waitNextButton"/>
<dragAndDrop selector1="{{StorefrontProductMediaSection.mainImageForJsActions}}" selector2="{{StorefrontProductMediaSection.imageNextButton}}" x="200" y="0" stepKey="dragImageBack"/>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->

<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
<actionGroup name="StorefrontProductPageGalleryDragMainImageForwardActionGroup">
<annotations>
<description>Drag forward main image in the media gallery of product page</description>
</annotations>
<moveMouseOver selector="{{StorefrontProductMediaSection.mainImageForJsActions}}" stepKey="hoverOnProductImage"/>
<waitForElementVisible selector="{{StorefrontProductMediaSection.imageNextButton}}" stepKey="waitNextButton"/>
<dragAndDrop selector1="{{StorefrontProductMediaSection.mainImageForJsActions}}" selector2="{{StorefrontProductMediaSection.imagePrevButton}}" x="-366" y="0" stepKey="dragImage"/>
</actionGroup>
</actionGroups>
48 changes: 48 additions & 0 deletions app/code/Magento/Catalog/Test/Mftf/Data/ImageData.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,52 @@
<data key="name">adobe-thumb</data>
<data key="extension">jpg</data>
</entity>
<entity name="AdobeSmallImage" type="image">
<data key="title" unique="suffix">magento-small</data>
<data key="file">adobe-small.jpg</data>
<data key="filename">adobe-small</data>
<data key="file_extension">jpg</data>
</entity>
<entity name="AdobeThumbImage" type="image">
<data key="title" unique="suffix">magento-thumb</data>
<data key="file">adobe-thumb.jpg</data>
<data key="filename">adobe-thumb</data>
<data key="file_extension">jpg</data>
</entity>
<entity name="JpgImage" type="image">
<data key="title" unique="suffix">jpgimage</data>
<data key="file">jpg.jpg</data>
<data key="filename">jpg</data>
<data key="file_extension">jpg</data>
</entity>
<entity name="LargeImage" type="image">
<data key="title" unique="suffix">largeimage</data>
<data key="file">large.jpg</data>
<data key="filename">large</data>
<data key="file_extension">jpg</data>
</entity>
<entity name="MagentoImage" type="image">
<data key="title" unique="suffix">magentoimage</data>
<data key="file">magento.jpg</data>
<data key="filename">magento</data>
<data key="file_extension">jpg</data>
</entity>
<entity name="MagentoStage" type="image">
<data key="title" unique="suffix">magentostage</data>
<data key="file">magentoStage.jpg</data>
<data key="filename">magentoStage</data>
<data key="file_extension">jpg</data>
</entity>
<entity name="MediumImage" type="image">
<data key="title" unique="suffix">mediumimage</data>
<data key="file">medium.jpg</data>
<data key="filename">medium</data>
<data key="file_extension">jpg</data>
</entity>
<entity name="PngImage" type="image">
<data key="title" unique="suffix">magentoimage</data>
<data key="file">png.png</data>
<data key="filename">png</data>
<data key="file_extension">png</data>
</entity>
</entities>
1 change: 1 addition & 0 deletions app/code/Magento/Catalog/Test/Mftf/Data/ProductData.xml
Original file line number Diff line number Diff line change
Expand Up @@ -370,6 +370,7 @@
<data key="shareable">Yes</data>
<data key="file">magento-logo.png</data>
<data key="fileName">magento-logo</data>
<data key="file_extension">png</data>
</entity>
<entity name="MagentoLogo" type="image">
<data key="title" unique="suffix">MagentoLogo</data>
Expand Down
Loading

0 comments on commit 297728f

Please sign in to comment.