Skip to content

Commit 846109a

Browse files
committed
ACP2E-1784: updated mftf
1 parent 2b42295 commit 846109a

6 files changed

+53
-7
lines changed

app/code/Magento/Bundle/Test/Mftf/Section/StorefrontProductInfoMainSection.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616
<element name="asLowAsFinalPrice" type="text" selector="div.price-box.price-final_price p.minimal-price > span.price-final_price span.price"/>
1717
<element name="fixedFinalPrice" type="text" selector="div.price-box.price-final_price > span.price-final_price span.price"/>
1818
<element name="productBundleOptionsCheckbox" type="checkbox" selector="//*[@id='product-options-wrapper']//div[@class='fieldset']//label[contains(.,'{{childName}}')]/../input" parameterized="true" timeout="30"/>
19+
<element name="productBundleOneOptionInput" type="input" selector="//*[@id='product-options-wrapper']//div[@class='fieldset']//label[contains(.,'{{childName}}')]/..//input[contains(@class, 'option')]" parameterized="true" timeout="30"/>
20+
<element name="productBundleOptionQty" type="input" selector="//*[@id='product-options-wrapper']//div[@class='fieldset']//label[contains(.,'{{childName}}')]/..//input[contains(@class, 'qty')]" parameterized="true" timeout="30"/>
1921
<element name="includingTaxPrice" type="text" selector=".//*[@class='price-wrapper price-including-tax']/span"/>
2022
<element name="excludingTaxPrice" type="text" selector=".//*[@class='price-wrapper price-excluding-tax']/span"/>
2123
</section>

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
<element name="price" type="text" selector=".product-info-main [data-price-type='finalPrice']"/>
1717
<element name="productPrice" type="text" selector=".price-final_price"/>
1818
<element name="qty" type="input" selector="#qty"/>
19+
<element name="qtyByClassAndQuantity" type="input" selector="//input[contains(@class,'qty') and @value='quantity']" parameterized="true"/>
1920
<element name="specialPrice" type="text" selector=".special-price"/>
2021
<element name="specialPriceAmount" type="text" selector=".special-price span.price"/>
2122
<element name="updatedPrice" type="text" selector="div.price-box.price-final_price [data-price-type='finalPrice'] .price"/>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
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="StorefrontCustomerAccessProductFromWishlistActionGroup">
12+
<annotations>
13+
<description>Go to product page from Wish List. Validates that the quantity is the same from Wish List.</description>
14+
</annotations>
15+
<arguments>
16+
<argument name="productVar" type="string"/>
17+
<argument name="quantity" type="string"/>
18+
<argument name="index" defaultValue="1" type="string"/>
19+
</arguments>
20+
21+
<click selector="{{StorefrontCustomerWishlistSection.productLinkByProductName(productVar)}}" stepKey="goToProductPageFromWishlist"/>
22+
<waitForPageLoad stepKey="waitForPageLoad"/>
23+
<seeInField selector="{{StorefrontProductInfoMainSection.groupedProductsAssociatedProductQuantity(index)}}" userInput="{{quantity}}" stepKey="assertProductQuantity"/>
24+
</actionGroup>
25+
</actionGroups>

app/code/Magento/Wishlist/Test/Mftf/ActionGroup/StorefrontCustomerAddBundleProductQuantityAndAddToWishListActionGroup.xml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,14 @@
1313
<description>Fills in the provided Bundle Product Quantity on a Storefront product page. Clicks on Add to Wish List.</description>
1414
</annotations>
1515
<arguments>
16-
<argument name="quantity" defaultValue="1" type="string"/>
17-
16+
<argument name="childQuantity" defaultValue="1" type="string"/>
17+
<argument name="parentQuantity" defaultValue="1" type="string" />
18+
<argument name="optionName" type="string"/>
1819
</arguments>
1920

