Skip to content

Commit 5acbf03

Browse files
committed
Merge remote-tracking branch 'mainline/2.4-develop' into PWA-1326
2 parents 13b0913 + dfd17e9 commit 5acbf03

File tree

10 files changed

+600
-1879
lines changed

10 files changed

+600
-1879
lines changed
Lines changed: 24 additions & 0 deletions
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+
9+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="StorefrontRemoveFirstProductFromCompareActionGroup">
12+
<annotations>
13+
<description>Open Compare Products list and remove a product</description>
14+
</annotations>
15+
16+
<amOnPage url="{{StorefrontProductComparePage.url}}" stepKey="navigateToComparePage"/>
17+
<waitForElementVisible selector="{{StorefrontProductCompareMainSection.removeFirstItem}}" stepKey="waitForButton"/>
18+
<click selector="{{StorefrontProductCompareMainSection.removeFirstItem}}" stepKey="clickOnButton"/>
19+
<waitForElementVisible selector="{{ModalConfirmationSection.OkButton}}" stepKey="waitForModal"/>
20+
<scrollTo selector="{{ModalConfirmationSection.OkButton}}" stepKey="scrollToModal"/>
21+
<click selector="{{ModalConfirmationSection.OkButton}}" stepKey="ClickOkButton"/>
22+
<waitForElementVisible selector="{{StorefrontMessagesSection.success}}" stepKey="waitForSuccessMessage"/>
23+
</actionGroup>
24+
</actionGroups>

app/code/Magento/Catalog/Test/Mftf/Section/StorefrontProductCompareMainSection.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,6 @@
1414
<element name="ProductPriceByName" type="text" selector="//*[@id='product-comparison']//td[.//strong[@class='product-item-name']/a[contains(text(), '{{var1}}')]]//span[@class='price']" parameterized="true"/>
1515
<element name="ProductImageByName" type="text" selector="//*[@id='product-comparison']//td[.//strong[@class='product-item-name']/a[contains(text(), '{{var1}}')]]//img[@class='product-image-photo']" parameterized="true"/>
1616
<element name="ProductAttributeByCodeAndProductName" type="text" selector="//*[@id='product-comparison']//tr[.//th[./span[contains(text(), '{{var1}}')]]]//td[count(//*[@id='product-comparison']//tr//td[.//strong[@class='product-item-name']/a[contains(text(), '{{var2}}')]]/preceding-sibling::td)+1]/div" parameterized="true"/>
17+
<element name="removeFirstItem" type="button" selector="table.table-comparison a.delete"/>
1718
</section>
1819
</sections>

app/code/Magento/Catalog/Test/Mftf/Test/AddOutOfStockProductToCompareListTest.xml

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,7 @@
7878
<actionGroup ref="StorefrontGoToCategoryPageActionGroup" stepKey="openCategoryPage">
7979
<argument name="categoryName" value="$$category.name$$"/>
8080
</actionGroup>
81-
82-
<actionGroup ref="StorefrontOpenAndCheckComparisionActionGroup" stepKey="navigateToComparePage"/>
81+
<comment userInput="Comment is kept to preserve the step key for backward compatibility" stepKey="navigateToComparePage"/>
8382
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForStorefrontProductComparePageLoad"/>
8483

8584
<actionGroup ref="SeeProductInComparisonListActionGroup" stepKey="seeProductInCompareList">
@@ -92,11 +91,13 @@
9291
<argument name="categoryName" value="$$category.name$$"/>
9392
</actionGroup>
9493

95-
<actionGroup ref="StorefrontClearCompareActionGroup" stepKey="clickClearAll"/>
94+
<actionGroup ref="StorefrontRemoveFirstProductFromCompareActionGroup" stepKey="clickClearAll"/>
9695
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForConfirmPageLoad"/>
9796
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="confirmProdDelate"/>
9897
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForConfirmLoad"/>
99-
<comment userInput="Add product to compare list fom Category page | Comment is kept to preserve the step key for backward compatibility" stepKey="addToCmpFromCategPage"/>
98+
<actionGroup ref="StorefrontGoToCategoryPageActionGroup" stepKey="addToCmpFromCategPage">
99+
<argument name="categoryName" value="$$category.name$$"/>
100+
</actionGroup>
100101

101102
<actionGroup ref="StorefrontHoverProductOnCategoryPageActionGroup" stepKey="hoverOverProduct"/>
102103

@@ -108,11 +109,11 @@
108109
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="grabTextFromSuccessMessage2"/>
109110
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="assertSuccessMessage2"/>
110111

