Skip to content

Commit 96bd13c

Browse files
author
OlgaVasyltsun
committed
Merge remote-tracking branch 'origin/MC-8107' into 2.2-develop-pr116
# Conflicts: # app/code/Magento/Catalog/Test/Mftf/Data/CategoryData.xml
2 parents 6e9ad0a + 40d6441 commit 96bd13c

10 files changed

+498
-3
lines changed

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

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@
77
-->
88

99
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10-
xsi:noNamespaceSchemaLocation="../../../../../../../dev/tests/acceptance/vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Test/etc/actionGroupSchema.xsd">
11-
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
1211
<!--Create a new category-->
1312
<actionGroup name="CreateCategory">
1413
<arguments>
@@ -122,4 +121,29 @@
122121
<click selector="{{AdminMainActionsSection.save}}" stepKey="saveCategory"/>
123122
<seeElement selector="{{AdminMessagesSection.success}}" stepKey="assertSuccess"/>
124123
</actionGroup>
124+
125+
<actionGroup name="DeleteDefaultCategoryChildren">
126+
<annotations>
127+
<description>Deletes all children categories of Default Root Category.</description>
128+
</annotations>
129+
130+
<amOnPage url="{{AdminCategoryPage.url}}" stepKey="navigateToAdminCategoryPage"/>
131+
<executeInSelenium function="function ($webdriver) use ($I) {
132+
$children = $webdriver->findElements(\Facebook\WebDriver\WebDriverBy::xpath('//ul[contains(@class, \'x-tree-node-ct\')]/li[@class=\'x-tree-node\' and contains(.,
133+
\'{{DefaultCategory.name}}\')]/ul[contains(@class, \'x-tree-node-ct\')]/li//a'));
134+
while (!empty($children)) {
135+
$I->click('//ul[contains(@class, \'x-tree-node-ct\')]/li[@class=\'x-tree-node\' and contains(.,
136+
\'{{DefaultCategory.name}}\')]/ul[contains(@class, \'x-tree-node-ct\')]/li//a');
137+
$I->waitForPageLoad(30);
138+
$I->click('#delete');
139+
$I->waitForElementVisible('aside.confirm .modal-footer button.action-accept');
140+
$I->click('aside.confirm .modal-footer button.action-accept');
141+
$I->waitForPageLoad(30);
142+
$I->waitForElementVisible('#messages div.message-success', 30);
143+
$I->see('You deleted the category.', '#messages div.message-success');
144+
$children = $webdriver->findElements(\Facebook\WebDriver\WebDriverBy::xpath('//ul[contains(@class, \'x-tree-node-ct\')]/li[@class=\'x-tree-node\' and contains(.,
145+
\'{{DefaultCategory.name}}\')]/ul[contains(@class, \'x-tree-node-ct\')]/li//a'));
146+
}
147+
}" stepKey="deleteAllChildCategories"/>
148+
</actionGroup>
125149
</actionGroups>

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
-->
88

99
<entities xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10-
xsi:noNamespaceSchemaLocation="../../../../../../../dev/tests/acceptance/vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/DataGenerator/etc/dataProfileSchema.xsd">
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:DataGenerator/etc/dataProfileSchema.xsd">
1111
<entity name="_defaultCategory" type="category">
1212
<data key="name" unique="suffix">simpleCategory</data>
1313
<data key="name_lwr" unique="suffix">simplecategory</data>
@@ -50,4 +50,7 @@
5050
<entity name="SubCategoryNonAnchor" extends="SubCategoryWithParent">
5151
<requiredEntity type="custom_attribute">CustomAttributeCategoryNonAnchor</requiredEntity>
5252
</entity>
53+
<entity name="DefaultCategory" type="category">
54+
<data key="name">Default Category</data>
55+
</entity>
5356
</entities>

app/code/Magento/Catalog/Test/Mftf/Test/StorefrontCatalogNavigationMenuUIDesktopTest.xml

