Skip to content

Commit

Permalink
Merge pull request magento#96 from magento-pangolin/MC-4457
Browse files Browse the repository at this point in the history
MC-4457
  • Loading branch information
soumyau authored Apr 30, 2019
2 parents 7a38191 + 9909ce0 commit 90e46d4
Show file tree
Hide file tree
Showing 24 changed files with 961 additions and 7 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?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="CustomerCheckoutFillNewShippingAddressActionGroup">
<arguments>
<argument name="address" type="entity"/>
</arguments>
<selectOption selector="{{CheckoutShippingSection.country}}" userInput="{{address.country}}" stepKey="selectCounty"/>
<fillField selector="{{CheckoutShippingSection.street}}" userInput="{{address.street}}" stepKey="fillStreet"/>
<fillField selector="{{CheckoutShippingSection.city}}" userInput="{{address.city}}" stepKey="fillCity"/>
<selectOption selector="{{CheckoutShippingSection.region}}" userInput="{{address.state}}" stepKey="selectRegion"/>
<fillField selector="{{CheckoutShippingSection.postcode}}" userInput="{{address.postcode}}" stepKey="fillZipCode"/>
<fillField selector="{{CheckoutShippingSection.telephone}}" userInput="{{address.telephone}}" stepKey="fillPhone"/>
<fillField selector="{{CheckoutShippingSection.company}}" userInput="{{address.company}}" stepKey="fillCompany"/>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?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="GuestCheckoutFillNewShippingAddressActionGroup">
<arguments>
<argument name="customer" type="entity"/>
<argument name="address" type="entity"/>
</arguments>
<fillField selector="{{CheckoutShippingSection.email}}" userInput="{{customer.email}}" stepKey="fillEmailField"/>
<fillField selector="{{CheckoutShippingSection.firstName}}" userInput="{{customer.firstName}}" stepKey="fillFirstName"/>
<fillField selector="{{CheckoutShippingSection.lastName}}" userInput="{{customer.lastName}}" stepKey="fillLastName"/>
<fillField selector="{{CheckoutShippingSection.street}}" userInput="{{address.street}}" stepKey="fillStreet"/>
<fillField selector="{{CheckoutShippingSection.city}}" userInput="{{address.city}}" stepKey="fillCity"/>
<selectOption selector="{{CheckoutShippingSection.region}}" userInput="{{address.state}}" stepKey="selectRegion"/>
<fillField selector="{{CheckoutShippingSection.postcode}}" userInput="{{address.postcode}}" stepKey="fillZipCode"/>
<fillField selector="{{CheckoutShippingSection.telephone}}" userInput="{{address.telephone}}" stepKey="fillPhone"/>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?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="LoginAsCustomerOnCheckoutPageActionGroup">
<arguments>
<argument name="customer" type="entity"/>
</arguments>
<waitForPageLoad stepKey="waitForCheckoutShippingSectionToLoad"/>
<fillField selector="{{CheckoutShippingSection.email}}" userInput="{{customer.email}}" stepKey="fillEmailField"/>
<waitForLoadingMaskToDisappear stepKey="waitForLoadingMaskToDisappear"/>
<waitForElementVisible selector="{{CheckoutShippingSection.password}}" stepKey="waitForElementVisible"/>
<fillField selector="{{CheckoutShippingSection.password}}" userInput="{{customer.password}}" stepKey="fillPasswordField"/>
<waitForLoadingMaskToDisappear stepKey="waitForLoadingMaskToDisappear2"/>
<doubleClick selector="{{CheckoutShippingSection.loginButton}}" stepKey="clickLoginBtn"/>
<waitForLoadingMaskToDisappear stepKey="waitForLoadingMaskToDisappear3"/>
<waitForPageLoad stepKey="waitForLogin"/>
</actionGroup>
</actionGroups>
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.
*/
-->

