Skip to content

Commit 0b4adc2

Browse files
committed
Merge branch 'MAGETWO-97026' into 2.3-develop-mftf-pr12
2 parents 59dfd6e + 1d70b83 commit 0b4adc2

File tree

141 files changed

+2062
-283
lines changed

Some content is hidden

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

141 files changed

+2062
-283
lines changed

app/code/Magento/User/Test/Mftf/ActionGroup/AdminRoleActionGroup.xml renamed to app/code/Magento/Braintree/Test/Mftf/ActionGroup/AdminRoleActionGroup.xml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
-->
88
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
99
xsi:noNamespaceSchemaLocation="../../../../../../../dev/tests/acceptance/vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Test/etc/actionGroupSchema.xsd">
10+
1011
<actionGroup name="GoToUserRoles">
1112
<click selector="#menu-magento-backend-system" stepKey="clickOnSystemIcon"/>
1213
<waitForPageLoad stepKey="waitForSystemsPageToOpen"/>
@@ -15,18 +16,19 @@
1516
</actionGroup>
1617

1718
<!--Create new role-->
18-
<actionGroup name="AdminCreateRole">
19+
<actionGroup name="AdminCreateNewRole">
1920
<arguments>
2021
<argument name="role" type="string" defaultValue=""/>
2122
<argument name="resource" type="string" defaultValue="All"/>
23+
<argument name="scope" type="string" defaultValue="Custom"/>
24+
<argument name="websites" type="string" defaultValue="Main Website"/>
2225
</arguments>
2326
<click selector="{{AdminCreateRoleSection.create}}" stepKey="clickToAddNewRole"/>
2427
<fillField selector="{{AdminCreateRoleSection.name}}" userInput="{{role.name}}" stepKey="setRoleName"/>
2528
<fillField stepKey="setPassword" selector="{{AdminCreateRoleSection.password}}" userInput="{{_ENV.MAGENTO_ADMIN_PASSWORD}}"/>
2629
<click selector="{{AdminCreateRoleSection.roleResources}}" stepKey="clickToOpenRoleResources"/>
2730
<waitForPageLoad stepKey="waitForRoleResourcePage" time="5"/>
28-
<click selector="{{AdminCreateRoleSection.roleScope}}" stepKey="clickToExpandScopeAccess"/>
29-
<click selector="{{AdminCreateRoleSection.scopeValue(resource)}}" stepKey="clickToSelectScopeAccess"/>
31+
<click stepKey="checkSales" selector="//a[text()='Sales']"/>
3032
<click selector="{{AdminCreateRoleSection.save}}" stepKey="clickToSaveRole"/>
3133
<waitForPageLoad stepKey="waitForPageLoad" time="10"/>
3234
<see userInput="You saved the role." stepKey="seeSuccessMessage" />
@@ -46,4 +48,4 @@
4648
<waitForPageLoad stepKey="waitForPageLoad" time="10"/>
4749
<see stepKey="seeSuccessMessage" userInput="You deleted the role."/>
4850
</actionGroup>
49-
</actionGroups>
51+
</actionGroups>

app/code/Magento/User/Test/Mftf/ActionGroup/AdminUserActionGroup.xml renamed to app/code/Magento/Braintree/Test/Mftf/ActionGroup/AdminUserActionGroup.xml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,9 @@
4141

4242

4343
<!--Delete User-->
44-
<actionGroup name="AdminDeleteUserActionGroup">
44+
<actionGroup name="AdminDeleteNewUserActionGroup">
45+
4546
<click stepKey="clickOnUser" selector="{{AdminDeleteUserSection.theUser}}"/>
46-
<waitForPageLoad stepKey="waitForUserPageToLoad"/>
4747
<fillField stepKey="TypeCurrentPassword" selector="{{AdminDeleteUserSection.password}}" userInput="{{_ENV.MAGENTO_ADMIN_PASSWORD}}"/>
4848
<scrollToTopOfPage stepKey="scrollToTop"/>
4949
<click stepKey="clickToDeleteUser" selector="{{AdminDeleteUserSection.delete}}"/>
@@ -52,4 +52,5 @@
5252
<waitForPageLoad stepKey="waitForPageLoad" time="10"/>
5353
<see userInput="You deleted the user." stepKey="seeSuccessMessage" />
5454
</actionGroup>
55+
5556
</actionGroups>

app/code/Magento/Braintree/Test/Mftf/Test/CreateAnAdminOrderUsingBraintreePaymentTest1.xml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,16 +40,18 @@
4040

4141
<!--Create New Role-->
4242
<actionGroup ref="GoToUserRoles" stepKey="GoToUserRoles"/>
43-
<actionGroup ref="AdminCreateRole" stepKey="AdminCreateNewRole"/>
43+
<waitForPageLoad stepKey="waitForAllRoles" time="15"/>
44+
<actionGroup ref="AdminCreateNewRole" stepKey="AdminCreateNewRole"/>
4445

