|
| 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 | +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
| 9 | + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> |
| 10 | + <test name="AdminAddLargeImageToWYSIWYGCMSTest"> |
| 11 | + <annotations> |
| 12 | + <features value="Cms"/> |
| 13 | + <stories value="Default WYSIWYG toolbar configuration with Magento Media Gallery"/> |
| 14 | + <group value="Cms"/> |
| 15 | + <title value="Resize image for CMS according to Upload Configuration"/> |
| 16 | + <description value="The large image should be resized according to Upload Configuration"/> |
| 17 | + <severity value="BLOCKER"/> |
| 18 | + <testCaseId value="MC-41826"/> |
| 19 | + </annotations> |
| 20 | + <before> |
| 21 | + <createData entity="_defaultCmsPage" stepKey="createCMSPage" /> |
| 22 | + <actionGroup ref="AdminLoginActionGroup" stepKey="login"/> |
| 23 | + </before> |
| 24 | + <after> |
| 25 | + <deleteData createDataKey="createCMSPage" stepKey="deletePreReqCMSPage" /> |
| 26 | + <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> |
| 27 | + </after> |
| 28 | + |
| 29 | + <actionGroup ref="NavigateToCreatedCMSPageActionGroup" stepKey="navigateToCreatedCMSPage"> |
| 30 | + <argument name="CMSPage" value="$$createCMSPage$$"/> |
| 31 | + </actionGroup> |
| 32 | + <waitForElementVisible selector="{{TinyMCESection.TinyMCE4}}" stepKey="waitForTinyMCE4" /> |
| 33 | + <click selector="{{TinyMCESection.InsertImageIcon}}" stepKey="clickInsertImageIcon" /> |
| 34 | + <waitForPageLoad stepKey="waitForPageLoad" /> |
| 35 | + <actionGroup ref="ClickBrowseBtnOnUploadPopupActionGroup" stepKey="clickBrowserBtn"/> |
| 36 | + <actionGroup ref="AttachImageActionGroup" stepKey="attachImage"> |
| 37 | + <argument name="Image" value="ImageUploadMedium"/> |
| 38 | + </actionGroup> |
| 39 | + <actionGroup ref="SaveImageActionGroup" stepKey="insertImage"/> |
| 40 | + <actionGroup ref="FillOutUploadImagePopupActionGroup" stepKey="fillOutUploadImagePopup" /> |
| 41 | + <click selector="{{CmsNewPagePageSeoSection.header}}" stepKey="clickExpandSearchEngineOptimisation"/> |
| 42 | + <fillField selector="{{CmsNewPagePageSeoSection.urlKey}}" userInput="$$createCMSPage.identifier$$" stepKey="fillFieldUrlKey"/> |
| 43 | + <actionGroup ref="SaveCmsPageActionGroup" stepKey="clickSavePage"/> |
| 44 | + <amOnPage url="$$createCMSPage.identifier$$" stepKey="amOnPageTestPage"/> |
| 45 | + <waitForPageLoad stepKey="waitPageLoadOnFrontend"/> |
| 46 | + <seeElementInDOM selector="{{StorefrontCMSPageSection.imageSource(ImageUploadMedium.fileName)}}" stepKey="assertMediaSource"/> |
| 47 | + <executeJS function='return document.querySelector("{{StorefrontCMSPageSection.imageBySource(ImageUploadMedium.fileName)}}").naturalWidth;' stepKey="imageNaturalWith"/> |
| 48 | + <assertLessThanOrEqual stepKey="assertMaxImageWith"> |
| 49 | + <expectedResult type="int">{{SystemUploadConfigurationMaxWidth.value}}</expectedResult> |
| 50 | + <actualResult type="variable">imageNaturalWith</actualResult> |
| 51 | + </assertLessThanOrEqual> |
| 52 | + <executeJS function='return document.querySelector("{{StorefrontCMSPageSection.imageBySource(ImageUploadMedium.fileName)}}").naturalHeight;' stepKey="imageNaturalHeight"/> |
| 53 | + <assertLessThanOrEqual stepKey="assertMaxImageHeight"> |
| 54 | + <expectedResult type="int">{{SystemUploadConfigurationMaxHeight.value}}</expectedResult> |
| 55 | + <actualResult type="variable">imageNaturalHeight</actualResult> |
| 56 | + </assertLessThanOrEqual> |
| 57 | + </test> |
| 58 | +</tests> |
0 commit comments