Skip to content

Commit b157a48

Browse files
committed
ACP2E-1105: keep new lines on street added through checkout; added mftf
1 parent 78663f9 commit b157a48

File tree

6 files changed

+174
-0
lines changed

6 files changed

+174
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
9+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="GuestCheckoutFillingShippingWithMultipleStreetLinesSectionActionGroup">
12+
<annotations>
13+
<description>Fills in the provided Customer/Address (Including Region) details on the Storefront Checkout page under the 'Shipping Address' section. Selects the provided Shipping Method. Clicks on Next. Validates that the URL is present and correct.</description>
14+
</annotations>
15+
<arguments>
16+
<argument name="customerVar" defaultValue="CustomerEntityOne"/>
17+
<argument name="customerAddressVar" defaultValue="CustomerAddressSimple"/>
18+
<!--First available shipping method will be selected if value is not passed for shippingMethod-->
19+
<argument name="shippingMethod" defaultValue="" type="string"/>
20+
</arguments>
21+
22+
<waitForElementVisible selector="{{CheckoutShippingSection.email}}" stepKey="waitForEmailField"/>
23+
<fillField selector="{{CheckoutShippingSection.email}}" userInput="{{customerVar.email}}" stepKey="enterEmail"/>
24+
<fillField selector="{{CheckoutShippingSection.firstName}}" userInput="{{customerVar.firstname}}" stepKey="enterFirstName"/>
25+
<fillField selector="{{CheckoutShippingSection.lastName}}" userInput="{{customerVar.lastname}}" stepKey="enterLastName"/>
26+
<fillField selector="{{CheckoutShippingSection.street}}" userInput="{{customerAddressVar.street[0]}}" stepKey="enterStreet1"/>
27+
<fillField selector="{{CheckoutShippingSection.street4}}" userInput="{{customerAddressVar.street[3]}}" stepKey="enterStreet4"/>
28+
<fillField selector="{{CheckoutShippingSection.city}}" userInput="{{customerAddressVar.city}}" stepKey="enterCity"/>
29+
<selectOption selector="{{CheckoutShippingSection.region}}" userInput="{{customerAddressVar.state}}" stepKey="selectRegion"/>
30+
<fillField selector="{{CheckoutShippingSection.postcode}}" userInput="{{customerAddressVar.postcode}}" stepKey="enterPostcode"/>
31+
<fillField selector="{{CheckoutShippingSection.telephone}}" userInput="{{customerAddressVar.telephone}}" stepKey="enterTelephone"/>
32+
<waitForPageLoad stepKey="waitForLoadingMask"/>
33+
<waitForElementClickable selector="{{CheckoutShippingMethodsSection.checkShippingMethodByName('shippingMethod')}}" stepKey="waitForShippingMethod"/>
34+
<click selector="{{CheckoutShippingMethodsSection.checkShippingMethodByName('shippingMethod')}}" stepKey="selectShippingMethod"/>
35+
<waitForPageLoad stepKey="waitForShippingLoading"/>
36+
<waitForElementVisible selector="{{CheckoutShippingSection.next}}" time="30" stepKey="waitForNextButton"/>
37+
<click selector="{{CheckoutShippingSection.next}}" stepKey="clickNext"/>
38+
<waitForPageLoad stepKey="waitForPaymentLoading"/>
39+
<waitForElementVisible selector="{{CheckoutPaymentSection.paymentSectionTitle}}" time="30" stepKey="waitForPaymentSectionLoaded"/>
40+
<seeInCurrentUrl url="{{CheckoutPage.url}}/#payment" stepKey="assertCheckoutPaymentUrl"/>
41+
</actionGroup>
42+
</actionGroups>

app/code/Magento/Checkout/Test/Mftf/Section/CheckoutPaymentSection.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@
2222
<element name="guestFirstName" type="input" selector=".payment-method._active .billing-address-form input[name='firstname']"/>
2323
<element name="guestLastName" type="input" selector=".payment-method._active .billing-address-form input[name*='lastname']"/>
2424
<element name="guestStreet" type="input" selector=".payment-method._active .billing-address-form input[name*='street[0]']"/>
25+
<element name="guestStreet2" type="input" selector=".payment-method._active .billing-address-form input[name*='street[1]']"/>
26+
<element name="guestStreet3" type="input" selector=".payment-method._active .billing-address-form input[name*='street[2]']"/>
27+
<element name="guestStreet4" type="input" selector=".payment-method._active .billing-address-form input[name*='street[3]']"/>
2528
<element name="guestCity" type="input" selector=".payment-method._active .billing-address-form input[name*='city']"/>
2629
<element name="guestCountry" type="select" selector=".payment-method._active .billing-address-form select[name*='country_id']"/>
2730
<element name="guestRegion" type="select" selector=".payment-method._active .billing-address-form select[name*='region_id']"/>

