Skip to content

Commit 4aa2f11

Browse files
🔃 [Magento Community Engineering] Community Contributions - 2.4-develop daily delivery
Accepted Community Pull Requests: - #30074: add action group for AdminAdobeStockInsertRenditionImageFromGalleryFileSizeTest (by @engcom-Golf) - #30042: #1827: Improve AdminMediaGalleryUploadCategoryImageTest (by @joweecaquicla) - #29834: [MFTF] removed redundant action group (by @Usik2203) - #29962: [MFTF] Add AdminClickInvoiceButtonIntoOrderActionGroup (by @Usik2203) - #29931: [MFTF] add new AdminOpenCatalogProductPageActionGroup (by @Usik2203) - #29835: [MFTF] use action group to go to customer account (by @Usik2203) - #27698: [MFTF] Cancel created orders after checks on frontend (by @elevinskii) - #26470: #7720 (by @engcom-Charlie) Fixed GitHub Issues: - #29838: [Issue] [MFTF] removed redundant action group (reported by @m2-assistant[bot]) has been fixed in #29834 by @Usik2203 in 2.4-develop branch Related commits: 1. 04aefed 2. c024003 3. b3bab92 4. f164033 5. 0305290 6. 6df880a 7. 255d035 - #29982: [Issue] [WIP][MFTF] Add AdminClickInvoiceButtonIntoOrderActionGroup (reported by @m2-assistant[bot]) has been fixed in #29962 by @Usik2203 in 2.4-develop branch Related commits: 1. 3dd3bb9 2. e406c82 3. 18ffc03 4. 5ced4ba 5. ca45436 6. 4fb0102 7. 1df23c8 - #29941: [Issue] [MFTF] add new AdminOpenCatalogProductPageActionGroup (reported by @m2-assistant[bot]) has been fixed in #29931 by @Usik2203 in 2.4-develop branch Related commits: 1. b8ce61b 2. 832bb01 3. 547f090 4. bd5b228 5. 971df44 - #29842: [Issue] [MFTF] use action group to go to customer account (reported by @m2-assistant[bot]) has been fixed in #29835 by @Usik2203 in 2.4-develop branch Related commits: 1. 18d82a3 2. 93995c8 3. 8690e43 4. 2d100fd 5. b5d1810 - #28324: [Issue] [MFTF] Cancel created orders after checks on frontend (reported by @m2-backlog[bot]) has been fixed in #27698 by @elevinskii in 2.4-develop branch Related commits: 1. 2b86774 2. 83a4f09 3. c66d517 4. 24f9954 5. fd3e813 6. 939ced0 7. 59c16ea 8. 756f2dc 9. d63b5d8 10. 8895db4 11. f2334ed 12. 14ed4b7 13. af6569f 14. da7af27 - #7720: Product Repository saves attribute values for existing product always on "Default Store Level" (reported by @itaymesh) has been fixed in #26470 by @engcom-Charlie in 2.4-develop branch Related commits: 1. 042df41 2. a039ff4 3. 13af48a 4. a5d7355 5. 8c8949d 6. 2c15517 7. 156b3c2 8. 347001f 9. 28b5d9d 10. a892a19 11. 9b9d123
2 parents 711b09c + 3b2eb0f commit 4aa2f11

File tree

65 files changed

+358
-99
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

65 files changed

+358
-99
lines changed

app/code/Magento/Backend/Test/Mftf/Test/AdminDashboardWithChartsTest.xml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@
3434
<!-- Reset admin order filter -->
3535
<comment userInput="Reset admin order filter" stepKey="resetAdminOrderFilter"/>
3636
<actionGroup ref="AdminOrdersGridClearFiltersActionGroup" stepKey="clearOrderFilters"/>
37-
<waitForLoadingMaskToDisappear stepKey="waitForLoadingOrderGrid"/>
3837
<magentoCLI command="config:set admin/dashboard/enable_charts 0" stepKey="setDisableChartsAsDefault"/>
3938
<deleteData createDataKey="createProduct" stepKey="deleteProduct"/>
4039
<deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/>
@@ -84,8 +83,7 @@
8483
<comment userInput="Create invoice" stepKey="createInvoice"/>
8584

