Skip to content

Commit 02bca98

Browse files
authored
Merge pull request #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>

0 commit comments

Comments
 (0)