Skip to content

Commit 3bb1494

Browse files
author
Magento CICD
authored
merge magento/2.3-develop into magento-earl-grey/MAGETWO-92929
2 parents 028156d + 34da3bd commit 3bb1494

31 files changed

+437
-31
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
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="../../../../../../vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Test/etc/actionGroupSchema.xsd">
11+
<!-- Add Bundle Product to Cart from the category page with specified quantity to cart -->
12+
<actionGroup name="StorefrontAddCategoryBundleProductToCartActionGroup">
13+
<arguments>
14+
<argument name="product"/>
15+
<argument name="quantity" defaultValue="1" type="string"/>
16+
</arguments>
17+
<moveMouseOver selector="{{StorefrontCategoryProductSection.ProductInfoByName(product.name)}}" stepKey="moveMouseOverProduct" />
18+
<click selector="{{StorefrontCategoryProductSection.ProductAddToCartByName(product.name)}}" stepKey="clickAddToCart" />
19+
<waitForPageLoad time="30" stepKey="waitForPageLoad1"/>
20+
<click selector="{{StorefrontBundleProductActionSection.customizeAndAddToCartButton}}" stepKey="clickCustomizeAndAddToCart"/>
21+
<waitForPageLoad time="30" stepKey="waitForPageLoad2"/>
22+
<fillField selector="{{StorefrontBundleProductActionSection.quantityField}}" userInput="{{quantity}}" stepKey="fillBundleProductQuantity"/>
23+
<click selector="{{StorefrontBundleProductActionSection.addToCartButton}}" stepKey="clickAddBundleProductToCart"/>
24+
<waitForPageLoad time="30" stepKey="waitForPageLoad3"/>
25+
<waitForText userInput="{{quantity}}" selector="{{StorefrontMinicartSection.productCount}}" time="30" stepKey="assertProductCount"/>
26+
</actionGroup>
27+
</actionGroups>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
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+
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
9+
xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Page/etc/SectionObject.xsd">
10+
<section name="StorefrontBundleProductActionSection">
11+
<element name="customizeAndAddToCartButton" type="button" selector="#bundle-slide"/>
12+
<element name="quantityField" type="input" selector="#qty"/>
13+
<element name="addToCartButton" type="button" selector="#product-addtocart-button"/>
14+
</section>
15+
</sections>

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

+1-2
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,7 @@
1212
<element name="backButton" type="button" selector="#back" timeout="30"/>
1313
<element name="saveButton" type="button" selector="#save-button" timeout="30"/>
1414
<element name="saveArrow" type="button" selector="button[data-ui-id='save-button-dropdown']" timeout="30"/>
15-
<!--<element name="saveAndClose" type="button" selector="span[title='Save &amp; Close']" timeout="30"/>-->
16-
<element name="saveAndClose" type="button" selector="span[id='save_and_close']" timeout="30"/>
15+
<element name="saveAndClose" type="button" selector="span[title='Save &amp; Close']" timeout="30"/>
1716
<element name="changeStoreButton" type="button" selector="#store-change-button" timeout="10"/>
1817
<element name="selectStoreView" type="button" selector="//ul[@data-role='stores-list']/li/a[normalize-space(.)='{{var1}}']" timeout="10" parameterized="true"/>
1918
</section>

app/code/Magento/Checkout/Test/Mftf/ActionGroup/StorefrontProductCartActionGroup.xml

+18
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,24 @@
2121
<waitForText userInput="{{productCount}}" selector="{{StorefrontMinicartSection.productCount}}" time="30" stepKey="assertProductCount"/>
2222
</actionGroup>
2323

