Skip to content

Commit 778b54c

Browse files
committed
Merge remote-tracking branch 'origin/2.2.10-develop' into MC-19048
2 parents 7edfdab + 3ae1e3e commit 778b54c

File tree

21 files changed

+545
-117
lines changed

21 files changed

+545
-117
lines changed
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
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="AdminClickSaveAndContinueButtonActionGroup">
12+
<annotations>
13+
<description>Click "Save and Continue" button and assert message</description>
14+
</annotations>
15+
<arguments>
16+
<argument name="message" type="string"/>
17+
</arguments>
18+
<scrollToTopOfPage stepKey="scrollToPageTop"/>
19+
<click selector="{{AdminMainActionsSection.saveAndContinue}}" stepKey="clickSaveAndContinue"/>
20+
<waitForElementVisible time="30" selector="{{AdminMessagesSection.success}}" stepKey="waitMessage"/>
21+
<see selector="{{AdminMessagesSection.success}}" userInput="{{message}}" stepKey="verifyMessage"/>
22+
</actionGroup>
23+
</actionGroups>

app/code/Magento/Braintree/view/frontend/web/js/view/payment/method-renderer/cc-form.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -246,8 +246,10 @@ define(
246246
return;
247247
}
248248

249-
self.setPaymentPayload(payload);
250-
self.placeOrder();
249+
if (self.validateCardType()) {
250+
self.setPaymentPayload(payload);
251+
self.placeOrder();
252+
}
251253
});
252254
}
253255
},

app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontCategoryActionGroup.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@
6161
</arguments>
6262
<!-- Go to storefront category page -->
6363
<amOnPage url="{{StorefrontCategoryPage.url(category)}}?product_list_mode={{mode}}&amp;product_list_order={{sortBy}}&amp;product_list_dir={{sort}}" stepKey="onCategoryPage"/>
64+
<waitForPageLoad time="30" stepKey="waitCategoryPageLoaded"/>
6465
</actionGroup>
6566

6667
<actionGroup name="VerifyCategoryPageParameters">
@@ -70,7 +71,6 @@
7071
<argument name="numOfProductsPerPage" type="string"/>
7172
<argument name="sortBy" type="string" defaultValue="position"/>
7273
</arguments>
73-
<amOnPage url="{{StorefrontCategoryPage.url(categoryName)}}" stepKey="navigateToCategoryPage"/>
7474
<seeInTitle userInput="{{categoryName}}" stepKey="assertCategoryNameInTitle"/>
7575
<see userInput="{{categoryName}}" selector="{{StorefrontCategoryMainSection.categoryTitle}}" stepKey="assertCategoryName"/>
7676
<see userInput="{{mode}}" selector="{{StorefrontCategoryPagerSection.modeGridIsActive}}" stepKey="assertViewMode"/>
Lines changed: 19 additions & 0 deletions
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+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
9+
<actionGroup name="StorefrontNavigateCategoryPageActionGroup">
10+
<annotations>
11+
<description>Navigates storefront category page by url key</description>
12+
</annotations>
13+
<arguments>
14+
<argument name="categoryUrlKey"/>
15+
</arguments>
16+
<amOnPage url="{{StorefrontCategoryPage.url(categoryUrlKey)}}" stepKey="navigateStorefrontCategoryPage"/>
17+
<waitForPageLoad time="30" stepKey="waitCategoryPageLoaded"/>
18+
</actionGroup>
19+
</actionGroups>

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

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@
3030
</createData>
3131

3232
<createData entity="RememberPaginationCatalogStorefrontConfig" stepKey="setRememberPaginationCatalogStorefrontConfig"/>
33-
<magentoCLI command="cache:flush" stepKey="clearCache"/>
3433
</before>
3534

3635
<after>
@@ -40,26 +39,29 @@
4039
<deleteData createDataKey="createCategory" stepKey="deleteCategory"/>
4140
<deleteData createDataKey="createProduct1" stepKey="deleteProduct1"/>
4241
<deleteData createDataKey="createCategory1" stepKey="deleteCategory1"/>
43-
44-
<magentoCLI command="cache:flush" stepKey="flushCache"/>
4542
</after>
4643

47-
<actionGroup ref="GoToStorefrontCategoryPageByParameters" stepKey="goToStorefrontCategory1Page">
48-
<argument name="category" value="$$createCategory.name$$"/>
44+
<actionGroup ref="GoToStorefrontCategoryPageByParameters" stepKey="goToStorefrontCategoryPage">
45+
<argument name="category" value="$$createCategory.custom_attributes[url_key]$$"/>
4946
<argument name="mode" value="grid"/>
5047
</actionGroup>
5148