<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
<actionGroup name="LoginAsCustomerUsingSignInLinkActionGroup">
<arguments>
<argument name="customer" type="entity"/>
</arguments>
<click selector="{{StorefrontCustomerSignInLinkSection.signInLink}}" stepKey="clickOnCustomizeAndAddToCartButton"/>
<fillField selector="{{StorefrontCustomerSignInLinkSection.email}}" userInput="{{customer.email}}" stepKey="fillEmail"/>
<fillField selector="{{StorefrontCustomerSignInLinkSection.password}}" userInput="{{customer.password}}" stepKey="fillPassword"/>
<click selector="{{StorefrontCustomerSignInLinkSection.signInBtn}}" stepKey="clickSignInBtn"/>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,14 @@
<element name="notAvailablePaymentSolutions" type="text" selector="#checkout-payment-method-load>div>div>div.payment-method._active>div.payment-method-title.field.choice"/>
<element name="billingNewAddressForm" type="text" selector="[data-form='billing-new-address']"/>
<element name="billingAddressNotSameCheckbox" type="checkbox" selector="#billing-address-same-as-shipping-checkmo"/>
<element name="editAddress" type="button" selector="button.action.action-edit-address"/>
<element name="placeOrderDisabled" type="button" selector="#checkout-payment-method-load button.disabled"/>
<element name="update" type="button" selector=".payment-method-billing-address .action.action-update"/>
<element name="guestFirstName" type="input" selector=".billing-address-form input[name*='firstname']"/>
<element name="guestLastName" type="input" selector=".billing-address-form input[name*='lastname']"/>
<element name="guestStreet" type="input" selector=".billing-address-form input[name*='street[0]']"/>
<element name="guestCity" type="input" selector=".billing-address-form input[name*='city']"/>
<element name="guestCountry" type="select" selector=".billing-address-form select[name*='country_id']"/>
<element name="guestRegion" type="select" selector=".billing-address-form select[name*='region_id']"/>
<element name="guestPostcode" type="input" selector=".billing-address-form input[name*='postcode']"/>
<element name="guestTelephone" type="input" selector=".billing-address-form input[name*='telephone']"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@
<element name="email" type="input" selector="#checkout-customer-email"/>
<element name="firstName" type="input" selector="input[name=firstname]"/>
<element name="lastName" type="input" selector="input[name=lastname]"/>
<element name="company" type="input" selector="input[name=company]"/>
<element name="street" type="input" selector="input[name='street[0]']"/>
<element name="street2" type="input" selector="input[name='street[1]']"/>
<element name="city" type="input" selector="input[name=city]"/>
<element name="region" type="select" selector="select[name=region_id]"/>
<element name="regionInput" type="input" selector="input[name=region]"/>
<element name="postcode" type="input" selector="input[name=postcode]"/>
<element name="country" type="select" selector="select[name=country_id]"/>
<element name="company" type="input" selector="input[name=company]"/>
<element name="telephone" type="input" selector="input[name=telephone]"/>
<element name="next" type="button" selector="button.button.action.continue.primary" timeout="30"/>
<element name="firstShippingMethod" type="radio" selector=".row:nth-of-type(1) .col-method .radio"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
<element name="shippingMethodRow" type="text" selector=".form.methods-shipping table tbody tr"/>
<element name="checkShippingMethodByName" type="radio" selector="//div[@id='checkout-shipping-method-load']//td[contains(., '{{var1}}')]/..//input" parameterized="true"/>
<element name="shippingMethodFlatRate" type="radio" selector="#checkout-shipping-method-load input[value='flatrate_flatrate']"/>
<element name="shippingMethodFreeShipping" type="radio" selector="#checkout-shipping-method-load input[value='freeshipping_freeshipping']"/>
<element name="shippingMethodRowByName" type="text" selector="//div[@id='checkout-shipping-method-load']//td[contains(., '{{var1}}')]/.." parameterized="true"/>
<element name="shipHereButton" type="button" selector="//div/following-sibling::div/button[contains(@class, 'action-select-shipping-item')]"/>
<element name="shippingMethodLoader" type="button" selector="//div[contains(@class, 'checkout-shipping-method')]/following-sibling::div[contains(@class, 'loading-mask')]"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
<element name="editAddressButton" type="button" selector=".action-edit-address" timeout="30"/>
<element name="addressDropdown" type="select" selector="[name=billing_address_id]"/>
<element name="newAddressButton" type="button" selector=".action-show-popup" timeout="30"/>
<element name="email" type="input" selector="#checkout-customer-email"/>
<element name="email" type="input" selector="input[id*=customer-email]"/>
<element name="password" type="input" selector="#customer-password"/>
<element name="firstName" type="input" selector="input[name=firstname]"/>
<element name="lastName" type="input" selector="input[name=lastname]"/>
<element name="company" type="input" selector="input[name=company]"/>
Expand All @@ -36,5 +37,7 @@
<element name="stateInput" type="input" selector="input[name=region]"/>
<element name="regionOptions" type="select" selector="select[name=region_id] option"/>
<element name="editActiveAddress" type="button" selector="//div[@class='shipping-address-item selected-item']//span[text()='Edit']" timeout="30"/>
<element name="loginButton" type="button" selector=".action.login" timeout="30"/>
<element name="shipHereButton" type="button" selector="//div[text()='{{street}}']/button[@class='action action-select-shipping-item']" parameterized="true" timeout="30"/>
</section>
</sections>
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->

<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
<test name="OnePageCheckoutAsCustomerUsingDefaultAddressTest">
<annotations>
<features value="OnePageCheckout"/>
<stories value="OnePageCheckout within Offline Payment Methods"/>
<title value="OnePageCheckout as customer using default address test"/>
<description value="Checkout as customer using default address"/>
<severity value="CRITICAL"/>
<testCaseId value="MC-14741"/>
<group value="checkout"/>
<group value="mtf_migrated"/>
</annotations>
<before>
<!-- Create Simple Product -->
<createData entity="SimpleProduct2" stepKey="createSimpleProduct">
<field key="price">560</field>
</createData>

