Skip to content

Commit

Permalink
Add MFTF test for entity chooser
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Bottens committed Oct 5, 2020
1 parent 51096cb commit fc74196
Show file tree
Hide file tree
Showing 4 changed files with 68 additions and 0 deletions.
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="AdminCreateSpecificEntityWidgetActionGroup" extends="AdminCreateWidgetActionGroup">
<annotations>
<description>Fill widget main fields and widget layout by index for anchor categories DisplayOn option</description>
</annotations>
<selectOption selector="{{AdminNewWidgetSection.specificEntitySelectContainer}}" userInput="{{widget.container}}" stepKey="setContainer"/>
<click selector="{{AdminNewWidgetSection.specificEntitySelectRadio}}" stepKey="clickSpecificEntityRadio" after="waitForPageLoad"/>
<click selector="{{AdminNewWidgetSection.specificEntityOptionsChooser}}" stepKey="clickChooserTrigger" after="clickSpecificEntityRadio"/>
<waitForAjaxLoad stepKey="waitForAjaxCategoryLoad" after="clickChooserTrigger"/>
</actionGroup>
</actionGroups>
14 changes: 14 additions & 0 deletions app/code/Magento/Widget/Test/Mftf/Data/WidgetsData.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,20 @@
<data key="display_on">All Pages</data>
<data key="container">Main Content Area</data>
</entity>
<entity name="CatalogCategoryLinkSpecifiedCategory" type="widget">
<data key="type">Catalog Category Link</data>
<data key="design_theme">Magento Luma</data>
<data key="name" unique="suffix">TestCategoryLinkWidgetOnSpecifiedCategory</data>
<array key="store_ids">
<item>All Store Views</item>
</array>
<data key="sort_order">0</data>
<data key="page">catalog_category_view</data>
<data key="template">Category Link Block Template</data>
<data key="condition">SKU</data>
<data key="display_on">Anchor Categories</data>
<data key="container">Main Content Area</data>
</entity>
<entity name="DynamicBlocksRotatorWidget" type="widget">
<data key="type">Dynamic Blocks Rotator</data>
<data key="design_theme">Magento Luma</data>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,5 +40,8 @@
<element name="displayMode" type="select" selector="select[id*='display_mode']"/>
<element name="restrictTypes" type="select" selector="select[id*='types']"/>
<element name="saveAndContinue" type="button" selector="#save_and_edit_button" timeout="30"/>
<element name="specificEntitySelectContainer" type="select" selector="select[name='widget_instance[0][anchor_categories][block]']"/>
<element name="specificEntitySelectRadio" type="input" selector="#specific_anchor_categories_0"/>
<element name="specificEntityOptionsChooser" type="button" selector="#anchor_categories_ids_0 .widget-option-chooser"/>
</section>
</sections>
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<?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="AdminContentWidgetsDisplayOnSpecificEntitiesTest">
<annotations>
<features value="Widget"/>
<stories value="Widget parameter configuration"/>
<title value="Admin content widgets display on specific entities test"/>
<description value="Admin should be able to select specific entities for widgets"/>
<severity value="CRITICAL"/>
<group value="widget"/>
</annotations>
<before>
<actionGroup ref="AdminLoginActionGroup" stepKey="LoginAsAdmin"/>
</before>
<after>
<actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/>
</after>
<amOnPage url="{{AdminNewWidgetPage.url}}" stepKey="createWidgetPage"/>
<actionGroup ref="AdminCreateSpecificEntityWidgetActionGroup" stepKey="fillForm">
<argument name="widget" value="CatalogCategoryLinkSpecifiedCategory"/>
</actionGroup>
</test>
</tests>

0 comments on commit fc74196

Please sign in to comment.