5249
<selectOption selector="{{StorefrontCategoryPagerSection.perPage}}" userInput="12" stepKey="setPerPage" />
53-
<waitForPageLoad stepKey="waitForPageLoad"/>
50+
<waitForPageLoad time="30" stepKey="waitForPageLoad"/>
51+
52+
<actionGroup ref="StorefrontNavigateCategoryPageActionGroup" stepKey="navigateToCategoryPage">
53+
<argument name="categoryUrlKey" value="$$createCategory.custom_attributes[url_key]$$"/>
54+
</actionGroup>
5455

5556
<actionGroup ref="VerifyCategoryPageParameters" stepKey="verifyCategoryPageParameters">
5657
<argument name="categoryName" value="$$createCategory.name$$"/>
5758
<argument name="mode" value="grid"/>
5859
<argument name="numOfProductsPerPage" value="12"/>
5960
</actionGroup>
6061

61-
<amOnPage url="{{StorefrontCategoryPage.url($$createCategory1.name$$)}}" stepKey="navigateToCategory1Page"/>
62-
<waitForPageLoad stepKey="waitForCategory1PageToLoad"/>
62+
<actionGroup ref="StorefrontNavigateCategoryPageActionGroup" stepKey="navigateToCategory1Page">
63+
<argument name="categoryUrlKey" value="$$createCategory1.custom_attributes[url_key]$$"/>
64+
</actionGroup>
6365

6466
<actionGroup ref="VerifyCategoryPageParameters" stepKey="verifyCategory1PageParameters">
6567
<argument name="categoryName" value="$$createCategory1.name$$"/>

app/code/Magento/CatalogRule/Test/Mftf/ActionGroup/CatalogPriceRuleActionGroup.xml

