Skip to content

Commit 6baba57

Browse files
Merge branch '2.4-develop' into community_prs_march
2 parents 309592d + fcc6f0a commit 6baba57

File tree

28 files changed

+1387
-16
lines changed

28 files changed

+1387
-16
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
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="StorefrontAssertProductPriceAndPriceLabelIfPresentOnCategoryPageActionGroup">
12+
<annotations>
13+
<description>Validate that the price and price label if present on category page.</description>
14+
</annotations>
15+
<arguments>
16+
<argument name="productName" type="string"/>
17+
<argument name="price" type="string"/>
18+
<argument name="priceLabel" type="string"/>
19+
</arguments>
20+
<waitForElementVisible selector="{{StorefrontCategoryMainSection.productNameWithPriceOrLabel(productName,priceLabel)}}" stepKey="assertProductPriceLabel"/>
21+
<waitForElementVisible selector="{{StorefrontCategoryMainSection.productNameWithPriceOrLabel(productName,price)}}" stepKey="assertProductPrice"/>
22+
</actionGroup>
23+
</actionGroups>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
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="StorefrontAssertProductPriceAndPriceLabelIsNotPresentOnCategoryPageActionGroup">
12+
<annotations>
13+
<description>Validate that the price and price label is not present on category page.</description>
14+
</annotations>
15+
<arguments>
16+
<argument name="productName" type="string"/>
17+
<argument name="price" type="string"/>
18+
<argument name="priceLabel" type="string"/>
19+
</arguments>
20+
<dontSeeElement selector="{{StorefrontCategoryMainSection.productNameWithPriceOrLabel(productName,priceLabel)}}" stepKey="dontSeePriceLabel"/>
21+
<waitForElementVisible selector="{{StorefrontCategoryMainSection.productNameWithPriceOrLabel(productName,price)}}" stepKey="assertProductPrice"/>
22+
</actionGroup>
23+
</actionGroups>

app/code/Magento/Catalog/Test/Mftf/Section/StorefrontCategoryMainSection.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
4646
<element name="outOfStockProductCategoryPage" type="text" selector="//div[@class='stock unavailable']//span[text()='Out of stock']"/>
4747
<element name="ListedProductAttributes" type="block" selector="//div[@aria-label='{{vs_attribute}}']//div[@aria-label='{{attribute_name}}']" parameterized="true"/>
4848
<element name="quickOrderLink" type="text" selector="//div[@class='panel header']//a[text()='Quick Order']" />
49+
<element name="productNameWithPriceOrLabel" type="text" selector="//div[@class='product details product-item-details']//a[contains(text(),'{{ProductName}}')]//parent::strong/following-sibling::div//span[contains(text(),'{{PriceLabelOrPrice}}')]" parameterized="true"/>
4950
<element name="sortByDropdownContent" type="select" selector="//select[@id='sorter']//option[contains(text(),'{{arg}}')]" parameterized="true"/>
5051
<element name="productInOrderDisplay" type="text" selector="//li[@class='item product product-item'][{{index}}]//a[@class='product-item-link' and contains(text(),'{{product_name}}')]" parameterized="true"/>
5152
</section>

