Skip to content

Commit c8c2791

Browse files
author
Alexander Akimov
authored
Merge pull request #2907 from magento-tsg/2.2-develop-pr36
[TSG] Backporting for 2.2 (pr36) (2.2.6)
2 parents 39e7c72 + ecfe462 commit c8c2791

File tree

81 files changed

+1390
-223
lines changed

Some content is hidden

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

81 files changed

+1390
-223
lines changed

app/code/Magento/Bundle/Test/Mftf/ActionGroup/BundleProductsOnAdminActionGroup.xml

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111
<actionGroup name="CreateBundleProductForTwoSimpleProducts">
1212
<arguments>
1313
<argument name="bundleProduct"/>
14+
<argument name="simpleProductFirst"/>
15+
<argument name="simpleProductSecond"/>
1416
</arguments>
1517
<fillField userInput="{{bundleProduct.sku}}" selector="{{AdminProductFormSection.productSku}}" stepKey="fillProductSku"/>
1618
<fillField userInput="{{bundleProduct.name}}" selector="{{AdminProductFormSection.productName}}" stepKey="fillProductName"/>
@@ -19,7 +21,22 @@
1921
<click selector="{{AdminProductFormBundleSection.AddOption}}" stepKey="clickAddOptionButton"/>
2022
<fillField userInput="{{bundleProduct.option_title}}" selector="{{AdminProductFormBundleSection.OptionTitle}}" stepKey="fillOptionTitle"/>
2123
<click selector="{{AdminProductFormBundleSection.AddProductsToOption}}" stepKey="clickAddProductsToOption"/>
22-
<click selector="{{AdminProductFormBundleSection.selectAll}}" stepKey="tickSelectAllCheckbox"/>
24+
25+
<!-- Select First Simple -->
26+
<click selector="{{AdminProductGridFilterSection.filters}}" stepKey="clickOnFiltersButton"/>
27+
<conditionalClick selector="{{AdminProductGridFilterSection.clearAll}}" dependentSelector="{{AdminProductGridFilterSection.clearAll}}" visible="true" stepKey="clearFilters"/>
28+
<fillField selector="{{AdminProductGridFilterSection.name}}" userInput="{{simpleProductFirst.name}}" stepKey="fillNameFilter"/>
29+
<click selector="{{AdminProductGridFilterSection.applyFilters}}" stepKey="applyFilters"/>
30+
<click selector="{{AdminProductFormBundleSection.firstRowCheckbox}}" stepKey="selectFirstSimple"/>
31+
32+
<!-- Select Second Simple -->
33+
<click selector="{{AdminProductGridFilterSection.filters}}" stepKey="clickOnFiltersButton2"/>
34+
<conditionalClick selector="{{AdminProductGridFilterSection.clearAll}}" dependentSelector="{{AdminProductGridFilterSection.clearAll}}" visible="true" stepKey="clearFilters2"/>
35+
<fillField selector="{{AdminProductGridFilterSection.name}}" userInput="{{simpleProductSecond.name}}" stepKey="fillNameFilter2"/>
36+
<click selector="{{AdminProductGridFilterSection.applyFilters}}" stepKey="applyFilters2"/>
37+
<click selector="{{AdminProductFormBundleSection.firstRowCheckbox}}" stepKey="selectSecondSimple"/>
38+
39+
<!-- Add Selected Simples To Bundle -->
2340
<click selector="{{AdminProductFormBundleSection.AddSelectedProducts}}" stepKey="clickAddSelectedProductsButton"/>
2441
<fillField userInput="{{bundleProduct.default_quantity1}}" selector="{{AdminProductFormBundleSection.DefaultQuantity1}}" stepKey="fillDefaultQuantityForFirstProduct"/>
2542
<fillField userInput="{{bundleProduct.default_quantity2}}" selector="{{AdminProductFormBundleSection.DefaultQuantity2}}" stepKey="fillDefaultQuantityForSecondProduct"/>

app/code/Magento/Bundle/Test/Mftf/Section/AdminProductFormSection.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,6 @@
2020
<!--Add Products to Option-->
2121
<element name="selectAll" type="input" selector="//label[@data-bind='attr: {for: ko.uid}']"/>
2222
<element name="AddSelectedProducts" type="button" selector="//span[contains(text(),'Add Selected Products')]/ancestor::button" timeout="30"/>
23+
<element name="firstRowCheckbox" type="checkbox" selector="tr.data-row:nth-of-type(1) input.admin__control-checkbox[data-action='select-row']"/>
2324
</section>
2425
</sections>

