-
Notifications
You must be signed in to change notification settings - Fork 9.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5029 from magento-borg/MC-23123
[cia] 2.2 bugfixes
- Loading branch information
Showing
12 changed files
with
245 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
50 changes: 50 additions & 0 deletions
50
app/code/Magento/Newsletter/Test/Mftf/ActionGroup/AdminNewsletterTemplateActionGroup.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- | ||
/** | ||
* Copyright © Magento, Inc. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
--> | ||
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> | ||
<actionGroup name="AdminAdminSwitchToPreviewIframeActionGroup"> | ||
<executeJS function="document.getElementById('preview_iframe').sandbox.add('allow-scripts')" stepKey="addSandboxValue"/> | ||
<wait time="10" stepKey="waitBeforeSwitchToIframe"/> | ||
<switchToIFrame userInput="preview_iframe" stepKey="switchToIframe" /> | ||
<waitForPageLoad stepKey="waitForPageLoad"/> | ||
</actionGroup> | ||
<actionGroup name="AdminNavigateToNewsletterGrid"> | ||
<amOnPage url="{{NewsletterTemplateForm.url}}" stepKey="amOnNewsletterTemplatePage"/> | ||
<waitForPageLoad stepKey="waitForNewNewsletterPageLoad"/> | ||
</actionGroup> | ||
|
||
<actionGroup name="AdminFillNewsletterForm"> | ||
<arguments> | ||
<argument name="Newsletter" defaultValue="BasicFieldNewsletterSection"/> | ||
</arguments> | ||
<waitForElementVisible selector="{{BasicFieldNewsletterSection.templateName}}" stepKey="waitForTemplateNameField"/> | ||
<fillField selector="{{BasicFieldNewsletterSection.templateName}}" userInput="{{Newsletter.name}}" stepKey="fillTemplateName" /> | ||
<fillField selector="{{BasicFieldNewsletterSection.templateSubject}}" userInput="{{Newsletter.subject}}" stepKey="fillTemplateSubject" /> | ||
<fillField selector="{{BasicFieldNewsletterSection.senderName}}" userInput="{{Newsletter.senderName}}" stepKey="fillSenderName" /> | ||
<fillField selector="{{BasicFieldNewsletterSection.senderEmail}}" userInput="{{Newsletter.senderEmail}}" stepKey="fillSenderEmail" /> | ||
<fillField selector="{{BasicFieldNewsletterSection.templateText}}" userInput="{{Newsletter.templateText}}" stepKey="fillTemplateText" /> | ||
</actionGroup> | ||
|
||
<actionGroup name="AdminOpenNewsletterPreviewTab"> | ||
<waitForElementVisible selector="{{BasicFieldNewsletterSection.templateName}}" stepKey="waitForPreviewButton"/> | ||
<click selector="{{BasicFieldNewsletterSection.preview}}" stepKey="clickPreview"/> | ||
<switchToNextTab stepKey="switchToPreviewTab"/> | ||
<waitForLoadingMaskToDisappear stepKey="waitForLoadingMask"/> | ||
<waitForElementVisible selector="{{BasicFieldNewsletterSection.previewIframe}}" stepKey="waitForIframeVisible"/> | ||
<executeJS function="document.getElementById('preview_iframe').sandbox.add('allow-scripts')" stepKey="addSandboxValue"/> | ||
<switchToIFrame userInput="preview_iframe" stepKey="switchToIframe"/> | ||
<waitForElementVisible selector="body" stepKey="waitForIframeLoad"/> | ||
</actionGroup> | ||
|
||
<actionGroup name="AdminAssertNewsletterContent"> | ||
<arguments> | ||
<argument name="Newsletter" defaultValue="BasicFieldNewsletterSection"/> | ||
</arguments> | ||
<waitForText userInput="{{Newsletter.expectedTemplate}}" stepKey="checkTemplateContainsText" time="30"/> | ||
</actionGroup> | ||
</actionGroups> |
19 changes: 19 additions & 0 deletions
19
app/code/Magento/Newsletter/Test/Mftf/Data/NewsletterTemplateData.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- | ||
/** | ||
* Copyright © Magento, Inc. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
--> | ||
|
||
<entities xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:noNamespaceSchemaLocation="urn:magento:mftf:DataGenerator/etc/dataProfileSchema.xsd"> | ||
<entity name="NewsletterWithDirectives" type="template"> | ||
<data key="name" unique="suffix">Test Newsletter Template</data> | ||
<data key="subject">Test Newsletter Subject</data> | ||
<data key="senderName">Admin</data> | ||
<data key="senderEmail">[email protected]</data> | ||
<data key="templateText">Template {{var this.template_id}}{{var this.getData(template_id)}} Text</data> | ||
<data key="expectedTemplate">Template 123 Text</data> | ||
</entity> | ||
</entities> |
14 changes: 14 additions & 0 deletions
14
app/code/Magento/Newsletter/Test/Mftf/Page/NewsletterTemplatePage.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- | ||
/** | ||
* Copyright © Magento, Inc. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
--> | ||
<pages xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/PageObject.xsd"> | ||
<page name="NewsletterTemplateForm" url="/newsletter/template/new/" area="admin" module="Magento_Cms"> | ||
<section name="StorefrontNewsletterSection"/> | ||
<section name="StorefrontNewsletterSection"/> | ||
</page> | ||
</pages> |
19 changes: 19 additions & 0 deletions
19
app/code/Magento/Newsletter/Test/Mftf/Section/NewsletterTemplateSection.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- | ||
/** | ||
* Copyright © Magento, Inc. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
--> | ||
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd"> | ||
<section name="BasicFieldNewsletterSection"> | ||
<element name="templateName" type="input" selector="#code"/> | ||
<element name="templateSubject" type="input" selector="#subject"/> | ||
<element name="templateText" type="input" selector="#text"/> | ||
<element name="senderName" type="input" selector="#sender_name"/> | ||
<element name="senderEmail" type="input" selector="#sender_email"/> | ||
<element name="preview" type="button" selector="button[data-role='template-preview']"/> | ||
<element name="previewIframe" type="iframe" selector="#preview_iframe"/> | ||
</section> | ||
</sections> |
44 changes: 44 additions & 0 deletions
44
app/code/Magento/Newsletter/Test/Mftf/Test/AdminNewsletterPreviewTest.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- | ||
/** | ||
* Copyright © Magento, Inc. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
--> | ||
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> | ||
<test name="AdminNewsletterDraftPreviewTest"> | ||
<annotations> | ||
<features value="Newsletter"/> | ||
<group value="Newsletter"/> | ||
<group value="WYSIWYGDisabled"/> | ||
<title value="Admin should be able to preview Newsletter content in draft mode"/> | ||
<description value="Admin should be able to preview newsletter content in draft mode"/> | ||
<severity value="CRITICAL"/> | ||
<testCaseId value="MC-23058"/> | ||
<stories value="Newsletter Preview"/> | ||
</annotations> | ||
|
||
<before> | ||
<actionGroup ref="LoginActionGroup" stepKey="login"/> | ||
</before> | ||
|
||
<after> | ||
<actionGroup ref="logout" stepKey="logout"/> | ||
</after> | ||
|
||
<actionGroup ref="AdminNavigateToNewsletterGrid" stepKey="navigateToGrid"/> | ||
|
||
<actionGroup ref="AdminFillNewsletterForm" stepKey="fillForm"> | ||
<argument name="Newsletter" value="NewsletterWithDirectives"/> | ||
</actionGroup> | ||
|
||
<actionGroup ref="AdminOpenNewsletterPreviewTab" stepKey="openPreviewTab"/> | ||
|
||
<actionGroup ref="AdminAssertNewsletterContent" stepKey="assertTemplateContent"> | ||
<argument name="Newsletter" value="NewsletterWithDirectives"/> | ||
</actionGroup> | ||
|
||
<closeTab stepKey="closeTab"/> | ||
</test> | ||
</tests> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters