Skip to content

Commit 01a441d

Browse files
authored
Merge pull request #4378 from magento-tsg/2.2-develop-pr102
[TSG] Fixes for 2.2 (pr102) (2.2-develop)
2 parents 3704e0d + d87832c commit 01a441d

File tree

39 files changed

+767
-118
lines changed

39 files changed

+767
-118
lines changed

app/code/Magento/Backend/Test/Mftf/ActionGroup/ConfigurationActionGroup.xml

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,7 @@
66
*/
77
-->
88

9-
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../dev/tests/acceptance/vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Test/etc/actionGroupSchema.xsd">
10-
<actionGroup name="NavigateToConfigurationGeneralPage">
11-
<amOnPage url="{{AdminConfigGeneralPage.url}}" stepKey="navigateToConfigGeneralPage"/>
12-
<waitForPageLoad stepKey="waitForConfigPageLoad"/>
13-
</actionGroup>
14-
9+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
1510
<actionGroup name="SelectTopDestinationsCountry">
1611
<arguments>
1712
<argument name="countries"/>

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

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,4 +120,21 @@
120120
<waitForPageLoad stepKey="waitForProductToLoad"/>
121121
<waitForElementVisible selector="{{AdminHeaderSection.pageTitle}}" stepKey="waitForProductTitle"/>
122122
</actionGroup>
123+
124+
<actionGroup name="DeleteAllProducts">
125+
<conditionalClick selector="{{AdminProductGridSection.multicheckDropdown}}" dependentSelector="{{AdminDataGridTableSection.firstRow}}" visible="true" stepKey="openMulticheckDropdown"/>
126+
<conditionalClick selector="{{AdminProductGridSection.multicheckOption('Select All')}}" dependentSelector="{{AdminDataGridTableSection.firstRow}}" visible="true" stepKey="selectAllProductInFilteredGrid"/>
127+
<click selector="{{AdminProductGridSection.bulkActionDropdown}}" stepKey="clickActionDropdown"/>
128+
<click selector="{{AdminProductGridSection.bulkActionOption('Delete')}}" stepKey="clickDeleteAction"/>
129+
<waitForElementVisible selector="{{AdminConfirmationModalSection.ok}}" stepKey="waitForModalPopUp"/>
130+
<grabTextFrom selector="{{AdminConfirmationModalSection.message}}" stepKey="grabConfirmationMessage"/>
131+
<click selector="{{AdminConfirmationModalSection.ok}}" stepKey="confirmProductDelete"/>
132+
<executeInSelenium function="function () use ($I, $grabConfirmationMessage) {
133+
if ($grabConfirmationMessage !== 'You haven\'t selected any items!') {
134+
$I->waitForElementVisible('#messages div.message-success');
135+
$I->see('record(s) have been deleted.', '#messages div.message-success');
136+
}
137+
}" stepKey="waitSuccessMessage"/>
138+
</actionGroup>
139+
123140
</actionGroups>

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

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,15 @@
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-
<seeElement selector="{{StorefrontCategoryProductSection.productAddToCartByName(product.name)}}" stepKey="AssertAddToCart" />
37+
<executeInSelenium function="function($webdriver) use ($I) {
38+
$productName = '//main//li[.//a[contains(text(), \'' . {{product.name}} . '\' )]]//div[@data-container=\'product-grid\']';
39+
$I->assertEquals('2', $webdriver->findElement(\Facebook\WebDriver\WebDriverBy::xpath($productName))->getCSSValue('z-index'));
40+
}" stepKey="assertProductContainerIsOpened"/>
41+
<seeElement selector="{{StorefrontCategoryProductSection.productAddToCartByName(product.name)}}" stepKey="assertAddToCart" />
42+
</actionGroup>
43+
44+
<actionGroup name="StorefrontCheckAddToCartButtonAbsence" extends="StorefrontCheckCategorySimpleProduct">
45+
<dontSeeElement selector="{{StorefrontCategoryProductSection.productAddToCartByName(product.name)}}" stepKey="assertAddToCart"/>
3846
</actionGroup>
3947

