Skip to content

Commit 035a396

Browse files
committed
B2B-1653: Add MFTF test for MC-38408
- Adding import test for grouped product
1 parent a16e269 commit 035a396

12 files changed

+548
-9
lines changed
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
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="AdminAssertProductInfoOnEditPageActionGroup">
12+
<annotations>
13+
<description>Verifies the general data on the Edit product details page in admin for a product.</description>
14+
</annotations>
15+
<arguments>
16+
<argument name="productStatus" defaultValue="{{_defaultProduct.status}}" type="string"/>
17+
<argument name="productAttributeSet" defaultValue="Default" type="string"/>
18+
<argument name="productName" defaultValue="{{_defaultProduct.name}}" type="string"/>
19+
<argument name="productSku" defaultValue="{{_defaultProduct.sku}}" type="string"/>
20+
<argument name="productPrice" defaultValue="{{_defaultProduct.price}}" type="string"/>
21+
<argument name="productQuantity" defaultValue="{{_defaultProduct.quantity}}" type="string"/>
22+
<argument name="productStockStatus" defaultValue="In Stock" type="string"/>
23+
<argument name="productWeight" defaultValue="{{_defaultProduct.weight}}" type="string"/>
24+
<argument name="productVisibility" defaultValue="Catalog, Search" type="string"/>
25+
<argument name="categoryNames" defaultValue="{{_defaultCategory.name}}" type="string"/>
26+
</arguments>
27+
<waitForElementVisible selector="{{AdminProductFormSection.productStatus}}" stepKey="waitForProductStatus"/>
28+
<seeElement selector="{{AdminProductFormSection.productStatusValue(productStatus)}}" stepKey="seeProductStatus"/>
29+
<seeOptionIsSelected selector="{{AdminProductFormSection.attributeSet}}" userInput="{{productAttributeSet}}" stepKey="seeProductAttributeSet"/>
30+
<seeInField selector="{{AdminProductFormSection.productName}}" userInput="{{productName}}" stepKey="seeProductName"/>
31+
<seeInField selector="{{AdminProductFormSection.productSku}}" userInput="{{productSku}}" stepKey="seeProductSku"/>
32+
<seeInField selector="{{AdminProductFormSection.productPrice}}" userInput="{{productPrice}}" stepKey="seeProductPrice"/>
33+
<seeInField selector="{{AdminProductFormSection.productQuantity}}" userInput="{{productQuantity}}" stepKey="seeProductQuantity"/>
34+
<seeInField selector="{{AdminProductFormSection.productStockStatus}}" userInput="{{productStockStatus}}" stepKey="seeProductStockStatus"/>
35+
<seeInField selector="{{AdminProductFormSection.productWeight}}" userInput="{{productWeight}}" stepKey="seeProductWeight"/>
36+
<seeOptionIsSelected selector="{{AdminProductFormSection.visibility}}" userInput="{{productVisibility}}" stepKey="seeProductVisibility"/>
37+
<seeElement selector="{{AdminProductFormSection.categories(categoryNames)}}" stepKey="seeProductCategories"/>
38+
</actionGroup>
39+
</actionGroups>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
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="StorefrontVerifyCustomerOrderProductRowDataActionGroup">
12+
<annotations>
13+
<description>Verify a customer's order details for a product row on the view order page on the storefront</description>
14+
</annotations>
15+
<arguments>
16+
<argument name="name" type="string"/>
17+
<argument name="sku" type="string"/>
18+
<argument name="price" type="string"/>
19+
<argument name="quantity" type="string"/>
20+
<argument name="subtotal" type="string"/>
21+
<argument name="index" defaultValue="1" type="string"/>
22+
</arguments>
23+
<waitForText userInput="{{name}}" selector="{{StorefrontCustomerOrderViewSection.productNameByRow(index)}}" stepKey="seeProductName"/>
24+
<waitForText userInput="{{sku}}" selector="{{StorefrontCustomerOrderViewSection.productSkuByRow(index)}}" stepKey="seeProductSku"/>
25+
<waitForText userInput="{{price}}" selector="{{StorefrontCustomerOrderViewSection.productPriceByRow(index)}}" stepKey="seeProductPrice"/>
26+
<waitForText userInput="{{quantity}}" selector="{{StorefrontCustomerOrderViewSection.productQuantityByRow(index)}}" stepKey="seeProductQuantity"/>
27+
<waitForText userInput="{{subtotal}}" selector="{{StorefrontCustomerOrderViewSection.productSubtotalByRow(index)}}" stepKey="seeProductSubtotal"/>
28+
</actionGroup>
29+
</actionGroups>

