Skip to content

Commit dcb43ec

Browse files
committed
Merge remote-tracking branch 'origin/MC-20614' into 2.3-develop-pr85
2 parents 1943fe4 + d7549f3 commit dcb43ec

20 files changed

+142
-30
lines changed

app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminCreateWidgetActionGroup.xml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,24 @@
1919
<waitForElementVisible selector="{{AdminMessagesSection.success}}" stepKey="waitForSuccessMessageAppears"/>
2020
<see selector="{{AdminMessagesSection.success}}" userInput="The widget instance has been saved" stepKey="seeSuccess"/>
2121
</actionGroup>
22+
23+
<actionGroup name="AdminCreateCatalogProductWidgetActionGroup" extends="AdminCreateWidgetActionGroup">
24+
<annotations>
25+
<description>EXTENDS: AdminCreateWidgetActionGroup. Creates Catalog Category Link Widget.</description>
26+
</annotations>
27+
<arguments>
28+
<argument name="categoryName" type="string"/>
29+
</arguments>
30+
31+
<waitForElementVisible selector="{{AdminNewWidgetSection.selectCategory}}" after="clickWidgetOptions" stepKey="waitForSelectCategoryButtonVisible"/>
32+
<click selector="{{AdminNewWidgetSection.selectCategory}}" stepKey="clickOnSelectCategory"/>
33+
<waitForPageLoad stepKey="waitForCategoryTreeLoaded"/>
34+
<click selector="{{AdminCategorySidebarTreeSection.expandRootCategoryByName(DefaultCategory.name)}}" stepKey="clickToExpandDefaultCategory"/>
35+
<waitForElementVisible selector="{{AdminCategorySidebarTreeSection.categoryInTree(categoryName)}}" stepKey="waitForCategoryVisible"/>
36+
<click selector="{{AdminCategorySidebarTreeSection.categoryInTree(categoryName)}}" stepKey="selectCategory"/>
37+
<waitForPageLoad stepKey="waitForWidgetPageLoaded"/>
38+
<click selector="{{AdminMainActionsSection.save}}" stepKey="clickSaveButton"/>
39+
<waitForElementVisible selector="{{AdminMessagesSection.success}}" stepKey="waitForSuccessMessage"/>
40+
<see selector="{{AdminMessagesSection.success}}" userInput="The widget instance has been saved" stepKey="seeSuccessMessage"/>
41+
</actionGroup>
2242
</actionGroups>

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

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,15 @@
3232
<data key="display_on">All Pages</data>
3333
<data key="container">Sidebar Additional</data>
3434
</entity>
35+
<entity name="CatalogCategoryLinkWidget" type="widget">
36+
<data key="type">Catalog Category Link</data>
37+
<data key="design_theme">Magento Luma</data>
38+
<data key="name" unique="suffix">Test Widget</data>
39+
<array key="store_ids">
40+
<item>All Store Views</item>
41+
</array>
42+
<data key="sort_order">0</data>
43+
<data key="display_on">All Pages</data>
44+
<data key="container">Main Content Area</data>
45+
</entity>
3546
</entities>

app/code/Magento/Catalog/Test/Mftf/Page/StorefrontCategoryPage.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
<pages xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
1010
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/PageObject.xsd">
11-
<page name="StorefrontCategoryPage" url="/{{var1}}.html" area="storefront" module="Catalog" parameterized="true">
11+
<page name="StorefrontCategoryPage" url="/{{var1}}.html" area="storefront" module="Magento_Catalog" parameterized="true">
1212
<section name="StorefrontCategoryMainSection"/>
1313
<section name="WYSIWYGToolbarSection"/>
1414
</page>

app/code/Magento/Catalog/Test/Mftf/Section/AdminCategorySidebarTreeSection.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
<element name="lastCreatedCategory" type="block" selector=".x-tree-root-ct li li:last-child" />
2020
<element name="treeContainer" type="block" selector=".tree-holder" />
2121
<element name="expandRootCategory" type="text" selector="img.x-tree-elbow-end-plus"/>
22+
<element name="expandRootCategoryByName" type="button" selector="//div[@class='x-tree-root-node']/li/div/a/span[contains(., '{{categoryName}}')]/../../img[contains(@class, 'x-tree-elbow-end-plus')]" parameterized="true" timeout="30"/>
2223
<element name="categoryByName" type="text" selector="//div[contains(@class, 'categories-side-col')]//a/span[contains(text(), '{{categoryName}}')]" parameterized="true" timeout="30"/>
2324
</section>
2425
</sections>

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,6 @@
1010
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
1111
<section name="AdminNewWidgetSection">
1212
<element name="selectProduct" type="button" selector=".btn-chooser" timeout="30"/>
13+
<element name="selectCategory" type="button" selector="button[title='Select Category...']" timeout="30"/>
1314
</section>
1415
</sections>

app/code/Magento/Catalog/Test/Mftf/Section/StorefrontWidgetsSection.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,6 @@
1212
<element name="widgetRecentlyViewedProductsGrid" type="block" selector=".block.widget.block-viewed-products-grid"/>
1313
<element name="widgetRecentlyComparedProductsGrid" type="block" selector=".block.widget.block-compared-products-grid"/>
1414
<element name="widgetRecentlyOrderedProductsGrid" type="block" selector=".block.block-reorder"/>
15+
<element name="widgetCategoryLinkByName" type="text" selector="//div[contains(@class, 'block-category-link')]/a/span[contains(., '{{categoryName}}')]" parameterized="true"/>
1516
</section>
16-
</sections>
17+
</sections>

