Skip to content

Commit fc646eb

Browse files
committed
Merge branch 'ACP2E-107' of https://github.com/magento-l3/magento2ce into L3-PR-20211001
2 parents 1c31d4f + be14a7d commit fc646eb

File tree

6 files changed

+110
-1
lines changed

6 files changed

+110
-1
lines changed
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="AssertEmailTemplateIndexActionGroup">
12+
<arguments>
13+
<argument name="expectedContent" type="string" defaultValue="{{EmailTemplate.templateName}}"/>
14+
</arguments>
15+
16+
<see userInput="{{expectedContent}}" selector="{{AdminEmailTemplateIndexSection.templateRowByName(EmailTemplate.templateName)}}" stepKey="checkGridIsPresent"/>
17+
</actionGroup>
18+
</actionGroups>
Lines changed: 22 additions & 0 deletions
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="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="FindEmailTemplateActionGroup">
12+
<arguments>
13+
<argument name="template" defaultValue="EmailTemplate"/>
14+
</arguments>
15+
16+
<amOnPage url="{{AdminEmailTemplateIndexPage.url}}" stepKey="navigateEmailTemplatePage" />
17+
<click selector="{{AdminDataGridHeaderSection.clearFilters}}" stepKey="clearFilters"/>
18+
<fillField selector="{{AdminEmailTemplateIndexSection.searchTemplateField}}" userInput="{{template.templateName}}" stepKey="findCreatedTemplate"/>
19+
<click selector="{{AdminDataGridHeaderSection.applyFilters}}" stepKey="clickSearch"/>
20+
<waitForElementVisible selector="{{AdminEmailTemplateIndexSection.templateRowByName(template.templateName)}}" stepKey="waitForTemplatesAppeared"/>
21+
</actionGroup>
22+
</actionGroups>
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+
9+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="PreviewFromGridEmailTemplateActionGroup" extends="FindEmailTemplateActionGroup">
12+
<arguments>
13+
<argument name="template" defaultValue="EmailTemplate"/>
14+
</arguments>
15+
16+
<click selector="{{AdminEmailTemplateIndexSection.templateActionByName(template.templateName)}}" stepKey="clickPreviewTemplate"/>
17+
<wait time="3" stepKey="waitForWindow"/>
18+
<switchToNextTab after="waitForWindow" stepKey="switchToNewOpenedTab"/>
19+
<seeInCurrentUrl url="{{AdminEmailTemplatePreviewPage.url}}" after="switchToNewOpenedTab" stepKey="seeWindowCurrentUrl"/>
20+
<seeElement selector="{{AdminEmailTemplatePreviewSection.iframe}}" after="seeWindowCurrentUrl" stepKey="seeIframeOnPage"/>
21+
<switchToIFrame userInput="preview_iframe" after="seeIframeOnPage" stepKey="switchToIframe"/>
22+
<waitForText userInput="{{template.templateText}}" after="switchToIframe" stepKey="waitForText"/>
23+
</actionGroup>
24+
</actionGroups>

app/code/Magento/Email/Test/Mftf/Section/AdminEmailTemplateIndexSection.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,6 @@
1111
<section name="AdminEmailTemplateIndexSection">
1212
<element name="searchTemplateField" type="input" selector="#systemEmailTemplateGrid_filter_code"/>
1313
<element name="templateRowByName" type="button" selector="//*[@id='systemEmailTemplateGrid_table']//td[contains(@class, 'col-code') and normalize-space(.)='{{templateName}}']/ancestor::tr" parameterized="true"/>
14+
<element name="templateActionByName" type="button" selector="//*[@id='systemEmailTemplateGrid_table']//td[contains(@class, 'col-code') and normalize-space(.)='{{templateName}}']/ancestor::tr/td[contains(@class, 'col-action')]/a" parameterized="true"/>
1415
</section>
1516
</sections>
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
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="AdminEmailTemplatePreviewFromGridTest">
12+
<annotations>
13+
<features value="Email"/>
14+
<stories value="Preview email template from grid"/>
15+
<title value="Check email template preview from grid"/>
16+
<description value="Check if email template preview action in the grid works correctly"/>
17+
<severity value="AVERAGE"/>
18+
<testCaseId value="AC-1503"/>
19+
<useCaseId value="ACP2E-107"/>
20+
<group value="email"/>
21+
<group value="WYSIWYGDisabled"/>
22+
</annotations>
23+
24+
<before>
25+
<!--Login to Admin Area-->
26+
<actionGroup ref="AdminLoginActionGroup" stepKey="loginToAdminArea"/>
27+
</before>
28+
29+
<after>
30+
<!--Delete created Template-->
31+
<actionGroup ref="DeleteEmailTemplateActionGroup" stepKey="deleteTemplate"/>
32+
<actionGroup ref="AdminClearGridFiltersActionGroup" stepKey="clearFilters"/>
33+
<!--Logout from Admin Area-->
34+
<actionGroup ref="AdminLogoutActionGroup" stepKey="logoutOfAdmin"/>
35+
</after>
36+
37+
<actionGroup ref="CreateCustomTemplateActionGroup" stepKey="createTemplate"/>
38+
<actionGroup ref="PreviewFromGridEmailTemplateActionGroup" stepKey="previewTemplateFromGrid"/>
39+
<actionGroup ref="AssertEmailTemplateContentActionGroup" stepKey="assertWindowContent"/>
40+
<closeTab stepKey="closeTab"/>
41+
<switchToWindow stepKey="switchToMainWindow"/>
42+
<actionGroup ref="AssertEmailTemplateIndexActionGroup" stepKey="assertGridContent"/>
43+
</test>
44+
</tests>

lib/internal/Magento/Framework/View/Helper/SecureHtmlRenderer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ function {$listenerFunction} () {
119119
if (event && event.target) {
120120
targetElement = event.target;
121121
}
122-
{$listenerFunction}.apply(targetElement);
122+
return {$listenerFunction}.apply(targetElement);
123123
};
124124
}
125125
});

0 commit comments

Comments
 (0)