-
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 #4940 from magento-engcom/2.3-develop-expedited-prs
[Magento Community Engineering] Community Contributions - 2.3-develop expedited
- Loading branch information
Showing
26 changed files
with
769 additions
and
30 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
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
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
26 changes: 26 additions & 0 deletions
26
...est/Mftf/ActionGroup/AdminAssertDefaultValueDisableAutoGroupInCustomerFormActionGroup.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,26 @@ | ||
<?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"> | ||
<!-- Check Default Value for Disable Automatic Group Changes Based on VAT ID in Customer Form --> | ||
<actionGroup name="AdminAssertDefaultValueDisableAutoGroupInCustomerFormActionGroup"> | ||
<annotations> | ||
<description>Check Default Value for Disable Automatic Group Changes Based on VAT ID in Create Customer form.</description> | ||
</annotations> | ||
<arguments> | ||
<argument name="isChecked" type="string"/> | ||
</arguments> | ||
|
||
<grabValueFrom selector="{{AdminCustomerAccountInformationSection.disableAutomaticGroupChange}}" stepKey="grabDisableAutomaticGroupChange"/> | ||
<assertEquals stepKey="assertDisableAutomaticGroupChangeNo" message="pass"> | ||
<expectedResult type="string">{{isChecked}}</expectedResult> | ||
<actualResult type="variable">grabDisableAutomaticGroupChange</actualResult> | ||
</assertEquals> | ||
</actionGroup> | ||
</actionGroups> |
19 changes: 19 additions & 0 deletions
19
app/code/Magento/Customer/Test/Mftf/ActionGroup/AdminNavigateNewCustomerActionGroup.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,19 @@ | ||
<?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"> | ||
<actionGroup name="AdminNavigateNewCustomerActionGroup"> | ||
<annotations> | ||
<description>Goes to the New Customer page.</description> | ||
</annotations> | ||
|
||
<amOnPage url="{{AdminNewCustomerPage.url}}" stepKey="navigateToCustomers"/> | ||
<waitForPageLoad stepKey="waitForLoad"/> | ||
</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
36 changes: 36 additions & 0 deletions
36
.../Magento/Customer/Test/Mftf/Test/AdminCheckDefaultValueDisableAutoGroupChangeIsNoTest.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,36 @@ | ||
<?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="AdminCheckDefaultValueDisableAutoGroupChangeIsNoTest"> | ||
<annotations> | ||
<features value="Customer"/> | ||
<stories value="Default Value for Disable Automatic Group Changes Based on VAT ID"/> | ||
<title value="Check settings Default Value for Disable Automatic Group Changes Based on VAT ID is No"/> | ||
<description value="Check settings Default Value for Disable Automatic Group Changes Based on VAT ID is No"/> | ||
<severity value="MAJOR"/> | ||
<group value="customer"/> | ||
<group value="create"/> | ||
</annotations> | ||
<before> | ||
<magentoCLI command="config:set customer/create_account/viv_disable_auto_group_assign_default 0" stepKey="setConfigDefaultIsNo"/> | ||
<magentoCLI command="cache:flush" stepKey="flushCache"/> | ||
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin1"/> | ||
</before> | ||
<after> | ||
<actionGroup ref="logout" stepKey="adminLogout"/> | ||
</after> | ||
|
||
<actionGroup ref="AdminNavigateNewCustomerActionGroup" stepKey="navigateToNewCustomer"/> | ||
|
||
<actionGroup ref="AdminAssertDefaultValueDisableAutoGroupInCustomerFormActionGroup" stepKey="seeDefaultValueInForm"> | ||
<argument name="isChecked" value="0"/> | ||
</actionGroup> | ||
</test> | ||
</tests> |
38 changes: 38 additions & 0 deletions
38
...Magento/Customer/Test/Mftf/Test/AdminCheckDefaultValueDisableAutoGroupChangeIsYesTest.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,38 @@ | ||
<?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="AdminCheckDefaultValueDisableAutoGroupChangeIsYesTest"> | ||
<annotations> | ||
<features value="Customer"/> | ||
<stories value="Default Value for Disable Automatic Group Changes Based on VAT ID"/> | ||
<title value="Check settings Default Value for Disable Automatic Group Changes Based on VAT ID is Yes"/> | ||
<description value="Check settings Default Value for Disable Automatic Group Changes Based on VAT ID is Yes"/> | ||
<severity value="MAJOR"/> | ||
<group value="customer"/> | ||
<group value="create"/> | ||
</annotations> | ||
<before> | ||
<magentoCLI command="config:set customer/create_account/viv_disable_auto_group_assign_default 1" stepKey="setConfigDefaultIsYes"/> | ||
<magentoCLI command="cache:flush" stepKey="flushCache"/> | ||
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin1"/> | ||
</before> | ||
<after> | ||
<magentoCLI command="config:set customer/create_account/viv_disable_auto_group_assign_default 0" stepKey="setConfigDefaultIsNo"/> | ||
<magentoCLI command="cache:flush" stepKey="flushCache"/> | ||
<actionGroup ref="logout" stepKey="adminLogout"/> | ||
</after> | ||
|
||
<actionGroup ref="AdminNavigateNewCustomerActionGroup" stepKey="navigateToNewCustomer"/> | ||
|
||
<actionGroup ref="AdminAssertDefaultValueDisableAutoGroupInCustomerFormActionGroup" stepKey="seeDefaultValueInForm"> | ||
<argument name="isChecked" value="1"/> | ||
</actionGroup> | ||
</test> | ||
</tests> |
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
70 changes: 70 additions & 0 deletions
70
app/code/Magento/Customer/Ui/Component/Form/Field/DisableAutoGroupChange.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,70 @@ | ||
<?php | ||
/** | ||
* Copyright © Magento, Inc. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
declare(strict_types=1); | ||
|
||
namespace Magento\Customer\Ui\Component\Form\Field; | ||
|
||
use Magento\Framework\View\Element\UiComponent\ContextInterface; | ||
use Magento\Framework\View\Element\UiComponentFactory; | ||
use Magento\Framework\View\Element\UiComponentInterface; | ||
use Magento\Customer\Helper\Address as AddressHelper; | ||
|
||
/** | ||
* Process setting to set Default Value for Disable Automatic Group Changes Based on VAT ID | ||
* | ||
* Class \Magento\Customer\Ui\Component\Form\Field\DisableAutoGroupChange | ||
*/ | ||
class DisableAutoGroupChange extends \Magento\Ui\Component\Form\Field | ||
{ | ||
/** | ||
* Yes value for Default Value for Disable Automatic Group Changes Based on VAT ID | ||
*/ | ||
const DISABLE_AUTO_GROUP_CHANGE_YES = '1'; | ||
|
||
/** | ||
* Address Helper | ||
* | ||
* @var AddressHelper | ||
*/ | ||
private $addressHelper; | ||
|
||
/** | ||
* Constructor | ||
* | ||
* @param ContextInterface $context | ||
* @param UiComponentFactory $uiComponentFactory | ||
* @param AddressHelper $addressHelper | ||
* @param UiComponentInterface[] $components | ||
* @param array $data | ||
*/ | ||
public function __construct( | ||
ContextInterface $context, | ||
UiComponentFactory $uiComponentFactory, | ||
AddressHelper $addressHelper, | ||
array $components = [], | ||
array $data = [] | ||
) { | ||
$this->addressHelper = $addressHelper; | ||
parent::__construct($context, $uiComponentFactory, $components, $data); | ||
} | ||
|
||
/** | ||
* Prepare component configuration | ||
* | ||
* @return void | ||
* @throws \Magento\Framework\Exception\LocalizedException | ||
*/ | ||
public function prepare() | ||
{ | ||
parent::prepare(); | ||
|
||
if ($this->addressHelper->isDisableAutoGroupAssignDefaultValue()) { | ||
$currentConfig = $this->getData('config'); | ||
$currentConfig['default'] = self::DISABLE_AUTO_GROUP_CHANGE_YES; | ||
$this->setData('config', $currentConfig); | ||
} | ||
} | ||
} |
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
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
...st/Mftf/ActionGroup/AdminAssertStoreViewRatingTitleWhenSingleStoreModeIsNoActionGroup.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. | ||
*/ | ||
--> | ||
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> | ||
<actionGroup name="AdminAssertStoreViewRatingTitleWhenSingleStoreModeIsNoActionGroup"> | ||
<annotations> | ||
<description>If Single Store Mode is disabled, default store view title label should be displayed.</description> | ||
</annotations> | ||
<seeElement selector="{{AdminEditAndNewRatingSection.defaultStoreViewTitleLabel}}" stepKey="seeLabel"/> | ||
<seeElement selector="{{AdminEditAndNewRatingSection.defaultStoreViewTitleInput}}" stepKey="seeInput"/> | ||
</actionGroup> | ||
</actionGroups> |
Oops, something went wrong.