app/code/Magento/Catalog/Test/Mftf/Section/StorefrontProductActionSection.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
1010
<section name="StorefrontProductActionSection">
1111
<element name="quantity" type="input" selector="#qty"/>
12-
<element name="addToCart" type="button" selector="#product-addtocart-button" timeout="60"/>
12+
<element name="addToCart" type="button" selector=".box-tocart .fieldset .actions #product-addtocart-button" timeout="60"/>
1313
<element name="addToCartDisabled" type="button" selector="#product-addtocart-button[disabled]" timeout="60"/>
1414
<element name="addToCartEnabledWithTranslation" type="button" selector="button#product-addtocart-button[data-translate]:enabled" timeout="60"/>
1515
<element name="addToCartButtonTitleIsAdding" type="text" selector="//button/span[text()='Adding...']"/>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
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="StorefrontApplyGiftsCardsAndCouponCodesInWidgetIsShownOnOrderReviewPageForPayflowProTest">
12+
<annotations>
13+
<features value="Payments"/>
14+
<stories value="Payflow Pro"/>
15+
<title value="Apply gift cards and promo codes widget are shown on Order review page for Payflow Pro"/>
16+
<description value="As a guest, apply coupon and gift card while placing an order through paypal payflow pro"/>
17+
<severity value="MAJOR"/>
18+
<testCaseId value="AC-5199"/>
19+
</annotations>
20+
<before>
21+
<!--Create simple product-->
22+
<createData entity="SimpleProduct" stepKey="createSimpleProduct1"/>
23+
<!--Create cart price rule and coupon-->
24+
<createData entity="ActiveSalesRuleForNotLoggedIn" stepKey="createCartPriceRule"/>
25+
<createData entity="SimpleSalesRuleCoupon" stepKey="createCouponForCartPriceRule">
26+
<requiredEntity createDataKey="createCartPriceRule"/>
27+
</createData>
28+
<!--Create a customer-->
29+
<createData entity="Simple_US_Customer" stepKey="createCustomer"/>
30+
<!--Login to admin site-->
31+
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>
32+
</before>
33+
<after>
34+
<!--Delete created product-->
35+
<deleteData createDataKey="createSimpleProduct1" stepKey="deleteSimpleProduct"/>
36+
<!--Delete created cart price rule-->
37+
<deleteData createDataKey="createCartPriceRule" stepKey="deleteCartPriceRule"/>
38+
<!--Delete created customer-->
39+
<deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/>
40+
<!--Logout from admin site-->
41+
<actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/>
42+
</after>
43+
<!--Go to storefront-->
44+
<actionGroup ref="StorefrontOpenHomePageActionGroup" stepKey="goToStoreFront"/>
45+
<!--Open product1 and add it to cart-->
46+
<actionGroup ref="StorefrontOpenProductEntityPageActionGroup" stepKey="gotToProductPage">
47+
<argument name="product" value="$$createSimpleProduct1$$"/>
48+
</actionGroup>
49+
<actionGroup ref="StorefrontAddToTheCartActionGroup" stepKey="addProductToCart">
50+
<argument name="product" value="$$createSimpleProduct1$$"/>
51+
</actionGroup>
52+
<!--Go to checkout page-->
53+
<actionGroup ref="StorefrontOpenCheckoutPageActionGroup" stepKey="goToCheckoutCartPage"/>
54+
<!--Fill Shipping Address-->
55+
<actionGroup ref="GuestCheckoutFillNewShippingAddressActionGroup" stepKey="fillShippingAddress">
56+
<argument name="customer" value="$$createCustomer$$" />
57+
<argument name="address" value="US_Address_TX"/>
58+
</actionGroup>
59+
<!-- Select shipping -->
60+
<actionGroup ref="StorefrontSetShippingMethodActionGroup" stepKey="selectShippingMethodAsFlatrate">
61+
<argument name="shippingMethodName" value="Flat Rate"/>
62+
</actionGroup>
63+
<!-- Go to Order review -->
64+
<actionGroup ref="StorefrontCheckoutClickNextOnShippingStepActionGroup" stepKey="goToCheckoutPaymentPage"/>
65+
<waitForPageLoad stepKey="waitForLoadingMask"/>
66+
<waitForPageLoad stepKey="waitForPaymentPageLoad"/>
67+
<!-- Apply Discount Coupon to the Order -->
68+
<actionGroup ref="StorefrontApplyDiscountCodeActionGroup" stepKey="applyDiscountCoupon">
69+
<argument name="discountCode" value="$createCouponForCartPriceRule.code$"/>
70+
</actionGroup>
71+
<!--Place an order-->
72+
<actionGroup ref="ClickPlaceOrderActionGroup" after="fillCardData" stepKey="clickOnPlaceOrder"/>
73+
</test>
74+
</tests>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
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="StorefrontPersistentDataForRegisterCustomerWithPhysicalQuoteTest">
12+
<annotations>
13+
<features value="Checkout"/>
14+
<stories value="Checkout via Register Checkout"/>
15+
<title value="Persistent Data for register Customer with physical quote"/>
16+
<description value="One can use Persistent Data for register Customer with physical quote"/>
17+
<severity value="MAJOR"/>
18+
<testCaseId value="AC-4618"/>
19+
<group value="checkout"/>
20+
</annotations>
21+
<before>
22+
<createData entity="SimpleProduct2" stepKey="createProduct">
23+
<field key="price">10</field>
24+
</createData>
25+
<createData entity="Simple_US_CA_Customer" stepKey="createCustomer"/>
26+
<actionGroup ref="CliEnableFreeShippingMethodActionGroup" stepKey="freeShippingMethodsSettingConfig"/>
27+
</before>
28+
<after>
29+
<actionGroup ref="CliDisableFreeShippingMethodActionGroup" stepKey="disableFreeShipping"/>
30+
<deleteData createDataKey="createProduct" stepKey="deleteProduct"/>
31+
<actionGroup ref="StorefrontCustomerLogoutActionGroup" stepKey="customerLogout"/>
32+
<deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/>
33+
<actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/>
34+
</after>
35+
<!-- Login as Customer Login from Customer page -->
36+
<actionGroup ref="StorefrontOpenHomePageActionGroup" stepKey="goToStorefront"/>
37+
<actionGroup ref="LoginToStorefrontActionGroup" stepKey="customerLogin">
38+
<argument name="Customer" value="$$createCustomer$$" />
39+
</actionGroup>
40+
<!-- Add simple product to cart and go to checkout-->
41+
<actionGroup ref="AddSimpleProductToCartActionGroup" stepKey="addSimpleProductToCart">
42+
<argument name="product" value="$$createProduct$$"/>
43+
</actionGroup>
44+
<!-- 2. Go to Shopping Cart -->
45+
<actionGroup ref="StorefrontCartPageOpenActionGroup" stepKey="goToCheckoutCartIndexPage"/>
46+
<!-- 3. Open "Estimate Shipping and Tax" section and input data -->
47+
<actionGroup ref="StorefrontCartEstimateShippingAndTaxActionGroup" stepKey="expandEstimateShippingAndTaxSection"/>
48+
<actionGroup ref="StorefrontAssertCartEstimateShippingAndTaxActionGroup" stepKey="assertCartEstimateShippingAddress"/>
49+
<actionGroup ref="StorefrontAssertShippingMethodPresentInCartActionGroup" stepKey="assertShippingMethodFlatRateIsPresentInCart">
50+
<argument name="shippingMethod" value="Flat Rate"/>
51+
</actionGroup>
52+
<actionGroup ref="StorefrontAssertShippingMethodPresentInCartActionGroup" stepKey="assertShippingMethodFreeShippingIsPresentInCart">
53+
<argument name="shippingMethod" value="Free Shipping"/>
54+
</actionGroup>
55+
<!-- 4. Select Flat Rate as shipping -->
56+
<checkOption selector="{{CheckoutCartSummarySection.flatRateShippingMethod}}" stepKey="selectFlatRateShippingMethod"/>
57+
<waitForLoadingMaskToDisappear stepKey="waitForLoadingMaskToDisappearAfterFlatRateSelection"/>
58+
<waitForText selector="{{CheckoutCartSummarySection.total}}" userInput="15" stepKey="assertOrderTotalField"/>
59+
<!-- 5. Refresh browser page (F5) -->
60+
<actionGroup ref="ReloadPageActionGroup" stepKey="reloadPage"/>
61+
<actionGroup ref="StorefrontAssertCartEstimateShippingAndTaxActionGroup" stepKey="assertCartEstimateShippingAddressAfterReload"/>
62+
<actionGroup ref="StorefrontAssertCartShippingMethodSelectedActionGroup" stepKey="assertFlatRateShippingMethodIsCheckedAfterReload">
63+
<argument name="carrierCode" value="flatrate"/>
64+
<argument name="methodCode" value="flatrate"/>
65+
</actionGroup>
66+
<actionGroup ref="CheckoutFillEstimateShippingAndTaxActionGroup" stepKey="fillUKEstimateShippingAndTaxFields">
67+
<argument name="address" value="updateCustomerUKAddress"/>
68+
</actionGroup>
69+
<waitForLoadingMaskToDisappear stepKey="waitForZipLoadingMaskDisappear"/>
70+
<dontSeeJsError stepKey="verifyThatThereIsNoJSErrors"/>
71+
<!-- 6. Go to Checkout -->
72+
<actionGroup ref="StorefrontClickProceedToCheckoutActionGroup" stepKey="clickProceedToCheckout"/>
73+
<actionGroup ref="StorefrontAssertCheckoutShippingMethodSelectedActionGroup" stepKey="assertFlatRateShippingMethodIsCheckedAfterGoingToCheckout">
74+
<argument name="shippingMethod" value="Flat Rate"/>
75+
</actionGroup>
76+
<actionGroup ref="StorefrontClickAddNewAddressButtonFromCheckoutShippingActionGroup" stepKey="clickOnNewAddressButton"/>
77+
<waitForElementVisible selector="{{CheckoutShippingSection.firstName('John')}}" stepKey="assertFirstName"/>
78+
<waitForElementVisible selector="{{CheckoutShippingSection.lastName('Doe')}}" stepKey="assertLastName"/>
79+
<seeOptionIsSelected selector="{{CheckoutShippingSection.country}}" userInput="{{UK_Address.country}}" stepKey="selectedCountryIsUnitedKingdom"/>
80+
<waitForElementVisible selector="{{CheckoutShippingSection.postcode('12345')}}" stepKey="assertUKPostCode"/>
81+
<actionGroup ref="CustomerLoggedInCheckoutFillNewBillingAddressActionGroup" stepKey="fillSwitzerlandAddress">
82+
<argument name="Address" value="Switzerland_Address"/>
83+
</actionGroup>
84+
<!-- Check order summary in checkout -->
85+
<actionGroup ref="StorefrontCheckoutClickSaveAddressButtonActionGroup" stepKey="saveAddress"/>
86+
<!-- Select Free Shipping -->
87+
<actionGroup ref="StorefrontSetShippingMethodActionGroup" stepKey="setShippingMethodFreeShipping">
88+
<argument name="shippingMethodName" value="Free Shipping"/>
89+
</actionGroup>
90+
<actionGroup ref="StorefrontCartPageOpenActionGroup" stepKey="againGoToShoppingCart"/>
91+
<dontSeeJsError stepKey="againVerifyThatThereIsNoJSErrors"/>
92+
<actionGroup ref="AssertStorefrontCheckoutCartEstimateShippingAndTaxAddressActionGroup" stepKey="checkSwitzerlandAddress">
93+
<argument name="country" value="{{Switzerland_Address.country}}"/>
94+
<argument name="state" value="{{Switzerland_Address.state}}"/>
95+
<argument name="postcode" value="{{Switzerland_Address.postcode}}"/>
96+
</actionGroup>
97+
<actionGroup ref="StorefrontAssertCartShippingMethodSelectedActionGroup" stepKey="assertFreeShippingMethodIsCheckedAfterGoingBackToShoppingCart">
98+
<argument name="carrierCode" value="freeshipping"/>
99+
<argument name="methodCode" value="freeshipping"/>
100+
</actionGroup>
101+
</test>
102+
</tests>

0 commit comments

Comments
 (0)