Skip to content

Commit

Permalink
Merge pull request #2712 from magento-obsessive-owls/MAGETWO-90828-te…
Browse files Browse the repository at this point in the history
…ch-debt-cleanup-background-attributes-for-banner

[obsessive] MAGETWO-90828: [Tech Debt] Cleanup Background Attributes for Banner
  • Loading branch information
tjwiebell committed Jun 19, 2018
2 parents b8528ae + cab7b03 commit e47b0d7
Show file tree
Hide file tree
Showing 7 changed files with 41 additions and 19 deletions.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,18 @@
<see selector="{{AdminCategoryContentSection.imageFileName}}" userInput="{{image.file}}" stepKey="seeImage"/>
</actionGroup>

<!-- Action to navigate to Media Gallery. Used in tests to cleanup uploaded images -->
<actionGroup name="navigateToMediaGallery">
<amOnPage url="{{AdminCategoryPage.url}}" stepKey="amOnAdminCategoryPage"/>
<waitForElementVisible selector="{{AdminCategoryContentSection.sectionHeader}}" stepKey="waitForContentSection"/>
<conditionalClick selector="{{AdminCategoryContentSection.sectionHeader}}" dependentSelector="{{AdminCategoryContentSection.uploadButton}}" visible="false" stepKey="openContentSection"/>
<waitForPageLoad stepKey="waitForPageLoad1"/>
<waitForElementVisible selector="{{AdminCategoryContentSection.selectFromGalleryButton}}" stepKey="waitForSelectFromGalleryButton"/>
<click selector="{{AdminCategoryContentSection.selectFromGalleryButton}}" stepKey="clickSelectFromGalleryButton"/>
<waitForPageLoad stepKey="waitForPageLoad2"/>
<waitForLoadingMaskToDisappear stepKey="waitForLoadingMaskToDisappear"/>
</actionGroup>

