Skip to content

Commit edcee33

Browse files
authored
Merge branch '2.4-develop' into storefront-extra-graphql-delivery
2 parents b74802f + 57cbaad commit edcee33

File tree

12 files changed

+762
-607
lines changed

12 files changed

+762
-607
lines changed

app/code/Magento/AwsS3/Test/Mftf/Test/AdminAwsS3SyncZeroByteFilesTest.xml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,11 @@
4444
<!-- Disable AWS S3 Remote Storage -->
4545
<magentoCLI command="setup:config:set {{RemoteStorageAwsS3ConfigData.disable_options}}" stepKey="disableRemoteStorage"/>
4646
</after>
47-
<magentoCLI command="remote-storage:sync" timeout="120" stepKey="syncRemoteStorage"/>
48-
<assertEquals stepKey="assertConfigTest">
49-
<expectedResult type="string">Uploading media files to remote storage.\n- empty.jpg\nEnd of upload.</expectedResult>
47+
<magentoCLI command="remote-storage:sync" timeout="200" stepKey="syncRemoteStorage"/>
48+
<comment userInput="checking remote-storage:sync" stepKey="assertConfigTest"/>
49+
<assertStringContainsString stepKey="checkingRemoteStorageSync">
50+
<expectedResult type="string">Uploading media files to remote storage</expectedResult>
5051
<actualResult type="variable">$syncRemoteStorage</actualResult>
51-
</assertEquals>
52-
52+
</assertStringContainsString>
5353
</test>
5454
</tests>

app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontAssertCategoryNameIsShownInMenuActionGroup.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
<argument name="categoryName" type="string"/>
1717
</arguments>
1818

19+
<waitForElementVisible selector="{{StorefrontHeaderSection.NavigationCategoryByName(categoryName)}}" stepKey="waitForCatName" time="120"/>
1920
<seeElement selector="{{StorefrontHeaderSection.NavigationCategoryByName(categoryName)}}"
2021
stepKey="seeCatergoryInStoreFront"/>
2122
</actionGroup>

app/code/Magento/Catalog/Test/Mftf/Test/StorefrontCategorySidebarMobileMenuTest.xml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,15 +42,17 @@
4242
<click selector="{{StorefrontHeaderSection.mobileMenuToggle}}" stepKey="openSideMenu"/>
4343
<waitForElementClickable selector="{{StorefrontHeaderSection.NavigationCategoryByName($$createParentCategory.name$$)}}" stepKey="waitForCategoryMenuClickable" />
4444
<click selector="{{StorefrontHeaderSection.NavigationCategoryByName($$createParentCategory.name$$)}}" stepKey="expandCategoryMenu"/>
45-
<waitForPageLoad stepKey="waitForSearchResult"/>
45+
<waitForPageLoad stepKey="waitForSearchResult" time="60"/>
4646

4747
<!-- Assert the category expanded successfully -->
4848
<actionGroup ref="StorefrontAssertCategoryNameIsShownInMenuActionGroup" stepKey="verifySubCatMenuItemIsVisibleInTheSidebar">
4949
<argument name="categoryName" value="$$createSubCategory.name$$"/>
5050
</actionGroup>
5151

