Skip to content

Commit 103d43f

Browse files
author
Stas Puga
committed
MC-24241: [MFTF Test] Uploading a Transactional Emails logo
1 parent cde4f67 commit 103d43f

File tree

5 files changed

+88
-18
lines changed

5 files changed

+88
-18
lines changed
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
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="AdminUploadTransactionEmailsImageActionGroup">
12+
<annotations>
13+
<description>Upload logo image for email</description>
14+
</annotations>
15+
<arguments>
16+
<argument name="image" type="string" defaultValue="{{MagentoLogo.file}}"/>
17+
<argument name="width" type="string"/>
18+
<argument name="height" type="string"/>
19+
</arguments>
20+
21+
<conditionalClick selector="{{AdminDesignConfigSection.logoSectionHeader}}" dependentSelector="{{AdminDesignConfigSection.logoWrapperOpen}}" visible="true" stepKey="openTab"/>
22+
<waitForElementVisible selector="{{AdminDesignConfigSection.logoImageAlt}}" stepKey="waitVisibleUploadLogo"/>
23+
<attachFile selector="{{AdminDesignConfigSection.logoUpload}}" userInput="{{image}}" stepKey="attachLogo"/>
24+
<waitForElementVisible selector="{{AdminDesignConfigSection.logoPreview}}" stepKey="waitingForLogoToUpload"/>
25+
<seeElement selector="{{AdminDesignConfigSection.logoPreview}}" stepKey="LogoPreviewIsVisible"/>
26+
<fillField selector="{{AdminDesignConfigSection.logoImageAlt}}" userInput="{{image}}" stepKey="fillFieldImageAlt"/>
27+
<fillField selector="{{AdminDesignConfigSection.logoImageWidth}}" userInput="{{width}}" stepKey="fillFieldImageWidth"/>
28+
<fillField selector="{{AdminDesignConfigSection.logoImageHeight}}" userInput="{{height}}" stepKey="fillFieldImageHeight"/>
29+
</actionGroup>
30+
</actionGroups>

app/code/Magento/Email/Test/Mftf/Test/TransactionalEmailsLogoUploadTest.xml

Lines changed: 28 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -11,33 +11,43 @@
1111
<test name="TransactionalEmailsLogoUploadTest">
1212
<annotations>
1313
<features value="Email"/>
14-
<stories value="Email"/>
15-
<title value="MC-13908: Uploading a Transactional Emails logo"/>
14+
<stories value="Transactional Emails logo"/>
15+
<title value="Uploading a Transactional Emails logo"/>
1616
<description value="Transactional Emails Logo should be able to be uploaded in the admin and previewed"/>
1717
<severity value="CRITICAL"/>
18-
<testCaseId value="MC-13908"/>
19-
<group value="LogoUpload"/>
20-
<skip>
21-
<issueId value="MC-18496"/>
22-
</skip>
18+
<testCaseId value="MC-27620"/>
19+
<useCaseId value="MC-24241"/>
20+
<group value="logoUpload"/>
2321
</annotations>
24-
<!--Login to Admin Area-->
2522
<before>
26-
<actionGroup ref="LoginAsAdmin" stepKey="loginToAdminArea"/>
23+
<!--Login to Admin Area-->
24+
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/>
2725
</before>
28-
<!--Logout from Admin Area-->
2926
<after>
30-
<actionGroup ref="logout" stepKey="logoutOfAdmin"/>
27+
<!-- Clear filter on Design Config Page -->
28+
<amOnPage url="{{DesignConfigPage.url}}" stepKey="navigateToDesignConfigPage" />
29+
<waitForPageLoad stepKey="waitForPageLoadToViewDesignConfigPage"/>
30+
<actionGroup ref="ClearFiltersAdminDataGridActionGroup" stepKey="clearFilter"/>
31+
<!--Logout from Admin Area-->
32+
<actionGroup ref="logout" stepKey="logoutFromAdmin"/>
3133
</after>
3234
<!--Navigate to content->Design->Config page-->
3335
<amOnPage url="{{DesignConfigPage.url}}" stepKey="navigateToDesignConfigPage" />
34-
<waitForPageLoad stepKey="waitForPageloadToViewDesignConfigPage"/>
35-
<click selector="{{AdminDesignConfigSection.scopeRow('3')}}" stepKey="editStoreView"/>
36+
<waitForPageLoad stepKey="waitForPageLoadToViewDesignConfigPage"/>
37+
<actionGroup ref="AdminGridFilterSearchResultsBySelectActionGroup" stepKey="filterThemeDesignConfiguration">
38+
<argument name="selectorAttr" value="store_id"/>
39+
<argument name="store" value="{{_defaultStore.name}}"/>
40+
</actionGroup>
41+
<click selector="{{AdminDesignConfigSection.scopeRow('1')}}" stepKey="editStoreView"/>
3642
<waitForPageLoad stepKey="waitForPageLoadToOpenStoreViewEditPage"/>
37-
<!--Click Upload logo in Transactional Emails and upload the image and preview it-->
38-
<click selector="{{AdminDesignConfigSection.logoWrapperOpen}}" stepKey="openTab" />
39-
<attachFile selector="{{AdminDesignConfigSection.logoUpload}}" userInput="{{MagentoLogo.file}}" stepKey="attachLogo"/>
40-
<wait time="5" stepKey="waitingForLogoToUpload" />
41-
<seeElement selector="{{AdminDesignConfigSection.logoPreview}}" stepKey="LogoPreviewIsVisible"/>
43+
<!-- Upload Image -->
44+
<actionGroup ref="AdminUploadTransactionEmailsImageActionGroup" stepKey="uploadImage">
45+
<argument name="width" value="200"/>
46+
<argument name="height" value="100"/>
47+
</actionGroup>
48+
<!--Save Design Configuration -->
49+
<actionGroup ref="ClickSaveButtonActionGroup" stepKey="saveDesignConfiguration">
50+
<argument name="message" value="You saved the configuration."/>
51+
</actionGroup>
4252
</test>
4353
</tests>