8685
<actionGroup ref="AdminOrderGridClickFirstRowActionGroup" stepKey="clickOrderRow"/>
87-
<click selector="{{AdminOrderDetailsMainActionsSection.invoice}}" stepKey="clickInvoiceButton"/>
88-
<waitForPageLoad stepKey="waitForInvoicePageToLoad"/>
86+
<actionGroup ref="AdminClickInvoiceButtonOrderViewActionGroup" stepKey="clickInvoiceButton"/>
8987
<see selector="{{AdminHeaderSection.pageTitle}}" userInput="New Invoice" stepKey="seeNewInvoiceInPageTitle" after="clickInvoiceButton"/>
9088
<see selector="{{AdminInvoiceTotalSection.total('Subtotal')}}" userInput="$150.00" stepKey="seeCorrectGrandTotal"/>
9189
<actionGroup ref="AdminInvoiceClickSubmitActionGroup" stepKey="clickSubmitInvoice"/>

app/code/Magento/Bundle/Test/Mftf/Test/AdminAddBundleItemsTest.xml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,7 @@
8686

8787
<!--Add another bundle option with 2 items-->
8888
<!--Go to bundle product creation page-->
89-
<amOnPage url="{{AdminCatalogProductPage.url}}" stepKey="GoToCatalogProductPage"/>
90-
<waitForPageLoad stepKey="WaitForPageToLoad"/>
89+
<actionGroup ref="AdminOpenCatalogProductPageActionGroup" stepKey="goToCatalogProductPage"/>
9190
<conditionalClick selector="{{AdminProductFiltersSection.filtersClear}}" dependentSelector="{{AdminProductFiltersSection.filtersClear}}" visible="true" stepKey="ClickOnButtonToRemoveFiltersIfPresent"/>
9291
<waitForPageLoad stepKey="WaitForClear"/>
9392
<actionGroup ref="FilterProductGridByNameActionGroup" stepKey="filterBundleProductOptionsDownToName">

app/code/Magento/Bundle/Test/Mftf/Test/AdminAttributeSetSelectionTest.xml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,7 @@
5454

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

7675
<!--Testing that price appears correctly in admin catalog-->
7776
<!--Set filter to product name-->
78-
<amOnPage url="{{AdminCatalogProductPage.url}}" stepKey="GoToCatalogProductPage2"/>
79-
<waitForPageLoad stepKey="WaitForPageToLoad2"/>
77+
<actionGroup ref="AdminOpenCatalogProductPageActionGroup" stepKey="goToCatalogProductPage2"/>
8078
<actionGroup ref="FilterProductGridByNameActionGroup" stepKey="filterBundleProductOptionsDownToName2">
8179
<argument name="product" value="BundleProduct"/>
8280
</actionGroup>

app/code/Magento/Bundle/Test/Mftf/Test/AdminBasicBundleProductAttributesTest.xml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,7 @@
9696
</actionGroup>
9797

9898
<!--Filter catalog-->
99-
<amOnPage url="{{AdminCatalogProductPage.url}}" stepKey="goToCatalogProductPage"/>
100-
<waitForPageLoad stepKey="WaitForPageToLoad"/>
99+
<actionGroup ref="AdminOpenCatalogProductPageActionGroup" stepKey="goToCatalogProductPage"/>
101100
<actionGroup ref="FilterProductGridByNameActionGroup" stepKey="filterBundleProductOptionsDownToName">
102101
<argument name="product" value="BundleProduct"/>
103102
</actionGroup>

app/code/Magento/Bundle/Test/Mftf/Test/AdminDeleteABundleProductTest.xml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,7 @@
5858
<actionGroup ref="AdminProductFormSaveActionGroup" stepKey="clickSaveButton"/>
5959
<seeElement selector="{{AdminCategoryMessagesSection.SuccessMessage}}" stepKey="messageYouSavedTheProductIsShown"/>
6060

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

6563
<!--Apply Name Filter-->
6664
<actionGroup ref="FilterProductGridByNameActionGroup" stepKey="filterBundleProductOptionsDownToName">

app/code/Magento/Bundle/Test/Mftf/Test/BundleProductFixedPricingTest.xml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,7 @@
7676

