Skip to content

Commit

Permalink
Merge pull request magento#4192 from magento-pangolin/community-tests…
Browse files Browse the repository at this point in the history
…-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
  • Loading branch information
okolesnyk authored May 11, 2019
2 parents f7cc333 + f2f7631 commit 02bca98
Show file tree
Hide file tree
Showing 35 changed files with 665 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->

<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
<actionGroup name="AssertAdminPageIsNot404ActionGroup">
<dontSee userInput="404 Error" selector="{{AdminHeaderSection.pageHeading}}" stepKey="dontSee404PageHeading"/>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->

<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
<actionGroup name="AssertMessageInAdminPanelActionGroup">
<arguments>
<argument name="message" type="string" />
<argument name="messageType" type="string" defaultValue="success" />
</arguments>

<waitForElementVisible selector="{{AdminMessagesSection.messageByType(messageType)}}" stepKey="waitForMessageVisible" />
<see userInput="{{message}}" selector="{{AdminMessagesSection.messageByType(messageType)}}" stepKey="verifyMessage" />
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,7 @@
<section name="AdminHeaderSection">
<element name="pageTitle" type="text" selector=".page-header h1.page-title"/>
<element name="adminUserAccountText" type="text" selector=".page-header .admin-user-account-text" />
<!-- Legacy heading section. Mostly used for admin 404 and 403 pages -->
<element name="pageHeading" type="text" selector=".page-content .page-heading"/>
</section>
</sections>
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,6 @@
<element name="nthSuccess" type="text" selector=".message.message-success.success:nth-of-type({{n}})>div" parameterized="true"/>
<element name="error" type="text" selector="#messages div.message-error"/>
<element name="notice" type="text" selector=".message.message-notice.notice"/>
<element name="messageByType" type="text" selector="#messages div.message-{{messageType}}" parameterized="true" />
</section>
</sections>
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->

<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
<test name="AdminLoginAfterJSMinificationTest">
<annotations>
<features value="Backend"/>
<title value="Admin panel should be accessible with JS minification enabled"/>
<description value="Admin panel should be accessible with JS minification enabled"/>
<testCaseId value="MC-14104" />
<group value="backend"/>
<group value="mtf_migrated"/>
</annotations>
<before>
<magentoCLI command="config:set {{MinifyJavaScriptFilesEnableConfigData.path}} {{MinifyJavaScriptFilesEnableConfigData.value}}" stepKey="enableJsMinification"/>
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/>
</before>
<after>
<magentoCLI command="config:set {{MinifyJavaScriptFilesDisableConfigData.path}} {{MinifyJavaScriptFilesDisableConfigData.value}}" stepKey="disableJsMinification"/>
<actionGroup ref="logout" stepKey="logout"/>
</after>

<actionGroup ref="AssertAdminSuccessLoginActionGroup" stepKey="loggedInSuccessfully"/>
<actionGroup ref="AssertAdminPageIsNot404ActionGroup" stepKey="dontSee404Page"/>
</test>
</tests>
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
<actionGroup name="AdminCMSPageMassActionSelectActionGroup">
<arguments>
<argument name="action" type="string" />
</arguments>
<click selector="{{CmsPagesPageActionsSection.massActionsButton}}" stepKey="clickMassActionDropdown"/>
<click selector="{{CmsPagesPageActionsSection.massActionsOption(action)}}" stepKey="clickAction"/>
<waitForPageLoad stepKey="waitForPageToReload"/>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
<actionGroup name="AdminOpenCMSPagesGridActionGroup">
<amOnPage url="{{CmsPagesPage.url}}" stepKey="navigateToCMSPagesGrid"/>
<waitForPageLoad stepKey="waitForPageLoad"/>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
<actionGroup name="AdminSelectCMSPageInGridActionGroup">
<arguments>
<argument name="identifier" type="string"/>
</arguments>
<checkOption selector="{{CmsPagesPageActionsSection.pageRowCheckboxByIdentifier(identifier)}}" stepKey="selectCmsPageInGrid"/>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
<actionGroup name="AssertCMSPageInGridActionGroup">
<arguments>
<argument name="cmsPage" type="entity" />
</arguments>