24+
<!-- Add Product to Cart from the category page with specified quantity and check message and product count in Minicart -->
25+
<actionGroup name="StorefrontAddCategoryProductToCartWithQuantityActionGroup">
26+
<arguments>
27+
<argument name="product"/>
28+
<argument name="quantity" defaultValue="1" type="string"/>
29+
<argument name="checkQuantity" defaultValue="1" type="string"/>
30+
</arguments>
31+
<moveMouseOver selector="{{StorefrontCategoryProductSection.ProductInfoByName(product.name)}}" stepKey="moveMouseOverProduct" />
32+
<click selector="{{StorefrontCategoryProductSection.ProductAddToCartByName(product.name)}}" stepKey="clickAddToCart" />
33+
<!-- @TODO: Use general message selector after MQE-694 is fixed -->
34+
<waitForElement selector="{{StorefrontMessagesSection.messageProductAddedToCart(product.name)}}" time="30" stepKey="assertMessage"/>
35+
<waitForText userInput="{{checkQuantity}}" selector="{{StorefrontMinicartSection.productCount}}" time="30" stepKey="assertProductCount"/>
36+
<conditionalClick selector="{{StorefrontMinicartSection.showCart}}" dependentSelector="{{StorefrontMinicartSection.miniCartOpened}}" visible="false" stepKey="openMiniCart"/>
37+
<waitForElementVisible selector="{{StorefrontMinicartSection.viewAndEditCart}}" stepKey="waitForViewAndEditCartVisible"/>
38+
<fillField selector="{{StorefrontMinicartSection.itemQuantity(product.name)}}" userInput="{{quantity}}" stepKey="setProductQtyToFiftyInMiniCart"/>
39+
<click selector="{{StorefrontMinicartSection.itemQuantityUpdate(product.name)}}" stepKey="updateQtyInMiniCart"/>
40+
</actionGroup>
41+
2442
<!-- Add Product to Cart from the product page and check message and product count in Minicart -->
2543
<actionGroup name="StorefrontAddProductToCartActionGroup">
2644
<arguments>

app/code/Magento/Checkout/Test/Mftf/Section/StorefrontMiniCartSection.xml

+2
Original file line numberDiff line numberDiff line change
@@ -23,5 +23,7 @@
2323
<element name="viewAndEditCart" type="button" selector=".action.viewcart" timeout="30"/>
2424
<element name="miniCartItemsText" type="text" selector=".minicart-items"/>
2525
<element name="deleteMiniCartItem" type="button" selector=".action.delete" timeout="30"/>
26+
<element name="itemQuantity" type="input" selector="//a[text()='{{productName}}']/../..//input[contains(@class,'cart-item-qty')]" parameterized="true"/>
27+
<element name="itemQuantityUpdate" type="button" selector="//a[text()='{{productName}}']/../..//span[text()='Update']" parameterized="true"/>
2628
</section>
2729
</sections>

app/code/Magento/ConfigurableProduct/Test/Mftf/Section/AdminProductFormConfigurationsSection.xml

-5
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,6 @@
3131
<section name="AdminConfigurableProductSelectAttributesSlideOut">
3232
<element name="grid" type="button" selector=".admin__data-grid-wrap tbody"/>
3333
</section>
34-
<section name="AdminConfigurableProductAssignSourcesSlideOut">
35-
<element name="done" type="button" selector=".product_form_product_form_assign_sources_configurable_modal .action-primary" timeout="5"/>
36-
<element name="assignSources" type="button" selector="(//button/span[contains(text(), 'Assign Sources')])[2]" timeout="5"/>
37-
<element name="quantityPerSource" type="input" selector="input[name='quantity_resolver[dynamicRows][dynamicRows][0][quantity_per_source]']"/>
38-
</section>
3934
<section name="StorefrontConfigurableProductPage">
4035
<element name="productAttributeDropDown" type="select" selector="select[id*='attribute']"/>
4136
</section>

app/code/Magento/GroupedProduct/Test/Mftf/ActionGroup/AdminGroupedProductActionGroup.xml