app/code/Magento/Checkout/Test/Mftf/Section/CheckoutShippingSection.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@
2323
<element name="company" type="input" selector="input[name=company]"/>
2424
<element name="street" type="input" selector="input[name='street[0]']"/>
2525
<element name="street2" type="input" selector="input[name='street[1]']"/>
26+
<element name="street3" type="input" selector="input[name='street[2]']"/>
27+
<element name="street4" type="input" selector="input[name='street[3]']"/>
2628
<element name="city" type="input" selector="input[name=city]"/>
2729
<element name="region" type="select" selector="select[name=region_id]"/>
2830
<element name="postcode" type="input" selector="input[name=postcode]"/>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
9+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
10+
<test name="StorefrontGuestCheckoutAddNewAddressTest">
11+
<annotations>
12+
<features value="Checkout"/>
13+
<stories value="Checkout via Guest Checkout"/>
14+
<title value="Guest Checkout - guest should be able to add new shipping / billing address through checkout process."/>
15+
<description value="Should be able to place an order as a Guest"/>
16+
<severity value="AVERAGE"/>
17+
<useCaseId value="ACP2E-1105"/>
18+
<testCaseId value="AC-6439"/>
19+
<group value="checkout"/>
20+
</annotations>
21+
<before>
22+
<createData entity="_defaultCategory" stepKey="createCategory"/>
23+
<createData entity="ApiSimpleProduct" stepKey="createProduct">
24+
<requiredEntity createDataKey="createCategory"/>
25+
</createData>
26+
<magentoCLI command="config:set customer/address/street_lines 4" stepKey="setStreetLineNo"/>
27+
<magentoCLI command="cache:clean config" stepKey="cacheCleanBefore"/>
28+
</before>
29+
<after>
30+
<actionGroup ref="AdminLogoutActionGroup" stepKey="adminLogout"/>
31+
<deleteData createDataKey="createCategory" stepKey="deleteCategory"/>
32+
<deleteData createDataKey="createProduct" stepKey="deleteProduct"/>
33+
<magentoCLI command="config:set customer/address/street_lines 2" stepKey="resetStreetLineNo"/>
34+
<magentoCLI command="cache:clean config" stepKey="cacheCleanAfter"/>
35+
</after>
36+
37+
<amOnPage url="{{StorefrontCategoryPage.url($$createCategory.custom_attributes[url_key]$$)}}" stepKey="onCategoryPage"/>
38+
<waitForPageLoad stepKey="waitForPageLoad1"/>
39+
<actionGroup ref="StorefrontHoverProductOnCategoryPageActionGroup" stepKey="hoverProduct"/>
40+
<actionGroup ref="StorefrontClickAddToCartButtonActionGroup" stepKey="addToCart"/>
41+
<waitForElementVisible selector="{{StorefrontCategoryMainSection.SuccessMsg}}" time="30" stepKey="waitForProductAdded"/>
42+
<see selector="{{StorefrontCategoryMainSection.SuccessMsg}}" userInput="You added $$createProduct.name$$ to your shopping cart." stepKey="seeAddedToCartMessage"/>
43+
<see selector="{{StorefrontMinicartSection.quantity}}" userInput="1" stepKey="seeCartQuantity"/>
44+
<actionGroup ref="GoToCheckoutFromMinicartActionGroup" stepKey="guestGoToCheckoutFromMinicart"/>
45+
<actionGroup ref="GuestCheckoutFillingShippingWithMultipleStreetLinesSectionActionGroup" stepKey="guestCheckoutFillingShippingSection">
46+
<argument name="customerVar" value="CustomerEntityOne"/>
47+
<argument name="customerAddressVar" value="US_Address_Empty_Street_Lines"/>
48+
</actionGroup>
49+
<actionGroup ref="CheckoutSelectCheckMoneyOrderPaymentActionGroup" stepKey="guestSelectCheckMoneyOrderPayment"/>
50+
<actionGroup ref="CheckBillingAddressInCheckoutActionGroup" stepKey="guestSeeAddress">
51+
<argument name="customerVar" value="CustomerEntityOne"/>
52+
<argument name="customerAddressVar" value="US_Address_Empty_Street_Lines"/>
53+
</actionGroup>
54+
<actionGroup ref="CheckoutPlaceOrderActionGroup" stepKey="guestPlaceorder">
55+
<argument name="orderNumberMessage" value="CONST.successGuestCheckoutOrderNumberMessage"/>
56+
<argument name="emailYouMessage" value="CONST.successCheckoutEmailYouMessage"/>
57+
</actionGroup>
58+
<grabTextFrom selector="{{CheckoutSuccessMainSection.orderNumber}}" stepKey="grabOrderNumber"/>
59+
60+
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin1"/>
61+
62+
<amOnPage url="{{AdminOrdersPage.url}}" stepKey="onOrdersPage"/>
63+
<waitForLoadingMaskToDisappear stepKey="waitForLoadingMaskToDisappearOnOrdersPage"/>
64+
<actionGroup ref="ClearFiltersAdminDataGridActionGroup" stepKey="clearGridFilter"/>
65+
<fillField selector="{{AdminOrdersGridSection.search}}" userInput="{$grabOrderNumber}" stepKey="fillOrderNum"/>
66+
<click selector="{{AdminOrdersGridSection.submitSearch}}" stepKey="submitSearchOrderNum"/>
67+
<waitForLoadingMaskToDisappear stepKey="waitForLoadingMaskToDisappearOnSearch"/>
68+
<actionGroup ref="AdminOrderGridClickFirstRowActionGroup" stepKey="clickOrderRow"/>
69+
<see selector="{{AdminOrderDetailsInformationSection.orderStatus}}" userInput="Pending" stepKey="seeAdminOrderStatus"/>
70+
<see selector="{{AdminOrderDetailsInformationSection.accountInformation}}" userInput="{{CustomerEntityOne.fullname}}" stepKey="seeAdminOrderGuest"/>
71+
<see selector="{{AdminOrderDetailsInformationSection.accountInformation}}" userInput="{{CustomerEntityOne.email}}" stepKey="seeAdminOrderEmail"/>
72+
<see selector="{{AdminOrderDetailsInformationSection.shippingAddress}}" userInput="{{US_Address_Empty_Street_Lines.street[0]}}" stepKey="seeAdminOrderShippingAddress1"/>
73+
<see selector="{{AdminOrderDetailsInformationSection.shippingAddress}}" userInput="{{US_Address_Empty_Street_Lines.street[3]}}" stepKey="seeAdminOrderShippingAddress4"/>
74+
<see selector="{{AdminOrderDetailsInformationSection.itemsOrdered}}" userInput="$$createProduct.name$$" stepKey="seeAdminOrderProduct"/>
75+
<click selector="{{AdminShipmentAddressInformationSection.shippingAddressEdit}}" stepKey="goToShippingAddress"/>
76+
<waitForPageLoad stepKey="waitForPageToLoad"/>
77+
<seeInField selector="{{AdminOrderEditShippingAddressSection.StreetLine1}}" userInput="{{US_Address_Empty_Street_Lines.street[0]}}" stepKey="seeAdminOrderEditShippingAddress1" />
78+
<seeInField selector="{{AdminOrderEditShippingAddressSection.StreetLine4}}" userInput="{{US_Address_Empty_Street_Lines.street[3]}}" stepKey="seeAdminOrderEditShippingAddress4" />
79+
</test>
80+
</tests>

