Skip to content

Commit 02bca98

Browse files
authored
Merge pull request magento#4192 from magento-pangolin/community-tests-migration-pr
[Pangolin] Community tests migration pr Resolves magento-commerce/magento-functional-tests-migration#386: Convert LockCustomerOnLoginPageTest to MFTF Resolves magento-commerce/magento-functional-tests-migration#578: Convert CreateExistingCustomerFrontendEntity to MFTF Resolves magento-commerce/magento-functional-tests-migration#276: Convert LoginAfterJSMinificationTest to MFTF Resolves magento-commerce/magento-functional-tests-migration#383: Convert LockAdminUserWhenCreatingNewRoleTest to MFTF Resolves magento-commerce/magento-functional-tests-migration#623: Convert CmsPageMassActionTest to MFTF
2 parents f7cc333 + f2f7631 commit 02bca98

File tree

35 files changed

+665
-5
lines changed

35 files changed

+665
-5
lines changed
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="AssertAdminPageIsNot404ActionGroup">
12+
<dontSee userInput="404 Error" selector="{{AdminHeaderSection.pageHeading}}" stepKey="dontSee404PageHeading"/>
13+
</actionGroup>
14+
</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="AssertMessageInAdminPanelActionGroup">
12+
<arguments>
13+
<argument name="message" type="string" />
14+
<argument name="messageType" type="string" defaultValue="success" />
15+
</arguments>
16+
17+
<waitForElementVisible selector="{{AdminMessagesSection.messageByType(messageType)}}" stepKey="waitForMessageVisible" />
18+
<see userInput="{{message}}" selector="{{AdminMessagesSection.messageByType(messageType)}}" stepKey="verifyMessage" />
19+
</actionGroup>
20+
</actionGroups>

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,7 @@
1111
<section name="AdminHeaderSection">
1212
<element name="pageTitle" type="text" selector=".page-header h1.page-title"/>
1313
<element name="adminUserAccountText" type="text" selector=".page-header .admin-user-account-text" />
14+
<!-- Legacy heading section. Mostly used for admin 404 and 403 pages -->
15+
<element name="pageHeading" type="text" selector=".page-content .page-heading"/>
1416
</section>
1517
</sections>

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,6 @@
1313
<element name="nthSuccess" type="text" selector=".message.message-success.success:nth-of-type({{n}})>div" parameterized="true"/>
1414
<element name="error" type="text" selector="#messages div.message-error"/>
1515
<element name="notice" type="text" selector=".message.message-notice.notice"/>
16+
<element name="messageByType" type="text" selector="#messages div.message-{{messageType}}" parameterized="true" />
1617
</section>
1718
</sections>
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
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="AdminLoginAfterJSMinificationTest">
12+
<annotations>
13+
<features value="Backend"/>
14+
<title value="Admin panel should be accessible with JS minification enabled"/>
15+
<description value="Admin panel should be accessible with JS minification enabled"/>
16+
<testCaseId value="MC-14104" />
17+
<group value="backend"/>
18+
<group value="mtf_migrated"/>
19+
</annotations>
20+
<before>
21+
<magentoCLI command="config:set {{MinifyJavaScriptFilesEnableConfigData.path}} {{MinifyJavaScriptFilesEnableConfigData.value}}" stepKey="enableJsMinification"/>
22+
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/>
23+
</before>
24+
<after>
25+
<magentoCLI command="config:set {{MinifyJavaScriptFilesDisableConfigData.path}} {{MinifyJavaScriptFilesDisableConfigData.value}}" stepKey="disableJsMinification"/>
26+
<actionGroup ref="logout" stepKey="logout"/>
27+
</after>
28+
29+
<actionGroup ref="AssertAdminSuccessLoginActionGroup" stepKey="loggedInSuccessfully"/>
30+
<actionGroup ref="AssertAdminPageIsNot404ActionGroup" stepKey="dontSee404Page"/>
31+
</test>
32+
</tests>
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+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
9+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
10+
<actionGroup name="AdminCMSPageMassActionSelectActionGroup">
11+
<arguments>
12+
<argument name="action" type="string" />
13+
</arguments>
14+
<click selector="{{CmsPagesPageActionsSection.massActionsButton}}" stepKey="clickMassActionDropdown"/>
15+
<click selector="{{CmsPagesPageActionsSection.massActionsOption(action)}}" stepKey="clickAction"/>
16+
<waitForPageLoad stepKey="waitForPageToReload"/>
17+
</actionGroup>
18+
</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+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
9+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
10+
<actionGroup name="AdminOpenCMSPagesGridActionGroup">
11+
<amOnPage url="{{CmsPagesPage.url}}" stepKey="navigateToCMSPagesGrid"/>
12+
<waitForPageLoad stepKey="waitForPageLoad"/>
13+
</actionGroup>
14+
</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+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
9+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
10+
<actionGroup name="AdminSelectCMSPageInGridActionGroup">
11+
<arguments>
12+
<argument name="identifier" type="string"/>
13+
</arguments>
14+
<checkOption selector="{{CmsPagesPageActionsSection.pageRowCheckboxByIdentifier(identifier)}}" stepKey="selectCmsPageInGrid"/>
15+
</actionGroup>
16+
</actionGroups>
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+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
9+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
10+
<actionGroup name="AssertCMSPageInGridActionGroup">
11+
<arguments>
12+
<argument name="cmsPage" type="entity" />
13+
</arguments>
14+
15+
<seeElement stepKey="seeElementByCmsPageIdentifier" selector="{{AdminDataGridTableSection.rowTemplateStrict(cmsPage.identifier)}}" />
16+
<see userInput="{{cmsPage.title}}" stepKey="seeCmsPageTitle" selector="{{AdminDataGridTableSection.rowTemplateStrict(cmsPage.identifier)}}" />
17+
</actionGroup>
18+
</actionGroups>
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="AssertCMSPageNotFoundOnStorefrontActionGroup">
11+
<see userInput="Whoops, our bad..." stepKey="seePageErrorNotFound"/>
12+
</actionGroup>
13+
</actionGroups>
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
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="StorefrontGoToCMSPageActionGroup">
11+
<arguments>
12+
<argument name="identifier" type="string"/>
13+
</arguments>
14+
<amOnPage url="{{StorefrontHomePage.url}}{{identifier}}" stepKey="amOnCmsPageOnStorefront"/>
15+
<waitForPageLoad stepKey="waitForPageLoadOnStorefront"/>
16+
</actionGroup>
17+
</actionGroups>