+9
Original file line numberDiff line numberDiff line change
@@ -43,4 +43,13 @@
4343
<see selector="{{AdminProductGridSection.firstProductRow}}" userInput="{{product.name}}" stepKey="seeProductNameInGrid"/>
4444
<click selector="{{AdminProductGridFilterSection.clearFilters}}" stepKey="clickClearFiltersAfter"/>
4545
</actionGroup>
46+
47+
<!--Fill product min quantity in group products grid-->
48+
<actionGroup name="fillDefaultQuantityForLinkedToGroupProductInGrid">
49+
<arguments>
50+
<argument name="productName" type="string"/>
51+
<argument name="qty" type="string"/>
52+
</arguments>
53+
<fillField selector="{{AdminAddedProductsToGroupGrid.inputByProductName(productName)}}" userInput="{{qty}}" stepKey="fillDefaultQtyForLinkedProduct"/>
54+
</actionGroup>
4655
</actionGroups>

app/code/Magento/GroupedProduct/Test/Mftf/Section/AdminAddProductsToGroupPanelSection.xml

+4
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,8 @@
1616
<element name="firstCheckbox" type="input" selector="tr[data-repeat-index='0'] .admin__control-checkbox"/>
1717
<element name="nThCheckbox" type="input" selector="tr[data-repeat-index='{{n}}'] .admin__control-checkbox" parameterized="true"/>
1818
</section>
19+
20+
<section name="AdminAddedProductsToGroupGrid">
21+
<element name="inputByProductName" type="input" selector="//div[@data-index='grouped']//table//tr[td[@data-index='name']//span[text()='{{productName}}']]//td[@data-index='qty']//input" parameterized="true"/>
22+
</section>
1923
</sections>

app/code/Magento/MessageQueue/Model/Cron/ConsumersRunner.php

+3-1
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,8 @@ private function canBeRun($consumerName, array $allowedConsumers = [])
139139
*/
140140
private function getPidFilePath($consumerName)
141141
{
142-
return $consumerName . static::PID_FILE_EXT;
142+
$sanitizedHostname = preg_replace('/[^a-z0-9]/i', '', gethostname());
143+
144+
return $consumerName . '-' . $sanitizedHostname . static::PID_FILE_EXT;
143145
}
144146
}

app/code/Magento/MessageQueue/Test/Unit/Model/Cron/ConsumersRunnerTest.php

