Skip to content

Commit cc6ba0d

Browse files
Merge branch '2.3-develop' of git.epam.com:magn-m23/magn-m23 into MAGETWO-96410
2 parents 591b85e + 25fb501 commit cc6ba0d

File tree

159 files changed

+7796
-1790
lines changed

Some content is hidden

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

159 files changed

+7796
-1790
lines changed

app/code/Magento/Authorizenet/Model/Directpost.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -707,6 +707,7 @@ protected function processOrder(\Magento\Sales\Model\Order $order)
707707
//decline the order (in case of wrong response code) but don't return money to customer.
708708
$message = $e->getMessage();
709709
$this->declineOrder($order, $message, false);
710+
710711
throw $e;
711712
}
712713

@@ -777,7 +778,7 @@ protected function processPaymentFraudStatus(\Magento\Sales\Model\Order\Payment
777778
}
778779

779780
/**
780-
* Add status comment
781+
* Add status comment to history
781782
*
782783
* @param \Magento\Sales\Model\Order\Payment $payment
783784
* @return $this
@@ -832,6 +833,7 @@ protected function declineOrder(\Magento\Sales\Model\Order $order, $message = ''
832833
->void($response);
833834
}
834835
$order->registerCancellation($message)->save();
836+
$this->_eventManager->dispatch('order_cancel_after', ['order' => $order ]);
835837
} catch (\Exception $e) {
836838
//quiet decline
837839
$this->getPsrLogger()->critical($e);
@@ -866,7 +868,7 @@ public function getConfigInterface()
866868
* Getter for specified value according to set payment method code
867869
*
868870
* @param mixed $key
869-
* @param int|string|null|\Magento\Store\Model\Store $storeId
871+
* @param mixed $storeId
870872
* @return mixed
871873
*/
872874
public function getValue($key, $storeId = null)
@@ -930,7 +932,7 @@ public function fetchTransactionInfo(\Magento\Payment\Model\InfoInterface $payme
930932
}
931933

932934
/**
933-
* Add statuc comment on update.
935+
* Add status comment on update
934936
*
935937
* @param \Magento\Sales\Model\Order\Payment $payment
936938
* @param \Magento\Framework\DataObject $response

app/code/Magento/Backend/Test/Mftf/ActionGroup/LoginAsAdminActionGroup.xml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,9 @@
1313
<argument name="adminUser" defaultValue="_ENV"/>
1414
</arguments>
1515
<amOnPage url="{{AdminLoginPage.url}}" stepKey="navigateToAdmin"/>
16-
<waitForPageLoad stepKey="waitForAdminLoginPageLoad"/>
1716
<fillField selector="{{AdminLoginFormSection.username}}" userInput="{{adminUser.MAGENTO_ADMIN_USERNAME}}" stepKey="fillUsername"/>
1817
<fillField selector="{{AdminLoginFormSection.password}}" userInput="{{adminUser.MAGENTO_ADMIN_PASSWORD}}" stepKey="fillPassword"/>
1918
<click selector="{{AdminLoginFormSection.signIn}}" stepKey="clickLogin"/>
2019
<closeAdminNotification stepKey="closeAdminNotification"/>
2120
</actionGroup>
22-
</actionGroups>
21+
</actionGroups>

app/code/Magento/Braintree/Test/Mftf/ActionGroup/DeleteCustomerActionGroup.xml

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,15 @@
66
*/
77
-->
88
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
9-
xsi:noNamespaceSchemaLocation="../../../../../../../dev/tests/acceptance/vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Test/etc/actionGroupSchema.xsd">
9+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
1010
<actionGroup name="DeleteCustomerActionGroup">
1111
<arguments>
1212
<argument name="lastName" defaultValue=""/>
1313
</arguments>
14-
<click stepKey="openCustomers" selector="{{AdminMenuSection.customers}}"/>
15-
<waitForPageLoad stepKey="waitForCatalogSubmenu" time="10"/>
16-
<click stepKey="clickOnAllCustomers" selector="{{CustomersSubmenuSection.allCustomers}}"/>
17-
<waitForPageLoad stepKey="waitForProductsPage" time="10"/>
14+
<!--Clear filter if exist-->
15+
<amOnPage url="{{AdminCustomerPage.url}}" stepKey="navigateToCustomers"/>
16+
<conditionalClick selector="{{AdminDataGridHeaderSection.clearFilters}}" dependentSelector="{{AdminDataGridHeaderSection.clearFilters}}" visible="true" stepKey="clearExistingCustomerFilters"/>
17+
1818
<click stepKey="chooseCustomer" selector="{{CustomersPageSection.customerCheckbox(lastName)}}"/>
1919
<waitForAjaxLoad stepKey="waitForThick" time="2"/>
2020
<click stepKey="OpenActions" selector="{{CustomersPageSection.actions}}"/>
@@ -23,6 +23,5 @@
2323
<waitForPageLoad stepKey="waitForDeleteItemPopup" time="10"/>
2424
<click stepKey="clickOnOk" selector="{{CustomersPageSection.ok}}"/>
2525
<waitForElementVisible stepKey="waitForSuccessfullyDeletedMessage" selector="{{CustomersPageSection.deletedSuccessMessage}}" time="10"/>
26-
2726
</actionGroup>
28-
</actionGroups>
27+
</actionGroups>