app/code/Magento/Cms/Test/Mftf/Section/CmsPagesPageActionsSection.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,5 +27,8 @@
2727
<element name="savePageSuccessMessage" type="text" selector=".message-success"/>
2828
<element name="delete" type="button" selector="//div[text()='{{var1}}']/parent::td//following-sibling::td[@class='data-grid-actions-cell']//a[text()='Delete']" parameterized="true"/>
2929
<element name="deleteConfirm" type="button" selector=".action-primary.action-accept" timeout="60"/>
30+
<element name="pageRowCheckboxByIdentifier" type="checkbox" selector="//table[@data-role='grid']//td[count(../../..//th[./*[.='URL Key']]/preceding-sibling::th) + 1][./*[.='{{identifier}}']]/../td//input[@data-action='select-row']" parameterized="true" />
31+
<element name="massActionsButton" type="button" selector="//div[@class='admin__data-grid-header'][(not(ancestor::*[@class='sticky-header']) and not(contains(@style,'visibility: hidden'))) or (ancestor::*[@class='sticky-header' and not(contains(@style,'display: none'))])]//button[contains(@class, 'action-select')]" />
32+
<element name="massActionsOption" type="button" selector="//div[@class='admin__data-grid-header'][(not(ancestor::*[@class='sticky-header']) and not(contains(@style,'visibility: hidden'))) or (ancestor::*[@class='sticky-header' and not(contains(@style,'display: none'))])]//span[contains(@class, 'action-menu-item') and .= '{{action}}']" parameterized="true"/>
3033
</section>
3134
</sections>
Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
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+
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
9+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
10+
<test name="AdminCmsPageMassActionTest">
11+
<annotations>
12+
<features value="CmsPage"/>
13+
<title value="Create two CMS Pages and perform mass disable action"/>
14+
<description value="Admin should be able to perform mass actions to CMS pages"/>
15+
<stories value="Admin Grid Mass Action" />
16+
<testCaseId value="MC-14659" />
17+
<severity value="CRITICAL"/>
18+
<group value="backend"/>
19+
<group value="CMSContent"/>
20+
<group value="mtf_migrated"/>
21+
</annotations>
22+
<before>
23+
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/>
24+
<createData entity="_defaultCmsPage" stepKey="firstCMSPage" />
25+
<createData entity="_duplicatedCMSPage" stepKey="secondCMSPage" />
26+
</before>
27+
<after>
28+
<deleteData createDataKey="firstCMSPage" stepKey="deleteFirstCMSPage" />
29+
<deleteData createDataKey="secondCMSPage" stepKey="deleteSecondCMSPage" />
30+
<actionGroup ref="logout" stepKey="logout"/>
31+
</after>
32+
33+
<!--Go to Grid page-->
34+
<actionGroup ref="AdminOpenCMSPagesGridActionGroup" stepKey="navigateToCMSPageGrid"/>
35+
<actionGroup ref="AdminGridFilterResetActionGroup" stepKey="clearPossibleGridFilters"/>
36+
37+
<!--Select pages in Grid-->
38+
<actionGroup ref="AdminSelectCMSPageInGridActionGroup" stepKey="selectFirstCMSPage">
39+
<argument name="identifier" value="$$firstCMSPage.identifier$$"/>
40+
</actionGroup>
41+
<actionGroup ref="AdminSelectCMSPageInGridActionGroup" stepKey="selectSecondCMSPage">
42+
<argument name="identifier" value="$$secondCMSPage.identifier$$"/>
43+
</actionGroup>
44+
45+
<!-- Disable Pages-->
46+
<actionGroup ref="AdminCMSPageMassActionSelectActionGroup" stepKey="disablePages">
47+
<argument name="action" value="Disable" />
48+
</actionGroup>
49+
50+
<actionGroup ref="AssertMessageInAdminPanelActionGroup" stepKey="assertSuccessMessage">
51+
<argument name="message" value="A total of 2 record(s) have been disabled." />
52+
</actionGroup>
53+
54+
<!--Verify pages in Grid-->
55+
<actionGroup ref="AdminGridFilterResetActionGroup" stepKey="clearGridFilters"/>
56+
<actionGroup ref="AdminGridFilterFillInputFieldActionGroup" stepKey="filterGridByFirstCmsPageIdentifier">
57+
<argument name="filterInputName" value="identifier" />
58+
<argument name="filterValue" value="$$firstCMSPage.identifier$$" />
59+
</actionGroup>
60+
<actionGroup ref="AdminGridFilterApplyActionGroup" stepKey="applyFirstGridFilters"/>
61+
<actionGroup ref="AssertCMSPageInGridActionGroup" stepKey="assertFirstCmsPageInGrid">
62+
<argument name="cmsPage" value="$$firstCMSPage$$" />
63+
</actionGroup>
64+
65+
<actionGroup ref="AdminGridFilterFillInputFieldActionGroup" stepKey="filterGridBySecondCmsPageIdentifier">
66+
<argument name="filterInputName" value="identifier" />
67+
<argument name="filterValue" value="$$secondCMSPage.identifier$$" />
68+
</actionGroup>
69+
<actionGroup ref="AdminGridFilterApplyActionGroup" stepKey="applySecondGridFilters"/>
70+
<actionGroup ref="AssertCMSPageInGridActionGroup" stepKey="assertSecondCmsPageInGrid">
71+
<argument name="cmsPage" value="$$secondCMSPage$$" />
72+
</actionGroup>
73+
<actionGroup ref="AdminGridFilterResetActionGroup" stepKey="clearGridFiltersToIsolateTest"/>
74+
75+
<!--Verify pages are disabled on Storefront-->
76+
<actionGroup ref="StorefrontGoToCMSPageActionGroup" stepKey="goToFirstCMSPageOnStorefront">
77+
<argument name="identifier" value="$$firstCMSPage.identifier$$"/>
78+
</actionGroup>
79+
<actionGroup ref="AssertCMSPageNotFoundOnStorefrontActionGroup" stepKey="seeNotFoundErrorForFirstPage"/>
80+
<actionGroup ref="StorefrontGoToCMSPageActionGroup" stepKey="goToSecondCMSPageOnStorefront">
81+
<argument name="identifier" value="$$secondCMSPage.identifier$$"/>
82+
</actionGroup>
83+
<actionGroup ref="AssertCMSPageNotFoundOnStorefrontActionGroup" stepKey="seeNotFoundErrorForSecondPage"/>
84+
</test>
85+
</tests>

