From 139a265bf7364c2e9b110d83f64a08f8b49949b8 Mon Sep 17 00:00:00 2001 From: Maria Kovdrysh Date: Sun, 16 Jun 2019 12:23:12 -0500 Subject: [PATCH 1/2] MC-6436: Configuring Instant Purchase functionality --- .../Test/Mftf/Data/BraintreeData.xml | 4 + ...tStorefrontElementInvisibleActionGroup.xml | 17 ++ ...guringInstantPurchaseFunctionalityTest.xml | 252 ++++++++++++++++++ ...StorefrontCustomerSavedCardActionGroup.xml | 18 ++ ...ontStoredPaymentMethodsPageActionGroup.xml | 14 + ...efrontCustomerStoredPaymentMethodsPage.xml | 14 + ...ontCustomerStoredPaymentMethodsSection.xml | 15 ++ ...geInstantPurchaseButtonTextActionGroup.xml | 21 ++ ...ChangeInstantPurchaseStatusActionGroup.xml | 21 ++ ...enInstantPurchaseConfigPageActionGroup.xml | 14 + .../AdminSystemConfigInstantPurchasePage.xml | 13 + .../AdminInstantPurchaseConfigSection.xml | 18 ++ .../StorefrontInstantPurchasePopupSection.xml | 15 ++ .../StorefrontInstantPurchaseSection.xml | 15 ++ 14 files changed, 451 insertions(+) create mode 100644 app/code/Magento/Checkout/Test/Mftf/ActionGroup/AssertStorefrontElementInvisibleActionGroup.xml create mode 100644 app/code/Magento/Checkout/Test/Mftf/Test/ConfiguringInstantPurchaseFunctionalityTest.xml create mode 100644 app/code/Magento/Customer/Test/Mftf/ActionGroup/AssertStorefrontCustomerSavedCardActionGroup.xml create mode 100644 app/code/Magento/Customer/Test/Mftf/ActionGroup/OpenStorefrontStoredPaymentMethodsPageActionGroup.xml create mode 100644 app/code/Magento/Customer/Test/Mftf/Page/StorefrontCustomerStoredPaymentMethodsPage.xml create mode 100644 app/code/Magento/Customer/Test/Mftf/Section/StorefrontCustomerStoredPaymentMethodsSection.xml create mode 100644 app/code/Magento/InstantPurchase/Test/Mftf/ActionGroup/AdminChangeInstantPurchaseButtonTextActionGroup.xml create mode 100644 app/code/Magento/InstantPurchase/Test/Mftf/ActionGroup/AdminChangeInstantPurchaseStatusActionGroup.xml create mode 100644 app/code/Magento/InstantPurchase/Test/Mftf/ActionGroup/AdminOpenInstantPurchaseConfigPageActionGroup.xml create mode 100644 app/code/Magento/InstantPurchase/Test/Mftf/Page/AdminSystemConfigInstantPurchasePage.xml create mode 100644 app/code/Magento/InstantPurchase/Test/Mftf/Section/AdminInstantPurchaseConfigSection.xml create mode 100644 app/code/Magento/InstantPurchase/Test/Mftf/Section/StorefrontInstantPurchasePopupSection.xml create mode 100644 app/code/Magento/InstantPurchase/Test/Mftf/Section/StorefrontInstantPurchaseSection.xml diff --git a/app/code/Magento/Braintree/Test/Mftf/Data/BraintreeData.xml b/app/code/Magento/Braintree/Test/Mftf/Data/BraintreeData.xml index f00e3fa286b0..6d00df535704 100644 --- a/app/code/Magento/Braintree/Test/Mftf/Data/BraintreeData.xml +++ b/app/code/Magento/Braintree/Test/Mftf/Data/BraintreeData.xml @@ -138,6 +138,10 @@ 20 113 + + 5100 + 12/2020 + Credit Card (Braintree) diff --git a/app/code/Magento/Checkout/Test/Mftf/ActionGroup/AssertStorefrontElementInvisibleActionGroup.xml b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/AssertStorefrontElementInvisibleActionGroup.xml new file mode 100644 index 000000000000..69fe27ff0746 --- /dev/null +++ b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/AssertStorefrontElementInvisibleActionGroup.xml @@ -0,0 +1,17 @@ + + + + + + + + + + + diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/ConfiguringInstantPurchaseFunctionalityTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/ConfiguringInstantPurchaseFunctionalityTest.xml new file mode 100644 index 000000000000..6d7ecc2ef990 --- /dev/null +++ b/app/code/Magento/Checkout/Test/Mftf/Test/ConfiguringInstantPurchaseFunctionalityTest.xml @@ -0,0 +1,252 @@ + + + + + + + + + + <description value="Configuring instant purchase"/> + <severity value="CRITICAL"/> + <testCaseId value="MC-6436"/> + <group value="checkout"/> + </annotations> + <before> + <!-- Configure Braintree Vault-enabled payment method --> + <createData entity="BraintreeConfig" stepKey="braintreeConfigurationData"/> + <createData entity="CustomBraintreeConfigurationData" stepKey="enableBraintree"/> + + <!-- Create customer --> + <createData entity="Simple_US_Customer" stepKey="createCustomer"/> + + <!-- Create product --> + <createData entity="SimpleProduct2" stepKey="createProduct"/> + + <!-- Login as admin --> + <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + + <!-- Create store views --> + <actionGroup ref="AdminCreateStoreViewActionGroup" stepKey="createFirstStoreView"> + <argument name="customStore" value="storeViewData1"/> + </actionGroup> + <actionGroup ref="AdminCreateStoreViewActionGroup" stepKey="createSecondStoreView"> + <argument name="customStore" value="storeViewData2"/> + </actionGroup> + </before> + <after> + <!-- Set configs to default --> + <createData entity="DefaultBraintreeConfig" stepKey="defaultBraintreeConfig"/> + <createData entity="RollBackCustomBraintreeConfigurationData" stepKey="rollBackCustomBraintreeConfigurationData"/> + + <!-- Delete product --> + <deleteData createDataKey="createProduct" stepKey="deleteProduct"/> + + <!-- Delete customer --> + <deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/> + + <!-- Delete store views --> + <actionGroup ref="AdminDeleteStoreViewActionGroup" stepKey="deleteFirstStoreView"> + <argument name="customStore" value="storeViewData1"/> + </actionGroup> + <actionGroup ref="AdminDeleteStoreViewActionGroup" stepKey="deleteSecondStoreView"> + <argument name="customStore" value="storeViewData2"/> + </actionGroup> + + <!-- Admin logout --> + <actionGroup ref="logout" stepKey="adminLogout"/> + </after> + + <!-- Login to Frontend --> + <actionGroup ref="LoginToStorefrontActionGroup" stepKey="loginAsCustomer"> + <argument name="Customer" value="$$createCustomer$$"/> + </actionGroup> + + <!-- Add product to cart --> + <actionGroup ref="AddSimpleProductToCart" stepKey="addProductToCart"> + <argument name="product" value="$$createProduct$$"/> + </actionGroup> + <actionGroup ref="GoToCheckoutFromMinicartActionGroup" stepKey="goToCheckoutFromMinicart"/> + + <!-- Customer placed order with payment method save --> + <waitForElement selector="{{CheckoutShippingMethodsSection.next}}" stepKey="waitForNextButton"/> + <click selector="{{CheckoutShippingMethodsSection.next}}" stepKey="clickNext"/> + <waitForElement selector="{{CheckoutPaymentSection.paymentSectionTitle}}" stepKey="waitForPaymentSectionLoaded"/> + + <!-- Fill Braintree cart data --> + <click selector="{{BraintreeConfigurationPaymentSection.creditCart}}" stepKey="selectBraintreePaymentMethod"/> + <waitForPageLoad stepKey="waitForBraintreeFormLoad"/> + <scrollTo selector="{{BraintreeConfigurationPaymentSection.creditCart}}" stepKey="scrollToCreditCardSection"/> + <actionGroup ref="StorefrontFillCartDataActionGroup" stepKey="fillCartData"/> + <waitForPageLoad stepKey="waitForFillCartData"/> + + <!-- Place order --> + <click selector="{{BraintreeConfigurationPaymentSection.paymentMethodContainer}}{{CheckoutPaymentSection.placeOrder}}" stepKey="checkoutPlaceOrder"/> + <waitForPageLoad stepKey="waitForPageLoad"/> + <see selector="{{CheckoutSuccessMainSection.successTitle}}" userInput="Thank you for your purchase!" stepKey="waitForLoadSuccessPage"/> + + <!-- Go to Configuration > Sales --> + <actionGroup ref="AdminOpenInstantPurchaseConfigPageActionGroup" stepKey="openInstantPurchaseConfigPage"/> + + <!-- Enable Instant Purchase --> + <actionGroup ref="AdminChangeInstantPurchaseStatusActionGroup" stepKey="enableInstantPurchase"/> + + <!-- Switch to specific store view --> + <actionGroup ref="AdminSwitchStoreViewActionGroup" stepKey="switchToSpecificStoreView"> + <argument name="storeView" value="storeViewData1.name"/> + </actionGroup> + + <!-- Change button text on a single store view --> + <actionGroup ref="AdminChangeInstantPurchaseButtonTextActionGroup" stepKey="changeInstantPurchaseButtonText"> + <argument name="buttonText" value="Quick Buy"/> + </actionGroup> + + <!-- Verify changes on the front-end by opening a simple product as a logged in customer with saved card and address on given store view: + 1. Go to Storefront page --> + <actionGroup ref="StorefrontOpenHomePageActionGroup" stepKey="openStorefrontPage"/> + + <!-- 2. Switch store view --> + <actionGroup ref="StorefrontSwitchStoreViewActionGroup" stepKey="SwitchStoreView"> + <argument name="storeView" value="storeViewData1"/> + </actionGroup> + + <!-- 3. Assert customer is logged with saved card with address --> + <actionGroup ref="OpenStorefrontCustomerStoredPaymentMethodsPageActionGroup" stepKey="openStorefrontCustomerStoredPaymentMethodsPage"/> + <actionGroup ref="AssertStorefrontCustomerSavedCardActionGroup" stepKey="assertCustomerPaymentMethod"/> + <actionGroup ref="StorefrontCustomerGoToSidebarMenu" stepKey="goToAddressBook"> + <argument name="menu" value="Address Book"/> + </actionGroup> + <see selector="{{CheckoutOrderSummarySection.shippingAddress}}" userInput="{{US_Address_TX.street[0]}} {{US_Address_TX.city}}, {{US_Address_TX.state}}, {{US_Address_TX.postcode}}" stepKey="checkShippingAddress"/> + + <!-- Open product page --> + <actionGroup ref="StorefrontOpenProductPageActionGroup" stepKey="openProductPage"> + <argument name="productUrl" value="$$createProduct.custom_attributes[url_key]$$"/> + </actionGroup> + + <!-- Quick Buy button shows up. Clicking it opens review popup --> + <actionGroup ref="AssertStorefrontElementVisibleActionGroup" stepKey="seeQuickBuyButton"> + <argument name="selector" value="{{StorefrontInstantPurchaseSection.instantPurchaseButton}}"/> + <argument name="userInput" value="Quick Buy"/> + </actionGroup> + <click selector="{{StorefrontInstantPurchaseSection.instantPurchaseButton}}" stepKey="clickQuickBuyButton"/> + <waitForElementVisible selector="{{StorefrontInstantPurchasePopupSection.modalTitle}}" stepKey="waitForPopUpTitleVisible"/> + <see selector="{{StorefrontInstantPurchasePopupSection.modalTitle}}" userInput="Instant Purchase Confirmation" stepKey="seeReviewPopUp"/> + <click selector="{{StorefrontInstantPurchasePopupSection.cancel}}" stepKey="closeModalPopup"/> + <waitForPageLoad stepKey="waitForClosing"/> + + <!-- Verify changes on the front-end by opening a simple product as a logged in customer with saved card and address on a store view for which description was not changed + 1. New customer session should be started to verify changes --> + <actionGroup ref="StorefrontSignOutActionGroup" stepKey="customerLogout"/> + <actionGroup ref="LoginToStorefrontActionGroup" stepKey="loginCustomer"> + <argument name="Customer" value="$$createCustomer$$"/> + </actionGroup> + + <!-- 2. Switch store view which description was not changed --> + <actionGroup ref="StorefrontSwitchStoreViewActionGroup" stepKey="SwitchToSecondStoreView"> + <argument name="storeView" value="storeViewData2"/> + </actionGroup> + + <!-- 3. Assert customer is logged with saved card and address --> + <actionGroup ref="OpenStorefrontCustomerStoredPaymentMethodsPageActionGroup" stepKey="openStorefrontCustomerPaymentMethodsPage"/> + <actionGroup ref="AssertStorefrontCustomerSavedCardActionGroup" stepKey="assertPaymentMethod"/> + <actionGroup ref="StorefrontCustomerGoToSidebarMenu" stepKey="openAddressBook"> + <argument name="menu" value="Address Book"/> + </actionGroup> + <see selector="{{CheckoutOrderSummarySection.shippingAddress}}" userInput="{{US_Address_TX.street[0]}} {{US_Address_TX.city}}, {{US_Address_TX.state}}, {{US_Address_TX.postcode}}" stepKey="seeShippingAddress"/> + + <!-- Open product page --> + <actionGroup ref="StorefrontOpenProductPageActionGroup" stepKey="openCreatedProductPage"> + <argument name="productUrl" value="$$createProduct.custom_attributes[url_key]$$"/> + </actionGroup> + + <!-- Instant Purchase button shows up. Clicking it opens review popup. --> + <actionGroup ref="AssertStorefrontElementVisibleActionGroup" stepKey="seeInstantPurchaseButton"> + <argument name="selector" value="{{StorefrontInstantPurchaseSection.instantPurchaseButton}}"/> + <argument name="userInput" value="Instant Purchase"/> + </actionGroup> + <click selector="{{StorefrontInstantPurchaseSection.instantPurchaseButton}}" stepKey="clickInstantPurchaseButton"/> + <waitForElementVisible selector="{{StorefrontInstantPurchasePopupSection.modalTitle}}" stepKey="waitForPopUpVisible"/> + <see selector="{{StorefrontInstantPurchasePopupSection.modalTitle}}" userInput="Instant Purchase Confirmation" stepKey="seeReviewPopUpTitle"/> + <click selector="{{StorefrontInstantPurchasePopupSection.cancel}}" stepKey="closeModalPopUp"/> + <waitForPageLoad stepKey="waitForModalClosing"/> + + <actionGroup ref="StorefrontSignOutActionGroup" stepKey="createdCustomerLogout"/> + + <!-- Return to configuration and disable Instant Purchase in a specific store view --> + <actionGroup ref="AdminOpenInstantPurchaseConfigPageActionGroup" stepKey="openInstantPurchasePage"/> + <scrollToTopOfPage stepKey="scrollToTop"/> + <actionGroup ref="AdminSwitchStoreViewActionGroup" stepKey="switchToFirstSpecificStoreView"> + <argument name="storeView" value="storeViewData1.name"/> + </actionGroup> + <actionGroup ref="AdminChangeInstantPurchaseStatusActionGroup" stepKey="disableInstantPurchase"> + <argument name="status" value="0"/> + </actionGroup> + + <!-- Verify changes on the front-end by opening a simple product as a logged in customer with saved card and address in the specific store view + 1. New customer session should be started to verify changes --> + <actionGroup ref="LoginToStorefrontActionGroup" stepKey="loginAsCreatedCustomer"> + <argument name="Customer" value="$$createCustomer$$"/> + </actionGroup> + + <!-- 2. Switch store view --> + <actionGroup ref="StorefrontSwitchStoreViewActionGroup" stepKey="switchStoreView"> + <argument name="storeView" value="storeViewData1"/> + </actionGroup> + + <!-- 3. Assert customer is logged with saved card and address --> + <actionGroup ref="OpenStorefrontCustomerStoredPaymentMethodsPageActionGroup" stepKey="openCustomerPaymentMethodsPage"/> + <actionGroup ref="AssertStorefrontCustomerSavedCardActionGroup" stepKey="assertCartPaymentMethod"/> + <actionGroup ref="StorefrontCustomerGoToSidebarMenu" stepKey="goToAddressBookPage"> + <argument name="menu" value="Address Book"/> + </actionGroup> + <see selector="{{CheckoutOrderSummarySection.shippingAddress}}" userInput="{{US_Address_TX.street[0]}} {{US_Address_TX.city}}, {{US_Address_TX.state}}, {{US_Address_TX.postcode}}" stepKey="assertCustomerShippingAddress"/> + + <!-- Open product page --> + <actionGroup ref="StorefrontOpenProductPageActionGroup" stepKey="openProductIndexPage"> + <argument name="productUrl" value="$$createProduct.custom_attributes[url_key]$$"/> + </actionGroup> + + <!-- Quick Buy button is not visible --> + <actionGroup ref="AssertStorefrontElementInvisibleActionGroup" stepKey="dontSeeQuickBuyButton"> + <argument name="selector" value="{{StorefrontInstantPurchaseSection.instantPurchaseButton}}"/> + <argument name="userInput" value="Quick Buy"/> + </actionGroup> + + <!-- Verify changes on the front-end by opening a simple product as a logged in customer with saved card and address in the other store view + 1. New customer session should be started to verify changes --> + <actionGroup ref="StorefrontSignOutActionGroup" stepKey="logoutCustomer"/> + <actionGroup ref="LoginToStorefrontActionGroup" stepKey="customerLoginToStorefront"> + <argument name="Customer" value="$$createCustomer$$"/> + </actionGroup> + + <!-- 2. Switch store view --> + <actionGroup ref="StorefrontSwitchStoreViewActionGroup" stepKey="switchToSecondStoreView"> + <argument name="storeView" value="storeViewData2"/> + </actionGroup> + + <!-- 3. Assert customer is logged with saved card and address --> + <actionGroup ref="OpenStorefrontCustomerStoredPaymentMethodsPageActionGroup" stepKey="goToStorefrontCustomerPaymentMethodsPage"/> + <actionGroup ref="AssertStorefrontCustomerSavedCardActionGroup" stepKey="assertCardPaymentMethod"/> + <actionGroup ref="StorefrontCustomerGoToSidebarMenu" stepKey="openAddressBookPage"> + <argument name="menu" value="Address Book"/> + </actionGroup> + <see selector="{{CheckoutOrderSummarySection.shippingAddress}}" userInput="{{US_Address_TX.street[0]}} {{US_Address_TX.city}}, {{US_Address_TX.state}}, {{US_Address_TX.postcode}}" stepKey="seeCustomerShippingAddress"/> + + <!-- Open product page --> + <actionGroup ref="StorefrontOpenProductPageActionGroup" stepKey="goToProductPage"> + <argument name="productUrl" value="$$createProduct.custom_attributes[url_key]$$"/> + </actionGroup> + + <!-- Instant Purchase button is still visible --> + <actionGroup ref="AssertStorefrontElementVisibleActionGroup" stepKey="seeInstantPurchaseBtn"> + <argument name="selector" value="{{StorefrontInstantPurchaseSection.instantPurchaseButton}}"/> + <argument name="userInput" value="Instant Purchase"/> + </actionGroup> + </test> +</tests> diff --git a/app/code/Magento/Customer/Test/Mftf/ActionGroup/AssertStorefrontCustomerSavedCardActionGroup.xml b/app/code/Magento/Customer/Test/Mftf/ActionGroup/AssertStorefrontCustomerSavedCardActionGroup.xml new file mode 100644 index 000000000000..94cd759e5cef --- /dev/null +++ b/app/code/Magento/Customer/Test/Mftf/ActionGroup/AssertStorefrontCustomerSavedCardActionGroup.xml @@ -0,0 +1,18 @@ +<?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="AssertStorefrontCustomerSavedCardActionGroup"> + <arguments> + <argument name="card" type="entity" defaultValue="StoredPaymentMethods"/> + </arguments> + <see selector="{{StorefrontCustomerStoredPaymentMethodsSection.cardNumber}}" userInput="{{card.cardNumberEnding}}" stepKey="verifyCardNumber"/> + <see selector="{{StorefrontCustomerStoredPaymentMethodsSection.expirationDate}}" userInput="{{card.cardExpire}}" stepKey="verifyCardExpire"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Customer/Test/Mftf/ActionGroup/OpenStorefrontStoredPaymentMethodsPageActionGroup.xml b/app/code/Magento/Customer/Test/Mftf/ActionGroup/OpenStorefrontStoredPaymentMethodsPageActionGroup.xml new file mode 100644 index 000000000000..9975431e9fe6 --- /dev/null +++ b/app/code/Magento/Customer/Test/Mftf/ActionGroup/OpenStorefrontStoredPaymentMethodsPageActionGroup.xml @@ -0,0 +1,14 @@ +<?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="OpenStorefrontCustomerStoredPaymentMethodsPageActionGroup"> + <amOnPage url="{{StorefrontCustomerStoredPaymentMethodsPage.url}}" stepKey="goToCustomerStoredPaymentMethodsPage"/> + <waitForPageLoad stepKey="waitForCustomerStoredPaymentMethodsPageLoad"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Customer/Test/Mftf/Page/StorefrontCustomerStoredPaymentMethodsPage.xml b/app/code/Magento/Customer/Test/Mftf/Page/StorefrontCustomerStoredPaymentMethodsPage.xml new file mode 100644 index 000000000000..bec802689a6c --- /dev/null +++ b/app/code/Magento/Customer/Test/Mftf/Page/StorefrontCustomerStoredPaymentMethodsPage.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="StorefrontCustomerStoredPaymentMethodsPage" url="/vault/cards/listaction/" area="storefront" module="Magento_Customer"> + <section name="StorefrontCustomerStoredPaymentMethodsSection"/> + </page> +</pages> diff --git a/app/code/Magento/Customer/Test/Mftf/Section/StorefrontCustomerStoredPaymentMethodsSection.xml b/app/code/Magento/Customer/Test/Mftf/Section/StorefrontCustomerStoredPaymentMethodsSection.xml new file mode 100644 index 000000000000..d6b586e42f28 --- /dev/null +++ b/app/code/Magento/Customer/Test/Mftf/Section/StorefrontCustomerStoredPaymentMethodsSection.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="StorefrontCustomerStoredPaymentMethodsSection"> + <element name="cardNumber" type="text" selector="td.card-number"/> + <element name="expirationDate" type="text" selector="td.card-expire"/> + </section> +</sections> diff --git a/app/code/Magento/InstantPurchase/Test/Mftf/ActionGroup/AdminChangeInstantPurchaseButtonTextActionGroup.xml b/app/code/Magento/InstantPurchase/Test/Mftf/ActionGroup/AdminChangeInstantPurchaseButtonTextActionGroup.xml new file mode 100644 index 000000000000..b8dda76d8710 --- /dev/null +++ b/app/code/Magento/InstantPurchase/Test/Mftf/ActionGroup/AdminChangeInstantPurchaseButtonTextActionGroup.xml @@ -0,0 +1,21 @@ +<?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="AdminChangeInstantPurchaseButtonTextActionGroup"> + <arguments> + <argument name="buttonText" type="string" defaultValue="Instant Purchase"/> + </arguments> + <conditionalClick selector="{{AdminInstantPurchaseConfigSection.salesInstantPurchaseTab}}" dependentSelector="{{AdminInstantPurchaseConfigSection.salesInstantPurchaseButtonText}}" visible="false" stepKey="expandTab"/> + <click selector="{{AdminInstantPurchaseConfigSection.salesInstantPurchaseButtonTextUseWebsite}}" stepKey="clickUseWebsite"/> + <fillField selector="{{AdminInstantPurchaseConfigSection.salesInstantPurchaseButtonText}}" userInput="{{buttonText}}" stepKey="changeInstantPurchaseButtonText"/> + <click selector="{{AdminConfigSection.saveButton}}" stepKey="saveConfigs"/> + <waitForPageLoad stepKey="waitForPageLoad"/> + <see selector="{{AdminCategoryMessagesSection.SuccessMessage}}" userInput="You saved the configuration." stepKey="seeSuccessMessage"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/InstantPurchase/Test/Mftf/ActionGroup/AdminChangeInstantPurchaseStatusActionGroup.xml b/app/code/Magento/InstantPurchase/Test/Mftf/ActionGroup/AdminChangeInstantPurchaseStatusActionGroup.xml new file mode 100644 index 000000000000..ce13ddb46fbc --- /dev/null +++ b/app/code/Magento/InstantPurchase/Test/Mftf/ActionGroup/AdminChangeInstantPurchaseStatusActionGroup.xml @@ -0,0 +1,21 @@ +<?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="AdminChangeInstantPurchaseStatusActionGroup"> + <arguments> + <argument name="status" type="string" defaultValue="1"/> + </arguments> + <conditionalClick selector="{{AdminInstantPurchaseConfigSection.salesInstantPurchaseTab}}" dependentSelector="{{AdminInstantPurchaseConfigSection.salesInstantPurchaseActive}}" visible="false" stepKey="expandTab"/> + <uncheckOption selector="{{AdminInstantPurchaseConfigSection.salesInstantPurchaseActiveUseWebsite}}" stepKey="uncheckUseSystemValue"/> + <selectOption selector="{{AdminInstantPurchaseConfigSection.salesInstantPurchaseActive}}" userInput="{{status}}" stepKey="changeInstantPurchaseStatus"/> + <click selector="{{AdminConfigSection.saveButton}}" stepKey="saveConfigs"/> + <waitForPageLoad stepKey="waitForPageLoad"/> + <see selector="{{AdminCategoryMessagesSection.SuccessMessage}}" userInput="You saved the configuration." stepKey="seeSuccessMessage"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/InstantPurchase/Test/Mftf/ActionGroup/AdminOpenInstantPurchaseConfigPageActionGroup.xml b/app/code/Magento/InstantPurchase/Test/Mftf/ActionGroup/AdminOpenInstantPurchaseConfigPageActionGroup.xml new file mode 100644 index 000000000000..e25e5271dffd --- /dev/null +++ b/app/code/Magento/InstantPurchase/Test/Mftf/ActionGroup/AdminOpenInstantPurchaseConfigPageActionGroup.xml @@ -0,0 +1,14 @@ +<?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="AdminOpenInstantPurchaseConfigPageActionGroup"> + <amOnPage url="{{AdminSystemConfigInstantPurchasePage.url}}" stepKey="openInstantPurchaseConfigPage"/> + <waitForPageLoad stepKey="waitForInstantPurchasePageLoad"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/InstantPurchase/Test/Mftf/Page/AdminSystemConfigInstantPurchasePage.xml b/app/code/Magento/InstantPurchase/Test/Mftf/Page/AdminSystemConfigInstantPurchasePage.xml new file mode 100644 index 000000000000..669172c6c4bb --- /dev/null +++ b/app/code/Magento/InstantPurchase/Test/Mftf/Page/AdminSystemConfigInstantPurchasePage.xml @@ -0,0 +1,13 @@ +<?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="AdminSystemConfigInstantPurchasePage" url="admin/system_config/edit/section/sales/#sales_instant_purchase-head" area="admin" module="Magento_GiftWrapping"> + </page> +</pages> diff --git a/app/code/Magento/InstantPurchase/Test/Mftf/Section/AdminInstantPurchaseConfigSection.xml b/app/code/Magento/InstantPurchase/Test/Mftf/Section/AdminInstantPurchaseConfigSection.xml new file mode 100644 index 000000000000..5b1c191d228c --- /dev/null +++ b/app/code/Magento/InstantPurchase/Test/Mftf/Section/AdminInstantPurchaseConfigSection.xml @@ -0,0 +1,18 @@ +<?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="AdminInstantPurchaseConfigSection"> + <element name="salesInstantPurchaseTab" type="button" selector="#sales_instant_purchase-head"/> + <element name="salesInstantPurchaseActive" type="select" selector="#sales_instant_purchase_active"/> + <element name="salesInstantPurchaseActiveUseWebsite" type="select" selector="#sales_instant_purchase_active_inherit"/> + <element name="salesInstantPurchaseButtonText" type="text" selector="#sales_instant_purchase_button_text"/> + <element name="salesInstantPurchaseButtonTextUseWebsite" type="checkbox" selector="#sales_instant_purchase_button_text_inherit"/> + </section> +</sections> diff --git a/app/code/Magento/InstantPurchase/Test/Mftf/Section/StorefrontInstantPurchasePopupSection.xml b/app/code/Magento/InstantPurchase/Test/Mftf/Section/StorefrontInstantPurchasePopupSection.xml new file mode 100644 index 000000000000..8e93d049ea14 --- /dev/null +++ b/app/code/Magento/InstantPurchase/Test/Mftf/Section/StorefrontInstantPurchasePopupSection.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="StorefrontInstantPurchasePopupSection"> + <element name="modalTitle" type="text" selector=".modal-popup .modal-title"/> + <element name="cancel" type="button" selector=".modal-popup.confirm button.action-dismiss"/> + </section> +</sections> diff --git a/app/code/Magento/InstantPurchase/Test/Mftf/Section/StorefrontInstantPurchaseSection.xml b/app/code/Magento/InstantPurchase/Test/Mftf/Section/StorefrontInstantPurchaseSection.xml new file mode 100644 index 000000000000..1124fe0aa799 --- /dev/null +++ b/app/code/Magento/InstantPurchase/Test/Mftf/Section/StorefrontInstantPurchaseSection.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="StorefrontInstantPurchaseSection"> + <element name="instantPurchaseButton" type="button" selector="button.instant-purchase"/> + <element name="instantPurchaseButtonName" type="text" selector="button.instant-purchase span"/> + </section> +</sections> From 2fed193bbcc021f15d8340046f9aefba195bd4cf Mon Sep 17 00:00:00 2001 From: Maria Kovdrysh <kovdrysh@adobe.com> Date: Tue, 18 Jun 2019 15:49:28 -0500 Subject: [PATCH 2/2] MC-6436: Configuring Instant Purchase functionality Moved UI actions out of the before/after sections --- ...guringInstantPurchaseFunctionalityTest.xml | 32 +++++++++---------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/ConfiguringInstantPurchaseFunctionalityTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/ConfiguringInstantPurchaseFunctionalityTest.xml index 6d7ecc2ef990..ead992789198 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/ConfiguringInstantPurchaseFunctionalityTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/ConfiguringInstantPurchaseFunctionalityTest.xml @@ -31,14 +31,6 @@ <!-- Login as admin --> <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> - - <!-- Create store views --> - <actionGroup ref="AdminCreateStoreViewActionGroup" stepKey="createFirstStoreView"> - <argument name="customStore" value="storeViewData1"/> - </actionGroup> - <actionGroup ref="AdminCreateStoreViewActionGroup" stepKey="createSecondStoreView"> - <argument name="customStore" value="storeViewData2"/> - </actionGroup> </before> <after> <!-- Set configs to default --> @@ -51,18 +43,18 @@ <!-- Delete customer --> <deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/> - <!-- Delete store views --> - <actionGroup ref="AdminDeleteStoreViewActionGroup" stepKey="deleteFirstStoreView"> - <argument name="customStore" value="storeViewData1"/> - </actionGroup> - <actionGroup ref="AdminDeleteStoreViewActionGroup" stepKey="deleteSecondStoreView"> - <argument name="customStore" value="storeViewData2"/> - </actionGroup> - <!-- Admin logout --> <actionGroup ref="logout" stepKey="adminLogout"/> </after> + <!-- Create store views --> + <actionGroup ref="AdminCreateStoreViewActionGroup" stepKey="createFirstStoreView"> + <argument name="customStore" value="storeViewData1"/> + </actionGroup> + <actionGroup ref="AdminCreateStoreViewActionGroup" stepKey="createSecondStoreView"> + <argument name="customStore" value="storeViewData2"/> + </actionGroup> + <!-- Login to Frontend --> <actionGroup ref="LoginToStorefrontActionGroup" stepKey="loginAsCustomer"> <argument name="Customer" value="$$createCustomer$$"/> @@ -248,5 +240,13 @@ <argument name="selector" value="{{StorefrontInstantPurchaseSection.instantPurchaseButton}}"/> <argument name="userInput" value="Instant Purchase"/> </actionGroup> + + <!-- Delete store views --> + <actionGroup ref="AdminDeleteStoreViewActionGroup" stepKey="deleteFirstStoreView"> + <argument name="customStore" value="storeViewData1"/> + </actionGroup> + <actionGroup ref="AdminDeleteStoreViewActionGroup" stepKey="deleteSecondStoreView"> + <argument name="customStore" value="storeViewData2"/> + </actionGroup> </test> </tests>