Skip to content

Commit

Permalink
🔃 [Magento Community Engineering] Community Contributions - 2.4-develop
Browse files Browse the repository at this point in the history
Accepted Community Pull Requests:
 - #29967: The "three dots" context menu is not closed after unsuccessful licensing from Media Gallery (by @joweecaquicla)
 - #29929: [MFTF] add new  AdminDeleteTaxRateActionGroup (by @Usik2203)
 - #29895: #1794: [MFTF] Unskip AdminMediaGalleryCatalogUiVerifyUsedInLinkCategoryGridTest (by @joweecaquicla)
 - #27446: Convert MSRP currency of configurable product options (by @ashokadewit)
 - #26527: issue/26526 Fix orderRepository does not check if there are no extens… (by @PascalBrouwers)


Fixed GitHub Issues:
 - #29940: [Issue] [MFTF] add new  AdminDeleteTaxRateActionGroup (reported by @m2-assistant[bot]) has been fixed in #29929 by @Usik2203 in 2.4-develop branch
   Related commits:
     1. d0ba337
     2. caaf469
     3. 03932b5
     4. 204c4d9
     5. b919939
     6. 9a5688d

 - #29603: [Issue] Convert MSRP currency of configurable product options (reported by @m2-assistant[bot]) has been fixed in #27446 by @ashokadewit in 2.4-develop branch
   Related commits:
     1. 3f616ad
     2. a93dbd8
     3. d07e0a9

 - #26526: orderRepository does not check if there are no extensionAttributes (reported by @PascalBrouwers) has been fixed in #26527 by @PascalBrouwers in 2.4-develop branch
   Related commits:
     1. 7a04c04
     2. 6ee28c8
     3. bb40898
     4. ff12e39
  • Loading branch information
magento-engcom-team authored Sep 14, 2020
2 parents 468128c + c3b95fd commit 70223c0
Show file tree
Hide file tree
Showing 21 changed files with 361 additions and 59 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ protected function getOptionPrices()
'tierPrices' => $tierPrices,
'msrpPrice' => [
'amount' => $this->localeFormat->getNumber(
$product->getMsrp()
$this->priceCurrency->convertAndRound($product->getMsrp())
),
],
];
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
<?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="StorefrontConfigurableProductMSRPCovertTest">
<annotations>
<features value="ConfigurableProduct"/>
<stories value="View configurable product options, verify convert MSRP currency on storefront."/>
<title value="Verify convert MSRP currency of configurable product options"/>
<description value="Check convert MSRP currency of configurable product options."/>
<testCaseId value="MC-37575"/>
<severity value="MAJOR"/>
<group value="ConfigurableProduct"/>
</annotations>

<before>
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>

<createData entity="SimpleSubCategory" stepKey="createCategory"/>

<createData entity="ApiConfigurableProduct" stepKey="createConfigProduct">
<requiredEntity createDataKey="createCategory"/>
</createData>

<createData entity="productAttributeWithTwoOptions" stepKey="createConfigProductAttribute"/>
<createData entity="productAttributeOption1" stepKey="createConfigProductAttributeOption1">
<requiredEntity createDataKey="createConfigProductAttribute"/>
</createData>
<createData entity="productAttributeOption2" stepKey="createConfigProductAttributeOption2">
<requiredEntity createDataKey="createConfigProductAttribute"/>
</createData>
<createData entity="AddToDefaultSet" stepKey="createConfigAddToAttributeSet">
<requiredEntity createDataKey="createConfigProductAttribute"/>
</createData>
<getData entity="ProductAttributeOptionGetter" index="1" stepKey="getConfigAttributeOption1">
<requiredEntity createDataKey="createConfigProductAttribute"/>
</getData>
<getData entity="ProductAttributeOptionGetter" index="2" stepKey="getConfigAttributeOption2">
<requiredEntity createDataKey="createConfigProductAttribute"/>
</getData>

