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>
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
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="LoginAsCustomerOnCheckoutPageActionGroup">
12+
<arguments>
13+
<argument name="customer" type="entity"/>
14+
</arguments>
15+
<waitForPageLoad stepKey="waitForCheckoutShippingSectionToLoad"/>
16+
<fillField selector="{{CheckoutShippingSection.email}}" userInput="{{customer.email}}" stepKey="fillEmailField"/>
17+
<waitForLoadingMaskToDisappear stepKey="waitForLoadingMaskToDisappear"/>
18+
<waitForElementVisible selector="{{CheckoutShippingSection.password}}" stepKey="waitForElementVisible"/>
19+
<fillField selector="{{CheckoutShippingSection.password}}" userInput="{{customer.password}}" stepKey="fillPasswordField"/>
20+
<waitForLoadingMaskToDisappear stepKey="waitForLoadingMaskToDisappear2"/>
21+
<waitForElementVisible selector="{{CheckoutShippingSection.loginButton}}" stepKey="waitForLoginButtonVisible"/>
22+
<doubleClick selector="{{CheckoutShippingSection.loginButton}}" stepKey="clickLoginBtn"/>
23+
<waitForLoadingMaskToDisappear stepKey="waitForLoadingMaskToDisappear3"/>
24+
<waitForPageLoad stepKey="waitToBeLoggedIn"/>
25+
<waitForElementNotVisible selector="{{CheckoutShippingSection.email}}" userInput="{{customer.email}}" stepKey="waitForEmailInvisible" time ="60"/>
26+
</actionGroup>
27+
</actionGroups>
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
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="LoginAsCustomerUsingSignInLinkActionGroup">
12+
<arguments>
13+
<argument name="customer" type="entity"/>
14+
</arguments>
15+
<click selector="{{StorefrontCustomerSignInLinkSection.signInLink}}" stepKey="clickOnCustomizeAndAddToCartButton"/>
16+
<fillField selector="{{StorefrontCustomerSignInLinkSection.email}}" userInput="{{customer.email}}" stepKey="fillEmail"/>
17+
<fillField selector="{{StorefrontCustomerSignInLinkSection.password}}" userInput="{{customer.password}}" stepKey="fillPassword"/>
18+
<click selector="{{StorefrontCustomerSignInLinkSection.signInBtn}}" stepKey="clickSignInBtn"/>
19+
</actionGroup>
20+
</actionGroups>

app/code/Magento/Checkout/Test/Mftf/Data/QuoteData.xml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,4 +37,21 @@
3737
<data key="subtotal">1,320.00</data>
3838
<data key="currency">$</data>
3939
</entity>
40+
<entity name="quoteQty2Price123" type="Quote">
41+
<data key="price">123.00</data>
42+
<data key="qty">2</data>
43+
<data key="shipping">10.00</data>
44+
<data key="subtotal">246.00</data>
45+
<data key="total">256.00</data>
46+
<data key="currency">$</data>
47+
</entity>
48+
<entity name="quoteQty2Subtotal266" type="Quote">
49+
<data key="qty">2</data>
50+
<data key="customOptionsPrice">20</data>
51+
<data key="price">143</data>
52+
<data key="subtotal">266.00</data>
53+
<data key="shipping">10.00</data>
54+
<data key="total">276.00</data>
55+
<data key="currency">$</data>
56+
</entity>
4057
</entities>

app/code/Magento/Checkout/Test/Mftf/Section/CheckoutCartProductSection.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
<element name="ProductPriceByOption" type="text" selector="//*[contains(@class, 'item-options')]/dd[normalize-space(.)='{{var1}}']/ancestor::tr//td[contains(@class, 'price')]//span[@class='price']" parameterized="true"/>
2828
<element name="RemoveItem" type="button"
2929
selector="//table[@id='shopping-cart-table']//tbody//tr[contains(@class,'item-actions')]//a[contains(@class,'action-delete')]"/>
30+
<element name="removeProductByName" selector="//*[contains(text(), '{{productName}}')]/ancestor::tbody//a[@class='action action-delete']" parameterized="true" timeout="30"/>
3031
<element name="productName" type="text" selector="//tbody[@class='cart item']//strong[@class='product-item-name']"/>
3132
<element name="nthItemOption" type="block" selector=".item:nth-of-type({{numElement}}) .item-options" parameterized="true"/>
3233
<element name="nthEditButton" type="block" selector=".item:nth-of-type({{numElement}}) .action-edit" parameterized="true"/>

app/code/Magento/Checkout/Test/Mftf/Section/CheckoutPaymentSection.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,14 @@
1414
<element name="notAvailablePaymentSolutions" type="text" selector="#checkout-payment-method-load>div>div>div.payment-method._active>div.payment-method-title.field.choice"/>
1515
<element name="billingNewAddressForm" type="text" selector="[data-form='billing-new-address']"/>
1616
<element name="billingAddressNotSameCheckbox" type="checkbox" selector="#billing-address-same-as-shipping-checkmo"/>
17+
<element name="editAddress" type="button" selector="button.action.action-edit-address"/>
1718
<element name="placeOrderDisabled" type="button" selector="#checkout-payment-method-load button.disabled"/>
1819
<element name="update" type="button" selector=".payment-method-billing-address .action.action-update"/>
1920
<element name="guestFirstName" type="input" selector=".billing-address-form input[name*='firstname']"/>
2021
<element name="guestLastName" type="input" selector=".billing-address-form input[name*='lastname']"/>
2122
<element name="guestStreet" type="input" selector=".billing-address-form input[name*='street[0]']"/>
2223
<element name="guestCity" type="input" selector=".billing-address-form input[name*='city']"/>
24+
<element name="guestCountry" type="select" selector=".billing-address-form select[name*='country_id']"/>
2325
<element name="guestRegion" type="select" selector=".billing-address-form select[name*='region_id']"/>
2426
<element name="guestPostcode" type="input" selector=".billing-address-form input[name*='postcode']"/>
2527
<element name="guestTelephone" type="input" selector=".billing-address-form input[name*='telephone']"/>

app/code/Magento/Checkout/Test/Mftf/Section/CheckoutShippingGuestInfoSection.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,14 @@
1212
<element name="email" type="input" selector="#checkout-customer-email"/>
1313
<element name="firstName" type="input" selector="input[name=firstname]"/>
1414
<element name="lastName" type="input" selector="input[name=lastname]"/>
15+
<element name="company" type="input" selector="input[name=company]"/>
1516
<element name="street" type="input" selector="input[name='street[0]']"/>
1617
<element name="street2" type="input" selector="input[name='street[1]']"/>
1718
<element name="city" type="input" selector="input[name=city]"/>
1819
<element name="region" type="select" selector="select[name=region_id]"/>
1920
<element name="regionInput" type="input" selector="input[name=region]"/>
2021
<element name="postcode" type="input" selector="input[name=postcode]"/>
2122
<element name="country" type="select" selector="select[name=country_id]"/>
22-
<element name="company" type="input" selector="input[name=company]"/>
2323
<element name="telephone" type="input" selector="input[name=telephone]"/>
2424
<element name="next" type="button" selector="button.button.action.continue.primary" timeout="30"/>
2525
<element name="firstShippingMethod" type="radio" selector=".row:nth-of-type(1) .col-method .radio"/>

0 commit comments

Comments
 (0)