Skip to content

Commit

Permalink
Merge pull request #3104 from magento-tsg/2.3-develop-mftf-pr4
Browse files Browse the repository at this point in the history
[TSG] MFTF for 2.3 (pr4) (2.3.0)
  • Loading branch information
Joan He authored Sep 11, 2018
2 parents 0eb8677 + 96cb0bb commit 89d8f80
Show file tree
Hide file tree
Showing 17 changed files with 265 additions and 1 deletion.
14 changes: 14 additions & 0 deletions app/code/Magento/Backend/Test/Mftf/Page/AdminDashboardPage.xml
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.
*/
-->

<pages xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="../../../../../../../dev/tests/acceptance/vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Page/etc/PageObject.xsd">
<page name="AdminDashboardPage" url="admin/dashboard/" area="admin" module="Magento_Backend">
<section name="AdminMenuSection"/>
</page>
</pages>
19 changes: 19 additions & 0 deletions app/code/Magento/Backend/Test/Mftf/Section/AdminMenuSection.xml
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.
*/
-->

<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="../../../../../../../dev/tests/acceptance/vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Page/etc/SectionObject.xsd">
<section name="AdminMenuSection">
<element name="catalog" type="button" selector="#menu-magento-catalog-catalog"/>
<element name="customers" type="button" selector="#menu-magento-customer-customer"/>
<element name="content" type="button" selector="#menu-magento-backend-content"/>
<element name="widgets" type="button" selector="#nav li[data-ui-id='menu-magento-widget-cms-widget-instance']"/>
<element name="stores" type="button" selector="#menu-magento-backend-stores"/>
<element name="configuration" type="button" selector="#nav li[data-ui-id='menu-magento-config-system-config']"/>
</section>
</sections>
Empty file.
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@
<argument name="simpleProduct"/>
</arguments>
<amOnPage url="{{AdminProductIndexPage.url}}" stepKey="navigateToProductIndex"/>
<waitForPageLoad stepKey="waitForPageLoad"/>
<click selector="{{AdminProductGridActionSection.addProductToggle}}" stepKey="clickAddProductDropdown"/>
<click selector="{{AdminProductGridActionSection.addSimpleProduct}}" stepKey="clickAddSimpleProduct"/>
<fillField userInput="{{simpleProduct.name}}" selector="{{AdminProductFormSection.productName}}" stepKey="fillName"/>
Expand Down
22 changes: 22 additions & 0 deletions app/code/Magento/Customer/Test/Mftf/ActionGroup/OpenEditCustomerFromAdminActionGroup.xml
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,26 @@
<click selector="{{AdminCustomerGridSection.firstRowEditLink}}" stepKey="clickEdit"/>
<waitForPageLoad stepKey="waitForPageLoad2" />
</actionGroup>
<actionGroup name="DeleteCustomerFromAdminActionGroup">
<arguments>
<argument name="customer"/>
</arguments>
<amOnPage url="{{AdminCustomerPage.url}}" stepKey="navigateToCustomers"/>
<waitForPageLoad stepKey="waitForPageLoad1" />
<conditionalClick selector="{{AdminDataGridHeaderSection.clearFilters}}" dependentSelector="{{AdminDataGridHeaderSection.clearFilters}}" visible="true" stepKey="clickOnButtonToRemoveFiltersIfPresent"/>
<fillField selector="{{AdminDataGridHeaderSection.search}}" userInput="{{customer.email}}" stepKey="fillSearch"/>
<click selector="{{AdminDataGridHeaderSection.submitSearch}}" stepKey="clickSubmit"/>
<waitForAjaxLoad stepKey="waitForLoadAjax"/>
<click selector="{{AdminCustomerGridMainActionsSection.multicheck}}" stepKey="selectAll"/>
<click selector="{{AdminCustomerGridMainActionsSection.actions}}" stepKey="clickActions"/>
<click selector="{{AdminCustomerGridMainActionsSection.delete}}" stepKey="clickDelete"/>
<waitForAjaxLoad stepKey="waitForLoadConfirmation"/>
<click selector="{{AdminConfirmationModalSection.ok}}" stepKey="confirmDelete"/>
<see selector="{{AdminMessagesSection.successMessage}}" userInput="A total of 1 record(s) were deleted" stepKey="seeSuccess"/>
</actionGroup>
<actionGroup name="AdminClearCustomersFiltersActionGroup">
<amOnPage url="{{AdminCustomerPage.url}}" stepKey="amOnCustomersPage"/>
<waitForPageLoad stepKey="WaitForPageToLoad"/>
<conditionalClick selector="{{AdminDataGridHeaderSection.clearFilters}}" dependentSelector="{{AdminDataGridHeaderSection.clearFilters}}" visible="true" stepKey="clickOnButtonToRemoveFiltersIfPresent"/>
</actionGroup>
</actionGroups>
2 changes: 1 addition & 1 deletion app/code/Magento/Customer/Test/Mftf/Data/AddressData.xml
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<data key="customer_id">12</data>
<requiredEntity type="region">CustomerRegionOne</requiredEntity>
<data key="region_id">0</data>
<data key="country_id">USA</data>
<data key="country_id">US</data>
<array key="street">
<item>7700 W Parmer Ln</item>
<item>Bld D</item>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,6 @@
<element name="nameInput" type="input" selector="input[name=name]"/>
<element name="emailInput" type="input" selector="input[name=email]"/>
<element name="apply" type="button" selector="button[data-action=grid-filter-apply]" timeout="30"/>
<element name="clearAllFilters" type="text" selector=".admin__current-filters-actions-wrap.action-clear"/>
</section>
</sections>
3 changes: 3 additions & 0 deletions app/code/Magento/Customer/Test/Mftf/Section/AdminCustomerGridMainActionsSection.xml
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,8 @@
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
<section name="AdminCustomerGridMainActionsSection">
<element name="addNewCustomer" type="button" selector="#add" timeout="30"/>
<element name="multicheck" type="checkbox" selector="#container>div>div.admin__data-grid-wrap>table>thead>tr>th.data-grid-multicheck-cell>div>label"/>
<element name="delete" type="button" selector="//*[contains(@class, 'admin__data-grid-header')]//span[contains(@class,'action-menu-item') and text()='Delete']"/>
<element name="actions" type="text" selector=".action-select"/>
</section>
</sections>
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?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="../../../../../../../dev/tests/acceptance/vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Test/etc/actionGroupSchema.xsd">
<actionGroup name="AdminCreateCartPriceRuleActionGroup">
<arguments>
<argument name="ruleName"/>
</arguments>
<amOnPage url="{{AdminCartPriceRulesPage.url}}" stepKey="amOnCartPriceList"/>
<waitForPageLoad stepKey="waitForPriceList"/>
<click selector="{{AdminCartPriceRulesSection.addNewRuleButton}}" stepKey="clickAddNewRule"/>
<fillField selector="{{AdminCartPriceRulesFormSection.ruleName}}" userInput="{{ruleName.name}}" stepKey="fillRuleName"/>
<selectOption selector="{{AdminCartPriceRulesFormSection.websites}}" userInput="{{ruleName.websites}}" stepKey="selectWebsites"/>
<selectOption selector="{{AdminCartPriceRulesFormSection.customerGroups}}" parameterArray="[{{ruleName.customerGroups}}]" stepKey="selectCustomerGroup"/>
<click selector="{{AdminCartPriceRulesFormSection.actionsHeader}}" stepKey="clickToExpandActions"/>
<selectOption selector="{{AdminCartPriceRulesFormSection.apply}}" userInput="{{ruleName.apply}}" stepKey="selectActionType"/>
<fillField selector="{{AdminCartPriceRulesFormSection.discountAmount}}" userInput="{{ruleName.discountAmount}}" stepKey="fillDiscountAmount"/>
<click selector="{{AdminCartPriceRulesFormSection.save}}" stepKey="clickSaveButton"/>
<see selector="{{AdminCartPriceRulesFormSection.successMessage}}" userInput="You saved the rule." stepKey="seeSuccessMessage"/>
</actionGroup>
</actionGroups>
7 changes: 7 additions & 0 deletions app/code/Magento/SalesRule/Test/Mftf/Data/SalesRuleData.xml
Original file line number Diff line number Diff line change
Expand Up @@ -53,4 +53,11 @@
<item>1</item>
</array>
</entity>
<entity name="TestSalesRule" type="SalesRule">
<data key="name" unique="suffix">TestSalesRule</data>
<data key="websites">Main Website</data>
<data key="customerGroups">'NOT LOGGED IN', 'General', 'Wholesale', 'Retailer'</data>
<data key="apply">Percent of product price discount</data>
<data key="discountAmount">50</data>
</entity>
</entities>
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
<?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="../../../../../../../dev/tests/acceptance/vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Test/etc/actionGroupSchema.xsd">
<actionGroup name="AdminCreateProductsListWidgetActionGroup">
<arguments>
<argument name="widget"/>
</arguments>
<amOnPage url="{{AdminDashboardPage.url}}" stepKey="amOnAdminDashboard"/>
<click selector="{{AdminMenuSection.content}}" stepKey="clickContent"/>
<waitForLoadingMaskToDisappear stepKey="waitForWidgets" />
<click selector="{{AdminMenuSection.widgets}}" stepKey="clickWidgets"/>
<waitForPageLoad stepKey="waitForWidgetsLoad"/>
<click selector="{{AdminGridMainControls.add}}" stepKey="addNewWidget"/>
<selectOption selector="{{AdminNewWidgetSection.widgetType}}" userInput="{{widget.type}}" stepKey="setWidgetType"/>
<selectOption selector="{{AdminNewWidgetSection.widgetDesignTheme}}" userInput="{{widget.design_theme}}" stepKey="setWidgetDesignTheme"/>
<click selector="{{AdminNewWidgetSection.continue}}" stepKey="clickContinue"/>
<fillField selector="{{AdminNewWidgetSection.widgetTitle}}" userInput="{{widget.name}}" stepKey="fillTitle"/>
<selectOption selector="{{AdminNewWidgetSection.widgetStoreIds}}" userInput="{{widget.store_ids[0]}}" stepKey="setWidgetStoreIds"/>
<click selector="{{AdminNewWidgetSection.addLayoutUpdate}}" stepKey="clickAddLayoutUpdate"/>
<selectOption selector="{{AdminNewWidgetSection.selectDisplayOn}}" userInput="{{widget.display_on}}" stepKey="setDisplayOn"/>
<waitForAjaxLoad stepKey="waitForLoad"/>
<selectOption selector="{{AdminNewWidgetSection.selectContainer}}" userInput="{{widget.container}}" stepKey="setContainer"/>
<waitForAjaxLoad stepKey="waitForPageLoad"/>
<scrollToTopOfPage stepKey="scrollToTopOfPage"/>
<click selector="{{AdminNewWidgetSection.widgetOptions}}" stepKey="clickWidgetOptions"/>
<click selector="{{AdminNewWidgetSection.addNewCondition}}" stepKey="clickAddNewCondition"/>
<selectOption selector="{{AdminNewWidgetSection.selectCondition}}" userInput="{{widget.condition}}" stepKey="selectCondition"/>
<waitForElement selector="{{AdminNewWidgetSection.ruleParameter}}" stepKey="waitRuleParameter"/>
<click selector="{{AdminNewWidgetSection.ruleParameter}}" stepKey="clickRuleParameter"/>
<click selector="{{AdminNewWidgetSection.openChooser}}" stepKey="clickChooser"/>
<waitForAjaxLoad stepKey="waitForAjaxLoad"/>
<click selector="{{AdminNewWidgetSection.selectAll}}" stepKey="clickSelectAll"/>
<click selector="{{AdminNewWidgetSection.applyParameter}}" stepKey="clickApplyRuleParameter"/>
<click selector="{{AdminMainActionsSection.save}}" stepKey="clickSaveWidget"/>
<waitForPageLoad stepKey="waitForSaveLoad"/>
<see selector="{{AdminMessagesSection.successMessage}}" userInput="The widget instance has been saved" stepKey="seeSuccess"/>
</actionGroup>
<actionGroup name="AdminDeleteWidgetActionGroup">
<arguments>
<argument name="widget"/>
</arguments>
<amOnPage url="{{AdminWidgetsPage.url}}" stepKey="amOnAdmin"/>
<waitForPageLoad stepKey="waitWidgetsLoad"/>
<fillField selector="{{AdminWidgetsSection.widgetTitleSearch}}" userInput="{{widget.name}}" stepKey="fillTitle"/>
<click selector="{{AdminWidgetsSection.searchButton}}" stepKey="clickContinue"/>
<click selector="{{AdminWidgetsSection.searchResult}}" stepKey="clickSearchResult"/>
<waitForPageLoad stepKey="waitForResultLoad"/>
<click selector="{{AdminMainActionsSection.delete}}" stepKey="clickDelete"/>
<waitForAjaxLoad stepKey="waitForAjaxLoad"/>
<click selector="{{AdminConfirmationModalSection.ok}}" stepKey="confirmDelete"/>
<waitForPageLoad stepKey="waitForDeleteLoad"/>
<see selector="{{AdminMessagesSection.successMessage}}" userInput="The widget instance has been deleted" stepKey="seeSuccess"/>
</actionGroup>
</actionGroups>
22 changes: 22 additions & 0 deletions app/code/Magento/Widget/Test/Mftf/Data/WidgetsData.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?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="../../../../../../../dev/tests/acceptance/vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/DataGenerator/etc/dataProfileSchema.xsd">
<entity name="ProductsListWidget" type="widget">
<data key="type">Catalog Products List</data>
<data key="design_theme">Magento Luma</data>
<data key="name" unique="suffix">TestWidget</data>
<array key="store_ids">
<item>All Store Views</item>
</array>
<data key="condition">SKU</data>
<data key="display_on">All Pages</data>
<data key="container">Main Content Area</data>
</entity>
</entities>
14 changes: 14 additions & 0 deletions app/code/Magento/Widget/Test/Mftf/Page/AdminNewWidgetPage.xml
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.
*/
-->

