Skip to content

Commit 2ca0838

Browse files
committed
B2B-1654: Add MFTF test for MC-38432
- Adding MFTF entities from previous PR
1 parent cd857f9 commit 2ca0838

File tree

8 files changed

+111
-1
lines changed

8 files changed

+111
-1
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>

app/code/Magento/Catalog/Test/Mftf/Data/ImageContentData.xml

Lines changed: 6 additions & 1 deletion
Large diffs are not rendered by default.

app/code/Magento/Catalog/Test/Mftf/Data/ProductAttributeMediaGalleryEntryData.xml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,18 @@
2020
<data key="disabled">false</data>
2121
<requiredEntity type="ImageContent">TestImageContent</requiredEntity>
2222
</entity>
23+
<entity name="ApiProductAttributeMediaGalleryEntryTestImage2" type="ProductAttributeMediaGalleryEntry">
24+
<data key="media_type">image</data>
25+
<data key="label" unique="suffix">Adobe Base </data>
26+
<data key="position">1</data>
27+
<array key="types">
28+
<item>image</item>
29+
<item>small_image</item>
30+
<item>thumbnail</item>
31+
</array>
32+
<data key="disabled">false</data>
33+
<requiredEntity type="ImageContent">AdobeBaseContent</requiredEntity>
34+
</entity>
2335
<entity name="ApiProductAttributeMediaGalleryEntryMagentoLogo" type="ProductAttributeMediaGalleryEntry">
2436
<data key="media_type">image</data>
2537
<data key="label" unique="suffix">Magento Logo </data>

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
<element name="imageFileUpload" type="input" selector="#fileupload"/>
1414
<element name="imageUploadButton" type="button" selector="div.image div.fileinput-button"/>
1515
<element name="imageFile" type="text" selector="//*[@id='media_gallery_content']//img[contains(@src, '{{url}}')]" parameterized="true"/>
16+
<element name="imageFileRoleByImage" type="text" selector="//*[@id='media_gallery_content']//img[contains(@src, '{{url}}')]/ancestor::div[@data-role='image']//*[@data-role-code='{{roleCode}}']" parameterized="true"/>
1617
<element name="imageElement" type="text" selector="#media_gallery_content img"/>
1718
<element name="removeImageButton" type="button" selector=".action-remove"/>
1819
<element name="removeImageButtonForExactImage" type="button" selector="[id='media_gallery_content'] img[src*='{{imageName}}'] + div[class='actions'] button[class='action-remove']" parameterized="true"/>
Lines changed: 18 additions & 0 deletions
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+
<entities xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:DataGenerator/etc/dataProfileSchema.xsd">
11+
<entity name="AdobeBaseContentExportImport" extends="AdobeBaseContent" type="ImageContent">
12+
<data key="name">adobe-base.jpg</data>
13+
</entity>
14+
<entity name="ApiProductAttributeMediaGalleryForExportImport3" extends="ApiProductAttributeMediaGalleryEntryTestImage2" type="ProductAttributeMediaGalleryEntry">
15+
<data key="label">Adobe Base</data>
16+
<requiredEntity type="ImageContent">AdobeBaseContentExportImport</requiredEntity>
17+
</entity>
18+
</entities>

app/code/Magento/Checkout/Test/Mftf/ActionGroup/ClickPlaceOrderActionGroup.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515

1616
<waitForElement selector="{{CheckoutPaymentSection.placeOrder}}" time="30" stepKey="waitForPlaceOrderButton"/>
1717
<click selector="{{CheckoutPaymentSection.placeOrder}}" stepKey="clickPlaceOrder"/>
18+
<waitForPageLoad stepKey="waitForCheckout"/>
1819
<see selector="{{CheckoutSuccessMainSection.successTitle}}" userInput="Thank you for your purchase!" stepKey="waitForLoadSuccessPage"/>
1920
</actionGroup>
2021
</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>

0 commit comments

Comments
 (0)