Skip to content

Commit

Permalink
Merge pull request #4011 from magento-tsg/2.2-develop-pr88
Browse files Browse the repository at this point in the history
[TSG] Backporting for 2.2 (pr88) (2.2-develop)
  • Loading branch information
xmav authored Apr 9, 2019
2 parents 9d4f9a0 + cf67930 commit 33f35ce
Show file tree
Hide file tree
Showing 33 changed files with 594 additions and 82 deletions.
Original file line number Diff line number Diff line change
@@ -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>
14 changes: 14 additions & 0 deletions app/code/Magento/Backend/Test/Mftf/Page/AdminSystemAccountPage.xml
Original file line number Diff line number Diff line change
@@ -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>
Original file line number Diff line number Diff line change
@@ -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>
Original file line number Diff line number Diff line change
@@ -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>
14 changes: 14 additions & 0 deletions app/code/Magento/Braintree/Test/Mftf/Data/BraintreeData.xml
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,13 @@
<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>
Expand Down Expand Up @@ -106,6 +113,13 @@
<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>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
Original file line number Diff line number Diff line change
@@ -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="StorefrontPaypalReviewOrderPage" url="/braintree/paypal/review" area="storefront" module="Magento_Braintree">
<section name="StorefrontPaypalReviewOrderShippingSection"/>
<section name="StorefrontPaypalReviewOrderItemsSection"/>
</page>
</pages>
Original file line number Diff line number Diff line change
@@ -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>
Original file line number Diff line number Diff line change
@@ -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="StorefrontPaypalReviewOrderItemsSection">
<element name="placeOrder" type="button" selector="#review-button" timeout="30"/>
<element name="orderSummaryTotal" type="text" selector="tr.grand.totals span.price"/>
</section>
</sections>
Original file line number Diff line number Diff line change
@@ -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="StorefrontPaypalReviewOrderShippingSection">
<element name="selectShippingMethodByName" type="select" selector="//select[@id='shipping-method']//option[contains(text(),'{{shippingMethod}}')]" parameterized="true"/>
</section>
</sections>
4 changes: 4 additions & 0 deletions app/code/Magento/Catalog/Test/Mftf/Data/ProductData.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,4 +106,26 @@
<click selector="{{CheckoutPaymentSection.placeOrder}}" stepKey="clickPlaceOrder"/>
<see selector="{{CheckoutSuccessMainSection.successTitle}}" userInput="Thank you for your purchase!" stepKey="waitForLoadSuccessPage"/>
</actionGroup>

<actionGroup name="CheckoutSelectShippingMethodActionGroup">
<arguments>
<!-- First available shipping method will be selected if value is not passed for shippingMethod -->
<argument name="shippingMethod" defaultValue="" type="string"/>
</arguments>
<conditionalClick selector="{{CheckoutShippingMethodsSection.checkShippingMethodByName(shippingMethod)}}" dependentSelector="{{CheckoutShippingMethodsSection.checkShippingMethodByName(shippingMethod)}}" visible="true" stepKey="selectShippingMethod"/>
<waitForLoadingMaskToDisappear stepKey="waitForNextButton"/>
<click selector="{{CheckoutShippingMethodsSection.next}}" stepKey="clickNext"/>
<waitForPageLoad stepKey="waitForPaymentMethod"/>
<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>
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Original file line number Diff line number Diff line change
Expand Up @@ -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"/>
Expand Down
24 changes: 24 additions & 0 deletions app/code/Magento/Config/Test/Mftf/Data/LocaleOptionsData.xml
Original file line number Diff line number Diff line change
@@ -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>
Original file line number Diff line number Diff line change
@@ -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>
7 changes: 7 additions & 0 deletions app/code/Magento/ConfigurableProduct/etc/di.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Original file line number Diff line number Diff line change
@@ -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>
Original file line number Diff line number Diff line change
@@ -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" timeout="30"/>
</section>
</sections>
Loading

0 comments on commit 33f35ce

Please sign in to comment.