app/code/Magento/Customer/Test/Mftf/Section/StorefrontCustomerOrderViewSection.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,11 @@
2121
<element name="createdDate" type="text" selector=".block-order-details-comments .comment-date"/>
2222
<element name="orderPlacedBy" type="text" selector=".block-order-details-comments .comment-content"/>
2323
<element name="productName" type="text" selector="//td[@data-th='Product Name']"/>
24+
<element name="productNameByRow" type="text" parameterized="true" selector="#my-orders-table tbody:nth-of-type({{index}}) td.name"/>
25+
<element name="productSkuByRow" type="text" parameterized="true" selector="#my-orders-table tbody:nth-of-type({{index}}) td.sku"/>
26+
<element name="productPriceByRow" type="text" parameterized="true" selector="#my-orders-table tbody:nth-of-type({{index}}) td.price"/>
27+
<element name="productQuantityByRow" type="text" parameterized="true" selector="#my-orders-table tbody:nth-of-type({{index}}) td.qty"/>
28+
<element name="productSubtotalByRow" type="text" parameterized="true" selector="#my-orders-table tbody:nth-of-type({{index}}) td.subtotal"/>
2429
<element name="grandTotal" type="text" selector="//tr[@class='grand_total']//td[@data-th='Grand Total']"/>
2530
</section>
2631
</sections>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
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="AdminAssertGroupedProductGeneralInfoOnEditPageActionGroup" extends="AdminAssertProductInfoOnEditPageActionGroup">
12+
<annotations>
13+
<description>Verifies the general data on the Edit product details page in admin for a grouped product.</description>
14+
</annotations>
15+
<remove keyForRemoval="seeProductPrice"/>
16+
<remove keyForRemoval="seeProductWeight"/>
17+
</actionGroup>
18+
</actionGroups>
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+
<entities xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:DataGenerator/etc/dataProfileSchema.xsd">
11+
<!-- Categories -->
12+
<entity name="Import_Grouped" type="category">
13+
<data key="name">import-grouped</data>
14+
<data key="name_lwr">import-grouped</data>
15+
<data key="is_active">true</data>
16+
<data key="include_in_menu">true</data>
17+
<data key="urlKey">import-grouped</data>
18+
</entity>
19+
20+
<!-- Products -->
21+
<entity name="ImportSimple1_Grouped" type="product">
22+
<data key="name">import-simple1-grouped</data>
23+
<data key="sku">import-simple1-grouped</data>
24+
<data key="type_id">simple</data>
25+
<data key="attribute_set_id">4</data>
26+
<data key="price">11.00</data>
27+
<data key="visibility">4</data>
28+
<data key="status">1</data>
29+
<data key="quantity">101</data>
30+
<data key="groupedDefaultQuantity">3</data>
31+
<data key="groupedPosition">1</data>
32+
<data key="urlKey">import-simple1-grouped</data>
33+
<data key="weight">1</data>
34+
<data key="thumbnailImage">/m/a/magento-logo.png</data>
35+
<requiredEntity type="product_extension_attribute">EavStockItem</requiredEntity>
36+
<requiredEntity type="custom_attribute_array">CustomAttributeCategoryIds</requiredEntity>
37+
</entity>
38+
<entity name="ImportSimple2_Grouped" type="product">
39+
<data key="name">import-simple2-grouped</data>
40+
<data key="sku">import-simple2-grouped</data>
41+
<data key="type_id">simple</data>
42+
<data key="attribute_set_id">4</data>
43+
<data key="price">12.00</data>
44+
<data key="visibility">4</data>
45+
<data key="status">1</data>
46+
<data key="quantity">102</data>
47+
<data key="groupedDefaultQuantity">2</data>
48+
<data key="groupedPosition">0</data>
49+
<data key="urlKey">import-simple2-grouped</data>
50+
<data key="weight">2</data>
51+
<data key="thumbnailImage">/t/e/test_image.jpg</data>
52+
<requiredEntity type="product_extension_attribute">EavStockItem</requiredEntity>
53+
<requiredEntity type="custom_attribute_array">CustomAttributeCategoryIds</requiredEntity>
54+
</entity>
55+
<entity name="ImportSimple3_Grouped" type="product">
56+
<data key="name">import-simple3-grouped</data>
57+
<data key="sku">import-simple3-grouped</data>
58+
<data key="type_id">simple</data>
59+
<data key="attribute_set_id">4</data>
60+
<data key="price">13.00</data>
61+
<data key="visibility">4</data>
62+
<data key="status">1</data>
63+
<data key="quantity">103</data>
64+
<data key="groupedDefaultQuantity">1</data>
65+
<data key="groupedPosition">2</data>
66+
<data key="urlKey">import-simple3-grouped</data>
67+
<data key="weight">3</data>
68+
<data key="thumbnailImage">/a/d/adobe-base.jpg</data>
69+
<requiredEntity type="product_extension_attribute">EavStockItem</requiredEntity>
70+
<requiredEntity type="custom_attribute_array">CustomAttributeCategoryIds</requiredEntity>
71+
</entity>
72+
<entity name="ImportProduct_Grouped" type="product">
73+
<data key="fileName">import_grouped_product.csv</data>
74+
<data key="importSummary">Created: 4, Updated: 0, Deleted: 0</data>
75+
<data key="name">import-grouped-product</data>
76+
<data key="sku">import-grouped-product</data>
77+
<data key="type_id">grouped</data>
78+
<data key="attribute_set_id">4</data>
79+
<data key="price"/>
80+
<data key="visibility">4</data>
81+
<data key="status">1</data>
82+
<data key="quantity">0</data>
83+
<data key="weight">1</data>
84+
<data key="urlKey">import-grouped-product</data>
85+
</entity>
86+
</entities>

0 commit comments

Comments
 (0)