7777
<!--Testing that price appears correctly in admin catalog-->
7878
<!--Set filter to product name-->
79-
<amOnPage url="{{AdminCatalogProductPage.url}}" stepKey="GoToCatalogProductPage"/>
80-
<waitForPageLoad stepKey="WaitForPageToLoad"/>
79+
<actionGroup ref="AdminOpenCatalogProductPageActionGroup" stepKey="goToCatalogProductPage"/>
8180
<conditionalClick selector="{{AdminProductFiltersSection.filtersClear}}" dependentSelector="{{AdminProductFiltersSection.filtersClear}}" visible="true" stepKey="ClickOnButtonToRemoveFiltersIfPresent"/>
8281
<waitForPageLoad stepKey="WaitForClear"/>
8382
<actionGroup ref="FilterProductGridByNameActionGroup" stepKey="filterBundleProductOptionsDownToName">

app/code/Magento/Bundle/Test/Mftf/Test/NewBundleProductSelectionTest.xml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,7 @@
2424
<after>
2525
<actionGroup ref="AdminLogoutActionGroup" stepKey="amOnLogoutPage"/>
2626
</after>
27-
<amOnPage url="{{AdminCatalogProductPage.url}}" stepKey="GoToCatalogProductPage"/>
28-
<waitForPageLoad stepKey="WaitForPageToLoad"/>
27+
<actionGroup ref="AdminOpenCatalogProductPageActionGroup" stepKey="goToCatalogProductPage"/>
2928
<!--Selecting new bundle product-->
3029
<actionGroup ref="GoToCreateProductPageActionGroup" stepKey="goToCreateBundleProduct">
3130
<argument name="product" value="BundleProduct"/>

app/code/Magento/Catalog/Model/ProductRepository.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@
3030
use Magento\Framework\Exception\ValidatorException;
3131

3232
/**
33-
* Product Repository.
33+
* @inheritdoc
34+
*
3435
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
3536
* @SuppressWarnings(PHPMD.TooManyFields)
3637
*/
@@ -543,7 +544,9 @@ public function save(ProductInterface $product, $saveOptions = false)
543544
if (!$ignoreLinksFlag && $ignoreLinksFlag !== null) {
544545
$productLinks = $product->getProductLinks();
545546
}
546-
$productDataArray['store_id'] = (int)$this->storeManager->getStore()->getId();
547+
if (!isset($productDataArray['store_id'])) {
548+
$productDataArray['store_id'] = (int) $this->storeManager->getStore()->getId();
549+
}
547550
$product = $this->initializeProductData($productDataArray, empty($existingProduct));
548551

