Skip to content

Commit

Permalink
Merge branch '2.4-develop' of github.com:magento/magento2 into ASI-18…
Browse files Browse the repository at this point in the history
…30-stabilize-failing-mftf-tests-in-media-gallery-catalog-ui
  • Loading branch information
joweecaquicla committed Sep 18, 2020
2 parents 53c6998 + 4aa2f11 commit 5a7fc3b
Show file tree
Hide file tree
Showing 127 changed files with 2,254 additions and 387 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
<!-- Reset admin order filter -->
<comment userInput="Reset admin order filter" stepKey="resetAdminOrderFilter"/>
<actionGroup ref="AdminOrdersGridClearFiltersActionGroup" stepKey="clearOrderFilters"/>
<waitForLoadingMaskToDisappear stepKey="waitForLoadingOrderGrid"/>
<magentoCLI command="config:set admin/dashboard/enable_charts 0" stepKey="setDisableChartsAsDefault"/>
<deleteData createDataKey="createProduct" stepKey="deleteProduct"/>
<deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/>
Expand Down Expand Up @@ -84,8 +83,7 @@
<comment userInput="Create invoice" stepKey="createInvoice"/>

<actionGroup ref="AdminOrderGridClickFirstRowActionGroup" stepKey="clickOrderRow"/>
<click selector="{{AdminOrderDetailsMainActionsSection.invoice}}" stepKey="clickInvoiceButton"/>
<waitForPageLoad stepKey="waitForInvoicePageToLoad"/>
<actionGroup ref="AdminClickInvoiceButtonOrderViewActionGroup" stepKey="clickInvoiceButton"/>
<see selector="{{AdminHeaderSection.pageTitle}}" userInput="New Invoice" stepKey="seeNewInvoiceInPageTitle" after="clickInvoiceButton"/>
<see selector="{{AdminInvoiceTotalSection.total('Subtotal')}}" userInput="$150.00" stepKey="seeCorrectGrandTotal"/>
<actionGroup ref="AdminInvoiceClickSubmitActionGroup" stepKey="clickSubmitInvoice"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,15 @@
<actionGroup ref="CliCacheCleanActionGroup" stepKey="cleanCache">
<argument name="tags" value="config"/>
</actionGroup>
<magentoCLI command="setup:static-content:deploy -f" stepKey="deployStaticContent"/>
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>
</before>
<after>
<magentoCLI command="config:set {{MinifyJavaScriptFilesDisableConfigData.path}} {{MinifyJavaScriptFilesDisableConfigData.value}}" stepKey="disableJsMinification"/>
<actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/>
</after>
<see userInput="Dashboard" selector="{{AdminHeaderSection.pageTitle}}" stepKey="seeDashboardTitle"/>
<waitForPageLoad stepKey="waitForPageLoadOnDashboard"/>
<see userInput="Dashboard" selector="{{AdminHeaderSection.pageTitle}}" stepKey="seeDashboardTitle"/>
<actionGroup ref="AssertAdminSuccessLoginActionGroup" stepKey="loggedInSuccessfully"/>
<actionGroup ref="AssertAdminPageIsNot404ActionGroup" stepKey="dontSee404Page"/>
</test>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,7 @@

<!--Add another bundle option with 2 items-->
<!--Go to bundle product creation page-->
<amOnPage url="{{AdminCatalogProductPage.url}}" stepKey="GoToCatalogProductPage"/>
<waitForPageLoad stepKey="WaitForPageToLoad"/>
<actionGroup ref="AdminOpenCatalogProductPageActionGroup" stepKey="goToCatalogProductPage"/>
<conditionalClick selector="{{AdminProductFiltersSection.filtersClear}}" dependentSelector="{{AdminProductFiltersSection.filtersClear}}" visible="true" stepKey="ClickOnButtonToRemoveFiltersIfPresent"/>
<waitForPageLoad stepKey="WaitForClear"/>
<actionGroup ref="FilterProductGridByNameActionGroup" stepKey="filterBundleProductOptionsDownToName">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,7 @@