app/code/Magento/Braintree/Test/Mftf/Data/NewCustomerData.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
<data key="City">Yerevan</data>
1919
<data key="Zip">9999</data>
2020
<data key="PhoneNumber">9999</data>
21+
<data key="Country">Armenia</data>
2122
</entity>
2223

2324
</entities>

app/code/Magento/Bundle/Test/Mftf/ActionGroup/StorefrontProductCartActionGroup.xml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,18 @@
2424
<waitForPageLoad time="30" stepKey="waitForPageLoad3"/>
2525
<waitForText userInput="{{quantity}}" selector="{{StorefrontMinicartSection.productCount}}" time="30" stepKey="assertProductCount"/>
2626
</actionGroup>
27+
28+
<!-- Add Bundle Product to Cart from the category page -->
29+
<actionGroup name="StorefrontAddBundleProductFromCategoryToCartActionGroup">
30+
<arguments>
31+
<argument name="productName" type="string"/>
32+
</arguments>
33+
<moveMouseOver selector="{{StorefrontCategoryProductSection.ProductTitleByName(productName)}}" stepKey="moveMouseOverProduct"/>
34+
<click selector="{{StorefrontCategoryProductSection.ProductTitleByName(productName)}}" stepKey="openProductPage"/>
35+
<waitForPageLoad time="30" stepKey="waitForBundleProductPageLoad"/>
36+
<click selector="{{StorefrontBundledSection.addToCart}}" stepKey="clickCustomizeAndAddToCart"/>
37+
<click selector="{{StorefrontBundledSection.addToCartConfigured}}" stepKey="clickAddBundleProductToCart"/>
38+
<waitForElementVisible selector="{{StorefrontMinicartSection.productCount}}" stepKey="waitProductCount"/>
39+
<see userInput="You added {{productName}} to your shopping cart." selector="{{StorefrontMessagesSection.success}}" stepKey="seeSuccessMessage"/>
40+
</actionGroup>
2741
</actionGroups>
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
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+
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
11+
<test name="StorefrontAddBundleProductWithZeroPriceToShoppingCartTest">
12+
<annotations>
13+
<features value="Bundle"/>
14+
<stories value="Add Bundle product with zero price to shopping cart"/>
15+
<title value="Add Bundle product with zero price to shopping cart"/>
16+
<description value="Add Bundle product with zero price to shopping cart"/>
17+
<severity value="CRITICAL"/>
18+
<testCaseId value="MAGETWO-95167"/>
19+
<group value="bundle"/>
20+
</annotations>
21+
<before>
22+
<!--Enable freeShipping-->
23+
<createData entity="FreeShippinMethodConfig" stepKey="enableFreeShipping"/>
24+
<!--Create category-->
25+
<createData entity="SimpleSubCategory" stepKey="createSubCategory"/>
26+
<!--Create simple with zero price product-->
27+
<createData entity="ApiProductWithDescription" stepKey="apiSimple">
28+
<field key="price">0</field>
29+
</createData>
30+
<!--Create Bundle product-->
31+
<createData entity="ApiBundleProductPriceViewRange" stepKey="apiBundleProduct">
32+
<requiredEntity createDataKey="createSubCategory"/>
33+
</createData>
34+
<!--Create Attribute-->
35+
<createData entity="DropDownBundleOption" stepKey="bundleOption">
36+
<requiredEntity createDataKey="apiBundleProduct"/>
37+
</createData>
38+
<createData entity="ApiBundleLink" stepKey="createBundleLink">
39+
<requiredEntity createDataKey="apiBundleProduct"/>
40+
<requiredEntity createDataKey="bundleOption"/>
41+
<requiredEntity createDataKey="apiSimple"/>
42+
</createData>
43+
<magentoCLI command="indexer:reindex" stepKey="reindex"/>
44+
</before>
45+
<after>
46+
<createData entity="FreeShippinMethodDefault" stepKey="disableFreeShipping"/>
47+
<deleteData createDataKey="apiSimple" stepKey="deleteSimple"/>
48+
<deleteData createDataKey="apiBundleProduct" stepKey="deleteBundleProduct"/>
49+
<deleteData createDataKey="createSubCategory" stepKey="deleteCategory"/>
50+
<actionGroup ref="AdminOrdersGridClearFiltersActionGroup" stepKey="clearFilters"/>
51+
<actionGroup ref="logout" stepKey="logout"/>
52+
</after>
53+
<!--Open category page-->
54+
<amOnPage url="{{StorefrontCategoryPage.url($$createSubCategory.custom_attributes[url_key]$$)}}" stepKey="amOnCategoryPage"/>
55+
<!--Add bundle product to cart-->
56+
<actionGroup ref="StorefrontAddBundleProductFromCategoryToCartActionGroup" stepKey="addBundleProductToCart">
57+
<argument name="productName" value="$$apiBundleProduct.name$$"/>
58+
</actionGroup>
59+
<actionGroup ref="GoToCheckoutFromMinicartActionGroup" stepKey="goToCheckoutFromMinicart"/>
60+
61+
<!--Place order-->
62+
<actionGroup ref="GuestCheckoutFillingShippingSectionActionGroup" stepKey="guestCheckoutFillingShipping">
63+
<argument name="shippingMethod" value="Free Shipping"/>
64+
</actionGroup>
65+
<actionGroup ref="ClickPlaceOrderActionGroup" stepKey="checkoutPlaceOrder"/>
66+
<grabTextFrom selector="{{CheckoutSuccessMainSection.orderNumber}}" stepKey="grabOrderNumber"/>
67+
68+
<!--Check subtotal in created order-->
69+
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/>
70+
<actionGroup ref="filterOrderGridById" stepKey="filterOrderById">
71+
<argument name="orderId" value="$grabOrderNumber"/>
72+
</actionGroup>
73+
<click selector="{{AdminOrdersGridSection.firstRow}}" stepKey="clickOrderRow"/>
74+
<waitForPageLoad stepKey="waitForAdminOrderPageLoad"/>
75+
<scrollTo selector="{{AdminOrderTotalSection.subTotal}}" stepKey="scrollToOrderTotalSection"/>
76+
<see selector="{{AdminOrderTotalSection.subTotal}}" userInput="$0.00" stepKey="checkSubtotal"/>
77+
</test>
78+
</tests>

