Skip to content

Commit

Permalink
Merge pull request magento#3840 from magento-pangolin/mtf-eol-pr
Browse files Browse the repository at this point in the history
[pangolins] Convert MTF tests to MFTF tests
  • Loading branch information
KevinBKozan authored Mar 8, 2019
2 parents 3caa171 + ef075e0 commit e457037
Show file tree
Hide file tree
Showing 152 changed files with 4,822 additions and 24 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?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="AdminAdvancedReportingSection">
<element name="goToAdvancedReporting" type="text" selector="//div[@class='dashboard-advanced-reports-actions']/a[@title='Go to Advanced Reporting']" timeout="30"/>
</section>
</sections>
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<?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="AdminAdvancedReportingButtonTest">
<annotations>
<stories value="AdvancedReporting"/>
<title value="AdvancedReportingButtonTest"/>
<description value="Test log in to AdvancedReporting and tests AdvancedReportingButtonTest"/>
<testCaseId value="MC-14800"/>
<severity value="CRITICAL"/>
<group value="analytics"/>
<group value="mtf_migrated"/>
</annotations>

<before>
<actionGroup ref = "LoginAsAdmin" stepKey="loginAsAdmin"/>
</before>
<after>
<actionGroup ref="logout" stepKey="logout"/>
</after>

<!--Navigate through Advanced Reporting button on dashboard to Sign Up page-->
<amOnPage url="{{AdminDashboardPage.url}}" stepKey="amOnDashboardPage"/>
<waitForPageLoad stepKey="waitForDashboardPageLoad"/>
<click selector="{{AdminAdvancedReportingSection.goToAdvancedReporting}}" stepKey="clickGoToAdvancedReporting"/>
<switchToNextTab stepKey="switchToNewTab"/>
<seeInCurrentUrl url="advancedreporting.rjmetrics.com/report" stepKey="seeAssertAdvancedReportingPageUrl"/>
</test>
</tests>
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
<click selector="{{AdminGridTableSection.backupRowCheckbox(backup.name)}}" stepKey="selectBackupRow"/>
<selectOption selector="{{AdminGridActionSection.actionSelect}}" userInput="Delete" stepKey="selectDeleteAction"/>
<click selector="{{AdminGridActionSection.submitButton}}" stepKey="clickSubmit"/>
<waitForPageLoad stepKey="waitForConfirmWindowToAppear"/>
<see selector="{{AdminConfirmationModalSection.message}}" userInput="Are you sure you want to delete the selected backup(s)?" stepKey="seeConfirmationModal"/>
<click selector="{{AdminConfirmationModalSection.ok}}" stepKey="clickOkConfirmDelete"/>
<dontSee selector="{{AdminGridTableSection.backupNameColumn}}" userInput="{{backup.name}}" stepKey="dontSeeBackupInGrid"/>
Expand Down
6 changes: 5 additions & 1 deletion app/code/Magento/Backup/Test/Mftf/Data/BackupData.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,8 @@
<data key="name" unique="suffix">databaseBackup</data>
<data key="type">Database</data>
</entity>
</entities>
<entity name="WebSetupWizardBackup" type="backup">
<data key="name">WebSetupWizard</data>
<data key="type">Database</data>
</entity>
</entities>
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="VerifyProductTypeOrder">
<seeElement stepKey="seeBundleInOrder" selector="{{AdminProductDropdownOrderSection.bundleProduct}}"/>
</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.
*/
-->