20-
<clearField selector="{{StorefrontProductInfoMainSection.qty}}" stepKey="clearTheQuantityField" before="WaitForWishList"/>
21-
<fillField selector="{{StorefrontProductInfoMainSection.qty}}" userInput="{{quantity}}" stepKey="fillTheProductQuantity" after="clearTheQuantityField"/>
21+
<clearField selector="{{StorefrontProductInfoMainSection.qty}}" stepKey="clearParentQuantityField" before="WaitForWishList"/>
22+
<fillField selector="{{StorefrontProductInfoMainSection.qty}}" userInput="{{parentQuantity}}" stepKey="fillParentProductQuantity" after="clearParentQuantityField"/>
23+
<clearField selector="{{StorefrontProductInfoMainSection.productBundleOptionQty(optionName)}}" stepKey="clearChildQuantityField" before="fillParentProductQuantity"/>
24+
<fillField selector="{{StorefrontProductInfoMainSection.productBundleOptionQty(optionName)}}" userInput="{{childQuantity}}" stepKey="fillChildProductQuantity" after="clearChildQuantityField" />
2225
</actionGroup>
2326
</actionGroups>

app/code/Magento/Wishlist/Test/Mftf/Section/StorefrontCustomerWishlistSection.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@
1212
<element name="pageTitle" type="text" selector="h1.page-title"/>
1313
<element name="successMsg" type="text" selector="div.message-success.success.message"/>
1414
<element name="productItemNameText" type="text" selector=".products-grid .product-item-name a"/>
15+
<element name="productLinkByProductName" type="text" selector="//a[contains(text(), '{{prodName}}') and contains(@class,'product-item-link')]" parameterized="true" timeout="30"/>
1516
<element name="removeWishlistButton" type="button" selector="//main//li[.//a[contains(text(), '{{prodName}}')]]//a[@data-role='remove']" parameterized="true" timeout="30"/>
1617
<element name="emptyWishlistText" type="text" selector=".message.info.empty>span"/>
1718
</section>
18-
</sections>
19+
</sections>

app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontAddProductsWithCustomizedQuantitiesTest.xml

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,6 @@
126126
<argument name="quantity" value="100"/>
127127
</actionGroup>
128128

129-
130129
<!-- Open Grouped Product page -->
131130
<actionGroup ref="StorefrontOpenProductPageActionGroup" stepKey="openGroupedProductPage">
132131
<argument name="productUrl" value="$createGroupedProduct.custom_attributes[url_key]$"/>
@@ -161,7 +160,9 @@
161160
<!-- Add Bundle product to the wishlist -->
162161
<actionGroup ref="StorefrontCustomerAddBundleProductQuantityAndAddToWishListActionGroup" stepKey="addBundleProductToWishlist">
163162
<argument name="productVar" value="$createBundleProduct$"/>
164-
<argument name="quantity" value="100"/>
163+
<argument name="parentQuantity" value="100"/>
164+
<argument name="childQuantity" value="100" />
165+
<argument name="optionName" value="$$createBundleOption1_1.value$$" />
165166
</actionGroup>
166167

167168
<!-- Assert Simple product is present in wishlist -->
@@ -184,5 +185,18 @@
184185
<argument name="productName" value="$createProduct.name$"/>
185186
<argument name="productQuantity" value="100"/>
186187
</actionGroup>
188+
189+
<!-- Go to Grouped PDP from Wishlist -->
190+
<actionGroup ref="StorefrontCustomerAccessProductFromWishlistActionGroup" stepKey="goToGroupedProductPage">
191+
<argument name="productVar" value="$createGroupedProduct.name$"/>
192+
<argument name="quantity" value="100"/>
193+
</actionGroup>
194+
195+
<!-- Add Grouped product to the wishlist again -->
196+
<actionGroup ref="StorefrontCustomerAddGroupedProductQuantityAndAddToWishListActionGroup" stepKey="readdGroupedProductToWishlist">
197+
<argument name="productVar" value="$createGroupedProduct$"/>
198+
<argument name="quantity" value="100"/>
199+
</actionGroup>
200+
187201
</test>
188202
</tests>

0 commit comments

Comments
 (0)