Skip to content

Commit

Permalink
Merge branch '2.4-develop' into 30936-cms-perfomance
Browse files Browse the repository at this point in the history
  • Loading branch information
Lars Roettig authored Dec 3, 2020
2 parents b9987d1 + f6c4e1c commit 6de189f
Show file tree
Hide file tree
Showing 112 changed files with 2,959 additions and 398 deletions.
23 changes: 23 additions & 0 deletions app/code/Magento/Bundle/Test/Mftf/Test/AdminAddBundleItemsTest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,18 @@
</actionGroup>
<checkOption selector="{{AdminAddProductsToOptionPanel.firstCheckbox}}" stepKey="selectFirstGridRow2"/>
<click selector="{{AdminAddProductsToOptionPanel.addSelectedProducts}}" stepKey="clickAddSelectedBundleProducts"/>
<!-- Check that Bundle Options initialized with default quantity -->
<grabValueFrom selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity('0', '0')}}" stepKey="grabbedFirstBundleOptionQuantity"/>
<assertEquals stepKey="assertFirstBundleOptionDefaultQuantity">
<expectedResult type="string">1</expectedResult>
<actualResult type="string">$grabbedFirstBundleOptionQuantity</actualResult>
</assertEquals>
<grabValueFrom selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity('0', '1')}}" stepKey="grabbedSecondBundleOptionQuantity"/>
<assertEquals stepKey="assertSecondBundleOptionDefaultQuantity">
<expectedResult type="string">1</expectedResult>
<actualResult type="string">$grabbedSecondBundleOptionQuantity</actualResult>
</assertEquals>

<fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity('0', '0')}}" userInput="{{BundleProduct.defaultQuantity}}" stepKey="fillProductDefaultQty1"/>
<fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity('0', '1')}}" userInput="{{BundleProduct.defaultQuantity}}" stepKey="fillProductDefaultQty2"/>

Expand Down Expand Up @@ -108,6 +120,17 @@
</actionGroup>
<checkOption selector="{{AdminProductFormBundleSection.firstProductOption}}" stepKey="selectNewFirstGridRow2"/>
<click selector="{{AdminAddProductsToOptionPanel.addSelectedProducts}}" stepKey="clickAddNewSelectedBundleProducts"/>
<!-- Check that existing Bundle Options do not loose user input quantity values -->
<grabValueFrom selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity('0', '0')}}" stepKey="grabbedFirstBundleOptionQuantityAfterUserInput"/>
<assertEquals stepKey="assertFirstBundleOptionDefaultQuantityAfterUserInput">
<expectedResult type="string">{{BundleProduct.defaultQuantity}}</expectedResult>
<actualResult type="string">$grabbedFirstBundleOptionQuantityAfterUserInput</actualResult>
</assertEquals>
<grabValueFrom selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity('0', '1')}}" stepKey="grabbedSecondBundleOptionQuantityAfterUserInput"/>
<assertEquals stepKey="assertSecondBundleOptionDefaultQuantityAfterUserInput">
<expectedResult type="string">{{BundleProduct.defaultQuantity}}</expectedResult>
<actualResult type="string">$grabbedSecondBundleOptionQuantityAfterUserInput</actualResult>
</assertEquals>
<fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity('0', '2')}}" userInput="{{BundleProduct.defaultQuantity}}" stepKey="fillNewProductDefaultQty1"/>
<fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity('0', '3')}}" userInput="{{BundleProduct.defaultQuantity}}" stepKey="fillNewProductDefaultQty2"/>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,26 @@ define([
}
},

/**
* @inheritdoc
*/
setInitialValue: function () {
this.initialValue = this.getInitialValue();

if (this.initialValue === undefined || this.initialValue === '') {
this.initialValue = 1;
}

if (this.value.peek() !== this.initialValue) {
this.value(this.initialValue);
}

this.on('value', this.onUpdate.bind(this));
this.isUseDefault(this.disabled());

return this;
},

/**
* @inheritdoc
*/
Expand All @@ -33,6 +53,5 @@ define([

return !this.visible() ? false : notEqual;
}

});
});
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>
Loading

0 comments on commit 6de189f

Please sign in to comment.