4048
<actionGroup name="StorefrontSwitchCategoryViewToListMode">
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="ProductGridPagerData">
12+
<data key="pageSize">1</data>
13+
</entity>
14+
</entities>

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
<element name="productPriceOld" type="text" selector="//span[@data-price-type='oldPrice']//span[@class='price'][contains(., '{{var1}}')]" parameterized="true"/>
2525
<element name="productPriceLabel" type="text" selector="//span[@class='price-label'][contains(text(),'{{var1}}')]" parameterized="true"/>
2626
<element name="productPriceLinkAfterLabel" type="text" selector="//span[@class='price-label'][contains(text(),'{{var1}}')]/following::span[contains(text(), '{{var2}}')]" parameterized="true"/>
27+
<element name="productNameInGrid" type="text" selector="//div[contains(@class,'products-grid')]//strong[contains(@class,'product-item-name')]//a[normalize-space(text())='{{productName}}']" parameterized="true"/>
2728
<element name="productStockUnavailableByName" type="text" selector="//a[contains(@class, 'product-item-link') and normalize-space(text())='{{productName}}']/ancestor::div[contains(@class, 'product-item-details')]//span[contains(text(),'Out of stock')]" parameterized="true"/>
2829
</section>
2930
</sections>
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
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="AdminGridPageNumberAfterSaveAndCloseActionTest">
12+
<annotations>
13+
<features value="Catalog"/>
14+
<title value="Checking Catalog grid page number after Save and Close action"/>
15+
<description value="Checking Catalog grid page number after Save and Close action"/>
16+
<stories value="Verify Catalog Grid"/>
17+
<severity value="MAJOR"/>
18+
<testCaseId value="MC-17278"/>
19+
<useCaseId value="MAGETWO-93755"/>
20+
<group value="catalog"/>
21+
</annotations>
22+
<before>
23+
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/>
24+
<!--Clear product grid-->
25+
<comment userInput="Clear product grid" stepKey="commentClearProductsGrid"/>
26+
<amOnPage url="{{AdminCatalogProductPage.url}}" stepKey="goToProductsGridPage"/>
27+
<actionGroup ref="clearFiltersAdminDataGrid" stepKey="clearProductsFilters"/>
28+
<actionGroup ref="DeleteAllProducts" stepKey="deleteProductsIfTheyExist"/>
29+
<!--Create products-->
30+
<createData entity="SimpleProduct3" stepKey="createProduct1"/>
31+
<createData entity="SimpleProduct3" stepKey="createProduct2"/>
32+
<!--Update product count per page-->
33+
<actionGroup ref="AdminDataGridSelectCustomPageSize" stepKey="selectCustomPageSize">
34+
<argument name="pageSize" value="{{ProductGridPagerData.pageSize}}"/>
35+
</actionGroup>
36+
</before>
37+
<after>
38+
<!--Delete created data-->
39+
<deleteData stepKey="deleteProduct1" createDataKey="createProduct1"/>
40+
<deleteData stepKey="deleteProduct2" createDataKey="createProduct2"/>
41+
<!--Revert products count per page -->
42+
<conditionalClick selector="{{AdminDataGridPaginationSection.previousPage}}" dependentSelector="{{AdminDataGridPaginationSection.previousPage}}" visible="true" stepKey="clickPrevPageOrderGrid"/>
43+
<amOnPage url="{{AdminCatalogProductPage.url}}" stepKey="goToProductsGridPage"/>
44+
<actionGroup ref="AdminDataGridDeleteCustomPageSize" stepKey="deleteCustomAddedPageSize">
45+
<argument name="pageSize" value="{{ProductGridPagerData.pageSize}}"/>
46+
</actionGroup>
47+
<actionGroup ref="logout" stepKey="logout"/>
48+
</after>
49+
50+
<amOnPage url="{{AdminCatalogProductPage.url}}" stepKey="goToProductsGridPage"/>
51+
<!--Go to the next page and edit the product-->
52+
<comment userInput="Go to the next page and edit the product" stepKey="commentEdiProduct"/>
53+
<click selector="{{AdminDataGridPaginationSection.nextPage}}" stepKey="clickNextPageOrderGrid"/>
54+
<waitForElementVisible selector="{{AdminDataGridPaginationSection.currentPage}}" stepKey="waitCurrentPageNumberAppeares"/>
55+
<seeInField selector="{{AdminDataGridPaginationSection.currentPage}}" userInput="2" stepKey="seeOnSecondPageOrderGrid"/>
56+
<actionGroup ref="OpenEditProductOnBackendActionGroup" stepKey="openEditProduct2">
57+
<argument name="product" value="$$createProduct2$$"/>
58+
</actionGroup>
59+
<actionGroup ref="AdminFormSaveAndClose" stepKey="saveAndCloseProduct"/>
60+
<waitForElementVisible selector="{{AdminDataGridPaginationSection.currentPage}}" stepKey="waitCurrentPageNumberAppearesAfterProductEdit"/>
61+
<seeInField selector="{{AdminDataGridPaginationSection.currentPage}}" userInput="2" stepKey="seeOnSecondPageOrderGridAfterProductSaved"/>
62+
</test>
63+
</tests>

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,9 +80,7 @@
8080
<waitForPageLoad stepKey="waitForSavingChanges"/>
8181

