Skip to content

Commit 4fc5977

Browse files
merge magento/2.2-develop into magento-chaika/Chaika-PR-2019-09-15-2.2
2 parents 0666c86 + 3a68504 commit 4fc5977

File tree

52 files changed

+1713
-194
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+1713
-194
lines changed
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
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="AdminClickSaveAndContinueButtonActionGroup">
12+
<annotations>
13+
<description>Click "Save and Continue" button and assert message</description>
14+
</annotations>
15+
<arguments>
16+
<argument name="message" type="string"/>
17+
</arguments>
18+
<scrollToTopOfPage stepKey="scrollToPageTop"/>
19+
<click selector="{{AdminMainActionsSection.saveAndContinue}}" stepKey="clickSaveAndContinue"/>
20+
<waitForElementVisible time="30" selector="{{AdminMessagesSection.success}}" stepKey="waitMessage"/>
21+
<see selector="{{AdminMessagesSection.success}}" userInput="{{message}}" stepKey="verifyMessage"/>
22+
</actionGroup>
23+
</actionGroups>

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/ActionGroup/AdminProductActionGroup.xml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,15 @@
6060

6161
<!--Save product and see success message-->
6262
<actionGroup name="saveProductForm">
63-
<scrollToTopOfPage stepKey="scrollToTop"/>
63+
<annotations>
64+
<description>Clicks on the Save button. Validates that the Success Message is present and correct.</description>
65+
</annotations>
66+
67+
<scrollToTopOfPage stepKey="scrollTopPageProduct"/>
68+
<waitForElementVisible selector="{{AdminProductFormActionSection.saveButton}}" stepKey="waitForSaveProductButton"/>
6469
<click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="clickSaveProduct"/>
65-
<see selector="{{AdminProductMessagesSection.successMessage}}" userInput="You saved the product." stepKey="seeSaveConfirmation"/>
70+
<waitForElementVisible selector="{{AdminMessagesSection.success}}" stepKey="waitProductSaveSuccessMessage"/>
71+
<see selector="{{AdminMessagesSection.success}}" userInput="You saved the product." stepKey="seeSaveConfirmation"/>
6672
</actionGroup>
6773

6874
<!--Upload image for product-->

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,11 @@
2020
<arguments>
2121
<argument name="useForPromoRule" type="string" defaultValue="Yes"/>
2222
</arguments>
23-
<click selector="{{StorefrontPropertiesSection.storefrontPropertiesTab}}" stepKey="clickStoreFrontPropertiesTab"/>
24-
<selectOption selector="{{StorefrontPropertiesSection.useForPromoRuleConditions}}" userInput="{{useForPromoRule}}" stepKey="changeOption"/>
23+
<click selector="{{AdminEditAttributeStorefrontPropertiesSection.storeFrontPropertiesTab}}" stepKey="clickStoreFrontPropertiesTab"/>
24+
<waitForElementVisible selector="{{AdminEditAttributeStorefrontPropertiesSection.useForPromoRuleConditions}}" stepKey="waitForUseForPromoRuleConditionsVisible"/>
25+
<selectOption selector="{{AdminEditAttributeStorefrontPropertiesSection.useForPromoRuleConditions}}" userInput="{{useForPromoRule}}" stepKey="changeOption"/>
2526
<click selector="{{AttributePropertiesSection.save}}" stepKey="saveAttribute"/>
27+
<waitForElementVisible selector="{{AdminMessagesSection.successMessage}}" stepKey="waitForSuccessMessage"/>
2628
<see selector="{{AdminMessagesSection.successMessage}}" userInput="You saved the product attribute." stepKey="successMessage"/>
2729
</actionGroup>
2830
<actionGroup name="navigateToProductAttributeByCode">

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

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,11 @@
3434
<seeElement selector="{{StorefrontCategoryProductSection.productTitleByName(product.name)}}" stepKey="assertProductName"/>
3535
<see userInput="${{product.price}}.00" selector="{{StorefrontCategoryProductSection.ProductPriceByName(product.name)}}" stepKey="AssertProductPrice"/>
3636
<moveMouseOver selector="{{StorefrontCategoryProductSection.ProductInfoByName(product.name)}}" stepKey="moveMouseOverProduct" />
37-
<executeInSelenium function="function($webdriver) use ($I) {
37+
<!-- @TODO: This causes a parsing error after updating the magento-testing-framework to version 2.4.4 -->
38+
<!--<executeInSelenium function="function($webdriver) use ($I) {
3839
$productName = '//main//li[.//a[contains(text(), \'' . {{product.name}} . '\' )]]//div[@data-container=\'product-grid\']';
3940
$I->assertEquals('2', $webdriver->findElement(\Facebook\WebDriver\WebDriverBy::xpath($productName))->getCSSValue('z-index'));
40-
}" stepKey="assertProductContainerIsOpened"/>
41+
}" stepKey="assertProductContainerIsOpened"/>-->
4142
<seeElement selector="{{StorefrontCategoryProductSection.productAddToCartByName(product.name)}}" stepKey="assertAddToCart" />
4243
</actionGroup>
4344

