-
Notifications
You must be signed in to change notification settings - Fork 9.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6340 from magento-tsg-csl3/2.4-develop-pr45
[TSG-CSL3] For 2.4 (pr45)
- Loading branch information
Showing
17 changed files
with
813 additions
and
146 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
92 changes: 92 additions & 0 deletions
92
...ento/Bundle/Test/Mftf/Test/StorefrontBundlePlaceOrderWithVirtualAndSimpleChildrenTest.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
<?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="StorefrontBundlePlaceOrderWithVirtualAndSimpleChildrenTest"> | ||
<annotations> | ||
<features value="Bundle"/> | ||
<stories value="Bundle product placing order"/> | ||
<title value="Admin should be able to invoice order for the bundle product with virtual and simple products in options"/> | ||
<description value="Place order for bundle product and create invoice"/> | ||
<severity value="MAJOR"/> | ||
<testCaseId value="MC-38683"/> | ||
<useCaseId value="MC-37663"/> | ||
<group value="Bundle"/> | ||
</annotations> | ||
<before> | ||
<createData entity="CustomerEntityOne" stepKey="createCustomer"/> | ||
<!--Create bundle product with fixed price with simple and virtual products in options--> | ||
<createData entity="SimpleProduct2" stepKey="createSimpleProduct"> | ||
<field key="price">100.00</field> | ||
</createData> | ||
<createData entity="VirtualProduct" stepKey="createVirtualProduct"> | ||
<field key="price">50.00</field> | ||
</createData> | ||
<createData entity="ApiFixedBundleProduct" stepKey="createFixedBundleProduct"/> | ||
<createData entity="DropDownBundleOption" stepKey="createFirstBundleOption"> | ||
<requiredEntity createDataKey="createFixedBundleProduct"/> | ||
</createData> | ||
<createData entity="DropDownBundleOption" stepKey="createSecondBundleOption"> | ||
<requiredEntity createDataKey="createFixedBundleProduct"/> | ||
</createData> | ||
<createData entity="ApiBundleLink" stepKey="firstLinkOptionToFixedProduct"> | ||
<requiredEntity createDataKey="createFixedBundleProduct"/> | ||
<requiredEntity createDataKey="createFirstBundleOption"/> | ||
<requiredEntity createDataKey="createSimpleProduct"/> | ||
</createData> | ||
<createData entity="ApiBundleLink" stepKey="secondLinkOptionToFixedProduct"> | ||
<requiredEntity createDataKey="createFixedBundleProduct"/> | ||
<requiredEntity createDataKey="createSecondBundleOption"/> | ||
<requiredEntity createDataKey="createVirtualProduct"/> | ||
</createData> | ||
<actionGroup stepKey="loginToAdminPanel" ref="AdminLoginActionGroup"/> | ||
<actionGroup ref="AdminProductPageOpenByIdActionGroup" stepKey="goToProductEditPage"> | ||
<argument name="productId" value="$createFixedBundleProduct.id$"/> | ||
</actionGroup> | ||
<actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct"/> | ||
<!--Perform reindex and flush cache--> | ||
<actionGroup ref="AdminReindexAndFlushCache" stepKey="reindexAndFlushCache"/> | ||
</before> | ||
<after> | ||
<deleteData createDataKey="createSimpleProduct" stepKey="deleteSimpleProductForBundleItem"/> | ||
<deleteData createDataKey="createVirtualProduct" stepKey="deleteVirtualProductForBundleItem"/> | ||
<deleteData createDataKey="createFixedBundleProduct" stepKey="deleteBundleProduct"/> | ||
<deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/> | ||
<actionGroup ref="AdminClearFiltersActionGroup" stepKey="clearProductsGridFilters"/> | ||
<waitForPageLoad stepKey="waitForClearProductsGridFilters"/> | ||
</after> | ||
<!--Login customer on storefront--> | ||
<actionGroup ref="LoginToStorefrontActionGroup" stepKey="loginCustomer"> | ||
<argument name="Customer" value="$$createCustomer$$" /> | ||
</actionGroup> | ||
<!--Open Product Page--> | ||
<actionGroup ref="StorefrontOpenProductEntityPageActionGroup" stepKey="openBundleProductPage"> | ||
<argument name="product" value="$createFixedBundleProduct$"/> | ||
</actionGroup> | ||
<!--Add bundle to cart--> | ||
<actionGroup ref="StorefrontSelectCustomizeAndAddToTheCartButtonActionGroup" stepKey="clickAddToCart"> | ||
<argument name="productUrl" value="$createFixedBundleProduct.name$"/> | ||
</actionGroup> | ||
<actionGroup ref="StorefrontEnterProductQuantityAndAddToTheCartActionGroup" stepKey="enterProductQuantityAndAddToTheCart"> | ||
<argument name="quantity" value="1"/> | ||
</actionGroup> | ||
<!--Navigate to checkout--> | ||
<actionGroup ref="StorefrontOpenCheckoutPageActionGroup" stepKey="openCheckoutPage"/> | ||
<!--Click next button to open payment section--> | ||
<actionGroup ref="StorefrontCheckoutClickNextButtonActionGroup" stepKey="clickNext"/> | ||
<!--Click place order--> | ||
<actionGroup ref="ClickPlaceOrderActionGroup" stepKey="placeOrder"/> | ||
<grabTextFrom selector="{{CheckoutSuccessMainSection.orderNumber22}}" stepKey="grabOrderNumber"/> | ||
<!--Order review page has address that was created during checkout--> | ||
<actionGroup ref="OpenOrderByIdActionGroup" stepKey="filterOrdersGridById"> | ||
<argument name="orderId" value="{$grabOrderNumber}"/> | ||
</actionGroup> | ||
<!--Create Invoice for this Order--> | ||
<actionGroup ref="StartCreateInvoiceFromOrderPageActionGroup" stepKey="createInvoice"/> | ||
<actionGroup ref="SubmitInvoiceActionGroup" stepKey="submitInvoice"/> | ||
</test> | ||
</tests> |
45 changes: 45 additions & 0 deletions
45
...ento/Catalog/Test/Mftf/ActionGroup/AdminMassUpdateProductQtyAndStockStatusActionGroup.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
<?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"> | ||
<!--Update Product Name and Description attribute--> | ||
<actionGroup name="AdminMassUpdateProductQtyAndStockStatusActionGroup"> | ||
<arguments> | ||
<argument name="attributes"/> | ||
<argument name="product"/> | ||
</arguments> | ||
<!--Filter product in product grid--> | ||
<amOnPage url="{{AdminProductIndexPage.url}}" stepKey="visitAdminProductPageFirstTime"/> | ||
<waitForPageLoad stepKey="waitForProductGridPageLoad"/> | ||
<conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFiltersInitial"/> | ||
<click selector="{{AdminProductGridFilterSection.filters}}" stepKey="openProductFilters"/> | ||
<fillField selector="{{AdminProductGridFilterSection.nameFilter}}" userInput="{{product.name}}" stepKey="fillProductNameFilter"/> | ||
<fillField selector="{{AdminProductGridFilterSection.skuFilter}}" userInput="{{product.sku}}" stepKey="fillProductSkuFilter"/> | ||
<selectOption selector="{{AdminProductGridFilterSection.typeFilter}}" userInput="{{product.type_id}}" stepKey="selectionProductType"/> | ||
<click selector="{{AdminProductGridFilterSection.applyFilters}}" stepKey="clickApplyFilters"/> | ||
<!--Select first product from grid and open mass action--> | ||
<click selector="{{AdminProductGridSection.productGridCheckboxOnRow('1')}}" stepKey="clickCheckbox"/> | ||
<click selector="{{AdminProductGridSection.bulkActionDropdown}}" stepKey="clickDropdown"/> | ||
<click selector="{{AdminProductGridSection.bulkActionOption('Update attributes')}}" stepKey="clickOption"/> | ||
<waitForPageLoad stepKey="waitForUploadPage"/> | ||
<seeInCurrentUrl url="{{ProductAttributesEditPage.url}}" stepKey="seeAttributePageEditUrl"/> | ||
<!--Update inventory attributes and save--> | ||
<click selector="{{AdminUpdateAttributesAdvancedInventorySection.inventory}}" stepKey="openInvetoryTab"/> | ||
<click selector="{{AdminUpdateAttributesAdvancedInventorySection.changeQty}}" stepKey="uncheckChangeQty"/> | ||
<fillField selector="{{AdminUpdateAttributesAdvancedInventorySection.qty}}" userInput="{{attributes.qty}}" stepKey="fillFieldName"/> | ||
<click selector="{{AdminUpdateAttributesAdvancedInventorySection.changeStockAvailability}}" stepKey="uncheckChangeStockAvailability"/> | ||
<selectOption selector="{{AdminUpdateAttributesAdvancedInventorySection.stockAvailability}}" userInput="{{attributes.stockAvailability}}" stepKey="selectStatus"/> | ||
<click selector="{{AdminUpdateAttributesSection.saveButton}}" stepKey="save"/> | ||
<waitForElementVisible selector="{{AdminMessagesSection.success}}" stepKey="waitVisibleSuccessMessage"/> | ||
<see selector="{{AdminMessagesSection.success}}" userInput="Message is added to queue" stepKey="seeSuccessMessage"/> | ||
<amOnPage url="{{AdminProductIndexPage.url}}" stepKey="visitAdminProductPageSecondTime"/> | ||
<waitForPageLoad stepKey="waitForProductGridPage"/> | ||
<conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFiltersAfterMassAction"/> | ||
</actionGroup> | ||
</actionGroups> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
...tf/Section/AdminUpdateAttributesSection/AdminUpdateAttributesAdvancedInventorySection.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- | ||
/** | ||
* Copyright © Magento, Inc. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
--> | ||
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd"> | ||
<section name="AdminUpdateAttributesAdvancedInventorySection"> | ||
<element name="inventory" type="button" selector="#attributes_update_tabs_inventory"/> | ||
<element name="changeQty" type="checkbox" selector="#inventory_qty_checkbox"/> | ||
<element name="qty" type="input" selector="#inventory_qty"/> | ||
<element name="changeStockAvailability" type="checkbox" selector="#inventory_stock_availability_checkbox"/> | ||
<element name="stockAvailability" type="select" selector="//select[@name='inventory[is_in_stock]']"/> | ||
</section> | ||
</sections> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
85 changes: 85 additions & 0 deletions
85
...ode/Magento/DownloadableImportExport/Test/Unit/Model/Export/Product/RowCustomizerTest.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
<?php | ||
/** | ||
* Copyright © Magento, Inc. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
declare(strict_types=1); | ||
|
||
namespace Magento\DownloadableImportExport\Test\Unit\Model\Export\Product; | ||
|
||
use Magento\Catalog\Model\ResourceModel\Product\Collection as ProductCollection; | ||
use Magento\Downloadable\Model\LinkRepository; | ||
use Magento\Downloadable\Model\Product\Type as Type; | ||
use Magento\Downloadable\Model\SampleRepository; | ||
use Magento\DownloadableImportExport\Model\Export\RowCustomizer; | ||
use Magento\Store\Model\Store; | ||
use Magento\Store\Model\StoreManagerInterface; | ||
use PHPUnit\Framework\MockObject\MockObject; | ||
use PHPUnit\Framework\TestCase; | ||
|
||
/** | ||
* Class to test Customizes output during export | ||
*/ | ||
class RowCustomizerTest extends TestCase | ||
{ | ||
/** | ||
* @var LinkRepository|MockObject | ||
*/ | ||
private $linkRepository; | ||
|
||
/** | ||
* @var SampleRepository|MockObject | ||
*/ | ||
private $sampleRepository; | ||
|
||
/** | ||
* @var StoreManagerInterface|MockObject | ||
*/ | ||
private $storeManager; | ||
|
||
/** | ||
* @var RowCustomizer | ||
*/ | ||
private $rowCustomizer; | ||
|
||
/** | ||
* @inheritdoc | ||
*/ | ||
protected function setUp(): void | ||
{ | ||
$this->linkRepository = $this->createMock(LinkRepository::class); | ||
$this->sampleRepository = $this->createMock(SampleRepository::class); | ||
$this->storeManager = $this->createMock(StoreManagerInterface::class); | ||
|
||
$this->rowCustomizer = new RowCustomizer( | ||
$this->storeManager, | ||
$this->linkRepository, | ||
$this->sampleRepository | ||
); | ||
} | ||
|
||
/** | ||
* Test to Prepare downloadable data for export | ||
*/ | ||
public function testPrepareData() | ||
{ | ||
$productIds = [1, 2, 3]; | ||
$collection = $this->createMock(ProductCollection::class); | ||
$collection->expects($this->at(0)) | ||
->method('addAttributeToFilter') | ||
->with('entity_id', ['in' => $productIds]) | ||
->willReturnSelf(); | ||
$collection->expects($this->at(1)) | ||
->method('addAttributeToFilter') | ||
->with('type_id', ['eq' => Type::TYPE_DOWNLOADABLE]) | ||
->willReturnSelf(); | ||
$collection->method('addAttributeToSelect')->willReturnSelf(); | ||
$collection->method('getIterator')->willReturn(new \ArrayIterator([])); | ||
|
||
$this->storeManager->expects($this->once()) | ||
->method('setCurrentStore') | ||
->with(Store::DEFAULT_STORE_ID); | ||
|
||
$this->rowCustomizer->prepareData($collection, $productIds); | ||
} | ||
} |
Oops, something went wrong.