app/code/Magento/Customer/Test/Mftf/ActionGroup/SignUpNewUserFromStorefrontActionGroup.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@
5757
<arguments>
5858
<argument name="Address"/>
5959
</arguments>
60-
60+
6161
<amOnPage url="customer/address/new/" stepKey="goToAddressPage"/>
6262
<waitForPageLoad stepKey="waitForAddressPage"/>
6363
<fillField stepKey="fillFirstName" selector="{{StorefrontCustomerAddressSection.firstName}}" userInput="{{Address.firstname}}"/>
@@ -154,4 +154,4 @@
154154
<waitForPageLoad stepKey="waitForRegistered" after="clickCreateAccountButton"/>
155155
<remove keyForRemoval="seeThankYouMessage"/>
156156
</actionGroup>
157-
</actionGroups>
157+
</actionGroups>
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+
9+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="StorefrontFillCustomerLoginFormWithWrongPasswordActionGroup" extends="StorefrontFillCustomerLoginFormActionGroup">
12+
<remove keyForRemoval="fillPassword"/>
13+
<fillField userInput="{{customer.password}}_INCORRECT" selector="{{StorefrontCustomerSignInFormSection.passwordField}}" stepKey="fillPassword"/>
14+
</actionGroup>
15+
</actionGroups>