549552
$this->processLinks($product, $productLinks);
@@ -735,6 +738,7 @@ private function getCollectionProcessor()
735738
{
736739
if (!$this->collectionProcessor) {
737740
$this->collectionProcessor = \Magento\Framework\App\ObjectManager::getInstance()->get(
741+
// phpstan:ignore "Class Magento\Catalog\Model\Api\SearchCriteria\ProductCollectionProcessor not found."
738742
\Magento\Catalog\Model\Api\SearchCriteria\ProductCollectionProcessor::class
739743
);
740744
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
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+
9+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="AdminOpenCatalogProductPageActionGroup">
12+
<annotations>
13+
<description>Open page with product grid.</description>
14+
</annotations>
15+
16+
<amOnPage url="{{AdminCatalogProductPage.url}}" stepKey="openCatalogProductPage"/>
17+
<waitForPageLoad stepKey="waitForPageToLoad"/>
18+
</actionGroup>
19+
</actionGroups>

app/code/Magento/Catalog/Test/Mftf/ActionGroup/GoToProductCatalogPageActionGroup.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
1010
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11-
<actionGroup name="GoToProductCatalogPageActionGroup">
11+
<actionGroup name="GoToProductCatalogPageActionGroup" deprecated="Use AdminOpenCatalogProductPageActionGroup instead.">
1212
<annotations>
1313
<description>Goes to the Admin Products grid page.</description>
1414
</annotations>

app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateAndSwitchProductType/AdminCreateSimpleProductSwitchToVirtualTest.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
<createData entity="_defaultCategory" stepKey="createPreReqCategory"/>
2323
</before>
2424
<after>
25-
<actionGroup ref="GoToProductCatalogPageActionGroup" stepKey="goToProductCatalogPage"/>
25+
<actionGroup ref="AdminOpenCatalogProductPageActionGroup" stepKey="goToProductCatalogPage"/>
2626
<actionGroup ref="DeleteProductUsingProductGridActionGroup" stepKey="deleteSimpleProduct">
2727
<argument name="product" value="_defaultProduct"/>
2828
</actionGroup>
@@ -49,7 +49,7 @@
4949
<actionGroup ref="SaveProductFormActionGroup" stepKey="saveProductForm"/>
5050
<!-- Check that product was added with implicit type change -->
5151
<comment stepKey="beforeVerify" userInput="Verify Product Type Assigned Correctly"/>
52-
<actionGroup ref="GoToProductCatalogPageActionGroup" stepKey="goToProductCatalogPage"/>
52+
<actionGroup ref="AdminOpenCatalogProductPageActionGroup" stepKey="goToProductCatalogPage"/>
5353
<actionGroup ref="ResetProductGridToDefaultViewActionGroup" stepKey="resetSearch"/>
5454
<actionGroup ref="FilterProductGridByNameActionGroup" stepKey="searchForProduct">
5555
<argument name="product" value="_defaultProduct"/>

app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateNewAttributeFromProductPageTest.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
<actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/>
2727
</after>
2828

29-
<actionGroup ref="GoToProductCatalogPageActionGroup" stepKey="goToProductCatalogPage"/>
29+
<actionGroup ref="AdminOpenCatalogProductPageActionGroup" stepKey="goToProductCatalogPage"/>
3030
<actionGroup ref="GoToCreateProductPageActionGroup" stepKey="goToCreateProduct">
3131
<argument name="product" value="SimpleProduct"/>
3232
</actionGroup>

app/code/Magento/Catalog/Test/Mftf/Test/AdminMoveProductBetweenCategoriesTest.xml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,7 @@
8787
<see selector="{{AdminIndexManagementSection.successMessage}}" userInput="You saved the configuration." stepKey="seeMessage"/>
8888

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

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

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

164162
<!-- Click on <product1> -->
165163
<actionGroup ref="FilterAndSelectProductActionGroup" stepKey="openSimpleProduct">

app/code/Magento/Catalog/Test/Mftf/Test/AdminProductTypeSwitchingOnEditingTest/AdminDownloadableProductTypeSwitchingToSimpleProductTest.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
<actionGroup ref="SaveProductFormActionGroup" stepKey="saveProductForm"/>
3030
<!--Assert simple product on Admin product page grid-->
3131
<comment userInput="Assert simple product in Admin product page grid" stepKey="commentAssertProductOnAdmin"/>
32-
<amOnPage url="{{AdminCatalogProductPage.url}}" stepKey="goToCatalogSimpleProductPage"/>
32+
<actionGroup ref="AdminOpenCatalogProductPageActionGroup" stepKey="goToCatalogSimpleProductPage"/>
3333
<actionGroup ref="FilterProductGridBySku2ActionGroup" stepKey="filterSimpleProductGridBySku">
3434
<argument name="sku" value="$$createProduct.sku$$"/>
3535
</actionGroup>

app/code/Magento/Catalog/Test/Mftf/Test/AdminProductTypeSwitchingOnEditingTest/AdminVirtualProductTypeSwitchingToDownloadableProductTest.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
<actionGroup ref="SaveProductFormActionGroup" stepKey="saveDownloadableProductForm"/>
5050
<!--Assert downloadable product on Admin product page grid-->
5151
<comment userInput="Assert configurable product in Admin product page grid" stepKey="commentAssertDownloadableProductOnAdmin"/>
52-
<amOnPage url="{{AdminCatalogProductPage.url}}" stepKey="goToCatalogProductPage"/>
52+
<actionGroup ref="AdminOpenCatalogProductPageActionGroup" stepKey="goToCatalogProductPage"/>
5353
<actionGroup ref="FilterProductGridBySku2ActionGroup" stepKey="filterProductGridBySku">
5454
<argument name="sku" value="$$createProduct.sku$$"/>
5555
</actionGroup>

app/code/Magento/Catalog/Test/Mftf/Test/AdminSortingByWebsitesTest.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
<actionGroup ref="AdminDeleteWebsiteActionGroup" stepKey="deleteTestWebsite">
4343
<argument name="websiteName" value="{{customWebsite.name}}"/>
4444
</actionGroup>
45-
<actionGroup ref="GoToProductCatalogPageActionGroup" stepKey="goToProductCatalogPage"/>
45+
<actionGroup ref="AdminOpenCatalogProductPageActionGroup" stepKey="goToProductCatalogPage"/>
4646
<actionGroup ref="ResetProductGridToDefaultViewActionGroup" stepKey="resetProductGridColumnsInitial"/>
4747
<actionGroup ref="ResetWebUrlOptionsActionGroup" stepKey="resetUrlOption"/>
4848
<actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex">

app/code/Magento/Catalog/Test/Mftf/Test/AdminVerifyProductOrderTest.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
<after>
2626
<actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/>
2727
</after>
28-
<actionGroup ref="GoToProductCatalogPageActionGroup" stepKey="goToProductCatalogPage"/>
28+
<actionGroup ref="AdminOpenCatalogProductPageActionGroup" stepKey="goToProductCatalogPage"/>
2929
<actionGroup ref="VerifyProductTypeOrder" stepKey="verifyProductTypeOrder"/>
3030
</test>
3131
</tests>

app/code/Magento/Catalog/Test/Unit/Model/ProductRepositoryTest.php

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,20 @@
4848
use PHPUnit\Framework\TestCase;
4949

5050
/**
51+
* Test for \Magento\Catalog\Model\ProductRepository.
52+
*
5153
* @SuppressWarnings(PHPMD.TooManyFields)
5254
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
5355
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
5456
*/
5557
class ProductRepositoryTest extends TestCase
5658
{
59+
private const STUB_STORE_ID = 1;
60+
private const STUB_STORE_ID_GLOBAL = 0;
61+
private const STUB_PRODUCT_ID = 100;
62+
private const STUB_PRODUCT_NAME = 'name';
63+
private const STUB_PRODUCT_SKU = 'sku';
64+
5765
/**
5866
* @var Product|MockObject
5967
*/
@@ -298,6 +306,7 @@ protected function setUp(): void
298306
->disableOriginalConstructor()
299307
->setMethods([])
300308
->getMockForAbstractClass();
309+
$storeMock->method('getId')->willReturn(self::STUB_STORE_ID);
301310
$storeMock->expects($this->any())->method('getWebsiteId')->willReturn('1');
302311
$storeMock->expects($this->any())->method('getCode')->willReturn(Store::ADMIN_CODE);
303312
$this->storeManager->expects($this->any())->method('getStore')->willReturn($storeMock);
@@ -351,6 +360,72 @@ function ($value) {
351360
$this->objectManager->setBackwardCompatibleProperty($this->model, 'mediaProcessor', $mediaProcessor);
352361
}
353362

363+
/**
364+
* Test save product with global store id
365+
*
366+
* @param array $productData
367+
* @return void
368+
* @dataProvider getProductData
369+
*/
370+
public function testSaveForAllStoreViewScope(array $productData): void
371+
{
372+
$this->productFactory->method('create')->willReturn($this->product);
373+
$this->product->method('getSku')->willReturn($productData['sku']);
374+
$this->extensibleDataObjectConverter
375+
->expects($this->once())
376+
->method('toNestedArray')
377+
->willReturn($productData);
378+
$this->resourceModel->method('getIdBySku')->willReturn(self::STUB_PRODUCT_ID);
379+
$this->resourceModel->expects($this->once())->method('validate')->willReturn(true);
380+
$this->product->expects($this->at(14))->method('setData')
381+
->with('store_id', $productData['store_id']);
382+
383+
$this->model->save($this->product);
384+
}
385+
386+
/**
387+
* Product data provider
388+
*
389+
* @return array
390+
*/
391+
public function getProductData(): array
392+
{
393+
return [
394+
[
395+
[
396+
'sku' => self::STUB_PRODUCT_SKU,
397+
'name' => self::STUB_PRODUCT_NAME,
398+
'store_id' => self::STUB_STORE_ID_GLOBAL,
399+
],
400+
],
401+
];
402+
}
403+
404+
/**
405+
* Test save product without store
406+
*
407+
* @return void
408+
*/
409+
public function testSaveWithoutStoreId(): void
410+
{
411+
$this->productFactory->method('create')->willReturn($this->product);
412+
$this->product->method('getSku')->willReturn($this->productData['sku']);
413+
$this->extensibleDataObjectConverter
414+
->expects($this->once())
415+
->method('toNestedArray')
416+
->willReturn($this->productData);
417+
$this->resourceModel->method('getIdBySku')->willReturn(self::STUB_PRODUCT_ID);
418+
$this->resourceModel->expects($this->once())->method('validate')->willReturn(true);
419+
$this->product->expects($this->at(15))->method('setData')
420+
->with('store_id', self::STUB_STORE_ID);
421+
422+
$this->model->save($this->product);
423+
}
424+
425+
/**
426+
* @expectedException \Magento\Framework\Exception\NoSuchEntityException
427+
* @expectedExceptionMessage The product that was requested doesn't exist. Verify the product and try again.
428+
*/
354429
public function testGetAbsentProduct()
355430
{
356431
$this->expectException('Magento\Framework\Exception\NoSuchEntityException');

app/code/Magento/CatalogInventory/Test/Mftf/Test/AssociatedProductToConfigurableOutOfStockTest.xml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -115,18 +115,14 @@
115115
<actionGroup ref="StorefrontSignOutActionGroup" stepKey="StorefrontSignOutActionGroup"/>
116116
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin1"/>
117117

118-
<amOnPage url="{{AdminOrdersPage.url}}" stepKey="onOrdersPage"/>
119-
<waitForLoadingMaskToDisappear stepKey="waitForLoadingMask3"/>
120118
<!-- Reset admin order filter -->
121119
<actionGroup ref="AdminOrdersGridClearFiltersActionGroup" stepKey="clearOrderFilters"/>
122-
<waitForLoadingMaskToDisappear stepKey="waitForLoadingMask5"/>
123120
<fillField selector="{{AdminOrdersGridSection.search}}" userInput="{$grabOrderNumber}" stepKey="searchOrderNum"/>
124121
<click selector="{{AdminOrdersGridSection.submitSearch}}" stepKey="submitSearch"/>
125122
<waitForLoadingMaskToDisappear stepKey="waitForLoadingMask4"/>
126123

127124
<actionGroup ref="AdminOrderGridClickFirstRowActionGroup" stepKey="clickOrderRow"/>
128-
<click selector="{{AdminOrderDetailsMainActionsSection.invoice}}" stepKey="clickInvoice"/>
129-
<waitForPageLoad stepKey="waitForNewInvoicePageToLoad"/>
125+
<actionGroup ref="AdminClickInvoiceButtonOrderViewActionGroup" stepKey="clickInvoice"/>
130126
<actionGroup ref="AdminInvoiceClickSubmitActionGroup" stepKey="clickSubmitInvoice"/>
131127
<see selector="{{AdminOrderDetailsMessagesSection.successMessage}}" userInput="The invoice has been created." stepKey="seeSuccessMessage"/>
132128
<click selector="{{AdminOrderDetailsMainActionsSection.ship}}" stepKey="clickShip"/>

app/code/Magento/Checkout/Test/Mftf/Test/CheckCheckoutSuccessPageTest/CheckCheckoutSuccessPageAsGuestTest.xml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,22 @@
2323
</before>
2424

2525
<after>
26+
<!--Cancel orders-->
27+
<actionGroup ref="AdminLoginActionGroup" stepKey="adminLogin"/>
28+
<actionGroup ref="AdminOrdersGridClearFiltersActionGroup" stepKey="goToOrdersPage"/>
29+
<actionGroup ref="AdminGridColumnShowActionGroup" stepKey="showCustomerEmailColumn">
30+
<argument name="columnLabel" value="Customer Email"/>
31+
</actionGroup>
32+
<actionGroup ref="AdminGridFilterFillInputFieldActionGroup" stepKey="filterOrdersByCustomerEmail">
33+
<argument name="filterInputName" value="customer_email"/>
34+
<argument name="filterValue" value="{{CustomerEntityOne.email}}"/>
35+
</actionGroup>
36+
<actionGroup ref="AdminGridFilterApplyActionGroup" stepKey="applyFilters"/>
37+
<actionGroup ref="AdminGridBulkActionGroup" stepKey="cancelOrders">
38+
<argument name="actionLabel" value="Cancel"/>
39+
</actionGroup>
2640
<actionGroup ref="AdminLogoutActionGroup" stepKey="adminLogout"/>
41+
2742
<deleteData createDataKey="createSimpleProduct" stepKey="deleteProduct"/>
2843
</after>
2944

0 commit comments

Comments
 (0)