Skip to content

Commit 57a10c8

Browse files
committed
mftf coverage for issue-37437 fix
1 parent 9ea8627 commit 57a10c8

File tree

2 files changed

+106
-0
lines changed

2 files changed

+106
-0
lines changed
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
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="AssertOnlyOneProductPresentedInWishlistActionGroup">
12+
<annotations>
13+
<description>Assert that there is only one product with specific product name and price on the Wishlist on hover.</description>
14+
</annotations>
15+
<arguments>
16+
<argument name="productName" type="string"/>
17+
<argument name="productPrice" type="string"/>
18+
</arguments>
19+
<amOnPage url="{{StorefrontCustomerWishlistPage.url}}" stepKey="goToWishList"/>
20+
<waitForPageLoad stepKey="waitForWishList"/>
21+
<waitForElement selector="{{StorefrontCustomerWishlistProductSection.ProductTitleByName(productName)}}" time="30" stepKey="assertProductName"/>
22+
<see userInput="{{productPrice}}" selector="{{StorefrontCustomerWishlistProductSection.ProductPriceByName(productName)}}" stepKey="assertProductPrice"/>
23+
24+
<grabMultiple selector="{{StorefrontCustomerWishlistProductSection.ProductInfoByName(productName)}}" stepKey="countProductsInWishlist"/>
25+
<assertCount stepKey="check">
26+
<expectedResult type="int">1</expectedResult>
27+
<actualResult type="variable">countProductsInWishlist</actualResult>
28+
</assertCount>
29+
</actionGroup>
30+
</actionGroups>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
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="StorefrontAddSimpleProductWithTextFieldAndAreaAndFileOptionsToWishlistTest">
12+
<annotations>
13+
<features value="Wishlist"/>
14+
<stories value="Add product to wishlist"/>
15+
<title value="Add simple product with customizable file and text and area options to wishlist"/>
16+
<description value="Add simple Product with customizable file and text and area options to Wishlist and verify customizable options are preserved, and the product was added only once"/>
17+
<severity value="AVERAGE"/>
18+
<testCaseId value="https://github.com/magento/magento2/issues/37437"/>
19+
<useCaseId value="https://github.com/magento/magento2/issues/37437"/>
20+
<group value="wishlist"/>
21+
</annotations>
22+
<before>
23+
<createData entity="Simple_US_Customer" stepKey="createCustomer"/>
24+
<createData entity="SimpleProduct2" stepKey="createProduct">
25+
<field key="price">100.00</field>
26+
</createData>
27+
<updateData entity="ProductWithTextFieldAndAreaAndFileOptions" createDataKey="createProduct" stepKey="updateProductWithOptions">
28+
<requiredEntity createDataKey="createProduct"/>
29+
</updateData>
30+
</before>
31+
<after>
32+
<actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/>
33+
<deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/>
34+
<deleteData createDataKey="createProduct" stepKey="deleteProduct1"/>
35+
</after>
36+
37+
<!-- Login as a customer -->
38+
<actionGroup ref="LoginToStorefrontActionGroup" stepKey="loginToStorefrontAccount">
39+
<argument name="Customer" value="$createCustomer$"/>
40+
</actionGroup>
41+
42+
<!-- Open Product page -->
43+
<actionGroup ref="StorefrontOpenProductPageActionGroup" stepKey="openProductPage">
44+
<argument name="productUrl" value="$createProduct.custom_attributes[url_key]$"/>
45+
</actionGroup>
46+
<fillField userInput="OptionField" selector="{{StorefrontProductInfoMainSection.productOptionFieldInput(ProductOptionField.title)}}" stepKey="fillProductOptionInputField"/>
47+
<fillField userInput="OptionArea" selector="{{StorefrontProductInfoMainSection.productOptionAreaInput(ProductOptionArea.title)}}" stepKey="fillProductOptionInputArea"/>
48+
<attachFile userInput="adobe-base.jpg" selector="{{StorefrontProductInfoMainSection.addLinkFileUploadFile(ProductOptionFile.title)}}" stepKey="fillUploadFile"/>
49+
50+
<!-- Add product to the wishlist -->
51+
<actionGroup ref="StorefrontCustomerAddProductToWishlistActionGroup" stepKey="addProductWithOptionToWishlist">
52+
<argument name="productVar" value="$createProduct$"/>
53+
</actionGroup>
54+
55+
<!-- Assert product is present in wishlist -->
56+
<actionGroup ref="AssertOnlyOneProductPresentedInWishlistActionGroup" stepKey="assertProductPresent">
57+
<argument name="productName" value="$createProduct.name$"/>
58+
<argument name="productPrice" value="$129.99"/>
59+
</actionGroup>
60+
61+
<!-- Edit wishlist product -->
62+
<actionGroup ref="StorefrontCustomerUpdateWishlistItemActionGroup" stepKey="clickEditWishlistItem">
63+
<argument name="productName" value="$createProduct.name$"/>
64+
</actionGroup>
65+
66+
<!-- Update product in wishlist from product page -->
67+
<actionGroup ref="StorefrontCustomerUpdateProductInWishlistActionGroup" stepKey="updateProductWithOptionInWishlist">
68+
<argument name="productVar" value="$createProduct$"/>
69+
</actionGroup>
70+
71+
<actionGroup ref="AssertOnlyOneProductPresentedInWishlistActionGroup" stepKey="assertProductPresent2">
72+
<argument name="productName" value="$createProduct.name$"/>
73+
<argument name="productPrice" value="$129.99"/>
74+
</actionGroup>
75+
</test>
76+
</tests>

0 commit comments

Comments
 (0)