Skip to content

Commit 3ed7b39

Browse files
authored
Merge pull request #4043 from magento-tsg/2.3-qwerty-pr47
[TSG] Upporting for 2.3 (pr47) (2.3-qwerty)
2 parents e5b64f9 + 3e16b6f commit 3ed7b39

File tree

23 files changed

+451
-63
lines changed

23 files changed

+451
-63
lines changed

app/code/Magento/Catalog/Controller/Product/Compare/Add.php

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,13 @@
99
use Magento\Framework\App\Action\HttpPostActionInterface as HttpPostActionInterface;
1010
use Magento\Framework\Exception\NoSuchEntityException;
1111

12+
/**
13+
* Add item to compare list action.
14+
*/
1215
class Add extends \Magento\Catalog\Controller\Product\Compare implements HttpPostActionInterface
1316
{
1417
/**
15-
* Add item to compare list
18+
* Add item to compare list.
1619
*
1720
* @return \Magento\Framework\Controller\ResultInterface
1821
*/
@@ -27,12 +30,13 @@ public function execute()
2730
if ($productId && ($this->_customerVisitor->getId() || $this->_customerSession->isLoggedIn())) {
2831
$storeId = $this->_storeManager->getStore()->getId();
2932
try {
33+
/** @var \Magento\Catalog\Model\Product $product */
3034
$product = $this->productRepository->getById($productId, false, $storeId);
3135
} catch (NoSuchEntityException $e) {
3236
$product = null;
3337
}
3438

35-
if ($product) {
39+
if ($product && $product->isSalable()) {
3640
$this->_catalogProductCompareList->addProduct($product);
3741
$productName = $this->_objectManager->get(
3842
\Magento\Framework\Escaper::class
@@ -41,7 +45,7 @@ public function execute()
4145
'addCompareSuccessMessage',
4246
[
4347
'product_name' => $productName,
44-
'compare_list_url' => $this->_url->getUrl('catalog/product_compare')
48+
'compare_list_url' => $this->_url->getUrl('catalog/product_compare'),
4549
]
4650
);
4751

@@ -50,6 +54,7 @@ public function execute()
5054

5155
$this->_objectManager->get(\Magento\Catalog\Helper\Product\Compare::class)->calculate();
5256
}
57+
5358
return $resultRedirect->setRefererOrBaseUrl();
5459
}
5560
}

app/code/Magento/Catalog/Controller/Product/Compare/Remove.php

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,13 @@
99
use Magento\Framework\App\Action\HttpPostActionInterface as HttpPostActionInterface;
1010
use Magento\Framework\Exception\NoSuchEntityException;
1111

12+
/**
13+
* Remove item from compare list action.
14+
*/
1215
class Remove extends \Magento\Catalog\Controller\Product\Compare implements HttpPostActionInterface
1316
{
1417
/**
15-
* Remove item from compare list
18+
* Remove item from compare list.
1619
*
1720
* @return \Magento\Framework\Controller\ResultInterface
1821
*/
@@ -22,12 +25,13 @@ public function execute()
2225
if ($productId) {
2326
$storeId = $this->_storeManager->getStore()->getId();
2427
try {
28+
/** @var \Magento\Catalog\Model\Product $product */
2529
$product = $this->productRepository->getById($productId, false, $storeId);
2630
} catch (NoSuchEntityException $e) {
2731
$product = null;
2832
}
2933

30-
if ($product) {
34+
if ($product && $product->isSalable()) {
3135
/** @var $item \Magento\Catalog\Model\Product\Compare\Item */
3236
$item = $this->_compareItemFactory->create();
3337
if ($this->_customerSession->isLoggedIn()) {
@@ -59,6 +63,7 @@ public function execute()
5963

6064
if (!$this->getRequest()->getParam('isAjax', false)) {
6165
$resultRedirect = $this->resultRedirectFactory->create();
66+
6267
return $resultRedirect->setRefererOrBaseUrl();
6368
}
6469
}

app/code/Magento/CatalogImportExport/Test/Mftf/ActionGroup/AdminExportActionGroup.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,12 +54,12 @@
5454
<argument name="rowIndex" type="string"/>
5555
</arguments>
5656
<reloadPage stepKey="refreshPage"/>
57-
<waitForPageLoad stepKey="waitFormReload"/>
57+
<waitForPageLoad time="30" stepKey="waitFormReload"/>
5858
<click stepKey="clickSelectBtn" selector="{{AdminExportAttributeSection.selectByIndex(rowIndex)}}"/>
5959
<click stepKey="clickOnDelete" selector="{{AdminExportAttributeSection.delete(rowIndex)}}" after="clickSelectBtn"/>
6060
<waitForElementVisible selector="{{AdminProductGridConfirmActionSection.title}}" stepKey="waitForConfirmModal"/>
6161
<click selector="{{AdminProductGridConfirmActionSection.ok}}" stepKey="confirmDelete"/>
62-
<waitForPageLoad stepKey="waitForExportDataDeleted" />
62+
<waitForElementVisible selector="{{AdminDataGridTableSection.dataGridEmpty}}" stepKey="waitDataGridEmptyMessageAppears"/>
6363
<see selector="{{AdminDataGridTableSection.dataGridEmpty}}" userInput="We couldn't find any records." stepKey="assertDataGridEmptyMessage"/>
6464
</actionGroup>
6565
</actionGroups>

app/code/Magento/CatalogImportExport/Test/Mftf/Test/AdminExportSimpleProductAndConfigurableProductsWithAssignedImagesTest.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,6 @@
115115

116116
<!-- Go to export page -->
117117
<amOnPage url="{{AdminExportIndexPage.url}}" stepKey="goToExportIndexPage"/>
118-
<waitForPageLoad stepKey="waitForExportIndexPageLoad"/>
119118

120119
<!-- Fill entity attributes data -->
121120
<actionGroup ref="exportProductsFilterByAttribute" stepKey="exportProductBySku">

app/code/Magento/Cms/etc/di.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@
4747
</item>
4848
<item name="media_allowed" xsi:type="array">
4949
<item name="flv" xsi:type="string">video/x-flv</item>
50-
<item name="swf" xsi:type="string">application/x-shockwave-flash</item>
5150
<item name="avi" xsi:type="string">video/x-msvideo</item>
5251
<item name="mov" xsi:type="string">video/x-sgi-movie</item>
5352
<item name="rm" xsi:type="string">application/vnd.rn-realmedia</item>
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+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
9+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
10+
<actionGroup name="SwitchToPreviewIframeActionGroup">
11+
<executeJS function="document.getElementById('preview_iframe').sandbox.add('allow-scripts')" stepKey="addSandboxValue"/>
12+
<wait time="10" stepKey="waitBeforeSwitchToIframe"/>
13+
<switchToIFrame userInput="preview_iframe" stepKey="switchToIframe" />
14+
<waitForPageLoad stepKey="waitForPageLoad"/>
15+
</actionGroup>
16+
</actionGroups>

app/code/Magento/Newsletter/Test/Mftf/Test/AdminAddImageToWYSIWYGNewsletterTest.xml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,7 @@
5151
<waitForPageLoad stepKey="waitForPageLoad11"/>
5252
<click selector="{{NewsletterWYSIWYGSection.Preview(_defaultNewsletter.name)}}" stepKey="clickPreview"/>
5353
<switchToWindow stepKey="switchToWindow" userInput="action_window"/>
54-
<switchToIFrame userInput="preview_iframe" stepKey="switchToIframe" />
55-
<waitForPageLoad stepKey="waitForPageLoad9"/>
54+
<actionGroup ref="SwitchToPreviewIframeActionGroup" stepKey="switchToIframe"/>
5655
<!--Verify that the text and image are present-->
5756
<seeElement selector="{{StorefrontNewsletterSection.mediaDescription}}" stepKey="assertMediaDescription"/>
5857
<seeElementInDOM selector="{{StorefrontNewsletterSection.imageSource(ImageUpload3.fileName)}}" stepKey="assertMediaSource"/>

app/code/Magento/Newsletter/Test/Mftf/Test/AdminAddVariableToWYSIWYGNewsletterTest.xml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,7 @@
8383
<waitForPageLoad stepKey="waitForPageLoad9" />
8484
<click selector="{{NewsletterWYSIWYGSection.Preview(_defaultNewsletter.name)}}" stepKey="clickPreview1" />
8585
<switchToWindow userInput="action_window" stepKey="switchToWindow1"/>
86-
<switchToIFrame userInput="preview_iframe" stepKey="switchToIframe1" />
87-
<waitForPageLoad stepKey="waitForPageLoad7"/>
86+
<actionGroup ref="SwitchToPreviewIframeActionGroup" stepKey="switchToIframe"/>
8887
<!--see Default Variable on Storefront-->
8988
<see userInput="{{_defaultVariable.city}}" stepKey="seeDefaultVariable" />
9089
<!--see Custom Variable on Storefront-->
@@ -95,8 +94,7 @@
9594
<amOnPage url="{{NewsletterTemplateGrid.url}}" stepKey="amOnTemplateGrid" />
9695
<click selector="{{NewsletterWYSIWYGSection.Preview(_defaultNewsletter.name)}}" stepKey="clickPreview2" />
9796
<switchToWindow userInput="action_window" stepKey="switchToWindow2"/>
98-
<switchToIFrame userInput="preview_iframe" stepKey="switchToIframe2" />
99-
<wait time="10" stepKey="waitForPageLoad8"/>
97+
<actionGroup ref="SwitchToPreviewIframeActionGroup" stepKey="switchToIframeAfterVariableDelete"/>
10098
<!--see custom variable blank-->
10199
<dontSee userInput="{{customVariable.html}}" stepKey="dontSeeCustomVariableName" />
102100
<closeTab stepKey="closeTab"/>

app/code/Magento/Newsletter/Test/Mftf/Test/AdminAddWidgetToWYSIWYGNewsletterTest.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
<waitForPageLoad stepKey="waitForPageLoad10" />
4949
<click selector="{{NewsletterWYSIWYGSection.Preview(_defaultNewsletter.name)}}" stepKey="clickPreview" />
5050
<switchToWindow stepKey="switchToWindow" userInput="action_window"/>
51-
<switchToIFrame userInput="preview_iframe" stepKey="switchToIframe" />
51+
<actionGroup ref="SwitchToPreviewIframeActionGroup" stepKey="switchToIframe"/>
5252
<waitForText userInput="Home page" stepKey="waitForPageLoad9"/>
5353
<see userInput="Home page" stepKey="seeHomePageCMSPage"/>
5454
<closeTab stepKey="closeTab"/>

app/code/Magento/Newsletter/Test/Mftf/Test/VerifyTinyMCEv4IsNativeWYSIWYGOnNewsletterTest.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
<waitForPageLoad stepKey="waitForPageLoad3" />
4343
<click selector="{{NewsletterWYSIWYGSection.Preview(_defaultNewsletter.name)}}" stepKey="clickPreview" />
4444
<switchToWindow stepKey="switchToWindow" userInput="action_window"/>
45-
<switchToIFrame userInput="preview_iframe" stepKey="switchToIframe" />
45+
<actionGroup ref="SwitchToPreviewIframeActionGroup" stepKey="switchToIframe"/>
4646
<waitForText userInput="Hello World From Newsletter Template!" stepKey="waitForPageLoad2"/>
4747
<see userInput="Hello World From Newsletter Template!" stepKey="seeContent" />
4848
<closeTab stepKey="closeTab"/>

0 commit comments

Comments
 (0)