<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
<section name="AdminProductDropdownOrderSection">
<element name="bundleProduct" type="text" selector="//li[not(preceding-sibling::li[span[@title='Downloadable Product']]) and not(following-sibling::li[span[@title='Simple Product']]) and not(following-sibling::li[span[@title='Configurable Product']]) and not(following-sibling::li[span[@title='Grouped Product']]) and not(following-sibling::li[span[@title='Virtual Product']])]/span[@title='Bundle Product']"/>
</section>
</sections>
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@
<deleteData createDataKey="createPreReqCategory" stepKey="deletePreReqCategory"/>
<deleteData createDataKey="simpleProduct1" stepKey="deleteSimpleProduct1"/>
<deleteData createDataKey="simpleProduct2" stepKey="deleteSimpleProduct2"/>
<!-- Delete the bundled product we created in the test body -->
<actionGroup ref="deleteProductBySku" stepKey="deleteBundleProduct">
<argument name="sku" value="{{BundleProduct.sku}}"/>
</actionGroup>
<actionGroup ref="logout" stepKey="logout"/>
</after>
<!--Go to bundle product creation page-->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,23 @@
<waitForPageLoad stepKey="waitForStoreViewChangeLoad"/>
</actionGroup>

<actionGroup name="switchCategoryToAllStoreView">
<arguments>
<argument name="CatName"/>
</arguments>
<click selector="{{AdminCategorySidebarTreeSection.categoryInTree(CatName)}}" stepKey="navigateToCreatedCategory" />
<waitForPageLoad stepKey="waitForPageLoad1"/>
<waitForLoadingMaskToDisappear stepKey="waitForSpinner1"/>
<scrollToTopOfPage stepKey="scrollToToggle"/>
<click selector="{{AdminCategoryMainActionsSection.CategoryStoreViewDropdownToggle}}" stepKey="openStoreViewDropDown"/>
<click selector="{{AdminCategoryMainActionsSection.allStoreViews}}" stepKey="clickStoreViewByName"/>
<see selector="{{AdminCategoryMainActionsSection.storeSwitcher}}" userInput="All Store Views" stepKey="seeAllStoreView"/>
<waitForPageLoad stepKey="waitForPageLoad2"/>
<waitForLoadingMaskToDisappear stepKey="waitForSpinner2"/>
<click selector="{{AdminCategoryMainActionsSection.CategoryStoreViewModalAccept}}" stepKey="selectStoreViewAccept"/>
<waitForPageLoad stepKey="waitForStoreViewChangeLoad"/>
</actionGroup>

<actionGroup name="navigateToCreatedCategory">
<arguments>
<argument name="Category"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,4 +74,21 @@
<click selector="{{AdminProductAttributeSetGridSection.nthRow('1')}}" stepKey="clickFirstRow"/>
<waitForPageLoad time="30" stepKey="waitForPageLoad1"/>
</actionGroup>

