Skip to content

Commit

Permalink
Merge pull request #5082 from magento-pangolin/MTF-MFTF-migration-kozan
Browse files Browse the repository at this point in the history
[Community MTF to MFTF] Test conversion delivery
  • Loading branch information
KevinBKozan authored Dec 5, 2019
2 parents 9544fb2 + af1b9e4 commit 57a2aad
Show file tree
Hide file tree
Showing 23 changed files with 653 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?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">

<!--Fill Required Fields -->
<actionGroup name="AdminCreatesNewIntegrationActionGroup">
<arguments>
<argument name="name" type="string"/>
<argument name="password" type="string"/>
</arguments>
<fillField stepKey="fillNameField" selector="{{AdminNewIntegrationSection.name}}" userInput="{{name}}"/>
<fillField stepKey="fillAdminPasswordField" selector="{{AdminNewIntegrationSection.password}}" userInput="{{password}}"/>
</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="AdminDeleteIntegrationEntityActionGroup">
<click stepKey="clickRemoveButon" selector="{{AdminIntegrationsGridSection.remove}}"/>
<waitForElementVisible selector="{{AdminIntegrationsGridSection.submitButton}}" stepKey="waitForConfirmButtonVisible"/>
<click stepKey="clickSubmitButton" selector="{{AdminIntegrationsGridSection.submitButton}}"/>
<waitForPageLoad stepKey="waitForPageLoad"/>
</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">

<!--Click the "Add New Integration" Button -->

<actionGroup name="AdminNavigateToCreateIntegrationPageActionGroup">
<click stepKey="clickAddNewIntegrationButton" selector="{{AdminIntegrationsGridSection.add}}"/>
<waitForPageLoad stepKey="waitForNewNIntegrationPageLoaded"/>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?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="AdminSearchIntegrationInGridActionGroup">
<arguments>
<argument name="name" type="string"/>
</arguments>
<!--Reset Search Filters -->
<conditionalClick selector="{{AdminDataGridHeaderSection.clearFilters}}" dependentSelector="{{AdminDataGridHeaderSection.clearFilters}}" visible="true" stepKey="clickClearFilters"/>
<!--Fill Integration Name Field -->
<fillField selector="{{AdminIntegrationsGridSection.name}}" userInput="{{name}}" stepKey="filterByName"/>
<!--Click "Search" Button -->
<click selector="{{AdminIntegrationsGridSection.search}}" stepKey="doFilter"/>
<waitForPageLoad stepKey="waitForSitemapPageLoadedAfterFiltering"/>
</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="AdminSubmitNewIntegrationFormActionGroup">
<!--Click the "Save" Button -->
<click stepKey="clickSaveButton" selector="{{AdminNewIntegrationSection.saveButton}}"/>
<waitForPageLoad stepKey="waitForPageLoad"/>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?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="AssertAdminMessageCreateIntegrationEntityActionGroup">
<arguments>
<argument name="message" type="string" defaultValue="The integration '{{name}}' has been saved."/>
<argument name="messageType" type="string" defaultValue="success"/>
</arguments>
<waitForElementVisible selector="{{AdminIntegrationsGridSection.messageByType(messageType)}}" stepKey="waitForMessage"/>
<see userInput="{{message}}" selector="{{AdminIntegrationsGridSection.messageByType(messageType)}}" stepKey="verifyMessage"/>
</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="AssertDeletedIntegrationIsNotInGridActionGroup">
<arguments>
<argument name="name" type="string"/>
</arguments>
<dontSee userInput="{{name}}" selector="{{AdminIntegrationsGridSection.rowByIndex('1')}}" stepKey="donSeeIntegration"/>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">

