Skip to content

Commit 6de189f

Browse files
author
Lars Roettig
authored
Merge branch '2.4-develop' into 30936-cms-perfomance
2 parents b9987d1 + f6c4e1c commit 6de189f

File tree

112 files changed

+2959
-398
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

112 files changed

+2959
-398
lines changed

app/code/Magento/Bundle/Test/Mftf/Test/AdminAddBundleItemsTest.xml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,18 @@
5959
</actionGroup>
6060
<checkOption selector="{{AdminAddProductsToOptionPanel.firstCheckbox}}" stepKey="selectFirstGridRow2"/>
6161
<click selector="{{AdminAddProductsToOptionPanel.addSelectedProducts}}" stepKey="clickAddSelectedBundleProducts"/>
62+
<!-- Check that Bundle Options initialized with default quantity -->
63+
<grabValueFrom selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity('0', '0')}}" stepKey="grabbedFirstBundleOptionQuantity"/>
64+
<assertEquals stepKey="assertFirstBundleOptionDefaultQuantity">
65+
<expectedResult type="string">1</expectedResult>
66+
<actualResult type="string">$grabbedFirstBundleOptionQuantity</actualResult>
67+
</assertEquals>
68+
<grabValueFrom selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity('0', '1')}}" stepKey="grabbedSecondBundleOptionQuantity"/>
69+
<assertEquals stepKey="assertSecondBundleOptionDefaultQuantity">
70+
<expectedResult type="string">1</expectedResult>
71+
<actualResult type="string">$grabbedSecondBundleOptionQuantity</actualResult>
72+
</assertEquals>
73+
6274
<fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity('0', '0')}}" userInput="{{BundleProduct.defaultQuantity}}" stepKey="fillProductDefaultQty1"/>
6375
<fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity('0', '1')}}" userInput="{{BundleProduct.defaultQuantity}}" stepKey="fillProductDefaultQty2"/>
6476

@@ -108,6 +120,17 @@
108120
</actionGroup>
109121
<checkOption selector="{{AdminProductFormBundleSection.firstProductOption}}" stepKey="selectNewFirstGridRow2"/>
110122
<click selector="{{AdminAddProductsToOptionPanel.addSelectedProducts}}" stepKey="clickAddNewSelectedBundleProducts"/>
123+
<!-- Check that existing Bundle Options do not loose user input quantity values -->
124+
<grabValueFrom selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity('0', '0')}}" stepKey="grabbedFirstBundleOptionQuantityAfterUserInput"/>
125+
<assertEquals stepKey="assertFirstBundleOptionDefaultQuantityAfterUserInput">
126+
<expectedResult type="string">{{BundleProduct.defaultQuantity}}</expectedResult>
127+
<actualResult type="string">$grabbedFirstBundleOptionQuantityAfterUserInput</actualResult>
128+
</assertEquals>
129+
<grabValueFrom selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity('0', '1')}}" stepKey="grabbedSecondBundleOptionQuantityAfterUserInput"/>
130+
<assertEquals stepKey="assertSecondBundleOptionDefaultQuantityAfterUserInput">
131+
<expectedResult type="string">{{BundleProduct.defaultQuantity}}</expectedResult>
132+
<actualResult type="string">$grabbedSecondBundleOptionQuantityAfterUserInput</actualResult>
133+
</assertEquals>
111134
<fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity('0', '2')}}" userInput="{{BundleProduct.defaultQuantity}}" stepKey="fillNewProductDefaultQty1"/>
112135
<fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity('0', '3')}}" userInput="{{BundleProduct.defaultQuantity}}" stepKey="fillNewProductDefaultQty2"/>
113136

app/code/Magento/Bundle/view/adminhtml/web/js/components/bundle-option-qty.js

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,26 @@ define([
1717
}
1818
},
1919