app/code/Magento/Bundle/Test/Mftf/Test/AdminCreateBundleProductTest.xml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@
2121
<before>
2222
<createData entity="_defaultCategory" stepKey="createPreReqCategory"/>
2323
<createData entity="SimpleProduct" stepKey="createPreReqSimpleProduct1">
24-
<requiredEntity createDataKey="createPreReqCategory"/>
24+
<requiredEntity createDataKey="createPreReqCategory"/>
2525
</createData>
2626
<createData entity="SimpleProduct2" stepKey="createPreReqSimpleProduct2">
27-
<requiredEntity createDataKey="createPreReqCategory"/>
27+
<requiredEntity createDataKey="createPreReqCategory"/>
2828
</createData>
2929
</before>
3030
<after>
@@ -45,6 +45,8 @@
4545
<!--Step4. Fill in all data according to data set-->
4646
<actionGroup ref="CreateBundleProductForTwoSimpleProducts" stepKey="CreateBundleProductForTwoSimpleProducts">
4747
<argument name="bundleProduct" value="BundleProduct"/>
48+
<argument name="simpleProductFirst" value="$$createPreReqSimpleProduct1$$"/>
49+
<argument name="simpleProductSecond" value="$$createPreReqSimpleProduct2$$"/>
4850
</actionGroup>
4951

5052
<!--Step5. Save product-->