<!--Testing that price appears correctly in admin catalog-->
<!--Set filter to product name-->
<amOnPage url="{{AdminCatalogProductPage.url}}" stepKey="GoToCatalogProductPage"/>
<waitForPageLoad stepKey="WaitForPageToLoad"/>
<actionGroup ref="AdminOpenCatalogProductPageActionGroup" stepKey="goToCatalogProductPage"/>
<actionGroup ref="FilterProductGridByNameActionGroup" stepKey="filterBundleProductOptionsDownToName">
<argument name="product" value="BundleProduct"/>
</actionGroup>
Expand All @@ -75,8 +74,7 @@

<!--Testing that price appears correctly in admin catalog-->
<!--Set filter to product name-->
<amOnPage url="{{AdminCatalogProductPage.url}}" stepKey="GoToCatalogProductPage2"/>
<waitForPageLoad stepKey="WaitForPageToLoad2"/>
<actionGroup ref="AdminOpenCatalogProductPageActionGroup" stepKey="goToCatalogProductPage2"/>
<actionGroup ref="FilterProductGridByNameActionGroup" stepKey="filterBundleProductOptionsDownToName2">
<argument name="product" value="BundleProduct"/>
</actionGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,7 @@
</actionGroup>

<!--Filter catalog-->
<amOnPage url="{{AdminCatalogProductPage.url}}" stepKey="goToCatalogProductPage"/>
<waitForPageLoad stepKey="WaitForPageToLoad"/>
<actionGroup ref="AdminOpenCatalogProductPageActionGroup" stepKey="goToCatalogProductPage"/>
<actionGroup ref="FilterProductGridByNameActionGroup" stepKey="filterBundleProductOptionsDownToName">
<argument name="product" value="BundleProduct"/>
</actionGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,7 @@
<actionGroup ref="AdminProductFormSaveActionGroup" stepKey="clickSaveButton"/>
<seeElement selector="{{AdminCategoryMessagesSection.SuccessMessage}}" stepKey="messageYouSavedTheProductIsShown"/>

<!--Go to catalog deletion page-->
<amOnPage url="{{AdminCatalogProductPage.url}}" stepKey="goToCatalogPage"/>
<waitForPageLoad stepKey="Loading"/>
<actionGroup ref="AdminOpenCatalogProductPageActionGroup" stepKey="goToCatalogPage"/>

<!--Apply Name Filter-->
<actionGroup ref="FilterProductGridByNameActionGroup" stepKey="filterBundleProductOptionsDownToName">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,7 @@

<!--Testing that price appears correctly in admin catalog-->
<!--Set filter to product name-->
<amOnPage url="{{AdminCatalogProductPage.url}}" stepKey="GoToCatalogProductPage"/>
<waitForPageLoad stepKey="WaitForPageToLoad"/>
<actionGroup ref="AdminOpenCatalogProductPageActionGroup" stepKey="goToCatalogProductPage"/>
<conditionalClick selector="{{AdminProductFiltersSection.filtersClear}}" dependentSelector="{{AdminProductFiltersSection.filtersClear}}" visible="true" stepKey="ClickOnButtonToRemoveFiltersIfPresent"/>
<waitForPageLoad stepKey="WaitForClear"/>
<actionGroup ref="FilterProductGridByNameActionGroup" stepKey="filterBundleProductOptionsDownToName">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@
<after>
<actionGroup ref="AdminLogoutActionGroup" stepKey="amOnLogoutPage"/>
</after>
<amOnPage url="{{AdminCatalogProductPage.url}}" stepKey="GoToCatalogProductPage"/>
<waitForPageLoad stepKey="WaitForPageToLoad"/>
<actionGroup ref="AdminOpenCatalogProductPageActionGroup" stepKey="goToCatalogProductPage"/>
<!--Selecting new bundle product-->
<actionGroup ref="GoToCreateProductPageActionGroup" stepKey="goToCreateBundleProduct">
<argument name="product" value="BundleProduct"/>
Expand Down
8 changes: 6 additions & 2 deletions app/code/Magento/Catalog/Model/ProductRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@
use Magento\Framework\Exception\ValidatorException;

