Skip to content

Commit d320cfd

Browse files
committed
Merge remote-tracking branch 'origin/2.4-develop' into MC-31395
2 parents 902b655 + 3a814d9 commit d320cfd

File tree

230 files changed

+6567
-638
lines changed

Some content is hidden

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

230 files changed

+6567
-638
lines changed
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
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="AssertAdminDashboardDisplayedWithNoErrorsActionGroup">
12+
<annotations>
13+
<description>Checks if Dashboard is displayed properly</description>
14+
</annotations>
15+
16+
<seeElement selector="{{AdminDashboardSection.dashboardDiagramOrderContentTab}}" stepKey="seeOrderContentTab"/>
17+
<seeElement selector="{{AdminDashboardSection.dashboardDiagramContent}}" stepKey="seeDiagramContent"/>
18+
<click selector="{{AdminDashboardSection.dashboardDiagramAmounts}}" stepKey="clickDashboardAmount"/>
19+
<waitForLoadingMaskToDisappear stepKey="waitForDashboardAmountLoading"/>
20+
<seeElement selector="{{AdminDashboardSection.dashboardDiagramAmountsContentTab}}" stepKey="seeDiagramAmountContent"/>
21+
<seeElement selector="{{AdminDashboardSection.dashboardDiagramTotals}}" stepKey="seeAmountTotals"/>
22+
<dontSeeJsError stepKey="dontSeeJsError"/>
23+
</actionGroup>
24+
</actionGroups>
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
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+
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
11+
<test name="AdminCheckDashboardWithChartsTest">
12+
<annotations>
13+
<features value="Backend"/>
14+
<stories value="Google Charts on Magento dashboard"/>
15+
<title value="Admin should see Google chart on Magento dashboard"/>
16+
<description value="Google chart on Magento dashboard page is displaying properly"/>
17+
<severity value="MAJOR"/>
18+
<testCaseId value="MAGETWO-98934"/>
19+
<useCaseId value="MAGETWO-98584"/>
20+
<group value="backend"/>
21+
</annotations>
22+
<before>
23+
<magentoCLI command="config:set admin/dashboard/enable_charts 1" stepKey="setEnableCharts"/>
24+
<createData entity="SimpleProduct2" stepKey="createProduct">
25+
<field key="price">150</field>
26+
</createData>
27+
<createData entity="Simple_US_Customer" stepKey="createCustomer">
28+
<field key="firstname">John1</field>
29+
<field key="lastname">Doe1</field>
30+
</createData>
31+
<createData entity="CustomerCart" stepKey="createCustomerCart">
32+
<requiredEntity createDataKey="createCustomer"/>
33+
</createData>
34+
<createData entity="CustomerCartItem" stepKey="addCartItem">
35+
<requiredEntity createDataKey="createCustomerCart"/>
36+
<requiredEntity createDataKey="createProduct"/>
37+
</createData>
38+
<createData entity="CustomerAddressInformation" stepKey="addCustomerOrderAddress">
39+
<requiredEntity createDataKey="createCustomerCart"/>
40+
</createData>
41+
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>
42+
</before>
43+
<after>
44+
<magentoCLI command="config:set admin/dashboard/enable_charts 0" stepKey="setDisableChartsAsDefault"/>
45+
<deleteData createDataKey="createProduct" stepKey="deleteProduct"/>
46+
<deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/>
47+
<actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/>
48+
</after>
49+
50+
<grabTextFrom selector="{{AdminDashboardSection.dashboardTotals('Quantity')}}" stepKey="grabQuantityBefore"/>
51+
52+
<updateData createDataKey="createCustomerCart" entity="CustomerOrderPaymentMethod" stepKey="sendCustomerPaymentInformation">
53+
<requiredEntity createDataKey="createCustomerCart"/>
54+
</updateData>
55+
<createData entity="Invoice" stepKey="invoiceOrder">
56+
<requiredEntity createDataKey="createCustomerCart"/>
57+
</createData>
58+
<createData entity="Shipment" stepKey="shipOrder">
59+
<requiredEntity createDataKey="createCustomerCart"/>
60+
</createData>
61+
62+
<reloadPage stepKey="refreshPage"/>
63+
<actionGroup ref="AssertAdminDashboardDisplayedWithNoErrorsActionGroup" stepKey="assertAdminDashboardNotBroken"/>
64+
<grabTextFrom selector="{{AdminDashboardSection.dashboardTotals('Quantity')}}" stepKey="grabQuantityAfter"/>
65+
<assertGreaterThan stepKey="checkQuantityWasChanged">
66+
<actualResult type="const">$grabQuantityAfter</actualResult>
67+
<expectedResult type="const">$grabQuantityBefore</expectedResult>
68+
</assertGreaterThan>
69+
</test>
70+
</tests>

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

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,19 @@
88