<section name="AdminIntegrationsGridSection">
<element name="add" type="button" selector=".page-actions .add"/>
<element name="messageByType" type="block" selector="#messages .message-{{messageType}}" parameterized="true"/>
<element name="name" type="input" selector=".data-grid-filters #integrationGrid_filter_name"/>
<element name="search" type="input" selector=".admin__filter-actions button[title=Search]"/>
<element name="remove" type="button" selector=".data-grid .delete"/>
<element name="submitButton" type="button" selector=".action-primary.action-accept" timeout="30"/>
<element name="rowByIndex" type="text" selector="tr[data-role='row']:nth-of-type({{var1}})" parameterized="true" timeout="30"/>
<element name="edit" type="button" selector=".data-grid .edit"/>
</section>
</sections>
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.
*/
-->
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
<section name="AdminNewIntegrationSection">
<element name="name" type="input" selector="#integration_properties_name"/>
<element name="password" type="input" selector="#integration_properties_current_password"/>
<element name="saveButton" type="button" selector=".page-actions #save-split-button-button"/>
<element name="endpoint" type="input" selector="#integration_properties_endpoint"/>
<element name="linkUrl" type="input" selector="#integration_properties_identity_link_url"/>
<element name="save" type="button" selector=".page-actions-buttons .save"/>
</section>
</sections>
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
<?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="AdminDeleteIntegrationEntityTest">
<annotations>
<features value="Integration"/>
<stories value="System Integration"/>
<title value="Admin system integration"/>
<description value="Admin Deletes Created Integration"/>
<group value="integration"/>
<group value="mtf_migrated"/>
</annotations>
<before>
<!-- Login As Admin -->
<actionGroup ref="LoginAsAdmin" stepKey="LoginAsAdmin"/>
<!-- Navigate To Integrations Page -->
<actionGroup ref="AdminNavigateMenuActionGroup" stepKey="navigateToIntegrationsPage">
<argument name="menuUiId" value="{{AdminMenuSystem.dataUiId}}"/>
<argument name="submenuUiId" value="{{AdminMenuSystemExtensionsIntegrations.dataUiId}}"/>
</actionGroup>
<!-- Click the "Add New Integration" button -->
<actionGroup ref="AdminNavigateToCreateIntegrationPageActionGroup" stepKey="clickAddNewIntegrationButton"/>
<!-- Create New Integration -->
<actionGroup ref="AdminCreatesNewIntegrationActionGroup" stepKey="createIntegration">
<argument name="name" value="Integration1"/>
<argument name="password" value="{{_ENV.MAGENTO_ADMIN_PASSWORD}}"/>
</actionGroup>
<!-- Submit The Form -->
<actionGroup ref="AdminSubmitNewIntegrationFormActionGroup" stepKey="submitTheForm"/>
</before>
<after>
<actionGroup ref="logout" stepKey="logout"/>
</after>

<!-- TEST BODY -->
<!-- Find Created Integration In Grid -->
<actionGroup ref="AdminSearchIntegrationInGridActionGroup" stepKey="findCreatedIntegration">
<argument name="name" value="Integration1"/>
</actionGroup>
<!-- Delete Created Integration Entity -->
<actionGroup ref="AdminDeleteIntegrationEntityActionGroup" stepKey="deleteIntegration"/>
<!-- Assert Success Message -->
<actionGroup ref="AssertAdminMessageCreateIntegrationEntityActionGroup" stepKey="seeSuccessMessage">
<argument name="message" value="The integration 'Integration1' has been deleted."/>
<argument value="success" name="messageType"/>
</actionGroup>
<!-- Assert Deleted Integration Is Not In Grid -->
<actionGroup ref="AdminSearchIntegrationInGridActionGroup" stepKey="findDeletedIntegration">
<argument name="name" value="Integration1"/>
</actionGroup>
<actionGroup ref="AssertDeletedIntegrationIsNotInGridActionGroup" stepKey="dontSeeIntegration">
<argument name="name" value="Integration1"/>
</actionGroup>
<!-- END TEST BODY -->
</test>
</tests>
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
<?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="AdminUpdateCmsPageRewriteEntityWithNoRedirectTest">
<annotations>
<stories value="Update CMS Page URL Redirect With No Redirect"/>
<title value="Update CMS Page URL Redirect With No Redirect"/>
<description value="Login as Admin and tried to update the created URL Rewrite for CMS page"/>
<group value="cMSContent"/>
<group value="mtf_migrated"/>
</annotations>