<createData entity="ApiSimpleProductWithPrice50" stepKey="createConfigChildProduct1">
<requiredEntity createDataKey="createConfigProductAttribute"/>
<requiredEntity createDataKey="getConfigAttributeOption1"/>
</createData>
<createData entity="ApiSimpleProductWithPrice60" stepKey="createConfigChildProduct2">
<requiredEntity createDataKey="createConfigProductAttribute"/>
<requiredEntity createDataKey="getConfigAttributeOption2"/>
</createData>

<createData entity="ConfigurableProductTwoOptions" stepKey="createConfigProductOption">
<requiredEntity createDataKey="createConfigProduct"/>
<requiredEntity createDataKey="createConfigProductAttribute"/>
<requiredEntity createDataKey="getConfigAttributeOption1"/>
<requiredEntity createDataKey="getConfigAttributeOption2"/>
</createData>
<createData entity="ConfigurableProductAddChild" stepKey="createConfigProductAddChild1">
<requiredEntity createDataKey="createConfigProduct"/>
<requiredEntity createDataKey="createConfigChildProduct1"/>
</createData>
<createData entity="ConfigurableProductAddChild" stepKey="createConfigProductAddChild2">
<requiredEntity createDataKey="createConfigProduct"/>
<requiredEntity createDataKey="createConfigChildProduct2"/>
</createData>

<createData entity="MsrpEnableMAP" stepKey="enableMAP"/>
<magentoCLI command="config:set currency/options/allow EUR,USD" stepKey="setCurrencyAllow"/>
</before>
<after>

<deleteData createDataKey="createCategory" stepKey="deleteCategory"/>
<deleteData createDataKey="createConfigProduct" stepKey="deleteConfigProduct"/>
<deleteData createDataKey="createConfigChildProduct1" stepKey="deleteConfigChildProduct1"/>
<deleteData createDataKey="createConfigChildProduct2" stepKey="deleteConfigChildProduct2"/>
<deleteData createDataKey="createConfigProductAttribute" stepKey="deleteConfigProductAttribute"/>
<createData entity="MsrpDisableMAP" stepKey="disableMAP"/>
<magentoCLI command="config:set currency/options/allow USD" stepKey="setCurrencyAllow"/>
<actionGroup ref="AdminLogoutActionGroup" stepKey="logoutOfAdmin"/>
</after>

<actionGroup ref="AdminProductPageOpenByIdActionGroup" stepKey="goToFirstChildProductEditPage">
<argument name="productId" value="$$createConfigChildProduct1.id$$"/>
</actionGroup>
<waitForPageLoad stepKey="waitForProductPageLoad"/>
<actionGroup ref="AdminSetAdvancedPricingActionGroup" stepKey="setAdvancedPricingFirst">
<argument name="advancedPrice" value="100"/>
</actionGroup>

<actionGroup ref="AdminProductPageOpenByIdActionGroup" stepKey="goToSecondChildProductEditPage">
<argument name="productId" value="$$createConfigChildProduct2.id$$"/>
</actionGroup>
<waitForPageLoad stepKey="waitForProductPageLoad1"/>
<actionGroup ref="AdminSetAdvancedPricingActionGroup" stepKey="setAdvancedPricingSecond">
<argument name="advancedPrice" value="100"/>
</actionGroup>

<actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache">
<argument name="tags" value=""/>
</actionGroup>

<actionGroup ref="OpenStoreFrontProductPageActionGroup" stepKey="navigateToProduct">
<argument name="productUrlKey" value="$$createConfigProduct.custom_attributes[url_key]$$"/>
</actionGroup>

<actionGroup ref="StorefrontSwitchCurrencyActionGroup" stepKey="switchEURCurrency">
<argument name="currency" value="EUR"/>
</actionGroup>