<pages xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="../../../../../../../dev/tests/acceptance/vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Page/etc/PageObject.xsd">
<page name="AdminNewWidgetPage" url="admin/admin/widget_instance/new/" area="admin" module="Magento_Widget">
<section name="AdminNewWidgetSection"/>
</page>
</pages>
14 changes: 14 additions & 0 deletions app/code/Magento/Widget/Test/Mftf/Page/AdminWidgetsPage.xml
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.
*/
-->

<pages xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="../../../../../../../dev/tests/acceptance/vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Page/etc/PageObject.xsd">
<page name="AdminWidgetsPage" url="admin/widget_instance/" area="admin" module="Magento_Widget">
<section name="AdminWidgetsSection"/>
</page>
</pages>
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<?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="../../../../../../../dev/tests/acceptance/vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Page/etc/SectionObject.xsd">
<section name="AdminNewWidgetSection">
<element name="widgetType" type="select" selector="#code"/>
<element name="widgetDesignTheme" type="select" selector="#theme_id"/>
<element name="continue" type="button" selector="#continue_button"/>
<element name="widgetTitle" type="input" selector="#title"/>
<element name="widgetStoreIds" type="select" selector="#store_ids"/>
<element name="addLayoutUpdate" type="button" selector=".action-default.scalable.action-add"/>
<element name="selectDisplayOn" type="select" selector="#widget_instance[0][page_group]"/>
<element name="selectContainer" type="select" selector="#all_pages_0>table>tbody>tr>td:nth-child(1)>div>div>select"/>
<element name="widgetOptions" type="select" selector="#widget_instace_tabs_properties_section"/>
<element name="addNewCondition" type="select" selector=".rule-param.rule-param-new-child"/>
<element name="selectCondition" type="input" selector="#conditions__1__new_child"/>
<element name="ruleParameter" type="select" selector="#conditions__1__children>li:nth-child(1)>span:nth-child(4)>a"/>
<element name="setRuleParameter" type="input" selector="#conditions__1--1__value"/>
<element name="applyParameter" type="button" selector=".rule-param-apply"/>
<element name="openChooser" type="button" selector=".rule-chooser-trigger"/>
<element name="selectAll" type="checkbox" selector=".admin__control-checkbox"/>
</section>
</sections>
16 changes: 16 additions & 0 deletions app/code/Magento/Widget/Test/Mftf/Section/AdminWidgetsSection.xml
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.
*/
-->

<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="../../../../../../../dev/tests/acceptance/vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Page/etc/SectionObject.xsd">
<section name="AdminWidgetsSection">
<element name="widgetTitleSearch" type="input" selector="#widgetInstanceGrid_filter_title"/>
<element name="searchButton" type="button" selector=".action-default.scalable.action-secondary"/>
<element name="searchResult" type="text" selector="#widgetInstanceGrid_table>tbody>tr:nth-child(1)"/>
</section>
</sections>
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.
*/
-->

<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="../../../../../../../dev/tests/acceptance/vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Page/etc/SectionObject.xsd">
<section name="StorefrontWidgetsSection">
<element name="widgetProductsGrid" type="block" selector=".block.widget.block-products-list.grid"/>
<element name="widgetProductName" type="text" selector=".product-item-name"/>
</section>
</sections>

0 comments on commit 89d8f80

Please sign in to comment.