<!--Actions to check if a category exists on StoreFront-->
<actionGroup name="CheckCategoryOnStorefront">
<arguments>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,22 @@
xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Test/etc/actionGroupSchema.xsd">
<actionGroup name="DeleteImageFromStorageActionGroup">
<arguments>
<argument name="Image" defaultValue="" />
<argument name="Image"/>
</arguments>
<click selector="//small[contains(text(),'{{Image.value}}')]" stepKey="selectImage" />
<see selector="{{MediaGallerySection.DeleteSelectedBtn}}" userInput="Delete Selected" stepKey="seeDeleteBtn"/>
<click selector="{{MediaGallerySection.DeleteSelectedBtn}}" stepKey="clickDeleteSelected" />
<waitForText userInput="OK" stepKey="waitForConfirm" />
<click selector="{{MediaGallerySection.confirmDelete}}" stepKey="confirmDelete" />
<waitForElementNotVisible selector="{{MediaGallerySection.image(ImageUpload.file)}}" stepKey="waitForImageDeleted" />
<dontSeeElement selector="{{MediaGallerySection.image(ImageUpload.file)}}" stepKey="dontSeeImage" />
<waitForElementVisible selector="{{MediaGallerySection.imageOrImageCopy(Image.fileName, Image.extension)}}" stepKey="waitForInitialImages"/>
<grabMultiple selector="{{MediaGallerySection.imageOrImageCopy(Image.fileName, Image.extension)}}" stepKey="initialImages"/>
<click selector="{{MediaGallerySection.imageOrImageCopy(Image.fileName, Image.extension)}}" stepKey="selectImage"/>
<waitForElementVisible selector="{{MediaGallerySection.DeleteSelectedBtn}}" stepKey="waitForDeleteBtn"/>
<click selector="{{MediaGallerySection.DeleteSelectedBtn}}" stepKey="clickDeleteSelected"/>
<waitForPageLoad stepKey="waitForPageLoad1"/>
<waitForElementVisible selector="{{MediaGallerySection.confirmDelete}}" stepKey="waitForConfirmBtn"/>
<click selector="{{MediaGallerySection.confirmDelete}}" stepKey="clickConfirmBtn"/>
<waitForPageLoad stepKey="waitForPageLoad2"/>
<waitForLoadingMaskToDisappear stepKey="waitForLoadingMaskToDisappear"/>
<grabMultiple selector="{{MediaGallerySection.imageOrImageCopy(Image.fileName, Image.extension)}}" stepKey="newImages"/>
<assertLessThan stepKey="assertLessImages">
<expectedResult type="variable">initialImages</expectedResult>
<actualResult type="variable">newImages</actualResult>
</assertLessThan>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@
xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Test/etc/actionGroupSchema.xsd">
<actionGroup name="NavigateToMediaFolderActionGroup">
<arguments>
<argument name="FolderName" type="string" defaultValue="" />
<argument name="FolderName" type="string"/>
</arguments>
<conditionalClick selector="{{MediaGallerySection.StorageRootArrow}}" dependentSelector="{{MediaGallerySection.checkIfArrowExpand}}" stepKey="clickArrowIfClosed" visible="true"/>
<waitForText userInput="{{FolderName}}" stepKey="waitForNewFolder" />
<click userInput="{{FolderName}}" stepKey="clickOnCreatedFolder" />
<waitForLoadingMaskToDisappear stepKey="waitForLoading5" />
<waitForText userInput="{{FolderName}}" stepKey="waitForNewFolder"/>
<click userInput="{{FolderName}}" stepKey="clickOnCreatedFolder"/>
<waitForLoadingMaskToDisappear stepKey="waitForLoading"/>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,12 @@
</actionGroup>
<actionGroup name="attachImage">
<arguments>
<argument name="Image" defaultValue=""/>
<argument name="Image"/>
</arguments>
<attachFile selector="{{MediaGallerySection.BrowseUploadImage}}" userInput="{{Image.value}}" stepKey="uploadImage1"/>
<waitForLoadingMaskToDisappear stepKey="waitForLoading6" />
<waitForElementVisible selector="{{MediaGallerySection.image(Image.value)}}" stepKey="waitForUploadImage1" />
<seeElement selector="{{MediaGallerySection.imageSelected(Image.value)}}" stepKey="seeImageSelected" />
<attachFile selector="{{MediaGallerySection.BrowseUploadImage}}" userInput="{{Image.value}}" stepKey="uploadImage"/>
<waitForPageLoad stepKey="waitForPageLoad"/>
<waitForLoadingMaskToDisappear stepKey="waitForLoadingMaskToDisappear"/>
<waitForElementVisible selector="{{MediaGallerySection.imageOrImageCopy(Image.fileName, Image.extension)}}" stepKey="waitForUploadImage"/>
</actionGroup>
<actionGroup name="deleteImage">
<see selector="{{MediaGallerySection.DeleteSelectedBtn}}" userInput="Delete Selected" stepKey="seeDeleteBtn"/>
Expand All @@ -53,8 +53,9 @@
<dontSeeElement selector="{{MediaGallerySection.image(ImageUpload.file)}}" stepKey="dontSeeImage" />
</actionGroup>
<actionGroup name="saveImage">
<click selector="{{MediaGallerySection.InsertFile}}" stepKey="clickInsertBtn" />
<waitForPageLoad stepKey="waitForPageLoad2"/>
<click selector="{{MediaGallerySection.InsertFile}}" stepKey="clickInsertBtn"/>
<waitForPageLoad stepKey="waitForPageLoad"/>
<waitForLoadingMaskToDisappear stepKey="waitForLoadingMaskToDisappear"/>
</actionGroup>
<actionGroup name="fillOutUploadImagePopup">
<waitForElementVisible selector="{{MediaGallerySection.OkBtn}}" stepKey="waitForOkBtn" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
<element name="Browse" type="button" selector=".mce-i-browse"/>
<element name="BrowseUploadImage" type="file" selector=".fileupload" />
<element name="image" type="text" selector="//small[text()='{{var1}}']" parameterized="true"/>
<element name="imageOrImageCopy" type="text" selector="//img[contains(@alt, '{{arg1}}.{{arg2}}')]|//img[contains(@alt,'{{arg1}}_') and contains(@alt,'.{{arg2}}')]" parameterized="true"/>
<element name="imageSelected" type="text" selector="//small[text()='{{var1}}']/parent::*[@class='filecnt selected']" parameterized="true"/>
<element name="ImageSource" type="input" selector=".mce-combobox.mce-abs-layout-item.mce-last.mce-has-open" />
<element name="ImageDescription" type="input" selector=".mce-textbox.mce-abs-layout-item.mce-last" />
Expand Down

0 comments on commit e47b0d7

Please sign in to comment.