Skip to content

Commit 71f9784

Browse files
authored
Merge pull request magento#4946 from magento-pangolin/community-tests-migration-pr
[MFTF] Deliver MTF to MFTF test conversion
2 parents 7d23e3f + e683445 commit 71f9784

File tree

38 files changed

+893
-19
lines changed

38 files changed

+893
-19
lines changed

app/code/Magento/Analytics/Test/Mftf/Data/UserRoleData.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
<entities xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
1010
xsi:noNamespaceSchemaLocation="urn:magento:mftf:DataGenerator/etc/dataProfileSchema.xsd">
1111
<entity name="adminNoReportRole" type="user_role">
12+
<data key="all">0</data>
1213
<data key="rolename" unique="suffix">noreport</data>
1314
<data key="current_password">123123q</data>
1415
<array key="resource">
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
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="AssertAdminUserIsInGridActionGroup">
12+
<arguments>
13+
<argument name="user" type="entity"/>
14+
</arguments>
15+
<click selector="{{AdminUserGridSection.resetButton}}" stepKey="resetGridFilter"/>
16+
<waitForPageLoad stepKey="waitForFiltersReset" time="15"/>
17+
<fillField selector="{{AdminUserGridSection.usernameFilterTextField}}" userInput="{{user.username}}" stepKey="enterUserName"/>
18+
<click selector="{{AdminUserGridSection.searchButton}}" stepKey="clickSearch"/>
19+
<waitForPageLoad stepKey="waitForGridToLoad" time="15"/>
20+
<see selector="{{AdminUserGridSection.usernameInFirstRow}}" userInput="{{user.username}}" stepKey="seeUser"/>
21+
</actionGroup>
22+
</actionGroups>
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
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="AssertUserRoleRestrictedAccessActionGroup">
12+
<see selector="{{AdminHeaderSection.pageHeading}}" userInput="Sorry, you need permissions to view this content." stepKey="seeErrorMessage"/>
13+
</actionGroup>
14+
</actionGroups>

app/code/Magento/Backend/Test/Mftf/Data/CookieConfigData.xml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,20 @@
2020
<data key="scope_code">base</data>
2121
<data key="value">''</data>
2222
</entity>
23+
<entity name="ChangeWebCookieLifetimeConfigData">
24+
<data key="path">web/cookie/cookie_lifetime</data>
25+
<data key="value">60</data>
26+
</entity>
27+
<entity name="DefaultWebCookieLifetimeConfigData">
28+
<data key="path">web/cookie/cookie_lifetime</data>
29+
<data key="value">3600</data>
30+
</entity>
31+
<entity name="ChangeAdminSecuritySessionLifetimeConfigData">
32+
<data key="path">admin/security/session_lifetime</data>
33+
<data key="value">60</data>
34+
</entity>
35+
<entity name="DefaultAdminSecuritySessionLifetimeConfigData">
36+
<data key="path">admin/security/session_lifetime</data>
37+
<data key="value">7200</data>
38+
</entity>
2339
</entities>