99
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
1010
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
11-
<test name="AdminDashboardWithChartsTest">
11+
<test name="AdminDashboardWithChartsTest" deprecated="Use AdminCheckDashboardWithChartsTest instead">
1212
<annotations>
1313
<features value="Backend"/>
1414
<stories value="Google Charts on Magento dashboard"/>
15-
<title value="Admin should see Google chart on Magento dashboard"/>
15+
<title value="DEPRECATED. Admin should see Google chart on Magento dashboard"/>
1616
<description value="Google chart on Magento dashboard page is displaying properly"/>
1717
<severity value="MAJOR"/>
1818
<testCaseId value="MAGETWO-98934"/>
1919
<useCaseId value="MAGETWO-98584"/>
2020
<group value="backend"/>
21+
<skip>
22+
<issueId value="DEPRECATED">Use AdminCheckDashboardWithChartsTest instead</issueId>
23+
</skip>
2124
</annotations>
2225
<before>
2326
<magentoCLI command="config:set admin/dashboard/enable_charts 1" stepKey="setEnableCharts"/>

app/code/Magento/Backend/view/adminhtml/templates/store/switcher.phtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ script;
200200
setLocation(url);
201201
';
202202
} else {
203-
$scriptString .= <<<script
203+
$scriptString .= <<<'script'
204204
jQuery('#preview_selected_store').val(scopeId);
205205
jQuery('#preview_form').submit();
206206

app/code/Magento/Bundle/Model/Product/BundleOptionDataProvider.php

Lines changed: 32 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
use Magento\Bundle\Model\Option;
1212
use Magento\Catalog\Model\Product;
1313
use Magento\Catalog\Model\Product\Configuration\Item\ItemInterface;
14+
use Magento\Framework\GraphQl\Query\Uid;
1415
use Magento\Framework\Pricing\Helper\Data;
1516
use Magento\Framework\Serialize\SerializerInterface;
1617

@@ -19,6 +20,11 @@
1920
*/
2021
class BundleOptionDataProvider
2122
{
23+
/**
24+
* Option type name
25+
*/
26+
private const OPTION_TYPE = 'bundle';
27+
2228
/**
2329
* @var Data
2430
*/
@@ -34,19 +40,27 @@ class BundleOptionDataProvider
3440
*/
3541
private $configuration;
3642

43+
/**
44+
* @var Uid
45+
*/
46+
private $uidEncoder;
47+
3748
/**
3849
* @param Data $pricingHelper
3950
* @param SerializerInterface $serializer
4051
* @param Configuration $configuration
52+
* @param Uid $uidEncoder
4153
*/
4254
public function __construct(
4355
Data $pricingHelper,
4456
SerializerInterface $serializer,
45-
Configuration $configuration
57+
Configuration $configuration,
58+
Uid $uidEncoder
4659
) {
4760
$this->pricingHelper = $pricingHelper;
4861
$this->serializer = $serializer;
4962
$this->configuration = $configuration;
63+
$this->uidEncoder = $uidEncoder;
5064
}
5165

5266
/**
@@ -100,8 +114,15 @@ private function buildBundleOptions(array $bundleOptions, ItemInterface $item):
100114
continue;
101115
}
102116

117+
$optionDetails = [
118+
self::OPTION_TYPE,
119+
$bundleOption->getOptionId()
120+
];
121+
$uidString = implode('/', $optionDetails);
122+
103123
$options[] = [
104124
'id' => $bundleOption->getId(),
125+
'uid' => $this->uidEncoder->encode($uidString),
105126
'label' => $bundleOption->getTitle(),
106127
'type' => $bundleOption->getType(),
107128
'values' => $this->buildBundleOptionValues($bundleOption->getSelections(), $item),
@@ -130,10 +151,19 @@ private function buildBundleOptionValues(array $selections, ItemInterface $item)
130151
continue;
131152
}
132153

154+
$optionValueDetails = [
155+
self::OPTION_TYPE,
156+
$selection->getOptionId(),
157+
$selection->getSelectionId(),
158+
(int) $selection->getSelectionQty()
159+
];
160+
$uidString = implode('/', $optionValueDetails);
161+
133162
$selectionPrice = $this->configuration->getSelectionFinalPrice($item, $selection);
134163
$values[] = [
135-
'label' => $selection->getName(),
136164
'id' => $selection->getSelectionId(),
165+
'uid' => $this->uidEncoder->encode($uidString),
166+
'label' => $selection->getName(),
137167
'quantity' => $qty,
138168
'price' => $this->pricingHelper->currency($selectionPrice, false, false),
139169
];

app/code/Magento/Bundle/Model/ResourceModel/Indexer/Price.php

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -273,6 +273,10 @@ private function prepareBundlePriceByType($priceType, array $dimensions, $entity
273273
['cwd' => $this->getTable('catalog_product_index_website')],
274274
'pw.website_id = cwd.website_id',
275275
[]
276+
)->joinLeft(
277+
['cgw' => $this->getTable('customer_group_excluded_website')],
278+
'cg.customer_group_id = cgw.customer_group_id AND pw.website_id = cgw.website_id',
279+
[]
276280
);
277281
$select->joinLeft(
278282
['tp' => $this->getTable('catalog_product_index_tier_price')],
@@ -365,6 +369,9 @@ private function prepareBundlePriceByType($priceType, array $dimensions, $entity
365369
$select->where('e.entity_id IN(?)', $entityIds);
366370
}
367371

372+
// exclude websites that are limited for customer group
373+
$select->where('cgw.website_id IS NULL');
374+
368375
/**
369376
* Add additional external limitation
370377
*/
@@ -714,6 +721,11 @@ private function prepareTierPriceIndex($dimensions, $entityIds)
714721
['pw' => $this->getTable('store_website')],
715722
'tp.website_id = 0 OR tp.website_id = pw.website_id',
716723
['website_id']
724+
)->joinLeft(
725+
// customer group website limitations
726+
['cgw' => $this->getTable('customer_group_excluded_website')],
727+
'cg.customer_group_id = cgw.customer_group_id AND pw.website_id = cgw.website_id',
728+
[]
717729
)->where(
718730
'pw.website_id != 0'
719731
)->where(
@@ -728,6 +740,10 @@ private function prepareTierPriceIndex($dimensions, $entityIds)
728740
if (!empty($entityIds)) {
729741
$select->where('e.entity_id IN(?)', $entityIds);
730742
}
743+
744+
// exclude websites that are limited for customer group
745+
$select->where('cgw.website_id IS NULL');
746+
731747
foreach ($dimensions as $dimension) {
732748
if (!isset($this->dimensionToFieldMapper[$dimension->getName()])) {
733749
throw new \LogicException(

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515
<title value="Guest customer should be able to advance search Bundle product with product description"/>
1616
<description value="Guest customer should be able to advance search Bundle product with product description"/>
1717
<severity value="MAJOR"/>
18-
<testCaseId value="MC-242"/>
19-
<group value="Bundle"/>
18+
<testCaseId value="MC-25427"/>
19+
<group value="bundle"/>
2020
<group value="SearchEngineElasticsearch"/>
2121
</annotations>
2222
<before>
@@ -43,9 +43,9 @@
4343
<deleteData createDataKey="simple1" stepKey="deleteSimple1" before="deleteSimple2"/>
4444
<deleteData createDataKey="simple2" stepKey="deleteSimple2" before="delete"/>
4545
</after>
46-
<see userInput="3 items" selector="{{StorefrontCatalogSearchAdvancedResultMainSection.itemFound}}" stepKey="see"/>
47-
<see userInput="$$product.name$$" selector="{{StorefrontCatalogSearchAdvancedResultMainSection.nthProductName('1')}}" stepKey="seeProductName"/>
48-
<see userInput="$$simple1.name$$" selector="{{StorefrontCatalogSearchAdvancedResultMainSection.nthProductName('2')}}" stepKey="seeSimple1ProductName"/>
49-
<see userInput="$$simple2.name$$" selector="{{StorefrontCatalogSearchAdvancedResultMainSection.nthProductName('3')}}" stepKey="seeSimple2ProductName"/>
46+
<see userInput="1 item" selector="{{StorefrontCatalogSearchAdvancedResultMainSection.itemFound}}" stepKey="see"/>
47+
<see userInput="$product.name$" selector="{{StorefrontCatalogSearchAdvancedResultMainSection.nthProductName('1')}}" stepKey="seeProductName"/>
48+
<comment userInput="BIC workaround" stepKey="seeSimple1ProductName"/>
49+
<comment userInput="BIC workaround" stepKey="seeSimple2ProductName"/>
5050
</test>
5151
</tests>

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515
<title value="Guest customer should be able to advance search Bundle product with product price"/>
1616
<description value="Guest customer should be able to advance search Bundle product with product price"/>
1717
<severity value="MAJOR"/>
18-
<testCaseId value="MC-251"/>
19-
<group value="Bundle"/>
18+
<testCaseId value="MC-25435"/>
19+
<group value="bundle"/>
2020
<group value="SearchEngineElasticsearch"/>
2121
</annotations>
2222
<before>
@@ -52,9 +52,9 @@
5252
<deleteData createDataKey="simple1" stepKey="deleteSimple1" before="deleteSimple2"/>
5353
<deleteData createDataKey="simple2" stepKey="deleteSimple2" before="delete"/>
5454
</after>
55-
<see userInput="3 items" selector="{{StorefrontCatalogSearchAdvancedResultMainSection.itemFound}}" stepKey="see"/>
56-
<see userInput="$$product.name$$" selector="{{StorefrontCatalogSearchAdvancedResultMainSection.nthProductName('1')}}" stepKey="seeProductName"/>
57-
<see userInput="$$simple1.name$$" selector="{{StorefrontCatalogSearchAdvancedResultMainSection.nthProductName('2')}}" stepKey="seeSimple1ProductName"/>
58-
<see userInput="$$simple2.name$$" selector="{{StorefrontCatalogSearchAdvancedResultMainSection.nthProductName('3')}}" stepKey="seeSimple2ProductName"/>
55+
<see userInput="1 item" selector="{{StorefrontCatalogSearchAdvancedResultMainSection.itemFound}}" stepKey="see"/>
56+
<see userInput="$product.name$" selector="{{StorefrontCatalogSearchAdvancedResultMainSection.nthProductName('1')}}" stepKey="seeProductName"/>
57+
<comment userInput="BIC workaround" stepKey="seeSimple1ProductName"/>
58+
<comment userInput="BIC workaround" stepKey="seeSimple2ProductName"/>
5959
</test>
6060
</tests>

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515
<title value="Guest customer should be able to advance search Bundle product with product short description"/>
1616
<description value="Guest customer should be able to advance search Bundle product with product short description"/>
1717
<severity value="MAJOR"/>
18-
<testCaseId value="MC-250"/>
19-
<group value="Bundle"/>
18+
<testCaseId value="MC-25434"/>
19+
<group value="bundle"/>
2020
<group value="SearchEngineElasticsearch"/>
2121
</annotations>
2222
<before>
@@ -43,9 +43,9 @@
4343
<deleteData createDataKey="simple1" stepKey="deleteSimple1" before="deleteSimple2"/>
4444
<deleteData createDataKey="simple2" stepKey="deleteSimple2" before="delete"/>
4545
</after>
46-
<see userInput="3 items" selector="{{StorefrontCatalogSearchAdvancedResultMainSection.itemFound}}" stepKey="see"/>
47-
<see userInput="$$product.name$$" selector="{{StorefrontCatalogSearchAdvancedResultMainSection.nthProductName('1')}}" stepKey="seeProductName"/>
48-
<see userInput="$$simple1.name$$" selector="{{StorefrontCatalogSearchAdvancedResultMainSection.nthProductName('2')}}" stepKey="seeSimple1ProductName"/>
49-
<see userInput="$$simple2.name$$" selector="{{StorefrontCatalogSearchAdvancedResultMainSection.nthProductName('3')}}" stepKey="seeSimple2ProductName"/>
46+
<see userInput="1 item" selector="{{StorefrontCatalogSearchAdvancedResultMainSection.itemFound}}" stepKey="see"/>
47+
<see userInput="$product.name$" selector="{{StorefrontCatalogSearchAdvancedResultMainSection.nthProductName('1')}}" stepKey="seeProductName"/>
48+
<comment userInput="BIC workaround" stepKey="seeSimple1ProductName"/>
49+
<comment userInput="BIC workaround" stepKey="seeSimple2ProductName"/>
5050
</test>
5151
</tests>

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515
<title value="Guest customer should be able to advance search Bundle product with product name"/>
1616
<description value="Guest customer should be able to advance search Bundle product with product name"/>
1717
<severity value="MAJOR"/>
18-
<testCaseId value="MC-139"/>
19-
<group value="Bundle"/>
18+
<testCaseId value="MC-25342"/>
19+
<group value="bundle"/>
2020
<group value="SearchEngineElasticsearch"/>
2121
</annotations>
2222
<before>
@@ -43,9 +43,9 @@
4343
<deleteData createDataKey="simple1" stepKey="deleteSimple1" before="deleteSimple2"/>
4444
<deleteData createDataKey="simple2" stepKey="deleteSimple2" before="delete"/>
4545
</after>
46-
<see userInput="3 items" selector="{{StorefrontCatalogSearchAdvancedResultMainSection.itemFound}}" stepKey="see"/>
47-
<see userInput="$$product.name$$" selector="{{StorefrontCatalogSearchAdvancedResultMainSection.nthProductName('1')}}" stepKey="seeProductName"/>
48-
<see userInput="$$simple1.name$$" selector="{{StorefrontCatalogSearchAdvancedResultMainSection.nthProductName('2')}}" stepKey="seeSimple1ProductName"/>
49-
<see userInput="$$simple2.name$$" selector="{{StorefrontCatalogSearchAdvancedResultMainSection.nthProductName('3')}}" stepKey="seeSimple2ProductName"/>
46+
<see userInput="1 item" selector="{{StorefrontCatalogSearchAdvancedResultMainSection.itemFound}}" stepKey="see"/>
47+
<see userInput="$product.name$" selector="{{StorefrontCatalogSearchAdvancedResultMainSection.nthProductName('1')}}" stepKey="seeProductName"/>
48+
<comment userInput="BIC workaround" stepKey="seeSimple1ProductName"/>
49+
<comment userInput="BIC workaround" stepKey="seeSimple2ProductName"/>
5050
</test>
5151
</tests>

0 commit comments

Comments
 (0)