20+
/**
21+
* @inheritdoc
22+
*/
23+
setInitialValue: function () {
24+
this.initialValue = this.getInitialValue();
25+
26+
if (this.initialValue === undefined || this.initialValue === '') {
27+
this.initialValue = 1;
28+
}
29+
30+
if (this.value.peek() !== this.initialValue) {
31+
this.value(this.initialValue);
32+
}
33+
34+
this.on('value', this.onUpdate.bind(this));
35+
this.isUseDefault(this.disabled());
36+
37+
return this;
38+
},
39+
2040
/**
2141
* @inheritdoc
2242
*/
@@ -33,6 +53,5 @@ define([
3353

3454
return !this.visible() ? false : notEqual;
3555
}
36-
3756
});
3857
});
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
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"
9+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
10+
<actionGroup name="AssertStorefrontProductPageGalleryChangingFullscreenImageByRibbonActionGroup">
11+
<annotations>
12+
<description>On the product page change main image by clicking on the images in the ribbon. Fullscreen</description>
13+
</annotations>
14+
<arguments>
15+
<argument name="startImage" type="string" />
16+
<argument name="expectedImage" type="string" />
17+
</arguments>
18+
<waitForElementVisible selector="{{StorefrontProductMediaSection.productImageFullscreen(startImage)}}" stepKey="seeStartFullscreenImage"/>
19+
<seeElement selector="{{StorefrontProductMediaSection.imgSelectedInThumbnail(startImage)}}" stepKey="seeActiveImageInThumbnail"/>
20+
<click selector="{{StorefrontProductMediaSection.productImageInFotorama(expectedImage)}}" stepKey="clickOnExpectedImage"/>
21+
<seeElement selector="{{StorefrontProductMediaSection.productImageFullscreen(expectedImage)}}" stepKey="seeExpectedImageAfterClick"/>
22+
<seeElement selector="{{StorefrontProductMediaSection.imgSelectedInThumbnail(expectedImage)}}" stepKey="seeExpectedImageActiveInThumbnailAfterChange"/>
23+
<click selector="{{StorefrontProductMediaSection.productImageInFotorama(startImage)}}" stepKey="clickOnStartImageInRibbon"/>
24+
<seeElement selector="{{StorefrontProductMediaSection.productImageFullscreen(startImage)}}" stepKey="seeStartImageAfterSecondChange"/>
25+
<seeElement selector="{{StorefrontProductMediaSection.imgSelectedInThumbnail(startImage)}}" stepKey="seeStartImageActiveInThumbnailAfterSecondChange"/>
26+
</actionGroup>
27+
</actionGroups>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
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"
9+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
10+
<actionGroup name="AssertStorefrontProductPageGalleryChangingMainImageByRibbonActionGroup">
11+
<annotations>
12+
<description>Changing main image on product page media gallery by clicking on the images in the fotorama ribbon</description>
13+
</annotations>
14+
<arguments>
15+
<argument name="startImage" type="string" />
16+
<argument name="expectedImage" type="string" />
17+
</arguments>
18+
<waitForElementVisible selector="{{StorefrontProductMediaSection.productImage(startImage)}}" stepKey="waitActiveImageDefault"/>
19+
<seeElement selector="{{StorefrontProductMediaSection.imgSelectedInThumbnail(startImage)}}" stepKey="seeActiveImageThumbnail"/>
20+
<click selector="{{StorefrontProductMediaSection.productImageInFotorama(expectedImage)}}" stepKey="firstClickOnImageInRibbon"/>
21+
<seeElement selector="{{StorefrontProductMediaSection.imgSelectedInThumbnail(expectedImage)}}" stepKey="seeExpectedImageSelectedInRibbon"/>
22+
<seeElement selector="{{StorefrontProductMediaSection.productImage(expectedImage)}}" stepKey="seeChangedImageAfterFirstClick"/>
23+
<click selector="{{StorefrontProductMediaSection.productImageInFotorama(startImage)}}" stepKey="secondClickOnImageInRibbon"/>
24+
<seeElement selector="{{StorefrontProductMediaSection.imgSelectedInThumbnail(startImage)}}" stepKey="seeStartImageSelectedInRibbonAfterSecondClick"/>
25+
<seeElement selector="{{StorefrontProductMediaSection.productImage(startImage)}}" stepKey="seeChangedImageAfterSecondClick"/>
26+
</actionGroup>
27+
</actionGroups>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
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+
9+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="AssertStorefrontProductPageGalleryFullscreenThumbnailDragActionGroup">
12+
<annotations>
13+
<description>On the product page check functional of drag actions in the fotorama ribbon during fullscreen</description>
14+
</annotations>
15+
<arguments>
16+
<argument name="dragPointImage" type="string" />
17+
<argument name="currentImage" type="string"/>
18+
<argument name="firstImage" type="string" />
19+
</arguments>
20+
<waitForElementVisible selector="{{StorefrontProductMediaSection.productImageFullscreen(currentImage)}}" stepKey="seeFullscreenImage"/>
21+
<seeElement selector="{{StorefrontProductMediaSection.productImageInFotorama(firstImage)}}" stepKey="seeFirstImageInRibbon"/>
22+
<dragAndDrop selector1="{{StorefrontProductMediaSection.productImageInFotorama(dragPointImage)}}" selector2="{{StorefrontProductMediaSection.productImageInFotorama(dragPointImage)}}" x="-300" y="0" stepKey="dragRibbon"/>
23+
<seeElement selector="{{StorefrontProductMediaSection.productImageFullscreen(currentImage)}}" stepKey="seeFullscreenImageAfterDrag"/>
24+
<dontSeeElement selector="{{StorefrontProductMediaSection.productImageInFotorama(firstImage)}}" stepKey="dontSeeFirstImageInRibbonAfterDrag"/>
25+
<dragAndDrop selector1="{{StorefrontProductMediaSection.productImageInFotorama(dragPointImage)}}" selector2="{{StorefrontProductMediaSection.productImageInFotorama(dragPointImage)}}" x="300" y="0" stepKey="dragBackRibbon"/>
26+
<seeElement selector="{{StorefrontProductMediaSection.productImageFullscreen(currentImage)}}" stepKey="seeMainImageAfterBackDrag"/>
27+
<seeElement selector="{{StorefrontProductMediaSection.productImageInFotorama(firstImage)}}" stepKey="seeFirstImageInRibbonAfterBackDrag"/>
28+
</actionGroup>
29+
</actionGroups>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
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"
9+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
10+
<actionGroup name="AssertStorefrontProductPageGalleryImageDimensionsActionGroup">
11+
<annotations>
12+
<description>On the product page grab dimensions of the displayed product image, and image section. Assert that image is less or equals</description>
13+
</annotations>
14+
<arguments>
15+
<argument name="imageSource" defaultValue="{{StorefrontProductMediaSection.mainImageForJsActions}}" type="string"/>
16+
</arguments>
17+
<executeJS function="var img=document.querySelector('{{imageSource}}');
18+
return img.clientHeight;" stepKey="getImageHeight"/>
19+
<executeJS function="var img=document.querySelector('{{imageSource}}');
20+
return img.clientWidth;" stepKey="getImageWidth"/>
21+
<executeJS function="var img=document.querySelector('{{StorefrontProductMediaSection.imageSectionForJsActions}}');
22+
return img.clientHeight;" stepKey="getSectionHeight"/>
23+
<executeJS function="var img=document.querySelector('{{StorefrontProductMediaSection.imageSectionForJsActions}}');
24+
return img.clientWidth;" stepKey="getSectionWidth"/>
25+
<assertLessThanOrEqual stepKey="checkHeightIsCorrect">
26+
<actualResult type="variable">getImageHeight</actualResult>
27+
<expectedResult type="variable">getSectionHeight</expectedResult>
28+
</assertLessThanOrEqual>
29+
<assertLessThanOrEqual stepKey="checkWidthIsCorrect">
30+
<actualResult type="variable">getImageWidth</actualResult>
31+
<expectedResult type="variable">getSectionWidth</expectedResult>
32+
</assertLessThanOrEqual>
33+
</actionGroup>
34+
</actionGroups>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
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"
9+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
10+
<actionGroup name="AssertStorefrontProductPageGalleryImagePositionInThumbnailRibbonActionGroup">
11+
<annotations>
12+
<description>Check the expected image position in the fotorama ribbon on the product page</description>
13+
</annotations>
14+
<arguments>
15+
<argument name="image" defaultValue="Magento2.filename" type="string"/>
16+
<argument name="extension" defaultValue="Magento2.file_extension" type="string"/>
17+
<argument name="position" defaultValue="0" type="string" />
18+
</arguments>
19+
<grabAttributeFrom userInput="src" selector="{{StorefrontProductMediaSection.fotoramaImageThumbnailImgByNumber(position)}}" stepKey="grabSrcFromThumbnailImageByPosition"/>
20+
<assertRegExp stepKey="checkImagePositionInThumbnail">
21+
<actualResult type="variable">$grabSrcFromThumbnailImageByPosition</actualResult>
22+
<expectedResult type="string">|{{image}}[_\d]*.{{extension}}|</expectedResult>
23+
</assertRegExp>
24+
</actionGroup>
25+
</actionGroups>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
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"
9+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
10+
<actionGroup name="AssertStorefrontProductPageGalleryMainImageButtonsActionGroup">
11+
<annotations>
12+
<description>Assert the buttons functionality "change image" on the product media gallery on the product page</description>
13+
</annotations>
14+
<arguments>
15+
<argument name="startImage" type="string" />
16+
<argument name="expectedImage" type="string" />
17+
</arguments>
18+
<moveMouseOver selector="{{StorefrontProductMediaSection.mainImageForJsActions}}" stepKey="hoverOverImage"/>
19+
<waitForElementVisible selector="{{StorefrontProductMediaSection.imageNextButton}}" stepKey="waitForButtons"/>
20+
<seeElement selector="{{StorefrontProductMediaSection.productImage(startImage)}}" stepKey="seeProductImageBeforeActions"/>
21+
<click selector="{{StorefrontProductMediaSection.imageNextButton}}" stepKey="clickOnNextImageButton"/>
22+
<seeElement selector="{{StorefrontProductMediaSection.imgSelectedInThumbnail(expectedImage)}}" stepKey="seeExpectedImageSelectedInRibbon"/>
23+
<seeElement selector="{{StorefrontProductMediaSection.productImage(expectedImage)}}" stepKey="seeExpectedImageOnPreview"/>
24+
<click selector="{{StorefrontProductMediaSection.imagePrevButton}}" stepKey="clickOnPrevImageButton"/>
25+
<seeElement selector="{{StorefrontProductMediaSection.imgSelectedInThumbnail(startImage)}}" stepKey="seeActiveImageSelectedInRibbonAfterSecondChange"/>
26+
<seeElement selector="{{StorefrontProductMediaSection.productImage(startImage)}}" stepKey="seeMainProductImageAfterSecondChange"/>
27+
</actionGroup>
28+
</actionGroups>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
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+
9+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="AssertStorefrontProductPageGalleryThumbnailDragActionGroup">
12+
<annotations>
13+
<description>Check functional of drag actions in the thumbnail ribbon on the product page</description>
14+
</annotations>
15+
<arguments>
16+
<argument name="dragPointImage" type="string" />
17+
<argument name="currentImage" type="string"/>
18+
<argument name="firstImage" type="string" />
19+
</arguments>
20+
<waitForElementVisible selector="{{StorefrontProductMediaSection.productImage(currentImage)}}" stepKey="seeMainImageBeforeDragActions"/>
21+
<dontSeeElement selector="{{StorefrontProductMediaSection.fotoramaPrevButton}}" stepKey="dontSeePrevButtonBeforeDragActions"/>
22+
<dragAndDrop selector1="{{StorefrontProductMediaSection.productImageInFotorama(dragPointImage)}}" selector2="{{StorefrontProductMediaSection.productImageInFotorama(dragPointImage)}}" x="-300" y="0" stepKey="dragRibbonForward"/>
23+
<seeElement selector="{{StorefrontProductMediaSection.productImage(currentImage)}}" stepKey="seeMainImageDontChangeAfterDrag"/>
24+
<waitForElementVisible selector="{{StorefrontProductMediaSection.fotoramaPrevButton}}" stepKey="waitPrevButton"/>
25+
<seeElement selector="{{StorefrontProductMediaSection.fotoramaPrevButton}}" stepKey="seePrevButton"/>
26+
<dontSeeElement selector="{{StorefrontProductMediaSection.productImageInFotorama(firstImage)}}" stepKey="dontSeeFirstImageInRibbonAfterDrag"/>
27+
<dragAndDrop selector1="{{StorefrontProductMediaSection.productImageInFotorama(dragPointImage)}}" selector2="{{StorefrontProductMediaSection.productImageInFotorama(dragPointImage)}}" x="300" y="0" stepKey="dragBackRibbon"/>
28+
<seeElement selector="{{StorefrontProductMediaSection.productImage(currentImage)}}" stepKey="seeMainImageDontChangeAfterBackDrag"/>
29+
<seeElement selector="{{StorefrontProductMediaSection.productImageInFotorama(firstImage)}}" stepKey="seeFirstImageInRibbonAfterBackDrag"/>
30+
<dontSeeElement selector="{{StorefrontProductMediaSection.fotoramaPrevButton}}" stepKey="dontSeePrevButtonAfterBackDrag"/>
31+
</actionGroup>
32+
</actionGroups>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
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+
9+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="StorefrontProductPageGalleryDragMainImageBackActionGroup">
12+
<annotations>
13+
<description>Drag back main image in the media gallery of product page</description>
14+
</annotations>
15+
<moveMouseOver selector="{{StorefrontProductMediaSection.mainImageForJsActions}}" stepKey="hoverOnProductImage"/>
16+
<waitForElementVisible selector="{{StorefrontProductMediaSection.imageNextButton}}" stepKey="waitNextButton"/>
17+
<dragAndDrop selector1="{{StorefrontProductMediaSection.mainImageForJsActions}}" selector2="{{StorefrontProductMediaSection.imageNextButton}}" x="200" y="0" stepKey="dragImageBack"/>
18+
</actionGroup>
19+
</actionGroups>

0 commit comments

Comments
 (0)