app/code/Magento/Bundle/Test/Mftf/Test/StorefrontEditBundleProductTest.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@
2020
</annotations>
2121
<before>
2222
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/>
23+
<createData entity="DefaultTaxConfig" stepKey="defaultTaxConfiguration"/>
24+
<createData entity="WeeeConfigDisable" stepKey="disableFPT"/>
2325
<createData entity="SimpleProduct3" stepKey="simpleProduct1"/>
2426
<createData entity="SimpleProduct3" stepKey="simpleProduct2"/>
2527
</before>
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
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="../../../../../../../dev/tests/acceptance/vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Test/etc/actionGroupSchema.xsd">
11+
<!--Actions to delete category-->
12+
<actionGroup name="DeleteProductAttribute">
13+
<arguments>
14+
<argument name="productAttribute"/>
15+
</arguments>
16+
<amOnPage url="{{AdminProductAttributeGridPage.url}}" stepKey="goToProductAttributesGridPage"/>
17+
<waitForPageLoad time="30" stepKey="waitForProductAttributesGridPageLoad"/>
18+
<click selector="{{AdminProductAttributeGridSection.resetFilter}}" stepKey="resetFilter"/>
19+
<fillField selector="{{AdminProductAttributeGridSection.gridFilterFrontEndLabel}}"
20+
userInput="{{productAttribute.default_label}}" stepKey="fillAttributeDefaultLabelInput"/>
21+
<click selector="{{AdminProductAttributeGridSection.search}}" stepKey="searchForAttribute"/>
22+
<click selector="{{AdminProductAttributeGridSection.firstRow}}" stepKey="clickFirstRow"/>
23+
<waitForPageLoad time="30" stepKey="waitForPageLoad"/>
24+
<click selector="{{AdminProductAttributeEditSection.deleteAttribute}}" stepKey="deleteProductAttribute"/>
25+
<waitForElementVisible selector="{{AdminConfirmationModalSection.message}}" stepKey="waitingForWarningModal"/>
26+
<click selector="{{AdminConfirmationModalSection.ok}}" stepKey="confirmStoreDelete"/>
27+
</actionGroup>
28+
</actionGroups>

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

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,29 @@
1919
</arguments>
2020
<amOnPage url="{{AdminProductIndexPage.url}}" stepKey="openProductsGridPage"/>
2121
<waitForPageLoad stepKey="waitForPageLoad"/>
22+
<conditionalClick selector="{{AdminProductGridFilterSection.clearAll}}" dependentSelector="{{AdminProductGridFilterSection.clearAll}}" visible="true" stepKey="clearFilters"/>
2223
<click selector="{{AdminProductGridSection.checkbox(product.name)}}" stepKey="tickCheckbox"/>
2324
<click selector="{{AdminProductGridActionSection.actionsSelectBox}}" stepKey="openActionsSelectBox"/>
2425
<click selector="{{AdminProductGridActionSection.deleteOptionInActionsSelectBox}}" stepKey="clickDeleteAction"/>
2526
<waitForElementVisible selector="{{AdminProductGridConfirmActionSection.title}}" stepKey="waitForConfirmModal"/>
2627
<click selector="{{AdminProductGridConfirmActionSection.ok}}" stepKey="clickOkInConfirmation"/>
2728
</actionGroup>
29+
30+
<actionGroup name="DeleteAllProductsOnProductsGridPageFilteredByName">
31+
<arguments>
32+
<argument name="product"/>
33+
</arguments>
34+
<amOnPage url="{{AdminProductIndexPage.url}}" stepKey="openProductsGridPage"/>
35+
<waitForPageLoad stepKey="waitForPageLoad"/>
36+
<click selector="{{AdminProductGridFilterSection.filters}}" stepKey="clickOnFiltersButton"/>
37+
<conditionalClick selector="{{AdminProductGridFilterSection.clearAll}}" dependentSelector="{{AdminProductGridFilterSection.clearAll}}" visible="true" stepKey="clearFilters"/>
38+
<fillField selector="{{AdminProductGridFilterSection.name}}" userInput="{{product.name}}" stepKey="fillNameFieldInFilter"/>
39+
<click selector="{{AdminProductGridFilterSection.applyFilters}}" stepKey="applyFilters"/>
40+
<click selector="{{AdminProductGridSection.multicheckDropdown}}" stepKey="clickMulticheckDropDown"/>
41+
<click selector="{{AdminProductGridSection.multicheckOption('Select All')}}" stepKey="selectAllFilteredProducts"/>
42+
<click selector="{{AdminProductGridActionSection.actionsSelectBox}}" stepKey="openActionsSelectBox"/>
43+
<click selector="{{AdminProductGridActionSection.deleteOptionInActionsSelectBox}}" stepKey="clickDeleteAction"/>
44+
<waitForElementVisible selector="{{AdminProductGridConfirmActionSection.title}}" stepKey="waitForConfirmModal"/>
45+
<click selector="{{AdminProductGridConfirmActionSection.ok}}" stepKey="clickOkInConfirmation"/>
46+
</actionGroup>
2847
</actionGroups>
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
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="../../../../../../../dev/tests/acceptance/vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Page/etc/PageObject.xsd">
11+
<page name="AdminCategoryProductAttributeEditPage" url="catalog/product_attribute/edit/" area="admin" module="Magento_Catalog">
12+
<section name="AdminProductAttributeEditSection"/>
13+
<section name="AdminConfirmationModalSection"/>
14+
</page>
15+
</pages>
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+
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="../../../../../../../dev/tests/acceptance/vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Page/etc/SectionObject.xsd">
11+
<section name="AdminProductAttributeEditSection">
12+
<element name="deleteAttribute" type="button" selector="#delete" timeout="30"/>
13+
</section>
14+
</sections>

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
<section name="ProductInWebsitesSection">
3838
<element name="sectionHeader" type="button" selector="div[data-index='websites']" timeout="30"/>
3939
<element name="website" type="checkbox" selector="//label[contains(text(), '{{var1}}')]/parent::div//input[@type='checkbox']" parameterized="true"/>
40+
<element name="isWebsiteDisabled" type="checkbox" selector="//label[contains(text(), '{{websiteName}}')]/parent::div//input[@type='checkbox' and @disabled]" parameterized="true"/>
4041
</section>
4142
<section name="ProductWYSIWYGSection">
4243
<element name="Switcher" type="button" selector="//select[@id='dropdown-switcher']"/>

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
<element name="applyFilters" type="button" selector="button[data-action='grid-filter-apply']" timeout="30"/>
1818
<element name="newFromDateFilter" type="input" selector="input.admin__control-text[name='news_from_date[from]']"/>
1919
<element name="skuFilter" type="input" selector="input.admin__control-text[name='sku']"/>
20+
<element name="name" type="input" selector="input.admin__control-text[name='name']"/>
2021
<element name="viewBookmark" type="button" selector="//div[contains(@class, 'admin__data-grid-action-bookmarks')]/ul/li/div/a[text() = '{{label}}']" parameterized="true" timeout="30"/>
2122
<element name="viewDropdown" type="button" selector=".admin__data-grid-action-bookmarks button.admin__action-dropdown"/>
2223
</section>

0 commit comments

Comments
 (0)