Skip to content

Commit a8900bd

Browse files
committed
Merge remote-tracking branch 'origin/MAGETWO-86938' into PANDA-FIXES-2.2
2 parents 243521c + 39170d4 commit a8900bd

17 files changed

+254
-4
lines changed

app/code/Magento/Wishlist/Controller/Index/Add.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,8 +114,9 @@ public function execute()
114114
if (is_string($result)) {
115115
throw new \Magento\Framework\Exception\LocalizedException(__($result));
116116
}
117-
$wishlist->save();
118-
117+
if ($wishlist->isObjectNew()) {
118+
$wishlist->save();
119+
}
119120
$this->_eventManager->dispatch(
120121
'wishlist_add_product',
121122
['wishlist' => $wishlist, 'product' => $product, 'item' => $result]
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+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="OpenEditProductOnBackendActionGroup">
12+
<arguments>
13+
<argument name="product" defaultValue="product"/>
14+
</arguments>
15+
<click stepKey="clickOnProductRow" selector="{{AdminProductGridSection.firstRow}}"/>
16+
<waitForPageLoad time="30" stepKey="waitForProductPageLoad"/>
17+
<seeInField stepKey="seeProductSkuOnEditProductPage" selector="{{AdminProductFormSection.productSku}}" userInput="{{product.sku}}" />
18+
</actionGroup>
19+
</actionGroups>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
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="../../../../../../vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="SearchForProductOnBackendActionGroup">
12+
<arguments>
13+
<argument name="product" defaultValue="product"/>
14+
</arguments>
15+
<amOnPage url="{{AdminProductIndexPage.url}}" stepKey="navigateToProductIndex"/>
16+
<waitForPageLoad time="30" stepKey="waitForProductsPageToLoad"/>
17+
<click stepKey="openFiltersSectionOnProductsPage" selector="{{AdminProductFiltersSection.FiltersButton}}"/>
18+
<conditionalClick selector="{{AdminProductFiltersSection.clearFiltersButton}}" dependentSelector="{{AdminProductFiltersSection.clearFiltersButton}}" visible="true" stepKey="cleanFiltersIfTheySet"/>
19+
<fillField stepKey="fillSkuFieldOnFiltersSection" userInput="{{product.sku}}" selector="{{AdminProductFiltersSection.SkuInput}}"/>
20+
<click stepKey="clickApplyFiltersButton" selector="{{AdminProductFiltersSection.Apply}}"/>
21+
</actionGroup>
22+
</actionGroups>

dev/tests/acceptance/tests/functional/Magento/FunctionalTest/Catalog/Page/AdminProductIndexPage.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,6 @@
1212
<section name="AdminProductGridActionSection" />
1313
<section name="AdminProductGridSection" />
1414
<section name="AdminMessagesSection" />
15+
<section name="AdminProductFiltersSection" />
1516
</page>
1617
</pages>
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+
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Page/etc/SectionObject.xsd">
11+
<section name="AdminProductFiltersSection">
12+
<element name="FiltersButton" type="button" selector="#container > div > div.admin__data-grid-header > div:nth-child(1) > div.data-grid-filters-actions-wrap > div > button"/>
13+
<element name="clearFiltersButton" type="button" selector="//div[@class='admin__data-grid-header']//button[@class='action-tertiary action-clear']" timeout="10"/>
14+
<element name="NameInput" type="input" selector="input[name=name]"/>
15+
<element name="SkuInput" type="input" selector="input[name=sku]"/>
16+
<element name="Apply" type="button" selector="button[data-action=grid-filter-apply]" timeout="30"/>
17+
</section>
18+
</sections>

dev/tests/acceptance/tests/functional/Magento/FunctionalTest/Catalog/Section/AdminProductFormActionSection.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,6 @@
1010
xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Page/etc/SectionObject.xsd">
1111
<section name="AdminProductFormActionSection">
1212
<element name="saveButton" type="button" selector="#save-button" timeout="30"/>
13+
<element name="changeStoreButton" type="button" selector="#store-change-button"/>
1314
</section>
1415
</sections>
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+
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Page/etc/SectionObject.xsd">
11+
<section name="AdminProductFormChangeStoreSection">
12+
<element name="storeSelector" type="button" selector="//a[contains(text(),'{{var1}}')]" parameterized="true"/>
13+
<element name="acceptButton" type="button" selector="button[class='action-primary action-accept']" timeout="30"/>
14+
</section>
15+
</sections>

dev/tests/acceptance/tests/functional/Magento/FunctionalTest/Catalog/Section/AdminProductFormSection.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
<element name="categoriesDropdown" type="multiselect" selector="div[data-index='category_ids']"/>
1616
<element name="productQuantity" type="input" selector=".admin__field[data-index=qty] input"/>
1717
<element name="contentTab" type="button" selector="//strong[@class='admin__collapsible-title']/span[text()='Content']"/>
18+
<element name="visibility" type="select" selector="//select[@name='product[visibility]']"/>
19+
<element name="visibilityUseDefault" type="checkbox" selector="//input[@name='use_default[visibility]']"/>
1820
</section>
1921
<section name="ProductWYSIWYGSection">
2022
<element name="Switcher" type="button" selector="//select[@id='dropdown-switcher']"/>

dev/tests/acceptance/tests/functional/Magento/FunctionalTest/Catalog/Section/AdminProductGridSection.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,6 @@
1111
<section name="AdminProductGridSection">
1212
<element name="productGridElement1" type="input" selector="#addselector" />
1313
<element name="productGridElement2" type="text" selector="#addselector" />
14+
<element name="firstRow" type="button" selector="tr.data-row:nth-of-type(1)"/>
1415
</section>
1516
</sections>
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+
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Page/etc/SectionObject.xsd">
11+
<section name="StorefrontFooterSection">
12+
<element name="SwitchStoreButton" type="button" selector="#switcher-store-trigger"/>
13+
<element name="StoreLink" type="button" selector="//ul[@class='dropdown switcher-dropdown']//a[contains(text(),'{{var1}}')]" parameterized="true" timeout="30"/>
14+
</section>
15+
</sections>

0 commit comments

Comments
 (0)