45-
<!--Create New User With Specific Role-->
46+
<!--Create new admin user-->
4647
<actionGroup ref="GoToAllUsers" stepKey="GoToAllUsers"/>
48+
<waitForPageLoad stepKey="waitForUsers" time="15"/>
4749
<actionGroup ref="AdminCreateUserAction" stepKey="AdminCreateNewUser"/>
4850

4951
<!--SignOut-->
5052
<actionGroup ref="logout" stepKey="signOutFromAdmin"/>
5153

52-
<!--SignIn New User-->
54+
<!--Log in as new user-->
5355
<actionGroup ref="LoginNewUser" stepKey="signInNewUser"/>
5456
<waitForPageLoad stepKey="waitForLogin" time="3"/>
5557

@@ -93,7 +95,7 @@
9395

9496
<!--Delete User -->
9597
<actionGroup ref="GoToAllUsers" stepKey="GoBackToAllUsers"/>
96-
<actionGroup ref="AdminDeleteUserActionGroup" stepKey="AdminDeleteUserActionGroup"/>
98+
<actionGroup ref="AdminDeleteNewUserActionGroup" stepKey="AdminDeleteUserActionGroup"/>
9799

98100
<!--Delete Role-->
99101
<actionGroup ref="GoToUserRoles" stepKey="GoBackToUserRoles"/>

app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Action/Attribute/Tab/Inventory.php

Lines changed: 38 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
*/
66
namespace Magento\Catalog\Block\Adminhtml\Product\Edit\Action\Attribute\Tab;
77

8+
use Magento\Customer\Api\Data\GroupInterface;
9+
810
/**
911
* Products mass update inventory tab
1012
*
@@ -29,20 +31,29 @@ class Inventory extends \Magento\Backend\Block\Widget implements \Magento\Backen
2931
*/
3032
protected $disabledFields = [];
3133

34+
/**
35+
* @var \Magento\Framework\Serialize\SerializerInterface
36+
*/
37+
private $serializer;
38+
3239
/**
3340
* @param \Magento\Backend\Block\Template\Context $context
3441
* @param \Magento\CatalogInventory\Model\Source\Backorders $backorders
3542
* @param \Magento\CatalogInventory\Api\StockConfigurationInterface $stockConfiguration
3643
* @param array $data
44+
* @param \Magento\Framework\Serialize\SerializerInterface|null $serializer
3745
*/
3846
public function __construct(
3947
\Magento\Backend\Block\Template\Context $context,
4048
\Magento\CatalogInventory\Model\Source\Backorders $backorders,
4149
\Magento\CatalogInventory\Api\StockConfigurationInterface $stockConfiguration,
42-
array $data = []
50+
array $data = [],
51+
\Magento\Framework\Serialize\SerializerInterface $serializer = null
4352
) {
4453
$this->_backorders = $backorders;
4554
$this->stockConfiguration = $stockConfiguration;
55+
$this->serializer = $serializer ?? \Magento\Framework\App\ObjectManager::getInstance()
56+
->get(\Magento\Framework\Serialize\SerializerInterface::class);
4657
parent::__construct($context, $data);
4758
}
4859

@@ -70,11 +81,13 @@ public function getFieldSuffix()
7081
* Retrieve current store id
7182
*
7283
* @return int
84+
* @SuppressWarnings(PHPMD.RequestAwareBlockMethod)
7385
*/
7486
public function getStoreId()
7587
{
76-
$storeId = $this->getRequest()->getParam('store');
77-
return (int) $storeId;
88+
$storeId = (int)$this->getRequest()->getParam('store');
89+
90+
return $storeId;
7891
}
7992

8093
/**
@@ -88,6 +101,22 @@ public function getDefaultConfigValue($field)
88101
return $this->stockConfiguration->getDefaultConfigValue($field);
89102
}
90103

104+
/**
105+
* Returns min_sale_qty configuration for the ALL Customer Group
106+
*
107+
* @return float
108+
*/
109+
public function getDefaultMinSaleQty()
110+
{
111+
$default = $this->stockConfiguration->getDefaultConfigValue('min_sale_qty');
112+
if (!is_numeric($default)) {
113+
$default = $this->serializer->unserialize($default);
114+
$default = $default[GroupInterface::CUST_GROUP_ALL] ?? 1;
115+
}
116+
117+
return (float) $default;
118+
}
119+
91120
/**
92121
* Tab settings
93122
*
@@ -99,6 +128,8 @@ public function getTabLabel()
99128
}
100129

101130
/**
131+
* Return Tab title.
132+
*
102133
* @return \Magento\Framework\Phrase
103134
*/
104135
public function getTabTitle()
@@ -107,22 +138,24 @@ public function getTabTitle()
107138
}
108139