<!-- Delete attribute set -->
<actionGroup name="deleteAttributeSetByLabel">
<arguments>
<argument name="label" type="string"/>
</arguments>
<amOnPage url="{{AdminProductAttributeSetGridPage.url}}" stepKey="goToAttributeSets"/>
<waitForPageLoad stepKey="waitForAttributeSetPageLoad"/>
<fillField selector="{{AdminProductAttributeSetGridSection.filter}}" userInput="{{label}}" stepKey="filterByName"/>
<click selector="{{AdminProductAttributeSetGridSection.searchBtn}}" stepKey="clickSearch"/>
<click selector="{{AdminProductAttributeSetGridSection.nthRow('1')}}" stepKey="clickFirstRow"/>
<waitForPageLoad stepKey="waitForClick"/>
<click selector="{{AdminProductAttributeSetSection.deleteBtn}}" stepKey="clickDelete"/>
<click selector="{{AdminProductAttributeSetSection.modalOk}}" stepKey="confirmDelete"/>
<waitForPageLoad stepKey="waitForDeleteToFinish"/>
<see selector="{{AdminCategoryMessagesSection.SuccessMessage}}" userInput="The attribute set has been removed." stepKey="seeDeleteMessage"/>
</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="AssertAttributeDeletionErrorMessageActionGroup">
<waitForElementVisible selector="{{AdminProductMessagesSection.errorMessage}}" stepKey="waitForErrorMessage"/>
<see selector="{{AdminProductMessagesSection.errorMessage}}" userInput="This attribute is used in configurable products." stepKey="deleteProductAttributeFailureMessage"/>
</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="AssertProductAttributePresenceInCatalogProductGridActionGroup">
<arguments>
<argument name="productAttribute" type="entity"/>
</arguments>
<waitForPageLoad stepKey="waitForCatalogProductGridPageLoad"/>
<seeElement selector="{{AdminGridHeaders.headerByName(productAttribute.label)}}" stepKey="seeAttributeInHeaders"/>
</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="DeleteProductAttributeByAttributeCodeActionGroup">
<arguments>
<argument name="productAttributeCode" type="string"/>
</arguments>
<waitForPageLoad stepKey="waitForViewAdminProductAttributeLoad" time="30" />
<click selector="{{AttributePropertiesSection.DeleteAttribute}}" stepKey="deleteAttribute"/>
<click selector="{{ModalConfirmationSection.OkButton}}" stepKey="clickOnConfirmOk"/>
<waitForPageLoad stepKey="waitForViewProductAttributePageLoad"/>
</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="OpenProductAttributeFromSearchResultInGridActionGroup" extends="SearchAttributeByCodeOnProductAttributeGridActionGroup">
<arguments>
<argument name="productAttributeCode" type="string"/>
</arguments>
<waitForElementVisible selector="{{AdminProductAttributeGridSection.AttributeCode(productAttributeCode)}}" stepKey="waitForAdminProductAttributeGridLoad"/>
<click selector="{{AdminProductAttributeGridSection.AttributeCode(productAttributeCode)}}" stepKey="clickAttributeToView"/>
<waitForPageLoad stepKey="waitForViewAdminProductAttributeLoad" />
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?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="SearchAttributeByCodeOnProductAttributeGridActionGroup">
<arguments>
<argument name="productAttributeCode" type="string"/>
</arguments>
<amOnPage url="{{AdminProductAttributeGridPage.url}}" stepKey="navigateToProductAttributeGrid"/>
<waitForPageLoad stepKey="waitForAdminProductAttributeGridLoad"/>
<click selector="{{AdminProductAttributeGridSection.ResetFilter}}" stepKey="resetFiltersOnGrid"/>
<waitForPageLoad stepKey="waitForAdminProductAttributeGridSectionLoad"/>
<fillField selector="{{AdminProductAttributeGridSection.FilterByAttributeCode}}" userInput="{{productAttributeCode}}" stepKey="setAttributeCode"/>
<click selector="{{AdminProductAttributeGridSection.Search}}" stepKey="searchForAttributeFromTheGrid"/>
<waitForLoadingMaskToDisappear stepKey="waitForLoadingMaskOnGridToDisappear"/>
<see selector="{{AdminProductAttributeGridSection.attributeCodeColumn}}" userInput="{{productAttributeCode}}" stepKey="seeAttributeCodeInGrid"/>
</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="VerifyProductTypeOrder">
<click selector="{{AdminProductGridActionSection.addProductToggle}}" stepKey="clickAddProductDropdown"/>
<waitForPageLoad stepKey="waitForLoad"/>
<seeElement stepKey="seeSimpleInOrder" selector="{{AdminProductDropdownOrderSection.simpleProduct}}"/>
<seeElement stepKey="seeVirtualInOrder" selector="{{AdminProductDropdownOrderSection.virtualProduct}}"/>
</actionGroup>
</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.
*/
-->