Lines changed: 57 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@
107107
<executeInSelenium
108108
function="
109109
function ($webdriver) use ($I) {
110-
$rows = $webdriver->findElements(\Facebook\WebDriver\WebDriverBy::cssSelector('table.data-grid tbody tr._clickable[data-role=row]:nth-of-type(1)'));
110+
$rows = $webdriver->findElements(\Facebook\WebDriver\WebDriverBy::cssSelector('table.data-grid tbody tr[data-role=row]:not(.data-grid-tr-no-data):nth-of-type(1)'));
111111
while(!empty($rows)) {
112112
$rows[0]->click();
113113
$I->waitForPageLoad(30);
@@ -120,11 +120,65 @@
120120
$I->waitForLoadingMaskToDisappear();
121121
$I->waitForElementVisible('#messages div.message-success', 10);
122122
$I->see('You deleted the rule.', '#messages div.message-success');
123-
$rows = $webdriver->findElements(\Facebook\WebDriver\WebDriverBy::cssSelector('table.data-grid tbody tr._clickable[data-role=row]:nth-of-type(1)'));
123+
$rows = $webdriver->findElements(\Facebook\WebDriver\WebDriverBy::cssSelector('table.data-grid tbody tr[data-role=row]:not(.data-grid-tr-no-data):nth-of-type(1)'));
124124
}
125125
}"
126-
stepKey="deleteAllCartPriceRulesOneByOne"/>
126+
stepKey="deleteAllCatalogPriceRulesOneByOne"/>
127127
<waitForElementVisible selector="{{AdminDataGridTableSection.dataGridEmpty}}" stepKey="waitDataGridEmptyMessageAppears"/>
128128
<see selector="{{AdminDataGridTableSection.dataGridEmpty}}" userInput="We couldn't find any records." stepKey="assertDataGridEmptyMessage"/>
129129
</actionGroup>
130+
131+
<actionGroup name="AdminStartCreateNewCatalogRuleActionGroup">
132+
<amOnPage url="{{AdminCatalogPriceRuleGridPage.url}}" stepKey="goToAdminCatalogPriceRuleGridPage"/>
133+
<waitForPageLoad time="30" stepKey="waitForGridPage"/>
134+
<click selector="{{AdminMainActionsSection.add}}" stepKey="addNewRule"/>
135+
<waitForElementVisible selector="{{AdminCatalogPriceRuleSection.ruleName}}" stepKey="waitCreatePageLoaded"/>
136+
</actionGroup>
137+
138+
<actionGroup name="AdminFillCatalogRuleFormActionGroup">
139+
<arguments>
140+
<argument name="catalogRule" defaultValue="CustomCatalogRule"/>
141+
</arguments>
142+
143+
<fillField selector="{{AdminCatalogPriceRuleSection.ruleName}}" userInput="{{catalogRule.name}}" stepKey="fillName"/>
144+
<fillField selector="{{AdminCatalogPriceRuleSection.description}}" userInput="{{catalogRule.description}}" stepKey="fillDescription"/>
145+
<selectOption selector="{{AdminCatalogPriceRuleSection.websites}}" parameterArray="{{catalogRule.websites}}" stepKey="selectWebsites"/>
146+
<selectOption selector="{{AdminCatalogPriceRuleSection.customerGroups}}" parameterArray="{{catalogRule.groups}}" stepKey="selectCustomerGroups"/>
147+
148+
<click selector="{{AdminCatalogPriceRuleSection.actionsTab}}" stepKey="openActionDropdown"/>
149+
<selectOption selector="{{AdminCatalogPriceRuleActionsSection.apply}}" userInput="{{catalogRule.simple_action}}" stepKey="discountType"/>
150+
<fillField selector="{{AdminCatalogPriceRuleActionsSection.discountAmount}}" userInput="{{catalogRule.discount_amount}}" stepKey="fillDiscountValue"/>
151+
<selectOption selector="{{AdminCatalogPriceRuleActionsSection.disregardRules}}" userInput="Yes" stepKey="discardSubsequentRules"/>
152+
</actionGroup>
153+
154+
<actionGroup name="AdminFillCatalogRuleConditionActionGroup">
155+
<arguments>
156+
<argument name="condition" type="string"/>
157+
<argument name="conditionOperator" type="string" defaultValue="is"/>
158+
<argument name="conditionValue" type="string"/>
159+
</arguments>
160+
161+
<conditionalClick selector="{{AdminCatalogPriceRuleSection.conditionsTab}}" dependentSelector="{{AdminCatalogPriceRuleConditionsSection.newCondition}}" visible="false" stepKey="openConditionsTab"/>
162+
<waitForElementVisible selector="{{AdminCatalogPriceRuleConditionsSection.newCondition}}" stepKey="waitForAddConditionButton"/>
163+
<click selector="{{AdminCatalogPriceRuleConditionsSection.newCondition}}" stepKey="addNewCondition"/>
164+
<selectOption selector="{{AdminCatalogPriceRuleConditionsSection.conditionSelect('1')}}" userInput="{{condition}}" stepKey="selectTypeCondition"/>
165+
<click selector="{{AdminCatalogPriceRuleConditionsSection.condition('is')}}" stepKey="clickOnOperator"/>
166+
<selectOption selector="{{AdminCatalogPriceRuleConditionsSection.activeOperatorSelect}}" userInput="{{conditionOperator}}" stepKey="selectCondition"/>
167+
<!-- In case we are choosing already selected value - select is not closed automatically -->
168+
<conditionalClick selector="{{AdminCatalogPriceRuleConditionsSection.condition('...')}}" dependentSelector="{{AdminCatalogPriceRuleConditionsSection.activeOperatorSelect}}" visible="true" stepKey="closeSelect"/>
169+
<click selector="{{AdminCatalogPriceRuleConditionsSection.condition('...')}}" stepKey="clickToChooseOption3"/>
170+
<waitForElementVisible selector="{{AdminCatalogPriceRuleConditionsSection.activeValueInput}}" stepKey="waitForValueInput"/>
171+
<fillField selector="{{AdminCatalogPriceRuleConditionsSection.activeValueInput}}" userInput="{{conditionValue}}" stepKey="fillConditionValue"/>
172+
<click selector="{{AdminCatalogPriceRuleConditionsSection.activeConditionApplyButton}}" stepKey="clickApply"/>
173+
<waitForElementNotVisible selector="{{AdminCatalogPriceRuleConditionsSection.activeConditionApplyButton}}" stepKey="waitForApplyButtonInvisibility"/>
174+
</actionGroup>
175+
176+
<actionGroup name="AdminSaveAndApplyCatalogPriceRuleActionGroup">
177+
<scrollToTopOfPage stepKey="scrollToPageTop"/>
178+
<click selector="{{AdminCatalogPriceRuleSection.saveAndApply}}" stepKey="saveAndApply"/>
179+
<waitForElementVisible selector="{{AdminMessagesSection.success}}" stepKey="waitSuccessMessage"/>
180+
<see selector="{{AdminMessagesSection.success}}" userInput="You saved the rule." stepKey="assertSaveSuccess"/>
181+
<see selector="{{AdminMessagesSection.success}}" userInput="Updated rules applied." stepKey="assertApplySuccess"/>
182+
</actionGroup>
183+
130184
</actionGroups>
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
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+
<entities xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:DataGenerator/etc/dataProfileSchema.xsd">
11+
<entity name="CatalogRuleProductConditions">
12+
<data key="productSku">Magento\CatalogRule\Model\Rule\Condition\Product|sku</data>
13+
</entity>
14+
</entities>