Lines changed: 336 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
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="AdminChangeStorefrontThemeActionGroup">
12+
<arguments>
13+
<argument name="theme" type="string"/>
14+
<argument name="scopeColumn" type="string" defaultValue="Store View"/>
15+
<argument name="scopeName" type="string" defaultValue="{{_defaultStore.name}}"/>
16+
</arguments>
17+
<amOnPage url="{{DesignConfigPage.url}}" stepKey="navigateToDesignConfigPage"/>
18+
<click selector="{{AdminDesignConfigSection.scopeEditLinkByName(scopeColumn, scopeName)}}" stepKey="editScopeConfig"/>
19+
<selectOption selector="{{AdminDesignConfigSection.appliedTheme}}" userInput="{{theme}}" stepKey="selectTheme"/>
20+
<click selector="{{AdminMainActionsSection.save}}" stepKey="clickSave"/>
21+
<waitForElementVisible selector="{{AdminMessagesSection.success}}" stepKey="waitForSuccessMessage"/>
22+
<see selector="{{AdminMessagesSection.success}}" userInput="You saved the configuration." stepKey="seeSuccessMessage"/>
23+
</actionGroup>
24+
</actionGroups>
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
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="StorefrontCheckElementColorActionGroup">
12+
<annotations>
13+
<description>Checks element color on storefront.</description>
14+
</annotations>
15+
<arguments>
16+
<argument name="selector" type="string"/>
17+
<argument name="property" type="string"/>
18+
<argument name="color" type="string"/>
19+
</arguments>
20+
21+
<executeJS function="return window.getComputedStyle(document.querySelector('{{selector}}')).getPropertyValue('{{property}}')" stepKey="getElementColor"/>
22+
<assertEquals expected="{{color}}" expectedType="string" actualType="variable" actual="getElementColor" message="pass" stepKey="assertElementColor"/>
23+
</actionGroup>
24+
</actionGroups>
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
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="MagentoBlankTheme" type="theme">
12+
<data key="name">Magento Blank</data>
13+
</entity>
14+
<entity name="MagentoLumaTheme" type="theme">
15+
<data key="name">Magento Luma</data>
16+
</entity>
17+
</entities>
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
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="NavigationMenuColor" type="navigation_menu_color">
12+
<data key="gray">rgb(232, 232, 232)</data>
13+
<data key="white">rgb(255, 255, 255)</data>
14+
<data key="orange">rgb(255, 85, 1)</data>
15+
</entity>
16+
</entities>
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+
<pages xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/PageObject.xsd">
11+
<page name="DesignConfigPage" url="theme/design_config/" area="admin" module="Magento_Theme">
12+
<section name="AdminDesignConfigSection"/>
13+
</page>
14+
</pages>
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
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+
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
11+
<section name="AdminDesignConfigSection">
12+
<element name="scopeRow" type="button" selector="//*[contains(@class,'data-row')][{{arg1}}]//*[contains(@class,'action-menu-item')]" parameterized="true"/>
13+
<element name="appliedTheme" type="select" selector="select[name='theme_theme_id']"/>
14+
<element name="scopeEditLinkByName" type="button" selector="//tr//td[count(//div[@data-role='grid-wrapper']//tr//th[normalize-space(.)= '{{scope}}']/preceding-sibling::th)+1][contains(.,'{{scopeName}}')]/..//a[contains(@class, 'action-menu-item')]" timeout="30" parameterized="true"/>
15+
</section>
16+
</sections>
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
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+
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
11+
<section name="StorefrontNavigationMenuSection">
12+
<element name="navigationMenu" type="block" selector=".section-items.nav-sections-items li"/>
13+
<element name="subItemLevelHover" type="text" selector=".{{level}} .submenu a:hover" parameterized="true"/>
14+
<element name="itemByNameAndLevel" type="text" selector="//a[span[contains(., '{{itemName}}')]]/following-sibling::ul[contains(@class,'{{itemLevel}}')]" parameterized="true"/>
15+
<element name="subItemByLevel" type="text" selector="li.{{itemLevel}}.parent ul.{{itemLevel}}" parameterized="true"/>
16+
<element name="itemActiveState" type="text" selector=".navigation .level0.active>.level-top"/>
17+
<element name="subItemActiveState" type="text" selector=".navigation .level0 .submenu .active>a"/>
18+
<element name="submenuLeftDirection" type="text" selector="ul.{{itemLevel}}.submenu-reverse" parameterized="true"/>
19+
<element name="submenuRightDirection" type="text" selector="ul.{{itemLevel}}:not(.submenu-reverse)" parameterized="true"/>
20+
</section>
21+
</sections>

0 commit comments

Comments
 (0)