<!-- Create customer -->
<createData entity="Simple_US_Customer_Multiple_Addresses" stepKey="createCustomer"/>
</before>
<after>
<!-- Admin log out -->
<actionGroup ref="logout" stepKey="logout"/>

<!-- Customer log out -->
<actionGroup ref="StorefrontCustomerLogoutActionGroup" stepKey="customerLogout"/>

<!-- Delete created product -->
<deleteData createDataKey="createSimpleProduct" stepKey="deleteSimpleProduct"/>

<!-- Delete customer -->
<deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/>
</after>

<!-- Add Simple Product to cart -->
<amOnPage url="{{StorefrontProductPage.url($$createSimpleProduct.custom_attributes[url_key]$$)}}" stepKey="navigateToSimpleProductPage"/>
<waitForPageLoad stepKey="waitForSimpleProductPageLoad"/>
<actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addToCartFromStorefrontProductPage">
<argument name="productName" value="$$createSimpleProduct.name$$"/>
</actionGroup>

<!-- Go to shopping cart -->
<actionGroup ref="clickViewAndEditCartFromMiniCart" stepKey="goToShoppingCartFromMinicart"/>
<actionGroup ref="FillShippingZipForm" stepKey="fillShippingZipForm">
<argument name="address" value="US_Address_CA"/>
</actionGroup>
<click selector="{{CheckoutCartSummarySection.proceedToCheckout}}" stepKey="clickProceedToCheckout"/>
<waitForPageLoad stepKey="waitForProceedToCheckout"/>


<!-- Login as customer on checkout page -->
<actionGroup ref="LoginAsCustomerOnCheckoutPageActionGroup" stepKey="customerLogin">
<argument name="customer" value="$createCustomer$"/>
</actionGroup>

<!-- Fill customer address data -->
<waitForElementVisible selector="{{CheckoutShippingSection.shipHereButton(UK_Not_Default_Address.street[0])}}" stepKey="waitForShipHereVisible"/>
<!-- Change address -->
<click selector="{{CheckoutShippingSection.shipHereButton(UK_Not_Default_Address.street[0])}}" stepKey="clickShipHere"/>

<!-- Click next button to open payment section -->
<click selector="{{CheckoutShippingGuestInfoSection.next}}" stepKey="clickNext"/>
<waitForPageLoad stepKey="waitForShipmentPageLoad"/>

<!-- Select payment solution -->
<checkOption selector="{{CheckoutPaymentSection.billingAddressNotSameCheckbox}}" stepKey="selectPaymentSolution" />

<!-- Check order summary in checkout -->
<waitForElement selector="{{CheckoutPaymentSection.paymentSectionTitle}}" stepKey="waitForPaymentSectionLoaded"/>
<click selector="{{CheckoutPaymentSection.placeOrder}}" stepKey="clickPlaceOrderButton"/>
<seeElement selector="{{CheckoutSuccessMainSection.success}}" stepKey="orderIsSuccessfullyPlaced"/>
<grabTextFrom selector="{{CheckoutSuccessMainSection.orderNumber22}}" stepKey="grabOrderNumber"/>

<!-- Login as admin -->
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/>

<!-- Open created order in backend -->
<amOnPage url="{{AdminOrdersPage.url}}" stepKey="goToOrders"/>
<waitForPageLoad stepKey="waitForOrdersPageLoad"/>
<actionGroup ref="OpenOrderById" stepKey="filterOrderGridById">
<argument name="orderId" value="$grabOrderNumber"/>
</actionGroup>

<!-- Assert order total -->
<scrollTo selector="{{AdminOrderTotalSection.grandTotal}}" stepKey="scrollToOrderTotalSection"/>
<see selector="{{AdminOrderTotalSection.grandTotal}}" userInput="$565.00" stepKey="checkOrderTotalInBackend"/>

<!-- Assert order addresses -->
<see selector="{{AdminShipmentAddressInformationSection.billingAddress}}" userInput="{{UK_Not_Default_Address.street[0]}}" stepKey="seeBillingAddressStreet"/>
<see selector="{{AdminShipmentAddressInformationSection.billingAddress}}" userInput="{{UK_Not_Default_Address.city}}" stepKey="seeBillingAddressCity"/>
<see selector="{{AdminShipmentAddressInformationSection.billingAddress}}" userInput="{{UK_Not_Default_Address.postcode}}" stepKey="seeBillingAddressPostcode"/>
<see selector="{{AdminShipmentAddressInformationSection.shippingAddress}}" userInput="{{UK_Not_Default_Address.street[0]}}" stepKey="seeShippingAddressStreet"/>
<see selector="{{AdminShipmentAddressInformationSection.shippingAddress}}" userInput="{{UK_Not_Default_Address.city}}" stepKey="seeShippingAddressCity"/>
<see selector="{{AdminShipmentAddressInformationSection.shippingAddress}}" userInput="{{UK_Not_Default_Address.postcode}}" stepKey="seeShippingAddressPostcode"/>
</test>
</tests>
Loading

0 comments on commit 90e46d4

Please sign in to comment.