app/code/Magento/CatalogRule/Test/Mftf/Section/AdminCatalogPriceRuleConditionsSection.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,9 @@
1414
<element name="targetEllipsis" type="button" selector="//li[{{var}}]//a[@class='label'][text() = '...']" parameterized="true" timeout="30"/>
1515
<element name="targetInput" type="input" selector="input#conditions__{{var1}}--{{var2}}__value" parameterized="true"/>
1616
<element name="applyButton" type="button" selector="#conditions__{{var1}}__children li:nth-of-type({{var2}}) a.rule-param-apply" parameterized="true" timeout="30"/>
17+
<element name="condition" type="text" selector="//span[@class='rule-param']/a[text()='{{condition}}']" parameterized="true"/>
18+
<element name="activeOperatorSelect" type="select" selector=".rule-param-edit select[name*='[operator]']"/>
19+
<element name="activeValueInput" type="input" selector=".rule-param-edit [name*='[value]']"/>
20+
<element name="activeConditionApplyButton" type="button" selector=".rule-param-edit .rule-param-apply" timeout="30"/>
1721
</section>
1822
</sections>

app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontSortingByPriceForConfigurableWithCatalogRuleAppliedTest.xml

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -87,13 +87,13 @@
8787
<requiredEntity createDataKey="createConfigChildProduct3"/>
8888
</createData>
8989
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/>
90+
<actionGroup ref="deleteAllCatalogPriceRule" stepKey="deleteCatalogRules"/>
9091
<!--SKU Product Attribute is enabled for Promo Rule Conditions-->
9192
<actionGroup ref="navigateToEditProductAttribute" stepKey="navigateToSkuProductAttribute">
9293
<argument name="attributeLabel" value="sku"/>
9394
</actionGroup>
9495
<actionGroup ref="changeUseForPromoRuleConditionsProductAttribute" stepKey="changeUseForPromoRuleConditionsProductAttributeToYes"/>
9596
<magentoCLI command="indexer:reindex" stepKey="reindex"/>
96-
<magentoCLI command="cache:flush" stepKey="flushCache"/>
9797
</before>
9898

9999
<after>
@@ -106,13 +106,19 @@
106106
<deleteData createDataKey="createConfigProduct" stepKey="deleteConfigProduct"/>
107107
<deleteData createDataKey="createConfigProductAttribute" stepKey="deleteConfigProductAttribute"/>
108108

109+
<!-- Delete the rule -->
110+
<actionGroup ref="RemoveCatalogPriceRule" stepKey="deletePriceRule">
111+
<argument name="ruleName" value="CatalogRule96PercentDiscount.name" />
112+
</actionGroup>
113+
<actionGroup ref="clearFiltersAdminDataGrid" stepKey="clearCatalogRuleGridFilters"/>
109114
<!--SKU Product Attribute is disable for Promo Rule Conditions-->
110115
<actionGroup ref="navigateToEditProductAttribute" stepKey="navigateToSkuProductAttribute">
111116
<argument name="attributeLabel" value="sku"/>
112117
</actionGroup>
113118
<actionGroup ref="changeUseForPromoRuleConditionsProductAttribute" stepKey="changeUseForPromoRuleConditionsProductAttributeToNo">
114119
<argument name="useForPromoRule" value="No"/>
115120
</actionGroup>
121+
<actionGroup ref="clearFiltersAdminDataGrid" stepKey="clearAttributeGridFilters"/>
116122
<actionGroup ref="logout" stepKey="logoutFromAdmin"/>
117123
</after>
118124