109140
/**
110-
* @return bool
141+
* @inheritdoc
111142
*/
112143
public function canShowTab()
113144
{
114145
return true;
115146
}
116147

117148
/**
118-
* @return bool
149+
* @inheritdoc
119150
*/
120151
public function isHidden()
121152
{
122153
return false;
123154
}
124155

125156
/**
157+
* Get availability status.
158+
*
126159
* @param string $fieldName
127160
* @return bool
128161
* @SuppressWarnings(PHPMD.UnusedFormalParameter)

app/code/Magento/Catalog/Model/Category/Attribute/Source/Layout.php

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,12 @@ class Layout extends \Magento\Eav\Model\Entity\Attribute\Source\AbstractSource
1717
*/
1818
protected $pageLayoutBuilder;
1919

20+
/**
21+
* @inheritdoc
22+
* @deprecated since the cache is now handled by \Magento\Theme\Model\PageLayout\Config\Builder::$configFiles
23+
*/
24+
protected $_options = null;
25+
2026
/**
2127
* @param \Magento\Framework\View\Model\PageLayout\Config\BuilderInterface $pageLayoutBuilder
2228
*/
@@ -26,14 +32,14 @@ public function __construct(\Magento\Framework\View\Model\PageLayout\Config\Buil
2632
}
2733

2834
/**
29-
* {@inheritdoc}
35+
* @inheritdoc
3036
*/
3137
public function getAllOptions()
3238
{
33-
if (!$this->_options) {
34-
$this->_options = $this->pageLayoutBuilder->getPageLayoutsConfig()->toOptionArray();
35-
array_unshift($this->_options, ['value' => '', 'label' => __('No layout updates')]);
36-
}
37-
return $this->_options;
39+
$options = $this->pageLayoutBuilder->getPageLayoutsConfig()->toOptionArray();
40+
array_unshift($options, ['value' => '', 'label' => __('No layout updates')]);
41+
$this->_options = $options;
42+
43+
return $options;
3844
}
3945
}

app/code/Magento/Catalog/Model/Product/Attribute/Source/Layout.php

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,12 @@ class Layout extends \Magento\Eav\Model\Entity\Attribute\Source\AbstractSource
1717
*/
1818
protected $pageLayoutBuilder;
1919

20+
/**
21+
* @inheritdoc
22+
* @deprecated since the cache is now handled by \Magento\Theme\Model\PageLayout\Config\Builder::$configFiles
23+
*/
24+
protected $_options = null;
25+
2026
/**
2127
* @param \Magento\Framework\View\Model\PageLayout\Config\BuilderInterface $pageLayoutBuilder
2228
*/
@@ -26,14 +32,14 @@ public function __construct(\Magento\Framework\View\Model\PageLayout\Config\Buil
2632
}
2733

2834
/**
29-
* @return array
35+
* @inheritdoc
3036
*/
3137
public function getAllOptions()
3238
{
33-
if (!$this->_options) {
34-
$this->_options = $this->pageLayoutBuilder->getPageLayoutsConfig()->toOptionArray();
35-
array_unshift($this->_options, ['value' => '', 'label' => __('No layout updates')]);
36-
}
37-
return $this->_options;
39+
$options = $this->pageLayoutBuilder->getPageLayoutsConfig()->toOptionArray();
40+
array_unshift($options, ['value' => '', 'label' => __('No layout updates')]);
41+
$this->_options = $options;
42+
43+
return $options;
3844
}
3945
}

app/code/Magento/Catalog/Model/ResourceModel/Product/Collection.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2218,7 +2218,7 @@ private function getTierPriceSelect(array $productIds)
22182218
$this->getLinkField() . ' IN(?)',
22192219
$productIds
22202220
)->order(
2221-
$this->getLinkField()
2221+
'qty'
22222222
);
22232223
return $select;
22242224
}

app/code/Magento/Catalog/Test/Mftf/Data/CategoryData.xml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,4 +62,12 @@
6262
<data key="name" unique="suffix">FifthLevelCategory</data>
6363
<data key="name_lwr" unique="suffix">category</data>
6464
</entity>
65+
<entity name="SimpleRootSubCategory" type="category">
66+
<data key="name" unique="suffix">SimpleRootSubCategory</data>
67+
<data key="name_lwr" unique="suffix">simplerootsubcategory</data>
68+
<data key="is_active">true</data>
69+
<data key="include_in_menu">true</data>
70+
<data key="url_key" unique="suffix">simplerootsubcategory</data>
71+
<var key="parent_id" entityType="category" entityKey="id" />
72+
</entity>
6573
</entities>