<before>
<createData entity="simpleCmsPage" stepKey="createCMSPage"/>
<actionGroup ref="LoginAsAdmin" stepKey="login"/>
</before>
<after>
<deleteData createDataKey="createCMSPage" stepKey="deleteCMSPage"/>
<actionGroup ref="logout" stepKey="logout"/>
</after>

<!--Create Custom Store View-->
<actionGroup ref="AdminCreateStoreViewActionGroup" stepKey="createCustomStoreView"/>

<!-- Open CMS Edit Page, Get the CMS ID and Modify Store View Option to All Store Views -->
<actionGroup ref="navigateToCreatedCMSPage" stepKey="navigateToCreatedCMSPage">
<argument name="CMSPage" value="$$createCMSPage$$"/>
</actionGroup>
<grabFromCurrentUrl stepKey="cmsId" regex="#\/([0-9]*)?\/$#"/>
<actionGroup ref="AddStoreViewToCmsPage" stepKey="updateStoreViewForCmsPage">
<argument name="CMSPage" value="$$createCMSPage$$"/>
<argument name="storeViewName" value="All Store Views"/>
</actionGroup>

<!--Create CMS Page URL Redirect-->
<actionGroup ref="AdminAddCustomUrlRewrite" stepKey="addCustomUrlRewrite">
<argument name="customUrlRewriteValue" value="Custom"/>
<argument name="storeValue" value="Default Store View"/>
<argument name="requestPath" value="created-new-cms-page"/>
<argument name="redirectTypeValue" value="Permanent (301)"/>
<argument name="targetPath" value="cms/page/view/page_id/{$cmsId}"/>
<argument name="description" value="Created New CMS Page"/>
</actionGroup>

<!--Search created CMS page url rewrite in grid-->
<actionGroup ref="AdminSearchAndSelectUrlRewriteInGrid" stepKey="searchUrlRewrite">
<argument name="requestPath" value="created-new-cms-page"/>
</actionGroup>

<!-- Update URL Rewrite for CMS Page -->
<actionGroup ref="AdminUpdateUrlRewrite" stepKey="updateUrlRewriteFirstAttempt">
<argument name="storeValue" value="{{customStore.name}}"/>
<argument name="requestPath" value="newrequestpath"/>
<argument name="redirectTypeValue" value="No"/>
<argument name="description" value="test_description_custom_store"/>
</actionGroup>

<!-- Assert Url Rewrite Save Message -->
<actionGroup ref="AssertMessageInAdminPanelActionGroup" stepKey="assertSuccessMessage">
<argument name="message" value="The URL Rewrite has been saved."/>
</actionGroup>

<!-- Assert Url Rewrite Cms Page Redirect -->
<actionGroup ref="StorefrontOpenHomePageActionGroup" stepKey="goToHomepage"/>
<actionGroup ref="StorefrontSwitchStoreViewActionGroup" stepKey="storefrontSwitchToCustomStoreView">
<argument name="storeView" value="customStore"/>
</actionGroup>
<actionGroup ref="navigateToStorefrontForCreatedPage" stepKey="navigateToTheStoreFront">
<argument name="page" value="newrequestpath"/>
</actionGroup>
<actionGroup ref="AssertStoreFrontCMSPage" stepKey="assertCMSPage">
<argument name="cmsTitle" value="$$createCMSPage.title$$"/>
<argument name="cmsContent" value="$$createCMSPage.content$$"/>
<argument name="cmsContentHeading" value="$$createCMSPage.content_heading$$"/>
</actionGroup>

<actionGroup ref="AdminDeleteUrlRewrite" stepKey="deleteCustomUrlRewrite">
<argument name="requestPath" value="newrequestpath"/>
</actionGroup>
<actionGroup ref="AdminDeleteStoreViewActionGroup" stepKey="deleteCustomStoreView"/>

</test>
</tests>
Loading

0 comments on commit 57a2aad

Please sign in to comment.