Skip to content

Commit 2ec065d

Browse files
authored
Merge pull request #4154 from magento-pangolin/mtf-eol-pr
[pangolins] Convert MTF tests to MFTF tests
2 parents 0a7221a + cec11d5 commit 2ec065d

File tree

84 files changed

+3577
-23
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

84 files changed

+3577
-23
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
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+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
9+
<actionGroup name="StorefrontAssertProductSpecialPriceOnProductPageActionGroup">
10+
<arguments>
11+
<argument name="product" type="entity"/>
12+
<argument name="specialPrice" type="string"/>
13+
</arguments>
14+
<amOnPage url="{{StorefrontProductPage.url(product.name)}}" stepKey="onFirstProductPage"/>
15+
<waitForPageLoad stepKey="waitForFirstProductPage"/>
16+
<grabTextFrom selector="{{StorefrontProductInfoMainSection.specialPriceValue}}" stepKey="grabProductSpecialPrice"/>
17+
<assertEquals actual="$grabProductSpecialPrice" expectedType="string" expected="{{specialPrice}}" stepKey="assertProductPriceValuesAreEqual"/>
18+
</actionGroup>
19+
</actionGroups>

app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontProductPageActionGroup.xml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,14 @@
1919
<see selector="{{StorefrontMessagesSection.success}}" userInput="You added {{productName}} to your shopping cart." stepKey="seeAddToCartSuccessMessage"/>
2020
</actionGroup>
2121