app/code/Magento/Theme/Test/Mftf/Section/AdminDesignConfigSection.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@
2626
<element name="logoUpload" type ="input" selector="[name='email_logo']" />
2727
<element name="logoWrapperOpen" type ="text" selector="[data-index='email'] [data-state-collapsible ='closed']"/>
2828
<element name="logoPreview" type ="text" selector="[alt ='magento-logo.png']"/>
29+
<element name="logoImageAlt" type ="text" selector="[name='email_logo_alt']"/>
30+
<element name="logoImageWidth" type ="text" selector="[name='email_logo_width']"/>
31+
<element name="logoImageHeight" type ="text" selector="[name='email_logo_height']"/>
2932
<element name="faviconArrow" type="button" selector="#ZmF2aWNvbg-- > .jstree-icon" />
3033
<element name="checkIfFaviconArrowExpand" type="button" selector="//li[@id='ZmF2aWNvbg--' and contains(@class,'jstree-closed')]" />
3134
<element name="storesArrow" type="button" selector="#ZmF2aWNvbi9zdG9yZXM- > .jstree-icon" />
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
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="AdminGridFilterSearchResultsBySelectActionGroup">
12+
<annotations>
13+
<description>Filters an Admin Grid page using the provided Filter Selector and Search Value.</description>
14+
</annotations>
15+
<arguments>
16+
<argument name="selectorAttr" type="string"/>
17+
<argument name="store" type="string"/>
18+
</arguments>
19+
20+
<conditionalClick selector="{{AdminGridFilterControls.clearAll}}" dependentSelector="{{AdminGridFilterControls.clearAll}}" visible="true" stepKey="clearTheFiltersIfPresent"/>
21+
<waitForPageLoad time="30" stepKey="waitForPageLoad"/>
22+
<click selector="{{AdminGridFilterControls.filters}}" stepKey="clickOnFilters"/>
23+
<selectOption selector="{{AdminDataGridFilterSection.selectFieldByNameAttrInGrid(selectorAttr)}}" userInput="{{store}}" stepKey="selectStoreView"/>
24+
<click selector="{{AdminGridFilterControls.applyFilters}}" stepKey="clickOnApplyFilters"/>
25+
</actionGroup>
26+
</actionGroups>

app/code/Magento/Ui/Test/Mftf/Section/AdminDataGridFilterSection.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
<element name="filterExpand" type="button" selector="//div[@class='admin__data-grid-header'][(not(ancestor::*[@class='sticky-header']) and not(contains(@style,'visibility: hidden'))) or (ancestor::*[@class='sticky-header' and not(contains(@style,'display: none'))])]//button[@data-action='grid-filter-expand']" />
1414
<element name="inputFieldByNameAttr" type="input" selector="//*[@data-part='filter-form']//input[@name='{{inputNameAttr}}']" parameterized="true" />
1515
<element name="inputFieldByNameAttrInGrid" type="input" selector="//*[@data-role='filter-form']//input[@name='{{inputNameAttr}}']" parameterized="true"/>
16+
<element name="selectFieldByNameAttrInGrid" type="select" selector="//*[@data-part='filter-form']//select[@name='{{selectNameAttr}}']" parameterized="true"/>
1617
<element name="apply" type="button" selector="//*[@data-part='filter-form']//button[@data-action='grid-filter-apply']" />
1718
<element name="clear" type="button" selector=".admin__data-grid-header [data-action='grid-filter-reset']" />
1819
</section>

0 commit comments

Comments
 (0)