Skip to content

Commit 69c32b1

Browse files
committed
Merge branch 'ACP2E-1234' of https://github.com/magento-l3/magento2ce into PR-L3-2023-01-31
2 parents 9a8d8d5 + d85d0d5 commit 69c32b1

File tree

4 files changed

+90
-0
lines changed

4 files changed

+90
-0
lines changed
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+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="AssertMetaDescriptionInProductEditFormActionGroup">
12+
<arguments>
13+
<argument name="productMetaDescription" type="string"/>
14+
</arguments>
15+
<scrollTo selector="{{AdminProductSEOSection.sectionHeader}}" x="0" y="-150" stepKey="scrollToContentSection"/>
16+
<click selector="{{AdminProductSEOSection.sectionHeader}}" stepKey="clickSearchEngineOptimizationTab"/>
17+
<seeInField selector="{{AdminProductSEOSection.metaDescriptionInput}}" userInput="{{productMetaDescription}}" stepKey="seeProductMetaDescription"/>
18+
</actionGroup>
19+
</actionGroups>
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
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="AdminSimpleProductSetEditMetaDescriptionContentTest">
12+
<annotations>
13+
<features value="Catalog"/>
14+
<stories value="Create/edit simple product"/>
15+
<title value="Admin should be able to set/edit product Content when editing a simple product. Meta description should be autogenerated."/>
16+
<description value="Admin should be able to set/edit product Content when editing a simple product"/>
17+
<severity value="MINOR"/>
18+
<testCaseId value="AC-6971"/>
19+
<group value="Catalog"/>
20+
<group value="WYSIWYGDisabled"/>
21+
</annotations>
22+
<before>
23+
<!--Admin Login-->
24+
<actionGroup stepKey="loginToAdminPanel" ref="AdminLoginActionGroup"/>
25+
<actionGroup ref="DisabledWYSIWYGActionGroup" stepKey="disableWYSIWYG"/>
26+
</before>
27+
<after>
28+
<!--Admin Logout-->
29+
<actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/>
30+
</after>
31+
32+
<!-- Create product -->
33+
<actionGroup ref="AdminOpenProductIndexPageActionGroup" stepKey="navigateToProductIndex"/>
34+
<actionGroup ref="GoToCreateProductPageActionGroup" stepKey="goToCreateProduct">
35+
<argument name="product" value="SimpleProduct"/>
36+
</actionGroup>
37+
<actionGroup ref="FillMainProductFormNoWeightActionGroup" stepKey="fillProductForm">
38+
<argument name="product" value="SimpleProduct"/>
39+
</actionGroup>
40+
41+
<!--Add content-->
42+
<!--A generic scroll scrolls past this element, in doing this it fails to execute certain actions on the element and others below it. By scrolling slightly above it resolves this issue.-->
43+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="scrollTo"/>
44+
<actionGroup ref="AdminOpenContentSectionOnProductPageActionGroup" stepKey="openDescriptionDropDown"/>
45+
<actionGroup ref="AdminFillInProductDescriptionActionGroup" stepKey="fillLongDescription">
46+
<argument name="description" value="&lt;style&gt;#html-body [data-pb-style=A463JYO]&lt;/style&gt;&lt;div data-content-type='block' data-appearance='default' data-element='main' data-pb-style='B1D1SCO'&gt;{{widget type='Magento\Cms\Block\Widget\Block' template='widget/static_block/default.phtml' block_id='1' type_name='CMS Static Block'}}&lt;/div&gt;&lt;p&gt;HTML description&lt;/p&gt;"/>
47+
</actionGroup>
48+
<actionGroup ref="AdminFillProductNameOnProductFormActionGroup" stepKey="fillProductName">
49+
<argument name="productName" value="simple"/>
50+
</actionGroup>
51+
52+
<!--Checking SEO content admin-->
53+
<actionGroup ref="AssertMetaDescriptionInProductEditFormActionGroup" stepKey="seeProductMetaDescription">
54+
<argument name="productMetaDescription" value="simple HTML description"/>
55+
</actionGroup>
56+
</test>
57+
</tests>

app/code/Magento/Catalog/view/adminhtml/web/js/components/import-handler.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,8 @@ define([
7272
});
7373

7474
if (nonEmptyValueFlag) {
75+
string = string.replace(/<style.*?>.*?<\/style>/gis, ''); //Remove style tags
76+
string = string.replace(/{{widget.*?}}/gis, ''); //Remove widgets
7577
string = string.replace(/(<([^>]+)>)/ig, ''); // Remove html tags
7678
this.value(string);
7779
} else {
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+
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
9+
<section name="AdminCatalogProductFieldsAutoGenerationSection">
10+
<element name="metaDescriptionInput" type="text" selector="groups[fields_masks][fields][meta_description][value]"/>
11+
</section>
12+
</sections>

0 commit comments

Comments
 (0)