Skip to content

Commit fc74196

Browse files
author
Michael Bottens
committed
Add MFTF test for entity chooser
1 parent 51096cb commit fc74196

File tree

4 files changed

+68
-0
lines changed

4 files changed

+68
-0
lines changed
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
9+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="AdminCreateSpecificEntityWidgetActionGroup" extends="AdminCreateWidgetActionGroup">
12+
<annotations>
13+
<description>Fill widget main fields and widget layout by index for anchor categories DisplayOn option</description>
14+
</annotations>
15+
<selectOption selector="{{AdminNewWidgetSection.specificEntitySelectContainer}}" userInput="{{widget.container}}" stepKey="setContainer"/>
16+
<click selector="{{AdminNewWidgetSection.specificEntitySelectRadio}}" stepKey="clickSpecificEntityRadio" after="waitForPageLoad"/>
17+
<click selector="{{AdminNewWidgetSection.specificEntityOptionsChooser}}" stepKey="clickChooserTrigger" after="clickSpecificEntityRadio"/>
18+
<waitForAjaxLoad stepKey="waitForAjaxCategoryLoad" after="clickChooserTrigger"/>
19+
</actionGroup>
20+
</actionGroups>

app/code/Magento/Widget/Test/Mftf/Data/WidgetsData.xml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,20 @@
1919
<data key="display_on">All Pages</data>
2020
<data key="container">Main Content Area</data>
2121
</entity>
22+
<entity name="CatalogCategoryLinkSpecifiedCategory" type="widget">
23+
<data key="type">Catalog Category Link</data>
24+
<data key="design_theme">Magento Luma</data>
25+
<data key="name" unique="suffix">TestCategoryLinkWidgetOnSpecifiedCategory</data>
26+
<array key="store_ids">
27+
<item>All Store Views</item>
28+
</array>
29+
<data key="sort_order">0</data>
30+
<data key="page">catalog_category_view</data>
31+
<data key="template">Category Link Block Template</data>
32+
<data key="condition">SKU</data>
33+
<data key="display_on">Anchor Categories</data>
34+
<data key="container">Main Content Area</data>
35+
</entity>
2236
<entity name="DynamicBlocksRotatorWidget" type="widget">
2337
<data key="type">Dynamic Blocks Rotator</data>
2438
<data key="design_theme">Magento Luma</data>

app/code/Magento/Widget/Test/Mftf/Section/AdminNewWidgetSection.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,5 +40,8 @@
4040
<element name="displayMode" type="select" selector="select[id*='display_mode']"/>
4141
<element name="restrictTypes" type="select" selector="select[id*='types']"/>
4242
<element name="saveAndContinue" type="button" selector="#save_and_edit_button" timeout="30"/>
43+
<element name="specificEntitySelectContainer" type="select" selector="select[name='widget_instance[0][anchor_categories][block]']"/>
44+
<element name="specificEntitySelectRadio" type="input" selector="#specific_anchor_categories_0"/>
45+
<element name="specificEntityOptionsChooser" type="button" selector="#anchor_categories_ids_0 .widget-option-chooser"/>
4346
</section>
4447
</sections>
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
9+
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
11+
<test name="AdminContentWidgetsDisplayOnSpecificEntitiesTest">
12+
<annotations>
13+
<features value="Widget"/>
14+
<stories value="Widget parameter configuration"/>
15+
<title value="Admin content widgets display on specific entities test"/>
16+
<description value="Admin should be able to select specific entities for widgets"/>
17+
<severity value="CRITICAL"/>
18+
<group value="widget"/>
19+
</annotations>
20+
<before>
21+
<actionGroup ref="AdminLoginActionGroup" stepKey="LoginAsAdmin"/>
22+
</before>
23+
<after>
24+
<actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/>
25+
</after>
26+
<amOnPage url="{{AdminNewWidgetPage.url}}" stepKey="createWidgetPage"/>
27+
<actionGroup ref="AdminCreateSpecificEntityWidgetActionGroup" stepKey="fillForm">
28+
<argument name="widget" value="CatalogCategoryLinkSpecifiedCategory"/>
29+
</actionGroup>
30+
</test>
31+
</tests>

0 commit comments

Comments
 (0)