@@ -60,6 +61,7 @@
6061
</arguments>
6162
<!-- Go to storefront category page -->
6263
<amOnPage url="{{StorefrontCategoryPage.url(category)}}?product_list_mode={{mode}}&amp;product_list_order={{sortBy}}&amp;product_list_dir={{sort}}" stepKey="onCategoryPage"/>
64+
<waitForPageLoad time="30" stepKey="waitCategoryPageLoaded"/>
6365
</actionGroup>
6466

6567
<actionGroup name="VerifyCategoryPageParameters">
@@ -69,7 +71,6 @@
6971
<argument name="numOfProductsPerPage" type="string"/>
7072
<argument name="sortBy" type="string" defaultValue="position"/>
7173
</arguments>
72-
<amOnPage url="{{StorefrontCategoryPage.url(categoryName)}}" stepKey="navigateToCategoryPage"/>
7374
<seeInTitle userInput="{{categoryName}}" stepKey="assertCategoryNameInTitle"/>
7475
<see userInput="{{categoryName}}" selector="{{StorefrontCategoryMainSection.categoryTitle}}" stepKey="assertCategoryName"/>
7576
<see userInput="{{mode}}" selector="{{StorefrontCategoryPagerSection.modeGridIsActive}}" stepKey="assertViewMode"/>
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
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+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
9+
<actionGroup name="StorefrontNavigateCategoryPageActionGroup">
10+
<annotations>
11+
<description>Navigates storefront category page by url key</description>
12+
</annotations>
13+
<arguments>
14+
<argument name="categoryUrlKey"/>
15+
</arguments>
16+
<amOnPage url="{{StorefrontCategoryPage.url(categoryUrlKey)}}" stepKey="navigateStorefrontCategoryPage"/>
17+
<waitForPageLoad time="30" stepKey="waitCategoryPageLoaded"/>
18+
</actionGroup>
19+
</actionGroups>

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

Lines changed: 7 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>
@@ -47,4 +47,10 @@
4747
<data key="name" unique="suffix">Bags</data>
4848
<data key="url_key" unique="suffix">bags</data>
4949
</entity>
50+
<entity name="SubCategoryNonAnchor" extends="SubCategoryWithParent">
51+
<requiredEntity type="custom_attribute">CustomAttributeCategoryNonAnchor</requiredEntity>
52+
</entity>
53+
<entity name="DefaultCategory" type="category">
54+
<data key="name">Default Category</data>
55+
</entity>
5056
</entities>
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
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="DefaultCategoryProductLink" type="CategoryProductLink">
12+
<var key="sku" entityKey="sku" entityType="product"/>
13+
<var key="category_id" entityKey="id" entityType="category"/>
14+
</entity>
15+
<entity name="CustomCategoryProductLink" type="CategoryProductLink">
16+
<var key="sku" entityKey="sku" entityType="product2"/>
17+
<var key="category_id" entityKey="id" entityType="category"/>
18+
</entity>
19+
</entities>

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,4 +36,8 @@
3636
<data key="attribute_code">news_from_date</data>
3737
<data key="value">2018-05-17 00:00:00</data>
3838
</entity>
39+
<entity name="CustomAttributeCategoryNonAnchor" type="custom_attribute">
40+
<data key="attribute_code">is_anchor</data>
41+
<data key="value">0</data>
42+
</entity>
3943
</entities>

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -345,4 +345,9 @@
345345
<data key="quantity">0</data>
346346
<requiredEntity type="custom_attribute_array">CustomAttributeCategoryIds</requiredEntity>
347347
</entity>
348+
<entity name="ProductFileOptionWithScriptTag" type="product">
349+
<var key="sku" entityType="product" entityKey="sku"/>
350+
<data key="file">&lt;img src=x onerror='alert("XSS without &lt;script&gt;&lt;:script&gt; tags...")'&gt;.png</data>
351+
<requiredEntity type="product_option">ProductOptionFile</requiredEntity>
352+
</entity>
348353
</entities>

0 commit comments

Comments
 (0)