app/code/Magento/Catalog/Test/Mftf/Data/ProductData.xml

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -481,7 +481,7 @@
481481
<requiredEntity type="custom_attribute">CustomAttributeProductAttribute</requiredEntity>
482482
</entity>
483483
<entity name="defaultSimpleProduct" type="product">
484-
<data key="name" unique="suffix">Test </data>
484+
<data key="name" unique="suffix">Testp</data>
485485
<data key="sku" unique="suffix">testsku</data>
486486
<data key="type_id">simple</data>
487487
<data key="attribute_set_id">4</data>
@@ -497,6 +497,19 @@
497497
<data key="name" unique="suffix">Product With Long Name And Sku - But not too long</data>
498498
<data key="sku" unique="suffix">Product With Long Name And Sku - But not too long</data>
499499
</entity>
500+
<entity name="PaginationProduct" type="product">
501+
<data key="name" unique="suffix">pagi</data>
502+
<data key="sku" unique="suffix">pagisku</data>
503+
<data key="type_id">simple</data>
504+
<data key="attribute_set_id">4</data>
505+
<data key="visibility">4</data>
506+
<data key="price">780.00</data>
507+
<data key="urlKey" unique="suffix">pagiurl-</data>
508+
<data key="status">1</data>
509+
<data key="quantity">50</data>
510+
<data key="weight">5</data>
511+
<requiredEntity type="product_extension_attribute">EavStock100</requiredEntity>
512+
</entity>
500513
<entity name="Magento3" type="image">
501514
<data key="title" unique="suffix">Magento3</data>
502515
<data key="price">1.00</data>

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,6 @@
1616
<element name="rowPosition" type="input" selector="#catalog_category_products_table tbody tr:nth-of-type({{row}}) .col-position .position input" timeout="30" parameterized="true"/>
1717
<element name="productGridNameProduct" type="text" selector="//table[@id='catalog_category_products_table']//td[contains(., '{{productName}}')]" parameterized="true"/>
1818
<element name="productVisibility" type="select" selector="//*[@name='product[visibility]']"/>
19+
<element name="productSelectAll" type="checkbox" selector="input.admin__control-checkbox"/>
1920
</section>
2021
</sections>

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,5 +31,7 @@
3131
<element name="newFromDateFilter" type="input" selector="input.admin__control-text[name='news_from_date[from]']"/>
3232
<element name="keywordSearch" type="input" selector="input#fulltext"/>
3333
<element name="keywordSearchButton" type="button" selector=".data-grid-search-control-wrap button.action-submit" timeout="30"/>
34+
<element name="productCount" type="text" selector="#catalog_category_products-total-count"/>
35+
<element name="productPerPage" type="select" selector="#catalog_category_products_page-limit"/>
3436
</section>
3537
</sections>

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
1010
<section name="AdminProductGridSection">
1111
<element name="productRowBySku" type="block" selector="//div[@id='container']//tr//td[count(../../..//th[./*[.='SKU']]/preceding-sibling::th) + 1][./*[.='{{sku}}']]" parameterized="true" />
12+
<element name="productRowCheckboxBySku" type="block" selector="//div[@id='container']//tr//td[count(../../..//th[./*[.='SKU']]/preceding-sibling::th) + 1][./*[.='{{sku}}']]/../td//input[@data-action='select-row']" parameterized="true" />
1213
<element name="loadingMask" type="text" selector=".admin__data-grid-loading-mask[data-component*='product_listing']"/>
1314
<element name="columnHeader" type="button" selector="//div[@data-role='grid-wrapper']//table[contains(@class, 'data-grid')]/thead/tr/th[contains(@class, 'data-grid-th')]/span[text() = '{{label}}']" parameterized="true" timeout="30"/>
1415
<element name="column" type="text" selector="//tr//td[count(//div[@data-role='grid-wrapper']//tr//th[contains(., '{{column}}')]/preceding-sibling::th) +1 ]" parameterized="true"/>
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
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="urn:magento:mftf:Page/etc/SectionObject.xsd">
10+
<section name="StorefrontCategoryBottomToolbarSection">
11+
<element name="nextPage" type="button" selector=".//*[@class='toolbar toolbar-products'][2]//a[contains(@class, 'next')]" timeout="30"/>
12+
<element name="previousPage" type="button" selector=".//*[@class='toolbar toolbar-products'][2]//a[contains(@class, 'previous')]" timeout="30"/>
13+
<element name="pageNumber" type="text" selector="//*[@class='toolbar toolbar-products'][2]//a[contains(@class, 'page')]//span[2][contains(text() ,'{{var1}}')]" parameterized="true"/>
14+
<element name="perPage" type="select" selector="//*[@class='toolbar toolbar-products'][2]//select[@id='limiter']"/>
15+
</section>
16+
</sections>

0 commit comments

Comments
 (0)