app/code/Magento/Backend/Test/Mftf/Section/AdminLoginFormSection.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,6 @@
1313
<element name="password" type="input" selector="#login"/>
1414
<element name="signIn" type="button" selector=".actions .action-primary" timeout="30"/>
1515
<element name="forgotPasswordLink" type="button" selector=".action-forgotpassword" timeout="10"/>
16+
<element name="loginBlock" type="block" selector=".adminhtml-auth-login"/>
1617
</section>
1718
</sections>
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
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="AdminExpireAdminSessionTest">
12+
<annotations>
13+
<features value="Backend"/>
14+
<stories value="Admin Session Expire"/>
15+
<title value="Admin Session Expire"/>
16+
<description value="Admin Session Expire"/>
17+
<severity value="MAJOR"/>
18+
<testCaseId value="MC-14111"/>
19+
<group value="Backend"/>
20+
<group value="mtf_migrated"/>
21+
</annotations>
22+
<after>
23+
<!-- 4. Restore default configuration settings. -->
24+
<magentoCLI command="config:set {{DefaultAdminSecuritySessionLifetimeConfigData.path}} {{DefaultAdminSecuritySessionLifetimeConfigData.value}}" stepKey="setDefaultSessionLifetime"/>
25+
</after>
26+
<!-- 1. Apply configuration settings. -->
27+
<magentoCLI command="config:set {{ChangeAdminSecuritySessionLifetimeConfigData.path}} {{ChangeAdminSecuritySessionLifetimeConfigData.value}}" stepKey="changeCookieLifetime"/>
28+
29+
<!-- 2. Wait for session to expire. -->
30+
<actionGroup ref="LoginAsAdmin" stepKey="LoginAsAdmin"/>
31+
<wait time="60" stepKey="waitForSessionLifetime"/>
32+
<reloadPage stepKey="reloadPage"/>
33+
34+
<!-- 3. Perform asserts. -->
35+
<seeElement selector="{{AdminLoginFormSection.loginBlock}}" stepKey="assertAdminLoginPageIsAvailable"/>
36+
</test>
37+
</tests>
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
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="AdminExpireCustomerSessionTest">
12+
<annotations>
13+
<features value="Backend"/>
14+
<stories value="Customer Session Expire"/>
15+
<title value="Customer Session Expireon"/>
16+
<description value="Customer Session Expire"/>
17+
<severity value="MAJOR"/>
18+
<testCaseId value="MC-14110"/>
19+
<group value="Backend"/>
20+
<group value="mtf_migrated"/>
21+
</annotations>
22+
<after>
23+
<!-- 6. Restore default configuration settings. -->
24+
<magentoCLI command="config:set {{DefaultWebCookieLifetimeConfigData.path}} {{DefaultWebCookieLifetimeConfigData.value}}" stepKey="setDefaultCookieLifetime"/>
25+
<!-- Delete data -->
26+
<deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/>
27+
<actionGroup ref="logout" stepKey="logout"/>
28+
</after>
29+
<!-- 1. Login to Admin. -->
30+
<actionGroup ref="LoginAsAdmin" stepKey="LoginAsAdmin"/>
31+
32+
<!-- 2. Create customer if needed. -->
33+
<createData entity="Simple_US_Customer" stepKey="createCustomer"/>
34+
35+
<!-- 3. Apply configuration settings. -->
36+
<magentoCLI command="config:set {{ChangeWebCookieLifetimeConfigData.path}} {{ChangeWebCookieLifetimeConfigData.value}}" stepKey="changeCookieLifetime"/>
37+
38+
<!-- 4. Wait for session to expire. -->
39+
<actionGroup ref="LoginToStorefrontActionGroup" stepKey="customerLogin">
40+
<argument name="Customer" value="$$createCustomer$$" />
41+
</actionGroup>
42+
<wait time="60" stepKey="waitForCookieLifetime"/>
43+
<reloadPage stepKey="reloadPage"/>
44+
45+
<!-- 5. Perform asserts. -->
46+
<seeElement selector="{{StorefrontPanelHeaderSection.customerLoginLink}}" stepKey="assertAuthorizationLinkIsVisibleOnStoreFront"/>
47+
</test>
48+
</tests>
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+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
9+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
10+
<actionGroup name="AssertAdminProductStockStatusActionGroup">
11+
<arguments>
12+
<argument name="productId" type="string"/>
13+
<argument name="stockStatus" type="string"/>
14+
</arguments>
15+
<amOnPage url="{{AdminProductEditPage.url(productId)}}" stepKey="goToProductEditPage"/>
16+
<waitForPageLoad stepKey="waitForProductPageLoad"/>
17+
<seeOptionIsSelected selector="{{AdminProductFormSection.productStockStatus}}" userInput="{{stockStatus}}"
18+
stepKey="checkProductStatus"/>
19+
</actionGroup>
20+
</actionGroups>

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,10 @@
3939
<data key="name">Pursuit Lumaflex&#38;trade; Tone Band</data>
4040
<data key="sku" unique="suffix">x&#38;trade;</data>
4141
</entity>
42+
<entity name="SimpleProduct_25" type="product" extends="SimpleProduct2">
43+
<data key="quantity">25</data>
44+
<requiredEntity type="product_extension_attribute">EavStock25</requiredEntity>
45+
</entity>
4246
<entity name="ApiSimpleProductWithCustomPrice" type="product" extends="ApiSimpleProduct">
4347
<data key="price">100</data>
4448
</entity>

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,7 @@
2626
<entity name="EavStock777" type="product_extension_attribute">
2727
<requiredEntity type="stock_item">Qty_777</requiredEntity>
2828
</entity>
29+
<entity name="EavStock25" type="product_extension_attribute">
30+
<requiredEntity type="stock_item">Qty_25</requiredEntity>
31+
</entity>
2932
</entities>

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,4 +40,8 @@
4040
<data key="qty">777</data>
4141
<data key="is_in_stock">true</data>
4242
</entity>
43+
<entity name="Qty_25" type="stock_item">
44+
<data key="qty">25</data>
45+
<data key="is_in_stock">true</data>
46+
</entity>
4347
</entities>
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
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="AdminOpenCmsPageActionGroup">
11+
<arguments>
12+
<argument name="page_id" type="string"/>
13+
</arguments>
14+
<amOnPage url="{{AdminCmsPageEditPage.url(page_id)}}" stepKey="openEditCmsPage"/>
15+
</actionGroup>
16+
</actionGroups>
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
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+
<pages xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
9+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/PageObject.xsd">
10+
<page name="AdminCmsPageEditPage" area="admin" url="/cms/page/edit/page_id/{{id}}" parameterized="true" module="Magento_Cms">
11+
<section name="CmsNewPagePageActionsSection"/>
12+
<section name="CmsNewPagePageBasicFieldsSection"/>
13+
<section name="CmsNewPagePageContentSection"/>
14+
<section name="CmsNewPagePageSeoSection"/>
15+
</page>
16+
</pages>
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
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="StorefrontCustomerReorderButtonNotVisibleActionGroup">
11+
<dontSeeElement selector="{{StorefrontCustomerOrderViewSection.reorder}}" stepKey="assertNotVisibleElement"/>
12+
</actionGroup>
13+
</actionGroups>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
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="StorefrontNavigateToCustomerOrdersHistoryPageActionGroup">
11+
<amOnPage url="{{StorefrontCustomerOrdersHistoryPage.url}}" stepKey="amOnTheCustomerPage"/>
12+
<waitForPageLoad stepKey="waitForPageLoad"/>
13+
</actionGroup>
14+
</actionGroups>