111-
<comment userInput="Check that product displays on add to compare widget | Comment is kept to preserve the step key for backward compatibility" stepKey="checkProdNameOnWidget"/>
112-
<seeElement selector="{{StorefrontComparisonSidebarSection.ProductTitleByName($$product.name$$)}}" stepKey="seeProdNameOnCmpWidget"/>
112+
<comment userInput="Comment is kept to preserve the step key for backward compatibility" stepKey="checkProdNameOnWidget"/>
113+
<comment userInput="Comment is kept to preserve the step key for backward compatibility" stepKey="seeProdNameOnCmpWidget"/>
113114

114115
<comment userInput="See product in the compare page" stepKey="seeProductInComparePage"/>
115-
<actionGroup ref="StorefrontOpenAndCheckComparisionActionGroup" stepKey="navigateToComparePage2"/>
116+
<comment userInput="Comment is kept to preserve the step key for backward compatibility" stepKey="navigateToComparePage2"/>
116117
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForStorefrontProductComparePageLoad2"/>
117118

118119
<actionGroup ref="SeeProductInComparisonListActionGroup" stepKey="seeProductInCompareList2">

app/code/Magento/ProductVideo/Test/Mftf/ActionGroup/AssertProductVideoNavigationArrowsActionGroup.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
</arguments>
1919

2020
<dontSeeElement selector="{{StorefrontProductMediaSection.imagePrevButton}}" stepKey="dontSeePrevButton"/>
21-
<moveMouseOver selector="{{StorefrontProductMediaSection.mainImageForJsActions}}" stepKey="hoverOverImage"/>
21+
<moveMouseOver selector="{{StorefrontProductInfoMainSection.clickPlayVideo}}" stepKey="hoverOverImage"/>
2222
<waitForElementVisible selector="{{StorefrontProductMediaSection.imageNextButton}}" stepKey="seeNextButton"/>
2323
<click selector="{{StorefrontProductMediaSection.imageNextButton}}" stepKey="clickNextButton"/>
2424
<waitForElementVisible selector="{{StorefrontProductInfoMainSection.productVideo(videoType)}}" stepKey="seeProductVideoDataType"/>
@@ -38,7 +38,7 @@
3838
<moveMouseOver selector="{{StorefrontCMSPageSection.mainTitle}}" stepKey="unFocusVideo"/>
3939
<waitForElement selector="{{StorefrontProductMediaSection.galleryNoControlsElement}}" stepKey="waitForVideoUnFocus"/>
4040

41-
<moveMouseOver selector="{{StorefrontProductMediaSection.mainImageForJsActions}}" stepKey="hoverOverImageSecond"/>
41+
<moveMouseOver selector="{{StorefrontProductInfoMainSection.clickPlayVideo}}" stepKey="hoverOverImageSecond"/>
4242
<waitForElementVisible selector="{{StorefrontProductMediaSection.imagePrevButton}}" stepKey="seePrevButton"/>
4343
<click selector="{{StorefrontProductMediaSection.imagePrevButton}}" stepKey="clickPrevButton"/>
4444
</actionGroup>

app/code/Magento/Ui/view/base/web/js/lib/validation/rules.js

Lines changed: 30 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -836,23 +836,47 @@ define([
836836
],
837837
'less-than-equals-to': [
838838
function (value, params) {
839-
if ($.isNumeric(params) && $.isNumeric(value)) {
840-
return parseFloat(value) <= parseFloat(params);
839+
value = utils.parseNumber(value);
840+
841+
if (isNaN(parseFloat(params))) {
842+
params = $(params).val();
843+
}
844+
845+
params = utils.parseNumber(params);
846+
847+
if (!isNaN(params) && !isNaN(value)) {
848+
this.lteToVal = params;
849+
850+
return value <= params;
841851
}
842852

843853
return true;
844854
},
845-
$.mage.__('Please enter a value less than or equal to {0}.')
855+
function () {
856+
return $.mage.__('Please enter a value less than or equal to %s.').replace('%s', this.lteToVal);
857+
}
846858
],
847859
'greater-than-equals-to': [
848860
function (value, params) {
849-
if ($.isNumeric(params) && $.isNumeric(value)) {
850-
return parseFloat(value) >= parseFloat(params);
861+
value = utils.parseNumber(value);
862+
863+
if (isNaN(parseFloat(params))) {
864+
params = $(params).val();
865+
}
866+
867+
params = utils.parseNumber(params);
868+
869+
if (!isNaN(params) && !isNaN(value)) {
870+
this.gteToVal = params;
871+
872+
return value >= params;
851873
}
852874

853875
return true;
854876
},
855-
$.mage.__('Please enter a value greater than or equal to {0}.')
877+
function () {
878+
return $.mage.__('Please enter a value greater than or equal to %s.').replace('%s', this.gteToVal);
879+
}
856880
],
857881
'validate-emails': [
858882
function (value) {

0 commit comments

Comments
 (0)