22+
<actionGroup name="AddProductWithQtyToCartFromStorefrontProductPage" extends="addToCartFromStorefrontProductPage">
23+
<arguments>
24+
<argument name="productName" type="string"/>
25+
<argument name="productQty" type="string"/>
26+
</arguments>
27+
<fillField selector="{{StorefrontProductActionSection.quantity}}" userInput="{{productQty}}" stepKey="fillProductQuantity" before="addToCart"/>
28+
</actionGroup>
29+
2230
<!--Verify text length validation hint with multiple inputs-->
2331
<actionGroup name="testDynamicValidationHint">
2432
<arguments>

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

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -481,6 +481,11 @@
481481
<var key="sku" entityType="product" entityKey="sku" />
482482
<requiredEntity type="product_option">ProductOptionValueDropdown</requiredEntity>
483483
</entity>
484+
<entity name="productWithDropdownAndFieldOptions" type="product">
485+
<var key="sku" entityType="product" entityKey="sku" />
486+
<requiredEntity type="product_option">ProductOptionValueDropdown</requiredEntity>
487+
<requiredEntity type="product_option">ProductOptionField</requiredEntity>
488+
</entity>
484489
<entity name="ProductWithTextFieldAndAreaOptions" type="product">
485490
<var key="sku" entityType="product" entityKey="sku" />
486491
<requiredEntity type="product_option">ProductOptionField</requiredEntity>
@@ -1069,4 +1074,74 @@
10691074
<requiredEntity type="product_extension_attribute">EavStockItem</requiredEntity>
10701075
<requiredEntity type="custom_attribute_array">ApiProductDescription</requiredEntity>
10711076
</entity>
1077+
<entity name="SimpleProductWithSpecialPrice" type="product">
1078+
<data key="sku" unique="suffix">SimpleProductWithSpecialPrice</data>
1079+
<data key="type_id">simple</data>
1080+
<data key="attribute_set_id">4</data>
1081+
<data key="name" unique="suffix">SimpleProduct</data>
1082+
<data key="price">100.00</data>
1083+
<data key="special_price">90.00</data>
1084+
<data key="visibility">4</data>
1085+
<data key="status">1</data>
1086+
<data key="quantity">86</data>
1087+
<data key="urlKey" unique="suffix">simpleproduct</data>
1088+
<data key="weight">1</data>
1089+
<requiredEntity type="product_extension_attribute">EavStockItem</requiredEntity>
1090+
<requiredEntity type="custom_attribute_array">CustomAttributeCategoryIds</requiredEntity>
1091+
</entity>
1092+
<entity name="SimpleProductWithSpecialPriceSecond" type="product">
1093+
<data key="sku" unique="suffix">SimpleProductWithSpecialPriceSecond</data>
1094+
<data key="type_id">simple</data>
1095+
<data key="attribute_set_id">4</data>
1096+
<data key="name" unique="suffix">SimpleProduct</data>
1097+
<data key="price">150.00</data>
1098+
<data key="special_price">110.00</data>
1099+
<data key="visibility">4</data>
1100+
<data key="status">1</data>
1101+
<data key="quantity">86</data>
1102+
<data key="urlKey" unique="suffix">simpleproduct</data>
1103+
<data key="weight">1</data>
1104+
<requiredEntity type="product_extension_attribute">EavStockItem</requiredEntity>
1105+
<requiredEntity type="custom_attribute_array">CustomAttributeCategoryIds</requiredEntity>
1106+
</entity>
1107+
<entity name="SimpleProduct_100" type="product">
1108+
<data key="sku" unique="suffix">testSku</data>
1109+
<data key="type_id">simple</data>
1110+
<data key="attribute_set_id">4</data>
1111+
<data key="visibility">4</data>
1112+
<data key="name" unique="suffix">testProductName</data>
1113+
<data key="price">100.00</data>
1114+
<data key="urlKey" unique="suffix">testurlkey</data>
1115+
<data key="status">1</data>
1116+
<data key="quantity">777</data>
1117+
<data key="weight">1</data>
1118+
<requiredEntity type="product_extension_attribute">EavStock777</requiredEntity>
1119+
<requiredEntity type="custom_attribute_array">CustomAttributeCategoryIds</requiredEntity>
1120+
</entity>
1121+
<entity name="ApiSimpleOneQty10" type="product2">
1122+
<data key="sku" unique="suffix">api-simple-product</data>
1123+
<data key="type_id">simple</data>
1124+
<data key="attribute_set_id">4</data>
1125+
<data key="visibility">4</data>
1126+
<data key="name" unique="suffix">Api Simple Product</data>
1127+
<data key="price">40.00</data>
1128+
<data key="urlKey" unique="suffix">api-simple-product</data>
1129+
<data key="status">1</data>
1130+
<data key="quantity">10</data>
1131+
<requiredEntity type="product_extension_attribute">EavStock10</requiredEntity>
1132+
<requiredEntity type="custom_attribute">CustomAttributeProductAttribute</requiredEntity>
1133+
</entity>
1134+
<entity name="ApiSimpleTwoQty10" type="product2">
1135+
<data key="sku" unique="suffix">api-simple-product-two</data>
1136+
<data key="type_id">simple</data>
1137+
<data key="attribute_set_id">4</data>
1138+
<data key="visibility">4</data>
1139+
<data key="name" unique="suffix">Api Simple Product Two</data>
1140+
<data key="price">40.00</data>
1141+
<data key="urlKey" unique="suffix">api-simple-product-two</data>
1142+
<data key="status">1</data>
1143+
<data key="quantity">10</data>
1144+
<requiredEntity type="product_extension_attribute">EavStock10</requiredEntity>
1145+
<requiredEntity type="custom_attribute">CustomAttributeProductAttribute</requiredEntity>
1146+
</entity>
10721147
</entities>

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,7 @@
2020
<entity name="EavStock1" type="product_extension_attribute">
2121
<requiredEntity type="stock_item">Qty_1</requiredEntity>
2222
</entity>
23+
<entity name="EavStock777" type="product_extension_attribute">
24+
<requiredEntity type="stock_item">Qty_777</requiredEntity>
25+
</entity>
2326
</entities>

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,8 @@
3232
<data key="qty">1</data>
3333
<data key="is_in_stock">true</data>
3434
</entity>
35+
<entity name="Qty_777" type="stock_item">
36+
<data key="qty">777</data>
37+
<data key="is_in_stock">true</data>
38+
</entity>
3539
</entities>
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
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+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
9+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
10+
<actionGroup name="AssertShoppingCartIsEmptyActionGroup">
11+
<amOnPage url="{{CheckoutCartPage.url}}" stepKey="amOnPageShoppingCart"/>
12+
<waitForPageLoad stepKey="waitForCheckoutPageLoad"/>
13+
<see userInput="You have no items in your shopping cart." stepKey="seeNoItemsInShoppingCart"/>
14+
</actionGroup>
15+
</actionGroups>

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
</arguments>
1414
<waitForLoadingMaskToDisappear stepKey="waitForMaskToDisappear" after="assertSubtotal"/>
1515
<waitForElementVisible selector="{{CheckoutCartSummarySection.shipping}}" time="60" stepKey="waitForElementToBeVisible" after="waitForMaskToDisappear"/>
16-
<waitForText userInput="{{shipping}}" selector="{{CheckoutCartSummarySection.shipping}}" time="60" stepKey="assertShipping" after="waitForElementToBeVisible"/>
16+
<wait time="5" stepKey="waitForShippingDetailsToLoad" after="waitForElementToBeVisible"/>
17+
<waitForText userInput="{{shipping}}" selector="{{CheckoutCartSummarySection.shipping}}" time="120" stepKey="assertShipping" after="waitForShippingDetailsToLoad"/>
1718
</actionGroup>
1819
</actionGroups>
Lines changed: 23 additions & 0 deletions
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="CustomerCheckoutFillNewShippingAddressActionGroup">
12+
<arguments>
13+
<argument name="address" type="entity"/>
14+
</arguments>
15+
<selectOption selector="{{CheckoutShippingSection.country}}" userInput="{{address.country}}" stepKey="selectCounty"/>
16+
<fillField selector="{{CheckoutShippingSection.street}}" userInput="{{address.street}}" stepKey="fillStreet"/>
17+
<fillField selector="{{CheckoutShippingSection.city}}" userInput="{{address.city}}" stepKey="fillCity"/>
18+
<selectOption selector="{{CheckoutShippingSection.region}}" userInput="{{address.state}}" stepKey="selectRegion"/>
19+
<fillField selector="{{CheckoutShippingSection.postcode}}" userInput="{{address.postcode}}" stepKey="fillZipCode"/>
20+
<fillField selector="{{CheckoutShippingSection.telephone}}" userInput="{{address.telephone}}" stepKey="fillPhone"/>
21+
<fillField selector="{{CheckoutShippingSection.company}}" userInput="{{address.company}}" stepKey="fillCompany"/>
22+
</actionGroup>
23+
</actionGroups>
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.z
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="DeleteProductFromShoppingCartActionGroup">
12+
<arguments>
13+
<argument name="productName" type="string"/>
14+
</arguments>
15+
<click selector="{{CheckoutCartProductSection.removeProductByName(productName)}}" stepKey="deleteProductFromCheckoutCart"/>
16+
<waitForPageLoad stepKey="waitForPageLoad"/>
17+
<see userInput="You have no items in your shopping cart." stepKey="seeNoItemsInShoppingCart"/>
18+
</actionGroup>
19+
</actionGroups>
Lines changed: 25 additions & 0 deletions
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="GuestCheckoutFillNewShippingAddressActionGroup">
12+
<arguments>
13+
<argument name="customer" type="entity"/>
14+
<argument name="address" type="entity"/>
15+
</arguments>
16+
<fillField selector="{{CheckoutShippingSection.email}}" userInput="{{customer.email}}" stepKey="fillEmailField"/>
17+
<fillField selector="{{CheckoutShippingSection.firstName}}" userInput="{{customer.firstName}}" stepKey="fillFirstName"/>
18+
<fillField selector="{{CheckoutShippingSection.lastName}}" userInput="{{customer.lastName}}" stepKey="fillLastName"/>
19+
<fillField selector="{{CheckoutShippingSection.street}}" userInput="{{address.street}}" stepKey="fillStreet"/>
20+
<fillField selector="{{CheckoutShippingSection.city}}" userInput="{{address.city}}" stepKey="fillCity"/>
21+
<selectOption selector="{{CheckoutShippingSection.region}}" userInput="{{address.state}}" stepKey="selectRegion"/>
22+
<fillField selector="{{CheckoutShippingSection.postcode}}" userInput="{{address.postcode}}" stepKey="fillZipCode"/>
23+
<fillField selector="{{CheckoutShippingSection.telephone}}" userInput="{{address.telephone}}" stepKey="fillPhone"/>
24+
</actionGroup>
25+
</actionGroups>

0 commit comments

Comments
 (0)