<seeElement stepKey="seeElementByCmsPageIdentifier" selector="{{AdminDataGridTableSection.rowTemplateStrict(cmsPage.identifier)}}" />
<see userInput="{{cmsPage.title}}" stepKey="seeCmsPageTitle" selector="{{AdminDataGridTableSection.rowTemplateStrict(cmsPage.identifier)}}" />
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
<actionGroup name="AssertCMSPageNotFoundOnStorefrontActionGroup">
<see userInput="Whoops, our bad..." stepKey="seePageErrorNotFound"/>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
<actionGroup name="StorefrontGoToCMSPageActionGroup">
<arguments>
<argument name="identifier" type="string"/>
</arguments>
<amOnPage url="{{StorefrontHomePage.url}}{{identifier}}" stepKey="amOnCmsPageOnStorefront"/>
<waitForPageLoad stepKey="waitForPageLoadOnStorefront"/>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,8 @@
<element name="savePageSuccessMessage" type="text" selector=".message-success"/>
<element name="delete" type="button" selector="//div[text()='{{var1}}']/parent::td//following-sibling::td[@class='data-grid-actions-cell']//a[text()='Delete']" parameterized="true"/>
<element name="deleteConfirm" type="button" selector=".action-primary.action-accept" timeout="60"/>
<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" />
<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')]" />
<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"/>
</section>
</sections>
85 changes: 85 additions & 0 deletions app/code/Magento/Cms/Test/Mftf/Test/AdminCmsPageMassActionTest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
<test name="AdminCmsPageMassActionTest">
<annotations>
<features value="CmsPage"/>
<title value="Create two CMS Pages and perform mass disable action"/>
<description value="Admin should be able to perform mass actions to CMS pages"/>
<stories value="Admin Grid Mass Action" />
<testCaseId value="MC-14659" />
<severity value="CRITICAL"/>
<group value="backend"/>
<group value="CMSContent"/>
<group value="mtf_migrated"/>
</annotations>
<before>
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/>
<createData entity="_defaultCmsPage" stepKey="firstCMSPage" />
<createData entity="_duplicatedCMSPage" stepKey="secondCMSPage" />
</before>
<after>
<deleteData createDataKey="firstCMSPage" stepKey="deleteFirstCMSPage" />
<deleteData createDataKey="secondCMSPage" stepKey="deleteSecondCMSPage" />
<actionGroup ref="logout" stepKey="logout"/>
</after>

<!--Go to Grid page-->
<actionGroup ref="AdminOpenCMSPagesGridActionGroup" stepKey="navigateToCMSPageGrid"/>
<actionGroup ref="AdminGridFilterResetActionGroup" stepKey="clearPossibleGridFilters"/>

<!--Select pages in Grid-->
<actionGroup ref="AdminSelectCMSPageInGridActionGroup" stepKey="selectFirstCMSPage">
<argument name="identifier" value="$$firstCMSPage.identifier$$"/>
</actionGroup>
<actionGroup ref="AdminSelectCMSPageInGridActionGroup" stepKey="selectSecondCMSPage">
<argument name="identifier" value="$$secondCMSPage.identifier$$"/>
</actionGroup>

<!-- Disable Pages-->
<actionGroup ref="AdminCMSPageMassActionSelectActionGroup" stepKey="disablePages">
<argument name="action" value="Disable" />
</actionGroup>

<actionGroup ref="AssertMessageInAdminPanelActionGroup" stepKey="assertSuccessMessage">
<argument name="message" value="A total of 2 record(s) have been disabled." />
</actionGroup>

<!--Verify pages in Grid-->
<actionGroup ref="AdminGridFilterResetActionGroup" stepKey="clearGridFilters"/>
<actionGroup ref="AdminGridFilterFillInputFieldActionGroup" stepKey="filterGridByFirstCmsPageIdentifier">
<argument name="filterInputName" value="identifier" />
<argument name="filterValue" value="$$firstCMSPage.identifier$$" />
</actionGroup>
<actionGroup ref="AdminGridFilterApplyActionGroup" stepKey="applyFirstGridFilters"/>
<actionGroup ref="AssertCMSPageInGridActionGroup" stepKey="assertFirstCmsPageInGrid">
<argument name="cmsPage" value="$$firstCMSPage$$" />
</actionGroup>