<selectOption selector="{{StorefrontProductInfoMainSection.productAttributeOptionsSelectButton}}" userInput="$$getConfigAttributeOption1.value$$" stepKey="selectFirstOption"/>
<waitForElement selector="{{StorefrontProductInfoMainSection.mapPrice}}" stepKey="waitForLoad"/>
<grabTextFrom selector="{{StorefrontProductInfoMainSection.mapPrice}}" stepKey="grabProductMapPrice"/>
<assertNotEquals stepKey="assertProductMapPrice">
<actualResult type="const">($grabProductMapPrice)</actualResult>
<expectedResult type="string">€100.00</expectedResult>
</assertNotEquals>
</test>
</tests>
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@
<description>Assert category grid page image column a specific category</description>
</annotations>

<seeElement selector="{{AdminMediaGalleryCatalogUiCategoryGridSection.image(file)}}" stepKey="assertImageColumn"/>
<grabAttributeFrom selector="{{AdminMediaGalleryCatalogUiCategoryGridSection.image}}" userInput="src"
stepKey="getImageSrc"/>
<assertStringContainsString stepKey="assertImageSrc">
<actualResult type="string">{$getImageSrc}</actualResult>
<expectedResult type="string">{{file}}</expectedResult>
</assertStringContainsString>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<section name="AdminMediaGalleryCatalogUiCategoryGridSection">
<element name="clearFilters" type="button" selector=".admin__data-grid-header [data-action='grid-filter-reset']" timeout="30"/>
<element name="activeFilterPlaceholder" type="text" selector="//div[@class='admin__current-filters-list-wrap']//li//span[contains(text(), '{{filterPlaceholder}}')]" parameterized="true"/>
<element name="image" type="text" selector="//tr//td[count(//div[@data-role='grid-wrapper']//tr//th[contains(., 'Image')]/preceding-sibling::th) +1]//img[contains(@src, '{{file}}')]" parameterized="true"/>
<element name="image" type="text" selector="//tr//td[count(//div[@data-role='grid-wrapper']//tr//th[contains(., 'Image')]/preceding-sibling::th) +1]//img"/>
<element name="columnValue" type="text" selector="//tr//td[count(//div[@data-role='grid-wrapper']//tr//th[contains(., '{{columnName}}')]/preceding-sibling::th) +1 ]//div" parameterized="true"/>
<element name="edit" type="button" selector="//tr[td//text()[contains(., '{{categoryName}}')]]//td[count(//div[@data-role='grid-wrapper']//tr//th[contains(., 'Action')]/preceding-sibling::th) +1 ]//*[text()='{{actionButton}}']" parameterized="true"/>
</section>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
<test name="AdminMediaGalleryCatalogUiVerifyUsedInLinkCategoryGridTest">
<annotations>
<skip>
<issueId value="https://github.com/magento/adobe-stock-integration/issues/1794"/>
</skip>
<features value="AdminMediaGalleryCategoryGrid"/>
<useCaseId value="https://github.com/magento/adobe-stock-integration/issues/1503"/>
<title value="User can open each entity the asset is associated with in a separate tab to manage association"/>
Expand All @@ -26,19 +23,30 @@
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>
</before>
<after>
<actionGroup ref="AdminEnhancedMediaGalleryEnableMassActionModeActionGroup" stepKey="enableMassActionToDeleteImages"/>
<actionGroup ref="AdminEnhancedMediaGallerySelectImageForMassActionActionGroup" stepKey="selectSecondImageToDelete">
<argument name="imageName" value="{{UpdatedImageDetails.title}}"/>
<actionGroup ref="ResetAdminDataGridToDefaultViewActionGroup" stepKey="resetAdminDataGridToDefaultView"/>
<actionGroup ref="AdminMediaGalleryFolderSelectActionGroup" stepKey="selectFolderForDelete">
<argument name="name" value="categoryImage"/>
</actionGroup>
<actionGroup ref="AdminMediaGalleryFolderDeleteActionGroup" stepKey="deleteFolder"/>
<actionGroup ref="AdminMediaGalleryAssertFolderDoesNotExistActionGroup" stepKey="assertFolderWasDeleted">
<argument name="name" value="categoryImage"/>
</actionGroup>
<actionGroup ref="AdminEnhancedMediaGalleryClickDeleteImagesButtonActionGroup" stepKey="clikDeleteSelectedButton"/>
<actionGroup ref="AdminEnhancedMediaGalleryConfirmDeleteImagesActionGroup" stepKey="deleteImages"/>
</after>