5252
<!-- Open the subcategory and assert it opened successfully -->
53+
<waitForElementClickable selector="{{StorefrontHeaderSection.NavigationCategoryByName($$createSubCategory.name$$)}}" stepKey="waitForSubCategory" time="90"/>
5354
<click selector="{{StorefrontHeaderSection.NavigationCategoryByName($$createSubCategory.name$$)}}" stepKey="openSubCategory"/>
55+
<waitForElementVisible selector="{{StorefrontCategoryMainSection.CategoryTitle}}" stepKey="waitForCategoryName" time="90"/>
5456
<see userInput="$$createSubCategory.name$$" selector="{{StorefrontCategoryMainSection.CategoryTitle}}" stepKey="assertCategoryName"/>
5557
</test>
5658
</tests>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
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="GuestVerifiesTheShipToDetailsOnStorefrontCheckoutPaymentActionGroup">
12+
<annotations>
13+
<description>Guest verifies the Shipping details on storefront checkout payment page.</description>
14+
</annotations>
15+
<arguments>
16+
<argument name="firstName" type="string" defaultValue="{{CustomerAddressSimple.firstName}}"/>
17+
<argument name="lastName" type="string" defaultValue="{{CustomerAddressSimple.lastName}}"/>
18+
<argument name="street" type="string" defaultValue="{{CustomerAddressSimple.street[0]}}"/>
19+
<argument name="city" type="string" defaultValue="{{CustomerAddressSimple.city}}"/>
20+
<argument name="state" type="string" defaultValue="{{CustomerAddressSimple.state}}"/>
21+
<argument name="postcode" type="string" defaultValue="{{CustomerAddressSimple.postcode}}"/>
22+
<argument name="telephone" type="string" defaultValue="{{CustomerAddressSimple.telephone}}"/>
23+
</arguments>
24+
<waitForText selector="{{CheckoutPaymentSection.shipToInformation}}" userInput="{{firstName}}" stepKey="assertShipToFirstName" />
25+
<waitForText selector="{{CheckoutPaymentSection.shipToInformation}}" userInput="{{lastName}}" stepKey="assertShipToLastName" />
26+
<waitForText selector="{{CheckoutPaymentSection.shipToInformation}}" userInput="{{street}}" stepKey="assertShipToStreet" />
27+
<waitForText selector="{{CheckoutPaymentSection.shipToInformation}}" userInput="{{city}}" stepKey="assertShipToCity" />
28+
<waitForText selector="{{CheckoutPaymentSection.shipToInformation}}" userInput="{{state}}" stepKey="assertShipToState" />
29+
<waitForText selector="{{CheckoutPaymentSection.shipToInformation}}" userInput="{{postcode}}" stepKey="assertShipToPostcode" />
30+
<waitForText selector="{{CheckoutPaymentSection.shipToInformation}}" userInput="{{telephone}}" stepKey="assertShipToTelephone" />
31+
</actionGroup>
32+
</actionGroups>
33+

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,10 @@
4848
<element name="ProductOptionsActiveByProductItemName" type="text" selector="//div[@class='product-item-details']//strong[@class='product-item-name'][text()='{{var1}}']//ancestor::div[@class='product-item-details']//div[@class='product options active']" parameterized="true" />
4949
<element name="ProductOptionLinkActiveByProductItemName" type="text" selector="//div[@class='product-item-details']//strong[@class='product-item-name'][text()='{{var1}}']//ancestor::div[@class='product-item-details']//div[@class='product options active']//a[text() = '{{var2}}']" parameterized="true" />
5050
<element name="shipToInformation" type="text" selector="//div[@class='ship-to']//div[@class='shipping-information-content']" />
51-
<element name="shippingMethodInformation" type="text" selector="//div[@class='ship-via']//div[@class='shipping-information-content']" />
51+
<element name="shippingMethodInformation" type="text" selector="//div[@class='ship-via']//div[@class='shipping-information-content']"/>
52+
<element name="editShipToAddress" type="button" selector="//div[@class='ship-to']//button[@class='action action-edit']"/>
53+
<element name="editShippingMethod" type="button" selector="//div[@class='ship-via']//button[@class='action action-edit']"/>
54+
<element name="shippingMethodTitle" type="text" selector="//div[text()='Shipping Methods']"/>
5255
<element name="shippingInformationSection" type="text" selector=".ship-to .shipping-information-content" />
5356
<element name="paymentMethodTitle" type="text" selector=".payment-method-title span" />
5457
<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"/>
@@ -72,5 +75,6 @@
7275
<element name="billingAddressSameAsShippingCashOnDeliveryCheckbox" type="checkbox" selector="#billing-address-same-as-shipping-cashondelivery"/>
7376
<element name="errormessage" type="text" selector="//div[@data-ui-id='checkout-cart-validationmessages-message-error']"/>
7477
<element name="productQuantityInCartBlock" type="text" selector="//div[@class='details-qty']/span[@class='value']" />
78+
<element name="customerAddressAttribute" type="input" selector="//div[@name='billingAddresscheckmo.custom_attributes.{{attribute}}']//input[@name='custom_attributes[{{attribute}}]']" parameterized="true" timeout="30"/>
7579
</section>
7680
</sections>

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,5 +55,6 @@
5555
<element name="selectCountry" type="select" selector="//div[@class='billing-address-form']//select[@name='country_id']"/>
5656
<element name="customerAddressAttribute" type="input" selector="[id*='{{attribute}}']" parameterized="true"/>
5757
<element name="savedAddress" type="text" selector="div[class='shipping-address-item selected-item']"/>
58+
<element name="shippingAddressBox" type="text" selector="//div[@class='shipping-address-item selected-item']" timeout="30"/>
5859
</section>
5960
</sections>
Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
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+
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
11+
<test name="StorefrontVerifyShipToShipMethodContainsSameDataTest">
12+
<annotations>
13+
<features value="Checkout"/>
14+
<stories value="Guest checkout"/>
15+
<title value="Ship To and Shipping Method blocks on Checkout contain actual information according to input data"/>
16+
<description value="Ship To and Shipping Method blocks on Checkout contain actual information according to input data"/>
17+
<severity value="MAJOR"/>
18+
<testCaseId value="AC-4628"/>
19+
</annotations>
20+
<before>
21+
<!-- Enable free shipping -->
22+
<createData entity="FreeShippingMethodsSettingConfig" stepKey="enableFreeShippingConfig"/>
23+
<!-- create category -->
24+
<createData entity="_defaultCategory" stepKey="createCategory"/>
25+
<!-- create simple product -->
26+
<createData entity="ApiSimpleProduct" stepKey="createProduct">
27+
<requiredEntity createDataKey="createCategory"/>
28+
</createData>
29+
</before>
30+
<after>
31+
<createData entity="DisableFreeShippingConfig" stepKey="disableFreeShippingConfig"/>
32+
<!-- delete category -->
33+
<deleteData createDataKey="createCategory" stepKey="deleteCategory"/>
34+
<!-- delete simple product -->
35+
<deleteData createDataKey="createProduct" stepKey="deleteProduct"/>
36+
</after>
37+
<!-- Go to Storefront as Guest and add product to cart -->
38+
<actionGroup ref="StorefrontOpenProductEntityPageActionGroup" stepKey="guestOpenProductPage">
39+
<argument name="product" value="$$createProduct$$"/>
40+
</actionGroup>
41+
<waitForPageLoad stepKey="waitForPageLoadToGetTheStorePageOpen"/>
42+
<actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addSimpleProductToCartFromStorefront">
43+
<argument name="productName" value="$createProduct.name$"/>
44+
</actionGroup>
45+
<!-- Proceed to Checkout -->
46+
<actionGroup ref="StorefrontOpenCheckoutPageActionGroup" stepKey="guestProceedsToCheckout"/>
47+
<waitForLoadingMaskToDisappear stepKey="waitForLoadingMaskToDisappearPostClickingOnCheckout"/>
48+
<!-- verify shipping screen is opened -->
49+
<waitForElement selector="{{CheckoutShippingSection.isShippingStep}}" stepKey="shippingStepIsOpened"/>
50+
<!--Filling shipping information and click next-->
51+
<actionGroup ref="GuestCheckoutFillingShippingSectionActionGroup" stepKey="guestCheckoutFillingShipping">
52+
<argument name="shippingMethod" value="Flat Rate"/>
53+
</actionGroup>
54+
<!--Review & Payments step of checkout is opened where Correct Billing address is verified-->
55+
<actionGroup ref="CheckShipToInformationInCheckoutActionGroup" stepKey="verifyShipToInformation">
56+
<argument name="customerVar" value="CustomerEntityOne" />
57+
<argument name="customerAddressVar" value="CustomerAddressSimple" />
58+
</actionGroup>
59+
<!-- Assert Shipping Method = "Flat Rate" -->
60+
<waitForText userInput="Flat Rate - Fixed" selector="{{CheckoutPaymentSection.orderSummaryShippingMethod}}" stepKey="assertShippingMethod"/>
61+
<!-- Reload Page and wait for page to get reload -->
62+
<reloadPage stepKey="refreshPageToVerifyAllInformationIsPresent"/>
63+
<waitForPageLoad stepKey="waitForPageToLoadProperlyToAssertShipToInformationDetails"/>
64+
<!-- Check that "Ship To" block contains correct information -->
65+
<actionGroup ref="GuestVerifiesTheShipToDetailsOnStorefrontCheckoutPaymentActionGroup" stepKey="assertingShipToInformationOnPaymentPage"/>
66+
<!-- Assert Shipping Method = "Flat Rate" -->
67+
<waitForText userInput="Flat Rate - Fixed" selector="{{CheckoutPaymentSection.orderSummaryShippingMethod}}" stepKey="assertShippingMethodAgain"/>
68+
<!-- click on Edit button next to "Ship To" Text -->
69+
<waitForElementVisible selector="{{CheckoutPaymentSection.editShipToAddress}}" stepKey="waitForEditButtonToBeVisible"/>
70+
<click selector="{{CheckoutPaymentSection.editShipToAddress}}" stepKey="clickOnEditButton"/>
71+
<actionGroup ref="GuestCheckoutFillingShippingSectionActionGroup" stepKey="guestCheckoutFillingShippingSectionAgain">
72+
<argument name="customerVar" value="CustomerEntityOne"/>
73+
<argument name="customerAddressVar" value="CustomerAddressSimple"/>
74+
</actionGroup>
75+
<!-- Check that "Ship To" block contains correct information -->
76+
<actionGroup ref="GuestVerifiesTheShipToDetailsOnStorefrontCheckoutPaymentActionGroup" stepKey="againAssertingShipToInformationOnPaymentPage"/>
77+
<!-- Assert Shipping Method = "Free Shipping" -->
78+
<waitForText userInput="Free Shipping - Free" selector="{{CheckoutPaymentSection.orderSummaryShippingMethod}}" stepKey="assertFreeShippingMethod"/>
79+
<!-- click on Edit button next to "Shipping Method" Text -->
80+
<waitForElementVisible selector="{{CheckoutPaymentSection.editShippingMethod}}" stepKey="waitForEditButtonToVisible"/>
81+
<click selector="{{CheckoutPaymentSection.editShippingMethod}}" stepKey="clickOnEditShippingMethodButton"/>
82+
<!-- Assert that it has scrolled to Shipping Method text -->
83+
<scrollTo selector="{{CheckoutPaymentSection.shippingMethodTitle}}" stepKey="scrollToShippingMethodTitle"/>
84+
<waitForText selector="{{CheckoutPaymentSection.shippingMethodTitle}}" userInput="Shipping Methods" stepKey="assertShippingMethodTitle"/>
85+
</test>
86+
</tests>