8282
<!-- Enable `Use Categories Path for Product URLs` on Stores -> Configuration -> Catalog -> Catalog -> Search Engine Optimization -->
83-
<amOnPage url="{{AdminCatalogSearchConfigurationPage.url}}" stepKey="onConfigPage"/>
84-
<waitForPageLoad stepKey="waitForLoading"/>
85-
<conditionalClick selector="{{AdminCatalogSearchEngineConfigurationSection.searchEngineOptimization}}" dependentSelector="{{AdminCatalogSearchEngineConfigurationSection.openedEngineOptimization}}" visible="false" stepKey="clickEngineOptimization"/>
83+
<amOnPage url="{{AdminCatalogSearchConfigurationPage.url('#catalog_seo-link')}}" stepKey="onConfigPage"/>
8684
<uncheckOption selector="{{AdminCatalogSearchEngineConfigurationSection.systemValueUseCategoriesPath}}" stepKey="uncheckDefault"/>
8785
<selectOption userInput="Yes" selector="{{AdminCatalogSearchEngineConfigurationSection.selectUseCategoriesPatForProductUrls}}" stepKey="selectYes"/>
8886
<click selector="{{AdminConfigSection.saveButton}}" stepKey="saveConfig"/>
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+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="AdminAssertQueryLengthHintsActionGroup">
12+
<amOnPage url="{{AdminCatalogSearchConfigurationPage.url('#catalog_search-link')}}" stepKey="navigateToConfigurationPage"/>
13+
<see userInput="{{MinMaxQueryLength.hint}}" selector="{{AdminCatalogSearchConfigurationSection.minQueryLengthHint}}" stepKey="seeMinQueryLengthHint"/>
14+
<see userInput="{{MinMaxQueryLength.hint}}" selector="{{AdminCatalogSearchConfigurationSection.maxQueryLengthHint}}" stepKey="seeMaxQueryLengthHint"/>
15+
</actionGroup>
16+
</actionGroups>
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
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="StorefrontSearchProductActionGroup" extends="StorefrontQuickSearchActionGroup">
12+
<arguments>
13+
<argument name="product"/>
14+
</arguments>
15+
<waitForElementVisible selector="{{StorefrontCategoryProductSection.productNameInGrid(product.name)}}" after="clickSearchButton" stepKey="waitForProductNameElement"/>
16+
<seeElement selector="{{StorefrontCategoryProductSection.productNameInGrid(product.name)}}" stepKey="seeProductNameInCatalogSearchPage"/>
17+
</actionGroup>
18+
</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="MinMaxQueryLength" type="constant">
12+
<data key="hint">This value must be compatible with the corresponding setting in the configured search engine</data>
13+
</entity>
14+
</entities>
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
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="SetMinQueryLengthToDefault" type="catalog_search_config">
12+
<requiredEntity type="length_config">CheckUseSystemValueCheckbox</requiredEntity>
13+
</entity>
14+
<entity name="SetMinQueryLengthToOne" type="catalog_search_config">
15+
<requiredEntity type="length_config">MinQueryLengthValue1</requiredEntity>
16+
</entity>
17+
<entity name="SetMinQueryLengthToTwo" type="catalog_search_config">
18+
<requiredEntity type="length_config">MinQueryLengthValue2</requiredEntity>
19+
</entity>
20+
21+
<entity name="MinQueryLengthValue1" type="length_config">
22+
<data key="value">1</data>
23+
<requiredEntity type="length_config_inherit">UncheckUseSystemValueCheckbox</requiredEntity>
24+
</entity>
25+
<entity name="MinQueryLengthValue2" type="length_config">
26+
<data key="value">2</data>
27+
<requiredEntity type="length_config_inherit">UncheckUseSystemValueCheckbox</requiredEntity>
28+
</entity>
29+
30+
<entity name="UncheckUseSystemValueCheckbox" type="length_config_inherit">
31+
<data key="value">false</data>
32+
</entity>
33+
<entity name="CheckUseSystemValueCheckbox" type="length_config_inherit">
34+
<data key="inherit">true</data>
35+
</entity>
36+
</entities>
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+
<operations xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
9+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:DataGenerator/etc/dataOperation.xsd">
10+
<operation name="CatalogSearchConfig" dataType="catalog_search_config" type="create" auth="adminFormKey" url="/admin/system_config/save/section/catalog/" method="POST" successRegex="/messages-message-success/">
11+
<object key="groups" dataType="catalog_search_config">
12+
<object key="search" dataType="catalog_search_config">
13+
<object key="fields" dataType="catalog_search_config">
14+
<object key="min_query_length" dataType="length_config">
15+
<object key="inherit" dataType="length_config_inherit">
16+
<field key="value">boolean</field>
17+
</object>
18+
<field key="value">integer</field>
19+
</object>
20+
</object>
21+
</object>
22+
</object>
23+
</operation>
24+
</operations>
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
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+
<pages xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/PageObject.xsd">
9+
<page name="AdminCatalogSearchConfigurationPage" url="admin/system_config/edit/section/catalog/{{tab_anchor}}" area="admin" module="Magento_CatalogSearch" parameterized="true">
10+
<section name="AdminCatalogSearchConfigurationSection"/>
11+
</page>
12+
</pages>
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+
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
11+
<section name="AdminCatalogSearchConfigurationSection">
12+
<element name="minQueryLength" type="input" selector="#catalog_search_min_query_length"/>
13+
<element name="minQueryLengthInherit" type="checkbox" selector="#catalog_search_min_query_length_inherit"/>
14+
<element name="minQueryLengthHint" type="text" selector="#row_catalog_search_min_query_length .value span"/>
15+
<element name="maxQueryLengthHint" type="text" selector="#row_catalog_search_max_query_length .value span"/>
16+
</section>
17+
</sections>
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
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="StorefrontMinimalQueryLengthForCatalogSearchTest">
12+
<annotations>
13+
<features value="CatalogSearch"/>
14+
<title value="Minimal query length for catalog search"/>
15+
<description value="Minimal query length for catalog search"/>
16+
<stories value="Catalog search"/>
17+
<severity value="AVERAGE"/>
18+
<testCaseId value="MC-15905"/>
19+
<useCaseId value="MAGETWO-73989"/>
20+
<group value="catalogSearch"/>
21+
</annotations>
22+
<before>
23+
<createData entity="_defaultCategory" stepKey="createCategory"/>
24+
<createData entity="ApiSimpleProduct" stepKey="createProduct">
25+
<requiredEntity createDataKey="createCategory"/>
26+
</createData>
27+
<createData entity="SetMinQueryLengthToOne" stepKey="setMinQueryLengthToOne"/>
28+
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/>
29+
</before>
30+
<after>
31+
<deleteData createDataKey="createCategory" stepKey="deleteCategory"/>
32+
<deleteData createDataKey="createProduct" stepKey="deleteProduct"/>
33+
<createData entity="SetMinQueryLengthToDefault" stepKey="setMinimumQueryLengthToDefault"/>
34+
<actionGroup ref="logout" stepKey="logout"/>
35+
</after>
36+
<actionGroup ref="AdminAssertQueryLengthHintsActionGroup" stepKey="assertQueryLengthHints"/>
37+
<actionGroup ref="StorefrontSearchProductActionGroup" stepKey="searchForProducts">
38+
<argument name="product" value="$$createProduct$$"/>
39+
<argument name="searchPhrase" value="s"/>
40+
</actionGroup>
41+
<createData entity="SetMinQueryLengthToTwo" stepKey="setMinQueryLengthToTwo"/>
42+
<actionGroup ref="StorefrontSearchProductActionGroup" stepKey="searchForProductsAgain">
43+
<argument name="product" value="$$createProduct$$"/>
44+
<argument name="searchPhrase" value="si"/>
45+
</actionGroup>
46+
</test>
47+
</tests>

0 commit comments

Comments
 (0)