From 8c5e0d81e4f77665af4439c69a64de870fc03b3d Mon Sep 17 00:00:00 2001 From: DianaRusin Date: Wed, 13 Feb 2019 13:26:00 +0200 Subject: [PATCH 01/14] MAGETWO-96375: Checkout Free Shipping Recalculation after Coupon Code Added --- .../Mftf/ActionGroup/CheckoutActionGroup.xml | 15 ++- .../Model/Carrier/Freeshipping.php | 5 +- ...gRecalculationAfterCouponCodeAddedTest.xml | 104 ++++++++++++++++++ .../ApplyCartRuleOnStorefrontActionGroup.xml | 29 +++-- .../Section/StorefrontDiscountSection.xml | 7 +- .../Mftf/Data/StoreShippingMethodsData.xml | 37 +++++++ .../Metadata/store_shipping_methods-meta.xml | 51 +++++++++ .../Section/StorefrontMessagesSection.xml | 1 + 8 files changed, 234 insertions(+), 15 deletions(-) create mode 100644 app/code/Magento/Sales/Test/Mftf/Test/StorefrontFreeShippingRecalculationAfterCouponCodeAddedTest.xml create mode 100644 app/code/Magento/Store/Test/Mftf/Data/StoreShippingMethodsData.xml create mode 100644 app/code/Magento/Store/Test/Mftf/Metadata/store_shipping_methods-meta.xml diff --git a/app/code/Magento/Checkout/Test/Mftf/ActionGroup/CheckoutActionGroup.xml b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/CheckoutActionGroup.xml index f79d59028c468..bb0b0a5edf2d3 100644 --- a/app/code/Magento/Checkout/Test/Mftf/ActionGroup/CheckoutActionGroup.xml +++ b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/CheckoutActionGroup.xml @@ -7,7 +7,7 @@ --> + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> @@ -106,4 +106,17 @@ + + + + + + + + + + + + + diff --git a/app/code/Magento/OfflineShipping/Model/Carrier/Freeshipping.php b/app/code/Magento/OfflineShipping/Model/Carrier/Freeshipping.php index 2373b5285ed00..0fc56c7136327 100644 --- a/app/code/Magento/OfflineShipping/Model/Carrier/Freeshipping.php +++ b/app/code/Magento/OfflineShipping/Model/Carrier/Freeshipping.php @@ -80,9 +80,8 @@ public function collectRates(RateRequest $request) $this->_updateFreeMethodQuote($request); - if ($request->getFreeShipping() || $request->getBaseSubtotalInclTax() >= $this->getConfigData( - 'free_shipping_subtotal' - ) + if ($request->getFreeShipping() + || ($request->getPackageValueWithDiscount() >= $this->getConfigData('free_shipping_subtotal')) ) { /** @var \Magento\Quote\Model\Quote\Address\RateResult\Method $method */ $method = $this->_rateMethodFactory->create(); diff --git a/app/code/Magento/Sales/Test/Mftf/Test/StorefrontFreeShippingRecalculationAfterCouponCodeAddedTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/StorefrontFreeShippingRecalculationAfterCouponCodeAddedTest.xml new file mode 100644 index 0000000000000..0407502b1a2d7 --- /dev/null +++ b/app/code/Magento/Sales/Test/Mftf/Test/StorefrontFreeShippingRecalculationAfterCouponCodeAddedTest.xml @@ -0,0 +1,104 @@ + + + + + + + + <stories value="Checkout Free Shipping Recalculation after Coupon Code Applied"/> + <description value="User should be able to do checkout free shipping recalculation after adding coupon code"/> + <severity value="MAJOR"/> + <testCaseId value="MAGETWO-96537"/> + <useCaseId value="MC-14807"/> + <group value="sales"/> + <group value="salesRule"/> + </annotations> + + <before> + <createData entity="_defaultCategory" stepKey="createCategory"/> + <createData entity="_defaultProduct" stepKey="createSimpleProduct"> + <field key="price">90</field> + <requiredEntity createDataKey="createCategory"/> + </createData> + <createData entity="Simple_US_Customer" stepKey="createSimpleUsCustomer"/> + + <!-- Enable Free Shipping and set minimum order amount --> + <createData entity="FreeShippingMethodsSettingConfig" stepKey="freeShippingMethodSettingConfig"/> + <createData entity="MinimumOrderAmount90" stepKey="setMinimumOrderAmount"/> + + <!-- Create Cart Price Rule --> + <createData entity="SalesRuleSpecificCouponWithPercentDiscount" stepKey="createCartPriceRule"> + <field key="simple_free_shipping">0</field> + </createData> + <createData entity="SimpleSalesRuleCoupon" stepKey="createCouponForCartPriceRule"> + <requiredEntity createDataKey="createCartPriceRule"/> + </createData> + + <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="CustomerLoginOnStorefront" stepKey="loginToStorefront"> + <argument name="customer" value="$$createSimpleUsCustomer$$"/> + </actionGroup> + </before> + <after> + <deleteData createDataKey="createSimpleProduct" stepKey="deleteProduct"/> + <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> + <deleteData createDataKey="createSimpleUsCustomer" stepKey="deleteCustomer"/> + <deleteData createDataKey="createCartPriceRule" stepKey="deleteCartPriceRule"/> + <createData entity="DefaultShippingMethodsConfig" stepKey="setDefaultShippingMethodsConfig"/> + <createData entity="DefaultMinimumOrderAmount" stepKey="setDefaultMinimumOrderAmount"/> + <actionGroup ref="logout" stepKey="logout"/> + <actionGroup ref="CustomerLogoutStorefrontActionGroup" stepKey="logoutFromStorefront"/> + </after> + + <!-- Add product to Shopping Cart and apply coupon --> + <amOnPage url="{{StorefrontProductPage.url($$createSimpleProduct.name$$)}}" stepKey="navigateToProductPage"/> + <actionGroup ref="ApplyCartRuleOnStorefrontActionGroup" stepKey="applyCartRule"> + <argument name="product" value="$$createSimpleProduct$$"/> + <argument name="couponCode" value="$$createCouponForCartPriceRule.code$$"/> + </actionGroup> + + <!-- Proceed to Checkout and make sure Free Shipping method isn't displaying --> + <actionGroup ref="GoToCheckoutFromMinicartActionGroup" stepKey="goToCheckoutFromMinicart"/> + <dontSee selector="{{CheckoutShippingMethodsSection.shippingMethodRowByName('Free')}}" stepKey="dontSeeFreeShipping"/> + + <!-- Back to Shopping Cart page and cancel coupon--> + <amOnPage url="{{CheckoutCartPage.url}}" stepKey="goToShoppingCartPage"/> + <actionGroup ref="StorefrontCancelCouponActionGroup" stepKey="cancelCoupon"/> + <waitForPageLoad stepKey="waitForPageLoad"/> + + <!-- Proceed to Checkout, select Free Shipping method and apply coupon --> + <actionGroup ref="GoToCheckoutFromMinicartActionGroup" stepKey="goToCheckoutFromMinicart1"/> + <actionGroup ref="CheckoutSelectShippingMethodActionGroup" stepKey="selectFreeShipping"> + <argument name="shippingMethod" value="Free"/> + </actionGroup> + <actionGroup ref="StorefrontApplyCouponOnCheckoutActionGroup" stepKey="applyCouponOnCheckout"> + <argument name="couponCode" value="$$createCouponForCartPriceRule.code$$"/> + <argument name="successMessage" value="Your coupon was successfully applied."/> + </actionGroup> + + <!-- Try to Place Order --> + <waitForElementVisible selector="{{CheckoutPaymentSection.placeOrder}}" stepKey="waitForPlaceOrderButton"/> + <click selector="{{CheckoutPaymentSection.placeOrder}}" stepKey="clickPlaceOrder"/> + <waitForElementVisible selector="{{StorefrontMessagesSection.errorMessage}}" stepKey="waitForError"/> + <see selector="{{StorefrontMessagesSection.errorMessage}}" userInput="The shipping method is missing. Select the shipping method and try again." stepKey="seeShippingMethodError"/> + + <!-- Go back to Shipping step and select Shipping method --> + <amOnPage url="{{CheckoutPage.url}}/#shipping" stepKey="navigateToShippingStep"/> + <actionGroup ref="CheckoutSelectShippingMethodActionGroup" stepKey="selectFlatRateShipping"> + <argument name="shippingMethod" value="Flat Rate"/> + </actionGroup> + + <!-- Select Payment method and Place order--> + <actionGroup ref="CheckoutSelectCheckMoneyOrderPaymentActionGroup" stepKey="selectPaymentMethod"/> + <actionGroup ref="CheckoutPlaceOrderActionGroup" stepKey="placeOrder"> + <argument name="orderNumberMessage" value="CONST.successCheckoutOrderNumberMessage"/> + <argument name="emailYouMessage" value="CONST.successCheckoutEmailYouMessage"/> + </actionGroup> + </test> +</tests> diff --git a/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/ApplyCartRuleOnStorefrontActionGroup.xml b/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/ApplyCartRuleOnStorefrontActionGroup.xml index 0ea7ec06ca869..a63fcec9f92bb 100644 --- a/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/ApplyCartRuleOnStorefrontActionGroup.xml +++ b/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/ApplyCartRuleOnStorefrontActionGroup.xml @@ -28,11 +28,12 @@ <arguments> <argument name="couponCode" type="string"/> </arguments> - <waitForElement selector="{{AdminCartPriceRuleDiscountSection.discountTab}}" time="30" stepKey="waitForCouponHeader" /> - <conditionalClick selector="{{AdminCartPriceRuleDiscountSection.discountTab}}" dependentSelector="{{AdminCartPriceRuleDiscountSection.discountBlockActive}}" visible="false" stepKey="clickCouponHeader" /> - <waitForElementVisible selector="{{AdminCartPriceRuleDiscountSection.couponInput}}" stepKey="waitForCouponField" /> - <fillField userInput="{{couponCode}}" selector="{{AdminCartPriceRuleDiscountSection.couponInput}}" stepKey="fillCouponField"/> - <click selector="{{AdminCartPriceRuleDiscountSection.applyCodeBtn}}" stepKey="clickApplyButton"/> + <waitForElement selector="{{StorefrontDiscountSection.discountTab}}" time="30" stepKey="waitForCouponHeader" /> + <conditionalClick selector="{{StorefrontDiscountSection.discountTab}}" dependentSelector="{{StorefrontDiscountSection.discountBlockActive}}" visible="false" stepKey="clickCouponHeader" /> + <waitForElementVisible selector="{{StorefrontDiscountSection.couponInput}}" stepKey="waitForCouponField" /> + <fillField userInput="{{couponCode}}" selector="{{StorefrontDiscountSection.couponInput}}" stepKey="fillCouponField"/> + <click selector="{{StorefrontDiscountSection.applyCodeBtn}}" stepKey="clickApplyButton"/> + <waitForElementVisible selector="{{StorefrontMessagesSection.successMessage}}" stepKey="waitForSuccessMessage" /> <see userInput='You used coupon code "{{couponCode}}".' selector="{{StorefrontMessagesSection.successMessage}}" stepKey="seeSuccessMessage"/> </actionGroup> @@ -46,10 +47,20 @@ <!-- Cancel Sales Rule Coupon applied to the cart --> <actionGroup name="StorefrontCancelCouponActionGroup"> - <waitForElement selector="{{AdminCartPriceRuleDiscountSection.discountTab}}" time="30" stepKey="waitForCouponHeader" /> - <conditionalClick selector="{{AdminCartPriceRuleDiscountSection.discountTab}}" dependentSelector="{{AdminCartPriceRuleDiscountSection.discountBlockActive}}" visible="false" stepKey="clickCouponHeader" /> - <waitForElementVisible selector="{{AdminCartPriceRuleDiscountSection.couponInput}}" stepKey="waitForCouponField" /> - <click selector="{{AdminCartPriceRuleDiscountSection.cancelButton}}" stepKey="clickCancelButton"/> + <waitForElement selector="{{StorefrontDiscountSection.discountTab}}" time="30" stepKey="waitForCouponHeader" /> + <conditionalClick selector="{{StorefrontDiscountSection.discountTab}}" dependentSelector="{{AdminCartPriceRuleDiscountSection.discountBlockActive}}" visible="false" stepKey="clickCouponHeader" /> + <waitForElementVisible selector="{{StorefrontDiscountSection.couponInput}}" stepKey="waitForCouponField" /> + <click selector="{{StorefrontDiscountSection.cancelCoupon}}" stepKey="clickCancelButton"/> + <waitForElementVisible selector="{{StorefrontMessagesSection.successMessage}}" stepKey="waitForSuccessMessage"/> <see userInput="You canceled the coupon code." selector="{{StorefrontMessagesSection.successMessage}}" stepKey="seeSuccessMessage"/> </actionGroup> + + <actionGroup name="StorefrontApplyCouponOnCheckoutActionGroup" extends="StorefrontApplyCouponActionGroup"> + <arguments> + <argument name="successMessage" type="string"/> + </arguments> + <waitForElementVisible selector="{{StorefrontDiscountSection.discountInput}}" stepKey="waitForCouponField"/> + <fillField userInput="{{couponCode}}" selector="{{StorefrontDiscountSection.discountInput}}" stepKey="fillCouponField"/> + <see userInput='{{successMessage}}' selector="{{StorefrontMessagesSection.successMessage}}" stepKey="seeSuccessMessage"/> + </actionGroup> </actionGroups> diff --git a/app/code/Magento/SalesRule/Test/Mftf/Section/StorefrontDiscountSection.xml b/app/code/Magento/SalesRule/Test/Mftf/Section/StorefrontDiscountSection.xml index 2ae50489b6d12..359e2eecb6b7e 100644 --- a/app/code/Magento/SalesRule/Test/Mftf/Section/StorefrontDiscountSection.xml +++ b/app/code/Magento/SalesRule/Test/Mftf/Section/StorefrontDiscountSection.xml @@ -6,10 +6,13 @@ */ --> <sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="../../../../../../../dev/tests/acceptance/vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Page/etc/SectionObject.xsd"> + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd"> <section name="StorefrontDiscountSection"> - <element name="discountTab" type="button" selector="#block-discount"/> + <element name="discountTab" type="button" selector="#block-discount-heading"/> <element name="couponInput" type="input" selector="#coupon_code"/> <element name="applyCodeBtn" type="button" selector="//span[text()='Apply Discount']"/> + <element name="cancelCoupon" type="button" selector="//button[@value='Cancel Coupon']"/> + <element name="discountInput" type="input" selector="#discount-code"/> + <element name="discountBlockActive" type="text" selector=".block.discount.active"/> </section> </sections> diff --git a/app/code/Magento/Store/Test/Mftf/Data/StoreShippingMethodsData.xml b/app/code/Magento/Store/Test/Mftf/Data/StoreShippingMethodsData.xml new file mode 100644 index 0000000000000..6b29baeb9eea3 --- /dev/null +++ b/app/code/Magento/Store/Test/Mftf/Data/StoreShippingMethodsData.xml @@ -0,0 +1,37 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> +<entities xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:DataGenerator/etc/dataProfileSchema.xsd"> + <entity name="FreeShippingMethodsSettingConfig" type="free_shipping_config_state"> + <requiredEntity type="active">Active</requiredEntity> + </entity> + <entity name="Active" type="active"> + <data key="value">1</data> + </entity> + + <entity name="MinimumOrderAmount90" type="minimum_order_amount"> + <requiredEntity type="free_shipping_subtotal">Price</requiredEntity> + </entity> + <entity name="Price" type="free_shipping_subtotal"> + <data key="value">90</data> + </entity> + + <entity name="DefaultMinimumOrderAmount" type="minimum_order_amount"> + <requiredEntity type="free_shipping_subtotal">DefaultPrice</requiredEntity> + </entity> + <entity name="DefaultPrice" type="free_shipping_subtotal"> + <data key="value">0</data> + </entity> + + <entity name="DefaultShippingMethodsConfig" type="free_shipping_config_state"> + <requiredEntity type="active">DefaultFreeShipping</requiredEntity> + </entity> + <entity name="DefaultFreeShipping" type="active"> + <data key="value">0</data> + </entity> +</entities> diff --git a/app/code/Magento/Store/Test/Mftf/Metadata/store_shipping_methods-meta.xml b/app/code/Magento/Store/Test/Mftf/Metadata/store_shipping_methods-meta.xml new file mode 100644 index 0000000000000..46132973e52c8 --- /dev/null +++ b/app/code/Magento/Store/Test/Mftf/Metadata/store_shipping_methods-meta.xml @@ -0,0 +1,51 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<operations xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:DataGenerator/etc/dataOperation.xsd"> + <operation name="EnableFreeShippingConfigState" dataType="free_shipping_config_state" type="create" auth="adminFormKey" + url="/admin/system_config/save/section/carriers/" method="POST"> + <object key="groups" dataType="free_shipping_config_state"> + <object key="freeshipping" dataType="free_shipping_config_state"> + <object key="fields" dataType="free_shipping_config_state"> + <object key="active" dataType="active"> + <field key="value">string</field> + </object> + </object> + </object> + </object> + </operation> + + <operation name="DisableFreeShippingConfigState" dataType="disable_free_shipping_config_state" type="create" auth="adminFormKey" + url="/admin/system_config/save/section/carriers/" method="POST"> + <object key="groups" dataType="disable_free_shipping_config_state"> + <object key="freeshipping" dataType="disable_free_shipping_config_state"> + <object key="fields" dataType="disable_free_shipping_config_state"> + <object key="active" dataType="disable_free_shipping_config_state"> + <object key="inherit" dataType="disableFreeShipping"> + <field key="value">integer</field> + </object> + </object> + </object> + </object> + </object> + </operation> + + <operation name="MinimumOrderAmount" dataType="minimum_order_amount" type="create" auth="adminFormKey" + url="/admin/system_config/save/section/carriers/" method="POST"> + <object key="groups" dataType="minimum_order_amount"> + <object key="freeshipping" dataType="minimum_order_amount"> + <object key="fields" dataType="minimum_order_amount"> + <object key="free_shipping_subtotal" dataType="free_shipping_subtotal"> + <field key="value">string</field> + </object> + </object> + </object> + </object> + </operation> +</operations> diff --git a/app/code/Magento/Ui/Test/Mftf/Section/StorefrontMessagesSection.xml b/app/code/Magento/Ui/Test/Mftf/Section/StorefrontMessagesSection.xml index b07f2d356b9ea..2834c367f136c 100644 --- a/app/code/Magento/Ui/Test/Mftf/Section/StorefrontMessagesSection.xml +++ b/app/code/Magento/Ui/Test/Mftf/Section/StorefrontMessagesSection.xml @@ -10,5 +10,6 @@ xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd"> <section name="StorefrontMessagesSection"> <element name="successMessage" type="text" selector=".message-success"/> + <element name="errorMessage" type="text" selector=".message-error"/> </section> </sections> From b8055004f7619d7a799769ed17f52fae8f75bb50 Mon Sep 17 00:00:00 2001 From: DianaRusin <rusind95@gmail.com> Date: Fri, 15 Mar 2019 13:46:16 +0200 Subject: [PATCH 02/14] MAGETWO-96375: Checkout Free Shipping Recalculation after Coupon Code Added --- ...frontFreeShippingRecalculationAfterCouponCodeAddedTest.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/code/Magento/Sales/Test/Mftf/Test/StorefrontFreeShippingRecalculationAfterCouponCodeAddedTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/StorefrontFreeShippingRecalculationAfterCouponCodeAddedTest.xml index 0407502b1a2d7..5ea04bbcbc13c 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/StorefrontFreeShippingRecalculationAfterCouponCodeAddedTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/StorefrontFreeShippingRecalculationAfterCouponCodeAddedTest.xml @@ -14,8 +14,8 @@ <stories value="Checkout Free Shipping Recalculation after Coupon Code Applied"/> <description value="User should be able to do checkout free shipping recalculation after adding coupon code"/> <severity value="MAJOR"/> - <testCaseId value="MAGETWO-96537"/> - <useCaseId value="MC-14807"/> + <testCaseId value="MC-15412"/> + <useCaseId value="MAGETWO-96375"/> <group value="sales"/> <group value="salesRule"/> </annotations> From cdd8ef4a42f2e2205deaa58067fdc18c0d1b3c69 Mon Sep 17 00:00:00 2001 From: DianaRusin <rusind95@gmail.com> Date: Mon, 18 Mar 2019 16:25:14 +0200 Subject: [PATCH 03/14] MAGETWO-96375: Checkout Free Shipping Recalculation after Coupon Code Added --- .../Mftf/ActionGroup/CheckoutActionGroup.xml | 4 +-- .../Mftf/Section/CheckoutPaymentSection.xml | 1 + ...gRecalculationAfterCouponCodeAddedTest.xml | 12 ++++---- .../ApplyCartRuleOnStorefrontActionGroup.xml | 5 ++-- .../Section/StorefrontDiscountSection.xml | 4 +-- .../Mftf/Data/StoreShippingMethodsData.xml | 11 +++++--- .../Metadata/store_shipping_methods-meta.xml | 28 ++----------------- 7 files changed, 24 insertions(+), 41 deletions(-) diff --git a/app/code/Magento/Checkout/Test/Mftf/ActionGroup/CheckoutActionGroup.xml b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/CheckoutActionGroup.xml index 354ea15c226bf..1cbaa66e2fd8b 100644 --- a/app/code/Magento/Checkout/Test/Mftf/ActionGroup/CheckoutActionGroup.xml +++ b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/CheckoutActionGroup.xml @@ -115,8 +115,8 @@ <conditionalClick selector="{{CheckoutShippingMethodsSection.checkShippingMethodByName(shippingMethod)}}" dependentSelector="{{CheckoutShippingMethodsSection.checkShippingMethodByName(shippingMethod)}}" visible="true" stepKey="selectShippingMethod"/> <waitForLoadingMaskToDisappear stepKey="waitForNextButton"/> <click selector="{{CheckoutShippingMethodsSection.next}}" stepKey="clickNext"/> - <waitForLoadingMaskToDisappear stepKey="waitForPaymentMethod"/> - <waitForElement selector="{{CheckoutPaymentSection.paymentSectionTitle}}" stepKey="waitForPaymentSectionLoaded"/> + <waitForPageLoad stepKey="waitForPaymentMethod"/> + <waitForElementVisible selector="{{CheckoutPaymentSection.paymentSectionTitle}}" stepKey="waitForPaymentSectionLoaded"/> <seeInCurrentUrl url="{{CheckoutPage.url}}/#payment" stepKey="assertCheckoutPaymentUrl"/> </actionGroup> </actionGroups> diff --git a/app/code/Magento/Checkout/Test/Mftf/Section/CheckoutPaymentSection.xml b/app/code/Magento/Checkout/Test/Mftf/Section/CheckoutPaymentSection.xml index ae8f9aa5f2aa7..e22a70df50f67 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Section/CheckoutPaymentSection.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Section/CheckoutPaymentSection.xml @@ -25,6 +25,7 @@ <element name="cartItems" type="text" selector=".minicart-items"/> <element name="billingAddress" type="text" selector="div.billing-address-details"/> <element name="placeOrder" type="button" selector=".payment-method._active button.action.primary.checkout" timeout="30"/> + <element name="placeOrderNoWait" type="button" selector=".payment-method._active button.action.primary.checkout"/> <element name="productOptionsByProductItemPrice" type="text" selector="//div[@class='product-item-inner']//div[@class='subtotal']//span[@class='price'][contains(.,'{{price}}')]//ancestor::div[@class='product-item-details']//div[@class='product options']" parameterized="true"/> <element name="productOptionsActiveByProductItemPrice" type="text" selector="//div[@class='subtotal']//span[@class='price'][contains(.,'{{price}}')]//ancestor::div[@class='product-item-details']//div[@class='product options active']" parameterized="true"/> <element name="productItemPriceByName" type="text" selector="//div[@class='product-item-details'][contains(., '{{ProductName}}')]//span[@class='price']" parameterized="true"/> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/StorefrontFreeShippingRecalculationAfterCouponCodeAddedTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/StorefrontFreeShippingRecalculationAfterCouponCodeAddedTest.xml index 5ea04bbcbc13c..0dac0266904ff 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/StorefrontFreeShippingRecalculationAfterCouponCodeAddedTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/StorefrontFreeShippingRecalculationAfterCouponCodeAddedTest.xml @@ -65,7 +65,7 @@ <!-- Proceed to Checkout and make sure Free Shipping method isn't displaying --> <actionGroup ref="GoToCheckoutFromMinicartActionGroup" stepKey="goToCheckoutFromMinicart"/> - <dontSee selector="{{CheckoutShippingMethodsSection.shippingMethodRowByName('Free')}}" stepKey="dontSeeFreeShipping"/> + <dontSeeElement selector="{{CheckoutShippingMethodsSection.shippingMethodRowByName('Free')}}" stepKey="dontSeeFreeShipping"/> <!-- Back to Shopping Cart page and cancel coupon--> <amOnPage url="{{CheckoutCartPage.url}}" stepKey="goToShoppingCartPage"/> @@ -81,12 +81,12 @@ <argument name="couponCode" value="$$createCouponForCartPriceRule.code$$"/> <argument name="successMessage" value="Your coupon was successfully applied."/> </actionGroup> + <actionGroup ref="CheckoutSelectCheckMoneyOrderPaymentActionGroup" stepKey="selectPaymentMethod"/> <!-- Try to Place Order --> - <waitForElementVisible selector="{{CheckoutPaymentSection.placeOrder}}" stepKey="waitForPlaceOrderButton"/> - <click selector="{{CheckoutPaymentSection.placeOrder}}" stepKey="clickPlaceOrder"/> - <waitForElementVisible selector="{{StorefrontMessagesSection.errorMessage}}" stepKey="waitForError"/> - <see selector="{{StorefrontMessagesSection.errorMessage}}" userInput="The shipping method is missing. Select the shipping method and try again." stepKey="seeShippingMethodError"/> + <waitForElementVisible selector="{{CheckoutPaymentSection.placeOrderNoWait}}" stepKey="waitForPlaceOrderButton"/> + <click selector="{{CheckoutPaymentSection.placeOrderNoWait}}" stepKey="clickPlaceOrder"/> + <waitForText selector="{{StorefrontMessagesSection.errorMessage}}" userInput="The shipping method is missing. Select the shipping method and try again." time="30" stepKey="seeShippingMethodError"/> <!-- Go back to Shipping step and select Shipping method --> <amOnPage url="{{CheckoutPage.url}}/#shipping" stepKey="navigateToShippingStep"/> @@ -95,7 +95,7 @@ </actionGroup> <!-- Select Payment method and Place order--> - <actionGroup ref="CheckoutSelectCheckMoneyOrderPaymentActionGroup" stepKey="selectPaymentMethod"/> + <actionGroup ref="CheckoutSelectCheckMoneyOrderPaymentActionGroup" stepKey="selectPaymentMethod1"/> <actionGroup ref="CheckoutPlaceOrderActionGroup" stepKey="placeOrder"> <argument name="orderNumberMessage" value="CONST.successCheckoutOrderNumberMessage"/> <argument name="emailYouMessage" value="CONST.successCheckoutEmailYouMessage"/> diff --git a/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/ApplyCartRuleOnStorefrontActionGroup.xml b/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/ApplyCartRuleOnStorefrontActionGroup.xml index a63fcec9f92bb..c8f2263d9734a 100644 --- a/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/ApplyCartRuleOnStorefrontActionGroup.xml +++ b/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/ApplyCartRuleOnStorefrontActionGroup.xml @@ -28,7 +28,7 @@ <arguments> <argument name="couponCode" type="string"/> </arguments> - <waitForElement selector="{{StorefrontDiscountSection.discountTab}}" time="30" stepKey="waitForCouponHeader" /> + <waitForElementVisible selector="{{StorefrontDiscountSection.discountTab}}" time="30" stepKey="waitForCouponHeader" /> <conditionalClick selector="{{StorefrontDiscountSection.discountTab}}" dependentSelector="{{StorefrontDiscountSection.discountBlockActive}}" visible="false" stepKey="clickCouponHeader" /> <waitForElementVisible selector="{{StorefrontDiscountSection.couponInput}}" stepKey="waitForCouponField" /> <fillField userInput="{{couponCode}}" selector="{{StorefrontDiscountSection.couponInput}}" stepKey="fillCouponField"/> @@ -47,7 +47,7 @@ <!-- Cancel Sales Rule Coupon applied to the cart --> <actionGroup name="StorefrontCancelCouponActionGroup"> - <waitForElement selector="{{StorefrontDiscountSection.discountTab}}" time="30" stepKey="waitForCouponHeader" /> + <waitForElementVisible selector="{{StorefrontDiscountSection.discountTab}}" time="30" stepKey="waitForCouponHeader" /> <conditionalClick selector="{{StorefrontDiscountSection.discountTab}}" dependentSelector="{{AdminCartPriceRuleDiscountSection.discountBlockActive}}" visible="false" stepKey="clickCouponHeader" /> <waitForElementVisible selector="{{StorefrontDiscountSection.couponInput}}" stepKey="waitForCouponField" /> <click selector="{{StorefrontDiscountSection.cancelCoupon}}" stepKey="clickCancelButton"/> @@ -61,6 +61,7 @@ </arguments> <waitForElementVisible selector="{{StorefrontDiscountSection.discountInput}}" stepKey="waitForCouponField"/> <fillField userInput="{{couponCode}}" selector="{{StorefrontDiscountSection.discountInput}}" stepKey="fillCouponField"/> + <waitForElementVisible selector="{{StorefrontMessagesSection.successMessage}}" stepKey="waitForSuccessMessage" /> <see userInput='{{successMessage}}' selector="{{StorefrontMessagesSection.successMessage}}" stepKey="seeSuccessMessage"/> </actionGroup> </actionGroups> diff --git a/app/code/Magento/SalesRule/Test/Mftf/Section/StorefrontDiscountSection.xml b/app/code/Magento/SalesRule/Test/Mftf/Section/StorefrontDiscountSection.xml index 359e2eecb6b7e..582e50cc766e0 100644 --- a/app/code/Magento/SalesRule/Test/Mftf/Section/StorefrontDiscountSection.xml +++ b/app/code/Magento/SalesRule/Test/Mftf/Section/StorefrontDiscountSection.xml @@ -10,8 +10,8 @@ <section name="StorefrontDiscountSection"> <element name="discountTab" type="button" selector="#block-discount-heading"/> <element name="couponInput" type="input" selector="#coupon_code"/> - <element name="applyCodeBtn" type="button" selector="//span[text()='Apply Discount']"/> - <element name="cancelCoupon" type="button" selector="//button[@value='Cancel Coupon']"/> + <element name="applyCodeBtn" type="button" selector="button[value='Apply Discount']"/> + <element name="cancelCoupon" type="button" selector="button[value='Cancel Coupon']"/> <element name="discountInput" type="input" selector="#discount-code"/> <element name="discountBlockActive" type="text" selector=".block.discount.active"/> </section> diff --git a/app/code/Magento/Store/Test/Mftf/Data/StoreShippingMethodsData.xml b/app/code/Magento/Store/Test/Mftf/Data/StoreShippingMethodsData.xml index 6b29baeb9eea3..c9d0fb628b853 100644 --- a/app/code/Magento/Store/Test/Mftf/Data/StoreShippingMethodsData.xml +++ b/app/code/Magento/Store/Test/Mftf/Data/StoreShippingMethodsData.xml @@ -14,14 +14,14 @@ <data key="value">1</data> </entity> - <entity name="MinimumOrderAmount90" type="minimum_order_amount"> + <entity name="MinimumOrderAmount90" type="free_shipping_config_state"> <requiredEntity type="free_shipping_subtotal">Price</requiredEntity> </entity> <entity name="Price" type="free_shipping_subtotal"> <data key="value">90</data> </entity> - <entity name="DefaultMinimumOrderAmount" type="minimum_order_amount"> + <entity name="DefaultMinimumOrderAmount" type="free_shipping_config_state"> <requiredEntity type="free_shipping_subtotal">DefaultPrice</requiredEntity> </entity> <entity name="DefaultPrice" type="free_shipping_subtotal"> @@ -29,9 +29,12 @@ </entity> <entity name="DefaultShippingMethodsConfig" type="free_shipping_config_state"> - <requiredEntity type="active">DefaultFreeShipping</requiredEntity> + <requiredEntity type="active">DefaultActive</requiredEntity> </entity> - <entity name="DefaultFreeShipping" type="active"> + <entity name="DefaultActive" type="active"> + <requiredEntity type="active_inherit">DefaultFreeShipping</requiredEntity> + </entity> + <entity name="DefaultFreeShipping" type="active_inherit"> <data key="value">0</data> </entity> </entities> diff --git a/app/code/Magento/Store/Test/Mftf/Metadata/store_shipping_methods-meta.xml b/app/code/Magento/Store/Test/Mftf/Metadata/store_shipping_methods-meta.xml index 46132973e52c8..32aa22fecf9cd 100644 --- a/app/code/Magento/Store/Test/Mftf/Metadata/store_shipping_methods-meta.xml +++ b/app/code/Magento/Store/Test/Mftf/Metadata/store_shipping_methods-meta.xml @@ -8,39 +8,17 @@ <operations xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:DataGenerator/etc/dataOperation.xsd"> - <operation name="EnableFreeShippingConfigState" dataType="free_shipping_config_state" type="create" auth="adminFormKey" - url="/admin/system_config/save/section/carriers/" method="POST"> + <operation name="ChangeFreeShippingConfiguration" dataType="free_shipping_config_state" type="create" auth="adminFormKey" + url="/admin/system_config/save/section/carriers/" method="POST" successRegex="/messages-message-success/"> <object key="groups" dataType="free_shipping_config_state"> <object key="freeshipping" dataType="free_shipping_config_state"> <object key="fields" dataType="free_shipping_config_state"> <object key="active" dataType="active"> <field key="value">string</field> - </object> - </object> - </object> - </object> - </operation> - - <operation name="DisableFreeShippingConfigState" dataType="disable_free_shipping_config_state" type="create" auth="adminFormKey" - url="/admin/system_config/save/section/carriers/" method="POST"> - <object key="groups" dataType="disable_free_shipping_config_state"> - <object key="freeshipping" dataType="disable_free_shipping_config_state"> - <object key="fields" dataType="disable_free_shipping_config_state"> - <object key="active" dataType="disable_free_shipping_config_state"> - <object key="inherit" dataType="disableFreeShipping"> + <object key="inherit" dataType="active_inherit"> <field key="value">integer</field> </object> </object> - </object> - </object> - </object> - </operation> - - <operation name="MinimumOrderAmount" dataType="minimum_order_amount" type="create" auth="adminFormKey" - url="/admin/system_config/save/section/carriers/" method="POST"> - <object key="groups" dataType="minimum_order_amount"> - <object key="freeshipping" dataType="minimum_order_amount"> - <object key="fields" dataType="minimum_order_amount"> <object key="free_shipping_subtotal" dataType="free_shipping_subtotal"> <field key="value">string</field> </object> From d5e40099b688e1265a1281df2f0c54d10128fbbf Mon Sep 17 00:00:00 2001 From: Viktor Petryk <victor.petryk@transoftgroup.com> Date: Tue, 19 Mar 2019 11:24:28 +0200 Subject: [PATCH 04/14] MC-15097: Incorrect Prolong responses --- .../src/Magento/Setup/Controller/Session.php | 50 +++++++++------ .../Test/Unit/Controller/SessionTest.php | 62 ++++++++++++++----- 2 files changed, 78 insertions(+), 34 deletions(-) diff --git a/setup/src/Magento/Setup/Controller/Session.php b/setup/src/Magento/Setup/Controller/Session.php index e310dd485ace5..adcbe1f5e0c49 100644 --- a/setup/src/Magento/Setup/Controller/Session.php +++ b/setup/src/Magento/Setup/Controller/Session.php @@ -5,6 +5,9 @@ */ namespace Magento\Setup\Controller; +/** + * Sets up session for setup/index.php/session/prolong or redirects to error page. + */ class Session extends \Zend\Mvc\Controller\AbstractActionController { /** @@ -30,7 +33,7 @@ public function __construct( } /** - * No index action, return 404 error page + * No index action, return 404 error page. * * @return \Zend\View\Model\ViewModel|\Zend\Http\Response */ @@ -39,11 +42,12 @@ public function indexAction() $view = new \Zend\View\Model\ViewModel(); $view->setTemplate('/error/404.phtml'); $this->getResponse()->setStatusCode(\Zend\Http\Response::STATUS_CODE_404); + return $view; } /** - * Prolong session + * Prolong session. * * @return string */ @@ -52,32 +56,41 @@ public function prolongAction() try { if ($this->serviceManager->get(\Magento\Framework\App\DeploymentConfig::class)->isAvailable()) { $objectManager = $this->objectManagerProvider->get(); - /** @var \Magento\Framework\App\State $adminAppState */ - $adminAppState = $objectManager->get(\Magento\Framework\App\State::class); - $adminAppState->setAreaCode(\Magento\Framework\App\Area::AREA_ADMINHTML); - $sessionConfig = $objectManager->get(\Magento\Backend\Model\Session\AdminConfig::class); - /** @var \Magento\Backend\Model\Url $backendUrl */ - $backendUrl = $objectManager->get(\Magento\Backend\Model\Url::class); - $urlPath = parse_url($backendUrl->getBaseUrl(), PHP_URL_PATH); - $cookiePath = $urlPath . 'setup'; - $sessionConfig->setCookiePath($cookiePath); /* @var \Magento\Backend\Model\Auth\Session $session */ - $session = $objectManager->create( - \Magento\Backend\Model\Auth\Session::class, - [ - 'sessionConfig' => $sessionConfig, - 'appState' => $adminAppState - ] - ); + $session = $objectManager->get(\Magento\Backend\Model\Auth\Session::class); + // check if session was already set in \Magento\Setup\Mvc\Bootstrap\InitParamListener::authPreDispatch + if (!$session->isSessionExists()) { + /** @var \Magento\Framework\App\State $adminAppState */ + $adminAppState = $objectManager->get(\Magento\Framework\App\State::class); + $adminAppState->setAreaCode(\Magento\Framework\App\Area::AREA_ADMINHTML); + $sessionConfig = $objectManager->get(\Magento\Backend\Model\Session\AdminConfig::class); + /** @var \Magento\Backend\Model\Url $backendUrl */ + $backendUrl = $objectManager->get(\Magento\Backend\Model\Url::class); + $urlPath = parse_url($backendUrl->getBaseUrl(), PHP_URL_PATH); + $cookiePath = $urlPath . 'setup'; + $sessionConfig->setCookiePath($cookiePath); + /* @var \Magento\Backend\Model\Auth\Session $session */ + $session = $objectManager->create( + \Magento\Backend\Model\Auth\Session::class, + [ + 'sessionConfig' => $sessionConfig, + 'appState' => $adminAppState + ] + ); + } $session->prolong(); + return new \Zend\View\Model\JsonModel(['success' => true]); } } catch (\Exception $e) { } + return new \Zend\View\Model\JsonModel(['success' => false]); } /** + * Unlogin action, return 401 error page. + * * @return \Zend\View\Model\ViewModel|\Zend\Http\Response */ public function unloginAction() @@ -85,6 +98,7 @@ public function unloginAction() $view = new \Zend\View\Model\ViewModel(); $view->setTemplate('/error/401.phtml'); $this->getResponse()->setStatusCode(\Zend\Http\Response::STATUS_CODE_401); + return $view; } } diff --git a/setup/src/Magento/Setup/Test/Unit/Controller/SessionTest.php b/setup/src/Magento/Setup/Test/Unit/Controller/SessionTest.php index f8e5e7cdc4d70..18d299cec37a1 100644 --- a/setup/src/Magento/Setup/Test/Unit/Controller/SessionTest.php +++ b/setup/src/Magento/Setup/Test/Unit/Controller/SessionTest.php @@ -8,6 +8,9 @@ use \Magento\Setup\Controller\Session; +/** + * Unit test for \Magento\Setup\Controller\Session. + */ class SessionTest extends \PHPUnit\Framework\TestCase { /** @@ -16,15 +19,18 @@ class SessionTest extends \PHPUnit\Framework\TestCase private $objectManager; /** - * @var \PHPUnit_Framework_MockObject_MockObject| \Magento\Setup\Model\ObjectManagerProvider + * @var \PHPUnit_Framework_MockObject_MockObject|\Magento\Setup\Model\ObjectManagerProvider */ private $objectManagerProvider; /** - * @var \Zend\ServiceManager\ServiceManager + * @var \PHPUnit_Framework_MockObject_MockObject|\Zend\ServiceManager\ServiceManager */ private $serviceManager; + /** + * @inheritdoc + */ public function setUp() { $objectManager = @@ -41,37 +47,40 @@ public function setUp() */ public function testUnloginAction() { - $this->objectManagerProvider->expects($this->once())->method('get')->will( - $this->returnValue($this->objectManager) + $this->objectManagerProvider->expects($this->once())->method('get')->willReturn($this->objectManager); + $deployConfigMock = $this->createPartialMock(\Magento\Framework\App\DeploymentConfig::class, ['isAvailable']); + $deployConfigMock->expects($this->once())->method('isAvailable')->willReturn(true); + + $sessionMock = $this->createPartialMock( + \Magento\Backend\Model\Auth\Session::class, + ['prolong', 'isSessionExists'] ); - $deployConfigMock = - $this->createPartialMock(\Magento\Framework\App\DeploymentConfig::class, ['isAvailable']); - $deployConfigMock->expects($this->once())->method('isAvailable')->will($this->returnValue(true)); + $sessionMock->expects($this->once())->method('isSessionExists')->willReturn(false); $stateMock = $this->createPartialMock(\Magento\Framework\App\State::class, ['setAreaCode']); $stateMock->expects($this->once())->method('setAreaCode'); - $sessionConfigMock = - $this->createPartialMock(\Magento\Backend\Model\Session\AdminConfig::class, ['setCookiePath']); + $sessionConfigMock = $this->createPartialMock( + \Magento\Backend\Model\Session\AdminConfig::class, + ['setCookiePath'] + ); $sessionConfigMock->expects($this->once())->method('setCookiePath'); $urlMock = $this->createMock(\Magento\Backend\Model\Url::class); $returnValueMap = [ + [\Magento\Backend\Model\Auth\Session::class, $sessionMock], [\Magento\Framework\App\State::class, $stateMock], [\Magento\Backend\Model\Session\AdminConfig::class, $sessionConfigMock], - [\Magento\Backend\Model\Url::class, $urlMock] + [\Magento\Backend\Model\Url::class, $urlMock], ]; - $this->serviceManager->expects($this->once())->method('get')->will($this->returnValue($deployConfigMock)); + $this->serviceManager->expects($this->once())->method('get')->willReturn($deployConfigMock); $this->objectManager->expects($this->atLeastOnce()) ->method('get') - ->will($this->returnValueMap($returnValueMap)); + ->willReturnMap($returnValueMap); - $sessionMock = $this->createPartialMock(\Magento\Backend\Model\Auth\Session::class, ['prolong']); - $this->objectManager->expects($this->once()) - ->method('create') - ->will($this->returnValue($sessionMock)); + $this->objectManager->expects($this->once())->method('create')->willReturn($sessionMock); $controller = new Session($this->serviceManager, $this->objectManagerProvider); $urlMock->expects($this->once())->method('getBaseUrl'); $controller->prolongAction(); @@ -87,4 +96,25 @@ public function testIndexAction() $viewModel = $controller->unloginAction(); $this->assertInstanceOf(\Zend\View\Model\ViewModel::class, $viewModel); } + + /** + * @covers \Magento\Setup\Controller\SystemConfig::prolongAction + */ + public function testProlongActionWithExistingSession() + { + $this->objectManagerProvider->expects($this->once())->method('get')->willReturn($this->objectManager); + $deployConfigMock = $this->createPartialMock(\Magento\Framework\App\DeploymentConfig::class, ['isAvailable']); + $deployConfigMock->expects($this->once())->method('isAvailable')->willReturn(true); + $sessionMock = $this->createPartialMock( + \Magento\Backend\Model\Auth\Session::class, + ['prolong', 'isSessionExists'] + ); + $sessionMock->expects($this->once())->method('isSessionExists')->willReturn(true); + + $this->serviceManager->expects($this->once())->method('get')->willReturn($deployConfigMock); + $this->objectManager->expects($this->once())->method('get')->willReturn($sessionMock); + + $controller = new Session($this->serviceManager, $this->objectManagerProvider); + $this->assertEquals(new \Zend\View\Model\JsonModel(['success' => true]), $controller->prolongAction()); + } } From ffba5a2e74210efe85e14483648335c937d2bfa7 Mon Sep 17 00:00:00 2001 From: DianaRusin <rusind95@gmail.com> Date: Wed, 20 Mar 2019 14:08:17 +0200 Subject: [PATCH 05/14] MAGETWO-96375: Checkout Free Shipping Recalculation after Coupon Code Added --- .../Mftf/ActionGroup/ApplyCartRuleOnStorefrontActionGroup.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/ApplyCartRuleOnStorefrontActionGroup.xml b/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/ApplyCartRuleOnStorefrontActionGroup.xml index c8f2263d9734a..4cd0637e83b77 100644 --- a/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/ApplyCartRuleOnStorefrontActionGroup.xml +++ b/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/ApplyCartRuleOnStorefrontActionGroup.xml @@ -39,6 +39,7 @@ <!-- Apply Sales Rule Coupon to the cart --> <actionGroup name="StorefrontTryingToApplyCouponActionGroup" extends="StorefrontApplyCouponActionGroup"> + <remove keyForRemoval="waitForSuccessMessage"/> <remove keyForRemoval="seeSuccessMessage"/> <waitForElementVisible selector="{{StorefrontMessagesSection.error}}" stepKey="waitError"/> <see selector="{{StorefrontMessagesSection.error}}" userInput='The coupon code "{{couponCode}}" is not valid.' From ff01cd61b82ce883114fc31ef05693b617c16c41 Mon Sep 17 00:00:00 2001 From: Stas Kozar <stas.kozar@transoftgroup.com> Date: Wed, 20 Mar 2019 14:26:15 +0200 Subject: [PATCH 06/14] MC-15360: Improve checkout through BrainTree(Paypal) --- ...frontPayWithPaypalFromMiniCartActionGroup.xml | 16 ++++++++++++++++ .../Braintree/Test/Mftf/Data/BraintreeData.xml | 8 ++++++++ .../Test/Mftf/Metadata/braintree_config-meta.xml | 3 +++ .../Braintree/Test/Mftf/Page/ReviewOrderPage.xml | 15 +++++++++++++++ .../Mftf/Section/StorefrontMiniCartSection.xml | 15 +++++++++++++++ .../StorefrontReviewOrderItemsSection.xml | 15 +++++++++++++++ .../StorefrontReviewOrderShippingSection.xml | 14 ++++++++++++++ 7 files changed, 86 insertions(+) create mode 100644 app/code/Magento/Braintree/Test/Mftf/ActionGroup/StorefrontPayWithPaypalFromMiniCartActionGroup.xml create mode 100644 app/code/Magento/Braintree/Test/Mftf/Page/ReviewOrderPage.xml create mode 100644 app/code/Magento/Braintree/Test/Mftf/Section/StorefrontMiniCartSection.xml create mode 100644 app/code/Magento/Braintree/Test/Mftf/Section/StorefrontReviewOrderItemsSection.xml create mode 100644 app/code/Magento/Braintree/Test/Mftf/Section/StorefrontReviewOrderShippingSection.xml diff --git a/app/code/Magento/Braintree/Test/Mftf/ActionGroup/StorefrontPayWithPaypalFromMiniCartActionGroup.xml b/app/code/Magento/Braintree/Test/Mftf/ActionGroup/StorefrontPayWithPaypalFromMiniCartActionGroup.xml new file mode 100644 index 0000000000000..8ad866b77e7ff --- /dev/null +++ b/app/code/Magento/Braintree/Test/Mftf/ActionGroup/StorefrontPayWithPaypalFromMiniCartActionGroup.xml @@ -0,0 +1,16 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="StorefrontPayWithPaypalFromMiniCartActionGroup" extends="StorefrontViewAndEditCartFromMiniCartActionGroup"> + <remove keyForRemoval="viewAndEditCart"/> + <remove keyForRemoval="seeInCurrentUrl"/> + <waitForElementVisible selector="{{StorefrontMiniCartSection.payWithPayPal}}" stepKey="waitForPaypalButtonIsVisible"/> + <click selector="{{StorefrontMiniCartSection.payWithPayPal}}" stepKey="clickPayWithPaypalButton"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Braintree/Test/Mftf/Data/BraintreeData.xml b/app/code/Magento/Braintree/Test/Mftf/Data/BraintreeData.xml index 4e8526a2b0e2b..a7730192af16e 100644 --- a/app/code/Magento/Braintree/Test/Mftf/Data/BraintreeData.xml +++ b/app/code/Magento/Braintree/Test/Mftf/Data/BraintreeData.xml @@ -44,6 +44,7 @@ <requiredEntity type="public_key">DefaultPublicKey</requiredEntity> <requiredEntity type="private_key">DefaultPrivateKey</requiredEntity> <requiredEntity type="active">DefaultActive</requiredEntity> + <requiredEntity type="active_braintree_paypal">DefaultActiveBraintreePaypal</requiredEntity> <requiredEntity type="merchant_account_id">DefaultMerchantAccountId</requiredEntity> </entity> <entity name="DefaultTitle" type="title"> @@ -67,6 +68,9 @@ <entity name="DefaultActive" type="active"> <data key="value">0</data> </entity> + <entity name="DefaultActiveBraintreePaypal" type="active_braintree_paypal"> + <data key="value">0</data> + </entity> <entity name="DefaultMerchantAccountId" type="merchant_account_id"> <data key="value"/> </entity> @@ -79,6 +83,7 @@ <requiredEntity type="public_key">EnabledPublicKey</requiredEntity> <requiredEntity type="private_key">EnabledPrivateKey</requiredEntity> <requiredEntity type="active">EnabledActive</requiredEntity> + <requiredEntity type="active_braintree_paypal">EnableActiveBraintreePaypal</requiredEntity> <requiredEntity type="merchant_account_id">EnabledMerchantAccountId</requiredEntity> </entity> <entity name="EnabledTitle" type="title"> @@ -102,6 +107,9 @@ <entity name="EnabledActive" type="active"> <data key="value">1</data> </entity> + <entity name="EnableActiveBraintreePaypal" type="active_braintree_paypal"> + <data key="value">1</data> + </entity> <entity name="EnabledMerchantAccountId" type="merchant_account_id"> <data key="value">Magneto</data> </entity> diff --git a/app/code/Magento/Braintree/Test/Mftf/Metadata/braintree_config-meta.xml b/app/code/Magento/Braintree/Test/Mftf/Metadata/braintree_config-meta.xml index 0f734e5c02d56..04b3cf38d27a7 100644 --- a/app/code/Magento/Braintree/Test/Mftf/Metadata/braintree_config-meta.xml +++ b/app/code/Magento/Braintree/Test/Mftf/Metadata/braintree_config-meta.xml @@ -49,6 +49,9 @@ <object key="active" dataType="active"> <field key="value">integer</field> </object> + <object key="active_braintree_paypal" dataType="active_braintree_paypal"> + <field key="value">integer</field> + </object> </object> </object> </object> diff --git a/app/code/Magento/Braintree/Test/Mftf/Page/ReviewOrderPage.xml b/app/code/Magento/Braintree/Test/Mftf/Page/ReviewOrderPage.xml new file mode 100644 index 0000000000000..96eff7a76a7f6 --- /dev/null +++ b/app/code/Magento/Braintree/Test/Mftf/Page/ReviewOrderPage.xml @@ -0,0 +1,15 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<pages xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/PageObject.xsd"> + <page name="ReviewOrderPage" url="/braintree/paypal/review" area="storefront" module="Magento_Braintree"> + <section name="StorefrontReviewOrderShippingSection"/> + <section name="StorefrontReviewOrderItemsSection"/> + </page> +</pages> diff --git a/app/code/Magento/Braintree/Test/Mftf/Section/StorefrontMiniCartSection.xml b/app/code/Magento/Braintree/Test/Mftf/Section/StorefrontMiniCartSection.xml new file mode 100644 index 0000000000000..bd4a5b72daa8a --- /dev/null +++ b/app/code/Magento/Braintree/Test/Mftf/Section/StorefrontMiniCartSection.xml @@ -0,0 +1,15 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd"> + <section name="StorefrontMiniCartSection"> + <element name="payWithPayPal" type="button" selector=".braintree-paypal-button-hidden" timeout="30"/> + <element name="proceedWithSandboxPurchase" type="text" selector="#return_url"/> + </section> +</sections> diff --git a/app/code/Magento/Braintree/Test/Mftf/Section/StorefrontReviewOrderItemsSection.xml b/app/code/Magento/Braintree/Test/Mftf/Section/StorefrontReviewOrderItemsSection.xml new file mode 100644 index 0000000000000..b751e67a7ac14 --- /dev/null +++ b/app/code/Magento/Braintree/Test/Mftf/Section/StorefrontReviewOrderItemsSection.xml @@ -0,0 +1,15 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd"> + <section name="StorefrontReviewOrderItemsSection"> + <element name="placeOrder" type="button" selector="#review-button" timeout="30"/> + <element name="orderSummaryTotal" type="text" selector="tr.grand.totals span.price"/> + </section> +</sections> diff --git a/app/code/Magento/Braintree/Test/Mftf/Section/StorefrontReviewOrderShippingSection.xml b/app/code/Magento/Braintree/Test/Mftf/Section/StorefrontReviewOrderShippingSection.xml new file mode 100644 index 0000000000000..4e1b3370432ad --- /dev/null +++ b/app/code/Magento/Braintree/Test/Mftf/Section/StorefrontReviewOrderShippingSection.xml @@ -0,0 +1,14 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd"> + <section name="StorefrontReviewOrderShippingSection"> + <element name="selectShippingMethodByName" type="select" selector="//select[@id='shipping-method']//option[contains(text(),'{{shippingMethod}}')]" parameterized="true"/> + </section> +</sections> From 470c0ec43d9030b02d2ce05f92b8decbd20db4bc Mon Sep 17 00:00:00 2001 From: DianaRusin <rusind95@gmail.com> Date: Thu, 21 Mar 2019 15:18:39 +0200 Subject: [PATCH 07/14] MC-15074: Add entity to Product data --- app/code/Magento/Catalog/Test/Mftf/Data/ProductData.xml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/code/Magento/Catalog/Test/Mftf/Data/ProductData.xml b/app/code/Magento/Catalog/Test/Mftf/Data/ProductData.xml index 8ee8b49d0a10a..ea73ec234e3fb 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Data/ProductData.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Data/ProductData.xml @@ -277,6 +277,10 @@ <var key="sku" entityType="product" entityKey="sku" /> <requiredEntity type="product_option">ProductOptionDropDownWithLongValuesTitle</requiredEntity> </entity> + <entity name="ProductWithFileOption" type="product"> + <var key="sku" entityType="product" entityKey="sku" /> + <requiredEntity type="product_option">ProductOptionFile</requiredEntity> + </entity> <entity name="SimpleProductWithCustomAttributeSet" type="product"> <data key="sku" unique="suffix">testSku</data> <data key="type_id">simple</data> From d50ecda433331af7433318d833ad5b71b93aa73a Mon Sep 17 00:00:00 2001 From: Stas Kozar <stas.kozar@transoftgroup.com> Date: Fri, 22 Mar 2019 10:38:49 +0200 Subject: [PATCH 08/14] MC-15360: Improve checkout through BrainTree(Paypal) --- .../Test/Mftf/Data/BraintreeData.xml | 22 ++++++++++++------- ...rderPage.xml => PaypalReviewOrderPage.xml} | 6 ++--- .../StorefrontReviewOrderItemsSection.xml | 2 +- .../StorefrontReviewOrderShippingSection.xml | 2 +- 4 files changed, 19 insertions(+), 13 deletions(-) rename app/code/Magento/Braintree/Test/Mftf/Page/{ReviewOrderPage.xml => PaypalReviewOrderPage.xml} (55%) diff --git a/app/code/Magento/Braintree/Test/Mftf/Data/BraintreeData.xml b/app/code/Magento/Braintree/Test/Mftf/Data/BraintreeData.xml index a7730192af16e..aa0f5a936fd7e 100644 --- a/app/code/Magento/Braintree/Test/Mftf/Data/BraintreeData.xml +++ b/app/code/Magento/Braintree/Test/Mftf/Data/BraintreeData.xml @@ -44,7 +44,6 @@ <requiredEntity type="public_key">DefaultPublicKey</requiredEntity> <requiredEntity type="private_key">DefaultPrivateKey</requiredEntity> <requiredEntity type="active">DefaultActive</requiredEntity> - <requiredEntity type="active_braintree_paypal">DefaultActiveBraintreePaypal</requiredEntity> <requiredEntity type="merchant_account_id">DefaultMerchantAccountId</requiredEntity> </entity> <entity name="DefaultTitle" type="title"> @@ -68,13 +67,17 @@ <entity name="DefaultActive" type="active"> <data key="value">0</data> </entity> - <entity name="DefaultActiveBraintreePaypal" type="active_braintree_paypal"> - <data key="value">0</data> - </entity> <entity name="DefaultMerchantAccountId" type="merchant_account_id"> <data key="value"/> </entity> + <entity name="DefaultBraintreeWithPaypalConfig" extends="DefaultBraintreeConfig"> + <requiredEntity type="active_braintree_paypal">DefaultActiveBraintreePaypal</requiredEntity> + </entity> + <entity name="DefaultActiveBraintreePaypal" type="active_braintree_paypal"> + <data key="value">0</data> + </entity> + <entity name="SandboxBraintreeConfig" type="braintree_config_state"> <requiredEntity type="title">EnabledTitle</requiredEntity> <requiredEntity type="payment_action">AuthorizePaymentAction</requiredEntity> @@ -83,7 +86,6 @@ <requiredEntity type="public_key">EnabledPublicKey</requiredEntity> <requiredEntity type="private_key">EnabledPrivateKey</requiredEntity> <requiredEntity type="active">EnabledActive</requiredEntity> - <requiredEntity type="active_braintree_paypal">EnableActiveBraintreePaypal</requiredEntity> <requiredEntity type="merchant_account_id">EnabledMerchantAccountId</requiredEntity> </entity> <entity name="EnabledTitle" type="title"> @@ -107,13 +109,17 @@ <entity name="EnabledActive" type="active"> <data key="value">1</data> </entity> - <entity name="EnableActiveBraintreePaypal" type="active_braintree_paypal"> - <data key="value">1</data> - </entity> <entity name="EnabledMerchantAccountId" type="merchant_account_id"> <data key="value">Magneto</data> </entity> + <entity name="SandboxBraintreeWithPaypalConfig" extends="SandboxBraintreeConfig"> + <requiredEntity type="active_braintree_paypal">EnableActiveBraintreePaypal</requiredEntity> + </entity> + <entity name="EnableActiveBraintreePaypal" type="active_braintree_paypal"> + <data key="value">1</data> + </entity> + <entity name="BraintreeCard" type="creditCard"> <data key="cc_type">MasterCard</data> <data key="card_number">5105105105105100</data> diff --git a/app/code/Magento/Braintree/Test/Mftf/Page/ReviewOrderPage.xml b/app/code/Magento/Braintree/Test/Mftf/Page/PaypalReviewOrderPage.xml similarity index 55% rename from app/code/Magento/Braintree/Test/Mftf/Page/ReviewOrderPage.xml rename to app/code/Magento/Braintree/Test/Mftf/Page/PaypalReviewOrderPage.xml index 96eff7a76a7f6..fa21d3c8fd9a1 100644 --- a/app/code/Magento/Braintree/Test/Mftf/Page/ReviewOrderPage.xml +++ b/app/code/Magento/Braintree/Test/Mftf/Page/PaypalReviewOrderPage.xml @@ -8,8 +8,8 @@ <pages xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/PageObject.xsd"> - <page name="ReviewOrderPage" url="/braintree/paypal/review" area="storefront" module="Magento_Braintree"> - <section name="StorefrontReviewOrderShippingSection"/> - <section name="StorefrontReviewOrderItemsSection"/> + <page name="PaypalReviewOrderPage" url="/braintree/paypal/review" area="storefront" module="Magento_Braintree"> + <section name="StorefrontPaypalReviewOrderShippingSection"/> + <section name="StorefrontPaypalReviewOrderItemsSection"/> </page> </pages> diff --git a/app/code/Magento/Braintree/Test/Mftf/Section/StorefrontReviewOrderItemsSection.xml b/app/code/Magento/Braintree/Test/Mftf/Section/StorefrontReviewOrderItemsSection.xml index b751e67a7ac14..8c834f7003eb5 100644 --- a/app/code/Magento/Braintree/Test/Mftf/Section/StorefrontReviewOrderItemsSection.xml +++ b/app/code/Magento/Braintree/Test/Mftf/Section/StorefrontReviewOrderItemsSection.xml @@ -8,7 +8,7 @@ <sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd"> - <section name="StorefrontReviewOrderItemsSection"> + <section name="StorefrontPaypalReviewOrderItemsSection"> <element name="placeOrder" type="button" selector="#review-button" timeout="30"/> <element name="orderSummaryTotal" type="text" selector="tr.grand.totals span.price"/> </section> diff --git a/app/code/Magento/Braintree/Test/Mftf/Section/StorefrontReviewOrderShippingSection.xml b/app/code/Magento/Braintree/Test/Mftf/Section/StorefrontReviewOrderShippingSection.xml index 4e1b3370432ad..2e4e6047f57bb 100644 --- a/app/code/Magento/Braintree/Test/Mftf/Section/StorefrontReviewOrderShippingSection.xml +++ b/app/code/Magento/Braintree/Test/Mftf/Section/StorefrontReviewOrderShippingSection.xml @@ -8,7 +8,7 @@ <sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd"> - <section name="StorefrontReviewOrderShippingSection"> + <section name="StorefrontPaypalReviewOrderShippingSection"> <element name="selectShippingMethodByName" type="select" selector="//select[@id='shipping-method']//option[contains(text(),'{{shippingMethod}}')]" parameterized="true"/> </section> </sections> From 4326a8672f2f629752e130f6a3512c6040bbd8f3 Mon Sep 17 00:00:00 2001 From: Stas Kozar <stas.kozar@transoftgroup.com> Date: Fri, 22 Mar 2019 10:50:17 +0200 Subject: [PATCH 09/14] MC-15360: Improve checkout through BrainTree(Paypal) --- ...lReviewOrderPage.xml => StorefrontPaypalReviewOrderPage.xml} | 2 +- ...sSection.xml => StorefrontPaypalReviewOrderItemsSection.xml} | 0 ...ction.xml => StorefrontPaypalReviewOrderShippingSection.xml} | 0 3 files changed, 1 insertion(+), 1 deletion(-) rename app/code/Magento/Braintree/Test/Mftf/Page/{PaypalReviewOrderPage.xml => StorefrontPaypalReviewOrderPage.xml} (78%) rename app/code/Magento/Braintree/Test/Mftf/Section/{StorefrontReviewOrderItemsSection.xml => StorefrontPaypalReviewOrderItemsSection.xml} (100%) rename app/code/Magento/Braintree/Test/Mftf/Section/{StorefrontReviewOrderShippingSection.xml => StorefrontPaypalReviewOrderShippingSection.xml} (100%) diff --git a/app/code/Magento/Braintree/Test/Mftf/Page/PaypalReviewOrderPage.xml b/app/code/Magento/Braintree/Test/Mftf/Page/StorefrontPaypalReviewOrderPage.xml similarity index 78% rename from app/code/Magento/Braintree/Test/Mftf/Page/PaypalReviewOrderPage.xml rename to app/code/Magento/Braintree/Test/Mftf/Page/StorefrontPaypalReviewOrderPage.xml index fa21d3c8fd9a1..82c0fa2a075d4 100644 --- a/app/code/Magento/Braintree/Test/Mftf/Page/PaypalReviewOrderPage.xml +++ b/app/code/Magento/Braintree/Test/Mftf/Page/StorefrontPaypalReviewOrderPage.xml @@ -8,7 +8,7 @@ <pages xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/PageObject.xsd"> - <page name="PaypalReviewOrderPage" url="/braintree/paypal/review" area="storefront" module="Magento_Braintree"> + <page name="StorefrontPaypalReviewOrderPage" url="/braintree/paypal/review" area="storefront" module="Magento_Braintree"> <section name="StorefrontPaypalReviewOrderShippingSection"/> <section name="StorefrontPaypalReviewOrderItemsSection"/> </page> diff --git a/app/code/Magento/Braintree/Test/Mftf/Section/StorefrontReviewOrderItemsSection.xml b/app/code/Magento/Braintree/Test/Mftf/Section/StorefrontPaypalReviewOrderItemsSection.xml similarity index 100% rename from app/code/Magento/Braintree/Test/Mftf/Section/StorefrontReviewOrderItemsSection.xml rename to app/code/Magento/Braintree/Test/Mftf/Section/StorefrontPaypalReviewOrderItemsSection.xml diff --git a/app/code/Magento/Braintree/Test/Mftf/Section/StorefrontReviewOrderShippingSection.xml b/app/code/Magento/Braintree/Test/Mftf/Section/StorefrontPaypalReviewOrderShippingSection.xml similarity index 100% rename from app/code/Magento/Braintree/Test/Mftf/Section/StorefrontReviewOrderShippingSection.xml rename to app/code/Magento/Braintree/Test/Mftf/Section/StorefrontPaypalReviewOrderShippingSection.xml From 5c7a4035f0e194171654860e27cd3b6eb26758e2 Mon Sep 17 00:00:00 2001 From: Viktor Petryk <victor.petryk@transoftgroup.com> Date: Thu, 28 Mar 2019 11:18:06 +0200 Subject: [PATCH 10/14] MAGETWO-74081: [GitHub] Can't use "configurable" as group name in attribute sets M2.1 #6123 --- .../Magento/ConfigurableProduct/etc/di.xml | 7 +++ .../Eav/Model/Entity/Attribute/Group.php | 57 ++++++++++++------- .../Unit/Model/Entity/Attribute/GroupTest.php | 25 +++++--- 3 files changed, 60 insertions(+), 29 deletions(-) diff --git a/app/code/Magento/ConfigurableProduct/etc/di.xml b/app/code/Magento/ConfigurableProduct/etc/di.xml index a390cb375befc..dd39bcb477699 100644 --- a/app/code/Magento/ConfigurableProduct/etc/di.xml +++ b/app/code/Magento/ConfigurableProduct/etc/di.xml @@ -248,4 +248,11 @@ <type name="Magento\Tax\Model\Sales\Total\Quote\CommonTaxCollector"> <plugin name="apply_tax_class_id" type="Magento\ConfigurableProduct\Plugin\Tax\Model\Sales\Total\Quote\CommonTaxCollector" /> </type> + <type name="Magento\Eav\Model\Entity\Attribute\Group"> + <arguments> + <argument name="reservedSystemNames" xsi:type="array"> + <item name="configurable" xsi:type="string">configurable</item> + </argument> + </arguments> + </type> </config> diff --git a/app/code/Magento/Eav/Model/Entity/Attribute/Group.php b/app/code/Magento/Eav/Model/Entity/Attribute/Group.php index 0b6ac2b998de7..7c7fcec6fc8f8 100644 --- a/app/code/Magento/Eav/Model/Entity/Attribute/Group.php +++ b/app/code/Magento/Eav/Model/Entity/Attribute/Group.php @@ -5,9 +5,14 @@ */ namespace Magento\Eav\Model\Entity\Attribute; +use Magento\Eav\Api\Data\AttributeGroupExtensionInterface; +use Magento\Eav\Api\Data\AttributeGroupInterface; use Magento\Framework\Api\AttributeValueFactory; +use Magento\Framework\Model\AbstractExtensibleModel; /** + * Entity attribute group model. + * * @api * @method int getSortOrder() * @method \Magento\Eav\Model\Entity\Attribute\Group setSortOrder(int $value) @@ -19,14 +24,18 @@ * @method \Magento\Eav\Model\Entity\Attribute\Group setTabGroupCode(string $value) * @since 100.0.2 */ -class Group extends \Magento\Framework\Model\AbstractExtensibleModel implements - \Magento\Eav\Api\Data\AttributeGroupInterface +class Group extends AbstractExtensibleModel implements AttributeGroupInterface { /** * @var \Magento\Framework\Filter\Translit */ private $translitFilter; + /** + * @var array + */ + private $reservedSystemNames = []; + /** * @param \Magento\Framework\Model\Context $context * @param \Magento\Framework\Registry $registry @@ -36,6 +45,7 @@ class Group extends \Magento\Framework\Model\AbstractExtensibleModel implements * @param \Magento\Framework\Model\ResourceModel\AbstractResource $resource * @param \Magento\Framework\Data\Collection\AbstractDb $resourceCollection * @param array $data + * @param array $reservedSystemNames */ public function __construct( \Magento\Framework\Model\Context $context, @@ -45,7 +55,8 @@ public function __construct( \Magento\Framework\Filter\Translit $translitFilter, \Magento\Framework\Model\ResourceModel\AbstractResource $resource = null, \Magento\Framework\Data\Collection\AbstractDb $resourceCollection = null, - array $data = [] + array $data = [], + array $reservedSystemNames = [] ) { parent::__construct( $context, @@ -57,10 +68,11 @@ public function __construct( $data ); $this->translitFilter = $translitFilter; + $this->reservedSystemNames = $reservedSystemNames; } /** - * Resource initialization + * Resource initialization. * * @return void * @codeCoverageIgnore @@ -71,7 +83,7 @@ protected function _construct() } /** - * Checks if current attribute group exists + * Checks if current attribute group exists. * * @return bool * @codeCoverageIgnore @@ -82,7 +94,7 @@ public function itemExists() } /** - * Delete groups + * Delete groups. * * @return $this * @codeCoverageIgnore @@ -93,7 +105,7 @@ public function deleteGroups() } /** - * Processing object before save data + * Processing object before save data. * * @return $this */ @@ -110,18 +122,20 @@ public function beforeSave() ), '-' ); - if (empty($attributeGroupCode)) { + $isReservedSystemName = in_array(strtolower($attributeGroupCode), $this->reservedSystemNames); + if (empty($attributeGroupCode) || $isReservedSystemName) { // in the following code md5 is not used for security purposes - $attributeGroupCode = md5($groupName); + $attributeGroupCode = md5(strtolower($groupName)); } $this->setAttributeGroupCode($attributeGroupCode); } } + return parent::beforeSave(); } /** - * {@inheritdoc} + * @inheritdoc * @codeCoverageIgnoreStart */ public function getAttributeGroupId() @@ -130,7 +144,7 @@ public function getAttributeGroupId() } /** - * {@inheritdoc} + * @inheritdoc */ public function getAttributeGroupName() { @@ -138,7 +152,7 @@ public function getAttributeGroupName() } /** - * {@inheritdoc} + * @inheritdoc */ public function getAttributeSetId() { @@ -146,7 +160,7 @@ public function getAttributeSetId() } /** - * {@inheritdoc} + * @inheritdoc */ public function setAttributeGroupId($attributeGroupId) { @@ -154,7 +168,7 @@ public function setAttributeGroupId($attributeGroupId) } /** - * {@inheritdoc} + * @inheritdoc */ public function setAttributeGroupName($attributeGroupName) { @@ -162,7 +176,7 @@ public function setAttributeGroupName($attributeGroupName) } /** - * {@inheritdoc} + * @inheritdoc */ public function setAttributeSetId($attributeSetId) { @@ -170,9 +184,9 @@ public function setAttributeSetId($attributeSetId) } /** - * {@inheritdoc} + * @inheritdoc * - * @return \Magento\Eav\Api\Data\AttributeGroupExtensionInterface|null + * @return AttributeGroupExtensionInterface|null */ public function getExtensionAttributes() { @@ -180,14 +194,13 @@ public function getExtensionAttributes() } /** - * {@inheritdoc} + * @inheritdoc * - * @param \Magento\Eav\Api\Data\AttributeGroupExtensionInterface $extensionAttributes + * @param AttributeGroupExtensionInterface $extensionAttributes * @return $this */ - public function setExtensionAttributes( - \Magento\Eav\Api\Data\AttributeGroupExtensionInterface $extensionAttributes - ) { + public function setExtensionAttributes(AttributeGroupExtensionInterface $extensionAttributes) + { return $this->_setExtensionAttributes($extensionAttributes); } diff --git a/app/code/Magento/Eav/Test/Unit/Model/Entity/Attribute/GroupTest.php b/app/code/Magento/Eav/Test/Unit/Model/Entity/Attribute/GroupTest.php index d4c91e98d9608..3f663558f4b8c 100644 --- a/app/code/Magento/Eav/Test/Unit/Model/Entity/Attribute/GroupTest.php +++ b/app/code/Magento/Eav/Test/Unit/Model/Entity/Attribute/GroupTest.php @@ -6,7 +6,12 @@ namespace Magento\Eav\Test\Unit\Model\Entity\Attribute; use Magento\Eav\Model\Entity\Attribute\Group; +use Magento\Eav\Model\ResourceModel\Entity\Attribute\Group as ResourceGroup; +use Magento\Framework\Event\ManagerInterface; +use Magento\Framework\Filter\Translit; +use Magento\Framework\Model\Context; use Magento\Framework\TestFramework\Unit\Helper\ObjectManager; +use PHPUnit_Framework_MockObject_MockObject as MockObject; class GroupTest extends \PHPUnit\Framework\TestCase { @@ -16,34 +21,38 @@ class GroupTest extends \PHPUnit\Framework\TestCase private $model; /** - * @var \PHPUnit_Framework_MockObject_MockObject + * @var ResourceGroup|MockObject */ private $resourceMock; /** - * @var \PHPUnit_Framework_MockObject_MockObject + * @var ManagerInterface|MockObject */ private $eventManagerMock; + /** + * @inheritdoc + */ protected function setUp() { - $this->resourceMock = $this->createMock(\Magento\Eav\Model\ResourceModel\Entity\Attribute\Group::class); - $translitFilter = $this->getMockBuilder(\Magento\Framework\Filter\Translit::class) + $this->resourceMock = $this->createMock(ResourceGroup::class); + $translitFilter = $this->getMockBuilder(Translit::class) ->disableOriginalConstructor() ->getMock(); $translitFilter->expects($this->atLeastOnce())->method('filter')->willReturnArgument(0); - $this->eventManagerMock = $this->createMock(\Magento\Framework\Event\ManagerInterface::class); - $contextMock = $this->createMock(\Magento\Framework\Model\Context::class); + $this->eventManagerMock = $this->createMock(ManagerInterface::class); + $contextMock = $this->createMock(Context::class); $contextMock->expects($this->any())->method('getEventDispatcher')->willReturn($this->eventManagerMock); $constructorArguments = [ 'resource' => $this->resourceMock, 'translitFilter' => $translitFilter, 'context' => $contextMock, + 'reservedSystemNames' => ['configurable'], ]; $objectManager = new ObjectManager($this); $this->model = $objectManager->getObject( - \Magento\Eav\Model\Entity\Attribute\Group::class, + Group::class, $constructorArguments ); } @@ -67,6 +76,8 @@ public function attributeGroupCodeDataProvider() { return [ ['General Group', 'general-group'], + ['configurable', md5('configurable')], + ['configurAble', md5('configurable')], ['///', md5('///')], ]; } From e7297da0eeed711158164fd2468b127accd8ed6c Mon Sep 17 00:00:00 2001 From: DianaRusin <rusind95@gmail.com> Date: Fri, 29 Mar 2019 11:06:54 +0200 Subject: [PATCH 11/14] MAGETWO-96375: Checkout Free Shipping Recalculation after Coupon Code Added --- .../Mftf/ActionGroup/CheckoutActionGroup.xml | 9 +++++++++ .../GoToCheckoutFromMinicartActionGroup.xml | 3 ++- ...ingRecalculationAfterCouponCodeAddedTest.xml | 17 ++++++----------- .../Test/Mftf/Data/StoreShippingMethodsData.xml | 14 ++++---------- 4 files changed, 21 insertions(+), 22 deletions(-) diff --git a/app/code/Magento/Checkout/Test/Mftf/ActionGroup/CheckoutActionGroup.xml b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/CheckoutActionGroup.xml index 1cbaa66e2fd8b..09197a90542ee 100644 --- a/app/code/Magento/Checkout/Test/Mftf/ActionGroup/CheckoutActionGroup.xml +++ b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/CheckoutActionGroup.xml @@ -119,4 +119,13 @@ <waitForElementVisible selector="{{CheckoutPaymentSection.paymentSectionTitle}}" stepKey="waitForPaymentSectionLoaded"/> <seeInCurrentUrl url="{{CheckoutPage.url}}/#payment" stepKey="assertCheckoutPaymentUrl"/> </actionGroup> + + <actionGroup name="AssertStorefrontErrorMessageOnOrderSubmit"> + <arguments> + <argument name="errorMessage" type="string"/> + </arguments> + <waitForElementVisible selector="{{CheckoutPaymentSection.placeOrderNoWait}}" stepKey="waitForPlaceOrderButton"/> + <click selector="{{CheckoutPaymentSection.placeOrderNoWait}}" stepKey="clickPlaceOrder"/> + <waitForText selector="{{StorefrontMessagesSection.errorMessage}}" userInput="{{errorMessage}}" time="30" stepKey="seeShippingMethodError"/> + </actionGroup> </actionGroups> diff --git a/app/code/Magento/Checkout/Test/Mftf/ActionGroup/GoToCheckoutFromMinicartActionGroup.xml b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/GoToCheckoutFromMinicartActionGroup.xml index f03be61cccd3a..c06ff0cb96b58 100644 --- a/app/code/Magento/Checkout/Test/Mftf/ActionGroup/GoToCheckoutFromMinicartActionGroup.xml +++ b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/GoToCheckoutFromMinicartActionGroup.xml @@ -10,10 +10,11 @@ xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> <!-- Go to checkout from minicart --> <actionGroup name="GoToCheckoutFromMinicartActionGroup"> + <waitForPageLoad stepKey="waitForPageLoad"/> <waitForElement selector="{{StorefrontMinicartSection.showCart}}" stepKey="waitMiniCartSectionShow" /> <click selector="{{StorefrontMinicartSection.showCart}}" stepKey="clickCart"/> <waitForElementVisible selector="{{StorefrontMinicartSection.goToCheckout}}" time="30" stepKey="waitForGoToCheckoutButtonVisible"/> <click selector="{{StorefrontMinicartSection.goToCheckout}}" stepKey="clickGoToCheckoutButton"/> - <waitForPageLoad stepKey="waitForPageLoad"/> + <waitForPageLoad stepKey="waitForPageLoad1"/> </actionGroup> </actionGroups> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/StorefrontFreeShippingRecalculationAfterCouponCodeAddedTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/StorefrontFreeShippingRecalculationAfterCouponCodeAddedTest.xml index 0dac0266904ff..5f0a5078734d7 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/StorefrontFreeShippingRecalculationAfterCouponCodeAddedTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/StorefrontFreeShippingRecalculationAfterCouponCodeAddedTest.xml @@ -29,8 +29,7 @@ <createData entity="Simple_US_Customer" stepKey="createSimpleUsCustomer"/> <!-- Enable Free Shipping and set minimum order amount --> - <createData entity="FreeShippingMethodsSettingConfig" stepKey="freeShippingMethodSettingConfig"/> - <createData entity="MinimumOrderAmount90" stepKey="setMinimumOrderAmount"/> + <createData entity="FreeShippingMethodWithMinimumOrderAmount90" stepKey="enableFreeShippingAndSetMinimumOrderAmount"/> <!-- Create Cart Price Rule --> <createData entity="SalesRuleSpecificCouponWithPercentDiscount" stepKey="createCartPriceRule"> @@ -39,20 +38,17 @@ <createData entity="SimpleSalesRuleCoupon" stepKey="createCouponForCartPriceRule"> <requiredEntity createDataKey="createCartPriceRule"/> </createData> - - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> <actionGroup ref="CustomerLoginOnStorefront" stepKey="loginToStorefront"> <argument name="customer" value="$$createSimpleUsCustomer$$"/> </actionGroup> </before> + <after> <deleteData createDataKey="createSimpleProduct" stepKey="deleteProduct"/> <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> <deleteData createDataKey="createSimpleUsCustomer" stepKey="deleteCustomer"/> <deleteData createDataKey="createCartPriceRule" stepKey="deleteCartPriceRule"/> - <createData entity="DefaultShippingMethodsConfig" stepKey="setDefaultShippingMethodsConfig"/> - <createData entity="DefaultMinimumOrderAmount" stepKey="setDefaultMinimumOrderAmount"/> - <actionGroup ref="logout" stepKey="logout"/> + <createData entity="ResetFreeShippingMethodWithMinimumOrderAmount90" stepKey="resetFreeShippingMethodAndMinimumOrderAmount"/> <actionGroup ref="CustomerLogoutStorefrontActionGroup" stepKey="logoutFromStorefront"/> </after> @@ -70,7 +66,6 @@ <!-- Back to Shopping Cart page and cancel coupon--> <amOnPage url="{{CheckoutCartPage.url}}" stepKey="goToShoppingCartPage"/> <actionGroup ref="StorefrontCancelCouponActionGroup" stepKey="cancelCoupon"/> - <waitForPageLoad stepKey="waitForPageLoad"/> <!-- Proceed to Checkout, select Free Shipping method and apply coupon --> <actionGroup ref="GoToCheckoutFromMinicartActionGroup" stepKey="goToCheckoutFromMinicart1"/> @@ -84,9 +79,9 @@ <actionGroup ref="CheckoutSelectCheckMoneyOrderPaymentActionGroup" stepKey="selectPaymentMethod"/> <!-- Try to Place Order --> - <waitForElementVisible selector="{{CheckoutPaymentSection.placeOrderNoWait}}" stepKey="waitForPlaceOrderButton"/> - <click selector="{{CheckoutPaymentSection.placeOrderNoWait}}" stepKey="clickPlaceOrder"/> - <waitForText selector="{{StorefrontMessagesSection.errorMessage}}" userInput="The shipping method is missing. Select the shipping method and try again." time="30" stepKey="seeShippingMethodError"/> + <actionGroup ref="AssertStorefrontErrorMessageOnOrderSubmit" stepKey="tryToPlaceOrder"> + <argument name="errorMessage" value="The shipping method is missing. Select the shipping method and try again."/> + </actionGroup> <!-- Go back to Shipping step and select Shipping method --> <amOnPage url="{{CheckoutPage.url}}/#shipping" stepKey="navigateToShippingStep"/> diff --git a/app/code/Magento/Store/Test/Mftf/Data/StoreShippingMethodsData.xml b/app/code/Magento/Store/Test/Mftf/Data/StoreShippingMethodsData.xml index c9d0fb628b853..413540a8f4c12 100644 --- a/app/code/Magento/Store/Test/Mftf/Data/StoreShippingMethodsData.xml +++ b/app/code/Magento/Store/Test/Mftf/Data/StoreShippingMethodsData.xml @@ -7,30 +7,24 @@ --> <entities xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:DataGenerator/etc/dataProfileSchema.xsd"> - <entity name="FreeShippingMethodsSettingConfig" type="free_shipping_config_state"> + <entity name="FreeShippingMethodWithMinimumOrderAmount90" type="free_shipping_config_state"> <requiredEntity type="active">Active</requiredEntity> + <requiredEntity type="free_shipping_subtotal">Price</requiredEntity> </entity> <entity name="Active" type="active"> <data key="value">1</data> </entity> - - <entity name="MinimumOrderAmount90" type="free_shipping_config_state"> - <requiredEntity type="free_shipping_subtotal">Price</requiredEntity> - </entity> <entity name="Price" type="free_shipping_subtotal"> <data key="value">90</data> </entity> - <entity name="DefaultMinimumOrderAmount" type="free_shipping_config_state"> + <entity name="ResetFreeShippingMethodWithMinimumOrderAmount90" type="free_shipping_config_state"> <requiredEntity type="free_shipping_subtotal">DefaultPrice</requiredEntity> + <requiredEntity type="active">DefaultActive</requiredEntity> </entity> <entity name="DefaultPrice" type="free_shipping_subtotal"> <data key="value">0</data> </entity> - - <entity name="DefaultShippingMethodsConfig" type="free_shipping_config_state"> - <requiredEntity type="active">DefaultActive</requiredEntity> - </entity> <entity name="DefaultActive" type="active"> <requiredEntity type="active_inherit">DefaultFreeShipping</requiredEntity> </entity> From 2192af8a1d12fc3457c514a08af7e24c896fe634 Mon Sep 17 00:00:00 2001 From: Myroslav Dobra <dmaraptor@gmail.com> Date: Mon, 1 Apr 2019 16:40:30 +0300 Subject: [PATCH 12/14] MAGETWO-94426: Admin date wrong formatting for French locale --- .../ActionGroup/AdminAccountActionGroup.xml | 24 +++++++++++++++++++ .../Test/Mftf/Page/AdminSystemAccountPage.xml | 14 +++++++++++ .../Section/AdminSystemAccountSection.xml | 15 ++++++++++++ .../Test/Mftf/Data/LocaleOptionsData.xml | 24 +++++++++++++++++++ .../Metadata/locale_options_config-meta.xml | 21 ++++++++++++++++ ...frontCustomerAccountInformationSection.xml | 20 ++++++++++++++++ .../Magento/Catalog/_files/products_new.php | 4 ++-- 7 files changed, 120 insertions(+), 2 deletions(-) create mode 100644 app/code/Magento/Backend/Test/Mftf/ActionGroup/AdminAccountActionGroup.xml create mode 100644 app/code/Magento/Backend/Test/Mftf/Page/AdminSystemAccountPage.xml create mode 100644 app/code/Magento/Backend/Test/Mftf/Section/AdminSystemAccountSection.xml create mode 100644 app/code/Magento/Config/Test/Mftf/Data/LocaleOptionsData.xml create mode 100644 app/code/Magento/Config/Test/Mftf/Metadata/locale_options_config-meta.xml create mode 100644 app/code/Magento/Customer/Test/Mftf/Section/StorefrontCustomerAccountInformationSection.xml diff --git a/app/code/Magento/Backend/Test/Mftf/ActionGroup/AdminAccountActionGroup.xml b/app/code/Magento/Backend/Test/Mftf/ActionGroup/AdminAccountActionGroup.xml new file mode 100644 index 0000000000000..01e3450b78c85 --- /dev/null +++ b/app/code/Magento/Backend/Test/Mftf/ActionGroup/AdminAccountActionGroup.xml @@ -0,0 +1,24 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="AdminAccountSetInterfaceLocaleActionGroup"> + <arguments> + <argument name="localeName" type="string"/> + </arguments> + <!-- Navigate to admin System Account Page--> + <amOnPage url="{{AdminSystemAccountPage.url}}" stepKey="openAdminSystemAccountPage"/> + <!-- Change Admin locale to {{localeName}} --> + <selectOption selector="{{AdminSystemAccountSection.interfaceLocale}}" userInput="{{localeName}}" stepKey="setInterfaceLocale"/> + <fillField selector="{{AdminSystemAccountSection.currentPassword}}" userInput="{{_ENV.MAGENTO_ADMIN_PASSWORD}}" stepKey="fillCurrentPassword"/> + <click selector="{{AdminMainActionsSection.save}}" stepKey="clickSave"/> + <waitForElementVisible selector="{{AdminMessagesSection.success}}" stepKey="waitForSuccessMessage"/> + <see selector="{{AdminMessagesSection.success}}" userInput="You saved the account." stepKey="seeSuccessMessage"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Backend/Test/Mftf/Page/AdminSystemAccountPage.xml b/app/code/Magento/Backend/Test/Mftf/Page/AdminSystemAccountPage.xml new file mode 100644 index 0000000000000..2f04c2c11d288 --- /dev/null +++ b/app/code/Magento/Backend/Test/Mftf/Page/AdminSystemAccountPage.xml @@ -0,0 +1,14 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<pages xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/PageObject.xsd"> + <page name="AdminSystemAccountPage" url="admin/system_account/index/" area="admin" module="Magento_Backend"> + <section name="AdminSystemAccountSection"/> + </page> +</pages> diff --git a/app/code/Magento/Backend/Test/Mftf/Section/AdminSystemAccountSection.xml b/app/code/Magento/Backend/Test/Mftf/Section/AdminSystemAccountSection.xml new file mode 100644 index 0000000000000..b9570ce945943 --- /dev/null +++ b/app/code/Magento/Backend/Test/Mftf/Section/AdminSystemAccountSection.xml @@ -0,0 +1,15 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd"> + <section name="AdminSystemAccountSection"> + <element name="interfaceLocale" type="text" selector="#interface_locale"/> + <element name="currentPassword" type="text" selector="#current_password"/> + </section> +</sections> diff --git a/app/code/Magento/Config/Test/Mftf/Data/LocaleOptionsData.xml b/app/code/Magento/Config/Test/Mftf/Data/LocaleOptionsData.xml new file mode 100644 index 0000000000000..e998730d11ae7 --- /dev/null +++ b/app/code/Magento/Config/Test/Mftf/Data/LocaleOptionsData.xml @@ -0,0 +1,24 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<entities xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:DataGenerator/etc/dataProfileSchema.xsd"> + <entity name="SetLocaleOptions" type="locale_options_config"> + <requiredEntity type="code">LocaleOptionsFrance</requiredEntity> + </entity> + <entity name="LocaleOptionsFrance" type="code"> + <data key="value">fr_FR</data> + </entity> + + <entity name="DefaultLocaleOptions" type="locale_options_config"> + <requiredEntity type="code">LocaleOptionsUSA</requiredEntity> + </entity> + <entity name="LocaleOptionsUSA" type="code"> + <data key="value">en_US</data> + </entity> +</entities> diff --git a/app/code/Magento/Config/Test/Mftf/Metadata/locale_options_config-meta.xml b/app/code/Magento/Config/Test/Mftf/Metadata/locale_options_config-meta.xml new file mode 100644 index 0000000000000..6398d51cda916 --- /dev/null +++ b/app/code/Magento/Config/Test/Mftf/Metadata/locale_options_config-meta.xml @@ -0,0 +1,21 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> +<operations xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:DataGenerator/etc/dataOperation.xsd"> + <operation name="GeneralLocaleOptionsConfig" dataType="locale_options_config" type="create" auth="adminFormKey" url="/admin/system_config/save/section/general/" method="POST" successRegex="/messages-message-success/"> + <object key="groups" dataType="locale_options_config"> + <object key="locale" dataType="locale_options_config"> + <object key="fields" dataType="locale_options_config"> + <object key="code" dataType="code"> + <field key="value">string</field> + </object> + </object> + </object> + </object> + </operation> +</operations> diff --git a/app/code/Magento/Customer/Test/Mftf/Section/StorefrontCustomerAccountInformationSection.xml b/app/code/Magento/Customer/Test/Mftf/Section/StorefrontCustomerAccountInformationSection.xml new file mode 100644 index 0000000000000..361d245676576 --- /dev/null +++ b/app/code/Magento/Customer/Test/Mftf/Section/StorefrontCustomerAccountInformationSection.xml @@ -0,0 +1,20 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd"> + <section name="StorefrontCustomerAccountInformationSection"> + <element name="title" type="text" selector=".page-title span"/> + <element name="firstName" type="input" selector="#firstname"/> + <element name="lastName" type="input" selector="#lastname"/> + <element name="changeEmail" type="checkbox" selector="#change_email"/> + <element name="changePassword" type="checkbox" selector="#change_password"/> + <element name="customAttributeFiled" type="input" selector="#{{attribute_code}}" parameterized="true"/> + <element name="saveButton" type="button" selector="#form-validate .action.save.primary"/> + </section> +</sections> diff --git a/dev/tests/integration/testsuite/Magento/Catalog/_files/products_new.php b/dev/tests/integration/testsuite/Magento/Catalog/_files/products_new.php index 15e274541bac4..a5ca4573d98b0 100644 --- a/dev/tests/integration/testsuite/Magento/Catalog/_files/products_new.php +++ b/dev/tests/integration/testsuite/Magento/Catalog/_files/products_new.php @@ -15,8 +15,8 @@ ->setStatus(\Magento\Catalog\Model\Product\Attribute\Source\Status::STATUS_ENABLED) ->setWebsiteIds([1]) ->setStockData(['qty' => 100, 'is_in_stock' => 1]) - ->setNewsFromDate(date('Y-m-d', strtotime('-2 day'))) - ->setNewsToDate(date('Y-m-d', strtotime('+2 day'))) + ->setNewsFromDate(date('Y-m-d H:i:s', strtotime('-2 day'))) + ->setNewsToDate(date('Y-m-d H:i:s', strtotime('+2 day'))) ->setDescription('description') ->setShortDescription('short desc') ->save(); From 2a9b75f103b12840803482c7d1594b47c90ca432 Mon Sep 17 00:00:00 2001 From: Myroslav Dobra <dmaraptor@gmail.com> Date: Tue, 2 Apr 2019 13:53:22 +0300 Subject: [PATCH 13/14] MAGETWO-94426: Admin date wrong formatting for French locale --- .../StorefrontCustomerAccountActionGroup.xml | 6 ++++++ .../StorefrontCustomerAccountInformationPage.xml | 15 +++++++++++++++ ...torefrontCustomerAccountInformationSection.xml | 2 +- 3 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 app/code/Magento/Customer/Test/Mftf/Page/StorefrontCustomerAccountInformationPage.xml diff --git a/app/code/Magento/Customer/Test/Mftf/ActionGroup/StorefrontCustomerAccountActionGroup.xml b/app/code/Magento/Customer/Test/Mftf/ActionGroup/StorefrontCustomerAccountActionGroup.xml index 50a238323e331..aa764e5f51de1 100644 --- a/app/code/Magento/Customer/Test/Mftf/ActionGroup/StorefrontCustomerAccountActionGroup.xml +++ b/app/code/Magento/Customer/Test/Mftf/ActionGroup/StorefrontCustomerAccountActionGroup.xml @@ -17,4 +17,10 @@ <waitForPageLoad stepKey="waitForPageLoad"/> <see selector="{{StorefrontHeaderSection.mainTitle}}" userInput="{{tabName}}" stepKey="checkTabTitle"/> </actionGroup> + + <!--Go to Storefront > Account Information--> + <actionGroup name="StorefrontStartCustomerAccountInformationEdit"> + <amOnPage url="{{StorefrontCustomerAccountInformationPage.url}}" stepKey="goToAccountInformationEditPage"/> + <see selector="{{StorefrontCustomerAccountInformationSection.title}}" userInput="Edit Account Information" stepKey="seeEditAccountInformationPageTitle"/> + </actionGroup> </actionGroups> diff --git a/app/code/Magento/Customer/Test/Mftf/Page/StorefrontCustomerAccountInformationPage.xml b/app/code/Magento/Customer/Test/Mftf/Page/StorefrontCustomerAccountInformationPage.xml new file mode 100644 index 0000000000000..80caea5a1f541 --- /dev/null +++ b/app/code/Magento/Customer/Test/Mftf/Page/StorefrontCustomerAccountInformationPage.xml @@ -0,0 +1,15 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<pages xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/PageObject.xsd"> + <page name="StorefrontCustomerAccountInformationPage" url="/customer/account/edit" area="storefront" module="Magento_Customer"> + <section name="StorefrontCustomerSidebarSection"/> + <section name="StorefrontCustomerAccountInformationSection" /> + </page> +</pages> diff --git a/app/code/Magento/Customer/Test/Mftf/Section/StorefrontCustomerAccountInformationSection.xml b/app/code/Magento/Customer/Test/Mftf/Section/StorefrontCustomerAccountInformationSection.xml index 361d245676576..f6706d0e16ab3 100644 --- a/app/code/Magento/Customer/Test/Mftf/Section/StorefrontCustomerAccountInformationSection.xml +++ b/app/code/Magento/Customer/Test/Mftf/Section/StorefrontCustomerAccountInformationSection.xml @@ -15,6 +15,6 @@ <element name="changeEmail" type="checkbox" selector="#change_email"/> <element name="changePassword" type="checkbox" selector="#change_password"/> <element name="customAttributeFiled" type="input" selector="#{{attribute_code}}" parameterized="true"/> - <element name="saveButton" type="button" selector="#form-validate .action.save.primary"/> + <element name="saveButton" type="button" selector="#form-validate .action.save.primary" timeout="30"/> </section> </sections> From 34d71f0f0aba7f0e7ac2d08f814483dbc4253599 Mon Sep 17 00:00:00 2001 From: Myroslav Dobra <dmaraptor@gmail.com> Date: Mon, 8 Apr 2019 10:20:49 +0300 Subject: [PATCH 14/14] MC-15360: Improve checkout through BrainTree(Paypal) Fixing EngCom mess --- app/code/Magento/Quote/Model/QuoteManagement.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/Quote/Model/QuoteManagement.php b/app/code/Magento/Quote/Model/QuoteManagement.php index 1ebf637706dd3..c3355a0c45e0b 100644 --- a/app/code/Magento/Quote/Model/QuoteManagement.php +++ b/app/code/Magento/Quote/Model/QuoteManagement.php @@ -609,7 +609,7 @@ private function rollbackAddresses( QuoteEntity $quote, \Magento\Sales\Api\Data\OrderInterface $order, \Exception $e - ): void { + ) { try { if (!empty($this->addressesToSync)) { foreach ($this->addressesToSync as $addressId) {