Skip to content

Commit d7f4b88

Browse files
authored
Merge branch 'magento-commerce:2.4-develop' into AC-4953
2 parents 195d39a + ed69801 commit d7f4b88

File tree

46 files changed

+978
-164
lines changed

Some content is hidden

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

46 files changed

+978
-164
lines changed

app/code/Magento/Bundle/Pricing/Adjustment/DefaultSelectionPriceListProvider.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,10 @@ public function getPriceList(Product $bundleProduct, $searchMin, $useRegularPric
8585
[(int)$option->getOptionId()],
8686
$bundleProduct
8787
);
88-
$selectionsCollection->setFlag('has_stock_status_filter', true);
88+
89+
if ((int)$bundleProduct->getPriceType() !== Price::PRICE_TYPE_FIXED) {
90+
$selectionsCollection->setFlag('has_stock_status_filter', true);
91+
}
8992
$selectionsCollection->removeAttributeToSelect();
9093

9194
if (!$useRegularPrice) {

app/code/Magento/Bundle/Test/Unit/Pricing/Adjustment/DefaultSelectionPriceListProviderTest.php

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
namespace Magento\Bundle\Test\Unit\Pricing\Adjustment;
99

1010
use Magento\Bundle\Model\Option;
11+
use Magento\Bundle\Model\Product\Price;
1112
use Magento\Bundle\Model\Product\Type;
1213
use Magento\Bundle\Model\ResourceModel\Option\Collection;
1314
use Magento\Bundle\Model\ResourceModel\Selection\Collection as SelectionCollection;
@@ -109,6 +110,8 @@ protected function setUp(): void
109110

110111
$this->product = $this->getMockBuilder(Product::class)
111112
->disableOriginalConstructor()
113+
->addMethods(['getPriceType'])
114+
->onlyMethods(['getTypeInstance', 'isSalable'])
112115
->getMock();
113116
$this->optionsCollection = $this->getMockBuilder(Collection::class)
114117
->disableOriginalConstructor()
@@ -142,6 +145,54 @@ public function testGetPriceList(): void
142145
{
143146
$optionId = 1;
144147

148+
$this->typeInstance->expects($this->any())
149+
->method('getOptionsCollection')
150+
->with($this->product)
151+
->willReturn($this->optionsCollection);
152+
$this->product->expects($this->any())
153+
->method('getTypeInstance')
154+
->willReturn($this->typeInstance);
155+
$this->product->expects($this->once())
156+
->method('getPriceType')->willReturn(Price::PRICE_TYPE_FIXED);
157+
$this->optionsCollection->expects($this->once())
158+
->method('getIterator')
159+
->willReturn(new \ArrayIterator([$this->option]));
160+
$this->option->expects($this->once())
161+
->method('getOptionId')
162+
->willReturn($optionId);
163+
$this->typeInstance->expects($this->once())
164+
->method('getSelectionsCollection')
165+
->with([$optionId], $this->product)
166+
->willReturn($this->selectionCollection);
167+
$this->option->expects($this->once())
168+
->method('isMultiSelection')
169+
->willReturn(true);
170+
$this->storeManager->expects($this->once())
171+
->method('getStore')
172+
->willReturn($this->store);
173+
$this->store->expects($this->once())
174+
->method('getWebsiteId')
175+
->willReturn(0);
176+
$this->websiteRepository->expects($this->once())
177+
->method('getDefault')
178+
->willReturn($this->website);
179+
$this->website->expects($this->once())
180+
->method('getId')
181+
->willReturn(1);
182+
$this->selectionCollection->expects($this->once())
183+
->method('getIterator')
184+
->willReturn(new \ArrayIterator([]));
185+
$this->selectionCollection->expects($this->never())
186+
->method('setFlag')
187+
->with('has_stock_status_filter', true);
188+
189+
$this->model->getPriceList($this->product, false, false);
190+
}
191+
192+
public function testGetPriceListForFixedPriceType(): void
193+
{
194+
$optionId = 1;
195+
145196
$this->typeInstance->expects($this->any())
146197
->method('getOptionsCollection')
147198
->with($this->product)

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,18 @@
1919
<!--Scroll up to avoid error-->
2020
<scrollTo selector="{{AdminProductFormRelatedUpSellCrossSellSection.relatedDropdown}}" x="0" y="-100" stepKey="scrollTo"/>
2121
<conditionalClick selector="{{AdminProductFormRelatedUpSellCrossSellSection.relatedDropdown}}" dependentSelector="{{AdminProductFormRelatedUpSellCrossSellSection.relatedDependent}}" visible="false" stepKey="openDropDownIfClosedRelatedUpSellCrossSell"/>
22+
<waitForElementClickable selector="{{AdminProductFormRelatedUpSellCrossSellSection.AddCrossSellProductsButton}}" stepKey="waitForAddCrossSellButtonClickable" />
2223
<click selector="{{AdminProductFormRelatedUpSellCrossSellSection.AddCrossSellProductsButton}}" stepKey="clickAddCrossSellButton"/>
2324
<conditionalClick selector="{{AdminProductCrossSellModalSection.Modal}} {{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductCrossSellModalSection.Modal}} {{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFilters"/>
25+
<waitForElementClickable selector="{{AdminProductCrossSellModalSection.Modal}} {{AdminProductGridFilterSection.filters}}" stepKey="waitForProductFiltersClickable" />
2426
<click selector="{{AdminProductCrossSellModalSection.Modal}} {{AdminProductGridFilterSection.filters}}" stepKey="openProductFilters"/>
27+
<waitForElementVisible selector="{{AdminProductCrossSellModalSection.Modal}} {{AdminProductGridFilterSection.skuFilter}}" stepKey="waitForSkuFilterVisible" />
2528
<fillField selector="{{AdminProductCrossSellModalSection.Modal}} {{AdminProductGridFilterSection.skuFilter}}" userInput="{{sku}}" stepKey="fillProductSkuFilter"/>
2629
<click selector="{{AdminProductCrossSellModalSection.Modal}} {{AdminProductGridFilterSection.applyFilters}}" stepKey="clickApplyFilters"/>
2730
<waitForPageLoad stepKey="waitForPageToLoad"/>
31+
<waitForElementClickable selector="{{AdminProductCrossSellModalSection.Modal}}{{AdminProductModalSlideGridSection.productGridXRowYColumnButton('1', '1')}}" stepKey="waitForProductClickable" />
2832
<click selector="{{AdminProductCrossSellModalSection.Modal}}{{AdminProductModalSlideGridSection.productGridXRowYColumnButton('1', '1')}}" stepKey="selectProduct"/>
33+
<waitForElementClickable selector="{{AdminProductCrossSellModalSection.addSelectedProducts}}" stepKey="waitForAddRelatedProductClickable" />
2934
<click selector="{{AdminProductCrossSellModalSection.addSelectedProducts}}" stepKey="addRelatedProductSelected"/>
3035
<waitForPageLoad stepKey="waitForModalDisappear"/>
3136
</actionGroup>

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@
1717
</arguments>
1818

1919
<waitForElementClickable selector="{{AdminProductGridSection.productRowCheckboxById(productId)}}" stepKey="waitForElementClickable" />
20+
<scrollTo selector="{{AdminProductGridSection.productRowCheckboxById(productId)}}" x="-100" stepKey="scrollToProductCheckbox" />
21+
<moveMouseOver selector="{{AdminProductGridSection.productRowCheckboxById(productId)}}" x="-100" stepKey="moveMouseOverProductCheckbox" />
2022
<checkOption selector="{{AdminProductGridSection.productRowCheckboxById(productId)}}" stepKey="selectProduct"/>
23+
<waitForPageLoad stepKey="waitForBackgroundProcessesToFinish" />
2124
</actionGroup>
2225
</actionGroups>

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@
1212
<annotations>
1313
<description>Clicks on 'Update attributes' from dropdown actions list on product grid page. Products should be selected via mass action before</description>
1414
</annotations>
15+
<waitForElementClickable selector="{{AdminProductGridSection.bulkActionDropdown}}" stepKey="waitForDropdownClickable" />
1516
<click selector="{{AdminProductGridSection.bulkActionDropdown}}" stepKey="clickDropdown"/>
17+
<waitForElementClickable selector="{{AdminProductGridSection.bulkActionOption('Update attributes')}}" stepKey="waitForOptionClickable" />
1618
<click selector="{{AdminProductGridSection.bulkActionOption('Update attributes')}}" stepKey="clickOption"/>
1719
<waitForPageLoad stepKey="waitForBulkUpdatePage"/>
1820
<seeInCurrentUrl url="{{ProductAttributesEditPage.url}}" stepKey="seeInUrl"/>

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
<argument name="productVar"/>
1717
</arguments>
1818

19+
<waitForPageLoad stepKey="waitForProductPageOpenedAndLoaded" />
1920
<waitForElementClickable selector="{{StorefrontProductInfoMainSection.productAddToCompare}}" stepKey="waitForAddToCompareButtonClickable" />
2021
<click selector="{{StorefrontProductInfoMainSection.productAddToCompare}}" stepKey="clickAddToCompare"/>
2122
<waitForElement selector="{{StorefrontMessagesSection.success}}" stepKey="waitForAddProductToCompareSuccessMessage"/>

app/code/Magento/Catalog/Test/Mftf/Section/StorefrontHeaderSection.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@
99
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
1010
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
1111
<section name="StorefrontHeaderSection">
12-
<element name="NavigationCategoryByName" type="button" selector="//nav//a[span[contains(., '{{var1}}')]]" parameterized="true" timeout="30"/>
12+
<element name="NavigationCategoryByName" type="button" selector="//nav//li[a[span[contains(., '{{var1}}')]]]" parameterized="true" timeout="30"/>
1313
</section>
1414
</sections>

0 commit comments

Comments
 (0)