app/code/Magento/Customer/Test/Mftf/Data/AddressData.xml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -446,4 +446,19 @@
446446
<data key="postcode">12345</data>
447447
<data key="telephone">512-345-6789</data>
448448
</entity>
449+
<entity name="US_Address_Empty_Street_Lines" type="address">
450+
<array key="street">
451+
<item>123 Street Line</item>
452+
<item>empty</item>
453+
<item>empty</item>
454+
<item>Region Line</item>
455+
</array>
456+
<data key="city">New York</data>
457+
<data key="state">New York</data>
458+
<data key="postcode">10001</data>
459+
<data key="telephone">512-345-6789</data>
460+
<requiredEntity type="region">RegionNY</requiredEntity>
461+
<data key="country_id">US</data>
462+
<data key="country">United States</data>
463+
</entity>
449464
</entities>
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
9+
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
11+
<section name="AdminOrderEditShippingAddressSection">
12+
<element name="NamePrefix" type="input" selector="#prefix"/>
13+
<element name="FirstName" type="input" selector="#firstname"/>
14+
<element name="MiddleName" type="input" selector="#middlename"/>
15+
<element name="LastName" type="input" selector="#olastname"/>
16+
<element name="NameSuffix" type="input" selector="#suffix"/>
17+
<element name="Company" type="input" selector="#company"/>
18+
<element name="StreetLine1" type="input" selector="#street0"/>
19+
<element name="StreetLine2" type="input" selector="#street1"/>
20+
<element name="StreetLine3" type="input" selector="#street2"/>
21+
<element name="StreetLine4" type="input" selector="#street3"/>
22+
<element name="City" type="input" selector="#city"/>
23+
<element name="Country" type="select" selector="#country_id"/>
24+
<element name="State" type="select" selector="#region_id"/>
25+
<element name="Province" type="input" selector="#region"/>
26+
<element name="PostalCode" type="input" selector="#postcode"/>
27+
<element name="Phone" type="input" selector="#telephone"/>
28+
<element name="Fax" type="input" selector="#fax"/>
29+
<element name="VatNumber" type="input" selector="#vat_id"/>
30+
<element name="SaveAddress" type="button" selector="#save"/>
31+
</section>
32+
</sections>

0 commit comments

Comments
 (0)