<actionGroup ref="AdminGridFilterFillInputFieldActionGroup" stepKey="filterGridBySecondCmsPageIdentifier">
<argument name="filterInputName" value="identifier" />
<argument name="filterValue" value="$$secondCMSPage.identifier$$" />
</actionGroup>
<actionGroup ref="AdminGridFilterApplyActionGroup" stepKey="applySecondGridFilters"/>
<actionGroup ref="AssertCMSPageInGridActionGroup" stepKey="assertSecondCmsPageInGrid">
<argument name="cmsPage" value="$$secondCMSPage$$" />
</actionGroup>
<actionGroup ref="AdminGridFilterResetActionGroup" stepKey="clearGridFiltersToIsolateTest"/>

<!--Verify pages are disabled on Storefront-->
<actionGroup ref="StorefrontGoToCMSPageActionGroup" stepKey="goToFirstCMSPageOnStorefront">
<argument name="identifier" value="$$firstCMSPage.identifier$$"/>
</actionGroup>
<actionGroup ref="AssertCMSPageNotFoundOnStorefrontActionGroup" stepKey="seeNotFoundErrorForFirstPage"/>
<actionGroup ref="StorefrontGoToCMSPageActionGroup" stepKey="goToSecondCMSPageOnStorefront">
<argument name="identifier" value="$$secondCMSPage.identifier$$"/>
</actionGroup>
<actionGroup ref="AssertCMSPageNotFoundOnStorefrontActionGroup" stepKey="seeNotFoundErrorForSecondPage"/>
</test>
</tests>
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
<arguments>
<argument name="Address"/>
</arguments>

<amOnPage url="customer/address/new/" stepKey="goToAddressPage"/>
<waitForPageLoad stepKey="waitForAddressPage"/>
<fillField stepKey="fillFirstName" selector="{{StorefrontCustomerAddressSection.firstName}}" userInput="{{Address.firstname}}"/>
Expand Down Expand Up @@ -154,4 +154,4 @@
<waitForPageLoad stepKey="waitForRegistered" after="clickCreateAccountButton"/>
<remove keyForRemoval="seeThankYouMessage"/>
</actionGroup>
</actionGroups>
</actionGroups>
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->

<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
<actionGroup name="StorefrontFillCustomerLoginFormWithWrongPasswordActionGroup" extends="StorefrontFillCustomerLoginFormActionGroup">
<remove keyForRemoval="fillPassword"/>
<fillField userInput="{{customer.password}}_INCORRECT" selector="{{StorefrontCustomerSignInFormSection.passwordField}}" stepKey="fillPassword"/>
</actionGroup>
</actionGroups>
13 changes: 13 additions & 0 deletions app/code/Magento/Customer/Test/Mftf/Data/CustomerConfigData.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,17 @@
<entity name="CustomerAccountSharingInherit" type="account_share_scope_inherit">
<data key="inherit">true</data>
</entity>
<entity name="StorefrontCustomerLockoutFailuresDefaultConfigData">
<!-- Magento default value -->
<data key="path">customer/password/lockout_failures</data>
<data key="scope_id">0</data>
<data key="label">10</data>
<data key="value">10</data>
</entity>
<entity name="StorefrontCustomerLockoutFailures5ConfigData">
<data key="path">customer/password/lockout_failures</data>
<data key="scope_id">0</data>
<data key="label">5</data>
<data key="value">5</data>
</entity>
</entities>
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->

<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
<test name="StorefrontCreateExistingCustomerTest">
<annotations>
<features value="Customer"/>
<title value="Attempt to register customer on storefront with existing email"/>
<description value="Attempt to register customer on storefront with existing email"/>
<testCaseId value="MC-10907" />
<group value="customers"/>
<group value="mtf_migrated"/>
</annotations>
<before>
<createData entity="Simple_US_Customer" stepKey="customer"/>
</before>
<after>
<deleteData createDataKey="customer" stepKey="deleteCustomer"/>
</after>

<actionGroup ref="StorefrontOpenCustomerAccountCreatePageActionGroup" stepKey="openCreateAccountPage"/>
<actionGroup ref="StorefrontFillCustomerAccountCreationFormActionGroup" stepKey="fillCreateAccountForm">
<argument name="customer" value="$$customer$$"/>
</actionGroup>
<actionGroup ref="StorefrontClickCreateAnAccountCustomerAccountCreationFormActionGroup" stepKey="submitCreateAccountForm"/>
<actionGroup ref="AssertMessageCustomerCreateAccountActionGroup" stepKey="seeErrorMessage">
<argument name="messageType" value="error"/>
<argument name="message" value="There is already an account with this email address."/>
</actionGroup>
</test>
</tests>
Loading

0 comments on commit 02bca98

Please sign in to comment.