app/code/Magento/Catalog/Model/Product/Attribute/Backend/TierPrice/SaveHandler.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -135,12 +135,12 @@ private function getAdditionalFields(array $objectArray): array
135135
* Check whether price has percentage value.
136136
*
137137
* @param array $priceRow
138-
* @return int|null
138+
* @return float|null
139139
*/
140-
private function getPercentage(array $priceRow): ?int
140+
private function getPercentage(array $priceRow): ?float
141141
{
142142
return isset($priceRow['percentage_value']) && is_numeric($priceRow['percentage_value'])
143-
? (int)$priceRow['percentage_value']
143+
? (float)$priceRow['percentage_value']
144144
: null;
145145
}
146146

app/code/Magento/Catalog/Model/Product/Attribute/Backend/TierPrice/UpdateHandler.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -138,12 +138,12 @@ private function getAdditionalFields(array $objectArray): array
138138
* Check whether price has percentage value.
139139
*
140140
* @param array $priceRow
141-
* @return int|null
141+
* @return float|null
142142
*/
143-
private function getPercentage(array $priceRow): ?int
143+
private function getPercentage(array $priceRow): ?float
144144
{
145145
return isset($priceRow['percentage_value']) && is_numeric($priceRow['percentage_value'])
146-
? (int)$priceRow['percentage_value']
146+
? (float)$priceRow['percentage_value']
147147
: null;
148148
}
149149

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

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,6 @@
121121
<argument name="simpleProduct"/>
122122
</arguments>
123123
<amOnPage url="{{AdminProductIndexPage.url}}" stepKey="navigateToProductIndex"/>
124-
<waitForPageLoad stepKey="waitForPageLoad"/>
125124
<click selector="{{AdminProductGridActionSection.addProductToggle}}" stepKey="clickAddProductDropdown"/>
126125
<click selector="{{AdminProductGridActionSection.addSimpleProduct}}" stepKey="clickAddSimpleProduct"/>
127126
<fillField userInput="{{simpleProduct.name}}" selector="{{AdminProductFormSection.productName}}" stepKey="fillName"/>
@@ -313,4 +312,19 @@
313312
<click selector="{{AdminProductFormAdvancedPricingSection.save}}" stepKey="clickSaveProduct"/>
314313
<waitForPageLoad stepKey="waitForSave"/>
315314
</actionGroup>
315+
316+
<!--Check tier price with a discount percentage on product-->
317+
<actionGroup name="AssertDiscountsPercentageOfProducts">
318+
<arguments>
319+
<argument name="amount" type="string" defaultValue="45"/>
320+
</arguments>
321+
<click selector="{{AdminProductFormSection.advancedPricingLink}}" stepKey="clickOnAdvancedPricingButton"/>
322+
<waitForElement selector="{{AdminProductFormAdvancedPricingSection.customerGroupPriceAddButton}}" stepKey="waitForCustomerGroupPriceAddButton"/>
323+
<grabValueFrom selector="{{AdminProductFormAdvancedPricingSection.productTierPricePercentageValuePriceInput('0')}}" stepKey="grabProductTierPriceInput"/>
324+
<assertEquals stepKey="assertProductTierPriceInput">
325+
<expectedResult type="string">{{amount}}</expectedResult>
326+
<actualResult type="string">$grabProductTierPriceInput</actualResult>
327+
</assertEquals>
328+
</actionGroup>
329+
316330
</actionGroups>

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

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,6 @@
179179
</arguments>
180180
<!--TODO use other action group for filtering grid when MQE-539 is implemented -->
181181
<amOnPage url="{{AdminProductIndexPage.url}}" stepKey="visitAdminProductPage"/>
182-
<waitForPageLoad time="60" stepKey="waitForPageLoadInitial"/>
183182
<conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFiltersInitial"/>
184183
<click selector="{{AdminProductGridFilterSection.filters}}" stepKey="openProductFilters"/>
185184
<fillField selector="{{AdminProductGridFilterSection.skuFilter}}" userInput="{{sku}}" stepKey="fillProductSkuFilter"/>
@@ -193,6 +192,17 @@
193192
<click selector="{{AdminProductGridConfirmActionSection.ok}}" stepKey="confirmProductDelete"/>
194193
</actionGroup>
195194

195+
<actionGroup name="deleteProductByName" extends="deleteProductBySku">
196+
<arguments>
197+
<argument name="sku" type="string" defaultValue=""/>
198+
<argument name="name" type="string"/>
199+
</arguments>
200+
<remove keyForRemoval="fillProductSkuFilter"/>
201+
<fillField selector="{{AdminProductGridFilterSection.nameFilter}}" userInput="{{name}}" stepKey="fillProductSkuFilter" after="openProductFilters"/>
202+
<remove keyForRemoval="seeProductSkuInGrid"/>
203+
<see selector="{{AdminProductGridSection.productGridCell('1', 'Name')}}" userInput="{{name}}" stepKey="seeProductNameInGrid" after="clickApplyFilters"/>
204+
</actionGroup>
205+
196206
<!--Open product for edit by clicking row X and column Y in product grid-->
197207
<actionGroup name="openProducForEditByClickingRowXColumnYInProductGrid">
198208
<arguments>

0 commit comments

Comments
 (0)