@@ -128,14 +134,19 @@
128134
<see selector="{{StorefrontCategoryMainSection.categoryPageProductName('3')}}" userInput="$$createSimpleProduct.name$$" stepKey="seeSimpleProduct"/>
129135

130136
<!--Create and apply catalog price rule-->
131-
<actionGroup ref="newCatalogPriceRuleByUIWithConditionIsSKU" stepKey="createCatalogPriceRule">
132-
<argument name="catalogRule" value="CatalogRule96PercentDiscount" />
133-
<argument name="productSku" value="$$createConfigChildProduct3.sku$$" />
137+
<actionGroup ref="AdminStartCreateNewCatalogRuleActionGroup" stepKey="startCreateNewCatalogRulePage"/>
138+
<actionGroup ref="AdminFillCatalogRuleFormActionGroup" stepKey="fillRuleFields">
139+
<argument name="catalogRule" value="CatalogRule96PercentDiscount"/>
140+
</actionGroup>
141+
<actionGroup ref="AdminFillCatalogRuleConditionActionGroup" stepKey="fillRuleConditions">
142+
<argument name="condition" value="{{CatalogRuleProductConditions.productSku}}"/>
143+
<argument name="conditionType" value="is"/>
144+
<argument name="conditionValue" value="$$createConfigChildProduct3.sku$$"/>
134145
</actionGroup>
135-
<click selector="{{AdminCatalogPriceRuleGridSection.applyRulesButton}}" stepKey="clickApplyRules"/>
146+
<actionGroup ref="AdminSaveAndApplyCatalogPriceRuleActionGroup" stepKey="saveAndApplyRule"/>
136147

137-
<magentoCLI command="indexer:reindex" stepKey="reindex1"/>
138-
<magentoCLI command="cache:flush" stepKey="flushCache1"/>
148+
<magentoCLI command="indexer:reindex" stepKey="reindex"/>
149+
<magentoCLI command="cache:flush" arguments="full_page" stepKey="flushCache"/>
139150

140151
<!--Reopen category with products and Sort by price desc-->
141152
<actionGroup ref="GoToStorefrontCategoryPageByParameters" stepKey="goToStorefrontCategoryPage2">
@@ -147,10 +158,5 @@
147158
<see selector="{{StorefrontCategoryMainSection.categoryPageProductName('1')}}" userInput="$$createSimpleProduct2.name$$" stepKey="seeSimpleProductTwo2"/>
148159
<see selector="{{StorefrontCategoryMainSection.categoryPageProductName('2')}}" userInput="$$createSimpleProduct.name$$" stepKey="seeSimpleProduct2"/>
149160
<see selector="{{StorefrontCategoryMainSection.categoryPageProductName('3')}}" userInput="$$createConfigProduct.name$$" stepKey="seeConfigurableProduct2"/>
150-
151-
<!-- Delete the rule -->
152-
<actionGroup ref="RemoveCatalogPriceRule" stepKey="deletePriceRule">
153-
<argument name="ruleName" value="CatalogRule96PercentDiscount.name" />
154-
</actionGroup>
155161
</test>
156162
</tests>

app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminOrderGridActionGroup.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
-->
88

99
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10-
xsi:noNamespaceSchemaLocation="../../../../../../../dev/tests/acceptance/vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Test/etc/actionGroupSchema.xsd">
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
1111
<!--Filter order grid by order id field-->
1212
<actionGroup name="filterOrderGridById">
1313
<arguments>

app/code/Magento/Sales/Test/Mftf/Section/AdminCreditMemoTotalSection.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,8 @@
1414
<element name="updateTotals" type="button" selector="button[class~='update-totals-button']:not([class~='disabled'])" timeout="30"/>
1515
<element name="submitRefundOffline" type="button" selector=".order-totals-actions button[title='Refund Offline']:not([class~='disabled'])" timeout="30"/>
1616
<element name="adjustmentRefund" type="input" selector=".order-subtotal-table tbody input[name='creditmemo[adjustment_positive]']"/>
17+
<element name="subTotal" type="text" selector=".order-subtotal-table tbody tr.col-0>td span.price"/>
18+
<element name="grandTotal" type="text" selector=".order-subtotal-table tfoot tr.col-0>td span.price"/>
19+
<element name="discount" type="text" selector="//table[contains(@class, 'order-subtotal-table')]//td[normalize-space(.)='Discount']/following-sibling::td//span[@class='price']"/>
1720
</section>
1821
</sections>

0 commit comments

Comments
 (0)