app/code/Magento/Paypal/Test/Mftf/Section/PayPalExpressCheckoutConfigSection/PayPalPaymentSection.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,5 +25,6 @@
2525
<element name="shippingMethod" type="text" selector="#shippingMethodCharge > span.selectedShippingMethod"/>
2626
<element name="paypalCart" type="text" selector="#transactionCart"/>
2727
<element name="productNamePosition" type="text" selector=".itemName"/>
28+
<element name="orderTotalOnPaypalCheckout" type="text" selector="//div[@id='cart']//span[contains(text(),'$')]"/>
2829
</section>
2930
</sections>
Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
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="StorefrontPaypalExpressCheckoutWithDiscountCouponTest">
11+
<annotations>
12+
<features value="PayPal"/>
13+
<stories value="Paypal express checkout with discount"/>
14+
<title value="Paypal Express Checkout with discount coupon applied"/>
15+
<description value="Place an order with discount coupon applied using paypal express checkout as payment method"/>
16+
<severity value="CRITICAL"/>
17+
<testCaseId value="AC-6152"/>
18+
</annotations>
19+
<before>
20+
<!-- Simple product is created -->
21+
<createData entity="SimpleProduct" stepKey="createProduct"/>
22+
<!-- US Customer is created -->
23+
<createData entity="Simple_US_Customer" stepKey="createCustomer"/>
24+
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>
25+
<!-- Delete all existing cart price rules -->
26+
<actionGroup ref="AdminCartPriceRuleDeleteAllActionGroup" stepKey="deleteAllCartPriceRules"/>
27+
<!-- Create new cart price rule -->
28+
<createData entity="SalesRuleSpecificCouponWithPercentDiscount" stepKey="createCartPriceRule"/>
29+
<createData entity="SimpleSalesRuleCoupon" stepKey="createCouponForCartPriceRule">
30+
<requiredEntity createDataKey="createCartPriceRule"/>
31+
</createData>
32+
<!-- Configure Paypal Express Checkout -->
33+
<actionGroup ref="AdminPayPalExpressCheckoutEnableActionGroup" stepKey="ConfigPayPalExpress">
34+
<argument name="credentials" value="SamplePaypalExpressConfig2"/>
35+
</actionGroup>
36+
</before>
37+
<after>
38+
<magentoCLI command="config:set payment/paypal_express/active 0" stepKey="disablePayPalExpress"/>
39+
<deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/>
40+
<deleteData createDataKey="createProduct" stepKey="deleteProduct"/>
41+
<!-- Delete Cart Price Rule -->
42+
<deleteData createDataKey="createCartPriceRule" stepKey="deleteCartPriceRule"/>
43+
<actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/>
44+
</after>
45+
<!-- Login to StoreFront -->
46+
<actionGroup ref="LoginToStorefrontActionGroup" stepKey="storefrontCustomerLogin">
47+
<argument name="Customer" value="$$createCustomer$$"/>
48+
</actionGroup>
49+
<!-- Add product to cart -->
50+
<actionGroup ref="AddSimpleProductToCartActionGroup" stepKey="addProductToCart">
51+
<argument name="product" value="$$createProduct$$"/>
52+
</actionGroup>
53+
<!-- Goto Checkout Page -->
54+
<actionGroup ref="StorefrontOpenCheckoutPageActionGroup" stepKey="goToCheckout"/>
55+
<actionGroup ref="CheckoutSelectFlatRateShippingMethodActionGroup" stepKey="selectFlatRateShipping" />
56+
<actionGroup ref="StorefrontCheckoutClickNextOnShippingStepActionGroup" stepKey="clickNext"/>
57+
<!-- Assert order total before applying coupon -->
58+
<actionGroup ref="AssertStorefrontCheckoutPaymentSummaryTotalActionGroup" stepKey="assertSummaryTotalBeforeCoupon">
59+
<argument name="orderTotal" value="$128.00"/>
60+
</actionGroup>
61+
<!-- Apply Discount Coupon to the Order and assert order total -->
62+
<actionGroup ref="StorefrontApplyDiscountCodeActionGroup" stepKey="applyDiscountCoupon">
63+
<argument name="discountCode" value="$$createCouponForCartPriceRule.code$$"/>
64+
</actionGroup>
65+
<actionGroup ref="AssertStorefrontCheckoutPaymentSummaryTotalActionGroup" stepKey="assertSummaryTotalAfterCoupon">
66+
<argument name="orderTotal" value="$110.70"/>
67+
</actionGroup>
68+
<!-- Click on PayPal payment radio button -->
69+
<waitForElementClickable selector="{{CheckoutPaymentSection.PayPalPaymentRadio}}" stepKey="waitForPayPalRadioButton"/>
70+
<click selector="{{CheckoutPaymentSection.PayPalPaymentRadio}}" stepKey="selectPaypalPayment"/>
71+
<actionGroup ref="SwitchToPayPalGroupBtnActionGroup" stepKey="clickPayPalBtn"/>
72+
<!-- Login to Paypal in-context and verify order total on paypal page-->
73+
<actionGroup ref="StorefrontLoginToPayPalPaymentAccountTwoStepActionGroup" stepKey="loginToPayPal"/>
74+
<waitForText selector="{{PayPalPaymentSection.orderTotalOnPaypalCheckout}}" userInput="$110.70" stepKey="verifyOrderTotalOnPaypalPage"/>
75+
<!-- Click PayPal button and go back to Magento site -->
76+
<actionGroup ref="StorefrontPaypalSwitchBackToMagentoFromCheckoutPageActionGroup" stepKey="confirmPaymentAndGoBackToMagento"/>
77+
<!-- I see order successful Page -->
78+
<actionGroup ref="AssertStorefrontCheckoutSuccessActionGroup" stepKey="assertOrderSuccess"/>
79+
<grabTextFrom selector="{{CheckoutSuccessMainSection.orderNumber22}}" stepKey="orderNumber"/>
80+
<assertNotEmpty stepKey="assertOrderIdIsNotEmpty">
81+
<actualResult type="const">$orderNumber</actualResult>
82+
</assertNotEmpty>
83+
</test>
84+
</tests>

0 commit comments

Comments
 (0)