+11-9
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,8 @@ class ConsumersRunnerTest extends \PHPUnit\Framework\TestCase
5151
*/
5252
protected function setUp()
5353
{
54+
require_once __DIR__ . '/../../_files/consumers_runner_functions_mocks.php';
55+
5456
$this->phpExecutableFinderMock = $this->getMockBuilder(phpExecutableFinder::class)
5557
->disableOriginalConstructor()
5658
->getMock();
@@ -116,7 +118,7 @@ public function testRun(
116118
$isRunExpects
117119
) {
118120
$consumerName = 'consumerName';
119-
$pidFilePath = 'consumerName.pid';
121+
$pidFilePath = 'consumerName-myHostName.pid';
120122

121123
$this->deploymentConfigMock->expects($this->exactly(3))
122124
->method('get')
@@ -164,7 +166,7 @@ public function runDataProvider()
164166
'isRun' => false,
165167
'php' => '',
166168
'command' => 'php '. BP . '/bin/magento queue:consumers:start %s %s %s',
167-
'arguments' => ['consumerName', '--pid-file-path=consumerName.pid', '--max-messages=20000'],
169+
'arguments' => ['consumerName', '--pid-file-path=consumerName-myHostName.pid', '--max-messages=20000'],
168170
'allowedConsumers' => [],
169171
'shellBackgroundExpects' => 1,
170172
'isRunExpects' => 1,
@@ -174,7 +176,7 @@ public function runDataProvider()
174176
'isRun' => false,
175177
'php' => '',
176178
'command' => 'php '. BP . '/bin/magento queue:consumers:start %s %s %s',
177-
'arguments' => ['consumerName', '--pid-file-path=consumerName.pid', '--max-messages=10000'],
179+
'arguments' => ['consumerName', '--pid-file-path=consumerName-myHostName.pid', '--max-messages=10000'],
178180
'allowedConsumers' => [],
179181
'shellBackgroundExpects' => 1,
180182
'isRunExpects' => 1,
@@ -184,7 +186,7 @@ public function runDataProvider()
184186
'isRun' => false,
185187
'php' => '',
186188
'command' => 'php '. BP . '/bin/magento queue:consumers:start %s %s %s',
187-
'arguments' => ['consumerName', '--pid-file-path=consumerName.pid', '--max-messages=10000'],
189+
'arguments' => ['consumerName', '--pid-file-path=consumerName-myHostName.pid', '--max-messages=10000'],
188190
'allowedConsumers' => ['someConsumer'],
189191
'shellBackgroundExpects' => 0,
190192
'isRunExpects' => 0,
@@ -194,7 +196,7 @@ public function runDataProvider()
194196
'isRun' => true,
195197
'php' => '',
196198
'command' => 'php '. BP . '/bin/magento queue:consumers:start %s %s %s',
197-
'arguments' => ['consumerName', '--pid-file-path=consumerName.pid', '--max-messages=10000'],
199+
'arguments' => ['consumerName', '--pid-file-path=consumerName-myHostName.pid', '--max-messages=10000'],
198200
'allowedConsumers' => ['someConsumer'],
199201
'shellBackgroundExpects' => 0,
200202
'isRunExpects' => 0,
@@ -204,7 +206,7 @@ public function runDataProvider()
204206
'isRun' => true,
205207
'php' => '',
206208
'command' => 'php '. BP . '/bin/magento queue:consumers:start %s %s %s',
207-
'arguments' => ['consumerName', '--pid-file-path=consumerName.pid', '--max-messages=10000'],
209+
'arguments' => ['consumerName', '--pid-file-path=consumerName-myHostName.pid', '--max-messages=10000'],
208210
'allowedConsumers' => [],
209211
'shellBackgroundExpects' => 0,
210212
'isRunExpects' => 1,
@@ -214,7 +216,7 @@ public function runDataProvider()
214216
'isRun' => true,
215217
'php' => '',
216218
'command' => 'php '. BP . '/bin/magento queue:consumers:start %s %s %s',
217-
'arguments' => ['consumerName', '--pid-file-path=consumerName.pid', '--max-messages=10000'],
219+
'arguments' => ['consumerName', '--pid-file-path=consumerName-myHostName.pid', '--max-messages=10000'],
218220
'allowedConsumers' => ['consumerName'],
219221
'shellBackgroundExpects' => 0,
220222
'isRunExpects' => 1,
@@ -224,7 +226,7 @@ public function runDataProvider()
224226
'isRun' => false,
225227
'php' => '',
226228
'command' => 'php '. BP . '/bin/magento queue:consumers:start %s %s %s',
227-
'arguments' => ['consumerName', '--pid-file-path=consumerName.pid', '--max-messages=10000'],
229+
'arguments' => ['consumerName', '--pid-file-path=consumerName-myHostName.pid', '--max-messages=10000'],
228230
'allowedConsumers' => ['consumerName'],
229231
'shellBackgroundExpects' => 1,
230232
'isRunExpects' => 1,
@@ -234,7 +236,7 @@ public function runDataProvider()
234236
'isRun' => false,
235237
'php' => '/bin/php',
236238
'command' => '/bin/php '. BP . '/bin/magento queue:consumers:start %s %s',
237-
'arguments' => ['consumerName', '--pid-file-path=consumerName.pid'],
239+
'arguments' => ['consumerName', '--pid-file-path=consumerName-myHostName.pid'],
238240
'allowedConsumers' => ['consumerName'],
239241
'shellBackgroundExpects' => 1,
240242
'isRunExpects' => 1,
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<?php
2+
/**
3+
* Copyright © Magento, Inc. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
declare(strict_types=1);
7+
8+
namespace Magento\MessageQueue\Model\Cron;
9+
10+
/**
11+
* @return string
12+
*/
13+
function gethostname()
14+
{
15+
return 'myHost@Name';
16+
}

0 commit comments

Comments
 (0)