<entities xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:DataGenerator/etc/dataProfileSchema.xsd">
<entity name="specialProductPrice" type="catalogSpecialPrice">
<data key="price">99.99</data>
<data key="store_id">0</data>
<var key="sku" entityType="product2" entityKey="sku" />
</entity>
</entities>
21 changes: 21 additions & 0 deletions app/code/Magento/Catalog/Test/Mftf/Data/ProductAttributeData.xml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,27 @@
<data key="used_for_sort_by">true</data>
<requiredEntity type="FrontendLabel">ProductAttributeFrontendLabel</requiredEntity>
</entity>
<entity name="productAttributeWithTwoOptionsNotVisible" type="ProductAttribute">
<data key="attribute_code" unique="suffix">test_attr_</data>
<data key="frontend_input">select</data>
<data key="scope">global</data>
<data key="is_required">false</data>
<data key="is_unique">false</data>
<data key="is_searchable">false</data>
<data key="is_visible">true</data>
<data key="is_visible_in_advanced_search">false</data>
<data key="is_visible_on_front">false</data>
<data key="is_filterable">false</data>
<data key="is_filterable_in_search">false</data>
<data key="used_in_product_listing">false</data>
<data key="is_used_for_promo_rules">false</data>
<data key="is_comparable">false</data>
<data key="is_used_in_grid">false</data>
<data key="is_visible_in_grid">false</data>
<data key="is_filterable_in_grid">false</data>
<data key="used_for_sort_by">false</data>
<requiredEntity type="FrontendLabel">ProductAttributeFrontendLabel</requiredEntity>
</entity>
<entity name="productDropDownAttribute" type="ProductAttribute">
<data key="attribute_code" unique="suffix">attribute</data>
<data key="frontend_input">select</data>
Expand Down
37 changes: 37 additions & 0 deletions app/code/Magento/Catalog/Test/Mftf/Data/ProductData.xml
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,31 @@
<data key="quantity">0</data>
<requiredEntity type="custom_attribute_array">CustomAttributeCategoryIds</requiredEntity>
</entity>
<entity name="SimpleOutOfStockProduct" type="product">
<data key="sku" unique="suffix">testSku</data>
<data key="type_id">simple</data>
<data key="attribute_set_id">4</data>
<data key="visibility">4</data>
<data key="name" unique="suffix">OutOfStockProduct</data>
<data key="price">123.00</data>
<data key="urlKey" unique="suffix">testurlkey</data>
<data key="status">1</data>
<data key="quantity">0</data>
</entity>
<!-- Simple Product Disabled -->
<entity name="SimpleProductOffline" type="product2">
<data key="sku" unique="suffix">testSku</data>
<data key="type_id">simple</data>
<data key="attribute_set_id">4</data>
<data key="visibility">4</data>
<data key="name" unique="suffix">SimpleOffline</data>
<data key="price">123.00</data>
<data key="status">2</data>
<data key="quantity">100</data>
<data key="urlKey" unique="suffix">testurlkey</data>
<requiredEntity type="product_extension_attribute">EavStockItem</requiredEntity>
<requiredEntity type="custom_attribute">CustomAttributeProductAttribute</requiredEntity>
</entity>
<entity name="NewSimpleProduct" type="product">
<data key="price">321.00</data>
</entity>
Expand All @@ -110,6 +135,18 @@
<requiredEntity type="product_extension_attribute">EavStockItem</requiredEntity>
<requiredEntity type="custom_attribute">CustomAttributeProductAttribute</requiredEntity>
</entity>
<entity name="ApiSimpleOutOfStock" type="product2">
<data key="sku" unique="suffix">api-simple-product</data>
<data key="type_id">simple</data>
<data key="attribute_set_id">4</data>
<data key="visibility">4</data>
<data key="name" unique="suffix">Api Simple Out Of Stock Product</data>
<data key="price">123.00</data>
<data key="urlKey" unique="suffix">api-simple-product</data>
<data key="status">1</data>
<data key="quantity">100</data>
<requiredEntity type="custom_attribute">CustomAttributeProductAttribute</requiredEntity>
</entity>
<entity name="ApiSimpleOne" type="product2">
<data key="sku" unique="suffix">api-simple-product</data>
<data key="type_id">simple</data>
Expand Down
8 changes: 8 additions & 0 deletions app/code/Magento/Catalog/Test/Mftf/Data/TierPriceData.xml
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,12 @@
<data key="price">500,000.00</data>
<data key="qty">1</data>
</entity>
<entity name="tierProductPrice" type="catalogTierPrice">
<data key="price">90.00</data>
<data key="price_type">fixed</data>
<data key="website_id">0</data>
<data key="customer_group">ALL GROUPS</data>
<data key="quantity">2</data>
<var key="sku" entityType="product2" entityKey="sku" />
</entity>
</entities>
Loading

0 comments on commit e457037

Please sign in to comment.