/**
* Product Repository.
* @inheritdoc
*
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
* @SuppressWarnings(PHPMD.TooManyFields)
*/
Expand Down Expand Up @@ -543,7 +544,9 @@ public function save(ProductInterface $product, $saveOptions = false)
if (!$ignoreLinksFlag && $ignoreLinksFlag !== null) {
$productLinks = $product->getProductLinks();
}
$productDataArray['store_id'] = (int)$this->storeManager->getStore()->getId();
if (!isset($productDataArray['store_id'])) {
$productDataArray['store_id'] = (int) $this->storeManager->getStore()->getId();
}
$product = $this->initializeProductData($productDataArray, empty($existingProduct));

$this->processLinks($product, $productLinks);
Expand Down Expand Up @@ -735,6 +738,7 @@ private function getCollectionProcessor()
{
if (!$this->collectionProcessor) {
$this->collectionProcessor = \Magento\Framework\App\ObjectManager::getInstance()->get(
// phpstan:ignore "Class Magento\Catalog\Model\Api\SearchCriteria\ProductCollectionProcessor not found."
\Magento\Catalog\Model\Api\SearchCriteria\ProductCollectionProcessor::class
);
}
Expand Down
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.
*/
-->

<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
<actionGroup name="AdminOpenCatalogProductPageActionGroup">
<annotations>
<description>Open page with product grid.</description>
</annotations>

<amOnPage url="{{AdminCatalogProductPage.url}}" stepKey="openCatalogProductPage"/>
<waitForPageLoad stepKey="waitForPageToLoad"/>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
<actionGroup name="GoToProductCatalogPageActionGroup">
<actionGroup name="GoToProductCatalogPageActionGroup" deprecated="Use AdminOpenCatalogProductPageActionGroup instead.">
<annotations>
<description>Goes to the Admin Products grid page.</description>
</annotations>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
<element name="selectFromGalleryButton" type="button" selector="//*[@class='file-uploader-area']/label[text()='Select from Gallery']"/>
<element name="uploadImageFile" type="input" selector=".file-uploader-area>input"/>
<element name="imageFileName" type="text" selector=".file-uploader-filename"/>
<element name="imageFileMeta" type="text" selector=".file-uploader-meta"/>
<element name="removeImageButton" type="button" selector=".file-uploader-summary .action-remove"/>
<element name="AddCMSBlock" type="select" selector="//*[@name='landing_page']"/>
<element name="description" type="input" selector="//*[@name='description']"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<createData entity="_defaultCategory" stepKey="createPreReqCategory"/>
</before>
<after>
<actionGroup ref="GoToProductCatalogPageActionGroup" stepKey="goToProductCatalogPage"/>
<actionGroup ref="AdminOpenCatalogProductPageActionGroup" stepKey="goToProductCatalogPage"/>
<actionGroup ref="DeleteProductUsingProductGridActionGroup" stepKey="deleteSimpleProduct">
<argument name="product" value="_defaultProduct"/>
</actionGroup>
Expand All @@ -49,7 +49,7 @@
<actionGroup ref="SaveProductFormActionGroup" stepKey="saveProductForm"/>
<!-- Check that product was added with implicit type change -->
<comment stepKey="beforeVerify" userInput="Verify Product Type Assigned Correctly"/>
<actionGroup ref="GoToProductCatalogPageActionGroup" stepKey="goToProductCatalogPage"/>
<actionGroup ref="AdminOpenCatalogProductPageActionGroup" stepKey="goToProductCatalogPage"/>
<actionGroup ref="ResetProductGridToDefaultViewActionGroup" stepKey="resetSearch"/>
<actionGroup ref="FilterProductGridByNameActionGroup" stepKey="searchForProduct">
<argument name="product" value="_defaultProduct"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
<actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/>
</after>

<actionGroup ref="GoToProductCatalogPageActionGroup" stepKey="goToProductCatalogPage"/>
<actionGroup ref="AdminOpenCatalogProductPageActionGroup" stepKey="goToProductCatalogPage"/>
<actionGroup ref="GoToCreateProductPageActionGroup" stepKey="goToCreateProduct">
<argument name="product" value="SimpleProduct"/>
</actionGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,7 @@
<see selector="{{AdminIndexManagementSection.successMessage}}" userInput="You saved the configuration." stepKey="seeMessage"/>

<!-- Navigate to the Catalog > Products -->
<amOnPage url="{{AdminCatalogProductPage.url}}" stepKey="onCatalogProductPage"/>
<waitForPageLoad stepKey="waitForProductPage"/>
<actionGroup ref="AdminOpenCatalogProductPageActionGroup" stepKey="onCatalogProductPage"/>

<!-- Click on <product1>: Product page opens-->
<actionGroup ref="FilterProductGridByNameActionGroup" stepKey="filterProduct">
Expand Down Expand Up @@ -158,8 +157,7 @@
<actionGroup ref="AdminLoginActionGroup" stepKey="LoginAdmin"/>

<!-- Navigate to the Catalog > Products: Navigate to the Catalog>Products -->
<amOnPage url="{{AdminCatalogProductPage.url}}" stepKey="amOnProductPage"/>
<waitForPageLoad stepKey="waitForProductsPage"/>
<actionGroup ref="AdminOpenCatalogProductPageActionGroup" stepKey="amOnProductPage"/>

<!-- Click on <product1> -->
<actionGroup ref="FilterAndSelectProductActionGroup" stepKey="openSimpleProduct">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
<actionGroup ref="SaveProductFormActionGroup" stepKey="saveProductForm"/>
<!--Assert simple product on Admin product page grid-->
<comment userInput="Assert simple product in Admin product page grid" stepKey="commentAssertProductOnAdmin"/>
<amOnPage url="{{AdminCatalogProductPage.url}}" stepKey="goToCatalogSimpleProductPage"/>
<actionGroup ref="AdminOpenCatalogProductPageActionGroup" stepKey="goToCatalogSimpleProductPage"/>
<actionGroup ref="FilterProductGridBySku2ActionGroup" stepKey="filterSimpleProductGridBySku">
<argument name="sku" value="$$createProduct.sku$$"/>
</actionGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
<actionGroup ref="SaveProductFormActionGroup" stepKey="saveDownloadableProductForm"/>
<!--Assert downloadable product on Admin product page grid-->
<comment userInput="Assert configurable product in Admin product page grid" stepKey="commentAssertDownloadableProductOnAdmin"/>
<amOnPage url="{{AdminCatalogProductPage.url}}" stepKey="goToCatalogProductPage"/>
<actionGroup ref="AdminOpenCatalogProductPageActionGroup" stepKey="goToCatalogProductPage"/>
<actionGroup ref="FilterProductGridBySku2ActionGroup" stepKey="filterProductGridBySku">
<argument name="sku" value="$$createProduct.sku$$"/>
</actionGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
<actionGroup ref="AdminDeleteWebsiteActionGroup" stepKey="deleteTestWebsite">
<argument name="websiteName" value="{{customWebsite.name}}"/>
</actionGroup>
<actionGroup ref="GoToProductCatalogPageActionGroup" stepKey="goToProductCatalogPage"/>
<actionGroup ref="AdminOpenCatalogProductPageActionGroup" stepKey="goToProductCatalogPage"/>
<actionGroup ref="ResetProductGridToDefaultViewActionGroup" stepKey="resetProductGridColumnsInitial"/>
<actionGroup ref="ResetWebUrlOptionsActionGroup" stepKey="resetUrlOption"/>
<actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex">
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
<?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="AdminUpdateCategoryWithProductsDefaultSortingTest">
<annotations>
<features value="Catalog"/>
<stories value="Update categories"/>
<title value="Update category, sort products by default sorting"/>
<description value="Login as admin, update category and sort products"/>
<testCaseId value="MC-25667"/>
<severity value="CRITICAL"/>
<group value="catalog"/>
<group value="mtf_migrated"/>
</annotations>
<before>
<createData entity="defaultSimpleProduct" stepKey="simpleProduct" />
<createData entity="_defaultCategory" stepKey="createCategory"/>
<actionGroup ref="AdminLoginActionGroup" stepKey="loginToAdminPanel"/>
</before>
<after>
<deleteData createDataKey="createCategory" stepKey="deleteCategory"/>
<deleteData createDataKey="simpleProduct" stepKey="deleteSimpleProduct"/>
<actionGroup ref="AdminLogoutActionGroup" stepKey="logoutFromAdmin"/>
<magentoCron groups="index" stepKey="reindexInvalidatedIndices"/>
</after>

<!--Open Category Page-->
<actionGroup ref="GoToAdminCategoryPageByIdActionGroup" stepKey="goToAdminCategoryPage">
<argument name="id" value="$createCategory.id$"/>
</actionGroup>

<!--Update Product Display Setting-->
<waitForElementVisible selector="{{AdminCategoryDisplaySettingsSection.settingsHeader}}" stepKey="waitForDisplaySettingsSection"/>
<conditionalClick selector="{{AdminCategoryDisplaySettingsSection.settingsHeader}}" dependentSelector="{{AdminCategoryDisplaySettingsSection.displayMode}}" visible="false" stepKey="openDisplaySettingsSection"/>
<waitForElementVisible selector="{{CategoryDisplaySettingsSection.productListCheckBox}}" stepKey="waitForAvailableProductListCheckbox"/>
<click selector="{{CategoryDisplaySettingsSection.productListCheckBox}}" stepKey="enableTheAvailableProductList"/>
<selectOption selector="{{CategoryDisplaySettingsSection.productList}}" parameterArray="['Product Name', 'Price']" stepKey="selectPrice"/>
<waitForElementVisible selector="{{CategoryDisplaySettingsSection.defaultProductLisCheckBox}}" stepKey="waitForDefaultProductList"/>
<click selector="{{CategoryDisplaySettingsSection.defaultProductLisCheckBox}}" stepKey="enableTheDefaultProductList"/>
<selectOption selector="{{CategoryDisplaySettingsSection.defaultProductList}}" userInput="name" stepKey="selectProductName"/>

<!--Add Products in Category-->
<actionGroup ref="AdminCategoryAssignProductActionGroup" stepKey="assignSimpleProductToCategory">
<argument name="productSku" value="$simpleProduct.sku$"/>
</actionGroup>
<actionGroup ref="AdminSaveCategoryFormActionGroup" stepKey="saveCategory"/>

<!--Verify Category Title-->
<see selector="{{AdminCategoryContentSection.categoryPageTitle}}" userInput="{{_defaultCategory.name}}" stepKey="seeCategoryNamePageTitle" />

<!--Verify Category in store front page-->
<amOnPage url="{{StorefrontCategoryPage.url($createCategory.custom_attributes[url_key]$)}}" stepKey="openStorefrontCategoryPage"/>

<!--Verify Product in Category-->
<actionGroup ref="AssertStorefrontProductIsPresentOnCategoryPageActionGroup" stepKey="assertSimpleProductOnCategoryPage">
<argument name="productName" value="$simpleProduct.name$"/>
</actionGroup>

<!--Verify product name and sku on Store Front-->
<actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKeyActionGroup" stepKey="assertProductOnStorefrontProductPage">
<argument name="product" value="$simpleProduct$"/>
</actionGroup>
</test>
</tests>

Loading

0 comments on commit 5a7fc3b

Please sign in to comment.