app/code/Magento/Customer/Test/Mftf/Data/CustomerConfigData.xml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,17 @@
2828
<entity name="CustomerAccountSharingInherit" type="account_share_scope_inherit">
2929
<data key="inherit">true</data>
3030
</entity>
31+
<entity name="StorefrontCustomerLockoutFailuresDefaultConfigData">
32+
<!-- Magento default value -->
33+
<data key="path">customer/password/lockout_failures</data>
34+
<data key="scope_id">0</data>
35+
<data key="label">10</data>
36+
<data key="value">10</data>
37+
</entity>
38+
<entity name="StorefrontCustomerLockoutFailures5ConfigData">
39+
<data key="path">customer/password/lockout_failures</data>
40+
<data key="scope_id">0</data>
41+
<data key="label">5</data>
42+
<data key="value">5</data>
43+
</entity>
3144
</entities>
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="StorefrontCreateExistingCustomerTest">
12+
<annotations>
13+
<features value="Customer"/>
14+
<title value="Attempt to register customer on storefront with existing email"/>
15+
<description value="Attempt to register customer on storefront with existing email"/>
16+
<testCaseId value="MC-10907" />
17+
<group value="customers"/>
18+
<group value="mtf_migrated"/>
19+
</annotations>
20+
<before>
21+
<createData entity="Simple_US_Customer" stepKey="customer"/>
22+
</before>
23+
<after>
24+
<deleteData createDataKey="customer" stepKey="deleteCustomer"/>
25+
</after>
26+
27+
<actionGroup ref="StorefrontOpenCustomerAccountCreatePageActionGroup" stepKey="openCreateAccountPage"/>
28+
<actionGroup ref="StorefrontFillCustomerAccountCreationFormActionGroup" stepKey="fillCreateAccountForm">
29+
<argument name="customer" value="$$customer$$"/>
30+
</actionGroup>
31+
<actionGroup ref="StorefrontClickCreateAnAccountCustomerAccountCreationFormActionGroup" stepKey="submitCreateAccountForm"/>
32+
<actionGroup ref="AssertMessageCustomerCreateAccountActionGroup" stepKey="seeErrorMessage">
33+
<argument name="messageType" value="error"/>
34+
<argument name="message" value="There is already an account with this email address."/>
35+
</actionGroup>
36+
</test>
37+
</tests>

0 commit comments

Comments
 (0)