Skip to content

Commit e5f676d

Browse files
committed
Merge branch '2.2.10-develop' of https://github.com/magento/magento2ce into MC-19172
2 parents 7497bf5 + cdc6ea2 commit e5f676d

26 files changed

+575
-133
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: 65 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -15,26 +15,27 @@
1515
</arguments>
1616
<!-- Go to the admin Catalog rule grid and add a new one -->
1717
<amOnPage url="{{AdminCatalogPriceRuleGridPage.url}}" stepKey="goToAdminCatalogPriceRuleGridPage"/>
18-
<waitForLoadingMaskToDisappear stepKey="waitForLoadingMaskToDisappear"/>
18+
<waitForPageLoad time="30" stepKey="waitForPageFullyLoaded"/>
1919
<click selector="{{AdminMainActionsSection.add}}" stepKey="addNewRule"/>
20-
<waitForLoadingMaskToDisappear stepKey="waitForLoadingMaskToDisappear1"/>
2120

2221
<!-- Fill the form according the attributes of the entity -->
22+
<waitForElementVisible selector="{{AdminCatalogPriceRuleSection.ruleName}}" stepKey="waitRuleNameFieldAppears"/>
2323
<fillField selector="{{AdminCatalogPriceRuleSection.ruleName}}" userInput="{{catalogRule.name}}" stepKey="fillName"/>
2424
<fillField selector="{{AdminCatalogPriceRuleSection.description}}" userInput="{{catalogRule.description}}" stepKey="fillDescription"/>
2525
<selectOption selector="{{AdminCatalogPriceRuleSection.websites}}" parameterArray="{{catalogRule.websites}}" stepKey="selectWebsites"/>
2626
<selectOption selector="{{AdminCatalogPriceRuleSection.customerGroups}}" parameterArray="{{catalogRule.groups}}" stepKey="selectCustomerGroups"/>
2727

28-
<click selector="{{AdminCatalogPriceRuleSection.actionsTab}}" stepKey="openActionDropdown"/>
28+
<scrollTo selector="{{AdminCatalogPriceRuleSection.actionsTabTitle}}" stepKey="scrollToActionsSection"/>
29+
<conditionalClick selector="{{AdminCatalogPriceRuleSection.actionsTabTitle}}" dependentSelector="{{AdminCatalogPriceRuleSection.actionsTabBody}}" visible="false" stepKey="openActionsTabIfCollapsed"/>
2930
<selectOption selector="{{AdminCatalogPriceRuleActionsSection.apply}}" userInput="{{catalogRule.simple_action}}" stepKey="discountType"/>
3031
<fillField selector="{{AdminCatalogPriceRuleActionsSection.discountAmount}}" userInput="{{catalogRule.discount_amount}}" stepKey="fillDiscountValue"/>
3132
<selectOption selector="{{AdminCatalogPriceRuleActionsSection.disregardRules}}" userInput="Yes" stepKey="discardSubsequentRules"/>
3233

3334
<!-- Scroll to top and either save or save and apply after the action group -->
3435
<scrollToTopOfPage stepKey="scrollToTop"/>
3536
<click selector="{{AdminMainActionsSection.save}}" stepKey="clickSave"/>
36-
<waitForPageLoad stepKey="waitForRuleSaved"/>
37-
<see userInput="You saved the rule." stepKey="verifyRuleSaved"/>
37+
<waitForElementVisible selector="{{AdminMessagesSection.success}}" stepKey="waitForSuccessMessage"/>
38+
<see selector="{{AdminMessagesSection.success}}" userInput="You saved the rule." stepKey="checkSuccessMessage"/>
3839
</actionGroup>
3940

4041
<actionGroup name="RemoveCatalogPriceRule">
@@ -48,13 +49,12 @@
4849
<fillField selector="{{AdminCatalogPriceRuleGridSection.filterByRuleName}}" userInput="{{ruleName}}" stepKey="filterByRuleName"/>
4950
<click selector="{{AdminDataGridHeaderSection.applyFilters}}" stepKey="clickSearch"/>
5051
<click selector="{{AdminGridTableSection.row('1')}}" stepKey="clickEdit"/>
51-
<waitForLoadingMaskToDisappear stepKey="waitForLoadingMaskToDisappear1"/>
52-
52+
<waitForPageLoad stepKey="waitForEditRuleFormLoad"/>
53+
<waitForElementVisible selector="{{AdminMainActionsSection.delete}}" stepKey="waitDeleteButtonAppears"/>
5354
<click selector="{{AdminMainActionsSection.delete}}" stepKey="clickToDelete"/>
5455
<waitForElementVisible selector="{{AdminConfirmationModalSection.ok}}" stepKey="waitForElementVisible"/>
5556
<click selector="{{AdminConfirmationModalSection.ok}}" stepKey="clickToConfirm"/>
5657
<waitForPageLoad stepKey="waitForPageLoad"/>
57-
<waitForLoadingMaskToDisappear stepKey="waitForLoadingMaskToDisappear2"/>
5858
<waitForElementVisible selector="{{AdminMessagesSection.success}}" stepKey="waitSuccessMessageAppears"/>
5959
<see selector="{{AdminMessagesSection.success}}" userInput="You deleted the rule." stepKey="checkSuccessMessage"/>
6060
</actionGroup>
@@ -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>

app/code/Magento/CatalogRule/Test/Mftf/Data/CatalogRuleData.xml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,4 +47,16 @@
4747
<data key="simple_action">to_percent</data>
4848
<data key="discount_amount">90</data>
4949
</entity>
50+
<entity name="CatalogRuleToPercent90" type="catalogRule">
51+
<data key="name" unique="suffix">CatalogPriceRule</data>
52+
<data key="description">Catalog Price Rule Description</data>
53+
<array key="groups">
54+
<item>NOT LOGGED IN</item>
55+
</array>
56+
<array key="websites">
57+
<item>Main Website</item>
58+
</array>
59+
<data key="simple_action">Adjust final price to this percentage</data>
60+
<data key="discount_amount">90</data>
61+
</entity>
5062
</entities>
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/CatalogRule/Test/Mftf/Section/AdminCatalogPriceRuleSection.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,5 +27,7 @@
2727
<element name="priority" type="input" selector="[name='sort_order']"/>
2828
<element name="conditionsTab" type="block" selector="[data-index='block_promo_catalog_edit_tab_conditions']"/>
2929
<element name="actionsTab" type="block" selector="[data-index='actions']"/>
30+
<element name="actionsTabTitle" type="block" selector="[data-index='actions'] .fieldset-wrapper-title"/>
31+
<element name="actionsTabBody" type="block" selector="[data-index='actions'] .admin__fieldset-wrapper-content"/>
3032
</section>
3133
</sections>

0 commit comments

Comments
 (0)