app/code/Magento/CatalogRule/Test/Mftf/ActionGroup/CatalogPriceRuleActionGroup.xml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,4 +208,29 @@
208208
<waitForElementVisible selector="{{AdminMessagesSection.success}}" after="clickToConfirm" stepKey="waitForSuccessMessage"/>
209209
<see selector="{{AdminMessagesSection.success}}" userInput="You deleted the rule." after="waitForSuccessMessage" stepKey="verifyRuleIsDeleted"/>
210210
</actionGroup>
211+
212+
<actionGroup name="AdminFillCatalogRuleConditionActionGroup">
213+
<annotations>
214+
<description>Clicks on the Conditions tab. Fills in the provided condition for Catalog Price Rule.</description>
215+
</annotations>
216+
<arguments>
217+
<argument name="condition" type="string"/>
218+
<argument name="conditionOperator" type="string" defaultValue="is"/>
219+
<argument name="conditionValue" type="string"/>
220+
</arguments>
221+
222+
<conditionalClick selector="{{AdminNewCatalogPriceRule.conditionsTab}}" dependentSelector="{{AdminNewCatalogPriceRuleConditions.newCondition}}" visible="false" stepKey="openConditionsTab"/>
223+
<waitForElementVisible selector="{{AdminNewCatalogPriceRuleConditions.newCondition}}" stepKey="waitForAddConditionButton"/>
224+
<click selector="{{AdminNewCatalogPriceRuleConditions.newCondition}}" stepKey="addNewCondition"/>
225+
<selectOption selector="{{AdminNewCatalogPriceRuleConditions.conditionSelect('1')}}" userInput="{{condition}}" stepKey="selectTypeCondition"/>
226+
<click selector="{{AdminNewCatalogPriceRuleConditions.condition('is')}}" stepKey="clickOnOperator"/>
227+
<selectOption selector="{{AdminNewCatalogPriceRuleConditions.activeOperatorSelect}}" userInput="{{conditionOperator}}" stepKey="selectCondition"/>
228+
<!-- In case we are choosing already selected value - select is not closed automatically -->
229+
<conditionalClick selector="{{AdminNewCatalogPriceRuleConditions.condition('...')}}" dependentSelector="{{AdminNewCatalogPriceRuleConditions.activeOperatorSelect}}" visible="true" stepKey="closeSelect"/>
230+
<click selector="{{AdminNewCatalogPriceRuleConditions.condition('...')}}" stepKey="clickToChooseOption3"/>
231+
<waitForElementVisible selector="{{AdminNewCatalogPriceRuleConditions.activeValueInput}}" stepKey="waitForValueInput"/>
232+
<fillField selector="{{AdminNewCatalogPriceRuleConditions.activeValueInput}}" userInput="{{conditionValue}}" stepKey="fillConditionValue"/>
233+
<click selector="{{AdminNewCatalogPriceRuleConditions.activeConditionApplyButton}}" stepKey="clickApply"/>
234+
<waitForElementNotVisible selector="{{AdminNewCatalogPriceRuleConditions.activeConditionApplyButton}}" stepKey="waitForApplyButtonInvisibility"/>
235+
</actionGroup>
211236
</actionGroups>
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
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+
<entities xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:DataGenerator/etc/dataProfileSchema.xsd">
11+
<entity name="CatalogRuleProductConditions">
12+
<data key="categoryIds">Magento\CatalogRule\Model\Rule\Condition\Product|category_ids</data>
13+
</entity>
14+
</entities>

app/code/Magento/CatalogRule/Test/Mftf/Metadata/catalog-rule-meta.xml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,9 @@
99

1010
<operations xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
1111
xsi:noNamespaceSchemaLocation="urn:magento:mftf:DataGenerator/etc/dataOperation.xsd">
12-
<operation name="createCatalogRule" dataType="catalogRule"
13-
type="create" auth="adminFormKey" url="/catalog_rule/promo_catalog/save/" method="POST">
12+
<operation name="createCatalogRule" dataType="catalogRule" type="create" auth="adminFormKey"
13+
url="/catalog_rule/promo_catalog/save/back/edit" method="POST"
14+
returnRegex="~\/id\/(?'id'\d+)\/~" returnIndex="id" successRegex="/messages-message-success/">
1415
<contentType>application/x-www-form-urlencoded</contentType>
1516
<field key="name">string</field>
1617
<field key="description">string</field>
@@ -24,4 +25,7 @@
2425
<field key="simple_action">string</field>
2526
<field key="discount_amount">string</field>
2627
</operation>
28+
<operation name="DeleteCatalogRule" dataType="catalogRule" type="delete" auth="adminFormKey"
29+
url="/catalog_rule/promo_catalog/delete/id/{return}" method="POST" successRegex="/messages-message-success/">
30+
</operation>
2731
</operations>

app/code/Magento/CatalogRule/Test/Mftf/Page/AdminNewCatalogPriceRulePage.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,6 @@
1010
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/PageObject.xsd">
1111
<page name="AdminNewCatalogPriceRulePage" url="catalog_rule/promo_catalog/new/" module="Magento_CatalogRule" area="admin">
1212
<section name="AdminNewCatalogPriceRule"/>
13+
<section name="AdminNewCatalogPriceRuleConditions"/>
1314
</page>
1415
</pages>

0 commit comments

Comments
 (0)