app/code/Magento/Payment/Test/Mftf/Data/PaymentMethodData.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,8 @@
1111
<entity name="PaymentMethodCheckMoneyOrder" type="payment_method">
1212
<data key="method">checkmo</data>
1313
</entity>
14+
15+
<entity name="CashOnDeliveryPaymentMethodDefault" type="cashondelivery_payment_method">
16+
<requiredEntity type="active">CashOnDeliveryEnableConfigData</requiredEntity>
17+
</entity>
1418
</entities>

app/code/Magento/Payment/Test/Mftf/Metadata/payment_method-meta.xml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,18 @@
1111
<operation name="CreatePaymentMethod" dataType="payment_method" type="create">
1212
<field key="method">string</field>
1313
</operation>
14+
<operation name="cashondeliveryPaymentMethodSetup" dataType="cashondelivery_payment_method" type="create" auth="adminFormKey" url="/admin/system_config/save/section/payment/" method="POST">
15+
<object key="groups" dataType="cashondelivery_payment_method">
16+
<object key="cashondelivery" dataType="cashondelivery_payment_method">
17+
<object key="fields" dataType="cashondelivery_payment_method">
18+
<object key="active" dataType="active">
19+
<field key="value">string</field>
20+
</object>
21+
<object key="title" dataType="title">
22+
<field key="value">string</field>
23+
</object>
24+
</object>
25+
</object>
26+
</object>
27+
</operation>
1428
</operations>
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
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="AdminCreateOrderAndCheckTheReorderTest">
12+
<annotations>
13+
<title value="'Reorder' button is not visible for customer if ordered item is out of stock"/>
14+
<stories value="MAGETWO-63924: 'Reorder' button is not visible for customer if ordered item is out of stock"/>
15+
<description value="'Reorder' button is not visible for customer if ordered item is out of stock"/>
16+
<features value="Sales"/>
17+
<testCaseId value="MC-22109"/>
18+
<severity value="MAJOR"/>
19+
<group value="Sales"/>
20+
<group value="mtf_migrated"/>
21+
</annotations>
22+
<before>
23+
<createData entity="FlatRateShippingMethodDefault" stepKey="setDefaultFlatRateShippingMethod"/>
24+
<createData entity="CashOnDeliveryPaymentMethodDefault" stepKey="cashOnDeliveryPaymentMethod"/>
25+
<createData entity="Simple_US_Customer_CA" stepKey="simpleCustomer"/>
26+
<createData entity="SimpleProduct_25" stepKey="simpleProduct">
27+
<field key="price">5</field>
28+
</createData>
29+
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/>
30+
</before>
31+
<actionGroup ref="navigateToNewOrderPageExistingCustomer" stepKey="navigateToNewOrderWithExistingCustomer">
32+
<argument name="customer" value="$$simpleCustomer$$"/>
33+
</actionGroup>
34+
<actionGroup ref="addSimpleProductToOrder" stepKey="addSimpleProductToOrder">
35+
<argument name="product" value="$$simpleProduct$$"/>
36+
<argument name="productQty" value="{{SimpleProduct_25.quantity}}"/>
37+
</actionGroup>
38+
<actionGroup ref="SelectCashOnDeliveryPaymentMethodActionGroup" stepKey="selectPaymentMethod"/>
39+
<actionGroup ref="orderSelectFlatRateShipping" stepKey="orderSelectFlatRateShippingMethod"/>
40+
<actionGroup ref="AdminSubmitOrderActionGroup" stepKey="submitOrder"/>
41+
<actionGroup ref="verifyCreatedOrderInformation" stepKey="verifyCreatedOrderInformation"/>
42+
<actionGroup ref="LoginToStorefrontActionGroup" stepKey="frontendCustomerLogIn">
43+
<argument name="Customer" value="$$simpleCustomer$$"/>
44+
</actionGroup>
45+
<actionGroup ref="StorefrontNavigateToCustomerOrdersHistoryPageActionGroup" stepKey="goToOrderHistoryPage"/>
46+
<actionGroup ref="StorefrontCustomerReorderButtonNotVisibleActionGroup" stepKey="checkReorderButton"/>
47+
<after>
48+
<actionGroup ref="StorefrontCustomerLogoutActionGroup" stepKey="customerLogout"/>
49+
<actionGroup ref="logout" stepKey="adminLogout"/>
50+
<magentoCLI command="config:set payment/cashondelivery/active 0" stepKey="disableCashOnDeliveryMethod"/>
51+
<deleteData createDataKey="simpleCustomer" stepKey="deleteSimpleCustomer"/>
52+
<deleteData createDataKey="simpleProduct" stepKey="deleteSimpleProduct"/>
53+
</after>
54+
</test>
55+
</tests>

0 commit comments

Comments
 (0)