<actionGroup ref="AdminOpenCategoryPageActionGroup" stepKey="openCategoryPage"/>
<actionGroup ref="AdminCategoriesOpenCategoryActionGroup" stepKey="openCategory">
<argument name="category" value="$$category$$"/>
</actionGroup>
<actionGroup ref="AdminOpenMediaGalleryFromCategoryImageUploaderActionGroup" stepKey="openMediaGalleryFromImageUploader"/>
<waitForLoadingMaskToDisappear stepKey="waitForLoadingMaskToDisappear" />
<actionGroup ref="ResetAdminDataGridToDefaultViewActionGroup" stepKey="resetCategoryImageGalleryGridToDefaultView"/>
<actionGroup ref="ClearFiltersAdminDataGridActionGroup" stepKey="clearFilter"/>
<actionGroup ref="AdminMediaGalleryOpenNewFolderFormActionGroup" stepKey="openNewFolderForm"/>
<actionGroup ref="AdminMediaGalleryCreateNewFolderActionGroup" stepKey="createCategoryImageFolder">
<argument name="name" value="categoryImage"/>
</actionGroup>
<actionGroup ref="AdminMediaGalleryAssertFolderNameActionGroup" stepKey="assertCategoryImageFolderCreated">
<argument name="name" value="categoryImage"/>
</actionGroup>
<actionGroup ref="AdminEnhancedMediaGalleryUploadImageActionGroup" stepKey="uploadImage">
<argument name="image" value="ImageUpload"/>
</actionGroup>
Expand All @@ -51,6 +59,10 @@
<actionGroup ref="AdminMediaGalleryClickAddSelectedActionGroup" stepKey="clickAddSelectedCategoryImage"/>
<actionGroup ref="AdminSaveCategoryActionGroup" stepKey="saveCategory"/>
<actionGroup ref="AdminOpenMediaGalleryFromCategoryImageUploaderActionGroup" stepKey="openMediaGalleryFromImageUploaderToVerifyLink"/>
<actionGroup ref="AdminMediaGalleryFolderSelectActionGroup" stepKey="selectCategoryImageFolder">
<argument name="name" value="categoryImage"/>
</actionGroup>
<waitForLoadingMaskToDisappear stepKey="waitForLoadingMaskToDisappear2"/>
<actionGroup ref="AdminEnhancedMediaGalleryViewImageDetails" stepKey="openViewImageDetails"/>
<actionGroup ref="AdminEnhancedMediaGalleryClickEntityUsedInActionGroup" stepKey="clickUsedInCategories">
<argument name="entityName" value="Categories"/>
Expand Down Expand Up @@ -80,13 +92,15 @@
<actionGroup ref="AssertAdminMediaGalleryAssetFilterPlaceHolderActionGroup" stepKey="assertFilterAppliedAfterUrlFilterApplier">
<argument name="filterPlaceholder" value="{{UpdatedImageDetails.title}}"/>
</actionGroup>
<actionGroup ref="ResetAdminDataGridToDefaultViewActionGroup" stepKey="resetAdminDataGridToDefaultView"/>
<actionGroup ref="ResetAdminDataGridToDefaultViewActionGroup" stepKey="secondResetAdminDataGridToDefaultView"/>

