Skip to content

Commit

Permalink
ENGCOM-6196: [Sitemap] MFTF to cover Create-Delete sitemap #25329
Browse files Browse the repository at this point in the history
  • Loading branch information
VladimirZaets committed Oct 28, 2019
2 parents e90ddc6 + d0c4755 commit 3e80e96
Show file tree
Hide file tree
Showing 11 changed files with 225 additions and 0 deletions.
@@ -0,0 +1,32 @@
<?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="AdminMarketingSiteDeleteByNameActionGroup">
<annotations>
<description>Go to the Site map page. Delete a site map based on the provided Name.</description>
</annotations>
<arguments>
<argument name="filename" type="string"/>
</arguments>

<amOnPage url="{{AdminMarketingSiteMapGridPage.url}}" stepKey="amOnSiteMapGridPage"/>
<waitForPageLoad stepKey="waitForPageLoad1"/>
<click selector="{{AdminMarketingSiteMapGridSection.resetButton}}" stepKey="resetSearchFilter"/>
<fillField selector="{{AdminMarketingSiteMapGridSection.fileNameTextField}}" userInput="{{filename}}" stepKey="fillFileNameField"/>
<click selector="{{AdminMarketingSiteMapGridSection.searchButton}}" stepKey="clickSearchButton"/>
<see userInput="{{filename}}" selector="{{AdminMarketingSiteMapGridSection.firstSearchResult}}" stepKey="verifyThatCorrectStoreGroupFound"/>
<click selector="{{AdminMarketingSiteMapGridSection.firstSearchResult}}" stepKey="clickEditExistingRow"/>
<waitForPageLoad stepKey="waitForSiteMapToLoad"/>
<click selector="{{AdminMarketingSiteMapEditActionSection.delete}}" stepKey="deleteSiteMap"/>
<waitForAjaxLoad stepKey="waitForAjaxLoad"/>
<click selector="{{AdminConfirmationModalSection.ok}}" stepKey="confirmDelete"/>
<waitForPageLoad stepKey="waitForDeleteLoad"/>
</actionGroup>
</actionGroups>
@@ -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="AdminMarketingSiteMapFillFormActionGroup">
<annotations>
<description>Fill data to Site map form</description>
</annotations>
<arguments>
<argument name="sitemap" type="entity" defaultValue="DefaultSiteMap"/>
</arguments>
<fillField selector="{{AdminMarketingSiteMapEditActionSection.filename}}" userInput="{{sitemap.filename}}" stepKey="fillFilename"/>
<fillField selector="{{AdminMarketingSiteMapEditActionSection.path}}" userInput="{{sitemap.path}}" stepKey="fillPath"/>
<click selector="{{AdminMarketingSiteMapEditActionSection.save}}" stepKey="saveSiteMap"/>
<waitForPageLoad stepKey="waitForPageLoad"/>
</actionGroup>
</actionGroups>
@@ -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="AdminMarketingSiteMapNavigateNewActionGroup">
<annotations>
<description>Navigate to New Site Map</description>
</annotations>
<amOnPage url="{{AdminMarketingSiteMapNewPage.url}}" stepKey="openNewSiteMapPage"/>
<waitForPageLoad stepKey="waitForPageLoad"/>
</actionGroup>
</actionGroups>
@@ -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="AssertSiteMapCreateSuccessActionGroup">
<annotations>
<description>Validate the success message after creating site map.</description>
</annotations>

<see selector="{{AdminMessagesSection.success}}" userInput="You saved the sitemap." stepKey="seeSuccess"/>
</actionGroup>
</actionGroups>
@@ -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="AssertSiteMapDeleteSuccessActionGroup">
<annotations>
<description>Validate the success message after delete site map.</description>
</annotations>

<see selector="{{AdminMessagesSection.success}}" userInput="You deleted the sitemap." stepKey="seeSuccess"/>
</actionGroup>
</actionGroups>
15 changes: 15 additions & 0 deletions app/code/Magento/Sitemap/Test/Mftf/Data/SitemapData.xml
@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->

<entities xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:DataGenerator/etc/dataProfileSchema.xsd">
<entity name="DefaultSiteMap">
<data key="filename">sitemap.xml</data>
<data key="path">/</data>
</entity>
</entities>
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->

<pages xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/PageObject.xsd">
<page name="AdminMarketingSiteMapGridPage" url="admin/sitemap/" area="admin" module="Sitemap">
<section name="AdminMarketingSiteMapGridSection"/>
</page>
</pages>
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->

<pages xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/PageObject.xsd">
<page name="AdminMarketingSiteMapNewPage" url="admin/sitemap/new/" area="admin" module="Sitemap">
<section name="AdminMarketingSiteMapEditActionSection"/>
</page>
</pages>
@@ -0,0 +1,20 @@
<?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="AdminMarketingSiteMapEditActionSection">
<element name="save" type="button" selector="#save" timeout="10"/>
<element name="delete" type="button" selector="#delete" timeout="10"/>
<element name="saveAndGenerate" type="button" selector="#generate" timeout="10"/>
<element name="reset" type="button" selector="#reset"/>
<element name="back" type="button" selector="#back"/>
<element name="filename" type="input" selector="input[name='sitemap_filename']"/>
<element name="path" type="input" selector="input[name='sitemap_path']"/>
</section>
</sections>
@@ -0,0 +1,17 @@
<?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="AdminMarketingSiteMapGridSection">
<element name="resetButton" type="button" selector="button[title='Reset Filter']"/>
<element name="searchButton" type="button" selector=".admin__filter-actions [title='Search']"/>
<element name="firstSearchResult" type="text" selector="#sitemapGrid_table>tbody>tr:nth-child(1)"/>
<element name="fileNameTextField" type="input" selector="#sitemapGrid_filter_sitemap_filename" timeout="90"/>
</section>
</sections>
@@ -0,0 +1,36 @@
<?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="AdminMarketingSiteMapCreateNewTest">
<annotations>
<features value="Sitemap"/>
<stories value="Create Site Map"/>
<title value="Create New Site Map with valid data"/>
<description value="Create New Site Map with valid data"/>
<severity value="CRITICAL"/>
<group value="sitemap"/>
</annotations>
<before>
<actionGroup ref="LoginAsAdmin" stepKey="LoginAsAdmin"/>
</before>
<after>
<actionGroup ref="AdminMarketingSiteDeleteByNameActionGroup" stepKey="deleteSiteMap">
<argument name="filename" value="{{DefaultSiteMap.filename}}" />
</actionGroup>
<actionGroup ref="AssertSiteMapDeleteSuccessActionGroup" stepKey="assertDeleteSuccessMessage"/>
<actionGroup ref="logout" stepKey="logout"/>
</after>
<actionGroup ref="AdminMarketingSiteMapNavigateNewActionGroup" stepKey="navigateNewSiteMap"/>
<actionGroup ref="AdminMarketingSiteMapFillFormActionGroup" stepKey="fillSiteMapForm">
<argument name="sitemap" value="DefaultSiteMap" />
</actionGroup>
<actionGroup ref="AssertSiteMapCreateSuccessActionGroup" stepKey="seeSuccessMessage"/>
</test>
</tests>

0 comments on commit 3e80e96

Please sign in to comment.