<deleteData createDataKey="category" stepKey="deleteCategory"/>
<actionGroup ref="AdminOpenStandaloneMediaGalleryActionGroup" stepKey="openMediaGallery"/>
<actionGroup ref="AdminEnhancedMediaGalleryViewImageDetails" stepKey="openViewImageDetailsToVerfifyEmptyUsedIn"/>
<actionGroup ref="AdminMediaGalleryFolderSelectActionGroup" stepKey="openCategoryImageFolder">
<argument name="name" value="categoryImage"/>
</actionGroup>
<actionGroup ref="AdminEnhancedMediaGalleryViewImageDetails" stepKey="openViewImageDetailsToVerifyEmptyUsedIn"/>
<actionGroup ref="AssertAdminEnhancedMediaGalleryUsedInSectionNotDisplayedActionGroup" stepKey="assertThereIsNoUsedInSection"/>
<actionGroup ref="AdminEnhancedMediaGalleryCloseViewDetailsActionGroup" stepKey="closeDetails"/>

</test>
</tests>
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?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="AssertAdminMediaGalleryContextMenuOpenedActionGroup">
<annotations>
<description>Verify that context menu is closed in Media Gallery.</description>
</annotations>
<dontSeeElement selector="{{AdminEnhancedMediaGalleryImageActionsSection.contextMenuItem}}" stepKey="verifyContextMenuIsClosed" />
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<data key="fileName">png</data>
<data key="extension">png</data>
</entity>
<entity name="ImageUploadGif" type="uploadImage">
<entity name="ImageUploadGif" type="uploadImage">
<data key="title" unique="suffix">Image1</data>
<data key="file_type">Upload File</data>
<data key="value">gif.gif</data>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
<section name="AdminEnhancedMediaGalleryImageActionsSection">
<element name="openContextMenu" type="button" selector=".three-dots"/>
<element name="contextMenuItem" type="block" selector="//div[@class='media-gallery-image']//ul[@class='action-menu _active']//li//a[@class='action-menu-item']"/>
<element name="viewDetails" type="button" selector="[data-ui-id='action-image-details']"/>
<element name="delete" type="button" selector="[data-ui-id='action-delete']"/>
<element name="edit" type="button" selector="[data-ui-id='action-edit']"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ define([
deleteImageUrl: 'media_gallery/image/delete',
addSelectedBtnSelector: '#add_selected',
deleteSelectedBtnSelector: '#delete_selected',
gridSelector: '[data-id="media-gallery-masonry-grid"]',
selected: null,
allowedActions: [],
fields: {
Expand Down Expand Up @@ -281,6 +282,7 @@ define([
*/
addMessage: function (code, message) {
this.messages().add(code, message);
this.closeContextMenu();
this.scrollToMessageContent();
this.messages().scheduleCleanup();
},
Expand All @@ -298,6 +300,13 @@ define([
}
},

/**
* Action to close the context menu in media gallery.
*/
closeContextMenu: function () {
$(this.gridSelector).click();
},

/**
* Scroll to the top of media gallery page
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<?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="AdminSetAdvancedPricingActionGroup">
<annotations>
<description>Set advanced pricing and Save product on the Admin Product creation/edit page.</description>
</annotations>
<arguments>
<argument name="advancedPrice" type="string"/>
</arguments>

<click selector="{{AdminProductFormSection.advancedPricingLink}}" stepKey="clickOnAdvancedPricingButton"/>
<waitForElement selector="{{AdminProductFormAdvancedPricingSection.msrp}}" stepKey="waitForMsrp"/>
<fillField selector="{{AdminProductFormAdvancedPricingSection.msrp}}" userInput="{{advancedPrice}}" stepKey="setMsrpForFirstChildProduct"/>
<click selector="{{AdminProductFormAdvancedPricingSection.doneButton}}" stepKey="clickDoneButton"/>
<scrollToTopOfPage stepKey="scrollTopPageProduct"/>
<waitForElementVisible selector="{{AdminProductFormActionSection.saveButton}}" stepKey="waitForSaveProductButton"/>
<click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="clickSaveProduct"/>
<waitForElementVisible selector="{{AdminMessagesSection.success}}" stepKey="waitProductSaveSuccessMessage"/>
<see selector="{{AdminMessagesSection.success}}" userInput="You saved the product." stepKey="seeSaveConfirmation"/>
</actionGroup>
</actionGroups>
Loading

0 comments on commit 70223c0

Please sign in to comment.