diff --git a/app/code/Magento/AdminAnalytics/Test/Mftf/Test/TrackingScriptTest.xml b/app/code/Magento/AdminAnalytics/Test/Mftf/Test/TrackingScriptTest.xml index 58bcacc190cff..e02c34fd8868e 100644 --- a/app/code/Magento/AdminAnalytics/Test/Mftf/Test/TrackingScriptTest.xml +++ b/app/code/Magento/AdminAnalytics/Test/Mftf/Test/TrackingScriptTest.xml @@ -21,6 +21,6 @@ - + \ No newline at end of file diff --git a/app/code/Magento/AdminNotification/Test/Mftf/Test/AdminSystemNotificationNavigateMenuTest.xml b/app/code/Magento/AdminNotification/Test/Mftf/Test/AdminSystemNotificationNavigateMenuTest.xml index 81ad2858d5901..77c8f02bfb777 100644 --- a/app/code/Magento/AdminNotification/Test/Mftf/Test/AdminSystemNotificationNavigateMenuTest.xml +++ b/app/code/Magento/AdminNotification/Test/Mftf/Test/AdminSystemNotificationNavigateMenuTest.xml @@ -20,7 +20,7 @@ - + diff --git a/app/code/Magento/Analytics/Test/Mftf/Test/AdminAdvancedReportingNavigateMenuTest.xml b/app/code/Magento/Analytics/Test/Mftf/Test/AdminAdvancedReportingNavigateMenuTest.xml index c742248b32cc3..ee25e80fcab30 100644 --- a/app/code/Magento/Analytics/Test/Mftf/Test/AdminAdvancedReportingNavigateMenuTest.xml +++ b/app/code/Magento/Analytics/Test/Mftf/Test/AdminAdvancedReportingNavigateMenuTest.xml @@ -20,7 +20,7 @@ - + diff --git a/app/code/Magento/AsynchronousOperations/Api/SaveMultipleOperationsInterface.php b/app/code/Magento/AsynchronousOperations/Api/SaveMultipleOperationsInterface.php new file mode 100644 index 0000000000000..8563ab6541a0c --- /dev/null +++ b/app/code/Magento/AsynchronousOperations/Api/SaveMultipleOperationsInterface.php @@ -0,0 +1,27 @@ +setUserId($userId); $bulkSummary->setUserType($userType); $bulkSummary->setOperationCount((int)$bulkSummary->getOperationCount() + count($operations)); - $this->entityManager->save($bulkSummary); $connection->commit(); diff --git a/app/code/Magento/AsynchronousOperations/Model/MassSchedule.php b/app/code/Magento/AsynchronousOperations/Model/MassSchedule.php index 0e197fc811adc..4dcaf7279a570 100644 --- a/app/code/Magento/AsynchronousOperations/Model/MassSchedule.php +++ b/app/code/Magento/AsynchronousOperations/Model/MassSchedule.php @@ -16,6 +16,7 @@ use Magento\Framework\Bulk\BulkManagementInterface; use Magento\Framework\DataObject\IdentityGeneratorInterface; use Magento\Framework\Encryption\Encryptor; +use Magento\AsynchronousOperations\Api\SaveMultipleOperationsInterface; use Magento\Framework\Exception\BulkException; use Magento\Framework\Exception\LocalizedException; use Psr\Log\LoggerInterface; @@ -67,6 +68,11 @@ class MassSchedule */ private $encryptor; + /** + * @var SaveMultipleOperationsInterface + */ + private $saveMultipleOperations; + /** * Initialize dependencies. * @@ -78,6 +84,7 @@ class MassSchedule * @param OperationRepositoryInterface $operationRepository * @param UserContextInterface $userContext * @param Encryptor $encryptor + * @param SaveMultipleOperationsInterface $saveMultipleOperations */ public function __construct( IdentityGeneratorInterface $identityService, @@ -87,7 +94,8 @@ public function __construct( LoggerInterface $logger, OperationRepositoryInterface $operationRepository, UserContextInterface $userContext, - Encryptor $encryptor + Encryptor $encryptor, + SaveMultipleOperationsInterface $saveMultipleOperations ) { $this->identityService = $identityService; $this->itemStatusInterfaceFactory = $itemStatusInterfaceFactory; @@ -97,6 +105,7 @@ public function __construct( $this->operationRepository = $operationRepository; $this->userContext = $userContext; $this->encryptor = $encryptor; + $this->saveMultipleOperations = $saveMultipleOperations; } /** @@ -159,6 +168,7 @@ public function publishMass($topicName, array $entitiesArray, $groupId = null, $ } } + $this->saveMultipleOperations->execute($operations); if (!$this->bulkManagement->scheduleBulk($groupId, $operations, $bulkDescription, $userId)) { throw new LocalizedException( __('Something went wrong while processing the request.') diff --git a/app/code/Magento/AsynchronousOperations/Model/OperationManagement.php b/app/code/Magento/AsynchronousOperations/Model/OperationManagement.php index f204f63ed032b..74740cba9a6d8 100644 --- a/app/code/Magento/AsynchronousOperations/Model/OperationManagement.php +++ b/app/code/Magento/AsynchronousOperations/Model/OperationManagement.php @@ -10,7 +10,7 @@ use Magento\Framework\EntityManager\EntityManager; /** - * Class OperationManagement + * Class for managing Bulk Operations */ class OperationManagement implements \Magento\Framework\Bulk\OperationManagementInterface { @@ -45,7 +45,7 @@ public function __construct( $this->operationFactory = $operationFactory; $this->logger = $logger; } - + /** * @inheritDoc */ diff --git a/app/code/Magento/AsynchronousOperations/Model/ResourceModel/Operation.php b/app/code/Magento/AsynchronousOperations/Model/ResourceModel/Operation.php index 061d0917e7ab0..0eaa5315af614 100644 --- a/app/code/Magento/AsynchronousOperations/Model/ResourceModel/Operation.php +++ b/app/code/Magento/AsynchronousOperations/Model/ResourceModel/Operation.php @@ -7,10 +7,14 @@ namespace Magento\AsynchronousOperations\Model\ResourceModel; /** - * Class Operation + * Resource class for Bulk Operations */ class Operation extends \Magento\Framework\Model\ResourceModel\Db\AbstractDb { + + public const TABLE_NAME = "magento_operation"; + public const TABLE_PRIMARY_KEY = "id"; + /** * Initialize banner sales rule resource model * @@ -18,6 +22,6 @@ class Operation extends \Magento\Framework\Model\ResourceModel\Db\AbstractDb */ protected function _construct() { - $this->_init('magento_operation', 'id'); + $this->_init(self::TABLE_NAME, self::TABLE_PRIMARY_KEY); } } diff --git a/app/code/Magento/AsynchronousOperations/Model/ResourceModel/Operation/OperationRepository.php b/app/code/Magento/AsynchronousOperations/Model/ResourceModel/Operation/OperationRepository.php index 5e42d0a2310b9..b189d81d31636 100644 --- a/app/code/Magento/AsynchronousOperations/Model/ResourceModel/Operation/OperationRepository.php +++ b/app/code/Magento/AsynchronousOperations/Model/ResourceModel/Operation/OperationRepository.php @@ -98,7 +98,7 @@ public function createByTopic($topicName, $entityParams, $groupId) /** @var OperationInterface $operation */ $operation = $this->operationFactory->create($data); - return $this->entityManager->save($operation); + return $operation; } /** diff --git a/app/code/Magento/AsynchronousOperations/Model/SaveMultipleOperations.php b/app/code/Magento/AsynchronousOperations/Model/SaveMultipleOperations.php new file mode 100644 index 0000000000000..88f44c64117f2 --- /dev/null +++ b/app/code/Magento/AsynchronousOperations/Model/SaveMultipleOperations.php @@ -0,0 +1,56 @@ +operationResource = $operationResource; + } + + /** + * @inheritDoc + */ + public function execute(array $operations): void + { + try { + $operationsToInsert = array_map(function ($operation) { + return $operation->getData(); + }, $operations); + + $connection = $this->operationResource->getConnection(); + $connection->insertMultiple( + $this->operationResource->getTable(OperationResource::TABLE_NAME), + $operationsToInsert + ); + } catch (\Exception $exception) { + throw new CouldNotSaveException(__($exception->getMessage())); + } + } +} diff --git a/app/code/Magento/AsynchronousOperations/etc/di.xml b/app/code/Magento/AsynchronousOperations/etc/di.xml index 0d8126358abf4..820bdd26e62b2 100644 --- a/app/code/Magento/AsynchronousOperations/etc/di.xml +++ b/app/code/Magento/AsynchronousOperations/etc/di.xml @@ -7,6 +7,7 @@ --> + diff --git a/app/code/Magento/Backend/README.md b/app/code/Magento/Backend/README.md index 205051809328a..f70dc9f676236 100644 --- a/app/code/Magento/Backend/README.md +++ b/app/code/Magento/Backend/README.md @@ -16,7 +16,6 @@ Before disabling or uninstalling this module, note that the following modules de - Magento_ReleaseNotification - Magento_Search - Magento_Security -- Magento_Signifyd - Magento_Swatches - Magento_Ui - Magento_User diff --git a/app/code/Magento/Backend/Test/Mftf/ActionGroup/AdminClickLogoActionGroup.xml b/app/code/Magento/Backend/Test/Mftf/ActionGroup/AdminClickLogoActionGroup.xml new file mode 100644 index 0000000000000..5fe89c3b8f6f4 --- /dev/null +++ b/app/code/Magento/Backend/Test/Mftf/ActionGroup/AdminClickLogoActionGroup.xml @@ -0,0 +1,15 @@ + + + + + + + + + diff --git a/app/code/Magento/Backend/Test/Mftf/ActionGroup/AdminNavigateToSetupWizardPageActionGroup.xml b/app/code/Magento/Backend/Test/Mftf/ActionGroup/AdminNavigateToSetupWizardPageActionGroup.xml new file mode 100644 index 0000000000000..5d5a233186c1f --- /dev/null +++ b/app/code/Magento/Backend/Test/Mftf/ActionGroup/AdminNavigateToSetupWizardPageActionGroup.xml @@ -0,0 +1,18 @@ + + + + + + + Open Setup Wizard Page. + + + + + diff --git a/app/code/Magento/Backend/Test/Mftf/Page/AdminSetupWizardPage.xml b/app/code/Magento/Backend/Test/Mftf/Page/AdminSetupWizardPage.xml new file mode 100644 index 0000000000000..40076ccd42b3a --- /dev/null +++ b/app/code/Magento/Backend/Test/Mftf/Page/AdminSetupWizardPage.xml @@ -0,0 +1,12 @@ + + + + + + diff --git a/app/code/Magento/Backend/Test/Mftf/Section/AdminMenuSection.xml b/app/code/Magento/Backend/Test/Mftf/Section/AdminMenuSection.xml index 8498ad8c52e41..e6782dca897d7 100644 --- a/app/code/Magento/Backend/Test/Mftf/Section/AdminMenuSection.xml +++ b/app/code/Magento/Backend/Test/Mftf/Section/AdminMenuSection.xml @@ -9,6 +9,7 @@
+ diff --git a/app/code/Magento/Backend/Test/Mftf/Test/AdminAttributeTextSwatchesCanBeFiledTest.xml b/app/code/Magento/Backend/Test/Mftf/Test/AdminAttributeTextSwatchesCanBeFiledTest.xml index 851d2447dfc15..8ac7af096da0a 100644 --- a/app/code/Magento/Backend/Test/Mftf/Test/AdminAttributeTextSwatchesCanBeFiledTest.xml +++ b/app/code/Magento/Backend/Test/Mftf/Test/AdminAttributeTextSwatchesCanBeFiledTest.xml @@ -22,7 +22,7 @@ - + diff --git a/app/code/Magento/Backend/Test/Mftf/Test/AdminCheckLocaleAndDeveloperConfigInDeveloperModeTest.xml b/app/code/Magento/Backend/Test/Mftf/Test/AdminCheckLocaleAndDeveloperConfigInDeveloperModeTest.xml index 47b8715b5541c..cbe0f0b5f4fe9 100644 --- a/app/code/Magento/Backend/Test/Mftf/Test/AdminCheckLocaleAndDeveloperConfigInDeveloperModeTest.xml +++ b/app/code/Magento/Backend/Test/Mftf/Test/AdminCheckLocaleAndDeveloperConfigInDeveloperModeTest.xml @@ -21,7 +21,7 @@ - + diff --git a/app/code/Magento/Backend/Test/Mftf/Test/AdminCheckLocaleAndDeveloperConfigInProductionModeTest.xml b/app/code/Magento/Backend/Test/Mftf/Test/AdminCheckLocaleAndDeveloperConfigInProductionModeTest.xml index 16bde998b9fb3..323ae324d4950 100644 --- a/app/code/Magento/Backend/Test/Mftf/Test/AdminCheckLocaleAndDeveloperConfigInProductionModeTest.xml +++ b/app/code/Magento/Backend/Test/Mftf/Test/AdminCheckLocaleAndDeveloperConfigInProductionModeTest.xml @@ -21,7 +21,7 @@ - + diff --git a/app/code/Magento/Backend/Test/Mftf/Test/AdminContentScheduleNavigateMenuTest.xml b/app/code/Magento/Backend/Test/Mftf/Test/AdminContentScheduleNavigateMenuTest.xml index 091e441559d78..8ae6d6de79c0b 100644 --- a/app/code/Magento/Backend/Test/Mftf/Test/AdminContentScheduleNavigateMenuTest.xml +++ b/app/code/Magento/Backend/Test/Mftf/Test/AdminContentScheduleNavigateMenuTest.xml @@ -20,7 +20,7 @@ - + diff --git a/app/code/Magento/Backend/Test/Mftf/Test/AdminDashboardNavigateMenuTest.xml b/app/code/Magento/Backend/Test/Mftf/Test/AdminDashboardNavigateMenuTest.xml index 60118202dbef2..efcc6da30199a 100644 --- a/app/code/Magento/Backend/Test/Mftf/Test/AdminDashboardNavigateMenuTest.xml +++ b/app/code/Magento/Backend/Test/Mftf/Test/AdminDashboardNavigateMenuTest.xml @@ -20,7 +20,7 @@ - + diff --git a/app/code/Magento/Backend/Test/Mftf/Test/AdminDashboardWithChartsChart.xml b/app/code/Magento/Backend/Test/Mftf/Test/AdminDashboardWithChartsChart.xml index 84e6b59e01504..0a54b3f66153a 100644 --- a/app/code/Magento/Backend/Test/Mftf/Test/AdminDashboardWithChartsChart.xml +++ b/app/code/Magento/Backend/Test/Mftf/Test/AdminDashboardWithChartsChart.xml @@ -41,7 +41,7 @@ - + diff --git a/app/code/Magento/Backend/Test/Mftf/Test/AdminExpireAdminSessionTest.xml b/app/code/Magento/Backend/Test/Mftf/Test/AdminExpireAdminSessionTest.xml index 88d26c052b59b..2469151337bfe 100644 --- a/app/code/Magento/Backend/Test/Mftf/Test/AdminExpireAdminSessionTest.xml +++ b/app/code/Magento/Backend/Test/Mftf/Test/AdminExpireAdminSessionTest.xml @@ -27,7 +27,7 @@ - + diff --git a/app/code/Magento/Backend/Test/Mftf/Test/AdminExpireCustomerSessionTest.xml b/app/code/Magento/Backend/Test/Mftf/Test/AdminExpireCustomerSessionTest.xml index d932da6ec0fad..0e3bf07d32441 100644 --- a/app/code/Magento/Backend/Test/Mftf/Test/AdminExpireCustomerSessionTest.xml +++ b/app/code/Magento/Backend/Test/Mftf/Test/AdminExpireCustomerSessionTest.xml @@ -27,7 +27,7 @@ - + diff --git a/app/code/Magento/Backend/Test/Mftf/Test/AdminLoginAfterChangeCookieDomainTest.xml b/app/code/Magento/Backend/Test/Mftf/Test/AdminLoginAfterChangeCookieDomainTest.xml index f75f3b2e3f15e..be734205e1f5b 100644 --- a/app/code/Magento/Backend/Test/Mftf/Test/AdminLoginAfterChangeCookieDomainTest.xml +++ b/app/code/Magento/Backend/Test/Mftf/Test/AdminLoginAfterChangeCookieDomainTest.xml @@ -27,7 +27,7 @@ - + diff --git a/app/code/Magento/Backend/Test/Mftf/Test/AdminLoginAfterJSMinificationTest.xml b/app/code/Magento/Backend/Test/Mftf/Test/AdminLoginAfterJSMinificationTest.xml index 0aa31bb21b6f7..d2c628ed13701 100644 --- a/app/code/Magento/Backend/Test/Mftf/Test/AdminLoginAfterJSMinificationTest.xml +++ b/app/code/Magento/Backend/Test/Mftf/Test/AdminLoginAfterJSMinificationTest.xml @@ -22,7 +22,7 @@ - + diff --git a/app/code/Magento/Backend/Test/Mftf/Test/AdminLoginWithRestrictPermissionTest.xml b/app/code/Magento/Backend/Test/Mftf/Test/AdminLoginWithRestrictPermissionTest.xml index a9706d902ff34..b3797b0720400 100644 --- a/app/code/Magento/Backend/Test/Mftf/Test/AdminLoginWithRestrictPermissionTest.xml +++ b/app/code/Magento/Backend/Test/Mftf/Test/AdminLoginWithRestrictPermissionTest.xml @@ -20,16 +20,16 @@ - + - + - + @@ -40,7 +40,7 @@ - + @@ -53,8 +53,9 @@ - - + + + diff --git a/app/code/Magento/Backend/Test/Mftf/Test/AdminMenuNavigationWithSecretKeysTest.xml b/app/code/Magento/Backend/Test/Mftf/Test/AdminMenuNavigationWithSecretKeysTest.xml index db81a7829160d..812158948d85f 100644 --- a/app/code/Magento/Backend/Test/Mftf/Test/AdminMenuNavigationWithSecretKeysTest.xml +++ b/app/code/Magento/Backend/Test/Mftf/Test/AdminMenuNavigationWithSecretKeysTest.xml @@ -21,7 +21,7 @@ - + diff --git a/app/code/Magento/Backend/Test/Mftf/Test/AdminPrivacyPolicyTest.xml b/app/code/Magento/Backend/Test/Mftf/Test/AdminPrivacyPolicyTest.xml index 4f215d20a7a36..b0fbdb8b5b596 100644 --- a/app/code/Magento/Backend/Test/Mftf/Test/AdminPrivacyPolicyTest.xml +++ b/app/code/Magento/Backend/Test/Mftf/Test/AdminPrivacyPolicyTest.xml @@ -21,7 +21,7 @@ - + diff --git a/app/code/Magento/Backend/Test/Mftf/Test/AdminRedirectToAdminPanelOnLogoClickFromWizardPageTest.xml b/app/code/Magento/Backend/Test/Mftf/Test/AdminRedirectToAdminPanelOnLogoClickFromWizardPageTest.xml new file mode 100644 index 0000000000000..bf74674a2c9c8 --- /dev/null +++ b/app/code/Magento/Backend/Test/Mftf/Test/AdminRedirectToAdminPanelOnLogoClickFromWizardPageTest.xml @@ -0,0 +1,29 @@ + + + + + + + + + + <description value="Check navigate to dashboard after click on logo on Setup Wizard Page"/> + </annotations> + <before> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginToAdminPanel"/> + </before> + <after> + <actionGroup ref="AdminLogoutActionGroup" stepKey="logoutFromAdmin"/> + </after> + + <actionGroup ref="AdminNavigateToSetupWizardPageActionGroup" stepKey="navigateToSetupWizardPage"/> + <actionGroup ref="AdminClickLogoActionGroup" stepKey="clickOnLogo"/> + <actionGroup ref="AssertAdminDashboardPageIsVisibleActionGroup" stepKey="checkTheDashboardPage"/> + </test> +</tests> diff --git a/app/code/Magento/Backend/Test/Mftf/Test/AdminStoresAllStoresNavigateMenuTest.xml b/app/code/Magento/Backend/Test/Mftf/Test/AdminStoresAllStoresNavigateMenuTest.xml index 0ff1e817ac0ea..97fdcdf9596a3 100644 --- a/app/code/Magento/Backend/Test/Mftf/Test/AdminStoresAllStoresNavigateMenuTest.xml +++ b/app/code/Magento/Backend/Test/Mftf/Test/AdminStoresAllStoresNavigateMenuTest.xml @@ -20,7 +20,7 @@ <group value="mtf_migrated"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="LoginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="LoginAsAdmin"/> </before> <after> <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> diff --git a/app/code/Magento/Backend/Test/Mftf/Test/AdminStoresConfigurationNavigateMenuTest.xml b/app/code/Magento/Backend/Test/Mftf/Test/AdminStoresConfigurationNavigateMenuTest.xml index 94bf5c6b8993a..39b08eeb2e42a 100644 --- a/app/code/Magento/Backend/Test/Mftf/Test/AdminStoresConfigurationNavigateMenuTest.xml +++ b/app/code/Magento/Backend/Test/Mftf/Test/AdminStoresConfigurationNavigateMenuTest.xml @@ -20,7 +20,7 @@ <group value="mtf_migrated"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="LoginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="LoginAsAdmin"/> </before> <after> <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> diff --git a/app/code/Magento/Backend/Test/Mftf/Test/AdminSystemCacheManagementNavigateMenuTest.xml b/app/code/Magento/Backend/Test/Mftf/Test/AdminSystemCacheManagementNavigateMenuTest.xml index 3aae643ccc36b..81fef1afc282c 100644 --- a/app/code/Magento/Backend/Test/Mftf/Test/AdminSystemCacheManagementNavigateMenuTest.xml +++ b/app/code/Magento/Backend/Test/Mftf/Test/AdminSystemCacheManagementNavigateMenuTest.xml @@ -20,7 +20,7 @@ <group value="mtf_migrated"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="LoginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="LoginAsAdmin"/> </before> <after> <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> diff --git a/app/code/Magento/Backend/Test/Mftf/Test/AdminUserLoginWithStoreCodeInUrlTest.xml b/app/code/Magento/Backend/Test/Mftf/Test/AdminUserLoginWithStoreCodeInUrlTest.xml index df5ca6d037813..e9050fa3ccd6e 100644 --- a/app/code/Magento/Backend/Test/Mftf/Test/AdminUserLoginWithStoreCodeInUrlTest.xml +++ b/app/code/Magento/Backend/Test/Mftf/Test/AdminUserLoginWithStoreCodeInUrlTest.xml @@ -26,7 +26,7 @@ <magentoCLI command="config:set {{StorefrontDisableAddStoreCodeToUrls.path}} {{StorefrontDisableAddStoreCodeToUrls.value}}" stepKey="addStoreCodeToUrlDisable"/> </after> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <actionGroup ref="AssertAdminDashboardPageIsVisibleActionGroup" stepKey="seeDashboardPage"/> </test> </tests> diff --git a/app/code/Magento/Braintree/Test/Mftf/Test/CreateAnAdminOrderUsingBraintreePaymentTest.xml b/app/code/Magento/Braintree/Test/Mftf/Test/CreateAnAdminOrderUsingBraintreePaymentTest.xml index 77dc83eec1176..9334b3beaa4c1 100644 --- a/app/code/Magento/Braintree/Test/Mftf/Test/CreateAnAdminOrderUsingBraintreePaymentTest.xml +++ b/app/code/Magento/Braintree/Test/Mftf/Test/CreateAnAdminOrderUsingBraintreePaymentTest.xml @@ -23,7 +23,7 @@ </annotations> <before> <!--Login As Admin--> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <!--CreateNewProduct--> <createData entity="_defaultCategory" stepKey="createCategory"/> @@ -93,7 +93,7 @@ <!--SignOut--> <actionGroup ref="SignOut" stepKey="signOutFromNewUser"/> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <!--Delete Product--> <deleteData stepKey="deleteProduct" createDataKey="createProduct"/> diff --git a/app/code/Magento/Braintree/Test/Mftf/Test/CretateAdminOrderWithOnlinePaymentIncludingTaxAndDiscountTest.xml b/app/code/Magento/Braintree/Test/Mftf/Test/CretateAdminOrderWithOnlinePaymentIncludingTaxAndDiscountTest.xml index 85d17a69ebae0..743eed209ebf4 100644 --- a/app/code/Magento/Braintree/Test/Mftf/Test/CretateAdminOrderWithOnlinePaymentIncludingTaxAndDiscountTest.xml +++ b/app/code/Magento/Braintree/Test/Mftf/Test/CretateAdminOrderWithOnlinePaymentIncludingTaxAndDiscountTest.xml @@ -44,7 +44,7 @@ </createData> <!--Login as Admin User--> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> </before> <after> diff --git a/app/code/Magento/Braintree/Test/Unit/Gateway/Response/PayPal/VaultDetailsHandlerTest.php b/app/code/Magento/Braintree/Test/Unit/Gateway/Response/PayPal/VaultDetailsHandlerTest.php index b3a7f8b9ee76a..657aa930a841f 100644 --- a/app/code/Magento/Braintree/Test/Unit/Gateway/Response/PayPal/VaultDetailsHandlerTest.php +++ b/app/code/Magento/Braintree/Test/Unit/Gateway/Response/PayPal/VaultDetailsHandlerTest.php @@ -8,8 +8,8 @@ use Braintree\Result\Successful; use Braintree\Transaction; use Braintree\Transaction\PayPalDetails; -use Magento\Braintree\Gateway\SubjectReader; use Magento\Braintree\Gateway\Response\PayPal\VaultDetailsHandler; +use Magento\Braintree\Gateway\SubjectReader; use Magento\Framework\Intl\DateTimeFactory; use Magento\Framework\TestFramework\Unit\Helper\ObjectManager; use Magento\Payment\Gateway\Data\PaymentDataObjectInterface; @@ -99,7 +99,12 @@ protected function setUp() ->getMock(); $this->paymentExtensionMock = $this->getMockBuilder(OrderPaymentExtensionInterface::class) - ->setMethods(['setVaultPaymentToken', 'getVaultPaymentToken']) + ->setMethods([ + 'setVaultPaymentToken', + 'getVaultPaymentToken', + 'setNotificationMessage', + 'getNotificationMessage' + ]) ->disableOriginalConstructor() ->getMock(); $this->paymentExtensionFactoryMock = $this->getMockBuilder(OrderPaymentExtensionInterfaceFactory::class) @@ -119,7 +124,7 @@ protected function setUp() ->disableOriginalConstructor() ->setMethods(['create']) ->getMock(); - + $this->handler = new VaultDetailsHandler( $this->paymentTokenFactoryMock, $this->paymentExtensionFactoryMock, @@ -139,7 +144,7 @@ public function testHandle() ->with($this->paymentTokenMock); $this->paymentExtensionMock->method('getVaultPaymentToken') ->willReturn($this->paymentTokenMock); - + $this->paymentDataObjectMock->method('getPayment') ->willReturn($this->paymentInfoMock); @@ -154,7 +159,7 @@ public function testHandle() $expirationDate = '2017-07-05 00:00:00'; $this->dateTimeFactoryMock->method('create') ->willReturn($dateTime); - + $this->handler->handle($this->subject, $response); $extensionAttributes = $this->paymentInfoMock->getExtensionAttributes(); diff --git a/app/code/Magento/Braintree/Test/Unit/Gateway/Response/VaultDetailsHandlerTest.php b/app/code/Magento/Braintree/Test/Unit/Gateway/Response/VaultDetailsHandlerTest.php index c8ec52560be29..131d94f3206c8 100644 --- a/app/code/Magento/Braintree/Test/Unit/Gateway/Response/VaultDetailsHandlerTest.php +++ b/app/code/Magento/Braintree/Test/Unit/Gateway/Response/VaultDetailsHandlerTest.php @@ -25,7 +25,7 @@ use PHPUnit_Framework_MockObject_MockObject as MockObject; /** - * VaultDetailsHandler Test + * Verify class VaultDetailsHandler * * @SuppressWarnings(PHPMD.CouplingBetweenObjects) */ @@ -216,7 +216,12 @@ private function getConfigMock(): Config private function initPaymentExtensionAttributesMock() { $this->paymentExtension = $this->getMockBuilder(OrderPaymentExtensionInterface::class) - ->setMethods(['setVaultPaymentToken', 'getVaultPaymentToken']) + ->setMethods([ + 'setVaultPaymentToken', + 'getVaultPaymentToken', + 'setNotificationMessage', + 'getNotificationMessage' + ]) ->disableOriginalConstructor() ->getMock(); diff --git a/app/code/Magento/Braintree/view/adminhtml/web/js/braintree.js b/app/code/Magento/Braintree/view/adminhtml/web/js/braintree.js index 845ed03725bfb..393b07fc30403 100644 --- a/app/code/Magento/Braintree/view/adminhtml/web/js/braintree.js +++ b/app/code/Magento/Braintree/view/adminhtml/web/js/braintree.js @@ -309,6 +309,7 @@ define([ self.hostedFieldsInstance.tokenize(function (err, payload) { if (err) { + $('body').trigger('processStop'); self.error($t('Some payment input fields are invalid.')); return false; diff --git a/app/code/Magento/Bundle/Block/Catalog/Product/View/Type/Bundle.php b/app/code/Magento/Bundle/Block/Catalog/Product/View/Type/Bundle.php index fa488b073f515..2e9b8ba413af3 100644 --- a/app/code/Magento/Bundle/Block/Catalog/Product/View/Type/Bundle.php +++ b/app/code/Magento/Bundle/Block/Catalog/Product/View/Type/Bundle.php @@ -6,20 +6,30 @@ namespace Magento\Bundle\Block\Catalog\Product\View\Type; use Magento\Bundle\Model\Option; +use Magento\Bundle\Model\Product\Price; +use Magento\Bundle\Model\Product\PriceFactory; +use Magento\Bundle\Model\Product\Type; +use Magento\Catalog\Block\Product\Context; +use Magento\Catalog\Block\Product\View\AbstractView; use Magento\Catalog\Model\Product; +use Magento\Catalog\Pricing\Price\FinalPrice; +use Magento\Catalog\Pricing\Price\RegularPrice; +use Magento\CatalogRule\Model\ResourceModel\Product\CollectionProcessor; +use Magento\Framework\App\ObjectManager; use Magento\Framework\DataObject; +use Magento\Framework\Json\EncoderInterface; +use Magento\Framework\Locale\FormatInterface; +use Magento\Framework\Stdlib\ArrayUtils; /** * Catalog bundle product info block * * @api - * @SuppressWarnings(PHPMD.CouplingBetweenObjects) - * @api * @since 100.0.2 + * @SuppressWarnings(PHPMD.CouplingBetweenObjects) */ -class Bundle extends \Magento\Catalog\Block\Product\View\AbstractView +class Bundle extends AbstractView { - /** * @var array */ @@ -33,17 +43,17 @@ class Bundle extends \Magento\Catalog\Block\Product\View\AbstractView protected $catalogProduct; /** - * @var \Magento\Bundle\Model\Product\PriceFactory + * @var PriceFactory */ protected $productPriceFactory; /** - * @var \Magento\Framework\Json\EncoderInterface + * @var EncoderInterface */ protected $jsonEncoder; /** - * @var \Magento\Framework\Locale\FormatInterface + * @var FormatInterface */ protected $localeFormat; @@ -63,22 +73,24 @@ class Bundle extends \Magento\Catalog\Block\Product\View\AbstractView private $optionsPosition = []; /** - * @param \Magento\Catalog\Block\Product\Context $context - * @param \Magento\Framework\Stdlib\ArrayUtils $arrayUtils + * @param Context $context + * @param ArrayUtils $arrayUtils * @param \Magento\Catalog\Helper\Product $catalogProduct - * @param \Magento\Bundle\Model\Product\PriceFactory $productPrice - * @param \Magento\Framework\Json\EncoderInterface $jsonEncoder - * @param \Magento\Framework\Locale\FormatInterface $localeFormat + * @param PriceFactory $productPrice + * @param EncoderInterface $jsonEncoder + * @param FormatInterface $localeFormat * @param array $data + * @param CollectionProcessor|null $catalogRuleProcessor */ public function __construct( - \Magento\Catalog\Block\Product\Context $context, - \Magento\Framework\Stdlib\ArrayUtils $arrayUtils, + Context $context, + ArrayUtils $arrayUtils, \Magento\Catalog\Helper\Product $catalogProduct, - \Magento\Bundle\Model\Product\PriceFactory $productPrice, - \Magento\Framework\Json\EncoderInterface $jsonEncoder, - \Magento\Framework\Locale\FormatInterface $localeFormat, - array $data = [] + PriceFactory $productPrice, + EncoderInterface $jsonEncoder, + FormatInterface $localeFormat, + array $data = [], + ?CollectionProcessor $catalogRuleProcessor = null ) { $this->catalogProduct = $catalogProduct; $this->productPriceFactory = $productPrice; @@ -89,22 +101,8 @@ public function __construct( $arrayUtils, $data ); - } - - /** - * Return catalog rule processor or creates processor if it does not exist - * - * @deprecated 100.2.0 - * @return \Magento\CatalogRule\Model\ResourceModel\Product\CollectionProcessor - */ - private function getCatalogRuleProcessor() - { - if ($this->catalogRuleProcessor === null) { - $this->catalogRuleProcessor = \Magento\Framework\App\ObjectManager::getInstance() - ->get(\Magento\CatalogRule\Model\ResourceModel\Product\CollectionProcessor::class); - } - - return $this->catalogRuleProcessor; + $this->catalogRuleProcessor = $catalogRuleProcessor ?? ObjectManager::getInstance() + ->get(CollectionProcessor::class); } /** @@ -120,7 +118,7 @@ public function getOptions($stripSelection = false) { if (!$this->options) { $product = $this->getProduct(); - /** @var \Magento\Bundle\Model\Product\Type $typeInstance */ + /** @var Type $typeInstance */ $typeInstance = $product->getTypeInstance(); $typeInstance->setStoreFilter($product->getStoreId(), $product); @@ -130,7 +128,7 @@ public function getOptions($stripSelection = false) $typeInstance->getOptionsIds($product), $product ); - $this->getCatalogRuleProcessor()->addPriceData($selectionCollection); + $this->catalogRuleProcessor->addPriceData($selectionCollection); $selectionCollection->addTierPriceData(); $this->options = $optionCollection->appendSelections( @@ -151,10 +149,7 @@ public function getOptions($stripSelection = false) public function hasOptions() { $this->getOptions(); - if (empty($this->options) || !$this->getProduct()->isSalable()) { - return false; - } - return true; + return !(empty($this->options) || !$this->getProduct()->isSalable()); } /** @@ -255,7 +250,7 @@ private function getSelectionItemData(Product $product, Product $selection) ->getOptionSelectionAmount($selection) ->getValue(); - $selection = [ + return [ 'qty' => $qty, 'customQty' => $selection->getSelectionCanChangeQty(), 'optionId' => $selection->getId(), @@ -275,8 +270,6 @@ private function getSelectionItemData(Product $product, Product $selection) 'name' => $selection->getName(), 'canApplyMsrp' => false, ]; - - return $selection; } /** @@ -371,16 +364,16 @@ private function getOptionItemData(Option $option, Product $product, $position) */ private function getConfigData(Product $product, array $options) { - $isFixedPrice = $this->getProduct()->getPriceType() == \Magento\Bundle\Model\Product\Price::PRICE_TYPE_FIXED; + $isFixedPrice = $this->getProduct()->getPriceType() == Price::PRICE_TYPE_FIXED; $productAmount = $product ->getPriceInfo() - ->getPrice(\Magento\Catalog\Pricing\Price\FinalPrice::PRICE_CODE) + ->getPrice(FinalPrice::PRICE_CODE) ->getPriceWithoutOption(); $baseProductAmount = $product ->getPriceInfo() - ->getPrice(\Magento\Catalog\Pricing\Price\RegularPrice::PRICE_CODE) + ->getPrice(RegularPrice::PRICE_CODE) ->getAmount(); $config = [ diff --git a/app/code/Magento/Bundle/Model/LinkManagement.php b/app/code/Magento/Bundle/Model/LinkManagement.php index 8c85c06c7342d..43a6532a16b2d 100644 --- a/app/code/Magento/Bundle/Model/LinkManagement.php +++ b/app/code/Magento/Bundle/Model/LinkManagement.php @@ -1,36 +1,49 @@ <?php /** - * * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ +declare(strict_types=1); namespace Magento\Bundle\Model; +use Magento\Bundle\Api\Data\LinkInterface; +use Magento\Bundle\Api\Data\LinkInterfaceFactory; +use Magento\Bundle\Api\Data\OptionInterface; +use Magento\Bundle\Api\ProductLinkManagementInterface; +use Magento\Bundle\Model\Product\Type; +use Magento\Bundle\Model\ResourceModel\Bundle; +use Magento\Bundle\Model\ResourceModel\BundleFactory; +use Magento\Bundle\Model\ResourceModel\Option\CollectionFactory; use Magento\Catalog\Api\Data\ProductInterface; use Magento\Catalog\Api\ProductRepositoryInterface; -use Magento\Framework\App\ObjectManager; +use Magento\Catalog\Model\Product; +use Magento\Framework\Api\DataObjectHelper; use Magento\Framework\Exception\CouldNotSaveException; use Magento\Framework\Exception\InputException; use Magento\Framework\EntityManager\MetadataPool; +use Magento\Framework\Exception\NoSuchEntityException; +use Magento\Store\Model\StoreManagerInterface; /** + * Class used to manage bundle products links. + * * @SuppressWarnings(PHPMD.CouplingBetweenObjects) */ -class LinkManagement implements \Magento\Bundle\Api\ProductLinkManagementInterface +class LinkManagement implements ProductLinkManagementInterface { /** - * @var \Magento\Catalog\Api\ProductRepositoryInterface + * @var ProductRepositoryInterface */ protected $productRepository; /** - * @var \Magento\Bundle\Api\Data\LinkInterfaceFactory + * @var LinkInterfaceFactory */ protected $linkFactory; /** - * @var \Magento\Bundle\Model\ResourceModel\BundleFactory + * @var BundleFactory */ protected $bundleFactory; @@ -40,12 +53,17 @@ class LinkManagement implements \Magento\Bundle\Api\ProductLinkManagementInterfa protected $bundleSelection; /** - * @var \Magento\Bundle\Model\ResourceModel\Option\CollectionFactory + * @var CollectionFactory */ protected $optionCollection; /** - * @var \Magento\Framework\Api\DataObjectHelper + * @var StoreManagerInterface + */ + private $storeManager; + + /** + * @var DataObjectHelper */ protected $dataObjectHelper; @@ -56,21 +74,23 @@ class LinkManagement implements \Magento\Bundle\Api\ProductLinkManagementInterfa /** * @param ProductRepositoryInterface $productRepository - * @param \Magento\Bundle\Api\Data\LinkInterfaceFactory $linkFactory - * @param \Magento\Bundle\Model\SelectionFactory $bundleSelection - * @param \Magento\Bundle\Model\ResourceModel\BundleFactory $bundleFactory - * @param \Magento\Bundle\Model\ResourceModel\Option\CollectionFactory $optionCollection - * @param \Magento\Store\Model\StoreManagerInterface $storeManager - * @param \Magento\Framework\Api\DataObjectHelper $dataObjectHelper + * @param LinkInterfaceFactory $linkFactory + * @param SelectionFactory $bundleSelection + * @param BundleFactory $bundleFactory + * @param CollectionFactory $optionCollection + * @param StoreManagerInterface $storeManager + * @param DataObjectHelper $dataObjectHelper + * @param MetadataPool $metadataPool */ public function __construct( ProductRepositoryInterface $productRepository, - \Magento\Bundle\Api\Data\LinkInterfaceFactory $linkFactory, - \Magento\Bundle\Model\SelectionFactory $bundleSelection, - \Magento\Bundle\Model\ResourceModel\BundleFactory $bundleFactory, - \Magento\Bundle\Model\ResourceModel\Option\CollectionFactory $optionCollection, - \Magento\Store\Model\StoreManagerInterface $storeManager, - \Magento\Framework\Api\DataObjectHelper $dataObjectHelper + LinkInterfaceFactory $linkFactory, + SelectionFactory $bundleSelection, + BundleFactory $bundleFactory, + CollectionFactory $optionCollection, + StoreManagerInterface $storeManager, + DataObjectHelper $dataObjectHelper, + MetadataPool $metadataPool ) { $this->productRepository = $productRepository; $this->linkFactory = $linkFactory; @@ -79,15 +99,16 @@ public function __construct( $this->optionCollection = $optionCollection; $this->storeManager = $storeManager; $this->dataObjectHelper = $dataObjectHelper; + $this->metadataPool = $metadataPool; } /** - * {@inheritdoc} + * @inheritDoc */ public function getChildren($productSku, $optionId = null) { $product = $this->productRepository->get($productSku, true); - if ($product->getTypeId() != \Magento\Catalog\Model\Product\Type::TYPE_BUNDLE) { + if ($product->getTypeId() != Product\Type::TYPE_BUNDLE) { throw new InputException(__('This is implemented for bundle products only.')); } @@ -96,7 +117,7 @@ public function getChildren($productSku, $optionId = null) if (!$option->getSelections() || ($optionId !== null && $option->getOptionId() != $optionId)) { continue; } - /** @var \Magento\Catalog\Model\Product $selection */ + /** @var Product $selection */ foreach ($option->getSelections() as $selection) { $childrenList[] = $this->buildLink($selection, $product); } @@ -105,32 +126,33 @@ public function getChildren($productSku, $optionId = null) } /** - * {@inheritdoc} + * @inheritDoc */ - public function addChildByProductSku($sku, $optionId, \Magento\Bundle\Api\Data\LinkInterface $linkedProduct) + public function addChildByProductSku($sku, $optionId, LinkInterface $linkedProduct) { - /** @var \Magento\Catalog\Model\Product $product */ + /** @var Product $product */ $product = $this->productRepository->get($sku, true); return $this->addChild($product, $optionId, $linkedProduct); } /** - * {@inheritdoc} + * @inheritDoc + * * @SuppressWarnings(PHPMD.CyclomaticComplexity) * @SuppressWarnings(PHPMD.NPathComplexity) */ public function saveChild( $sku, - \Magento\Bundle\Api\Data\LinkInterface $linkedProduct + LinkInterface $linkedProduct ) { $product = $this->productRepository->get($sku, true); - if ($product->getTypeId() != \Magento\Catalog\Model\Product\Type::TYPE_BUNDLE) { + if ($product->getTypeId() != Product\Type::TYPE_BUNDLE) { throw new InputException( __('The product with the "%1" SKU isn\'t a bundle product.', [$product->getSku()]) ); } - /** @var \Magento\Catalog\Model\Product $linkProductModel */ + /** @var Product $linkProductModel */ $linkProductModel = $this->productRepository->get($linkedProduct->getSku()); if ($linkProductModel->isComposite()) { throw new InputException(__('The bundle product can\'t contain another composite product.')); @@ -140,7 +162,7 @@ public function saveChild( throw new InputException(__('The product link needs an ID field entered. Enter and try again.')); } - /** @var \Magento\Bundle\Model\Selection $selectionModel */ + /** @var Selection $selectionModel */ $selectionModel = $this->bundleSelection->create(); $selectionModel->load($linkedProduct->getId()); if (!$selectionModel->getId()) { @@ -151,7 +173,7 @@ public function saveChild( ) ); } - $linkField = $this->getMetadataPool()->getMetadata(ProductInterface::class)->getLinkField(); + $linkField = $this->metadataPool->getMetadata(ProductInterface::class)->getLinkField(); $selectionModel = $this->mapProductLinkToSelectionModel( $selectionModel, $linkedProduct, @@ -169,17 +191,21 @@ public function saveChild( } /** - * @param \Magento\Bundle\Model\Selection $selectionModel - * @param \Magento\Bundle\Api\Data\LinkInterface $productLink + * Fill selection model with product link data + * + * @param Selection $selectionModel + * @param LinkInterface $productLink * @param string $linkedProductId * @param string $parentProductId - * @return \Magento\Bundle\Model\Selection + * + * @return Selection + * * @SuppressWarnings(PHPMD.CyclomaticComplexity) * @SuppressWarnings(PHPMD.NPathComplexity) */ protected function mapProductLinkToSelectionModel( - \Magento\Bundle\Model\Selection $selectionModel, - \Magento\Bundle\Api\Data\LinkInterface $productLink, + Selection $selectionModel, + LinkInterface $productLink, $linkedProductId, $parentProductId ) { @@ -214,21 +240,22 @@ protected function mapProductLinkToSelectionModel( } /** - * {@inheritdoc} + * @inheritDoc + * * @SuppressWarnings(PHPMD.CyclomaticComplexity) */ public function addChild( - \Magento\Catalog\Api\Data\ProductInterface $product, + ProductInterface $product, $optionId, - \Magento\Bundle\Api\Data\LinkInterface $linkedProduct + LinkInterface $linkedProduct ) { - if ($product->getTypeId() != \Magento\Catalog\Model\Product\Type::TYPE_BUNDLE) { + if ($product->getTypeId() != Product\Type::TYPE_BUNDLE) { throw new InputException( __('The product with the "%1" SKU isn\'t a bundle product.', $product->getSku()) ); } - $linkField = $this->getMetadataPool()->getMetadata(ProductInterface::class)->getLinkField(); + $linkField = $this->metadataPool->getMetadata(ProductInterface::class)->getLinkField(); $options = $this->optionCollection->create(); @@ -246,10 +273,10 @@ public function addChild( ); } - /* @var $resource \Magento\Bundle\Model\ResourceModel\Bundle */ + /* @var $resource Bundle */ $resource = $this->bundleFactory->create(); $selections = $resource->getSelectionsData($product->getData($linkField)); - /** @var \Magento\Catalog\Model\Product $linkProductModel */ + /** @var Product $linkProductModel */ $linkProductModel = $this->productRepository->get($linkedProduct->getSku()); if ($linkProductModel->isComposite()) { throw new InputException(__('The bundle product can\'t contain another composite product.')); @@ -267,9 +294,9 @@ public function addChild( [$linkedProduct->getSku(), $product->getSku()] ) ); - } else { - return $this->bundleSelection->create()->load($linkProductModel->getEntityId()); } + + return $this->bundleSelection->create()->load($linkProductModel->getEntityId()); } } } @@ -294,13 +321,13 @@ public function addChild( } /** - * {@inheritdoc} + * @inheritDoc */ public function removeChild($sku, $optionId, $childSku) { $product = $this->productRepository->get($sku, true); - if ($product->getTypeId() != \Magento\Catalog\Model\Product\Type::TYPE_BUNDLE) { + if ($product->getTypeId() != Product\Type::TYPE_BUNDLE) { throw new InputException(__('The product with the "%1" SKU isn\'t a bundle product.', $sku)); } @@ -308,7 +335,7 @@ public function removeChild($sku, $optionId, $childSku) $usedProductIds = []; $removeSelectionIds = []; foreach ($this->getOptions($product) as $option) { - /** @var \Magento\Bundle\Model\Selection $selection */ + /** @var Selection $selection */ foreach ($option->getSelections() as $selection) { if ((strcasecmp($selection->getSku(), $childSku) == 0) && ($selection->getOptionId() == $optionId)) { $removeSelectionIds[] = $selection->getSelectionId(); @@ -319,12 +346,12 @@ public function removeChild($sku, $optionId, $childSku) } } if (empty($removeSelectionIds)) { - throw new \Magento\Framework\Exception\NoSuchEntityException( + throw new NoSuchEntityException( __("The bundle product doesn't exist. Review your request and try again.") ); } - $linkField = $this->getMetadataPool()->getMetadata(ProductInterface::class)->getLinkField(); - /* @var $resource \Magento\Bundle\Model\ResourceModel\Bundle */ + $linkField = $this->metadataPool->getMetadata(ProductInterface::class)->getLinkField(); + /* @var $resource Bundle */ $resource = $this->bundleFactory->create(); $resource->dropAllUnneededSelections($product->getData($linkField), $excludeSelectionIds); $resource->removeProductRelations($product->getData($linkField), array_unique($usedProductIds)); @@ -333,26 +360,29 @@ public function removeChild($sku, $optionId, $childSku) } /** - * @param \Magento\Catalog\Model\Product $selection - * @param \Magento\Catalog\Model\Product $product - * @return \Magento\Bundle\Api\Data\LinkInterface + * Build bundle link between two products + * + * @param Product $selection + * @param Product $product + * + * @return LinkInterface */ - private function buildLink(\Magento\Catalog\Model\Product $selection, \Magento\Catalog\Model\Product $product) + private function buildLink(Product $selection, Product $product) { $selectionPriceType = $selectionPrice = null; - /** @var \Magento\Bundle\Model\Selection $product */ + /** @var Selection $product */ if ($product->getPriceType()) { $selectionPriceType = $selection->getSelectionPriceType(); $selectionPrice = $selection->getSelectionPriceValue(); } - /** @var \Magento\Bundle\Api\Data\LinkInterface $link */ + /** @var LinkInterface $link */ $link = $this->linkFactory->create(); $this->dataObjectHelper->populateWithArray( $link, $selection->getData(), - \Magento\Bundle\Api\Data\LinkInterface::class + LinkInterface::class ); $link->setIsDefault($selection->getIsDefault()) ->setId($selection->getSelectionId()) @@ -364,12 +394,15 @@ private function buildLink(\Magento\Catalog\Model\Product $selection, \Magento\C } /** - * @param \Magento\Catalog\Api\Data\ProductInterface $product - * @return \Magento\Bundle\Api\Data\OptionInterface[] + * Get bundle product options + * + * @param ProductInterface $product + * + * @return OptionInterface[] */ - private function getOptions(\Magento\Catalog\Api\Data\ProductInterface $product) + private function getOptions(ProductInterface $product) { - /** @var \Magento\Bundle\Model\Product\Type $productTypeInstance */ + /** @var Type $productTypeInstance */ $productTypeInstance = $product->getTypeInstance(); $productTypeInstance->setStoreFilter( $product->getStoreId(), @@ -383,19 +416,6 @@ private function getOptions(\Magento\Catalog\Api\Data\ProductInterface $product) $product ); - $options = $optionCollection->appendSelections($selectionCollection, true); - return $options; - } - - /** - * Get MetadataPool instance - * @return MetadataPool - */ - private function getMetadataPool() - { - if (!$this->metadataPool) { - $this->metadataPool = ObjectManager::getInstance()->get(MetadataPool::class); - } - return $this->metadataPool; + return $optionCollection->appendSelections($selectionCollection, true); } } diff --git a/app/code/Magento/Bundle/Model/Product/SaveHandler.php b/app/code/Magento/Bundle/Model/Product/SaveHandler.php index 99e8188146bbb..8c2727a71aac1 100644 --- a/app/code/Magento/Bundle/Model/Product/SaveHandler.php +++ b/app/code/Magento/Bundle/Model/Product/SaveHandler.php @@ -3,58 +3,59 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ +declare(strict_types=1); + namespace Magento\Bundle\Model\Product; +use Magento\Bundle\Api\Data\OptionInterface; use Magento\Bundle\Model\Option\SaveAction; use Magento\Catalog\Api\Data\ProductInterface; use Magento\Bundle\Api\ProductOptionRepositoryInterface as OptionRepository; use Magento\Bundle\Api\ProductLinkManagementInterface; -use Magento\Framework\App\ObjectManager; use Magento\Framework\EntityManager\MetadataPool; use Magento\Framework\EntityManager\Operation\ExtensionInterface; /** - * Class SaveHandler + * Bundle product save handler */ class SaveHandler implements ExtensionInterface { /** * @var OptionRepository */ - protected $optionRepository; + private $optionRepository; /** * @var ProductLinkManagementInterface */ - protected $productLinkManagement; + private $productLinkManagement; /** - * @var MetadataPool + * @var SaveAction */ - private $metadataPool; + private $optionSave; /** - * @var SaveAction + * @var MetadataPool */ - private $optionSave; + private $metadataPool; /** * @param OptionRepository $optionRepository * @param ProductLinkManagementInterface $productLinkManagement * @param SaveAction $optionSave - * @param MetadataPool|null $metadataPool + * @param MetadataPool $metadataPool */ public function __construct( OptionRepository $optionRepository, ProductLinkManagementInterface $productLinkManagement, SaveAction $optionSave, - MetadataPool $metadataPool = null + MetadataPool $metadataPool ) { $this->optionRepository = $optionRepository; $this->productLinkManagement = $productLinkManagement; $this->optionSave = $optionSave; - $this->metadataPool = $metadataPool - ?: ObjectManager::getInstance()->get(MetadataPool::class); + $this->metadataPool = $metadataPool; } /** @@ -69,7 +70,7 @@ public function __construct( */ public function execute($entity, $arguments = []) { - /** @var \Magento\Bundle\Api\Data\OptionInterface[] $bundleProductOptions */ + /** @var OptionInterface[] $bundleProductOptions */ $bundleProductOptions = $entity->getExtensionAttributes()->getBundleProductOptions() ?: []; //Only processing bundle products. if ($entity->getTypeId() !== Type::TYPE_CODE || empty($bundleProductOptions)) { @@ -101,7 +102,8 @@ public function execute($entity, $arguments = []) * Remove option product links * * @param string $entitySku - * @param \Magento\Bundle\Api\Data\OptionInterface $option + * @param OptionInterface $option + * * @return void */ protected function removeOptionLinks($entitySku, $option) @@ -120,6 +122,7 @@ protected function removeOptionLinks($entitySku, $option) * @param object $entity * @param array $options * @param array $newOptionsIds + * * @return void */ private function saveOptions($entity, array $options, array $newOptionsIds = []): void @@ -137,6 +140,7 @@ private function saveOptions($entity, array $options, array $newOptionsIds = []) * Get options ids from array of the options entities. * * @param array $options + * * @return array */ private function getOptionIds(array $options): array @@ -144,7 +148,7 @@ private function getOptionIds(array $options): array $optionIds = []; if (!empty($options)) { - /** @var \Magento\Bundle\Api\Data\OptionInterface $option */ + /** @var OptionInterface $option */ foreach ($options as $option) { if ($option->getOptionId()) { $optionIds[] = $option->getOptionId(); @@ -161,6 +165,7 @@ private function getOptionIds(array $options): array * @param ProductInterface $entity * @param array $existingOptionsIds * @param array $optionIds + * * @return void */ private function processRemovedOptions(ProductInterface $entity, array $existingOptionsIds, array $optionIds): void diff --git a/app/code/Magento/Bundle/Model/ResourceModel/Indexer/Stock.php b/app/code/Magento/Bundle/Model/ResourceModel/Indexer/Stock.php index 803fbae067e9d..6808081506dd7 100644 --- a/app/code/Magento/Bundle/Model/ResourceModel/Indexer/Stock.php +++ b/app/code/Magento/Bundle/Model/ResourceModel/Indexer/Stock.php @@ -3,65 +3,65 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ +declare(strict_types=1); + namespace Magento\Bundle\Model\ResourceModel\Indexer; +use Magento\Catalog\Model\ResourceModel\Indexer\ActiveTableSwitcher; use Magento\CatalogInventory\Model\Indexer\Stock\Action\Full; -use Magento\Framework\App\ObjectManager; +use Magento\CatalogInventory\Model\ResourceModel\Indexer\Stock\DefaultStock; +use Magento\Eav\Model\Config; +use Magento\Framework\App\Config\ScopeConfigInterface; +use Magento\Framework\Indexer\Table\StrategyInterface; +use Magento\Framework\Model\ResourceModel\Db\Context; /** * Bundle Stock Status Indexer Resource Model * - * @author Magento Core Team <core@magentocommerce.com> + * @SuppressWarnings(PHPMD.CouplingBetweenObjects) */ -class Stock extends \Magento\CatalogInventory\Model\ResourceModel\Indexer\Stock\DefaultStock +class Stock extends DefaultStock { /** - * @var \Magento\Catalog\Model\ResourceModel\Indexer\ActiveTableSwitcher + * @var ActiveTableSwitcher */ private $activeTableSwitcher; /** - * @var \Magento\Bundle\Model\ResourceModel\Indexer\StockStatusSelectBuilder + * @var StockStatusSelectBuilder */ private $stockStatusSelectBuilder; /** - * @var \Magento\Bundle\Model\ResourceModel\Indexer\BundleOptionStockDataSelectBuilder + * @var BundleOptionStockDataSelectBuilder */ private $bundleOptionStockDataSelectBuilder; /** - * Class constructor - * - * @param \Magento\Framework\Model\ResourceModel\Db\Context $context - * @param \Magento\Framework\Indexer\Table\StrategyInterface $tableStrategy - * @param \Magento\Eav\Model\Config $eavConfig - * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig - * @param null $connectionName - * @param \Magento\Catalog\Model\ResourceModel\Indexer\ActiveTableSwitcher|null $activeTableSwitcher - * @param StockStatusSelectBuilder|null $stockStatusSelectBuilder - * @param BundleOptionStockDataSelectBuilder|null $bundleOptionStockDataSelectBuilder + * @param Context $context + * @param StrategyInterface $tableStrategy + * @param Config $eavConfig + * @param ScopeConfigInterface $scopeConfig + * @param ActiveTableSwitcher $activeTableSwitcher + * @param StockStatusSelectBuilder $stockStatusSelectBuilder + * @param BundleOptionStockDataSelectBuilder $bundleOptionStockDataSelectBuilder + * @param string $connectionName */ public function __construct( - \Magento\Framework\Model\ResourceModel\Db\Context $context, - \Magento\Framework\Indexer\Table\StrategyInterface $tableStrategy, - \Magento\Eav\Model\Config $eavConfig, - \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, - $connectionName = null, - \Magento\Catalog\Model\ResourceModel\Indexer\ActiveTableSwitcher $activeTableSwitcher = null, - StockStatusSelectBuilder $stockStatusSelectBuilder = null, - BundleOptionStockDataSelectBuilder $bundleOptionStockDataSelectBuilder = null + Context $context, + StrategyInterface $tableStrategy, + Config $eavConfig, + ScopeConfigInterface $scopeConfig, + ActiveTableSwitcher $activeTableSwitcher, + StockStatusSelectBuilder $stockStatusSelectBuilder, + BundleOptionStockDataSelectBuilder $bundleOptionStockDataSelectBuilder, + $connectionName = null ) { parent::__construct($context, $tableStrategy, $eavConfig, $scopeConfig, $connectionName); - $this->activeTableSwitcher = $activeTableSwitcher ?: ObjectManager::getInstance() - ->get(\Magento\Catalog\Model\ResourceModel\Indexer\ActiveTableSwitcher::class); - - $this->stockStatusSelectBuilder = $stockStatusSelectBuilder ?: ObjectManager::getInstance() - ->get(StockStatusSelectBuilder::class); - - $this->bundleOptionStockDataSelectBuilder = $bundleOptionStockDataSelectBuilder ?: ObjectManager::getInstance() - ->get(BundleOptionStockDataSelectBuilder::class); + $this->activeTableSwitcher = $activeTableSwitcher; + $this->stockStatusSelectBuilder = $stockStatusSelectBuilder; + $this->bundleOptionStockDataSelectBuilder = $bundleOptionStockDataSelectBuilder; } /** @@ -79,6 +79,7 @@ protected function _getBundleOptionTable() * * @param int|array $entityIds * @param bool $usePrimaryTable use primary or temporary index table + * * @return $this */ protected function _prepareBundleOptionStockData($entityIds = null, $usePrimaryTable = false) @@ -122,6 +123,7 @@ protected function _prepareBundleOptionStockData($entityIds = null, $usePrimaryT * * @param int|array $entityIds * @param bool $usePrimaryTable use primary or temporary index table + * * @return \Magento\Framework\DB\Select */ protected function _getStockStatusSelect($entityIds = null, $usePrimaryTable = false) @@ -171,6 +173,7 @@ protected function _prepareIndexTable($entityIds = null) * Update Stock status index by product ids * * @param array|int $entityIds + * * @return $this */ protected function _updateIndex($entityIds) diff --git a/app/code/Magento/Bundle/Model/ResourceModel/Option.php b/app/code/Magento/Bundle/Model/ResourceModel/Option.php index 7babd0b349f02..1260233b5bcb3 100644 --- a/app/code/Magento/Bundle/Model/ResourceModel/Option.php +++ b/app/code/Magento/Bundle/Model/ResourceModel/Option.php @@ -3,20 +3,26 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ +declare(strict_types=1); + namespace Magento\Bundle\Model\ResourceModel; +use Magento\Bundle\Model\Option\Validator; use Magento\Catalog\Api\Data\ProductInterface; -use Magento\Framework\EntityManager\MetadataPool; -use Magento\Framework\App\ObjectManager; +use Magento\Framework\DataObject; use Magento\Framework\EntityManager\EntityManager; +use Magento\Framework\EntityManager\MetadataPool; +use Magento\Framework\Model\AbstractModel; +use Magento\Framework\Model\ResourceModel\Db\AbstractDb; +use Magento\Framework\Model\ResourceModel\Db\Context; /** * Bundle Option Resource Model */ -class Option extends \Magento\Framework\Model\ResourceModel\Db\AbstractDb +class Option extends AbstractDb { /** - * @var \Magento\Bundle\Model\Option\Validator + * @var Validator */ private $validator; @@ -31,22 +37,23 @@ class Option extends \Magento\Framework\Model\ResourceModel\Db\AbstractDb private $entityManager; /** - * @param \Magento\Framework\Model\ResourceModel\Db\Context $context - * @param \Magento\Bundle\Model\Option\Validator $validator + * @param Context $context + * @param Validator $validator + * @param MetadataPool $metadataPool + * @param EntityManager $entityManager * @param string $connectionName - * @param EntityManager|null $entityManager */ public function __construct( - \Magento\Framework\Model\ResourceModel\Db\Context $context, - \Magento\Bundle\Model\Option\Validator $validator, - $connectionName = null, - EntityManager $entityManager = null + Context $context, + Validator $validator, + MetadataPool $metadataPool, + EntityManager $entityManager, + $connectionName = null ) { parent::__construct($context, $connectionName); $this->validator = $validator; - - $this->entityManager = $entityManager - ?: ObjectManager::getInstance()->get(EntityManager::class); + $this->metadataPool = $metadataPool; + $this->entityManager = $entityManager; } /** @@ -60,7 +67,10 @@ protected function _construct() } /** + * Remove selections by option id + * * @param int $optionId + * * @return int */ public function removeOptionSelections($optionId) @@ -74,10 +84,11 @@ public function removeOptionSelections($optionId) /** * After save process * - * @param \Magento\Framework\Model\AbstractModel $object + * @param AbstractModel $object + * * @return $this */ - protected function _afterSave(\Magento\Framework\Model\AbstractModel $object) + protected function _afterSave(AbstractModel $object) { parent::_afterSave($object); @@ -90,7 +101,7 @@ protected function _afterSave(\Magento\Framework\Model\AbstractModel $object) $connection = $this->getConnection(); $connection->delete($this->getTable('catalog_product_bundle_option_value'), $condition); - $data = new \Magento\Framework\DataObject(); + $data = new DataObject(); $data->setOptionId($object->getId()) ->setStoreId($object->getStoreId()) ->setParentProductId($object->getParentId()) @@ -112,10 +123,10 @@ protected function _afterSave(\Magento\Framework\Model\AbstractModel $object) /** * After delete process * - * @param \Magento\Framework\Model\AbstractModel $object + * @param AbstractModel $object * @return $this */ - protected function _afterDelete(\Magento\Framework\Model\AbstractModel $object) + protected function _afterDelete(AbstractModel $object) { parent::_afterDelete($object); @@ -136,6 +147,7 @@ protected function _afterDelete(\Magento\Framework\Model\AbstractModel $object) * * @param int $productId * @param int $storeId + * * @return array */ public function getSearchableData($productId, $storeId) @@ -148,7 +160,7 @@ public function getSearchableData($productId, $storeId) 'option_title_default.title' ); $bind = ['store_id' => $storeId, 'product_id' => $productId]; - $linkField = $this->getMetadataPool()->getMetadata(ProductInterface::class)->getLinkField(); + $linkField = $this->metadataPool->getMetadata(ProductInterface::class)->getLinkField(); $select = $connection->select() ->from( ['opt' => $this->getMainTable()], @@ -180,7 +192,7 @@ public function getSearchableData($productId, $storeId) } /** - * {@inheritdoc} + * @inheritDoc */ public function getValidationRulesBeforeSave() { @@ -188,21 +200,9 @@ public function getValidationRulesBeforeSave() } /** - * Get MetadataPool instance - * @return MetadataPool - */ - private function getMetadataPool() - { - if (!$this->metadataPool) { - $this->metadataPool = ObjectManager::getInstance()->get(MetadataPool::class); - } - return $this->metadataPool; - } - - /** - * {@inheritdoc} + * @inheritDoc */ - public function save(\Magento\Framework\Model\AbstractModel $object) + public function save(AbstractModel $object) { $this->entityManager->save($object); diff --git a/app/code/Magento/Bundle/Model/Sales/Order/Pdf/Items/AbstractItems.php b/app/code/Magento/Bundle/Model/Sales/Order/Pdf/Items/AbstractItems.php index 30e37e54a21db..441bc0dd9de89 100644 --- a/app/code/Magento/Bundle/Model/Sales/Order/Pdf/Items/AbstractItems.php +++ b/app/code/Magento/Bundle/Model/Sales/Order/Pdf/Items/AbstractItems.php @@ -6,8 +6,14 @@ namespace Magento\Bundle\Model\Sales\Order\Pdf\Items; use Magento\Catalog\Model\Product\Type\AbstractType; -use Magento\Framework\App\ObjectManager; +use Magento\Framework\Data\Collection\AbstractDb; +use Magento\Framework\Filesystem; +use Magento\Framework\Filter\FilterManager; +use Magento\Framework\Model\Context; +use Magento\Framework\Model\ResourceModel\AbstractResource; +use Magento\Framework\Registry; use Magento\Framework\Serialize\Serializer\Json; +use Magento\Tax\Helper\Data; /** * Order pdf items renderer @@ -24,30 +30,28 @@ abstract class AbstractItems extends \Magento\Sales\Model\Order\Pdf\Items\Abstra private $serializer; /** - * Constructor - * - * @param \Magento\Framework\Model\Context $context - * @param \Magento\Framework\Registry $registry - * @param \Magento\Tax\Helper\Data $taxData - * @param \Magento\Framework\Filesystem $filesystem - * @param \Magento\Framework\Filter\FilterManager $filterManager - * @param \Magento\Framework\Model\ResourceModel\AbstractResource $resource - * @param \Magento\Framework\Data\Collection\AbstractDb $resourceCollection + * @param Context $context + * @param Registry $registry + * @param Data $taxData + * @param Filesystem $filesystem + * @param FilterManager $filterManager + * @param Json $serializer + * @param AbstractResource $resource + * @param AbstractDb $resourceCollection * @param array $data - * @param \Magento\Framework\Serialize\Serializer\Json $serializer */ public function __construct( - \Magento\Framework\Model\Context $context, - \Magento\Framework\Registry $registry, - \Magento\Tax\Helper\Data $taxData, - \Magento\Framework\Filesystem $filesystem, - \Magento\Framework\Filter\FilterManager $filterManager, - \Magento\Framework\Model\ResourceModel\AbstractResource $resource = null, - \Magento\Framework\Data\Collection\AbstractDb $resourceCollection = null, - array $data = [], - Json $serializer = null + Context $context, + Registry $registry, + Data $taxData, + Filesystem $filesystem, + FilterManager $filterManager, + Json $serializer, + AbstractResource $resource = null, + AbstractDb $resourceCollection = null, + array $data = [] ) { - $this->serializer = $serializer ?: ObjectManager::getInstance()->get(Json::class); + $this->serializer = $serializer; parent::__construct( $context, $registry, diff --git a/app/code/Magento/Bundle/Model/Sales/Order/Pdf/Items/Creditmemo.php b/app/code/Magento/Bundle/Model/Sales/Order/Pdf/Items/Creditmemo.php index 3d7d05396e0fc..1ed3fc76ddee0 100644 --- a/app/code/Magento/Bundle/Model/Sales/Order/Pdf/Items/Creditmemo.php +++ b/app/code/Magento/Bundle/Model/Sales/Order/Pdf/Items/Creditmemo.php @@ -3,10 +3,19 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ +declare(strict_types=1); + namespace Magento\Bundle\Model\Sales\Order\Pdf\Items; -use Magento\Framework\App\ObjectManager; +use Magento\Framework\Data\Collection\AbstractDb; +use Magento\Framework\Filesystem; +use Magento\Framework\Filter\FilterManager; +use Magento\Framework\Model\Context; +use Magento\Framework\Model\ResourceModel\AbstractResource; +use Magento\Framework\Registry; use Magento\Framework\Serialize\Serializer\Json; +use Magento\Framework\Stdlib\StringUtils; +use Magento\Tax\Helper\Data; /** * Order creditmemo pdf default items renderer @@ -16,36 +25,34 @@ class Creditmemo extends AbstractItems /** * Core string * - * @var \Magento\Framework\Stdlib\StringUtils + * @var StringUtils */ protected $string; /** - * Constructor - * - * @param \Magento\Framework\Model\Context $context - * @param \Magento\Framework\Registry $registry - * @param \Magento\Tax\Helper\Data $taxData - * @param \Magento\Framework\Filesystem $filesystem - * @param \Magento\Framework\Filter\FilterManager $filterManager - * @param \Magento\Framework\Stdlib\StringUtils $string - * @param \Magento\Framework\Model\ResourceModel\AbstractResource $resource - * @param \Magento\Framework\Data\Collection\AbstractDb $resourceCollection + * @param Context $context + * @param Registry $registry + * @param Data $taxData + * @param Filesystem $filesystem + * @param FilterManager $filterManager + * @param Json $serializer + * @param StringUtils $string + * @param AbstractResource $resource + * @param AbstractDb $resourceCollection * @param array $data - * @param \Magento\Framework\Serialize\Serializer\Json|null $serializer * @SuppressWarnings(PHPMD.ExcessiveParameterList) */ public function __construct( - \Magento\Framework\Model\Context $context, - \Magento\Framework\Registry $registry, - \Magento\Tax\Helper\Data $taxData, - \Magento\Framework\Filesystem $filesystem, - \Magento\Framework\Filter\FilterManager $filterManager, - \Magento\Framework\Stdlib\StringUtils $string, - \Magento\Framework\Model\ResourceModel\AbstractResource $resource = null, - \Magento\Framework\Data\Collection\AbstractDb $resourceCollection = null, - array $data = [], - Json $serializer = null + Context $context, + Registry $registry, + Data $taxData, + Filesystem $filesystem, + FilterManager $filterManager, + Json $serializer, + StringUtils $string, + AbstractResource $resource = null, + AbstractDb $resourceCollection = null, + array $data = [] ) { $this->string = $string; parent::__construct( @@ -54,10 +61,10 @@ public function __construct( $taxData, $filesystem, $filterManager, + $serializer, $resource, $resourceCollection, - $data, - $serializer + $data ); } @@ -98,19 +105,17 @@ public function draw() } // draw selection attributes - if ($childItem->getOrderItem()->getParentItem()) { - if ($prevOptionId != $attributes['option_id']) { - $line[0] = [ - 'font' => 'italic', - 'text' => $this->string->split($attributes['option_label'], 38, true, true), - 'feed' => $x, - ]; + if ($childItem->getOrderItem()->getParentItem() && $prevOptionId != $attributes['option_id']) { + $line[0] = [ + 'font' => 'italic', + 'text' => $this->string->split($attributes['option_label'], 38, true, true), + 'feed' => $x, + ]; - $drawItems[$optionId] = ['lines' => [$line], 'height' => 15]; + $drawItems[$optionId] = ['lines' => [$line], 'height' => 15]; - $line = []; - $prevOptionId = $attributes['option_id']; - } + $line = []; + $prevOptionId = $attributes['option_id']; } // draw product titles @@ -152,7 +157,7 @@ public function draw() // draw QTY $text = $childItem->getQty() * 1; $line[] = [ - 'text' => $childItem->getQty() * 1, + 'text' => $text, 'feed' => $x, 'font' => 'bold', 'align' => 'center', @@ -177,40 +182,34 @@ public function draw() // custom options $options = $item->getOrderItem()->getProductOptions(); - if ($options) { - if (isset($options['options'])) { - foreach ($options['options'] as $option) { - $lines = []; - $lines[][] = [ - 'text' => $this->string->split( - $this->filterManager->stripTags($option['label']), - 40, - true, - true - ), - 'font' => 'italic', - 'feed' => $leftBound, - ]; - - if ($option['value']) { - $text = []; - $printValue = isset( - $option['print_value'] - ) ? $option['print_value'] : $this->filterManager->stripTags( - $option['value'] - ); - $values = explode(', ', $printValue); - foreach ($values as $value) { - foreach ($this->string->split($value, 30, true, true) as $subValue) { - $text[] = $subValue; - } - } + if ($options && isset($options['options'])) { + foreach ($options['options'] as $option) { + $lines = []; + $lines[][] = [ + 'text' => $this->string->split( + $this->filterManager->stripTags($option['label']), + 40, + true, + true + ), + 'font' => 'italic', + 'feed' => $leftBound, + ]; - $lines[][] = ['text' => $text, 'feed' => $leftBound + 5]; + if ($option['value']) { + $text = []; + $printValue = $option['print_value'] ?? $this->filterManager->stripTags($option['value']); + $values = explode(', ', $printValue); + foreach ($values as $value) { + foreach ($this->string->split($value, 30, true, true) as $subValue) { + $text[] = $subValue; + } } - $drawItems[] = ['lines' => $lines, 'height' => 15]; + $lines[][] = ['text' => $text, 'feed' => $leftBound + 5]; } + + $drawItems[] = ['lines' => $lines, 'height' => 15]; } } diff --git a/app/code/Magento/Bundle/Model/Sales/Order/Pdf/Items/Invoice.php b/app/code/Magento/Bundle/Model/Sales/Order/Pdf/Items/Invoice.php index 1827c2249dda3..64e9f56dd65bc 100644 --- a/app/code/Magento/Bundle/Model/Sales/Order/Pdf/Items/Invoice.php +++ b/app/code/Magento/Bundle/Model/Sales/Order/Pdf/Items/Invoice.php @@ -3,10 +3,19 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ +declare(strict_types=1); + namespace Magento\Bundle\Model\Sales\Order\Pdf\Items; -use Magento\Framework\App\ObjectManager; +use Magento\Framework\Data\Collection\AbstractDb; +use Magento\Framework\Filesystem; +use Magento\Framework\Filter\FilterManager; +use Magento\Framework\Model\Context; +use Magento\Framework\Model\ResourceModel\AbstractResource; +use Magento\Framework\Registry; use Magento\Framework\Serialize\Serializer\Json; +use Magento\Framework\Stdlib\StringUtils; +use Magento\Tax\Helper\Data; /** * Order invoice pdf default items renderer @@ -14,36 +23,36 @@ class Invoice extends AbstractItems { /** - * @var \Magento\Framework\Stdlib\StringUtils + * @var StringUtils */ protected $string; /** * Constructor * - * @param \Magento\Framework\Model\Context $context - * @param \Magento\Framework\Registry $registry - * @param \Magento\Tax\Helper\Data $taxData - * @param \Magento\Framework\Filesystem $filesystem - * @param \Magento\Framework\Filter\FilterManager $filterManager - * @param \Magento\Framework\Stdlib\StringUtils $coreString - * @param \Magento\Framework\Model\ResourceModel\AbstractResource $resource - * @param \Magento\Framework\Data\Collection\AbstractDb $resourceCollection + * @param Context $context + * @param Registry $registry + * @param Data $taxData + * @param Filesystem $filesystem + * @param FilterManager $filterManager + * @param StringUtils $coreString + * @param Json $serializer + * @param AbstractResource $resource + * @param AbstractDb $resourceCollection * @param array $data - * @param \Magento\Framework\Serialize\Serializer\Json|null $serializer * @SuppressWarnings(PHPMD.ExcessiveParameterList) */ public function __construct( - \Magento\Framework\Model\Context $context, - \Magento\Framework\Registry $registry, - \Magento\Tax\Helper\Data $taxData, - \Magento\Framework\Filesystem $filesystem, - \Magento\Framework\Filter\FilterManager $filterManager, - \Magento\Framework\Stdlib\StringUtils $coreString, - \Magento\Framework\Model\ResourceModel\AbstractResource $resource = null, - \Magento\Framework\Data\Collection\AbstractDb $resourceCollection = null, - array $data = [], - Json $serializer = null + Context $context, + Registry $registry, + Data $taxData, + Filesystem $filesystem, + FilterManager $filterManager, + StringUtils $coreString, + Json $serializer, + AbstractResource $resource = null, + AbstractDb $resourceCollection = null, + array $data = [] ) { $this->string = $coreString; parent::__construct( @@ -52,10 +61,10 @@ public function __construct( $taxData, $filesystem, $filterManager, + $serializer, $resource, $resourceCollection, - $data, - $serializer + $data ); } @@ -94,19 +103,17 @@ public function draw() $drawItems[$optionId] = ['lines' => [], 'height' => 15]; } - if ($childItem->getOrderItem()->getParentItem()) { - if ($prevOptionId != $attributes['option_id']) { - $line[0] = [ - 'font' => 'italic', - 'text' => $this->string->split($attributes['option_label'], 45, true, true), - 'feed' => 35, - ]; + if ($childItem->getOrderItem()->getParentItem() && $prevOptionId != $attributes['option_id']) { + $line[0] = [ + 'font' => 'italic', + 'text' => $this->string->split($attributes['option_label'], 45, true, true), + 'feed' => 35, + ]; - $drawItems[$optionId] = ['lines' => [$line], 'height' => 15]; + $drawItems[$optionId] = ['lines' => [$line], 'height' => 15]; - $line = []; - $prevOptionId = $attributes['option_id']; - } + $line = []; + $prevOptionId = $attributes['option_id']; } /* in case Product name is longer than 80 chars - it is written in a few lines */ @@ -146,40 +153,34 @@ public function draw() // custom options $options = $item->getOrderItem()->getProductOptions(); - if ($options) { - if (isset($options['options'])) { - foreach ($options['options'] as $option) { - $lines = []; - $lines[][] = [ - 'text' => $this->string->split( - $this->filterManager->stripTags($option['label']), - 40, - true, - true - ), - 'font' => 'italic', - 'feed' => 35, - ]; - - if ($option['value']) { - $text = []; - $printValue = isset( - $option['print_value'] - ) ? $option['print_value'] : $this->filterManager->stripTags( - $option['value'] - ); - $values = explode(', ', $printValue); - foreach ($values as $value) { - foreach ($this->string->split($value, 30, true, true) as $subValue) { - $text[] = $subValue; - } + if ($options && isset($options['options'])) { + foreach ($options['options'] as $option) { + $lines = []; + $lines[][] = [ + 'text' => $this->string->split( + $this->filterManager->stripTags($option['label']), + 40, + true, + true + ), + 'font' => 'italic', + 'feed' => 35, + ]; + + if ($option['value']) { + $text = []; + $printValue = $option['print_value'] ?? $this->filterManager->stripTags($option['value']); + $values = explode(', ', $printValue); + foreach ($values as $value) { + foreach ($this->string->split($value, 30, true, true) as $subValue) { + $text[] = $subValue; } - - $lines[][] = ['text' => $text, 'feed' => 40]; } - $drawItems[] = ['lines' => $lines, 'height' => 15]; + $lines[][] = ['text' => $text, 'feed' => 40]; } + + $drawItems[] = ['lines' => $lines, 'height' => 15]; } } diff --git a/app/code/Magento/Bundle/Model/Sales/Order/Pdf/Items/Shipment.php b/app/code/Magento/Bundle/Model/Sales/Order/Pdf/Items/Shipment.php index 08ccf0618d03e..8a293b63541a2 100644 --- a/app/code/Magento/Bundle/Model/Sales/Order/Pdf/Items/Shipment.php +++ b/app/code/Magento/Bundle/Model/Sales/Order/Pdf/Items/Shipment.php @@ -3,10 +3,19 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ +declare(strict_types=1); + namespace Magento\Bundle\Model\Sales\Order\Pdf\Items; -use Magento\Framework\App\ObjectManager; +use Magento\Framework\Data\Collection\AbstractDb; +use Magento\Framework\Filesystem; +use Magento\Framework\Filter\FilterManager; +use Magento\Framework\Model\Context; +use Magento\Framework\Model\ResourceModel\AbstractResource; +use Magento\Framework\Registry; use Magento\Framework\Serialize\Serializer\Json; +use Magento\Framework\Stdlib\StringUtils; +use Magento\Tax\Helper\Data; /** * Order shipment pdf items renderer @@ -14,36 +23,34 @@ class Shipment extends AbstractItems { /** - * @var \Magento\Framework\Stdlib\StringUtils + * @var StringUtils */ protected $string; /** - * Constructor - * - * @param \Magento\Framework\Model\Context $context - * @param \Magento\Framework\Registry $registry - * @param \Magento\Tax\Helper\Data $taxData - * @param \Magento\Framework\Filesystem $filesystem - * @param \Magento\Framework\Filter\FilterManager $filterManager - * @param \Magento\Framework\Stdlib\StringUtils $string - * @param \Magento\Framework\Model\ResourceModel\AbstractResource $resource - * @param \Magento\Framework\Data\Collection\AbstractDb $resourceCollection + * @param Context $context + * @param Registry $registry + * @param Data $taxData + * @param Filesystem $filesystem + * @param FilterManager $filterManager + * @param StringUtils $string + * @param Json $serializer + * @param AbstractResource $resource + * @param AbstractDb $resourceCollection * @param array $data - * @param \Magento\Framework\Serialize\Serializer\Json|null $serializer * @SuppressWarnings(PHPMD.ExcessiveParameterList) */ public function __construct( - \Magento\Framework\Model\Context $context, - \Magento\Framework\Registry $registry, - \Magento\Tax\Helper\Data $taxData, - \Magento\Framework\Filesystem $filesystem, - \Magento\Framework\Filter\FilterManager $filterManager, - \Magento\Framework\Stdlib\StringUtils $string, - \Magento\Framework\Model\ResourceModel\AbstractResource $resource = null, - \Magento\Framework\Data\Collection\AbstractDb $resourceCollection = null, - array $data = [], - Json $serializer = null + Context $context, + Registry $registry, + Data $taxData, + Filesystem $filesystem, + FilterManager $filterManager, + StringUtils $string, + Json $serializer, + AbstractResource $resource = null, + AbstractDb $resourceCollection = null, + array $data = [] ) { $this->string = $string; parent::__construct( @@ -52,10 +59,10 @@ public function __construct( $taxData, $filesystem, $filterManager, + $serializer, $resource, $resourceCollection, - $data, - $serializer + $data ); } @@ -95,24 +102,22 @@ public function draw() $drawItems[$optionId] = ['lines' => [], 'height' => 15]; } - if ($childItem->getParentItem()) { - if ($prevOptionId != $attributes['option_id']) { - $line[0] = [ - 'font' => 'italic', - 'text' => $this->string->split($attributes['option_label'], 60, true, true), - 'feed' => 60, - ]; + if ($childItem->getParentItem() && $prevOptionId != $attributes['option_id']) { + $line[0] = [ + 'font' => 'italic', + 'text' => $this->string->split($attributes['option_label'], 60, true, true), + 'feed' => 60, + ]; - $drawItems[$optionId] = ['lines' => [$line], 'height' => 15]; + $drawItems[$optionId] = ['lines' => [$line], 'height' => 15]; - $line = []; + $line = []; - $prevOptionId = $attributes['option_id']; - } + $prevOptionId = $attributes['option_id']; } - if ($this->isShipmentSeparately() && $childItem->getParentItem() || - !$this->isShipmentSeparately() && !$childItem->getParentItem() + if (($this->isShipmentSeparately() && $childItem->getParentItem()) || + (!$this->isShipmentSeparately() && !$childItem->getParentItem()) ) { if (isset($shipItems[$childItem->getId()])) { $qty = $shipItems[$childItem->getId()]->getQty() * 1; @@ -153,40 +158,34 @@ public function draw() // custom options $options = $item->getOrderItem()->getProductOptions(); - if ($options) { - if (isset($options['options'])) { - foreach ($options['options'] as $option) { - $lines = []; - $lines[][] = [ - 'text' => $this->string->split( - $this->filterManager->stripTags($option['label']), - 70, - true, - true - ), - 'font' => 'italic', - 'feed' => 60, - ]; - - if ($option['value']) { - $text = []; - $printValue = isset( - $option['print_value'] - ) ? $option['print_value'] : $this->filterManager->stripTags( - $option['value'] - ); - $values = explode(', ', $printValue); - foreach ($values as $value) { - foreach ($this->string->split($value, 50, true, true) as $subValue) { - $text[] = $subValue; - } + if ($options && isset($options['options'])) { + foreach ($options['options'] as $option) { + $lines = []; + $lines[][] = [ + 'text' => $this->string->split( + $this->filterManager->stripTags($option['label']), + 70, + true, + true + ), + 'font' => 'italic', + 'feed' => 60, + ]; + + if ($option['value']) { + $text = []; + $printValue = $option['print_value'] ?? $this->filterManager->stripTags($option['value']); + $values = explode(', ', $printValue); + foreach ($values as $value) { + foreach ($this->string->split($value, 50, true, true) as $subValue) { + $text[] = $subValue; } - - $lines[][] = ['text' => $text, 'feed' => 65]; } - $drawItems[] = ['lines' => $lines, 'height' => 15]; + $lines[][] = ['text' => $text, 'feed' => 65]; } + + $drawItems[] = ['lines' => $lines, 'height' => 15]; } } diff --git a/app/code/Magento/Bundle/Pricing/Adjustment/Calculator.php b/app/code/Magento/Bundle/Pricing/Adjustment/Calculator.php index 04a6ee0bd459b..3051394eaf512 100644 --- a/app/code/Magento/Bundle/Pricing/Adjustment/Calculator.php +++ b/app/code/Magento/Bundle/Pricing/Adjustment/Calculator.php @@ -3,14 +3,18 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ +declare(strict_types=1); namespace Magento\Bundle\Pricing\Adjustment; +use Magento\Bundle\Model\Option; use Magento\Bundle\Model\Product\Price; use Magento\Bundle\Pricing\Price\BundleSelectionFactory; +use Magento\Bundle\Pricing\Price\BundleSelectionPrice; use Magento\Catalog\Model\Product; use Magento\Framework\Pricing\Adjustment\Calculator as CalculatorBase; use Magento\Framework\Pricing\Amount\AmountFactory; +use Magento\Framework\Pricing\Amount\AmountInterface; use Magento\Framework\Pricing\SaleableInterface; use Magento\Framework\Pricing\PriceCurrencyInterface; use Magento\Store\Model\Store; @@ -51,7 +55,7 @@ class Calculator implements BundleCalculatorInterface protected $priceCurrency; /** - * @var \Magento\Framework\Pricing\Amount\AmountInterface[] + * @var AmountInterface[] */ private $optionAmount = []; @@ -66,7 +70,7 @@ class Calculator implements BundleCalculatorInterface * @param BundleSelectionFactory $bundleSelectionFactory * @param TaxHelper $taxHelper * @param PriceCurrencyInterface $priceCurrency - * @param SelectionPriceListProviderInterface|null $selectionPriceListProvider + * @param SelectionPriceListProviderInterface $selectionPriceListProvider */ public function __construct( CalculatorBase $calculator, @@ -74,7 +78,7 @@ public function __construct( BundleSelectionFactory $bundleSelectionFactory, TaxHelper $taxHelper, PriceCurrencyInterface $priceCurrency, - SelectionPriceListProviderInterface $selectionPriceListProvider = null + SelectionPriceListProviderInterface $selectionPriceListProvider ) { $this->calculator = $calculator; $this->amountFactory = $amountFactory; @@ -91,7 +95,9 @@ public function __construct( * @param SaleableInterface $saleableItem * @param null|bool|string|array $exclude * @param null|array $context - * @return \Magento\Framework\Pricing\Amount\AmountInterface + * + * @return AmountInterface + * * @SuppressWarnings(PHPMD.UnusedFormalParameter) */ public function getAmount($amount, SaleableInterface $saleableItem, $exclude = null, $context = []) @@ -105,7 +111,8 @@ public function getAmount($amount, SaleableInterface $saleableItem, $exclude = n * @param float $amount * @param Product $saleableItem * @param null|bool|string|array $exclude - * @return \Magento\Framework\Pricing\Amount\AmountInterface + * + * @return AmountInterface */ public function getMinRegularAmount($amount, Product $saleableItem, $exclude = null) { @@ -118,7 +125,8 @@ public function getMinRegularAmount($amount, Product $saleableItem, $exclude = n * @param float $amount * @param Product $saleableItem * @param null|bool|string|array $exclude - * @return \Magento\Framework\Pricing\Amount\AmountInterface + * + * @return AmountInterface */ public function getMaxAmount($amount, Product $saleableItem, $exclude = null) { @@ -131,7 +139,8 @@ public function getMaxAmount($amount, Product $saleableItem, $exclude = null) * @param float $amount * @param Product $saleableItem * @param null|bool|string|array $exclude - * @return \Magento\Framework\Pricing\Amount\AmountInterface + * + * @return AmountInterface */ public function getMaxRegularAmount($amount, Product $saleableItem, $exclude = null) { @@ -146,7 +155,8 @@ public function getMaxRegularAmount($amount, Product $saleableItem, $exclude = n * @param bool $searchMin * @param float $baseAmount * @param bool $useRegularPrice - * @return \Magento\Framework\Pricing\Amount\AmountInterface + * + * @return AmountInterface */ public function getOptionsAmount( Product $saleableItem, @@ -173,7 +183,8 @@ public function getOptionsAmount( * * @param float $amount * @param Product $saleableItem - * @return \Magento\Framework\Pricing\Amount\AmountInterface|void + * + * @return AmountInterface|void */ public function getAmountWithoutOption($amount, Product $saleableItem) { @@ -194,29 +205,13 @@ public function getAmountWithoutOption($amount, Product $saleableItem) */ protected function getSelectionAmounts(Product $bundleProduct, $searchMin, $useRegularPrice = false) { - return $this->getSelectionPriceListProvider()->getPriceList($bundleProduct, $searchMin, $useRegularPrice); - } - - /** - * Get selection price list provider. - * - * @return SelectionPriceListProviderInterface - * @deprecated 100.2.0 - */ - private function getSelectionPriceListProvider() - { - if (null === $this->selectionPriceListProvider) { - $this->selectionPriceListProvider = \Magento\Framework\App\ObjectManager::getInstance() - ->get(SelectionPriceListProviderInterface::class); - } - - return $this->selectionPriceListProvider; + return $this->selectionPriceListProvider->getPriceList($bundleProduct, $searchMin, $useRegularPrice); } /** * Check this option if it should be skipped * - * @param \Magento\Bundle\Model\Option $option + * @param Option $option * @param bool $canSkipRequiredOption * @return bool * @deprecated 100.2.0 @@ -265,9 +260,9 @@ protected function getBundleOptions(Product $saleableItem) * * @param float $basePriceValue * @param Product $bundleProduct - * @param \Magento\Bundle\Pricing\Price\BundleSelectionPrice[] $selectionPriceList + * @param BundleSelectionPrice[] $selectionPriceList * @param null|bool|string|array $exclude - * @return \Magento\Framework\Pricing\Amount\AmountInterface + * @return AmountInterface */ public function calculateBundleAmount($basePriceValue, $bundleProduct, $selectionPriceList, $exclude = null) { @@ -282,14 +277,14 @@ public function calculateBundleAmount($basePriceValue, $bundleProduct, $selectio * * @param float $basePriceValue * @param Product $bundleProduct - * @param \Magento\Bundle\Pricing\Price\BundleSelectionPrice[] $selectionPriceList + * @param BundleSelectionPrice[] $selectionPriceList * @param null|bool|string|array $exclude - * @return \Magento\Framework\Pricing\Amount\AmountInterface + * @return AmountInterface */ protected function calculateFixedBundleAmount($basePriceValue, $bundleProduct, $selectionPriceList, $exclude) { $fullAmount = $basePriceValue; - /** @var $option \Magento\Bundle\Model\Option */ + /** @var $option Option */ foreach ($selectionPriceList as $selectionPrice) { $fullAmount += ($selectionPrice->getValue() * $selectionPrice->getQuantity()); } @@ -301,9 +296,9 @@ protected function calculateFixedBundleAmount($basePriceValue, $bundleProduct, $ * * @param float $basePriceValue * @param Product $bundleProduct - * @param \Magento\Bundle\Pricing\Price\BundleSelectionPrice[] $selectionPriceList + * @param BundleSelectionPrice[] $selectionPriceList * @param null|bool|string|array $exclude - * @return \Magento\Framework\Pricing\Amount\AmountInterface + * @return AmountInterface * @SuppressWarnings(PHPMD.CyclomaticComplexity) */ protected function calculateDynamicBundleAmount($basePriceValue, $bundleProduct, $selectionPriceList, $exclude) @@ -328,7 +323,7 @@ protected function calculateDynamicBundleAmount($basePriceValue, $bundleProduct, $store = $bundleProduct->getStore(); $roundingMethod = $this->taxHelper->getCalculationAlgorithm($store); foreach ($amountList as $amountInfo) { - /** @var \Magento\Framework\Pricing\Amount\AmountInterface $itemAmount */ + /** @var AmountInterface $itemAmount */ $itemAmount = $amountInfo['amount']; $qty = $amountInfo['quantity']; @@ -366,10 +361,10 @@ protected function calculateDynamicBundleAmount($basePriceValue, $bundleProduct, /** * Create selection price list for the retrieved options * - * @param \Magento\Bundle\Model\Option $option + * @param Option $option * @param Product $bundleProduct * @param bool $useRegularPrice - * @return \Magento\Bundle\Pricing\Price\BundleSelectionPrice[] + * @return BundleSelectionPrice[] */ public function createSelectionPriceList($option, $bundleProduct, $useRegularPrice = false) { @@ -399,10 +394,10 @@ public function createSelectionPriceList($option, $bundleProduct, $useRegularPri /** * Find minimal or maximal price for existing options * - * @param \Magento\Bundle\Model\Option $option - * @param \Magento\Bundle\Pricing\Price\BundleSelectionPrice[] $selectionPriceList + * @param Option $option + * @param BundleSelectionPrice[] $selectionPriceList * @param bool $searchMin - * @return \Magento\Bundle\Pricing\Price\BundleSelectionPrice[] + * @return BundleSelectionPrice[] * @SuppressWarnings(PHPMD.CyclomaticComplexity) */ public function processOptions($option, $selectionPriceList, $searchMin = true) diff --git a/app/code/Magento/Bundle/Pricing/Price/BundleOptionPrice.php b/app/code/Magento/Bundle/Pricing/Price/BundleOptionPrice.php index 1c724caaa28d8..a76112da0ca4e 100644 --- a/app/code/Magento/Bundle/Pricing/Price/BundleOptionPrice.php +++ b/app/code/Magento/Bundle/Pricing/Price/BundleOptionPrice.php @@ -3,12 +3,17 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ +declare(strict_types=1); + namespace Magento\Bundle\Pricing\Price; +use Magento\Bundle\Model\ResourceModel\Option\Collection; +use Magento\Bundle\Model\Selection; use Magento\Bundle\Pricing\Adjustment\BundleCalculatorInterface; use Magento\Catalog\Model\Product; +use Magento\Framework\Pricing\Amount\AmountInterface; use Magento\Framework\Pricing\Price\AbstractPrice; -use Magento\Framework\App\ObjectManager; +use Magento\Framework\Pricing\PriceCurrencyInterface; /** * Bundle option price model with final price. @@ -25,12 +30,6 @@ class BundleOptionPrice extends AbstractPrice implements BundleOptionPriceInterf */ protected $calculator; - /** - * @var BundleSelectionFactory - * @deprecated - */ - protected $selectionFactory; - /** * @var float|bool|null */ @@ -45,26 +44,23 @@ class BundleOptionPrice extends AbstractPrice implements BundleOptionPriceInterf * @param Product $saleableItem * @param float $quantity * @param BundleCalculatorInterface $calculator - * @param \Magento\Framework\Pricing\PriceCurrencyInterface $priceCurrency - * @param BundleSelectionFactory $bundleSelectionFactory - * @param BundleOptions|null $bundleOptions + * @param PriceCurrencyInterface $priceCurrency + * @param BundleOptions $bundleOptions */ public function __construct( Product $saleableItem, $quantity, BundleCalculatorInterface $calculator, - \Magento\Framework\Pricing\PriceCurrencyInterface $priceCurrency, - BundleSelectionFactory $bundleSelectionFactory, - BundleOptions $bundleOptions = null + PriceCurrencyInterface $priceCurrency, + BundleOptions $bundleOptions ) { - $this->selectionFactory = $bundleSelectionFactory; parent::__construct($saleableItem, $quantity, $calculator, $priceCurrency); $this->product->setQty($this->quantity); - $this->bundleOptions = $bundleOptions ?: ObjectManager::getInstance()->get(BundleOptions::class); + $this->bundleOptions = $bundleOptions; } /** - * {@inheritdoc} + * @inheritDoc */ public function getValue() { @@ -75,25 +71,10 @@ public function getValue() return $this->value; } - /** - * Getter for maximal price of options. - * - * @return bool|float - * @deprecated - */ - public function getMaxValue() - { - if (null === $this->maximalPrice) { - $this->maximalPrice = $this->bundleOptions->calculateOptions($this->product, false); - } - - return $this->maximalPrice; - } - /** * Get Options with attached Selections collection. * - * @return \Magento\Bundle\Model\ResourceModel\Option\Collection + * @return Collection */ public function getOptions() { @@ -103,8 +84,9 @@ public function getOptions() /** * Get selection amount. * - * @param \Magento\Bundle\Model\Selection $selection - * @return \Magento\Framework\Pricing\Amount\AmountInterface + * @param Selection $selection + * + * @return AmountInterface */ public function getOptionSelectionAmount($selection) { @@ -119,6 +101,7 @@ public function getOptionSelectionAmount($selection) * Calculate maximal or minimal options value. * * @param bool $searchMin + * * @return bool|float */ protected function calculateOptions($searchMin = true) @@ -129,7 +112,7 @@ protected function calculateOptions($searchMin = true) /** * Get minimal amount of bundle price with options * - * @return \Magento\Framework\Pricing\Amount\AmountInterface + * @return AmountInterface */ public function getAmount() { diff --git a/app/code/Magento/Bundle/Pricing/Price/FinalPrice.php b/app/code/Magento/Bundle/Pricing/Price/FinalPrice.php index c41f6a4868ab1..66f618c0fcfa5 100644 --- a/app/code/Magento/Bundle/Pricing/Price/FinalPrice.php +++ b/app/code/Magento/Bundle/Pricing/Price/FinalPrice.php @@ -3,15 +3,17 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ +declare(strict_types=1); namespace Magento\Bundle\Pricing\Price; -use Magento\Catalog\Model\Product; -use Magento\Framework\Pricing\Adjustment\CalculatorInterface; -use Magento\Catalog\Pricing\Price\CustomOptionPrice; use Magento\Bundle\Model\Product\Price; -use Magento\Framework\App\ObjectManager; use Magento\Catalog\Api\ProductCustomOptionRepositoryInterface; +use Magento\Catalog\Model\Product; +use Magento\Catalog\Pricing\Price\CustomOptionPrice; +use Magento\Framework\Pricing\Adjustment\CalculatorInterface; +use Magento\Framework\Pricing\Amount\AmountInterface; +use Magento\Framework\Pricing\PriceCurrencyInterface; /** * Final price model @@ -19,27 +21,27 @@ class FinalPrice extends \Magento\Catalog\Pricing\Price\FinalPrice implements FinalPriceInterface { /** - * @var \Magento\Framework\Pricing\Amount\AmountInterface + * @var AmountInterface */ protected $maximalPrice; /** - * @var \Magento\Framework\Pricing\Amount\AmountInterface + * @var AmountInterface */ protected $minimalPrice; /** - * @var \Magento\Framework\Pricing\Amount\AmountInterface + * @var AmountInterface */ protected $priceWithoutOption; /** - * @var \Magento\Bundle\Pricing\Price\BundleOptionPrice + * @var BundleOptionPrice */ protected $bundleOptionPrice; /** - * @var \Magento\Catalog\Api\ProductCustomOptionRepositoryInterface + * @var ProductCustomOptionRepositoryInterface */ private $productOptionRepository; @@ -47,15 +49,18 @@ class FinalPrice extends \Magento\Catalog\Pricing\Price\FinalPrice implements Fi * @param Product $saleableItem * @param float $quantity * @param CalculatorInterface $calculator - * @param \Magento\Framework\Pricing\PriceCurrencyInterface $priceCurrency + * @param PriceCurrencyInterface $priceCurrency + * @param ProductCustomOptionRepositoryInterface $productOptionRepository */ public function __construct( Product $saleableItem, $quantity, CalculatorInterface $calculator, - \Magento\Framework\Pricing\PriceCurrencyInterface $priceCurrency + PriceCurrencyInterface $priceCurrency, + ProductCustomOptionRepositoryInterface $productOptionRepository ) { parent::__construct($saleableItem, $quantity, $calculator, $priceCurrency); + $this->productOptionRepository = $productOptionRepository; } /** @@ -65,49 +70,33 @@ public function __construct( */ public function getValue() { - return parent::getValue() + - $this->getBundleOptionPrice()->getValue(); + return parent::getValue() + $this->getBundleOptionPrice()->getValue(); } /** * Returns max price * - * @return \Magento\Framework\Pricing\Amount\AmountInterface + * @return AmountInterface */ public function getMaximalPrice() { if (!$this->maximalPrice) { $price = $this->getBasePrice()->getValue(); if ($this->product->getPriceType() == Price::PRICE_TYPE_FIXED) { - /** @var \Magento\Catalog\Pricing\Price\CustomOptionPrice $customOptionPrice */ + /** @var CustomOptionPrice $customOptionPrice */ $customOptionPrice = $this->priceInfo->getPrice(CustomOptionPrice::PRICE_CODE); $price += $customOptionPrice->getCustomOptionRange(false); } $this->maximalPrice = $this->calculator->getMaxAmount($price, $this->product); } - return $this->maximalPrice; - } - /** - * Return ProductCustomOptionRepository - * - * @return ProductCustomOptionRepositoryInterface - * @deprecated 100.1.0 - */ - private function getProductOptionRepository() - { - if (!$this->productOptionRepository) { - $this->productOptionRepository = ObjectManager::getInstance()->get( - ProductCustomOptionRepositoryInterface::class - ); - } - return $this->productOptionRepository; + return $this->maximalPrice; } /** * Returns min price * - * @return \Magento\Framework\Pricing\Amount\AmountInterface + * @return AmountInterface */ public function getMinimalPrice() { @@ -117,7 +106,7 @@ public function getMinimalPrice() /** * Returns price amount * - * @return \Magento\Framework\Pricing\Amount\AmountInterface + * @return AmountInterface */ public function getAmount() { @@ -125,7 +114,7 @@ public function getAmount() $price = parent::getValue(); if ($this->product->getPriceType() == Price::PRICE_TYPE_FIXED) { $this->loadProductCustomOptions(); - /** @var \Magento\Catalog\Pricing\Price\CustomOptionPrice $customOptionPrice */ + /** @var CustomOptionPrice $customOptionPrice */ $customOptionPrice = $this->priceInfo->getPrice(CustomOptionPrice::PRICE_CODE); $price += $customOptionPrice->getCustomOptionRange(true); } @@ -143,7 +132,7 @@ private function loadProductCustomOptions() { if (!$this->product->getOptions()) { $options = []; - foreach ($this->getProductOptionRepository()->getProductOptions($this->product) as $option) { + foreach ($this->productOptionRepository->getProductOptions($this->product) as $option) { $option->setProduct($this->product); $options[] = $option; } @@ -152,9 +141,9 @@ private function loadProductCustomOptions() } /** - * get bundle product price without any option + * Get bundle product price without any option * - * @return \Magento\Framework\Pricing\Amount\AmountInterface + * @return AmountInterface */ public function getPriceWithoutOption() { @@ -167,7 +156,7 @@ public function getPriceWithoutOption() /** * Returns option price * - * @return \Magento\Bundle\Pricing\Price\BundleOptionPrice + * @return BundleOptionPrice */ protected function getBundleOptionPrice() { diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/AdminAddBundleItemsTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/AdminAddBundleItemsTest.xml index c67a207ebf0b1..0871a6723417f 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/AdminAddBundleItemsTest.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/AdminAddBundleItemsTest.xml @@ -26,7 +26,7 @@ <createData entity="SimpleProduct2" stepKey="simpleProduct2"/> <createData entity="SimpleProduct2" stepKey="simpleProduct3"/> <!--Admin login--> - <actionGroup stepKey="loginToAdminPanel" ref="LoginAsAdmin"/> + <actionGroup stepKey="loginToAdminPanel" ref="AdminLoginActionGroup"/> </before> <after> <!--Deleting data--> diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/AdminAddBundleProductToCartFromWishListPageTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/AdminAddBundleProductToCartFromWishListPageTest.xml index aa06990f7af78..803beb30d677b 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/AdminAddBundleProductToCartFromWishListPageTest.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/AdminAddBundleProductToCartFromWishListPageTest.xml @@ -21,7 +21,7 @@ <before> <!-- Login as Admin --> <comment userInput="Login as Admin" stepKey="commentLoginAsAdmin"/> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <!-- Create customer on Storefront and bundle product --> <comment userInput="Create customer on Storefront and bundle product" stepKey="commentCreateData"/> <createData entity="SimpleSubCategory" stepKey="createCategory"/> diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/AdminAddDefaultImageBundleProductTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/AdminAddDefaultImageBundleProductTest.xml index 3770e47079c98..73ced5eaf1592 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/AdminAddDefaultImageBundleProductTest.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/AdminAddDefaultImageBundleProductTest.xml @@ -19,7 +19,7 @@ <group value="Bundle"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <createData entity="SimpleProduct2" stepKey="simpleProduct1"/> <createData entity="SimpleProduct2" stepKey="simpleProduct2"/> </before> diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/AdminAssociateBundleProductToWebsitesTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/AdminAssociateBundleProductToWebsitesTest.xml index baf9652522909..30922839a191d 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/AdminAssociateBundleProductToWebsitesTest.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/AdminAssociateBundleProductToWebsitesTest.xml @@ -46,7 +46,7 @@ <magentoCLI command="indexer:reindex" stepKey="reindex"/> <!-- Login as admin --> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <!--Create website--> <actionGroup ref="AdminCreateWebsiteActionGroup" stepKey="createSecondWebsite"> diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/AdminAttributeSetSelectionTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/AdminAttributeSetSelectionTest.xml index c8977cbae1957..06a05e7a29cd9 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/AdminAttributeSetSelectionTest.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/AdminAttributeSetSelectionTest.xml @@ -19,7 +19,7 @@ <group value="Bundle"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> </before> <after> <amOnPage url="{{AdminLogoutPage.url}}" stepKey="amOnLogoutPage"/> diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/AdminBasicBundleProductAttributesTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/AdminBasicBundleProductAttributesTest.xml index fcfd80ac8533c..7b65b2db0f160 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/AdminBasicBundleProductAttributesTest.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/AdminBasicBundleProductAttributesTest.xml @@ -18,7 +18,7 @@ <group value="Bundle"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> </before> <after> <amOnPage url="{{AdminLogoutPage.url}}" stepKey="amOnLogoutPage"/> diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/AdminCreateAndEditBundleProductOptionsNegativeTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/AdminCreateAndEditBundleProductOptionsNegativeTest.xml index 8a8e9dd275ee4..82da228e040dc 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/AdminCreateAndEditBundleProductOptionsNegativeTest.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/AdminCreateAndEditBundleProductOptionsNegativeTest.xml @@ -32,7 +32,7 @@ <createData entity="SimpleProduct2" stepKey="createSecondSimpleProduct"/> <!-- Login as admin --> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> </before> <after> <!-- Delete the simple product --> diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/AdminCreateAndEditBundleProductSettingsTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/AdminCreateAndEditBundleProductSettingsTest.xml index 1a7117fbf4485..26d7dddbcc378 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/AdminCreateAndEditBundleProductSettingsTest.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/AdminCreateAndEditBundleProductSettingsTest.xml @@ -26,7 +26,7 @@ <createData entity="SimpleProduct2" stepKey="createSimpleProduct"/> <!-- Login as admin --> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> </before> <after> <!-- Delete the simple product --> diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/AdminDeleteABundleProductTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/AdminDeleteABundleProductTest.xml index a98d544aad3b6..8dad41ca780af 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/AdminDeleteABundleProductTest.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/AdminDeleteABundleProductTest.xml @@ -19,7 +19,7 @@ <group value="Bundle"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <createData entity="SimpleProduct2" stepKey="simpleProduct1"/> <createData entity="SimpleProduct2" stepKey="simpleProduct2"/> </before> diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/AdminDeleteBundleDynamicProductTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/AdminDeleteBundleDynamicProductTest.xml index a3e9a8af40a34..3ce398f9c33ba 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/AdminDeleteBundleDynamicProductTest.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/AdminDeleteBundleDynamicProductTest.xml @@ -21,7 +21,7 @@ </skip> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <createData entity="_defaultCategory" stepKey="createCategory"/> <createData entity="ApiBundleProductPriceViewRange" stepKey="createDynamicBundleProduct"> <requiredEntity createDataKey="createCategory"/> diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/AdminDeleteBundleFixedProductTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/AdminDeleteBundleFixedProductTest.xml index 0c26fb1775bff..1f37468ea245c 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/AdminDeleteBundleFixedProductTest.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/AdminDeleteBundleFixedProductTest.xml @@ -18,7 +18,7 @@ <group value="mtf_migrated"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <createData entity="_defaultCategory" stepKey="createCategory"/> <createData entity="FixedBundleProduct" stepKey="createFixedBundleProduct"> <requiredEntity createDataKey="createCategory"/> diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/AdminEditRelatedBundleProductTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/AdminEditRelatedBundleProductTest.xml index fbb9dda50f0d9..2fe5981eb36c7 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/AdminEditRelatedBundleProductTest.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/AdminEditRelatedBundleProductTest.xml @@ -20,7 +20,7 @@ </annotations> <before> <!--Admin login--> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <createData entity="SimpleProduct2" stepKey="simpleProduct0"/> <createData entity="SimpleProduct2" stepKey="simpleProduct1"/> </before> diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/AdminFilterProductListByBundleProductTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/AdminFilterProductListByBundleProductTest.xml index dea39fcb45908..f34ebd4b93cdc 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/AdminFilterProductListByBundleProductTest.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/AdminFilterProductListByBundleProductTest.xml @@ -19,7 +19,7 @@ <group value="Bundle"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <createData entity="SimpleProduct2" stepKey="simpleProduct1"/> <createData entity="SimpleProduct2" stepKey="simpleProduct2"/> </before> diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/AdminMassDeleteBundleProducts.xml b/app/code/Magento/Bundle/Test/Mftf/Test/AdminMassDeleteBundleProducts.xml index 28abd06253393..81bd46fdb5412 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/AdminMassDeleteBundleProducts.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/AdminMassDeleteBundleProducts.xml @@ -19,7 +19,7 @@ <group value="Bundle"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <createData entity="SimpleProduct2" stepKey="simpleProduct1"/> <createData entity="SimpleProduct2" stepKey="simpleProduct2"/> <createData entity="SimpleProduct2" stepKey="simpleProduct3"/> diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/AdminProductBundleCreationTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/AdminProductBundleCreationTest.xml index 0af44f64f8df1..70fe7720f0d78 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/AdminProductBundleCreationTest.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/AdminProductBundleCreationTest.xml @@ -25,7 +25,7 @@ <createData entity="SimpleProduct2" stepKey="simpleProduct2"/> <!-- Admin Login--> - <actionGroup stepKey="loginToAdminPanel" ref="LoginAsAdmin"/> + <actionGroup stepKey="loginToAdminPanel" ref="AdminLoginActionGroup"/> </before> <after> <deleteData createDataKey="createPreReqCategory" stepKey="deletePreReqCategory"/> diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/AdminRemoveDefaultImageBundleProductTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/AdminRemoveDefaultImageBundleProductTest.xml index 77be5b879b1c6..c292d831fac13 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/AdminRemoveDefaultImageBundleProductTest.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/AdminRemoveDefaultImageBundleProductTest.xml @@ -19,7 +19,7 @@ <group value="Bundle"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <createData entity="SimpleProduct2" stepKey="simpleProduct1"/> <createData entity="SimpleProduct2" stepKey="simpleProduct2"/> </before> diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/AdminShouldBeAbleToMassUpdateAttributesForBundleProductsTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/AdminShouldBeAbleToMassUpdateAttributesForBundleProductsTest.xml index 173319affe53b..4172611d99b88 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/AdminShouldBeAbleToMassUpdateAttributesForBundleProductsTest.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/AdminShouldBeAbleToMassUpdateAttributesForBundleProductsTest.xml @@ -46,7 +46,7 @@ <actionGroup ref="AdminLogoutActionGroup" stepKey="logoutAsAdmin"/> </after> <!-- Login as Admin --> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <!-- Go to Catalog -> Catalog -> Products and Search created product in precondition and choose it --> <actionGroup ref="SearchForProductOnBackendActionGroup" stepKey="searchProduct"> <argument name="product" value="$$createFixedBundleProduct$$"/> diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/BundleProductFixedPricingTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/BundleProductFixedPricingTest.xml index 171ed1323a6b2..c14da7e1cbfd0 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/BundleProductFixedPricingTest.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/BundleProductFixedPricingTest.xml @@ -25,7 +25,7 @@ <createData entity="SimpleProduct2" stepKey="simpleProduct2"/> <!--Admin login--> - <actionGroup stepKey="loginToAdminPanel" ref="LoginAsAdmin"/> + <actionGroup stepKey="loginToAdminPanel" ref="AdminLoginActionGroup"/> </before> <after> <deleteData createDataKey="createPreReqCategory" stepKey="deletePreReqCategory"/> diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/BundleProductWithTierPriceInCartTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/BundleProductWithTierPriceInCartTest.xml index 91a2d15287033..d08ad8970e19f 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/BundleProductWithTierPriceInCartTest.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/BundleProductWithTierPriceInCartTest.xml @@ -20,7 +20,7 @@ <before> <createData entity="SimpleProduct2" stepKey="simpleProduct1"/> <createData entity="SimpleProduct2" stepKey="simpleProduct2"/> - <actionGroup ref="LoginAsAdmin" stepKey="login"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="login"/> </before> <after> <deleteData createDataKey="simpleProduct1" stepKey="deleteSimpleProduct1"/> diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/CurrencyChangingBundleProductInCartTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/CurrencyChangingBundleProductInCartTest.xml index 14753da609967..a3e5c988717a7 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/CurrencyChangingBundleProductInCartTest.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/CurrencyChangingBundleProductInCartTest.xml @@ -18,7 +18,7 @@ <group value="Bundle"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="login"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="login"/> <createData entity="SimpleProduct2" stepKey="simpleProduct1"/> <createData entity="SimpleProduct2" stepKey="simpleProduct2"/> </before> diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/EnableDisableBundleProductStatusTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/EnableDisableBundleProductStatusTest.xml index f1124e5446b58..ceea9e47af7ee 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/EnableDisableBundleProductStatusTest.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/EnableDisableBundleProductStatusTest.xml @@ -25,7 +25,7 @@ <createData entity="SimpleProduct2" stepKey="simpleProduct2"/> <!--Admin login--> - <actionGroup stepKey="loginToAdminPanel" ref="LoginAsAdmin"/> + <actionGroup stepKey="loginToAdminPanel" ref="AdminLoginActionGroup"/> </before> <after> <deleteData createDataKey="createPreReqCategory" stepKey="deletePreReqCategory"/> diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/MassEnableDisableBundleProductsTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/MassEnableDisableBundleProductsTest.xml index 4760570adfa2e..6310f6497ac1e 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/MassEnableDisableBundleProductsTest.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/MassEnableDisableBundleProductsTest.xml @@ -19,7 +19,7 @@ <group value="Bundle"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <createData entity="SimpleProduct2" stepKey="simpleProduct1"/> <createData entity="SimpleProduct2" stepKey="simpleProduct2"/> <createData entity="SimpleProduct2" stepKey="simpleProduct3"/> diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/NewBundleProductSelectionTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/NewBundleProductSelectionTest.xml index 2b948ff02d38c..efef033f9d974 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/NewBundleProductSelectionTest.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/NewBundleProductSelectionTest.xml @@ -19,7 +19,7 @@ <group value="Bundle"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> </before> <after> <amOnPage url="{{AdminLogoutPage.url}}" stepKey="amOnLogoutPage"/> diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontAddBundleOptionsToCartTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontAddBundleOptionsToCartTest.xml index 296ba31baa589..7ded8b300f82d 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontAddBundleOptionsToCartTest.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontAddBundleOptionsToCartTest.xml @@ -19,7 +19,7 @@ <group value="Bundle"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="login"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="login"/> <createData entity="SimpleProduct2" stepKey="simpleProduct1"/> <createData entity="SimpleProduct2" stepKey="simpleProduct2"/> <createData entity="SimpleProduct2" stepKey="simpleProduct3"/> diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontAddBundleProductWithZeroPriceToShoppingCartTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontAddBundleProductWithZeroPriceToShoppingCartTest.xml index 7ff88c49f0bc7..1a40489387197 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontAddBundleProductWithZeroPriceToShoppingCartTest.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontAddBundleProductWithZeroPriceToShoppingCartTest.xml @@ -66,7 +66,7 @@ <grabTextFrom selector="{{CheckoutSuccessMainSection.orderNumber}}" stepKey="grabOrderNumber"/> <!--Check subtotal in created order--> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <actionGroup ref="FilterOrderGridByIdActionGroup" stepKey="filterOrderById"> <argument name="orderId" value="$grabOrderNumber"/> </actionGroup> diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontAdminEditDataTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontAdminEditDataTest.xml index 22b746ce69046..dc5344e91ec82 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontAdminEditDataTest.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontAdminEditDataTest.xml @@ -19,7 +19,7 @@ <group value="Bundle"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <createData entity="SimpleProduct2" stepKey="simpleProduct1"/> <createData entity="SimpleProduct2" stepKey="simpleProduct2"/> </before> diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontBundleAddToCartSuccessTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontBundleAddToCartSuccessTest.xml index 9fc19f5c5750f..85be636ec269c 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontBundleAddToCartSuccessTest.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontBundleAddToCartSuccessTest.xml @@ -19,7 +19,7 @@ <group value="Bundle"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="login"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="login"/> <createData entity="SimpleProduct2" stepKey="simpleProduct1"/> <createData entity="SimpleProduct2" stepKey="simpleProduct2"/> </before> diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontBundleCartTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontBundleCartTest.xml index ed4a592b0d71e..1adad0f1a4d80 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontBundleCartTest.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontBundleCartTest.xml @@ -19,7 +19,7 @@ <group value="Bundle"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="login"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="login"/> <createData entity="SimpleProduct2" stepKey="simpleProduct1"/> <createData entity="SimpleProduct2" stepKey="simpleProduct2"/> </before> diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontBundleProductDetailsTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontBundleProductDetailsTest.xml index 15d5ff7d3560b..80681704533fc 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontBundleProductDetailsTest.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontBundleProductDetailsTest.xml @@ -25,7 +25,7 @@ <createData entity="SimpleProduct2" stepKey="simpleProduct2"/> <!-- Admin Login--> - <actionGroup stepKey="loginToAdminPanel" ref="LoginAsAdmin"/> + <actionGroup stepKey="loginToAdminPanel" ref="AdminLoginActionGroup"/> <actionGroup ref="DisabledWYSIWYGActionGroup" stepKey="disableWYSIWYG"/> </before> <after> diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontBundleProductShownInCategoryListAndGridTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontBundleProductShownInCategoryListAndGridTest.xml index 78a039eccde2d..65b20ca1dd7c1 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontBundleProductShownInCategoryListAndGridTest.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontBundleProductShownInCategoryListAndGridTest.xml @@ -20,7 +20,7 @@ </annotations> <before> <!--Admin login--> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <createData entity="SimpleProduct2" stepKey="simpleProduct1"/> <createData entity="SimpleProduct2" stepKey="simpleProduct2"/> <createData entity="SimpleProduct2" stepKey="simpleProduct3"/> diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontCheckBundleProductOptionTierPricesTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontCheckBundleProductOptionTierPricesTest.xml index 30369d447ab15..753a36dc1e613 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontCheckBundleProductOptionTierPricesTest.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontCheckBundleProductOptionTierPricesTest.xml @@ -26,7 +26,7 @@ <!-- Add tier prices to simple products --> <!-- Simple product 1 --> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <actionGroup ref="AdminProductPageOpenByIdActionGroup" stepKey="openAdminEditPageProduct1"> <argument name="productId" value="$$simpleProduct1CreateBundleProduct.id$$"/> </actionGroup> diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontCustomerSelectAndSetBundleOptionsTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontCustomerSelectAndSetBundleOptionsTest.xml index 613187a4c3856..a5e0c0cc4658a 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontCustomerSelectAndSetBundleOptionsTest.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontCustomerSelectAndSetBundleOptionsTest.xml @@ -19,7 +19,7 @@ <group value="Bundle"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="login"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="login"/> <createData entity="SimpleProduct2" stepKey="simpleProduct1"/> <createData entity="SimpleProduct2" stepKey="simpleProduct2"/> diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontEditBundleProductTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontEditBundleProductTest.xml index d284ddf59ddcf..115b540e672f1 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontEditBundleProductTest.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontEditBundleProductTest.xml @@ -19,7 +19,7 @@ <group value="Bundle"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <createData entity="SimpleProduct2" stepKey="simpleProduct1"/> <createData entity="SimpleProduct2" stepKey="simpleProduct2"/> </before> diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontGoToDetailsPageWhenAddingToCartTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontGoToDetailsPageWhenAddingToCartTest.xml index f0e16bbdd1b99..93554917b6783 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontGoToDetailsPageWhenAddingToCartTest.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontGoToDetailsPageWhenAddingToCartTest.xml @@ -19,7 +19,7 @@ <group value="Bundle"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <createData entity="SimpleProduct2" stepKey="simpleProduct1"/> <createData entity="SimpleProduct2" stepKey="simpleProduct2"/> <createData entity="_defaultCategory" stepKey="createCategory"/> diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontVerifyDynamicBundleProductPricesForCombinationOfOptionsTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontVerifyDynamicBundleProductPricesForCombinationOfOptionsTest.xml index d388549745d51..ac2ab4806fd44 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontVerifyDynamicBundleProductPricesForCombinationOfOptionsTest.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontVerifyDynamicBundleProductPricesForCombinationOfOptionsTest.xml @@ -39,7 +39,7 @@ </createData> <!--Add special price to simple product--> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <actionGroup ref="AdminProductPageOpenByIdActionGroup" stepKey="openAdminEditPage"> <argument name="productId" value="$$simpleProduct5.id$$"/> </actionGroup> diff --git a/app/code/Magento/Bundle/Test/Unit/Model/LinkManagementTest.php b/app/code/Magento/Bundle/Test/Unit/Model/LinkManagementTest.php index ccc8c52d5022f..b31b82a6a72bf 100644 --- a/app/code/Magento/Bundle/Test/Unit/Model/LinkManagementTest.php +++ b/app/code/Magento/Bundle/Test/Unit/Model/LinkManagementTest.php @@ -7,174 +7,198 @@ namespace Magento\Bundle\Test\Unit\Model; +use Exception; +use Magento\Bundle\Api\Data\LinkInterface; +use Magento\Bundle\Api\Data\LinkInterfaceFactory; use Magento\Bundle\Model\LinkManagement; +use Magento\Bundle\Model\Option; +use Magento\Bundle\Model\ResourceModel\Bundle; +use Magento\Bundle\Model\ResourceModel\BundleFactory; +use Magento\Bundle\Model\ResourceModel\Option\Collection as OptionCollection; +use Magento\Bundle\Model\ResourceModel\Option\CollectionFactory as OptionCollectionFactory; +use Magento\Bundle\Model\ResourceModel\Selection\Collection as SelectionCollection; +use Magento\Bundle\Model\Selection; +use Magento\Bundle\Model\SelectionFactory; +use Magento\Catalog\Api\Data\ProductInterface; +use Magento\Catalog\Model\Product; +use Magento\Catalog\Model\Product\Type; +use Magento\Catalog\Model\ProductRepository; +use Magento\Framework\Api\DataObjectHelper; +use Magento\Framework\EntityManager\EntityMetadata; +use Magento\Framework\EntityManager\MetadataPool; use Magento\Framework\TestFramework\Unit\Helper\ObjectManager; +use Magento\Store\Model\Store; +use Magento\Store\Model\StoreManagerInterface; +use PHPUnit\Framework\MockObject\MockObject; +use PHPUnit\Framework\TestCase; /** - * Class LinkManagementTest + * Test class for \Magento\Bundle\Model\LinkManagement * * @SuppressWarnings(PHPMD.TooManyFields) * @SuppressWarnings(PHPMD.CouplingBetweenObjects) */ -class LinkManagementTest extends \PHPUnit\Framework\TestCase +class LinkManagementTest extends TestCase { /** - * @var \Magento\Bundle\Model\LinkManagement + * @var LinkManagement */ - protected $model; + private $model; /** - * @var \Magento\Catalog\Model\ProductRepository|\PHPUnit_Framework_MockObject_MockObject + * @var ProductRepository|MockObject */ - protected $productRepository; + private $productRepository; /** - * @var \Magento\Catalog\Model\Product|\PHPUnit_Framework_MockObject_MockObject + * @var Product|MockObject */ - protected $product; + private $product; /** - * @var \PHPUnit_Framework_MockObject_MockObject + * @var LinkInterfaceFactory|MockObject */ - protected $linkFactory; + private $linkFactory; /** - * @var \Magento\Catalog\Model\Product\Type\Interceptor|\PHPUnit_Framework_MockObject_MockObject + * @var Type|MockObject */ - protected $productType; + private $productType; /** - * @var \Magento\Bundle\Model\ResourceModel\Option\Collection|\PHPUnit_Framework_MockObject_MockObject + * @var OptionCollection|MockObject */ - protected $optionCollection; + private $optionCollection; /** - * @var \Magento\Bundle\Model\ResourceModel\Selection\Collection|\PHPUnit_Framework_MockObject_MockObject + * @var SelectionCollection|MockObject */ - protected $selectionCollection; + private $selectionCollection; /** - * @var \Magento\Bundle\Model\Option|\PHPUnit_Framework_MockObject_MockObject + * @var Option|MockObject */ - protected $option; + private $option; /** - * @var \PHPUnit_Framework_MockObject_MockObject | \Magento\Bundle\Model\SelectionFactory + * @var SelectionFactory|MockObject */ - protected $bundleSelectionMock; + private $bundleSelectionMock; /** - * @var \PHPUnit_Framework_MockObject_MockObject | \Magento\Bundle\Model\ResourceModel\BundleFactory + * @var BundleFactory|MockObject */ - protected $bundleFactoryMock; + private $bundleFactoryMock; /** - * @var \PHPUnit_Framework_MockObject_MockObject | \Magento\Bundle\Model\ResourceModel\Option\CollectionFactory + * @var OptionCollectionFactory|MockObject */ - protected $optionCollectionFactoryMock; + private $optionCollectionFactoryMock; /** - * @var \PHPUnit_Framework_MockObject_MockObject | \Magento\Store\Model\StoreManagerInterface + * @var StoreManagerInterface|MockObject */ - protected $storeManagerMock; + private $storeManagerMock; /** - * @var \PHPUnit_Framework_MockObject_MockObject + * @var LinkInterface|MockObject */ - protected $link; + private $link; /** - * @var int + * @var MockObject */ - protected $storeId = 2; + private $dataObjectHelperMock; /** - * @var array + * @var MetadataPool|MockObject */ - protected $optionIds = [1, 2, 3]; + private $metadataPoolMock; /** - * @var \PHPUnit_Framework_MockObject_MockObject + * @var EntityMetadata|MockObject */ - protected $dataObjectHelperMock; + private $metadataMock; /** - * @var \Magento\Framework\EntityManager\MetadataPool|\PHPUnit_Framework_MockObject_MockObject + * @var int */ - protected $metadataPoolMock; + private $storeId = 2; /** - * @var \Magento\Framework\EntityManager\EntityMetadata|\PHPUnit_Framework_MockObject_MockObject + * @var array */ - protected $metadataMock; + private $optionIds = [1, 2, 3]; /** * @var string */ - protected $linkField = 'product_id'; + private $linkField = 'product_id'; + /** + * @inheritDoc + */ protected function setUp() { $helper = new ObjectManager($this); - $this->productRepository = $this->getMockBuilder(\Magento\Catalog\Model\ProductRepository::class) + $this->productRepository = $this->getMockBuilder(ProductRepository::class) ->setMethods(['get']) ->disableOriginalConstructor() ->getMock(); - $this->productType = $this->getMockBuilder(\Magento\Bundle\Model\Product\Type\Interceptor::class) + $this->productType = $this->getMockBuilder(\Magento\Bundle\Model\Product\Type::class) ->setMethods(['getOptionsCollection', 'setStoreFilter', 'getSelectionsCollection', 'getOptionsIds']) ->disableOriginalConstructor() ->getMock(); - $this->option = $this->getMockBuilder(\Magento\Bundle\Model\Option::class) + $this->option = $this->getMockBuilder(Option::class) ->setMethods(['getSelections', 'getOptionId', '__wakeup']) ->disableOriginalConstructor() ->getMock(); - $this->optionCollection = $this->getMockBuilder(\Magento\Bundle\Model\ResourceModel\Option\Collection::class) + $this->optionCollection = $this->getMockBuilder(OptionCollection::class) ->setMethods(['appendSelections']) ->disableOriginalConstructor() ->getMock(); $this->selectionCollection = $this->getMockBuilder( - \Magento\Bundle\Model\ResourceModel\Selection\Collection::class + SelectionCollection::class )->disableOriginalConstructor()->getMock(); - $this->product = $this->getMockBuilder(\Magento\Catalog\Model\Product::class) + $this->product = $this->getMockBuilder(Product::class) ->setMethods(['getTypeInstance', 'getStoreId', 'getTypeId', '__wakeup', 'getId', 'getData']) ->disableOriginalConstructor() ->getMock(); - $this->link = $this->getMockBuilder(\Magento\Bundle\Api\Data\LinkInterface::class) + $this->link = $this->getMockBuilder(LinkInterface::class) ->disableOriginalConstructor() ->getMock(); - $this->linkFactory = $this->getMockBuilder(\Magento\Bundle\Api\Data\LinkInterfaceFactory::class) + $this->linkFactory = $this->getMockBuilder(LinkInterfaceFactory::class) ->setMethods(['create']) ->disableOriginalConstructor() ->getMock(); $this->bundleSelectionMock = $this->createPartialMock( - \Magento\Bundle\Model\SelectionFactory::class, + SelectionFactory::class, ['create'] ); $this->bundleFactoryMock = $this->createPartialMock( - \Magento\Bundle\Model\ResourceModel\BundleFactory::class, + BundleFactory::class, ['create'] ); $this->optionCollectionFactoryMock = $this->createPartialMock( - \Magento\Bundle\Model\ResourceModel\Option\CollectionFactory::class, + OptionCollectionFactory::class, ['create'] ); - $this->storeManagerMock = $this->createMock(\Magento\Store\Model\StoreManagerInterface::class); - $this->metadataPoolMock = $this->getMockBuilder(\Magento\Framework\EntityManager\MetadataPool::class) + $this->storeManagerMock = $this->createMock(StoreManagerInterface::class); + $this->metadataPoolMock = $this->getMockBuilder(MetadataPool::class) ->disableOriginalConstructor() ->getMock(); - $this->metadataMock = $this->getMockBuilder(\Magento\Framework\EntityManager\EntityMetadata::class) + $this->metadataMock = $this->getMockBuilder(EntityMetadata::class) ->disableOriginalConstructor() ->getMock(); - $this->metadataPoolMock->expects($this->any())->method('getMetadata') - ->with(\Magento\Catalog\Api\Data\ProductInterface::class) + $this->metadataPoolMock->method('getMetadata') + ->with(ProductInterface::class) ->willReturn($this->metadataMock); - $this->dataObjectHelperMock = $this->getMockBuilder(\Magento\Framework\Api\DataObjectHelper::class) + $this->dataObjectHelperMock = $this->getMockBuilder(DataObjectHelper::class) ->disableOriginalConstructor() ->getMock(); $this->model = $helper->getObject( - LinkManagement::class, [ 'productRepository' => $this->productRepository, @@ -184,12 +208,9 @@ protected function setUp() 'optionCollection' => $this->optionCollectionFactoryMock, 'storeManager' => $this->storeManagerMock, 'dataObjectHelper' => $this->dataObjectHelperMock, + 'metadataPool' => $this->metadataPoolMock ] ); - $refClass = new \ReflectionClass(LinkManagement::class); - $refProperty = $refClass->getProperty('metadataPool'); - $refProperty->setAccessible(true); - $refProperty->setValue($this->model, $this->metadataPoolMock); } public function testGetChildren() @@ -198,31 +219,45 @@ public function testGetChildren() $this->getOptions(); - $this->productRepository->expects($this->any())->method('get')->with($this->equalTo($productSku)) - ->will($this->returnValue($this->product)); + $this->productRepository->method('get') + ->with($this->equalTo($productSku)) + ->willReturn($this->product); - $this->product->expects($this->once())->method('getTypeId')->will($this->returnValue('bundle')); + $this->product->expects($this->once()) + ->method('getTypeId') + ->willReturn('bundle'); - $this->productType->expects($this->once())->method('setStoreFilter')->with( - $this->equalTo($this->storeId), - $this->product - ); - $this->productType->expects($this->once())->method('getSelectionsCollection') - ->with($this->equalTo($this->optionIds), $this->equalTo($this->product)) - ->will($this->returnValue($this->selectionCollection)); - $this->productType->expects($this->once())->method('getOptionsIds')->with($this->equalTo($this->product)) - ->will($this->returnValue($this->optionIds)); + $this->productType->expects($this->once()) + ->method('setStoreFilter') + ->with( + $this->equalTo($this->storeId), + $this->product + ); + $this->productType->expects($this->once()) + ->method('getSelectionsCollection') + ->with( + $this->equalTo($this->optionIds), + $this->equalTo($this->product) + ) + ->willReturn($this->selectionCollection); + $this->productType->expects($this->once()) + ->method('getOptionsIds') + ->with($this->equalTo($this->product)) + ->willReturn($this->optionIds); - $this->optionCollection->expects($this->once())->method('appendSelections') + $this->optionCollection->expects($this->once()) + ->method('appendSelections') ->with($this->equalTo($this->selectionCollection)) - ->will($this->returnValue([$this->option])); + ->willReturn([$this->option]); - $this->option->expects($this->any())->method('getSelections')->willReturn([$this->product]); - $this->product->expects($this->any())->method('getData')->willReturn([]); + $this->option->method('getSelections') + ->willReturn([$this->product]); + $this->product->method('getData') + ->willReturn([]); $this->dataObjectHelperMock->expects($this->once()) ->method('populateWithArray') - ->with($this->link, $this->anything(), \Magento\Bundle\Api\Data\LinkInterface::class) + ->with($this->link, $this->anything(), LinkInterface::class) ->willReturnSelf(); $this->link->expects($this->once())->method('setIsDefault')->willReturnSelf(); $this->link->expects($this->once())->method('setQty')->willReturnSelf(); @@ -241,27 +276,42 @@ public function testGetChildrenWithOptionId() $this->getOptions(); - $this->productRepository->expects($this->any())->method('get')->with($this->equalTo($productSku)) - ->will($this->returnValue($this->product)); + $this->productRepository->method('get') + ->with($this->equalTo($productSku)) + ->willReturn($this->product); - $this->product->expects($this->once())->method('getTypeId')->will($this->returnValue('bundle')); + $this->product->expects($this->once()) + ->method('getTypeId') + ->willReturn('bundle'); - $this->productType->expects($this->once())->method('setStoreFilter')->with( - $this->equalTo($this->storeId), - $this->product - ); - $this->productType->expects($this->once())->method('getSelectionsCollection') - ->with($this->equalTo($this->optionIds), $this->equalTo($this->product)) - ->will($this->returnValue($this->selectionCollection)); - $this->productType->expects($this->once())->method('getOptionsIds')->with($this->equalTo($this->product)) - ->will($this->returnValue($this->optionIds)); + $this->productType->expects($this->once()) + ->method('setStoreFilter') + ->with( + $this->equalTo($this->storeId), + $this->product + ); + $this->productType->expects($this->once()) + ->method('getSelectionsCollection') + ->with( + $this->equalTo($this->optionIds), + $this->equalTo($this->product) + ) + ->willReturn($this->selectionCollection); + $this->productType->expects($this->once()) + ->method('getOptionsIds') + ->with($this->equalTo($this->product)) + ->willReturn($this->optionIds); - $this->optionCollection->expects($this->once())->method('appendSelections') + $this->optionCollection->expects($this->once()) + ->method('appendSelections') ->with($this->equalTo($this->selectionCollection)) - ->will($this->returnValue([$this->option])); + ->willReturn([$this->option]); - $this->option->expects($this->any())->method('getOptionId')->will($this->returnValue(10)); - $this->option->expects($this->once())->method('getSelections')->willReturn([1, 2]); + $this->option->method('getOptionId') + ->willReturn(10); + $this->option->expects($this->once()) + ->method('getSelections') + ->willReturn([1, 2]); $this->dataObjectHelperMock->expects($this->never())->method('populateWithArray'); @@ -275,10 +325,14 @@ public function testGetChildrenException() { $productSku = 'productSku'; - $this->productRepository->expects($this->once())->method('get')->with($this->equalTo($productSku)) - ->will($this->returnValue($this->product)); + $this->productRepository->expects($this->once()) + ->method('get') + ->with($this->equalTo($productSku)) + ->willReturn($this->product); - $this->product->expects($this->once())->method('getTypeId')->will($this->returnValue('simple')); + $this->product->expects($this->once()) + ->method('getTypeId') + ->willReturn('simple'); $this->assertEquals([$this->link], $this->model->getChildren($productSku)); } @@ -288,13 +342,14 @@ public function testGetChildrenException() */ public function testAddChildToNotBundleProduct() { - $productLink = $this->createMock(\Magento\Bundle\Api\Data\LinkInterface::class); - $productLink->expects($this->any())->method('getOptionId')->will($this->returnValue(1)); + $productLink = $this->createMock(LinkInterface::class); + $productLink->method('getOptionId') + ->willReturn(1); - $productMock = $this->createMock(\Magento\Catalog\Model\Product::class); - $productMock->expects($this->once())->method('getTypeId')->will($this->returnValue( - \Magento\Catalog\Model\Product\Type::TYPE_SIMPLE - )); + $productMock = $this->createMock(Product::class); + $productMock->expects($this->once()) + ->method('getTypeId') + ->willReturn(Type::TYPE_SIMPLE); $this->model->addChild($productMock, 1, $productLink); } @@ -303,37 +358,35 @@ public function testAddChildToNotBundleProduct() */ public function testAddChildNonExistingOption() { - $productLink = $this->createMock(\Magento\Bundle\Api\Data\LinkInterface::class); - $productLink->expects($this->any())->method('getOptionId')->will($this->returnValue(1)); + $productLink = $this->createMock(LinkInterface::class); + $productLink->method('getOptionId')->willReturn(1); - $productMock = $this->createMock(\Magento\Catalog\Model\Product::class); - $productMock->expects($this->once())->method('getTypeId')->will($this->returnValue( - \Magento\Catalog\Model\Product\Type::TYPE_BUNDLE - )); + $productMock = $this->createMock(Product::class); + $productMock->expects($this->once())->method('getTypeId')->willReturn(Type::TYPE_BUNDLE); - $store = $this->createMock(\Magento\Store\Model\Store::class); - $this->storeManagerMock->expects($this->any())->method('getStore')->will($this->returnValue($store)); - $store->expects($this->any())->method('getId')->will($this->returnValue(0)); + $store = $this->createMock(Store::class); + $this->storeManagerMock->method('getStore')->willReturn($store); + $store->method('getId')->willReturn(0); - $emptyOption = $this->getMockBuilder(\Magento\Bundle\Model\Option::class)->disableOriginalConstructor() + $emptyOption = $this->getMockBuilder(Option::class)->disableOriginalConstructor() ->setMethods(['getId', '__wakeup']) ->getMock(); $emptyOption->expects($this->once()) ->method('getId') - ->will($this->returnValue(null)); + ->willReturn(null); - $optionsCollectionMock = $this->createMock(\Magento\Bundle\Model\ResourceModel\Option\Collection::class); + $optionsCollectionMock = $this->createMock(OptionCollection::class); $optionsCollectionMock->expects($this->once()) ->method('setIdFilter') ->with($this->equalTo(1)) - ->will($this->returnSelf()); + ->willReturnSelf(); $optionsCollectionMock->expects($this->once()) ->method('getFirstItem') - ->will($this->returnValue($emptyOption)); + ->willReturn($emptyOption); - $this->optionCollectionFactoryMock->expects($this->any())->method('create')->will( - $this->returnValue($optionsCollectionMock) - ); + $this->optionCollectionFactoryMock + ->method('create') + ->willReturn($optionsCollectionMock); $this->model->addChild($productMock, 1, $productLink); } @@ -343,53 +396,55 @@ public function testAddChildNonExistingOption() */ public function testAddChildLinkedProductIsComposite() { - $productLink = $this->createMock(\Magento\Bundle\Api\Data\LinkInterface::class); - $productLink->expects($this->any())->method('getSku')->will($this->returnValue('linked_product_sku')); - $productLink->expects($this->any())->method('getOptionId')->will($this->returnValue(1)); + $productLink = $this->createMock(LinkInterface::class); + $productLink->method('getSku')->willReturn('linked_product_sku'); + $productLink->method('getOptionId')->willReturn(1); $this->metadataMock->expects($this->once())->method('getLinkField')->willReturn($this->linkField); - $productMock = $this->createMock(\Magento\Catalog\Model\Product::class); - $productMock->expects($this->once())->method('getTypeId')->will($this->returnValue( - \Magento\Catalog\Model\Product\Type::TYPE_BUNDLE - )); - $productMock->expects($this->any()) - ->method('getData') + $productMock = $this->createMock(Product::class); + $productMock->expects($this->once()) + ->method('getTypeId') + ->willReturn(Type::TYPE_BUNDLE); + $productMock->method('getData') ->with($this->linkField) ->willReturn($this->linkField); - $linkedProductMock = $this->createMock(\Magento\Catalog\Model\Product::class); - $linkedProductMock->expects($this->any())->method('getId')->will($this->returnValue(13)); - $linkedProductMock->expects($this->once())->method('isComposite')->will($this->returnValue(true)); - $this->productRepository - ->expects($this->once()) + $linkedProductMock = $this->createMock(Product::class); + $linkedProductMock->method('getId')->willReturn(13); + $linkedProductMock->expects($this->once()) + ->method('isComposite') + ->willReturn(true); + $this->productRepository->expects($this->once()) ->method('get') ->with('linked_product_sku') - ->will($this->returnValue($linkedProductMock)); + ->willReturn($linkedProductMock); - $store = $this->createMock(\Magento\Store\Model\Store::class); - $this->storeManagerMock->expects($this->any())->method('getStore')->will($this->returnValue($store)); - $store->expects($this->any())->method('getId')->will($this->returnValue(0)); + $store = $this->createMock(Store::class); + $this->storeManagerMock + ->method('getStore') + ->willReturn($store); + $store->method('getId') + ->willReturn(0); - $option = $this->getMockBuilder(\Magento\Bundle\Model\Option::class)->disableOriginalConstructor() + $option = $this->getMockBuilder(Option::class)->disableOriginalConstructor() ->setMethods(['getId', '__wakeup']) ->getMock(); - $option->expects($this->once())->method('getId')->will($this->returnValue(1)); + $option->expects($this->once())->method('getId')->willReturn(1); - $optionsCollectionMock = $this->createMock(\Magento\Bundle\Model\ResourceModel\Option\Collection::class); + $optionsCollectionMock = $this->createMock(OptionCollection::class); $optionsCollectionMock->expects($this->once()) ->method('setIdFilter') ->with($this->equalTo('1')) - ->will($this->returnSelf()); + ->willReturnSelf(); $optionsCollectionMock->expects($this->once()) ->method('getFirstItem') - ->will($this->returnValue($option)); - $this->optionCollectionFactoryMock->expects($this->any())->method('create')->will( - $this->returnValue($optionsCollectionMock) - ); + ->willReturn($option); + $this->optionCollectionFactoryMock->method('create') + ->willReturn($optionsCollectionMock); - $bundle = $this->createMock(\Magento\Bundle\Model\ResourceModel\Bundle::class); + $bundle = $this->createMock(Bundle::class); $bundle->expects($this->once())->method('getSelectionsData')->with($this->linkField)->willReturn([]); - $this->bundleFactoryMock->expects($this->once())->method('create')->will($this->returnValue($bundle)); + $this->bundleFactoryMock->expects($this->once())->method('create')->willReturn($bundle); $this->model->addChild($productMock, 1, $productLink); } @@ -398,68 +453,74 @@ public function testAddChildLinkedProductIsComposite() */ public function testAddChildProductAlreadyExistsInOption() { - $productLink = $this->getMockBuilder(\Magento\Bundle\Api\Data\LinkInterface::class) + $productLink = $this->getMockBuilder(LinkInterface::class) ->setMethods(['getSku', 'getOptionId', 'getSelectionId']) ->disableOriginalConstructor() ->getMockForAbstractClass(); - $productLink->expects($this->any())->method('getSku')->will($this->returnValue('linked_product_sku')); - $productLink->expects($this->any())->method('getOptionId')->will($this->returnValue(1)); - $productLink->expects($this->any())->method('getSelectionId')->will($this->returnValue(1)); + $productLink->method('getSku')->willReturn('linked_product_sku'); + $productLink->method('getOptionId')->willReturn(1); + $productLink->method('getSelectionId')->willReturn(1); $this->metadataMock->expects($this->once())->method('getLinkField')->willReturn($this->linkField); $productMock = $this->createPartialMock( - \Magento\Catalog\Model\Product::class, + Product::class, ['getTypeId', 'getCopyFromView', 'getData', 'getTypeInstance', 'getSku'] ); $productMock->expects($this->once())->method('getTypeId')->willReturn( - \Magento\Catalog\Model\Product\Type::TYPE_BUNDLE + Type::TYPE_BUNDLE ); - $productMock->expects($this->any()) - ->method('getData') + $productMock->method('getData') ->with($this->linkField) ->willReturn($this->linkField); - $productMock->expects($this->any())->method('getCopyFromView')->will($this->returnValue(false)); - - $linkedProductMock = $this->createMock(\Magento\Catalog\Model\Product::class); - $linkedProductMock->expects($this->any())->method('getEntityId')->will($this->returnValue(13)); - $linkedProductMock->expects($this->once())->method('isComposite')->will($this->returnValue(false)); - $this->productRepository - ->expects($this->once()) + $productMock->method('getCopyFromView') + ->willReturn(false); + + $linkedProductMock = $this->createMock(Product::class); + $linkedProductMock->method('getEntityId') + ->willReturn(13); + $linkedProductMock->expects($this->once()) + ->method('isComposite') + ->willReturn(false); + $this->productRepository->expects($this->once()) ->method('get') ->with('linked_product_sku') - ->will($this->returnValue($linkedProductMock)); + ->willReturn($linkedProductMock); - $store = $this->createMock(\Magento\Store\Model\Store::class); - $this->storeManagerMock->expects($this->any())->method('getStore')->will($this->returnValue($store)); - $store->expects($this->any())->method('getId')->will($this->returnValue(0)); + $store = $this->createMock(Store::class); + $this->storeManagerMock->method('getStore')->willReturn($store); + $store->method('getId')->willReturn(0); - $option = $this->getMockBuilder(\Magento\Bundle\Model\Option::class)->disableOriginalConstructor() + $option = $this->getMockBuilder(Option::class)->disableOriginalConstructor() ->setMethods(['getId', '__wakeup']) ->getMock(); - $option->expects($this->once())->method('getId')->will($this->returnValue(1)); + $option->expects($this->once()) + ->method('getId') + ->willReturn(1); - $optionsCollectionMock = $this->createMock(\Magento\Bundle\Model\ResourceModel\Option\Collection::class); + $optionsCollectionMock = $this->createMock(OptionCollection::class); $optionsCollectionMock->expects($this->once()) ->method('setIdFilter') ->with($this->equalTo(1)) - ->will($this->returnSelf()); + ->willReturnSelf(); $optionsCollectionMock->expects($this->once()) ->method('getFirstItem') - ->will($this->returnValue($option)); - $this->optionCollectionFactoryMock->expects($this->any())->method('create')->will( - $this->returnValue($optionsCollectionMock) - ); + ->willReturn($option); + $this->optionCollectionFactoryMock->method('create') + ->willReturn($optionsCollectionMock); $selections = [ ['option_id' => 1, 'product_id' => 12, 'parent_product_id' => 'product_id'], ['option_id' => 1, 'product_id' => 13, 'parent_product_id' => 'product_id'], ]; - $bundle = $this->createMock(\Magento\Bundle\Model\ResourceModel\Bundle::class); - $bundle->expects($this->once())->method('getSelectionsData') + $bundle = $this->createMock(Bundle::class); + $bundle->expects($this->once()) + ->method('getSelectionsData') ->with($this->linkField) - ->will($this->returnValue($selections)); - $this->bundleFactoryMock->expects($this->once())->method('create')->will($this->returnValue($bundle)); + ->willReturn($selections); + $this->bundleFactoryMock->expects($this->once()) + ->method('create') + ->willReturn($bundle); $this->model->addChild($productMock, 1, $productLink); } @@ -468,141 +529,141 @@ public function testAddChildProductAlreadyExistsInOption() */ public function testAddChildCouldNotSave() { - $productLink = $this->getMockBuilder(\Magento\Bundle\Api\Data\LinkInterface::class) + $productLink = $this->getMockBuilder(LinkInterface::class) ->setMethods(['getSku', 'getOptionId', 'getSelectionId']) ->disableOriginalConstructor() ->getMockForAbstractClass(); - $productLink->expects($this->any())->method('getSku')->will($this->returnValue('linked_product_sku')); - $productLink->expects($this->any())->method('getOptionId')->will($this->returnValue(1)); - $productLink->expects($this->any())->method('getSelectionId')->will($this->returnValue(1)); + $productLink->method('getSku')->willReturn('linked_product_sku'); + $productLink->method('getOptionId')->willReturn(1); + $productLink->method('getSelectionId')->willReturn(1); $this->metadataMock->expects($this->once())->method('getLinkField')->willReturn($this->linkField); - $productMock = $this->createMock(\Magento\Catalog\Model\Product::class); - $productMock->expects($this->once())->method('getTypeId')->will($this->returnValue( - \Magento\Catalog\Model\Product\Type::TYPE_BUNDLE - )); - $productMock->expects($this->any()) + $productMock = $this->createMock(Product::class); + $productMock->expects($this->once()) + ->method('getTypeId') + ->willReturn(Type::TYPE_BUNDLE); + $productMock ->method('getData') ->with($this->linkField) ->willReturn($this->linkField); - $linkedProductMock = $this->createMock(\Magento\Catalog\Model\Product::class); - $linkedProductMock->expects($this->any())->method('getId')->will($this->returnValue(13)); - $linkedProductMock->expects($this->once())->method('isComposite')->will($this->returnValue(false)); + $linkedProductMock = $this->createMock(Product::class); + $linkedProductMock->method('getId')->willReturn(13); + $linkedProductMock->expects($this->once()) + ->method('isComposite') + ->willReturn(false); $this->productRepository ->expects($this->once()) ->method('get') ->with('linked_product_sku') - ->will($this->returnValue($linkedProductMock)); + ->willReturn($linkedProductMock); - $store = $this->createMock(\Magento\Store\Model\Store::class); - $this->storeManagerMock->expects($this->any())->method('getStore')->will($this->returnValue($store)); - $store->expects($this->any())->method('getId')->will($this->returnValue(0)); + $store = $this->createMock(Store::class); + $this->storeManagerMock->method('getStore')->willReturn($store); + $store->method('getId')->willReturn(0); - $option = $this->getMockBuilder(\Magento\Bundle\Model\Option::class)->disableOriginalConstructor() + $option = $this->getMockBuilder(Option::class)->disableOriginalConstructor() ->setMethods(['getId', '__wakeup']) ->getMock(); - $option->expects($this->once())->method('getId')->will($this->returnValue(1)); + $option->expects($this->once())->method('getId')->willReturn(1); - $optionsCollectionMock = $this->createMock(\Magento\Bundle\Model\ResourceModel\Option\Collection::class); + $optionsCollectionMock = $this->createMock(OptionCollection::class); $optionsCollectionMock->expects($this->once()) ->method('setIdFilter') ->with($this->equalTo(1)) - ->will($this->returnSelf()); + ->willReturnSelf(); $optionsCollectionMock->expects($this->once()) ->method('getFirstItem') - ->will($this->returnValue($option)); - $this->optionCollectionFactoryMock->expects($this->any())->method('create')->will( - $this->returnValue($optionsCollectionMock) - ); + ->willReturn($option); + $this->optionCollectionFactoryMock->method('create') + ->willReturn($optionsCollectionMock); $selections = [ ['option_id' => 1, 'product_id' => 11], ['option_id' => 1, 'product_id' => 12], ]; - $bundle = $this->createMock(\Magento\Bundle\Model\ResourceModel\Bundle::class); + $bundle = $this->createMock(Bundle::class); $bundle->expects($this->once())->method('getSelectionsData') ->with($this->linkField) - ->will($this->returnValue($selections)); - $this->bundleFactoryMock->expects($this->once())->method('create')->will($this->returnValue($bundle)); + ->willReturn($selections); + $this->bundleFactoryMock->expects($this->once()) + ->method('create') + ->willReturn($bundle); - $selection = $this->createPartialMock(\Magento\Bundle\Model\Selection::class, ['save']); + $selection = $this->createPartialMock(Selection::class, ['save']); $selection->expects($this->once())->method('save') - ->will( - $this->returnCallback( - function () { - throw new \Exception('message'); - } - ) + ->willReturnCallback( + static function () { + throw new Exception('message'); + } ); - $this->bundleSelectionMock->expects($this->once())->method('create')->will($this->returnValue($selection)); + $this->bundleSelectionMock->expects($this->once()) + ->method('create') + ->willReturn($selection); $this->model->addChild($productMock, 1, $productLink); } public function testAddChild() { - $productLink = $this->getMockBuilder(\Magento\Bundle\Api\Data\LinkInterface::class) + $productLink = $this->getMockBuilder(LinkInterface::class) ->setMethods(['getSku', 'getOptionId', 'getSelectionId']) ->disableOriginalConstructor() ->getMockForAbstractClass(); - $productLink->expects($this->any())->method('getSku')->will($this->returnValue('linked_product_sku')); - $productLink->expects($this->any())->method('getOptionId')->will($this->returnValue(1)); - $productLink->expects($this->any())->method('getSelectionId')->will($this->returnValue(1)); + $productLink->method('getSku')->willReturn('linked_product_sku'); + $productLink->method('getOptionId')->willReturn(1); + $productLink->method('getSelectionId')->willReturn(1); $this->metadataMock->expects($this->once())->method('getLinkField')->willReturn($this->linkField); - $productMock = $this->createMock(\Magento\Catalog\Model\Product::class); - $productMock->expects($this->once())->method('getTypeId')->will($this->returnValue( - \Magento\Catalog\Model\Product\Type::TYPE_BUNDLE - )); - $productMock->expects($this->any()) + $productMock = $this->createMock(Product::class); + $productMock->expects($this->once())->method('getTypeId')->willReturn(Type::TYPE_BUNDLE); + $productMock ->method('getData') ->with($this->linkField) ->willReturn($this->linkField); - $linkedProductMock = $this->createMock(\Magento\Catalog\Model\Product::class); - $linkedProductMock->expects($this->any())->method('getId')->will($this->returnValue(13)); - $linkedProductMock->expects($this->once())->method('isComposite')->will($this->returnValue(false)); + $linkedProductMock = $this->createMock(Product::class); + $linkedProductMock->method('getId')->willReturn(13); + $linkedProductMock->expects($this->once())->method('isComposite')->willReturn(false); $this->productRepository ->expects($this->once()) ->method('get') ->with('linked_product_sku') - ->will($this->returnValue($linkedProductMock)); + ->willReturn($linkedProductMock); - $store = $this->createMock(\Magento\Store\Model\Store::class); - $this->storeManagerMock->expects($this->any())->method('getStore')->will($this->returnValue($store)); - $store->expects($this->any())->method('getId')->will($this->returnValue(0)); + $store = $this->createMock(Store::class); + $this->storeManagerMock->method('getStore')->willReturn($store); + $store->method('getId')->willReturn(0); - $option = $this->getMockBuilder(\Magento\Bundle\Model\Option::class)->disableOriginalConstructor() + $option = $this->getMockBuilder(Option::class)->disableOriginalConstructor() ->setMethods(['getId', '__wakeup']) ->getMock(); - $option->expects($this->once())->method('getId')->will($this->returnValue(1)); + $option->expects($this->once())->method('getId')->willReturn(1); - $optionsCollectionMock = $this->createMock(\Magento\Bundle\Model\ResourceModel\Option\Collection::class); + $optionsCollectionMock = $this->createMock(OptionCollection::class); $optionsCollectionMock->expects($this->once()) ->method('setIdFilter') ->with($this->equalTo(1)) - ->will($this->returnSelf()); + ->willReturnSelf(); $optionsCollectionMock->expects($this->once()) ->method('getFirstItem') - ->will($this->returnValue($option)); - $this->optionCollectionFactoryMock->expects($this->any())->method('create')->will( - $this->returnValue($optionsCollectionMock) - ); + ->willReturn($option); + $this->optionCollectionFactoryMock->method('create') + ->willReturn($optionsCollectionMock); $selections = [ ['option_id' => 1, 'product_id' => 11], ['option_id' => 1, 'product_id' => 12], ]; - $bundle = $this->createMock(\Magento\Bundle\Model\ResourceModel\Bundle::class); + $bundle = $this->createMock(Bundle::class); $bundle->expects($this->once())->method('getSelectionsData') ->with($this->linkField) - ->will($this->returnValue($selections)); - $this->bundleFactoryMock->expects($this->once())->method('create')->will($this->returnValue($bundle)); + ->willReturn($selections); + $this->bundleFactoryMock->expects($this->once())->method('create')->willReturn($bundle); - $selection = $this->createPartialMock(\Magento\Bundle\Model\Selection::class, ['save', 'getId']); + $selection = $this->createPartialMock(Selection::class, ['save', 'getId']); $selection->expects($this->once())->method('save'); - $selection->expects($this->once())->method('getId')->will($this->returnValue(42)); - $this->bundleSelectionMock->expects($this->once())->method('create')->will($this->returnValue($selection)); + $selection->expects($this->once())->method('getId')->willReturn(42); + $this->bundleSelectionMock->expects($this->once())->method('create')->willReturn($selection); $result = $this->model->addChild($productMock, 1, $productLink); $this->assertEquals(42, $result); } @@ -621,51 +682,51 @@ public function testSaveChild() $parentProductId = 32; $bundleProductSku = 'bundleProductSku'; - $productLink = $this->getMockBuilder(\Magento\Bundle\Api\Data\LinkInterface::class) + $productLink = $this->getMockBuilder(LinkInterface::class) ->setMethods(['getSku', 'getOptionId', 'getSelectionId']) ->disableOriginalConstructor() ->getMockForAbstractClass(); - $productLink->expects($this->any())->method('getSku')->will($this->returnValue('linked_product_sku')); - $productLink->expects($this->any())->method('getId')->will($this->returnValue($id)); - $productLink->expects($this->any())->method('getOptionId')->will($this->returnValue($optionId)); - $productLink->expects($this->any())->method('getPosition')->will($this->returnValue($position)); - $productLink->expects($this->any())->method('getQty')->will($this->returnValue($qty)); - $productLink->expects($this->any())->method('getPriceType')->will($this->returnValue($priceType)); - $productLink->expects($this->any())->method('getPrice')->will($this->returnValue($price)); - $productLink->expects($this->any())->method('getCanChangeQuantity') - ->will($this->returnValue($canChangeQuantity)); - $productLink->expects($this->any())->method('getIsDefault')->will($this->returnValue($isDefault)); - $productLink->expects($this->any())->method('getSelectionId')->will($this->returnValue($optionId)); + $productLink->method('getSku')->willReturn('linked_product_sku'); + $productLink->method('getId')->willReturn($id); + $productLink->method('getOptionId')->willReturn($optionId); + $productLink->method('getPosition')->willReturn($position); + $productLink->method('getQty')->willReturn($qty); + $productLink->method('getPriceType')->willReturn($priceType); + $productLink->method('getPrice')->willReturn($price); + $productLink->method('getCanChangeQuantity') + ->willReturn($canChangeQuantity); + $productLink->method('getIsDefault')->willReturn($isDefault); + $productLink->method('getSelectionId')->willReturn($optionId); $this->metadataMock->expects($this->once())->method('getLinkField')->willReturn($this->linkField); - $productMock = $this->createMock(\Magento\Catalog\Model\Product::class); - $productMock->expects($this->once())->method('getTypeId')->will($this->returnValue( - \Magento\Catalog\Model\Product\Type::TYPE_BUNDLE - )); - $productMock->expects($this->any()) + $productMock = $this->createMock(Product::class); + $productMock->expects($this->once())->method('getTypeId')->willReturn(Type::TYPE_BUNDLE); + $productMock ->method('getData') ->with($this->linkField) ->willReturn($parentProductId); - $linkedProductMock = $this->createMock(\Magento\Catalog\Model\Product::class); - $linkedProductMock->expects($this->any())->method('getId')->will($this->returnValue($linkProductId)); - $linkedProductMock->expects($this->once())->method('isComposite')->will($this->returnValue(false)); + $linkedProductMock = $this->createMock(Product::class); + $linkedProductMock->method('getId')->willReturn($linkProductId); + $linkedProductMock->expects($this->once())->method('isComposite')->willReturn(false); $this->productRepository ->expects($this->at(0)) ->method('get') ->with($bundleProductSku) - ->will($this->returnValue($productMock)); + ->willReturn($productMock); $this->productRepository ->expects($this->at(1)) ->method('get') ->with('linked_product_sku') - ->will($this->returnValue($linkedProductMock)); + ->willReturn($linkedProductMock); - $store = $this->createMock(\Magento\Store\Model\Store::class); - $this->storeManagerMock->expects($this->any())->method('getStore')->will($this->returnValue($store)); - $store->expects($this->any())->method('getId')->will($this->returnValue(0)); + $store = $this->createMock(Store::class); + $this->storeManagerMock->method('getStore')->willReturn($store); + $store->method('getId')->willReturn(0); - $selection = $this->createPartialMock(\Magento\Bundle\Model\Selection::class, [ + $selection = $this->createPartialMock( + Selection::class, + [ 'save', 'getId', 'load', @@ -678,10 +739,11 @@ public function testSaveChild() 'setSelectionPriceValue', 'setSelectionCanChangeQty', 'setIsDefault' - ]); + ] + ); $selection->expects($this->once())->method('save'); - $selection->expects($this->once())->method('load')->with($id)->will($this->returnSelf()); - $selection->expects($this->any())->method('getId')->will($this->returnValue($id)); + $selection->expects($this->once())->method('load')->with($id)->willReturnSelf(); + $selection->method('getId')->willReturn($id); $selection->expects($this->once())->method('setProductId')->with($linkProductId); $selection->expects($this->once())->method('setParentProductId')->with($parentProductId); $selection->expects($this->once())->method('setOptionId')->with($optionId); @@ -692,7 +754,7 @@ public function testSaveChild() $selection->expects($this->once())->method('setSelectionCanChangeQty')->with($canChangeQuantity); $selection->expects($this->once())->method('setIsDefault')->with($isDefault); - $this->bundleSelectionMock->expects($this->once())->method('create')->will($this->returnValue($selection)); + $this->bundleSelectionMock->expects($this->once())->method('create')->willReturn($selection); $this->assertTrue($this->model->saveChild($bundleProductSku, $productLink)); } @@ -705,40 +767,45 @@ public function testSaveChildFailedToSave() $linkProductId = 45; $parentProductId = 32; - $productLink = $this->getMockBuilder(\Magento\Bundle\Api\Data\LinkInterface::class) + $productLink = $this->getMockBuilder(LinkInterface::class) ->setMethods(['getSku', 'getOptionId', 'getSelectionId']) ->disableOriginalConstructor() ->getMockForAbstractClass(); - $productLink->expects($this->any())->method('getSku')->will($this->returnValue('linked_product_sku')); - $productLink->expects($this->any())->method('getId')->will($this->returnValue($id)); - $productLink->expects($this->any())->method('getSelectionId')->will($this->returnValue(1)); + $productLink->method('getSku')->willReturn('linked_product_sku'); + $productLink->method('getId')->willReturn($id); + $productLink->method('getSelectionId')->willReturn(1); $bundleProductSku = 'bundleProductSku'; - $productMock = $this->createMock(\Magento\Catalog\Model\Product::class); - $productMock->expects($this->once())->method('getTypeId')->will($this->returnValue( - \Magento\Catalog\Model\Product\Type::TYPE_BUNDLE - )); - $productMock->expects($this->any())->method('getId')->will($this->returnValue($parentProductId)); + $productMock = $this->createMock(Product::class); + $productMock->expects($this->once()) + ->method('getTypeId') + ->willReturn(Type::TYPE_BUNDLE); + $productMock->method('getId') + ->willReturn($parentProductId); - $linkedProductMock = $this->createMock(\Magento\Catalog\Model\Product::class); - $linkedProductMock->expects($this->any())->method('getId')->will($this->returnValue($linkProductId)); - $linkedProductMock->expects($this->once())->method('isComposite')->will($this->returnValue(false)); - $this->productRepository - ->expects($this->at(0)) + $linkedProductMock = $this->createMock(Product::class); + $linkedProductMock->method('getId')->willReturn($linkProductId); + $linkedProductMock->expects($this->once()) + ->method('isComposite') + ->willReturn(false); + $this->productRepository->expects($this->at(0)) ->method('get') ->with($bundleProductSku) - ->will($this->returnValue($productMock)); - $this->productRepository - ->expects($this->at(1)) + ->willReturn($productMock); + $this->productRepository->expects($this->at(1)) ->method('get') ->with('linked_product_sku') - ->will($this->returnValue($linkedProductMock)); + ->willReturn($linkedProductMock); - $store = $this->createMock(\Magento\Store\Model\Store::class); - $this->storeManagerMock->expects($this->any())->method('getStore')->will($this->returnValue($store)); - $store->expects($this->any())->method('getId')->will($this->returnValue(0)); + $store = $this->createMock(Store::class); + $this->storeManagerMock->method('getStore') + ->willReturn($store); + $store->method('getId') + ->willReturn(0); - $selection = $this->createPartialMock(\Magento\Bundle\Model\Selection::class, [ + $selection = $this->createPartialMock( + Selection::class, + [ 'save', 'getId', 'load', @@ -752,14 +819,25 @@ public function testSaveChildFailedToSave() 'setSelectionPriceValue', 'setSelectionCanChangeQty', 'setIsDefault' - ]); - $mockException = $this->createMock(\Exception::class); - $selection->expects($this->once())->method('save')->will($this->throwException($mockException)); - $selection->expects($this->once())->method('load')->with($id)->will($this->returnSelf()); - $selection->expects($this->any())->method('getId')->will($this->returnValue($id)); - $selection->expects($this->once())->method('setProductId')->with($linkProductId); - - $this->bundleSelectionMock->expects($this->once())->method('create')->will($this->returnValue($selection)); + ] + ); + $mockException = $this->createMock(Exception::class); + $selection->expects($this->once()) + ->method('save') + ->willThrowException($mockException); + $selection->expects($this->once()) + ->method('load') + ->with($id) + ->willReturnSelf(); + $selection->method('getId') + ->willReturn($id); + $selection->expects($this->once()) + ->method('setProductId') + ->with($linkProductId); + + $this->bundleSelectionMock->expects($this->once()) + ->method('create') + ->willReturn($selection); $this->model->saveChild($bundleProductSku, $productLink); } @@ -768,29 +846,29 @@ public function testSaveChildFailedToSave() */ public function testSaveChildWithoutId() { - $bundleProductSku = "bundleSku"; + $bundleProductSku = 'bundleSku'; $linkedProductSku = 'simple'; - $productLink = $this->createMock(\Magento\Bundle\Api\Data\LinkInterface::class); - $productLink->expects($this->any())->method('getId')->will($this->returnValue(null)); - $productLink->expects($this->any())->method('getSku')->will($this->returnValue($linkedProductSku)); + $productLink = $this->createMock(LinkInterface::class); + $productLink->method('getId')->willReturn(null); + $productLink->method('getSku')->willReturn($linkedProductSku); - $productMock = $this->createMock(\Magento\Catalog\Model\Product::class); - $productMock->expects($this->once())->method('getTypeId')->will($this->returnValue( - \Magento\Catalog\Model\Product\Type::TYPE_BUNDLE - )); + $productMock = $this->createMock(Product::class); + $productMock->expects($this->once()) + ->method('getTypeId') + ->willReturn(Type::TYPE_BUNDLE); - $linkedProductMock = $this->createMock(\Magento\Catalog\Model\Product::class); - $linkedProductMock->expects($this->once())->method('isComposite')->will($this->returnValue(false)); - $this->productRepository - ->expects($this->at(0)) + $linkedProductMock = $this->createMock(Product::class); + $linkedProductMock->expects($this->once()) + ->method('isComposite') + ->willReturn(false); + $this->productRepository->expects($this->at(0)) ->method('get') ->with($bundleProductSku) - ->will($this->returnValue($productMock)); - $this->productRepository - ->expects($this->at(1)) + ->willReturn($productMock); + $this->productRepository->expects($this->at(1)) ->method('get') ->with($linkedProductSku) - ->will($this->returnValue($linkedProductMock)); + ->willReturn($linkedProductMock); $this->model->saveChild($bundleProductSku, $productLink); } @@ -803,37 +881,45 @@ public function testSaveChildWithInvalidId() { $id = 12345; $linkedProductSku = 'simple'; - $bundleProductSku = "bundleProductSku"; - $productLink = $this->createMock(\Magento\Bundle\Api\Data\LinkInterface::class); - $productLink->expects($this->any())->method('getId')->will($this->returnValue($id)); - $productLink->expects($this->any())->method('getSku')->will($this->returnValue($linkedProductSku)); - - $productMock = $this->createMock(\Magento\Catalog\Model\Product::class); - $productMock->expects($this->once())->method('getTypeId')->will($this->returnValue( - \Magento\Catalog\Model\Product\Type::TYPE_BUNDLE - )); - - $linkedProductMock = $this->createMock(\Magento\Catalog\Model\Product::class); - $linkedProductMock->expects($this->once())->method('isComposite')->will($this->returnValue(false)); - $this->productRepository - ->expects($this->at(0)) + $bundleProductSku = 'bundleProductSku'; + $productLink = $this->createMock(LinkInterface::class); + $productLink->method('getId')->willReturn($id); + $productLink->method('getSku')->willReturn($linkedProductSku); + + $productMock = $this->createMock(Product::class); + $productMock->expects($this->once()) + ->method('getTypeId') + ->willReturn(Type::TYPE_BUNDLE); + + $linkedProductMock = $this->createMock(Product::class); + $linkedProductMock->expects($this->once()) + ->method('isComposite') + ->willReturn(false); + $this->productRepository->expects($this->at(0)) ->method('get') ->with($bundleProductSku) - ->will($this->returnValue($productMock)); - $this->productRepository - ->expects($this->at(1)) + ->willReturn($productMock); + $this->productRepository->expects($this->at(1)) ->method('get') ->with($linkedProductSku) - ->will($this->returnValue($linkedProductMock)); + ->willReturn($linkedProductMock); - $selection = $this->createPartialMock(\Magento\Bundle\Model\Selection::class, [ + $selection = $this->createPartialMock( + Selection::class, + [ 'getId', 'load', - ]); - $selection->expects($this->once())->method('load')->with($id)->will($this->returnSelf()); - $selection->expects($this->any())->method('getId')->will($this->returnValue(null)); + ] + ); + $selection->expects($this->once()) + ->method('load') + ->with($id) + ->willReturnSelf(); + $selection->method('getId')->willReturn(null); - $this->bundleSelectionMock->expects($this->once())->method('create')->will($this->returnValue($selection)); + $this->bundleSelectionMock->expects($this->once()) + ->method('create') + ->willReturn($selection); $this->model->saveChild($bundleProductSku, $productLink); } @@ -843,30 +929,26 @@ public function testSaveChildWithInvalidId() */ public function testSaveChildWithCompositeProductLink() { - $bundleProductSku = "bundleProductSku"; + $bundleProductSku = 'bundleProductSku'; $id = 12; $linkedProductSku = 'simple'; - $productLink = $this->createMock(\Magento\Bundle\Api\Data\LinkInterface::class); - $productLink->expects($this->any())->method('getId')->will($this->returnValue($id)); - $productLink->expects($this->any())->method('getSku')->will($this->returnValue($linkedProductSku)); + $productLink = $this->createMock(LinkInterface::class); + $productLink->method('getId')->willReturn($id); + $productLink->method('getSku')->willReturn($linkedProductSku); - $productMock = $this->createMock(\Magento\Catalog\Model\Product::class); - $productMock->expects($this->once())->method('getTypeId')->will($this->returnValue( - \Magento\Catalog\Model\Product\Type::TYPE_BUNDLE - )); + $productMock = $this->createMock(Product::class); + $productMock->expects($this->once())->method('getTypeId')->willReturn(Type::TYPE_BUNDLE); - $linkedProductMock = $this->createMock(\Magento\Catalog\Model\Product::class); - $linkedProductMock->expects($this->once())->method('isComposite')->will($this->returnValue(true)); - $this->productRepository - ->expects($this->at(0)) + $linkedProductMock = $this->createMock(Product::class); + $linkedProductMock->expects($this->once())->method('isComposite')->willReturn(true); + $this->productRepository->expects($this->at(0)) ->method('get') ->with($bundleProductSku) - ->will($this->returnValue($productMock)); - $this->productRepository - ->expects($this->at(1)) + ->willReturn($productMock); + $this->productRepository->expects($this->at(1)) ->method('get') ->with($linkedProductSku) - ->will($this->returnValue($linkedProductMock)); + ->willReturn($linkedProductMock); $this->model->saveChild($bundleProductSku, $productLink); } @@ -878,18 +960,18 @@ public function testSaveChildWithSimpleProduct() { $id = 12; $linkedProductSku = 'simple'; - $bundleProductSku = "bundleProductSku"; + $bundleProductSku = 'bundleProductSku'; - $productLink = $this->createMock(\Magento\Bundle\Api\Data\LinkInterface::class); - $productLink->expects($this->any())->method('getId')->will($this->returnValue($id)); - $productLink->expects($this->any())->method('getSku')->will($this->returnValue($linkedProductSku)); + $productLink = $this->createMock(LinkInterface::class); + $productLink->method('getId')->willReturn($id); + $productLink->method('getSku')->willReturn($linkedProductSku); - $productMock = $this->createMock(\Magento\Catalog\Model\Product::class); - $productMock->expects($this->once())->method('getTypeId')->will($this->returnValue( - \Magento\Catalog\Model\Product\Type::TYPE_SIMPLE - )); + $productMock = $this->createMock(Product::class); + $productMock->expects($this->once())->method('getTypeId')->willReturn(Type::TYPE_SIMPLE); - $this->productRepository->expects($this->once())->method('get')->with($bundleProductSku) + $this->productRepository->expects($this->once()) + ->method('get') + ->with($bundleProductSku) ->willReturn($productMock); $this->model->saveChild($bundleProductSku, $productLink); @@ -897,34 +979,33 @@ public function testSaveChildWithSimpleProduct() public function testRemoveChild() { - $this->productRepository->expects($this->any())->method('get')->will($this->returnValue($this->product)); - $bundle = $this->createMock(\Magento\Bundle\Model\ResourceModel\Bundle::class); - $this->bundleFactoryMock->expects($this->once())->method('create')->will($this->returnValue($bundle)); + $this->productRepository->method('get')->willReturn($this->product); + $bundle = $this->createMock(Bundle::class); + $this->bundleFactoryMock->expects($this->once()) + ->method('create') + ->willReturn($bundle); $productSku = 'productSku'; $optionId = 1; $productId = 1; $childSku = 'childSku'; - $this->product - ->expects($this->any()) - ->method('getTypeId') - ->will($this->returnValue(\Magento\Catalog\Model\Product\Type::TYPE_BUNDLE)); + $this->product->method('getTypeId') + ->willReturn(Type::TYPE_BUNDLE); $this->getRemoveOptions(); - $selection = $this->getMockBuilder(\Magento\Bundle\Model\Selection::class) + $selection = $this->getMockBuilder(Selection::class) ->setMethods(['getSku', 'getOptionId', 'getSelectionId', 'getProductId', '__wakeup']) ->disableOriginalConstructor() ->getMock(); - $selection->expects($this->any())->method('getSku')->will($this->returnValue($childSku)); - $selection->expects($this->any())->method('getOptionId')->will($this->returnValue($optionId)); - $selection->expects($this->any())->method('getSelectionId')->will($this->returnValue(55)); - $selection->expects($this->any())->method('getProductId')->willReturn($productId); - - $this->option->expects($this->any())->method('getSelections')->will($this->returnValue([$selection])); - $this->metadataMock->expects($this->any())->method('getLinkField')->willReturn($this->linkField); - $this->product->expects($this->any()) - ->method('getData') + $selection->method('getSku')->willReturn($childSku); + $selection->method('getOptionId')->willReturn($optionId); + $selection->method('getSelectionId')->willReturn(55); + $selection->method('getProductId')->willReturn($productId); + + $this->option->method('getSelections')->willReturn([$selection]); + $this->metadataMock->method('getLinkField')->willReturn($this->linkField); + $this->product->method('getData') ->with($this->linkField) ->willReturn(3); @@ -939,14 +1020,12 @@ public function testRemoveChild() */ public function testRemoveChildForbidden() { - $this->productRepository->expects($this->any())->method('get')->will($this->returnValue($this->product)); + $this->productRepository->method('get')->willReturn($this->product); $productSku = 'productSku'; $optionId = 1; $childSku = 'childSku'; - $this->product - ->expects($this->any()) - ->method('getTypeId') - ->will($this->returnValue(\Magento\Catalog\Model\Product\Type::TYPE_SIMPLE)); + $this->product->method('getTypeId') + ->willReturn(Type::TYPE_SIMPLE); $this->model->removeChild($productSku, $optionId, $childSku); } @@ -955,28 +1034,26 @@ public function testRemoveChildForbidden() */ public function testRemoveChildInvalidOptionId() { - $this->productRepository->expects($this->any())->method('get')->will($this->returnValue($this->product)); + $this->productRepository->method('get')->willReturn($this->product); $productSku = 'productSku'; $optionId = 1; $childSku = 'childSku'; - $this->product - ->expects($this->any()) - ->method('getTypeId') - ->will($this->returnValue(\Magento\Catalog\Model\Product\Type::TYPE_BUNDLE)); + $this->product->method('getTypeId') + ->willReturn(Type::TYPE_BUNDLE); $this->getRemoveOptions(); - $selection = $this->getMockBuilder(\Magento\Bundle\Model\Selection::class) + $selection = $this->getMockBuilder(Selection::class) ->setMethods(['getSku', 'getOptionId', 'getSelectionId', 'getProductId', '__wakeup']) ->disableOriginalConstructor() ->getMock(); - $selection->expects($this->any())->method('getSku')->will($this->returnValue($childSku)); - $selection->expects($this->any())->method('getOptionId')->will($this->returnValue($optionId + 1)); - $selection->expects($this->any())->method('getSelectionId')->will($this->returnValue(55)); - $selection->expects($this->any())->method('getProductId')->will($this->returnValue(1)); + $selection->method('getSku')->willReturn($childSku); + $selection->method('getOptionId')->willReturn($optionId + 1); + $selection->method('getSelectionId')->willReturn(55); + $selection->method('getProductId')->willReturn(1); - $this->option->expects($this->any())->method('getSelections')->will($this->returnValue([$selection])); + $this->option->method('getSelections')->willReturn([$selection]); $this->model->removeChild($productSku, $optionId, $childSku); } @@ -985,61 +1062,71 @@ public function testRemoveChildInvalidOptionId() */ public function testRemoveChildInvalidChildSku() { - $this->productRepository->expects($this->any())->method('get')->will($this->returnValue($this->product)); + $this->productRepository->method('get')->willReturn($this->product); $productSku = 'productSku'; $optionId = 1; $childSku = 'childSku'; - $this->product - ->expects($this->any()) - ->method('getTypeId') - ->will($this->returnValue(\Magento\Catalog\Model\Product\Type::TYPE_BUNDLE)); + $this->product->method('getTypeId') + ->willReturn(Type::TYPE_BUNDLE); $this->getRemoveOptions(); - $selection = $this->getMockBuilder(\Magento\Bundle\Model\Selection::class) + $selection = $this->getMockBuilder(Selection::class) ->setMethods(['getSku', 'getOptionId', 'getSelectionId', 'getProductId', '__wakeup']) ->disableOriginalConstructor() ->getMock(); - $selection->expects($this->any())->method('getSku')->will($this->returnValue($childSku . '_invalid')); - $selection->expects($this->any())->method('getOptionId')->will($this->returnValue($optionId)); - $selection->expects($this->any())->method('getSelectionId')->will($this->returnValue(55)); - $selection->expects($this->any())->method('getProductId')->will($this->returnValue(1)); + $selection->method('getSku')->willReturn($childSku . '_invalid'); + $selection->method('getOptionId')->willReturn($optionId); + $selection->method('getSelectionId')->willReturn(55); + $selection->method('getProductId')->willReturn(1); - $this->option->expects($this->any())->method('getSelections')->will($this->returnValue([$selection])); + $this->option->method('getSelections') + ->willReturn([$selection]); $this->model->removeChild($productSku, $optionId, $childSku); } private function getOptions() { - $this->product->expects($this->any())->method('getTypeInstance')->will($this->returnValue($this->productType)); - $this->product->expects($this->once())->method('getStoreId')->will($this->returnValue($this->storeId)); - $this->productType->expects($this->once())->method('setStoreFilter') + $this->product->method('getTypeInstance') + ->willReturn($this->productType); + $this->product->expects($this->once()) + ->method('getStoreId') + ->willReturn($this->storeId); + $this->productType->expects($this->once()) + ->method('setStoreFilter') ->with($this->equalTo($this->storeId), $this->equalTo($this->product)); - $this->productType->expects($this->once())->method('getOptionsCollection') + $this->productType->expects($this->once()) + ->method('getOptionsCollection') ->with($this->equalTo($this->product)) - ->will($this->returnValue($this->optionCollection)); + ->willReturn($this->optionCollection); } public function getRemoveOptions() { - $this->product->expects($this->any())->method('getTypeInstance')->will($this->returnValue($this->productType)); - $this->product->expects($this->once())->method('getStoreId')->will($this->returnValue(1)); + $this->product->method('getTypeInstance') + ->willReturn($this->productType); + $this->product->expects($this->once()) + ->method('getStoreId') + ->willReturn(1); $this->productType->expects($this->once())->method('setStoreFilter'); $this->productType->expects($this->once())->method('getOptionsCollection') ->with($this->equalTo($this->product)) - ->will($this->returnValue($this->optionCollection)); + ->willReturn($this->optionCollection); - $this->productType->expects($this->once())->method('getOptionsIds')->with($this->equalTo($this->product)) - ->will($this->returnValue([1, 2, 3])); + $this->productType->expects($this->once()) + ->method('getOptionsIds') + ->with($this->equalTo($this->product)) + ->willReturn([1, 2, 3]); - $this->productType->expects($this->once())->method('getSelectionsCollection') - ->will($this->returnValue([])); + $this->productType->expects($this->once()) + ->method('getSelectionsCollection') + ->willReturn([]); - $this->optionCollection->expects($this->any())->method('appendSelections') + $this->optionCollection->method('appendSelections') ->with($this->equalTo([]), true) - ->will($this->returnValue([$this->option])); + ->willReturn([$this->option]); } } diff --git a/app/code/Magento/Bundle/Test/Unit/Model/Sales/Order/Pdf/Items/AbstractItemsTest.php b/app/code/Magento/Bundle/Test/Unit/Model/Sales/Order/Pdf/Items/AbstractItemsTest.php index 3e9aeaed5c5b4..3c4dbf2e85274 100644 --- a/app/code/Magento/Bundle/Test/Unit/Model/Sales/Order/Pdf/Items/AbstractItemsTest.php +++ b/app/code/Magento/Bundle/Test/Unit/Model/Sales/Order/Pdf/Items/AbstractItemsTest.php @@ -3,50 +3,71 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ +declare(strict_types=1); + namespace Magento\Bundle\Test\Unit\Model\Sales\Order\Pdf\Items; -class AbstractItemsTest extends \PHPUnit\Framework\TestCase +use Magento\Bundle\Model\Sales\Order\Pdf\Items\Shipment; +use Magento\Framework\Serialize\Serializer\Json; +use Magento\Framework\TestFramework\Unit\Helper\ObjectManager; +use Magento\Sales\Model\Order\Creditmemo; +use Magento\Sales\Model\Order\Invoice; +use Magento\Sales\Model\Order\Item; +use PHPUnit\Framework\MockObject\MockObject; +use PHPUnit\Framework\TestCase; + +class AbstractItemsTest extends TestCase { - /** @var \Magento\Sales\Model\Order\Item|\PHPUnit_Framework_MockObject_MockObject */ - protected $orderItem; + /** + * @var Shipment + */ + private $model; - /** @var \Magento\Bundle\Model\Sales\Order\Pdf\Items\Shipment $model */ - protected $model; + /** + * @var Json|MockObject + */ + private $serializerMock; - /** @var \Magento\Framework\Serialize\Serializer\Json $serializer */ - protected $serializer; + /** + * @var Item|MockObject + */ + private $orderItemMock; protected function setUp() { - $this->orderItem = $this->createPartialMock( - \Magento\Sales\Model\Order\Item::class, + $this->orderItemMock = $this->createPartialMock( + Item::class, ['getProductOptions', '__wakeup', 'getParentItem', 'getOrderItem', 'getOrderItemId', 'getId'] ); - $objectManager = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this); - $this->serializer = $this->createMock(\Magento\Framework\Serialize\Serializer\Json::class); + $objectManager = new ObjectManager($this); + $this->serializerMock = $this->createMock(Json::class); $this->model = $objectManager->getObject( - \Magento\Bundle\Model\Sales\Order\Pdf\Items\Shipment::class, + Shipment::class, [ - 'serializer' => $this->serializer + 'serializer' => $this->serializerMock ] ); } /** * @dataProvider getChildrenEmptyItemsDataProvider + * + * @param string $class + * @param string $method + * @param string $returnClass */ public function testGetChildrenEmptyItems($class, $method, $returnClass) { $salesModel = $this->createPartialMock($returnClass, ['getAllItems', '__wakeup']); - $salesModel->expects($this->once())->method('getAllItems')->will($this->returnValue([])); + $salesModel->expects($this->once())->method('getAllItems')->willReturn([]); $item = $this->createPartialMock($class, [$method, 'getOrderItem', '__wakeup']); - $item->expects($this->once())->method($method)->will($this->returnValue($salesModel)); - $item->expects($this->once())->method('getOrderItem')->will($this->returnValue($this->orderItem)); - $this->orderItem->expects($this->any())->method('getId')->will($this->returnValue(1)); + $item->expects($this->once())->method($method)->willReturn($salesModel); + $item->expects($this->once())->method('getOrderItem')->willReturn($this->orderItemMock); + $this->orderItemMock->method('getId')->willReturn(1); - $this->assertSame(null, $this->model->getChildren($item)); + $this->assertNull($this->model->getChildren($item)); } /** @@ -56,9 +77,9 @@ public function getChildrenEmptyItemsDataProvider() { return [ [ - \Magento\Sales\Model\Order\Invoice\Item::class, + Invoice\Item::class, 'getInvoice', - \Magento\Sales\Model\Order\Invoice::class + Invoice::class ], [ \Magento\Sales\Model\Order\Shipment\Item::class, @@ -66,38 +87,40 @@ public function getChildrenEmptyItemsDataProvider() \Magento\Sales\Model\Order\Shipment::class ], [ - \Magento\Sales\Model\Order\Creditmemo\Item::class, + Creditmemo\Item::class, 'getCreditmemo', - \Magento\Sales\Model\Order\Creditmemo::class + Creditmemo::class ] ]; } /** * @dataProvider getChildrenDataProvider + * + * @param bool $parentItem */ public function testGetChildren($parentItem) { if ($parentItem) { - $parentItem = $this->createPartialMock(\Magento\Sales\Model\Order\Item::class, ['getId', '__wakeup']); - $parentItem->expects($this->any())->method('getId')->will($this->returnValue(1)); + $parentItem = $this->createPartialMock(Item::class, ['getId', '__wakeup']); + $parentItem->method('getId')->willReturn(1); } - $this->orderItem->expects($this->any())->method('getOrderItem')->will($this->returnSelf()); - $this->orderItem->expects($this->any())->method('getParentItem')->will($this->returnValue($parentItem)); - $this->orderItem->expects($this->any())->method('getOrderItemId')->will($this->returnValue(2)); - $this->orderItem->expects($this->any())->method('getId')->will($this->returnValue(1)); + $this->orderItemMock->method('getOrderItem')->willReturnSelf(); + $this->orderItemMock->method('getParentItem')->willReturn($parentItem); + $this->orderItemMock->method('getOrderItemId')->willReturn(2); + $this->orderItemMock->method('getId')->willReturn(1); - $salesModel = $this->createPartialMock(\Magento\Sales\Model\Order\Invoice::class, ['getAllItems', '__wakeup']); - $salesModel->expects($this->once())->method('getAllItems')->will($this->returnValue([$this->orderItem])); + $salesModel = $this->createPartialMock(Invoice::class, ['getAllItems', '__wakeup']); + $salesModel->expects($this->once())->method('getAllItems')->willReturn([$this->orderItemMock]); $item = $this->createPartialMock( - \Magento\Sales\Model\Order\Invoice\Item::class, + Invoice\Item::class, ['getInvoice', 'getOrderItem', '__wakeup'] ); - $item->expects($this->once())->method('getInvoice')->will($this->returnValue($salesModel)); - $item->expects($this->any())->method('getOrderItem')->will($this->returnValue($this->orderItem)); + $item->expects($this->once())->method('getInvoice')->willReturn($salesModel); + $item->method('getOrderItem')->willReturn($this->orderItemMock); - $this->assertSame([2 => $this->orderItem], $this->model->getChildren($item)); + $this->assertSame([2 => $this->orderItemMock], $this->model->getChildren($item)); } /** @@ -113,11 +136,14 @@ public function getChildrenDataProvider() /** * @dataProvider isShipmentSeparatelyWithoutItemDataProvider + * + * @param array $productOptions + * @param bool $result */ public function testIsShipmentSeparatelyWithoutItem($productOptions, $result) { - $this->model->setItem($this->orderItem); - $this->orderItem->expects($this->any())->method('getProductOptions')->will($this->returnValue($productOptions)); + $this->model->setItem($this->orderItemMock); + $this->orderItemMock->method('getProductOptions')->willReturn($productOptions); $this->assertSame($result, $this->model->isShipmentSeparately()); } @@ -136,23 +162,27 @@ public function isShipmentSeparatelyWithoutItemDataProvider() /** * @dataProvider isShipmentSeparatelyWithItemDataProvider + * + * @param array $productOptions + * @param bool $result + * @param bool $parentItem */ public function testIsShipmentSeparatelyWithItem($productOptions, $result, $parentItem) { if ($parentItem) { $parentItem = $this->createPartialMock( - \Magento\Sales\Model\Order\Item::class, + Item::class, ['getProductOptions', '__wakeup'] ); - $parentItem->expects($this->any())->method('getProductOptions')->will($this->returnValue($productOptions)); + $parentItem->method('getProductOptions')->willReturn($productOptions); } else { - $this->orderItem->expects($this->any())->method('getProductOptions') - ->will($this->returnValue($productOptions)); + $this->orderItemMock->method('getProductOptions') + ->willReturn($productOptions); } - $this->orderItem->expects($this->any())->method('getParentItem')->will($this->returnValue($parentItem)); - $this->orderItem->expects($this->any())->method('getOrderItem')->will($this->returnSelf()); + $this->orderItemMock->method('getParentItem')->willReturn($parentItem); + $this->orderItemMock->method('getOrderItem')->willReturnSelf(); - $this->assertSame($result, $this->model->isShipmentSeparately($this->orderItem)); + $this->assertSame($result, $this->model->isShipmentSeparately($this->orderItemMock)); } /** @@ -170,11 +200,14 @@ public function isShipmentSeparatelyWithItemDataProvider() /** * @dataProvider isChildCalculatedWithoutItemDataProvider + * + * @param array $productOptions + * @param bool $result */ public function testIsChildCalculatedWithoutItem($productOptions, $result) { - $this->model->setItem($this->orderItem); - $this->orderItem->expects($this->any())->method('getProductOptions')->will($this->returnValue($productOptions)); + $this->model->setItem($this->orderItemMock); + $this->orderItemMock->method('getProductOptions')->willReturn($productOptions); $this->assertSame($result, $this->model->isChildCalculated()); } @@ -193,23 +226,27 @@ public function isChildCalculatedWithoutItemDataProvider() /** * @dataProvider isChildCalculatedWithItemDataProvider + * + * @param array $productOptions + * @param bool $result + * @param bool $parentItem */ public function testIsChildCalculatedWithItem($productOptions, $result, $parentItem) { if ($parentItem) { $parentItem = $this->createPartialMock( - \Magento\Sales\Model\Order\Item::class, + Item::class, ['getProductOptions', '__wakeup'] ); - $parentItem->expects($this->any())->method('getProductOptions')->will($this->returnValue($productOptions)); + $parentItem->method('getProductOptions')->willReturn($productOptions); } else { - $this->orderItem->expects($this->any())->method('getProductOptions') - ->will($this->returnValue($productOptions)); + $this->orderItemMock->method('getProductOptions') + ->willReturn($productOptions); } - $this->orderItem->expects($this->any())->method('getParentItem')->will($this->returnValue($parentItem)); - $this->orderItem->expects($this->any())->method('getOrderItem')->will($this->returnSelf()); + $this->orderItemMock->method('getParentItem')->willReturn($parentItem); + $this->orderItemMock->method('getOrderItem')->willReturnSelf(); - $this->assertSame($result, $this->model->isChildCalculated($this->orderItem)); + $this->assertSame($result, $this->model->isChildCalculated($this->orderItemMock)); } /** @@ -227,11 +264,13 @@ public function isChildCalculatedWithItemDataProvider() /** * @dataProvider getBundleOptionsDataProvider + * @param array $productOptions + * @param array|string $result */ public function testGetBundleOptions($productOptions, $result) { - $this->model->setItem($this->orderItem); - $this->orderItem->expects($this->any())->method('getProductOptions')->will($this->returnValue($productOptions)); + $this->model->setItem($this->orderItemMock); + $this->orderItemMock->method('getProductOptions')->willReturn($productOptions); $this->assertSame($result, $this->model->getBundleOptions()); } @@ -248,8 +287,8 @@ public function getBundleOptionsDataProvider() public function testGetSelectionAttributes() { - $this->orderItem->expects($this->any())->method('getProductOptions')->will($this->returnValue([])); - $this->assertNull($this->model->getSelectionAttributes($this->orderItem)); + $this->orderItemMock->method('getProductOptions')->willReturn([]); + $this->assertNull($this->model->getSelectionAttributes($this->orderItemMock)); } public function testGetSelectionAttributesWithBundle() @@ -258,13 +297,12 @@ public function testGetSelectionAttributesWithBundle() $options = ['bundle_selection_attributes' => $bundleAttributes]; $unserializedResult = 'result of "bundle_selection_attributes" unserialization'; - $this->serializer->expects($this->any()) - ->method('unserialize') + $this->serializerMock->method('unserialize') ->with($bundleAttributes) - ->will($this->returnValue($unserializedResult)); - $this->orderItem->expects($this->any())->method('getProductOptions')->will($this->returnValue($options)); + ->willReturn($unserializedResult); + $this->orderItemMock->method('getProductOptions')->willReturn($options); - $this->assertEquals($unserializedResult, $this->model->getSelectionAttributes($this->orderItem)); + $this->assertEquals($unserializedResult, $this->model->getSelectionAttributes($this->orderItemMock)); } public function testGetOrderOptions() @@ -274,28 +312,32 @@ public function testGetOrderOptions() 'additional_options' => ['additional_options'], 'attributes_info' => ['attributes_info'], ]; - $this->model->setItem($this->orderItem); - $this->orderItem->expects($this->any())->method('getProductOptions')->will($this->returnValue($productOptions)); + $this->model->setItem($this->orderItemMock); + $this->orderItemMock->method('getProductOptions')->willReturn($productOptions); $this->assertEquals(['attributes_info', 'options', 'additional_options'], $this->model->getOrderOptions()); } public function testGetOrderItem() { - $this->model->setItem($this->orderItem); - $this->assertSame($this->orderItem, $this->model->getOrderItem()); + $this->model->setItem($this->orderItemMock); + $this->assertSame($this->orderItemMock, $this->model->getOrderItem()); } /** * @dataProvider canShowPriceInfoDataProvider + * + * @param bool $parentItem + * @param array $productOptions + * @param bool $result */ public function testCanShowPriceInfo($parentItem, $productOptions, $result) { - $this->model->setItem($this->orderItem); - $this->orderItem->expects($this->any())->method('getOrderItem')->will($this->returnSelf()); - $this->orderItem->expects($this->any())->method('getParentItem')->will($this->returnValue($parentItem)); - $this->orderItem->expects($this->any())->method('getProductOptions')->will($this->returnValue($productOptions)); + $this->model->setItem($this->orderItemMock); + $this->orderItemMock->method('getOrderItem')->willReturnSelf(); + $this->orderItemMock->method('getParentItem')->willReturn($parentItem); + $this->orderItemMock->method('getProductOptions')->willReturn($productOptions); - $this->assertSame($result, $this->model->canShowPriceInfo($this->orderItem)); + $this->assertSame($result, $this->model->canShowPriceInfo($this->orderItemMock)); } /** diff --git a/app/code/Magento/Bundle/Test/Unit/Pricing/Price/BundleOptionsTest.php b/app/code/Magento/Bundle/Test/Unit/Pricing/Price/BundleOptionsTest.php index 37973b9b8ae28..d795af793675b 100644 --- a/app/code/Magento/Bundle/Test/Unit/Pricing/Price/BundleOptionsTest.php +++ b/app/code/Magento/Bundle/Test/Unit/Pricing/Price/BundleOptionsTest.php @@ -7,23 +7,24 @@ namespace Magento\Bundle\Test\Unit\Pricing\Price; -use Magento\Framework\TestFramework\Unit\Helper\ObjectManager as ObjectManagerHelper; -use PHPUnit_Framework_MockObject_MockObject as MockObject; -use Magento\Framework\Pricing\Amount\AmountFactory; -use Magento\Framework\Pricing\Adjustment\Calculator as AdjustmentCalculator; -use Magento\Framework\Pricing\PriceInfo\Base as BasePriceInfo; -use Magento\Framework\Pricing\PriceCurrencyInterface; -use Magento\Framework\Pricing\Amount\AmountInterface; -use Magento\Framework\Pricing\Amount\Base as BaseAmount; -use Magento\Bundle\Pricing\Price\BundleOptions; -use Magento\Bundle\Pricing\Price\BundleSelectionPrice; -use Magento\Bundle\Pricing\Price\BundleSelectionFactory; -use Magento\Bundle\Pricing\Adjustment\Calculator as BundleAdjustmentCalculator; use Magento\Bundle\Model\Option as BundleOption; use Magento\Bundle\Model\Product\Type as BundleProductType; use Magento\Bundle\Model\ResourceModel\Option\Collection as BundleOptionCollection; +use Magento\Bundle\Pricing\Adjustment\Calculator as BundleAdjustmentCalculator; +use Magento\Bundle\Pricing\Adjustment\SelectionPriceListProviderInterface; +use Magento\Bundle\Pricing\Price\BundleOptions; +use Magento\Bundle\Pricing\Price\BundleSelectionFactory; +use Magento\Bundle\Pricing\Price\BundleSelectionPrice; use Magento\Catalog\Model\Product; +use Magento\Framework\Pricing\Adjustment\Calculator as AdjustmentCalculator; +use Magento\Framework\Pricing\Amount\AmountFactory; +use Magento\Framework\Pricing\Amount\AmountInterface; +use Magento\Framework\Pricing\Amount\Base as BaseAmount; +use Magento\Framework\Pricing\PriceCurrencyInterface; +use Magento\Framework\Pricing\PriceInfo\Base as BasePriceInfo; +use Magento\Framework\TestFramework\Unit\Helper\ObjectManager as ObjectManagerHelper; use Magento\Tax\Helper\Data as TaxHelperData; +use PHPUnit_Framework_MockObject_MockObject as MockObject; /** * Test for Magento\Bundle\Pricing\Price\BundleOptions @@ -71,6 +72,11 @@ class BundleOptionsTest extends \PHPUnit\Framework\TestCase */ private $priceInfoMock; + /** + * @var SelectionPriceListProviderInterface + */ + private $selectionPriceListProviderMock; + protected function setUp() { $this->priceInfoMock = $this->getMockBuilder(BasePriceInfo::class) @@ -102,9 +108,20 @@ function ($fullAmount, $adjustments) { ->disableOriginalConstructor() ->getMock(); + $this->selectionPriceListProviderMock = $this->getMockBuilder(SelectionPriceListProviderInterface::class) + ->disableOriginalConstructor() + ->getMock(); + $this->bundleCalculatorMock = $this->getMockBuilder(BundleAdjustmentCalculator::class) ->setConstructorArgs( - [$this->baseCalculator, $this->amountFactory, $this->selectionFactoryMock, $taxData, $priceCurrency] + [ + $this->baseCalculator, + $this->amountFactory, + $this->selectionFactoryMock, + $taxData, + $priceCurrency, + $this->selectionPriceListProviderMock + ] ) ->setMethods(['getOptionsAmount']) ->getMock(); diff --git a/app/code/Magento/Bundle/Test/Unit/Pricing/Price/FinalPriceTest.php b/app/code/Magento/Bundle/Test/Unit/Pricing/Price/FinalPriceTest.php index 4463709391102..d21971b821691 100644 --- a/app/code/Magento/Bundle/Test/Unit/Pricing/Price/FinalPriceTest.php +++ b/app/code/Magento/Bundle/Test/Unit/Pricing/Price/FinalPriceTest.php @@ -3,121 +3,156 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ +declare(strict_types=1); namespace Magento\Bundle\Test\Unit\Pricing\Price; +use Magento\Bundle\Pricing\Adjustment\BundleCalculatorInterface; use Magento\Bundle\Pricing\Price\BundleOptionPrice; +use Magento\Bundle\Pricing\Price\FinalPrice; +use Magento\Catalog\Api\Data\ProductCustomOptionInterface; +use Magento\Catalog\Model\Product; +use Magento\Catalog\Pricing\Price\BasePrice; use Magento\Catalog\Pricing\Price\CustomOptionPrice; use Magento\Bundle\Model\Product\Price; use Magento\Catalog\Api\ProductCustomOptionRepositoryInterface; use Magento\Framework\Pricing\PriceCurrencyInterface; +use Magento\Framework\Pricing\PriceInfo\Base; +use Magento\Framework\Pricing\SaleableInterface; use Magento\Framework\TestFramework\Unit\Helper\ObjectManager as ObjectManagerHelper; +use PHPUnit\Framework\MockObject\MockObject; +use PHPUnit\Framework\TestCase; /** - * @SuppressWarnings(PHPMD) + * Test class for \Magento\Bundle\Pricing\Price\FinalPrice + * + * @SuppressWarnings(PHPMD.CouplingBetweenObjects) */ -class FinalPriceTest extends \PHPUnit\Framework\TestCase +class FinalPriceTest extends TestCase { - /** @var \Magento\Bundle\Pricing\Price\FinalPrice */ - protected $finalPrice; + /** + * @var FinalPrice + */ + private $finalPrice; - /** @var ObjectManagerHelper */ - protected $objectManagerHelper; + /** + * @var ObjectManagerHelper + */ + private $objectManagerHelper; - /** @var \Magento\Framework\Pricing\SaleableInterface|\PHPUnit_Framework_MockObject_MockObject */ - protected $saleableInterfaceMock; + /** + * @var SaleableInterface|MockObject + */ + private $saleableInterfaceMock; - /** @var float */ - protected $quantity = 1.; + /** + * @var float + */ + private $quantity = 1.; - /** @var float*/ - protected $baseAmount; + /** + * @var BundleCalculatorInterface|MockObject + */ + private $bundleCalculatorMock; - /** @var \Magento\Bundle\Pricing\Adjustment\BundleCalculatorInterface|\PHPUnit_Framework_MockObject_MockObject */ - protected $bundleCalculatorMock; + /** + * @var PriceCurrencyInterface|MockObject + */ + private $priceCurrencyMock; - /** @var \Magento\Framework\Pricing\PriceInfo\Base |\PHPUnit_Framework_MockObject_MockObject */ - protected $priceInfoMock; + /** + * @var ProductCustomOptionRepositoryInterface|MockObject + */ + private $productOptionRepositoryMock; - /** @var \Magento\Catalog\Pricing\Price\BasePrice|\PHPUnit_Framework_MockObject_MockObject */ - protected $basePriceMock; + /** + * @var float + */ + private $baseAmount; - /** @var BundleOptionPrice|\PHPUnit_Framework_MockObject_MockObject */ - protected $bundleOptionMock; + /** + * @var Base|MockObject + */ + private $priceInfoMock; - /** @var CustomOptionPrice|\PHPUnit_Framework_MockObject_MockObject */ - protected $customOptionPriceMock; + /** + * @var BasePrice|MockObject + */ + private $basePriceMock; /** - * @var PriceCurrencyInterface|\PHPUnit_Framework_MockObject_MockObject + * @var BundleOptionPrice|MockObject */ - protected $priceCurrencyMock; + private $bundleOptionMock; /** - * @var ProductCustomOptionRepositoryInterface|\PHPUnit_Framework_MockObject_MockObject + * @var CustomOptionPrice|MockObject */ - private $productOptionRepositoryMock; + private $customOptionPriceMock; /** * @return void */ protected function prepareMock() { - $this->saleableInterfaceMock = $this->getMockBuilder(\Magento\Catalog\Model\Product::class) + $this->saleableInterfaceMock = $this->getMockBuilder(Product::class) ->disableOriginalConstructor() ->setMethods(['getPriceType', 'getPriceInfo']) ->getMock(); $this->bundleCalculatorMock = $this->createMock( - \Magento\Bundle\Pricing\Adjustment\BundleCalculatorInterface::class + BundleCalculatorInterface::class ); - $this->basePriceMock = $this->createMock(\Magento\Catalog\Pricing\Price\BasePrice::class); - $this->basePriceMock->expects($this->any()) - ->method('getValue') - ->will($this->returnValue($this->baseAmount)); + $this->basePriceMock = $this->createMock(BasePrice::class); + $this->basePriceMock->method('getValue') + ->willReturn($this->baseAmount); - $this->bundleOptionMock = $this->getMockBuilder(\Magento\Bundle\Pricing\Price\BundleOptionPrice::class) + $this->bundleOptionMock = $this->getMockBuilder(BundleOptionPrice::class) ->disableOriginalConstructor() ->getMock(); - $this->customOptionPriceMock = $this->getMockBuilder(\Magento\Catalog\Pricing\Price\CustomOptionPrice::class) + $this->customOptionPriceMock = $this->getMockBuilder(CustomOptionPrice::class) ->disableOriginalConstructor() ->getMock(); - $this->priceInfoMock = $this->createMock(\Magento\Framework\Pricing\PriceInfo\Base::class); + $this->priceInfoMock = $this->createMock(Base::class); $this->priceInfoMock->expects($this->atLeastOnce()) ->method('getPrice') - ->will($this->returnValueMap([ - [\Magento\Catalog\Pricing\Price\BasePrice::PRICE_CODE, $this->basePriceMock], - [BundleOptionPrice::PRICE_CODE, $this->bundleOptionMock], - [CustomOptionPrice::PRICE_CODE, $this->customOptionPriceMock], - ])); + ->willReturnMap( + [ + [BasePrice::PRICE_CODE, $this->basePriceMock], + [BundleOptionPrice::PRICE_CODE, $this->bundleOptionMock], + [CustomOptionPrice::PRICE_CODE, $this->customOptionPriceMock], + ] + ); $this->saleableInterfaceMock->expects($this->once()) ->method('getPriceInfo') - ->will($this->returnValue($this->priceInfoMock)); - - $this->priceCurrencyMock = $this->createMock(\Magento\Framework\Pricing\PriceCurrencyInterface::class); - - $this->objectManagerHelper = new ObjectManagerHelper($this); - $this->finalPrice = new \Magento\Bundle\Pricing\Price\FinalPrice( - $this->saleableInterfaceMock, - $this->quantity, - $this->bundleCalculatorMock, - $this->priceCurrencyMock - ); + ->willReturn($this->priceInfoMock); + $this->priceCurrencyMock = $this->createMock(PriceCurrencyInterface::class); $this->productOptionRepositoryMock = $this->getMockForAbstractClass( ProductCustomOptionRepositoryInterface::class ); - $reflection = new \ReflectionClass(get_class($this->finalPrice)); - $reflectionProperty = $reflection->getProperty('productOptionRepository'); - $reflectionProperty->setAccessible(true); - $reflectionProperty->setValue($this->finalPrice, $this->productOptionRepositoryMock); + + $this->objectManagerHelper = new ObjectManagerHelper($this); + $this->finalPrice = $this->objectManagerHelper->getObject( + FinalPrice::class, + [ + 'saleableItem' => $this->saleableInterfaceMock, + 'quantity' => $this->quantity, + 'calculator' => $this->bundleCalculatorMock, + 'priceCurrency' => $this->priceCurrencyMock, + 'productOptionRepository' => $this->productOptionRepositoryMock + ] + ); } /** + * @param $baseAmount + * @param $optionsValue + * @param $result * @dataProvider getValueDataProvider */ public function testGetValue($baseAmount, $optionsValue, $result) @@ -126,7 +161,7 @@ public function testGetValue($baseAmount, $optionsValue, $result) $this->prepareMock(); $this->bundleOptionMock->expects($this->once()) ->method('getValue') - ->will($this->returnValue($optionsValue)); + ->willReturn($optionsValue); $this->assertSame($result, $this->finalPrice->getValue()); } @@ -144,6 +179,7 @@ public function getValueDataProvider() } /** + * @param $baseAmount * @dataProvider getValueDataProvider */ public function testGetMaximalPrice($baseAmount) @@ -155,7 +191,7 @@ public function testGetMaximalPrice($baseAmount) $this->bundleCalculatorMock->expects($this->once()) ->method('getMaxAmount') ->with($this->equalTo($this->baseAmount), $this->equalTo($this->saleableInterfaceMock)) - ->will($this->returnValue($result)); + ->willReturn($result); $this->assertSame($result, $this->finalPrice->getMaximalPrice()); //The second call should use cached value $this->assertSame($result, $this->finalPrice->getMaximalPrice()); @@ -179,7 +215,7 @@ public function testGetMaximalPriceFixedBundleWithOption() $this->bundleCalculatorMock->expects($this->once()) ->method('getMaxAmount') ->with($this->equalTo($this->baseAmount + $optionMaxPrice), $this->equalTo($this->saleableInterfaceMock)) - ->will($this->returnValue($result)); + ->willReturn($result); $this->assertSame($result, $this->finalPrice->getMaximalPrice()); //The second call should use cached value $this->assertSame($result, $this->finalPrice->getMaximalPrice()); @@ -192,7 +228,7 @@ public function testGetMinimalPriceFixedBundleWithOption() $result = 7; $this->prepareMock(); $customOptions = [ - $this->getMockBuilder(\Magento\Catalog\Api\Data\ProductCustomOptionInterface::class) + $this->getMockBuilder(ProductCustomOptionInterface::class) ->setMethods(['setProduct']) ->getMockForAbstractClass() ]; @@ -213,7 +249,7 @@ public function testGetMinimalPriceFixedBundleWithOption() $this->bundleCalculatorMock->expects($this->once()) ->method('getAmount') ->with($this->equalTo($this->baseAmount + $optionMaxPrice), $this->equalTo($this->saleableInterfaceMock)) - ->will($this->returnValue($result)); + ->willReturn($result); $this->assertSame($result, $this->finalPrice->getMinimalPrice()); //The second call should use cached value $this->assertSame($result, $this->finalPrice->getMinimalPrice()); @@ -231,7 +267,7 @@ public function testGetMinimalPrice($baseAmount) $this->bundleCalculatorMock->expects($this->once()) ->method('getAmount') ->with($this->equalTo($this->baseAmount), $this->equalTo($this->saleableInterfaceMock)) - ->will($this->returnValue($result)); + ->willReturn($result); $this->assertSame($result, $this->finalPrice->getMinimalPrice()); //The second call should use cached value $this->assertSame($result, $this->finalPrice->getMinimalPrice()); @@ -244,7 +280,7 @@ public function testGetPriceWithoutOption() $this->bundleCalculatorMock->expects($this->once()) ->method('getAmountWithoutOption') ->with($this->equalTo($this->baseAmount), $this->equalTo($this->saleableInterfaceMock)) - ->will($this->returnValue($result)); + ->willReturn($result); $this->assertSame($result, $this->finalPrice->getPriceWithoutOption()); //The second call should use cached value $this->assertSame($result, $this->finalPrice->getPriceWithoutOption()); diff --git a/app/code/Magento/BundleImportExport/Test/Mftf/Test/UpdateBundleProductViaImportTest.xml b/app/code/Magento/BundleImportExport/Test/Mftf/Test/UpdateBundleProductViaImportTest.xml index 45b4c4f5ededd..23d24369cad4a 100644 --- a/app/code/Magento/BundleImportExport/Test/Mftf/Test/UpdateBundleProductViaImportTest.xml +++ b/app/code/Magento/BundleImportExport/Test/Mftf/Test/UpdateBundleProductViaImportTest.xml @@ -18,7 +18,7 @@ <group value="importExport"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> </before> <after> <!-- Delete products created via import --> @@ -28,7 +28,7 @@ <actionGroup ref="DeleteProductBySkuActionGroup" stepKey="deleteSimpleProduct"> <argument name="sku" value="Simple"/> </actionGroup> - <actionGroup ref="logout" stepKey="logoutFromAdmin"/> + <actionGroup ref="AdminLogoutActionGroup" stepKey="logoutFromAdmin"/> </after> <!-- Create Bundle product via import --> diff --git a/app/code/Magento/Captcha/Test/Mftf/Test/AdminLoginWithCaptchaTest.xml b/app/code/Magento/Captcha/Test/Mftf/Test/AdminLoginWithCaptchaTest.xml index e5ee55910df65..962b788aa80bb 100644 --- a/app/code/Magento/Captcha/Test/Mftf/Test/AdminLoginWithCaptchaTest.xml +++ b/app/code/Magento/Captcha/Test/Mftf/Test/AdminLoginWithCaptchaTest.xml @@ -31,18 +31,21 @@ <magentoCLI command="cache:clean config full_page" stepKey="cleanInvalidatedCaches"/> </after> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdminWithWrongCredentialsFirstAttempt"> - <argument name="adminUser" value="AdminUserWrongCredentials" /> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdminWithWrongCredentialsFirstAttempt"> + <argument name="username" value="{{AdminUserWrongCredentials.username}}"/> + <argument name="password" value="{{AdminUserWrongCredentials.password}}"/> </actionGroup> <actionGroup ref="AssertMessageOnAdminLoginActionGroup" stepKey="seeFirstLoginErrorMessage" /> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdminWithWrongCredentialsSecondAttempt"> - <argument name="adminUser" value="AdminUserWrongCredentials" /> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdminWithWrongCredentialsSecondAttempt"> + <argument name="username" value="{{AdminUserWrongCredentials.username}}"/> + <argument name="password" value="{{AdminUserWrongCredentials.password}}"/> </actionGroup> <actionGroup ref="AssertMessageOnAdminLoginActionGroup" stepKey="seeSecondLoginErrorMessage" /> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdminWithWrongCredentialsThirdAttempt"> - <argument name="adminUser" value="AdminUserWrongCredentials" /> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdminWithWrongCredentialsThirdAttempt"> + <argument name="username" value="{{AdminUserWrongCredentials.username}}"/> + <argument name="password" value="{{AdminUserWrongCredentials.password}}"/> </actionGroup> <actionGroup ref="AssertMessageOnAdminLoginActionGroup" stepKey="seeThirdLoginErrorMessage" /> diff --git a/app/code/Magento/Captcha/Test/Mftf/Test/CaptchaFormsDisplayingTest/CaptchaFormsDisplayingTest.xml b/app/code/Magento/Captcha/Test/Mftf/Test/CaptchaFormsDisplayingTest/CaptchaFormsDisplayingTest.xml index ee71a243a769d..3aa57917c43a8 100644 --- a/app/code/Magento/Captcha/Test/Mftf/Test/CaptchaFormsDisplayingTest/CaptchaFormsDisplayingTest.xml +++ b/app/code/Magento/Captcha/Test/Mftf/Test/CaptchaFormsDisplayingTest/CaptchaFormsDisplayingTest.xml @@ -19,7 +19,7 @@ </annotations> <!--Login as admin--> - <actionGroup ref="LoginAsAdmin" stepKey="LoginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="LoginAsAdmin"/> <!--Go to Captcha--> <actionGroup ref="CaptchaFormsDisplayingActionGroup" stepKey="CaptchaFormsDisplayingActionGroup"/> <waitForPageLoad stepKey="WaitForPageLoaded"/> diff --git a/app/code/Magento/CardinalCommerce/Test/Mftf/Test/AdminCardinalCommerceSettingsHiddenTest.xml b/app/code/Magento/CardinalCommerce/Test/Mftf/Test/AdminCardinalCommerceSettingsHiddenTest.xml index 16f2774e22ccd..59f1c13621982 100644 --- a/app/code/Magento/CardinalCommerce/Test/Mftf/Test/AdminCardinalCommerceSettingsHiddenTest.xml +++ b/app/code/Magento/CardinalCommerce/Test/Mftf/Test/AdminCardinalCommerceSettingsHiddenTest.xml @@ -17,7 +17,7 @@ <severity value="MINOR"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <magentoCLI command="config:set three_d_secure/cardinal/enabled_authorizenet 1" stepKey="enableCardinalCommerce"/> </before> diff --git a/app/code/Magento/Catalog/Model/Indexer/Product/Flat/Action/Row.php b/app/code/Magento/Catalog/Model/Indexer/Product/Flat/Action/Row.php index 64a7c4be4e03c..5ea2b636933a3 100644 --- a/app/code/Magento/Catalog/Model/Indexer/Product/Flat/Action/Row.php +++ b/app/code/Magento/Catalog/Model/Indexer/Product/Flat/Action/Row.php @@ -85,10 +85,16 @@ public function execute($id = null) $ids = [$id]; $linkField = $this->metadataPool->getMetadata(ProductInterface::class)->getLinkField(); + $storeIds = $this->getAssignedStoreIdsOfProduct($id); + $stores = $this->_storeManager->getStores(); foreach ($stores as $store) { $tableExists = $this->_isFlatTableExists($store->getId()); if ($tableExists) { + if (!in_array($store->getId(), $storeIds)) { + $this->flatItemEraser->deleteProductsFromStore($id, $store->getId()); + continue; + } $this->flatItemEraser->removeDeletedProducts($ids, $store->getId()); $this->flatItemEraser->removeDisabledProducts($ids, $store->getId()); } @@ -129,4 +135,23 @@ public function execute($id = null) return $this; } + + /** + * Get list store id where the product is enable + * + * @param int $productId + * @return array + */ + private function getAssignedStoreIdsOfProduct($productId) + { + $select = $this->_connection->select(); + $select->from(['e' => $this->_productIndexerHelper->getTable('store')], ['e.store_id']) + ->where('c.product_id = ' . $productId) + ->joinLeft( + ['c' => $this->_productIndexerHelper->getTable('catalog_product_website')], + 'e.website_id = c.website_id', + [] + ); + return $this->_connection->fetchCol($select); + } } diff --git a/app/code/Magento/Catalog/Model/ResourceModel/Product/Collection.php b/app/code/Magento/Catalog/Model/ResourceModel/Product/Collection.php index 1a46c38d04319..41b3f9781c8a0 100644 --- a/app/code/Magento/Catalog/Model/ResourceModel/Product/Collection.php +++ b/app/code/Magento/Catalog/Model/ResourceModel/Product/Collection.php @@ -1717,7 +1717,10 @@ public function addAttributeToSort($attribute, $dir = self::SORT_ORDER_ASC) // optimize if using cat index $filters = $this->_productLimitationFilters; if (isset($filters['category_id']) || isset($filters['visibility'])) { - $this->getSelect()->order(['cat_index.position ' . $dir, 'e.entity_id ' . $dir]); + $this->getSelect()->order([ + 'cat_index.position ' . $dir, + 'e.entity_id ' . \Magento\Framework\DB\Select::SQL_DESC + ]); } else { $this->getSelect()->order('e.entity_id ' . $dir); } diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminCategoriesExpandAllActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminCategoriesExpandAllActionGroup.xml new file mode 100644 index 0000000000000..aa4a69f8abf62 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminCategoriesExpandAllActionGroup.xml @@ -0,0 +1,13 @@ +<?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="AdminCategoriesExpandAllActionGroup"> + <click selector="{{AdminCategorySidebarTreeSection.expandAll}}" stepKey="clickExpandAll"/> + </actionGroup> +</actionGroups> \ No newline at end of file diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminCategoriesOpenCategoryActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminCategoriesOpenCategoryActionGroup.xml new file mode 100644 index 0000000000000..3903615597eb3 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminCategoriesOpenCategoryActionGroup.xml @@ -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="AdminCategoriesOpenCategoryActionGroup"> + <arguments> + <argument name="category" defaultValue="_defaultCategory"/> + </arguments> + <click selector="{{AdminCategorySidebarTreeSection.categoryInTree(category.name)}}" stepKey="clickCategoryLink"/> + <waitForPageLoad stepKey="waitForCategoryPageLoad"/> + </actionGroup> +</actionGroups> \ No newline at end of file diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminCategoriesOpenContentSectionActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminCategoriesOpenContentSectionActionGroup.xml new file mode 100644 index 0000000000000..edc3d11bebe66 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminCategoriesOpenContentSectionActionGroup.xml @@ -0,0 +1,15 @@ +<?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="AdminCategoriesOpenContentSectionActionGroup"> + <waitForElementVisible selector="{{AdminCategoryContentSection.sectionHeader}}" stepKey="waitForContentSection"/> + <conditionalClick selector="{{AdminCategoryContentSection.sectionHeader}}" dependentSelector="{{AdminCategoryContentSection.uploadButton}}" visible="false" stepKey="openContentSection"/> + <waitForPageLoad stepKey="waitForContentSectionLoad"/> + </actionGroup> +</actionGroups> \ No newline at end of file diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminCategoriesSetDisplayModeActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminCategoriesSetDisplayModeActionGroup.xml new file mode 100644 index 0000000000000..7e3877bb76ffc --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminCategoriesSetDisplayModeActionGroup.xml @@ -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="AdminCategoriesSetDisplayModeActionGroup"> + <arguments> + <argument name="value" type="string"/> + </arguments> + <waitForElementVisible selector="{{AdminCategoryDisplaySettingsSection.settingsHeader}}" stepKey="waitForDisplaySettingsSection"/> + <conditionalClick selector="{{AdminCategoryDisplaySettingsSection.settingsHeader}}" dependentSelector="{{AdminCategoryDisplaySettingsSection.displayMode}}" visible="false" stepKey="openDisplaySettingsSection"/> + <waitForPageLoad stepKey="waitForDisplaySettingsLoad"/> + <selectOption stepKey="selectStaticBlockOnlyOption" userInput="{{value}}" selector="{{AdminCategoryDisplaySettingsSection.displayMode}}"/> + </actionGroup> +</actionGroups> \ No newline at end of file diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminCategoriesSetStaticBlockActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminCategoriesSetStaticBlockActionGroup.xml new file mode 100644 index 0000000000000..1d5308a639d72 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminCategoriesSetStaticBlockActionGroup.xml @@ -0,0 +1,16 @@ +<?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="AdminCategoriesSetStaticBlockActionGroup"> + <arguments> + <argument name="block" defaultValue="_defaultBlock"/> + </arguments> + <selectOption selector="{{AdminCategoryContentSection.AddCMSBlock}}" stepKey="selectBlock" userInput="{{block.title}}"/> + </actionGroup> +</actionGroups> \ No newline at end of file diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminOpenCategoriesPageActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminOpenCategoriesPageActionGroup.xml new file mode 100644 index 0000000000000..7f41a0c4eb1a3 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminOpenCategoriesPageActionGroup.xml @@ -0,0 +1,14 @@ +<?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="AdminOpenCategoriesPageActionGroup"> + <amOnPage url="{{AdminCategoryPage.url}}" stepKey="onCategoryIndexPage"/> + <waitForPageLoad stepKey="waitForPageLoad" after="onCategoryIndexPage"/> + </actionGroup> +</actionGroups> \ No newline at end of file diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminSaveCategoryActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminSaveCategoryActionGroup.xml new file mode 100644 index 0000000000000..535a08382aabb --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminSaveCategoryActionGroup.xml @@ -0,0 +1,15 @@ +<?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="AdminSaveCategoryActionGroup"> + <click selector="{{AdminCategoryMainActionsSection.SaveButton}}" stepKey="saveCategoryWithProducts"/> + <waitForPageLoad stepKey="waitForCategorySaved"/> + <see userInput="You saved the category." stepKey="seeSuccessMessage"/> + </actionGroup> +</actionGroups> \ No newline at end of file diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AddOutOfStockProductToCompareListTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AddOutOfStockProductToCompareListTest.xml index 777bbcbcf37aa..e42dd8b8ab12e 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AddOutOfStockProductToCompareListTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AddOutOfStockProductToCompareListTest.xml @@ -20,7 +20,7 @@ <group value="Catalog"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <magentoCLI command="config:set {{CatalogInventoryOptionsShowOutOfStockDisable.path}} {{CatalogInventoryOptionsShowOutOfStockDisable.value}}" stepKey="setConfigShowOutOfStockFalse"/> <magentoCLI command="cache:flush" stepKey="flushCache"/> <createData entity="SimpleSubCategory" stepKey="category"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AddToCartCrossSellTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AddToCartCrossSellTest.xml index a7c0575e0cc96..83a05fef83607 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AddToCartCrossSellTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AddToCartCrossSellTest.xml @@ -30,7 +30,7 @@ <requiredEntity createDataKey="category1"/> </createData> - <actionGroup ref="LoginAsAdmin" stepKey="logInAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="logInAsAdmin"/> </before> <after> <actionGroup ref="AdminLogoutActionGroup" stepKey="logoutFromAdmin"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminAddDefaultImageSimpleProductTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminAddDefaultImageSimpleProductTest.xml index ce8ce5ead1153..92f24fe76502d 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminAddDefaultImageSimpleProductTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminAddDefaultImageSimpleProductTest.xml @@ -19,7 +19,7 @@ <group value="Catalog"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> </before> <after> <amOnPage url="{{AdminLogoutPage.url}}" stepKey="amOnLogoutPage"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminAddDefaultImageVirtualProductTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminAddDefaultImageVirtualProductTest.xml index 367827f8c0c28..7cf388914207b 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminAddDefaultImageVirtualProductTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminAddDefaultImageVirtualProductTest.xml @@ -19,7 +19,7 @@ <group value="Catalog"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> </before> <after> <amOnPage url="{{AdminLogoutPage.url}}" stepKey="amOnLogoutPage"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminAddDefaultVideoSimpleProductTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminAddDefaultVideoSimpleProductTest.xml index adf13e4e31435..61d197d34a31d 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminAddDefaultVideoSimpleProductTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminAddDefaultVideoSimpleProductTest.xml @@ -23,7 +23,7 @@ </annotations> <before> <actionGroup ref="EnableAdminAccountSharingActionGroup" stepKey="enableAdminAccountSharing"/> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> </before> <after> <amOnPage url="{{AdminLogoutPage.url}}" stepKey="amOnLogoutPage"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminAddImageForCategoryTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminAddImageForCategoryTest.xml index 690f2440b2f3b..dcb900164eba7 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminAddImageForCategoryTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminAddImageForCategoryTest.xml @@ -19,7 +19,7 @@ <group value="Catalog"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> </before> <after> <actionGroup ref="DeleteCategoryActionGroup" stepKey="DeleteCategory"> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminAddInStockProductToTheCartTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminAddInStockProductToTheCartTest.xml index 9ee5e9138d764..4aa96c91eb299 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminAddInStockProductToTheCartTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminAddInStockProductToTheCartTest.xml @@ -19,7 +19,7 @@ </annotations> <before> <!-- Login as admin --> - <actionGroup ref="LoginAsAdmin" stepKey="login"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="login"/> <!--Create Category--> <createData entity="SimpleSubCategory" stepKey="createCategory"/> <!--Create Simple Product--> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminApplyTierPriceToProductTest/AdminApplyTierPriceToProductTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminApplyTierPriceToProductTest/AdminApplyTierPriceToProductTest.xml index 016d11f8e660a..b2181164070dc 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminApplyTierPriceToProductTest/AdminApplyTierPriceToProductTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminApplyTierPriceToProductTest/AdminApplyTierPriceToProductTest.xml @@ -36,7 +36,7 @@ <actionGroup ref="ResetProductGridToDefaultViewActionGroup" stepKey="resetGridToDefaultKeywordSearch"/> <actionGroup ref="AdminLogoutActionGroup" stepKey="logoutFromAdmin"/> </after> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <!--Case: Group Price--> <actionGroup ref="SearchForProductOnBackendActionGroup" stepKey="searchForSimpleProduct"> <argument name="product" value="$$createSimpleProduct$$"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminApplyTierPriceToProductTest/AdminApplyTierPriceToProductWithPercentageDiscountTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminApplyTierPriceToProductTest/AdminApplyTierPriceToProductWithPercentageDiscountTest.xml index 848fb7d1155f3..fd8c0ba29fdfa 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminApplyTierPriceToProductTest/AdminApplyTierPriceToProductWithPercentageDiscountTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminApplyTierPriceToProductTest/AdminApplyTierPriceToProductWithPercentageDiscountTest.xml @@ -32,7 +32,7 @@ <actionGroup ref="ResetProductGridToDefaultViewActionGroup" stepKey="resetGridToDefaultKeywordSearch"/> <actionGroup ref="AdminLogoutActionGroup" stepKey="logoutFromAdmin"/> </after> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <actionGroup ref="SearchForProductOnBackendActionGroup" stepKey="searchForSimpleProduct"> <argument name="product" value="$$createSimpleProduct$$"/> </actionGroup> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminAssignProductAttributeToAttributeSetTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminAssignProductAttributeToAttributeSetTest.xml index 980760699dc71..e3fa3dada5b22 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminAssignProductAttributeToAttributeSetTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminAssignProductAttributeToAttributeSetTest.xml @@ -28,7 +28,7 @@ <requiredEntity createDataKey="attribute"/> </createData> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> </before> <after> <deleteData createDataKey="attribute" stepKey="deleteAttribute"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCatalogCategoriesNavigateMenuTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCatalogCategoriesNavigateMenuTest.xml index 03331b0d75cc5..72ffcad4a9dfc 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCatalogCategoriesNavigateMenuTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCatalogCategoriesNavigateMenuTest.xml @@ -20,7 +20,7 @@ <group value="mtf_migrated"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="LoginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="LoginAsAdmin"/> </before> <after> <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCatalogProductsNavigateMenuTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCatalogProductsNavigateMenuTest.xml index 23c9513c7ab49..acd662401399e 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCatalogProductsNavigateMenuTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCatalogProductsNavigateMenuTest.xml @@ -20,7 +20,7 @@ <group value="mtf_migrated"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="LoginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="LoginAsAdmin"/> </before> <after> <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminChangeProductAttributeSetTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminChangeProductAttributeSetTest.xml index 2e55d9fbfa4bc..3b8c2cb736721 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminChangeProductAttributeSetTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminChangeProductAttributeSetTest.xml @@ -33,7 +33,7 @@ </createData> <createData entity="CatalogAttributeSet" stepKey="createAttributeSet"/> - <actionGroup ref="LoginAsAdmin" stepKey="login"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="login"/> <amOnPage url="{{AdminProductAttributeSetEditPage.url}}/$$createAttributeSet.attribute_set_id$$/" stepKey="onAttributeSetEdit"/> <actionGroup ref="AssignAttributeToGroupActionGroup" stepKey="assignAttributeToGroup"> <argument name="group" value="Product Details"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCheckConfigurableProductPriceWithDisabledChildProductTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCheckConfigurableProductPriceWithDisabledChildProductTest.xml index 9821acc4b9e5d..39351539d14a6 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCheckConfigurableProductPriceWithDisabledChildProductTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCheckConfigurableProductPriceWithDisabledChildProductTest.xml @@ -19,7 +19,7 @@ </annotations> <before> <!-- Login as Admin --> - <actionGroup ref="LoginAsAdmin" stepKey="loginToAdminPanel"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginToAdminPanel"/> <!-- Create Default Category --> <createData entity="_defaultCategory" stepKey="createCategory"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCheckCustomAttributeValuesAfterProductSaveTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCheckCustomAttributeValuesAfterProductSaveTest.xml index 8eec2ed40c8cb..51d9e26ebd2cb 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCheckCustomAttributeValuesAfterProductSaveTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCheckCustomAttributeValuesAfterProductSaveTest.xml @@ -35,7 +35,7 @@ <createData entity="SimpleProduct2" stepKey="createSimpleProduct"/> <magentoCLI command="indexer:reindex" arguments="catalogsearch_fulltext" stepKey="reindexCatalogSearch"/> <!-- Login to Admin page --> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> </before> <after> <!-- Delete created entities --> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCheckInactiveAndNotIncludeInMenuCategoryAndSubcategoryIsNotVisibleInNavigationTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCheckInactiveAndNotIncludeInMenuCategoryAndSubcategoryIsNotVisibleInNavigationTest.xml index 9b95ef726a617..f076f4fa407b4 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCheckInactiveAndNotIncludeInMenuCategoryAndSubcategoryIsNotVisibleInNavigationTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCheckInactiveAndNotIncludeInMenuCategoryAndSubcategoryIsNotVisibleInNavigationTest.xml @@ -19,7 +19,7 @@ </annotations> <before> <!--Login as admin --> - <actionGroup ref="LoginAsAdmin" stepKey="loginToAdminPanel"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginToAdminPanel"/> <!--Create Parent Inactive and Not Include In Menu Category --> <createData entity="CatInactiveNotInMenu" stepKey="createCategory"/> </before> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCheckInactiveCategoryAndSubcategoryIsNotVisibleInNavigationMenuTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCheckInactiveCategoryAndSubcategoryIsNotVisibleInNavigationMenuTest.xml index 3f180939bc7ea..8a0b1977bf901 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCheckInactiveCategoryAndSubcategoryIsNotVisibleInNavigationMenuTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCheckInactiveCategoryAndSubcategoryIsNotVisibleInNavigationMenuTest.xml @@ -19,7 +19,7 @@ </annotations> <before> <!--Login as Admin --> - <actionGroup ref="LoginAsAdmin" stepKey="loginToAdminPanel"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginToAdminPanel"/> <!--Create Parent Inactive Category --> <createData entity="CatNotActive" stepKey="createCategory"/> </before> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCheckInactiveIncludeInMenuCategoryAndSubcategoryIsNotVisibleInNavigationTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCheckInactiveIncludeInMenuCategoryAndSubcategoryIsNotVisibleInNavigationTest.xml index 3edd82e060e2e..e832f2baf24a2 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCheckInactiveIncludeInMenuCategoryAndSubcategoryIsNotVisibleInNavigationTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCheckInactiveIncludeInMenuCategoryAndSubcategoryIsNotVisibleInNavigationTest.xml @@ -19,7 +19,7 @@ </annotations> <before> <!--Login as Admin --> - <actionGroup ref="LoginAsAdmin" stepKey="loginToAdminPanel"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginToAdminPanel"/> <!--Create inactive Include In Menu Parent Category --> <createData entity="CatNotIncludeInMenu" stepKey="createCategory"/> </before> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCheckMediaRolesForFirstAddedImageViaApiTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCheckMediaRolesForFirstAddedImageViaApiTest.xml index 7d27bfb3a058b..dfde5779637a4 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCheckMediaRolesForFirstAddedImageViaApiTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCheckMediaRolesForFirstAddedImageViaApiTest.xml @@ -25,7 +25,7 @@ </before> <after> <deleteData createDataKey="createSimpleProduct" stepKey="deleteSimpleProduct"/> - <actionGroup ref="logout" stepKey="logout"/> + <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> <!-- Reindex invalidated indices after product attribute has been created/deleted --> <actionGroup ref="CliRunReindexUsingCronJobsActionGroup" stepKey="reindexInvalidatedIndices"/> </after> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCheckNewCategoryLevelAddedViaApiTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCheckNewCategoryLevelAddedViaApiTest.xml index 427ef6551ce9b..e707c15bccdf1 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCheckNewCategoryLevelAddedViaApiTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCheckNewCategoryLevelAddedViaApiTest.xml @@ -26,7 +26,7 @@ </before> <after> <deleteData createDataKey="createCategoryWithChildrenBlank" stepKey="deleteCategoryWithChildrenBlank"/> - <actionGroup ref="logout" stepKey="logout"/> + <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> </after> <actionGroup ref="AssertAdminCategoryLevelByParentCategoryLevelActionGroup" stepKey="assertCategoryLevelByParentCategory"> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCheckOutOfStockProductIsNotVisibleInCategoryTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCheckOutOfStockProductIsNotVisibleInCategoryTest.xml index 9b7ef4077f906..a94610abf0918 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCheckOutOfStockProductIsNotVisibleInCategoryTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCheckOutOfStockProductIsNotVisibleInCategoryTest.xml @@ -19,7 +19,7 @@ </annotations> <before> <!-- Login as admin --> - <actionGroup ref="LoginAsAdmin" stepKey="login"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="login"/> <!--Create Category--> <createData entity="SimpleSubCategory" stepKey="createCategory"/> <!--Create Simple Product--> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCheckOutOfStockProductIsVisibleInCategoryTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCheckOutOfStockProductIsVisibleInCategoryTest.xml index 433289f59f21b..e64707a895fd4 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCheckOutOfStockProductIsVisibleInCategoryTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCheckOutOfStockProductIsVisibleInCategoryTest.xml @@ -21,7 +21,7 @@ <!--Set Display out of stock product--> <magentoCLI stepKey="setDisplayOutOfStockProduct" command="config:set cataloginventory/options/show_out_of_stock 1" /> <!-- Login as admin --> - <actionGroup ref="LoginAsAdmin" stepKey="login"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="login"/> <!--Create Category--> <createData entity="SimpleSubCategory" stepKey="createCategory"/> <!--Create Simple Product--> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCheckPaginationInStorefrontTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCheckPaginationInStorefrontTest.xml index c1f310575de2f..278a1fdc7ad9c 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCheckPaginationInStorefrontTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCheckPaginationInStorefrontTest.xml @@ -51,7 +51,7 @@ <createData entity="PaginationProduct" stepKey="simpleProduct28"/> <createData entity="PaginationProduct" stepKey="simpleProduct29"/> <createData entity="PaginationProduct" stepKey="simpleProduct30"/> - <actionGroup ref="LoginAsAdmin" stepKey="loginToAdminPanel"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginToAdminPanel"/> </before> <after> <magentoCLI stepKey="setFlatCatalogCategory" command="config:set catalog/frontend/flat_catalog_category 0" /> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCheckProductListPriceAttributesTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCheckProductListPriceAttributesTest.xml index f2d6d9442fb18..c389d447feeba 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCheckProductListPriceAttributesTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCheckProductListPriceAttributesTest.xml @@ -31,7 +31,7 @@ <actionGroup ref="ResetAdminProductGridColumnsActionGroup" stepKey="resetAdminProductGridColumns"/> <deleteData createDataKey="createSimpleProduct" stepKey="deleteSimpleProduct"/> - <actionGroup ref="logout" stepKey="logout"/> + <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> <!-- Reindex invalidated indices after product attribute has been created/deleted --> <actionGroup ref="CliRunReindexUsingCronJobsActionGroup" stepKey="reindexInvalidatedIndices"/> </after> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCheckSubCategoryIsNotVisibleInNavigationMenuTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCheckSubCategoryIsNotVisibleInNavigationMenuTest.xml index 4ea294e3a3f36..ff1e65bca9acc 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCheckSubCategoryIsNotVisibleInNavigationMenuTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCheckSubCategoryIsNotVisibleInNavigationMenuTest.xml @@ -19,7 +19,7 @@ </annotations> <before> <!--Login as Admin --> - <actionGroup ref="LoginAsAdmin" stepKey="loginToAdminPanel"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginToAdminPanel"/> <!--Create Parent Category --> <createData entity="_defaultCategory" stepKey="createCategory"/> </before> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCloneProductWithDuplicateUrlTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCloneProductWithDuplicateUrlTest.xml index 86ab49d6f69c1..d3140dba85752 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCloneProductWithDuplicateUrlTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCloneProductWithDuplicateUrlTest.xml @@ -20,7 +20,7 @@ <group value="catalog"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <!--Create category and product--> <comment userInput="Create category and product" stepKey="commentCreateCategoryAndProduct"/> <createData entity="SimpleProduct2" stepKey="createSimpleProduct"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminConfigureProductImagePlaceholderTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminConfigureProductImagePlaceholderTest.xml index b5ab36729c7fe..a4414901517b9 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminConfigureProductImagePlaceholderTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminConfigureProductImagePlaceholderTest.xml @@ -63,7 +63,7 @@ <deleteData createDataKey="productWithImages" stepKey="deleteProductWithImages"/> </after> - <actionGroup ref="LoginAsAdmin" stepKey="loginToAdminArea"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginToAdminArea"/> <!--Admin area: configure Product Image Placeholders--> <comment userInput="Configure product image placeholders in store config" stepKey="configurePlaceholderComment"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateAndEditSimpleProductSettingsTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateAndEditSimpleProductSettingsTest.xml index 9cb709a8c7e62..0525e7543accb 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateAndEditSimpleProductSettingsTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateAndEditSimpleProductSettingsTest.xml @@ -20,7 +20,7 @@ </annotations> <before> <!-- Login as admin --> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <!-- Create related products --> <createData entity="SimpleProduct2" stepKey="createFirstRelatedProduct"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateAndEditVirtualProductSettingsTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateAndEditVirtualProductSettingsTest.xml index 43fce1cfdd329..ce3dd8fa0873c 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateAndEditVirtualProductSettingsTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateAndEditVirtualProductSettingsTest.xml @@ -29,7 +29,7 @@ <createData entity="secondCustomWebsite" stepKey="createWebsite"/> <!-- Login as admin --> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> </before> <after> <!-- Delete created virtual product --> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateAndSwitchProductType/AdminCreateSimpleProductSwitchToVirtualTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateAndSwitchProductType/AdminCreateSimpleProductSwitchToVirtualTest.xml index fde018ddc181a..65e67020e4532 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateAndSwitchProductType/AdminCreateSimpleProductSwitchToVirtualTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateAndSwitchProductType/AdminCreateSimpleProductSwitchToVirtualTest.xml @@ -31,7 +31,7 @@ <deleteData createDataKey="createPreReqCategory" stepKey="deletePreReqCategory"/> </after> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin1"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin1"/> <!-- Open Dropdown and select simple product option --> <comment stepKey="beforeOpenProductFillForm" userInput="Selecting Product from the Add Product Dropdown"/> <actionGroup ref="GoToSpecifiedCreateProductPageActionGroup" stepKey="openProductFillForm"> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateAttributeSetEntityTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateAttributeSetEntityTest.xml index aba7bf6073117..04d032511ded0 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateAttributeSetEntityTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateAttributeSetEntityTest.xml @@ -19,7 +19,7 @@ <group value="mtf_migrated"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <createData entity="productAttributeWysiwyg" stepKey="createProductAttribute"/> <createData entity="CatalogAttributeSet" stepKey="createAttributeSet"/> </before> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateCategoryFromProductPageTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateCategoryFromProductPageTest.xml index ef21b53c7613b..b94c12d1d7a39 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateCategoryFromProductPageTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateCategoryFromProductPageTest.xml @@ -21,7 +21,7 @@ <before> <!-- Login as admin --> <createData entity="SimpleTwo" stepKey="simpleProduct"/> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> </before> <after> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateCategoryTest/AdminCategoryFormDisplaySettingsUIValidationTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateCategoryTest/AdminCategoryFormDisplaySettingsUIValidationTest.xml index a4fe694ea65a7..e0fa4a3c3410c 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateCategoryTest/AdminCategoryFormDisplaySettingsUIValidationTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateCategoryTest/AdminCategoryFormDisplaySettingsUIValidationTest.xml @@ -18,7 +18,7 @@ <group value="category"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> </before> <after> <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateCategoryTest/AdminConfigDefaultCategoryLayoutFromConfigurationSettingTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateCategoryTest/AdminConfigDefaultCategoryLayoutFromConfigurationSettingTest.xml index e6a2030e37d86..e8b13afc7138e 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateCategoryTest/AdminConfigDefaultCategoryLayoutFromConfigurationSettingTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateCategoryTest/AdminConfigDefaultCategoryLayoutFromConfigurationSettingTest.xml @@ -18,7 +18,7 @@ <group value="category"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> </before> <after> <actionGroup ref="RestoreLayoutSetting" stepKey="sampleActionGroup"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateCategoryTest/AdminCreateCategoryTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateCategoryTest/AdminCreateCategoryTest.xml index b6d1d4b81fffb..8ad76bdde7306 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateCategoryTest/AdminCreateCategoryTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateCategoryTest/AdminCreateCategoryTest.xml @@ -21,7 +21,7 @@ <actionGroup ref="AdminLogoutActionGroup" stepKey="adminLogout"/> </after> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin1"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin1"/> <amOnPage url="{{AdminCategoryPage.url}}" stepKey="navigateToCategoryPage"/> <waitForPageLoad time="30" stepKey="waitForPageLoad1"/> <click selector="{{AdminCategorySidebarActionSection.AddSubcategoryButton}}" stepKey="clickOnAddSubCategory"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateCategoryWithAnchorFieldTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateCategoryWithAnchorFieldTest.xml index 8900e85ca3431..7deb79c66ff6d 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateCategoryWithAnchorFieldTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateCategoryWithAnchorFieldTest.xml @@ -18,7 +18,7 @@ <group value="mtf_migrated"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="loginToAdminPanel"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginToAdminPanel"/> <createData entity="_defaultBlock" stepKey="createDefaultCMSBlock"/> <createData entity="defaultSimpleProduct" stepKey="simpleProduct" /> </before> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateCategoryWithCustomRootCategoryTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateCategoryWithCustomRootCategoryTest.xml index ac237fbe49978..71167882d135d 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateCategoryWithCustomRootCategoryTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateCategoryWithCustomRootCategoryTest.xml @@ -18,7 +18,7 @@ <group value="Catalog"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="loginToAdminPanel"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginToAdminPanel"/> </before> <after> <amOnPage url="{{AdminSystemStorePage.url}}" stepKey="navigateToStoresIndex"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateCategoryWithFiveNestingTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateCategoryWithFiveNestingTest.xml index bc60f21b5d214..c1df630685949 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateCategoryWithFiveNestingTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateCategoryWithFiveNestingTest.xml @@ -19,7 +19,7 @@ <group value="mtf_migrated"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="loginToAdminPanel"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginToAdminPanel"/> </before> <after> <amOnPage url="{{AdminCategoryPage.url}}" stepKey="goToCategoryPage"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateCategoryWithInactiveCategoryTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateCategoryWithInactiveCategoryTest.xml index ca2b15658f02e..34714db67fbd6 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateCategoryWithInactiveCategoryTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateCategoryWithInactiveCategoryTest.xml @@ -18,7 +18,7 @@ <group value="mtf_migrated"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="loginToAdminPanel"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginToAdminPanel"/> </before> <after> <actionGroup ref="DeleteCategoryActionGroup" stepKey="deleteCategory"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateCategoryWithInactiveIncludeInMenuTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateCategoryWithInactiveIncludeInMenuTest.xml index f6b0a0a321c5d..a11717c04ea8c 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateCategoryWithInactiveIncludeInMenuTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateCategoryWithInactiveIncludeInMenuTest.xml @@ -18,7 +18,7 @@ <group value="mtf_migrated"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="loginToAdminPanel"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginToAdminPanel"/> </before> <after> <actionGroup ref="DeleteCategoryActionGroup" stepKey="deleteCategory"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateCategoryWithNoAnchorFieldTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateCategoryWithNoAnchorFieldTest.xml index 5342dec6b1ebb..ec3c7a26723c2 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateCategoryWithNoAnchorFieldTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateCategoryWithNoAnchorFieldTest.xml @@ -18,7 +18,7 @@ <group value="mtf_migrated"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="loginToAdminPanel"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginToAdminPanel"/> <createData entity="_defaultBlock" stepKey="createDefaultCMSBlock"/> <createData entity="defaultSimpleProduct" stepKey="simpleProduct" /> </before> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateCategoryWithProductsGridFilterTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateCategoryWithProductsGridFilterTest.xml index 9a580df52259b..99d0f88cf0e9a 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateCategoryWithProductsGridFilterTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateCategoryWithProductsGridFilterTest.xml @@ -18,7 +18,7 @@ <group value="Catalog"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="loginToAdminPanel"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginToAdminPanel"/> </before> <after> <actionGroup ref="DeleteCategoryActionGroup" stepKey="deleteCategory"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateCategoryWithRequiredFieldsTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateCategoryWithRequiredFieldsTest.xml index 110f52aaeb40a..871dd606c14db 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateCategoryWithRequiredFieldsTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateCategoryWithRequiredFieldsTest.xml @@ -18,7 +18,7 @@ <group value="mtf_migrated"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="loginToAdminPanel"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginToAdminPanel"/> </before> <after> <actionGroup ref="DeleteCategoryActionGroup" stepKey="deleteCategory"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateCustomProductAttributeWithDropdownFieldTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateCustomProductAttributeWithDropdownFieldTest.xml index 06d7d1081d058..7b2c67b205ea8 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateCustomProductAttributeWithDropdownFieldTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateCustomProductAttributeWithDropdownFieldTest.xml @@ -23,7 +23,7 @@ <before> <!-- Login as admin --> - <actionGroup ref="LoginAsAdmin" stepKey="login"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="login"/> <!--Create Category--> <createData entity="SimpleSubCategory" stepKey="createCategory"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateDatetimeProductAttributeTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateDatetimeProductAttributeTest.xml index e32aad76c9b28..37dc7de910917 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateDatetimeProductAttributeTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateDatetimeProductAttributeTest.xml @@ -17,7 +17,7 @@ <group value="catalog"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="login"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="login"/> </before> <after> <actionGroup ref="DeleteProductAttributeActionGroup" stepKey="deleteAttribute"> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateDropdownProductAttributeTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateDropdownProductAttributeTest.xml index 348c973b4de82..88b1c874caadc 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateDropdownProductAttributeTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateDropdownProductAttributeTest.xml @@ -17,7 +17,7 @@ <group value="Catalog"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="login"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="login"/> </before> <after> <!-- Remove attribute --> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateDropdownProductAttributeVisibleInStorefrontAdvancedSearchFormTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateDropdownProductAttributeVisibleInStorefrontAdvancedSearchFormTest.xml index 4d2250d650da2..fef69edde23e8 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateDropdownProductAttributeVisibleInStorefrontAdvancedSearchFormTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateDropdownProductAttributeVisibleInStorefrontAdvancedSearchFormTest.xml @@ -31,7 +31,7 @@ <!-- Create product attribute set --> <createData entity="CatalogAttributeSet" stepKey="createAttributeSet"/> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> </before> <after> <deleteData createDataKey="attribute" stepKey="deleteProductAttribute"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateDuplicateCategoryTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateDuplicateCategoryTest.xml index 4c91c6bac0e1a..a34712397e830 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateDuplicateCategoryTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateDuplicateCategoryTest.xml @@ -18,7 +18,7 @@ </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="loginToAdminPanel"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginToAdminPanel"/> <createData entity="SimpleSubCategory" stepKey="category"/> </before> <after> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateDuplicateProductTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateDuplicateProductTest.xml index c6703a1109345..cc76304bc5ebc 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateDuplicateProductTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateDuplicateProductTest.xml @@ -23,7 +23,7 @@ <requiredEntity createDataKey="category"/> </createData> <magentoCLI command="config:set catalog/seo/generate_category_product_rewrites 1" stepKey="enableGenerateUrlRewrite"/> - <actionGroup ref="LoginAsAdmin" stepKey="login"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="login"/> </before> <after> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateInactiveFlatCategoryAndUpdateAsInactiveTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateInactiveFlatCategoryAndUpdateAsInactiveTest.xml index bff43cf65faf6..c3b86c99bbd67 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateInactiveFlatCategoryAndUpdateAsInactiveTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateInactiveFlatCategoryAndUpdateAsInactiveTest.xml @@ -19,7 +19,7 @@ </annotations> <before> <!--Login as admin --> - <actionGroup ref="LoginAsAdmin" stepKey="loginToAdminPanel"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginToAdminPanel"/> <!--Create category--> <createData entity="CatNotActive" stepKey="createCategory"/> <!-- Create First StoreView --> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateInactiveFlatCategoryTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateInactiveFlatCategoryTest.xml index 9ef3659cb5ab1..affdbaf7b0eb7 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateInactiveFlatCategoryTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateInactiveFlatCategoryTest.xml @@ -19,7 +19,7 @@ </annotations> <before> <!--Login as admin --> - <actionGroup ref="LoginAsAdmin" stepKey="loginToAdminPanel"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginToAdminPanel"/> <!--Create category--> <createData entity="SimpleSubCategory" stepKey="createCategory"/> <!-- Create First StoreView --> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateInactiveInMenuFlatCategoryTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateInactiveInMenuFlatCategoryTest.xml index 4623f9ad4005b..10e4d9f434be0 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateInactiveInMenuFlatCategoryTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateInactiveInMenuFlatCategoryTest.xml @@ -19,7 +19,7 @@ </annotations> <before> <!--Login as admin --> - <actionGroup ref="LoginAsAdmin" stepKey="loginToAdminPanel"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginToAdminPanel"/> <!--Create category--> <createData entity="SimpleSubCategory" stepKey="category"/> <!-- Create First StoreView --> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateMultipleSelectProductAttributeVisibleInStorefrontAdvancedSearchFormTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateMultipleSelectProductAttributeVisibleInStorefrontAdvancedSearchFormTest.xml index b5b5fa3b12dc7..caacfde89d1cb 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateMultipleSelectProductAttributeVisibleInStorefrontAdvancedSearchFormTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateMultipleSelectProductAttributeVisibleInStorefrontAdvancedSearchFormTest.xml @@ -31,7 +31,7 @@ <!-- Create product attribute set --> <createData entity="CatalogAttributeSet" stepKey="createAttributeSet"/> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> </before> <after> <!-- Delete product attribute --> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateNewAttributeFromProductPageTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateNewAttributeFromProductPageTest.xml index 4ffb81d9a1d67..e99643deed11d 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateNewAttributeFromProductPageTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateNewAttributeFromProductPageTest.xml @@ -20,7 +20,7 @@ <group value="Catalog"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> </before> <after> <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateNewAttributeFromProductTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateNewAttributeFromProductTest.xml index 18fbcadf985c3..7c8ce1455fc37 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateNewAttributeFromProductTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateNewAttributeFromProductTest.xml @@ -20,7 +20,7 @@ <group value="Catalog"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="login"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="login"/> <!--Create product--> <createData entity="SimpleProduct2" stepKey="createProduct"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateNewGroupForAttributeSetTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateNewGroupForAttributeSetTest.xml index 6cd4ce6ac47c4..573fc1f83a5a8 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateNewGroupForAttributeSetTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateNewGroupForAttributeSetTest.xml @@ -23,7 +23,7 @@ <createData entity="productAttributeWithTwoOptions" stepKey="createConfigProductAttribute"/> <!-- Login to Admin --> - <actionGroup ref="LoginAsAdmin" stepKey="LoginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="LoginAsAdmin"/> </before> <after> <deleteData createDataKey="createConfigProductAttribute" stepKey="deleteConfigProductAttribute"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateProductAttributeFromProductPageTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateProductAttributeFromProductPageTest.xml index ae4720e19118d..7fdab11d0a050 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateProductAttributeFromProductPageTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateProductAttributeFromProductPageTest.xml @@ -20,7 +20,7 @@ <before> <!-- Login as admin --> - <actionGroup ref="LoginAsAdmin" stepKey="login"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="login"/> <!--Create Category--> <createData entity="SimpleSubCategory" stepKey="createCategory"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateProductAttributeRequiredTextFieldTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateProductAttributeRequiredTextFieldTest.xml index a75cb093ec8ee..274a560d343d8 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateProductAttributeRequiredTextFieldTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateProductAttributeRequiredTextFieldTest.xml @@ -20,7 +20,7 @@ <before> <!-- Login as admin --> - <actionGroup ref="LoginAsAdmin" stepKey="login"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="login"/> <!--Create Category--> <createData entity="SimpleSubCategory" stepKey="createCategory"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateProductCustomAttributeSetTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateProductCustomAttributeSetTest.xml index 2fbd1ac2cf321..d2278f3ddae1d 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateProductCustomAttributeSetTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateProductCustomAttributeSetTest.xml @@ -20,7 +20,7 @@ </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> </before> <after> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateProductDuplicateUrlkeyTest/AdminCreateProductDuplicateProductTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateProductDuplicateUrlkeyTest/AdminCreateProductDuplicateProductTest.xml index 3fb3db231c29c..91ea74f1089ca 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateProductDuplicateUrlkeyTest/AdminCreateProductDuplicateProductTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateProductDuplicateUrlkeyTest/AdminCreateProductDuplicateProductTest.xml @@ -31,7 +31,7 @@ <deleteData createDataKey="createCategory" stepKey="deletePreReqCatalog"/> <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> </after> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <actionGroup ref="SearchForProductOnBackendActionGroup" stepKey="searchForSimpleProduct1"> <argument name="product" value="$$createSimpleProduct$$"/> </actionGroup> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateProductDuplicateUrlkeyTest/AdminCreateProductDuplicateUrlkeyTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateProductDuplicateUrlkeyTest/AdminCreateProductDuplicateUrlkeyTest.xml index 2ccec016b8e15..c461aa8bfcf18 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateProductDuplicateUrlkeyTest/AdminCreateProductDuplicateUrlkeyTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateProductDuplicateUrlkeyTest/AdminCreateProductDuplicateUrlkeyTest.xml @@ -26,7 +26,7 @@ <deleteData createDataKey="simpleProduct" stepKey="deleteProduct"/> </after> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="navigateToProductIndex"/> <click selector="{{AdminProductGridActionSection.addProductToggle}}" stepKey="clickAddProductDropdown"/> <click selector="{{AdminProductGridActionSection.addSimpleProduct}}" stepKey="clickAddSimpleProduct"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateRootCategoryAndSubcategoriesTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateRootCategoryAndSubcategoriesTest.xml index 2352e231e66a4..9a0ff1d02c153 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateRootCategoryAndSubcategoriesTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateRootCategoryAndSubcategoriesTest.xml @@ -20,7 +20,7 @@ </annotations> <!--Delete all created data during the test execution and assign Default Root Category to Store--> <after> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin2"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin2"/> <amOnPage url="{{AdminSystemStorePage.url}}" stepKey="amOnPageAdminSystemStore"/> <waitForPageLoad stepKey="waitForPageAdminSystemStoreLoad" /> <click selector="{{AdminStoresGridSection.resetButton}}" stepKey="clickOnResetButton"/> @@ -38,7 +38,7 @@ </actionGroup> <actionGroup ref="AdminLogoutActionGroup" stepKey="logout2"/> </after> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin1"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin1"/> <amOnPage url="{{AdminCategoryPage.url}}" stepKey="amOnAdminCategoryPage"/> <scrollToTopOfPage stepKey="scrollToTopOfPage1"/> <waitForPageLoad stepKey="waitForPageLoad1"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateSimpleProductNotVisibleIndividuallyTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateSimpleProductNotVisibleIndividuallyTest.xml index 4188fc628064a..12cd5454ea8e2 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateSimpleProductNotVisibleIndividuallyTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateSimpleProductNotVisibleIndividuallyTest.xml @@ -19,7 +19,7 @@ <group value="mtf_migrated"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="loginToAdminPanel"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginToAdminPanel"/> <createData entity="_defaultCategory" stepKey="createPreReqCategory"/> </before> <after> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateSimpleProductTest/AdminConfigDefaultProductLayoutFromConfigurationSettingTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateSimpleProductTest/AdminConfigDefaultProductLayoutFromConfigurationSettingTest.xml index f1bb67bf66784..7317f2f7214f0 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateSimpleProductTest/AdminConfigDefaultProductLayoutFromConfigurationSettingTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateSimpleProductTest/AdminConfigDefaultProductLayoutFromConfigurationSettingTest.xml @@ -18,7 +18,7 @@ <group value="product"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> </before> <after> <actionGroup ref="RestoreLayoutSetting" stepKey="sampleActionGroup"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateSimpleProductTest/AdminCreateSimpleProductNegativePriceTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateSimpleProductTest/AdminCreateSimpleProductNegativePriceTest.xml index c3b74eb128ef6..a8cc66243d73e 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateSimpleProductTest/AdminCreateSimpleProductNegativePriceTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateSimpleProductTest/AdminCreateSimpleProductNegativePriceTest.xml @@ -17,7 +17,7 @@ <testCaseId value="MAGETWO-89912"/> <group value="product"/> </annotations> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <amOnPage url="{{AdminProductCreatePage.url(SimpleProduct.visibility, SimpleProduct.type_id)}}" stepKey="goToCreateProduct"/> <waitForPageLoad stepKey="wait1"/> <fillField selector="{{AdminProductFormSection.productName}}" userInput="{{SimpleProduct.name}}" stepKey="fillName"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateSimpleProductTest/AdminCreateSimpleProductTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateSimpleProductTest/AdminCreateSimpleProductTest.xml index 1a95824014deb..3e5ccfd8bf3b9 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateSimpleProductTest/AdminCreateSimpleProductTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateSimpleProductTest/AdminCreateSimpleProductTest.xml @@ -24,7 +24,7 @@ <deleteData createDataKey="createPreReqCategory" stepKey="deletePreReqCategory"/> </after> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin1"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin1"/> <actionGroup ref="FillAdminSimpleProductFormActionGroup" stepKey="fillProductFieldsInAdmin"> <argument name="category" value="$$createPreReqCategory$$"/> <argument name="simpleProduct" value="_defaultProduct"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateSimpleProductTest/AdminCreateSimpleProductZeroPriceTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateSimpleProductTest/AdminCreateSimpleProductZeroPriceTest.xml index a0e51faf0897f..f4878f2948e9d 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateSimpleProductTest/AdminCreateSimpleProductZeroPriceTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateSimpleProductTest/AdminCreateSimpleProductZeroPriceTest.xml @@ -17,7 +17,7 @@ <testCaseId value="MAGETWO-89910"/> <group value="product"/> </annotations> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <amOnPage url="{{AdminProductCreatePage.url(SimpleProduct.visibility, SimpleProduct.type_id)}}" stepKey="goToCreateProduct"/> <waitForPageLoad stepKey="wait1"/> <fillField selector="{{AdminProductFormSection.productName}}" userInput="{{SimpleProduct.name}}" stepKey="fillName"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateSimpleProductWithCountryOfManufactureAttributeSKUMaskTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateSimpleProductWithCountryOfManufactureAttributeSKUMaskTest.xml index 967babc617ce9..c378ca5b2c27a 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateSimpleProductWithCountryOfManufactureAttributeSKUMaskTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateSimpleProductWithCountryOfManufactureAttributeSKUMaskTest.xml @@ -21,7 +21,7 @@ <before> <magentoCLI stepKey="setCountryOfManufacture" command="config:set catalog/fields_masks/sku" arguments="{{name}}-{{country_of_manufacture}}"/> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> </before> <after> <magentoCLI stepKey="setName" command="config:set catalog/fields_masks/sku" arguments="{{name}}"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateSimpleProductWithUnicodeTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateSimpleProductWithUnicodeTest.xml index 9660a46d43dba..8de84867241a8 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateSimpleProductWithUnicodeTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateSimpleProductWithUnicodeTest.xml @@ -26,7 +26,7 @@ <deleteData createDataKey="createPreReqCategory" stepKey="deletePreReqCategory"/> </after> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin1"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin1"/> <actionGroup ref="FillAdminSimpleProductFormActionGroup" stepKey="fillProductFieldsInAdmin"> <argument name="category" value="$$createPreReqCategory$$"/> <argument name="simpleProduct" value="ProductWithUnicode"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateTextEditorProductAttributeTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateTextEditorProductAttributeTest.xml index bad620b3dab99..fd6db45b1716b 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateTextEditorProductAttributeTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateTextEditorProductAttributeTest.xml @@ -26,7 +26,7 @@ <magentoCLI command="config:set {{EnableTinyMCE4.path}} {{EnableTinyMCE4.value}}" stepKey="enableTinyMCE4"/> <!-- Login as admin --> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> </before> <after> <!-- Delete attribute --> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateVirtualProductFillingRequiredFieldsOnlyTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateVirtualProductFillingRequiredFieldsOnlyTest.xml index 6d39455e4a31b..9d3a47cd115aa 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateVirtualProductFillingRequiredFieldsOnlyTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateVirtualProductFillingRequiredFieldsOnlyTest.xml @@ -19,7 +19,7 @@ <group value="mtf_migrated"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> </before> <after> <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateVirtualProductOutOfStockWithTierPriceTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateVirtualProductOutOfStockWithTierPriceTest.xml index df46983b361c6..842f93b49c14a 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateVirtualProductOutOfStockWithTierPriceTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateVirtualProductOutOfStockWithTierPriceTest.xml @@ -20,7 +20,7 @@ </annotations> <before> <createData entity="SimpleSubCategory" stepKey="categoryEntity"/> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> </before> <after> <deleteData stepKey="deleteSimpleSubCategory" createDataKey="categoryEntity"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateVirtualProductWithCustomOptionsSuiteAndImportOptionsTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateVirtualProductWithCustomOptionsSuiteAndImportOptionsTest.xml index 899f3af02c78e..8bb3391b5240b 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateVirtualProductWithCustomOptionsSuiteAndImportOptionsTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateVirtualProductWithCustomOptionsSuiteAndImportOptionsTest.xml @@ -20,7 +20,7 @@ </annotations> <before> <createData entity="SimpleSubCategory" stepKey="categoryEntity"/> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> </before> <after> <deleteData stepKey="deleteSimpleSubCategory" createDataKey="categoryEntity"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateVirtualProductWithTierPriceForGeneralGroupTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateVirtualProductWithTierPriceForGeneralGroupTest.xml index 84cba791c6629..9305e9ed3fd49 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateVirtualProductWithTierPriceForGeneralGroupTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateVirtualProductWithTierPriceForGeneralGroupTest.xml @@ -22,7 +22,7 @@ <before> <createData entity="SimpleSubCategory" stepKey="categoryEntity"/> <createData entity="Simple_US_CA_Customer" stepKey="customer" /> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> </before> <after> <deleteData createDataKey="categoryEntity" stepKey="deleteSimpleSubCategory"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateVirtualProductWithTierPriceTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateVirtualProductWithTierPriceTest.xml index ea73de1cab15d..d8eaed92de4cf 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateVirtualProductWithTierPriceTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateVirtualProductWithTierPriceTest.xml @@ -19,7 +19,7 @@ <group value="mtf_migrated"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <createData entity="SimpleSubCategory" stepKey="categoryEntity"/> </before> <after> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateVirtualProductWithoutManageStockTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateVirtualProductWithoutManageStockTest.xml index 685db6db90a10..3b5a8d8e753da 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateVirtualProductWithoutManageStockTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateVirtualProductWithoutManageStockTest.xml @@ -19,7 +19,7 @@ <group value="mtf_migrated"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <createData entity="SimpleSubCategory" stepKey="categoryEntity"/> </before> <after> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminDeleteAttributeSetTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminDeleteAttributeSetTest.xml index bb4ff7acaa4a7..3dfeea2c33af0 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminDeleteAttributeSetTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminDeleteAttributeSetTest.xml @@ -18,7 +18,7 @@ <group value="mtf_migrated"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <createData entity="_defaultCategory" stepKey="createCategory"/> <createData entity="CatalogAttributeSet" stepKey="createAttributeSet"/> <createData entity="SimpleProductWithCustomAttributeSet" stepKey="SimpleProductWithCustomAttributeSet"> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminDeleteConfigurableChildProductsTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminDeleteConfigurableChildProductsTest.xml index 069789738d11f..7748d4bf4db6f 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminDeleteConfigurableChildProductsTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminDeleteConfigurableChildProductsTest.xml @@ -21,7 +21,7 @@ <!--Set Display Out Of Stock Product --> <magentoCLI stepKey="setDisplayOutOfStockProduct" command="config:set cataloginventory/options/show_out_of_stock 0 "/> <!--Login as Admin --> - <actionGroup ref="LoginAsAdmin" stepKey="loginToAdminPanel"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginToAdminPanel"/> <!--Create Default Category --> <createData entity="_defaultCategory" stepKey="createCategory"/> <!-- Create an attribute with two options to be used in the first child product --> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminDeleteDropdownProductAttributeFromAttributeSetTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminDeleteDropdownProductAttributeFromAttributeSetTest.xml index 9d52399f15a96..841b08e70fb4f 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminDeleteDropdownProductAttributeFromAttributeSetTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminDeleteDropdownProductAttributeFromAttributeSetTest.xml @@ -19,7 +19,7 @@ </annotations> <before> <!-- Login as admin --> - <actionGroup ref="LoginAsAdmin" stepKey="login"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="login"/> <!-- Create Dropdown Product Attribute --> <createData entity="productDropDownAttribute" stepKey="attribute"/> <!-- Create Attribute set --> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminDeleteProductAttributeTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminDeleteProductAttributeTest.xml index 20d2a924954cb..c0cbb44ebc681 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminDeleteProductAttributeTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminDeleteProductAttributeTest.xml @@ -18,7 +18,7 @@ <group value="mtf_migrated"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <createData entity="productAttributeWysiwyg" stepKey="createProductAttribute"/> </before> <after> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminDeleteProductWithCustomOptionTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminDeleteProductWithCustomOptionTest.xml index 834da3f4d4f9b..22e1d7d7c5d9e 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminDeleteProductWithCustomOptionTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminDeleteProductWithCustomOptionTest.xml @@ -19,7 +19,7 @@ <group value="mtf_migrated"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <createData entity="_defaultCategory" stepKey="createCategory"/> <createData entity="_defaultProduct" stepKey="createSimpleProduct"> <requiredEntity createDataKey="createCategory"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminDeleteProductsImageInCaseOfMultipleStoresTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminDeleteProductsImageInCaseOfMultipleStoresTest.xml index 386077396e4a7..0b857c6d3bbaf 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminDeleteProductsImageInCaseOfMultipleStoresTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminDeleteProductsImageInCaseOfMultipleStoresTest.xml @@ -21,7 +21,7 @@ </annotations> <before> <!--Login as admin--> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <!--Create new website, store and store view--> <actionGroup ref="AdminCreateWebsiteActionGroup" stepKey="createWebsite"> <argument name="newWebsiteName" value="{{NewWebSiteData.name}}"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminDeleteRootCategoryAssignedToStoreTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminDeleteRootCategoryAssignedToStoreTest.xml index 77ebf77f05e58..0396ab743c745 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminDeleteRootCategoryAssignedToStoreTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminDeleteRootCategoryAssignedToStoreTest.xml @@ -18,7 +18,7 @@ <group value="mtf_migrated"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="loginToAdminPanel"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginToAdminPanel"/> <createData entity="NewRootCategory" stepKey="rootCategory" /> </before> <after> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminDeleteRootCategoryTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminDeleteRootCategoryTest.xml index 4974b983beeb9..0a41842d5709c 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminDeleteRootCategoryTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminDeleteRootCategoryTest.xml @@ -18,7 +18,7 @@ <group value="mtf_migrated"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="loginToAdminPanel"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginToAdminPanel"/> <createData entity="NewRootCategory" stepKey="rootCategory" /> </before> <after> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminDeleteRootSubCategoryTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminDeleteRootSubCategoryTest.xml index 48422d9ba2025..6ae00d213bf77 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminDeleteRootSubCategoryTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminDeleteRootSubCategoryTest.xml @@ -18,7 +18,7 @@ <group value="mtf_migrated"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="loginToAdminPanel"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginToAdminPanel"/> <createData entity="NewRootCategory" stepKey="rootCategory" /> <createData entity="SimpleRootSubCategory" stepKey="category"> <requiredEntity createDataKey="rootCategory"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminDeleteSimpleProductTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminDeleteSimpleProductTest.xml index b5d7f413730aa..390002f5d9498 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminDeleteSimpleProductTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminDeleteSimpleProductTest.xml @@ -19,7 +19,7 @@ <group value="mtf_migrated"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <createData entity="_defaultCategory" stepKey="createCategory"/> <createData entity="_defaultProduct" stepKey="createSimpleProduct"> <requiredEntity createDataKey="createCategory"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminDeleteSystemProductAttributeTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminDeleteSystemProductAttributeTest.xml index be54262987b05..22c6bf061f274 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminDeleteSystemProductAttributeTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminDeleteSystemProductAttributeTest.xml @@ -18,7 +18,7 @@ <group value="mtf_migrated"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> </before> <after> <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminDeleteTextFieldProductAttributeFromAttributeSetTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminDeleteTextFieldProductAttributeFromAttributeSetTest.xml index 3d6eca36ec06d..36001bd0b570a 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminDeleteTextFieldProductAttributeFromAttributeSetTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminDeleteTextFieldProductAttributeFromAttributeSetTest.xml @@ -19,7 +19,7 @@ </annotations> <before> <!-- Login as admin --> - <actionGroup ref="LoginAsAdmin" stepKey="login"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="login"/> <!-- Create Product Attribute and assign to Default Product Attribute Set --> <createData entity="newProductAttribute" stepKey="attribute"/> <createData entity="AddToDefaultSet" stepKey="addToDefaultAttributeSet"> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminDeleteVirtualProductTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminDeleteVirtualProductTest.xml index 642fb1c1f7ba0..f49e1142315eb 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminDeleteVirtualProductTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminDeleteVirtualProductTest.xml @@ -19,7 +19,7 @@ <group value="mtf_migrated"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <createData entity="_defaultCategory" stepKey="createCategory"/> <createData entity="defaultVirtualProduct" stepKey="createVirtualProduct"> <requiredEntity createDataKey="createCategory"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminDisableProductOnChangingAttributeSetTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminDisableProductOnChangingAttributeSetTest.xml index 8ce478ff48469..f2a7ffcce0eb0 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminDisableProductOnChangingAttributeSetTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminDisableProductOnChangingAttributeSetTest.xml @@ -31,7 +31,7 @@ <actionGroup ref="ClearProductsFilterActionGroup" stepKey="clearProductsFilter"/> <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> </after> - <actionGroup ref="LoginAsAdmin" stepKey="login"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="login"/> <amOnPage url="{{AdminProductAttributeSetEditPage.url}}/$$createAttributeSet.attribute_set_id$$/" stepKey="onAttributeSetEdit"/> <actionGroup ref="SaveAttributeSetActionGroup" stepKey="SaveAttributeSet"/> <actionGroup ref="SearchForProductOnBackendActionGroup" stepKey="searchForSimpleProduct"> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminFilterByNameByStoreViewOnProductGridTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminFilterByNameByStoreViewOnProductGridTest.xml index 7f973c99b39a5..843221782ebd9 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminFilterByNameByStoreViewOnProductGridTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminFilterByNameByStoreViewOnProductGridTest.xml @@ -21,7 +21,7 @@ </annotations> <before> <createData entity="SimpleProduct2" stepKey="createSimpleProduct"/> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> </before> <after> <deleteData createDataKey="createSimpleProduct" stepKey="deleteSimpleProduct"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminFilteringCategoryProductsUsingScopeSelectorTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminFilteringCategoryProductsUsingScopeSelectorTest.xml index a0dbb7cea5e16..89b3b2cb6fb41 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminFilteringCategoryProductsUsingScopeSelectorTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminFilteringCategoryProductsUsingScopeSelectorTest.xml @@ -18,7 +18,7 @@ <group value="catalog"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <!--Create website, Store and Store View--> <actionGroup ref="AdminCreateWebsiteActionGroup" stepKey="createSecondWebsite"> <argument name="newWebsiteName" value="{{secondCustomWebsite.name}}"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminGridPageNumberAfterSaveAndCloseActionTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminGridPageNumberAfterSaveAndCloseActionTest.xml index a42fe576751f7..f6b2a74eca0f0 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminGridPageNumberAfterSaveAndCloseActionTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminGridPageNumberAfterSaveAndCloseActionTest.xml @@ -20,7 +20,7 @@ <group value="Catalog"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <!--Clear product grid--> <comment userInput="Clear product grid" stepKey="commentClearProductGrid"/> <amOnPage url="{{ProductCatalogPage.url}}" stepKey="goToProductCatalog"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminImportCustomizableOptionToProductWithSKUTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminImportCustomizableOptionToProductWithSKUTest.xml index cc21740cbc59f..c319116bf075c 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminImportCustomizableOptionToProductWithSKUTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminImportCustomizableOptionToProductWithSKUTest.xml @@ -35,7 +35,7 @@ <magentoCLI command="indexer:reindex" stepKey="reindex"/> <magentoCLI command="cache:flush" stepKey="flushCache"/> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> </before> <after> <!--Delete created data--> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminMassChangeProductsStatusTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminMassChangeProductsStatusTest.xml index 6896b11196cf2..0214f9141b903 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminMassChangeProductsStatusTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminMassChangeProductsStatusTest.xml @@ -20,7 +20,7 @@ <group value="Product Attributes"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <createData entity="_defaultCategory" stepKey="createCategory"/> <createData entity="ApiSimpleProduct" stepKey="createProductOne"> <requiredEntity createDataKey="createCategory"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminMassProductPriceUpdateTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminMassProductPriceUpdateTest.xml index f803050b7a59b..e8e0d449aee4e 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminMassProductPriceUpdateTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminMassProductPriceUpdateTest.xml @@ -19,7 +19,7 @@ <group value="mtf_migrated"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="loginToAdminPanel"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginToAdminPanel"/> <createData entity="defaultSimpleProduct" stepKey="simpleProduct1"/> <createData entity="defaultSimpleProduct" stepKey="simpleProduct2"/> </before> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminMassUpdateProductAttributesGlobalScopeTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminMassUpdateProductAttributesGlobalScopeTest.xml index 0fbbca2602e86..31b5961edaaaa 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminMassUpdateProductAttributesGlobalScopeTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminMassUpdateProductAttributesGlobalScopeTest.xml @@ -20,7 +20,7 @@ <group value="product_attributes"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <actionGroup ref="DeleteAllProductsUsingProductGridActionGroup" stepKey="deleteAllProducts"/> <actionGroup ref="AdminCreateStoreViewActionGroup" stepKey="createStoreView" /> <createData entity="_defaultCategory" stepKey="createCategory"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminMassUpdateProductAttributesMissingRequiredFieldTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminMassUpdateProductAttributesMissingRequiredFieldTest.xml index a4c8f5e8cff6c..e4d69e9169613 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminMassUpdateProductAttributesMissingRequiredFieldTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminMassUpdateProductAttributesMissingRequiredFieldTest.xml @@ -20,7 +20,7 @@ <group value="Product Attributes"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <createData entity="_defaultCategory" stepKey="createCategory"/> <createData entity="ApiSimpleProduct" stepKey="createProductOne"> <requiredEntity createDataKey="createCategory"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminMassUpdateProductAttributesStoreViewScopeTest/AdminMassUpdateProductAttributesStoreViewScopeMysqlTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminMassUpdateProductAttributesStoreViewScopeTest/AdminMassUpdateProductAttributesStoreViewScopeMysqlTest.xml index ffaf8501ea71f..7cdfd6dabed47 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminMassUpdateProductAttributesStoreViewScopeTest/AdminMassUpdateProductAttributesStoreViewScopeMysqlTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminMassUpdateProductAttributesStoreViewScopeTest/AdminMassUpdateProductAttributesStoreViewScopeMysqlTest.xml @@ -20,7 +20,7 @@ <group value="SearchEngineMysql"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <actionGroup ref="AdminCreateStoreViewActionGroup" stepKey="createStoreView"/> <createData entity="ApiProductWithDescription" stepKey="createProductOne"/> <createData entity="ApiProductWithDescription" stepKey="createProductTwo"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminMassUpdateProductAttributesStoreViewScopeTest/AdminMassUpdateProductAttributesStoreViewScopeTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminMassUpdateProductAttributesStoreViewScopeTest/AdminMassUpdateProductAttributesStoreViewScopeTest.xml index 308a240eda184..08b2d924e2a5e 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminMassUpdateProductAttributesStoreViewScopeTest/AdminMassUpdateProductAttributesStoreViewScopeTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminMassUpdateProductAttributesStoreViewScopeTest/AdminMassUpdateProductAttributesStoreViewScopeTest.xml @@ -20,7 +20,7 @@ <group value="SearchEngineElasticsearch"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <actionGroup ref="AdminCreateStoreViewActionGroup" stepKey="createStoreView"/> <createData entity="ApiProductWithDescription" stepKey="createProductOne"/> <createData entity="ApiProductWithDescription" stepKey="createProductTwo"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminMoveAnchoredCategoryTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminMoveAnchoredCategoryTest.xml index 820a578e0252f..72092af331974 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminMoveAnchoredCategoryTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminMoveAnchoredCategoryTest.xml @@ -35,7 +35,7 @@ <magentoCLI command="cron:run" arguments="--group='index'" stepKey="firstRunToScheduleJobs"/> <magentoCLI command="cron:run" arguments="--group='index'" stepKey="secondRunToExecuteJobs"/> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> </before> <after> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminMoveAnchoredCategoryToDefaultCategoryTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminMoveAnchoredCategoryToDefaultCategoryTest.xml index 2122d73ca7e62..1ea1f60f52a2c 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminMoveAnchoredCategoryToDefaultCategoryTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminMoveAnchoredCategoryToDefaultCategoryTest.xml @@ -18,7 +18,7 @@ <features value="Catalog"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="loginToAdminPanel"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginToAdminPanel"/> <createData entity="_defaultCategory" stepKey="createDefaultCategory"/> <createData entity="defaultSimpleProduct" stepKey="simpleProduct"/> </before> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminMoveCategoryAndCheckUrlRewritesTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminMoveCategoryAndCheckUrlRewritesTest.xml index ac766feef1742..39040c7e88205 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminMoveCategoryAndCheckUrlRewritesTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminMoveCategoryAndCheckUrlRewritesTest.xml @@ -18,7 +18,7 @@ <group value="mtf_migrated"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="loginToAdminPanel"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginToAdminPanel"/> <createData entity="FirstLevelSubCat" stepKey="createDefaultCategory"> <field key="is_active">true</field> </createData> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminMoveCategoryFromParentAnchoredCategoryTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminMoveCategoryFromParentAnchoredCategoryTest.xml index 393d0c49c2e93..7fdc6e7b9cf8f 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminMoveCategoryFromParentAnchoredCategoryTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminMoveCategoryFromParentAnchoredCategoryTest.xml @@ -18,7 +18,7 @@ <features value="Catalog"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="loginToAdminPanel"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginToAdminPanel"/> <createData entity="defaultSimpleProduct" stepKey="simpleProduct"/> <createData entity="_defaultCategory" stepKey="createDefaultCategory"/> </before> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminMoveCategoryToAnotherPositionInCategoryTreeTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminMoveCategoryToAnotherPositionInCategoryTreeTest.xml index f49b9b5b5d3e3..2909d17b1541b 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminMoveCategoryToAnotherPositionInCategoryTreeTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminMoveCategoryToAnotherPositionInCategoryTreeTest.xml @@ -20,7 +20,7 @@ </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="loginToAdminPanel"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginToAdminPanel"/> <createData entity="_defaultCategory" stepKey="createDefaultCategory"/> </before> <after> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminMoveProductBetweenCategoriesTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminMoveProductBetweenCategoriesTest.xml index d3d435b7451c3..50c7fa38d881e 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminMoveProductBetweenCategoriesTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminMoveProductBetweenCategoriesTest.xml @@ -19,7 +19,7 @@ </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="LoginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="LoginAsAdmin"/> <createData entity="defaultSimpleProduct" stepKey="simpleProduct"/> <createData entity="_defaultCategory" stepKey="createAnchoredCategory1"/> <createData entity="_defaultCategory" stepKey="createSecondCategory"/> @@ -163,7 +163,7 @@ <dontSee userInput="$$simpleProduct.name$$" selector="{{StorefrontCategoryMainSection.productName}}" stepKey="dontseeProduct"/> <!-- Log in to the backend: Admin user is logged in--> - <actionGroup ref="LoginAsAdmin" stepKey="LoginAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="LoginAdmin"/> <!-- Navigate to the Catalog > Products: Navigate to the Catalog>Products --> <amOnPage url="{{AdminCatalogProductPage.url}}" stepKey="amOnProductPage"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminNavigateMultipleUpSellProductsTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminNavigateMultipleUpSellProductsTest.xml index d0e466114a1d4..659521ed9e467 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminNavigateMultipleUpSellProductsTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminNavigateMultipleUpSellProductsTest.xml @@ -74,7 +74,7 @@ </createData> <!--Login as admin--> - <actionGroup ref="LoginAsAdmin" stepKey="login"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="login"/> </before> <after> <!--Logout as admin--> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminProductCategoryIndexerInUpdateOnScheduleModeTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminProductCategoryIndexerInUpdateOnScheduleModeTest.xml index 4a4a4a6833b33..b8e7bdae0df2b 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminProductCategoryIndexerInUpdateOnScheduleModeTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminProductCategoryIndexerInUpdateOnScheduleModeTest.xml @@ -23,7 +23,7 @@ </skip> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="LoginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="LoginAsAdmin"/> <!-- Create category A without products --> <createData entity="_defaultCategory" stepKey="createCategoryA"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminProductCustomURLKeyPreservedWhenAssignedToCategoryWithoutCustomURLKeyTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminProductCustomURLKeyPreservedWhenAssignedToCategoryWithoutCustomURLKeyTest.xml index c62c6b4b4c6a9..ee34d8286fe32 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminProductCustomURLKeyPreservedWhenAssignedToCategoryWithoutCustomURLKeyTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminProductCustomURLKeyPreservedWhenAssignedToCategoryWithoutCustomURLKeyTest.xml @@ -28,7 +28,7 @@ <createData entity="SimpleProduct2" stepKey="createSimpleProductSecond"/> <!--Login as admin --> - <actionGroup ref="LoginAsAdmin" stepKey="loginToAdminPanel"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginToAdminPanel"/> <actionGroup ref="AdminCreateStoreViewActionGroup" stepKey="createStoreView"> <argument name="customStore" value="storeViewData"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminProductGridFilteringByCustomAttributeTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminProductGridFilteringByCustomAttributeTest.xml index 5593e8b56422f..9536ee030cdf8 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminProductGridFilteringByCustomAttributeTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminProductGridFilteringByCustomAttributeTest.xml @@ -21,7 +21,7 @@ </annotations> <before> <!--Login as admin and delete all products --> - <actionGroup ref="LoginAsAdmin" stepKey="login"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="login"/> <actionGroup ref="DeleteAllProductsUsingProductGridActionGroup" stepKey="deleteAllProducts"/> <!--Create dropdown product attribute--> <createData entity="productDropDownAttribute" stepKey="createDropdownAttribute"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminProductGridFilteringByDateAttributeTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminProductGridFilteringByDateAttributeTest.xml index 8c334cb84be01..d47730a99308b 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminProductGridFilteringByDateAttributeTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminProductGridFilteringByDateAttributeTest.xml @@ -19,7 +19,7 @@ <group value="product"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <createData entity="SimpleProductWithNewFromDate" stepKey="createSimpleProductWithDate"/> </before> <after> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminProductImageAssignmentForMultipleStoresTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminProductImageAssignmentForMultipleStoresTest.xml index f32845072ec02..35632f4fa6311 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminProductImageAssignmentForMultipleStoresTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminProductImageAssignmentForMultipleStoresTest.xml @@ -21,7 +21,7 @@ </annotations> <before> <!-- Login Admin --> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <!-- Create Store View English --> <actionGroup ref="AdminCreateStoreViewActionGroup" stepKey="createStoreViewEn"> <argument name="customStore" value="customStoreEN"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminProductStatusAttributeDisabledByDefaultTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminProductStatusAttributeDisabledByDefaultTest.xml index 5f089aad256b7..ae63158990b96 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminProductStatusAttributeDisabledByDefaultTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminProductStatusAttributeDisabledByDefaultTest.xml @@ -19,7 +19,7 @@ <group value="Catalog"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> </before> <after> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminProductTypeSwitchingOnEditingTest/AdminVirtualProductTypeSwitchingToDownloadableProductTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminProductTypeSwitchingOnEditingTest/AdminVirtualProductTypeSwitchingToDownloadableProductTest.xml index 4966e94463e98..12d654508d7d7 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminProductTypeSwitchingOnEditingTest/AdminVirtualProductTypeSwitchingToDownloadableProductTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminProductTypeSwitchingOnEditingTest/AdminVirtualProductTypeSwitchingToDownloadableProductTest.xml @@ -21,7 +21,7 @@ <before> <!-- Add downloadable domains --> <magentoCLI stepKey="addDownloadableDomain" command="downloadable:domains:add example.com static.magento.com"/> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <!--Create product--> <comment userInput="Create product" stepKey="commentCreateProduct"/> <createData entity="VirtualProduct" stepKey="createProduct"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminRemoveCustomOptionsFromProductTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminRemoveCustomOptionsFromProductTest.xml index f46a3aea0ef81..96ee795998459 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminRemoveCustomOptionsFromProductTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminRemoveCustomOptionsFromProductTest.xml @@ -30,7 +30,7 @@ <actionGroup ref="ClearFiltersAdminDataGridActionGroup" stepKey="clearProductFilter"/> <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> </after> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <!-- Edit Simple Product --> <actionGroup ref="AdminProductPageOpenByIdActionGroup" stepKey="goToProduct"> <argument name="productId" value="$$createProduct.id$$"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminRemoveDefaultImageSimpleProductTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminRemoveDefaultImageSimpleProductTest.xml index 3b750c2cdb21c..00eaa623e2bca 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminRemoveDefaultImageSimpleProductTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminRemoveDefaultImageSimpleProductTest.xml @@ -19,7 +19,7 @@ <group value="Catalog"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> </before> <after> <amOnPage url="{{AdminLogoutPage.url}}" stepKey="amOnLogoutPage"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminRemoveDefaultImageVirtualProductTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminRemoveDefaultImageVirtualProductTest.xml index 6a68928be8c70..6cc1b256e5ec9 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminRemoveDefaultImageVirtualProductTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminRemoveDefaultImageVirtualProductTest.xml @@ -19,7 +19,7 @@ <group value="Catalog"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> </before> <after> <amOnPage url="{{AdminLogoutPage.url}}" stepKey="amOnLogoutPage"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminRemoveDefaultVideoSimpleProductTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminRemoveDefaultVideoSimpleProductTest.xml index baa952f6bcf45..60c32004e3ca8 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminRemoveDefaultVideoSimpleProductTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminRemoveDefaultVideoSimpleProductTest.xml @@ -23,7 +23,7 @@ </annotations> <before> <actionGroup ref="EnableAdminAccountSharingActionGroup" stepKey="enableAdminAccountSharing"/> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> </before> <after> <amOnPage url="{{AdminLogoutPage.url}}" stepKey="amOnLogoutPage"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminRemoveImageAffectsAllScopesTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminRemoveImageAffectsAllScopesTest.xml index 5e29bf30b4bf2..6cd76c4cc06b8 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminRemoveImageAffectsAllScopesTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminRemoveImageAffectsAllScopesTest.xml @@ -20,7 +20,7 @@ </annotations> <before> <!--Create 2 websites (with stores, store views)--> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <createData entity="_defaultCategory" stepKey="category"/> <createData entity="_defaultProduct" stepKey="product"> <requiredEntity createDataKey="category"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminRemoveImageFromCategoryTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminRemoveImageFromCategoryTest.xml index b3e5900c9bb76..ee8636dece808 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminRemoveImageFromCategoryTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminRemoveImageFromCategoryTest.xml @@ -19,7 +19,7 @@ <group value="Catalog"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> </before> <after> <actionGroup ref="DeleteCategoryActionGroup" stepKey="DeleteCategory"> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminRequiredFieldsHaveRequiredFieldIndicatorTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminRequiredFieldsHaveRequiredFieldIndicatorTest.xml index d2822a53b1a73..0281fded3a8e4 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminRequiredFieldsHaveRequiredFieldIndicatorTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminRequiredFieldsHaveRequiredFieldIndicatorTest.xml @@ -21,7 +21,7 @@ <actionGroup ref="AdminLogoutActionGroup" stepKey="adminLogout"/> </after> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin1"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin1"/> <amOnPage url="{{AdminCategoryPage.url}}" stepKey="navigateToCategoryPage"/> <waitForElementVisible selector="{{AdminCategorySidebarActionSection.AddSubcategoryButton}}" stepKey="waitForAddSubCategoryVisible"/> <click selector="{{AdminCategorySidebarActionSection.AddSubcategoryButton}}" stepKey="clickOnAddSubCategory"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminRestrictedUserAddCategoryFromProductPageTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminRestrictedUserAddCategoryFromProductPageTest.xml index 5f489e337b01a..e89e89205f3f5 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminRestrictedUserAddCategoryFromProductPageTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminRestrictedUserAddCategoryFromProductPageTest.xml @@ -20,7 +20,7 @@ <group value="catalog"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <!--Create category--> <comment userInput="Create category" stepKey="commentCreateCategory"/> <createData entity="SimpleSubCategory" stepKey="createCategory"/> @@ -33,7 +33,7 @@ </actionGroup> <actionGroup ref="ResetProductGridToDefaultViewActionGroup" stepKey="resetFiltersIfExist"/> <actionGroup ref="AdminLogoutActionGroup" stepKey="logoutOfUser"/> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <!--Delete created data--> <comment userInput="Delete created data" stepKey="commentDeleteCreatedData"/> <amOnPage url="{{AdminRolesPage.url}}" stepKey="navigateToUserRoleGrid" /> @@ -75,8 +75,9 @@ <!--Log out of admin and login with newly created user--> <comment userInput="Log out of admin and login with newly created user" stepKey="commentLoginWithNewUser"/> <actionGroup ref="AdminLogoutActionGroup" stepKey="logoutOfAdmin"/> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsNewUser"> - <argument name="adminUser" value="admin2"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsNewUser"> + <argument name="username" value="{{admin2.username}}"/> + <argument name="password" value="{{admin2.password}}"/> </actionGroup> <!--Go to create product page--> <comment userInput="Go to create product page" stepKey="commentGoCreateProductPage"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminShouldBeAbleToAssociateSimpleProductToWebsitesTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminShouldBeAbleToAssociateSimpleProductToWebsitesTest.xml index 190a051c16d44..00b9e77d5fe5e 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminShouldBeAbleToAssociateSimpleProductToWebsitesTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminShouldBeAbleToAssociateSimpleProductToWebsitesTest.xml @@ -23,7 +23,7 @@ <magentoCLI command="config:set {{StorefrontEnableAddStoreCodeToUrls.path}} {{StorefrontEnableAddStoreCodeToUrls.value}}" stepKey="setAddStoreCodeToUrlsToYes"/> <createData entity="secondCustomWebsite" stepKey="createCustomWebsite"/> <createData entity="SimpleProduct2" stepKey="createSimpleProduct"/> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <actionGroup ref="AdminStoreGroupCreateActionGroup" stepKey="createNewStore"> <argument name="Website" value="secondCustomWebsite"/> <argument name="storeGroup" value="customStoreGroup"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminSimpleProductEditUiTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminSimpleProductEditUiTest.xml index c0f121edcf6bd..3ee8d0e3c2571 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminSimpleProductEditUiTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminSimpleProductEditUiTest.xml @@ -33,7 +33,7 @@ </after> <!--check admin for valid Enable Status label--> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <actionGroup ref="AdminProductPageOpenByIdActionGroup" stepKey="goToEditPage"> <argument name="productId" value="$$createSimpleProduct.id$$"/> </actionGroup> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminSimpleProductImagesTest/AdminSimpleProductImagesTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminSimpleProductImagesTest/AdminSimpleProductImagesTest.xml index 8bb65045fdde9..9819890ed3751 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminSimpleProductImagesTest/AdminSimpleProductImagesTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminSimpleProductImagesTest/AdminSimpleProductImagesTest.xml @@ -26,7 +26,7 @@ <createData entity="_defaultProduct" stepKey="secondProduct"> <requiredEntity createDataKey="category"/> </createData> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> </before> <after> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminSimpleProductImagesTest/AdminSimpleProductRemoveImagesTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminSimpleProductImagesTest/AdminSimpleProductRemoveImagesTest.xml index 53ccb0257aa19..ec82bdcf5bc94 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminSimpleProductImagesTest/AdminSimpleProductRemoveImagesTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminSimpleProductImagesTest/AdminSimpleProductRemoveImagesTest.xml @@ -23,7 +23,7 @@ <createData entity="_defaultProduct" stepKey="product"> <requiredEntity createDataKey="category"/> </createData> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> </before> <after> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminSimpleProductSetEditContentTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminSimpleProductSetEditContentTest.xml index 80e245818e216..51a91a17ff41a 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminSimpleProductSetEditContentTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminSimpleProductSetEditContentTest.xml @@ -21,7 +21,7 @@ </annotations> <before> <!--Admin Login--> - <actionGroup stepKey="loginToAdminPanel" ref="LoginAsAdmin"/> + <actionGroup stepKey="loginToAdminPanel" ref="AdminLoginActionGroup"/> <actionGroup ref="DisabledWYSIWYGActionGroup" stepKey="disableWYSIWYG"/> </before> <after> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminSimpleSetEditRelatedProductsTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminSimpleSetEditRelatedProductsTest.xml index 76e0bdd5d46ad..534924e0f70c9 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminSimpleSetEditRelatedProductsTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminSimpleSetEditRelatedProductsTest.xml @@ -19,7 +19,7 @@ <group value="Catalog"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <createData entity="SimpleProduct2" stepKey="simpleProduct0"/> <createData entity="SimpleProduct2" stepKey="simpleProduct1"/> <createData entity="SimpleProduct2" stepKey="simpleProduct2"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminSortingByWebsitesTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminSortingByWebsitesTest.xml index 16bc76cb6446a..71e827a64ae2d 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminSortingByWebsitesTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminSortingByWebsitesTest.xml @@ -24,7 +24,7 @@ <requiredEntity createDataKey="createCategory"/> </createData> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <!--Create new website --> <actionGroup ref="AdminCreateWebsiteActionGroup" stepKey="createAdditionalWebsite"> <argument name="newWebsiteName" value="{{customWebsite.name}}"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminStoresAttributeSetNavigateMenuTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminStoresAttributeSetNavigateMenuTest.xml index 544ab05d8783b..c1538cf8c5329 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminStoresAttributeSetNavigateMenuTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminStoresAttributeSetNavigateMenuTest.xml @@ -20,7 +20,7 @@ <group value="mtf_migrated"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="LoginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="LoginAsAdmin"/> </before> <after> <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminStoresProductNavigateMenuTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminStoresProductNavigateMenuTest.xml index 37571d7b44635..e0a2c4272372a 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminStoresProductNavigateMenuTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminStoresProductNavigateMenuTest.xml @@ -20,7 +20,7 @@ <group value="mtf_migrated"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="LoginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="LoginAsAdmin"/> </before> <after> <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminTierPriceNotAvailableForProductOptionsWithoutTierPriceTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminTierPriceNotAvailableForProductOptionsWithoutTierPriceTest.xml index 0ce506fe1918d..9838283bbfb96 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminTierPriceNotAvailableForProductOptionsWithoutTierPriceTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminTierPriceNotAvailableForProductOptionsWithoutTierPriceTest.xml @@ -20,7 +20,7 @@ <group value="catalog"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <!--Create category--> <createData entity="SimpleSubCategory" stepKey="createCategory"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUnassignProductAttributeFromAttributeSetTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUnassignProductAttributeFromAttributeSetTest.xml index 307eceddae3ef..5fe71ce0a1e5d 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUnassignProductAttributeFromAttributeSetTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUnassignProductAttributeFromAttributeSetTest.xml @@ -30,7 +30,7 @@ <requiredEntity createDataKey="attribute"/> </createData> <createData entity="ApiProductWithDescription" stepKey="product"/> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> </before> <after> <deleteData createDataKey="product" stepKey="deleteProduct"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateCategoryAndCheckDefaultUrlKeyOnStoreViewTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateCategoryAndCheckDefaultUrlKeyOnStoreViewTest.xml index 4b1cd1f674425..f3225bcd7fe3d 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateCategoryAndCheckDefaultUrlKeyOnStoreViewTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateCategoryAndCheckDefaultUrlKeyOnStoreViewTest.xml @@ -18,7 +18,7 @@ <group value="mtf_migrated"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="loginToAdminPanel"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginToAdminPanel"/> <createData entity="NewRootCategory" stepKey="rootCategory"/> <createData entity="SimpleRootSubCategory" stepKey="category"> <requiredEntity createDataKey="rootCategory"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateCategoryAndMakeInactiveTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateCategoryAndMakeInactiveTest.xml index 4eab0ca8f0694..2865e9bc87dd3 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateCategoryAndMakeInactiveTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateCategoryAndMakeInactiveTest.xml @@ -18,7 +18,7 @@ <group value="mtf_migrated"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="loginToAdminPanel"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginToAdminPanel"/> <createData entity="_defaultCategory" stepKey="createDefaultCategory"/> </before> <after> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateCategoryNameWithStoreViewTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateCategoryNameWithStoreViewTest.xml index 51d8b9e1eaf37..3c3baf3524e87 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateCategoryNameWithStoreViewTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateCategoryNameWithStoreViewTest.xml @@ -18,7 +18,7 @@ <group value="mtf_migrated"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="loginToAdminPanel"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginToAdminPanel"/> <createData entity="NewRootCategory" stepKey="rootCategory"/> <createData entity="SimpleRootSubCategory" stepKey="category"> <requiredEntity createDataKey="rootCategory"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateCategoryStoreUrlKeyTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateCategoryStoreUrlKeyTest.xml index 3c99e86dba2c9..8b57c2e371355 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateCategoryStoreUrlKeyTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateCategoryStoreUrlKeyTest.xml @@ -26,7 +26,7 @@ </after> <!-- Create category, change store view to default --> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <amOnPage url="{{AdminCategoryPage.url}}" stepKey="navigateToCategoryPage"/> <waitForPageLoad stepKey="waitForPageLoad1"/> <actionGroup ref="CreateCategoryActionGroup" stepKey="createCategory"> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateCategoryUrlKeyWithStoreViewTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateCategoryUrlKeyWithStoreViewTest.xml index 6ecb7e09d5a2c..117019da38ffa 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateCategoryUrlKeyWithStoreViewTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateCategoryUrlKeyWithStoreViewTest.xml @@ -18,7 +18,7 @@ <group value="mtf_migrated"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="loginToAdminPanel"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginToAdminPanel"/> <createData entity="NewRootCategory" stepKey="rootCategory"/> <createData entity="SimpleRootSubCategory" stepKey="category"> <requiredEntity createDataKey="rootCategory"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateCategoryWithInactiveIncludeInMenuTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateCategoryWithInactiveIncludeInMenuTest.xml index d6c581b18beff..9663632e6dc36 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateCategoryWithInactiveIncludeInMenuTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateCategoryWithInactiveIncludeInMenuTest.xml @@ -19,7 +19,7 @@ <group value="WYSIWYGDisabled"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="loginToAdminPanel"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginToAdminPanel"/> <createData entity="_defaultCategory" stepKey="createDefaultCategory"/> </before> <after> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateCategoryWithProductsTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateCategoryWithProductsTest.xml index 6dde1567b68f8..ccab2f9e96ce7 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateCategoryWithProductsTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateCategoryWithProductsTest.xml @@ -18,7 +18,7 @@ <group value="mtf_migrated"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="loginToAdminPanel"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginToAdminPanel"/> <createData entity="defaultSimpleProduct" stepKey="simpleProduct" /> <createData entity="_defaultCategory" stepKey="createCategory"/> </before> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateFlatCategoryAndAddProductsTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateFlatCategoryAndAddProductsTest.xml index 8a31145f7349d..512df79cb7c9c 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateFlatCategoryAndAddProductsTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateFlatCategoryAndAddProductsTest.xml @@ -18,7 +18,7 @@ <group value="mtf_migrated"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="loginToAdminPanel"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginToAdminPanel"/> <!-- Create Simple Product --> <createData entity="SimpleSubCategory" stepKey="category"/> <!-- Create category --> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateFlatCategoryIncludeInNavigationTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateFlatCategoryIncludeInNavigationTest.xml index 6575fd1f1c977..f444e741fea0e 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateFlatCategoryIncludeInNavigationTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateFlatCategoryIncludeInNavigationTest.xml @@ -18,7 +18,7 @@ <group value="mtf_migrated"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="loginToAdminPanel"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginToAdminPanel"/> <!--Create category--> <createData entity="CatNotIncludeInMenu" stepKey="createCategory"/> <!-- Create First StoreView --> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateFlatCategoryNameAndDescriptionTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateFlatCategoryNameAndDescriptionTest.xml index 2c356636df56c..2b9cbf379c5e6 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateFlatCategoryNameAndDescriptionTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateFlatCategoryNameAndDescriptionTest.xml @@ -19,7 +19,7 @@ <group value="WYSIWYGDisabled"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="loginToAdminPanel"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginToAdminPanel"/> <!--Create category--> <createData entity="_defaultCategory" stepKey="createCategory"/> <!-- Create First StoreView --> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductNameToVerifyDataOverridingOnStoreViewLevelTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductNameToVerifyDataOverridingOnStoreViewLevelTest.xml index 2c45e957d801c..6edffb923d540 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductNameToVerifyDataOverridingOnStoreViewLevelTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductNameToVerifyDataOverridingOnStoreViewLevelTest.xml @@ -19,7 +19,7 @@ <group value="mtf_migrated"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <actionGroup ref="CreateStoreViewActionGroup" stepKey="createCustomStoreViewFr"> <argument name="storeView" value="customStoreFR"/> </actionGroup> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductPriceToVerifyDataOverridingOnStoreViewLevelTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductPriceToVerifyDataOverridingOnStoreViewLevelTest.xml index 4e80f95bbf390..e954de90ef542 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductPriceToVerifyDataOverridingOnStoreViewLevelTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductPriceToVerifyDataOverridingOnStoreViewLevelTest.xml @@ -19,7 +19,7 @@ <group value="mtf_migrated"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <actionGroup ref="CreateStoreViewActionGroup" stepKey="createCustomStoreViewFr"> <argument name="storeView" value="customStoreFR"/> </actionGroup> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductTieredPriceTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductTieredPriceTest.xml index 7096e547c5aa7..f5b0fb8054dc1 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductTieredPriceTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductTieredPriceTest.xml @@ -19,7 +19,7 @@ <group value="mtf_migrated"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <createData entity="SimpleSubCategory" stepKey="initialCategoryEntity"/> <createData entity="defaultSimpleProduct" stepKey="initialSimpleProduct"> <requiredEntity createDataKey="initialCategoryEntity"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockDisabledProductTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockDisabledProductTest.xml index d0935948e88bd..d20594461173b 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockDisabledProductTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockDisabledProductTest.xml @@ -19,7 +19,7 @@ <group value="mtf_migrated"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <createData entity="SimpleSubCategory" stepKey="initialCategoryEntity"/> <createData entity="defaultSimpleProduct" stepKey="initialSimpleProduct"> <requiredEntity createDataKey="initialCategoryEntity"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockEnabledFlatTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockEnabledFlatTest.xml index e9c2ed1511ce3..5fa7acbeb8de9 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockEnabledFlatTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockEnabledFlatTest.xml @@ -19,7 +19,7 @@ <group value="mtf_migrated"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <magentoCLI stepKey="setFlatCatalogProduct" command="config:set catalog/frontend/flat_catalog_product 1"/> <createData entity="SimpleSubCategory" stepKey="initialCategoryEntity"/> <createData entity="defaultSimpleProduct" stepKey="initialSimpleProduct"> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockNotVisibleIndividuallyTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockNotVisibleIndividuallyTest.xml index 17a91ed2cf4f4..259eb01d9bc5d 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockNotVisibleIndividuallyTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockNotVisibleIndividuallyTest.xml @@ -19,7 +19,7 @@ <group value="mtf_migrated"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <createData entity="SimpleSubCategory" stepKey="initialCategoryEntity"/> <createData entity="defaultSimpleProduct" stepKey="initialSimpleProduct"> <requiredEntity createDataKey="initialCategoryEntity"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockUnassignFromCategoryTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockUnassignFromCategoryTest.xml index 84f2c4552ae6c..45f8918100083 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockUnassignFromCategoryTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockUnassignFromCategoryTest.xml @@ -19,7 +19,7 @@ <group value="mtf_migrated"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <createData entity="SimpleSubCategory" stepKey="initialCategoryEntity"/> <createData entity="_defaultProduct" stepKey="initialSimpleProduct"> <requiredEntity createDataKey="initialCategoryEntity"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockVisibleInCatalogAndSearchTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockVisibleInCatalogAndSearchTest.xml index 423a7d23d7d4a..58db163bed720 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockVisibleInCatalogAndSearchTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockVisibleInCatalogAndSearchTest.xml @@ -19,7 +19,7 @@ <group value="mtf_migrated"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <createData entity="SimpleSubCategory" stepKey="initialCategoryEntity"/> <createData entity="defaultSimpleProduct" stepKey="initialSimpleProduct"> <requiredEntity createDataKey="initialCategoryEntity"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockVisibleInCatalogOnlyTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockVisibleInCatalogOnlyTest.xml index 29a4c5e009d07..5e9a48f659d6b 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockVisibleInCatalogOnlyTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockVisibleInCatalogOnlyTest.xml @@ -19,7 +19,7 @@ <group value="mtf_migrated"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <createData entity="SimpleSubCategory" stepKey="initialCategoryEntity"/> <createData entity="defaultSimpleProduct" stepKey="initialSimpleProduct"> <requiredEntity createDataKey="initialCategoryEntity"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockVisibleInSearchOnlyTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockVisibleInSearchOnlyTest.xml index 5c196744f0181..3d37b54dfa439 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockVisibleInSearchOnlyTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockVisibleInSearchOnlyTest.xml @@ -19,7 +19,7 @@ <group value="mtf_migrated"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <createData entity="SimpleSubCategory" stepKey="initialCategoryEntity"/> <createData entity="defaultSimpleProduct" stepKey="initialSimpleProduct"> <requiredEntity createDataKey="initialCategoryEntity"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockWithCustomOptionsTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockWithCustomOptionsTest.xml index 00b6a5def6169..c924c94a9aba8 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockWithCustomOptionsTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockWithCustomOptionsTest.xml @@ -19,7 +19,7 @@ <group value="mtf_migrated"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <createData entity="SimpleSubCategory" stepKey="initialCategoryEntity"/> <createData entity="defaultSimpleProduct" stepKey="initialSimpleProduct"> <requiredEntity createDataKey="initialCategoryEntity"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceOutOfStockTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceOutOfStockTest.xml index ec19a2a496f9f..af836efcf6be6 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceOutOfStockTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceOutOfStockTest.xml @@ -19,7 +19,7 @@ <group value="mtf_migrated"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <createData entity="SimpleSubCategory" stepKey="initialCategoryEntity"/> <createData entity="defaultSimpleProduct" stepKey="initialSimpleProduct"> <requiredEntity createDataKey="initialCategoryEntity"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateTopCategoryUrlWithNoRedirectTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateTopCategoryUrlWithNoRedirectTest.xml index f499d87c84682..db8b808e74f76 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateTopCategoryUrlWithNoRedirectTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateTopCategoryUrlWithNoRedirectTest.xml @@ -29,7 +29,7 @@ </createData> <!-- Login as admin --> - <actionGroup ref="LoginAsAdmin" stepKey="login"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="login"/> </before> <after> <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateTopCategoryUrlWithRedirectTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateTopCategoryUrlWithRedirectTest.xml index eabedebaeab83..c5757a6428e8d 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateTopCategoryUrlWithRedirectTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateTopCategoryUrlWithRedirectTest.xml @@ -20,7 +20,7 @@ <before> <!-- Login as admin --> - <actionGroup ref="LoginAsAdmin" stepKey="login"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="login"/> <!-- Create three level nested category --> <createData entity="_defaultCategory" stepKey="createDefaultCategory"/> <createData entity="Two_nested_categories" stepKey="createTwoLevelNestedCategories"> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminVerifyProductOrderTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminVerifyProductOrderTest.xml index bd1a5aaf9ed42..9146ee4d4d579 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminVerifyProductOrderTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminVerifyProductOrderTest.xml @@ -20,7 +20,7 @@ <group value="product"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin1"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin1"/> </before> <after> <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdvanceCatalogSearchSimpleProductTest/AdvanceCatalogSearchSimpleProductByNameTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdvanceCatalogSearchSimpleProductTest/AdvanceCatalogSearchSimpleProductByNameTest.xml index a667d08b8e25f..5115399db9e3b 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdvanceCatalogSearchSimpleProductTest/AdvanceCatalogSearchSimpleProductByNameTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdvanceCatalogSearchSimpleProductTest/AdvanceCatalogSearchSimpleProductByNameTest.xml @@ -18,7 +18,7 @@ <group value="Catalog"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <actionGroup ref="DeleteAllProductsUsingProductGridActionGroup" stepKey="deleteAllProducts"/> <createData entity="ApiProductWithDescription" stepKey="product"/> </before> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdvanceCatalogSearchSimpleProductTest/AdvanceCatalogSearchSimpleProductByPriceTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdvanceCatalogSearchSimpleProductTest/AdvanceCatalogSearchSimpleProductByPriceTest.xml index 50ca013050ea7..cacf4f3f4c9f5 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdvanceCatalogSearchSimpleProductTest/AdvanceCatalogSearchSimpleProductByPriceTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdvanceCatalogSearchSimpleProductTest/AdvanceCatalogSearchSimpleProductByPriceTest.xml @@ -18,7 +18,7 @@ <group value="Catalog"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <actionGroup ref="DeleteAllProductsUsingProductGridActionGroup" stepKey="deleteAllProducts"/> <createData entity="ApiProductWithDescription" stepKey="product"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/CheckTierPricingOfProductsTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/CheckTierPricingOfProductsTest.xml index 1fe42a331c80c..d89ffa0055d3b 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/CheckTierPricingOfProductsTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/CheckTierPricingOfProductsTest.xml @@ -35,7 +35,7 @@ </createData> <createData entity="Simple_US_Customer" stepKey="customer"/> <!--Login as admin--> - <actionGroup ref="LoginAsAdmin" stepKey="LoginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="LoginAsAdmin"/> <createData entity="CustomerAccountSharingGlobal" stepKey="setConfigCustomerAccountToGlobal"/> </before> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/ConfigurableOptionTextInputLengthValidationHint.xml b/app/code/Magento/Catalog/Test/Mftf/Test/ConfigurableOptionTextInputLengthValidationHint.xml index 850c0e98c45f3..e50c124f7cfd9 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/ConfigurableOptionTextInputLengthValidationHint.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/ConfigurableOptionTextInputLengthValidationHint.xml @@ -26,7 +26,7 @@ <deleteData createDataKey="createPreReqCategory" stepKey="deletePreReqCategory"/> </after> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin1"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin1"/> <actionGroup ref="AdminCreateSimpleProductWithTextOptionCharLimitActionGroup" stepKey="fillProductFieldsInAdmin"> <argument name="category" value="$$createPreReqCategory$$"/> <argument name="simpleProduct" value="_defaultProduct"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/CreateProductAttributeEntityTest/CreateProductAttributeEntityDateTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/CreateProductAttributeEntityTest/CreateProductAttributeEntityDateTest.xml index 6ee37221acc93..437532b9baebf 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/CreateProductAttributeEntityTest/CreateProductAttributeEntityDateTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/CreateProductAttributeEntityTest/CreateProductAttributeEntityDateTest.xml @@ -23,7 +23,7 @@ </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> </before> <after> <actionGroup ref="NavigateToEditProductAttributeActionGroup" stepKey="goToEditPage"> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/CreateProductAttributeEntityTest/CreateProductAttributeEntityDropdownTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/CreateProductAttributeEntityTest/CreateProductAttributeEntityDropdownTest.xml index dc38062a99c53..580a5bd4939bb 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/CreateProductAttributeEntityTest/CreateProductAttributeEntityDropdownTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/CreateProductAttributeEntityTest/CreateProductAttributeEntityDropdownTest.xml @@ -20,7 +20,7 @@ </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> </before> <after> <actionGroup ref="NavigateToEditProductAttributeActionGroup" stepKey="goToEditPage"> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/CreateProductAttributeEntityTest/CreateProductAttributeEntityDropdownWithSingleQuoteTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/CreateProductAttributeEntityTest/CreateProductAttributeEntityDropdownWithSingleQuoteTest.xml index b8b2224abf5a1..e24bf0d7b1115 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/CreateProductAttributeEntityTest/CreateProductAttributeEntityDropdownWithSingleQuoteTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/CreateProductAttributeEntityTest/CreateProductAttributeEntityDropdownWithSingleQuoteTest.xml @@ -20,7 +20,7 @@ </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> </before> <after> <actionGroup ref="NavigateToEditProductAttributeActionGroup" stepKey="goToEditPage"> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/CreateProductAttributeEntityTest/CreateProductAttributeEntityMultiSelectTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/CreateProductAttributeEntityTest/CreateProductAttributeEntityMultiSelectTest.xml index 50606994cace8..0a84d9af3c918 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/CreateProductAttributeEntityTest/CreateProductAttributeEntityMultiSelectTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/CreateProductAttributeEntityTest/CreateProductAttributeEntityMultiSelectTest.xml @@ -19,7 +19,7 @@ <group value="mtf_migrated"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> </before> <after> <actionGroup ref="NavigateToEditProductAttributeActionGroup" stepKey="goToEditPage"> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/CreateProductAttributeEntityTest/CreateProductAttributeEntityPriceTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/CreateProductAttributeEntityTest/CreateProductAttributeEntityPriceTest.xml index f1a19a9ece8d5..97eff20b2d560 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/CreateProductAttributeEntityTest/CreateProductAttributeEntityPriceTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/CreateProductAttributeEntityTest/CreateProductAttributeEntityPriceTest.xml @@ -20,7 +20,7 @@ </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> </before> <after> <actionGroup ref="NavigateToEditProductAttributeActionGroup" stepKey="goToEditPage"> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/CreateProductAttributeEntityTest/CreateProductAttributeEntityTextFieldTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/CreateProductAttributeEntityTest/CreateProductAttributeEntityTextFieldTest.xml index 3495069face61..c0cff7b0b2bc9 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/CreateProductAttributeEntityTest/CreateProductAttributeEntityTextFieldTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/CreateProductAttributeEntityTest/CreateProductAttributeEntityTextFieldTest.xml @@ -20,7 +20,7 @@ </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> </before> <after> <actionGroup ref="NavigateToEditProductAttributeActionGroup" stepKey="goToEditPage"> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/DeleteCategoriesTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/DeleteCategoriesTest.xml index 604c01f05b838..f70979285446a 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/DeleteCategoriesTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/DeleteCategoriesTest.xml @@ -41,7 +41,7 @@ <deleteData createDataKey="createProduct2" stepKey="deleteProduct2"/> <deleteData createDataKey="createProduct3" stepKey="deleteProduct3"/> </after> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin1"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin1"/> <amOnPage url="{{AdminCategoryPage.url}}" stepKey="navigateToCategoryPage1"/> <waitForPageLoad time="30" stepKey="waitForPageCategoryLoadAfterNavigate"/> <click selector="{{AdminCategorySidebarTreeSection.categoryInTree($$createNewRootCategoryA.name$$)}}" stepKey="openNewRootCategory"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/DeleteUsedInConfigurableProductAttributeTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/DeleteUsedInConfigurableProductAttributeTest.xml index 026f3ce7067f6..d2b9fba0895ea 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/DeleteUsedInConfigurableProductAttributeTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/DeleteUsedInConfigurableProductAttributeTest.xml @@ -59,7 +59,7 @@ </createData> <!-- Login As Admin --> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> </before> <after> <!-- Delete the configurable product created in the before block --> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/DisplayRefreshCacheAfterChangingCategoryPageLayoutTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/DisplayRefreshCacheAfterChangingCategoryPageLayoutTest.xml index 5a57bd844aa8d..f6ede46578f33 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/DisplayRefreshCacheAfterChangingCategoryPageLayoutTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/DisplayRefreshCacheAfterChangingCategoryPageLayoutTest.xml @@ -23,7 +23,7 @@ <!-- Create category, flush cache and log in --> <comment userInput="Create category, flush cache and log in" stepKey="createCategoryAndLogIn"/> <createData entity="SimpleSubCategory" stepKey="simpleCategory"/> - <actionGroup ref="LoginAsAdmin" stepKey="logInAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="logInAsAdmin"/> <magentoCLI command="cache:flush" stepKey="flushCache"/> </before> <after> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/EndToEndB2CAdminTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/EndToEndB2CAdminTest.xml index 43208f336dbcd..151046f0474e0 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/EndToEndB2CAdminTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/EndToEndB2CAdminTest.xml @@ -25,7 +25,7 @@ </after> <!--Login to Admin Area--> - <actionGroup ref="LoginAsAdmin" stepKey="loginToAdminArea"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginToAdminArea"/> <!--Admin creates product--> <!--Create Simple Product--> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/ProductAttributeWithoutValueInCompareListTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/ProductAttributeWithoutValueInCompareListTest.xml index 79fe21e0c0d77..916bcd7405ecf 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/ProductAttributeWithoutValueInCompareListTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/ProductAttributeWithoutValueInCompareListTest.xml @@ -18,7 +18,7 @@ <group value="Catalog"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <createData entity="textProductAttribute" stepKey="createProductAttribute"/> <createData entity="CatalogAttributeSet" stepKey="createAttributeSet"/> <amOnPage url="{{AdminProductAttributeSetEditPage.url}}/$$createAttributeSet.attribute_set_id$$/" diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/ProductAvailableAfterEnablingSubCategoriesTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/ProductAvailableAfterEnablingSubCategoriesTest.xml index da7165600d64d..ea9a4cb08bb08 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/ProductAvailableAfterEnablingSubCategoriesTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/ProductAvailableAfterEnablingSubCategoriesTest.xml @@ -29,7 +29,7 @@ <requiredEntity createDataKey="simpleSubCategory"/> </createData> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> </before> <after> <deleteData createDataKey="createSimpleProduct" stepKey="deleteSimpleProduct"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/SaveProductWithCustomOptionsSecondWebsiteTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/SaveProductWithCustomOptionsSecondWebsiteTest.xml index 783054c3ffb5a..b206a33ebde88 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/SaveProductWithCustomOptionsSecondWebsiteTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/SaveProductWithCustomOptionsSecondWebsiteTest.xml @@ -19,7 +19,7 @@ <group value="product"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <!--Create new website --> <actionGroup ref="AdminCreateWebsiteActionGroup" stepKey="createAdditionalWebsite"> <argument name="newWebsiteName" value="Second Website"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/SimpleProductTwoCustomOptionsTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/SimpleProductTwoCustomOptionsTest.xml index f5ac8b243979f..7b2e004495fea 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/SimpleProductTwoCustomOptionsTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/SimpleProductTwoCustomOptionsTest.xml @@ -20,7 +20,7 @@ </annotations> <before> <!-- log in as admin --> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <!--Create product--> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="navigateToProductIndex"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/StoreFrontProductsDisplayUsingElasticSearchTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/StoreFrontProductsDisplayUsingElasticSearchTest.xml index 9690246bbe68c..ea7912613f7f2 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/StoreFrontProductsDisplayUsingElasticSearchTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/StoreFrontProductsDisplayUsingElasticSearchTest.xml @@ -16,10 +16,10 @@ <testCaseId value="MC-30209"/> <severity value="CRITICAL"/> <group value="Catalog"/> + <group value="SearchEngineElasticsearch"/> </annotations> + <before> - <!-- Login Admin --> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> <!--Create Category and Simple Products--> <createData entity="SimpleSubCategory" stepKey="createCategory1"/> <createData entity="SimpleProduct" stepKey="createSimpleProduct"> @@ -64,51 +64,39 @@ <createData entity="SimpleProduct" stepKey="createSimpleProduct14"> <requiredEntity createDataKey="createCategory1"/> </createData> - <createData entity="SimpleProduct" stepKey="createSimpleProduct15"> <requiredEntity createDataKey="createCategory1"/> </createData> - <createData entity="SimpleProduct" stepKey="createSimpleProduct16"> <requiredEntity createDataKey="createCategory1"/> </createData> - <createData entity="SimpleProduct" stepKey="createSimpleProduct17"> <requiredEntity createDataKey="createCategory1"/> </createData> - <createData entity="SimpleProduct" stepKey="createSimpleProduct18"> <requiredEntity createDataKey="createCategory1"/> </createData> - <createData entity="SimpleProduct" stepKey="createSimpleProduct19"> <requiredEntity createDataKey="createCategory1"/> </createData> - <createData entity="SimpleProduct" stepKey="createSimpleProduct20"> <requiredEntity createDataKey="createCategory1"/> </createData> - <createData entity="SimpleProduct" stepKey="createSimpleProduct21"> <requiredEntity createDataKey="createCategory1"/> </createData> - <createData entity="SimpleProduct" stepKey="createSimpleProduct22"> <requiredEntity createDataKey="createCategory1"/> </createData> - <createData entity="SimpleProduct" stepKey="createSimpleProduct23"> <requiredEntity createDataKey="createCategory1"/> </createData> - <createData entity="SimpleProduct" stepKey="createSimpleProduct24"> <requiredEntity createDataKey="createCategory1"/> </createData> - <createData entity="SimpleProduct" stepKey="createSimpleProduct25"> <requiredEntity createDataKey="createCategory1"/> </createData> - <createData entity="SimpleProduct" stepKey="createSimpleProduct26"> <requiredEntity createDataKey="createCategory1"/> </createData> @@ -118,7 +106,6 @@ <createData entity="SimpleProduct" stepKey="createSimpleProduct28"> <requiredEntity createDataKey="createCategory1"/> </createData> - <createData entity="SimpleProduct" stepKey="createSimpleProduct29"> <requiredEntity createDataKey="createCategory1"/> </createData> @@ -126,71 +113,65 @@ <requiredEntity createDataKey="createCategory1"/> </createData> - <!--Enable ElasticSearch as search engine.--> - <magentoCLI command="config:set {{SearchEngineElasticsearchConfigData.path}} {{SearchEngineElasticsearchConfigData.value}}" stepKey="enableElasticSearchAsSearchEngine"/> - <magentoCLI command="indexer:reindex" stepKey="performReindexAfterElasticSearchEnable"/> - <magentoCLI command="cache:flush" stepKey="cleanCacheAfterElasticSearchEnable"/> - + <actionGroup ref="CliRunReindexUsingCronJobsActionGroup" stepKey="reindexInvalidatedIndices"/> + <magentoCLI command="indexer:reindex" arguments="catalogsearch_fulltext" stepKey="performReindex"/> + <magentoCLI command="cache:clean" arguments="full_page" stepKey="cleanFullPageCache"/> </before> - <after> - <!--Delete created products, category --> - <deleteData createDataKey="createCategory1" stepKey="deleteCategory"/> - <deleteData createDataKey="createSimpleProduct" stepKey="deleteSimpleProduct1"/> - <deleteData createDataKey="createSimpleProduct2" stepKey="deleteSimpleProduct2"/> - <deleteData createDataKey="createSimpleProduct3" stepKey="deleteSimpleProduct3"/> - <deleteData createDataKey="createSimpleProduct4" stepKey="deleteSimpleProduct4"/> - <deleteData createDataKey="createSimpleProduct5" stepKey="deleteSimpleProduct5"/> - <deleteData createDataKey="createSimpleProduct6" stepKey="deleteSimpleProduct6"/> - <deleteData createDataKey="createSimpleProduct7" stepKey="deleteSimpleProduct7"/> - <deleteData createDataKey="createSimpleProduct8" stepKey="deleteSimpleProduct8"/> - <deleteData createDataKey="createSimpleProduct9" stepKey="deleteSimpleProduct9"/> - <deleteData createDataKey="createSimpleProduct10" stepKey="deleteSimpleProduct10"/> - <deleteData createDataKey="createSimpleProduct11" stepKey="deleteSimpleProduct11"/> - <deleteData createDataKey="createSimpleProduct12" stepKey="deleteSimpleProduct12"/> - <deleteData createDataKey="createSimpleProduct13" stepKey="deleteSimpleProduct13"/> - <deleteData createDataKey="createSimpleProduct14" stepKey="deleteSimpleProduct14"/> - <deleteData createDataKey="createSimpleProduct15" stepKey="deleteSimpleProduct15"/> - <deleteData createDataKey="createSimpleProduct16" stepKey="deleteSimpleProduct16"/> - <deleteData createDataKey="createSimpleProduct17" stepKey="deleteSimpleProduct17"/> - <deleteData createDataKey="createSimpleProduct18" stepKey="deleteSimpleProduct18"/> - <deleteData createDataKey="createSimpleProduct19" stepKey="deleteSimpleProduct19"/> - <deleteData createDataKey="createSimpleProduct20" stepKey="deleteSimpleProduct20"/> - <deleteData createDataKey="createSimpleProduct21" stepKey="deleteSimpleProduct21"/> - <deleteData createDataKey="createSimpleProduct22" stepKey="deleteSimpleProduct22"/> - <deleteData createDataKey="createSimpleProduct23" stepKey="deleteSimpleProduct23"/> - <deleteData createDataKey="createSimpleProduct24" stepKey="deleteSimpleProduct24"/> - <deleteData createDataKey="createSimpleProduct25" stepKey="deleteSimpleProduct25"/> - <deleteData createDataKey="createSimpleProduct26" stepKey="deleteSimpleProduct26"/> - <deleteData createDataKey="createSimpleProduct27" stepKey="deleteSimpleProduct27"/> - <deleteData createDataKey="createSimpleProduct28" stepKey="deleteSimpleProduct28"/> - <deleteData createDataKey="createSimpleProduct29" stepKey="deleteSimpleProduct29"/> - <deleteData createDataKey="createSimpleProduct30" stepKey="deleteSimpleProduct30"/> - - <!--Revert ElasticSearch as search engine.--> - <actionGroup ref="ResetSearchEngineConfigurationActionGroup" stepKey="resetCatalogSearchConfiguration"/> - <magentoCLI command="indexer:reindex" stepKey="performReindexAfterElasticSearchDisable"/> - <magentoCLI command="cache:flush" stepKey="cleanCacheAfterElasticSearchDisable"/> - <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> - </after> + <after> + <!--Delete created products, category --> + <deleteData createDataKey="createCategory1" stepKey="deleteCategory"/> + <deleteData createDataKey="createSimpleProduct" stepKey="deleteSimpleProduct1"/> + <deleteData createDataKey="createSimpleProduct2" stepKey="deleteSimpleProduct2"/> + <deleteData createDataKey="createSimpleProduct3" stepKey="deleteSimpleProduct3"/> + <deleteData createDataKey="createSimpleProduct4" stepKey="deleteSimpleProduct4"/> + <deleteData createDataKey="createSimpleProduct5" stepKey="deleteSimpleProduct5"/> + <deleteData createDataKey="createSimpleProduct6" stepKey="deleteSimpleProduct6"/> + <deleteData createDataKey="createSimpleProduct7" stepKey="deleteSimpleProduct7"/> + <deleteData createDataKey="createSimpleProduct8" stepKey="deleteSimpleProduct8"/> + <deleteData createDataKey="createSimpleProduct9" stepKey="deleteSimpleProduct9"/> + <deleteData createDataKey="createSimpleProduct10" stepKey="deleteSimpleProduct10"/> + <deleteData createDataKey="createSimpleProduct11" stepKey="deleteSimpleProduct11"/> + <deleteData createDataKey="createSimpleProduct12" stepKey="deleteSimpleProduct12"/> + <deleteData createDataKey="createSimpleProduct13" stepKey="deleteSimpleProduct13"/> + <deleteData createDataKey="createSimpleProduct14" stepKey="deleteSimpleProduct14"/> + <deleteData createDataKey="createSimpleProduct15" stepKey="deleteSimpleProduct15"/> + <deleteData createDataKey="createSimpleProduct16" stepKey="deleteSimpleProduct16"/> + <deleteData createDataKey="createSimpleProduct17" stepKey="deleteSimpleProduct17"/> + <deleteData createDataKey="createSimpleProduct18" stepKey="deleteSimpleProduct18"/> + <deleteData createDataKey="createSimpleProduct19" stepKey="deleteSimpleProduct19"/> + <deleteData createDataKey="createSimpleProduct20" stepKey="deleteSimpleProduct20"/> + <deleteData createDataKey="createSimpleProduct21" stepKey="deleteSimpleProduct21"/> + <deleteData createDataKey="createSimpleProduct22" stepKey="deleteSimpleProduct22"/> + <deleteData createDataKey="createSimpleProduct23" stepKey="deleteSimpleProduct23"/> + <deleteData createDataKey="createSimpleProduct24" stepKey="deleteSimpleProduct24"/> + <deleteData createDataKey="createSimpleProduct25" stepKey="deleteSimpleProduct25"/> + <deleteData createDataKey="createSimpleProduct26" stepKey="deleteSimpleProduct26"/> + <deleteData createDataKey="createSimpleProduct27" stepKey="deleteSimpleProduct27"/> + <deleteData createDataKey="createSimpleProduct28" stepKey="deleteSimpleProduct28"/> + <deleteData createDataKey="createSimpleProduct29" stepKey="deleteSimpleProduct29"/> + <deleteData createDataKey="createSimpleProduct30" stepKey="deleteSimpleProduct30"/> + </after> <!--Open Storefront on the myCategory page--> - <amOnPage url="/$$createCategory1.name$$.html" stepKey="GoToStorefrontCategory"/> - <waitForPageLoad stepKey="waitForStorefrontCategoryPageLoad"/> + <actionGroup ref="StorefrontNavigateCategoryPageActionGroup" stepKey="goToStorefrontCategory"> + <argument name="category" value="$createCategory1$"/> + </actionGroup> + <waitForPageLoad stepKey="waitForStorefrontCategoryPageLoad"/> <!--Select 12 items per page and verify number of products displayed in each page --> <conditionalClick selector="{{StorefrontCategoryTopToolbarSection.gridMode}}" visible="true" dependentSelector="{{StorefrontCategoryTopToolbarSection.gridMode}}" stepKey="seeProductGridIsActive"/> - <scrollTo selector="{{StorefrontCategoryBottomToolbarSection.perPage}}" stepKey="scrollToBottomToolbarSection"/> + <scrollTo selector="{{StorefrontCategoryBottomToolbarSection.perPage}}" stepKey="scrollToBottomToolbarSection"/> <selectOption selector="{{StorefrontCategoryBottomToolbarSection.perPage}}" userInput="12" stepKey="selectPerPageOption"/> <!--Verify number of products displayed in First Page --> - <seeNumberOfElements selector="{{StorefrontCategoryMainSection.productLink}}" userInput="12" stepKey="seeNumberOfProductsInFirstPage"/> + <seeNumberOfElements selector="{{StorefrontCategoryMainSection.productLink}}" userInput="12" stepKey="seeNumberOfProductsInFirstPage"/> <!--Verify number of products displayed in Second Page --> - <scrollTo selector="{{StorefrontCategoryBottomToolbarSection.nextPage}}" stepKey="scrollToNextButton"/> + <scrollTo selector="{{StorefrontCategoryBottomToolbarSection.nextPage}}" stepKey="scrollToNextButton"/> <click selector="{{StorefrontCategoryBottomToolbarSection.nextPage}}" stepKey="clickOnNextPage"/> <waitForPageLoad stepKey="waitForPageToLoad4"/> <seeNumberOfElements selector="{{StorefrontCategoryMainSection.productLink}}" userInput="12" stepKey="seeNumberOfProductsInSecondPage"/> <!--Verify number of products displayed in third Page --> - <scrollTo selector="{{StorefrontCategoryBottomToolbarSection.nextPage}}" stepKey="scrollToNextButton1"/> + <scrollTo selector="{{StorefrontCategoryBottomToolbarSection.nextPage}}" stepKey="scrollToNextButton1"/> <click selector="{{StorefrontCategoryBottomToolbarSection.nextPage}}" stepKey="clickOnNextPage1"/> <waitForPageLoad stepKey="waitForPageToLoad2"/> <seeNumberOfElements selector="{{StorefrontCategoryMainSection.productLink}}" userInput="6" stepKey="seeNumberOfProductsInThirdPage"/> @@ -201,11 +182,11 @@ <waitForPageLoad stepKey="waitForPageToLoad9"/> <seeNumberOfElements selector="{{StorefrontCategoryMainSection.productLink}}" userInput="12" stepKey="seeNumberOfProductsFirstPage2"/> <!--Select 24 items per page and verify number of products displayed in each page --> - <scrollTo selector="{{StorefrontCategoryBottomToolbarSection.perPage}}" stepKey="scrollToPerPage"/> + <scrollTo selector="{{StorefrontCategoryBottomToolbarSection.perPage}}" stepKey="scrollToPerPage"/> <selectOption selector="{{StorefrontCategoryBottomToolbarSection.perPage}}" userInput="24" stepKey="selectPerPageOption1"/> <waitForPageLoad stepKey="waitForPageToLoad10"/> <seeNumberOfElements selector="{{StorefrontCategoryMainSection.productLink}}" userInput="24" stepKey="seeNumberOfProductsInFirstPage3"/> - <scrollTo selector="{{StorefrontCategoryBottomToolbarSection.nextPage}}" stepKey="scrollToNextButton2"/> + <scrollTo selector="{{StorefrontCategoryBottomToolbarSection.nextPage}}" stepKey="scrollToNextButton2"/> <click selector="{{StorefrontCategoryBottomToolbarSection.nextPage}}" stepKey="clickOnNextPage2"/> <waitForPageLoad stepKey="waitForPageToLoad11"/> <seeNumberOfElements selector="{{StorefrontCategoryMainSection.productLink}}" userInput="6" stepKey="seeNumberOfProductsInSecondPage3"/> @@ -214,7 +195,7 @@ <click selector="{{StorefrontCategoryBottomToolbarSection.pageNumber('1')}}" stepKey="clickOnFirstPage2"/> <waitForPageLoad stepKey="waitForPageToLoad13"/> <!--Select 36 items per page and verify number of products displayed in each page --> - <scrollTo selector="{{StorefrontCategoryBottomToolbarSection.perPage}}" stepKey="scrollToPerPage4"/> + <scrollTo selector="{{StorefrontCategoryBottomToolbarSection.perPage}}" stepKey="scrollToPerPage4"/> <selectOption selector="{{StorefrontCategoryBottomToolbarSection.perPage}}" userInput="36" stepKey="selectPerPageOption2"/> <waitForPageLoad stepKey="waitForPageToLoad12"/> <seeNumberOfElements selector="{{StorefrontCategoryMainSection.productLink}}" userInput="30" stepKey="seeNumberOfProductsInFirstPage4"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/StoreFrontRecentlyViewedAtStoreLevelTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/StoreFrontRecentlyViewedAtStoreLevelTest.xml index d84e2283b2dd4..16f3c6ae25436 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/StoreFrontRecentlyViewedAtStoreLevelTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/StoreFrontRecentlyViewedAtStoreLevelTest.xml @@ -18,7 +18,7 @@ <group value="WYSIWYGDisabled"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <!--Create Simple Product and Category --> <createData entity="SimpleSubCategory" stepKey="createCategory"/> <createData entity="SimpleProduct" stepKey="createSimpleProduct1"> @@ -73,7 +73,7 @@ <argument name="pageId" value="{{CmsHomePageContent.page_id}}"/> </actionGroup> <!-- Logout Admin --> - <actionGroup ref="logout" stepKey="logout"/> + <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> <magentoCLI command="indexer:reindex" stepKey="reindex"/> <magentoCLI command="cache:flush" stepKey="flushCacheAfterDeletion"/> </after> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/StoreFrontRecentlyViewedAtStoreViewLevelTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/StoreFrontRecentlyViewedAtStoreViewLevelTest.xml index d454a3d24e273..9fbdde86bb5ee 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/StoreFrontRecentlyViewedAtStoreViewLevelTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/StoreFrontRecentlyViewedAtStoreViewLevelTest.xml @@ -18,7 +18,7 @@ <group value="WYSIWYGDisabled"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <!--Create Simple Product and Category --> <createData entity="SimpleSubCategory" stepKey="createCategory"/> <createData entity="SimpleProduct" stepKey="createSimpleProduct1"> @@ -63,7 +63,7 @@ </actionGroup> <!-- Logout Admin --> - <actionGroup ref="logout" stepKey="logout"/> + <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> <magentoCLI command="indexer:reindex" stepKey="reindex"/> <magentoCLI command="cache:flush" stepKey="flushCacheAfterDeletion"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/StoreFrontSimpleProductWithSpecialAndTierDiscountPriceTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/StoreFrontSimpleProductWithSpecialAndTierDiscountPriceTest.xml index d642f16160c5b..c38ea2de558e1 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/StoreFrontSimpleProductWithSpecialAndTierDiscountPriceTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/StoreFrontSimpleProductWithSpecialAndTierDiscountPriceTest.xml @@ -32,7 +32,7 @@ <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> </after> - <actionGroup ref="LoginAsAdmin" stepKey="LoginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="LoginAsAdmin"/> <actionGroup ref="AdminProductPageOpenByIdActionGroup" stepKey="openAdminProductEditPage"> <argument name="productId" value="$createProduct.id$"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontCatalogNavigationMenuUIDesktopTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontCatalogNavigationMenuUIDesktopTest.xml index 2f4b6a90bd1e5..2a59be6306a30 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontCatalogNavigationMenuUIDesktopTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontCatalogNavigationMenuUIDesktopTest.xml @@ -20,7 +20,7 @@ </annotations> <before> <!-- Login as admin --> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> </before> <after> <actionGroup ref="AdminChangeStorefrontThemeActionGroup" stepKey="changeThemeToDefault"> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontCategoryHighlightedAndProductDisplayedTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontCategoryHighlightedAndProductDisplayedTest.xml index 00f9608d07c3e..b6ba5245645eb 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontCategoryHighlightedAndProductDisplayedTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontCategoryHighlightedAndProductDisplayedTest.xml @@ -20,7 +20,7 @@ <group value="Catalog"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <createData entity="SimpleSubCategory" stepKey="category1"/> <createData entity="SimpleSubCategory" stepKey="category2"/> <createData entity="SimpleSubCategory" stepKey="category3"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontCheckDefaultNumberProductsToDisplayTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontCheckDefaultNumberProductsToDisplayTest.xml index aacce53819178..b13c3827c6727 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontCheckDefaultNumberProductsToDisplayTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontCheckDefaultNumberProductsToDisplayTest.xml @@ -21,7 +21,7 @@ <before> <!-- Login as Admin --> <comment userInput="Login as Admin" stepKey="commentLoginAsAdmin"/> - <actionGroup ref="LoginAsAdmin" stepKey="login"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="login"/> <!--Create 37 Products and Subcategory --> <comment userInput="Create 37 Products and Subcategory" stepKey="commentCreateData"/> <createData entity="SimpleSubCategory" stepKey="createCategory"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontConfigurableOptionsThumbImagesTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontConfigurableOptionsThumbImagesTest.xml index 059b90532f8f9..c22f91b5394ea 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontConfigurableOptionsThumbImagesTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontConfigurableOptionsThumbImagesTest.xml @@ -19,7 +19,7 @@ </annotations> <before> <!-- Login as Admin --> - <actionGroup ref="LoginAsAdmin" stepKey="loginToAdminPanel"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginToAdminPanel"/> <!-- Create Default Category --> <createData entity="_defaultCategory" stepKey="createCategory"/> @@ -162,7 +162,7 @@ <deleteData createDataKey="createConfigChildProduct1" stepKey="deleteConfigChildProduct1"/> <deleteData createDataKey="createConfigChildProduct2" stepKey="deleteConfigChildProduct2"/> <deleteData createDataKey="createConfigProductAttribute" stepKey="deleteAttribute"/> - <actionGroup ref="logout" stepKey="logout"/> + <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> <!-- Reindex invalidated indices after product attribute has been created/deleted --> <actionGroup ref="CliRunReindexUsingCronJobsActionGroup" stepKey="reindexInvalidatedIndices"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontEnsureThatAccordionAnchorIsVisibleOnViewportOnceClickedTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontEnsureThatAccordionAnchorIsVisibleOnViewportOnceClickedTest.xml index be063d2387b25..8acc6272d5da4 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontEnsureThatAccordionAnchorIsVisibleOnViewportOnceClickedTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontEnsureThatAccordionAnchorIsVisibleOnViewportOnceClickedTest.xml @@ -52,7 +52,7 @@ </createData> <!-- Login as admin --> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> </before> <after> <!-- Delete reviews --> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontFotoramaArrowsTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontFotoramaArrowsTest.xml index 68d847907a448..df1eb0c502e18 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontFotoramaArrowsTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontFotoramaArrowsTest.xml @@ -21,7 +21,7 @@ <createData entity="_defaultProduct" stepKey="createProduct"> <requiredEntity createDataKey="createCategory"/> </createData> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> </before> <after> <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontProductNameWithDoubleQuoteTest/StorefrontProductNameWithDoubleQuoteTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontProductNameWithDoubleQuoteTest/StorefrontProductNameWithDoubleQuoteTest.xml index 5c13e5a47973a..bcd5d7b851db3 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontProductNameWithDoubleQuoteTest/StorefrontProductNameWithDoubleQuoteTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontProductNameWithDoubleQuoteTest/StorefrontProductNameWithDoubleQuoteTest.xml @@ -24,7 +24,7 @@ <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> </after> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <!--Create product via admin--> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="goToProductIndex"/> <waitForPageLoad stepKey="waitForProductIndexPage"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontProductWithEmptyAttributeTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontProductWithEmptyAttributeTest.xml index 40733b120f1e8..a311b63418a69 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontProductWithEmptyAttributeTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontProductWithEmptyAttributeTest.xml @@ -33,7 +33,7 @@ <!-- Reindex invalidated indices after product attribute has been created/deleted --> <magentoCron groups="index" stepKey="reindexInvalidatedIndices"/> </after> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin1"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin1"/> <amOnPage url="{{AdminProductAttributeSetGridPage.url}}" stepKey="amOnAttributeSetPage"/> <click selector="{{AdminProductAttributeSetGridSection.AttributeSetName('Default')}}" stepKey="chooseDefaultAttributeSet"/> <waitForPageLoad stepKey="waitForAttributeSetPageLoad"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontProductsCompareWithEmptyAttributeTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontProductsCompareWithEmptyAttributeTest.xml index 849de20991c62..c7817ed181ae0 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontProductsCompareWithEmptyAttributeTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontProductsCompareWithEmptyAttributeTest.xml @@ -37,7 +37,7 @@ <!-- Reindex invalidated indices after product attribute has been created/deleted --> <magentoCron groups="index" stepKey="reindexInvalidatedIndices"/> </after> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin1"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin1"/> <amOnPage url="{{AdminProductAttributeSetGridPage.url}}" stepKey="amOnAttributeSetPage"/> <click selector="{{AdminProductAttributeSetGridSection.AttributeSetName('Default')}}" stepKey="chooseDefaultAttributeSet"/> <waitForPageLoad stepKey="waitForAttributeSetPageLoad"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontPurchaseProductCustomOptionsDifferentStoreViewsTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontPurchaseProductCustomOptionsDifferentStoreViewsTest.xml index a8ab4cca1ac78..5659f053613c2 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontPurchaseProductCustomOptionsDifferentStoreViewsTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontPurchaseProductCustomOptionsDifferentStoreViewsTest.xml @@ -32,7 +32,7 @@ <field key="price">100</field> </createData> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin1"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin1"/> <!--Create storeView 1--> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontPurchaseProductWithCustomOptionsTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontPurchaseProductWithCustomOptionsTest.xml index 066337bf25cb6..09b596f298e0f 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontPurchaseProductWithCustomOptionsTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontPurchaseProductWithCustomOptionsTest.xml @@ -128,7 +128,7 @@ <!-- Login to Admin and open Order --> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin1"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin1"/> <actionGroup ref="FilterOrderGridByIdActionGroup" stepKey="filterByOrderId"> <argument name="orderId" value="$grabOrderNumber"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontPurchaseProductWithCustomOptionsWithLongValuesTitleTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontPurchaseProductWithCustomOptionsWithLongValuesTitleTest.xml index b8aed7f0ac2ad..3c1dc2bc844cf 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontPurchaseProductWithCustomOptionsWithLongValuesTitleTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontPurchaseProductWithCustomOptionsWithLongValuesTitleTest.xml @@ -96,7 +96,7 @@ <!-- Login to Admin and open Order --> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin1"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin1"/> <amOnPage url="{{AdminOrdersPage.url}}" stepKey="onOrdersPage"/> <waitForLoadingMaskToDisappear stepKey="waitForLoadingMaskToDisappearOnOrdersPage"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontSpecialPriceForDifferentTimezonesForWebsitesTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontSpecialPriceForDifferentTimezonesForWebsitesTest.xml index 5bc8427db022f..0dccc409a1032 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontSpecialPriceForDifferentTimezonesForWebsitesTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontSpecialPriceForDifferentTimezonesForWebsitesTest.xml @@ -20,7 +20,7 @@ <group value="Catalog"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="login"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="login"/> <!--Create product--> <createData entity="SimpleProduct2" stepKey="createProduct"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/TieredPricingAndQuantityIncrementsWorkWithDecimalinventoryTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/TieredPricingAndQuantityIncrementsWorkWithDecimalinventoryTest.xml index 0413018128491..26cebae318cd9 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/TieredPricingAndQuantityIncrementsWorkWithDecimalinventoryTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/TieredPricingAndQuantityIncrementsWorkWithDecimalinventoryTest.xml @@ -29,7 +29,7 @@ <deleteData createDataKey="createPreReqSimpleProduct" stepKey="deletePreReqSimpleProduct"/> </after> <!--Step1. Login as admin. Go to Catalog > Products page. Filtering *prod1*. Open *prod1* to edit--> - <actionGroup ref="LoginAsAdmin" stepKey="LoginAsAdmin" /> + <actionGroup ref="AdminLoginActionGroup" stepKey="LoginAsAdmin" /> <actionGroup ref="SearchForProductOnBackendActionGroup" stepKey="filterGroupedProductOptions"> <argument name="product" value="SimpleProduct"/> </actionGroup> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/VerifyCategoryProductAndProductCategoryPartialReindexTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/VerifyCategoryProductAndProductCategoryPartialReindexTest.xml index c30c750fec10c..b4514c9b53736 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/VerifyCategoryProductAndProductCategoryPartialReindexTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/VerifyCategoryProductAndProductCategoryPartialReindexTest.xml @@ -49,7 +49,7 @@ <!-- Product C in 2 categories M and N --> <createData entity="SimpleProduct2" stepKey="productC"/> - <actionGroup ref="LoginAsAdmin" stepKey="LoginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="LoginAsAdmin"/> <actionGroup ref="AdminAssignProductToCategoryActionGroup" stepKey="assignCategoryNAndMToProductC"> <argument name="productId" value="$$productC.id$$"/> <argument name="categoryName" value="$$categoryN.name$$, $$categoryM.name$$"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/VerifyChildCategoriesShouldNotIncludeInMenuTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/VerifyChildCategoriesShouldNotIncludeInMenuTest.xml index 2a6a05c8ffeab..94b16ac8bddce 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/VerifyChildCategoriesShouldNotIncludeInMenuTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/VerifyChildCategoriesShouldNotIncludeInMenuTest.xml @@ -27,7 +27,7 @@ </actionGroup> <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> </after> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <amOnPage url="{{AdminCategoryPage.url}}" stepKey="navigateToCategoryPage1"/> <waitForPageLoad stepKey="waitForPageLoad1"/> <scrollToTopOfPage stepKey="scrollToTopOfPage"/> diff --git a/app/code/Magento/Catalog/Test/Unit/Model/Indexer/Product/Flat/Action/RowTest.php b/app/code/Magento/Catalog/Test/Unit/Model/Indexer/Product/Flat/Action/RowTest.php index 11d07872fef91..61fad897c6418 100644 --- a/app/code/Magento/Catalog/Test/Unit/Model/Indexer/Product/Flat/Action/RowTest.php +++ b/app/code/Magento/Catalog/Test/Unit/Model/Indexer/Product/Flat/Action/RowTest.php @@ -160,8 +160,24 @@ public function testExecuteWithExistingFlatTablesCreatesTables() ->willReturn('store_flat_table'); $this->connection->expects($this->any())->method('isTableExists')->with('store_flat_table') ->willReturn(true); + $this->connection->expects($this->any())->method('fetchCol') + ->willReturn(['store_id_1']); $this->flatItemEraser->expects($this->once())->method('removeDeletedProducts'); $this->flatTableBuilder->expects($this->never())->method('build')->with('store_id_1', ['product_id_1']); $this->model->execute('product_id_1'); } + + public function testExecuteWithExistingFlatTablesRemoveProductFromStore() + { + $this->productIndexerHelper->expects($this->any())->method('getFlatTableName') + ->willReturn('store_flat_table'); + $this->connection->expects($this->any())->method('isTableExists')->with('store_flat_table') + ->willReturn(true); + $this->connection->expects($this->any())->method('fetchCol') + ->willReturn([1]); + $this->flatItemEraser->expects($this->once())->method('deleteProductsFromStore'); + $this->flatItemEraser->expects($this->never())->method('removeDeletedProducts'); + $this->flatTableBuilder->expects($this->never())->method('build')->with('store_id_1', ['product_id_1']); + $this->model->execute('product_id_1'); + } } diff --git a/app/code/Magento/Catalog/view/frontend/web/js/catalog-add-to-cart.js b/app/code/Magento/Catalog/view/frontend/web/js/catalog-add-to-cart.js index 382b4ef98532b..7d3e4b3280473 100644 --- a/app/code/Magento/Catalog/view/frontend/web/js/catalog-add-to-cart.js +++ b/app/code/Magento/Catalog/view/frontend/web/js/catalog-add-to-cart.js @@ -8,8 +8,9 @@ define([ 'mage/translate', 'underscore', 'Magento_Catalog/js/product/view/product-ids-resolver', + 'Magento_Catalog/js/product/view/product-info-resolver', 'jquery-ui-modules/widget' -], function ($, $t, _, idsResolver) { +], function ($, $t, _, idsResolver, productInfoResolver) { 'use strict'; $.widget('mage.catalogAddToCart', { @@ -24,7 +25,8 @@ define([ addToCartButtonDisabledClass: 'disabled', addToCartButtonTextWhileAdding: '', addToCartButtonTextAdded: '', - addToCartButtonTextDefault: '' + addToCartButtonTextDefault: '', + productInfoResolver: productInfoResolver }, /** @inheritdoc */ @@ -90,6 +92,7 @@ define([ ajaxSubmit: function (form) { var self = this, productIds = idsResolver(form), + productInfo = self.options.productInfoResolver(form), formData; $(self.options.minicartSelector).trigger('contentLoading'); @@ -119,6 +122,7 @@ define([ $(document).trigger('ajax:addToCart', { 'sku': form.data().productSku, 'productIds': productIds, + 'productInfo': productInfo, 'form': form, 'response': res }); @@ -172,6 +176,7 @@ define([ $(document).trigger('ajax:addToCart:error', { 'sku': form.data().productSku, 'productIds': productIds, + 'productInfo': productInfo, 'form': form, 'response': res }); diff --git a/app/code/Magento/Catalog/view/frontend/web/js/product/view/product-info-resolver.js b/app/code/Magento/Catalog/view/frontend/web/js/product/view/product-info-resolver.js new file mode 100644 index 0000000000000..f58f0ba2dfa68 --- /dev/null +++ b/app/code/Magento/Catalog/view/frontend/web/js/product/view/product-info-resolver.js @@ -0,0 +1,35 @@ +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +define([ + 'underscore', + 'Magento_Catalog/js/product/view/product-info' +], function (_, productInfo) { + 'use strict'; + + /** + * Returns info about products in form. + * + * @param {jQuery} $form + * @return {Array} + */ + return function ($form) { + var product = _.findWhere($form.serializeArray(), { + name: 'product' + }); + + if (!_.isUndefined(product)) { + productInfo().push( + { + 'id': product.value + } + ); + } + + return _.uniq(productInfo(), function (item) { + return item.id; + }); + }; +}); + diff --git a/app/code/Magento/Catalog/view/frontend/web/js/product/view/product-info.js b/app/code/Magento/Catalog/view/frontend/web/js/product/view/product-info.js new file mode 100644 index 0000000000000..2198b7b8e48b0 --- /dev/null +++ b/app/code/Magento/Catalog/view/frontend/web/js/product/view/product-info.js @@ -0,0 +1,12 @@ +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +define([ + 'ko' +], function (ko) { + 'use strict'; + + return ko.observableArray([]); +}); diff --git a/app/code/Magento/CatalogImportExport/Test/Mftf/Test/AdminExportBundleProductTest.xml b/app/code/Magento/CatalogImportExport/Test/Mftf/Test/AdminExportBundleProductTest.xml index 6dab378fe6456..2b4609f1219df 100644 --- a/app/code/Magento/CatalogImportExport/Test/Mftf/Test/AdminExportBundleProductTest.xml +++ b/app/code/Magento/CatalogImportExport/Test/Mftf/Test/AdminExportBundleProductTest.xml @@ -85,7 +85,7 @@ <magentoCLI command="cron:run" stepKey="runCron2"/> <!-- Login as admin --> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> </before> <after> <!-- Delete products creations --> diff --git a/app/code/Magento/CatalogImportExport/Test/Mftf/Test/AdminExportGroupedProductWithSpecialPriceTest.xml b/app/code/Magento/CatalogImportExport/Test/Mftf/Test/AdminExportGroupedProductWithSpecialPriceTest.xml index 8f9e1bd49af0e..3449a39679666 100644 --- a/app/code/Magento/CatalogImportExport/Test/Mftf/Test/AdminExportGroupedProductWithSpecialPriceTest.xml +++ b/app/code/Magento/CatalogImportExport/Test/Mftf/Test/AdminExportGroupedProductWithSpecialPriceTest.xml @@ -53,7 +53,7 @@ <magentoCLI command="cron:run" stepKey="runCron2"/> <!-- Login as admin --> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> </before> <after> <!-- Deleted created products --> diff --git a/app/code/Magento/CatalogImportExport/Test/Mftf/Test/AdminExportImportConfigurableProductWithImagesTest.xml b/app/code/Magento/CatalogImportExport/Test/Mftf/Test/AdminExportImportConfigurableProductWithImagesTest.xml index 6b6ee2e0fcc58..64b1680d2e9a1 100644 --- a/app/code/Magento/CatalogImportExport/Test/Mftf/Test/AdminExportImportConfigurableProductWithImagesTest.xml +++ b/app/code/Magento/CatalogImportExport/Test/Mftf/Test/AdminExportImportConfigurableProductWithImagesTest.xml @@ -127,7 +127,7 @@ </createData> <!-- Login as admin --> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> </before> <after> <!-- Remove downloadable domains --> diff --git a/app/code/Magento/CatalogImportExport/Test/Mftf/Test/AdminExportSimpleAndConfigurableProductsWithCustomOptionsTest.xml b/app/code/Magento/CatalogImportExport/Test/Mftf/Test/AdminExportSimpleAndConfigurableProductsWithCustomOptionsTest.xml index 1168033172d23..ac730a6c6a7cc 100644 --- a/app/code/Magento/CatalogImportExport/Test/Mftf/Test/AdminExportSimpleAndConfigurableProductsWithCustomOptionsTest.xml +++ b/app/code/Magento/CatalogImportExport/Test/Mftf/Test/AdminExportSimpleAndConfigurableProductsWithCustomOptionsTest.xml @@ -78,7 +78,7 @@ <magentoCLI command="cron:run" stepKey="runCron2"/> <!-- Login as admin --> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> </before> <after> <!-- Delete configurable product creation --> diff --git a/app/code/Magento/CatalogImportExport/Test/Mftf/Test/AdminExportSimpleProductAndConfigurableProductsWithAssignedImagesTest.xml b/app/code/Magento/CatalogImportExport/Test/Mftf/Test/AdminExportSimpleProductAndConfigurableProductsWithAssignedImagesTest.xml index cc25baee2c9f4..a0a3efdedadc8 100644 --- a/app/code/Magento/CatalogImportExport/Test/Mftf/Test/AdminExportSimpleProductAndConfigurableProductsWithAssignedImagesTest.xml +++ b/app/code/Magento/CatalogImportExport/Test/Mftf/Test/AdminExportSimpleProductAndConfigurableProductsWithAssignedImagesTest.xml @@ -94,7 +94,7 @@ <magentoCLI command="cron:run" stepKey="runCron2"/> <!-- Login as admin --> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> </before> <after> <!-- Delete configurable product creation --> diff --git a/app/code/Magento/CatalogImportExport/Test/Mftf/Test/AdminExportSimpleProductAssignedToMainWebsiteAndConfigurableProductAssignedToCustomWebsiteTest.xml b/app/code/Magento/CatalogImportExport/Test/Mftf/Test/AdminExportSimpleProductAssignedToMainWebsiteAndConfigurableProductAssignedToCustomWebsiteTest.xml index 13a0f92076a57..f9669dfbdac27 100644 --- a/app/code/Magento/CatalogImportExport/Test/Mftf/Test/AdminExportSimpleProductAssignedToMainWebsiteAndConfigurableProductAssignedToCustomWebsiteTest.xml +++ b/app/code/Magento/CatalogImportExport/Test/Mftf/Test/AdminExportSimpleProductAssignedToMainWebsiteAndConfigurableProductAssignedToCustomWebsiteTest.xml @@ -76,7 +76,7 @@ <magentoCLI command="cron:run" stepKey="runCron2"/> <!-- Login as admin --> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> </before> <after> diff --git a/app/code/Magento/CatalogImportExport/Test/Mftf/Test/AdminExportSimpleProductWithCustomAttributeTest.xml b/app/code/Magento/CatalogImportExport/Test/Mftf/Test/AdminExportSimpleProductWithCustomAttributeTest.xml index cd65416460ce6..2e8e62667b314 100644 --- a/app/code/Magento/CatalogImportExport/Test/Mftf/Test/AdminExportSimpleProductWithCustomAttributeTest.xml +++ b/app/code/Magento/CatalogImportExport/Test/Mftf/Test/AdminExportSimpleProductWithCustomAttributeTest.xml @@ -33,7 +33,7 @@ <magentoCLI command="cron:run" stepKey="runCron2"/> <!-- Login as admin --> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> </before> <after> <!-- Delete product creations --> diff --git a/app/code/Magento/CatalogInventory/Model/Quote/Item/QuantityValidator/Initializer/StockItem.php b/app/code/Magento/CatalogInventory/Model/Quote/Item/QuantityValidator/Initializer/StockItem.php index 7a46780f2d783..f104552b4e0fc 100644 --- a/app/code/Magento/CatalogInventory/Model/Quote/Item/QuantityValidator/Initializer/StockItem.php +++ b/app/code/Magento/CatalogInventory/Model/Quote/Item/QuantityValidator/Initializer/StockItem.php @@ -118,6 +118,10 @@ public function initialize( $product->getStore()->getWebsiteId() ); + if ($result->getHasError() === true && in_array($result->getErrorCode(), ['qty_available', 'out_stock'])) { + $quoteItem->setHasError(true); + } + /* We need to ensure that any possible plugin will not erase the data */ $backOrdersQty = $this->stockStateProvider->checkQuoteItemQty($stockItem, $rowQty, $qtyForCheck, $qty) ->getItemBackorders(); diff --git a/app/code/Magento/CatalogInventory/Model/StockStateProvider.php b/app/code/Magento/CatalogInventory/Model/StockStateProvider.php index 6851b05aa56a6..b57518b681aa2 100644 --- a/app/code/Magento/CatalogInventory/Model/StockStateProvider.php +++ b/app/code/Magento/CatalogInventory/Model/StockStateProvider.php @@ -14,7 +14,7 @@ use Magento\Framework\Math\Division as MathDivision; /** - * Interface StockStateProvider + * Provider stocks state */ class StockStateProvider implements StockStateProviderInterface { @@ -156,6 +156,7 @@ public function checkQuoteItemQty(StockItemInterface $stockItem, $qty, $summaryQ if (!$stockItem->getIsInStock()) { $result->setHasError(true) + ->setErrorCode('out_stock') ->setMessage(__('This product is out of stock.')) ->setQuoteMessage(__('Some of the products are out of stock.')) ->setQuoteMessageIndex('stock'); @@ -165,7 +166,11 @@ public function checkQuoteItemQty(StockItemInterface $stockItem, $qty, $summaryQ if (!$this->checkQty($stockItem, $summaryQty) || !$this->checkQty($stockItem, $qty)) { $message = __('The requested qty is not available'); - $result->setHasError(true)->setMessage($message)->setQuoteMessage($message)->setQuoteMessageIndex('qty'); + $result->setHasError(true) + ->setErrorCode('qty_available') + ->setMessage($message) + ->setQuoteMessage($message) + ->setQuoteMessageIndex('qty'); return $result; } else { if ($stockItem->getQty() - $summaryQty < 0) { diff --git a/app/code/Magento/CatalogInventory/Test/Mftf/Test/AdminCreateProductWithZeroMaximumQtyAllowedInShoppingCartTest.xml b/app/code/Magento/CatalogInventory/Test/Mftf/Test/AdminCreateProductWithZeroMaximumQtyAllowedInShoppingCartTest.xml index edbf7451c6b6b..9db6f250dc114 100644 --- a/app/code/Magento/CatalogInventory/Test/Mftf/Test/AdminCreateProductWithZeroMaximumQtyAllowedInShoppingCartTest.xml +++ b/app/code/Magento/CatalogInventory/Test/Mftf/Test/AdminCreateProductWithZeroMaximumQtyAllowedInShoppingCartTest.xml @@ -23,7 +23,7 @@ <before> <createData entity="DefaultValueForMaxSaleQty" stepKey="setDefaultValueForMaxSaleQty"/> <createData entity="SimpleProduct2" stepKey="createdProduct"/> - <actionGroup ref="LoginAsAdmin" stepKey="login"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="login"/> </before> <after> <createData entity="DefaultValueForMaxSaleQty" stepKey="setDefaultValueForMaxSaleQty"/> diff --git a/app/code/Magento/CatalogInventory/Test/Mftf/Test/AssociatedProductToConfigurableOutOfStockTest.xml b/app/code/Magento/CatalogInventory/Test/Mftf/Test/AssociatedProductToConfigurableOutOfStockTest.xml index b1ab6a598eb88..b291fb46ae71c 100644 --- a/app/code/Magento/CatalogInventory/Test/Mftf/Test/AssociatedProductToConfigurableOutOfStockTest.xml +++ b/app/code/Magento/CatalogInventory/Test/Mftf/Test/AssociatedProductToConfigurableOutOfStockTest.xml @@ -113,7 +113,7 @@ <waitForPageLoad stepKey="waitForOrderSuccessPage1"/> <grabTextFrom selector="{{CheckoutSuccessMainSection.orderNumber22}}" stepKey="grabOrderNumber"/> <actionGroup ref="StorefrontSignOutActionGroup" stepKey="StorefrontSignOutActionGroup"/> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin1"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin1"/> <amOnPage url="{{AdminOrdersPage.url}}" stepKey="onOrdersPage"/> <waitForLoadingMaskToDisappear stepKey="waitForLoadingMask3"/> diff --git a/app/code/Magento/CatalogInventory/etc/adminhtml/di.xml b/app/code/Magento/CatalogInventory/etc/adminhtml/di.xml index 4d90b2159d852..065d9c1878849 100644 --- a/app/code/Magento/CatalogInventory/etc/adminhtml/di.xml +++ b/app/code/Magento/CatalogInventory/etc/adminhtml/di.xml @@ -14,11 +14,6 @@ </argument> </arguments> </type> - <type name="Magento\CatalogInventory\Model\Spi\StockStateProviderInterface"> - <arguments> - <argument name="qtyCheckApplicable" xsi:type="boolean">false</argument> - </arguments> - </type> <type name="Magento\Catalog\Ui\DataProvider\Product\ProductDataProvider"> <arguments> <argument name="addFieldStrategies" xsi:type="array"> diff --git a/app/code/Magento/CatalogRule/Test/Mftf/Test/AdminApplyCatalogRuleByCategoryTest.xml b/app/code/Magento/CatalogRule/Test/Mftf/Test/AdminApplyCatalogRuleByCategoryTest.xml index b2ce64fe651c0..4d97338333be8 100644 --- a/app/code/Magento/CatalogRule/Test/Mftf/Test/AdminApplyCatalogRuleByCategoryTest.xml +++ b/app/code/Magento/CatalogRule/Test/Mftf/Test/AdminApplyCatalogRuleByCategoryTest.xml @@ -27,7 +27,7 @@ <requiredEntity createDataKey="createCategoryTwo"/> </createData> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> </before> <after> <deleteData createDataKey="createCategoryOne" stepKey="deleteCategoryOne"/> diff --git a/app/code/Magento/CatalogRule/Test/Mftf/Test/AdminApplyCatalogRuleForConfigurableProductWithSpecialPricesTest.xml b/app/code/Magento/CatalogRule/Test/Mftf/Test/AdminApplyCatalogRuleForConfigurableProductWithSpecialPricesTest.xml index f8b477e796c9d..9cc0090fef756 100644 --- a/app/code/Magento/CatalogRule/Test/Mftf/Test/AdminApplyCatalogRuleForConfigurableProductWithSpecialPricesTest.xml +++ b/app/code/Magento/CatalogRule/Test/Mftf/Test/AdminApplyCatalogRuleForConfigurableProductWithSpecialPricesTest.xml @@ -19,7 +19,7 @@ </annotations> <before> <!-- Login as Admin --> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <!-- Create category --> <createData entity="ApiCategory" stepKey="createCategory"/> diff --git a/app/code/Magento/CatalogRule/Test/Mftf/Test/AdminCreateCatalogPriceRuleTest/AdminCreateCatalogPriceRuleByPercentTest.xml b/app/code/Magento/CatalogRule/Test/Mftf/Test/AdminCreateCatalogPriceRuleTest/AdminCreateCatalogPriceRuleByPercentTest.xml index d033e03bb4916..8c3d1dad1b2a3 100644 --- a/app/code/Magento/CatalogRule/Test/Mftf/Test/AdminCreateCatalogPriceRuleTest/AdminCreateCatalogPriceRuleByPercentTest.xml +++ b/app/code/Magento/CatalogRule/Test/Mftf/Test/AdminCreateCatalogPriceRuleTest/AdminCreateCatalogPriceRuleByPercentTest.xml @@ -29,7 +29,7 @@ <magentoCLI command="cache:flush" stepKey="flushCache"/> <!-- log in and create the price rule --> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <actionGroup stepKey="createNewPriceRule" ref="NewCatalogPriceRuleByUIActionGroup"/> <actionGroup stepKey="selectNotLoggedInCustomerGroup" ref="SelectNotLoggedInCustomerGroupActionGroup"/> <click stepKey="saveAndApply" selector="{{AdminNewCatalogPriceRule.saveAndApply}}"/> diff --git a/app/code/Magento/CatalogRule/Test/Mftf/Test/AdminCreateCatalogPriceRuleTest/AdminCreateCatalogPriceRuleForCustomerGroupTest.xml b/app/code/Magento/CatalogRule/Test/Mftf/Test/AdminCreateCatalogPriceRuleTest/AdminCreateCatalogPriceRuleForCustomerGroupTest.xml index 93291104e7fc9..65ef23de65380 100644 --- a/app/code/Magento/CatalogRule/Test/Mftf/Test/AdminCreateCatalogPriceRuleTest/AdminCreateCatalogPriceRuleForCustomerGroupTest.xml +++ b/app/code/Magento/CatalogRule/Test/Mftf/Test/AdminCreateCatalogPriceRuleTest/AdminCreateCatalogPriceRuleForCustomerGroupTest.xml @@ -24,7 +24,7 @@ <requiredEntity createDataKey="createCategory"/> </createData> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> </before> <after> <!-- Delete the simple product and category --> diff --git a/app/code/Magento/CatalogRule/Test/Mftf/Test/AdminCreateCatalogPriceRuleTest/AdminCreateCatalogPriceRuleWithInvalidDataTest.xml b/app/code/Magento/CatalogRule/Test/Mftf/Test/AdminCreateCatalogPriceRuleTest/AdminCreateCatalogPriceRuleWithInvalidDataTest.xml index a4a7ba012ac98..90a0835508b06 100644 --- a/app/code/Magento/CatalogRule/Test/Mftf/Test/AdminCreateCatalogPriceRuleTest/AdminCreateCatalogPriceRuleWithInvalidDataTest.xml +++ b/app/code/Magento/CatalogRule/Test/Mftf/Test/AdminCreateCatalogPriceRuleTest/AdminCreateCatalogPriceRuleWithInvalidDataTest.xml @@ -17,7 +17,7 @@ <group value="CatalogRule"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> </before> <after> <amOnPage url="{{AdminLogoutPage.url}}" stepKey="amOnLogoutPage"/> diff --git a/app/code/Magento/CatalogRule/Test/Mftf/Test/AdminCreateInactiveCatalogPriceRuleTest.xml b/app/code/Magento/CatalogRule/Test/Mftf/Test/AdminCreateInactiveCatalogPriceRuleTest.xml index 4211f0fc76508..1d4b21cb04a60 100644 --- a/app/code/Magento/CatalogRule/Test/Mftf/Test/AdminCreateInactiveCatalogPriceRuleTest.xml +++ b/app/code/Magento/CatalogRule/Test/Mftf/Test/AdminCreateInactiveCatalogPriceRuleTest.xml @@ -18,7 +18,7 @@ </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="loginToAdminPanel"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginToAdminPanel"/> </before> <after> <actionGroup ref="AdminSearchCatalogRuleInGridActionGroup" stepKey="searchCreatedCatalogRule"> diff --git a/app/code/Magento/CatalogRule/Test/Mftf/Test/AdminDeleteCatalogPriceRuleEntityTest/AdminDeleteCatalogPriceRuleEntityFromConfigurableProductTest.xml b/app/code/Magento/CatalogRule/Test/Mftf/Test/AdminDeleteCatalogPriceRuleEntityTest/AdminDeleteCatalogPriceRuleEntityFromConfigurableProductTest.xml index 93797bcda5411..5fb33c9482709 100644 --- a/app/code/Magento/CatalogRule/Test/Mftf/Test/AdminDeleteCatalogPriceRuleEntityTest/AdminDeleteCatalogPriceRuleEntityFromConfigurableProductTest.xml +++ b/app/code/Magento/CatalogRule/Test/Mftf/Test/AdminDeleteCatalogPriceRuleEntityTest/AdminDeleteCatalogPriceRuleEntityFromConfigurableProductTest.xml @@ -75,7 +75,7 @@ <magentoCLI command="indexer:reindex" stepKey="reindex"/> <magentoCLI command="cache:flush" stepKey="flushCache"/> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin1"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin1"/> <amOnPage url="{{AdminNewCatalogPriceRulePage.url}}" stepKey="openNewCatalogPriceRulePage"/> <waitForPageLoad stepKey="waitForPageToLoad1"/> diff --git a/app/code/Magento/CatalogRule/Test/Mftf/Test/AdminDeleteCatalogPriceRuleEntityTest/AdminDeleteCatalogPriceRuleEntityFromSimpleProductTest.xml b/app/code/Magento/CatalogRule/Test/Mftf/Test/AdminDeleteCatalogPriceRuleEntityTest/AdminDeleteCatalogPriceRuleEntityFromSimpleProductTest.xml index 91ccfb458e98f..fc37fc893f871 100644 --- a/app/code/Magento/CatalogRule/Test/Mftf/Test/AdminDeleteCatalogPriceRuleEntityTest/AdminDeleteCatalogPriceRuleEntityFromSimpleProductTest.xml +++ b/app/code/Magento/CatalogRule/Test/Mftf/Test/AdminDeleteCatalogPriceRuleEntityTest/AdminDeleteCatalogPriceRuleEntityFromSimpleProductTest.xml @@ -25,7 +25,7 @@ <requiredEntity createDataKey="createCategory1"/> </createData> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin1"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin1"/> <amOnPage url="{{AdminNewCatalogPriceRulePage.url}}" stepKey="openNewCatalogPriceRulePage"/> <waitForPageLoad stepKey="waitForPageToLoad1"/> diff --git a/app/code/Magento/CatalogRule/Test/Mftf/Test/AdminDeleteCatalogPriceRuleTest.xml b/app/code/Magento/CatalogRule/Test/Mftf/Test/AdminDeleteCatalogPriceRuleTest.xml index dfb846e90b669..c6b3569f3b597 100644 --- a/app/code/Magento/CatalogRule/Test/Mftf/Test/AdminDeleteCatalogPriceRuleTest.xml +++ b/app/code/Magento/CatalogRule/Test/Mftf/Test/AdminDeleteCatalogPriceRuleTest.xml @@ -26,7 +26,7 @@ <requiredEntity createDataKey="createCategory"/> </createData> <!-- Login to Admin page --> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <!-- Create a configurable product --> <actionGroup ref="CreateConfigurableProductActionGroup" stepKey="createConfigurableProduct"> <argument name="product" value="_defaultProduct"/> diff --git a/app/code/Magento/CatalogRule/Test/Mftf/Test/AdminEnableAttributeIsUndefinedCatalogPriceRuleTest.xml b/app/code/Magento/CatalogRule/Test/Mftf/Test/AdminEnableAttributeIsUndefinedCatalogPriceRuleTest.xml index fdd9b4788d315..973d73da2ab6a 100644 --- a/app/code/Magento/CatalogRule/Test/Mftf/Test/AdminEnableAttributeIsUndefinedCatalogPriceRuleTest.xml +++ b/app/code/Magento/CatalogRule/Test/Mftf/Test/AdminEnableAttributeIsUndefinedCatalogPriceRuleTest.xml @@ -20,7 +20,7 @@ <group value="CatalogRule"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="login"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="login"/> <createData entity="ApiCategory" stepKey="createFirstCategory"/> <createData entity="ApiSimpleProduct" stepKey="createFirstProduct"> diff --git a/app/code/Magento/CatalogRule/Test/Mftf/Test/AdminMarketingCatalogPriceRuleNavigateMenuTest.xml b/app/code/Magento/CatalogRule/Test/Mftf/Test/AdminMarketingCatalogPriceRuleNavigateMenuTest.xml index 2a45de28db199..60b16276f6c17 100644 --- a/app/code/Magento/CatalogRule/Test/Mftf/Test/AdminMarketingCatalogPriceRuleNavigateMenuTest.xml +++ b/app/code/Magento/CatalogRule/Test/Mftf/Test/AdminMarketingCatalogPriceRuleNavigateMenuTest.xml @@ -20,7 +20,7 @@ <group value="mtf_migrated"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="LoginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="LoginAsAdmin"/> </before> <after> <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> diff --git a/app/code/Magento/CatalogRule/Test/Mftf/Test/ApplyCatalogPriceRuleByProductAttributeTest.xml b/app/code/Magento/CatalogRule/Test/Mftf/Test/ApplyCatalogPriceRuleByProductAttributeTest.xml index 400b03c9af21e..0747d42dc8737 100644 --- a/app/code/Magento/CatalogRule/Test/Mftf/Test/ApplyCatalogPriceRuleByProductAttributeTest.xml +++ b/app/code/Magento/CatalogRule/Test/Mftf/Test/ApplyCatalogPriceRuleByProductAttributeTest.xml @@ -21,7 +21,7 @@ </skip> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="login"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="login"/> <createData entity="ApiCategory" stepKey="createFirstCategory"/> <createData entity="ApiSimpleProduct" stepKey="createFirstProduct"> diff --git a/app/code/Magento/CatalogRule/Test/Mftf/Test/ApplyCatalogRuleForSimpleAndConfigurableProductTest.xml b/app/code/Magento/CatalogRule/Test/Mftf/Test/ApplyCatalogRuleForSimpleAndConfigurableProductTest.xml index d79a3805d79a4..101883f5ea9f2 100644 --- a/app/code/Magento/CatalogRule/Test/Mftf/Test/ApplyCatalogRuleForSimpleAndConfigurableProductTest.xml +++ b/app/code/Magento/CatalogRule/Test/Mftf/Test/ApplyCatalogRuleForSimpleAndConfigurableProductTest.xml @@ -20,7 +20,7 @@ </annotations> <before> <!-- Login as Admin --> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <!-- Create Simple Product --> <createData entity="ApiCategory" stepKey="createCategory"/> diff --git a/app/code/Magento/CatalogRule/Test/Mftf/Test/ApplyCatalogRuleForSimpleProductAndFixedMethodTest.xml b/app/code/Magento/CatalogRule/Test/Mftf/Test/ApplyCatalogRuleForSimpleProductAndFixedMethodTest.xml index 0149a2d0a6abb..552a6dc48eb7f 100644 --- a/app/code/Magento/CatalogRule/Test/Mftf/Test/ApplyCatalogRuleForSimpleProductAndFixedMethodTest.xml +++ b/app/code/Magento/CatalogRule/Test/Mftf/Test/ApplyCatalogRuleForSimpleProductAndFixedMethodTest.xml @@ -20,7 +20,7 @@ </annotations> <before> <!-- Login as Admin --> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <!-- Create category --> <createData entity="_defaultCategory" stepKey="createCategory"/> diff --git a/app/code/Magento/CatalogRule/Test/Mftf/Test/ApplyCatalogRuleForSimpleProductForNewCustomerGroupTest.xml b/app/code/Magento/CatalogRule/Test/Mftf/Test/ApplyCatalogRuleForSimpleProductForNewCustomerGroupTest.xml index c70a72d725489..6e8cb01f64ea2 100644 --- a/app/code/Magento/CatalogRule/Test/Mftf/Test/ApplyCatalogRuleForSimpleProductForNewCustomerGroupTest.xml +++ b/app/code/Magento/CatalogRule/Test/Mftf/Test/ApplyCatalogRuleForSimpleProductForNewCustomerGroupTest.xml @@ -20,7 +20,7 @@ </annotations> <before> <!-- Login as Admin --> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <!-- Create new customer group --> <createData entity="CustomCustomerGroup" stepKey="customerGroup" /> diff --git a/app/code/Magento/CatalogRule/Test/Mftf/Test/ApplyCatalogRuleForSimpleProductWithCustomOptionsTest.xml b/app/code/Magento/CatalogRule/Test/Mftf/Test/ApplyCatalogRuleForSimpleProductWithCustomOptionsTest.xml index 9ebab2d28249a..aa20a1d72d063 100644 --- a/app/code/Magento/CatalogRule/Test/Mftf/Test/ApplyCatalogRuleForSimpleProductWithCustomOptionsTest.xml +++ b/app/code/Magento/CatalogRule/Test/Mftf/Test/ApplyCatalogRuleForSimpleProductWithCustomOptionsTest.xml @@ -20,7 +20,7 @@ </annotations> <before> <!-- Login as Admin --> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <!-- Create category --> <createData entity="_defaultCategory" stepKey="createCategory"/> diff --git a/app/code/Magento/CatalogRule/Test/Mftf/Test/CatalogPriceRuleAndCustomerGroupMembershipArePersistedUnderLongTermCookieTest.xml b/app/code/Magento/CatalogRule/Test/Mftf/Test/CatalogPriceRuleAndCustomerGroupMembershipArePersistedUnderLongTermCookieTest.xml index c752ce5c07636..6ac9f713e2844 100644 --- a/app/code/Magento/CatalogRule/Test/Mftf/Test/CatalogPriceRuleAndCustomerGroupMembershipArePersistedUnderLongTermCookieTest.xml +++ b/app/code/Magento/CatalogRule/Test/Mftf/Test/CatalogPriceRuleAndCustomerGroupMembershipArePersistedUnderLongTermCookieTest.xml @@ -27,7 +27,7 @@ </createData> <createData entity="Simple_US_Customer" stepKey="createCustomer"/> - <actionGroup ref="LoginAsAdmin" stepKey="loginToAdminPanel"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginToAdminPanel"/> <!--Create Catalog Rule--> <actionGroup ref="AdminOpenNewCatalogPriceRuleFormPageActionGroup" stepKey="startCreatingFirstPriceRule"/> diff --git a/app/code/Magento/CatalogRule/Test/Mftf/Test/StorefrontInactiveCatalogRuleTest.xml b/app/code/Magento/CatalogRule/Test/Mftf/Test/StorefrontInactiveCatalogRuleTest.xml index cf34a01498e6f..46ba6e30100b1 100644 --- a/app/code/Magento/CatalogRule/Test/Mftf/Test/StorefrontInactiveCatalogRuleTest.xml +++ b/app/code/Magento/CatalogRule/Test/Mftf/Test/StorefrontInactiveCatalogRuleTest.xml @@ -24,7 +24,7 @@ <createData entity="ApiSimpleProduct" stepKey="createProduct"> <requiredEntity createDataKey="createCategory"/> </createData> - <actionGroup ref="LoginAsAdmin" stepKey="loginToAdminPanel"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginToAdminPanel"/> <actionGroup ref="AdminOpenNewCatalogPriceRuleFormPageActionGroup" stepKey="startCreatingFirstPriceRule"/> <actionGroup ref="AdminCatalogPriceRuleFillMainInfoActionGroup" stepKey="fillMainInfoForFirstPriceRule"> diff --git a/app/code/Magento/CatalogRuleConfigurable/Test/Mftf/Test/AdminApplyCatalogRuleForConfigurableProductWithAssignedSimpleProducts2Test.xml b/app/code/Magento/CatalogRuleConfigurable/Test/Mftf/Test/AdminApplyCatalogRuleForConfigurableProductWithAssignedSimpleProducts2Test.xml index aa2b41b96979f..48f53da8e2a2e 100644 --- a/app/code/Magento/CatalogRuleConfigurable/Test/Mftf/Test/AdminApplyCatalogRuleForConfigurableProductWithAssignedSimpleProducts2Test.xml +++ b/app/code/Magento/CatalogRuleConfigurable/Test/Mftf/Test/AdminApplyCatalogRuleForConfigurableProductWithAssignedSimpleProducts2Test.xml @@ -144,7 +144,7 @@ </createData> <!-- Login as Admin --> - <actionGroup ref="LoginAsAdmin" stepKey="loginToAdminPanel"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginToAdminPanel"/> </before> <after> <!-- Delete created data --> diff --git a/app/code/Magento/CatalogRuleConfigurable/Test/Mftf/Test/AdminApplyCatalogRuleForConfigurableProductWithAssignedSimpleProductsTest.xml b/app/code/Magento/CatalogRuleConfigurable/Test/Mftf/Test/AdminApplyCatalogRuleForConfigurableProductWithAssignedSimpleProductsTest.xml index ff0c9058037df..e4dd65479b784 100644 --- a/app/code/Magento/CatalogRuleConfigurable/Test/Mftf/Test/AdminApplyCatalogRuleForConfigurableProductWithAssignedSimpleProductsTest.xml +++ b/app/code/Magento/CatalogRuleConfigurable/Test/Mftf/Test/AdminApplyCatalogRuleForConfigurableProductWithAssignedSimpleProductsTest.xml @@ -145,7 +145,7 @@ </createData> <!-- Login as Admin --> - <actionGroup ref="LoginAsAdmin" stepKey="loginToAdminPanel"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginToAdminPanel"/> </before> <after> <!-- Customer log out --> diff --git a/app/code/Magento/CatalogRuleConfigurable/Test/Mftf/Test/AdminApplyCatalogRuleForConfigurableProductWithOptions2Test.xml b/app/code/Magento/CatalogRuleConfigurable/Test/Mftf/Test/AdminApplyCatalogRuleForConfigurableProductWithOptions2Test.xml index b011719495d2b..350f896606c19 100644 --- a/app/code/Magento/CatalogRuleConfigurable/Test/Mftf/Test/AdminApplyCatalogRuleForConfigurableProductWithOptions2Test.xml +++ b/app/code/Magento/CatalogRuleConfigurable/Test/Mftf/Test/AdminApplyCatalogRuleForConfigurableProductWithOptions2Test.xml @@ -92,7 +92,7 @@ </createData> <!-- Login as Admin --> - <actionGroup ref="LoginAsAdmin" stepKey="loginToAdminPanel"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginToAdminPanel"/> </before> <after> <!-- Delete created data --> diff --git a/app/code/Magento/CatalogRuleConfigurable/Test/Mftf/Test/AdminApplyCatalogRuleForConfigurableProductWithOptionsTest.xml b/app/code/Magento/CatalogRuleConfigurable/Test/Mftf/Test/AdminApplyCatalogRuleForConfigurableProductWithOptionsTest.xml index b7cae5980239b..8ed9c6ad09dad 100644 --- a/app/code/Magento/CatalogRuleConfigurable/Test/Mftf/Test/AdminApplyCatalogRuleForConfigurableProductWithOptionsTest.xml +++ b/app/code/Magento/CatalogRuleConfigurable/Test/Mftf/Test/AdminApplyCatalogRuleForConfigurableProductWithOptionsTest.xml @@ -93,7 +93,7 @@ </createData> <!-- Login as Admin --> - <actionGroup ref="LoginAsAdmin" stepKey="loginToAdminPanel"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginToAdminPanel"/> </before> <after> <!-- Delete created data --> diff --git a/app/code/Magento/CatalogSearch/Test/Mftf/Test/AdminCreateSearchTermEntityTest.xml b/app/code/Magento/CatalogSearch/Test/Mftf/Test/AdminCreateSearchTermEntityTest.xml index 2ab87b3ceb967..7ac06c0342229 100644 --- a/app/code/Magento/CatalogSearch/Test/Mftf/Test/AdminCreateSearchTermEntityTest.xml +++ b/app/code/Magento/CatalogSearch/Test/Mftf/Test/AdminCreateSearchTermEntityTest.xml @@ -20,7 +20,7 @@ </annotations> <before> <!-- Login as admin --> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <!-- Create simple product --> <createData entity="SimpleProduct2" stepKey="createSimpleProduct"/> diff --git a/app/code/Magento/CatalogSearch/Test/Mftf/Test/AdminMarketingSearchTermsNavigateMenuTest.xml b/app/code/Magento/CatalogSearch/Test/Mftf/Test/AdminMarketingSearchTermsNavigateMenuTest.xml index 6be63541f3c27..a0abefebcb6b4 100644 --- a/app/code/Magento/CatalogSearch/Test/Mftf/Test/AdminMarketingSearchTermsNavigateMenuTest.xml +++ b/app/code/Magento/CatalogSearch/Test/Mftf/Test/AdminMarketingSearchTermsNavigateMenuTest.xml @@ -20,7 +20,7 @@ <group value="mtf_migrated"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="LoginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="LoginAsAdmin"/> </before> <after> <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> diff --git a/app/code/Magento/CatalogSearch/Test/Mftf/Test/AdminReportsSearchTermsNavigateMenuTest.xml b/app/code/Magento/CatalogSearch/Test/Mftf/Test/AdminReportsSearchTermsNavigateMenuTest.xml index e1a965bd08e0b..42c6d13784a98 100644 --- a/app/code/Magento/CatalogSearch/Test/Mftf/Test/AdminReportsSearchTermsNavigateMenuTest.xml +++ b/app/code/Magento/CatalogSearch/Test/Mftf/Test/AdminReportsSearchTermsNavigateMenuTest.xml @@ -20,7 +20,7 @@ <group value="mtf_migrated"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="LoginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="LoginAsAdmin"/> </before> <after> <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> diff --git a/app/code/Magento/CatalogSearch/Test/Mftf/Test/MinimalQueryLengthForCatalogSearchTest.xml b/app/code/Magento/CatalogSearch/Test/Mftf/Test/MinimalQueryLengthForCatalogSearchTest.xml index 6ae215f821a0b..437357ba861f2 100644 --- a/app/code/Magento/CatalogSearch/Test/Mftf/Test/MinimalQueryLengthForCatalogSearchTest.xml +++ b/app/code/Magento/CatalogSearch/Test/Mftf/Test/MinimalQueryLengthForCatalogSearchTest.xml @@ -25,7 +25,7 @@ <createData entity="ApiSimpleProduct" stepKey="createProduct"> <requiredEntity createDataKey="createCategory"/> </createData> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> </before> <after> <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> diff --git a/app/code/Magento/CatalogSearch/Test/Mftf/Test/SearchEntityResultsTest/QuickSearchAndAddToCartBundleDynamicTest.xml b/app/code/Magento/CatalogSearch/Test/Mftf/Test/SearchEntityResultsTest/QuickSearchAndAddToCartBundleDynamicTest.xml index f6cd95b4f5a3d..49fce41fddf05 100644 --- a/app/code/Magento/CatalogSearch/Test/Mftf/Test/SearchEntityResultsTest/QuickSearchAndAddToCartBundleDynamicTest.xml +++ b/app/code/Magento/CatalogSearch/Test/Mftf/Test/SearchEntityResultsTest/QuickSearchAndAddToCartBundleDynamicTest.xml @@ -37,7 +37,7 @@ <field key="qty">10</field> </createData> <!--Finish bundle creation--> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <actionGroup ref="AdminProductPageOpenByIdActionGroup" stepKey="goToProductEditPage"> <argument name="productId" value="$$createBundleProduct.id$$"/> </actionGroup> diff --git a/app/code/Magento/CatalogSearch/Test/Mftf/Test/SearchEntityResultsTest/QuickSearchAndAddToCartBundleFixedTest.xml b/app/code/Magento/CatalogSearch/Test/Mftf/Test/SearchEntityResultsTest/QuickSearchAndAddToCartBundleFixedTest.xml index 844c100830bc2..4b0a5c84ac360 100644 --- a/app/code/Magento/CatalogSearch/Test/Mftf/Test/SearchEntityResultsTest/QuickSearchAndAddToCartBundleFixedTest.xml +++ b/app/code/Magento/CatalogSearch/Test/Mftf/Test/SearchEntityResultsTest/QuickSearchAndAddToCartBundleFixedTest.xml @@ -48,7 +48,7 @@ </createData> <!--Finish bundle creation--> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <actionGroup ref="AdminProductPageOpenByIdActionGroup" stepKey="goToProductEditPage"> <argument name="productId" value="$$createBundleProduct.id$$"/> </actionGroup> diff --git a/app/code/Magento/CatalogSearch/Test/Mftf/Test/SearchEntityResultsTest/QuickSearchAndAddToCartConfigurableTest.xml b/app/code/Magento/CatalogSearch/Test/Mftf/Test/SearchEntityResultsTest/QuickSearchAndAddToCartConfigurableTest.xml index e4918536245cf..35db90363b1ae 100644 --- a/app/code/Magento/CatalogSearch/Test/Mftf/Test/SearchEntityResultsTest/QuickSearchAndAddToCartConfigurableTest.xml +++ b/app/code/Magento/CatalogSearch/Test/Mftf/Test/SearchEntityResultsTest/QuickSearchAndAddToCartConfigurableTest.xml @@ -19,7 +19,7 @@ </annotations> <before> <createData entity="_defaultCategory" stepKey="createCategory"/> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin1"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin1"/> <actionGroup ref="CreateConfigurableProductActionGroup" stepKey="createProduct"> <argument name="product" value="_defaultProduct"/> <argument name="category" value="$$createCategory$$"/> diff --git a/app/code/Magento/CatalogSearch/Test/Mftf/Test/SearchEntityResultsTest/QuickSearchAndAddToCartGroupedTest.xml b/app/code/Magento/CatalogSearch/Test/Mftf/Test/SearchEntityResultsTest/QuickSearchAndAddToCartGroupedTest.xml index 0d062c832090c..cf30e4d06e8e7 100644 --- a/app/code/Magento/CatalogSearch/Test/Mftf/Test/SearchEntityResultsTest/QuickSearchAndAddToCartGroupedTest.xml +++ b/app/code/Magento/CatalogSearch/Test/Mftf/Test/SearchEntityResultsTest/QuickSearchAndAddToCartGroupedTest.xml @@ -18,7 +18,7 @@ <group value="mtf_migrated"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <actionGroup ref="DeleteAllProductsUsingProductGridActionGroup" stepKey="deleteAllProducts"/> <createData entity="ApiProductWithDescription" stepKey="simple1"/> <createData entity="ApiGroupedProduct" stepKey="createProduct"/> diff --git a/app/code/Magento/CatalogSearch/Test/Mftf/Test/SearchEntityResultsTest/QuickSearchTwoProductsWithSameWeightTest.xml b/app/code/Magento/CatalogSearch/Test/Mftf/Test/SearchEntityResultsTest/QuickSearchTwoProductsWithSameWeightTest.xml index 0d2009f21aac1..00a7ffa3fc142 100644 --- a/app/code/Magento/CatalogSearch/Test/Mftf/Test/SearchEntityResultsTest/QuickSearchTwoProductsWithSameWeightTest.xml +++ b/app/code/Magento/CatalogSearch/Test/Mftf/Test/SearchEntityResultsTest/QuickSearchTwoProductsWithSameWeightTest.xml @@ -26,7 +26,7 @@ <createData entity="productAlphabeticalB" stepKey="product2"> <requiredEntity createDataKey="createCategory"/> </createData> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin1"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin1"/> <!-- Create and Assign Attribute to product1--> diff --git a/app/code/Magento/CatalogSearch/Test/Mftf/Test/StorefrontAdvancedSearchEntitySimpleProductTest.xml b/app/code/Magento/CatalogSearch/Test/Mftf/Test/StorefrontAdvancedSearchEntitySimpleProductTest.xml index f032a97ac297c..968435747bdbb 100644 --- a/app/code/Magento/CatalogSearch/Test/Mftf/Test/StorefrontAdvancedSearchEntitySimpleProductTest.xml +++ b/app/code/Magento/CatalogSearch/Test/Mftf/Test/StorefrontAdvancedSearchEntitySimpleProductTest.xml @@ -19,7 +19,7 @@ <group value="mtf_migrated"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <!-- Delete all products left by prev tests because it sensitive for search--> <actionGroup ref="DeleteAllProductsUsingProductGridActionGroup" stepKey="deleteAllProducts"/> <!-- Create Data --> diff --git a/app/code/Magento/CatalogSearch/Test/Mftf/Test/StorefrontQuickSearchConfigurableChildrenTest.xml b/app/code/Magento/CatalogSearch/Test/Mftf/Test/StorefrontQuickSearchConfigurableChildrenTest.xml index 954f53814f3c3..6f510fa315d7d 100644 --- a/app/code/Magento/CatalogSearch/Test/Mftf/Test/StorefrontQuickSearchConfigurableChildrenTest.xml +++ b/app/code/Magento/CatalogSearch/Test/Mftf/Test/StorefrontQuickSearchConfigurableChildrenTest.xml @@ -31,7 +31,7 @@ </createData> <!-- Assign attribute to set --> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <actionGroup ref="GoToAttributeGridPageActionGroup" stepKey="goToAttributeSetPage"/> <actionGroup ref="GoToAttributeSetByNameActionGroup" stepKey="openAttributeSetByName"> <argument name="name" value="$createAttributeSet.attribute_set_name$"/> diff --git a/app/code/Magento/CatalogSearch/Test/Mftf/Test/StorefrontUpdateSearchTermEntityTest.xml b/app/code/Magento/CatalogSearch/Test/Mftf/Test/StorefrontUpdateSearchTermEntityTest.xml index 502301939f71a..3c0c7cf53d0a1 100644 --- a/app/code/Magento/CatalogSearch/Test/Mftf/Test/StorefrontUpdateSearchTermEntityTest.xml +++ b/app/code/Magento/CatalogSearch/Test/Mftf/Test/StorefrontUpdateSearchTermEntityTest.xml @@ -48,7 +48,7 @@ <argument name="phrase" value="$$createProduct1.name$$"/> </actionGroup> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin1"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin1"/> <amOnPage url="{{AdminCatalogSearchTermIndexPage.url}}" stepKey="openAdminCatalogSearchTermIndexPage1"/> <waitForPageLoad stepKey="waitForPageLoad1"/> diff --git a/app/code/Magento/CatalogUrlRewrite/Test/Mftf/Test/AdminCategoryWithRestrictedUrlKeyNotCreatedTest.xml b/app/code/Magento/CatalogUrlRewrite/Test/Mftf/Test/AdminCategoryWithRestrictedUrlKeyNotCreatedTest.xml index 5d02e2075430e..7d75364cc9b50 100644 --- a/app/code/Magento/CatalogUrlRewrite/Test/Mftf/Test/AdminCategoryWithRestrictedUrlKeyNotCreatedTest.xml +++ b/app/code/Magento/CatalogUrlRewrite/Test/Mftf/Test/AdminCategoryWithRestrictedUrlKeyNotCreatedTest.xml @@ -20,7 +20,7 @@ <group value="urlRewrite"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> </before> <after> <!--Delete created categories--> diff --git a/app/code/Magento/CatalogUrlRewrite/Test/Mftf/Test/AdminRewriteProductWithTwoStoreTest.xml b/app/code/Magento/CatalogUrlRewrite/Test/Mftf/Test/AdminRewriteProductWithTwoStoreTest.xml index db4811273a5cc..e8a1ee850cd74 100644 --- a/app/code/Magento/CatalogUrlRewrite/Test/Mftf/Test/AdminRewriteProductWithTwoStoreTest.xml +++ b/app/code/Magento/CatalogUrlRewrite/Test/Mftf/Test/AdminRewriteProductWithTwoStoreTest.xml @@ -17,7 +17,7 @@ <magentoCLI command="config:set {{EnableCategoriesPathProductUrls.path}} {{EnableCategoriesPathProductUrls.value}}" stepKey="enableUseCategoriesPath"/> <magentoCLI command="cache:flush" stepKey="flushCache"/> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <actionGroup ref="AdminCreateStoreViewActionGroup" stepKey="createStoreView" /> <createData entity="_defaultCategoryDifferentUrlStore" stepKey="defaultCategory"/> <createData entity="SimpleSubCategoryDifferentUrlStore" stepKey="subCategory"> @@ -30,7 +30,7 @@ <after> <actionGroup ref="AdminDeleteStoreViewActionGroup" stepKey="deleteStoreView"/> - <actionGroup ref="logout" stepKey="logout"/> + <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> <deleteData createDataKey="simpleProduct" stepKey="deleteSimpleProduct"/> <deleteData createDataKey="defaultCategory" stepKey="deleteNewRootCategory"/> <magentoCLI command="config:set {{DisableCategoriesPathProductUrls.path}} {{DisableCategoriesPathProductUrls.value}}" stepKey="disableUseCategoriesPath"/> diff --git a/app/code/Magento/CatalogUrlRewrite/Test/Mftf/Test/AdminUrlForProductRewrittenCorrectlyTest.xml b/app/code/Magento/CatalogUrlRewrite/Test/Mftf/Test/AdminUrlForProductRewrittenCorrectlyTest.xml index 62ef26145619b..456458a4fad40 100644 --- a/app/code/Magento/CatalogUrlRewrite/Test/Mftf/Test/AdminUrlForProductRewrittenCorrectlyTest.xml +++ b/app/code/Magento/CatalogUrlRewrite/Test/Mftf/Test/AdminUrlForProductRewrittenCorrectlyTest.xml @@ -21,7 +21,7 @@ </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <!--Create product--> <createData entity="_defaultCategory" stepKey="category"/> diff --git a/app/code/Magento/CatalogUrlRewrite/Test/Mftf/Test/RewriteStoreLevelUrlKeyOfChildCategoryTest.xml b/app/code/Magento/CatalogUrlRewrite/Test/Mftf/Test/RewriteStoreLevelUrlKeyOfChildCategoryTest.xml index d61a4bd077d9c..8764555f94357 100644 --- a/app/code/Magento/CatalogUrlRewrite/Test/Mftf/Test/RewriteStoreLevelUrlKeyOfChildCategoryTest.xml +++ b/app/code/Magento/CatalogUrlRewrite/Test/Mftf/Test/RewriteStoreLevelUrlKeyOfChildCategoryTest.xml @@ -19,7 +19,7 @@ </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <actionGroup ref="AdminCreateStoreViewActionGroup" stepKey="createStoreView" /> <createData entity="_defaultCategory" stepKey="defaultCategory"/> diff --git a/app/code/Magento/CatalogWidget/Test/Mftf/Test/CatalogProductListWidgetOperatorsTest.xml b/app/code/Magento/CatalogWidget/Test/Mftf/Test/CatalogProductListWidgetOperatorsTest.xml index 8d4e97420dd0b..288134a889db0 100644 --- a/app/code/Magento/CatalogWidget/Test/Mftf/Test/CatalogProductListWidgetOperatorsTest.xml +++ b/app/code/Magento/CatalogWidget/Test/Mftf/Test/CatalogProductListWidgetOperatorsTest.xml @@ -37,7 +37,7 @@ <createData entity="_defaultBlock" stepKey="createPreReqBlock"/> <!--User log in on back-end as admin--> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <actionGroup ref="EnabledWYSIWYGActionGroup" stepKey="enableWYSIWYG"/> </before> diff --git a/app/code/Magento/CatalogWidget/Test/Mftf/Test/CatalogProductListWidgetOrderTest.xml b/app/code/Magento/CatalogWidget/Test/Mftf/Test/CatalogProductListWidgetOrderTest.xml index ea6a3a73522e7..fd87d58e47125 100644 --- a/app/code/Magento/CatalogWidget/Test/Mftf/Test/CatalogProductListWidgetOrderTest.xml +++ b/app/code/Magento/CatalogWidget/Test/Mftf/Test/CatalogProductListWidgetOrderTest.xml @@ -37,7 +37,7 @@ <field key="price">30</field> </createData> <createData entity="_defaultCmsPage" stepKey="createPreReqPage"/> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <actionGroup ref="EnabledWYSIWYGActionGroup" stepKey="enableWYSIWYG"/> </before> <!--Open created cms page--> diff --git a/app/code/Magento/CatalogWidget/Test/Mftf/Test/StorefrontProductGridUIUpdatesOnDesktopTest.xml b/app/code/Magento/CatalogWidget/Test/Mftf/Test/StorefrontProductGridUIUpdatesOnDesktopTest.xml index 74e1110c95636..5590aa1cdcefa 100644 --- a/app/code/Magento/CatalogWidget/Test/Mftf/Test/StorefrontProductGridUIUpdatesOnDesktopTest.xml +++ b/app/code/Magento/CatalogWidget/Test/Mftf/Test/StorefrontProductGridUIUpdatesOnDesktopTest.xml @@ -36,7 +36,7 @@ </createData> <!-- 2. Create new CMS page and add "Catalog Product List" widget type via content >insert widget option --> <createData entity="_emptyCmsPage" stepKey="createCmsPage"/> - <actionGroup ref="LoginAsAdmin" stepKey="loginToAdminPanel"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginToAdminPanel"/> <actionGroup ref="NavigateToCreatedCMSPageActionGroup" stepKey="navigateToCreatedCmsPage"> <argument name="CMSPage" value="$createCmsPage$"/> </actionGroup> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/AdminCheckConfigsChangesIsNotAffectedStartedCheckoutProcessTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/AdminCheckConfigsChangesIsNotAffectedStartedCheckoutProcessTest.xml index a9c3d20c447a9..ab0453e1faa18 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/AdminCheckConfigsChangesIsNotAffectedStartedCheckoutProcessTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/AdminCheckConfigsChangesIsNotAffectedStartedCheckoutProcessTest.xml @@ -75,7 +75,7 @@ <!-- Open new browser's window and login as Admin --> <openNewTab stepKey="openNewTab"/> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <!-- Go to Store > Configuration > Sales > Shipping Methods --> <actionGroup ref="AdminOpenShippingMethodsConfigPageActionGroup" stepKey="openShippingMethodConfigPage"/> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/CheckoutSpecificDestinationsTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/CheckoutSpecificDestinationsTest.xml index 294fc2c562491..58a44f5b89f90 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/CheckoutSpecificDestinationsTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/CheckoutSpecificDestinationsTest.xml @@ -24,7 +24,7 @@ <requiredEntity createDataKey="defaultCategory"/> </createData> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> </before> <!--Go to configuration general page--> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/ConfiguringInstantPurchaseFunctionalityTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/ConfiguringInstantPurchaseFunctionalityTest.xml index 899688c80764e..016616a27a05a 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/ConfiguringInstantPurchaseFunctionalityTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/ConfiguringInstantPurchaseFunctionalityTest.xml @@ -33,7 +33,7 @@ <createData entity="SimpleProduct2" stepKey="createProduct"/> <!-- Login as admin --> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> </before> <after> <!-- Set configs to default --> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/OnePageCheckoutAsCustomerUsingDefaultAddressTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/OnePageCheckoutAsCustomerUsingDefaultAddressTest.xml index c88025feba3d4..3215503b3205a 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/OnePageCheckoutAsCustomerUsingDefaultAddressTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/OnePageCheckoutAsCustomerUsingDefaultAddressTest.xml @@ -82,7 +82,7 @@ <grabTextFrom selector="{{CheckoutSuccessMainSection.orderNumber22}}" stepKey="grabOrderNumber"/> <!-- Login as admin --> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <!-- Open created order in backend --> <amOnPage url="{{AdminOrdersPage.url}}" stepKey="goToOrders"/> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/OnePageCheckoutAsCustomerUsingNewAddressTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/OnePageCheckoutAsCustomerUsingNewAddressTest.xml index 4065b3691b250..76a998fec8adc 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/OnePageCheckoutAsCustomerUsingNewAddressTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/OnePageCheckoutAsCustomerUsingNewAddressTest.xml @@ -95,7 +95,7 @@ <grabTextFrom selector="{{CheckoutSuccessMainSection.orderNumber22}}" stepKey="grabOrderNumber"/> <!-- Login as admin --> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <!-- Open created order in backend --> <amOnPage url="{{AdminOrdersPage.url}}" stepKey="goToOrders"/> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/OnePageCheckoutAsCustomerUsingNonDefaultAddressTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/OnePageCheckoutAsCustomerUsingNonDefaultAddressTest.xml index 571fb8c4cf3a5..340ff4159900a 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/OnePageCheckoutAsCustomerUsingNonDefaultAddressTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/OnePageCheckoutAsCustomerUsingNonDefaultAddressTest.xml @@ -83,7 +83,7 @@ <seeElement selector="{{CheckoutSuccessMainSection.success}}" stepKey="orderIsSuccessfullyPlaced"/> <grabTextFrom selector="{{CheckoutSuccessMainSection.orderNumber22}}" stepKey="grabOrderNumber"/> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <!-- Open created order in backend --> <amOnPage url="{{AdminOrdersPage.url}}" stepKey="goToOrders"/> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/OnePageCheckoutUsingSignInLinkTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/OnePageCheckoutUsingSignInLinkTest.xml index 6b7feb485c812..1c03808ac71cf 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/OnePageCheckoutUsingSignInLinkTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/OnePageCheckoutUsingSignInLinkTest.xml @@ -76,7 +76,7 @@ <grabTextFrom selector="{{CheckoutSuccessMainSection.orderNumber22}}" stepKey="grabOrderNumber"/> <!-- Login as admin --> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <!-- Open created order in backend --> <amOnPage url="{{AdminOrdersPage.url}}" stepKey="goToOrders"/> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/OnePageCheckoutWithAllProductTypesTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/OnePageCheckoutWithAllProductTypesTest.xml index d362f83043c2a..e678bb0d2a87b 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/OnePageCheckoutWithAllProductTypesTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/OnePageCheckoutWithAllProductTypesTest.xml @@ -195,7 +195,7 @@ <grabTextFrom selector="{{CheckoutSuccessMainSection.orderNumber22}}" stepKey="grabOrderNumber"/> <!-- Login as admin --> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <!-- Open created order --> <amOnPage url="{{AdminOrdersPage.url}}" stepKey="goToOrders"/> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StoreFrontCheckCustomerInfoCreatedByGuestTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StoreFrontCheckCustomerInfoCreatedByGuestTest.xml index d0fb6babb22fa..bd81a1cfab604 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StoreFrontCheckCustomerInfoCreatedByGuestTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StoreFrontCheckCustomerInfoCreatedByGuestTest.xml @@ -54,7 +54,7 @@ <fillField selector="{{StorefrontCustomerCreateFormSection.confirmPasswordField}}" userInput="{{CustomerEntityOne.password}}" stepKey="TypeConfirmationPassword"/> <click selector="{{StorefrontCustomerCreateFormSection.createAccountButton}}" stepKey="clickOnCreateAccount"/> <see userInput="Thank you for registering" stepKey="verifyAccountCreated"/> - <actionGroup ref="LoginAsAdmin" stepKey="loginToAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginToAdmin"/> <amOnPage url="{{AdminOrderPage.url({$grabOrderNumber})}}" stepKey="navigateToOrderPage"/> <waitForPageLoad stepKey="waitForCreatedOrderPage"/> <see stepKey="seeCustomerName" userInput="{{CustomerEntityOne.firstname}}" selector="{{AdminShipmentOrderInformationSection.customerName}}"/> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StoreFrontFreeShippingRecalculationAfterCouponCodeAddedTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StoreFrontFreeShippingRecalculationAfterCouponCodeAddedTest.xml index ba26b44c11ba3..57ed8e442af7c 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StoreFrontFreeShippingRecalculationAfterCouponCodeAddedTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StoreFrontFreeShippingRecalculationAfterCouponCodeAddedTest.xml @@ -20,7 +20,7 @@ </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <createData entity="Simple_US_Customer" stepKey="createSimpleUsCustomer"> <field key="group_id">1</field> </createData> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontApplyPromoCodeDuringCheckoutTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontApplyPromoCodeDuringCheckoutTest.xml index 58cc137efd7b3..e4eb53a1f1925 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontApplyPromoCodeDuringCheckoutTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontApplyPromoCodeDuringCheckoutTest.xml @@ -77,7 +77,7 @@ <grabTextFrom selector="{{CheckoutSuccessMainSection.orderNumber}}" stepKey="grabOrderNumber"/> <!-- Login as admin --> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <!-- Verify total on order page --> <actionGroup ref="FilterOrderGridByIdActionGroup" stepKey="filterOrderById"> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCheckoutDisabledBundleProductTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCheckoutDisabledBundleProductTest.xml index 7405a3100728f..444ebf653b94f 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCheckoutDisabledBundleProductTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCheckoutDisabledBundleProductTest.xml @@ -61,7 +61,7 @@ </actionGroup> <!-- Login to admin panel --> <openNewTab stepKey="openNewTab"/> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <!-- Find the first simple product that we just created using the product grid and go to its page--> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="visitAdminProductPage"/> <!-- Disabled bundle product from grid --> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCheckoutWithDifferentShippingAndBillingAddressAndProductWithTierPricesTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCheckoutWithDifferentShippingAndBillingAddressAndProductWithTierPricesTest.xml index 80da3fb70f944..ce7c5c3b29353 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCheckoutWithDifferentShippingAndBillingAddressAndProductWithTierPricesTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCheckoutWithDifferentShippingAndBillingAddressAndProductWithTierPricesTest.xml @@ -19,7 +19,7 @@ <before> <magentoCLI command="config:set {{EnablePaymentBankTransferConfigData.path}} {{EnablePaymentBankTransferConfigData.value}}" stepKey="enableBankTransferPayment"/> - <actionGroup ref="LoginAsAdmin" stepKey="loginToAdminPanel"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginToAdminPanel"/> <createData entity="SimpleProduct2" stepKey="simpleProduct"> <field key="price">50.00</field> </createData> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCheckoutWithDifferentShippingAndBillingAddressAndRegisterCustomerAfterCheckoutTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCheckoutWithDifferentShippingAndBillingAddressAndRegisterCustomerAfterCheckoutTest.xml index 85e6a6b9c434c..16c7a0609a6ff 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCheckoutWithDifferentShippingAndBillingAddressAndRegisterCustomerAfterCheckoutTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCheckoutWithDifferentShippingAndBillingAddressAndRegisterCustomerAfterCheckoutTest.xml @@ -18,7 +18,7 @@ </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="loginToAdminPanel"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginToAdminPanel"/> <createData entity="SimpleProduct2" stepKey="simpleProduct"> <field key="price">50.00</field> </createData> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCheckoutWithSpecialPriceProductsTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCheckoutWithSpecialPriceProductsTest.xml index dee2bb16a63d0..787d8f58891d0 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCheckoutWithSpecialPriceProductsTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCheckoutWithSpecialPriceProductsTest.xml @@ -18,7 +18,7 @@ </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="loginToAdminPanel"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginToAdminPanel"/> <createData entity="Simple_US_Customer" stepKey="createCustomer"/> <createData entity="defaultSimpleProduct" stepKey="simpleProduct"> <field key="price">10.00</field> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCustomerCheckoutDisabledProductAndCouponTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCustomerCheckoutDisabledProductAndCouponTest.xml index f8e1f32e93f52..b962d80a4d88b 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCustomerCheckoutDisabledProductAndCouponTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCustomerCheckoutDisabledProductAndCouponTest.xml @@ -67,7 +67,7 @@ <!-- Login to admin panel --> <openNewTab stepKey="openNewTab"/> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <!-- Find the first simple product that we just created using the product grid and go to its page--> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="visitAdminProductPage"/> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCustomerCheckoutOnLoginWhenGuestCheckoutIsDisabledTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCustomerCheckoutOnLoginWhenGuestCheckoutIsDisabledTest.xml index f0907e89f00da..5fbfdb5a07678 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCustomerCheckoutOnLoginWhenGuestCheckoutIsDisabledTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCustomerCheckoutOnLoginWhenGuestCheckoutIsDisabledTest.xml @@ -18,7 +18,7 @@ </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="loginToAdminPanel"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginToAdminPanel"/> <magentoCLI command="config:set {{DisableGuestCheckoutConfigData.path}} {{DisableGuestCheckoutConfigData.value}}" stepKey="disableGuestCheckout"/> <magentoCLI command="config:set {{DisableCustomerRedirectToDashboardConfigData.path}} {{DisableCustomerRedirectToDashboardConfigData.value}}" stepKey="disableCustomerRedirect"/> <createData entity="SimpleProduct2" stepKey="simpleProduct"> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCustomerCheckoutTest/StorefrontCustomerCheckoutTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCustomerCheckoutTest/StorefrontCustomerCheckoutTest.xml index 8c58827812d99..b5f573aba7561 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCustomerCheckoutTest/StorefrontCustomerCheckoutTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCustomerCheckoutTest/StorefrontCustomerCheckoutTest.xml @@ -60,7 +60,7 @@ <grabTextFrom selector="{{CheckoutSuccessMainSection.orderNumber22}}" stepKey="orderNumber"/> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <actionGroup ref="OpenOrderByIdActionGroup" stepKey="addFilterToGridAndOpenOrder"> <argument name="orderId" value="{$orderNumber}"/> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCustomerCheckoutTest/StorefrontCustomerCheckoutTestWithMultipleAddressesAndTaxRatesTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCustomerCheckoutTest/StorefrontCustomerCheckoutTestWithMultipleAddressesAndTaxRatesTest.xml index 0edc919920103..4c3c1561a2445 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCustomerCheckoutTest/StorefrontCustomerCheckoutTestWithMultipleAddressesAndTaxRatesTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCustomerCheckoutTest/StorefrontCustomerCheckoutTestWithMultipleAddressesAndTaxRatesTest.xml @@ -24,7 +24,7 @@ </createData> <createData entity="Simple_US_Customer_Multiple_Addresses" stepKey="multiple_address_customer"/> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <!-- Go to tax rule page --> <amOnPage url="{{AdminTaxRuleGridPage.url}}" stepKey="goToTaxRulePage"/> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCustomerCheckoutWithNewCustomerRegistrationAndDisableGuestCheckoutTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCustomerCheckoutWithNewCustomerRegistrationAndDisableGuestCheckoutTest.xml index c616faf716f03..0f82302260995 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCustomerCheckoutWithNewCustomerRegistrationAndDisableGuestCheckoutTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCustomerCheckoutWithNewCustomerRegistrationAndDisableGuestCheckoutTest.xml @@ -18,7 +18,7 @@ </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="loginToAdminPanel"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginToAdminPanel"/> <magentoCLI command="config:set {{DisableGuestCheckoutConfigData.path}} {{DisableGuestCheckoutConfigData.value}}" stepKey="disableGuestCheckout"/> <magentoCLI command="config:set {{DisableCustomerRedirectToDashboardConfigData.path}} {{DisableCustomerRedirectToDashboardConfigData.value}}" stepKey="disableCustomerRedirect"/> <createData entity="SimpleProduct2" stepKey="simpleProduct"> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCustomerCheckoutWithoutRegionTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCustomerCheckoutWithoutRegionTest.xml index c66c6371ae595..0c762519e9083 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCustomerCheckoutWithoutRegionTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCustomerCheckoutWithoutRegionTest.xml @@ -24,7 +24,7 @@ <requiredEntity createDataKey="createCategory"/> </createData> <createData entity="Simple_GB_Customer" stepKey="createCustomer"/> - <actionGroup stepKey="loginToAdminPanel" ref="LoginAsAdmin"/> + <actionGroup stepKey="loginToAdminPanel" ref="AdminLoginActionGroup"/> <actionGroup ref="SelectCountriesWithRequiredRegionActionGroup" stepKey="setCustomCountryWithRequiredRegion"> <argument name="countries" value="CustomCountryWithRequiredRegion"/> </actionGroup> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCustomerLoginDuringCheckoutTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCustomerLoginDuringCheckoutTest.xml index f43cadabfd611..9152949fbf2a1 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCustomerLoginDuringCheckoutTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCustomerLoginDuringCheckoutTest.xml @@ -23,7 +23,7 @@ <createData entity="SimpleProduct2" stepKey="createProduct"/> <!-- Login as admin --> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> </before> <after> <!-- Delete simple product --> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontDeleteBundleProductFromMiniShoppingCartTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontDeleteBundleProductFromMiniShoppingCartTest.xml index 1690612fa3242..fe320fb276c8a 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontDeleteBundleProductFromMiniShoppingCartTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontDeleteBundleProductFromMiniShoppingCartTest.xml @@ -19,7 +19,7 @@ </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="LoginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="LoginAsAdmin"/> <magentoCLI command="config:set {{EnableFlatRateConfigData.path}} {{EnableFlatRateConfigData.value}}" stepKey="enableFlatRate"/> <magentoCLI command="config:set {{EnableFlatRateDefaultPriceConfigData.path}} {{EnableFlatRateDefaultPriceConfigData.value}}" stepKey="enableFlatRateDefaultPrice"/> <createData entity="SimpleSubCategory" stepKey="createSubCategory"/> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontDeleteConfigurableProductFromMiniShoppingCartTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontDeleteConfigurableProductFromMiniShoppingCartTest.xml index 92e185d1bbb00..eb8b047b57288 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontDeleteConfigurableProductFromMiniShoppingCartTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontDeleteConfigurableProductFromMiniShoppingCartTest.xml @@ -19,7 +19,7 @@ </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="LoginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="LoginAsAdmin"/> <!-- Create Default Category --> <createData entity="_defaultCategory" stepKey="createCategory"/> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontDeleteDownloadableProductFromMiniShoppingCartTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontDeleteDownloadableProductFromMiniShoppingCartTest.xml index a60fe104ce14b..3c234602df17a 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontDeleteDownloadableProductFromMiniShoppingCartTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontDeleteDownloadableProductFromMiniShoppingCartTest.xml @@ -20,7 +20,7 @@ <before> <magentoCLI stepKey="addDownloadableDomain" command="downloadable:domains:add example.com static.magento.com"/> - <actionGroup ref="LoginAsAdmin" stepKey="LoginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="LoginAsAdmin"/> <magentoCLI command="config:set {{EnableFlatRateConfigData.path}} {{EnableFlatRateConfigData.value}}" stepKey="enableFlatRate"/> <magentoCLI command="config:set {{EnableFlatRateDefaultPriceConfigData.path}} {{EnableFlatRateDefaultPriceConfigData.value}}" stepKey="enableFlatRateDefaultPrice"/> <createData entity="ApiDownloadableProduct" stepKey="createDownloadableProduct"/> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontDeleteProductsWithCartItemsDisplayDefaultLimitationFromMiniShoppingCartTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontDeleteProductsWithCartItemsDisplayDefaultLimitationFromMiniShoppingCartTest.xml index 992d3eab9b563..b460bc2bb3446 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontDeleteProductsWithCartItemsDisplayDefaultLimitationFromMiniShoppingCartTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontDeleteProductsWithCartItemsDisplayDefaultLimitationFromMiniShoppingCartTest.xml @@ -19,7 +19,7 @@ </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="LoginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="LoginAsAdmin"/> <!--Create 10 simple products--> <createData entity="SimpleProduct2" stepKey="simpleProduct1"> <field key="price">10.00</field> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontDeleteSimpleAndVirtualProductFromMiniShoppingCartTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontDeleteSimpleAndVirtualProductFromMiniShoppingCartTest.xml index a6ac6d40a0ce0..643c6d8c14dd7 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontDeleteSimpleAndVirtualProductFromMiniShoppingCartTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontDeleteSimpleAndVirtualProductFromMiniShoppingCartTest.xml @@ -19,7 +19,7 @@ </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="LoginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="LoginAsAdmin"/> <!--Create simple product--> <createData entity="SimpleProduct2" stepKey="simpleProduct"> <field key="price">10.00</field> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontDeleteSimpleProductFromMiniShoppingCartTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontDeleteSimpleProductFromMiniShoppingCartTest.xml index 9e0f59f8a0e77..a7bb3d927f620 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontDeleteSimpleProductFromMiniShoppingCartTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontDeleteSimpleProductFromMiniShoppingCartTest.xml @@ -19,7 +19,7 @@ </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="LoginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="LoginAsAdmin"/> <!--Create simple product--> <createData entity="SimpleProduct2" stepKey="simpleProduct"> <field key="price">10.00</field> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontGuestCheckoutTest/StorefrontGuestCheckoutTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontGuestCheckoutTest/StorefrontGuestCheckoutTest.xml index 05a136e4c312a..5c06f9ed55067 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontGuestCheckoutTest/StorefrontGuestCheckoutTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontGuestCheckoutTest/StorefrontGuestCheckoutTest.xml @@ -56,7 +56,7 @@ </actionGroup> <grabTextFrom selector="{{CheckoutSuccessMainSection.orderNumber}}" stepKey="grabOrderNumber"/> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin1"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin1"/> <amOnPage url="{{AdminOrdersPage.url}}" stepKey="onOrdersPage"/> <waitForLoadingMaskToDisappear stepKey="waitForLoadingMaskToDisappearOnOrdersPage"/> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontGuestCheckoutUsingFreeShippingAndTaxesTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontGuestCheckoutUsingFreeShippingAndTaxesTest.xml index 7f4e6f0201ce5..2787627b935c1 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontGuestCheckoutUsingFreeShippingAndTaxesTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontGuestCheckoutUsingFreeShippingAndTaxesTest.xml @@ -21,7 +21,7 @@ </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="loginToAdminPanel"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginToAdminPanel"/> <createData entity="FlatRateShippingMethodConfig" stepKey="enableFlatRate"/> <createData entity="FreeShippingMethodsSettingConfig" stepKey="freeShippingMethodsSettingConfig"/> <createData entity="MinimumOrderAmount100" stepKey="minimumOrderAmount100"/> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontGuestCheckoutWithCouponAndZeroSubtotalTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontGuestCheckoutWithCouponAndZeroSubtotalTest.xml index c217eca5053c1..b63766e0cd374 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontGuestCheckoutWithCouponAndZeroSubtotalTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontGuestCheckoutWithCouponAndZeroSubtotalTest.xml @@ -18,7 +18,7 @@ </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="loginToAdminPanel"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginToAdminPanel"/> <createData entity="VirtualProduct" stepKey="virtualProduct"> <field key="price">50.00</field> </createData> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontProductNameMinicartOnCheckoutPageDifferentStoreViewsTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontProductNameMinicartOnCheckoutPageDifferentStoreViewsTest.xml index 71c6c7863f07c..e6e5c4f1a9299 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontProductNameMinicartOnCheckoutPageDifferentStoreViewsTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontProductNameMinicartOnCheckoutPageDifferentStoreViewsTest.xml @@ -20,7 +20,7 @@ <group value="checkout"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <!--Create a product--> <createData entity="SimpleProduct2" stepKey="createProduct"/> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontProductQuantityChangesInBackendAfterCustomerCheckoutTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontProductQuantityChangesInBackendAfterCustomerCheckoutTest.xml index 44e12d1ea4039..146db30aa7c86 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontProductQuantityChangesInBackendAfterCustomerCheckoutTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontProductQuantityChangesInBackendAfterCustomerCheckoutTest.xml @@ -18,7 +18,7 @@ </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="loginToAdminPanel"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginToAdminPanel"/> <magentoCLI command="config:set {{EnablePaymentBankTransferConfigData.path}} {{EnablePaymentBankTransferConfigData.value}}" stepKey="enableBankTransferPayment"/> <magentoCLI command="config:set {{EnableCatalogInventoryConfigData.path}} {{EnableCatalogInventoryConfigData.value}}" stepKey="enableCatalogInventoryStock"/> <createData entity="defaultSimpleProduct" stepKey="simpleProduct"> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontRefreshPageDuringGuestCheckoutTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontRefreshPageDuringGuestCheckoutTest.xml index 90896c3eb403e..43b2262265841 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontRefreshPageDuringGuestCheckoutTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontRefreshPageDuringGuestCheckoutTest.xml @@ -20,7 +20,7 @@ </annotations> <before> <!-- Login as admin --> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <!-- Create simple product --> <createData entity="SimpleProduct2" stepKey="createProduct"/> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontUKCustomerCheckoutWithCouponTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontUKCustomerCheckoutWithCouponTest.xml index 293abcb8197e1..849b586594955 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontUKCustomerCheckoutWithCouponTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontUKCustomerCheckoutWithCouponTest.xml @@ -109,7 +109,7 @@ <grabTextFrom selector="{{CheckoutSuccessMainSection.orderLink}}" stepKey="orderId"/> <!-- Login to Admin Page --> - <actionGroup ref="LoginAsAdmin" stepKey="loginToAdminPanel"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginToAdminPanel"/> <!-- Open Order Index Page --> <amOnPage url="{{AdminOrdersPage.url}}" stepKey="goToOrders"/> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontUKGuestCheckoutWithConditionProductQuantityEqualsToOrderedQuantityTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontUKGuestCheckoutWithConditionProductQuantityEqualsToOrderedQuantityTest.xml index 04ee2e2adbf28..ec99bb0e46722 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontUKGuestCheckoutWithConditionProductQuantityEqualsToOrderedQuantityTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontUKGuestCheckoutWithConditionProductQuantityEqualsToOrderedQuantityTest.xml @@ -18,7 +18,7 @@ </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="loginToAdminPanel"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginToAdminPanel"/> <createData entity="defaultSimpleProduct" stepKey="simpleProduct"> <field key="price">10.00</field> </createData> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontUSCustomerCheckoutWithCouponAndBankTransferPaymentMethodTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontUSCustomerCheckoutWithCouponAndBankTransferPaymentMethodTest.xml index bb3bd50072f23..642814ded6e3e 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontUSCustomerCheckoutWithCouponAndBankTransferPaymentMethodTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontUSCustomerCheckoutWithCouponAndBankTransferPaymentMethodTest.xml @@ -18,7 +18,7 @@ </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="loginToAdminPanel"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginToAdminPanel"/> <magentoCLI command="config:set {{EnablePaymentBankTransferConfigData.path}} {{EnablePaymentBankTransferConfigData.value}}" stepKey="enableBankTransferPayment"/> <createData entity="SimpleProduct2" stepKey="simpleProduct"> <field key="price">50.00</field> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontUpdatePriceInShoppingCartAfterProductSaveTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontUpdatePriceInShoppingCartAfterProductSaveTest.xml index e3a5546311f3b..12e2820821c87 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontUpdatePriceInShoppingCartAfterProductSaveTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontUpdatePriceInShoppingCartAfterProductSaveTest.xml @@ -22,7 +22,7 @@ <createData entity="SimpleProduct2" stepKey="createSimpleProduct"> <field key="price">100</field> </createData> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <actionGroup ref="SetCustomerDataLifetimeActionGroup" stepKey="setCustomerDataLifetime"> <argument name="minutes" value="1"/> </actionGroup> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/ZeroSubtotalOrdersWithProcessingStatusTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/ZeroSubtotalOrdersWithProcessingStatusTest.xml index 781253a707271..542c0ed6586e9 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/ZeroSubtotalOrdersWithProcessingStatusTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/ZeroSubtotalOrdersWithProcessingStatusTest.xml @@ -26,7 +26,7 @@ <createData entity="PaymentMethodsSettingConfig" stepKey="paymentMethodsSettingConfig"/> <createData entity="FreeShippingMethodsSettingConfig" stepKey="freeShippingMethodsSettingConfig"/> <!--Go to Admin page--> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> </before> <after> diff --git a/app/code/Magento/Checkout/view/frontend/web/js/sidebar.js b/app/code/Magento/Checkout/view/frontend/web/js/sidebar.js index 6fc5ef9d2a574..a7ccb217fa102 100644 --- a/app/code/Magento/Checkout/view/frontend/web/js/sidebar.js +++ b/app/code/Magento/Checkout/view/frontend/web/js/sidebar.js @@ -260,7 +260,12 @@ define([ if (!_.isUndefined(productData)) { $(document).trigger('ajax:removeFromCart', { - productIds: [productData['product_id']] + productIds: [productData['product_id']], + productInfo: [ + { + 'id': productData['product_id'] + } + ] }); if (window.location.href.indexOf(this.shoppingCartUrl) === 0) { diff --git a/app/code/Magento/CheckoutAgreements/Test/Mftf/ActionGroup/AdminAssertTermInGridActionGroup.xml b/app/code/Magento/CheckoutAgreements/Test/Mftf/ActionGroup/AdminAssertTermAbsentInGridActionGroup.xml similarity index 79% rename from app/code/Magento/CheckoutAgreements/Test/Mftf/ActionGroup/AdminAssertTermInGridActionGroup.xml rename to app/code/Magento/CheckoutAgreements/Test/Mftf/ActionGroup/AdminAssertTermAbsentInGridActionGroup.xml index 9a855c6f8b5e9..9e95f27c47287 100644 --- a/app/code/Magento/CheckoutAgreements/Test/Mftf/ActionGroup/AdminAssertTermInGridActionGroup.xml +++ b/app/code/Magento/CheckoutAgreements/Test/Mftf/ActionGroup/AdminAssertTermAbsentInGridActionGroup.xml @@ -8,7 +8,7 @@ <actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> - <actionGroup name="AdminAssertTermInGridActionGroup"> + <actionGroup name="AdminAssertTermAbsentInGridActionGroup"> <arguments> <argument name="termName" type="string"/> </arguments> @@ -16,6 +16,6 @@ <waitForPageLoad stepKey="waitForPageLoad"/> <fillField selector="{{AdminTermGridSection.filterByTermName}}" userInput="{{termName}}" stepKey="fillTermNameFilter"/> <click selector="{{AdminTermGridSection.searchButton}}" stepKey="clickSearchButton"/> - <see selector="{{AdminTermGridSection.firstRowConditionName}}" userInput="{{termName}}" stepKey="assertTermInGrid"/> + <dontSee selector="{{AdminTermGridSection.firstRowConditionName}}" userInput="{{termName}}" stepKey="assertTermAbsentInGrid"/> </actionGroup> </actionGroups> diff --git a/app/code/Magento/CheckoutAgreements/Test/Mftf/ActionGroup/DeleteTermActionGroup.xml b/app/code/Magento/CheckoutAgreements/Test/Mftf/ActionGroup/AdminTermsConditionsDeleteTermByNameActionGroup.xml similarity index 55% rename from app/code/Magento/CheckoutAgreements/Test/Mftf/ActionGroup/DeleteTermActionGroup.xml rename to app/code/Magento/CheckoutAgreements/Test/Mftf/ActionGroup/AdminTermsConditionsDeleteTermByNameActionGroup.xml index 13163e90efdbc..9489fece37008 100644 --- a/app/code/Magento/CheckoutAgreements/Test/Mftf/ActionGroup/DeleteTermActionGroup.xml +++ b/app/code/Magento/CheckoutAgreements/Test/Mftf/ActionGroup/AdminTermsConditionsDeleteTermByNameActionGroup.xml @@ -8,16 +8,7 @@ <actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> - <actionGroup name="DeleteTermActionGroup"> - <arguments> - <argument name="term"/> - </arguments> - <amOnPage url="{{AdminTermsPage.url}}" stepKey="onTermGridPage"/> - <waitForPageLoad stepKey="waitForAdminTermsGridPageLoad"/> - <fillField selector="{{AdminTermGridSection.filterByTermName}}" userInput="{{term.name}}" stepKey="fillTermNameFilter"/> - <click selector="{{AdminTermGridSection.searchButton}}" stepKey="clickSearchButton"/> - <click selector="{{AdminTermGridSection.firstRowConditionId}}" stepKey="clickFirstRow"/> - <waitForPageLoad stepKey="waitForEditTermPageLoad"/> + <actionGroup name="AdminTermsConditionsDeleteTermByNameActionGroup"> <click selector="{{AdminEditTermFormSection.delete}}" stepKey="clickDeleteButton"/> <waitForElementVisible selector="{{AdminEditTermFormSection.acceptPopupButton}}" stepKey="waitForElement"/> <click selector="{{AdminEditTermFormSection.acceptPopupButton}}" stepKey="clickDeleteOkButton"/> diff --git a/app/code/Magento/CheckoutAgreements/Test/Mftf/ActionGroup/AdminTermsConditionsEditTermByNameActionGroup.xml b/app/code/Magento/CheckoutAgreements/Test/Mftf/ActionGroup/AdminTermsConditionsEditTermByNameActionGroup.xml new file mode 100644 index 0000000000000..8f2e65415ac22 --- /dev/null +++ b/app/code/Magento/CheckoutAgreements/Test/Mftf/ActionGroup/AdminTermsConditionsEditTermByNameActionGroup.xml @@ -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="AdminTermsConditionsEditTermByNameActionGroup" extends="AdminTermsConditionsFilterGridByNameActionGroup"> + <annotations> + <description>Filters Terms and Conditions grid and opens the first result Edit page</description> + </annotations> + + <click selector="{{AdminTermGridSection.firstRowConditionId}}" stepKey="clickFirstRow"/> + <waitForPageLoad stepKey="waitForEditTermPageLoad"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/CheckoutAgreements/Test/Mftf/ActionGroup/CreateNewTermActionGroup.xml b/app/code/Magento/CheckoutAgreements/Test/Mftf/ActionGroup/AdminTermsConditionsFillTermEditFormActionGroup.xml similarity index 75% rename from app/code/Magento/CheckoutAgreements/Test/Mftf/ActionGroup/CreateNewTermActionGroup.xml rename to app/code/Magento/CheckoutAgreements/Test/Mftf/ActionGroup/AdminTermsConditionsFillTermEditFormActionGroup.xml index d420cc155a77c..f32f1b11926a3 100644 --- a/app/code/Magento/CheckoutAgreements/Test/Mftf/ActionGroup/CreateNewTermActionGroup.xml +++ b/app/code/Magento/CheckoutAgreements/Test/Mftf/ActionGroup/AdminTermsConditionsFillTermEditFormActionGroup.xml @@ -8,12 +8,11 @@ <actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> - <actionGroup name="CreateNewTermActionGroup"> + <actionGroup name="AdminTermsConditionsFillTermEditFormActionGroup"> <arguments> <argument name="term"/> </arguments> - <amOnPage url="{{AdminNewTermPage.url}}" stepKey="amOnNewTermPage"/> - <waitForPageLoad stepKey="waitForAdminNewTermPageLoad"/> + <fillField selector="{{AdminNewTermFormSection.conditionName}}" userInput="{{term.name}}" stepKey="fillFieldConditionName"/> <selectOption selector="{{AdminNewTermFormSection.isActive}}" userInput="{{term.isActive}}" stepKey="selectOptionIsActive"/> <selectOption selector="{{AdminNewTermFormSection.isHtml}}" userInput="{{term.isHtml}}" stepKey="selectOptionIsHtml"/> @@ -21,7 +20,5 @@ <selectOption selector="{{AdminNewTermFormSection.storeView}}" userInput="{{term.storeView}}" stepKey="selectOptionStoreView" /> <fillField selector="{{AdminNewTermFormSection.checkboxText}}" userInput="{{term.checkboxText}}" stepKey="fillFieldCheckboxText"/> <fillField selector="{{AdminNewTermFormSection.content}}" userInput="{{term.content}}" stepKey="fillFieldContent"/> - <click selector="{{AdminNewTermFormSection.save}}" stepKey="saveTerm"/> - <see selector="{{AdminTermFormMessagesSection.successMessage}}" userInput="You saved the condition." stepKey="seeSuccessMessage"/> </actionGroup> -</actionGroups> \ No newline at end of file +</actionGroups> diff --git a/app/code/Magento/CheckoutAgreements/Test/Mftf/ActionGroup/AdminTermsConditionsFilterGridByNameActionGroup.xml b/app/code/Magento/CheckoutAgreements/Test/Mftf/ActionGroup/AdminTermsConditionsFilterGridByNameActionGroup.xml new file mode 100644 index 0000000000000..2290d8152473c --- /dev/null +++ b/app/code/Magento/CheckoutAgreements/Test/Mftf/ActionGroup/AdminTermsConditionsFilterGridByNameActionGroup.xml @@ -0,0 +1,22 @@ +<?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="AdminTermsConditionsFilterGridByNameActionGroup"> + <annotations> + <description>Filters Terms and Conditions grid for name</description> + </annotations> + <arguments> + <argument name="termName" type="string"/> + </arguments> + + <fillField selector="{{AdminTermGridSection.filterByTermName}}" userInput="{{termName}}" stepKey="fillTermNameFilter"/> + <click selector="{{AdminTermGridSection.searchButton}}" stepKey="clickSearchButton"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/CheckoutAgreements/Test/Mftf/ActionGroup/AdminTermsConditionsOpenGridActionGroup.xml b/app/code/Magento/CheckoutAgreements/Test/Mftf/ActionGroup/AdminTermsConditionsOpenGridActionGroup.xml new file mode 100644 index 0000000000000..98a0a04e501fc --- /dev/null +++ b/app/code/Magento/CheckoutAgreements/Test/Mftf/ActionGroup/AdminTermsConditionsOpenGridActionGroup.xml @@ -0,0 +1,15 @@ +<?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="AdminTermsConditionsOpenGridActionGroup"> + <amOnPage url="{{AdminTermsPage.url}}" stepKey="onTermGridPage"/> + <waitForPageLoad stepKey="waitForPageLoad"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/CheckoutAgreements/Test/Mftf/ActionGroup/AdminTermsConditionsOpenNewTermPageActionGroup.xml b/app/code/Magento/CheckoutAgreements/Test/Mftf/ActionGroup/AdminTermsConditionsOpenNewTermPageActionGroup.xml new file mode 100644 index 0000000000000..a6aa97dd269d4 --- /dev/null +++ b/app/code/Magento/CheckoutAgreements/Test/Mftf/ActionGroup/AdminTermsConditionsOpenNewTermPageActionGroup.xml @@ -0,0 +1,15 @@ +<?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="AdminTermsConditionsOpenNewTermPageActionGroup"> + <amOnPage url="{{AdminNewTermPage.url}}" stepKey="amOnNewTermPage"/> + <waitForPageLoad stepKey="waitForAdminNewTermPageLoad"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/CheckoutAgreements/Test/Mftf/ActionGroup/AdminTermsConditionsSaveTermActionGroup.xml b/app/code/Magento/CheckoutAgreements/Test/Mftf/ActionGroup/AdminTermsConditionsSaveTermActionGroup.xml new file mode 100644 index 0000000000000..457c4495c28e3 --- /dev/null +++ b/app/code/Magento/CheckoutAgreements/Test/Mftf/ActionGroup/AdminTermsConditionsSaveTermActionGroup.xml @@ -0,0 +1,15 @@ +<?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="AdminTermsConditionsSaveTermActionGroup"> + <click selector="{{AdminNewTermFormSection.save}}" stepKey="saveTerm"/> + <see selector="{{AdminTermFormMessagesSection.successMessage}}" userInput="You saved the condition." stepKey="seeSuccessMessage"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/CheckoutAgreements/Test/Mftf/ActionGroup/AdminTermsConditionsUpdateTermActionGroup.xml b/app/code/Magento/CheckoutAgreements/Test/Mftf/ActionGroup/AdminTermsConditionsUpdateTermActionGroup.xml new file mode 100644 index 0000000000000..b7f92093356fa --- /dev/null +++ b/app/code/Magento/CheckoutAgreements/Test/Mftf/ActionGroup/AdminTermsConditionsUpdateTermActionGroup.xml @@ -0,0 +1,31 @@ +<?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="UpdateTermActionGroup"> + <arguments> + <argument name="term" /> + <argument name="updateTermData" /> + </arguments> + <amOnPage url="{{AdminTermsPage.url}}" stepKey="onTermGridPage"/> + <waitForPageLoad stepKey="waitForAdminTermsGridLoad"/> + <fillField selector="{{AdminTermGridSection.filterByTermName}}" userInput="{{term.name}}" stepKey="fillTermNameFilter"/> + <click selector="{{AdminTermGridSection.searchButton}}" stepKey="clickSearchButton"/> + + <fillField selector="{{AdminNewTermFormSection.conditionName}}" userInput="{{updateTermData.name}}" stepKey="fillFieldConditionName"/> + <selectOption selector="{{AdminNewTermFormSection.isActive}}" userInput="{{updateTermData.isActive}}" stepKey="selectOptionIsActive"/> + <selectOption selector="{{AdminNewTermFormSection.isHtml}}" userInput="{{updateTermData.isHtml}}" stepKey="selectOptionIsHtml"/> + <selectOption selector="{{AdminNewTermFormSection.mode}}" userInput="{{updateTermData.mode}}" stepKey="selectOptionMode"/> + <selectOption selector="{{AdminNewTermFormSection.storeView}}" userInput="{{updateTermData.storeView}}" stepKey="selectOptionStoreView" /> + <fillField selector="{{AdminNewTermFormSection.checkboxText}}" userInput="{{updateTermData.checkboxText}}" stepKey="fillFieldCheckboxText"/> + <fillField selector="{{AdminNewTermFormSection.content}}" userInput="{{updateTermData.content}}" stepKey="fillFieldContent"/> + <click selector="{{AdminNewTermFormSection.save}}" stepKey="saveTerm"/> + <see selector="{{AdminTermFormMessagesSection.successMessage}}" userInput="You saved the condition." stepKey="seeSuccessMessage"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/CheckoutAgreements/Test/Mftf/ActionGroup/AssertAdminTermsConditionsInGridActionGroup.xml b/app/code/Magento/CheckoutAgreements/Test/Mftf/ActionGroup/AssertAdminTermsConditionsInGridActionGroup.xml new file mode 100644 index 0000000000000..37f2761bf8e9a --- /dev/null +++ b/app/code/Magento/CheckoutAgreements/Test/Mftf/ActionGroup/AssertAdminTermsConditionsInGridActionGroup.xml @@ -0,0 +1,14 @@ +<?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="AssertAdminTermsConditionsInGridActionGroup" extends="AdminTermsConditionsFilterGridByNameActionGroup"> + <see selector="{{AdminTermGridSection.firstRowConditionName}}" userInput="{{termName}}" stepKey="assertTermInGrid" after="clickSearchButton"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/CheckoutAgreements/Test/Mftf/ActionGroup/StorefrontAssertTermAbsentInCheckoutActionGroup.xml b/app/code/Magento/CheckoutAgreements/Test/Mftf/ActionGroup/AssertStorefrontTermAbsentInCheckoutActionGroup.xml similarity index 96% rename from app/code/Magento/CheckoutAgreements/Test/Mftf/ActionGroup/StorefrontAssertTermAbsentInCheckoutActionGroup.xml rename to app/code/Magento/CheckoutAgreements/Test/Mftf/ActionGroup/AssertStorefrontTermAbsentInCheckoutActionGroup.xml index 7be17d8ca69d0..bf0c4f4b5a2c5 100644 --- a/app/code/Magento/CheckoutAgreements/Test/Mftf/ActionGroup/StorefrontAssertTermAbsentInCheckoutActionGroup.xml +++ b/app/code/Magento/CheckoutAgreements/Test/Mftf/ActionGroup/AssertStorefrontTermAbsentInCheckoutActionGroup.xml @@ -8,7 +8,7 @@ <actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> - <actionGroup name="StorefrontAssertTermAbsentInCheckoutActionGroup"> + <actionGroup name="AssertStorefrontTermAbsentInCheckoutActionGroup"> <arguments> <argument name="termCheckboxText" type="string"/> </arguments> diff --git a/app/code/Magento/CheckoutAgreements/Test/Mftf/ActionGroup/StorefrontAssertTermInCheckoutActionGroup.xml b/app/code/Magento/CheckoutAgreements/Test/Mftf/ActionGroup/AssertStorefrontTermInCheckoutActionGroup.xml similarity index 96% rename from app/code/Magento/CheckoutAgreements/Test/Mftf/ActionGroup/StorefrontAssertTermInCheckoutActionGroup.xml rename to app/code/Magento/CheckoutAgreements/Test/Mftf/ActionGroup/AssertStorefrontTermInCheckoutActionGroup.xml index 0cf745ce4e04f..bef0591a6e311 100644 --- a/app/code/Magento/CheckoutAgreements/Test/Mftf/ActionGroup/StorefrontAssertTermInCheckoutActionGroup.xml +++ b/app/code/Magento/CheckoutAgreements/Test/Mftf/ActionGroup/AssertStorefrontTermInCheckoutActionGroup.xml @@ -8,7 +8,7 @@ <actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> - <actionGroup name="StorefrontAssertTermInCheckoutActionGroup"> + <actionGroup name="AssertStorefrontTermInCheckoutActionGroup"> <arguments> <argument name="termCheckboxText" type="string"/> </arguments> diff --git a/app/code/Magento/CheckoutAgreements/Test/Mftf/ActionGroup/StorefrontAssertTermRequireMessageInMultishippingCheckoutActionGroup.xml b/app/code/Magento/CheckoutAgreements/Test/Mftf/ActionGroup/AssertStorefrontTermRequireMessageInMultishippingCheckoutActionGroup.xml similarity index 97% rename from app/code/Magento/CheckoutAgreements/Test/Mftf/ActionGroup/StorefrontAssertTermRequireMessageInMultishippingCheckoutActionGroup.xml rename to app/code/Magento/CheckoutAgreements/Test/Mftf/ActionGroup/AssertStorefrontTermRequireMessageInMultishippingCheckoutActionGroup.xml index 35ac4826ccfef..c8f49adc30067 100644 --- a/app/code/Magento/CheckoutAgreements/Test/Mftf/ActionGroup/StorefrontAssertTermRequireMessageInMultishippingCheckoutActionGroup.xml +++ b/app/code/Magento/CheckoutAgreements/Test/Mftf/ActionGroup/AssertStorefrontTermRequireMessageInMultishippingCheckoutActionGroup.xml @@ -8,7 +8,7 @@ <actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> - <actionGroup name="StorefrontAssertTermRequireMessageInMultishippingCheckoutActionGroup"> + <actionGroup name="AssertStorefrontTermRequireMessageInMultishippingCheckoutActionGroup"> <arguments> <argument name="termCheckboxText" type="string"/> </arguments> diff --git a/app/code/Magento/CheckoutAgreements/Test/Mftf/Data/TermData.xml b/app/code/Magento/CheckoutAgreements/Test/Mftf/Data/TermData.xml index f34aa52d1ebe3..0172ffc771384 100644 --- a/app/code/Magento/CheckoutAgreements/Test/Mftf/Data/TermData.xml +++ b/app/code/Magento/CheckoutAgreements/Test/Mftf/Data/TermData.xml @@ -35,4 +35,13 @@ <data key="checkboxText" unique="suffix">test_checkbox</data> <data key="content" unique="suffix">TestMessage</data> </entity> + <entity name="disabledHtmlTerm" type="term"> + <data key="name" unique="suffix">name</data> + <data key="isActive">Disabled</data> + <data key="isHtml">HTML</data> + <data key="mode">Manually</data> + <data key="storeView">Default Store View</data> + <data key="checkboxText" unique="suffix">test_checkbox</data> + <data key="content"><html></data> + </entity> </entities> diff --git a/app/code/Magento/CheckoutAgreements/Test/Mftf/Test/AdminCreateActiveHtmlTermEntityTest.xml b/app/code/Magento/CheckoutAgreements/Test/Mftf/Test/AdminCreateActiveHtmlTermEntityTest.xml index 1e87d73c26205..c597d3d660dc8 100644 --- a/app/code/Magento/CheckoutAgreements/Test/Mftf/Test/AdminCreateActiveHtmlTermEntityTest.xml +++ b/app/code/Magento/CheckoutAgreements/Test/Mftf/Test/AdminCreateActiveHtmlTermEntityTest.xml @@ -21,32 +21,44 @@ </annotations> <before> <magentoCLI command="config:set checkout/options/enable_agreements 1" stepKey="setEnableTermsOnCheckout"/> - <actionGroup ref="LoginAsAdmin" stepKey="LoginAsAdmin" /> - <createData entity="SimpleTwo" stepKey="createdProduct"/> - <magentoCLI command="indexer:reindex" stepKey="reindex"/> - <magentoCLI command="cache:flush" stepKey="flushCache"/> + + <createData entity="SimpleTwo" stepKey="createProduct"/> + <magentoCron stepKey="runCronIndex" groups="index"/> + + <actionGroup ref="AdminLoginActionGroup" stepKey="adminLogin"/> </before> <after> <magentoCLI command="config:set checkout/options/enable_agreements 0" stepKey="setDisableTermsOnCheckout"/> - <deleteData createDataKey="createdProduct" stepKey="deletedProduct"/> - <actionGroup ref="DeleteTermActionGroup" stepKey="deleteTerm"> - <argument name="term" value="activeHtmlTerm"/> + <deleteData createDataKey="createProduct" stepKey="deletedProduct"/> + + <actionGroup ref="AdminTermsConditionsOpenGridActionGroup" stepKey="openTermsGridToDelete"/> + <actionGroup ref="AdminTermsConditionsEditTermByNameActionGroup" stepKey="openTermToDelete"> + <argument name="termName" value="{{activeHtmlTerm.name}}"/> </actionGroup> - <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> + <actionGroup ref="AdminTermsConditionsDeleteTermByNameActionGroup" stepKey="deleteOpenedTerm"/> + + <actionGroup ref="AdminLogoutActionGroup" stepKey="adminLogout"/> </after> - <actionGroup ref="CreateNewTermActionGroup" stepKey="createTerm"> + <actionGroup ref="AdminTermsConditionsOpenNewTermPageActionGroup" stepKey="openNewTerm"/> + <actionGroup ref="AdminTermsConditionsFillTermEditFormActionGroup" stepKey="fillNewTerm"> <argument name="term" value="activeHtmlTerm"/> </actionGroup> - <actionGroup ref="AdminAssertTermInGridActionGroup" stepKey="assertTermInGrid"> + <actionGroup ref="AdminTermsConditionsSaveTermActionGroup" stepKey="saveNewTerm"/> + + <actionGroup ref="AdminTermsConditionsOpenGridActionGroup" stepKey="openTermsGrid"/> + <actionGroup ref="AssertAdminTermsConditionsInGridActionGroup" stepKey="assertTermInGrid"> <argument name="termName" value="{{activeHtmlTerm.name}}"/> </actionGroup> + + <openNewTab stepKey="openStorefrontTab"/> <actionGroup ref="AddSimpleProductToCartActionGroup" stepKey="addProductToTheCart"> - <argument name="product" value="$$createdProduct$$"/> + <argument name="product" value="$$createProduct$$"/> </actionGroup> <actionGroup ref="StorefrontProcessCheckoutToPaymentActionGroup" stepKey="processCheckoutToThePaymentMethodsPage"/> - <actionGroup ref="StorefrontAssertTermInCheckoutActionGroup" stepKey="assertTermInCheckout"> + <actionGroup ref="AssertStorefrontTermInCheckoutActionGroup" stepKey="assertTermInCheckout"> <argument name="termCheckboxText" value="{{activeHtmlTerm.checkboxText}}"/> </actionGroup> + <closeTab stepKey="closeStorefrontTab"/> </test> </tests> diff --git a/app/code/Magento/CheckoutAgreements/Test/Mftf/Test/AdminCreateActiveTextTermEntityTest.xml b/app/code/Magento/CheckoutAgreements/Test/Mftf/Test/AdminCreateActiveTextTermEntityTest.xml index 2db3377e0e89e..a90c3536ec744 100644 --- a/app/code/Magento/CheckoutAgreements/Test/Mftf/Test/AdminCreateActiveTextTermEntityTest.xml +++ b/app/code/Magento/CheckoutAgreements/Test/Mftf/Test/AdminCreateActiveTextTermEntityTest.xml @@ -8,7 +8,7 @@ <tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> - <test name="AdminCreateActiveTextTermEntityTest"> + <test name="AdminCreateActiveTextTermEntityTest" extends="AdminCreateActiveHtmlTermEntityTest"> <annotations> <features value="CheckoutAgreements"/> <stories value="Checkout agreements"/> @@ -19,33 +19,19 @@ <group value="checkoutAgreements"/> <group value="mtf_migrated"/> </annotations> - <before> - <magentoCLI command="config:set checkout/options/enable_agreements 1" stepKey="setEnableTermsOnCheckout"/> - <actionGroup ref="LoginAsAdmin" stepKey="LoginAsAdmin" /> - <createData entity="SimpleTwo" stepKey="createdProduct"/> - <magentoCLI command="indexer:reindex" stepKey="reindex"/> - <magentoCLI command="cache:flush" stepKey="flushCache"/> - </before> <after> - <magentoCLI command="config:set checkout/options/enable_agreements 0" stepKey="setDisableTermsOnCheckout"/> - <deleteData createDataKey="createdProduct" stepKey="deletedProduct"/> - <actionGroup ref="DeleteTermActionGroup" stepKey="deleteTerm"> - <argument name="term" value="activeTextTerm"/> + <actionGroup ref="AdminTermsConditionsEditTermByNameActionGroup" stepKey="openTermToDelete"> + <argument name="termName" value="{{activeTextTerm.name}}"/> </actionGroup> - <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> </after> - <actionGroup ref="CreateNewTermActionGroup" stepKey="createTerm"> + <actionGroup ref="AdminTermsConditionsFillTermEditFormActionGroup" stepKey="fillNewTerm"> <argument name="term" value="activeTextTerm"/> </actionGroup> - <actionGroup ref="AdminAssertTermInGridActionGroup" stepKey="assertTermInGrid"> + <actionGroup ref="AssertAdminTermsConditionsInGridActionGroup" stepKey="assertTermInGrid"> <argument name="termName" value="{{activeTextTerm.name}}"/> </actionGroup> - <actionGroup ref="AddSimpleProductToCartActionGroup" stepKey="addProductToTheCart"> - <argument name="product" value="$$createdProduct$$"/> - </actionGroup> - <actionGroup ref="StorefrontProcessCheckoutToPaymentActionGroup" stepKey="processCheckoutToThePaymentMethodsPage"/> - <actionGroup ref="StorefrontAssertTermInCheckoutActionGroup" stepKey="assertTermInCheckout"> + <actionGroup ref="AssertStorefrontTermInCheckoutActionGroup" stepKey="assertTermInCheckout"> <argument name="termCheckboxText" value="{{activeTextTerm.checkboxText}}"/> </actionGroup> </test> diff --git a/app/code/Magento/CheckoutAgreements/Test/Mftf/Test/AdminCreateDisabledTextTermEntityTest.xml b/app/code/Magento/CheckoutAgreements/Test/Mftf/Test/AdminCreateDisabledTextTermEntityTest.xml index df666ecab817b..3c0c171fdfe9e 100644 --- a/app/code/Magento/CheckoutAgreements/Test/Mftf/Test/AdminCreateDisabledTextTermEntityTest.xml +++ b/app/code/Magento/CheckoutAgreements/Test/Mftf/Test/AdminCreateDisabledTextTermEntityTest.xml @@ -21,32 +21,44 @@ </annotations> <before> <magentoCLI command="config:set checkout/options/enable_agreements 1" stepKey="setEnableTermsOnCheckout"/> - <actionGroup ref="LoginAsAdmin" stepKey="LoginAsAdmin" /> - <createData entity="SimpleTwo" stepKey="createdProduct"/> - <magentoCLI command="indexer:reindex" stepKey="reindex"/> - <magentoCLI command="cache:flush" stepKey="flushCache"/> + + <createData entity="SimpleTwo" stepKey="createProduct"/> + <magentoCron stepKey="runCronIndex" groups="index"/> + + <actionGroup ref="AdminLoginActionGroup" stepKey="adminLogin"/> </before> <after> <magentoCLI command="config:set checkout/options/enable_agreements 0" stepKey="setDisableTermsOnCheckout"/> - <deleteData createDataKey="createdProduct" stepKey="deletedProduct"/> - <actionGroup ref="DeleteTermActionGroup" stepKey="deleteTerm"> - <argument name="term" value="disabledTextTerm"/> + <deleteData createDataKey="createProduct" stepKey="deletedProduct"/> + + <actionGroup ref="AdminTermsConditionsOpenGridActionGroup" stepKey="openTermsGridToDelete"/> + <actionGroup ref="AdminTermsConditionsEditTermByNameActionGroup" stepKey="openTermToDelete"> + <argument name="termName" value="{{disabledTextTerm.name}}"/> </actionGroup> - <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> + <actionGroup ref="AdminTermsConditionsDeleteTermByNameActionGroup" stepKey="deleteOpenedTerm"/> + + <actionGroup ref="AdminLogoutActionGroup" stepKey="adminLogout"/> </after> - <actionGroup ref="CreateNewTermActionGroup" stepKey="createTerm"> + <actionGroup ref="AdminTermsConditionsOpenNewTermPageActionGroup" stepKey="openNewTerm"/> + <actionGroup ref="AdminTermsConditionsFillTermEditFormActionGroup" stepKey="fillNewTerm"> <argument name="term" value="disabledTextTerm"/> </actionGroup> - <actionGroup ref="AdminAssertTermInGridActionGroup" stepKey="assertTermInGrid"> + <actionGroup ref="AdminTermsConditionsSaveTermActionGroup" stepKey="saveNewTerm"/> + + <actionGroup ref="AdminTermsConditionsOpenGridActionGroup" stepKey="openTermsGrid"/> + <actionGroup ref="AssertAdminTermsConditionsInGridActionGroup" stepKey="assertTermInGrid"> <argument name="termName" value="{{disabledTextTerm.name}}"/> </actionGroup> + + <openNewTab stepKey="openStorefrontTab"/> <actionGroup ref="AddSimpleProductToCartActionGroup" stepKey="addProductToTheCart"> - <argument name="product" value="$$createdProduct$$"/> + <argument name="product" value="$$createProduct$$"/> </actionGroup> <actionGroup ref="StorefrontProcessCheckoutToPaymentActionGroup" stepKey="processCheckoutToThePaymentMethodsPage"/> - <actionGroup ref="StorefrontAssertTermAbsentInCheckoutActionGroup" stepKey="assertTermAbsentInCheckout"> + <actionGroup ref="AssertStorefrontTermAbsentInCheckoutActionGroup" stepKey="assertTermAbsentInCheckout"> <argument name="termCheckboxText" value="{{disabledTextTerm.checkboxText}}"/> </actionGroup> + <closeTab stepKey="closeStorefrontTab"/> </test> </tests> diff --git a/app/code/Magento/CheckoutAgreements/Test/Mftf/Test/AdminCreateEnabledTextTermOnMultishippingEntityTest.xml b/app/code/Magento/CheckoutAgreements/Test/Mftf/Test/AdminCreateEnabledTextTermOnMultishippingEntityTest.xml index fec2365431862..c60ef95c8edce 100644 --- a/app/code/Magento/CheckoutAgreements/Test/Mftf/Test/AdminCreateEnabledTextTermOnMultishippingEntityTest.xml +++ b/app/code/Magento/CheckoutAgreements/Test/Mftf/Test/AdminCreateEnabledTextTermOnMultishippingEntityTest.xml @@ -21,27 +21,36 @@ </annotations> <before> <magentoCLI command="config:set checkout/options/enable_agreements 1" stepKey="setEnableTermsOnCheckout"/> - <actionGroup ref="LoginAsAdmin" stepKey="LoginAsAdmin" /> + <createData entity="Simple_US_Customer_Multiple_Addresses" stepKey="createdCustomer"/> <createData entity="SimpleTwo" stepKey="createdProduct1"/> <createData entity="SimpleTwo" stepKey="createdProduct2"/> - <magentoCLI command="indexer:reindex" stepKey="reindex"/> - <magentoCLI command="cache:flush" stepKey="flushCache"/> + <magentoCron stepKey="runCronIndex" groups="index"/> + + <actionGroup ref="AdminLoginActionGroup" stepKey="adminLogin"/> </before> <after> <magentoCLI command="config:set checkout/options/enable_agreements 0" stepKey="setDisableTermsOnCheckout"/> + <deleteData createDataKey="createdCustomer" stepKey="deletedCustomer"/> <deleteData createDataKey="createdProduct1" stepKey="deletedProduct1"/> <deleteData createDataKey="createdProduct2" stepKey="deletedProduct2"/> - <actionGroup ref="DeleteTermActionGroup" stepKey="deleteTerm"> - <argument name="term" value="activeTextTerm"/> + + <actionGroup ref="AdminTermsConditionsOpenGridActionGroup" stepKey="openTermsGridToDelete"/> + <actionGroup ref="AdminTermsConditionsEditTermByNameActionGroup" stepKey="openTermToDelete"> + <argument name="termName" value="{{activeTextTerm.name}}"/> </actionGroup> + <actionGroup ref="AdminTermsConditionsDeleteTermByNameActionGroup" stepKey="deleteOpenedTerm"/> + <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> </after> - <actionGroup ref="CreateNewTermActionGroup" stepKey="createTerm"> + <actionGroup ref="AdminTermsConditionsOpenNewTermPageActionGroup" stepKey="openNewTerm"/> + <actionGroup ref="AdminTermsConditionsFillTermEditFormActionGroup" stepKey="fillNewTerm"> <argument name="term" value="activeTextTerm"/> </actionGroup> + <actionGroup ref="AdminTermsConditionsSaveTermActionGroup" stepKey="saveNewTerm"/> + <actionGroup ref="LoginToStorefrontActionGroup" stepKey="customerLogin"> <argument name="Customer" value="$$createdCustomer$$" /> </actionGroup> @@ -51,7 +60,7 @@ <actionGroup ref="AddSimpleProductToCartActionGroup" stepKey="addProduct2ToTheCart"> <argument name="product" value="$$createdProduct2$$"/> </actionGroup> - <actionGroup ref="StorefrontAssertTermRequireMessageInMultishippingCheckoutActionGroup" stepKey="assertTermInCheckout"> + <actionGroup ref="AssertStorefrontTermRequireMessageInMultishippingCheckoutActionGroup" stepKey="assertTermInCheckout"> <argument name="termCheckboxText" value="{{activeTextTerm.checkboxText}}"/> </actionGroup> </test> diff --git a/app/code/Magento/CheckoutAgreements/Test/Mftf/Test/AdminDeleteActiveTextTermEntityTest.xml b/app/code/Magento/CheckoutAgreements/Test/Mftf/Test/AdminDeleteActiveTextTermEntityTest.xml new file mode 100644 index 0000000000000..1e17dcc675573 --- /dev/null +++ b/app/code/Magento/CheckoutAgreements/Test/Mftf/Test/AdminDeleteActiveTextTermEntityTest.xml @@ -0,0 +1,55 @@ +<?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="AdminDeleteActiveTextTermEntityTest"> + <annotations> + <features value="CheckoutAgreements"/> + <stories value="Checkout agreements"/> + <title value="Delete active text checkout agreement"/> + <description value="Admin should be able to delete active text checkout agreement"/> + <severity value="CRITICAL"/> + <testCaseId value="MC-14663"/> + <group value="checkoutAgreements"/> + <group value="mtf_migrated"/> + </annotations> + <before> + <magentoCLI command="config:set checkout/options/enable_agreements 1" stepKey="setEnableTermsOnCheckout"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="LoginAsAdmin" /> + <createData entity="SimpleTwo" stepKey="createdProduct"/> + <actionGroup ref="AdminTermsConditionsOpenNewTermPageActionGroup" stepKey="openNewTerm"/> + <actionGroup ref="AdminTermsConditionsFillTermEditFormActionGroup" stepKey="createTerm"> + <argument name="term" value="activeTextTerm"/> + </actionGroup> + <actionGroup ref="AdminTermsConditionsSaveTermActionGroup" stepKey="saveNewTerm"/> + </before> + <after> + <magentoCLI command="config:set checkout/options/enable_agreements 0" stepKey="setDisableTermsOnCheckout"/> + <deleteData createDataKey="createdProduct" stepKey="deletedProduct"/> + <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> + </after> + + <actionGroup ref="AdminTermsConditionsOpenGridActionGroup" stepKey="openTermsGridToDelete"/> + <actionGroup ref="AdminTermsConditionsEditTermByNameActionGroup" stepKey="openTermToDelete"> + <argument name="termName" value="{{activeTextTerm.name}}"/> + </actionGroup> + <actionGroup ref="AdminTermsConditionsDeleteTermByNameActionGroup" stepKey="deleteOpenedTerm"/> + <actionGroup ref="AdminAssertTermAbsentInGridActionGroup" stepKey="assertTermAbsentInGrid"> + <argument name="termName" value="{{activeTextTerm.name}}"/> + </actionGroup> + + <actionGroup ref="AddSimpleProductToCartActionGroup" stepKey="openProductPage"> + <argument name="product" value="$$createdProduct$$"/> + </actionGroup> + <actionGroup ref="StorefrontProcessCheckoutToPaymentActionGroup" stepKey="processCheckoutToThePaymentMethodsPage"/> + <actionGroup ref="AssertStorefrontTermAbsentInCheckoutActionGroup" stepKey="assertTermAbsentInCheckout"> + <argument name="termCheckboxText" value="{{activeTextTerm.checkboxText}}"/> + </actionGroup> + </test> +</tests> diff --git a/app/code/Magento/CheckoutAgreements/Test/Mftf/Test/AdminStoresTermsAndConditionsNavigateMenuTest.xml b/app/code/Magento/CheckoutAgreements/Test/Mftf/Test/AdminStoresTermsAndConditionsNavigateMenuTest.xml index 7ffabcfa51215..3e680ce83f00e 100644 --- a/app/code/Magento/CheckoutAgreements/Test/Mftf/Test/AdminStoresTermsAndConditionsNavigateMenuTest.xml +++ b/app/code/Magento/CheckoutAgreements/Test/Mftf/Test/AdminStoresTermsAndConditionsNavigateMenuTest.xml @@ -20,7 +20,7 @@ <group value="mtf_migrated"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="LoginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="LoginAsAdmin"/> </before> <after> <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> diff --git a/app/code/Magento/CheckoutAgreements/Test/Mftf/Test/AdminUpdateDisabledHtmlTermEntityTest.xml b/app/code/Magento/CheckoutAgreements/Test/Mftf/Test/AdminUpdateDisabledHtmlTermEntityTest.xml new file mode 100644 index 0000000000000..f9d60796d0424 --- /dev/null +++ b/app/code/Magento/CheckoutAgreements/Test/Mftf/Test/AdminUpdateDisabledHtmlTermEntityTest.xml @@ -0,0 +1,73 @@ +<?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="AdminUpdateDisabledHtmlTermEntityTest"> + <annotations> + <features value="CheckoutAgreements"/> + <stories value="Checkout agreements"/> + <title value="Update disabled HTML checkout agreement"/> + <description value="Admin should be able to update disabled HTML checkout agreement"/> + <severity value="CRITICAL"/> + <testCaseId value="MC-14664"/> + <group value="checkoutAgreements"/> + <group value="mtf_migrated"/> + </annotations> + <before> + <magentoCLI command="config:set checkout/options/enable_agreements 1" stepKey="setEnableTermsOnCheckout"/> + + <createData entity="SimpleTwo" stepKey="createProduct"/> + <magentoCron stepKey="runCronIndex" groups="index"/> + + <actionGroup ref="AdminLoginActionGroup" stepKey="adminLogin"/> + </before> + <after> + <magentoCLI command="config:set checkout/options/enable_agreements 0" stepKey="setDisableTermsOnCheckout"/> + <deleteData createDataKey="createProduct" stepKey="deletedProduct"/> + + <actionGroup ref="AdminTermsConditionsOpenGridActionGroup" stepKey="openTermsGridToDelete"/> + <actionGroup ref="AdminTermsConditionsEditTermByNameActionGroup" stepKey="openTermToDelete"> + <argument name="termName" value="{{activeTextTerm.name}}"/> + </actionGroup> + <actionGroup ref="AdminTermsConditionsDeleteTermByNameActionGroup" stepKey="deleteOpenedTerm"/> + + <actionGroup ref="AdminLogoutActionGroup" stepKey="adminLogout"/> + </after> + + <actionGroup ref="AdminTermsConditionsOpenNewTermPageActionGroup" stepKey="openNewTerm"/> + <actionGroup ref="AdminTermsConditionsFillTermEditFormActionGroup" stepKey="fillNewTerm"> + <argument name="term" value="disabledHtmlTerm"/> + </actionGroup> + <actionGroup ref="AdminTermsConditionsSaveTermActionGroup" stepKey="saveNewTerm"/> + + <actionGroup ref="AdminTermsConditionsOpenGridActionGroup" stepKey="openTermsGrid"/> + <actionGroup ref="AdminTermsConditionsEditTermByNameActionGroup" stepKey="openUpdateTerm"> + <argument name="termName" value="{{disabledHtmlTerm.name}}"/> + </actionGroup> + <actionGroup ref="AdminTermsConditionsFillTermEditFormActionGroup" stepKey="fillUpdateTerm"> + <argument name="term" value="activeTextTerm"/> + </actionGroup> + <actionGroup ref="AdminTermsConditionsSaveTermActionGroup" stepKey="saveUpdateTerm"/> + + <actionGroup ref="AdminTermsConditionsOpenGridActionGroup" stepKey="openNewTermsGrid"/> + <actionGroup ref="AssertAdminTermsConditionsInGridActionGroup" stepKey="assertTermInGrid"> + <argument name="termName" value="{{activeTextTerm.name}}"/> + </actionGroup> + + <openNewTab stepKey="openStorefrontTab"/> + <actionGroup ref="AddSimpleProductToCartActionGroup" stepKey="addProductToTheCart"> + <argument name="product" value="$$createProduct$$"/> + </actionGroup> + <actionGroup ref="StorefrontProcessCheckoutToPaymentActionGroup" stepKey="processCheckoutToThePaymentMethodsPage"/> + <actionGroup ref="AssertStorefrontTermInCheckoutActionGroup" stepKey="assertTermInCheckout"> + <argument name="termCheckboxText" value="{{activeTextTerm.checkboxText}}"/> + </actionGroup> + <closeTab stepKey="closeStorefrontTab"/> + </test> +</tests> diff --git a/app/code/Magento/CheckoutAgreements/Test/Mftf/Test/AdminUpdateDisabledTextTermEntityTest.xml b/app/code/Magento/CheckoutAgreements/Test/Mftf/Test/AdminUpdateDisabledTextTermEntityTest.xml new file mode 100644 index 0000000000000..198a9fe3fc7b4 --- /dev/null +++ b/app/code/Magento/CheckoutAgreements/Test/Mftf/Test/AdminUpdateDisabledTextTermEntityTest.xml @@ -0,0 +1,45 @@ +<?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="AdminUpdateDisabledTextTermEntityTest" extends="AdminUpdateDisabledHtmlTermEntityTest"> + <annotations> + <features value="CheckoutAgreements"/> + <stories value="Checkout agreements"/> + <title value="Update disabled Text checkout agreement"/> + <description value="Admin should be able to update disabled Text checkout agreement"/> + <severity value="CRITICAL"/> + <testCaseId value="MC-14665"/> + <group value="checkoutAgreements"/> + <group value="mtf_migrated"/> + </annotations> + + <after> + <actionGroup ref="AdminTermsConditionsEditTermByNameActionGroup" stepKey="openTermToDelete"> + <argument name="termName" value="{{activeHtmlTerm.name}}"/> + </actionGroup> + </after> + + <actionGroup ref="AdminTermsConditionsFillTermEditFormActionGroup" stepKey="fillNewTerm"> + <argument name="term" value="disabledTextTerm"/> + </actionGroup> + <actionGroup ref="AdminTermsConditionsEditTermByNameActionGroup" stepKey="openUpdateTerm"> + <argument name="termName" value="{{disabledTextTerm.name}}"/> + </actionGroup> + <actionGroup ref="AdminTermsConditionsFillTermEditFormActionGroup" stepKey="fillUpdateTerm"> + <argument name="term" value="activeHtmlTerm"/> + </actionGroup> + <actionGroup ref="AssertAdminTermsConditionsInGridActionGroup" stepKey="assertTermInGrid"> + <argument name="termName" value="{{activeHtmlTerm.name}}"/> + </actionGroup> + <actionGroup ref="AssertStorefrontTermInCheckoutActionGroup" stepKey="assertTermInCheckout"> + <argument name="termCheckboxText" value="{{activeHtmlTerm.checkboxText}}"/> + </actionGroup> + </test> +</tests> diff --git a/app/code/Magento/CheckoutAgreements/Test/Mftf/Test/AdminUpdateEnabledTextTermEntityTest.xml b/app/code/Magento/CheckoutAgreements/Test/Mftf/Test/AdminUpdateEnabledTextTermEntityTest.xml new file mode 100644 index 0000000000000..f82840bc07c7d --- /dev/null +++ b/app/code/Magento/CheckoutAgreements/Test/Mftf/Test/AdminUpdateEnabledTextTermEntityTest.xml @@ -0,0 +1,44 @@ +<?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="AdminUpdateEnabledTextTermEntityTest" extends="AdminUpdateDisabledHtmlTermEntityTest"> + <annotations> + <features value="CheckoutAgreements"/> + <stories value="Checkout agreements"/> + <title value="Update enabled Text checkout agreement"/> + <description value="Admin should be able to update enabled Text checkout agreement"/> + <severity value="CRITICAL"/> + <testCaseId value="MC-14666"/> + <group value="checkoutAgreements"/> + <group value="mtf_migrated"/> + </annotations> + <after> + <actionGroup ref="AdminTermsConditionsEditTermByNameActionGroup" stepKey="openTermToDelete"> + <argument name="termName" value="{{disabledHtmlTerm.name}}"/> + </actionGroup> + </after> + + <actionGroup ref="AdminTermsConditionsFillTermEditFormActionGroup" stepKey="fillNewTerm"> + <argument name="term" value="activeTextTerm"/> + </actionGroup> + <actionGroup ref="AdminTermsConditionsEditTermByNameActionGroup" stepKey="openUpdateTerm"> + <argument name="termName" value="{{activeTextTerm.name}}"/> + </actionGroup> + <actionGroup ref="AdminTermsConditionsFillTermEditFormActionGroup" stepKey="fillUpdateTerm"> + <argument name="term" value="disabledHtmlTerm"/> + </actionGroup> + <actionGroup ref="AssertAdminTermsConditionsInGridActionGroup" stepKey="assertTermInGrid"> + <argument name="termName" value="{{disabledHtmlTerm.name}}"/> + </actionGroup> + <actionGroup ref="AssertStorefrontTermAbsentInCheckoutActionGroup" stepKey="assertTermInCheckout"> + <argument name="termCheckboxText" value="{{disabledHtmlTerm.checkboxText}}"/> + </actionGroup> + </test> +</tests> diff --git a/app/code/Magento/Cms/Test/Mftf/ActionGroup/AdminSetCMSBlockDisabledActionGroup.xml b/app/code/Magento/Cms/Test/Mftf/ActionGroup/AdminSetCMSBlockDisabledActionGroup.xml new file mode 100644 index 0000000000000..5c02822bedd4a --- /dev/null +++ b/app/code/Magento/Cms/Test/Mftf/ActionGroup/AdminSetCMSBlockDisabledActionGroup.xml @@ -0,0 +1,14 @@ +<?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="AdminSetCMSBlockDisabledActionGroup"> + <seeElement selector="{{BlockNewPageBasicFieldsSection.isActive('1')}}" stepKey="seeBlockIsEnabled" /> + <click selector="{{BlockNewPageBasicFieldsSection.isActiveLabel}}" stepKey="setBlockDisabled"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Cms/Test/Mftf/ActionGroup/AdminSetCMSBlockEnabledActionGroup.xml b/app/code/Magento/Cms/Test/Mftf/ActionGroup/AdminSetCMSBlockEnabledActionGroup.xml new file mode 100644 index 0000000000000..4ba17decb82ab --- /dev/null +++ b/app/code/Magento/Cms/Test/Mftf/ActionGroup/AdminSetCMSBlockEnabledActionGroup.xml @@ -0,0 +1,14 @@ +<?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="AdminSetCMSBlockEnabledActionGroup"> + <seeElement selector="{{BlockNewPageBasicFieldsSection.isActive('0')}}" stepKey="seeBlockIsDisabled" /> + <click selector="{{BlockNewPageBasicFieldsSection.isActiveLabel}}" stepKey="setBlockEnabled"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Cms/Test/Mftf/ActionGroup/AssertStorefrontNoTextOnCategoryPageActionGroup.xml b/app/code/Magento/Cms/Test/Mftf/ActionGroup/AssertStorefrontNoTextOnCategoryPageActionGroup.xml new file mode 100644 index 0000000000000..8ca93004c4e1d --- /dev/null +++ b/app/code/Magento/Cms/Test/Mftf/ActionGroup/AssertStorefrontNoTextOnCategoryPageActionGroup.xml @@ -0,0 +1,21 @@ +<?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="AssertStorefrontNoTextOnCategoryPageActionGroup"> + <arguments> + <argument name="category" defaultValue="_defaultCategory"/> + <argument name="text" type="string"/> + </arguments> + <amOnPage url="{{StorefrontCategoryPage.url(category.name)}}" stepKey="navigateToCategoryPage"/> + <waitForPageLoad stepKey="waitForPageLoad1"/> + <see selector="{{StorefrontCategoryMainSection.CategoryTitle}}" userInput="{{category.name_lwr}}" stepKey="assertCategoryOnStorefront"/> + <seeInTitle userInput="{{category.name}}" stepKey="seeCategoryNameInTitle"/> + <dontSee selector="{{StorefrontCMSPageSection.mainContent}}" userInput="{{text}}" stepKey="seeAssertTextInMainContent"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Cms/Test/Mftf/ActionGroup/AssertStorefrontTextOnCategoryPageActionGroup.xml b/app/code/Magento/Cms/Test/Mftf/ActionGroup/AssertStorefrontTextOnCategoryPageActionGroup.xml new file mode 100644 index 0000000000000..aa761854a10fa --- /dev/null +++ b/app/code/Magento/Cms/Test/Mftf/ActionGroup/AssertStorefrontTextOnCategoryPageActionGroup.xml @@ -0,0 +1,21 @@ +<?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="AssertStorefrontTextOnCategoryPageActionGroup"> + <arguments> + <argument name="category" defaultValue="_defaultCategory"/> + <argument name="text" type="string"/> + </arguments> + <amOnPage url="{{StorefrontCategoryPage.url(category.name)}}" stepKey="navigateToCategoryPage"/> + <waitForPageLoad stepKey="waitForPageLoad1"/> + <see selector="{{StorefrontCategoryMainSection.CategoryTitle}}" userInput="{{category.name_lwr}}" stepKey="assertCategoryOnStorefront"/> + <seeInTitle userInput="{{category.name}}" stepKey="seeCategoryNameInTitle"/> + <see selector="{{StorefrontCMSPageSection.mainContent}}" userInput="{{text}}" stepKey="seeAssertTextInMainContent"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Cms/Test/Mftf/Section/CmsNewBlockBlockBasicFieldsSection/BlockNewPageBasicFieldsSection.xml b/app/code/Magento/Cms/Test/Mftf/Section/CmsNewBlockBlockBasicFieldsSection/BlockNewPageBasicFieldsSection.xml index 9b358dcb25769..9b6b00602b753 100644 --- a/app/code/Magento/Cms/Test/Mftf/Section/CmsNewBlockBlockBasicFieldsSection/BlockNewPageBasicFieldsSection.xml +++ b/app/code/Magento/Cms/Test/Mftf/Section/CmsNewBlockBlockBasicFieldsSection/BlockNewPageBasicFieldsSection.xml @@ -13,5 +13,6 @@ <element name="identifier" type="input" selector="input[name=identifier]"/> <element name="storeView" type="multiselect" selector="select[name=store_id]"/> <element name="duplicatedIdentifier" type="input" selector="//input[contains(@data-value,'{{var1}}')]" parameterized="true"/> + <element name="isActiveLabel" type="button" selector="div[data-index=is_active] .admin__actions-switch-label"/> </section> </sections> diff --git a/app/code/Magento/Cms/Test/Mftf/Test/AdminAddImageToCMSPageTinyMCE3Test.xml b/app/code/Magento/Cms/Test/Mftf/Test/AdminAddImageToCMSPageTinyMCE3Test.xml index a577f9853ea1d..7c2aedceb9b7e 100644 --- a/app/code/Magento/Cms/Test/Mftf/Test/AdminAddImageToCMSPageTinyMCE3Test.xml +++ b/app/code/Magento/Cms/Test/Mftf/Test/AdminAddImageToCMSPageTinyMCE3Test.xml @@ -19,7 +19,7 @@ <testCaseId value="MAGETWO-95725"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <magentoCLI command="config:set cms/wysiwyg/enabled enabled" stepKey="enableWYSIWYG"/> <!-- Choose TinyMCE3 as the default WYSIWYG editor--> <magentoCLI command="config:set cms/wysiwyg/editor Magento_Tinymce3/tinymce3Adapter" stepKey="enableTinyMCE3"/> diff --git a/app/code/Magento/Cms/Test/Mftf/Test/AdminCMSPageCreateDisabledPageTest.xml b/app/code/Magento/Cms/Test/Mftf/Test/AdminCMSPageCreateDisabledPageTest.xml index 3c6d70dc53418..446ef1b9f3b93 100644 --- a/app/code/Magento/Cms/Test/Mftf/Test/AdminCMSPageCreateDisabledPageTest.xml +++ b/app/code/Magento/Cms/Test/Mftf/Test/AdminCMSPageCreateDisabledPageTest.xml @@ -21,7 +21,7 @@ <group value="WYSIWYGDisabled"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> </before> <after> <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> diff --git a/app/code/Magento/Cms/Test/Mftf/Test/AdminCMSPageCreatePageForDefaultStoreTest.xml b/app/code/Magento/Cms/Test/Mftf/Test/AdminCMSPageCreatePageForDefaultStoreTest.xml index 036efab75f963..e3fe278c4449e 100644 --- a/app/code/Magento/Cms/Test/Mftf/Test/AdminCMSPageCreatePageForDefaultStoreTest.xml +++ b/app/code/Magento/Cms/Test/Mftf/Test/AdminCMSPageCreatePageForDefaultStoreTest.xml @@ -21,7 +21,7 @@ <group value="WYSIWYGDisabled"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> </before> <after> <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> diff --git a/app/code/Magento/Cms/Test/Mftf/Test/AdminCMSPageCreatePageInSingleStoreModeTest.xml b/app/code/Magento/Cms/Test/Mftf/Test/AdminCMSPageCreatePageInSingleStoreModeTest.xml index 1b3a7e74af08f..4bb56dddec963 100644 --- a/app/code/Magento/Cms/Test/Mftf/Test/AdminCMSPageCreatePageInSingleStoreModeTest.xml +++ b/app/code/Magento/Cms/Test/Mftf/Test/AdminCMSPageCreatePageInSingleStoreModeTest.xml @@ -22,7 +22,7 @@ </annotations> <before> <magentoCLI command="config:set {{StorefrontSingleStoreModeEnabledConfigData.path}} {{StorefrontSingleStoreModeEnabledConfigData.value}}" stepKey="enableSingleStoreMode" /> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> </before> <after> <magentoCLI command="config:set {{StorefrontSingleStoreModeDisabledConfigData.path}} {{StorefrontSingleStoreModeDisabledConfigData.value}}" stepKey="disableSingleStoreMode" /> diff --git a/app/code/Magento/Cms/Test/Mftf/Test/AdminCMSPageCreatePageTest.xml b/app/code/Magento/Cms/Test/Mftf/Test/AdminCMSPageCreatePageTest.xml index a097a6d11403e..596503cd8faab 100644 --- a/app/code/Magento/Cms/Test/Mftf/Test/AdminCMSPageCreatePageTest.xml +++ b/app/code/Magento/Cms/Test/Mftf/Test/AdminCMSPageCreatePageTest.xml @@ -21,7 +21,7 @@ <group value="WYSIWYGDisabled"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> </before> <after> <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> diff --git a/app/code/Magento/Cms/Test/Mftf/Test/AdminCMSPageCreatePageWithBlockTest.xml b/app/code/Magento/Cms/Test/Mftf/Test/AdminCMSPageCreatePageWithBlockTest.xml index 9c2f1abc4d522..aac56e16a53c4 100644 --- a/app/code/Magento/Cms/Test/Mftf/Test/AdminCMSPageCreatePageWithBlockTest.xml +++ b/app/code/Magento/Cms/Test/Mftf/Test/AdminCMSPageCreatePageWithBlockTest.xml @@ -21,7 +21,7 @@ <group value="WYSIWYGDisabled"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> </before> <after> <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> diff --git a/app/code/Magento/Cms/Test/Mftf/Test/AdminCheckCreateFolderEscapeAndEnterHandlesForWYSIWYGBlockTest.xml b/app/code/Magento/Cms/Test/Mftf/Test/AdminCheckCreateFolderEscapeAndEnterHandlesForWYSIWYGBlockTest.xml index 8114310e46f73..0644542ccc0f3 100644 --- a/app/code/Magento/Cms/Test/Mftf/Test/AdminCheckCreateFolderEscapeAndEnterHandlesForWYSIWYGBlockTest.xml +++ b/app/code/Magento/Cms/Test/Mftf/Test/AdminCheckCreateFolderEscapeAndEnterHandlesForWYSIWYGBlockTest.xml @@ -28,7 +28,7 @@ <after> <deleteData createDataKey="createPreReqBlock" stepKey="deletePreReqBlock" /> <actionGroup ref="DisabledWYSIWYGActionGroup" stepKey="disableWYSIWYG"/> - <actionGroup ref="logout" stepKey="logout"/> + <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> </after> <actionGroup ref="NavigateToCreatedCMSBlockPageActionGroup" stepKey="navigateToCreatedCMSBlockPage"> diff --git a/app/code/Magento/Cms/Test/Mftf/Test/AdminCmsPageMassActionTest.xml b/app/code/Magento/Cms/Test/Mftf/Test/AdminCmsPageMassActionTest.xml index 4c9ef31b0d202..9a02104d8d6ef 100644 --- a/app/code/Magento/Cms/Test/Mftf/Test/AdminCmsPageMassActionTest.xml +++ b/app/code/Magento/Cms/Test/Mftf/Test/AdminCmsPageMassActionTest.xml @@ -21,7 +21,7 @@ <group value="mtf_migrated"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <createData entity="_defaultCmsPage" stepKey="firstCMSPage" /> <createData entity="_duplicatedCMSPage" stepKey="secondCMSPage" /> </before> diff --git a/app/code/Magento/Cms/Test/Mftf/Test/AdminCmsPageUpdateAndDisableTest.xml b/app/code/Magento/Cms/Test/Mftf/Test/AdminCmsPageUpdateAndDisableTest.xml new file mode 100644 index 0000000000000..24d61311e8951 --- /dev/null +++ b/app/code/Magento/Cms/Test/Mftf/Test/AdminCmsPageUpdateAndDisableTest.xml @@ -0,0 +1,46 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + *CreateNewPage 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="AdminCmsPageUpdateAndDisableTest"> + <annotations> + <features value="Cms"/> + <testCaseId value="MC-14673" /> + <title value="Update CMS Page via the Admin, disable"/> + <description value="Admin should be able to update a CMS Page"/> + <group value="backend"/> + <group value="cMSContent"/> + <group value="mtf_migrated"/> + <group value="WYSIWYGDisabled"/> + </annotations> + <before> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> + <createData entity="_defaultCmsPage" stepKey="existingCMSPage" /> + </before> + <after> + <deleteData createDataKey="existingCMSPage" stepKey="deleteCMSPage" /> + <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> + </after> + <!--Navigate to Page in Admin--> + <actionGroup ref="NavigateToCreatedCMSPageActionGroup" stepKey="navigateToCreatedCMSPage"> + <argument name="CMSPage" value="$$existingCMSPage$$"/> + </actionGroup> + <!--Deactivate page--> + <actionGroup ref="AdminDisableCMSPageActionGroup" stepKey="setPageDisabled"/> + <!--Fill data using _duplicatedCMSPage--> + <actionGroup ref="FillOutCMSPageContent" stepKey="fillNewData"/> + <!--Save page--> + <actionGroup ref="SaveCmsPageActionGroup" stepKey="saveDisabledPage"/> + <!--Check that page is not found on storefront--> + <actionGroup ref="StorefrontGoToCMSPageActionGroup" stepKey="goToCMSPageOnStorefront"> + <argument name="identifier" value="{{_duplicatedCMSPage.identifier}}"/> + </actionGroup> + <actionGroup ref="AssertCMSPageNotFoundOnStorefrontActionGroup" stepKey="seeNotFoundError"/> + </test> +</tests> diff --git a/app/code/Magento/Cms/Test/Mftf/Test/AdminCmsPageUpdateTest.xml b/app/code/Magento/Cms/Test/Mftf/Test/AdminCmsPageUpdateTest.xml new file mode 100644 index 0000000000000..6e05828726e7d --- /dev/null +++ b/app/code/Magento/Cms/Test/Mftf/Test/AdminCmsPageUpdateTest.xml @@ -0,0 +1,52 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + *CreateNewPage 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="AdminCmsPageUpdateTest"> + <annotations> + <features value="Cms"/> + <title value="Update CMS Page via the Admin"/> + <description value="Admin should be able to update a CMS Page"/> + <testCaseId value="MC-14674"/> + <group value="backend"/> + <group value="cMSContent"/> + <group value="mtf_migrated"/> + <group value="WYSIWYGDisabled"/> + </annotations> + <before> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> + <createData entity="_defaultCmsPage" stepKey="existingCMSPage" /> + </before> + <after> + <deleteData createDataKey="existingCMSPage" stepKey="deleteCMSPage" /> + <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> + </after> + <!--Navigate to Page in Admin--> + <actionGroup ref="NavigateToCreatedCMSPageActionGroup" stepKey="navigateToCreatedCMSPage"> + <argument name="CMSPage" value="$$existingCMSPage$$"/> + </actionGroup> + <!--Fill data using _duplicatedCMSPage--> + <actionGroup ref="FillOutCMSPageContent" stepKey="fillNewData"/> + <actionGroup ref="SaveCmsPageActionGroup" stepKey="saveActivatedPage"/> + <!--Verify data in admin--> + <actionGroup ref="NavigateToCreatedCMSPageActionGroup" stepKey="navigateToUpdatedCMSPage"> + <argument name="CMSPage" value="_duplicatedCMSPage"/> + </actionGroup> + <actionGroup ref="AssertCMSPageContentActionGroup" stepKey="verifyPageDataInAdmin"/> + <!--Verify data on frontend--> + <actionGroup ref="StorefrontGoToCMSPageActionGroup" stepKey="navigateToPageOnStorefront"> + <argument name="identifier" value="{{_duplicatedCMSPage.identifier}}"/> + </actionGroup> + <actionGroup ref="AssertStoreFrontCMSPageActionGroup" stepKey="verifyPageDataOnFrontend"> + <argument name="cmsTitle" value="{{_duplicatedCMSPage.title}}"/> + <argument name="cmsContent" value="{{_duplicatedCMSPage.content}}"/> + <argument name="cmsContentHeading" value="{{_duplicatedCMSPage.content_heading}}"/> + </actionGroup> + </test> +</tests> diff --git a/app/code/Magento/Cms/Test/Mftf/Test/AdminConfigDefaultCMSPageLayoutFromConfigurationSettingTest.xml b/app/code/Magento/Cms/Test/Mftf/Test/AdminConfigDefaultCMSPageLayoutFromConfigurationSettingTest.xml index 99990595fca95..0eac31c891e64 100644 --- a/app/code/Magento/Cms/Test/Mftf/Test/AdminConfigDefaultCMSPageLayoutFromConfigurationSettingTest.xml +++ b/app/code/Magento/Cms/Test/Mftf/Test/AdminConfigDefaultCMSPageLayoutFromConfigurationSettingTest.xml @@ -19,7 +19,7 @@ <group value="Cms"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> </before> <after> <actionGroup ref="RestoreLayoutSetting" stepKey="sampleActionGroup"/> diff --git a/app/code/Magento/Cms/Test/Mftf/Test/AdminContentBlocksNavigateMenuTest.xml b/app/code/Magento/Cms/Test/Mftf/Test/AdminContentBlocksNavigateMenuTest.xml index bb15904540be4..7d3946ea86c92 100644 --- a/app/code/Magento/Cms/Test/Mftf/Test/AdminContentBlocksNavigateMenuTest.xml +++ b/app/code/Magento/Cms/Test/Mftf/Test/AdminContentBlocksNavigateMenuTest.xml @@ -20,7 +20,7 @@ <group value="mtf_migrated"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="LoginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="LoginAsAdmin"/> </before> <after> <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> diff --git a/app/code/Magento/Cms/Test/Mftf/Test/AdminContentPagesNavigateMenuTest.xml b/app/code/Magento/Cms/Test/Mftf/Test/AdminContentPagesNavigateMenuTest.xml index c7726e7e427ce..bd24e4b082edc 100644 --- a/app/code/Magento/Cms/Test/Mftf/Test/AdminContentPagesNavigateMenuTest.xml +++ b/app/code/Magento/Cms/Test/Mftf/Test/AdminContentPagesNavigateMenuTest.xml @@ -20,7 +20,7 @@ <group value="mtf_migrated"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="LoginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="LoginAsAdmin"/> </before> <after> <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> diff --git a/app/code/Magento/Cms/Test/Mftf/Test/AdminCreateCmsBlockWithMarginalSpaceTest.xml b/app/code/Magento/Cms/Test/Mftf/Test/AdminCreateCmsBlockWithMarginalSpaceTest.xml index 07f033b18ea39..f2c84dea13f97 100644 --- a/app/code/Magento/Cms/Test/Mftf/Test/AdminCreateCmsBlockWithMarginalSpaceTest.xml +++ b/app/code/Magento/Cms/Test/Mftf/Test/AdminCreateCmsBlockWithMarginalSpaceTest.xml @@ -19,7 +19,7 @@ <group value="WYSIWYGDisabled"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="loginGetFromGeneralFile"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginGetFromGeneralFile"/> </before> <amOnPage url="{{CmsNewBlock.url}}" stepKey="amOnBlocksCreationForm"/> diff --git a/app/code/Magento/Cms/Test/Mftf/Test/AdminCreateDisabledCmsBlockEntityAndAssignToCategoryTest.xml b/app/code/Magento/Cms/Test/Mftf/Test/AdminCreateDisabledCmsBlockEntityAndAssignToCategoryTest.xml new file mode 100644 index 0000000000000..51fbbf8020545 --- /dev/null +++ b/app/code/Magento/Cms/Test/Mftf/Test/AdminCreateDisabledCmsBlockEntityAndAssignToCategoryTest.xml @@ -0,0 +1,55 @@ +<?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="AdminCreateDisabledCmsBlockEntityAndAssignToCategoryTest"> + <annotations> + <features value="Cms"/> + <testCaseId value="MC-14657" /> + <stories value="Create a CMS block via the Admin, disable, add to category, verify on frontend"/> + <title value="Create disabled CMS block entity and assign to category"/> + <severity value="MAJOR"/> + <group value="cMSContent"/> + <group value="mtf_migrated"/> + </annotations> + <before> + <createData entity="_defaultCategory" stepKey="newDefaultCategory"/> + <createData entity="_defaultBlock" stepKey="newDefaultBlock"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> + </before> + <after> + <deleteData createDataKey="newDefaultCategory" stepKey="deleteCategory"/> + <deleteData createDataKey="newDefaultBlock" stepKey="deleteBlock"/> + <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> + </after> + + <actionGroup ref="AdminOpenCmsBlockActionGroup" stepKey="openCmsBlock"> + <argument name="block_id" value="$$newDefaultBlock.id$$"/> + </actionGroup> + <actionGroup ref="AdminSetCMSBlockDisabledActionGroup" stepKey="disableBlock"/> + <actionGroup ref="SaveCMSBlockActionGroup" stepKey="saveCMSBlock"/> + + <actionGroup ref="AdminOpenCategoriesPageActionGroup" stepKey="openCategoriesPage"/> + <actionGroup ref="AdminCategoriesExpandAllActionGroup" stepKey="expandAll"/> + <actionGroup ref="AdminCategoriesOpenCategoryActionGroup" stepKey="openCategory"> + <argument name="category" value="$$newDefaultCategory$$"/> + </actionGroup> + <actionGroup ref="AdminCategoriesOpenContentSectionActionGroup" stepKey="openContentSection"/> + <actionGroup ref="AdminCategoriesSetStaticBlockActionGroup" stepKey="setStaticBlock"/> + <actionGroup ref="AdminCategoriesSetDisplayModeActionGroup" stepKey="setDisplay"> + <argument name="value" value="Static block only"/> + </actionGroup> + <actionGroup ref="AdminSaveCategoryActionGroup" stepKey="saveCategory"/> + + <actionGroup ref="AssertStorefrontNoTextOnCategoryPageActionGroup" stepKey="assertBlockOnCategoryFrontPage"> + <argument name="category" value="$$newDefaultCategory$$"/> + <argument name="text" value="{{_defaultBlock.content}}"/> + </actionGroup> + </test> +</tests> diff --git a/app/code/Magento/Cms/Test/Mftf/Test/AdminCreateEnabledCmsBlockEntityAndAssignToCategoryTest.xml b/app/code/Magento/Cms/Test/Mftf/Test/AdminCreateEnabledCmsBlockEntityAndAssignToCategoryTest.xml new file mode 100644 index 0000000000000..5ccd8fa713cc0 --- /dev/null +++ b/app/code/Magento/Cms/Test/Mftf/Test/AdminCreateEnabledCmsBlockEntityAndAssignToCategoryTest.xml @@ -0,0 +1,49 @@ +<?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="AdminCreateEnabledCmsBlockEntityAndAssignToCategoryTest"> + <annotations> + <features value="Cms"/> + <stories value="Create a CMS block via the Admin, add to category, verify on frontend"/> + <title value="Create CMS block entity and assign to category"/> + <testCaseId value="MC-14658"/> + <severity value="MAJOR"/> + <group value="cMSContent"/> + <group value="mtf_migrated"/> + </annotations> + <before> + <createData entity="_defaultCategory" stepKey="newDefaultCategory"/> + <createData entity="_defaultBlock" stepKey="newDefaultBlock"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> + </before> + <after> + <deleteData createDataKey="newDefaultCategory" stepKey="deleteCategory"/> + <deleteData createDataKey="newDefaultBlock" stepKey="deleteBlock"/> + <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> + </after> + + <actionGroup ref="AdminOpenCategoriesPageActionGroup" stepKey="openCategoriesPage"/> + <actionGroup ref="AdminCategoriesExpandAllActionGroup" stepKey="expandAll"/> + <actionGroup ref="AdminCategoriesOpenCategoryActionGroup" stepKey="openCategory"> + <argument name="category" value="$$newDefaultCategory$$"/> + </actionGroup> + <actionGroup ref="AdminCategoriesOpenContentSectionActionGroup" stepKey="openContentSection"/> + <actionGroup ref="AdminCategoriesSetStaticBlockActionGroup" stepKey="setStaticBlock"/> + <actionGroup ref="AdminCategoriesSetDisplayModeActionGroup" stepKey="setDisplay"> + <argument name="value" value="Static block only"/> + </actionGroup> + <actionGroup ref="AdminSaveCategoryActionGroup" stepKey="saveCategory"/> + + <actionGroup ref="AssertStorefrontTextOnCategoryPageActionGroup" stepKey="assertBlockOnCategoryFrontPage"> + <argument name="category" value="$$newDefaultCategory$$"/> + <argument name="text" value="{{_defaultBlock.content}}"/> + </actionGroup> + </test> +</tests> diff --git a/app/code/Magento/Cms/Test/Mftf/Test/AdminSaveAndCloseCmsBlockTest.xml b/app/code/Magento/Cms/Test/Mftf/Test/AdminSaveAndCloseCmsBlockTest.xml index e2800c2ac3094..b1073c1a0f41d 100644 --- a/app/code/Magento/Cms/Test/Mftf/Test/AdminSaveAndCloseCmsBlockTest.xml +++ b/app/code/Magento/Cms/Test/Mftf/Test/AdminSaveAndCloseCmsBlockTest.xml @@ -20,7 +20,7 @@ </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="loginToAdminPanel"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginToAdminPanel"/> </before> <after> diff --git a/app/code/Magento/Cms/Test/Mftf/Test/CheckOrderOfProdsInWidgetOnCMSPageTest.xml b/app/code/Magento/Cms/Test/Mftf/Test/CheckOrderOfProdsInWidgetOnCMSPageTest.xml index 58adae02298b7..c69cd620b1d72 100644 --- a/app/code/Magento/Cms/Test/Mftf/Test/CheckOrderOfProdsInWidgetOnCMSPageTest.xml +++ b/app/code/Magento/Cms/Test/Mftf/Test/CheckOrderOfProdsInWidgetOnCMSPageTest.xml @@ -20,7 +20,7 @@ <group value="Catalog"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <actionGroup ref="EnabledWYSIWYGActionGroup" stepKey="enableWYSIWYG"/> <actionGroup ref="SwitchToVersion4ActionGroup" stepKey="enableTinyMCE4"/> <waitForPageLoad stepKey="waitConfigToSave"/> diff --git a/app/code/Magento/Cms/Test/Mftf/Test/CheckStaticBlocksTest.xml b/app/code/Magento/Cms/Test/Mftf/Test/CheckStaticBlocksTest.xml index 8d4326040c919..fe3e69880fc5c 100644 --- a/app/code/Magento/Cms/Test/Mftf/Test/CheckStaticBlocksTest.xml +++ b/app/code/Magento/Cms/Test/Mftf/Test/CheckStaticBlocksTest.xml @@ -20,7 +20,7 @@ </annotations> <before> <magentoCLI command="config:set cms/wysiwyg/enabled disabled" stepKey="disableWYSIWYG"/> - <actionGroup ref="LoginAsAdmin" stepKey="LoginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="LoginAsAdmin"/> <actionGroup ref="AdminCreateWebsiteActionGroup" stepKey="AdminCreateWebsite"> <argument name="newWebsiteName" value="secondWebsite"/> <argument name="websiteCode" value="second_website"/> diff --git a/app/code/Magento/Cms/Test/Mftf/Test/StoreViewLanguageCorrectSwitchTest.xml b/app/code/Magento/Cms/Test/Mftf/Test/StoreViewLanguageCorrectSwitchTest.xml index a73e41de6b861..2fd31fffa838d 100644 --- a/app/code/Magento/Cms/Test/Mftf/Test/StoreViewLanguageCorrectSwitchTest.xml +++ b/app/code/Magento/Cms/Test/Mftf/Test/StoreViewLanguageCorrectSwitchTest.xml @@ -20,7 +20,7 @@ <group value="Cms"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <!-- Create Cms Pages --> <createData entity="_newDefaultCmsPage" stepKey="createFirstCmsPage"/> diff --git a/app/code/Magento/Config/Test/Mftf/Test/CheckingCountryDropDownWithOneAllowedCountryTest.xml b/app/code/Magento/Config/Test/Mftf/Test/CheckingCountryDropDownWithOneAllowedCountryTest.xml index 32fa1d13023de..9e05f4819cd73 100644 --- a/app/code/Magento/Config/Test/Mftf/Test/CheckingCountryDropDownWithOneAllowedCountryTest.xml +++ b/app/code/Magento/Config/Test/Mftf/Test/CheckingCountryDropDownWithOneAllowedCountryTest.xml @@ -24,7 +24,7 @@ <after> <magentoCLI stepKey="flushCache" command="cache:flush"/> <createData entity="DisableAdminAccountAllowCountry" stepKey="setDefaultValueForAllowCountries"/> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <actionGroup ref="AdminDeleteCustomerActionGroup" stepKey="deleteCustomer"> <argument name="customerEmail" value="CustomerEntityOne.email"/> </actionGroup> diff --git a/app/code/Magento/Config/Test/Mftf/Test/ConfigurationTest.xml b/app/code/Magento/Config/Test/Mftf/Test/ConfigurationTest.xml index 9700d8024ce8f..d4fcbb06ea2d3 100644 --- a/app/code/Magento/Config/Test/Mftf/Test/ConfigurationTest.xml +++ b/app/code/Magento/Config/Test/Mftf/Test/ConfigurationTest.xml @@ -20,7 +20,7 @@ <group value="configuration"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> </before> <after> <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminAddDefaultImageConfigurableTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminAddDefaultImageConfigurableTest.xml index 9e96b5847b8e7..0d83cc6610194 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminAddDefaultImageConfigurableTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminAddDefaultImageConfigurableTest.xml @@ -20,7 +20,7 @@ </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <createData entity="SimpleSubCategory" stepKey="categoryHandle"/> <createData entity="SimpleProduct" stepKey="simple1Handle"> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminAddingNewOptionsWithImagesAndPricesToConfigurableProductTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminAddingNewOptionsWithImagesAndPricesToConfigurableProductTest.xml index 07d9719b24d96..72ebd7962f420 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminAddingNewOptionsWithImagesAndPricesToConfigurableProductTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminAddingNewOptionsWithImagesAndPricesToConfigurableProductTest.xml @@ -21,7 +21,7 @@ <before> <actionGroup ref="AdminCreateApiConfigurableProductActionGroup" stepKey="createConfigurableProduct"/> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> </before> <after> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminAssertNoticeThatExistingSkuAutomaticallyChangedWhenSavingProductWithSameSkuTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminAssertNoticeThatExistingSkuAutomaticallyChangedWhenSavingProductWithSameSkuTest.xml index a6c3794a2d622..d58e7cfab1350 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminAssertNoticeThatExistingSkuAutomaticallyChangedWhenSavingProductWithSameSkuTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminAssertNoticeThatExistingSkuAutomaticallyChangedWhenSavingProductWithSameSkuTest.xml @@ -18,7 +18,7 @@ <group value="mtf_migrated"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> </before> <after> <!-- Delete configurable product --> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCheckConfigurableProductAttributeValueUniquenessTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCheckConfigurableProductAttributeValueUniquenessTest.xml index c6a277295632b..8962efbb8dd26 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCheckConfigurableProductAttributeValueUniquenessTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCheckConfigurableProductAttributeValueUniquenessTest.xml @@ -20,7 +20,7 @@ <group value="ConfigurableProduct"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <createData entity="dropdownProductAttribute" stepKey="createProductAttribute"/> </before> <after> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCheckResultsOfColorAndOtherFiltersTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCheckResultsOfColorAndOtherFiltersTest.xml index 21619ca911d8a..7d75f5d53c1f4 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCheckResultsOfColorAndOtherFiltersTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCheckResultsOfColorAndOtherFiltersTest.xml @@ -69,7 +69,7 @@ <requiredEntity createDataKey="createConfigProductAttribute2"/> </createData> <!-- Login as Admin --> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <!-- Add created attributes with options to Attribute Set --> <actionGroup ref="AdminAddUnassignedAttributeToGroupActionGroup" stepKey="createDefaultAttributeSet"> <argument name="label" value="mySet"/> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCheckValidatorConfigurableProductTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCheckValidatorConfigurableProductTest.xml index 2a2ef1947fdab..dc8c09864d0ab 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCheckValidatorConfigurableProductTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCheckValidatorConfigurableProductTest.xml @@ -21,7 +21,7 @@ <before> <!--Login as admin--> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <!--Create Category--> <createData entity="ApiCategory" stepKey="createCategory"/> <!--Create Configurable product--> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductCreateTest/AdminConfigurableProductCreateTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductCreateTest/AdminConfigurableProductCreateTest.xml index 9bd4161a80cf7..59da88874f5b2 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductCreateTest/AdminConfigurableProductCreateTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductCreateTest/AdminConfigurableProductCreateTest.xml @@ -20,7 +20,7 @@ <before> <createData entity="ApiCategory" stepKey="createCategory"/> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin1"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin1"/> </before> <after> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductCreateTest/AdminCreateConfigurableProductAfterGettingIncorrectSKUMessageTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductCreateTest/AdminCreateConfigurableProductAfterGettingIncorrectSKUMessageTest.xml index ab0336637c12c..274a75aedbc5f 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductCreateTest/AdminCreateConfigurableProductAfterGettingIncorrectSKUMessageTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductCreateTest/AdminCreateConfigurableProductAfterGettingIncorrectSKUMessageTest.xml @@ -24,7 +24,7 @@ <createData entity="ApiConfigurableProduct" stepKey="createConfigProduct"> <requiredEntity createDataKey="createCategory"/> </createData> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> </before> <after> <deleteData createDataKey="createConfigProduct" stepKey="deleteConfigProduct"/> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductDeleteTest/AdminConfigurableProductBulkDeleteTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductDeleteTest/AdminConfigurableProductBulkDeleteTest.xml index 7c474a135c334..a7615d5565828 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductDeleteTest/AdminConfigurableProductBulkDeleteTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductDeleteTest/AdminConfigurableProductBulkDeleteTest.xml @@ -120,7 +120,7 @@ <requiredEntity createDataKey="createConfigChildProduct6"/> </createData> - <actionGroup ref="LoginAsAdmin" stepKey="login"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="login"/> </before> <after> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductDeleteTest/AdminConfigurableProductDeleteTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductDeleteTest/AdminConfigurableProductDeleteTest.xml index de904cf854171..807ea69bb3958 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductDeleteTest/AdminConfigurableProductDeleteTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductDeleteTest/AdminConfigurableProductDeleteTest.xml @@ -80,7 +80,7 @@ <see selector="{{StorefrontProductInfoMainSection.productName}}" userInput="$$createConfigProduct.name$$" stepKey="seeProduct"/> <!-- go to admin and delete --> - <actionGroup ref="LoginAsAdmin" stepKey="login"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="login"/> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="goToProductList"/> <waitForPageLoad stepKey="wait2"/> <conditionalClick selector="{{AdminProductGridFilterSection.clearAll}}" dependentSelector="{{AdminProductGridFilterSection.clearAll}}" stepKey="clearAll" visible="true"/> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductLongSkuTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductLongSkuTest.xml index 9d01438a3c423..10cdcea2855d6 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductLongSkuTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductLongSkuTest.xml @@ -39,7 +39,7 @@ </getData> <!--Create Category--> <createData entity="ApiCategory" stepKey="createCategory"/> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin1"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin1"/> </before> <after> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductOutOfStockTest/AdminConfigurableProductChildrenOutOfStockTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductOutOfStockTest/AdminConfigurableProductChildrenOutOfStockTest.xml index a5d7e97c33b66..8d2f80ef262fd 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductOutOfStockTest/AdminConfigurableProductChildrenOutOfStockTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductOutOfStockTest/AdminConfigurableProductChildrenOutOfStockTest.xml @@ -72,7 +72,7 @@ </createData> <!-- log in --> - <actionGroup ref="LoginAsAdmin" stepKey="login"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="login"/> </before> <after> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductOutOfStockTest/AdminConfigurableProductOutOfStockAndDeleteCombinationTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductOutOfStockTest/AdminConfigurableProductOutOfStockAndDeleteCombinationTest.xml index d0f686f9cbc0a..3121725c23fe9 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductOutOfStockTest/AdminConfigurableProductOutOfStockAndDeleteCombinationTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductOutOfStockTest/AdminConfigurableProductOutOfStockAndDeleteCombinationTest.xml @@ -72,7 +72,7 @@ </createData> <!-- log in --> - <actionGroup ref="LoginAsAdmin" stepKey="login"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="login"/> </before> <after> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductOutOfStockTest/AdminConfigurableProductOutOfStockTestDeleteChildrenTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductOutOfStockTest/AdminConfigurableProductOutOfStockTestDeleteChildrenTest.xml index e9fc3443a9d56..2e8bf8ff66933 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductOutOfStockTest/AdminConfigurableProductOutOfStockTestDeleteChildrenTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductOutOfStockTest/AdminConfigurableProductOutOfStockTestDeleteChildrenTest.xml @@ -72,7 +72,7 @@ </createData> <!-- log in --> - <actionGroup ref="LoginAsAdmin" stepKey="login"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="login"/> </before> <after> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductSearchTest/AdminConfigurableProductFilterByTypeTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductSearchTest/AdminConfigurableProductFilterByTypeTest.xml index 4dd73ea3ce562..a35ef058dfd80 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductSearchTest/AdminConfigurableProductFilterByTypeTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductSearchTest/AdminConfigurableProductFilterByTypeTest.xml @@ -63,7 +63,7 @@ <requiredEntity createDataKey="createConfigChildProduct2"/> </createData> - <actionGroup ref="LoginAsAdmin" stepKey="login"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="login"/> </before> <after> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductSearchTest/AdminConfigurableProductSearchTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductSearchTest/AdminConfigurableProductSearchTest.xml index d2d5aa969bd50..6d9015b5d1cbf 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductSearchTest/AdminConfigurableProductSearchTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductSearchTest/AdminConfigurableProductSearchTest.xml @@ -63,7 +63,7 @@ <requiredEntity createDataKey="createConfigChildProduct2"/> </createData> - <actionGroup ref="LoginAsAdmin" stepKey="login"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="login"/> </before> <after> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductUpdateAttributeTest/AdminConfigurableProductUpdateAttributeTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductUpdateAttributeTest/AdminConfigurableProductUpdateAttributeTest.xml index 4f1ab935a84d6..4b6baf8c58493 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductUpdateAttributeTest/AdminConfigurableProductUpdateAttributeTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductUpdateAttributeTest/AdminConfigurableProductUpdateAttributeTest.xml @@ -91,7 +91,7 @@ </createData> <!-- login --> - <actionGroup ref="LoginAsAdmin" stepKey="login"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="login"/> </before> <after> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductUpdateAttributeTest/AdminConfigurableProductUpdateChildAttributeTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductUpdateAttributeTest/AdminConfigurableProductUpdateChildAttributeTest.xml index 8b7fc64d265a0..56f53519e69af 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductUpdateAttributeTest/AdminConfigurableProductUpdateChildAttributeTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductUpdateAttributeTest/AdminConfigurableProductUpdateChildAttributeTest.xml @@ -76,7 +76,7 @@ </createData> <!-- login --> - <actionGroup ref="LoginAsAdmin" stepKey="login"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="login"/> </before> <after> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductUpdateTest/AdminConfigurableProductAddConfigurationTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductUpdateTest/AdminConfigurableProductAddConfigurationTest.xml index a6301978dc96f..589f20d0d544c 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductUpdateTest/AdminConfigurableProductAddConfigurationTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductUpdateTest/AdminConfigurableProductAddConfigurationTest.xml @@ -20,7 +20,7 @@ <before> <createData entity="ApiCategory" stepKey="createCategory"/> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> </before> <after> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductUpdateTest/AdminConfigurableProductBulkUpdateTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductUpdateTest/AdminConfigurableProductBulkUpdateTest.xml index b2a2c1300d00a..bd409d0e4bfde 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductUpdateTest/AdminConfigurableProductBulkUpdateTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductUpdateTest/AdminConfigurableProductBulkUpdateTest.xml @@ -29,7 +29,7 @@ <createData entity="ApiConfigurableProduct" stepKey="createProduct3"> <requiredEntity createDataKey="createCategory"/> </createData> - <actionGroup ref="LoginAsAdmin" stepKey="login"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="login"/> </before> <after> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductUpdateTest/AdminConfigurableProductDisableAnOptionTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductUpdateTest/AdminConfigurableProductDisableAnOptionTest.xml index bd1b17ca46099..1eb3df993dd1c 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductUpdateTest/AdminConfigurableProductDisableAnOptionTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductUpdateTest/AdminConfigurableProductDisableAnOptionTest.xml @@ -81,7 +81,7 @@ <see selector="{{StorefrontProductInfoMainSection.productAttributeOptions1}}" userInput="option2" stepKey="seeOption2Storefront"/> <!--go to admin and disable an option--> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <actionGroup ref="AdminProductPageOpenByIdActionGroup" stepKey="goToEditPage"> <argument name="productId" value="$$createConfigProduct.id$$"/> </actionGroup> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductUpdateTest/AdminConfigurableProductRemoveAnOptionTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductUpdateTest/AdminConfigurableProductRemoveAnOptionTest.xml index 09407c40db8a1..00b17fda944f1 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductUpdateTest/AdminConfigurableProductRemoveAnOptionTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductUpdateTest/AdminConfigurableProductRemoveAnOptionTest.xml @@ -81,7 +81,7 @@ <see selector="{{StorefrontProductInfoMainSection.productAttributeOptions1}}" userInput="option2" stepKey="seeOption2Storefront"/> <!--check admin for both options--> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <actionGroup ref="AdminProductPageOpenByIdActionGroup" stepKey="goToEditPage"> <argument name="productId" value="$$createConfigProduct.id$$"/> </actionGroup> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductUpdateTest/AdminConfigurableProductRemoveConfigurationTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductUpdateTest/AdminConfigurableProductRemoveConfigurationTest.xml index 68d6423b43c07..bef7d26c5007f 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductUpdateTest/AdminConfigurableProductRemoveConfigurationTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductUpdateTest/AdminConfigurableProductRemoveConfigurationTest.xml @@ -20,7 +20,7 @@ <before> <createData entity="ApiCategory" stepKey="createCategory"/> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> </before> <after> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateAndEditConfigurableProductSettingsTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateAndEditConfigurableProductSettingsTest.xml index 6f5e8ddd54759..796a4628393bb 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateAndEditConfigurableProductSettingsTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateAndEditConfigurableProductSettingsTest.xml @@ -20,7 +20,7 @@ </annotations> <before> <!-- Login as admin --> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> </before> <after> <!-- Log out --> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateAndSwitchProductType/AdminCreateDownloadableProductSwitchToConfigurableTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateAndSwitchProductType/AdminCreateDownloadableProductSwitchToConfigurableTest.xml index 7593242c4f716..db5c824341c57 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateAndSwitchProductType/AdminCreateDownloadableProductSwitchToConfigurableTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateAndSwitchProductType/AdminCreateDownloadableProductSwitchToConfigurableTest.xml @@ -39,7 +39,7 @@ </after> <!-- Create configurable product from downloadable product page--> <comment userInput="Create configurable product" stepKey="commentCreateProduct"/> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin1"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin1"/> <!-- Open Dropdown and select downloadable product option --> <comment stepKey="beforeOpenProductFillForm" userInput="Selecting Product from the Add Product Dropdown"/> <actionGroup ref="GoToSpecifiedCreateProductPageActionGroup" stepKey="openProductFillForm"> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductBasedOnParentSkuTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductBasedOnParentSkuTest.xml index 41ba0fc048120..78cbca2d4c099 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductBasedOnParentSkuTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductBasedOnParentSkuTest.xml @@ -18,7 +18,7 @@ <group value="mtf_migrated"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> </before> <after> <!-- Delete configurable product with children products --> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductWithCreatingCategoryAndAttributeTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductWithCreatingCategoryAndAttributeTest.xml index cef95ec7835d0..3913139c9b7e6 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductWithCreatingCategoryAndAttributeTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductWithCreatingCategoryAndAttributeTest.xml @@ -19,7 +19,7 @@ </annotations> <before> <createData entity="SimpleSubCategory" stepKey="createCategory"/> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> </before> <after> <!-- Delete configurable product --> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductWithDisabledChildrenProductsTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductWithDisabledChildrenProductsTest.xml index 261b307a0718c..3bf5666d5a997 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductWithDisabledChildrenProductsTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductWithDisabledChildrenProductsTest.xml @@ -36,7 +36,7 @@ <requiredEntity createDataKey="getConfigAttributeOption"/> </createData> <createData entity="SimpleSubCategory" stepKey="createCategory"/> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> </before> <after> <!-- Don't display out of stock product --> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductWithImagesTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductWithImagesTest.xml index 7d863b299f384..fa8866fa7d91c 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductWithImagesTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductWithImagesTest.xml @@ -42,7 +42,7 @@ </createData> <createData entity="SimpleSubCategory" stepKey="createCategory"/> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> </before> <after> <!-- Delete configurable product --> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductWithThreeProductDisplayOutOfStockProductsTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductWithThreeProductDisplayOutOfStockProductsTest.xml index 14304d93b3c28..e76d14f3a6aae 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductWithThreeProductDisplayOutOfStockProductsTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductWithThreeProductDisplayOutOfStockProductsTest.xml @@ -57,7 +57,7 @@ </createData> <createData entity="SimpleSubCategory" stepKey="createCategory"/> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> </before> <after> <!-- Don't display out of stock product --> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductWithThreeProductDontDisplayOutOfStockProductsTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductWithThreeProductDontDisplayOutOfStockProductsTest.xml index c6bb6fdf7e7e8..9516216d4a62e 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductWithThreeProductDontDisplayOutOfStockProductsTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductWithThreeProductDontDisplayOutOfStockProductsTest.xml @@ -57,7 +57,7 @@ </createData> <createData entity="SimpleSubCategory" stepKey="createCategory"/> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> </before> <after> <!-- Delete configurable product --> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductWithTierPriceForOneItemTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductWithTierPriceForOneItemTest.xml index 96ffecaf337ae..660eb82a9eacb 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductWithTierPriceForOneItemTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductWithTierPriceForOneItemTest.xml @@ -50,7 +50,7 @@ <createData entity="tierProductPrice" stepKey="addTierPrice"> <requiredEntity createDataKey="createFirstSimpleProduct" /> </createData> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> </before> <after> <!-- Delete configurable product --> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductWithTwoOptionsAssignedToCategoryTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductWithTwoOptionsAssignedToCategoryTest.xml index 4c39b0c2a54fb..f57fc81294cbc 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductWithTwoOptionsAssignedToCategoryTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductWithTwoOptionsAssignedToCategoryTest.xml @@ -22,7 +22,7 @@ <createData entity="SimpleSubCategory" stepKey="createCategory"/> <!-- Login as admin --> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> </before> <after> <!-- Delete configurable product --> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductWithTwoOptionsWithoutAssignedToCategoryTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductWithTwoOptionsWithoutAssignedToCategoryTest.xml index 31851fc78968b..977eb2bdba0fe 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductWithTwoOptionsWithoutAssignedToCategoryTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductWithTwoOptionsWithoutAssignedToCategoryTest.xml @@ -18,7 +18,7 @@ <group value="mtf_migrated"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> </before> <after> <!-- Delete configurable product --> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminDeleteConfigurableProductTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminDeleteConfigurableProductTest.xml index 68f86a7d07890..e625a1cf6f2be 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminDeleteConfigurableProductTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminDeleteConfigurableProductTest.xml @@ -18,7 +18,7 @@ <group value="mtf_migrated"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <createData entity="_defaultCategory" stepKey="createCategory"/> <createData entity="BaseConfigurableProduct" stepKey="createConfigurableProduct"> <requiredEntity createDataKey="createCategory"/> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminProductTypeSwitchingOnEditingTest/AdminSimpleProductTypeSwitchingToConfigurableProductTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminProductTypeSwitchingOnEditingTest/AdminSimpleProductTypeSwitchingToConfigurableProductTest.xml index e7006591c2a8f..c5fdbfb36490a 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminProductTypeSwitchingOnEditingTest/AdminSimpleProductTypeSwitchingToConfigurableProductTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminProductTypeSwitchingOnEditingTest/AdminSimpleProductTypeSwitchingToConfigurableProductTest.xml @@ -19,7 +19,7 @@ <group value="catalog"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <!--Create product--> <comment userInput="Create product" stepKey="commentCreateProduct"/> <createData entity="SimpleProduct2" stepKey="createProduct"/> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminProductTypeSwitchingOnEditingTest/AdminVirtualProductTypeSwitchingToConfigurableProductTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminProductTypeSwitchingOnEditingTest/AdminVirtualProductTypeSwitchingToConfigurableProductTest.xml index 43f00fcef9993..90a396b970c3a 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminProductTypeSwitchingOnEditingTest/AdminVirtualProductTypeSwitchingToConfigurableProductTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminProductTypeSwitchingOnEditingTest/AdminVirtualProductTypeSwitchingToConfigurableProductTest.xml @@ -19,7 +19,7 @@ <group value="catalog"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <!--Create product--> <comment userInput="Create product" stepKey="commentCreateProduct"/> <createData entity="VirtualProduct" stepKey="createProduct"/> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminRelatedProductsTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminRelatedProductsTest.xml index d9300ad1b290b..b6b3d21c8a626 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminRelatedProductsTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminRelatedProductsTest.xml @@ -78,7 +78,7 @@ <requiredEntity createDataKey="baseConfigProductHandle"/> <requiredEntity createDataKey="childProductHandle2"/> </createData> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin1"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin1"/> </before> <after> <amOnPage url="{{AdminLogoutPage.url}}" stepKey="amOnLogoutPage"/> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminRemoveDefaultImageConfigurableTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminRemoveDefaultImageConfigurableTest.xml index a1a1bb5c8a35a..86d4070a9a2c8 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminRemoveDefaultImageConfigurableTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminRemoveDefaultImageConfigurableTest.xml @@ -20,7 +20,7 @@ </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <createData entity="SimpleSubCategory" stepKey="categoryHandle"/> <createData entity="SimpleProduct" stepKey="simple1Handle"> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/ConfigurableProductAttributeNameDesignTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/ConfigurableProductAttributeNameDesignTest.xml index bb16d04dfc94a..e064e635de1cd 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/ConfigurableProductAttributeNameDesignTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/ConfigurableProductAttributeNameDesignTest.xml @@ -21,7 +21,7 @@ <before> <!-- Log in to Dashboard page --> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin1"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin1"/> </before> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/ConfigurableProductPriceAdditionalStoreViewTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/ConfigurableProductPriceAdditionalStoreViewTest.xml index 23c3de4675718..a34dfd06ce844 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/ConfigurableProductPriceAdditionalStoreViewTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/ConfigurableProductPriceAdditionalStoreViewTest.xml @@ -64,7 +64,7 @@ <requiredEntity createDataKey="createConfigProduct"/> <requiredEntity createDataKey="createConfigChildProduct2"/> </createData> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin1"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin1"/> </before> <after> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/NoErrorForMiniCartItemEditTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/NoErrorForMiniCartItemEditTest.xml index 18993269ab0b1..c2ac4dde21c35 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/NoErrorForMiniCartItemEditTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/NoErrorForMiniCartItemEditTest.xml @@ -18,7 +18,7 @@ <group value="ConfigurableProduct"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin1"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin1"/> <createData entity="ApiCategory" stepKey="createCategory"/> <!-- Create Configurable product --> <actionGroup ref="CreateConfigurableProductActionGroup" stepKey="createProduct"> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/NoOptionAvailableToConfigureDisabledProductTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/NoOptionAvailableToConfigureDisabledProductTest.xml index e0263c5c011b9..54e23470ae786 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/NoOptionAvailableToConfigureDisabledProductTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/NoOptionAvailableToConfigureDisabledProductTest.xml @@ -20,7 +20,7 @@ <group value="ConfigurableProduct"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="login"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="login"/> <!--Create category--> <comment userInput="Create category" stepKey="commentCreateCategory"/> <createData entity="SimpleSubCategory" stepKey="createCategory"/> @@ -161,7 +161,12 @@ <click selector="{{AdminInvoicePaymentShippingSection.shippingMethod}}" stepKey="chooseShippingMethod"/> <waitForPageLoad stepKey="waitForShippingMethodLoad"/> <click selector="{{AdminOrderFormActionSection.SubmitOrder}}" stepKey="clickSubmitOrder"/> - <waitForPageLoad stepKey="waitForSuccess"/> - <see selector="{{AdminOrderDetailsMessagesSection.successMessage}}" userInput="You created the order." stepKey="seeSuccessMessage"/> + <waitForPageLoad stepKey="waitForError"/> + <!-- Check that error remains --> + <actionGroup ref="AssertAdminItemOrderedErrorActionGroup" stepKey="assertProductErrorRemains"> + <argument name="productName" value="$createConfigChildProduct2.name$"/> + <argument name="messageType" value="error"/> + <argument name="message" value="This product is out of stock."/> + </actionGroup> </test> </tests> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/ProductsQtyReturnAfterOrderCancelTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/ProductsQtyReturnAfterOrderCancelTest.xml index a2cfd47eb3402..355c4fa049f01 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/ProductsQtyReturnAfterOrderCancelTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/ProductsQtyReturnAfterOrderCancelTest.xml @@ -26,7 +26,7 @@ <createData entity="ApiConfigurableProduct" stepKey="createConfigProduct"> <requiredEntity createDataKey="createCategory"/> </createData> - <actionGroup ref="LoginAsAdmin" stepKey="login"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="login"/> </before> <after> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontConfigurableProductChildSearchTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontConfigurableProductChildSearchTest.xml index d52cf1978d7fe..10ea3a7e400c4 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontConfigurableProductChildSearchTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontConfigurableProductChildSearchTest.xml @@ -114,7 +114,7 @@ <requiredEntity createDataKey="createConfigProductAttributeSelect"/> </createData> - <actionGroup ref="LoginAsAdmin" stepKey="login"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="login"/> <!-- Go to the product page for the first product --> <amOnPage stepKey="goToProductGrid" url="{{ProductCatalogPage.url}}"/> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontConfigurableProductDetailsTest/StorefrontConfigurableProductBasicInfoTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontConfigurableProductDetailsTest/StorefrontConfigurableProductBasicInfoTest.xml index fa635dfb94e78..317563a468d74 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontConfigurableProductDetailsTest/StorefrontConfigurableProductBasicInfoTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontConfigurableProductDetailsTest/StorefrontConfigurableProductBasicInfoTest.xml @@ -20,7 +20,7 @@ <before> <createData entity="ApiCategory" stepKey="createCategory"/> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <!-- Create a configurable product via the UI --> <actionGroup ref="CreateConfigurableProductActionGroup" stepKey="createProduct"> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontConfigurableProductDetailsTest/StorefrontConfigurableProductCanAddToCartTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontConfigurableProductDetailsTest/StorefrontConfigurableProductCanAddToCartTest.xml index a9e3d725bb079..9fc6dce10c21a 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontConfigurableProductDetailsTest/StorefrontConfigurableProductCanAddToCartTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontConfigurableProductDetailsTest/StorefrontConfigurableProductCanAddToCartTest.xml @@ -20,7 +20,7 @@ <before> <createData entity="ApiCategory" stepKey="createCategory"/> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <!-- Create a configurable product via the UI --> <actionGroup ref="CreateConfigurableProductActionGroup" stepKey="createProduct"> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontConfigurableProductDetailsTest/StorefrontConfigurableProductCantAddToCartTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontConfigurableProductDetailsTest/StorefrontConfigurableProductCantAddToCartTest.xml index 154fcca60ed6b..01859f995b00b 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontConfigurableProductDetailsTest/StorefrontConfigurableProductCantAddToCartTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontConfigurableProductDetailsTest/StorefrontConfigurableProductCantAddToCartTest.xml @@ -20,7 +20,7 @@ <before> <createData entity="ApiCategory" stepKey="createCategory"/> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <!-- Create a configurable product via the UI --> <actionGroup ref="CreateConfigurableProductActionGroup" stepKey="createProduct"> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontConfigurableProductDetailsTest/StorefrontConfigurableProductOptionsTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontConfigurableProductDetailsTest/StorefrontConfigurableProductOptionsTest.xml index 88171e3668119..1aef8c33785ca 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontConfigurableProductDetailsTest/StorefrontConfigurableProductOptionsTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontConfigurableProductDetailsTest/StorefrontConfigurableProductOptionsTest.xml @@ -20,7 +20,7 @@ <before> <createData entity="ApiCategory" stepKey="createCategory"/> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <!-- Create a configurable product via the UI --> <actionGroup ref="CreateConfigurableProductActionGroup" stepKey="createProduct"> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontConfigurableProductDetailsTest/StorefrontConfigurableProductVariationsTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontConfigurableProductDetailsTest/StorefrontConfigurableProductVariationsTest.xml index 4dc6030e2ce4c..e51250c76bfe7 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontConfigurableProductDetailsTest/StorefrontConfigurableProductVariationsTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontConfigurableProductDetailsTest/StorefrontConfigurableProductVariationsTest.xml @@ -37,7 +37,7 @@ <createData entity="productAttributeOption2" stepKey="createSecondAttributeSecondOption"> <requiredEntity createDataKey="createSecondAttribute"/> </createData> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> </before> <after> <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontConfigurableProductViewTest/StorefrontConfigurableProductAddToCartTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontConfigurableProductViewTest/StorefrontConfigurableProductAddToCartTest.xml index d1768783e46e6..1fee355ad5e44 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontConfigurableProductViewTest/StorefrontConfigurableProductAddToCartTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontConfigurableProductViewTest/StorefrontConfigurableProductAddToCartTest.xml @@ -20,7 +20,7 @@ <before> <createData entity="ApiCategory" stepKey="createCategory"/> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin1"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin1"/> <!-- Create a configurable product via the UI --> <actionGroup ref="CreateConfigurableProductActionGroup" stepKey="createProduct"> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontConfigurableProductViewTest/StorefrontConfigurableProductGridViewTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontConfigurableProductViewTest/StorefrontConfigurableProductGridViewTest.xml index 009a5008875e5..ca0426f1b97d5 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontConfigurableProductViewTest/StorefrontConfigurableProductGridViewTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontConfigurableProductViewTest/StorefrontConfigurableProductGridViewTest.xml @@ -20,7 +20,7 @@ <before> <createData entity="ApiCategory" stepKey="createCategory"/> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin1"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin1"/> <!-- Create a configurable product via the UI --> <actionGroup ref="CreateConfigurableProductActionGroup" stepKey="createProduct"> <argument name="product" value="_defaultProduct"/> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontConfigurableProductViewTest/StorefrontConfigurableProductListViewTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontConfigurableProductViewTest/StorefrontConfigurableProductListViewTest.xml index 7097641c67530..619e50acba848 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontConfigurableProductViewTest/StorefrontConfigurableProductListViewTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontConfigurableProductViewTest/StorefrontConfigurableProductListViewTest.xml @@ -20,7 +20,7 @@ <before> <createData entity="ApiCategory" stepKey="createCategory"/> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin1"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin1"/> <!-- Create a configurable product via the UI --> <actionGroup ref="CreateConfigurableProductActionGroup" stepKey="createProduct"> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontConfigurableProductWithFileCustomOptionTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontConfigurableProductWithFileCustomOptionTest.xml index 4de8dedefab48..ac14b9b299b98 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontConfigurableProductWithFileCustomOptionTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontConfigurableProductWithFileCustomOptionTest.xml @@ -28,7 +28,7 @@ <actionGroup ref="AdminLogoutActionGroup" stepKey="adminLogout"/> </after> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <!-- Create a configurable product via the UI --> <actionGroup ref="CreateConfigurableProductActionGroup" stepKey="createProduct"> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontGalleryConfigurableProductWithSeveralAttributesPrependMediaTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontGalleryConfigurableProductWithSeveralAttributesPrependMediaTest.xml index 9d48546e1ad3a..a50d1e32d3614 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontGalleryConfigurableProductWithSeveralAttributesPrependMediaTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontGalleryConfigurableProductWithSeveralAttributesPrependMediaTest.xml @@ -42,7 +42,7 @@ <requiredEntity createDataKey="createVisualSwatchAttribute"/> </createData> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <!-- Open configurable product edit page --> <amOnPage url="{{AdminProductEditPage.url($createConfigurableProduct.id$)}}" stepKey="goToProductIndex"/> @@ -158,7 +158,7 @@ <argument name="ProductAttribute" value="$createVisualSwatchAttribute$"/> </actionGroup> <actionGroup ref="ClearFiltersAdminDataGridActionGroup" stepKey="clearProductAttributeGridFilters"/> - <actionGroup ref="logout" stepKey="logoutFromAdmin"/> + <actionGroup ref="AdminLogoutActionGroup" stepKey="logoutFromAdmin"/> <!-- Reindex invalidated indices after product attribute has been created --> <actionGroup ref="CliRunReindexUsingCronJobsActionGroup" stepKey="reindexInvalidatedIndicesAfterDeleteAttributes"/> </after> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontGalleryConfigurableProductWithVisualSwatchAttributePrependMediaTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontGalleryConfigurableProductWithVisualSwatchAttributePrependMediaTest.xml index ac3c2497d9dfb..be81b64c7ed25 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontGalleryConfigurableProductWithVisualSwatchAttributePrependMediaTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontGalleryConfigurableProductWithVisualSwatchAttributePrependMediaTest.xml @@ -36,7 +36,7 @@ <requiredEntity createDataKey="createVisualSwatchAttribute"/> </createData> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <!-- Open configurable product edit page --> <amOnPage url="{{AdminProductEditPage.url($createConfigurableProduct.id$)}}" stepKey="goToProductIndex"/> @@ -120,7 +120,7 @@ <argument name="ProductAttribute" value="$createVisualSwatchAttribute$"/> </actionGroup> <actionGroup ref="ClearFiltersAdminDataGridActionGroup" stepKey="clearProductAttributeGridFilters"/> - <actionGroup ref="logout" stepKey="logoutFromAdmin"/> + <actionGroup ref="AdminLogoutActionGroup" stepKey="logoutFromAdmin"/> <!-- Reindex invalidated indices after product attribute has been created --> <actionGroup ref="CliRunReindexUsingCronJobsActionGroup" stepKey="reindexInvalidatedIndicesAfterDeleteAttributes"/> </after> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontShouldSeeOnlyConfigurableProductChildAssignedToSeparateCategoryTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontShouldSeeOnlyConfigurableProductChildAssignedToSeparateCategoryTest.xml index ddb8190c076ee..7662779a6955f 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontShouldSeeOnlyConfigurableProductChildAssignedToSeparateCategoryTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontShouldSeeOnlyConfigurableProductChildAssignedToSeparateCategoryTest.xml @@ -84,7 +84,7 @@ <requiredEntity createDataKey="createConfigChildProduct2"/> </createData> - <actionGroup ref="LoginAsAdmin" stepKey="loginToAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginToAdmin"/> </before> <after> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontSortingByPriceForConfigurableWithCatalogRuleAppliedTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontSortingByPriceForConfigurableWithCatalogRuleAppliedTest.xml index 308a56860a661..ef9f71da0ebca 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontSortingByPriceForConfigurableWithCatalogRuleAppliedTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontSortingByPriceForConfigurableWithCatalogRuleAppliedTest.xml @@ -90,7 +90,7 @@ <requiredEntity createDataKey="createConfigurableProduct"/> <requiredEntity createDataKey="createConfigChildProduct3"/> </createData> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <!--SKU Product Attribute is enabled for Promo Rule Conditions--> <actionGroup ref="NavigateToEditProductAttributeActionGroup" stepKey="navigateToSkuProductAttribute"> <argument name="ProductAttribute" value="sku"/> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontVerifyConfigurableProductLayeredNavigationTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontVerifyConfigurableProductLayeredNavigationTest.xml index 618881906c47d..7acece767760d 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontVerifyConfigurableProductLayeredNavigationTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontVerifyConfigurableProductLayeredNavigationTest.xml @@ -21,7 +21,7 @@ <before> <!-- Login as Admin --> - <actionGroup ref="LoginAsAdmin" stepKey="loginToAdminPanel"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginToAdminPanel"/> <!-- Create Default Category --> <createData entity="_defaultCategory" stepKey="createCategory"/> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontVisibilityOfDuplicateProductTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontVisibilityOfDuplicateProductTest.xml index aa9b0ac01872a..6126338461fdd 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontVisibilityOfDuplicateProductTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontVisibilityOfDuplicateProductTest.xml @@ -19,7 +19,7 @@ <group value="ConfigurableProduct"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <!--Create configurable product--> <comment userInput="Create configurable product" stepKey="commentCreateConfigProduct"/> <createData entity="SimpleSubCategory" stepKey="createCategory"/> diff --git a/app/code/Magento/ConfigurableProduct/view/frontend/requirejs-config.js b/app/code/Magento/ConfigurableProduct/view/frontend/requirejs-config.js index c25096121be5d..b2208686e7fab 100644 --- a/app/code/Magento/ConfigurableProduct/view/frontend/requirejs-config.js +++ b/app/code/Magento/ConfigurableProduct/view/frontend/requirejs-config.js @@ -8,5 +8,12 @@ var config = { '*': { configurable: 'Magento_ConfigurableProduct/js/configurable' } + }, + config: { + mixins: { + 'Magento_Catalog/js/catalog-add-to-cart': { + 'Magento_ConfigurableProduct/js/catalog-add-to-cart-mixin': true + } + } } }; diff --git a/app/code/Magento/ConfigurableProduct/view/frontend/web/js/catalog-add-to-cart-mixin.js b/app/code/Magento/ConfigurableProduct/view/frontend/web/js/catalog-add-to-cart-mixin.js new file mode 100644 index 0000000000000..88bb2ab75dc1d --- /dev/null +++ b/app/code/Magento/ConfigurableProduct/view/frontend/web/js/catalog-add-to-cart-mixin.js @@ -0,0 +1,33 @@ +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +define([ + 'underscore', + 'jquery', + 'Magento_ConfigurableProduct/js/product/view/product-info-resolver' +], function (_, $, productInfoResolver) { + 'use strict'; + + return function (widget) { + + $.widget('mage.catalogAddToCart', widget, { + /** + * @param {jQuery} form + */ + ajaxSubmit: function (form) { + var isConfigurable = !!_.find(form.serializeArray(), function (item) { + return item.name.indexOf('super_attribute') !== -1; + }); + + if (isConfigurable) { + this.options.productInfoResolver = productInfoResolver; + } + + return this._super(form); + } + }); + + return $.mage.catalogAddToCart; + }; +}); diff --git a/app/code/Magento/ConfigurableProduct/view/frontend/web/js/product/view/product-info-resolver.js b/app/code/Magento/ConfigurableProduct/view/frontend/web/js/product/view/product-info-resolver.js new file mode 100644 index 0000000000000..679632606c72d --- /dev/null +++ b/app/code/Magento/ConfigurableProduct/view/frontend/web/js/product/view/product-info-resolver.js @@ -0,0 +1,47 @@ +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +define([ + 'underscore', + 'Magento_Catalog/js/product/view/product-info' +], function (_, productInfo) { + 'use strict'; + + /** + * Returns info about configurable products in form. + * + * @param {jQuery} $form + * @return {Array} + */ + return function ($form) { + var optionValues = [], + product = _.findWhere($form.serializeArray(), { + name: 'product' + }), + productId; + + if (!_.isUndefined(product)) { + productId = product.value; + _.each($form.serializeArray(), function (item) { + if (item.name.indexOf('super_attribute') !== -1) { + optionValues.push(item.value); + } + }); + optionValues.sort(); + productInfo().push( + { + 'id': productId, + 'optionValues': optionValues + } + ); + } + + return _.uniq(productInfo(), function (item) { + var optionValuesStr = item.optionValues ? item.optionValues.join() : ''; + + return item.id + optionValuesStr; + }); + }; +}); + diff --git a/app/code/Magento/CurrencySymbol/Test/Mftf/Test/AdminCurrencyConverterAPIConfigurationTest.xml b/app/code/Magento/CurrencySymbol/Test/Mftf/Test/AdminCurrencyConverterAPIConfigurationTest.xml index eb3ca4f977c65..5d6d05ebfead4 100644 --- a/app/code/Magento/CurrencySymbol/Test/Mftf/Test/AdminCurrencyConverterAPIConfigurationTest.xml +++ b/app/code/Magento/CurrencySymbol/Test/Mftf/Test/AdminCurrencyConverterAPIConfigurationTest.xml @@ -32,7 +32,7 @@ <createData entity="SimpleProduct" stepKey="createProduct"> <requiredEntity createDataKey="createCategory"/> </createData> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> </before> <after> <!--Set currency allow previous config--> diff --git a/app/code/Magento/CurrencySymbol/Test/Mftf/Test/AdminDefaultCurrencySymbolsAreDisabledTest.xml b/app/code/Magento/CurrencySymbol/Test/Mftf/Test/AdminDefaultCurrencySymbolsAreDisabledTest.xml index 7e1cb41871d43..f4d6180bae88a 100644 --- a/app/code/Magento/CurrencySymbol/Test/Mftf/Test/AdminDefaultCurrencySymbolsAreDisabledTest.xml +++ b/app/code/Magento/CurrencySymbol/Test/Mftf/Test/AdminDefaultCurrencySymbolsAreDisabledTest.xml @@ -19,7 +19,7 @@ </annotations> <before> <magentoCLI command="config:set --scope={{SetAllowedCurrenciesConfigForUSD.scope}} --scope-code={{SetAllowedCurrenciesConfigForUSD.scope_code}} {{SetAllowedCurrenciesConfigForUSD.path}} {{SetAllowedCurrenciesConfigForUSD.value}},{{SetAllowedCurrenciesConfigForEUR.value}},{{SetAllowedCurrenciesConfigForRUB.value}}" stepKey="setAllowedCurrencyWebsites_EUR_RUB_USD"/> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> </before> <after> <magentoCLI command="config:set --scope={{SetAllowedCurrenciesConfigForUSD.scope}} --scope-code={{SetAllowedCurrenciesConfigForUSD.scope_code}} {{SetAllowedCurrenciesConfigForUSD.path}} {{SetAllowedCurrenciesConfigForUSD.value}},{{SetAllowedCurrenciesConfigForEUR.value}}" stepKey="setAllowedCurrencyWebsites_EUR_USD"/> diff --git a/app/code/Magento/CurrencySymbol/Test/Mftf/Test/AdminOrderRateDisplayWhenChooseThreeAllowedCurrenciesTest.xml b/app/code/Magento/CurrencySymbol/Test/Mftf/Test/AdminOrderRateDisplayWhenChooseThreeAllowedCurrenciesTest.xml index 8f87246bcf018..ce9b05882d494 100644 --- a/app/code/Magento/CurrencySymbol/Test/Mftf/Test/AdminOrderRateDisplayWhenChooseThreeAllowedCurrenciesTest.xml +++ b/app/code/Magento/CurrencySymbol/Test/Mftf/Test/AdminOrderRateDisplayWhenChooseThreeAllowedCurrenciesTest.xml @@ -20,7 +20,7 @@ <group value="currency"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <!--Create product--> <createData entity="SimpleProduct2" stepKey="createNewProduct"/> <!--Set Currency options for Website--> diff --git a/app/code/Magento/CurrencySymbol/Test/Mftf/Test/AdminOrderRateDisplayedInOneLineTest.xml b/app/code/Magento/CurrencySymbol/Test/Mftf/Test/AdminOrderRateDisplayedInOneLineTest.xml index 8c61bd4434fff..146671e36af68 100644 --- a/app/code/Magento/CurrencySymbol/Test/Mftf/Test/AdminOrderRateDisplayedInOneLineTest.xml +++ b/app/code/Magento/CurrencySymbol/Test/Mftf/Test/AdminOrderRateDisplayedInOneLineTest.xml @@ -20,7 +20,7 @@ <group value="currency"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <!--Create product--> <createData entity="SimpleProduct2" stepKey="createProduct"/> <!--Set price scope website--> diff --git a/app/code/Magento/CurrencySymbol/Test/Mftf/Test/AdminStoresCurrencyRatesNavigateMenuTest.xml b/app/code/Magento/CurrencySymbol/Test/Mftf/Test/AdminStoresCurrencyRatesNavigateMenuTest.xml index a5781698deed4..95f1eebee6c87 100644 --- a/app/code/Magento/CurrencySymbol/Test/Mftf/Test/AdminStoresCurrencyRatesNavigateMenuTest.xml +++ b/app/code/Magento/CurrencySymbol/Test/Mftf/Test/AdminStoresCurrencyRatesNavigateMenuTest.xml @@ -20,7 +20,7 @@ <group value="mtf_migrated"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="LoginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="LoginAsAdmin"/> </before> <after> <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> diff --git a/app/code/Magento/CurrencySymbol/Test/Mftf/Test/AdminStoresCurrencySymbolsNavigateMenuTest.xml b/app/code/Magento/CurrencySymbol/Test/Mftf/Test/AdminStoresCurrencySymbolsNavigateMenuTest.xml index 65afd4e2e744a..254b0fc6058f8 100644 --- a/app/code/Magento/CurrencySymbol/Test/Mftf/Test/AdminStoresCurrencySymbolsNavigateMenuTest.xml +++ b/app/code/Magento/CurrencySymbol/Test/Mftf/Test/AdminStoresCurrencySymbolsNavigateMenuTest.xml @@ -20,7 +20,7 @@ <group value="mtf_migrated"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="LoginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="LoginAsAdmin"/> </before> <after> <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> diff --git a/app/code/Magento/Customer/Block/Widget/Dob.php b/app/code/Magento/Customer/Block/Widget/Dob.php index e020de79a3a60..90ce9ba210ed2 100644 --- a/app/code/Magento/Customer/Block/Widget/Dob.php +++ b/app/code/Magento/Customer/Block/Widget/Dob.php @@ -9,7 +9,7 @@ use Magento\Framework\Api\ArrayObjectSearch; /** - * Class Dob + * Customer date of birth attribute block * * @SuppressWarnings(PHPMD.DepthOfInheritance) */ @@ -267,7 +267,9 @@ public function getHtmlExtraParams() $validators['validate-date'] = [ 'dateFormat' => $this->getDateFormat() ]; - $validators['validate-dob'] = true; + $validators['validate-dob'] = [ + 'dateFormat' => $this->getDateFormat() + ]; return 'data-validate="' . $this->_escaper->escapeHtml(json_encode($validators)) . '"'; } diff --git a/app/code/Magento/Customer/Test/Mftf/ActionGroup/AdminCustomerShowDateOfBirthActionGroup.xml b/app/code/Magento/Customer/Test/Mftf/ActionGroup/AdminCustomerShowDateOfBirthActionGroup.xml new file mode 100644 index 0000000000000..009c37c568c44 --- /dev/null +++ b/app/code/Magento/Customer/Test/Mftf/ActionGroup/AdminCustomerShowDateOfBirthActionGroup.xml @@ -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"> + <actionGroup name="AdminCustomerShowDateOfBirthActionGroup"> + <annotations> + <description>Goes to the customer configuration. Set "Show Date of Birth" with provided value.</description> + </annotations> + <arguments> + <argument name="value" type="string" defaultValue="{{ShowDateOfBirth.optional}}"/> + </arguments> + <amOnPage url="{{AdminCustomerConfigPage.url('#customer_address-link')}}" stepKey="openCustomerConfigPage"/> + <waitForPageLoad stepKey="waitCustomerConfigPage"/> + <scrollTo selector="{{AdminCustomerConfigSection.showDateOfBirth}}" x="0" y="-100" stepKey="scrollToShowDateOfBirth"/> + <uncheckOption selector="{{AdminCustomerConfigSection.showDateOfBirthInherit}}" stepKey="uncheckUseSystem"/> + <selectOption selector="{{AdminCustomerConfigSection.showDateOfBirth}}" userInput="{{value}}" stepKey="fillShowDateOfBirth"/> + <click selector="{{AdminMainActionsSection.save}}" stepKey="clickSave"/> + <seeElement selector="{{AdminMessagesSection.success}}" stepKey="seeSuccessMessage"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Customer/Test/Mftf/ActionGroup/AdminOpenCustomerGroupEditPageFromGridActionGroup.xml b/app/code/Magento/Customer/Test/Mftf/ActionGroup/AdminOpenCustomerGroupEditPageFromGridActionGroup.xml new file mode 100644 index 0000000000000..f27f418496204 --- /dev/null +++ b/app/code/Magento/Customer/Test/Mftf/ActionGroup/AdminOpenCustomerGroupEditPageFromGridActionGroup.xml @@ -0,0 +1,18 @@ +<?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="AdminOpenCustomerGroupEditPageFromGridActionGroup"> + <arguments> + <argument name="groupCode" type="string"/> + </arguments> + <conditionalClick selector="{{AdminCustomerGroupMainSection.selectFirstRow}}" dependentSelector="{{AdminCustomerGroupMainSection.selectFirstRow}}" visible="true" stepKey="clickSelectButton"/> + <click selector="{{AdminCustomerGroupMainSection.editButtonByCustomerGroupCode(groupCode)}}" stepKey="clickOnEditCustomerGroup" /> + <waitForPageLoad stepKey="waitForCustomerGroupEditPage"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Customer/Test/Mftf/ActionGroup/AdminOpenCustomerGroupsGridPageActionGroup.xml b/app/code/Magento/Customer/Test/Mftf/ActionGroup/AdminOpenCustomerGroupsGridPageActionGroup.xml new file mode 100644 index 0000000000000..d6fd64426e3cf --- /dev/null +++ b/app/code/Magento/Customer/Test/Mftf/ActionGroup/AdminOpenCustomerGroupsGridPageActionGroup.xml @@ -0,0 +1,15 @@ +<?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="AdminOpenCustomerGroupsGridPageActionGroup"> + <amOnPage url="{{AdminCustomerGroupsIndexPage.url}}" stepKey="goToAdminCustomerGroupIndexPage"/> + <waitForPageLoad time="30" stepKey="waitForCustomerGroupIndexPageLoad"/> + </actionGroup> +</actionGroups> \ No newline at end of file diff --git a/app/code/Magento/Customer/Test/Mftf/ActionGroup/AssertDeleteCustomerGroupButtonMissingActionGroup.xml b/app/code/Magento/Customer/Test/Mftf/ActionGroup/AssertDeleteCustomerGroupButtonMissingActionGroup.xml new file mode 100644 index 0000000000000..e45490e6330e5 --- /dev/null +++ b/app/code/Magento/Customer/Test/Mftf/ActionGroup/AssertDeleteCustomerGroupButtonMissingActionGroup.xml @@ -0,0 +1,14 @@ +<?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="AssertDeleteCustomerGroupButtonMissingActionGroup"> + <dontSeeElement selector="AdminEditCustomerGroupSection.deleteButton" stepKey="dontSeeDeleteButton"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Customer/Test/Mftf/ActionGroup/AssertStorefrontAccountPasswordFieldsNotAvailableActionGroup.xml b/app/code/Magento/Customer/Test/Mftf/ActionGroup/AssertStorefrontAccountPasswordFieldsNotAvailableActionGroup.xml new file mode 100644 index 0000000000000..1e828414935da --- /dev/null +++ b/app/code/Magento/Customer/Test/Mftf/ActionGroup/AssertStorefrontAccountPasswordFieldsNotAvailableActionGroup.xml @@ -0,0 +1,16 @@ +<?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="AssertStorefrontAccountPasswordFieldsNotAvailableActionGroup"> + <dontSee stepKey="dontSeeCurrentPasswordField" selector="{{StorefrontCustomerAccountInformationSection.currentPassword}}"/> + <dontSee stepKey="dontSeeNewPasswordField" selector="{{StorefrontCustomerAccountInformationSection.newPassword}}"/> + <dontSee stepKey="dontSeeConfirmPasswordField" selector="{{StorefrontCustomerAccountInformationSection.confirmNewPassword}}"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Customer/Test/Mftf/ActionGroup/StorefrontCustomerChangePasswordActionGroup.xml b/app/code/Magento/Customer/Test/Mftf/ActionGroup/StorefrontCustomerChangePasswordActionGroup.xml new file mode 100644 index 0000000000000..802b75213825b --- /dev/null +++ b/app/code/Magento/Customer/Test/Mftf/ActionGroup/StorefrontCustomerChangePasswordActionGroup.xml @@ -0,0 +1,23 @@ +<?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="StorefrontCustomerChangePasswordActionGroup"> + <arguments> + <argument name="password" type="string" /> + </arguments> + + <checkOption selector="{{StorefrontCustomerAccountInformationSection.changePassword}}" stepKey="clickChangePasswordlCheckbox" /> + <fillField selector="{{StorefrontCustomerAccountInformationSection.currentPassword}}" userInput="{{password}}" stepKey="fillCurrentPassword" /> + <fillField selector="{{StorefrontCustomerAccountInformationSection.newPassword}}" userInput="{{password}}" stepKey="fillNewPassword" /> + <fillField selector="{{StorefrontCustomerAccountInformationSection.confirmNewPassword}}" userInput="{{password}}" stepKey="confirmNewPassword" /> + <click selector="{{StorefrontCustomerAccountInformationSection.saveButton}}" stepKey="saveChange" /> + <waitForPageLoad stepKey="waitForPageLoaded" /> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Customer/Test/Mftf/ActionGroup/StorefrontCustomerCreateAccountWithDateOfBirthActionGroup.xml b/app/code/Magento/Customer/Test/Mftf/ActionGroup/StorefrontCustomerCreateAccountWithDateOfBirthActionGroup.xml new file mode 100644 index 0000000000000..22af2752ed1a5 --- /dev/null +++ b/app/code/Magento/Customer/Test/Mftf/ActionGroup/StorefrontCustomerCreateAccountWithDateOfBirthActionGroup.xml @@ -0,0 +1,20 @@ +<?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="StorefrontCustomerCreateAccountWithDateOfBirthActionGroup" extends="SignUpNewUserFromStorefrontActionGroup"> + <annotations> + <description>EXTENDS: SignUpNewUserFromStorefrontActionGroup. Fills birthday field.</description> + </annotations> + <arguments> + <argument name="dob" defaultValue="{{EN_US_DATE.short4DigitYear}}" type="string"/> + </arguments> + <fillField userInput="{{dob}}" selector="{{StorefrontCustomerCreateFormSection.dobField}}" after="fillLastName" stepKey="fillDob"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Customer/Test/Mftf/ActionGroup/StorefrontNavigateToAccountInformationChangeActionGroup.xml b/app/code/Magento/Customer/Test/Mftf/ActionGroup/StorefrontNavigateToAccountInformationChangeActionGroup.xml new file mode 100644 index 0000000000000..68ab140ff0899 --- /dev/null +++ b/app/code/Magento/Customer/Test/Mftf/ActionGroup/StorefrontNavigateToAccountInformationChangeActionGroup.xml @@ -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="StorefrontNavigateToAccountInformationChangeActionGroup"> + <amOnPage url="{{StorefrontCustomerEditPage.url}}" stepKey="goToCustomerEditPage"/> + <waitForPageLoad stepKey="waitForEditPage"/> + <conditionalClick selector="{{StorefrontCustomerSidebarSection.sidebarTab('Account Information')}}" dependentSelector="{{StorefrontCustomerSidebarSection.sidebarTab('Account Information')}}" visible="true" stepKey="openAccountInfoTab" /> + <waitForPageLoad stepKey="waitForAccountInfoTabOpened"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Customer/Test/Mftf/Data/AdminCustomerConfigData.xml b/app/code/Magento/Customer/Test/Mftf/Data/AdminCustomerConfigData.xml new file mode 100644 index 0000000000000..53963b1e95fbd --- /dev/null +++ b/app/code/Magento/Customer/Test/Mftf/Data/AdminCustomerConfigData.xml @@ -0,0 +1,16 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<entities xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:DataGenerator/etc/dataProfileSchema.xsd"> + <entity name="ShowDateOfBirth"> + <data key="no">No</data> + <data key="optional">Optional</data> + <data key="required">Required</data> + </entity> +</entities> diff --git a/app/code/Magento/Customer/Test/Mftf/Data/DateData.xml b/app/code/Magento/Customer/Test/Mftf/Data/DateData.xml new file mode 100644 index 0000000000000..5fbb1c279e38e --- /dev/null +++ b/app/code/Magento/Customer/Test/Mftf/Data/DateData.xml @@ -0,0 +1,25 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<entities xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:DataGenerator/etc/dataProfileSchema.xsd"> + <entity name="EN_US_DATE"> + <data key="short">9/21/93</data> + <data key="short4DigitYear">9/21/1993</data> + <data key="medium">Sep 21, 1993</data> + <data key="long">September 21, 1993</data> + <data key="full">Tuesday, September 21, 1993</data> + </entity> + <entity name="FR_FR_DATE"> + <data key="short">21/09/1993</data> + <data key="short4DigitYear">21/09/1993</data> + <data key="medium">21 sept. 1993</data> + <data key="long">21 septembre 1993</data> + <data key="full">mardi 21 septembre 1993</data> + </entity> +</entities> diff --git a/app/code/Magento/Customer/Test/Mftf/Section/AdminCustomerConfigSection.xml b/app/code/Magento/Customer/Test/Mftf/Section/AdminCustomerConfigSection.xml index a934d71397b8c..f8a441e40a792 100644 --- a/app/code/Magento/Customer/Test/Mftf/Section/AdminCustomerConfigSection.xml +++ b/app/code/Magento/Customer/Test/Mftf/Section/AdminCustomerConfigSection.xml @@ -11,5 +11,7 @@ <element name="accountSharingOptionsTab" type="button" selector="#customer_account_share-head"/> <element name="shareCustomerAccountInherit" type="checkbox" selector="#customer_account_share_scope_inherit"/> <element name="shareCustomerAccount" type="select" selector="#customer_account_share_scope"/> + <element name="showDateOfBirth" type="select" selector="#customer_address_dob_show"/> + <element name="showDateOfBirthInherit" type="select" selector="#customer_address_dob_show_inherit"/> </section> </sections> diff --git a/app/code/Magento/Customer/Test/Mftf/Section/AdminEditCustomerGroupSection.xml b/app/code/Magento/Customer/Test/Mftf/Section/AdminEditCustomerGroupSection.xml new file mode 100644 index 0000000000000..917af88338d24 --- /dev/null +++ b/app/code/Magento/Customer/Test/Mftf/Section/AdminEditCustomerGroupSection.xml @@ -0,0 +1,14 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd"> + <section name="AdminEditCustomerGroupSection"> + <element name="deleteButton" type="button" selector=".page-actions-buttons button#delete"/> + </section> +</sections> diff --git a/app/code/Magento/Customer/Test/Mftf/Section/StorefrontCustomerCreateFormSection/StorefrontCustomerCreateFormSection.xml b/app/code/Magento/Customer/Test/Mftf/Section/StorefrontCustomerCreateFormSection/StorefrontCustomerCreateFormSection.xml index 0fb05c319c90a..6b65ef861472c 100644 --- a/app/code/Magento/Customer/Test/Mftf/Section/StorefrontCustomerCreateFormSection/StorefrontCustomerCreateFormSection.xml +++ b/app/code/Magento/Customer/Test/Mftf/Section/StorefrontCustomerCreateFormSection/StorefrontCustomerCreateFormSection.xml @@ -11,6 +11,7 @@ <element name="firstnameField" type="input" selector="#firstname"/> <element name="lastnameField" type="input" selector="#lastname"/> <element name="lastnameLabel" type="text" selector="//label[@for='lastname']"/> + <element name="dobField" type="input" selector="#dob"/> <element name="signUpForNewsletter" type="checkbox" selector="//div/input[@name='is_subscribed']"/> <element name="emailField" type="input" selector="#email_address"/> <element name="passwordField" type="input" selector="#password"/> diff --git a/app/code/Magento/Customer/Test/Mftf/Test/AdminAddNewDefaultBillingShippingCustomerAddressTest.xml b/app/code/Magento/Customer/Test/Mftf/Test/AdminAddNewDefaultBillingShippingCustomerAddressTest.xml index 59326317e74b1..b061b6a256471 100644 --- a/app/code/Magento/Customer/Test/Mftf/Test/AdminAddNewDefaultBillingShippingCustomerAddressTest.xml +++ b/app/code/Magento/Customer/Test/Mftf/Test/AdminAddNewDefaultBillingShippingCustomerAddressTest.xml @@ -19,7 +19,7 @@ </annotations> <before> <createData entity="Simple_US_Customer_Multiple_Addresses_No_Default_Address" stepKey="customer"/> - <actionGroup ref="LoginAsAdmin" stepKey="login"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="login"/> </before> <after> <deleteData createDataKey="customer" stepKey="deleteCustomer"/> diff --git a/app/code/Magento/Customer/Test/Mftf/Test/AdminChangeCustomerGenderInCustomersGridTest.xml b/app/code/Magento/Customer/Test/Mftf/Test/AdminChangeCustomerGenderInCustomersGridTest.xml index 30c441796c435..423954a7d9bf7 100644 --- a/app/code/Magento/Customer/Test/Mftf/Test/AdminChangeCustomerGenderInCustomersGridTest.xml +++ b/app/code/Magento/Customer/Test/Mftf/Test/AdminChangeCustomerGenderInCustomersGridTest.xml @@ -21,7 +21,7 @@ </annotations> <before> <createData entity="Simple_US_Customer" stepKey="createCustomer"/> - <actionGroup ref="LoginAsAdmin" stepKey="login"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="login"/> </before> <after> <deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/> diff --git a/app/code/Magento/Customer/Test/Mftf/Test/AdminChangeSingleCustomerGroupViaGridTest.xml b/app/code/Magento/Customer/Test/Mftf/Test/AdminChangeSingleCustomerGroupViaGridTest.xml index 908977da25d36..a7383af2d7eea 100644 --- a/app/code/Magento/Customer/Test/Mftf/Test/AdminChangeSingleCustomerGroupViaGridTest.xml +++ b/app/code/Magento/Customer/Test/Mftf/Test/AdminChangeSingleCustomerGroupViaGridTest.xml @@ -23,7 +23,7 @@ <before> <createData entity="Simple_US_Customer" stepKey="createCustomer"/> <createData entity="CustomerGroupChange" stepKey="createCustomerGroup"/> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> </before> <after> <!--Delete created data--> diff --git a/app/code/Magento/Customer/Test/Mftf/Test/AdminCheckDefaultValueDisableAutoGroupChangeIsNoTest.xml b/app/code/Magento/Customer/Test/Mftf/Test/AdminCheckDefaultValueDisableAutoGroupChangeIsNoTest.xml index aa23fc0670a88..ab5e332aeed64 100644 --- a/app/code/Magento/Customer/Test/Mftf/Test/AdminCheckDefaultValueDisableAutoGroupChangeIsNoTest.xml +++ b/app/code/Magento/Customer/Test/Mftf/Test/AdminCheckDefaultValueDisableAutoGroupChangeIsNoTest.xml @@ -21,7 +21,7 @@ <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"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin1"/> </before> <after> <actionGroup ref="AdminLogoutActionGroup" stepKey="adminLogout"/> diff --git a/app/code/Magento/Customer/Test/Mftf/Test/AdminCheckDefaultValueDisableAutoGroupChangeIsYesTest.xml b/app/code/Magento/Customer/Test/Mftf/Test/AdminCheckDefaultValueDisableAutoGroupChangeIsYesTest.xml index d7c4fb2d68772..0bf221d49ab74 100644 --- a/app/code/Magento/Customer/Test/Mftf/Test/AdminCheckDefaultValueDisableAutoGroupChangeIsYesTest.xml +++ b/app/code/Magento/Customer/Test/Mftf/Test/AdminCheckDefaultValueDisableAutoGroupChangeIsYesTest.xml @@ -21,7 +21,7 @@ <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"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin1"/> </before> <after> <magentoCLI command="config:set customer/create_account/viv_disable_auto_group_assign_default 0" stepKey="setConfigDefaultIsNo"/> diff --git a/app/code/Magento/Customer/Test/Mftf/Test/AdminCreateCustomerGroupAlreadyExistsTest.xml b/app/code/Magento/Customer/Test/Mftf/Test/AdminCreateCustomerGroupAlreadyExistsTest.xml index dd065adc7f417..c660ce031422e 100644 --- a/app/code/Magento/Customer/Test/Mftf/Test/AdminCreateCustomerGroupAlreadyExistsTest.xml +++ b/app/code/Magento/Customer/Test/Mftf/Test/AdminCreateCustomerGroupAlreadyExistsTest.xml @@ -20,7 +20,7 @@ <group value="mtf_migrated"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> </before> <after> <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> diff --git a/app/code/Magento/Customer/Test/Mftf/Test/AdminCreateCustomerRetailerWithoutAddressTest.xml b/app/code/Magento/Customer/Test/Mftf/Test/AdminCreateCustomerRetailerWithoutAddressTest.xml index 436d7838fc6b7..3488d2c94dd69 100644 --- a/app/code/Magento/Customer/Test/Mftf/Test/AdminCreateCustomerRetailerWithoutAddressTest.xml +++ b/app/code/Magento/Customer/Test/Mftf/Test/AdminCreateCustomerRetailerWithoutAddressTest.xml @@ -19,7 +19,7 @@ </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="loginToAdminPanel"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginToAdminPanel"/> </before> <after> <actionGroup ref="DeleteCustomerByEmailActionGroup" stepKey="deleteCustomer"> diff --git a/app/code/Magento/Customer/Test/Mftf/Test/AdminCreateCustomerTest.xml b/app/code/Magento/Customer/Test/Mftf/Test/AdminCreateCustomerTest.xml index 1cf73e97f91df..64e8520323184 100644 --- a/app/code/Magento/Customer/Test/Mftf/Test/AdminCreateCustomerTest.xml +++ b/app/code/Magento/Customer/Test/Mftf/Test/AdminCreateCustomerTest.xml @@ -26,7 +26,7 @@ <actionGroup ref="AdminLogoutActionGroup" stepKey="adminLogout"/> </after> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin1"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin1"/> <amOnPage url="{{AdminCustomerPage.url}}" stepKey="navigateToCustomers"/> <waitForPageLoad stepKey="waitForLoad1"/> <click selector="{{AdminCustomerGridMainActionsSection.addNewCustomer}}" stepKey="clickCreateCustomer"/> diff --git a/app/code/Magento/Customer/Test/Mftf/Test/AdminCreateCustomerWithCountryPolandTest.xml b/app/code/Magento/Customer/Test/Mftf/Test/AdminCreateCustomerWithCountryPolandTest.xml index 3482f150ebaad..5f496e2c5fba3 100644 --- a/app/code/Magento/Customer/Test/Mftf/Test/AdminCreateCustomerWithCountryPolandTest.xml +++ b/app/code/Magento/Customer/Test/Mftf/Test/AdminCreateCustomerWithCountryPolandTest.xml @@ -19,7 +19,7 @@ </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="loginToAdminPanel"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginToAdminPanel"/> <createData entity="Simple_Customer_Without_Address" stepKey="createCustomer"/> </before> <after> diff --git a/app/code/Magento/Customer/Test/Mftf/Test/AdminCreateCustomerWithCountryUSATest.xml b/app/code/Magento/Customer/Test/Mftf/Test/AdminCreateCustomerWithCountryUSATest.xml index 7d19f2fcf096b..da2eed2006434 100644 --- a/app/code/Magento/Customer/Test/Mftf/Test/AdminCreateCustomerWithCountryUSATest.xml +++ b/app/code/Magento/Customer/Test/Mftf/Test/AdminCreateCustomerWithCountryUSATest.xml @@ -19,7 +19,7 @@ </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="loginToAdminPanel"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginToAdminPanel"/> <createData entity="Simple_Customer_Without_Address" stepKey="createCustomer"/> </before> <after> diff --git a/app/code/Magento/Customer/Test/Mftf/Test/AdminCreateCustomerWithCustomGroupTest.xml b/app/code/Magento/Customer/Test/Mftf/Test/AdminCreateCustomerWithCustomGroupTest.xml index e16a01bc3222b..52a2483096aaf 100644 --- a/app/code/Magento/Customer/Test/Mftf/Test/AdminCreateCustomerWithCustomGroupTest.xml +++ b/app/code/Magento/Customer/Test/Mftf/Test/AdminCreateCustomerWithCustomGroupTest.xml @@ -20,7 +20,7 @@ <before> <createData entity="CustomCustomerGroup" stepKey="customerGroup" /> - <actionGroup ref="LoginAsAdmin" stepKey="login"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="login"/> </before> <after> <actionGroup ref="DeleteCustomerByEmailActionGroup" stepKey="deleteCustomer"> diff --git a/app/code/Magento/Customer/Test/Mftf/Test/AdminCreateCustomerWithPrefixTest.xml b/app/code/Magento/Customer/Test/Mftf/Test/AdminCreateCustomerWithPrefixTest.xml index 6b2655b5deaaf..591cb2dd2845a 100644 --- a/app/code/Magento/Customer/Test/Mftf/Test/AdminCreateCustomerWithPrefixTest.xml +++ b/app/code/Magento/Customer/Test/Mftf/Test/AdminCreateCustomerWithPrefixTest.xml @@ -19,7 +19,7 @@ </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="loginToAdminPanel"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginToAdminPanel"/> </before> <after> <actionGroup ref="DeleteCustomerByEmailActionGroup" stepKey="deleteCustomer"> diff --git a/app/code/Magento/Customer/Test/Mftf/Test/AdminCreateCustomerWithoutAddressTest.xml b/app/code/Magento/Customer/Test/Mftf/Test/AdminCreateCustomerWithoutAddressTest.xml index 7889f2be57a4c..081695f7ebe1e 100644 --- a/app/code/Magento/Customer/Test/Mftf/Test/AdminCreateCustomerWithoutAddressTest.xml +++ b/app/code/Magento/Customer/Test/Mftf/Test/AdminCreateCustomerWithoutAddressTest.xml @@ -19,7 +19,7 @@ </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="loginToAdminPanel"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginToAdminPanel"/> </before> <after> <actionGroup ref="DeleteCustomerByEmailActionGroup" stepKey="deleteCustomer"> diff --git a/app/code/Magento/Customer/Test/Mftf/Test/AdminCreateNewCustomerOnStorefrontSignupNewsletterTest.xml b/app/code/Magento/Customer/Test/Mftf/Test/AdminCreateNewCustomerOnStorefrontSignupNewsletterTest.xml index 3810da9d62427..5440339e3a95e 100644 --- a/app/code/Magento/Customer/Test/Mftf/Test/AdminCreateNewCustomerOnStorefrontSignupNewsletterTest.xml +++ b/app/code/Magento/Customer/Test/Mftf/Test/AdminCreateNewCustomerOnStorefrontSignupNewsletterTest.xml @@ -20,7 +20,7 @@ </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> </before> <after> <actionGroup ref="DeleteCustomerByEmailActionGroup" stepKey="deleteNewUser"> diff --git a/app/code/Magento/Customer/Test/Mftf/Test/AdminCreateNewCustomerOnStorefrontTest.xml b/app/code/Magento/Customer/Test/Mftf/Test/AdminCreateNewCustomerOnStorefrontTest.xml index 116ba3773efff..8fe6e220c4aed 100644 --- a/app/code/Magento/Customer/Test/Mftf/Test/AdminCreateNewCustomerOnStorefrontTest.xml +++ b/app/code/Magento/Customer/Test/Mftf/Test/AdminCreateNewCustomerOnStorefrontTest.xml @@ -20,7 +20,7 @@ </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> </before> <after> <actionGroup ref="DeleteCustomerByEmailActionGroup" stepKey="deleteNewUser"> diff --git a/app/code/Magento/Customer/Test/Mftf/Test/AdminCreateNewCustomerTest.xml b/app/code/Magento/Customer/Test/Mftf/Test/AdminCreateNewCustomerTest.xml index 49d23c7787554..da25139ee8e60 100644 --- a/app/code/Magento/Customer/Test/Mftf/Test/AdminCreateNewCustomerTest.xml +++ b/app/code/Magento/Customer/Test/Mftf/Test/AdminCreateNewCustomerTest.xml @@ -19,7 +19,7 @@ </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="loginToAdminPanel"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginToAdminPanel"/> </before> <after> <actionGroup ref="DeleteCustomerByEmailActionGroup" stepKey="deleteCustomer"> diff --git a/app/code/Magento/Customer/Test/Mftf/Test/AdminCreateRetailCustomerGroupTest.xml b/app/code/Magento/Customer/Test/Mftf/Test/AdminCreateRetailCustomerGroupTest.xml index e0c1c0012f5bc..e8198cb79262e 100644 --- a/app/code/Magento/Customer/Test/Mftf/Test/AdminCreateRetailCustomerGroupTest.xml +++ b/app/code/Magento/Customer/Test/Mftf/Test/AdminCreateRetailCustomerGroupTest.xml @@ -20,7 +20,7 @@ <group value="mtf_migrated"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> </before> <after> <actionGroup ref="AdminDeleteCustomerGroupActionGroup" stepKey="deleteCustomerGroup"> diff --git a/app/code/Magento/Customer/Test/Mftf/Test/AdminCreateTaxClassCustomerGroupTest.xml b/app/code/Magento/Customer/Test/Mftf/Test/AdminCreateTaxClassCustomerGroupTest.xml index d89b755492cec..3416c64a7e9d7 100644 --- a/app/code/Magento/Customer/Test/Mftf/Test/AdminCreateTaxClassCustomerGroupTest.xml +++ b/app/code/Magento/Customer/Test/Mftf/Test/AdminCreateTaxClassCustomerGroupTest.xml @@ -25,7 +25,7 @@ <getData entity="customerTaxClass" stepKey="customerTaxClassData"> <requiredEntity createDataKey="createCustomerTaxClass"/> </getData> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> </before> <after> <actionGroup ref="AdminDeleteCustomerGroupActionGroup" stepKey="deleteCustomerGroup"> diff --git a/app/code/Magento/Customer/Test/Mftf/Test/AdminCustomerSubscribeNewsletterPerWebsiteTest.xml b/app/code/Magento/Customer/Test/Mftf/Test/AdminCustomerSubscribeNewsletterPerWebsiteTest.xml index 06c0593ad00c4..affcf6ddbe6ca 100644 --- a/app/code/Magento/Customer/Test/Mftf/Test/AdminCustomerSubscribeNewsletterPerWebsiteTest.xml +++ b/app/code/Magento/Customer/Test/Mftf/Test/AdminCustomerSubscribeNewsletterPerWebsiteTest.xml @@ -20,7 +20,7 @@ </annotations> <before> <createData entity="CustomerAccountSharingGlobal" stepKey="setConfigCustomerAccountToGlobal"/> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> </before> <after> <actionGroup ref="AdminDeleteStoreViewActionGroup" stepKey="deleteStoreView"> diff --git a/app/code/Magento/Customer/Test/Mftf/Test/AdminCustomersAllCustomersNavigateMenuTest.xml b/app/code/Magento/Customer/Test/Mftf/Test/AdminCustomersAllCustomersNavigateMenuTest.xml index d4551c0cd0af9..4850a6faf438a 100644 --- a/app/code/Magento/Customer/Test/Mftf/Test/AdminCustomersAllCustomersNavigateMenuTest.xml +++ b/app/code/Magento/Customer/Test/Mftf/Test/AdminCustomersAllCustomersNavigateMenuTest.xml @@ -20,7 +20,7 @@ <group value="mtf_migrated"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="LoginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="LoginAsAdmin"/> </before> <after> <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> diff --git a/app/code/Magento/Customer/Test/Mftf/Test/AdminCustomersCustomerGroupsNavigateMenuTest.xml b/app/code/Magento/Customer/Test/Mftf/Test/AdminCustomersCustomerGroupsNavigateMenuTest.xml index 7c1a0722ef912..bc0c3e00d75aa 100644 --- a/app/code/Magento/Customer/Test/Mftf/Test/AdminCustomersCustomerGroupsNavigateMenuTest.xml +++ b/app/code/Magento/Customer/Test/Mftf/Test/AdminCustomersCustomerGroupsNavigateMenuTest.xml @@ -20,7 +20,7 @@ <group value="mtf_migrated"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="LoginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="LoginAsAdmin"/> </before> <after> <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> diff --git a/app/code/Magento/Customer/Test/Mftf/Test/AdminCustomersDeleteSystemCustomerGroupTest.xml b/app/code/Magento/Customer/Test/Mftf/Test/AdminCustomersDeleteSystemCustomerGroupTest.xml new file mode 100644 index 0000000000000..124f086044f76 --- /dev/null +++ b/app/code/Magento/Customer/Test/Mftf/Test/AdminCustomersDeleteSystemCustomerGroupTest.xml @@ -0,0 +1,49 @@ +<?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="AdminCustomersDeleteSystemCustomerGroupTest"> + <annotations> + <features value="Customer"/> + <title value="System Customer Groups"/> + <description value="Admin should not be able to delete system customer groups"/> + <stories value="Delete System Customer Group" /> + <testCaseId value="MC-14588" /> + <group value="customers"/> + <group value="mtf_migrated"/> + </annotations> + <before> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> + </before> + <after> + <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> + </after> + + <!--Verify Not Logged In customer group--> + <!--Go to Customer Group grid page--> + <actionGroup ref="AdminOpenCustomerGroupsGridPageActionGroup" stepKey="openCustomerGroupGridPageToCheckNotLoggedInGroup"/> + <actionGroup ref="AdminFilterCustomerGroupByNameActionGroup" stepKey="filterCustomerGroupsByNotLoggedInGroup"> + <argument name="customerGroupName" value="{{NotLoggedInCustomerGroup.code}}"/> + </actionGroup> + <actionGroup ref="AdminOpenCustomerGroupEditPageFromGridActionGroup" stepKey="openNotLoggedInCustomerGroupEditPage"> + <argument name="groupCode" value="{{NotLoggedInCustomerGroup.code}}"/> + </actionGroup> + <actionGroup ref="AssertDeleteCustomerGroupButtonMissingActionGroup" stepKey="verifyThereIsNoDeleteButtonForNotLoggedInGroup"/> + + <!--Verify General customer group--> + <!--Go to Customer Group grid page--> + <actionGroup ref="AdminOpenCustomerGroupsGridPageActionGroup" stepKey="openCustomerGroupGridPageToCheckGeneralGroup"/> + <actionGroup ref="AdminFilterCustomerGroupByNameActionGroup" stepKey="filterCustomerGroupsByGeneralGroup"> + <argument name="customerGroupName" value="{{GeneralCustomerGroup.code}}"/> + </actionGroup> + <actionGroup ref="AdminOpenCustomerGroupEditPageFromGridActionGroup" stepKey="openGeneralCustomerGroupEditPage"> + <argument name="groupCode" value="{{GeneralCustomerGroup.code}}"/> + </actionGroup> + <actionGroup ref="AssertDeleteCustomerGroupButtonMissingActionGroup" stepKey="verifyThereIsNoDeleteButtonForGeneralGroup"/> + </test> +</tests> \ No newline at end of file diff --git a/app/code/Magento/Customer/Test/Mftf/Test/AdminCustomersNowOnlineNavigateMenuTest.xml b/app/code/Magento/Customer/Test/Mftf/Test/AdminCustomersNowOnlineNavigateMenuTest.xml index 828fc60f0b77f..8d5535a48f8a3 100644 --- a/app/code/Magento/Customer/Test/Mftf/Test/AdminCustomersNowOnlineNavigateMenuTest.xml +++ b/app/code/Magento/Customer/Test/Mftf/Test/AdminCustomersNowOnlineNavigateMenuTest.xml @@ -20,7 +20,7 @@ <group value="mtf_migrated"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="LoginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="LoginAsAdmin"/> </before> <after> <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> diff --git a/app/code/Magento/Customer/Test/Mftf/Test/AdminDeleteCustomerAddressesFromTheGridTest.xml b/app/code/Magento/Customer/Test/Mftf/Test/AdminDeleteCustomerAddressesFromTheGridTest.xml index b21f2a795bde7..8494a94f0c122 100644 --- a/app/code/Magento/Customer/Test/Mftf/Test/AdminDeleteCustomerAddressesFromTheGridTest.xml +++ b/app/code/Magento/Customer/Test/Mftf/Test/AdminDeleteCustomerAddressesFromTheGridTest.xml @@ -21,7 +21,7 @@ <before> <createData entity="Simple_US_Customer_Multiple_Addresses" stepKey="createCustomer"/> <magentoCLI command="indexer:reindex" stepKey="reindex"/> - <actionGroup ref="LoginAsAdmin" stepKey="login"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="login"/> </before> <after> <deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/> diff --git a/app/code/Magento/Customer/Test/Mftf/Test/AdminDeleteCustomerAddressesFromTheGridViaMassActionsTest.xml b/app/code/Magento/Customer/Test/Mftf/Test/AdminDeleteCustomerAddressesFromTheGridViaMassActionsTest.xml index 05926e7aefc92..340295df04da2 100644 --- a/app/code/Magento/Customer/Test/Mftf/Test/AdminDeleteCustomerAddressesFromTheGridViaMassActionsTest.xml +++ b/app/code/Magento/Customer/Test/Mftf/Test/AdminDeleteCustomerAddressesFromTheGridViaMassActionsTest.xml @@ -21,7 +21,7 @@ <before> <createData entity="Simple_US_Customer_Multiple_Addresses" stepKey="createCustomer"/> <magentoCLI command="indexer:reindex" stepKey="reindex"/> - <actionGroup ref="LoginAsAdmin" stepKey="login"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="login"/> </before> <after> <deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/> diff --git a/app/code/Magento/Customer/Test/Mftf/Test/AdminDeleteCustomerTest.xml b/app/code/Magento/Customer/Test/Mftf/Test/AdminDeleteCustomerTest.xml index 14a89df5eb0a5..03691eb7e7b72 100644 --- a/app/code/Magento/Customer/Test/Mftf/Test/AdminDeleteCustomerTest.xml +++ b/app/code/Magento/Customer/Test/Mftf/Test/AdminDeleteCustomerTest.xml @@ -22,7 +22,7 @@ <!-- Create Customer --> <createData entity="CustomerEntityOne" stepKey="createCustomer"/> <!-- Login as admin --> - <actionGroup ref="LoginAsAdmin" stepKey="login"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="login"/> </before> <after> <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> diff --git a/app/code/Magento/Customer/Test/Mftf/Test/AdminDeleteDefaultBillingCustomerAddressTest.xml b/app/code/Magento/Customer/Test/Mftf/Test/AdminDeleteDefaultBillingCustomerAddressTest.xml index 98a9414f29885..1630743da4922 100644 --- a/app/code/Magento/Customer/Test/Mftf/Test/AdminDeleteDefaultBillingCustomerAddressTest.xml +++ b/app/code/Magento/Customer/Test/Mftf/Test/AdminDeleteDefaultBillingCustomerAddressTest.xml @@ -21,7 +21,7 @@ <before> <createData entity="Simple_US_Customer_Multiple_Addresses" stepKey="createCustomer"/> <magentoCLI command="indexer:reindex" stepKey="reindex"/> - <actionGroup ref="LoginAsAdmin" stepKey="login"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="login"/> </before> <after> <deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/> diff --git a/app/code/Magento/Customer/Test/Mftf/Test/AdminEditDefaultBillingShippingCustomerAddressTest.xml b/app/code/Magento/Customer/Test/Mftf/Test/AdminEditDefaultBillingShippingCustomerAddressTest.xml index c998babacb575..6e44fe96b0d7b 100644 --- a/app/code/Magento/Customer/Test/Mftf/Test/AdminEditDefaultBillingShippingCustomerAddressTest.xml +++ b/app/code/Magento/Customer/Test/Mftf/Test/AdminEditDefaultBillingShippingCustomerAddressTest.xml @@ -19,7 +19,7 @@ </annotations> <before> <createData entity="Simple_US_Customer_Multiple_Addresses" stepKey="customer"/> - <actionGroup ref="LoginAsAdmin" stepKey="login"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="login"/> </before> <after> <deleteData createDataKey="customer" stepKey="deleteCustomer"/> diff --git a/app/code/Magento/Customer/Test/Mftf/Test/AdminExactMatchSearchInCustomerGridTest.xml b/app/code/Magento/Customer/Test/Mftf/Test/AdminExactMatchSearchInCustomerGridTest.xml index 1822f427ec389..ea4b3645d371f 100644 --- a/app/code/Magento/Customer/Test/Mftf/Test/AdminExactMatchSearchInCustomerGridTest.xml +++ b/app/code/Magento/Customer/Test/Mftf/Test/AdminExactMatchSearchInCustomerGridTest.xml @@ -23,7 +23,7 @@ <createData entity="Simple_US_Customer" stepKey="createSecondCustomer"> <field key="firstname">"Jane Doe"</field> </createData> - <actionGroup ref="LoginAsAdmin" stepKey="login"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="login"/> </before> <after> <deleteData createDataKey="createFirstCustomer" stepKey="deleteFirstCustomer"/> diff --git a/app/code/Magento/Customer/Test/Mftf/Test/AdminPanelIsFrozenIfStorefrontIsOpenedViaCustomerViewTest.xml b/app/code/Magento/Customer/Test/Mftf/Test/AdminPanelIsFrozenIfStorefrontIsOpenedViaCustomerViewTest.xml index 0eeab8cb36c2e..77422c6e8da3f 100644 --- a/app/code/Magento/Customer/Test/Mftf/Test/AdminPanelIsFrozenIfStorefrontIsOpenedViaCustomerViewTest.xml +++ b/app/code/Magento/Customer/Test/Mftf/Test/AdminPanelIsFrozenIfStorefrontIsOpenedViaCustomerViewTest.xml @@ -23,7 +23,7 @@ <createData entity="SimpleProduct" stepKey="createSimpleProduct"> <requiredEntity createDataKey="createSimpleCategory"/> </createData> - <actionGroup ref="LoginAsAdmin" stepKey="login"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="login"/> </before> <after> <deleteData createDataKey="createSimpleCategory" stepKey="deleteCategory"/> diff --git a/app/code/Magento/Customer/Test/Mftf/Test/AdminProductBackRedirectNavigateFromCustomerViewCartProductTest.xml b/app/code/Magento/Customer/Test/Mftf/Test/AdminProductBackRedirectNavigateFromCustomerViewCartProductTest.xml index 3e65c688e3474..4c4175bb32198 100644 --- a/app/code/Magento/Customer/Test/Mftf/Test/AdminProductBackRedirectNavigateFromCustomerViewCartProductTest.xml +++ b/app/code/Magento/Customer/Test/Mftf/Test/AdminProductBackRedirectNavigateFromCustomerViewCartProductTest.xml @@ -28,7 +28,7 @@ <createData entity="Simple_US_Customer" stepKey="createCustomer"/> <!-- Login as admin--> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> </before> <!-- Go to storefront as customer--> diff --git a/app/code/Magento/Customer/Test/Mftf/Test/AdminResetCustomerPasswordTest.xml b/app/code/Magento/Customer/Test/Mftf/Test/AdminResetCustomerPasswordTest.xml index afe8dbef99916..5721c46d5e4b9 100644 --- a/app/code/Magento/Customer/Test/Mftf/Test/AdminResetCustomerPasswordTest.xml +++ b/app/code/Magento/Customer/Test/Mftf/Test/AdminResetCustomerPasswordTest.xml @@ -19,7 +19,7 @@ </annotations> <before> <createData entity="Simple_US_Customer" stepKey="customer"/> - <actionGroup ref="LoginAsAdmin" stepKey="login"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="login"/> </before> <after> <deleteData createDataKey="customer" stepKey="deleteCustomer"/> diff --git a/app/code/Magento/Customer/Test/Mftf/Test/AdminSearchCustomerAddressByKeywordTest.xml b/app/code/Magento/Customer/Test/Mftf/Test/AdminSearchCustomerAddressByKeywordTest.xml index 6be675140c555..10da9284d45dc 100644 --- a/app/code/Magento/Customer/Test/Mftf/Test/AdminSearchCustomerAddressByKeywordTest.xml +++ b/app/code/Magento/Customer/Test/Mftf/Test/AdminSearchCustomerAddressByKeywordTest.xml @@ -21,7 +21,7 @@ <before> <createData entity="Simple_US_Customer_Multiple_Addresses" stepKey="createCustomer"/> <magentoCLI command="indexer:reindex" stepKey="reindex"/> - <actionGroup ref="LoginAsAdmin" stepKey="login"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="login"/> </before> <after> <deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/> diff --git a/app/code/Magento/Customer/Test/Mftf/Test/AdminSetCustomerDefaultBillingAddressTest.xml b/app/code/Magento/Customer/Test/Mftf/Test/AdminSetCustomerDefaultBillingAddressTest.xml index 96a614da0b379..5ce96a8dcab3c 100644 --- a/app/code/Magento/Customer/Test/Mftf/Test/AdminSetCustomerDefaultBillingAddressTest.xml +++ b/app/code/Magento/Customer/Test/Mftf/Test/AdminSetCustomerDefaultBillingAddressTest.xml @@ -19,7 +19,7 @@ </annotations> <before> <createData entity="Simple_US_Customer_Multiple_Addresses_No_Default_Address" stepKey="customer"/> - <actionGroup ref="LoginAsAdmin" stepKey="login"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="login"/> </before> <after> <deleteData createDataKey="customer" stepKey="deleteCustomer"/> diff --git a/app/code/Magento/Customer/Test/Mftf/Test/AdminSetCustomerDefaultShippingAddressTest.xml b/app/code/Magento/Customer/Test/Mftf/Test/AdminSetCustomerDefaultShippingAddressTest.xml index ae26519d9618e..a9832c86562f1 100644 --- a/app/code/Magento/Customer/Test/Mftf/Test/AdminSetCustomerDefaultShippingAddressTest.xml +++ b/app/code/Magento/Customer/Test/Mftf/Test/AdminSetCustomerDefaultShippingAddressTest.xml @@ -19,7 +19,7 @@ </annotations> <before> <createData entity="Simple_US_Customer_Multiple_Addresses_No_Default_Address" stepKey="customer"/> - <actionGroup ref="LoginAsAdmin" stepKey="login"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="login"/> </before> <after> <deleteData createDataKey="customer" stepKey="deleteCustomer"/> diff --git a/app/code/Magento/Customer/Test/Mftf/Test/AdminUpdateCustomerTest/AdminDeleteCustomerAddressTest.xml b/app/code/Magento/Customer/Test/Mftf/Test/AdminUpdateCustomerTest/AdminDeleteCustomerAddressTest.xml index b344458363999..c9805ebcc90ed 100644 --- a/app/code/Magento/Customer/Test/Mftf/Test/AdminUpdateCustomerTest/AdminDeleteCustomerAddressTest.xml +++ b/app/code/Magento/Customer/Test/Mftf/Test/AdminUpdateCustomerTest/AdminDeleteCustomerAddressTest.xml @@ -21,7 +21,7 @@ <before> <createData stepKey="customer" entity="Simple_US_Customer_Multiple_Addresses"/> <magentoCLI command="indexer:reindex" stepKey="reindex"/> - <actionGroup ref="LoginAsAdmin" stepKey="login"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="login"/> </before> <after> <deleteData stepKey="deleteCustomer" createDataKey="customer"/> diff --git a/app/code/Magento/Customer/Test/Mftf/Test/AdminUpdateCustomerTest/AdminUpdateCustomerInfoFromDefaultToNonDefaultTest.xml b/app/code/Magento/Customer/Test/Mftf/Test/AdminUpdateCustomerTest/AdminUpdateCustomerInfoFromDefaultToNonDefaultTest.xml index a6ccfda4939f9..0d550416167aa 100644 --- a/app/code/Magento/Customer/Test/Mftf/Test/AdminUpdateCustomerTest/AdminUpdateCustomerInfoFromDefaultToNonDefaultTest.xml +++ b/app/code/Magento/Customer/Test/Mftf/Test/AdminUpdateCustomerTest/AdminUpdateCustomerInfoFromDefaultToNonDefaultTest.xml @@ -21,7 +21,7 @@ <before> <createData stepKey="customer" entity="Simple_Customer_Without_Address"/> <magentoCLI command="indexer:reindex" stepKey="reindex"/> - <actionGroup ref="LoginAsAdmin" stepKey="login"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="login"/> </before> <after> <deleteData stepKey="deleteCustomer" createDataKey="customer"/> diff --git a/app/code/Magento/Customer/Test/Mftf/Test/AdminVerifyCreateCustomerRequiredFieldsTest.xml b/app/code/Magento/Customer/Test/Mftf/Test/AdminVerifyCreateCustomerRequiredFieldsTest.xml index 72661e4505322..72064617ef33b 100644 --- a/app/code/Magento/Customer/Test/Mftf/Test/AdminVerifyCreateCustomerRequiredFieldsTest.xml +++ b/app/code/Magento/Customer/Test/Mftf/Test/AdminVerifyCreateCustomerRequiredFieldsTest.xml @@ -19,7 +19,7 @@ </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="loginToAdminPanel"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginToAdminPanel"/> </before> <after> <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> diff --git a/app/code/Magento/Customer/Test/Mftf/Test/AdminVerifyCustomerAddressRequiredFieldsTest.xml b/app/code/Magento/Customer/Test/Mftf/Test/AdminVerifyCustomerAddressRequiredFieldsTest.xml index 41efec9d87b18..d78d676a822d9 100644 --- a/app/code/Magento/Customer/Test/Mftf/Test/AdminVerifyCustomerAddressRequiredFieldsTest.xml +++ b/app/code/Magento/Customer/Test/Mftf/Test/AdminVerifyCustomerAddressRequiredFieldsTest.xml @@ -20,7 +20,7 @@ <before> <createData entity="Simple_Customer_Without_Address" stepKey="createCustomer"/> - <actionGroup ref="LoginAsAdmin" stepKey="loginToAdminPanel"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginToAdminPanel"/> </before> <after> <deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/> diff --git a/app/code/Magento/Customer/Test/Mftf/Test/AdminVerifyCustomerAddressStateContainValuesOnceTest.xml b/app/code/Magento/Customer/Test/Mftf/Test/AdminVerifyCustomerAddressStateContainValuesOnceTest.xml index e9b0e1723c6ba..2aa85f8c966a9 100644 --- a/app/code/Magento/Customer/Test/Mftf/Test/AdminVerifyCustomerAddressStateContainValuesOnceTest.xml +++ b/app/code/Magento/Customer/Test/Mftf/Test/AdminVerifyCustomerAddressStateContainValuesOnceTest.xml @@ -21,7 +21,7 @@ </annotations> <before> <createData entity="Simple_US_Customer_Multiple_Addresses" stepKey="firstCustomer"/> - <actionGroup ref="LoginAsAdmin" stepKey="login"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="login"/> </before> <after> <deleteData createDataKey="firstCustomer" stepKey="deleteFirstCustomer"/> diff --git a/app/code/Magento/Customer/Test/Mftf/Test/ChangeCustomerGroupTest/ChangingSingleCustomerGroupViaGridTest.xml b/app/code/Magento/Customer/Test/Mftf/Test/ChangeCustomerGroupTest/ChangingSingleCustomerGroupViaGridTest.xml index ce6ba7ce05e16..0edadb86888f5 100644 --- a/app/code/Magento/Customer/Test/Mftf/Test/ChangeCustomerGroupTest/ChangingSingleCustomerGroupViaGridTest.xml +++ b/app/code/Magento/Customer/Test/Mftf/Test/ChangeCustomerGroupTest/ChangingSingleCustomerGroupViaGridTest.xml @@ -24,7 +24,7 @@ <before> <createData entity="Simple_US_Customer" stepKey="createCustomer"/> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> </before> <after> <!--Delete created product--> diff --git a/app/code/Magento/Customer/Test/Mftf/Test/DeleteCustomerGroupTest.xml b/app/code/Magento/Customer/Test/Mftf/Test/DeleteCustomerGroupTest.xml index b03478c5be684..e32ae04495fe5 100644 --- a/app/code/Magento/Customer/Test/Mftf/Test/DeleteCustomerGroupTest.xml +++ b/app/code/Magento/Customer/Test/Mftf/Test/DeleteCustomerGroupTest.xml @@ -25,7 +25,7 @@ <createData entity="UsCustomerAssignedToNewCustomerGroup" stepKey="customer"> <requiredEntity createDataKey="customerGroup"/> </createData> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> </before> <after> <deleteData createDataKey="customer" stepKey="deleteCustomer"/> diff --git a/app/code/Magento/Customer/Test/Mftf/Test/EndToEndB2CLoggedInUserTest.xml b/app/code/Magento/Customer/Test/Mftf/Test/EndToEndB2CLoggedInUserTest.xml index 501baca64318f..86218647778e6 100644 --- a/app/code/Magento/Customer/Test/Mftf/Test/EndToEndB2CLoggedInUserTest.xml +++ b/app/code/Magento/Customer/Test/Mftf/Test/EndToEndB2CLoggedInUserTest.xml @@ -24,10 +24,10 @@ </before> <after> <actionGroup ref="StorefrontCustomerLogoutActionGroup" stepKey="logoutCustomer"/> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <actionGroup ref="DeleteCustomerFromAdminActionGroup" stepKey="deleteCustomerFromAdmin"/> <actionGroup ref="ClearFiltersAdminDataGridActionGroup" stepKey="clearProductsGridFilters"/> - <actionGroup ref="logout" stepKey="adminLogout"/> + <actionGroup ref="AdminLogoutActionGroup" stepKey="adminLogout"/> </after> <!-- Step 0: User signs up an account --> <comment userInput="Start of signing up user account" stepKey="startOfSigningUpUserAccount" /> diff --git a/app/code/Magento/Customer/Test/Mftf/Test/SearchByEmailInCustomerGridTest.xml b/app/code/Magento/Customer/Test/Mftf/Test/SearchByEmailInCustomerGridTest.xml index 0d9f17096b26e..d4351c8bcdc84 100644 --- a/app/code/Magento/Customer/Test/Mftf/Test/SearchByEmailInCustomerGridTest.xml +++ b/app/code/Magento/Customer/Test/Mftf/Test/SearchByEmailInCustomerGridTest.xml @@ -21,7 +21,7 @@ <before> <createData entity="Simple_US_Customer" stepKey="createFirstCustomer"/> <createData entity="Simple_US_Customer" stepKey="createSecondCustomer"/> - <actionGroup ref="LoginAsAdmin" stepKey="login"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="login"/> </before> <after> <deleteData createDataKey="createFirstCustomer" stepKey="deleteFirstCustomer"/> diff --git a/app/code/Magento/Customer/Test/Mftf/Test/StorefrontCheckTaxAddingValidVATIdTest.xml b/app/code/Magento/Customer/Test/Mftf/Test/StorefrontCheckTaxAddingValidVATIdTest.xml index d154893f70588..9b4e7716f4a25 100644 --- a/app/code/Magento/Customer/Test/Mftf/Test/StorefrontCheckTaxAddingValidVATIdTest.xml +++ b/app/code/Magento/Customer/Test/Mftf/Test/StorefrontCheckTaxAddingValidVATIdTest.xml @@ -20,7 +20,7 @@ </annotations> <before> <!--Log In--> - <actionGroup ref="LoginAsAdmin" stepKey="logIn"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="logIn"/> <!--Create category--> <createData entity="_defaultCategory" stepKey="createCategory"/> <!--Create product--> diff --git a/app/code/Magento/Customer/Test/Mftf/Test/StorefrontClearAllCompareProductsTest.xml b/app/code/Magento/Customer/Test/Mftf/Test/StorefrontClearAllCompareProductsTest.xml index 6c6ce5c8619e8..317f2c2825ca7 100644 --- a/app/code/Magento/Customer/Test/Mftf/Test/StorefrontClearAllCompareProductsTest.xml +++ b/app/code/Magento/Customer/Test/Mftf/Test/StorefrontClearAllCompareProductsTest.xml @@ -106,7 +106,7 @@ <magentoCLI command="cache:flush" stepKey="flushCache"/> <!-- Login --> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin1"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin1"/> </before> <after> <magentoCLI stepKey="removeDownloadableDomain" command="downloadable:domains:remove static.magento.com"/> diff --git a/app/code/Magento/Customer/Test/Mftf/Test/StorefrontCreateCustomerWithDateOfBirthTest.xml b/app/code/Magento/Customer/Test/Mftf/Test/StorefrontCreateCustomerWithDateOfBirthTest.xml new file mode 100644 index 0000000000000..8cd35f4147636 --- /dev/null +++ b/app/code/Magento/Customer/Test/Mftf/Test/StorefrontCreateCustomerWithDateOfBirthTest.xml @@ -0,0 +1,43 @@ +<?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="StorefrontCreateCustomerWithDateOfBirthTest"> + <annotations> + <features value="Customer"/> + <stories value="Create a Customer via the Storefront"/> + <title value="Customer should be able to create an account with date of birth via the storefront"/> + <description value="Customer should be able to create an account with date of birth via the storefront"/> + <severity value="CRITICAL"/> + <testCaseId value="MC-32413"/> + <group value="customer"/> + <group value="create"/> + </annotations> + <before> + <actionGroup ref="AdminLoginActionGroup" stepKey="login"/> + <actionGroup ref="AdminCustomerShowDateOfBirthActionGroup" stepKey="showDateOfBirth"> + <argument name="value" value="{{ShowDateOfBirth.required}}"/> + </actionGroup> + </before> + <after> + <actionGroup ref="AdminCustomerShowDateOfBirthActionGroup" stepKey="hideDateOfBirth"> + <argument name="value" value="{{ShowDateOfBirth.no}}"/> + </actionGroup> + <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> + </after> + <actionGroup ref="StorefrontCustomerCreateAccountWithDateOfBirthActionGroup" stepKey="SignUpNewUser"> + <argument name="Customer" value="CustomerEntityOne"/> + <argument name="dob" value="{{EN_US_DATE.short4DigitYear}}"/> + </actionGroup> + <magentoCLI command="indexer:reindex" stepKey="reindex"/> + <actionGroup ref="DeleteCustomerByEmailActionGroup" stepKey="deleteNewUser"> + <argument name="email" value="{{CustomerEntityOne.email}}"/> + </actionGroup> + </test> +</tests> diff --git a/app/code/Magento/Customer/Test/Unit/Block/Widget/DobTest.php b/app/code/Magento/Customer/Test/Unit/Block/Widget/DobTest.php index 1fd7fc340e542..59660ec345814 100644 --- a/app/code/Magento/Customer/Test/Unit/Block/Widget/DobTest.php +++ b/app/code/Magento/Customer/Test/Unit/Block/Widget/DobTest.php @@ -29,6 +29,7 @@ /** * @SuppressWarnings(PHPMD.CouplingBetweenObjects) + * @SuppressWarnings(PHPMD.TooManyPublicMethods) */ class DobTest extends TestCase { @@ -542,18 +543,30 @@ public function testGetMaxDateRangeWithException() */ public function testGetHtmlExtraParamsWithoutRequiredOption() { + $validation = json_encode( + [ + 'validate-date' => [ + 'dateFormat' => self::DATE_FORMAT + ], + 'validate-dob' => [ + 'dateFormat' => self::DATE_FORMAT + ], + ] + ); $this->escaper->expects($this->any()) ->method('escapeHtml') - ->with('{"validate-date":{"dateFormat":"M\/d\/Y"},"validate-dob":true}') - ->will($this->returnValue('{"validate-date":{"dateFormat":"M\/d\/Y"},"validate-dob":true}')); + ->with($validation) + ->will( + $this->returnValue($validation) + ); $this->attribute->expects($this->once()) ->method("isRequired") ->willReturn(false); $this->assertEquals( - $this->_block->getHtmlExtraParams(), - 'data-validate="{"validate-date":{"dateFormat":"M\/d\/Y"},"validate-dob":true}"' + "data-validate=\"$validation\"", + $this->_block->getHtmlExtraParams() ); } @@ -562,22 +575,31 @@ public function testGetHtmlExtraParamsWithoutRequiredOption() */ public function testGetHtmlExtraParamsWithRequiredOption() { + $validation = json_encode( + [ + 'required' => true, + 'validate-date' => [ + 'dateFormat' => self::DATE_FORMAT + ], + 'validate-dob' => [ + 'dateFormat' => self::DATE_FORMAT + ], + ] + ); $this->attribute->expects($this->once()) ->method("isRequired") ->willReturn(true); $this->escaper->expects($this->any()) ->method('escapeHtml') - ->with('{"required":true,"validate-date":{"dateFormat":"M\/d\/Y"},"validate-dob":true}') + ->with($validation) ->will( - $this->returnValue( - '{"required":true,"validate-date":{"dateFormat":"M\/d\/Y"},"validate-dob":true}' - ) + $this->returnValue($validation) ); $this->context->expects($this->any())->method('getEscaper')->will($this->returnValue($this->escaper)); $this->assertEquals( - 'data-validate="{"required":true,"validate-date":{"dateFormat":"M\/d\/Y"},"validate-dob":true}"', + "data-validate=\"$validation\"", $this->_block->getHtmlExtraParams() ); } diff --git a/app/code/Magento/Customer/Test/Unit/ViewModel/Customer/WebsiteTest.php b/app/code/Magento/Customer/Test/Unit/ViewModel/Customer/WebsiteTest.php new file mode 100644 index 0000000000000..50862fa36f0f9 --- /dev/null +++ b/app/code/Magento/Customer/Test/Unit/ViewModel/Customer/WebsiteTest.php @@ -0,0 +1,105 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +declare(strict_types=1); + +namespace Magento\Customer\Test\Unit\ViewModel\Customer; + +use Magento\Framework\App\Config\ScopeConfigInterface; +use PHPUnit\Framework\TestCase; +use Magento\Framework\TestFramework\Unit\Helper\ObjectManager as ObjectManagerHelper; +use Magento\Customer\ViewModel\Customer\Website as CustomerWebsite; +use Magento\Store\Model\System\Store as SystemStore; + +/** + * Test for customer's website view model + */ +class WebsiteTest extends TestCase +{ + /** @var ObjectManagerHelper */ + private $objectManagerHelper; + + /** + * @var CustomerWebsite + */ + private $customerWebsite; + + /** + * @var SystemStore + */ + private $systemStore; + + /** + * @var ScopeConfigInterface + */ + private $scopeConfig; + + protected function setUp() + { + $this->systemStore = $this->createMock(SystemStore::class); + $this->scopeConfig = $this->createMock(ScopeConfigInterface::class); + $this->objectManagerHelper = new ObjectManagerHelper($this); + $this->customerWebsite = $this->objectManagerHelper->getObject( + CustomerWebsite::class, + [ + 'systemStore' => $this->systemStore, + 'scopeConfig' => $this->scopeConfig + ] + ); + } + + /** + * Test that method return correct array of options + * + * @param array $options + * @dataProvider dataProviderOptionsArray + * @return void + */ + public function testToOptionArray(array $options): void + { + $this->scopeConfig->method('getValue') + ->willReturn(1); + + $this->systemStore->method('getWebsiteValuesForForm') + ->willReturn([ + [ + 'label' => 'Main Website', + 'value' => '1', + ], + [ + 'label' => 'Second Website', + 'value' => '2', + ], + ]); + + $this->assertEquals($options, $this->customerWebsite->toOptionArray()); + } + + /** + * Data provider for testToOptionArray test + * + * @return array + */ + public function dataProviderOptionsArray(): array + { + return [ + [ + 'options' => [ + [ + 'label' => 'Main Website', + 'value' => '1', + 'group_id' => '1', + ], + [ + 'label' => 'Second Website', + 'value' => '2', + 'group_id' => '1', + ], + ], + ], + ]; + } +} diff --git a/app/code/Magento/Customer/ViewModel/Customer/Website.php b/app/code/Magento/Customer/ViewModel/Customer/Website.php new file mode 100644 index 0000000000000..bb25f4766aa77 --- /dev/null +++ b/app/code/Magento/Customer/ViewModel/Customer/Website.php @@ -0,0 +1,74 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +declare(strict_types=1); + +namespace Magento\Customer\ViewModel\Customer; + +use Magento\Customer\Model\GroupManagement; +use Magento\Framework\App\Config\ScopeConfigInterface; +use Magento\Framework\Data\OptionSourceInterface; +use Magento\Store\Model\ScopeInterface; +use Magento\Store\Model\System\Store as SystemStore; + +/** + * Customer's website view model + */ +class Website implements OptionSourceInterface +{ + /** + * @var SystemStore + */ + private $systemStore; + + /** + * @var ScopeConfigInterface + */ + private $scopeConfig; + + /** + * Store constructor. + * + * @param SystemStore $systemStore + * @param ScopeConfigInterface $scopeConfig + */ + public function __construct( + SystemStore $systemStore, + ScopeConfigInterface $scopeConfig + ) { + $this->systemStore = $systemStore; + $this->scopeConfig = $scopeConfig; + } + + /** + * @inheritdoc + */ + public function toOptionArray(): array + { + return $this->getWebsiteOptions(); + } + + /** + * Adding group ID to options list + * + * @return array + */ + private function getWebsiteOptions(): array + { + $options = $this->systemStore->getWebsiteValuesForForm(); + foreach ($options as $key => $option) { + $websiteId = $option['value']; + $groupId = $this->scopeConfig->getValue( + GroupManagement::XML_PATH_DEFAULT_ID, + ScopeInterface::SCOPE_WEBSITE, + $websiteId + ); + $options[$key]['group_id'] = $groupId; + } + + return $options; + } +} diff --git a/app/code/Magento/Customer/view/adminhtml/web/js/form/element/website.js b/app/code/Magento/Customer/view/adminhtml/web/js/form/element/website.js new file mode 100644 index 0000000000000..7c2f6489a51d3 --- /dev/null +++ b/app/code/Magento/Customer/view/adminhtml/web/js/form/element/website.js @@ -0,0 +1,30 @@ +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +define([ + 'Magento_Ui/js/form/element/website', + 'uiRegistry' +], function (Website, registry) { + 'use strict'; + + return Website.extend({ + /** + * On value change handler. + * + * @param {String} value + */ + onUpdate: function (value) { + var groupIdFieldKey = 'group_id', + groupId = registry.get('index = ' + groupIdFieldKey), + option = this.getOption(value); + + if (groupId) { + groupId.value(option[groupIdFieldKey]); + } + + return this._super(); + } + }); +}); diff --git a/app/code/Magento/Customer/view/base/ui_component/customer_form.xml b/app/code/Magento/Customer/view/base/ui_component/customer_form.xml index d5c7154a30f54..b9487037da2cc 100644 --- a/app/code/Magento/Customer/view/base/ui_component/customer_form.xml +++ b/app/code/Magento/Customer/view/base/ui_component/customer_form.xml @@ -117,7 +117,7 @@ <visible>false</visible> </settings> </field> - <field name="website_id" component="Magento_Ui/js/form/element/website" formElement="select"> + <field name="website_id" component="Magento_Customer/js/form/element/website" formElement="select"> <argument name="data" xsi:type="array"> <item name="config" xsi:type="array"> <item name="source" xsi:type="string">customer</item> @@ -136,6 +136,13 @@ <link name="customerId">${ $.provider }:data.customer.entity_id</link> </imports> </settings> + <formElements> + <select> + <settings> + <options class="Magento\Customer\ViewModel\Customer\Website"/> + </settings> + </select> + </formElements> </field> <field name="prefix" formElement="input"> <argument name="data" xsi:type="array"> diff --git a/app/code/Magento/Customer/view/frontend/web/js/validation.js b/app/code/Magento/Customer/view/frontend/web/js/validation.js index 573556f0f33a2..1f7f24d5ac031 100644 --- a/app/code/Magento/Customer/view/frontend/web/js/validation.js +++ b/app/code/Magento/Customer/view/frontend/web/js/validation.js @@ -1,20 +1,23 @@ define([ 'jquery', 'moment', + 'mageUtils', 'jquery/validate', 'validation', 'mage/translate' -], function ($, moment) { +], function ($, moment, utils) { 'use strict'; $.validator.addMethod( 'validate-dob', - function (value) { + function (value, element, params) { + var dateFormat = utils.convertToMomentFormat(params.dateFormat); + if (value === '') { return true; } - return moment(value).isBefore(moment()); + return moment(value, dateFormat).isBefore(moment()); }, $.mage.__('The Date of Birth should not be greater than today.') ); diff --git a/app/code/Magento/Directory/Test/Mftf/Test/AdminScheduledImportSettingsHiddenTest.xml b/app/code/Magento/Directory/Test/Mftf/Test/AdminScheduledImportSettingsHiddenTest.xml index 51fd2facab3b0..5f3504fe0921e 100644 --- a/app/code/Magento/Directory/Test/Mftf/Test/AdminScheduledImportSettingsHiddenTest.xml +++ b/app/code/Magento/Directory/Test/Mftf/Test/AdminScheduledImportSettingsHiddenTest.xml @@ -16,7 +16,7 @@ <severity value="MINOR"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <magentoCLI command="config:set currency/import/enabled 1" stepKey="enableCurrencyImport"/> </before> diff --git a/app/code/Magento/Downloadable/Test/Mftf/Test/AdminAddDefaultImageDownloadableProductTest.xml b/app/code/Magento/Downloadable/Test/Mftf/Test/AdminAddDefaultImageDownloadableProductTest.xml index e5633707824dd..c634a8426eac0 100644 --- a/app/code/Magento/Downloadable/Test/Mftf/Test/AdminAddDefaultImageDownloadableProductTest.xml +++ b/app/code/Magento/Downloadable/Test/Mftf/Test/AdminAddDefaultImageDownloadableProductTest.xml @@ -20,7 +20,7 @@ </annotations> <before> <magentoCLI stepKey="addDownloadableDomain" command="downloadable:domains:add static.magento.com"/> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> </before> <after> <actionGroup ref="DeleteProductUsingProductGridActionGroup" stepKey="deleteProduct"> diff --git a/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateAndEditDownloadableProductSettingsTest.xml b/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateAndEditDownloadableProductSettingsTest.xml index 8a0c6d478ecfc..650cfd5ba8198 100644 --- a/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateAndEditDownloadableProductSettingsTest.xml +++ b/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateAndEditDownloadableProductSettingsTest.xml @@ -20,7 +20,7 @@ </annotations> <before> <!-- Login as admin --> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> </before> <after> <!-- Delete created downloadable product --> diff --git a/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateDownloadableProductAndAssignItToCustomStoreTest.xml b/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateDownloadableProductAndAssignItToCustomStoreTest.xml index 9a1f1273a41fd..c4d1f57e10aea 100644 --- a/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateDownloadableProductAndAssignItToCustomStoreTest.xml +++ b/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateDownloadableProductAndAssignItToCustomStoreTest.xml @@ -25,7 +25,7 @@ <createData entity="SimpleSubCategory" stepKey="createCategory"/> <!-- Login as admin --> - <actionGroup ref="LoginAsAdmin" stepKey="LoginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="LoginAsAdmin"/> </before> <after> <magentoCLI stepKey="removeDownloadableDomain" command="downloadable:domains:remove static.magento.com"/> diff --git a/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateDownloadableProductWithCustomOptionsTest.xml b/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateDownloadableProductWithCustomOptionsTest.xml index 8e08ae813faed..f1ea344d4e45c 100644 --- a/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateDownloadableProductWithCustomOptionsTest.xml +++ b/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateDownloadableProductWithCustomOptionsTest.xml @@ -25,7 +25,7 @@ <createData entity="SimpleSubCategory" stepKey="createCategory"/> <!-- Login as admin --> - <actionGroup ref="LoginAsAdmin" stepKey="LoginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="LoginAsAdmin"/> </before> <after> <magentoCLI stepKey="removeDownloadableDomain" command="downloadable:domains:remove static.magento.com"/> diff --git a/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateDownloadableProductWithDefaultSetLinksTest.xml b/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateDownloadableProductWithDefaultSetLinksTest.xml index 865f392f7c841..850a73cd354a5 100644 --- a/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateDownloadableProductWithDefaultSetLinksTest.xml +++ b/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateDownloadableProductWithDefaultSetLinksTest.xml @@ -27,7 +27,7 @@ <magentoCLI command="indexer:reindex" stepKey="reindex"/> <magentoCLI command="cache:flush" arguments="full_page" stepKey="flushCache"/> <!-- Login as admin --> - <actionGroup ref="LoginAsAdmin" stepKey="LoginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="LoginAsAdmin"/> </before> <after> <magentoCLI stepKey="removeDownloadableDomain" command="downloadable:domains:remove static.magento.com"/> diff --git a/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateDownloadableProductWithGroupPriceTest.xml b/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateDownloadableProductWithGroupPriceTest.xml index 7fcb70b169ab7..ba2e5e89005cf 100644 --- a/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateDownloadableProductWithGroupPriceTest.xml +++ b/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateDownloadableProductWithGroupPriceTest.xml @@ -25,7 +25,7 @@ <createData entity="SimpleSubCategory" stepKey="createCategory"/> <!-- Login as admin --> - <actionGroup ref="LoginAsAdmin" stepKey="LoginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="LoginAsAdmin"/> </before> <after> <magentoCLI stepKey="removeDownloadableDomain" command="downloadable:domains:remove static.magento.com"/> diff --git a/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateDownloadableProductWithLinkTest.xml b/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateDownloadableProductWithLinkTest.xml index 6ec42335e60e3..9ae046210181b 100644 --- a/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateDownloadableProductWithLinkTest.xml +++ b/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateDownloadableProductWithLinkTest.xml @@ -25,7 +25,7 @@ <createData entity="SimpleSubCategory" stepKey="createCategory"/> <!-- Login as admin --> - <actionGroup ref="LoginAsAdmin" stepKey="LoginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="LoginAsAdmin"/> </before> <after> <magentoCLI stepKey="removeDownloadableDomain" command="downloadable:domains:remove static.magento.com"/> diff --git a/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateDownloadableProductWithManageStockTest.xml b/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateDownloadableProductWithManageStockTest.xml index e9a6efc49b635..0ff7c9bab26ca 100644 --- a/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateDownloadableProductWithManageStockTest.xml +++ b/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateDownloadableProductWithManageStockTest.xml @@ -25,7 +25,7 @@ <createData entity="SimpleSubCategory" stepKey="createCategory"/> <!-- Login as admin --> - <actionGroup ref="LoginAsAdmin" stepKey="LoginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="LoginAsAdmin"/> </before> <after> <magentoCLI stepKey="removeDownloadableDomain" command="downloadable:domains:remove static.magento.com"/> diff --git a/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateDownloadableProductWithOutOfStockStatusTest.xml b/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateDownloadableProductWithOutOfStockStatusTest.xml index 16d88c16073cb..5615c66762c52 100644 --- a/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateDownloadableProductWithOutOfStockStatusTest.xml +++ b/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateDownloadableProductWithOutOfStockStatusTest.xml @@ -25,7 +25,7 @@ <createData entity="SimpleSubCategory" stepKey="createCategory"/> <!-- Login as admin --> - <actionGroup ref="LoginAsAdmin" stepKey="LoginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="LoginAsAdmin"/> </before> <after> <magentoCLI stepKey="removeDownloadableDomain" command="downloadable:domains:remove static.magento.com"/> diff --git a/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateDownloadableProductWithSpecialPriceTest.xml b/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateDownloadableProductWithSpecialPriceTest.xml index 307eb43273dbd..f1d00d83b6666 100644 --- a/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateDownloadableProductWithSpecialPriceTest.xml +++ b/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateDownloadableProductWithSpecialPriceTest.xml @@ -25,7 +25,7 @@ <createData entity="SimpleSubCategory" stepKey="createCategory"/> <!-- Login as admin --> - <actionGroup ref="LoginAsAdmin" stepKey="LoginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="LoginAsAdmin"/> </before> <after> <magentoCLI stepKey="removeDownloadableDomain" command="downloadable:domains:remove static.magento.com"/> diff --git a/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateDownloadableProductWithoutFillingQuantityAndStockTest.xml b/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateDownloadableProductWithoutFillingQuantityAndStockTest.xml index 092129dc1ba1e..fb0532d9d1fbe 100644 --- a/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateDownloadableProductWithoutFillingQuantityAndStockTest.xml +++ b/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateDownloadableProductWithoutFillingQuantityAndStockTest.xml @@ -25,7 +25,7 @@ <createData entity="SimpleSubCategory" stepKey="createCategory"/> <!-- Login as admin --> - <actionGroup ref="LoginAsAdmin" stepKey="LoginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="LoginAsAdmin"/> </before> <after> <magentoCLI stepKey="removeDownloadableDomain" command="downloadable:domains:remove static.magento.com"/> diff --git a/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateDownloadableProductWithoutTaxClassIdTest.xml b/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateDownloadableProductWithoutTaxClassIdTest.xml index 63796a197e586..50a2215d441ad 100644 --- a/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateDownloadableProductWithoutTaxClassIdTest.xml +++ b/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateDownloadableProductWithoutTaxClassIdTest.xml @@ -25,7 +25,7 @@ <createData entity="SimpleSubCategory" stepKey="createCategory"/> <!-- Login as admin --> - <actionGroup ref="LoginAsAdmin" stepKey="LoginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="LoginAsAdmin"/> </before> <after> <magentoCLI stepKey="removeDownloadableDomain" command="downloadable:domains:remove static.magento.com"/> diff --git a/app/code/Magento/Downloadable/Test/Mftf/Test/AdminDeleteDownloadableProductTest.xml b/app/code/Magento/Downloadable/Test/Mftf/Test/AdminDeleteDownloadableProductTest.xml index 3d01168613ecc..7062b15aeedbf 100644 --- a/app/code/Magento/Downloadable/Test/Mftf/Test/AdminDeleteDownloadableProductTest.xml +++ b/app/code/Magento/Downloadable/Test/Mftf/Test/AdminDeleteDownloadableProductTest.xml @@ -19,7 +19,7 @@ </annotations> <before> <magentoCLI stepKey="addDownloadableDomain" command="downloadable:domains:add example.com static.magento.com"/> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <createData entity="_defaultCategory" stepKey="createCategory"/> <createData entity="DownloadableProductWithTwoLink" stepKey="createDownloadableProduct"> <requiredEntity createDataKey="createCategory"/> diff --git a/app/code/Magento/Downloadable/Test/Mftf/Test/AdminProductTypeSwitchingOnEditingTest/AdminSimpleProductTypeSwitchingToDownloadableProductTest.xml b/app/code/Magento/Downloadable/Test/Mftf/Test/AdminProductTypeSwitchingOnEditingTest/AdminSimpleProductTypeSwitchingToDownloadableProductTest.xml index a9ceb5e057c3f..aa94de681de1d 100644 --- a/app/code/Magento/Downloadable/Test/Mftf/Test/AdminProductTypeSwitchingOnEditingTest/AdminSimpleProductTypeSwitchingToDownloadableProductTest.xml +++ b/app/code/Magento/Downloadable/Test/Mftf/Test/AdminProductTypeSwitchingOnEditingTest/AdminSimpleProductTypeSwitchingToDownloadableProductTest.xml @@ -21,7 +21,7 @@ <before> <!-- Add downloadable domains --> <magentoCLI stepKey="addDownloadableDomain" command="downloadable:domains:add example.com static.magento.com"/> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <!--Create product--> <comment userInput="Create product" stepKey="commentCreateProduct"/> <createData entity="SimpleProduct2" stepKey="createProduct"/> diff --git a/app/code/Magento/Downloadable/Test/Mftf/Test/AdminRemoveDefaultImageDownloadableProductTest.xml b/app/code/Magento/Downloadable/Test/Mftf/Test/AdminRemoveDefaultImageDownloadableProductTest.xml index e4a3be9494268..27d3d3d10a0b7 100644 --- a/app/code/Magento/Downloadable/Test/Mftf/Test/AdminRemoveDefaultImageDownloadableProductTest.xml +++ b/app/code/Magento/Downloadable/Test/Mftf/Test/AdminRemoveDefaultImageDownloadableProductTest.xml @@ -20,7 +20,7 @@ </annotations> <before> <magentoCLI stepKey="addDownloadableDomain" command="downloadable:domains:add static.magento.com"/> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> </before> <after> <magentoCLI stepKey="removeDownloadableDomain" command="downloadable:domains:remove static.magento.com"/> diff --git a/app/code/Magento/Downloadable/Test/Mftf/Test/EditDownloadableProductWithSeparateLinksFromCartTest.xml b/app/code/Magento/Downloadable/Test/Mftf/Test/EditDownloadableProductWithSeparateLinksFromCartTest.xml index 3d9229a4b0854..30e31be6c8ec4 100644 --- a/app/code/Magento/Downloadable/Test/Mftf/Test/EditDownloadableProductWithSeparateLinksFromCartTest.xml +++ b/app/code/Magento/Downloadable/Test/Mftf/Test/EditDownloadableProductWithSeparateLinksFromCartTest.xml @@ -25,7 +25,7 @@ <createData entity="SimpleSubCategory" stepKey="createCategory"/> <!-- Login as admin --> - <actionGroup ref="LoginAsAdmin" stepKey="LoginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="LoginAsAdmin"/> <!-- Create downloadable product --> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="amOnProductGridPage"/> diff --git a/app/code/Magento/Downloadable/Test/Mftf/Test/ManualSelectAllDownloadableLinksDownloadableProductTest.xml b/app/code/Magento/Downloadable/Test/Mftf/Test/ManualSelectAllDownloadableLinksDownloadableProductTest.xml index 7eea3926f450c..4a7f1dde227da 100644 --- a/app/code/Magento/Downloadable/Test/Mftf/Test/ManualSelectAllDownloadableLinksDownloadableProductTest.xml +++ b/app/code/Magento/Downloadable/Test/Mftf/Test/ManualSelectAllDownloadableLinksDownloadableProductTest.xml @@ -25,7 +25,7 @@ <createData entity="SimpleSubCategory" stepKey="createCategory"/> <!-- Login as admin --> - <actionGroup ref="LoginAsAdmin" stepKey="LoginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="LoginAsAdmin"/> <!-- Create downloadable product --> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="amOnProductGridPage"/> diff --git a/app/code/Magento/Downloadable/Test/Mftf/Test/SelectAllDownloadableLinksDownloadableProductTest.xml b/app/code/Magento/Downloadable/Test/Mftf/Test/SelectAllDownloadableLinksDownloadableProductTest.xml index 2ce0272852711..0ed826e944a4f 100644 --- a/app/code/Magento/Downloadable/Test/Mftf/Test/SelectAllDownloadableLinksDownloadableProductTest.xml +++ b/app/code/Magento/Downloadable/Test/Mftf/Test/SelectAllDownloadableLinksDownloadableProductTest.xml @@ -25,7 +25,7 @@ <createData entity="SimpleSubCategory" stepKey="createCategory"/> <!-- Login as admin --> - <actionGroup ref="LoginAsAdmin" stepKey="LoginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="LoginAsAdmin"/> <!-- Create downloadable product --> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="amOnProductGridPage"/> diff --git a/app/code/Magento/Downloadable/Test/Mftf/Test/VerifyDisableDownloadableProductSamplesAreNotAccessibleTest.xml b/app/code/Magento/Downloadable/Test/Mftf/Test/VerifyDisableDownloadableProductSamplesAreNotAccessibleTest.xml index 919fe4b3c645e..1529750cbb293 100644 --- a/app/code/Magento/Downloadable/Test/Mftf/Test/VerifyDisableDownloadableProductSamplesAreNotAccessibleTest.xml +++ b/app/code/Magento/Downloadable/Test/Mftf/Test/VerifyDisableDownloadableProductSamplesAreNotAccessibleTest.xml @@ -84,7 +84,7 @@ <closeTab stepKey="closeLinkSampleTab"/> <!-- Login as admin --> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <!-- Open Downloadable product from precondition --> <actionGroup ref="AdminProductPageOpenByIdActionGroup" stepKey="openProductEditPage"> diff --git a/app/code/Magento/Elasticsearch/Test/Mftf/Test/ProductQuickSearchUsingElasticSearchTest.xml b/app/code/Magento/Elasticsearch/Test/Mftf/Test/ProductQuickSearchUsingElasticSearchTest.xml index 4b959b043be2b..99dd88ec6fc56 100644 --- a/app/code/Magento/Elasticsearch/Test/Mftf/Test/ProductQuickSearchUsingElasticSearchTest.xml +++ b/app/code/Magento/Elasticsearch/Test/Mftf/Test/ProductQuickSearchUsingElasticSearchTest.xml @@ -36,7 +36,7 @@ <actionGroup ref="AdminLogoutActionGroup" stepKey="logoutOfAdmin"/> </after> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <comment userInput="Change Catalog search engine option to Elastic Search 5.0+" stepKey="chooseElasticSearch5"/> <comment userInput="The test was moved to elasticsearch suite" stepKey="chooseES5"/> <actionGroup ref="ClearPageCacheActionGroup" stepKey="clearing"/> @@ -56,6 +56,6 @@ <seeInTitle userInput="Search results for: 'Simple'" stepKey="assertQuickSearchTitle"/> <see userInput="Search results for: 'Simple'" selector="{{StorefrontCatalogSearchMainSection.SearchTitle}}" stepKey="assertQuickSearchName"/> <comment userInput="End of searching products" stepKey="endOfSearchingProducts"/> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin2"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin2"/> </test> </tests> diff --git a/app/code/Magento/Elasticsearch/Test/Mftf/Test/StorefrontCheckAdvancedSearchOnElasticSearchTest.xml b/app/code/Magento/Elasticsearch/Test/Mftf/Test/StorefrontCheckAdvancedSearchOnElasticSearchTest.xml index 532975eddabbe..a94a6a2e3d133 100644 --- a/app/code/Magento/Elasticsearch/Test/Mftf/Test/StorefrontCheckAdvancedSearchOnElasticSearchTest.xml +++ b/app/code/Magento/Elasticsearch/Test/Mftf/Test/StorefrontCheckAdvancedSearchOnElasticSearchTest.xml @@ -23,7 +23,7 @@ <before> <!--Delete all product if exists--> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <actionGroup ref="AdminOpenProductIndexPageActionGroup" stepKey="navigateToProductIndexPage"/> <actionGroup ref="DeleteProductsIfTheyExistActionGroup" stepKey="deleteAllProducts"/> diff --git a/app/code/Magento/Elasticsearch/Test/Mftf/Test/StorefrontProductQuickSearchWithDecimalAttributeUsingElasticSearchTest.xml b/app/code/Magento/Elasticsearch/Test/Mftf/Test/StorefrontProductQuickSearchWithDecimalAttributeUsingElasticSearchTest.xml index c48f0d63b06ca..fc66db636bb17 100644 --- a/app/code/Magento/Elasticsearch/Test/Mftf/Test/StorefrontProductQuickSearchWithDecimalAttributeUsingElasticSearchTest.xml +++ b/app/code/Magento/Elasticsearch/Test/Mftf/Test/StorefrontProductQuickSearchWithDecimalAttributeUsingElasticSearchTest.xml @@ -46,7 +46,7 @@ <requiredEntity createDataKey="newCategory"/> <requiredEntity createDataKey="customAttribute"/> </createData> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> </before> <after> <deleteData createDataKey="product1" stepKey="deleteProduct1"/> @@ -57,7 +57,7 @@ <!--Reindex and clear cache--> <magentoCLI command="indexer:reindex" stepKey="reindex"/> <magentoCLI command="cache:clean" stepKey="cleanCache"/> - <actionGroup ref="logout" stepKey="logoutOfAdmin"/> + <actionGroup ref="AdminLogoutActionGroup" stepKey="logoutOfAdmin"/> </after> <!--Navigate to backend and update value for custom attribute --> <actionGroup ref="SearchForProductOnBackendActionGroup" stepKey="searchForSimpleProduct"> diff --git a/app/code/Magento/Elasticsearch6/Test/Mftf/Test/StorefrontElasticSearchForChineseLocaleTest.xml b/app/code/Magento/Elasticsearch6/Test/Mftf/Test/StorefrontElasticSearchForChineseLocaleTest.xml index 9ffd69b65ea19..2bdbe58ecd97e 100644 --- a/app/code/Magento/Elasticsearch6/Test/Mftf/Test/StorefrontElasticSearchForChineseLocaleTest.xml +++ b/app/code/Magento/Elasticsearch6/Test/Mftf/Test/StorefrontElasticSearchForChineseLocaleTest.xml @@ -22,7 +22,7 @@ </annotations> <before> <!-- Set search engine to Elastic 6, set Locale to China, create category and product, then go to Storefront --> - <actionGroup ref="LoginAsAdmin" stepKey="login"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="login"/> <magentoCLI command="config:set --scope={{GeneralLocalCodeConfigsForChina.scope}} --scope-code={{GeneralLocalCodeConfigsForChina.scope_code}} {{GeneralLocalCodeConfigsForChina.path}} {{GeneralLocalCodeConfigsForChina.value}}" stepKey="setLocaleToChina"/> <comment userInput="Moved to appropriate test suite" stepKey="enableElasticsearch6"/> <comment userInput="Moved to appropriate test suite" stepKey="checkConnection"/> diff --git a/app/code/Magento/Elasticsearch6/Test/Mftf/Test/StorefrontElasticsearch6SearchInvalidValueTest.xml b/app/code/Magento/Elasticsearch6/Test/Mftf/Test/StorefrontElasticsearch6SearchInvalidValueTest.xml index 49aef41d7f31c..93a2938d86f26 100644 --- a/app/code/Magento/Elasticsearch6/Test/Mftf/Test/StorefrontElasticsearch6SearchInvalidValueTest.xml +++ b/app/code/Magento/Elasticsearch6/Test/Mftf/Test/StorefrontElasticsearch6SearchInvalidValueTest.xml @@ -20,7 +20,7 @@ <group value="elasticsearch"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <!--Create category--> <createData entity="SimpleSubCategory" stepKey="createCategory"/> <!--Set Minimal Query Length--> diff --git a/app/code/Magento/Email/Test/Mftf/Test/AdminEmailTemplatePreviewTest.xml b/app/code/Magento/Email/Test/Mftf/Test/AdminEmailTemplatePreviewTest.xml index 92f4b79b09be2..0d9ca6a2c195a 100644 --- a/app/code/Magento/Email/Test/Mftf/Test/AdminEmailTemplatePreviewTest.xml +++ b/app/code/Magento/Email/Test/Mftf/Test/AdminEmailTemplatePreviewTest.xml @@ -22,7 +22,7 @@ <before> <!--Login to Admin Area--> - <actionGroup ref="LoginAsAdmin" stepKey="loginToAdminArea"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginToAdminArea"/> </before> <after> diff --git a/app/code/Magento/Email/Test/Mftf/Test/AdminMarketingEmailTemplatesNavigateMenuTest.xml b/app/code/Magento/Email/Test/Mftf/Test/AdminMarketingEmailTemplatesNavigateMenuTest.xml index 28e77ee399737..2dace58274e29 100644 --- a/app/code/Magento/Email/Test/Mftf/Test/AdminMarketingEmailTemplatesNavigateMenuTest.xml +++ b/app/code/Magento/Email/Test/Mftf/Test/AdminMarketingEmailTemplatesNavigateMenuTest.xml @@ -20,7 +20,7 @@ <group value="mtf_migrated"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="LoginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="LoginAsAdmin"/> </before> <after> <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> diff --git a/app/code/Magento/EncryptionKey/Test/Mftf/Test/AdminEncryptionKeyAutoGenerateKeyTest.xml b/app/code/Magento/EncryptionKey/Test/Mftf/Test/AdminEncryptionKeyAutoGenerateKeyTest.xml index 04430661a62a4..0d73802268ad1 100644 --- a/app/code/Magento/EncryptionKey/Test/Mftf/Test/AdminEncryptionKeyAutoGenerateKeyTest.xml +++ b/app/code/Magento/EncryptionKey/Test/Mftf/Test/AdminEncryptionKeyAutoGenerateKeyTest.xml @@ -20,7 +20,7 @@ <before> <!--Login to Admin Area--> - <actionGroup ref="LoginAsAdmin" stepKey="loginToAdminArea"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginToAdminArea"/> </before> <after> diff --git a/app/code/Magento/EncryptionKey/Test/Mftf/Test/AdminEncryptionKeyManualGenerateKeyTest.xml b/app/code/Magento/EncryptionKey/Test/Mftf/Test/AdminEncryptionKeyManualGenerateKeyTest.xml index 0674fd12ebead..427be2edd1184 100644 --- a/app/code/Magento/EncryptionKey/Test/Mftf/Test/AdminEncryptionKeyManualGenerateKeyTest.xml +++ b/app/code/Magento/EncryptionKey/Test/Mftf/Test/AdminEncryptionKeyManualGenerateKeyTest.xml @@ -20,7 +20,7 @@ <before> <!--Login to Admin Area--> - <actionGroup ref="LoginAsAdmin" stepKey="loginToAdminArea"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginToAdminArea"/> </before> <after> diff --git a/app/code/Magento/Fedex/Test/Mftf/Test/AdminCreatingShippingLabelTest.xml b/app/code/Magento/Fedex/Test/Mftf/Test/AdminCreatingShippingLabelTest.xml index dd4512c969453..3850bfabc0c34 100644 --- a/app/code/Magento/Fedex/Test/Mftf/Test/AdminCreatingShippingLabelTest.xml +++ b/app/code/Magento/Fedex/Test/Mftf/Test/AdminCreatingShippingLabelTest.xml @@ -23,7 +23,7 @@ </skip> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <!-- Create product --> <createData entity="SimpleSubCategory" stepKey="createCategory"/> <createData entity="SimpleProduct" stepKey="createProduct"> diff --git a/app/code/Magento/GoogleAdwords/Test/Mftf/Test/AdminValidateConversionIdConfigTest.xml b/app/code/Magento/GoogleAdwords/Test/Mftf/Test/AdminValidateConversionIdConfigTest.xml index bc1983344ce88..3010c32cd3ed8 100644 --- a/app/code/Magento/GoogleAdwords/Test/Mftf/Test/AdminValidateConversionIdConfigTest.xml +++ b/app/code/Magento/GoogleAdwords/Test/Mftf/Test/AdminValidateConversionIdConfigTest.xml @@ -16,7 +16,7 @@ <severity value="MINOR"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> </before> <after> <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> diff --git a/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdminAddDefaultImageGroupedProductTest.xml b/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdminAddDefaultImageGroupedProductTest.xml index d71ee505f8356..04b704b9193ca 100644 --- a/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdminAddDefaultImageGroupedProductTest.xml +++ b/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdminAddDefaultImageGroupedProductTest.xml @@ -19,7 +19,7 @@ <group value="GroupedProduct"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <createData entity="_defaultCategory" stepKey="createCategory"/> <createData entity="ApiSimpleProduct" stepKey="createProductOne"> <requiredEntity createDataKey="createCategory"/> diff --git a/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdminAssociateGroupedProductToWebsitesTest.xml b/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdminAssociateGroupedProductToWebsitesTest.xml index d23013a6157c9..bd6785eb5e41b 100644 --- a/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdminAssociateGroupedProductToWebsitesTest.xml +++ b/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdminAssociateGroupedProductToWebsitesTest.xml @@ -33,7 +33,7 @@ </createData> <!-- Login as Admin --> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <!--Create website--> <actionGroup ref="AdminCreateWebsiteActionGroup" stepKey="createSecondWebsite"> diff --git a/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdminCreateAndEditGroupedProductSettingsTest.xml b/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdminCreateAndEditGroupedProductSettingsTest.xml index c6228e674aa34..b842dad9c8c4e 100644 --- a/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdminCreateAndEditGroupedProductSettingsTest.xml +++ b/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdminCreateAndEditGroupedProductSettingsTest.xml @@ -26,7 +26,7 @@ <createData entity="SimpleProduct2" stepKey="createProduct"/> <!-- Login as admin --> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> </before> <after> <!-- Delete grouped product --> diff --git a/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdminDeleteGroupedProductTest.xml b/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdminDeleteGroupedProductTest.xml index ebcdc0623cd75..b88f909d977ab 100644 --- a/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdminDeleteGroupedProductTest.xml +++ b/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdminDeleteGroupedProductTest.xml @@ -18,7 +18,7 @@ <group value="mtf_migrated"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <createData entity="ApiProductWithDescription" stepKey="createSimpleProduct"/> <createData entity="_defaultCategory" stepKey="createCategory"/> <createData entity="ApiGroupedProduct2" stepKey="createGroupedProduct"> diff --git a/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdminGroupedProductsListTest.xml b/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdminGroupedProductsListTest.xml index 7657c9a86a62b..6514b5ddc5f78 100644 --- a/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdminGroupedProductsListTest.xml +++ b/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdminGroupedProductsListTest.xml @@ -27,7 +27,7 @@ <createData entity="SimpleProduct4" stepKey="simpleProduct2"> <requiredEntity createDataKey="category1"/> </createData> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> </before> <after> <deleteData createDataKey="simpleProduct1" stepKey="deleteSimpleProduct1"/> diff --git a/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdminRemoveDefaultImageGroupedProductTest.xml b/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdminRemoveDefaultImageGroupedProductTest.xml index 452b55b835739..053949fa20fb2 100644 --- a/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdminRemoveDefaultImageGroupedProductTest.xml +++ b/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdminRemoveDefaultImageGroupedProductTest.xml @@ -19,7 +19,7 @@ <group value="GroupedProduct"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <createData entity="_defaultCategory" stepKey="createCategory"/> <createData entity="ApiSimpleProduct" stepKey="createProductOne"> <requiredEntity createDataKey="createCategory"/> diff --git a/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdminSortingAssociatedProductsTest.xml b/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdminSortingAssociatedProductsTest.xml index dd4619c5c2ce1..7f03765720069 100644 --- a/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdminSortingAssociatedProductsTest.xml +++ b/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdminSortingAssociatedProductsTest.xml @@ -19,7 +19,7 @@ <group value="GroupedProduct"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="login"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="login"/> <createData entity="_defaultCategory" stepKey="category"/> <!-- Create 23 products so that grid can have more than one page --> <createData entity="ApiSimpleProduct" stepKey="product1"> diff --git a/app/code/Magento/GroupedProduct/view/frontend/web/js/product-ids-resolver.js b/app/code/Magento/GroupedProduct/view/frontend/web/js/product-ids-resolver.js index e6294d8043a50..ea5f841d738a3 100644 --- a/app/code/Magento/GroupedProduct/view/frontend/web/js/product-ids-resolver.js +++ b/app/code/Magento/GroupedProduct/view/frontend/web/js/product-ids-resolver.js @@ -4,8 +4,9 @@ */ define([ 'jquery', - 'Magento_Catalog/js/product/view/product-ids' -], function ($, productIds) { + 'Magento_Catalog/js/product/view/product-ids', + 'Magento_Catalog/js/product/view/product-info' +], function ($, productIds, productInfo) { 'use strict'; /** @@ -18,6 +19,11 @@ define([ return function (config, element) { $(element).find('div[data-product-id]').each(function () { productIds.push($(this).data('productId').toString()); + productInfo.push( + { + 'id': $(this).data('productId').toString() + } + ); }); return productIds(); diff --git a/app/code/Magento/ImportExport/Test/Mftf/Test/AdminCheckThatSomeAttributesChangedValueToEmptyAfterImportTest.xml b/app/code/Magento/ImportExport/Test/Mftf/Test/AdminCheckThatSomeAttributesChangedValueToEmptyAfterImportTest.xml index 2d891982e8306..a45783767e6a2 100644 --- a/app/code/Magento/ImportExport/Test/Mftf/Test/AdminCheckThatSomeAttributesChangedValueToEmptyAfterImportTest.xml +++ b/app/code/Magento/ImportExport/Test/Mftf/Test/AdminCheckThatSomeAttributesChangedValueToEmptyAfterImportTest.xml @@ -20,7 +20,7 @@ <group value="importExport"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <actionGroup ref="AdminOpenProductIndexPageActionGroup" stepKey="navigateToProductIndexPage"/> <actionGroup ref="ResetProductGridToDefaultViewActionGroup" stepKey="resetProductGridToDefaultView"/> <actionGroup ref="DeleteProductsIfTheyExistActionGroup" stepKey="deleteAllProducts"/> diff --git a/app/code/Magento/ImportExport/Test/Mftf/Test/AdminExportPageNavigateMenuTest.xml b/app/code/Magento/ImportExport/Test/Mftf/Test/AdminExportPageNavigateMenuTest.xml index eba744e551037..98df7b8d8900e 100644 --- a/app/code/Magento/ImportExport/Test/Mftf/Test/AdminExportPageNavigateMenuTest.xml +++ b/app/code/Magento/ImportExport/Test/Mftf/Test/AdminExportPageNavigateMenuTest.xml @@ -20,7 +20,7 @@ <group value="mtf_migrated"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="LoginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="LoginAsAdmin"/> </before> <after> <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> diff --git a/app/code/Magento/ImportExport/Test/Mftf/Test/AdminExportPagerGridTest.xml b/app/code/Magento/ImportExport/Test/Mftf/Test/AdminExportPagerGridTest.xml index b52d8ec729fc0..0c5bf2d3fcee3 100644 --- a/app/code/Magento/ImportExport/Test/Mftf/Test/AdminExportPagerGridTest.xml +++ b/app/code/Magento/ImportExport/Test/Mftf/Test/AdminExportPagerGridTest.xml @@ -18,7 +18,7 @@ <group value="importExport"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="LoginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="LoginAsAdmin"/> </before> <after> <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> diff --git a/app/code/Magento/ImportExport/Test/Mftf/Test/AdminImagesFileDirectoryCorrectExplanationTest.xml b/app/code/Magento/ImportExport/Test/Mftf/Test/AdminImagesFileDirectoryCorrectExplanationTest.xml index 92f93736f237a..58ff334ee9f93 100644 --- a/app/code/Magento/ImportExport/Test/Mftf/Test/AdminImagesFileDirectoryCorrectExplanationTest.xml +++ b/app/code/Magento/ImportExport/Test/Mftf/Test/AdminImagesFileDirectoryCorrectExplanationTest.xml @@ -18,7 +18,7 @@ <group value="importExport"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> </before> <after> <actionGroup ref="AdminLogoutActionGroup" stepKey="logoutFromAdmin"/> diff --git a/app/code/Magento/ImportExport/Test/Mftf/Test/AdminImportCSVWithSpecialCharactersTest.xml b/app/code/Magento/ImportExport/Test/Mftf/Test/AdminImportCSVWithSpecialCharactersTest.xml index 91d1209f1f1b8..111ba187c6f26 100644 --- a/app/code/Magento/ImportExport/Test/Mftf/Test/AdminImportCSVWithSpecialCharactersTest.xml +++ b/app/code/Magento/ImportExport/Test/Mftf/Test/AdminImportCSVWithSpecialCharactersTest.xml @@ -20,7 +20,7 @@ <group value="importExport"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> </before> <after> <actionGroup ref="AdminLogoutActionGroup" stepKey="logoutFromAdmin"/> diff --git a/app/code/Magento/ImportExport/Test/Mftf/Test/AdminImportProductsWithAddUpdateBehaviorTest.xml b/app/code/Magento/ImportExport/Test/Mftf/Test/AdminImportProductsWithAddUpdateBehaviorTest.xml index 0bd447905fb47..583ceb0b2496f 100644 --- a/app/code/Magento/ImportExport/Test/Mftf/Test/AdminImportProductsWithAddUpdateBehaviorTest.xml +++ b/app/code/Magento/ImportExport/Test/Mftf/Test/AdminImportProductsWithAddUpdateBehaviorTest.xml @@ -29,7 +29,7 @@ </createData> <!-- Login as Admin --> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <!-- Create Website --> <actionGroup ref="AdminCreateWebsiteActionGroup" stepKey="AdminCreateWebsite"> diff --git a/app/code/Magento/ImportExport/Test/Mftf/Test/AdminImportProductsWithDeleteBehaviorTest.xml b/app/code/Magento/ImportExport/Test/Mftf/Test/AdminImportProductsWithDeleteBehaviorTest.xml index 800e8203d19ce..503037401b9f7 100644 --- a/app/code/Magento/ImportExport/Test/Mftf/Test/AdminImportProductsWithDeleteBehaviorTest.xml +++ b/app/code/Magento/ImportExport/Test/Mftf/Test/AdminImportProductsWithDeleteBehaviorTest.xml @@ -34,7 +34,7 @@ <field key="name">Api Downloadable Product for Test</field> <field key="sku">Api Downloadable Product for Test</field> </createData> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> </before> <after> <actionGroup ref="AdminClearFiltersActionGroup" stepKey="clearProductFilters"/> diff --git a/app/code/Magento/ImportExport/Test/Mftf/Test/AdminImportProductsWithErrorEntriesTest.xml b/app/code/Magento/ImportExport/Test/Mftf/Test/AdminImportProductsWithErrorEntriesTest.xml index 1d3a45b79dc74..3c208eabc9558 100644 --- a/app/code/Magento/ImportExport/Test/Mftf/Test/AdminImportProductsWithErrorEntriesTest.xml +++ b/app/code/Magento/ImportExport/Test/Mftf/Test/AdminImportProductsWithErrorEntriesTest.xml @@ -19,7 +19,7 @@ </annotations> <before> <!--Login to Admin Page--> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> </before> <after> <!--Clear products grid filters--> diff --git a/app/code/Magento/ImportExport/Test/Mftf/Test/AdminProductImportCSVFileCorrectDifferentFilesTest.xml b/app/code/Magento/ImportExport/Test/Mftf/Test/AdminProductImportCSVFileCorrectDifferentFilesTest.xml index c5926428daaa7..209bb3b48834f 100644 --- a/app/code/Magento/ImportExport/Test/Mftf/Test/AdminProductImportCSVFileCorrectDifferentFilesTest.xml +++ b/app/code/Magento/ImportExport/Test/Mftf/Test/AdminProductImportCSVFileCorrectDifferentFilesTest.xml @@ -21,7 +21,7 @@ </annotations> <before> <!--Login as Admin--> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> </before> <after> <!--Logout from Admin--> diff --git a/app/code/Magento/ImportExport/Test/Mftf/Test/AdminProductVisibilityDifferentStoreViewsAfterImportTest.xml b/app/code/Magento/ImportExport/Test/Mftf/Test/AdminProductVisibilityDifferentStoreViewsAfterImportTest.xml index e176052d7a280..b9b61a2ae28ee 100644 --- a/app/code/Magento/ImportExport/Test/Mftf/Test/AdminProductVisibilityDifferentStoreViewsAfterImportTest.xml +++ b/app/code/Magento/ImportExport/Test/Mftf/Test/AdminProductVisibilityDifferentStoreViewsAfterImportTest.xml @@ -20,7 +20,7 @@ <group value="importExport"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <!--Create English and Chinese store views--> <actionGroup ref="AdminCreateStoreViewActionGroup" stepKey="createEnglishStoreView"> <argument name="StoreGroup" value="_defaultStoreGroup"/> diff --git a/app/code/Magento/ImportExport/Test/Mftf/Test/AdminSystemImportNavigateMenuTest.xml b/app/code/Magento/ImportExport/Test/Mftf/Test/AdminSystemImportNavigateMenuTest.xml index 249f3b28f7a56..69fb7598848aa 100644 --- a/app/code/Magento/ImportExport/Test/Mftf/Test/AdminSystemImportNavigateMenuTest.xml +++ b/app/code/Magento/ImportExport/Test/Mftf/Test/AdminSystemImportNavigateMenuTest.xml @@ -20,7 +20,7 @@ <group value="mtf_migrated"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="LoginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="LoginAsAdmin"/> </before> <after> <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> diff --git a/app/code/Magento/ImportExport/Test/Mftf/Test/AdminURLKeyWorksWhenUpdatingProductThroughImportingCSVTest.xml b/app/code/Magento/ImportExport/Test/Mftf/Test/AdminURLKeyWorksWhenUpdatingProductThroughImportingCSVTest.xml index b23e3703b5cfd..99622caf0697e 100644 --- a/app/code/Magento/ImportExport/Test/Mftf/Test/AdminURLKeyWorksWhenUpdatingProductThroughImportingCSVTest.xml +++ b/app/code/Magento/ImportExport/Test/Mftf/Test/AdminURLKeyWorksWhenUpdatingProductThroughImportingCSVTest.xml @@ -25,7 +25,7 @@ <createData entity="SimpleProductBeforeUpdate" stepKey="createProduct"> <requiredEntity createDataKey="createCategory"/> </createData> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> </before> <after> <!--Delete created data--> diff --git a/app/code/Magento/Indexer/Test/Mftf/Test/AdminSystemIndexManagementGridChangesTest.xml b/app/code/Magento/Indexer/Test/Mftf/Test/AdminSystemIndexManagementGridChangesTest.xml index f966ffc0b9158..84619a5213128 100644 --- a/app/code/Magento/Indexer/Test/Mftf/Test/AdminSystemIndexManagementGridChangesTest.xml +++ b/app/code/Magento/Indexer/Test/Mftf/Test/AdminSystemIndexManagementGridChangesTest.xml @@ -25,14 +25,14 @@ <magentoCLI command="indexer:set-mode" arguments="schedule" stepKey="setIndexerModeSchedule"/> <magentoCLI command="indexer:reindex" stepKey="indexerReindex"/> <magentoCLI command="cache:flush" stepKey="flushCache"/> - <actionGroup ref="LoginAsAdmin" stepKey="LoginAsAdmin"/></before> + <actionGroup ref="AdminLoginActionGroup" stepKey="LoginAsAdmin"/></before> <after> <deleteData createDataKey="createProduct" stepKey="deleteProduct"/> <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> <magentoCLI command="indexer:set-mode" arguments="realtime" stepKey="setIndexerModeRealTime"/> <magentoCLI command="indexer:reindex" stepKey="indexerReindex"/> <magentoCLI command="cache:flush" stepKey="flushCache"/> - <actionGroup ref="logout" stepKey="logout"/> + <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> </after> <actionGroup ref="AdminNavigateMenuActionGroup" stepKey="navigateToIndexManagementPageFirst"> diff --git a/app/code/Magento/Indexer/Test/Mftf/Test/AdminSystemIndexManagementNavigateMenuTest.xml b/app/code/Magento/Indexer/Test/Mftf/Test/AdminSystemIndexManagementNavigateMenuTest.xml index cbe5161e40ee8..4c0c4940ec130 100644 --- a/app/code/Magento/Indexer/Test/Mftf/Test/AdminSystemIndexManagementNavigateMenuTest.xml +++ b/app/code/Magento/Indexer/Test/Mftf/Test/AdminSystemIndexManagementNavigateMenuTest.xml @@ -20,7 +20,7 @@ <group value="mtf_migrated"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="LoginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="LoginAsAdmin"/> </before> <after> <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> diff --git a/app/code/Magento/Integration/Test/Mftf/Test/AdminCreateIntegrationEntityWithDuplicatedNameTest.xml b/app/code/Magento/Integration/Test/Mftf/Test/AdminCreateIntegrationEntityWithDuplicatedNameTest.xml index 60598fdd27612..f55e4e37585ba 100644 --- a/app/code/Magento/Integration/Test/Mftf/Test/AdminCreateIntegrationEntityWithDuplicatedNameTest.xml +++ b/app/code/Magento/Integration/Test/Mftf/Test/AdminCreateIntegrationEntityWithDuplicatedNameTest.xml @@ -20,7 +20,7 @@ <group value="mtf_migrated"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="LoginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="LoginAsAdmin"/> </before> <after> <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> diff --git a/app/code/Magento/Integration/Test/Mftf/Test/AdminDeleteIntegrationEntityTest.xml b/app/code/Magento/Integration/Test/Mftf/Test/AdminDeleteIntegrationEntityTest.xml index d1850fdc989fb..eb6c946a03bb5 100644 --- a/app/code/Magento/Integration/Test/Mftf/Test/AdminDeleteIntegrationEntityTest.xml +++ b/app/code/Magento/Integration/Test/Mftf/Test/AdminDeleteIntegrationEntityTest.xml @@ -21,7 +21,7 @@ </annotations> <before> <!-- Login As Admin --> - <actionGroup ref="LoginAsAdmin" stepKey="LoginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="LoginAsAdmin"/> <!-- Navigate To Integrations Page --> <actionGroup ref="AdminNavigateMenuActionGroup" stepKey="navigateToIntegrationsPage"> <argument name="menuUiId" value="{{AdminMenuSystem.dataUiId}}"/> diff --git a/app/code/Magento/Integration/Test/Mftf/Test/AdminSystemIntegrationsNavigateMenuTest.xml b/app/code/Magento/Integration/Test/Mftf/Test/AdminSystemIntegrationsNavigateMenuTest.xml index 483afc62c9808..41f7f3225255d 100644 --- a/app/code/Magento/Integration/Test/Mftf/Test/AdminSystemIntegrationsNavigateMenuTest.xml +++ b/app/code/Magento/Integration/Test/Mftf/Test/AdminSystemIntegrationsNavigateMenuTest.xml @@ -20,7 +20,7 @@ <group value="mtf_migrated"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="LoginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="LoginAsAdmin"/> </before> <after> <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> diff --git a/app/code/Magento/LayeredNavigation/Test/Mftf/Test/ShopByButtonInMobileTest.xml b/app/code/Magento/LayeredNavigation/Test/Mftf/Test/ShopByButtonInMobileTest.xml index b5fc483e251eb..6f2de31548ce0 100644 --- a/app/code/Magento/LayeredNavigation/Test/Mftf/Test/ShopByButtonInMobileTest.xml +++ b/app/code/Magento/LayeredNavigation/Test/Mftf/Test/ShopByButtonInMobileTest.xml @@ -29,7 +29,7 @@ </createData> <createData entity="SimpleProduct2" stepKey="simpleProduct1"/> <createData entity="SimpleProduct2" stepKey="simpleProduct2"/> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> </before> <after> <deleteData createDataKey="attribute" stepKey="deleteAttribute"/> diff --git a/app/code/Magento/Msrp/Test/Mftf/Test/StorefrontProductWithMapAssignedConfigProductIsCorrectTest.xml b/app/code/Magento/Msrp/Test/Mftf/Test/StorefrontProductWithMapAssignedConfigProductIsCorrectTest.xml index 104850dea4403..2bfb1239cba60 100644 --- a/app/code/Magento/Msrp/Test/Mftf/Test/StorefrontProductWithMapAssignedConfigProductIsCorrectTest.xml +++ b/app/code/Magento/Msrp/Test/Mftf/Test/StorefrontProductWithMapAssignedConfigProductIsCorrectTest.xml @@ -20,7 +20,7 @@ <group value="Msrp"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <!--Create category--> <createData entity="SimpleSubCategory" stepKey="createCategory"/> diff --git a/app/code/Magento/Multishipping/Test/Mftf/Test/StoreFrontCheckingWithMultishipmentTest.xml b/app/code/Magento/Multishipping/Test/Mftf/Test/StoreFrontCheckingWithMultishipmentTest.xml index 811af2baef56f..7ae23e8f871eb 100644 --- a/app/code/Magento/Multishipping/Test/Mftf/Test/StoreFrontCheckingWithMultishipmentTest.xml +++ b/app/code/Magento/Multishipping/Test/Mftf/Test/StoreFrontCheckingWithMultishipmentTest.xml @@ -31,7 +31,7 @@ <createData entity="FreeShippinMethodConfig" stepKey="enableFreeShipping"/> <createData entity="FlatRateShippingMethodConfig" stepKey="enableFlatRateShipping"/> <magentoCLI command="config:set {{EnableCheckMoneyOrderPaymentMethod.path}} {{EnableCheckMoneyOrderPaymentMethod.value}}" stepKey="enableCheckMoneyOrderPaymentMethod"/> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <actionGroup ref="LoginToStorefrontActionGroup" stepKey="loginToStorefrontAccount"> <argument name="Customer" value="$$customer$$"/> </actionGroup> diff --git a/app/code/Magento/Multishipping/Test/Mftf/Test/StoreFrontCheckingWithSingleShipmentTest.xml b/app/code/Magento/Multishipping/Test/Mftf/Test/StoreFrontCheckingWithSingleShipmentTest.xml index de52d20542ce8..27876df8caefe 100644 --- a/app/code/Magento/Multishipping/Test/Mftf/Test/StoreFrontCheckingWithSingleShipmentTest.xml +++ b/app/code/Magento/Multishipping/Test/Mftf/Test/StoreFrontCheckingWithSingleShipmentTest.xml @@ -31,7 +31,7 @@ <createData entity="FreeShippinMethodConfig" stepKey="enableFreeShipping"/> <createData entity="FlatRateShippingMethodConfig" stepKey="enableFlatRateShipping"/> <magentoCLI command="config:set {{EnableCheckMoneyOrderPaymentMethod.path}} {{EnableCheckMoneyOrderPaymentMethod.value}}" stepKey="enableCheckMoneyOrderPaymentMethod"/> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <actionGroup ref="LoginToStorefrontActionGroup" stepKey="loginToStorefrontAccount"> <argument name="Customer" value="$$customer$$"/> </actionGroup> diff --git a/app/code/Magento/Multishipping/Test/Mftf/Test/StoreFrontMinicartWithMultishipmentTest.xml b/app/code/Magento/Multishipping/Test/Mftf/Test/StoreFrontMinicartWithMultishipmentTest.xml index 90cc8b3952dde..f21a8d32d8841 100644 --- a/app/code/Magento/Multishipping/Test/Mftf/Test/StoreFrontMinicartWithMultishipmentTest.xml +++ b/app/code/Magento/Multishipping/Test/Mftf/Test/StoreFrontMinicartWithMultishipmentTest.xml @@ -31,7 +31,7 @@ <createData entity="FreeShippinMethodConfig" stepKey="enableFreeShipping"/> <createData entity="FlatRateShippingMethodConfig" stepKey="enableFlatRateShipping"/> <magentoCLI command="config:set {{EnableCheckMoneyOrderPaymentMethod.path}} {{EnableCheckMoneyOrderPaymentMethod.value}}" stepKey="enableCheckMoneyOrderPaymentMethod"/> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <actionGroup ref="LoginToStorefrontActionGroup" stepKey="loginToStorefrontAccount"> <argument name="Customer" value="$$customer$$"/> </actionGroup> diff --git a/app/code/Magento/Multishipping/Test/Mftf/Test/StoreFrontMyAccountWithMultishipmentTest.xml b/app/code/Magento/Multishipping/Test/Mftf/Test/StoreFrontMyAccountWithMultishipmentTest.xml index 8f27fa35bde02..312fa95bf77af 100644 --- a/app/code/Magento/Multishipping/Test/Mftf/Test/StoreFrontMyAccountWithMultishipmentTest.xml +++ b/app/code/Magento/Multishipping/Test/Mftf/Test/StoreFrontMyAccountWithMultishipmentTest.xml @@ -36,7 +36,7 @@ <magentoCLI command="config:set {{EnableFreeShippingMethod.path}} {{EnableFreeShippingMethod.value}}" stepKey="enableFreeShipping"/> <magentoCLI command="config:set {{EnableFlatRateShippingMethod.path}} {{EnableFlatRateShippingMethod.value}}" stepKey="enableFlatRateShipping"/> <magentoCLI command="config:set {{EnableCheckMoneyOrderPaymentMethod.path}} {{EnableCheckMoneyOrderPaymentMethod.value}}" stepKey="enableCheckMoneyOrderPaymentMethod"/> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <actionGroup ref="LoginToStorefrontActionGroup" stepKey="loginToStorefrontAccount"> <argument name="Customer" value="$$customer$$"/> </actionGroup> diff --git a/app/code/Magento/Multishipping/Test/Mftf/Test/StorefrontCheckoutWithMultipleAddressesTest.xml b/app/code/Magento/Multishipping/Test/Mftf/Test/StorefrontCheckoutWithMultipleAddressesTest.xml index 5890ab49b2587..a49a37e475409 100644 --- a/app/code/Magento/Multishipping/Test/Mftf/Test/StorefrontCheckoutWithMultipleAddressesTest.xml +++ b/app/code/Magento/Multishipping/Test/Mftf/Test/StorefrontCheckoutWithMultipleAddressesTest.xml @@ -21,7 +21,7 @@ </annotations> <before> <!-- Login as Admin --> - <actionGroup ref="LoginAsAdmin" stepKey="login"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="login"/> <!-- Set configurations --> <magentoCLI command="config:set multishipping/options/checkout_multiple 1" stepKey="allowShippingToMultipleAddresses"/> <!-- Create simple products --> diff --git a/app/code/Magento/Multishipping/Test/Mftf/Test/StorefrontOrderWithMultishippingTest.xml b/app/code/Magento/Multishipping/Test/Mftf/Test/StorefrontOrderWithMultishippingTest.xml index 9a3d622b2e264..80407a219a841 100644 --- a/app/code/Magento/Multishipping/Test/Mftf/Test/StorefrontOrderWithMultishippingTest.xml +++ b/app/code/Magento/Multishipping/Test/Mftf/Test/StorefrontOrderWithMultishippingTest.xml @@ -31,7 +31,7 @@ <magentoCLI command="config:set {{EnableFreeShippingMethod.path}} {{EnableFreeShippingMethod.value}}" stepKey="enableFreeShipping"/> <magentoCLI command="config:set {{EnableFlatRateShippingMethod.path}} {{EnableFlatRateShippingMethod.value}}" stepKey="enableFlatRateShipping"/> <magentoCLI command="config:set {{EnableCheckMoneyOrderPaymentMethod.path}} {{EnableCheckMoneyOrderPaymentMethod.value}}" stepKey="enableCheckMoneyOrderPaymentMethod"/> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <actionGroup ref="LoginToStorefrontActionGroup" stepKey="loginToStorefrontAccount"> <argument name="Customer" value="$$createCustomer$$"/> </actionGroup> diff --git a/app/code/Magento/Multishipping/Test/Mftf/Test/StorefrontProcessMultishippingCheckoutWhenCartPageIsOpenedInAnotherTabTest.xml b/app/code/Magento/Multishipping/Test/Mftf/Test/StorefrontProcessMultishippingCheckoutWhenCartPageIsOpenedInAnotherTabTest.xml index f37b45c639263..2925f2c5b1690 100644 --- a/app/code/Magento/Multishipping/Test/Mftf/Test/StorefrontProcessMultishippingCheckoutWhenCartPageIsOpenedInAnotherTabTest.xml +++ b/app/code/Magento/Multishipping/Test/Mftf/Test/StorefrontProcessMultishippingCheckoutWhenCartPageIsOpenedInAnotherTabTest.xml @@ -21,7 +21,7 @@ </annotations> <before> <!-- Login as Admin --> - <actionGroup ref="LoginAsAdmin" stepKey="login"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="login"/> <!-- Set configurations --> <magentoCLI command="config:set multishipping/options/checkout_multiple 1" stepKey="allowShippingToMultipleAddresses"/> <!-- Create two simple products --> diff --git a/app/code/Magento/NewRelicReporting/Test/Mftf/Test/AdminCheckNewRelicSystemConfigDependencyTest.xml b/app/code/Magento/NewRelicReporting/Test/Mftf/Test/AdminCheckNewRelicSystemConfigDependencyTest.xml index 5b4b92559f355..9b210db497e9a 100644 --- a/app/code/Magento/NewRelicReporting/Test/Mftf/Test/AdminCheckNewRelicSystemConfigDependencyTest.xml +++ b/app/code/Magento/NewRelicReporting/Test/Mftf/Test/AdminCheckNewRelicSystemConfigDependencyTest.xml @@ -18,7 +18,7 @@ <group value="NewRelicReporting"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <actionGroup ref="AdminNavigateToNewRelicConfigurationActionGroup" stepKey="goToConfigPage"/> <actionGroup ref="AdminExpandConfigSectionActionGroup" stepKey="expandingGeneralSection"> <argument name="sectionName" value="General"/> diff --git a/app/code/Magento/Newsletter/Test/Mftf/Test/AdminMarketingNewsletterQueueNavigateMenuTest.xml b/app/code/Magento/Newsletter/Test/Mftf/Test/AdminMarketingNewsletterQueueNavigateMenuTest.xml index c094117870712..81fb69f557dfd 100644 --- a/app/code/Magento/Newsletter/Test/Mftf/Test/AdminMarketingNewsletterQueueNavigateMenuTest.xml +++ b/app/code/Magento/Newsletter/Test/Mftf/Test/AdminMarketingNewsletterQueueNavigateMenuTest.xml @@ -20,7 +20,7 @@ <group value="mtf_migrated"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="LoginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="LoginAsAdmin"/> </before> <after> <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> diff --git a/app/code/Magento/Newsletter/Test/Mftf/Test/AdminMarketingNewsletterSubscribersNavigateMenuTest.xml b/app/code/Magento/Newsletter/Test/Mftf/Test/AdminMarketingNewsletterSubscribersNavigateMenuTest.xml index a5046b6fa4b71..9908e4a115820 100644 --- a/app/code/Magento/Newsletter/Test/Mftf/Test/AdminMarketingNewsletterSubscribersNavigateMenuTest.xml +++ b/app/code/Magento/Newsletter/Test/Mftf/Test/AdminMarketingNewsletterSubscribersNavigateMenuTest.xml @@ -20,7 +20,7 @@ <group value="mtf_migrated"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="LoginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="LoginAsAdmin"/> </before> <after> <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> diff --git a/app/code/Magento/Newsletter/Test/Mftf/Test/AdminMarketingNewsletterTemplateNavigateMenuTest.xml b/app/code/Magento/Newsletter/Test/Mftf/Test/AdminMarketingNewsletterTemplateNavigateMenuTest.xml index 4c12765ebc2a0..bac6023b80446 100644 --- a/app/code/Magento/Newsletter/Test/Mftf/Test/AdminMarketingNewsletterTemplateNavigateMenuTest.xml +++ b/app/code/Magento/Newsletter/Test/Mftf/Test/AdminMarketingNewsletterTemplateNavigateMenuTest.xml @@ -20,7 +20,7 @@ <group value="mtf_migrated"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="LoginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="LoginAsAdmin"/> </before> <after> <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> diff --git a/app/code/Magento/Newsletter/Test/Mftf/Test/AdminReportsNewsletterProblemReportsNavigateMenuTest.xml b/app/code/Magento/Newsletter/Test/Mftf/Test/AdminReportsNewsletterProblemReportsNavigateMenuTest.xml index 9765a65cd60db..441deff9a5cf9 100644 --- a/app/code/Magento/Newsletter/Test/Mftf/Test/AdminReportsNewsletterProblemReportsNavigateMenuTest.xml +++ b/app/code/Magento/Newsletter/Test/Mftf/Test/AdminReportsNewsletterProblemReportsNavigateMenuTest.xml @@ -20,7 +20,7 @@ <group value="mtf_migrated"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="LoginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="LoginAsAdmin"/> </before> <after> <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> diff --git a/app/code/Magento/Newsletter/Test/Unit/Model/Plugin/CustomerPluginTest.php b/app/code/Magento/Newsletter/Test/Unit/Model/Plugin/CustomerPluginTest.php index 4dbaa93b1d134..c8a846cb2a758 100644 --- a/app/code/Magento/Newsletter/Test/Unit/Model/Plugin/CustomerPluginTest.php +++ b/app/code/Magento/Newsletter/Test/Unit/Model/Plugin/CustomerPluginTest.php @@ -6,10 +6,10 @@ namespace Magento\Newsletter\Test\Unit\Model\Plugin; use Magento\Customer\Api\CustomerRepositoryInterface; +use Magento\Customer\Api\Data\CustomerExtensionInterface; use Magento\Customer\Api\Data\CustomerInterface; use Magento\Customer\Model\Config\Share; use Magento\Customer\Model\ResourceModel\CustomerRepository; -use Magento\Customer\Api\Data\CustomerExtensionInterface; use Magento\Framework\Api\ExtensionAttributesFactory; use Magento\Framework\TestFramework\Unit\Helper\ObjectManager; use Magento\Newsletter\Model\Plugin\CustomerPlugin; @@ -134,7 +134,13 @@ public function testAfterSave(?int $originalStatus, ?bool $newValue, ?bool $expe } $this->subscriberFactory->method('create')->willReturn($subscriber); - $customerExtension = $this->createPartialMock(CustomerExtensionInterface::class, ['getIsSubscribed']); + $customerExtension = $this->createPartialMock( + CustomerExtensionInterface::class, + [ + 'getIsSubscribed', + 'CustomerExtensionInterface' + ] + ); $customerExtension->method('getIsSubscribed')->willReturn($newValue); /** @var CustomerInterface|MockObject $customer */ $customer = $this->createMock(CustomerInterface::class); @@ -152,7 +158,14 @@ public function testAfterSave(?int $originalStatus, ?bool $newValue, ?bool $expe $this->subscriptionManager->expects($this->never())->method('subscribeCustomer'); $this->subscriptionManager->expects($this->never())->method('unsubscribeCustomer'); } - $resultExtension = $this->createPartialMock(CustomerExtensionInterface::class, ['setIsSubscribed']); + $resultExtension = $this->createPartialMock( + CustomerExtensionInterface::class, + [ + 'setIsSubscribed', + 'getIsSubscribed', + 'CustomerExtensionInterface' + ] + ); $resultExtension->expects($this->once())->method('setIsSubscribed')->with($resultIsSubscribed); /** @var CustomerInterface|MockObject $result */ $result = $this->createMock(CustomerInterface::class); @@ -291,7 +304,7 @@ public function testAfterGetByIdCreatesExtensionAttributes(): void $customerExtension = $this->createPartialMock( CustomerExtensionInterface::class, - ['getIsSubscribed', 'setIsSubscribed'] + ['getIsSubscribed', 'setIsSubscribed','CustomerExtensionInterface'] ); $customerExtension->expects($this->once())->method('setIsSubscribed')->with($subscribed); $this->extensionFactory->expects($this->once())->method('create')->willReturn($customerExtension); diff --git a/app/code/Magento/PageCache/Test/Mftf/Test/AdminFrontendAreaSessionMustNotAffectAdminAreaTest.xml b/app/code/Magento/PageCache/Test/Mftf/Test/AdminFrontendAreaSessionMustNotAffectAdminAreaTest.xml index c94eed9dc6a57..d2c738398aae1 100644 --- a/app/code/Magento/PageCache/Test/Mftf/Test/AdminFrontendAreaSessionMustNotAffectAdminAreaTest.xml +++ b/app/code/Magento/PageCache/Test/Mftf/Test/AdminFrontendAreaSessionMustNotAffectAdminAreaTest.xml @@ -58,7 +58,7 @@ </after> <!-- 1. Login as admin --> - <actionGroup ref="LoginAsAdmin" stepKey="LoginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="LoginAsAdmin"/> <!-- 2. Navigate Go to "Catalog"->"Products" --> <amOnPage url="{{ProductCatalogPage.url}}" stepKey="onCatalogProductPage"/> diff --git a/app/code/Magento/PageCache/Test/Mftf/Test/FlushStaticFilesCacheButtonVisibilityTest.xml b/app/code/Magento/PageCache/Test/Mftf/Test/FlushStaticFilesCacheButtonVisibilityTest.xml index bd6f7ba362bf4..3b93ec1796838 100644 --- a/app/code/Magento/PageCache/Test/Mftf/Test/FlushStaticFilesCacheButtonVisibilityTest.xml +++ b/app/code/Magento/PageCache/Test/Mftf/Test/FlushStaticFilesCacheButtonVisibilityTest.xml @@ -22,7 +22,7 @@ </annotations> <before> <!-- Log in to Admin Panel --> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> </before> <!-- Open Cache Management page --> diff --git a/app/code/Magento/Paypal/Block/Express/InContext/Minicart/SmartButton.php b/app/code/Magento/Paypal/Block/Express/InContext/Minicart/SmartButton.php index c6a17fa5efb9f..a4732a8b4c579 100644 --- a/app/code/Magento/Paypal/Block/Express/InContext/Minicart/SmartButton.php +++ b/app/code/Magento/Paypal/Block/Express/InContext/Minicart/SmartButton.php @@ -27,6 +27,8 @@ class SmartButton extends Template implements ShortcutInterface { private const ALIAS_ELEMENT_INDEX = 'alias'; + const PAYPAL_BUTTON_ID = 'paypal-express-in-context-checkout-main'; + /** * @var Config */ diff --git a/app/code/Magento/Paypal/Controller/Hostedpro/Cancel.php b/app/code/Magento/Paypal/Controller/Hostedpro/Cancel.php index 629431e13879c..981d63b88225c 100644 --- a/app/code/Magento/Paypal/Controller/Hostedpro/Cancel.php +++ b/app/code/Magento/Paypal/Controller/Hostedpro/Cancel.php @@ -1,15 +1,24 @@ <?php /** - * * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ +declare(strict_types=1); + namespace Magento\Paypal\Controller\Hostedpro; +use Magento\Framework\App\Action\Action; use Magento\Framework\App\Action\Context; +use Magento\Framework\App\Action\HttpGetActionInterface; +use Magento\Framework\App\CsrfAwareActionInterface; +use Magento\Framework\App\Request\InvalidRequestException; +use Magento\Framework\App\RequestInterface; use Magento\Paypal\Helper\Checkout; -class Cancel extends \Magento\Framework\App\Action\Action +/** + * PayPal Hostedpro cancel controller. + */ +class Cancel extends Action implements CsrfAwareActionInterface, HttpGetActionInterface { /** * @var Checkout @@ -40,4 +49,20 @@ public function execute() $this->_redirect('checkout', ['_fragment' => 'payment']); } + + /** + * @inheritDoc + */ + public function createCsrfValidationException(RequestInterface $request): ?InvalidRequestException + { + return null; + } + + /** + * @inheritDoc + */ + public function validateForCsrf(RequestInterface $request): ?bool + { + return true; + } } diff --git a/app/code/Magento/Paypal/Controller/Hostedpro/ReturnAction.php b/app/code/Magento/Paypal/Controller/Hostedpro/ReturnAction.php index 1643f480d25e9..bb8b5f8fa0b46 100644 --- a/app/code/Magento/Paypal/Controller/Hostedpro/ReturnAction.php +++ b/app/code/Magento/Paypal/Controller/Hostedpro/ReturnAction.php @@ -1,12 +1,23 @@ <?php /** - * * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ +declare(strict_types=1); + namespace Magento\Paypal\Controller\Hostedpro; -class ReturnAction extends \Magento\Framework\App\Action\Action +use Magento\Framework\App\Action\Action; +use Magento\Framework\App\Action\HttpGetActionInterface; +use Magento\Framework\App\Action\HttpPostActionInterface; +use Magento\Framework\App\CsrfAwareActionInterface; +use Magento\Framework\App\Request\InvalidRequestException; +use Magento\Framework\App\RequestInterface; + +/** + * PayPal Hostedpro return controller. + */ +class ReturnAction extends Action implements CsrfAwareActionInterface, HttpPostActionInterface, HttpGetActionInterface { /** * When a customer return to website from gateway. @@ -21,4 +32,20 @@ public function execute() $this->_redirect('checkout/onepage/success'); } } + + /** + * @inheritDoc + */ + public function createCsrfValidationException(RequestInterface $request): ?InvalidRequestException + { + return null; + } + + /** + * @inheritDoc + */ + public function validateForCsrf(RequestInterface $request): ?bool + { + return true; + } } diff --git a/app/code/Magento/Paypal/Model/Ipn.php b/app/code/Magento/Paypal/Model/Ipn.php index 0d7d5518f9c7d..4c128adfbd00e 100644 --- a/app/code/Magento/Paypal/Model/Ipn.php +++ b/app/code/Magento/Paypal/Model/Ipn.php @@ -8,6 +8,7 @@ use Exception; use Magento\Framework\Exception\LocalizedException; +use Magento\Sales\Model\Order; use Magento\Sales\Model\Order\Email\Sender\CreditmemoSender; use Magento\Sales\Model\Order\Email\Sender\OrderSender; @@ -301,6 +302,9 @@ protected function _registerPaymentCapture($skipFraudDetection = false) $payment->setParentTransactionId($parentTransactionId); $payment->setShouldCloseParentTransaction('Completed' === $this->getRequestData('auth_status')); $payment->setIsTransactionClosed(0); + if ($this->_order->getState() === Order::STATE_PENDING_PAYMENT) { + $this->_order->setState(Order::STATE_PROCESSING); + } $payment->registerCaptureNotification( $this->getRequestData('mc_gross'), $skipFraudDetection && $parentTransactionId diff --git a/app/code/Magento/Paypal/Test/Mftf/Test/AdminConfigPaymentsConflictResolutionForPayPalTest/AdminConfigPaymentsConflictResolutionForPayPalInUnitedKingdomTest.xml b/app/code/Magento/Paypal/Test/Mftf/Test/AdminConfigPaymentsConflictResolutionForPayPalTest/AdminConfigPaymentsConflictResolutionForPayPalInUnitedKingdomTest.xml index 1d2e8ce4ae156..ebdfb9e91ecf1 100644 --- a/app/code/Magento/Paypal/Test/Mftf/Test/AdminConfigPaymentsConflictResolutionForPayPalTest/AdminConfigPaymentsConflictResolutionForPayPalInUnitedKingdomTest.xml +++ b/app/code/Magento/Paypal/Test/Mftf/Test/AdminConfigPaymentsConflictResolutionForPayPalTest/AdminConfigPaymentsConflictResolutionForPayPalInUnitedKingdomTest.xml @@ -18,7 +18,7 @@ <group value="paypal"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <actionGroup ref="SampleConfigPayPalExpressCheckoutActionGroup" stepKey="ConfigPayPalExpress"> <argument name="credentials" value="SamplePaypalExpressConfig"/> </actionGroup> diff --git a/app/code/Magento/Paypal/Test/Mftf/Test/AdminConfigPaymentsSectionStateTest.xml b/app/code/Magento/Paypal/Test/Mftf/Test/AdminConfigPaymentsSectionStateTest.xml index 62d77d8aae6f8..11b2c1e97b02f 100644 --- a/app/code/Magento/Paypal/Test/Mftf/Test/AdminConfigPaymentsSectionStateTest.xml +++ b/app/code/Magento/Paypal/Test/Mftf/Test/AdminConfigPaymentsSectionStateTest.xml @@ -21,7 +21,7 @@ <actionGroup ref="AdminLogoutActionGroup" stepKey="amOnLogoutPage"/> </after> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin1"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin1"/> <amOnPage url="{{AdminConfigPaymentMethodsPage.url}}" stepKey="navigateToConfigurationPage"/> <waitForPageLoad stepKey="waitForPageLoad1"/> <seeElement selector="{{OtherPaymentsConfigSection.expandedTab}}" stepKey="seeSectionExpanded"/> diff --git a/app/code/Magento/Paypal/Test/Mftf/Test/AdminOnePayPalSolutionsEnabledAtTheSameTimeTest.xml b/app/code/Magento/Paypal/Test/Mftf/Test/AdminOnePayPalSolutionsEnabledAtTheSameTimeTest.xml index ede251ddee647..c35e5dbe05e76 100644 --- a/app/code/Magento/Paypal/Test/Mftf/Test/AdminOnePayPalSolutionsEnabledAtTheSameTimeTest.xml +++ b/app/code/Magento/Paypal/Test/Mftf/Test/AdminOnePayPalSolutionsEnabledAtTheSameTimeTest.xml @@ -20,7 +20,7 @@ <group value="paypal"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <!--Set PayPal Payments Standard Configs--> <comment userInput="Set PayPal Payments Standard Configs" stepKey="commentsetConfigs"/> <magentoCLI command="config:set paypal/wpp/api_authentication 0" stepKey="setApiAuthentication"/> diff --git a/app/code/Magento/Paypal/Test/Mftf/Test/AdminReportsPayPalSettlementNavigateMenuTest.xml b/app/code/Magento/Paypal/Test/Mftf/Test/AdminReportsPayPalSettlementNavigateMenuTest.xml index d2cdec73551d0..a18717344c7a3 100644 --- a/app/code/Magento/Paypal/Test/Mftf/Test/AdminReportsPayPalSettlementNavigateMenuTest.xml +++ b/app/code/Magento/Paypal/Test/Mftf/Test/AdminReportsPayPalSettlementNavigateMenuTest.xml @@ -20,7 +20,7 @@ <group value="mtf_migrated"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="LoginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="LoginAsAdmin"/> </before> <after> <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> diff --git a/app/code/Magento/Paypal/Test/Mftf/Test/AdminSalesBillingAgreementsNavigateMenuTest.xml b/app/code/Magento/Paypal/Test/Mftf/Test/AdminSalesBillingAgreementsNavigateMenuTest.xml index 2f0013c43fd9e..140d2bcef28ae 100644 --- a/app/code/Magento/Paypal/Test/Mftf/Test/AdminSalesBillingAgreementsNavigateMenuTest.xml +++ b/app/code/Magento/Paypal/Test/Mftf/Test/AdminSalesBillingAgreementsNavigateMenuTest.xml @@ -20,7 +20,7 @@ <group value="mtf_migrated"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="LoginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="LoginAsAdmin"/> </before> <after> <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> diff --git a/app/code/Magento/Paypal/Test/Unit/Model/IpnTest.php b/app/code/Magento/Paypal/Test/Unit/Model/IpnTest.php index 53022e2db93f5..3de60edf1e648 100644 --- a/app/code/Magento/Paypal/Test/Unit/Model/IpnTest.php +++ b/app/code/Magento/Paypal/Test/Unit/Model/IpnTest.php @@ -53,6 +53,7 @@ protected function setUp() 'getEmailSent', 'save', 'getState', + 'setState', ]; $this->_orderMock = $this->createPartialMock(\Magento\Sales\Model\OrderFactory::class, $methods); $this->_orderMock->expects($this->any())->method('create')->will($this->returnSelf()); @@ -149,9 +150,12 @@ public function testPaymentReviewRegisterPaymentFraud() ->will($this->returnValue(true)); $this->_orderMock->expects($this->any())->method('getPayment')->will($this->returnValue($paymentMock)); $this->_orderMock->expects($this->any())->method('canFetchPaymentReviewUpdate')->will($this->returnValue(true)); - $this->_orderMock->expects($this->once())->method('getState')->will( + $this->_orderMock->expects($this->any())->method('getState')->will( $this->returnValue(Order::STATE_PENDING_PAYMENT) ); + $this->_orderMock->expects($this->once()) + ->method('setState') + ->with(Order::STATE_PROCESSING); $this->_paypalInfo->expects($this->once()) ->method('importToPayment') ->with( diff --git a/app/code/Magento/Paypal/view/frontend/templates/express/in-context/component.phtml b/app/code/Magento/Paypal/view/frontend/templates/express/in-context/component.phtml index ba98f5caeb15a..c102b21830de8 100644 --- a/app/code/Magento/Paypal/view/frontend/templates/express/in-context/component.phtml +++ b/app/code/Magento/Paypal/view/frontend/templates/express/in-context/component.phtml @@ -3,12 +3,12 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ -use Magento\Paypal\Block\Express\InContext\Minicart\Button; +use Magento\Paypal\Block\Express\InContext\Minicart\SmartButton; /** @var \Magento\Paypal\Block\Express\InContext\Component $block */ $configuration = [ - 'id' => Button::PAYPAL_BUTTON_ID, + 'id' => SmartButton::PAYPAL_BUTTON_ID, 'path' => $block->getUrl( 'paypal/express/gettoken', [ @@ -21,17 +21,18 @@ $configuration = [ 'locale' => $block->getLocale(), 'environment' => $block->getEnvironment(), 'button' => [ - Button::PAYPAL_BUTTON_ID, + SmartButton::PAYPAL_BUTTON_ID, ] ] ]; ?> -<div style="display: none;" id="<?= /* @noEscape */ Button::PAYPAL_BUTTON_ID ?>"></div> +<div style="display: none;" id="<?= /* @noEscape */ SmartButton::PAYPAL_BUTTON_ID ?>"></div> <script type="text/x-magento-init"> { "*": { - "Magento_Paypal/js/in-context/express-checkout": <?= /* @noEscape */ $this->helper(\Magento\Framework\Json\Helper\Data::class)->jsonEncode($configuration) ?> + "Magento_Paypal/js/in-context/express-checkout": + <?= /* @noEscape */ $this->helper(\Magento\Framework\Json\Helper\Data::class)->jsonEncode($configuration) ?> } } </script> diff --git a/app/code/Magento/Persistent/Test/Mftf/Test/StorefrontVerifyShoppingCartPersistenceUnderLongTermCookieTest.xml b/app/code/Magento/Persistent/Test/Mftf/Test/StorefrontVerifyShoppingCartPersistenceUnderLongTermCookieTest.xml index 2aa43e9ef828d..dd24c6ae4279d 100644 --- a/app/code/Magento/Persistent/Test/Mftf/Test/StorefrontVerifyShoppingCartPersistenceUnderLongTermCookieTest.xml +++ b/app/code/Magento/Persistent/Test/Mftf/Test/StorefrontVerifyShoppingCartPersistenceUnderLongTermCookieTest.xml @@ -38,7 +38,7 @@ <deleteData createDataKey="createSimple1" stepKey="deleteSimple1"/> <deleteData createDataKey="createSimple2" stepKey="deleteSimple2"/> <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> - <actionGroup ref="LoginAsAdmin" stepKey="LoginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="LoginAsAdmin"/> <actionGroup ref="AdminDeleteCustomerActionGroup" stepKey="deleteJohnSmithCustomer"> <argument name="customerEmail" value="John_Smith_Customer.email"/> </actionGroup> diff --git a/app/code/Magento/Persistent/Test/Mftf/Test/StorefrontVerifyThatInformationAboutViewingComparisonWishlistIsPersistedUnderLongTermCookieTest.xml b/app/code/Magento/Persistent/Test/Mftf/Test/StorefrontVerifyThatInformationAboutViewingComparisonWishlistIsPersistedUnderLongTermCookieTest.xml index 1f84200f856d9..461304ef7aeaa 100644 --- a/app/code/Magento/Persistent/Test/Mftf/Test/StorefrontVerifyThatInformationAboutViewingComparisonWishlistIsPersistedUnderLongTermCookieTest.xml +++ b/app/code/Magento/Persistent/Test/Mftf/Test/StorefrontVerifyThatInformationAboutViewingComparisonWishlistIsPersistedUnderLongTermCookieTest.xml @@ -36,7 +36,7 @@ </createData> <createData entity="Simple_US_Customer" stepKey="createCustomer"/> - <actionGroup ref="LoginAsAdmin" stepKey="login"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="login"/> <actionGroup ref="AdminCreateRecentlyProductsWidgetActionGroup" stepKey="createRecentlyComparedProductsWidget"> <argument name="widget" value="RecentlyComparedProductsWidget"/> </actionGroup> diff --git a/app/code/Magento/ProductVideo/Test/Mftf/Test/AdminValidateUrlOnGetVideoInformationTest.xml b/app/code/Magento/ProductVideo/Test/Mftf/Test/AdminValidateUrlOnGetVideoInformationTest.xml index 440846e073f1b..96aa49a53081b 100644 --- a/app/code/Magento/ProductVideo/Test/Mftf/Test/AdminValidateUrlOnGetVideoInformationTest.xml +++ b/app/code/Magento/ProductVideo/Test/Mftf/Test/AdminValidateUrlOnGetVideoInformationTest.xml @@ -20,7 +20,7 @@ </skip> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <createData entity="ProductVideoYoutubeApiKeyConfig" stepKey="setStoreConfig"/> </before> <after> diff --git a/app/code/Magento/ProductVideo/Test/Mftf/Test/YoutubeVideoWindowOnProductPageTest.xml b/app/code/Magento/ProductVideo/Test/Mftf/Test/YoutubeVideoWindowOnProductPageTest.xml index dc9b74a8be36b..92ea0aa86000f 100644 --- a/app/code/Magento/ProductVideo/Test/Mftf/Test/YoutubeVideoWindowOnProductPageTest.xml +++ b/app/code/Magento/ProductVideo/Test/Mftf/Test/YoutubeVideoWindowOnProductPageTest.xml @@ -24,7 +24,7 @@ <before> <!--Log In--> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <!--Create category--> <createData entity="_defaultCategory" stepKey="createCategory"/> <!--Create product--> diff --git a/app/code/Magento/Quote/Model/Cart/CartTotalRepository.php b/app/code/Magento/Quote/Model/Cart/CartTotalRepository.php index 2c487cdea63fa..8f7e6504cb7d8 100644 --- a/app/code/Magento/Quote/Model/Cart/CartTotalRepository.php +++ b/app/code/Magento/Quote/Model/Cart/CartTotalRepository.php @@ -3,6 +3,9 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ + +declare(strict_types=1); + namespace Magento\Quote\Model\Cart; use Magento\Quote\Api; @@ -12,9 +15,11 @@ use Magento\Framework\Api\ExtensibleDataInterface; use Magento\Quote\Model\Cart\Totals\ItemConverter; use Magento\Quote\Api\CouponManagementInterface; +use Magento\Quote\Api\Data\TotalsInterface as QuoteTotalsInterface; /** * Cart totals data object. + * * @SuppressWarnings(PHPMD.CouplingBetweenObjects) */ class CartTotalRepository implements CartTotalRepositoryInterface @@ -79,11 +84,8 @@ public function __construct( /** * @inheritdoc - * - * @param int $cartId The cart ID. - * @return Totals Quote totals data. */ - public function get($cartId) + public function get($cartId): QuoteTotalsInterface { /** @var \Magento\Quote\Model\Quote $quote */ $quote = $this->quoteRepository->getActive($cartId); @@ -96,17 +98,14 @@ public function get($cartId) } unset($addressTotalsData[ExtensibleDataInterface::EXTENSION_ATTRIBUTES_KEY]); - /** @var \Magento\Quote\Api\Data\TotalsInterface $quoteTotals */ + /** @var QuoteTotalsInterface $quoteTotals */ $quoteTotals = $this->totalsFactory->create(); $this->dataObjectHelper->populateWithArray( $quoteTotals, $addressTotalsData, - \Magento\Quote\Api\Data\TotalsInterface::class + QuoteTotalsInterface::class ); - $items = []; - foreach ($quote->getAllVisibleItems() as $index => $item) { - $items[$index] = $this->itemConverter->modelToDataObject($item); - } + $items = array_map([$this->itemConverter, 'modelToDataObject'], $quote->getAllVisibleItems()); $calculatedTotals = $this->totalsConverter->process($addressTotals); $quoteTotals->setTotalSegments($calculatedTotals); diff --git a/app/code/Magento/Quote/Test/Mftf/Test/StorefrontGuestCheckoutDisabledProductTest.xml b/app/code/Magento/Quote/Test/Mftf/Test/StorefrontGuestCheckoutDisabledProductTest.xml index 5f5138d6b9495..12427c2caec25 100644 --- a/app/code/Magento/Quote/Test/Mftf/Test/StorefrontGuestCheckoutDisabledProductTest.xml +++ b/app/code/Magento/Quote/Test/Mftf/Test/StorefrontGuestCheckoutDisabledProductTest.xml @@ -103,7 +103,7 @@ <waitForElement selector="{{StorefrontMessagesSection.messageProductAddedToCart($$createConfigProduct.name$$)}}" time="30" stepKey="assertMessage"/> <!--Disabled via admin panel--> <openNewTab stepKey="openNewTab"/> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <!-- Find the first simple product that we just created using the product grid and go to its page--> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="visitAdminProductPage"/> <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="findCreatedProduct"> diff --git a/app/code/Magento/Quote/Test/Unit/Model/Cart/CartTotalRepositoryTest.php b/app/code/Magento/Quote/Test/Unit/Model/Cart/CartTotalRepositoryTest.php index 804f0863d2d2a..8c67ff4314b17 100644 --- a/app/code/Magento/Quote/Test/Unit/Model/Cart/CartTotalRepositoryTest.php +++ b/app/code/Magento/Quote/Test/Unit/Model/Cart/CartTotalRepositoryTest.php @@ -4,73 +4,104 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ + +declare(strict_types=1); + namespace Magento\Quote\Test\Unit\Model\Cart; -use Magento\Framework\TestFramework\Unit\Helper\ObjectManager; +use Magento\Framework\Api\DataObjectHelper; +use Magento\Framework\TestFramework\Unit\Helper\ObjectManager as ObjectManagerHelper; +use Magento\Quote\Api\CartRepositoryInterface; +use Magento\Quote\Api\CouponManagementInterface; +use Magento\Quote\Api\Data\TotalSegmentInterface; +use Magento\Quote\Model\Cart\CartTotalRepository; +use Magento\Quote\Model\Cart\Totals\ItemConverter; +use Magento\Quote\Model\Quote; +use Magento\Quote\Model\Quote\Address; +use Magento\Quote\Model\Quote\Item as QuoteItem; +use Magento\Quote\Model\Cart\TotalsConverter; +use Magento\Quote\Api\Data\TotalsInterfaceFactory; +use Magento\Quote\Api\Data\TotalsInterface as QuoteTotalsInterface; +use PHPUnit\Framework\TestCase; +use PHPUnit\Framework\MockObject\MockObject; /** + * Test Cart totals object for class \Magento\Quote\Model\Cart\CartTotalRepository + * * @SuppressWarnings(PHPMD.CouplingBetweenObjects) */ -class CartTotalRepositoryTest extends \PHPUnit\Framework\TestCase +class CartTotalRepositoryTest extends TestCase { + private const STUB_CART_ID = 12; + + private const STUB_ITEMS_QTY = 100; + + private const STUB_CURRENCY_CODE = 'en_US'; + + private const STUB_COUPON = 'coupon'; + /** - * @var ObjectManager + * @var ObjectManagerHelper */ protected $objectManager; /** - * @var \PHPUnit_Framework_MockObject_MockObject + * @var ItemConverter|MockObject */ protected $converterMock; /** - * @var \Magento\Quote\Model\Cart\CartTotalRepository + * @var CartTotalRepository */ protected $model; /** - * @var \PHPUnit_Framework_MockObject_MockObject + * @var CartRepositoryInterface|MockObject */ private $quoteRepositoryMock; /** - * @var \PHPUnit_Framework_MockObject_MockObject + * @var MockObject */ private $quoteMock; /** - * @var \PHPUnit_Framework_MockObject_MockObject + * @var TotalsInterfaceFactory|MockObject */ private $totalsFactoryMock; /** - * @var \PHPUnit_Framework_MockObject_MockObject + * @var MockObject */ protected $addressMock; /** - * @var \Magento\Framework\Api\DataObjectHelper|\PHPUnit_Framework_MockObject_MockObject + * @var DataObjectHelper|MockObject */ protected $dataObjectHelperMock; /** - * @var \PHPUnit_Framework_MockObject_MockObject + * @var CouponManagementInterface|MockObject */ protected $couponServiceMock; /** - * @var \PHPUnit_Framework_MockObject_MockObject + * @var TotalsConverter|MockObject */ protected $totalsConverterMock; protected function setUp() { - $this->objectManager = new ObjectManager($this); + $this->objectManager = new ObjectManagerHelper($this); $this->totalsFactoryMock = $this->createPartialMock( - \Magento\Quote\Api\Data\TotalsInterfaceFactory::class, - ['create'] + TotalsInterfaceFactory::class, + [ + 'create' + ] ); - $this->quoteMock = $this->createPartialMock(\Magento\Quote\Model\Quote::class, [ + $this->quoteMock = $this->createPartialMock( + Quote::class, + [ 'isVirtual', 'getShippingAddress', 'getBillingAddress', @@ -79,21 +110,33 @@ protected function setUp() 'getQuoteCurrencyCode', 'getItemsQty', 'collectTotals' - ]); - $this->quoteRepositoryMock = $this->createMock(\Magento\Quote\Api\CartRepositoryInterface::class); + ] + ); + $this->quoteRepositoryMock = $this->createMock( + CartRepositoryInterface::class + ); $this->addressMock = $this->createPartialMock( - \Magento\Quote\Model\Quote\Address::class, - ['getData', 'getTotals'] + Address::class, + [ + 'getData', + 'getTotals' + ] + ); + $this->dataObjectHelperMock = $this->getMockBuilder( + DataObjectHelper::class + )->disableOriginalConstructor()->getMock(); + $this->converterMock = $this->createMock( + ItemConverter::class ); - $this->dataObjectHelperMock = $this->getMockBuilder(\Magento\Framework\Api\DataObjectHelper::class) - ->disableOriginalConstructor() - ->getMock(); - $this->converterMock = $this->createMock(\Magento\Quote\Model\Cart\Totals\ItemConverter::class); - $this->couponServiceMock = $this->createMock(\Magento\Quote\Api\CouponManagementInterface::class); - $this->totalsConverterMock = $this->createMock(\Magento\Quote\Model\Cart\TotalsConverter::class); + $this->couponServiceMock = $this->createMock( + CouponManagementInterface::class + ); + $this->totalsConverterMock = $this->createMock( + TotalsConverter::class + ); - $this->model = new \Magento\Quote\Model\Cart\CartTotalRepository( + $this->model = new CartTotalRepository( $this->totalsFactoryMock, $this->quoteRepositoryMock, $this->dataObjectHelperMock, @@ -104,17 +147,18 @@ protected function setUp() } /** + * Test get cart total + * * @param bool $isVirtual * @param string $getAddressType * @dataProvider getDataProvider + * + * @return void */ - public function testGet($isVirtual, $getAddressType) + public function testGetCartTotal($isVirtual, $getAddressType): void { - $cartId = 12; - $itemsQty = 100; - $coupon = 'coupon'; $addressTotals = ['address' => 'totals']; - $itemMock = $this->createMock(\Magento\Quote\Model\Quote\Item::class); + $itemMock = $this->createMock(QuoteItem::class); $visibleItems = [ 11 => $itemMock, ]; @@ -122,52 +166,95 @@ public function testGet($isVirtual, $getAddressType) 'name' => 'item', 'options' => [ 4 => ['label' => 'justLabel']], ]; - $currencyCode = 'US'; - $this->quoteRepositoryMock->expects($this->once()) ->method('getActive') - ->with($cartId) + ->with(self::STUB_CART_ID) ->willReturn($this->quoteMock); - $this->quoteMock->expects($this->once())->method('isVirtual')->willReturn($isVirtual); - $this->quoteMock->expects($this->exactly(2))->method($getAddressType)->willReturn($this->addressMock); - $this->quoteMock->expects($this->once())->method('getAllVisibleItems')->willReturn($visibleItems); - $this->quoteMock->expects($this->once())->method('getBaseCurrencyCode')->willReturn($currencyCode); - $this->quoteMock->expects($this->once())->method('getQuoteCurrencyCode')->willReturn($currencyCode); - $this->quoteMock->expects($this->once())->method('getItemsQty')->willReturn($itemsQty); - $this->addressMock->expects($this->any())->method('getData')->willReturn($addressTotals); - $this->addressMock->expects($this->once())->method('getTotals')->willReturn($addressTotals); - - $totalsMock = $this->createMock(\Magento\Quote\Api\Data\TotalsInterface::class); - $this->totalsFactoryMock->expects($this->once())->method('create')->willReturn($totalsMock); + $this->quoteMock->expects($this->once()) + ->method('isVirtual') + ->willReturn($isVirtual); + $this->quoteMock->expects($this->exactly(2)) + ->method($getAddressType) + ->willReturn($this->addressMock); + $this->quoteMock->expects($this->once()) + ->method('getAllVisibleItems') + ->willReturn($visibleItems); + $this->quoteMock->expects($this->once()) + ->method('getBaseCurrencyCode') + ->willReturn(self::STUB_CURRENCY_CODE); + $this->quoteMock->expects($this->once()) + ->method('getQuoteCurrencyCode') + ->willReturn(self::STUB_CURRENCY_CODE); + $this->quoteMock->expects($this->once()) + ->method('getItemsQty') + ->willReturn(self::STUB_ITEMS_QTY); + $this->addressMock->expects($this->any()) + ->method('getData') + ->willReturn($addressTotals); + $this->addressMock->expects($this->once()) + ->method('getTotals') + ->willReturn($addressTotals); + + $totalsMock = $this->createMock(QuoteTotalsInterface::class); + $this->totalsFactoryMock->expects($this->once()) + ->method('create') + ->willReturn($totalsMock); $this->dataObjectHelperMock->expects($this->once())->method('populateWithArray'); $this->converterMock->expects($this->once()) ->method('modelToDataObject') ->with($itemMock) ->willReturn($itemArray); - $totalSegmentsMock = $this->createMock(\Magento\Quote\Api\Data\TotalSegmentInterface::class); + $totalSegmentsMock = $this->createMock(TotalSegmentInterface::class); $this->totalsConverterMock->expects($this->once()) ->method('process') ->with($addressTotals) ->willReturn($totalSegmentsMock); - $this->couponServiceMock->expects($this->once())->method('get')->with($cartId)->willReturn($coupon); + $this->couponServiceMock + ->expects($this->once()) + ->method('get') + ->with(self::STUB_CART_ID) + ->willReturn(self::STUB_COUPON); - $totalsMock->expects($this->once())->method('setItems')->with([11 => $itemArray])->willReturnSelf(); - $totalsMock->expects($this->once())->method('setTotalSegments')->with($totalSegmentsMock)->willReturnSelf(); - $totalsMock->expects($this->once())->method('setCouponCode')->with($coupon)->willReturnSelf(); - $totalsMock->expects($this->once())->method('setGrandTotal')->willReturnSelf(); - $totalsMock->expects($this->once())->method('setItemsQty')->with($itemsQty)->willReturnSelf(); - $totalsMock->expects($this->once())->method('setBaseCurrencyCode')->with($currencyCode)->willReturnSelf(); - $totalsMock->expects($this->once())->method('setQuoteCurrencyCode')->with($currencyCode)->willReturnSelf(); + $totalsMock->expects($this->once()) + ->method('setItems') + ->with([11 => $itemArray]) + ->willReturnSelf(); + $totalsMock->expects($this->once()) + ->method('setTotalSegments') + ->with($totalSegmentsMock) + ->willReturnSelf(); + $totalsMock->expects($this->once()) + ->method('setCouponCode') + ->with(self::STUB_COUPON) + ->willReturnSelf(); + $totalsMock->expects($this->once()) + ->method('setGrandTotal') + ->willReturnSelf(); + $totalsMock->expects($this->once()) + ->method('setItemsQty') + ->with(self::STUB_ITEMS_QTY) + ->willReturnSelf(); + $totalsMock->expects($this->once()) + ->method('setBaseCurrencyCode') + ->with(self::STUB_CURRENCY_CODE) + ->willReturnSelf(); + $totalsMock->expects($this->once()) + ->method('setQuoteCurrencyCode') + ->with(self::STUB_CURRENCY_CODE) + ->willReturnSelf(); - $this->assertEquals($totalsMock, $this->model->get($cartId)); + $this->assertEquals($totalsMock, $this->model->get(self::STUB_CART_ID)); } /** + * Provide data for test different cases + * + * @param void * @return array */ - public function getDataProvider() + public function getDataProvider(): array { return [ 'Virtual Quote' => [ diff --git a/app/code/Magento/QuoteGraphQl/Model/Cart/GetShippingAddress.php b/app/code/Magento/QuoteGraphQl/Model/Cart/GetShippingAddress.php index f0b69885b6e40..c68b987fe8a96 100644 --- a/app/code/Magento/QuoteGraphQl/Model/Cart/GetShippingAddress.php +++ b/app/code/Magento/QuoteGraphQl/Model/Cart/GetShippingAddress.php @@ -8,9 +8,9 @@ namespace Magento\QuoteGraphQl\Model\Cart; use Magento\Framework\GraphQl\Exception\GraphQlAuthorizationException; -use Magento\GraphQl\Model\Query\ContextInterface; use Magento\Framework\GraphQl\Exception\GraphQlInputException; use Magento\Framework\GraphQl\Exception\GraphQlNoSuchEntityException; +use Magento\GraphQl\Model\Query\ContextInterface; use Magento\Quote\Model\Quote\Address; /** diff --git a/app/code/Magento/QuoteGraphQl/Model/Cart/SetBillingAddressOnCart.php b/app/code/Magento/QuoteGraphQl/Model/Cart/SetBillingAddressOnCart.php index e600965923c14..497819cbeec3b 100644 --- a/app/code/Magento/QuoteGraphQl/Model/Cart/SetBillingAddressOnCart.php +++ b/app/code/Magento/QuoteGraphQl/Model/Cart/SetBillingAddressOnCart.php @@ -56,23 +56,18 @@ public function execute(ContextInterface $context, CartInterface $cart, array $b { $customerAddressId = $billingAddressInput['customer_address_id'] ?? null; $addressInput = $billingAddressInput['address'] ?? null; + + if (!$customerAddressId && !isset($billingAddressInput['address']['save_in_address_book']) && $addressInput) { + $addressInput['save_in_address_book'] = true; + } + // Need to keep this for BC of `use_for_shipping` field $sameAsShipping = isset($billingAddressInput['use_for_shipping']) ? (bool)$billingAddressInput['use_for_shipping'] : false; $sameAsShipping = isset($billingAddressInput['same_as_shipping']) ? (bool)$billingAddressInput['same_as_shipping'] : $sameAsShipping; - if (null === $customerAddressId && null === $addressInput) { - throw new GraphQlInputException( - __('The billing address must contain either "customer_address_id" or "address".') - ); - } - - if ($customerAddressId && $addressInput) { - throw new GraphQlInputException( - __('The billing address cannot contain "customer_address_id" and "address" at the same time.') - ); - } + $this->checkForInputExceptions($billingAddressInput); $addresses = $cart->getAllShippingAddresses(); if ($sameAsShipping && count($addresses) > 1) { @@ -86,6 +81,31 @@ public function execute(ContextInterface $context, CartInterface $cart, array $b $this->assignBillingAddressToCart->execute($cart, $billingAddress, $sameAsShipping); } + /** + * Check for the input exceptions + * + * @param array $billingAddressInput + * @throws GraphQlInputException + */ + private function checkForInputExceptions( + ?array $billingAddressInput + ) { + $customerAddressId = $billingAddressInput['customer_address_id'] ?? null; + $addressInput = $billingAddressInput['address'] ?? null; + + if (null === $customerAddressId && null === $addressInput) { + throw new GraphQlInputException( + __('The billing address must contain either "customer_address_id" or "address".') + ); + } + + if ($customerAddressId && $addressInput) { + throw new GraphQlInputException( + __('The billing address cannot contain "customer_address_id" and "address" at the same time.') + ); + } + } + /** * Create billing address * diff --git a/app/code/Magento/QuoteGraphQl/Model/Cart/SetShippingAddressesOnCart.php b/app/code/Magento/QuoteGraphQl/Model/Cart/SetShippingAddressesOnCart.php index e058913dde1d3..f73daa715c1df 100644 --- a/app/code/Magento/QuoteGraphQl/Model/Cart/SetShippingAddressesOnCart.php +++ b/app/code/Magento/QuoteGraphQl/Model/Cart/SetShippingAddressesOnCart.php @@ -10,7 +10,6 @@ use Magento\Framework\GraphQl\Exception\GraphQlInputException; use Magento\GraphQl\Model\Query\ContextInterface; use Magento\Quote\Api\Data\CartInterface; -use Magento\Quote\Model\Quote\Address; /** * Set single shipping address for a specified shopping cart @@ -49,7 +48,12 @@ public function execute(ContextInterface $context, CartInterface $cart, array $s __('You cannot specify multiple shipping addresses.') ); } - $shippingAddressInput = current($shippingAddressesInput); + $shippingAddressInput = current($shippingAddressesInput) ?? []; + $customerAddressId = $shippingAddressInput['customer_address_id'] ?? null; + + if (!$customerAddressId && !isset($shippingAddressInput['address']['save_in_address_book'])) { + $shippingAddressInput['address']['save_in_address_book'] = true; + } $shippingAddress = $this->getShippingAddress->execute($context, $shippingAddressInput); diff --git a/app/code/Magento/QuoteGraphQl/etc/schema.graphqls b/app/code/Magento/QuoteGraphQl/etc/schema.graphqls index d334d56c85aac..1ca00d5ef7bdc 100644 --- a/app/code/Magento/QuoteGraphQl/etc/schema.graphqls +++ b/app/code/Magento/QuoteGraphQl/etc/schema.graphqls @@ -112,7 +112,7 @@ input CartAddressInput { postcode: String country_code: String! telephone: String! - save_in_address_book: Boolean + save_in_address_book: Boolean @doc(description: "Determines whether to save the address in the customer's address book. The default value is true") } input SetShippingMethodsOnCartInput { diff --git a/app/code/Magento/Reports/Test/Mftf/Test/AdminReportsAbandonedCartsNavigateMenuTest.xml b/app/code/Magento/Reports/Test/Mftf/Test/AdminReportsAbandonedCartsNavigateMenuTest.xml index b044b7a9b1f79..6daf322dd5b10 100644 --- a/app/code/Magento/Reports/Test/Mftf/Test/AdminReportsAbandonedCartsNavigateMenuTest.xml +++ b/app/code/Magento/Reports/Test/Mftf/Test/AdminReportsAbandonedCartsNavigateMenuTest.xml @@ -20,7 +20,7 @@ <group value="mtf_migrated"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="LoginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="LoginAsAdmin"/> </before> <after> <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> diff --git a/app/code/Magento/Reports/Test/Mftf/Test/AdminReportsBestsellersNavigateMenuTest.xml b/app/code/Magento/Reports/Test/Mftf/Test/AdminReportsBestsellersNavigateMenuTest.xml index 2c78a9568325b..546b7ad167c25 100644 --- a/app/code/Magento/Reports/Test/Mftf/Test/AdminReportsBestsellersNavigateMenuTest.xml +++ b/app/code/Magento/Reports/Test/Mftf/Test/AdminReportsBestsellersNavigateMenuTest.xml @@ -20,7 +20,7 @@ <group value="mtf_migrated"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="LoginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="LoginAsAdmin"/> </before> <after> <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> diff --git a/app/code/Magento/Reports/Test/Mftf/Test/AdminReportsCouponsNavigateMenuTest.xml b/app/code/Magento/Reports/Test/Mftf/Test/AdminReportsCouponsNavigateMenuTest.xml index ff3372285b211..14db012e76888 100644 --- a/app/code/Magento/Reports/Test/Mftf/Test/AdminReportsCouponsNavigateMenuTest.xml +++ b/app/code/Magento/Reports/Test/Mftf/Test/AdminReportsCouponsNavigateMenuTest.xml @@ -20,7 +20,7 @@ <group value="mtf_migrated"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="LoginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="LoginAsAdmin"/> </before> <after> <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> diff --git a/app/code/Magento/Reports/Test/Mftf/Test/AdminReportsDownloadsNavigateMenuTest.xml b/app/code/Magento/Reports/Test/Mftf/Test/AdminReportsDownloadsNavigateMenuTest.xml index 05ee0a8032fb5..fe578210d13a7 100644 --- a/app/code/Magento/Reports/Test/Mftf/Test/AdminReportsDownloadsNavigateMenuTest.xml +++ b/app/code/Magento/Reports/Test/Mftf/Test/AdminReportsDownloadsNavigateMenuTest.xml @@ -20,7 +20,7 @@ <group value="mtf_migrated"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="LoginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="LoginAsAdmin"/> </before> <after> <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> diff --git a/app/code/Magento/Reports/Test/Mftf/Test/AdminReportsInvoicedNavigateMenuTest.xml b/app/code/Magento/Reports/Test/Mftf/Test/AdminReportsInvoicedNavigateMenuTest.xml index f28ffc700c34a..e9ed4caa7ef03 100644 --- a/app/code/Magento/Reports/Test/Mftf/Test/AdminReportsInvoicedNavigateMenuTest.xml +++ b/app/code/Magento/Reports/Test/Mftf/Test/AdminReportsInvoicedNavigateMenuTest.xml @@ -20,7 +20,7 @@ <group value="mtf_migrated"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="LoginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="LoginAsAdmin"/> </before> <after> <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> diff --git a/app/code/Magento/Reports/Test/Mftf/Test/AdminReportsLowStockDisableProductTest.xml b/app/code/Magento/Reports/Test/Mftf/Test/AdminReportsLowStockDisableProductTest.xml index 841ba89b643bf..c74e4651346d0 100644 --- a/app/code/Magento/Reports/Test/Mftf/Test/AdminReportsLowStockDisableProductTest.xml +++ b/app/code/Magento/Reports/Test/Mftf/Test/AdminReportsLowStockDisableProductTest.xml @@ -15,14 +15,14 @@ <description value="A product must don't presents on 'Low Stock' report if the product is disabled."/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <!-- Created disabled simple product with stock quantity zero --> <createData entity="SimpleProductDisabledStockQuantityZero" stepKey="createProduct"/> </before> <after> <deleteData createDataKey="createProduct" stepKey="deleteProduct"/> - <actionGroup ref="logout" stepKey="logout"/> + <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> </after> <actionGroup ref="AdminNavigateMenuActionGroup" stepKey="navigateToReportsLowStockPage"> diff --git a/app/code/Magento/Reports/Test/Mftf/Test/AdminReportsLowStockNavigateMenuTest.xml b/app/code/Magento/Reports/Test/Mftf/Test/AdminReportsLowStockNavigateMenuTest.xml index 986101a8c0db8..ce2c3f5084a21 100644 --- a/app/code/Magento/Reports/Test/Mftf/Test/AdminReportsLowStockNavigateMenuTest.xml +++ b/app/code/Magento/Reports/Test/Mftf/Test/AdminReportsLowStockNavigateMenuTest.xml @@ -20,7 +20,7 @@ <group value="mtf_migrated"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="LoginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="LoginAsAdmin"/> </before> <after> <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> diff --git a/app/code/Magento/Reports/Test/Mftf/Test/AdminReportsNewNavigateMenuTest.xml b/app/code/Magento/Reports/Test/Mftf/Test/AdminReportsNewNavigateMenuTest.xml index dd97d092041ca..3b308edffeb2b 100644 --- a/app/code/Magento/Reports/Test/Mftf/Test/AdminReportsNewNavigateMenuTest.xml +++ b/app/code/Magento/Reports/Test/Mftf/Test/AdminReportsNewNavigateMenuTest.xml @@ -20,7 +20,7 @@ <group value="mtf_migrated"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="LoginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="LoginAsAdmin"/> </before> <after> <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> diff --git a/app/code/Magento/Reports/Test/Mftf/Test/AdminReportsOrderCountNavigateMenuTest.xml b/app/code/Magento/Reports/Test/Mftf/Test/AdminReportsOrderCountNavigateMenuTest.xml index 638cc30279966..9a3f7ae5cee33 100644 --- a/app/code/Magento/Reports/Test/Mftf/Test/AdminReportsOrderCountNavigateMenuTest.xml +++ b/app/code/Magento/Reports/Test/Mftf/Test/AdminReportsOrderCountNavigateMenuTest.xml @@ -20,7 +20,7 @@ <group value="mtf_migrated"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="LoginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="LoginAsAdmin"/> </before> <after> <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> diff --git a/app/code/Magento/Reports/Test/Mftf/Test/AdminReportsOrderTotalNavigateMenuTest.xml b/app/code/Magento/Reports/Test/Mftf/Test/AdminReportsOrderTotalNavigateMenuTest.xml index c1c8256e3d331..be8fc67317be0 100644 --- a/app/code/Magento/Reports/Test/Mftf/Test/AdminReportsOrderTotalNavigateMenuTest.xml +++ b/app/code/Magento/Reports/Test/Mftf/Test/AdminReportsOrderTotalNavigateMenuTest.xml @@ -20,7 +20,7 @@ <group value="mtf_migrated"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="LoginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="LoginAsAdmin"/> </before> <after> <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> diff --git a/app/code/Magento/Reports/Test/Mftf/Test/AdminReportsOrderedGroupedBySkuTest.xml b/app/code/Magento/Reports/Test/Mftf/Test/AdminReportsOrderedGroupedBySkuTest.xml index 52c0e49ee9291..6d0b335ac7094 100644 --- a/app/code/Magento/Reports/Test/Mftf/Test/AdminReportsOrderedGroupedBySkuTest.xml +++ b/app/code/Magento/Reports/Test/Mftf/Test/AdminReportsOrderedGroupedBySkuTest.xml @@ -15,7 +15,7 @@ </annotations> <before> <createData entity="_defaultCategory" stepKey="createCategory"/> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <actionGroup ref="CreateConfigurableProductActionGroup" stepKey="createConfigurableProduct"> <argument name="product" value="_defaultProduct"/> <argument name="category" value="$$createCategory$$"/> diff --git a/app/code/Magento/Reports/Test/Mftf/Test/AdminReportsOrderedNavigateMenuTest.xml b/app/code/Magento/Reports/Test/Mftf/Test/AdminReportsOrderedNavigateMenuTest.xml index 9053fb35150b6..40e1005ec7c8c 100644 --- a/app/code/Magento/Reports/Test/Mftf/Test/AdminReportsOrderedNavigateMenuTest.xml +++ b/app/code/Magento/Reports/Test/Mftf/Test/AdminReportsOrderedNavigateMenuTest.xml @@ -20,7 +20,7 @@ <group value="mtf_migrated"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="LoginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="LoginAsAdmin"/> </before> <after> <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> diff --git a/app/code/Magento/Reports/Test/Mftf/Test/AdminReportsOrdersNavigateMenuTest.xml b/app/code/Magento/Reports/Test/Mftf/Test/AdminReportsOrdersNavigateMenuTest.xml index 77fd6c46196af..ed7eff4430030 100644 --- a/app/code/Magento/Reports/Test/Mftf/Test/AdminReportsOrdersNavigateMenuTest.xml +++ b/app/code/Magento/Reports/Test/Mftf/Test/AdminReportsOrdersNavigateMenuTest.xml @@ -20,7 +20,7 @@ <group value="mtf_migrated"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="LoginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="LoginAsAdmin"/> </before> <after> <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> diff --git a/app/code/Magento/Reports/Test/Mftf/Test/AdminReportsProductsInCartNavigateMenuTest.xml b/app/code/Magento/Reports/Test/Mftf/Test/AdminReportsProductsInCartNavigateMenuTest.xml index 00b93b0a93180..0ae7b79f2458d 100644 --- a/app/code/Magento/Reports/Test/Mftf/Test/AdminReportsProductsInCartNavigateMenuTest.xml +++ b/app/code/Magento/Reports/Test/Mftf/Test/AdminReportsProductsInCartNavigateMenuTest.xml @@ -20,7 +20,7 @@ <group value="mtf_migrated"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="LoginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="LoginAsAdmin"/> </before> <after> <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> diff --git a/app/code/Magento/Reports/Test/Mftf/Test/AdminReportsRefreshStatisticsNavigateMenuTest.xml b/app/code/Magento/Reports/Test/Mftf/Test/AdminReportsRefreshStatisticsNavigateMenuTest.xml index 94290b918969d..d8bc9d1a4444a 100644 --- a/app/code/Magento/Reports/Test/Mftf/Test/AdminReportsRefreshStatisticsNavigateMenuTest.xml +++ b/app/code/Magento/Reports/Test/Mftf/Test/AdminReportsRefreshStatisticsNavigateMenuTest.xml @@ -20,7 +20,7 @@ <group value="mtf_migrated"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="LoginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="LoginAsAdmin"/> </before> <after> <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> diff --git a/app/code/Magento/Reports/Test/Mftf/Test/AdminReportsTaxNavigateMenuTest.xml b/app/code/Magento/Reports/Test/Mftf/Test/AdminReportsTaxNavigateMenuTest.xml index 6b34f51c39d88..f8091d4f63101 100644 --- a/app/code/Magento/Reports/Test/Mftf/Test/AdminReportsTaxNavigateMenuTest.xml +++ b/app/code/Magento/Reports/Test/Mftf/Test/AdminReportsTaxNavigateMenuTest.xml @@ -20,7 +20,7 @@ <group value="mtf_migrated"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="LoginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="LoginAsAdmin"/> </before> <after> <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> diff --git a/app/code/Magento/Reports/Test/Mftf/Test/AdminReportsViewsNavigateMenuTest.xml b/app/code/Magento/Reports/Test/Mftf/Test/AdminReportsViewsNavigateMenuTest.xml index ff259cc5870ff..0002050bff957 100644 --- a/app/code/Magento/Reports/Test/Mftf/Test/AdminReportsViewsNavigateMenuTest.xml +++ b/app/code/Magento/Reports/Test/Mftf/Test/AdminReportsViewsNavigateMenuTest.xml @@ -20,7 +20,7 @@ <group value="mtf_migrated"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="LoginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="LoginAsAdmin"/> </before> <after> <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> diff --git a/app/code/Magento/Reports/Test/Mftf/Test/CancelOrdersInOrderSalesReportTest.xml b/app/code/Magento/Reports/Test/Mftf/Test/CancelOrdersInOrderSalesReportTest.xml index 41b917c4c1371..e572febec5a5c 100644 --- a/app/code/Magento/Reports/Test/Mftf/Test/CancelOrdersInOrderSalesReportTest.xml +++ b/app/code/Magento/Reports/Test/Mftf/Test/CancelOrdersInOrderSalesReportTest.xml @@ -21,7 +21,7 @@ <before> <!-- log in as admin --> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <!-- create new product --> <createData entity="_defaultCategory" stepKey="createCategory"/> diff --git a/app/code/Magento/Review/Test/Mftf/ActionGroup/AdminFilterCustomerReviewActionGroup.xml b/app/code/Magento/Review/Test/Mftf/ActionGroup/AdminFilterCustomerReviewActionGroup.xml new file mode 100644 index 0000000000000..971ec2dae2072 --- /dev/null +++ b/app/code/Magento/Review/Test/Mftf/ActionGroup/AdminFilterCustomerReviewActionGroup.xml @@ -0,0 +1,21 @@ +<?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="AdminFilterCustomerReviewActionGroup"> + <arguments> + <argument name="reviewCount" type="string" defaultValue="0"/> + </arguments> + <!--Sort Review Column in Grid --> + <waitForPageLoad stepKey="waitForGridToAppear"/> + <fillField userInput="{{reviewCount}}" selector="{{AdminCreateNewReviewSection.gridCustomer_filter_review_cnt}}" stepKey="searchReview"/> + <click selector="{{AdminCreateNewReviewSection.CustomerSearchButton}}" stepKey="startSearch"/> + <waitForPageLoad stepKey="waitForResults"/> + <see userInput="{{reviewCount}}" selector="{{AdminCreateNewReviewSection.gridReviewColumn}}" stepKey="assertReviewColumn"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Review/Test/Mftf/Test/AdminMarketingPendingReviewsNavigateMenuActiveTest.xml b/app/code/Magento/Review/Test/Mftf/Test/AdminMarketingPendingReviewsNavigateMenuActiveTest.xml index f1bba674ac5eb..5ff1ed0a1062b 100644 --- a/app/code/Magento/Review/Test/Mftf/Test/AdminMarketingPendingReviewsNavigateMenuActiveTest.xml +++ b/app/code/Magento/Review/Test/Mftf/Test/AdminMarketingPendingReviewsNavigateMenuActiveTest.xml @@ -16,10 +16,10 @@ <group value="menu"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="LoginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="LoginAsAdmin"/> </before> <after> - <actionGroup ref="logout" stepKey="logout"/> + <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> </after> <actionGroup ref="AdminNavigateMenuActionGroup" stepKey="navigateToReportsViewsPage"> <argument name="menuUiId" value="{{AdminMenuMarketing.dataUiId}}"/> diff --git a/app/code/Magento/Review/Test/Mftf/Test/AdminMarketingReviewsNavigateMenuTest.xml b/app/code/Magento/Review/Test/Mftf/Test/AdminMarketingReviewsNavigateMenuTest.xml index 5f0bf53012126..5198949a61024 100644 --- a/app/code/Magento/Review/Test/Mftf/Test/AdminMarketingReviewsNavigateMenuTest.xml +++ b/app/code/Magento/Review/Test/Mftf/Test/AdminMarketingReviewsNavigateMenuTest.xml @@ -20,7 +20,7 @@ <group value="mtf_migrated"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="LoginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="LoginAsAdmin"/> </before> <after> <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> diff --git a/app/code/Magento/Review/Test/Mftf/Test/AdminReportsByCustomersNavigateMenuTest.xml b/app/code/Magento/Review/Test/Mftf/Test/AdminReportsByCustomersNavigateMenuTest.xml index bc8b5655ad537..c6ef740f69e8f 100644 --- a/app/code/Magento/Review/Test/Mftf/Test/AdminReportsByCustomersNavigateMenuTest.xml +++ b/app/code/Magento/Review/Test/Mftf/Test/AdminReportsByCustomersNavigateMenuTest.xml @@ -20,7 +20,7 @@ <group value="mtf_migrated"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="LoginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="LoginAsAdmin"/> </before> <after> <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> diff --git a/app/code/Magento/Review/Test/Mftf/Test/AdminReportsByProductsNavigateMenuTest.xml b/app/code/Magento/Review/Test/Mftf/Test/AdminReportsByProductsNavigateMenuTest.xml index cab50343efb54..97d0498c5fd22 100644 --- a/app/code/Magento/Review/Test/Mftf/Test/AdminReportsByProductsNavigateMenuTest.xml +++ b/app/code/Magento/Review/Test/Mftf/Test/AdminReportsByProductsNavigateMenuTest.xml @@ -20,7 +20,7 @@ <group value="mtf_migrated"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="LoginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="LoginAsAdmin"/> </before> <after> <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> diff --git a/app/code/Magento/Review/Test/Mftf/Test/AdminReviewsByProductsReportTest.xml b/app/code/Magento/Review/Test/Mftf/Test/AdminReviewsByProductsReportTest.xml index 050f30d6ca65f..0809ad0fa8541 100644 --- a/app/code/Magento/Review/Test/Mftf/Test/AdminReviewsByProductsReportTest.xml +++ b/app/code/Magento/Review/Test/Mftf/Test/AdminReviewsByProductsReportTest.xml @@ -15,11 +15,11 @@ <title value="Admin Reports Review by Products"/> <description value="Review By Products Grid Filters"/> <severity value="AVERAGE"/> - <testCaseId value="MC-32083"/> + <testCaseId value="MC-32333"/> </annotations> <before> <!--Login--> - <actionGroup ref="LoginAsAdmin" stepKey="LoginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="LoginAsAdmin"/> <!--Create product and Category--> <createData stepKey="category" entity="SimpleSubCategory"/> <createData stepKey="createProduct1" entity="SimpleProduct"> @@ -38,7 +38,7 @@ <deleteData createDataKey="createProduct2" stepKey="deleteProduct2"/> <deleteData createDataKey="category" stepKey="deleteCategory"/> <!--Logout--> - <actionGroup ref="logout" stepKey="logout"/> + <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> </after> <!-- Navigate to Marketing > User Content> All Review --> <amOnPage url="{{AdminReviewsPage.url}}" stepKey="openReviewsPage"/> diff --git a/app/code/Magento/Review/Test/Mftf/Test/AdminStoresRatingNavigateMenuTest.xml b/app/code/Magento/Review/Test/Mftf/Test/AdminStoresRatingNavigateMenuTest.xml index ad211a2ee0ec8..ea03f557962ad 100644 --- a/app/code/Magento/Review/Test/Mftf/Test/AdminStoresRatingNavigateMenuTest.xml +++ b/app/code/Magento/Review/Test/Mftf/Test/AdminStoresRatingNavigateMenuTest.xml @@ -20,7 +20,7 @@ <group value="mtf_migrated"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="LoginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="LoginAsAdmin"/> </before> <after> <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> diff --git a/app/code/Magento/Review/Test/Mftf/Test/AdminVerifyNewRatingFormSingleStoreModeNoTest.xml b/app/code/Magento/Review/Test/Mftf/Test/AdminVerifyNewRatingFormSingleStoreModeNoTest.xml index f6e80119610c0..e9a08a3e196f5 100644 --- a/app/code/Magento/Review/Test/Mftf/Test/AdminVerifyNewRatingFormSingleStoreModeNoTest.xml +++ b/app/code/Magento/Review/Test/Mftf/Test/AdminVerifyNewRatingFormSingleStoreModeNoTest.xml @@ -20,7 +20,7 @@ </annotations> <before> <magentoCLI command="config:set general/single_store_mode/enabled 0" stepKey="enabledSingleStoreMode"/> - <actionGroup ref="LoginAsAdmin" stepKey="LoginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="LoginAsAdmin"/> </before> <after> <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> diff --git a/app/code/Magento/Review/Test/Mftf/Test/AdminVerifyNewRatingFormSingleStoreModeYesTest.xml b/app/code/Magento/Review/Test/Mftf/Test/AdminVerifyNewRatingFormSingleStoreModeYesTest.xml index 5c4a455dde9ae..55e709f08d77d 100644 --- a/app/code/Magento/Review/Test/Mftf/Test/AdminVerifyNewRatingFormSingleStoreModeYesTest.xml +++ b/app/code/Magento/Review/Test/Mftf/Test/AdminVerifyNewRatingFormSingleStoreModeYesTest.xml @@ -20,7 +20,7 @@ </annotations> <before> <magentoCLI command="config:set general/single_store_mode/enabled 1" stepKey="enabledSingleStoreMode"/> - <actionGroup ref="LoginAsAdmin" stepKey="LoginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="LoginAsAdmin"/> </before> <after> <magentoCLI command="config:set general/single_store_mode/enabled 0" stepKey="enabledSingleStoreMode"/> diff --git a/app/code/Magento/Review/Test/Mftf/Test/StoreFrontReviewByCustomerReportTest.xml b/app/code/Magento/Review/Test/Mftf/Test/StoreFrontReviewByCustomerReportTest.xml new file mode 100644 index 0000000000000..b70000ed3f3b0 --- /dev/null +++ b/app/code/Magento/Review/Test/Mftf/Test/StoreFrontReviewByCustomerReportTest.xml @@ -0,0 +1,76 @@ +<?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="StoreFrontReviewByCustomerReportTest"> + <annotations> + <features value="Review"/> + <stories value="Review By Customers"/> + <title value="StoreFront Reports Review By Customers"/> + <description value="Review By Customer Grid Filters"/> + <severity value="AVERAGE"/> + <testCaseId value="MC-32340"/> + </annotations> + <before> + <!--Login--> + <actionGroup ref="AdminLoginActionGroup" stepKey="LoginAsAdmin"/> + <!--Create product and Category--> + <createData stepKey="category" entity="SimpleSubCategory"/> + <createData stepKey="createProduct1" entity="SimpleProduct"> + <requiredEntity createDataKey="category"/> + </createData> + <createData stepKey="createProduct2" entity="SimpleProduct"> + <requiredEntity createDataKey="category"/> + </createData> + </before> + <after> + <!-- Delete reviews --> + <actionGroup ref="AdminOpenReviewsPageActionGroup" stepKey="openAllReviewsPage"/> + <actionGroup ref="AdminDeleteReviewsByUserNicknameActionGroup" stepKey="deleteCustomerReview"/> + <actionGroup ref="ClearFiltersAdminDataGridActionGroup" stepKey="clearNickNameReviewFilters"/> + <!-- Delete customer --> + <actionGroup ref="AdminDeleteCustomerActionGroup" stepKey="deleteCustomer"> + <argument name="customerEmail" value="CustomerEntityOne.email"/> + </actionGroup> + <!--delete Category and Products --> + <deleteData createDataKey="createProduct1" stepKey="deleteProduct1"/> + <deleteData createDataKey="createProduct2" stepKey="deleteProduct2"/> + <deleteData createDataKey="category" stepKey="deleteCategory"/> + <!--Logout--> + <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> + </after> + <!-- Go to frontend and make a user account and login with it --> + <actionGroup ref="SignUpNewUserFromStorefrontActionGroup" stepKey="signUpNewUser"> + <argument name="Customer" value="CustomerEntityOne"/> + </actionGroup> + <!-- Go to the product view page --> + <actionGroup ref="StorefrontOpenProductPageActionGroup" stepKey="openStorefrontProductPage"> + <argument name="productUrl" value="$$createProduct1.custom_attributes[url_key]$$"/> + </actionGroup> + <!-- Click on reviews and add reviews with current user --> + <actionGroup ref="StorefrontAddProductReviewActionGroup" stepKey="addReview"/> + <!-- Go to Pending reviews page and clear filters --> + <actionGroup ref="AdminOpenPendingReviewsPageActionGroup" stepKey="openReviewsPage"/> + <actionGroup ref="ClearFiltersAdminDataGridActionGroup" stepKey="clearFilters"/> + <!-- Moderate first product reviews: change review status from pending to approved, save --> + <actionGroup ref="AdminOpenReviewByUserNicknameActionGroup" stepKey="openFirstCustomerReviews"/> + <actionGroup ref="AdminChangeReviewStatusActionGroup" stepKey="changeFirstReviewStatus"/> + <actionGroup ref="AdminSaveReviewActionGroup" stepKey="saveModeratedFirstReview"/> + <!-- Navigate to Reports > Reviews >By Customers --> + <actionGroup ref="AdminNavigateMenuActionGroup" stepKey="navigateToReportsByCustomersPage"> + <argument name="menuUiId" value="{{AdminMenuReports.dataUiId}}"/> + <argument name="submenuUiId" value="{{AdminMenuReportsReviewsByCustomers.dataUiId}}"/> + </actionGroup> + <!--Sort Review Column --> + <grabTextFrom selector="{{AdminCreateNewReviewSection.gridReviewColumn}}" stepKey="grabCustomerReviewQuantity"/> + <actionGroup ref="AdminFilterCustomerReviewActionGroup" stepKey="navigateToCustomerReportsReview"> + <argument name="reviewCount" value="$grabCustomerReviewQuantity"/> + </actionGroup> + </test> +</tests> diff --git a/app/code/Magento/Review/Test/Mftf/Test/StorefrontNoJavascriptErrorOnAddYourReviewClickTest.xml b/app/code/Magento/Review/Test/Mftf/Test/StorefrontNoJavascriptErrorOnAddYourReviewClickTest.xml index c76c30b47ac51..81f5db6d2fd10 100644 --- a/app/code/Magento/Review/Test/Mftf/Test/StorefrontNoJavascriptErrorOnAddYourReviewClickTest.xml +++ b/app/code/Magento/Review/Test/Mftf/Test/StorefrontNoJavascriptErrorOnAddYourReviewClickTest.xml @@ -18,7 +18,7 @@ <group value="review"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <createData entity="textProductAttribute" stepKey="createProductAttribute"/> <createData entity="CatalogAttributeSet" stepKey="createAttributeSet"/> <amOnPage url="{{AdminProductAttributeSetEditPage.url}}/$$createAttributeSet.attribute_set_id$$/" diff --git a/app/code/Magento/Sales/Block/Adminhtml/Order/Create/Messages.php b/app/code/Magento/Sales/Block/Adminhtml/Order/Create/Messages.php index d62497d6b47e9..18c1431f61104 100644 --- a/app/code/Magento/Sales/Block/Adminhtml/Order/Create/Messages.php +++ b/app/code/Magento/Sales/Block/Adminhtml/Order/Create/Messages.php @@ -14,6 +14,9 @@ */ class Messages extends \Magento\Framework\View\Element\Messages { + + private const ITEMS_GRID = 'items_grid'; + /** * Preparing global layout * @@ -22,6 +25,24 @@ class Messages extends \Magento\Framework\View\Element\Messages protected function _prepareLayout() { $this->addMessages($this->messageManager->getMessages(true)); + $itemsBlock = $this->getLayout()->getBlock(self::ITEMS_GRID); + if (!$itemsBlock) { + return; + } + $items = $itemsBlock->getItems(); + foreach ($items as $item) { + if ($item->getHasError()) { + $messageCollection = $this->getMessageCollection(); + foreach ($messageCollection->getItems() as $blockMessage) { + if ($item->getMessage(true) === $blockMessage->getText()) { + /* Remove duplicated messages.*/ + $messageCollection->deleteMessageByIdentifier($blockMessage->getIdentifier()); + } + } + $this->setMessages($messageCollection); + } + } + parent::_prepareLayout(); } } diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AddConfigurableProductToOrderFromShoppingCartTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AddConfigurableProductToOrderFromShoppingCartTest.xml index 1c6c2d1494e2c..6f4073bf70f46 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AddConfigurableProductToOrderFromShoppingCartTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AddConfigurableProductToOrderFromShoppingCartTest.xml @@ -91,7 +91,7 @@ </actionGroup> <!-- Login as admin --> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <!-- Search and open customer --> <actionGroup ref="AdminFilterCustomerByEmail" stepKey="filterCreatedCustomer"> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AddSimpleProductToOrderFromShoppingCartTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AddSimpleProductToOrderFromShoppingCartTest.xml index e6bcbc3b08028..d8a9effa56dac 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AddSimpleProductToOrderFromShoppingCartTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AddSimpleProductToOrderFromShoppingCartTest.xml @@ -52,7 +52,7 @@ </actionGroup> <!-- Login as admin --> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <!-- Search and open customer --> <actionGroup ref="AdminFilterCustomerByEmail" stepKey="filterCreatedCustomer"> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminAddSelectedProductToOrderTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminAddSelectedProductToOrderTest.xml index ca74eca88308a..452fd511f2ce2 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminAddSelectedProductToOrderTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminAddSelectedProductToOrderTest.xml @@ -23,12 +23,12 @@ <before> <createData entity="Simple_US_Customer" stepKey="simpleCustomer"/> <createData entity="SimpleProduct2" stepKey="simpleProduct"/> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> </before> <after> <deleteData createDataKey="simpleCustomer" stepKey="deleteSimpleCustomer"/> <deleteData createDataKey="simpleProduct" stepKey="deleteSimpleProduct"/> - <actionGroup ref="logout" stepKey="logoutFromAdmin"/> + <actionGroup ref="AdminLogoutActionGroup" stepKey="logoutFromAdmin"/> </after> <!-- Initiate create new order --> @@ -72,7 +72,7 @@ <!-- Check that error remains --> <actionGroup ref="AssertAdminItemOrderedErrorActionGroup" stepKey="assertProductErrorRemains"> <argument name="productName" value="$simpleProduct.name$"/> - <argument name="messageType" value="notice"/> + <argument name="messageType" value="error"/> </actionGroup> </test> </tests> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminAvailabilityCreditMemoWithNoPaymentTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminAvailabilityCreditMemoWithNoPaymentTest.xml index 9b12f1c951991..11a9957fe0041 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminAvailabilityCreditMemoWithNoPaymentTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminAvailabilityCreditMemoWithNoPaymentTest.xml @@ -26,7 +26,7 @@ <!-- Enable *Free Shipping* --> <createData entity="FreeShippingMethodsSettingConfig" stepKey="freeShippingMethodsSettingConfig"/> <magentoCLI command="cache:flush" stepKey="flushCache"/> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> </before> <after> <!-- Disable *Free Shipping* --> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminCancelTheCreatedOrderWithBankTransferPaymentMethodTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminCancelTheCreatedOrderWithBankTransferPaymentMethodTest.xml index 4646f6cf2e5a0..bb1940357a7f4 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminCancelTheCreatedOrderWithBankTransferPaymentMethodTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminCancelTheCreatedOrderWithBankTransferPaymentMethodTest.xml @@ -20,7 +20,7 @@ </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <!-- Enable Bank Transfer payment --> <magentoCLI command="config:set {{EnablePaymentBankTransferConfigData.path}} {{EnablePaymentBankTransferConfigData.value}}" stepKey="enableBankTransferPayment"/> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminCancelTheCreatedOrderWithCashOnDeliveryPaymentMethodTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminCancelTheCreatedOrderWithCashOnDeliveryPaymentMethodTest.xml index 7f162ca4e2a6a..dafd00ff60b29 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminCancelTheCreatedOrderWithCashOnDeliveryPaymentMethodTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminCancelTheCreatedOrderWithCashOnDeliveryPaymentMethodTest.xml @@ -20,7 +20,7 @@ </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <!-- Enable Cash On Delivery payment method --> <magentoCLI command="config:set {{EnableCashOnDeliveryConfigData.path}} {{EnableCashOnDeliveryConfigData.value}}" stepKey="enableCashOnDeliveryPayment"/> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminCancelTheCreatedOrderWithCheckMoneyOrderPaymentMethodTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminCancelTheCreatedOrderWithCheckMoneyOrderPaymentMethodTest.xml index 7d6ce40659b1f..c0ebbe450119e 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminCancelTheCreatedOrderWithCheckMoneyOrderPaymentMethodTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminCancelTheCreatedOrderWithCheckMoneyOrderPaymentMethodTest.xml @@ -19,7 +19,7 @@ <group value="mtf_migrated"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <!-- Set default flat rate shipping method settings --> <comment userInput="Set default flat rate shipping method settings" stepKey="setDefaultFlatRateShippingMethodComment"/> <createData entity="FlatRateShippingMethodDefault" stepKey="setDefaultFlatRateShippingMethod"/> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminCancelTheCreatedOrderWithProductQtyWithoutStockDecreaseTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminCancelTheCreatedOrderWithProductQtyWithoutStockDecreaseTest.xml index ee69d9fd1ca46..256417c0d0d10 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminCancelTheCreatedOrderWithProductQtyWithoutStockDecreaseTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminCancelTheCreatedOrderWithProductQtyWithoutStockDecreaseTest.xml @@ -20,7 +20,7 @@ </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <magentoCLI command="config:set {{DisableCatalogInventoryConfigData.path}} {{DisableCatalogInventoryConfigData.value}}" stepKey="disableDecreaseInQuantityAfterOrder"/> <!--Set default flat rate shipping method settings--> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminCancelTheCreatedOrderWithPurchaseOrderPaymentMethodTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminCancelTheCreatedOrderWithPurchaseOrderPaymentMethodTest.xml index ce653b11f854b..477676085cf2e 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminCancelTheCreatedOrderWithPurchaseOrderPaymentMethodTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminCancelTheCreatedOrderWithPurchaseOrderPaymentMethodTest.xml @@ -20,7 +20,7 @@ </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <!-- Enable Purchase Order payment method --> <magentoCLI command="config:set {{EnablePurchaseOrderConfigData.path}} {{EnablePurchaseOrderConfigData.value}}" stepKey="enableCPurchaseOrderPayment"/> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminCancelTheCreatedOrderWithZeroSubtotalCheckoutTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminCancelTheCreatedOrderWithZeroSubtotalCheckoutTest.xml index 095bd9af2c1b1..d22e11bca3d0e 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminCancelTheCreatedOrderWithZeroSubtotalCheckoutTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminCancelTheCreatedOrderWithZeroSubtotalCheckoutTest.xml @@ -22,7 +22,7 @@ <before> <!-- Enable Zero Subtotal Checkout --> <magentoCLI command="config:set {{EnableZeroSubtotalCheckoutConfigData.path}} {{EnableZeroSubtotalCheckoutConfigData.value}}" stepKey="enableZeroSubtotalCheckout"/> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <!--Set Free shipping method settings--> <createData entity="FreeShippingMethodsSettingConfig" stepKey="freeShippingMethodsSettingConfig"/> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminChangeCustomerGroupInNewOrderTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminChangeCustomerGroupInNewOrderTest.xml index c8b2b66a758eb..b2bfa93678dfd 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminChangeCustomerGroupInNewOrderTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminChangeCustomerGroupInNewOrderTest.xml @@ -20,7 +20,7 @@ </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="login"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="login"/> </before> <after> <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminCheckingCreditMemoUpdateTotalsTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminCheckingCreditMemoUpdateTotalsTest.xml index 34a415ccf03ad..37a4782ce2e73 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminCheckingCreditMemoUpdateTotalsTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminCheckingCreditMemoUpdateTotalsTest.xml @@ -25,7 +25,7 @@ <!--Create customer--> <createData entity="Simple_US_CA_Customer" stepKey="createCustomer"/> <!--Login to admin page--> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> </before> <after> <!--Delete simple product--> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminCheckingDateAfterChangeInterfaceLocaleTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminCheckingDateAfterChangeInterfaceLocaleTest.xml index 979e2cef3ff28..ca3733d5f0b96 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminCheckingDateAfterChangeInterfaceLocaleTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminCheckingDateAfterChangeInterfaceLocaleTest.xml @@ -27,7 +27,7 @@ <createData entity="SimpleProduct2" stepKey="createProduct"/> <createData entity="Simple_US_Customer" stepKey="createCustomer"/> <!--Login to Admin page--> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> </before> <after> <!--Delete entities--> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminCorrectnessInvoicedItemInBundleProductTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminCorrectnessInvoicedItemInBundleProductTest.xml index c9f878a716ae8..69e3ade9231d0 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminCorrectnessInvoicedItemInBundleProductTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminCorrectnessInvoicedItemInBundleProductTest.xml @@ -20,7 +20,7 @@ <group value="sales"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <!--Create category and simple product--> <createData entity="SimpleSubCategory" stepKey="createCategory"/> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateCreditMemoBankTransferPaymentTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateCreditMemoBankTransferPaymentTest.xml index a20e9efd614fd..2935a56a6c0a1 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateCreditMemoBankTransferPaymentTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateCreditMemoBankTransferPaymentTest.xml @@ -19,7 +19,7 @@ <group value="mtf_migrated"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="LoginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="LoginAsAdmin"/> <!-- Create Data --> <createData entity="Simple_US_Customer" stepKey="createCustomer"/> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateCreditMemoConfigurableProductTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateCreditMemoConfigurableProductTest.xml index 5839ff4b3dfe2..ab3a2cc647740 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateCreditMemoConfigurableProductTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateCreditMemoConfigurableProductTest.xml @@ -83,7 +83,7 @@ <!-- Enable payment method one of "Check/Money Order" and shipping method one of "Flat Rate" --> <magentoCLI command="config:set {{enabledCheckMoneyOrder.label}} {{enabledCheckMoneyOrder.value}}" stepKey="enableCheckMoneyOrder"/> <createData entity="FlatRateShippingMethodConfig" stepKey="enableFlatRate"/> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> </before> <after> <!-- Delete data --> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateCreditMemoPartialRefundTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateCreditMemoPartialRefundTest.xml index df1a541eeb94c..564cde1151660 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateCreditMemoPartialRefundTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateCreditMemoPartialRefundTest.xml @@ -19,7 +19,7 @@ <group value="mtf_migrated"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="LoginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="LoginAsAdmin"/> <!-- Create Data --> <createData entity="Simple_US_Customer" stepKey="createCustomer"/> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateCreditMemoWithCashOnDeliveryTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateCreditMemoWithCashOnDeliveryTest.xml index e0e7234fc9d24..45eefbcc3f97d 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateCreditMemoWithCashOnDeliveryTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateCreditMemoWithCashOnDeliveryTest.xml @@ -19,7 +19,7 @@ <group value="mtf_migrated"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="LoginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="LoginAsAdmin"/> <!-- Create Data --> <createData entity="Simple_US_Customer" stepKey="createCustomer"/> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateCreditMemoWithPurchaseOrderTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateCreditMemoWithPurchaseOrderTest.xml index b2e0d788a24e2..7974d594eb99c 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateCreditMemoWithPurchaseOrderTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateCreditMemoWithPurchaseOrderTest.xml @@ -19,7 +19,7 @@ <group value="mtf_migrated"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="LoginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="LoginAsAdmin"/> <!-- Create Data --> <createData entity="Simple_US_Customer" stepKey="createCustomer"/> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateInvoiceTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateInvoiceTest.xml index 9a635df80f108..1411f7b292757 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateInvoiceTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateInvoiceTest.xml @@ -59,7 +59,7 @@ <grabTextFrom selector="{{CheckoutSuccessMainSection.orderNumber}}" stepKey="grabOrderNumber"/> <!-- end todo --> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin1"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin1"/> <amOnPage url="{{AdminOrdersPage.url}}" stepKey="onOrdersPage"/> <waitForLoadingMaskToDisappear stepKey="waitForLoadingMask3"/> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateOrderAddProductCheckboxTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateOrderAddProductCheckboxTest.xml index 072522452e7b9..baef605ad52af 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateOrderAddProductCheckboxTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateOrderAddProductCheckboxTest.xml @@ -26,7 +26,7 @@ <createData entity="ApiProductWithDescription" stepKey="createSimpleProduct"/> <!-- Login to Admin Panel --> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> </before> <!-- Initiate create new order --> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateOrderAndCheckTheReorderTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateOrderAndCheckTheReorderTest.xml index a7112776bf157..ab5c089dfcc30 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateOrderAndCheckTheReorderTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateOrderAndCheckTheReorderTest.xml @@ -26,7 +26,7 @@ <createData entity="SimpleProduct_25" stepKey="simpleProduct"> <field key="price">5</field> </createData> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> </before> <actionGroup ref="NavigateToNewOrderPageExistingCustomerActionGroup" stepKey="navigateToNewOrderWithExistingCustomer"> <argument name="customer" value="$$simpleCustomer$$"/> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateOrderForCustomerWithTwoAddressesTaxableAndNonTaxableTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateOrderForCustomerWithTwoAddressesTaxableAndNonTaxableTest.xml index 72080c3170c48..2f89573b00101 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateOrderForCustomerWithTwoAddressesTaxableAndNonTaxableTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateOrderForCustomerWithTwoAddressesTaxableAndNonTaxableTest.xml @@ -33,7 +33,7 @@ <!--Create tax rule for US-CA--> <createData entity="defaultTaxRule" stepKey="createTaxRule"/> <!--Login as admin--> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> </before> <!--Step 1: Create new order for customer--> <actionGroup ref="NavigateToNewOrderPageExistingCustomerActionGroup" stepKey="navigateToNewOrderWithExistingCustomer"> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateOrderStatusDuplicatingCodeTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateOrderStatusDuplicatingCodeTest.xml index bbb0489b6c9a4..23dca916781f1 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateOrderStatusDuplicatingCodeTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateOrderStatusDuplicatingCodeTest.xml @@ -19,7 +19,7 @@ <group value="mtf_migrated"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> </before> <after> <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateOrderStatusDuplicatingLabelTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateOrderStatusDuplicatingLabelTest.xml index 23bf293f67a81..d3cd3e8b8549c 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateOrderStatusDuplicatingLabelTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateOrderStatusDuplicatingLabelTest.xml @@ -19,7 +19,7 @@ <group value="mtf_migrated"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> </before> <after> <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateOrderStatusTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateOrderStatusTest.xml index 03acf2194c64d..a30040045a4ca 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateOrderStatusTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateOrderStatusTest.xml @@ -19,7 +19,7 @@ <group value="mtf_migrated"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> </before> <after> <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateOrderWithBundleProductTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateOrderWithBundleProductTest.xml index f439d792c9330..1401930131b13 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateOrderWithBundleProductTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateOrderWithBundleProductTest.xml @@ -76,7 +76,7 @@ <requiredEntity createDataKey="simple2"/> <field key="qty">2</field> </createData> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> </before> <!--Create new customer order--> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateOrderWithCustomerWithoutEmailTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateOrderWithCustomerWithoutEmailTest.xml index bb1f5840ed6bf..0be7e20be5aea 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateOrderWithCustomerWithoutEmailTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateOrderWithCustomerWithoutEmailTest.xml @@ -23,7 +23,7 @@ <createData entity="SimpleProduct" stepKey="simpleProduct"> <requiredEntity createDataKey="category"/> </createData> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <magentoCLI command="cache:flush" stepKey="flushCache"/> </before> <after> @@ -32,7 +32,7 @@ <deleteData createDataKey="category" stepKey="deleteCategory"/> <!--Enable required 'email' field on create order page.--> <magentoCLI command="config:set {{EnableEmailRequiredForOrder.path}} {{EnableEmailRequiredForOrder.value}}" stepKey="enableRequiredFieldEmailForAdminOrderCreation"/> - <actionGroup ref="logout" stepKey="logout"/> + <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> <magentoCLI command="cache:flush" stepKey="flushCache"/> </after> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateOrderWithDateTimeOptionUITest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateOrderWithDateTimeOptionUITest.xml index c689869d35c30..b0926948f2bf6 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateOrderWithDateTimeOptionUITest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateOrderWithDateTimeOptionUITest.xml @@ -26,7 +26,7 @@ <requiredEntity createDataKey="createCategory"/> </createData> <updateData createDataKey="createProduct" entity="productWithDateTimeOption" stepKey="updateProductWithOption"/> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> </before> <after> <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateOrderWithMinimumAmountEnabledTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateOrderWithMinimumAmountEnabledTest.xml index da427c9085084..ade1f783c1309 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateOrderWithMinimumAmountEnabledTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateOrderWithMinimumAmountEnabledTest.xml @@ -24,7 +24,7 @@ <createData entity="SimpleProduct" stepKey="createProduct"> <requiredEntity createDataKey="createCategory"/> </createData> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <actionGroup ref="ClearCacheActionGroup" stepKey="clearCacheBefore"/> </before> <after> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateOrderWithSelectedShoppingCartItemsTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateOrderWithSelectedShoppingCartItemsTest.xml index 841db82adefb7..6e8ec14fc67cb 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateOrderWithSelectedShoppingCartItemsTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateOrderWithSelectedShoppingCartItemsTest.xml @@ -37,7 +37,7 @@ </createData> <!--Login as admin--> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> </before> <!-- Step 1: Go to Storefront as Customer --> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateOrderWithSimpleProductCustomOptionFileTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateOrderWithSimpleProductCustomOptionFileTest.xml index d1417ba1bc267..82e9606175764 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateOrderWithSimpleProductCustomOptionFileTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateOrderWithSimpleProductCustomOptionFileTest.xml @@ -22,7 +22,7 @@ <requiredEntity createDataKey="category"/> </createData> <createData entity="Simple_US_Customer_CA" stepKey="customer"/> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> </before> <after> <!--Clean up created test data.--> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateOrderWithSimpleProductTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateOrderWithSimpleProductTest.xml index cc709dc6e16eb..1c8cf2219f13b 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateOrderWithSimpleProductTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateOrderWithSimpleProductTest.xml @@ -26,7 +26,7 @@ <createData entity="SimpleProduct_25" stepKey="simpleProduct"> <field key="price">5</field> </createData> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> </before> <actionGroup ref="NavigateToNewOrderPageExistingCustomerActionGroup" stepKey="navigateToNewOrderWithExistingCustomer"> <argument name="customer" value="$$simpleCustomer$$"/> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminFreeShippingNotAvailableIfMinimumOrderAmountNotMatchOrderTotalTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminFreeShippingNotAvailableIfMinimumOrderAmountNotMatchOrderTotalTest.xml index 01a27a6191d74..1c59f6f936cef 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminFreeShippingNotAvailableIfMinimumOrderAmountNotMatchOrderTotalTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminFreeShippingNotAvailableIfMinimumOrderAmountNotMatchOrderTotalTest.xml @@ -27,7 +27,7 @@ <createData entity="DisableFlatRateShippingMethodConfig" stepKey="disableFlatRate"/> <createData entity="FreeShippinMethodConfig" stepKey="enableFreeShippingMethod"/> <createData entity="setFreeShippingSubtotal" stepKey="setFreeShippingSubtotal"/> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <magentoCLI command="cache:flush" stepKey="flushCache"/> </before> <after> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminHoldCreatedOrderTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminHoldCreatedOrderTest.xml index a5cbb15faf2d7..8d328beab1adc 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminHoldCreatedOrderTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminHoldCreatedOrderTest.xml @@ -20,7 +20,7 @@ </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <!--Set default flat rate shipping method settings--> <createData entity="FlatRateShippingMethodDefault" stepKey="setDefaultFlatRateShippingMethod"/> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminMassOrdersCancelCompleteAndClosedTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminMassOrdersCancelCompleteAndClosedTest.xml index ca2a35eef5ae6..a89e9f7ce6ebe 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminMassOrdersCancelCompleteAndClosedTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminMassOrdersCancelCompleteAndClosedTest.xml @@ -19,7 +19,7 @@ <group value="mtf_migrated"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="LoginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="LoginAsAdmin"/> <!-- Create Data --> <createData entity="Simple_US_Customer" stepKey="createCustomer"/> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminMassOrdersCancelProcessingAndClosedTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminMassOrdersCancelProcessingAndClosedTest.xml index c11ea49893734..45cbe23042e03 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminMassOrdersCancelProcessingAndClosedTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminMassOrdersCancelProcessingAndClosedTest.xml @@ -19,7 +19,7 @@ <group value="mtf_migrated"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="LoginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="LoginAsAdmin"/> <!-- Create Data --> <createData entity="Simple_US_Customer" stepKey="createCustomer"/> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminMassOrdersHoldOnCompleteTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminMassOrdersHoldOnCompleteTest.xml index f583f46f19c7c..22b2d69a73090 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminMassOrdersHoldOnCompleteTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminMassOrdersHoldOnCompleteTest.xml @@ -19,7 +19,7 @@ <group value="mtf_migrated"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="LoginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="LoginAsAdmin"/> <!-- Create Data --> <createData entity="Simple_US_Customer" stepKey="createCustomer"/> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminMassOrdersHoldOnPendingAndProcessingTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminMassOrdersHoldOnPendingAndProcessingTest.xml index f334a77da6550..4b690a00ee9ed 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminMassOrdersHoldOnPendingAndProcessingTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminMassOrdersHoldOnPendingAndProcessingTest.xml @@ -19,7 +19,7 @@ <group value="mtf_migrated"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="LoginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="LoginAsAdmin"/> <!-- Create Data --> <createData entity="Simple_US_Customer" stepKey="createCustomer"/> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminMassOrdersReleasePendingOrderTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminMassOrdersReleasePendingOrderTest.xml index 437487e3d7e40..e1d934f794142 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminMassOrdersReleasePendingOrderTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminMassOrdersReleasePendingOrderTest.xml @@ -19,7 +19,7 @@ <group value="mtf_migrated"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="LoginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="LoginAsAdmin"/> <!-- Create Data --> <createData entity="Simple_US_Customer" stepKey="createCustomer"/> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminMassOrdersUpdateCancelPendingOrderTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminMassOrdersUpdateCancelPendingOrderTest.xml index 87d3a864e0820..86a3e381cb237 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminMassOrdersUpdateCancelPendingOrderTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminMassOrdersUpdateCancelPendingOrderTest.xml @@ -19,7 +19,7 @@ <group value="mtf_migrated"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="LoginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="LoginAsAdmin"/> <!-- Create Data --> <createData entity="Simple_US_Customer" stepKey="createCustomer"/> <createData entity="_defaultCategory" stepKey="createCategory"/> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminOrdersReleaseInUnholdStatusTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminOrdersReleaseInUnholdStatusTest.xml index 9eaa3a87e873a..bfd75a69b81d6 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminOrdersReleaseInUnholdStatusTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminOrdersReleaseInUnholdStatusTest.xml @@ -19,7 +19,7 @@ <group value="mtf_migrated"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="LoginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="LoginAsAdmin"/> <!-- Create Data --> <createData entity="Simple_US_Customer" stepKey="createCustomer"/> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminProductInTheShoppingCartCouldBeReachedByAdminDuringOrderCreationWithMultiWebsiteConfigTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminProductInTheShoppingCartCouldBeReachedByAdminDuringOrderCreationWithMultiWebsiteConfigTest.xml index eb9d48cbbd567..338975d3c1f25 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminProductInTheShoppingCartCouldBeReachedByAdminDuringOrderCreationWithMultiWebsiteConfigTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminProductInTheShoppingCartCouldBeReachedByAdminDuringOrderCreationWithMultiWebsiteConfigTest.xml @@ -23,7 +23,7 @@ <before> <magentoCLI command="config:set {{StorefrontEnableAddStoreCodeToUrls.path}} {{StorefrontEnableAddStoreCodeToUrls.value}}" stepKey="addStoreCodeToUrlEnable"/> <createData entity="SimpleProduct2" stepKey="createProduct"/> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <actionGroup ref="AdminCreateWebsiteActionGroup" stepKey="createWebsite"> <argument name="newWebsiteName" value="{{customWebsite.name}}"/> <argument name="websiteCode" value="{{customWebsite.code}}"/> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminReorderWithCatalogPriceRuleDiscountTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminReorderWithCatalogPriceRuleDiscountTest.xml index 2eb7e8ec33d92..0a4445f338960 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminReorderWithCatalogPriceRuleDiscountTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminReorderWithCatalogPriceRuleDiscountTest.xml @@ -23,7 +23,7 @@ <before> <!--Create product--> <createData entity="SimpleProduct2" stepKey="createSimpleProductApi"/> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <!--Create the catalog price rule --> <createData entity="CatalogRuleToPercent" stepKey="createCatalogRule"/> <!--Create order via API--> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminSalesCreditMemosNavigateMenuTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminSalesCreditMemosNavigateMenuTest.xml index 424b931314b01..39b5cabdadd72 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminSalesCreditMemosNavigateMenuTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminSalesCreditMemosNavigateMenuTest.xml @@ -20,7 +20,7 @@ <group value="mtf_migrated"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="LoginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="LoginAsAdmin"/> </before> <after> <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminSalesInvoicesNavigateMenuTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminSalesInvoicesNavigateMenuTest.xml index 89d4cc4c7371f..567a0466d12e0 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminSalesInvoicesNavigateMenuTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminSalesInvoicesNavigateMenuTest.xml @@ -20,7 +20,7 @@ <group value="mtf_migrated"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="LoginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="LoginAsAdmin"/> </before> <after> <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminSalesOrdersNavigateMenuTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminSalesOrdersNavigateMenuTest.xml index 6d765537494ed..4023be10f390e 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminSalesOrdersNavigateMenuTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminSalesOrdersNavigateMenuTest.xml @@ -20,7 +20,7 @@ <group value="mtf_migrated"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="LoginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="LoginAsAdmin"/> </before> <after> <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminSalesShipmentsNavigateMenuTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminSalesShipmentsNavigateMenuTest.xml index 05f15ad76b07c..07d75664f1fda 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminSalesShipmentsNavigateMenuTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminSalesShipmentsNavigateMenuTest.xml @@ -20,7 +20,7 @@ <group value="mtf_migrated"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="LoginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="LoginAsAdmin"/> </before> <after> <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminSalesTransactionsNavigateMenuTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminSalesTransactionsNavigateMenuTest.xml index 17f0bad87037e..544bb5adf57cd 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminSalesTransactionsNavigateMenuTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminSalesTransactionsNavigateMenuTest.xml @@ -20,7 +20,7 @@ <group value="mtf_migrated"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="LoginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="LoginAsAdmin"/> </before> <after> <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminStoresOrderStatusNavigateMenuTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminStoresOrderStatusNavigateMenuTest.xml index 7884926946178..d521c3dc647e2 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminStoresOrderStatusNavigateMenuTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminStoresOrderStatusNavigateMenuTest.xml @@ -20,7 +20,7 @@ <group value="mtf_migrated"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="LoginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="LoginAsAdmin"/> </before> <after> <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminSubmitConfigurableProductOrderTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminSubmitConfigurableProductOrderTest.xml index 8ab26c04d5d6d..54ae549967a3b 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminSubmitConfigurableProductOrderTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminSubmitConfigurableProductOrderTest.xml @@ -87,7 +87,7 @@ <requiredEntity createDataKey="createConfigChildProduct2"/> </createData> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> </before> <!--Create new customer order--> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminSubmitsOrderPaymentMethodValidationTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminSubmitsOrderPaymentMethodValidationTest.xml index 5981c49345aa0..85665dfc1b00e 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminSubmitsOrderPaymentMethodValidationTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminSubmitsOrderPaymentMethodValidationTest.xml @@ -23,7 +23,7 @@ <createData entity="_defaultProduct" stepKey="createSimpleProduct"> <requiredEntity createDataKey="createCategory"/> </createData> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> </before> <after> <magentoCLI stepKey="allowSpecificValue" command="config:set payment/cashondelivery/active 0" /> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminSubmitsOrderWithAndWithoutEmailTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminSubmitsOrderWithAndWithoutEmailTest.xml index d28b636770856..7615cc219d430 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminSubmitsOrderWithAndWithoutEmailTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminSubmitsOrderWithAndWithoutEmailTest.xml @@ -29,7 +29,7 @@ <actionGroup ref="AdminLogoutActionGroup" stepKey="adminLogout"/> </after> <!--Create order via Admin--> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <comment userInput="Admin creates order" stepKey="adminCreateOrderComment"/> <!--<actionGroup ref="NavigateToNewOrderPageNewCustomerActionGroup" stepKey="navigateToNewOrderPage"/>--> <amOnPage url="{{AdminOrdersPage.url}}" stepKey="navigateToOrderIndexPage"/> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminSubmitsOrderWithAndWithoutFieldsValidationTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminSubmitsOrderWithAndWithoutFieldsValidationTest.xml index d44cb829bc205..fd26ca1ca601e 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminSubmitsOrderWithAndWithoutFieldsValidationTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminSubmitsOrderWithAndWithoutFieldsValidationTest.xml @@ -28,7 +28,7 @@ <actionGroup ref="AdminLogoutActionGroup" stepKey="adminLogout"/> </after> <!--Create order via Admin--> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <comment userInput="Admin creates order" stepKey="adminCreateOrderComment"/> <!--<actionGroup ref="NavigateToNewOrderPageNewCustomerActionGroup" stepKey="navigateToNewOrderPage"/>--> <amOnPage url="{{AdminOrdersPage.url}}" stepKey="navigateToOrderIndexPage"/> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminUnassignCustomOrderStatusTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminUnassignCustomOrderStatusTest.xml index bd43937e6f24e..692f293ef3a75 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminUnassignCustomOrderStatusTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminUnassignCustomOrderStatusTest.xml @@ -18,7 +18,7 @@ <group value="mtf_migrated"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> </before> <after> <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AssignCustomOrderStatusNotVisibleOnStorefrontTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AssignCustomOrderStatusNotVisibleOnStorefrontTest.xml index af07d50bcc8c7..f0f4cf9d1a468 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AssignCustomOrderStatusNotVisibleOnStorefrontTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AssignCustomOrderStatusNotVisibleOnStorefrontTest.xml @@ -27,7 +27,7 @@ <createData entity="SimpleProduct2" stepKey="createSimpleProduct"/> <!-- Login as admin --> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> </before> <after> <!-- Disable created order status --> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/CheckXSSVulnerabilityDuringOrderCreationTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/CheckXSSVulnerabilityDuringOrderCreationTest.xml index dbe012f17176d..df6a797372e62 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/CheckXSSVulnerabilityDuringOrderCreationTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/CheckXSSVulnerabilityDuringOrderCreationTest.xml @@ -49,7 +49,7 @@ <actionGroup ref="AssertStorefrontEmailValidationMessageOnCheckoutActionGroup" stepKey="assertErrorMessageStorefront"/> <!-- Login as admin --> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <!-- Try to create order in admin with provided email --> <actionGroup ref="NavigateToNewOrderPageNewCustomerSingleStoreActionGroup" stepKey="navigateToNewOrderPage"/> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/CreateInvoiceAndCheckInvoiceOrderTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/CreateInvoiceAndCheckInvoiceOrderTest.xml index 73f3b5310731e..d8a3db76da05e 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/CreateInvoiceAndCheckInvoiceOrderTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/CreateInvoiceAndCheckInvoiceOrderTest.xml @@ -20,7 +20,7 @@ </annotations> <before> <!-- Login as admin --> - <actionGroup ref="LoginAsAdmin" stepKey="LoginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="LoginAsAdmin"/> <!-- Create customer --> <createData entity="Simple_US_Customer" stepKey="createCustomer"/> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/CreateInvoiceWithCashOnDeliveryPaymentMethodTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/CreateInvoiceWithCashOnDeliveryPaymentMethodTest.xml index 3ae4007ac211d..c58b95a41b157 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/CreateInvoiceWithCashOnDeliveryPaymentMethodTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/CreateInvoiceWithCashOnDeliveryPaymentMethodTest.xml @@ -20,7 +20,7 @@ </annotations> <before> <!-- Login as admin --> - <actionGroup ref="LoginAsAdmin" stepKey="LoginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="LoginAsAdmin"/> <!-- Create customer --> <createData entity="Simple_US_Customer" stepKey="createCustomer"/> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/CreateInvoiceWithShipmentAndCheckInvoicedOrderTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/CreateInvoiceWithShipmentAndCheckInvoicedOrderTest.xml index 540af6958d54c..1c92c2dae3712 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/CreateInvoiceWithShipmentAndCheckInvoicedOrderTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/CreateInvoiceWithShipmentAndCheckInvoicedOrderTest.xml @@ -20,7 +20,7 @@ </annotations> <before> <!-- Login as admin --> - <actionGroup ref="LoginAsAdmin" stepKey="LoginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="LoginAsAdmin"/> <!-- Create customer --> <createData entity="Simple_US_Customer" stepKey="createCustomer"/> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/CreateInvoiceWithZeroSubtotalCheckoutTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/CreateInvoiceWithZeroSubtotalCheckoutTest.xml index 8fd751f96914e..b562073a1276f 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/CreateInvoiceWithZeroSubtotalCheckoutTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/CreateInvoiceWithZeroSubtotalCheckoutTest.xml @@ -20,7 +20,7 @@ </annotations> <before> <!-- Login as admin --> - <actionGroup ref="LoginAsAdmin" stepKey="LoginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="LoginAsAdmin"/> <!-- Create customer --> <createData entity="Simple_US_Customer" stepKey="createCustomer"/> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/CreateOrderFromEditCustomerPageTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/CreateOrderFromEditCustomerPageTest.xml index e8eea2019c941..776d84ac230b8 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/CreateOrderFromEditCustomerPageTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/CreateOrderFromEditCustomerPageTest.xml @@ -20,7 +20,7 @@ </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <createData entity="FreeShippingMethodsSettingConfig" stepKey="freeShippingMethodsSettingConfig"/> <!--Create simple customer--> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/CreditMemoTotalAfterShippingDiscountTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/CreditMemoTotalAfterShippingDiscountTest.xml index 97d9ad9dbeb59..09197963434eb 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/CreditMemoTotalAfterShippingDiscountTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/CreditMemoTotalAfterShippingDiscountTest.xml @@ -92,7 +92,7 @@ <waitForElement selector="{{CheckoutPaymentSection.placeOrder}}" time="30" stepKey="waitForPlaceOrderButton"/> <click selector="{{CheckoutPaymentSection.placeOrder}}" stepKey="clickPlaceOrder"/> <grabTextFrom selector="{{CheckoutSuccessMainSection.orderNumber}}" stepKey="grabOrderNumber"/> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin1"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin1"/> <!-- Search for Order in the order grid --> <amOnPage url="{{AdminOrdersPage.url}}" stepKey="onOrdersPage"/> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/MoveConfigurableProductsInComparedOnOrderPageTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/MoveConfigurableProductsInComparedOnOrderPageTest.xml index 1f655f319076b..c3058ca6ede87 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/MoveConfigurableProductsInComparedOnOrderPageTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/MoveConfigurableProductsInComparedOnOrderPageTest.xml @@ -130,7 +130,7 @@ </actionGroup> <!-- Login as admin --> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <!-- Open Customers -> All Customers --> <amOnPage url="{{AdminCustomerPage.url}}" stepKey="openCustomersGridPage"/> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/MoveLastOrderedConfigurableProductOnOrderPageTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/MoveLastOrderedConfigurableProductOnOrderPageTest.xml index f9215ff5019ff..c635e6b0ad6b2 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/MoveLastOrderedConfigurableProductOnOrderPageTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/MoveLastOrderedConfigurableProductOnOrderPageTest.xml @@ -21,7 +21,7 @@ </annotations> <before> <!-- Login as admin --> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <!-- Create customer --> <createData entity="Simple_US_CA_Customer" stepKey="createCustomer"/> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/MoveLastOrderedSimpleProductOnOrderPageTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/MoveLastOrderedSimpleProductOnOrderPageTest.xml index 4596faedbbe6c..eb28ebfd068da 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/MoveLastOrderedSimpleProductOnOrderPageTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/MoveLastOrderedSimpleProductOnOrderPageTest.xml @@ -21,7 +21,7 @@ </annotations> <before> <!-- Login as admin --> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <!-- Create customer --> <createData entity="Simple_US_CA_Customer" stepKey="createCustomer"/> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/MoveRecentlyViewedBundleFixedProductOnOrderPageTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/MoveRecentlyViewedBundleFixedProductOnOrderPageTest.xml index bf78012926a7b..f374741c247d4 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/MoveRecentlyViewedBundleFixedProductOnOrderPageTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/MoveRecentlyViewedBundleFixedProductOnOrderPageTest.xml @@ -21,7 +21,7 @@ </annotations> <before> <!-- Login as admin --> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <!-- Create customer --> <createData entity="Simple_US_CA_Customer" stepKey="createCustomer"/> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/MoveRecentlyViewedConfigurableProductOnOrderPageTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/MoveRecentlyViewedConfigurableProductOnOrderPageTest.xml index 4fafd3d163930..0e021600ab3e3 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/MoveRecentlyViewedConfigurableProductOnOrderPageTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/MoveRecentlyViewedConfigurableProductOnOrderPageTest.xml @@ -21,7 +21,7 @@ </annotations> <before> <!-- Login as admin --> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <!-- Create customer --> <createData entity="Simple_US_CA_Customer" stepKey="createCustomer"/> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/MoveSimpleProductsInComparedOnOrderPageTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/MoveSimpleProductsInComparedOnOrderPageTest.xml index 9ee96e2b64678..176fb05bc74b3 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/MoveSimpleProductsInComparedOnOrderPageTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/MoveSimpleProductsInComparedOnOrderPageTest.xml @@ -68,7 +68,7 @@ </actionGroup> <!-- Login as admin --> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <!-- Open Customers -> All Customers --> <amOnPage url="{{AdminCustomerPage.url}}" stepKey="openCustomersGridPage"/> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/StorefrontOrderPagerDisplayedTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/StorefrontOrderPagerDisplayedTest.xml index f68a36b29af4f..5cc4fae330d05 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/StorefrontOrderPagerDisplayedTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/StorefrontOrderPagerDisplayedTest.xml @@ -19,7 +19,7 @@ <group value="mtf_migrated"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="LoginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="LoginAsAdmin"/> <!-- 21 products created and category --> <createData entity="_defaultCategory" stepKey="createCategory"/> <createData entity="SimpleProduct" stepKey="createProduct01"> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/StorefrontOrderPagerIsAbsentTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/StorefrontOrderPagerIsAbsentTest.xml index 9319022a96b20..20261de502ea3 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/StorefrontOrderPagerIsAbsentTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/StorefrontOrderPagerIsAbsentTest.xml @@ -19,7 +19,7 @@ <group value="mtf_migrated"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="LoginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="LoginAsAdmin"/> <!-- 20 products created and category --> <createData entity="_defaultCategory" stepKey="createCategory"/> <createData entity="SimpleProduct" stepKey="createProduct01"> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/StorefrontPrintOrderGuestTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/StorefrontPrintOrderGuestTest.xml index 468abf8fb8b81..00117c56de439 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/StorefrontPrintOrderGuestTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/StorefrontPrintOrderGuestTest.xml @@ -20,7 +20,7 @@ </annotations> <before> <magentoCLI command="downloadable:domains:add" arguments="example.com static.magento.com" stepKey="addDownloadableDomain"/> - <actionGroup ref="LoginAsAdmin" stepKey="LoginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="LoginAsAdmin"/> <createData entity="ApiCategory" stepKey="createCategory"/> <!-- Create downloadable Product --> diff --git a/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCartRulesAppliedForProductInCartTest.xml b/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCartRulesAppliedForProductInCartTest.xml index 49dcc47e14779..1433d660d3535 100644 --- a/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCartRulesAppliedForProductInCartTest.xml +++ b/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCartRulesAppliedForProductInCartTest.xml @@ -28,7 +28,7 @@ <field key="quantity">500</field> </createData> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> </before> <after> diff --git a/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreateBuyXGetYFreeTest.xml b/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreateBuyXGetYFreeTest.xml index 3f063b5869129..ed2dd16b7df9d 100644 --- a/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreateBuyXGetYFreeTest.xml +++ b/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreateBuyXGetYFreeTest.xml @@ -21,7 +21,7 @@ <before> <createData entity="_defaultCategory" stepKey="createPreReqCategory"/> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> </before> <after> diff --git a/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreateCartPriceRuleAndVerifyRuleConditionIsNotAppliedTest.xml b/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreateCartPriceRuleAndVerifyRuleConditionIsNotAppliedTest.xml index 0e1a4d7c186aa..9ac73ceae586e 100644 --- a/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreateCartPriceRuleAndVerifyRuleConditionIsNotAppliedTest.xml +++ b/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreateCartPriceRuleAndVerifyRuleConditionIsNotAppliedTest.xml @@ -22,7 +22,7 @@ <magentoCLI command="config:set {{EnableFlatRateConfigData.path}} {{EnableFlatRateConfigData.value}}" stepKey="enableFlatRate"/> <magentoCLI command="config:set {{EnableFlatRateDefaultPriceConfigData.path}} {{EnableFlatRateDefaultPriceConfigData.value}}" stepKey="enableFlatRateDefaultPrice"/> <createData entity="defaultSimpleProduct" stepKey="initialSimpleProduct"/> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> </before> <after> <deleteData stepKey="deleteProduct" createDataKey="initialSimpleProduct"/> diff --git a/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreateCartPriceRuleEmptyFromDateTest.xml b/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreateCartPriceRuleEmptyFromDateTest.xml index 64443c717ac33..67e75d63e016e 100644 --- a/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreateCartPriceRuleEmptyFromDateTest.xml +++ b/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreateCartPriceRuleEmptyFromDateTest.xml @@ -24,7 +24,7 @@ <createData entity="SimpleProduct" stepKey="product"> <requiredEntity createDataKey="category"/> </createData> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> </before> <after> diff --git a/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreateCartPriceRuleForCouponCodeTest.xml b/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreateCartPriceRuleForCouponCodeTest.xml index f33eb187e4cc8..2bf96cf0377d4 100644 --- a/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreateCartPriceRuleForCouponCodeTest.xml +++ b/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreateCartPriceRuleForCouponCodeTest.xml @@ -21,7 +21,7 @@ <before> <createData entity="_defaultCategory" stepKey="createPreReqCategory"/> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> </before> <after> diff --git a/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreateCartPriceRuleForGeneratedCouponTest.xml b/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreateCartPriceRuleForGeneratedCouponTest.xml index 4b793dbf8583f..9833231f8ed84 100644 --- a/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreateCartPriceRuleForGeneratedCouponTest.xml +++ b/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreateCartPriceRuleForGeneratedCouponTest.xml @@ -21,7 +21,7 @@ <before> <createData entity="_defaultCategory" stepKey="createPreReqCategory"/> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> </before> <after> diff --git a/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreateFixedAmountDiscountTest.xml b/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreateFixedAmountDiscountTest.xml index f6d61f62c1f54..0d98abfba3f62 100644 --- a/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreateFixedAmountDiscountTest.xml +++ b/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreateFixedAmountDiscountTest.xml @@ -21,7 +21,7 @@ <before> <createData entity="_defaultCategory" stepKey="createPreReqCategory"/> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> </before> <after> diff --git a/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreateFixedAmountWholeCartDiscountTest.xml b/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreateFixedAmountWholeCartDiscountTest.xml index cb3e6c517e1ec..bc4139435ab55 100644 --- a/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreateFixedAmountWholeCartDiscountTest.xml +++ b/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreateFixedAmountWholeCartDiscountTest.xml @@ -21,7 +21,7 @@ <before> <createData entity="_defaultCategory" stepKey="createPreReqCategory"/> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> </before> <after> diff --git a/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreateInvalidRuleTest.xml b/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreateInvalidRuleTest.xml index 3bbacf912e5d6..56c4506196d24 100644 --- a/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreateInvalidRuleTest.xml +++ b/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreateInvalidRuleTest.xml @@ -19,7 +19,7 @@ </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> </before> <after> diff --git a/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreatePercentOfProductPriceTest.xml b/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreatePercentOfProductPriceTest.xml index 902c118129bab..23e472518ba84 100644 --- a/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreatePercentOfProductPriceTest.xml +++ b/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreatePercentOfProductPriceTest.xml @@ -23,7 +23,7 @@ <createData entity="_defaultCategory" stepKey="createPreReqCategory"/> <!-- Reindex invalidated indices after product attribute has been created/deleted --> <magentoCron groups="index" stepKey="reindexInvalidatedIndices"/> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> </before> <after> diff --git a/app/code/Magento/SalesRule/Test/Mftf/Test/AdminDeleteActiveSalesRuleWithComplexConditionsAndVerifyDeleteMessageTest.xml b/app/code/Magento/SalesRule/Test/Mftf/Test/AdminDeleteActiveSalesRuleWithComplexConditionsAndVerifyDeleteMessageTest.xml index aed9d71c306ae..3aacc176acdc5 100644 --- a/app/code/Magento/SalesRule/Test/Mftf/Test/AdminDeleteActiveSalesRuleWithComplexConditionsAndVerifyDeleteMessageTest.xml +++ b/app/code/Magento/SalesRule/Test/Mftf/Test/AdminDeleteActiveSalesRuleWithComplexConditionsAndVerifyDeleteMessageTest.xml @@ -19,7 +19,7 @@ </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <!--Create active cart price rule--> <actionGroup ref="AdminCreateCartPriceRuleRuleInfoSectionActionGroup" stepKey="createActiveCartPriceRuleRuleInfoSection"> <argument name="ruleName" value="ActiveSalesRuleWithComplexConditions"/> diff --git a/app/code/Magento/SalesRule/Test/Mftf/Test/AdminDeleteActiveSalesRuleWithPercentPriceAndVerifyDeleteMessageTest.xml b/app/code/Magento/SalesRule/Test/Mftf/Test/AdminDeleteActiveSalesRuleWithPercentPriceAndVerifyDeleteMessageTest.xml index fc9a92765c2d0..8c02f401992ee 100644 --- a/app/code/Magento/SalesRule/Test/Mftf/Test/AdminDeleteActiveSalesRuleWithPercentPriceAndVerifyDeleteMessageTest.xml +++ b/app/code/Magento/SalesRule/Test/Mftf/Test/AdminDeleteActiveSalesRuleWithPercentPriceAndVerifyDeleteMessageTest.xml @@ -20,7 +20,7 @@ </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <!--Create active cart price rule--> <actionGroup ref="AdminCreateCartPriceRuleWithCouponCodeActionGroup" stepKey="createActiveCartPriceRule"> <argument name="ruleName" value="ActiveSalesRuleWithPercentPriceDiscountCoupon"/> diff --git a/app/code/Magento/SalesRule/Test/Mftf/Test/AdminDeleteInactiveSalesRuleAndVerifyDeleteMessageTest.xml b/app/code/Magento/SalesRule/Test/Mftf/Test/AdminDeleteInactiveSalesRuleAndVerifyDeleteMessageTest.xml index 6de5f127a296c..18183085060d2 100644 --- a/app/code/Magento/SalesRule/Test/Mftf/Test/AdminDeleteInactiveSalesRuleAndVerifyDeleteMessageTest.xml +++ b/app/code/Magento/SalesRule/Test/Mftf/Test/AdminDeleteInactiveSalesRuleAndVerifyDeleteMessageTest.xml @@ -20,7 +20,7 @@ </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <createData entity="defaultSimpleProduct" stepKey="initialSimpleProduct"/> <!--Create inactive cart price rule--> <actionGroup ref="AdminInactiveCartPriceRuleActionGroup" stepKey="createInactiveCartPriceRule"> diff --git a/app/code/Magento/SalesRule/Test/Mftf/Test/AdminMarketingCartPriceRulesNavigateMenuTest.xml b/app/code/Magento/SalesRule/Test/Mftf/Test/AdminMarketingCartPriceRulesNavigateMenuTest.xml index 58d7ea7c1bad8..d001ac98eefeb 100644 --- a/app/code/Magento/SalesRule/Test/Mftf/Test/AdminMarketingCartPriceRulesNavigateMenuTest.xml +++ b/app/code/Magento/SalesRule/Test/Mftf/Test/AdminMarketingCartPriceRulesNavigateMenuTest.xml @@ -20,7 +20,7 @@ <group value="mtf_migrated"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="LoginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="LoginAsAdmin"/> </before> <after> <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> diff --git a/app/code/Magento/SalesRule/Test/Mftf/Test/CartPriceRuleForConfigurableProductTest.xml b/app/code/Magento/SalesRule/Test/Mftf/Test/CartPriceRuleForConfigurableProductTest.xml index 22dff89ebe8a6..bc608c0e06086 100644 --- a/app/code/Magento/SalesRule/Test/Mftf/Test/CartPriceRuleForConfigurableProductTest.xml +++ b/app/code/Magento/SalesRule/Test/Mftf/Test/CartPriceRuleForConfigurableProductTest.xml @@ -77,7 +77,7 @@ <magentoCLI command="cron:run --group=index" stepKey="runCronIndexer"/> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> </before> <after> diff --git a/app/code/Magento/SalesRule/Test/Mftf/Test/PriceRuleCategoryNestingTest.xml b/app/code/Magento/SalesRule/Test/Mftf/Test/PriceRuleCategoryNestingTest.xml index f99b19f4a6289..91fe4f142d570 100644 --- a/app/code/Magento/SalesRule/Test/Mftf/Test/PriceRuleCategoryNestingTest.xml +++ b/app/code/Magento/SalesRule/Test/Mftf/Test/PriceRuleCategoryNestingTest.xml @@ -35,7 +35,7 @@ <actionGroup ref="AdminLogoutActionGroup" stepKey="adminLogout"/> </after> <!-- Login as admin and open page for creation new Price Rule --> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin1"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin1"/> <amOnPage url="{{PriceRuleNewPage.url}}" stepKey="openCatalogPriceRulePage"/> <waitForPageLoad stepKey="waitCatalogPriceRulePageLoad"/> <!-- Open Conditions section and select Categories condition --> diff --git a/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontAutoGeneratedCouponCodeTest.xml b/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontAutoGeneratedCouponCodeTest.xml index 96ba6208a7518..09b45cd554056 100644 --- a/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontAutoGeneratedCouponCodeTest.xml +++ b/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontAutoGeneratedCouponCodeTest.xml @@ -37,7 +37,7 @@ <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> </after> <!-- Login as Admin --> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <!-- Search Cart Price Rule and go to edit Cart Price Rule --> <amOnPage url="{{AdminCartPriceRulesPage.url}}" stepKey="amOnCartPriceList"/> diff --git a/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontCartPriceRuleCountryTest.xml b/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontCartPriceRuleCountryTest.xml index 1406d4dfbde67..4cc331eebc4ee 100644 --- a/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontCartPriceRuleCountryTest.xml +++ b/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontCartPriceRuleCountryTest.xml @@ -24,7 +24,7 @@ <createData entity="_defaultProduct" stepKey="createPreReqProduct"> <requiredEntity createDataKey="createPreReqCategory"/> </createData> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> </before> <after> diff --git a/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontCartPriceRulePostcodeTest.xml b/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontCartPriceRulePostcodeTest.xml index aade41b30284c..4d987c00884e1 100644 --- a/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontCartPriceRulePostcodeTest.xml +++ b/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontCartPriceRulePostcodeTest.xml @@ -24,7 +24,7 @@ <createData entity="_defaultProduct" stepKey="createPreReqProduct"> <requiredEntity createDataKey="createPreReqCategory"/> </createData> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> </before> <after> diff --git a/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontCartPriceRuleQuantityTest.xml b/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontCartPriceRuleQuantityTest.xml index 283d22351b1f1..ff0e011210785 100644 --- a/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontCartPriceRuleQuantityTest.xml +++ b/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontCartPriceRuleQuantityTest.xml @@ -25,7 +25,7 @@ <requiredEntity createDataKey="createPreReqCategory"/> </createData> <magentoCron groups="index" stepKey="reindexInvalidatedIndices"/> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> </before> <after> diff --git a/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontCartPriceRuleStateTest.xml b/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontCartPriceRuleStateTest.xml index fafede4120573..036844562af50 100644 --- a/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontCartPriceRuleStateTest.xml +++ b/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontCartPriceRuleStateTest.xml @@ -24,7 +24,7 @@ <createData entity="_defaultProduct" stepKey="createPreReqProduct"> <requiredEntity createDataKey="createPreReqCategory"/> </createData> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> </before> <after> diff --git a/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontCartPriceRuleSubtotalTest.xml b/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontCartPriceRuleSubtotalTest.xml index 7d343cd6dafd8..efd82316f0b0a 100644 --- a/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontCartPriceRuleSubtotalTest.xml +++ b/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontCartPriceRuleSubtotalTest.xml @@ -25,7 +25,7 @@ <requiredEntity createDataKey="createPreReqCategory"/> </createData> <magentoCron groups="index" stepKey="reindexInvalidatedIndices"/> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> </before> <after> diff --git a/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontCartRuleCouponForFreeShippingTest.xml b/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontCartRuleCouponForFreeShippingTest.xml index 12c278d1e7b63..7d266e2cdd6f1 100644 --- a/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontCartRuleCouponForFreeShippingTest.xml +++ b/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontCartRuleCouponForFreeShippingTest.xml @@ -86,7 +86,7 @@ <grabFromCurrentUrl regex="~/order_id/(\d+)/~" stepKey="grabOrderId"/> <!-- Login to admin --> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <!-- Go to created Order --> <amOnPage url="{{AdminOrderPage.url({$grabOrderId})}}" stepKey="goToAdminViewOrder"/> diff --git a/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontCartTotalValueWithFullDiscountUsingCartRuleTest.xml b/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontCartTotalValueWithFullDiscountUsingCartRuleTest.xml index 80b0747a3bf72..172f6b6ba24c6 100644 --- a/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontCartTotalValueWithFullDiscountUsingCartRuleTest.xml +++ b/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontCartTotalValueWithFullDiscountUsingCartRuleTest.xml @@ -20,7 +20,7 @@ </annotations> <before> <!-- log in --> - <actionGroup ref="LoginAsAdmin" stepKey="login"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="login"/> <!-- Set configurations --> <magentoCLI command="config:set carriers/tablerate/active 1" stepKey="setShippingMethodEnabled"/> <magentoCLI command="config:set carriers/tablerate/condition_name package_value" stepKey="setShippingMethodConditionName"/> diff --git a/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontCategoryRulesShouldApplyToComplexProductsTest.xml b/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontCategoryRulesShouldApplyToComplexProductsTest.xml index b43fd095b5556..85a30b3a3a2b4 100644 --- a/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontCategoryRulesShouldApplyToComplexProductsTest.xml +++ b/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontCategoryRulesShouldApplyToComplexProductsTest.xml @@ -29,7 +29,7 @@ <actionGroup ref="AdminCreateApiConfigurableProductWithHiddenChildActionGroup" stepKey="createConfigurableProduct2"> <argument name="productName" value="config2"/> </actionGroup> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <!-- Assign config1 and the associated child products to CAT1 --> <actionGroup ref="AdminAssignProductToCategoryActionGroup" stepKey="assignConfigurableProduct1ToCategory"> <argument name="productId" value="$$createConfigProductCreateConfigurableProduct1.id$$"/> diff --git a/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontCategoryRulesShouldApplyToGroupedProductWithInvisibleIndividualProductTest.xml b/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontCategoryRulesShouldApplyToGroupedProductWithInvisibleIndividualProductTest.xml index 13c1100bd21f6..d63df5fe50a6d 100644 --- a/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontCategoryRulesShouldApplyToGroupedProductWithInvisibleIndividualProductTest.xml +++ b/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontCategoryRulesShouldApplyToGroupedProductWithInvisibleIndividualProductTest.xml @@ -62,7 +62,7 @@ <requiredEntity createDataKey="createSecondGroupedProduct"/> <requiredEntity createDataKey="createFourthSimpleProduct"/> </updateData> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> </before> <after> <deleteData createDataKey="createFirstSimpleProduct" stepKey="deleteFirstSimpleProduct"/> diff --git a/app/code/Magento/Search/Controller/Term/Popular.php b/app/code/Magento/Search/Controller/Term/Popular.php index 0573fe6a81a12..2b3ac5c73c9dd 100644 --- a/app/code/Magento/Search/Controller/Term/Popular.php +++ b/app/code/Magento/Search/Controller/Term/Popular.php @@ -3,59 +3,78 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ +declare(strict_types=1); + namespace Magento\Search\Controller\Term; -use Magento\Framework\App\Action\Action; -use Magento\Framework\App\Action\Context; +use Magento\Framework\App\Action\HttpGetActionInterface; use Magento\Framework\App\Config\ScopeConfigInterface; -use Magento\Framework\App\RequestInterface; +use Magento\Framework\Controller\Result\ForwardFactory as ResultForwardFactory; +use Magento\Framework\View\Result\PageFactory as ResultPageFactory; use Magento\Store\Model\ScopeInterface; -use Magento\Framework\Controller\ResultFactory; -class Popular extends Action +/** + * Popular search terms page + */ +class Popular implements HttpGetActionInterface { + private const XML_PATH_SEO_SEARCH_TERMS = 'catalog/seo/search_terms'; + /** - * @var \Magento\Framework\App\Config\ScopeConfigInterface + * @var ResultForwardFactory */ - protected $scopeConfig; + private $resultForwardFactory; /** - * @param \Magento\Framework\App\Action\Context $context - * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig + * @var ResultPageFactory */ - public function __construct(Context $context, ScopeConfigInterface $scopeConfig) - { + private $resultPageFactory; + + /** + * @var ScopeConfigInterface + */ + private $scopeConfig; + + /** + * @param ResultForwardFactory $resultForwardFactory + * @param ResultPageFactory $resultPageFactory + * @param ScopeConfigInterface $scopeConfig + */ + public function __construct( + ResultForwardFactory $resultForwardFactory, + ResultPageFactory $resultPageFactory, + ScopeConfigInterface $scopeConfig + ) { + $this->resultForwardFactory = $resultForwardFactory; + $this->resultPageFactory = $resultPageFactory; $this->scopeConfig = $scopeConfig; - parent::__construct($context); } /** - * Dispatch request - * - * @param \Magento\Framework\App\RequestInterface $request - * @return \Magento\Framework\App\ResponseInterface - * @throws \Magento\Framework\Exception\NotFoundException + * @inheritDoc */ - public function dispatch(RequestInterface $request) + public function execute() { - $searchTerms = $this->scopeConfig->getValue( - 'catalog/seo/search_terms', - ScopeInterface::SCOPE_STORE - ); - if (!$searchTerms) { - $this->_redirect('noroute'); - $this->_actionFlag->set('', self::FLAG_NO_DISPATCH, true); + if (!$this->checkEnabledSearchTerms()) { + $resultForward = $this->resultForwardFactory->create(); + $resultForward->forward('noroute'); + + return $resultForward; } - return parent::dispatch($request); + + return $this->resultPageFactory->create(); } /** - * @return \Magento\Framework\View\Result\Page + * Check if search terms are enabled + * + * @return bool */ - public function execute() + private function checkEnabledSearchTerms(): bool { - /** @var \Magento\Framework\View\Result\Page $resultPage */ - $resultPage = $this->resultFactory->create(ResultFactory::TYPE_PAGE); - return $resultPage; + return $this->scopeConfig->isSetFlag( + self::XML_PATH_SEO_SEARCH_TERMS, + ScopeInterface::SCOPE_STORE + ); } } diff --git a/app/code/Magento/Search/Test/Mftf/Test/AdminGlobalSearchOnProductPageTest.xml b/app/code/Magento/Search/Test/Mftf/Test/AdminGlobalSearchOnProductPageTest.xml index 6ff7a34a03b8a..82ec95b24d3ca 100644 --- a/app/code/Magento/Search/Test/Mftf/Test/AdminGlobalSearchOnProductPageTest.xml +++ b/app/code/Magento/Search/Test/Mftf/Test/AdminGlobalSearchOnProductPageTest.xml @@ -20,7 +20,7 @@ </annotations> <before> <!-- Login as admin --> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> </before> <after> <!-- Delete product --> diff --git a/app/code/Magento/Search/Test/Mftf/Test/AdminMassDeleteSearchTermEntityTest.xml b/app/code/Magento/Search/Test/Mftf/Test/AdminMassDeleteSearchTermEntityTest.xml index 2b7a4e7f5e5cb..9ff088fb25b82 100644 --- a/app/code/Magento/Search/Test/Mftf/Test/AdminMassDeleteSearchTermEntityTest.xml +++ b/app/code/Magento/Search/Test/Mftf/Test/AdminMassDeleteSearchTermEntityTest.xml @@ -26,7 +26,7 @@ <createData entity="SearchTerm" stepKey="createThirdSearchTerm"/> <!-- Login as admin --> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> </before> <after> <!-- Log out --> diff --git a/app/code/Magento/Search/Test/Mftf/Test/StorefrontUsingElasticSearchWithWeightAttributeTest.xml b/app/code/Magento/Search/Test/Mftf/Test/StorefrontUsingElasticSearchWithWeightAttributeTest.xml index 4cdd8e6992367..18f623288621d 100644 --- a/app/code/Magento/Search/Test/Mftf/Test/StorefrontUsingElasticSearchWithWeightAttributeTest.xml +++ b/app/code/Magento/Search/Test/Mftf/Test/StorefrontUsingElasticSearchWithWeightAttributeTest.xml @@ -22,7 +22,7 @@ <!--Create Simple Product with weight--> <createData entity="defaultSimpleProduct" stepKey="simpleProduct"/> <!-- Login as admin --> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> </before> <after> <!-- Delete create product --> diff --git a/app/code/Magento/Search/Test/Mftf/Test/StorefrontVerifySearchSuggestionByProductDescriptionTest.xml b/app/code/Magento/Search/Test/Mftf/Test/StorefrontVerifySearchSuggestionByProductDescriptionTest.xml index 5030484434925..3bfa777ac27d8 100644 --- a/app/code/Magento/Search/Test/Mftf/Test/StorefrontVerifySearchSuggestionByProductDescriptionTest.xml +++ b/app/code/Magento/Search/Test/Mftf/Test/StorefrontVerifySearchSuggestionByProductDescriptionTest.xml @@ -19,7 +19,7 @@ </annotations> <before> <!-- Login as admin --> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <!-- Create product with description --> <createData entity="SimpleProductWithDescription" stepKey="simpleProduct"/> diff --git a/app/code/Magento/Search/Test/Mftf/Test/StorefrontVerifySearchSuggestionByProductNameTest.xml b/app/code/Magento/Search/Test/Mftf/Test/StorefrontVerifySearchSuggestionByProductNameTest.xml index 1d312959a4a00..93a3c8ca8e4a2 100644 --- a/app/code/Magento/Search/Test/Mftf/Test/StorefrontVerifySearchSuggestionByProductNameTest.xml +++ b/app/code/Magento/Search/Test/Mftf/Test/StorefrontVerifySearchSuggestionByProductNameTest.xml @@ -20,7 +20,7 @@ <before> <!-- Login as admin --> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <!--Create Simple Product --> <createData entity="defaultSimpleProduct" stepKey="simpleProduct"/> diff --git a/app/code/Magento/Search/Test/Mftf/Test/StorefrontVerifySearchSuggestionByProductShortDescriptionTest.xml b/app/code/Magento/Search/Test/Mftf/Test/StorefrontVerifySearchSuggestionByProductShortDescriptionTest.xml index 3ae29f60a8e86..ebe3b6c129721 100644 --- a/app/code/Magento/Search/Test/Mftf/Test/StorefrontVerifySearchSuggestionByProductShortDescriptionTest.xml +++ b/app/code/Magento/Search/Test/Mftf/Test/StorefrontVerifySearchSuggestionByProductShortDescriptionTest.xml @@ -20,7 +20,7 @@ <before> <!-- Login as admin --> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <!-- Create product with short description --> <createData entity="ApiProductWithDescription" stepKey="product"/> diff --git a/app/code/Magento/Search/Test/Mftf/Test/StorefrontVerifySearchSuggestionByProductSkuTest.xml b/app/code/Magento/Search/Test/Mftf/Test/StorefrontVerifySearchSuggestionByProductSkuTest.xml index e14cbbb85a0e7..e72f614593cfe 100644 --- a/app/code/Magento/Search/Test/Mftf/Test/StorefrontVerifySearchSuggestionByProductSkuTest.xml +++ b/app/code/Magento/Search/Test/Mftf/Test/StorefrontVerifySearchSuggestionByProductSkuTest.xml @@ -20,7 +20,7 @@ <before> <!-- Login as admin --> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <!--Create Simple Product --> <createData entity="defaultSimpleProduct" stepKey="simpleProduct"/> diff --git a/app/code/Magento/Search/Test/Mftf/Test/StorefrontVerifySearchTermEntityRedirectTest.xml b/app/code/Magento/Search/Test/Mftf/Test/StorefrontVerifySearchTermEntityRedirectTest.xml index 5f21d4364736b..6ff4b7de5559d 100644 --- a/app/code/Magento/Search/Test/Mftf/Test/StorefrontVerifySearchTermEntityRedirectTest.xml +++ b/app/code/Magento/Search/Test/Mftf/Test/StorefrontVerifySearchTermEntityRedirectTest.xml @@ -17,7 +17,7 @@ <before> <!-- Login As Admin User --> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <!-- Navigate To Marketing Search Terms Grid --> <actionGroup ref="AdminNavigateMenuActionGroup" stepKey="navigateToSearchTermPage"> <argument name="menuUiId" value="{{AdminMenuMarketing.dataUiId}}"/> diff --git a/app/code/Magento/Search/Test/Unit/Controller/Term/PopularTest.php b/app/code/Magento/Search/Test/Unit/Controller/Term/PopularTest.php new file mode 100644 index 0000000000000..590d959b95ff3 --- /dev/null +++ b/app/code/Magento/Search/Test/Unit/Controller/Term/PopularTest.php @@ -0,0 +1,103 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Search\Test\Unit\Controller\Term; + +use Magento\Framework\App\Config\ScopeConfigInterface; +use Magento\Framework\Controller\Result\Forward as ResultForward; +use Magento\Framework\Controller\Result\ForwardFactory as ResultForwardFactory; +use Magento\Framework\View\Result\Page as ResultPage; +use Magento\Framework\View\Result\PageFactory as ResultPageFactory; +use Magento\Framework\TestFramework\Unit\Helper\ObjectManager; +use Magento\Search\Controller\Term\Popular; +use Magento\Store\Model\ScopeInterface; +use PHPUnit\Framework\MockObject\MockObject; +use PHPUnit\Framework\TestCase; + +class PopularTest extends TestCase +{ + private const XML_PATH_SEO_SEARCH_TERMS = 'catalog/seo/search_terms'; + + /** + * @var Popular + */ + private $action; + + /** + * @var ResultForwardFactory|MockObject + */ + private $resultForwardFactoryMock; + + /** + * @var ResultPageFactory|MockObject + */ + private $resultPageFactoryMock; + + /** + * @var ScopeConfigInterface|MockObject + */ + private $scopeConfigMock; + + protected function setUp() + { + $this->resultForwardFactoryMock = $this->getMockBuilder(ResultForwardFactory::class) + ->disableOriginalConstructor() + ->getMock(); + + $this->resultPageFactoryMock = $this->getMockBuilder(ResultPageFactory::class) + ->disableOriginalConstructor() + ->getMock(); + + $this->scopeConfigMock = $this->getMockBuilder(ScopeConfigInterface::class) + ->getMockForAbstractClass(); + + $objectManager = new ObjectManager($this); + $this->action = $objectManager->getObject( + Popular::class, + [ + 'resultForwardFactory' => $this->resultForwardFactoryMock, + 'resultPageFactory' => $this->resultPageFactoryMock, + 'scopeConfig' => $this->scopeConfigMock + ] + ); + } + + public function testResult() + { + $this->scopeConfigMock->expects($this->once()) + ->method('isSetFlag') + ->with(static::XML_PATH_SEO_SEARCH_TERMS, ScopeInterface::SCOPE_STORE) + ->willReturn(true); + $resultPageMock = $this->getMockBuilder(ResultPage::class) + ->disableOriginalConstructor() + ->getMock(); + $this->resultPageFactoryMock->expects($this->once()) + ->method('create') + ->willReturn($resultPageMock); + + $this->assertSame($resultPageMock, $this->action->execute()); + } + + public function testResultWithDisabledPage() + { + $this->scopeConfigMock->expects($this->once()) + ->method('isSetFlag') + ->with(static::XML_PATH_SEO_SEARCH_TERMS, ScopeInterface::SCOPE_STORE) + ->willReturn(false); + $resultForwardMock = $this->getMockBuilder(ResultForward::class) + ->disableOriginalConstructor() + ->getMock(); + $this->resultForwardFactoryMock->expects($this->once()) + ->method('create') + ->willReturn($resultForwardMock); + $resultForwardMock->expects($this->once()) + ->method('forward') + ->with('noroute'); + + $this->assertSame($resultForwardMock, $this->action->execute()); + } +} diff --git a/app/code/Magento/Security/Test/Mftf/Test/AdminCreateNewUserWithInvalidExpirationTest.xml b/app/code/Magento/Security/Test/Mftf/Test/AdminCreateNewUserWithInvalidExpirationTest.xml index 02a8170b308d3..fc91c8caddf71 100644 --- a/app/code/Magento/Security/Test/Mftf/Test/AdminCreateNewUserWithInvalidExpirationTest.xml +++ b/app/code/Magento/Security/Test/Mftf/Test/AdminCreateNewUserWithInvalidExpirationTest.xml @@ -19,10 +19,10 @@ </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> </before> <after> - <actionGroup ref="logout" stepKey="logout"/> + <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> </after> <actionGroup ref="AdminOpenNewUserPageActionGroup" stepKey="openNewUserPage" /> diff --git a/app/code/Magento/Security/Test/Mftf/Test/AdminCreateNewUserWithValidExpirationTest.xml b/app/code/Magento/Security/Test/Mftf/Test/AdminCreateNewUserWithValidExpirationTest.xml index dc971f2044760..cd67bf4612520 100644 --- a/app/code/Magento/Security/Test/Mftf/Test/AdminCreateNewUserWithValidExpirationTest.xml +++ b/app/code/Magento/Security/Test/Mftf/Test/AdminCreateNewUserWithValidExpirationTest.xml @@ -18,10 +18,10 @@ <group value="security"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> </before> <after> - <actionGroup ref="logout" stepKey="logout"/> + <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> </after> <actionGroup ref="AdminOpenNewUserPageActionGroup" stepKey="openNewUserPage" /> diff --git a/app/code/Magento/Security/Test/Mftf/Test/AdminLockAdminUserWhenCreatingNewIntegrationTest.xml b/app/code/Magento/Security/Test/Mftf/Test/AdminLockAdminUserWhenCreatingNewIntegrationTest.xml index c3945fe0199b6..a75f65dffeca3 100644 --- a/app/code/Magento/Security/Test/Mftf/Test/AdminLockAdminUserWhenCreatingNewIntegrationTest.xml +++ b/app/code/Magento/Security/Test/Mftf/Test/AdminLockAdminUserWhenCreatingNewIntegrationTest.xml @@ -23,7 +23,7 @@ </annotations> <before> <!-- Log in to Admin Panel --> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> </before> <after> <!-- Unlock Admin user --> @@ -94,7 +94,7 @@ </actionGroup> <!-- Try to login as admin and check error --> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsLockedAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsLockedAdmin"/> <actionGroup ref="AssertMessageOnAdminLoginActionGroup" stepKey="checkLoginError" /> </test> </tests> diff --git a/app/code/Magento/Security/Test/Mftf/Test/AdminLockAdminUserWhenCreatingNewRoleTest.xml b/app/code/Magento/Security/Test/Mftf/Test/AdminLockAdminUserWhenCreatingNewRoleTest.xml index bf13ab6b5c6aa..3d04f3eed4daf 100644 --- a/app/code/Magento/Security/Test/Mftf/Test/AdminLockAdminUserWhenCreatingNewRoleTest.xml +++ b/app/code/Magento/Security/Test/Mftf/Test/AdminLockAdminUserWhenCreatingNewRoleTest.xml @@ -23,7 +23,7 @@ </annotations> <before> <!-- Log in to Admin Panel --> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> </before> <after> <!-- Unlock Admin user --> @@ -92,7 +92,7 @@ </actionGroup> <!-- Try to login as admin and check error message --> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsLockedAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsLockedAdmin"/> <actionGroup ref="AssertMessageOnAdminLoginActionGroup" stepKey="checkLoginMessage"/> </test> </tests> diff --git a/app/code/Magento/Security/Test/Mftf/Test/AdminLoginAdminUserWithInvalidExpiration.xml b/app/code/Magento/Security/Test/Mftf/Test/AdminLoginAdminUserWithInvalidExpiration.xml index bdea845c81a56..130dacfbc2237 100644 --- a/app/code/Magento/Security/Test/Mftf/Test/AdminLoginAdminUserWithInvalidExpiration.xml +++ b/app/code/Magento/Security/Test/Mftf/Test/AdminLoginAdminUserWithInvalidExpiration.xml @@ -21,7 +21,7 @@ </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> </before> <actionGroup ref="AdminOpenNewUserPageActionGroup" stepKey="openNewUserPage" /> @@ -34,7 +34,7 @@ <scrollToTopOfPage stepKey="scrollToTopOfPage"/> <click selector="{{AdminNewUserFormSection.userInfoTab}}" stepKey="openUserInfoTab"/> <actionGroup ref="AdminSaveUserSuccessActionGroup" stepKey="saveNewUserWithValidExpirationSuccess"/> - <actionGroup ref="logout" stepKey="logout"/> + <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> <wait time="120" stepKey="waitForUserToExpire"/> <actionGroup ref="LoginAdminWithCredentialsActionGroup" stepKey="loginAsNewAdmin"> <argument name="adminUser" value="{$grabUsername}"/> @@ -43,7 +43,7 @@ <actionGroup ref="AssertMessageOnAdminLoginActionGroup" stepKey="checkLoginMessage" /> <!-- delete user --> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <actionGroup ref="AdminDeleteCustomUserActionGroup" stepKey="deleteUser"> <argument name="user" value="NewAdminUser" /> </actionGroup> diff --git a/app/code/Magento/Security/Test/Mftf/Test/AdminLoginAdminUserWithValidExpiration.xml b/app/code/Magento/Security/Test/Mftf/Test/AdminLoginAdminUserWithValidExpiration.xml index 12bba27f21269..39e4a3b56ca13 100644 --- a/app/code/Magento/Security/Test/Mftf/Test/AdminLoginAdminUserWithValidExpiration.xml +++ b/app/code/Magento/Security/Test/Mftf/Test/AdminLoginAdminUserWithValidExpiration.xml @@ -21,10 +21,10 @@ </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> </before> <after> - <actionGroup ref="logout" stepKey="logout"/> + <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> </after> <actionGroup ref="AdminOpenNewUserPageActionGroup" stepKey="openNewUserPage" /> @@ -35,15 +35,15 @@ <grabValueFrom selector="{{AdminNewUserFormSection.username}}" stepKey="grabUsername"/> <grabValueFrom selector="{{AdminNewUserFormSection.password}}" stepKey="grabPassword"/> <actionGroup ref="AdminSaveUserSuccessActionGroup" stepKey="saveNewUserWithValidExpirationSuccess"/> - <actionGroup ref="logout" stepKey="logout"/> + <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> <actionGroup ref="LoginAdminWithCredentialsActionGroup" stepKey="loginAsNewAdmin"> <argument name="adminUser" value="{$grabUsername}"/> <argument name="adminPassword" value="{$grabPassword}"/> </actionGroup> <actionGroup ref="AssertAdminDashboardPageIsVisibleActionGroup" stepKey="seeDashboardPage"/> - <actionGroup ref="logout" stepKey="logoutAsUserWithValidExpiration"/> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLogoutActionGroup" stepKey="logoutAsUserWithValidExpiration"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <actionGroup ref="AdminDeleteCustomUserActionGroup" stepKey="deleteUser"> <argument name="user" value="NewAdminUser"/> </actionGroup> diff --git a/app/code/Magento/Security/Test/Mftf/Test/AdminNavigateWhileUserExpiredTest.xml b/app/code/Magento/Security/Test/Mftf/Test/AdminNavigateWhileUserExpiredTest.xml index c4603a88c56c4..1c251ea2b9ec2 100644 --- a/app/code/Magento/Security/Test/Mftf/Test/AdminNavigateWhileUserExpiredTest.xml +++ b/app/code/Magento/Security/Test/Mftf/Test/AdminNavigateWhileUserExpiredTest.xml @@ -20,10 +20,10 @@ </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> </before> <after> - <actionGroup ref="logout" stepKey="logout"/> + <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> </after> <!-- Create user --> @@ -37,7 +37,7 @@ <scrollToTopOfPage stepKey="scrollToTopOfPage"/> <click selector="{{AdminNewUserFormSection.userInfoTab}}" stepKey="openUserInfoTab"/> <actionGroup ref="AdminSaveUserSuccessActionGroup" stepKey="saveNewUserWithValidExpirationSuccess"/> - <actionGroup ref="logout" stepKey="logout"/> + <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> <!-- Login as that user --> <actionGroup ref="LoginAdminWithCredentialsActionGroup" stepKey="loginAsNewAdmin"> @@ -51,7 +51,7 @@ <seeInCurrentUrl url="{{AdminLoginPage.url}}" stepKey="seeAdminLoginUrl"/> <!-- Delete created user --> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <actionGroup ref="AdminDeleteCustomUserActionGroup" stepKey="deleteUser"> <argument name="user" value="NewAdminUser"/> </actionGroup> diff --git a/app/code/Magento/Security/Test/Mftf/Test/AdminUserLockWhenCreatingNewUserTest.xml b/app/code/Magento/Security/Test/Mftf/Test/AdminUserLockWhenCreatingNewUserTest.xml index 4ceffd676313d..c130de5d8699f 100644 --- a/app/code/Magento/Security/Test/Mftf/Test/AdminUserLockWhenCreatingNewUserTest.xml +++ b/app/code/Magento/Security/Test/Mftf/Test/AdminUserLockWhenCreatingNewUserTest.xml @@ -21,7 +21,7 @@ </annotations> <before> <!-- Log in to Admin Panel --> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> </before> <after> <!-- Unlock Admin user --> @@ -73,7 +73,7 @@ </actionGroup> <!-- Try to login as admin and check error --> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsLockedAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsLockedAdmin"/> <actionGroup ref="AssertMessageOnAdminLoginActionGroup" stepKey="seeLoginUserErrorMessage" /> </test> </tests> diff --git a/app/code/Magento/Security/Test/Mftf/Test/AdminUserLockWhenEditingUserTest.xml b/app/code/Magento/Security/Test/Mftf/Test/AdminUserLockWhenEditingUserTest.xml index 47a0224a1c4db..5b4f38ae30566 100644 --- a/app/code/Magento/Security/Test/Mftf/Test/AdminUserLockWhenEditingUserTest.xml +++ b/app/code/Magento/Security/Test/Mftf/Test/AdminUserLockWhenEditingUserTest.xml @@ -22,12 +22,12 @@ <before> <createData entity="NewAdminUser" stepKey="user" /> <!-- Log in to Admin Panel --> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> </before> <after> <!-- Unlock Admin user --> <magentoCLI command="admin:user:unlock {{DefaultAdminUser.username}}" stepKey="unlockAdminUser"/> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <actionGroup ref="AdminDeleteUserViaCurlActionGroup" stepKey="deleteUser"> <argument name="user" value="$$user$$" /> </actionGroup> @@ -92,7 +92,7 @@ </actionGroup> <!-- Try to login as admin and check error --> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsLockedAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsLockedAdmin"/> <actionGroup ref="AssertMessageOnAdminLoginActionGroup" stepKey="seeLoginErrorMessage" /> </test> </tests> diff --git a/app/code/Magento/Security/Test/Mftf/Test/StorefrontAccountPasswordFieldsNotAvailableTest.xml b/app/code/Magento/Security/Test/Mftf/Test/StorefrontAccountPasswordFieldsNotAvailableTest.xml new file mode 100644 index 0000000000000..fd7ef0261cd26 --- /dev/null +++ b/app/code/Magento/Security/Test/Mftf/Test/StorefrontAccountPasswordFieldsNotAvailableTest.xml @@ -0,0 +1,43 @@ +<?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="StorefrontAccountPasswordFieldsNotAvailableTest"> + <annotations> + <features value="Security"/> + <stories value="Password Fields not Available on Frontend Until Checkbox Change Password Unchecked"/> + <title value="Password Fields not Available"/> + <description value="User Cannot Change Password Until Checkbox Change Password Unchecked"/> + <testCaseId value="MC-14369"/> + <group value="security"/> + <group value="mtf_migrated"/> + </annotations> + + <before> + <createData entity="Simple_US_Customer" stepKey="customer"/> + </before> + <after> + <deleteData createDataKey="customer" stepKey="deleteCustomer"/> + </after> + + <!-- TEST BODY --> + <!-- Go to storefront home page --> + <actionGroup ref="StorefrontOpenHomePageActionGroup" stepKey="openStoreFrontHomePage"/> + <!-- Login as created customer --> + <actionGroup ref="LoginToStorefrontActionGroup" stepKey="loginToStorefrontAccount"> + <argument name="Customer" value="$$customer$$"/> + </actionGroup> + <!-- Navigate to "Change Account Information" tab --> + <actionGroup ref="StorefrontNavigateToAccountInformationChangeActionGroup" stepKey="goToCustomerEditPage"/> + <!-- Assert Account Password Fields not Available --> + <actionGroup ref="AssertStorefrontAccountPasswordFieldsNotAvailableActionGroup" stepKey="uncheckedCheckbox"/> + <!-- END TEST BODY --> + + </test> +</tests> diff --git a/app/code/Magento/Security/Test/Mftf/Test/StorefrontChangeCustomerPasswordTest.xml b/app/code/Magento/Security/Test/Mftf/Test/StorefrontChangeCustomerPasswordTest.xml new file mode 100644 index 0000000000000..242bad033ed47 --- /dev/null +++ b/app/code/Magento/Security/Test/Mftf/Test/StorefrontChangeCustomerPasswordTest.xml @@ -0,0 +1,47 @@ +<?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="StorefrontChangeCustomerPasswordTest"> + <annotations> + <features value="Security"/> + <stories value="Changing Customer's Password"/> + <title value="Changing Customer Password Test"/> + <description value="Changing Customer's password using correct value"/> + <testCaseId value="MC-14370"/> + <group value="security"/> + <group value="mtf_migrated"/> + </annotations> + + <before> + <createData entity="Simple_US_Customer" stepKey="customer"/> + </before> + <after> + <deleteData createDataKey="customer" stepKey="deleteCustomer"/> + </after> + + <!-- TEST BODY --> + <!-- Go to storefront home page --> + <actionGroup ref="StorefrontOpenHomePageActionGroup" stepKey="openStoreFrontHomePage"/> + <!-- Login as created customer --> + <actionGroup ref="LoginToStorefrontActionGroup" stepKey="loginToStorefrontAccount"> + <argument name="Customer" value="$$customer$$"/> + </actionGroup> + <!-- Navigate to "Change Account Information" tab --> + <actionGroup ref="StorefrontNavigateToAccountInformationChangeActionGroup" stepKey="goToCustomerEditPage"/> + <!-- Change Password with Correct Data --> + <actionGroup ref="StorefrontCustomerChangePasswordActionGroup" stepKey="changePasswordWithCorrectData"> + <argument name="password" value="$$customer.password$$"/> + </actionGroup> + <!-- See Success Message --> + <actionGroup ref="AssertMessageCustomerChangeAccountInfoActionGroup" stepKey="assertAccountMessageSuccess"/> + <!-- END TEST BODY --> + + </test> +</tests> diff --git a/app/code/Magento/Security/Test/Mftf/Test/StorefrontChangeCustomerPasswordTestWithIncorrectDataTest.xml b/app/code/Magento/Security/Test/Mftf/Test/StorefrontChangeCustomerPasswordTestWithIncorrectDataTest.xml new file mode 100644 index 0000000000000..f08db36e7e20c --- /dev/null +++ b/app/code/Magento/Security/Test/Mftf/Test/StorefrontChangeCustomerPasswordTestWithIncorrectDataTest.xml @@ -0,0 +1,50 @@ +<?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="StorefrontChangeCustomerPasswordTestWithIncorrectDataTest"> + <annotations> + <features value="Security"/> + <stories value="Changing Customer's Password With Incorrect Current Password"/> + <title value="Changing Customer Password Test with Incorrect Data"/> + <description value="Changing Customer's password using Incorrect Current Password"/> + <testCaseId value="MC-14371"/> + <group value="security"/> + <group value="mtf_migrated"/> + </annotations> + + <before> + <createData entity="Simple_US_Customer" stepKey="customer"/> + </before> + <after> + <deleteData createDataKey="customer" stepKey="deleteCustomer"/> + </after> + + <!-- TEST BODY --> + <!-- Go to storefront home page --> + <actionGroup ref="StorefrontOpenHomePageActionGroup" stepKey="openStoreFrontHomePage"/> + <!-- Login as created customer --> + <actionGroup ref="LoginToStorefrontActionGroup" stepKey="loginToStorefrontAccount"> + <argument name="Customer" value="$$customer$$"/> + </actionGroup> + <!-- Navigate to "Change Account Information" tab --> + <actionGroup ref="StorefrontNavigateToAccountInformationChangeActionGroup" stepKey="goToCustomerEditPage"/> + <!-- Change Password with InCorrect Current Password --> + <actionGroup ref="StorefrontCustomerChangePasswordActionGroup" stepKey="changePasswordWithInCorrectData"> + <argument name="password" value="{{Colorado_US_Customer.password}}"/> + </actionGroup> + <!-- See Error Message --> + <actionGroup ref="AssertMessageCustomerChangeAccountInfoActionGroup" stepKey="assertAccountMessageFirstAttempt"> + <argument name="message" value="The password doesn't match this account. Verify the password and try again."/> + <argument name="messageType" value="error"/> + </actionGroup> + <!-- END TEST BODY --> + + </test> +</tests> diff --git a/app/code/Magento/Security/Test/Mftf/Test/StorefrontSecureChangingCustomerEmailTest.xml b/app/code/Magento/Security/Test/Mftf/Test/StorefrontSecureChangingCustomerEmailTest.xml new file mode 100644 index 0000000000000..020e1965ddf71 --- /dev/null +++ b/app/code/Magento/Security/Test/Mftf/Test/StorefrontSecureChangingCustomerEmailTest.xml @@ -0,0 +1,63 @@ +<?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="StorefrontSecureChangingCustomerEmailTest"> + <annotations> + <features value="Security"/> + <stories value="Changing Customer's email"/> + <title value="Changing Customer Email Test"/> + <description value="Changing Customer's email with correct and wrong passwords"/> + <testCaseId value="MC-14385"/> + <group value="security"/> + <group value="mtf_migrated"/> + </annotations> + + <before> + <createData entity="Simple_US_Customer" stepKey="customer"/> + </before> + <after> + <deleteData createDataKey="customer" stepKey="deleteCustomer"/> + </after> + + <!-- TEST BODY --> + <!-- Go to storefront home page --> + <actionGroup ref="StorefrontOpenHomePageActionGroup" stepKey="openStoreFrontHomePage"/> + <!-- Login as created customer --> + <actionGroup ref="LoginToStorefrontActionGroup" stepKey="loginToStorefrontAccount"> + <argument name="Customer" value="$$customer$$"/> + </actionGroup> + <!-- Navigate to "Account Information" tab First Time--> + <actionGroup ref="StorefrontOpenCustomerAccountInfoEditPageActionGroup" stepKey="goToCustomerEditPageFirstTime"/> + <!-- Checking Email checkbox, entering new email, saving with correct password --> + <actionGroup ref="StorefrontCustomerChangeEmailActionGroup" stepKey="changeEmailCorrectAttempt"> + <argument name="email" value="$$customer.email$$"/> + <argument name="password" value="$$customer.password$$"/> + </actionGroup> + <!-- See Success Notify--> + <actionGroup ref="AssertMessageCustomerChangeAccountInfoActionGroup" stepKey="seeSuccessMessage"> + <argument name="message" value="You saved the account information."/> + </actionGroup> + <!-- Navigate to "Account Information" tab Second Time--> + <actionGroup ref="StorefrontOpenCustomerAccountInfoEditPageActionGroup" stepKey="goToCustomerEditPageSecondTime" /> + <!-- Checking Email checkbox, entering new email, saving with incorrect password --> + <actionGroup ref="StorefrontCustomerChangeEmailActionGroup" stepKey="changeEmailWrongAttempt"> + <argument name="email" value="$$customer.email$$"/> + <argument name="password" value="WRONG_PASSWORD_123123q"/> + </actionGroup> + <!-- See Failure Message--> + <actionGroup ref="AssertMessageCustomerChangeAccountInfoActionGroup" stepKey="seeFailureMessage"> + <argument name="message" value="The password doesn't match this account. Verify the password and try again."/> + <argument name="messageType" value="error"/> + </actionGroup> + + <!-- END TEST BODY --> + + </test> + </tests> diff --git a/app/code/Magento/Shipping/Test/Mftf/Test/AdminCheckInputFieldsDisabledAfterAppConfigDumpTest.xml b/app/code/Magento/Shipping/Test/Mftf/Test/AdminCheckInputFieldsDisabledAfterAppConfigDumpTest.xml index 08064ae59d793..188b12c6a91c3 100644 --- a/app/code/Magento/Shipping/Test/Mftf/Test/AdminCheckInputFieldsDisabledAfterAppConfigDumpTest.xml +++ b/app/code/Magento/Shipping/Test/Mftf/Test/AdminCheckInputFieldsDisabledAfterAppConfigDumpTest.xml @@ -20,7 +20,7 @@ <group value="configuration"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> </before> <after> <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> diff --git a/app/code/Magento/Shipping/Test/Mftf/Test/AdminCheckTheConfirmationPopupTest.xml b/app/code/Magento/Shipping/Test/Mftf/Test/AdminCheckTheConfirmationPopupTest.xml index bacfaf15f99d7..fea499954896d 100644 --- a/app/code/Magento/Shipping/Test/Mftf/Test/AdminCheckTheConfirmationPopupTest.xml +++ b/app/code/Magento/Shipping/Test/Mftf/Test/AdminCheckTheConfirmationPopupTest.xml @@ -19,7 +19,7 @@ <before> <createData entity="Simple_US_Customer" stepKey="createCustomer"/> <createData entity="SimpleProduct2" stepKey="createSimpleProduct"/> - <actionGroup ref="LoginAsAdmin" stepKey="LoginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="LoginAsAdmin"/> </before> <after> <deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/> diff --git a/app/code/Magento/Shipping/Test/Mftf/Test/AdminCreateOrderCustomStoreShippingMethodTableRatesTest.xml b/app/code/Magento/Shipping/Test/Mftf/Test/AdminCreateOrderCustomStoreShippingMethodTableRatesTest.xml index a4c155e9d3753..0e69dba36d41c 100644 --- a/app/code/Magento/Shipping/Test/Mftf/Test/AdminCreateOrderCustomStoreShippingMethodTableRatesTest.xml +++ b/app/code/Magento/Shipping/Test/Mftf/Test/AdminCreateOrderCustomStoreShippingMethodTableRatesTest.xml @@ -22,7 +22,7 @@ <before> <!--Create product and customer--> <createData entity="SimpleProduct2" stepKey="createProduct"/> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <!--Create website, store group and store view--> <actionGroup ref="AdminCreateWebsiteActionGroup" stepKey="createWebsite"> <argument name="newWebsiteName" value="{{customWebsite.name}}"/> diff --git a/app/code/Magento/Shipping/Test/Mftf/Test/AdminCreatePartialShipmentEntityTest.xml b/app/code/Magento/Shipping/Test/Mftf/Test/AdminCreatePartialShipmentEntityTest.xml index 64d0932e9272d..5e57224bfee48 100644 --- a/app/code/Magento/Shipping/Test/Mftf/Test/AdminCreatePartialShipmentEntityTest.xml +++ b/app/code/Magento/Shipping/Test/Mftf/Test/AdminCreatePartialShipmentEntityTest.xml @@ -20,7 +20,7 @@ </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="LoginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="LoginAsAdmin"/> <!-- Create Data --> <createData entity="Simple_US_Customer" stepKey="createCustomer"/> <createData entity="SimpleProduct2" stepKey="createSimpleProduct"> diff --git a/app/code/Magento/Shipping/Test/Mftf/Test/AdminCreateShipmentEntityTest.xml b/app/code/Magento/Shipping/Test/Mftf/Test/AdminCreateShipmentEntityTest.xml index 0985aea2e502c..6b388ae31e45e 100644 --- a/app/code/Magento/Shipping/Test/Mftf/Test/AdminCreateShipmentEntityTest.xml +++ b/app/code/Magento/Shipping/Test/Mftf/Test/AdminCreateShipmentEntityTest.xml @@ -20,7 +20,7 @@ </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="LoginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="LoginAsAdmin"/> <!-- Create Data --> <createData entity="Simple_US_Customer" stepKey="createCustomer"/> <createData entity="SimpleProduct2" stepKey="createSimpleProduct"> diff --git a/app/code/Magento/Shipping/Test/Mftf/Test/AdminValidateShippingTrackingNumberTest.xml b/app/code/Magento/Shipping/Test/Mftf/Test/AdminValidateShippingTrackingNumberTest.xml index 7df8f08e79530..0d709e1d08006 100644 --- a/app/code/Magento/Shipping/Test/Mftf/Test/AdminValidateShippingTrackingNumberTest.xml +++ b/app/code/Magento/Shipping/Test/Mftf/Test/AdminValidateShippingTrackingNumberTest.xml @@ -19,7 +19,7 @@ <before> <createData entity="Simple_US_Customer" stepKey="createCustomer"/> <createData entity="SimpleProduct2" stepKey="createSimpleProduct"/> - <actionGroup ref="LoginAsAdmin" stepKey="LoginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="LoginAsAdmin"/> </before> <after> <deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/> diff --git a/app/code/Magento/Shipping/Test/Mftf/Test/StorefrontDisplayTableRatesShippingMethodForAETest.xml b/app/code/Magento/Shipping/Test/Mftf/Test/StorefrontDisplayTableRatesShippingMethodForAETest.xml index 81c76ec916f7e..5fd9a6a29c0e3 100644 --- a/app/code/Magento/Shipping/Test/Mftf/Test/StorefrontDisplayTableRatesShippingMethodForAETest.xml +++ b/app/code/Magento/Shipping/Test/Mftf/Test/StorefrontDisplayTableRatesShippingMethodForAETest.xml @@ -24,7 +24,7 @@ <requiredEntity createDataKey="createCategory"/> </createData> <createData entity="Simple_US_Customer_ArmedForcesEurope" stepKey="createCustomer"/> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> </before> <after> <deleteData createDataKey="createProduct" stepKey="deleteProduct"/> diff --git a/app/code/Magento/Shipping/Test/Mftf/Test/TableRatesShippingMethodForDifferentStatesTest.xml b/app/code/Magento/Shipping/Test/Mftf/Test/TableRatesShippingMethodForDifferentStatesTest.xml index 3a375be6533db..0f2f7ed26f1e1 100644 --- a/app/code/Magento/Shipping/Test/Mftf/Test/TableRatesShippingMethodForDifferentStatesTest.xml +++ b/app/code/Magento/Shipping/Test/Mftf/Test/TableRatesShippingMethodForDifferentStatesTest.xml @@ -26,7 +26,7 @@ <createData entity="Simple_US_Customer_CA" stepKey="createCustomer"/> <!-- Login as admin --> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> </before> <after> <!-- Delete product --> diff --git a/app/code/Magento/Signifyd/Api/CaseCreationServiceInterface.php b/app/code/Magento/Signifyd/Api/CaseCreationServiceInterface.php deleted file mode 100644 index f7611660b93a1..0000000000000 --- a/app/code/Magento/Signifyd/Api/CaseCreationServiceInterface.php +++ /dev/null @@ -1,29 +0,0 @@ -<?php -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ -namespace Magento\Signifyd\Api; - -/** - * Signifyd case creation interface - * - * Interface of service for new Signifyd case creation and registering it on Magento side. - * Implementation should send request to Signifyd API and create new entity in Magento. - * - * @api - * @since 100.2.0 - */ -interface CaseCreationServiceInterface -{ - /** - * Create new case for order with specified id. - * - * @param int $orderId - * @return bool - * @throws \Magento\Framework\Exception\NotFoundException If order does not exists - * @throws \Magento\Framework\Exception\AlreadyExistsException If case for $orderId already exists - * @since 100.2.0 - */ - public function createForOrder($orderId); -} diff --git a/app/code/Magento/Signifyd/Api/CaseManagementInterface.php b/app/code/Magento/Signifyd/Api/CaseManagementInterface.php deleted file mode 100644 index 69075a308cb96..0000000000000 --- a/app/code/Magento/Signifyd/Api/CaseManagementInterface.php +++ /dev/null @@ -1,36 +0,0 @@ -<?php -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ -namespace Magento\Signifyd\Api; - -/** - * Signifyd management interface - * Allows to performs operations with Signifyd cases. - * - * @api - * @since 100.2.0 - */ -interface CaseManagementInterface -{ - /** - * Creates new Case entity linked to order id. - * - * @param int $orderId - * @return \Magento\Signifyd\Api\Data\CaseInterface - * @throws \Magento\Framework\Exception\NotFoundException If order does not exists - * @throws \Magento\Framework\Exception\AlreadyExistsException If case for $orderId already exists - * @since 100.2.0 - */ - public function create($orderId); - - /** - * Gets Case entity associated with order id. - * - * @param int $orderId - * @return \Magento\Signifyd\Api\Data\CaseInterface|null - * @since 100.2.0 - */ - public function getByOrderId($orderId); -} diff --git a/app/code/Magento/Signifyd/Api/CaseRepositoryInterface.php b/app/code/Magento/Signifyd/Api/CaseRepositoryInterface.php deleted file mode 100644 index 4f148a082b300..0000000000000 --- a/app/code/Magento/Signifyd/Api/CaseRepositoryInterface.php +++ /dev/null @@ -1,60 +0,0 @@ -<?php -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ -namespace Magento\Signifyd\Api; - -/** - * Signifyd Case repository interface - * - * @api - * @since 100.2.0 - */ -interface CaseRepositoryInterface -{ - /** - * Saves case entity. - * - * @param \Magento\Signifyd\Api\Data\CaseInterface $case - * @return \Magento\Signifyd\Api\Data\CaseInterface - * @since 100.2.0 - */ - public function save(\Magento\Signifyd\Api\Data\CaseInterface $case); - - /** - * Gets case entity by order id. - * - * @param int $id - * @return \Magento\Signifyd\Api\Data\CaseInterface - * @since 100.2.0 - */ - public function getById($id); - - /** - * Gets entity by Signifyd case id. - * - * @param int $caseId - * @return \Magento\Signifyd\Api\Data\CaseInterface|null - * @since 100.2.0 - */ - public function getByCaseId($caseId); - - /** - * Deletes case entity. - * - * @param \Magento\Signifyd\Api\Data\CaseInterface $case - * @return bool - * @since 100.2.0 - */ - public function delete(\Magento\Signifyd\Api\Data\CaseInterface $case); - - /** - * Gets list of case entities. - * - * @param \Magento\Framework\Api\SearchCriteriaInterface $searchCriteria - * @return \Magento\Signifyd\Api\Data\CaseSearchResultsInterface - * @since 100.2.0 - */ - public function getList(\Magento\Framework\Api\SearchCriteriaInterface $searchCriteria); -} diff --git a/app/code/Magento/Signifyd/Api/Data/CaseInterface.php b/app/code/Magento/Signifyd/Api/Data/CaseInterface.php deleted file mode 100644 index eff46b972fc02..0000000000000 --- a/app/code/Magento/Signifyd/Api/Data/CaseInterface.php +++ /dev/null @@ -1,235 +0,0 @@ -<?php -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ -namespace Magento\Signifyd\Api\Data; - -use Magento\Signifyd\Model\SignifydGateway\Gateway; - -/** - * Signifyd Case entity interface - * - * @api - * @see https://www.signifyd.com/docs/api/#/reference/cases/retrieve-a-case/get-a-case - * @since 100.2.0 - */ -interface CaseInterface -{ - /**#@+ - * Constants for case available statuses - */ - const STATUS_OPEN = Gateway::STATUS_OPEN; - const STATUS_PENDING = 'PENDING'; - const STATUS_PROCESSING = Gateway::STATUS_PROCESSING; - const STATUS_FLAGGED = Gateway::STATUS_FLAGGED; - const STATUS_DISMISSED = Gateway::STATUS_DISMISSED; - /**#@-*/ - - /**#@+ - * Constants for guarantee available statuses - */ - const GUARANTEE_APPROVED = Gateway::GUARANTEE_APPROVED; - const GUARANTEE_DECLINED = Gateway::GUARANTEE_DECLINED; - const GUARANTEE_PENDING = Gateway::GUARANTEE_PENDING; - const GUARANTEE_CANCELED = Gateway::GUARANTEE_CANCELED; - const GUARANTEE_IN_REVIEW = Gateway::GUARANTEE_IN_REVIEW; - const GUARANTEE_UNREQUESTED = Gateway::GUARANTEE_UNREQUESTED; - /**#@-*/ - - /**#@+ - * Constants for case available review dispositions - */ - const DISPOSITION_GOOD = Gateway::DISPOSITION_GOOD; - const DISPOSITION_FRAUDULENT = Gateway::DISPOSITION_FRAUDULENT; - const DISPOSITION_UNSET = Gateway::DISPOSITION_UNSET; - /**#@-*/ - - /** - * Returns local case entity identifier. - * - * @return int - * @since 100.2.0 - */ - public function getEntityId(); - - /** - * Sets local case entity id. - * - * @param int $id - * @return $this - * @since 100.2.0 - */ - public function setEntityId($id); - - /** - * Returns Signifyd case identifier. - * - * @return int - * @since 100.2.0 - */ - public function getCaseId(); - - /** - * Sets Signifyd case id. - * - * @param int $id - * @return $this - * @since 100.2.0 - */ - public function setCaseId($id); - - /** - * Returns value, which indicates if a guarantee can be requested for a case. - * Returns null if state of guarantee eligible does not set yet. - * - * @return boolean|null - * @since 100.2.0 - */ - public function isGuaranteeEligible(); - - /** - * Sets value-indicator about guarantee availability for a case. - * - * @param bool $guaranteeEligible - * @return $this - * @since 100.2.0 - */ - public function setGuaranteeEligible($guaranteeEligible); - - /** - * Returns decision state of the guarantee. - * - * @return string - * @since 100.2.0 - */ - public function getGuaranteeDisposition(); - - /** - * Sets decision state of the guarantee. - * - * @param string $disposition - * @return $this - * @since 100.2.0 - */ - public function setGuaranteeDisposition($disposition); - - /** - * Returns case status. - * - * @return string - * @since 100.2.0 - */ - public function getStatus(); - - /** - * Sets case status. - * - * @param string $status - * @return $this - * @since 100.2.0 - */ - public function setStatus($status); - - /** - * Returns value, which indicates the likelihood that the order is fraud. - * - * @return int - * @since 100.2.0 - */ - public function getScore(); - - /** - * Sets risk level value. - * - * @param int $score - * @return $this - * @since 100.2.0 - */ - public function setScore($score); - - /** - * Get order id for a case. - * - * @return int - * @since 100.2.0 - */ - public function getOrderId(); - - /** - * Sets order id for a case. - * - * @param int $orderId - * @return $this - * @since 100.2.0 - */ - public function setOrderId($orderId); - - /** - * Returns data about a team associated with a case. - * - * @return array - * @since 100.2.0 - */ - public function getAssociatedTeam(); - - /** - * Sets team data associated with a case. - * - * @param array $team - * @return $this - * @since 100.2.0 - */ - public function setAssociatedTeam(array $team); - - /** - * Returns disposition of an agent's opinion after reviewing the case. - * - * @return string - * @since 100.2.0 - */ - public function getReviewDisposition(); - - /** - * Sets case disposition. - * - * @param string $disposition - * @return $this - * @since 100.2.0 - */ - public function setReviewDisposition($disposition); - - /** - * Returns creation datetime for a case. - * - * @return string - * @since 100.2.0 - */ - public function getCreatedAt(); - - /** - * Sets creation datetime for a case. - * - * @param string $datetime in DATE_ATOM format - * @return $this - * @since 100.2.0 - */ - public function setCreatedAt($datetime); - - /** - * Returns updating datetime for a case. - * - * @return string - * @since 100.2.0 - */ - public function getUpdatedAt(); - - /** - * Sets updating datetime for a case. - * - * @param string $datetime in DATE_ATOM format - * @return $this - * @since 100.2.0 - */ - public function setUpdatedAt($datetime); -} diff --git a/app/code/Magento/Signifyd/Api/Data/CaseSearchResultsInterface.php b/app/code/Magento/Signifyd/Api/Data/CaseSearchResultsInterface.php deleted file mode 100644 index 78d37841cff69..0000000000000 --- a/app/code/Magento/Signifyd/Api/Data/CaseSearchResultsInterface.php +++ /dev/null @@ -1,34 +0,0 @@ -<?php -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ -namespace Magento\Signifyd\Api\Data; - -use Magento\Framework\Api\SearchResultsInterface; - -/** - * Retrieve and set list of case entities. - * - * @api - * @since 100.2.0 - */ -interface CaseSearchResultsInterface extends SearchResultsInterface -{ - /** - * Gets collection of case entities. - * - * @return \Magento\Signifyd\Api\Data\CaseInterface[] - * @since 100.2.0 - */ - public function getItems(); - - /** - * Sets collection of case entities. - * - * @param \Magento\Signifyd\Api\Data\CaseInterface[] $items - * @return $this - * @since 100.2.0 - */ - public function setItems(array $items); -} diff --git a/app/code/Magento/Signifyd/Api/GuaranteeCancelingServiceInterface.php b/app/code/Magento/Signifyd/Api/GuaranteeCancelingServiceInterface.php deleted file mode 100644 index 41f4753d036a7..0000000000000 --- a/app/code/Magento/Signifyd/Api/GuaranteeCancelingServiceInterface.php +++ /dev/null @@ -1,27 +0,0 @@ -<?php -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ -namespace Magento\Signifyd\Api; - -/** - * Signifyd guarantee canceling interface. - * - * Interface allows to submit request to cancel previously created guarantee. - * Implementation should send request to Signifyd API and update existing case entity with guarantee information. - * - * @api - * @since 100.2.0 - */ -interface GuaranteeCancelingServiceInterface -{ - /** - * Cancels Signifyd guarantee for an order. - * - * @param int $orderId - * @return bool - * @since 100.2.0 - */ - public function cancelForOrder($orderId); -} diff --git a/app/code/Magento/Signifyd/Api/GuaranteeCreationServiceInterface.php b/app/code/Magento/Signifyd/Api/GuaranteeCreationServiceInterface.php deleted file mode 100644 index b4502ea861acd..0000000000000 --- a/app/code/Magento/Signifyd/Api/GuaranteeCreationServiceInterface.php +++ /dev/null @@ -1,27 +0,0 @@ -<?php -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ -namespace Magento\Signifyd\Api; - -/** - * Signifyd guarantee creation interface - * - * Interface allows submit previously created Signifyd case for a guaranty. - * Implementation should send request to Signifyd API and update existing case entity with guarantee infromation. - * - * @api - * @since 100.2.0 - */ -interface GuaranteeCreationServiceInterface -{ - /** - * Request Signifyd guarantee for order - * - * @param int $orderId - * @return bool - * @since 100.2.0 - */ - public function createForOrder($orderId); -} diff --git a/app/code/Magento/Signifyd/Block/Adminhtml/CaseInfo.php b/app/code/Magento/Signifyd/Block/Adminhtml/CaseInfo.php deleted file mode 100644 index 87d09e392e091..0000000000000 --- a/app/code/Magento/Signifyd/Block/Adminhtml/CaseInfo.php +++ /dev/null @@ -1,120 +0,0 @@ -<?php -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ -namespace Magento\Signifyd\Block\Adminhtml; - -use Magento\Framework\View\Element\Template; -use Magento\Framework\View\Element\Template\Context; -use Magento\Signifyd\Api\Data\CaseInterface; -use Magento\Signifyd\Model\CaseManagement; - -/** - * Get Signifyd Case Info - * - * @api - * @since 100.2.0 - */ -class CaseInfo extends Template -{ - /** - * @var CaseInterface - */ - private $caseEntity = false; - - /** - * @var CaseManagement - */ - private $caseManagement; - - /** - * @param Context $context - * @param CaseManagement $caseManagement - * @param array $data - */ - public function __construct( - Context $context, - CaseManagement $caseManagement, - array $data = [] - ) { - $this->caseManagement = $caseManagement; - - parent::__construct($context, $data); - } - - /** - * Gets case entity associated with order id. - * - * @return CaseInterface|null - */ - private function getCaseEntity() - { - if ($this->caseEntity === false) { - $this->caseEntity = $this->caseManagement->getByOrderId( - $this->getOrderId() - ); - } - - return $this->caseEntity; - } - - /** - * Default getter for case properties - * - * @param mixed $defaultValue - * @param callable $callback - * @return mixed - */ - private function getCaseProperty($defaultValue, callable $callback) - { - return $this->isEmptyCase() ? $defaultValue : call_user_func($callback); - } - - /** - * Checks if case is exists for order - * - * @return bool - * @since 100.2.0 - */ - public function isEmptyCase() - { - return $this->getCaseEntity() === null; - } - - /** - * Gets case guarantee disposition status. - * - * @return string - * @since 100.2.0 - */ - public function getCaseGuaranteeDisposition() - { - return $this->getCaseProperty('', function () { - $guaranteeStatusMap = [ - CaseInterface::GUARANTEE_APPROVED => __('Approved'), - CaseInterface::GUARANTEE_DECLINED => __('Declined'), - CaseInterface::GUARANTEE_PENDING => __('Pending'), - CaseInterface::GUARANTEE_CANCELED => __('Canceled'), - CaseInterface::GUARANTEE_IN_REVIEW => __('In Review'), - CaseInterface::GUARANTEE_UNREQUESTED => __('Unrequested') - ]; - - $status = isset($guaranteeStatusMap[$this->getCaseEntity()->getGuaranteeDisposition()]) ? - $guaranteeStatusMap[$this->getCaseEntity()->getGuaranteeDisposition()] : - ''; - - return $status; - }); - } - - /** - * Retrieves current order Id. - * - * @return integer - */ - private function getOrderId() - { - return (int) $this->getRequest()->getParam('order_id'); - } -} diff --git a/app/code/Magento/Signifyd/Block/Adminhtml/System/Config/Field/WebhookUrl.php b/app/code/Magento/Signifyd/Block/Adminhtml/System/Config/Field/WebhookUrl.php deleted file mode 100644 index 7964d6b1af397..0000000000000 --- a/app/code/Magento/Signifyd/Block/Adminhtml/System/Config/Field/WebhookUrl.php +++ /dev/null @@ -1,60 +0,0 @@ -<?php -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ -namespace Magento\Signifyd\Block\Adminhtml\System\Config\Field; - -use Magento\Framework\Data\Form\Element\AbstractElement; -use Magento\Config\Block\System\Config\Form\Field; -use Magento\Store\Model\ScopeInterface; -use Magento\Store\Model\Store; - -/** - * Input field transformed to text node with link to store Signifyd webhooks controller. - */ -class WebhookUrl extends Field -{ - /** - * @inheritdoc - */ - protected function _getElementHtml(AbstractElement $element) - { - $url = ''; - $originalData = $element->getOriginalData(); - if (!empty($originalData['handler_url'])) { - $url = $this->getStoreUrl(); - $url .= $originalData['handler_url']; - } - - return '<p class="webhook-url">' . $this->escapeHtml($url) . '</p>'; - } - - /** - * @inheritdoc - */ - protected function _isInheritCheckboxRequired(AbstractElement $element) - { - return false; - } - - /** - * Return base store URL. - * - * @return string - */ - private function getStoreUrl() - { - $website = $this->_storeManager->getWebsite($this->getRequest()->getParam('website')); - - $isSecure = $this->_scopeConfig->isSetFlag( - Store::XML_PATH_SECURE_IN_FRONTEND, - ScopeInterface::SCOPE_WEBSITE, - $website->getCode() - ); - - $configPath = $isSecure ? Store::XML_PATH_SECURE_BASE_LINK_URL : Store::XML_PATH_UNSECURE_BASE_LINK_URL; - - return $this->_scopeConfig->getValue($configPath, ScopeInterface::SCOPE_WEBSITE, $website->getCode()); - } -} diff --git a/app/code/Magento/Signifyd/Block/Adminhtml/System/Config/Fieldset/Info.php b/app/code/Magento/Signifyd/Block/Adminhtml/System/Config/Fieldset/Info.php deleted file mode 100644 index c18c3dc596e21..0000000000000 --- a/app/code/Magento/Signifyd/Block/Adminhtml/System/Config/Fieldset/Info.php +++ /dev/null @@ -1,31 +0,0 @@ -<?php -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ -namespace Magento\Signifyd\Block\Adminhtml\System\Config\Fieldset; - -use Magento\Config\Block\System\Config\Form\Fieldset; - -/** - * Fieldset renderer with url attached to comment. - */ -class Info extends Fieldset -{ - /** - * @inheritdoc - */ - protected function _getHeaderCommentHtml($element) - { - $groupConfig = $element->getGroup(); - - if (!empty($groupConfig['more_url']) && !empty($element->getComment())) { - $comment = $element->getComment(); - $comment .= '<p><a href="' . $this->escapeUrl($groupConfig['more_url']) . '" target="_blank">' . - $this->escapeHtml(__('Learn more')) . '</a></p>'; - $element->setComment($comment); - } - - return parent::_getHeaderCommentHtml($element); - } -} diff --git a/app/code/Magento/Signifyd/Block/Fingerprint.php b/app/code/Magento/Signifyd/Block/Fingerprint.php deleted file mode 100644 index f43bffce1fc1a..0000000000000 --- a/app/code/Magento/Signifyd/Block/Fingerprint.php +++ /dev/null @@ -1,92 +0,0 @@ -<?php -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ -namespace Magento\Signifyd\Block; - -use Magento\Framework\View\Element\Template; -use Magento\Framework\View\Element\Template\Context; -use Magento\Signifyd\Model\Config; -use Magento\Signifyd\Model\QuoteSession\QuoteSessionInterface; -use Magento\Signifyd\Model\SignifydOrderSessionId; - -/** - * Provides data for Signifyd device fingerprinting script. - * - * Signifyd’s device fingerprinting solution uniquely tracks and identifies devices - * used to transact on your site, increasing your protection from fraud. - * - * @api - * @see https://www.signifyd.com/docs/api/#/reference/device-fingerprint/create-a-case - * @since 100.2.0 - */ -class Fingerprint extends Template -{ - /** - * @var SignifydOrderSessionId - */ - private $signifydOrderSessionId; - - /** - * @var Config - */ - private $config; - - /** - * @var QuoteSessionInterface - */ - private $quoteSession; - - /** - * @var string - * @since 100.2.0 - */ - protected $_template = 'Magento_Signifyd::fingerprint.phtml'; - - /** - * @param Context $context - * @param Config $config - * @param SignifydOrderSessionId $signifydOrderSessionId - * @param QuoteSessionInterface $quoteSession - * @param array $data - */ - public function __construct( - Context $context, - Config $config, - SignifydOrderSessionId $signifydOrderSessionId, - QuoteSessionInterface $quoteSession, - array $data = [] - ) { - parent::__construct($context, $data); - $this->signifydOrderSessionId = $signifydOrderSessionId; - $this->config = $config; - $this->quoteSession = $quoteSession; - } - - /** - * Returns a unique Signifyd order session id. - * - * @return string - * @since 100.2.0 - */ - public function getSignifydOrderSessionId() - { - $quoteId = $this->quoteSession->getQuote()->getId(); - - return $this->signifydOrderSessionId->get($quoteId); - } - - /** - * Checks if module is enabled. - * - * @return boolean - * @since 100.2.0 - */ - public function isModuleActive() - { - $storeId = $this->quoteSession->getQuote()->getStoreId(); - - return $this->config->isActive($storeId); - } -} diff --git a/app/code/Magento/Signifyd/Controller/Webhooks/Handler.php b/app/code/Magento/Signifyd/Controller/Webhooks/Handler.php deleted file mode 100644 index 2dee31f4048b9..0000000000000 --- a/app/code/Magento/Signifyd/Controller/Webhooks/Handler.php +++ /dev/null @@ -1,157 +0,0 @@ -<?php -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ -namespace Magento\Signifyd\Controller\Webhooks; - -use Magento\Framework\App\Action\Action; -use Magento\Framework\App\Action\Context; -use Magento\Framework\App\Request\InvalidRequestException; -use Magento\Framework\App\RequestInterface; -use Magento\Framework\Exception\LocalizedException; -use Magento\Signifyd\Api\CaseRepositoryInterface; -use Magento\Signifyd\Model\CaseServices\UpdatingServiceFactory; -use Magento\Signifyd\Model\Config; -use Magento\Signifyd\Model\SignifydGateway\Response\WebhookMessageReader; -use Magento\Signifyd\Model\SignifydGateway\Response\WebhookRequest; -use Magento\Signifyd\Model\SignifydGateway\Response\WebhookRequestValidator; -use Psr\Log\LoggerInterface; - -/** - * Responsible for handling webhook posts from Signifyd service. - * - * @see https://www.signifyd.com/docs/api/#/reference/webhooks/ - */ -class Handler extends Action implements \Magento\Framework\App\CsrfAwareActionInterface -{ - /** - * Event topic of test webhook request. - * - * @var string - */ - private static $eventTopicTest = 'cases/test'; - - /** - * @var WebhookRequest - */ - private $webhookRequest; - - /** - * @var LoggerInterface - */ - private $logger; - - /** - * @var WebhookMessageReader - */ - private $webhookMessageReader; - - /** - * @var UpdatingServiceFactory - */ - private $caseUpdatingServiceFactory; - - /** - * @var WebhookRequestValidator - */ - private $webhookRequestValidator; - - /** - * @var CaseRepositoryInterface - */ - private $caseRepository; - - /** - * @var Config - */ - private $config; - - /** - * @param Context $context - * @param WebhookRequest $webhookRequest - * @param LoggerInterface $logger - * @param WebhookMessageReader $webhookMessageReader - * @param UpdatingServiceFactory $caseUpdatingServiceFactory - * @param WebhookRequestValidator $webhookRequestValidator - * @param CaseRepositoryInterface $caseRepository - * @param Config $config - */ - public function __construct( - Context $context, - WebhookRequest $webhookRequest, - LoggerInterface $logger, - WebhookMessageReader $webhookMessageReader, - UpdatingServiceFactory $caseUpdatingServiceFactory, - WebhookRequestValidator $webhookRequestValidator, - CaseRepositoryInterface $caseRepository, - Config $config - ) { - parent::__construct($context); - $this->webhookRequest = $webhookRequest; - $this->logger = $logger; - $this->webhookMessageReader = $webhookMessageReader; - $this->caseUpdatingServiceFactory = $caseUpdatingServiceFactory; - $this->webhookRequestValidator = $webhookRequestValidator; - $this->caseRepository = $caseRepository; - $this->config = $config; - } - - /** - * Processes webhook request data and updates case entity - * - * @return void - */ - public function execute() - { - if ($this->config->isDebugModeEnabled()) { - $this->logger->debug($this->webhookRequest->getEventTopic() . '|' . $this->webhookRequest->getBody()); - } - - if (!$this->webhookRequestValidator->validate($this->webhookRequest)) { - $this->_redirect('noroute'); - return; - } - - $webhookMessage = $this->webhookMessageReader->read($this->webhookRequest); - if ($webhookMessage->getEventTopic() === self::$eventTopicTest) { - return; - } - - $data = $webhookMessage->getData(); - if (empty($data['caseId'])) { - $this->_redirect('noroute'); - return; - } - - $case = $this->caseRepository->getByCaseId($data['caseId']); - if ($case === null) { - $this->_redirect('noroute'); - return; - } - - $caseUpdatingService = $this->caseUpdatingServiceFactory->create($webhookMessage->getEventTopic()); - try { - $caseUpdatingService->update($case, $data); - } catch (LocalizedException $e) { - $this->getResponse()->setHttpResponseCode(400); - $this->logger->critical($e); - } - } - - /** - * @inheritDoc - */ - public function createCsrfValidationException(RequestInterface $request): ?InvalidRequestException - { - return null; - } - - /** - * @inheritDoc - */ - public function validateForCsrf(RequestInterface $request): ?bool - { - return true; - } -} diff --git a/app/code/Magento/Signifyd/LICENSE.txt b/app/code/Magento/Signifyd/LICENSE.txt deleted file mode 100644 index 49525fd99da9c..0000000000000 --- a/app/code/Magento/Signifyd/LICENSE.txt +++ /dev/null @@ -1,48 +0,0 @@ - -Open Software License ("OSL") v. 3.0 - -This Open Software License (the "License") applies to any original work of authorship (the "Original Work") whose owner (the "Licensor") has placed the following licensing notice adjacent to the copyright notice for the Original Work: - -Licensed under the Open Software License version 3.0 - - 1. Grant of Copyright License. Licensor grants You a worldwide, royalty-free, non-exclusive, sublicensable license, for the duration of the copyright, to do the following: - - 1. to reproduce the Original Work in copies, either alone or as part of a collective work; - - 2. to translate, adapt, alter, transform, modify, or arrange the Original Work, thereby creating derivative works ("Derivative Works") based upon the Original Work; - - 3. to distribute or communicate copies of the Original Work and Derivative Works to the public, with the proviso that copies of Original Work or Derivative Works that You distribute or communicate shall be licensed under this Open Software License; - - 4. to perform the Original Work publicly; and - - 5. to display the Original Work publicly. - - 2. Grant of Patent License. Licensor grants You a worldwide, royalty-free, non-exclusive, sublicensable license, under patent claims owned or controlled by the Licensor that are embodied in the Original Work as furnished by the Licensor, for the duration of the patents, to make, use, sell, offer for sale, have made, and import the Original Work and Derivative Works. - - 3. Grant of Source Code License. The term "Source Code" means the preferred form of the Original Work for making modifications to it and all available documentation describing how to modify the Original Work. Licensor agrees to provide a machine-readable copy of the Source Code of the Original Work along with each copy of the Original Work that Licensor distributes. Licensor reserves the right to satisfy this obligation by placing a machine-readable copy of the Source Code in an information repository reasonably calculated to permit inexpensive and convenient access by You for as long as Licensor continues to distribute the Original Work. - - 4. Exclusions From License Grant. Neither the names of Licensor, nor the names of any contributors to the Original Work, nor any of their trademarks or service marks, may be used to endorse or promote products derived from this Original Work without express prior permission of the Licensor. Except as expressly stated herein, nothing in this License grants any license to Licensor's trademarks, copyrights, patents, trade secrets or any other intellectual property. No patent license is granted to make, use, sell, offer for sale, have made, or import embodiments of any patent claims other than the licensed claims defined in Section 2. No license is granted to the trademarks of Licensor even if such marks are included in the Original Work. Nothing in this License shall be interpreted to prohibit Licensor from licensing under terms different from this License any Original Work that Licensor otherwise would have a right to license. - - 5. External Deployment. The term "External Deployment" means the use, distribution, or communication of the Original Work or Derivative Works in any way such that the Original Work or Derivative Works may be used by anyone other than You, whether those works are distributed or communicated to those persons or made available as an application intended for use over a network. As an express condition for the grants of license hereunder, You must treat any External Deployment by You of the Original Work or a Derivative Work as a distribution under section 1(c). - - 6. Attribution Rights. You must retain, in the Source Code of any Derivative Works that You create, all copyright, patent, or trademark notices from the Source Code of the Original Work, as well as any notices of licensing and any descriptive text identified therein as an "Attribution Notice." You must cause the Source Code for any Derivative Works that You create to carry a prominent Attribution Notice reasonably calculated to inform recipients that You have modified the Original Work. - - 7. Warranty of Provenance and Disclaimer of Warranty. Licensor warrants that the copyright in and to the Original Work and the patent rights granted herein by Licensor are owned by the Licensor or are sublicensed to You under the terms of this License with the permission of the contributor(s) of those copyrights and patent rights. Except as expressly stated in the immediately preceding sentence, the Original Work is provided under this License on an "AS IS" BASIS and WITHOUT WARRANTY, either express or implied, including, without limitation, the warranties of non-infringement, merchantability or fitness for a particular purpose. THE ENTIRE RISK AS TO THE QUALITY OF THE ORIGINAL WORK IS WITH YOU. This DISCLAIMER OF WARRANTY constitutes an essential part of this License. No license to the Original Work is granted by this License except under this disclaimer. - - 8. Limitation of Liability. Under no circumstances and under no legal theory, whether in tort (including negligence), contract, or otherwise, shall the Licensor be liable to anyone for any indirect, special, incidental, or consequential damages of any character arising as a result of this License or the use of the Original Work including, without limitation, damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses. This limitation of liability shall not apply to the extent applicable law prohibits such limitation. - - 9. Acceptance and Termination. If, at any time, You expressly assented to this License, that assent indicates your clear and irrevocable acceptance of this License and all of its terms and conditions. If You distribute or communicate copies of the Original Work or a Derivative Work, You must make a reasonable effort under the circumstances to obtain the express assent of recipients to the terms of this License. This License conditions your rights to undertake the activities listed in Section 1, including your right to create Derivative Works based upon the Original Work, and doing so without honoring these terms and conditions is prohibited by copyright law and international treaty. Nothing in this License is intended to affect copyright exceptions and limitations (including 'fair use' or 'fair dealing'). This License shall terminate immediately and You may no longer exercise any of the rights granted to You by this License upon your failure to honor the conditions in Section 1(c). - - 10. Termination for Patent Action. This License shall terminate automatically and You may no longer exercise any of the rights granted to You by this License as of the date You commence an action, including a cross-claim or counterclaim, against Licensor or any licensee alleging that the Original Work infringes a patent. This termination provision shall not apply for an action alleging patent infringement by combinations of the Original Work with other software or hardware. - - 11. Jurisdiction, Venue and Governing Law. Any action or suit relating to this License may be brought only in the courts of a jurisdiction wherein the Licensor resides or in which Licensor conducts its primary business, and under the laws of that jurisdiction excluding its conflict-of-law provisions. The application of the United Nations Convention on Contracts for the International Sale of Goods is expressly excluded. Any use of the Original Work outside the scope of this License or after its termination shall be subject to the requirements and penalties of copyright or patent law in the appropriate jurisdiction. This section shall survive the termination of this License. - - 12. Attorneys' Fees. In any action to enforce the terms of this License or seeking damages relating thereto, the prevailing party shall be entitled to recover its costs and expenses, including, without limitation, reasonable attorneys' fees and costs incurred in connection with such action, including any appeal of such action. This section shall survive the termination of this License. - - 13. Miscellaneous. If any provision of this License is held to be unenforceable, such provision shall be reformed only to the extent necessary to make it enforceable. - - 14. Definition of "You" in This License. "You" throughout this License, whether in upper or lower case, means an individual or a legal entity exercising rights under, and complying with all of the terms of, this License. For legal entities, "You" includes any entity that controls, is controlled by, or is under common control with you. For purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. - - 15. Right to Use. You may use the Original Work in all ways not otherwise restricted or conditioned by this License or by law, and Licensor promises not to interfere with or be responsible for such uses by You. - - 16. Modification of This License. This License is Copyright (C) 2005 Lawrence Rosen. Permission is granted to copy, distribute, or communicate this License without modification. Nothing in this License permits You to modify this License as applied to the Original Work or to Derivative Works. However, You may modify the text of this License and copy, distribute or communicate your modified version (the "Modified License") and apply it to other original works of authorship subject to the following conditions: (i) You may not indicate in any way that your Modified License is the "Open Software License" or "OSL" and you may not use those names in the name of your Modified License; (ii) You must replace the notice specified in the first paragraph above with the notice "Licensed under <insert your license name here>" or with a notice of your own that is not confusingly similar to the notice in this License; and (iii) You may not claim that your original works are open source software unless your Modified License has been approved by Open Source Initiative (OSI) and You comply with its license review and certification process. \ No newline at end of file diff --git a/app/code/Magento/Signifyd/LICENSE_AFL.txt b/app/code/Magento/Signifyd/LICENSE_AFL.txt deleted file mode 100644 index f39d641b18a19..0000000000000 --- a/app/code/Magento/Signifyd/LICENSE_AFL.txt +++ /dev/null @@ -1,48 +0,0 @@ - -Academic Free License ("AFL") v. 3.0 - -This Academic Free License (the "License") applies to any original work of authorship (the "Original Work") whose owner (the "Licensor") has placed the following licensing notice adjacent to the copyright notice for the Original Work: - -Licensed under the Academic Free License version 3.0 - - 1. Grant of Copyright License. Licensor grants You a worldwide, royalty-free, non-exclusive, sublicensable license, for the duration of the copyright, to do the following: - - 1. to reproduce the Original Work in copies, either alone or as part of a collective work; - - 2. to translate, adapt, alter, transform, modify, or arrange the Original Work, thereby creating derivative works ("Derivative Works") based upon the Original Work; - - 3. to distribute or communicate copies of the Original Work and Derivative Works to the public, under any license of your choice that does not contradict the terms and conditions, including Licensor's reserved rights and remedies, in this Academic Free License; - - 4. to perform the Original Work publicly; and - - 5. to display the Original Work publicly. - - 2. Grant of Patent License. Licensor grants You a worldwide, royalty-free, non-exclusive, sublicensable license, under patent claims owned or controlled by the Licensor that are embodied in the Original Work as furnished by the Licensor, for the duration of the patents, to make, use, sell, offer for sale, have made, and import the Original Work and Derivative Works. - - 3. Grant of Source Code License. The term "Source Code" means the preferred form of the Original Work for making modifications to it and all available documentation describing how to modify the Original Work. Licensor agrees to provide a machine-readable copy of the Source Code of the Original Work along with each copy of the Original Work that Licensor distributes. Licensor reserves the right to satisfy this obligation by placing a machine-readable copy of the Source Code in an information repository reasonably calculated to permit inexpensive and convenient access by You for as long as Licensor continues to distribute the Original Work. - - 4. Exclusions From License Grant. Neither the names of Licensor, nor the names of any contributors to the Original Work, nor any of their trademarks or service marks, may be used to endorse or promote products derived from this Original Work without express prior permission of the Licensor. Except as expressly stated herein, nothing in this License grants any license to Licensor's trademarks, copyrights, patents, trade secrets or any other intellectual property. No patent license is granted to make, use, sell, offer for sale, have made, or import embodiments of any patent claims other than the licensed claims defined in Section 2. No license is granted to the trademarks of Licensor even if such marks are included in the Original Work. Nothing in this License shall be interpreted to prohibit Licensor from licensing under terms different from this License any Original Work that Licensor otherwise would have a right to license. - - 5. External Deployment. The term "External Deployment" means the use, distribution, or communication of the Original Work or Derivative Works in any way such that the Original Work or Derivative Works may be used by anyone other than You, whether those works are distributed or communicated to those persons or made available as an application intended for use over a network. As an express condition for the grants of license hereunder, You must treat any External Deployment by You of the Original Work or a Derivative Work as a distribution under section 1(c). - - 6. Attribution Rights. You must retain, in the Source Code of any Derivative Works that You create, all copyright, patent, or trademark notices from the Source Code of the Original Work, as well as any notices of licensing and any descriptive text identified therein as an "Attribution Notice." You must cause the Source Code for any Derivative Works that You create to carry a prominent Attribution Notice reasonably calculated to inform recipients that You have modified the Original Work. - - 7. Warranty of Provenance and Disclaimer of Warranty. Licensor warrants that the copyright in and to the Original Work and the patent rights granted herein by Licensor are owned by the Licensor or are sublicensed to You under the terms of this License with the permission of the contributor(s) of those copyrights and patent rights. Except as expressly stated in the immediately preceding sentence, the Original Work is provided under this License on an "AS IS" BASIS and WITHOUT WARRANTY, either express or implied, including, without limitation, the warranties of non-infringement, merchantability or fitness for a particular purpose. THE ENTIRE RISK AS TO THE QUALITY OF THE ORIGINAL WORK IS WITH YOU. This DISCLAIMER OF WARRANTY constitutes an essential part of this License. No license to the Original Work is granted by this License except under this disclaimer. - - 8. Limitation of Liability. Under no circumstances and under no legal theory, whether in tort (including negligence), contract, or otherwise, shall the Licensor be liable to anyone for any indirect, special, incidental, or consequential damages of any character arising as a result of this License or the use of the Original Work including, without limitation, damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses. This limitation of liability shall not apply to the extent applicable law prohibits such limitation. - - 9. Acceptance and Termination. If, at any time, You expressly assented to this License, that assent indicates your clear and irrevocable acceptance of this License and all of its terms and conditions. If You distribute or communicate copies of the Original Work or a Derivative Work, You must make a reasonable effort under the circumstances to obtain the express assent of recipients to the terms of this License. This License conditions your rights to undertake the activities listed in Section 1, including your right to create Derivative Works based upon the Original Work, and doing so without honoring these terms and conditions is prohibited by copyright law and international treaty. Nothing in this License is intended to affect copyright exceptions and limitations (including "fair use" or "fair dealing"). This License shall terminate immediately and You may no longer exercise any of the rights granted to You by this License upon your failure to honor the conditions in Section 1(c). - - 10. Termination for Patent Action. This License shall terminate automatically and You may no longer exercise any of the rights granted to You by this License as of the date You commence an action, including a cross-claim or counterclaim, against Licensor or any licensee alleging that the Original Work infringes a patent. This termination provision shall not apply for an action alleging patent infringement by combinations of the Original Work with other software or hardware. - - 11. Jurisdiction, Venue and Governing Law. Any action or suit relating to this License may be brought only in the courts of a jurisdiction wherein the Licensor resides or in which Licensor conducts its primary business, and under the laws of that jurisdiction excluding its conflict-of-law provisions. The application of the United Nations Convention on Contracts for the International Sale of Goods is expressly excluded. Any use of the Original Work outside the scope of this License or after its termination shall be subject to the requirements and penalties of copyright or patent law in the appropriate jurisdiction. This section shall survive the termination of this License. - - 12. Attorneys' Fees. In any action to enforce the terms of this License or seeking damages relating thereto, the prevailing party shall be entitled to recover its costs and expenses, including, without limitation, reasonable attorneys' fees and costs incurred in connection with such action, including any appeal of such action. This section shall survive the termination of this License. - - 13. Miscellaneous. If any provision of this License is held to be unenforceable, such provision shall be reformed only to the extent necessary to make it enforceable. - - 14. Definition of "You" in This License. "You" throughout this License, whether in upper or lower case, means an individual or a legal entity exercising rights under, and complying with all of the terms of, this License. For legal entities, "You" includes any entity that controls, is controlled by, or is under common control with you. For purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. - - 15. Right to Use. You may use the Original Work in all ways not otherwise restricted or conditioned by this License or by law, and Licensor promises not to interfere with or be responsible for such uses by You. - - 16. Modification of This License. This License is Copyright © 2005 Lawrence Rosen. Permission is granted to copy, distribute, or communicate this License without modification. Nothing in this License permits You to modify this License as applied to the Original Work or to Derivative Works. However, You may modify the text of this License and copy, distribute or communicate your modified version (the "Modified License") and apply it to other original works of authorship subject to the following conditions: (i) You may not indicate in any way that your Modified License is the "Academic Free License" or "AFL" and you may not use those names in the name of your Modified License; (ii) You must replace the notice specified in the first paragraph above with the notice "Licensed under <insert your license name here>" or with a notice of your own that is not confusingly similar to the notice in this License; and (iii) You may not claim that your original works are open source software unless your Modified License has been approved by Open Source Initiative (OSI) and You comply with its license review and certification process. diff --git a/app/code/Magento/Signifyd/Model/CaseEntity.php b/app/code/Magento/Signifyd/Model/CaseEntity.php deleted file mode 100644 index c11c72db79f16..0000000000000 --- a/app/code/Magento/Signifyd/Model/CaseEntity.php +++ /dev/null @@ -1,249 +0,0 @@ -<?php -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ -namespace Magento\Signifyd\Model; - -use Magento\Framework\Data\Collection\AbstractDb; -use Magento\Framework\Model\AbstractModel; -use Magento\Framework\Model\Context; -use Magento\Framework\Model\ResourceModel\AbstractResource; -use Magento\Framework\Registry; -use Magento\Framework\Serialize\SerializerInterface; -use Magento\Signifyd\Api\Data\CaseInterface; - -/** - * Implementation of Signifyd Case interface. - */ -class CaseEntity extends AbstractModel implements CaseInterface -{ - /** - * @var string - */ - protected $_eventPrefix = 'signifyd_case'; - - /** - * @var SerializerInterface - */ - private $serializer; - - /** - * CaseEntity constructor. - * - * @param Context $context - * @param Registry $registry - * @param SerializerInterface $serializer - * @param array $data - * @param AbstractResource|null $resource - * @param AbstractDb|null $resourceCollection - */ - public function __construct( - Context $context, - Registry $registry, - SerializerInterface $serializer, - array $data = [], - AbstractResource $resource = null, - AbstractDb $resourceCollection = null - ) { - $this->serializer = $serializer; - parent::__construct($context, $registry, $resource, $resourceCollection, $data); - } - - /** - * @inheritdoc - */ - protected function _construct() - { - $this->_init(ResourceModel\CaseEntity::class); - } - - /** - * @inheritdoc - */ - public function getEntityId() - { - return (int) $this->getData('entity_id'); - } - - /** - * @inheritdoc - */ - public function setEntityId($id) - { - $this->setData('entity_id', (int) $id); - return $this; - } - - /** - * @inheritdoc - */ - public function getCaseId() - { - return (int) $this->getData('case_id'); - } - - /** - * @inheritdoc - */ - public function setCaseId($id) - { - $this->setData('case_id', (int) $id); - return $this; - } - - /** - * @inheritdoc - */ - public function isGuaranteeEligible() - { - $value = $this->getData('guarantee_eligible'); - return ($value === null) ? $value : (bool) $value; - } - - /** - * @inheritdoc - */ - public function setGuaranteeEligible($guaranteeEligible) - { - $this->setData('guarantee_eligible', $guaranteeEligible); - return $this; - } - - /** - * @inheritdoc - */ - public function getGuaranteeDisposition() - { - return (string) $this->getData('guarantee_disposition'); - } - - /** - * @inheritdoc - */ - public function setGuaranteeDisposition($disposition) - { - $this->setData('guarantee_disposition', (string) $disposition); - return $this; - } - - /** - * @inheritdoc - */ - public function getStatus() - { - return (string) $this->getData('status'); - } - - /** - * @inheritdoc - */ - public function setStatus($status) - { - $this->setData('status', (string) $status); - return $this; - } - - /** - * @inheritdoc - */ - public function getScore() - { - return (int) $this->getData('score'); - } - - /** - * @inheritdoc - */ - public function setScore($score) - { - $this->setData('score', (int) $score); - return $this; - } - - /** - * @inheritdoc - */ - public function getOrderId() - { - return (int) $this->getData('order_id'); - } - - /** - * @inheritdoc - */ - public function setOrderId($orderId) - { - $this->setData('order_id', (int) $orderId); - return $this; - } - - /** - * @inheritdoc - */ - public function getAssociatedTeam() - { - $teamData = $this->getData('associated_team'); - return empty($teamData) ? [] : $this->serializer->unserialize($teamData); - } - - /** - * @inheritdoc - */ - public function setAssociatedTeam(array $team) - { - $this->setData('associated_team', $this->serializer->serialize($team)); - return $this; - } - - /** - * @inheritdoc - */ - public function getReviewDisposition() - { - return (string) $this->getData('review_disposition'); - } - - /** - * @inheritdoc - */ - public function setReviewDisposition($disposition) - { - $this->setData('review_disposition', (string) $disposition); - return $this; - } - - /** - * @inheritdoc - */ - public function getCreatedAt() - { - return $this->getData('created_at'); - } - - /** - * @inheritdoc - */ - public function setCreatedAt($datetime) - { - $this->setData('created_at', $datetime); - return $this; - } - - /** - * @inheritdoc - */ - public function getUpdatedAt() - { - return $this->getData('updated_at'); - } - - /** - * @inheritdoc - */ - public function setUpdatedAt($datetime) - { - $this->setData('updated_at', $datetime); - return $this; - } -} diff --git a/app/code/Magento/Signifyd/Model/CaseManagement.php b/app/code/Magento/Signifyd/Model/CaseManagement.php deleted file mode 100644 index 1913f1e7a17b3..0000000000000 --- a/app/code/Magento/Signifyd/Model/CaseManagement.php +++ /dev/null @@ -1,93 +0,0 @@ -<?php -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ -namespace Magento\Signifyd\Model; - -use Magento\Framework\Api\FilterBuilder; -use Magento\Framework\Api\SearchCriteriaBuilder; -use Magento\Signifyd\Api\CaseManagementInterface; -use Magento\Signifyd\Api\CaseRepositoryInterface; -use Magento\Signifyd\Api\Data\CaseInterface; -use Magento\Signifyd\Api\Data\CaseInterfaceFactory; -use Magento\Framework\Exception\AlreadyExistsException; -use Magento\Framework\DB\Adapter\DuplicateException; - -/** - * - * Default case management implementation - */ -class CaseManagement implements CaseManagementInterface -{ - /** - * @var CaseRepositoryInterface - */ - private $caseRepository; - - /** - * @var CaseInterfaceFactory - */ - private $caseFactory; - - /** - * @var FilterBuilder - */ - private $filterBuilder; - - /** - * @var SearchCriteriaBuilder - */ - private $searchCriteriaBuilder; - - /** - * CaseManagement constructor. - * @param CaseRepositoryInterface $caseRepository - * @param CaseInterfaceFactory $caseFactory - * @param FilterBuilder $filterBuilder - * @param SearchCriteriaBuilder $searchCriteriaBuilder - */ - public function __construct( - CaseRepositoryInterface $caseRepository, - CaseInterfaceFactory $caseFactory, - FilterBuilder $filterBuilder, - SearchCriteriaBuilder $searchCriteriaBuilder - ) { - $this->caseRepository = $caseRepository; - $this->caseFactory = $caseFactory; - $this->searchCriteriaBuilder = $searchCriteriaBuilder; - $this->filterBuilder = $filterBuilder; - } - - /** - * @inheritdoc - */ - public function create($orderId) - { - /** @var \Magento\Signifyd\Api\Data\CaseInterface $case */ - $case = $this->caseFactory->create(); - $case->setOrderId($orderId) - ->setStatus(CaseInterface::STATUS_PENDING) - ->setGuaranteeDisposition(CaseInterface::GUARANTEE_PENDING); - try { - return $this->caseRepository->save($case); - } catch (DuplicateException $e) { - throw new AlreadyExistsException(__('This order already has associated case entity'), $e); - } - } - - /** - * @inheritdoc - */ - public function getByOrderId($orderId) - { - $filters = [ - $this->filterBuilder->setField('order_id') - ->setValue($orderId) - ->create() - ]; - $searchCriteria = $this->searchCriteriaBuilder->addFilters($filters)->create(); - $items = $this->caseRepository->getList($searchCriteria)->getItems(); - return !empty($items) ? array_pop($items) : null; - } -} diff --git a/app/code/Magento/Signifyd/Model/CaseRepository.php b/app/code/Magento/Signifyd/Model/CaseRepository.php deleted file mode 100644 index ea3ea3e67aafd..0000000000000 --- a/app/code/Magento/Signifyd/Model/CaseRepository.php +++ /dev/null @@ -1,134 +0,0 @@ -<?php -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ -namespace Magento\Signifyd\Model; - -use Magento\Framework\Api\SearchCriteriaInterface; -use Magento\Framework\Api\SearchCriteria\CollectionProcessorInterface; -use Magento\Signifyd\Api\CaseRepositoryInterface; -use Magento\Signifyd\Api\Data\CaseInterface; -use Magento\Signifyd\Api\Data\CaseInterfaceFactory; -use Magento\Signifyd\Api\Data\CaseSearchResultsInterface; -use Magento\Signifyd\Api\Data\CaseSearchResultsInterfaceFactory; -use Magento\Signifyd\Model\ResourceModel\CaseEntity as CaseResourceModel; -use Magento\Signifyd\Model\ResourceModel\CaseEntity\Collection; -use Magento\Signifyd\Model\ResourceModel\CaseEntity\CollectionFactory; - -/** - * Repository for Case interface - * - * @SuppressWarnings(PHPMD.CouplingBetweenObjects) - */ -class CaseRepository implements CaseRepositoryInterface -{ - /** - * @var CollectionProcessorInterface - */ - private $collectionProcessor; - - /** - * @var CollectionFactory - */ - private $collectionFactory; - - /** - * @var CaseSearchResultsInterfaceFactory - */ - private $searchResultsFactory; - - /** - * @var CaseInterfaceFactory - */ - private $caseFactory; - - /** - * @var CaseResourceModel - */ - private $resourceModel; - - /** - * CaseRepository constructor. - * @param CollectionProcessorInterface $collectionProcessor - * @param CollectionFactory $collectionFactory - * @param CaseSearchResultsInterfaceFactory $searchResultsFactory - * @param CaseInterfaceFactory $caseFactory - * @param CaseResourceModel $resourceModel - */ - public function __construct( - CollectionProcessorInterface $collectionProcessor, - CollectionFactory $collectionFactory, - CaseSearchResultsInterfaceFactory $searchResultsFactory, - CaseInterfaceFactory $caseFactory, - CaseResourceModel $resourceModel - ) { - $this->collectionProcessor = $collectionProcessor; - $this->collectionFactory = $collectionFactory; - $this->searchResultsFactory = $searchResultsFactory; - $this->caseFactory = $caseFactory; - $this->resourceModel = $resourceModel; - } - - /** - * @inheritdoc - */ - public function save(CaseInterface $case) - { - /** @var CaseEntity $case */ - $this->resourceModel->save($case); - - return $case; - } - - /** - * @inheritdoc - */ - public function getById($id) - { - /** @var CaseEntity $case */ - $case = $this->caseFactory->create(); - $this->resourceModel->load($case, $id); - - return $case; - } - - /** - * @inheritdoc - */ - public function getByCaseId($caseId) - { - /** @var CaseEntity $case */ - $case = $this->caseFactory->create(); - $this->resourceModel->load($case, $caseId, 'case_id'); - - return $case->getEntityId() ? $case : null; - } - - /** - * @inheritdoc - */ - public function delete(CaseInterface $case) - { - $this->resourceModel->delete($case); - - return true; - } - - /** - * @inheritdoc - */ - public function getList(SearchCriteriaInterface $searchCriteria) - { - /** @var Collection $collection */ - $collection = $this->collectionFactory->create(); - $this->collectionProcessor->process($searchCriteria, $collection); - - /** @var CaseSearchResultsInterface $searchResults */ - $searchResults = $this->searchResultsFactory->create(); - $searchResults->setSearchCriteria($searchCriteria); - $searchResults->setItems($collection->getItems()); - - return $searchResults; - } -} diff --git a/app/code/Magento/Signifyd/Model/CaseSearchResults.php b/app/code/Magento/Signifyd/Model/CaseSearchResults.php deleted file mode 100644 index ff1ab8839f6cd..0000000000000 --- a/app/code/Magento/Signifyd/Model/CaseSearchResults.php +++ /dev/null @@ -1,18 +0,0 @@ -<?php -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ -declare(strict_types=1); - -namespace Magento\Signifyd\Model; - -use Magento\Framework\Api\SearchResults; -use Magento\Signifyd\Api\Data\CaseSearchResultsInterface; - -/** - * Service Data Object with Case entities search results. - */ -class CaseSearchResults extends SearchResults implements CaseSearchResultsInterface -{ -} diff --git a/app/code/Magento/Signifyd/Model/CaseServices/CreationService.php b/app/code/Magento/Signifyd/Model/CaseServices/CreationService.php deleted file mode 100644 index 8413838bd7d5f..0000000000000 --- a/app/code/Magento/Signifyd/Model/CaseServices/CreationService.php +++ /dev/null @@ -1,101 +0,0 @@ -<?php -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ -namespace Magento\Signifyd\Model\CaseServices; - -use Magento\Signifyd\Api\CaseCreationServiceInterface; -use Magento\Signifyd\Api\CaseManagementInterface; -use Magento\Signifyd\Api\CaseRepositoryInterface; -use Magento\Signifyd\Model\OrderStateService; -use Magento\Signifyd\Model\SalesOrderGrid\OrderGridUpdater; -use Magento\Signifyd\Model\SignifydGateway\Gateway; -use Magento\Signifyd\Model\SignifydGateway\GatewayException; -use Psr\Log\LoggerInterface; - -/** - * Case Creation Service - * - * Creates new Case entity and register it at Signifyd - */ -class CreationService implements CaseCreationServiceInterface -{ - /** - * @var CaseManagementInterface - */ - private $caseManagement; - - /** - * @var Gateway; - */ - private $signifydGateway; - - /** - * @var LoggerInterface - */ - private $logger; - - /** - * @var CaseRepositoryInterface - */ - private $caseRepository; - - /** - * @var OrderGridUpdater - */ - private $orderGridUpdater; - - /** - * @var OrderStateService - */ - private $orderStateService; - - /** - * CreationService constructor. - * - * @param CaseManagementInterface $caseManagement - * @param Gateway $signifydGateway - * @param LoggerInterface $logger - * @param CaseRepositoryInterface $caseRepository - * @param OrderGridUpdater $orderGridUpdater - * @param OrderStateService $orderStateService - */ - public function __construct( - CaseManagementInterface $caseManagement, - Gateway $signifydGateway, - LoggerInterface $logger, - CaseRepositoryInterface $caseRepository, - OrderGridUpdater $orderGridUpdater, - OrderStateService $orderStateService - ) { - $this->caseManagement = $caseManagement; - $this->signifydGateway = $signifydGateway; - $this->logger = $logger; - $this->caseRepository = $caseRepository; - $this->orderGridUpdater = $orderGridUpdater; - $this->orderStateService = $orderStateService; - } - - /** - * {@inheritdoc} - */ - public function createForOrder($orderId) - { - $case = $this->caseManagement->create($orderId); - $this->orderGridUpdater->update($orderId); - - try { - $caseId = $this->signifydGateway->createCase($orderId); - } catch (GatewayException $e) { - $this->logger->error($e->getMessage()); - return true; - } - - $case->setCaseId($caseId); - $this->caseRepository->save($case); - $this->orderStateService->updateByCase($case); - - return true; - } -} diff --git a/app/code/Magento/Signifyd/Model/CaseServices/StubUpdatingService.php b/app/code/Magento/Signifyd/Model/CaseServices/StubUpdatingService.php deleted file mode 100644 index 295d7f13fb0ac..0000000000000 --- a/app/code/Magento/Signifyd/Model/CaseServices/StubUpdatingService.php +++ /dev/null @@ -1,23 +0,0 @@ -<?php -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ -namespace Magento\Signifyd\Model\CaseServices; - -use Magento\Signifyd\Api\Data\CaseInterface; - -/** - * Stub implementation for case updating service interface and might be used - * for test Signifyd webhooks - */ -class StubUpdatingService implements UpdatingServiceInterface -{ - /** - * @inheritdoc - */ - public function update(CaseInterface $case, array $data) - { - // just stub method and doesn't contain any logic - } -} diff --git a/app/code/Magento/Signifyd/Model/CaseServices/UpdatingService.php b/app/code/Magento/Signifyd/Model/CaseServices/UpdatingService.php deleted file mode 100644 index 168ab67f8cf50..0000000000000 --- a/app/code/Magento/Signifyd/Model/CaseServices/UpdatingService.php +++ /dev/null @@ -1,119 +0,0 @@ -<?php -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ -namespace Magento\Signifyd\Model\CaseServices; - -use Magento\Framework\Api\SimpleDataObjectConverter; -use Magento\Framework\Exception\LocalizedException; -use Magento\Signifyd\Api\CaseRepositoryInterface; -use Magento\Signifyd\Api\Data\CaseInterface; -use Magento\Signifyd\Model\CommentsHistoryUpdater; -use Magento\Signifyd\Model\MessageGenerators\GeneratorInterface; -use Magento\Signifyd\Model\OrderStateService; -use Magento\Signifyd\Model\SalesOrderGrid\OrderGridUpdater; - -/** - * Performs Signifyd case entity updating operations. - */ -class UpdatingService implements UpdatingServiceInterface -{ - /** - * @var GeneratorInterface - */ - private $messageGenerator; - - /** - * @var CaseRepositoryInterface - */ - private $caseRepository; - - /** - * @var CommentsHistoryUpdater - */ - private $commentsHistoryUpdater; - - /** - * @var \Magento\Signifyd\Model\SalesOrderGrid\OrderGridUpdater - */ - private $orderGridUpdater; - - /** - * @var OrderStateService - */ - private $orderStateService; - - /** - * UpdatingService constructor. - * - * @param GeneratorInterface $messageGenerator - * @param CaseRepositoryInterface $caseRepository - * @param CommentsHistoryUpdater $commentsHistoryUpdater - * @param \Magento\Signifyd\Model\SalesOrderGrid\OrderGridUpdater $orderGridUpdater - * @param OrderStateService $orderStateService - */ - public function __construct( - GeneratorInterface $messageGenerator, - CaseRepositoryInterface $caseRepository, - CommentsHistoryUpdater $commentsHistoryUpdater, - OrderGridUpdater $orderGridUpdater, - OrderStateService $orderStateService - ) { - $this->messageGenerator = $messageGenerator; - $this->caseRepository = $caseRepository; - $this->commentsHistoryUpdater = $commentsHistoryUpdater; - $this->orderGridUpdater = $orderGridUpdater; - $this->orderStateService = $orderStateService; - } - - /** - * Updates Signifyd Case entity by received data. - * - * @param CaseInterface $case - * @param array $data - * @return void - * @throws LocalizedException - */ - public function update(CaseInterface $case, array $data) - { - if (empty($case->getEntityId()) || empty($case->getCaseId())) { - throw new LocalizedException(__('The case entity should not be empty.')); - } - - try { - $previousDisposition = $case->getGuaranteeDisposition(); - $this->setCaseData($case, $data); - $orderHistoryComment = $this->messageGenerator->generate($data); - $case = $this->caseRepository->save($case); - $this->orderGridUpdater->update($case->getOrderId()); - $this->commentsHistoryUpdater->addComment($case, $orderHistoryComment); - if ($case->getGuaranteeDisposition() !== $previousDisposition) { - $this->orderStateService->updateByCase($case); - } - } catch (\Exception $e) { - throw new LocalizedException(__('Cannot update Case entity.'), $e); - } - } - - /** - * Sets data to case entity. - * - * @param CaseInterface $case - * @param array $data - * @return void - */ - private function setCaseData(CaseInterface $case, array $data) - { - // list of keys which should not be replaced, like order id - $notResolvedKeys = [ - 'orderId' - ]; - foreach ($data as $key => $value) { - $methodName = 'set' . SimpleDataObjectConverter::snakeCaseToUpperCamelCase($key); - if (!in_array($key, $notResolvedKeys) && method_exists($case, $methodName)) { - call_user_func([$case, $methodName], $value); - } - } - } -} diff --git a/app/code/Magento/Signifyd/Model/CaseServices/UpdatingServiceFactory.php b/app/code/Magento/Signifyd/Model/CaseServices/UpdatingServiceFactory.php deleted file mode 100644 index 5415044b5edc4..0000000000000 --- a/app/code/Magento/Signifyd/Model/CaseServices/UpdatingServiceFactory.php +++ /dev/null @@ -1,78 +0,0 @@ -<?php -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ -namespace Magento\Signifyd\Model\CaseServices; - -use Magento\Framework\ObjectManagerInterface; -use Magento\Signifyd\Model\MessageGenerators\GeneratorFactory; -use Magento\Signifyd\Model\Config; - -/** - * Creates instance of case updating service configured with specific message generator. - * The message generator initialization depends on specified type (like, case creation, re-scoring, review and - * guarantee completion). - */ -class UpdatingServiceFactory -{ - /** - * Type of testing Signifyd case - * @var string - */ - private static $caseTest = 'cases/test'; - - /** - * @var ObjectManagerInterface - */ - private $objectManager; - - /** - * @var GeneratorFactory - */ - private $generatorFactory; - - /** - * @var Config - */ - private $config; - - /** - * UpdatingServiceFactory constructor. - * - * @param ObjectManagerInterface $objectManager - * @param GeneratorFactory $generatorFactory - * @param Config $config - */ - public function __construct( - ObjectManagerInterface $objectManager, - GeneratorFactory $generatorFactory, - Config $config - ) { - $this->objectManager = $objectManager; - $this->generatorFactory = $generatorFactory; - $this->config = $config; - } - - /** - * Creates instance of service updating case. - * As param retrieves type of message generator. - * - * @param string $type - * @return UpdatingServiceInterface - * @throws \InvalidArgumentException - */ - public function create($type) - { - if (!$this->config->isActive() || $type === self::$caseTest) { - return $this->objectManager->create(StubUpdatingService::class); - } - - $messageGenerator = $this->generatorFactory->create($type); - $service = $this->objectManager->create(UpdatingService::class, [ - 'messageGenerator' => $messageGenerator - ]); - - return $service; - } -} diff --git a/app/code/Magento/Signifyd/Model/CaseServices/UpdatingServiceInterface.php b/app/code/Magento/Signifyd/Model/CaseServices/UpdatingServiceInterface.php deleted file mode 100644 index daa7b40bfd674..0000000000000 --- a/app/code/Magento/Signifyd/Model/CaseServices/UpdatingServiceInterface.php +++ /dev/null @@ -1,23 +0,0 @@ -<?php -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ -namespace Magento\Signifyd\Model\CaseServices; - -use Magento\Signifyd\Api\Data\CaseInterface; - -/** - * Common abstraction to perform updating operations with Signifyd case entity. - */ -interface UpdatingServiceInterface -{ - /** - * Updates Signifyd Case entity by received data. - * - * @param CaseInterface $case - * @param array $data - * @return void - */ - public function update(CaseInterface $case, array $data); -} diff --git a/app/code/Magento/Signifyd/Model/CommentsHistoryUpdater.php b/app/code/Magento/Signifyd/Model/CommentsHistoryUpdater.php deleted file mode 100644 index f473d157efa4a..0000000000000 --- a/app/code/Magento/Signifyd/Model/CommentsHistoryUpdater.php +++ /dev/null @@ -1,65 +0,0 @@ -<?php -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ -namespace Magento\Signifyd\Model; - -use Magento\Framework\Phrase; -use Magento\Sales\Api\OrderStatusHistoryRepositoryInterface; -use Magento\Sales\Model\Order\Status\HistoryFactory; -use Magento\Signifyd\Api\Data\CaseInterface; - -/** - * Updates case order comments history. - */ -class CommentsHistoryUpdater -{ - /** - * @var HistoryFactory - */ - private $historyFactory; - - /** - * @var OrderStatusHistoryRepositoryInterface - */ - private $historyRepository; - - /** - * CommentsHistoryUpdater constructor. - * - * @param HistoryFactory $historyFactory - * @param OrderStatusHistoryRepositoryInterface $historyRepository - */ - public function __construct( - HistoryFactory $historyFactory, - OrderStatusHistoryRepositoryInterface $historyRepository - ) { - $this->historyFactory = $historyFactory; - $this->historyRepository = $historyRepository; - } - - /** - * Adds comment to case related order. - * Throws an exception if cannot save history comment. - * - * @param CaseInterface $case - * @param Phrase $message - * @param string $status - * @return void - */ - public function addComment(CaseInterface $case, Phrase $message, $status = '') - { - if (!$message->getText()) { - return; - } - - /** @var \Magento\Sales\Api\Data\OrderStatusHistoryInterface $history */ - $history = $this->historyFactory->create(); - $history->setParentId($case->getOrderId()) - ->setComment($message) - ->setEntityName('order') - ->setStatus($status); - $this->historyRepository->save($history); - } -} diff --git a/app/code/Magento/Signifyd/Model/Config.php b/app/code/Magento/Signifyd/Model/Config.php deleted file mode 100644 index 15d3608bd38c4..0000000000000 --- a/app/code/Magento/Signifyd/Model/Config.php +++ /dev/null @@ -1,101 +0,0 @@ -<?php -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ -namespace Magento\Signifyd\Model; - -use Magento\Framework\App\Config\ScopeConfigInterface; -use Magento\Store\Model\ScopeInterface; - -/** - * Signifyd integration configuration. - * - * Class is a proxy service for retrieving configuration settings. - */ -class Config -{ - /** - * @var ScopeConfigInterface - */ - private $scopeConfig; - - /** - * Config constructor. - * - * @param ScopeConfigInterface $scopeConfig - */ - public function __construct(ScopeConfigInterface $scopeConfig) - { - $this->scopeConfig = $scopeConfig; - } - - /** - * If this config option set to false no Signifyd integration should be available - * (only possibility to configure Signifyd setting in admin) - * - * @param int|null $storeId - * @return bool - */ - public function isActive($storeId = null): bool - { - $enabled = $this->scopeConfig->isSetFlag( - 'fraud_protection/signifyd/active', - ScopeInterface::SCOPE_STORE, - $storeId - ); - return $enabled; - } - - /** - * Signifyd API Key used for authentication. - * - * @see https://www.signifyd.com/docs/api/#/introduction/authentication - * @see https://app.signifyd.com/settings - * - * @param int|null $storeId - * @return string - */ - public function getApiKey($storeId = null): string - { - $apiKey = $this->scopeConfig->getValue( - 'fraud_protection/signifyd/api_key', - ScopeInterface::SCOPE_STORE, - $storeId - ); - return $apiKey; - } - - /** - * Base URL to Signifyd REST API. - * Usually equals to https://api.signifyd.com/v2 and should not be changed - * - * @param int|null $storeId - * @return string - */ - public function getApiUrl($storeId = null): string - { - $apiUrl = $this->scopeConfig->getValue( - 'fraud_protection/signifyd/api_url', - ScopeInterface::SCOPE_STORE, - $storeId - ); - return $apiUrl; - } - - /** - * If is "true" extra information about interaction with Signifyd API are written to debug.log file - * - * @param int|null $storeId - * @return bool - */ - public function isDebugModeEnabled($storeId = null): bool - { - $debugModeEnabled = $this->scopeConfig->isSetFlag( - 'fraud_protection/signifyd/debug', - ScopeInterface::SCOPE_STORE, - $storeId - ); - return $debugModeEnabled; - } -} diff --git a/app/code/Magento/Signifyd/Model/CustomerOrders.php b/app/code/Magento/Signifyd/Model/CustomerOrders.php deleted file mode 100644 index c326cf06424c0..0000000000000 --- a/app/code/Magento/Signifyd/Model/CustomerOrders.php +++ /dev/null @@ -1,173 +0,0 @@ -<?php -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ -namespace Magento\Signifyd\Model; - -use Exception; -use Magento\Directory\Model\Currency; -use Magento\Directory\Model\CurrencyFactory; -use Magento\Framework\Api\FilterBuilder; -use Magento\Framework\Api\SearchCriteriaBuilder; -use Magento\Sales\Api\Data\OrderInterface; -use Magento\Sales\Api\OrderRepositoryInterface; -use Psr\Log\LoggerInterface; - -/** - * Provides information about customer orders. - * - * @SuppressWarnings(PHPMD.CouplingBetweenObjects) - */ -class CustomerOrders -{ - /** - * @var SearchCriteriaBuilder - */ - private $searchCriteriaBuilder; - - /** - * @var FilterBuilder - */ - private $filterBuilder; - - /** - * @var OrderRepositoryInterface - */ - private $orderRepository; - - /** - * @var LoggerInterface - */ - private $logger; - - /** - * @var CurrencyFactory - */ - private $currencyFactory; - - /** - * @var array - */ - private $currencies = []; - - /** - * @var string - */ - private static $usdCurrencyCode = 'USD'; - - /** - * @param SearchCriteriaBuilder $searchCriteriaBuilder - * @param FilterBuilder $filterBuilder - * @param OrderRepositoryInterface $orderRepository - * @param CurrencyFactory $currencyFactory - * @param LoggerInterface $logger - */ - public function __construct( - SearchCriteriaBuilder $searchCriteriaBuilder, - FilterBuilder $filterBuilder, - OrderRepositoryInterface $orderRepository, - CurrencyFactory $currencyFactory, - LoggerInterface $logger - ) { - $this->searchCriteriaBuilder = $searchCriteriaBuilder; - $this->filterBuilder = $filterBuilder; - $this->orderRepository = $orderRepository; - $this->currencyFactory = $currencyFactory; - $this->logger = $logger; - } - - /** - * Returns aggregated customer orders count and total amount in USD. - * - * Returned array contains next keys: - * aggregateOrderCount - total count of orders placed by this account since it was created, including the current - * aggregateOrderDollars - total amount spent by this account since it was created, including the current order - * - * @param int $customerId - * @return array - */ - public function getAggregatedOrdersInfo($customerId) - { - $result = [ - 'aggregateOrderCount' => null, - 'aggregateOrderDollars' => null - ]; - - $customerOrders = $this->getCustomerOrders($customerId); - if (!empty($customerOrders)) { - try { - $orderTotalDollars = 0.0; - foreach ($customerOrders as $order) { - $orderTotalDollars += $this->getUsdOrderTotal( - $order->getBaseGrandTotal(), - $order->getBaseCurrencyCode() - ); - } - $result = [ - 'aggregateOrderCount' => count($customerOrders), - 'aggregateOrderDollars' => $orderTotalDollars - ]; - } catch (Exception $e) { - $this->logger->error($e->getMessage()); - } - } - - return $result; - } - - /** - * Returns customer orders. - * - * @param int $customerId - * @return OrderInterface[] - */ - private function getCustomerOrders($customerId) - { - $filters = [ - $this->filterBuilder->setField(OrderInterface::CUSTOMER_ID)->setValue($customerId)->create() - ]; - $this->searchCriteriaBuilder->addFilters($filters); - $searchCriteria = $this->searchCriteriaBuilder->create(); - $searchResults = $this->orderRepository->getList($searchCriteria); - - return $searchResults->getItems(); - } - - /** - * Returns amount in USD. - * - * @param float $amount - * @param string $currency - * @return float - */ - private function getUsdOrderTotal($amount, $currency) - { - if ($currency === self::$usdCurrencyCode) { - return $amount; - } - - $operationCurrency = $this->getCurrencyByCode($currency); - - return $operationCurrency->convert($amount, self::$usdCurrencyCode); - } - - /** - * Returns currency by currency code. - * - * @param string|null $currencyCode - * @return Currency - */ - private function getCurrencyByCode($currencyCode) - { - if (isset($this->currencies[$currencyCode])) { - return $this->currencies[$currencyCode]; - } - - /** @var Currency $currency */ - $currency = $this->currencyFactory->create(); - $this->currencies[$currencyCode] = $currency->load($currencyCode); - - return $this->currencies[$currencyCode]; - } -} diff --git a/app/code/Magento/Signifyd/Model/Guarantee/CancelGuaranteeAbility.php b/app/code/Magento/Signifyd/Model/Guarantee/CancelGuaranteeAbility.php deleted file mode 100644 index 65bede6f0cea5..0000000000000 --- a/app/code/Magento/Signifyd/Model/Guarantee/CancelGuaranteeAbility.php +++ /dev/null @@ -1,84 +0,0 @@ -<?php -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ -namespace Magento\Signifyd\Model\Guarantee; - -use Magento\Framework\Exception\InputException; -use Magento\Framework\Exception\NoSuchEntityException; -use Magento\Sales\Api\Data\OrderInterface; -use Magento\Sales\Api\OrderRepositoryInterface; -use Magento\Signifyd\Model\CaseManagement; - -/** - * Checks if is possible to cancel Guarantee for order. - */ -class CancelGuaranteeAbility -{ - /** - * @var CaseManagement - */ - private $caseManagement; - - /** - * @var OrderRepositoryInterface - */ - private $orderRepository; - - /** - * @param CaseManagement $caseManagement - * @param OrderRepositoryInterface $orderRepository - */ - public function __construct( - CaseManagement $caseManagement, - OrderRepositoryInterface $orderRepository - ) { - $this->caseManagement = $caseManagement; - $this->orderRepository = $orderRepository; - } - - /** - * Checks if it is possible to create Guarantee for order and case. - * - * @param int $orderId - * @return bool - */ - public function isAvailable($orderId) - { - $case = $this->caseManagement->getByOrderId($orderId); - if ($case === null) { - return false; - } - - if (in_array($case->getGuaranteeDisposition(), [null, $case::GUARANTEE_CANCELED])) { - return false; - } - - $order = $this->getOrder($orderId); - if (null === $order) { - return false; - } - - return true; - } - - /** - * Returns order by id - * - * @param int $orderId - * @return OrderInterface|null - */ - private function getOrder($orderId) - { - try { - $order = $this->orderRepository->get($orderId); - } catch (InputException $e) { - return null; - } catch (NoSuchEntityException $e) { - return null; - } - - return $order; - } -} diff --git a/app/code/Magento/Signifyd/Model/Guarantee/CancelingService.php b/app/code/Magento/Signifyd/Model/Guarantee/CancelingService.php deleted file mode 100644 index b30efac8c2190..0000000000000 --- a/app/code/Magento/Signifyd/Model/Guarantee/CancelingService.php +++ /dev/null @@ -1,94 +0,0 @@ -<?php -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ -namespace Magento\Signifyd\Model\Guarantee; - -use Magento\Signifyd\Api\CaseManagementInterface; -use Magento\Signifyd\Api\GuaranteeCancelingServiceInterface; -use Magento\Signifyd\Model\CaseServices\UpdatingServiceFactory; -use Magento\Signifyd\Model\SignifydGateway\Gateway; -use Magento\Signifyd\Model\SignifydGateway\GatewayException; -use Psr\Log\LoggerInterface; - -/** - * Sends request to Signifyd to cancel guarantee and updates case entity. - */ -class CancelingService implements GuaranteeCancelingServiceInterface -{ - /** - * @var CaseManagementInterface - */ - private $caseManagement; - - /** - * @var UpdatingServiceFactory - */ - private $serviceFactory; - - /** - * @var Gateway - */ - private $gateway; - - /** - * @var CancelGuaranteeAbility - */ - private $cancelGuaranteeAbility; - - /** - * @var LoggerInterface - */ - private $logger; - - /** - * CancelingService constructor. - * - * @param CaseManagementInterface $caseManagement - * @param UpdatingServiceFactory $serviceFactory - * @param Gateway $gateway - * @param CancelGuaranteeAbility $cancelGuaranteeAbility - * @param LoggerInterface $logger - */ - public function __construct( - CaseManagementInterface $caseManagement, - UpdatingServiceFactory $serviceFactory, - Gateway $gateway, - CancelGuaranteeAbility $cancelGuaranteeAbility, - LoggerInterface $logger - ) { - $this->caseManagement = $caseManagement; - $this->serviceFactory = $serviceFactory; - $this->gateway = $gateway; - $this->cancelGuaranteeAbility = $cancelGuaranteeAbility; - $this->logger = $logger; - } - - /** - * @inheritdoc - */ - public function cancelForOrder($orderId) - { - if (!$this->cancelGuaranteeAbility->isAvailable($orderId)) { - return false; - } - - $caseEntity = $this->caseManagement->getByOrderId($orderId); - - try { - $disposition = $this->gateway->cancelGuarantee($caseEntity->getCaseId()); - } catch (GatewayException $e) { - $this->logger->error($e->getMessage()); - return false; - } - - $updatingService = $this->serviceFactory->create('guarantees/cancel'); - $data = [ - 'guaranteeDisposition' => $disposition - ]; - $updatingService->update($caseEntity, $data); - - return true; - } -} diff --git a/app/code/Magento/Signifyd/Model/Guarantee/CreateGuaranteeAbility.php b/app/code/Magento/Signifyd/Model/Guarantee/CreateGuaranteeAbility.php deleted file mode 100644 index 15addba3ec4fd..0000000000000 --- a/app/code/Magento/Signifyd/Model/Guarantee/CreateGuaranteeAbility.php +++ /dev/null @@ -1,124 +0,0 @@ -<?php -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ -namespace Magento\Signifyd\Model\Guarantee; - -use Magento\Framework\Exception\InputException; -use Magento\Framework\Exception\NoSuchEntityException; -use Magento\Framework\Intl\DateTimeFactory; -use Magento\Sales\Api\Data\OrderInterface; -use Magento\Sales\Api\OrderRepositoryInterface; -use Magento\Sales\Model\Order; -use Magento\Signifyd\Model\CaseManagement; - -/** - * Checks if is possible to create Guarantee for order. - */ -class CreateGuaranteeAbility -{ - /** - * @var CaseManagement - */ - private $caseManagement; - - /** - * @var OrderRepositoryInterface - */ - private $orderRepository; - - /** - * @var DateTimeFactory - */ - private $dateTimeFactory; - - /** - * Eligible count of days from the order creation date to submit a case for Guarantee. - * - * @var int - */ - private static $guarantyEligibleDays = 7; - - /** - * @param CaseManagement $caseManagement - * @param OrderRepositoryInterface $orderRepository - * @param DateTimeFactory $dateTimeFactory - */ - public function __construct( - CaseManagement $caseManagement, - OrderRepositoryInterface $orderRepository, - DateTimeFactory $dateTimeFactory - ) { - $this->caseManagement = $caseManagement; - $this->orderRepository = $orderRepository; - $this->dateTimeFactory = $dateTimeFactory; - } - - /** - * Checks if it is possible to create Guarantee for order and case. - * - * @param int $orderId - * @return bool - */ - public function isAvailable($orderId) - { - $case = $this->caseManagement->getByOrderId($orderId); - if (null === $case) { - return false; - } - - if ($case->isGuaranteeEligible() === false) { - return false; - } - - $order = $this->getOrder($orderId); - if (null === $order) { - return false; - } - - if (in_array($order->getState(), [Order::STATE_CANCELED, Order::STATE_CLOSED])) { - return false; - } - - if ($this->isOrderOlderThen(static::$guarantyEligibleDays, $order)) { - return false; - } - - return true; - } - - /** - * Checks if Guarantee submit is applicable for order. - * - * @param OrderInterface $order - * @param int $days number of days from the order creation date to submit a case for Guarantee. - * @return bool - */ - private function isOrderOlderThen($days, OrderInterface $order) - { - $orderCreateDate = $this->dateTimeFactory->create($order->getCreatedAt(), new \DateTimeZone('UTC')); - $currentDate = $this->dateTimeFactory->create('now', new \DateTimeZone('UTC')); - - return $orderCreateDate->diff($currentDate)->days >= $days; - } - - /** - * Returns order by id - * - * @param int $orderId - * @return OrderInterface|null - */ - private function getOrder($orderId) - { - try { - $order = $this->orderRepository->get($orderId); - } catch (InputException $e) { - return null; - } catch (NoSuchEntityException $e) { - return null; - } - - return $order; - } -} diff --git a/app/code/Magento/Signifyd/Model/Guarantee/CreationService.php b/app/code/Magento/Signifyd/Model/Guarantee/CreationService.php deleted file mode 100644 index 4080aee453f18..0000000000000 --- a/app/code/Magento/Signifyd/Model/Guarantee/CreationService.php +++ /dev/null @@ -1,97 +0,0 @@ -<?php -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ -namespace Magento\Signifyd\Model\Guarantee; - -use Magento\Framework\Exception\AlreadyExistsException; -use Magento\Framework\Exception\NotFoundException; -use Magento\Signifyd\Api\CaseManagementInterface; -use Magento\Signifyd\Api\GuaranteeCreationServiceInterface; -use Magento\Signifyd\Model\CaseServices\UpdatingServiceFactory; -use Magento\Signifyd\Model\SignifydGateway\Gateway; -use Magento\Signifyd\Model\SignifydGateway\GatewayException; -use Psr\Log\LoggerInterface; - -/** - * Register guarantee at Signifyd and updates case entity - */ -class CreationService implements GuaranteeCreationServiceInterface -{ - /** - * @var CaseManagementInterface - */ - private $caseManagement; - - /** - * @var UpdatingServiceFactory - */ - private $caseUpdatingServiceFactory; - - /** - * @var Gateway - */ - private $gateway; - - /** - * @var CreateGuaranteeAbility - */ - private $createGuaranteeAbility; - - /** - * @var LoggerInterface - */ - private $logger; - - /** - * CreationService constructor. - * - * @param CaseManagementInterface $caseManagement - * @param UpdatingServiceFactory $caseUpdatingServiceFactory - * @param Gateway $gateway - * @param CreateGuaranteeAbility $createGuaranteeAbility - * @param LoggerInterface $logger - */ - public function __construct( - CaseManagementInterface $caseManagement, - UpdatingServiceFactory $caseUpdatingServiceFactory, - Gateway $gateway, - CreateGuaranteeAbility $createGuaranteeAbility, - LoggerInterface $logger - ) { - $this->caseManagement = $caseManagement; - $this->caseUpdatingServiceFactory = $caseUpdatingServiceFactory; - $this->gateway = $gateway; - $this->createGuaranteeAbility = $createGuaranteeAbility; - $this->logger = $logger; - } - - /** - * @inheritdoc - */ - public function createForOrder($orderId) - { - if (!$this->createGuaranteeAbility->isAvailable($orderId)) { - return false; - } - - $caseEntity = $this->caseManagement->getByOrderId($orderId); - - try { - $disposition = $this->gateway->submitCaseForGuarantee($caseEntity->getCaseId()); - } catch (GatewayException $e) { - $this->logger->error($e->getMessage()); - return false; - } - - $updatingService = $this->caseUpdatingServiceFactory->create('guarantees/creation'); - $data = [ - 'caseId' => $caseEntity->getCaseId(), - 'guaranteeDisposition' => $disposition - ]; - $updatingService->update($caseEntity, $data); - - return true; - } -} diff --git a/app/code/Magento/Signifyd/Model/MessageGenerators/CaseRescore.php b/app/code/Magento/Signifyd/Model/MessageGenerators/CaseRescore.php deleted file mode 100644 index d0e89854e3909..0000000000000 --- a/app/code/Magento/Signifyd/Model/MessageGenerators/CaseRescore.php +++ /dev/null @@ -1,51 +0,0 @@ -<?php -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ -namespace Magento\Signifyd\Model\MessageGenerators; - -use Magento\Signifyd\Api\CaseRepositoryInterface; - -/** - * Generates message based on previous and current Case scores. - */ -class CaseRescore implements GeneratorInterface -{ - /** - * @var CaseRepositoryInterface - */ - private $caseRepository; - - /** - * CaseRescore constructor. - * - * @param CaseRepositoryInterface $caseRepository - */ - public function __construct(CaseRepositoryInterface $caseRepository) - { - $this->caseRepository = $caseRepository; - } - - /** - * @inheritdoc - */ - public function generate(array $data) - { - if (empty($data['caseId'])) { - throw new GeneratorException(__('The "%1" should not be empty.', 'caseId')); - } - - $caseEntity = $this->caseRepository->getByCaseId($data['caseId']); - - if ($caseEntity === null) { - throw new GeneratorException(__('Case entity not found.')); - } - - return __( - 'Case Update: New score for the order is %1. Previous score was %2.', - !empty($data['score']) ? $data['score'] : 0, - $caseEntity->getScore() - ); - } -} diff --git a/app/code/Magento/Signifyd/Model/MessageGenerators/GeneratorException.php b/app/code/Magento/Signifyd/Model/MessageGenerators/GeneratorException.php deleted file mode 100644 index 103cb9fc1e2d3..0000000000000 --- a/app/code/Magento/Signifyd/Model/MessageGenerators/GeneratorException.php +++ /dev/null @@ -1,19 +0,0 @@ -<?php -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ -namespace Magento\Signifyd\Model\MessageGenerators; - -use Magento\Framework\Exception\LocalizedException; - -/** - * Common exception for Signifyd message generators. - * - * @api - * @since 100.2.0 - */ -class GeneratorException extends LocalizedException -{ - -} diff --git a/app/code/Magento/Signifyd/Model/MessageGenerators/GeneratorFactory.php b/app/code/Magento/Signifyd/Model/MessageGenerators/GeneratorFactory.php deleted file mode 100644 index 66e02a3803950..0000000000000 --- a/app/code/Magento/Signifyd/Model/MessageGenerators/GeneratorFactory.php +++ /dev/null @@ -1,112 +0,0 @@ -<?php -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ -namespace Magento\Signifyd\Model\MessageGenerators; - -use Magento\Framework\ObjectManagerInterface; -use Magento\Signifyd\Model\MessageGeneratorInterface; - -/** - * Creates instance of message generator based on received type of message. - */ -class GeneratorFactory -{ - /** - * Type of message for Signifyd case creation. - * @var string - */ - private static $caseCreation = 'cases/creation'; - - /** - * Type of message for Signifyd case re-scoring. - * @var string - */ - private static $caseRescore = 'cases/rescore'; - - /** - * Type of message for Signifyd case reviewing - * @var string - */ - private static $caseReview = 'cases/review'; - - /** - * Type of message of Signifyd guarantee completion - * @var string - */ - private static $guaranteeCompletion = 'guarantees/completion'; - - /** - * Type of message of Signifyd guarantee creation - * @var string - */ - private static $guaranteeCreation = 'guarantees/creation'; - - /** - * Type of message of Signifyd guarantee canceling - * @var string - */ - private static $guaranteeCancel = 'guarantees/cancel'; - - /** - * UpdatingServiceFactory constructor. - * - * @param ObjectManagerInterface $objectManager - */ - public function __construct(ObjectManagerInterface $objectManager) - { - $this->objectManager = $objectManager; - } - - /** - * Creates instance of message generator. - * Throws exception if type of message generator does not have implementations. - * - * @param string $type - * @return GeneratorInterface - * @throws \InvalidArgumentException - */ - public function create($type) - { - $className = PatternGenerator::class; - switch ($type) { - case self::$caseCreation: - $classConfig = [ - 'template' => 'Signifyd Case %1 has been created for order.', - 'requiredParams' => ['caseId'] - ]; - break; - case self::$caseRescore: - $classConfig = []; - $className = CaseRescore::class; - break; - case self::$caseReview: - $classConfig = [ - 'template' => 'Case Update: Case Review was completed. Review Deposition is %1.', - 'requiredParams' => ['reviewDisposition'] - ]; - break; - case self::$guaranteeCompletion: - $classConfig = [ - 'template' => 'Case Update: Guarantee Disposition is %1.', - 'requiredParams' => ['guaranteeDisposition'] - ]; - break; - case self::$guaranteeCreation: - $classConfig = [ - 'template' => 'Case Update: Case is submitted for guarantee.' - ]; - break; - case self::$guaranteeCancel: - $classConfig = [ - 'template' => 'Case Update: Case guarantee has been cancelled.' - ]; - break; - default: - throw new \InvalidArgumentException('Specified message type does not supported.'); - } - - return $this->objectManager->create($className, $classConfig); - } -} diff --git a/app/code/Magento/Signifyd/Model/MessageGenerators/GeneratorInterface.php b/app/code/Magento/Signifyd/Model/MessageGenerators/GeneratorInterface.php deleted file mode 100644 index 385cbe35f05ac..0000000000000 --- a/app/code/Magento/Signifyd/Model/MessageGenerators/GeneratorInterface.php +++ /dev/null @@ -1,21 +0,0 @@ -<?php -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ -namespace Magento\Signifyd\Model\MessageGenerators; - -/** - * Represents common abstraction for Signifyd Case/Guarantee messages. - * Each interface implementation might use Case/Guarantee data to generate specific message. - */ -interface GeneratorInterface -{ - /** - * Creates new localized message based on Signifyd Case/Guarantee data. - * @param array $data - * @return \Magento\Framework\Phrase - * @throws GeneratorException - */ - public function generate(array $data); -} diff --git a/app/code/Magento/Signifyd/Model/MessageGenerators/PatternGenerator.php b/app/code/Magento/Signifyd/Model/MessageGenerators/PatternGenerator.php deleted file mode 100644 index 8501934bebbc5..0000000000000 --- a/app/code/Magento/Signifyd/Model/MessageGenerators/PatternGenerator.php +++ /dev/null @@ -1,56 +0,0 @@ -<?php -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ -namespace Magento\Signifyd\Model\MessageGenerators; - -/** - * Common implementation of message generator. - * Takes a message template (placeholders for localization also can be used) and list - * of required params, which should persist in input data. - * - * If template contains placeholders, when required params should be specified in the same order as - * placeholders, for example: - * Message is 'Case Update: New score for the order is %1. Previous score was %2.', then the required params order - * should be ['new_score', 'prev_score']. - */ -class PatternGenerator implements GeneratorInterface -{ - /** - * @var string - */ - private $template; - - /** - * @var array - */ - private $requiredParams; - - /** - * PatternGenerator constructor. - * - * @param string $template - * @param array $requiredParams - */ - public function __construct($template, array $requiredParams = []) - { - $this->template = $template; - $this->requiredParams = $requiredParams; - } - - /** - * @inheritdoc - */ - public function generate(array $data) - { - $placeholders = []; - foreach ($this->requiredParams as $param) { - if (empty($data[$param])) { - throw new GeneratorException(__('The "%1" should not be empty.', $param)); - } - $placeholders[] = $data[$param]; - } - return __($this->template, ...$placeholders); - } -} diff --git a/app/code/Magento/Signifyd/Model/OrderStateService.php b/app/code/Magento/Signifyd/Model/OrderStateService.php deleted file mode 100644 index 2b3f0e155981e..0000000000000 --- a/app/code/Magento/Signifyd/Model/OrderStateService.php +++ /dev/null @@ -1,119 +0,0 @@ -<?php -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ -namespace Magento\Signifyd\Model; - -use Magento\Sales\Api\OrderManagementInterface; -use Magento\Sales\Model\Order; -use Magento\Sales\Model\OrderFactory; -use Magento\Signifyd\Api\Data\CaseInterface; - -/** - * Updates order state. - */ -class OrderStateService -{ - /** - * @var OrderFactory - */ - private $orderFactory; - - /** - * @var OrderManagementInterface - */ - private $orderManagement; - - /** - * @var CommentsHistoryUpdater - */ - private $commentsHistoryUpdater; - - /** - * @param OrderFactory $orderFactory - * @param OrderManagementInterface $orderManagement - * @param CommentsHistoryUpdater $commentsHistoryUpdater - */ - public function __construct( - OrderFactory $orderFactory, - OrderManagementInterface $orderManagement, - CommentsHistoryUpdater $commentsHistoryUpdater - ) { - $this->orderFactory = $orderFactory; - $this->orderManagement = $orderManagement; - $this->commentsHistoryUpdater = $commentsHistoryUpdater; - } - - /** - * Updates order state depending on case guarantee disposition status. - * - * @param CaseInterface $case - * @return void - */ - public function updateByCase(CaseInterface $case) - { - $orderId = $case->getOrderId(); - - switch ($case->getGuaranteeDisposition()) { - case CaseInterface::GUARANTEE_APPROVED: - $this->unHold($orderId); - break; - case CaseInterface::GUARANTEE_DECLINED: - $this->hold($orderId); - break; - case CaseInterface::GUARANTEE_PENDING: - if ($this->hold($orderId)) { - $this->commentsHistoryUpdater->addComment( - $case, - __('Awaiting the Signifyd guarantee disposition.'), - Order::STATE_HOLDED - ); - } - break; - } - } - - /** - * Tries to unhold the order. - * - * @param int $orderId - * @return bool - */ - private function unHold($orderId) - { - $order = $this->getOrder($orderId); - if ($order->canUnhold()) { - return $this->orderManagement->unHold($orderId); - } - - return false; - } - - /** - * Tries to hold the order. - * - * @param int $orderId - * @return bool - */ - private function hold($orderId) - { - $order = $this->getOrder($orderId); - if ($order->canHold()) { - return $this->orderManagement->hold($orderId); - } - - return false; - } - - /** - * Returns the order. - * - * @param int $orderId - * @return Order - */ - private function getOrder($orderId) - { - return $this->orderFactory->create()->load($orderId); - } -} diff --git a/app/code/Magento/Signifyd/Model/PaymentMethodMapper/PaymentMethodMapper.php b/app/code/Magento/Signifyd/Model/PaymentMethodMapper/PaymentMethodMapper.php deleted file mode 100644 index cdf9041510b45..0000000000000 --- a/app/code/Magento/Signifyd/Model/PaymentMethodMapper/PaymentMethodMapper.php +++ /dev/null @@ -1,40 +0,0 @@ -<?php -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ -namespace Magento\Signifyd\Model\PaymentMethodMapper; - -use Magento\Framework\Config\Data; - -/** - * Load and cache configuration data. - */ -class PaymentMethodMapper -{ - /** - * @var Data - */ - private $paymentMethodMapping; - - /** - * PaymentMapper constructor. - * - * @param Data $paymentMapping - */ - public function __construct(Data $paymentMapping) - { - $this->paymentMethodMapping = $paymentMapping; - } - - /** - * Gets the Sygnifyd payment method by the order's payment method. - * - * @param string $paymentMethod - * @return string - */ - public function getSignifydPaymentMethodCode($paymentMethod) - { - return $this->paymentMethodMapping->get($paymentMethod, ''); - } -} diff --git a/app/code/Magento/Signifyd/Model/PaymentMethodMapper/XmlToArrayConfigConverter.php b/app/code/Magento/Signifyd/Model/PaymentMethodMapper/XmlToArrayConfigConverter.php deleted file mode 100644 index 5c3f23bb92729..0000000000000 --- a/app/code/Magento/Signifyd/Model/PaymentMethodMapper/XmlToArrayConfigConverter.php +++ /dev/null @@ -1,88 +0,0 @@ -<?php -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ -namespace Magento\Signifyd\Model\PaymentMethodMapper; - -use Magento\Framework\Config\Dom\ValidationSchemaException; - -/** - * Converts XML config file to payment methods mapping. - */ -class XmlToArrayConfigConverter implements \Magento\Framework\Config\ConverterInterface -{ - /** - * Node type wrapper for magento and signifyd payment codes - * - * @var string - */ - private static $paymentMethodNodeType = 'payment_method'; - - /** - * Node type for payment methods code - * - * @var string - */ - private static $magentoCodeNodeType = 'magento_code'; - - /** - * Node type for Sygnifyd payment methods code - * - * @var string - */ - private static $signifydCodeNodeType = 'signifyd_code'; - - /** - * @inheritdoc - */ - public function convert($source) - { - $paymentMethods = $source->getElementsByTagName(self::$paymentMethodNodeType); - $paymentsList = []; - foreach ($paymentMethods as $paymentMethod) { - $paymentsList += $this->getPaymentMethodMapping($paymentMethod); - } - - return $paymentsList; - } - - /** - * Adds a payment method as key and a Sygnifyd payment method as value - * in the payment list array - * - * @param \DOMElement $payment - * @return array - * @throws ValidationSchemaException - */ - private function getPaymentMethodMapping(\DOMElement $payment) - { - $paymentMethodCode = $this->readSubnodeValue($payment, self::$magentoCodeNodeType); - $signifyPaymentMethodCode = $this->readSubnodeValue($payment, self::$signifydCodeNodeType); - - return [$paymentMethodCode => $signifyPaymentMethodCode]; - } - - /** - * Reads node value by node type - * - * @param \DOMElement $element - * @param string $subNodeType - * @return mixed - * @throws ValidationSchemaException - */ - private function readSubnodeValue(\DOMElement $element, $subNodeType) - { - $domList = $element->getElementsByTagName($subNodeType); - if (empty($domList[0])) { - throw new ValidationSchemaException(__('Only single entrance of "%1" node is required.', $subNodeType)); - } - - $subNodeValue = trim($domList[0]->nodeValue); - if (!$subNodeValue) { - throw new ValidationSchemaException(__('Not empty value for "%1" node is required.', $subNodeType)); - } - - return $subNodeValue; - } -} diff --git a/app/code/Magento/Signifyd/Model/PaymentVerificationFactory.php b/app/code/Magento/Signifyd/Model/PaymentVerificationFactory.php deleted file mode 100644 index 5be5ccbc5e55a..0000000000000 --- a/app/code/Magento/Signifyd/Model/PaymentVerificationFactory.php +++ /dev/null @@ -1,109 +0,0 @@ -<?php -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ -namespace Magento\Signifyd\Model; - -use Magento\Framework\ObjectManagerInterface; -use Magento\Payment\Api\PaymentVerificationInterface; -use Magento\Payment\Gateway\ConfigInterface; -use Magento\Framework\Exception\ConfigurationMismatchException; - -/** - * Creates verification service for provided payment method, or PaymentVerificationInterface::class - * if payment method does not support AVS, CVV verifications. - */ -class PaymentVerificationFactory -{ - /** - * @var ConfigInterface - */ - private $config; - - /** - * @var ObjectManagerInterface - */ - private $objectManager; - - /** - * @var PaymentVerificationInterface - */ - private $avsDefaultAdapter; - - /** - * @var PaymentVerificationInterface - */ - private $cvvDefaultAdapter; - - /** - * @param ObjectManagerInterface $objectManager - * @param ConfigInterface|Config $config - * @param PaymentVerificationInterface $avsDefaultAdapter - * @param PaymentVerificationInterface $cvvDefaultAdapter - */ - public function __construct( - ObjectManagerInterface $objectManager, - ConfigInterface $config, - PaymentVerificationInterface $avsDefaultAdapter, - PaymentVerificationInterface $cvvDefaultAdapter - ) { - $this->config = $config; - $this->objectManager = $objectManager; - $this->avsDefaultAdapter = $avsDefaultAdapter; - $this->cvvDefaultAdapter = $cvvDefaultAdapter; - } - - /** - * Creates instance of CVV code verification. - * Exception will be thrown if CVV mapper does not implement PaymentVerificationInterface. - * - * @param string $paymentCode - * @return PaymentVerificationInterface - * @throws ConfigurationMismatchException - */ - public function createPaymentCvv($paymentCode) - { - return $this->create($this->cvvDefaultAdapter, $paymentCode, 'cvv_ems_adapter'); - } - - /** - * Creates instance of AVS code verification. - * Exception will be thrown if AVS mapper does not implement PaymentVerificationInterface. - * - * @param string $paymentCode - * @return PaymentVerificationInterface - * @throws ConfigurationMismatchException - */ - public function createPaymentAvs($paymentCode) - { - return $this->create($this->avsDefaultAdapter, $paymentCode, 'avs_ems_adapter'); - } - - /** - * Creates instance of PaymentVerificationInterface. - * Default implementation will be returned if payment method does not implement PaymentVerificationInterface. - * - * @param PaymentVerificationInterface $defaultAdapter - * @param string $paymentCode - * @param string $configKey - * @return PaymentVerificationInterface - * @throws ConfigurationMismatchException If payment verification instance - * does not implement PaymentVerificationInterface. - */ - private function create(PaymentVerificationInterface $defaultAdapter, $paymentCode, $configKey) - { - $this->config->setMethodCode($paymentCode); - $verificationClass = $this->config->getValue($configKey); - if ($verificationClass === null) { - return $defaultAdapter; - } - $mapper = $this->objectManager->create($verificationClass); - if (!$mapper instanceof PaymentVerificationInterface) { - throw new ConfigurationMismatchException( - __('%1 must implement %2', $verificationClass, PaymentVerificationInterface::class) - ); - } - return $mapper; - } -} diff --git a/app/code/Magento/Signifyd/Model/PredefinedVerificationCode.php b/app/code/Magento/Signifyd/Model/PredefinedVerificationCode.php deleted file mode 100644 index 618d74b2a52e9..0000000000000 --- a/app/code/Magento/Signifyd/Model/PredefinedVerificationCode.php +++ /dev/null @@ -1,37 +0,0 @@ -<?php -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ -namespace Magento\Signifyd\Model; - -use Magento\Payment\Api\PaymentVerificationInterface; -use Magento\Sales\Api\Data\OrderPaymentInterface; - -/** - * Default implementation of payment verification interface. - * The default code value can be configured via DI. - */ -class PredefinedVerificationCode implements PaymentVerificationInterface -{ - /** - * @var string - */ - private $code; - - /** - * @param string $code - */ - public function __construct($code = '') - { - $this->code = $code; - } - - /** - * @inheritdoc - */ - public function getCode(OrderPaymentInterface $orderPayment) - { - return $this->code; - } -} diff --git a/app/code/Magento/Signifyd/Model/QuoteSession/Adminhtml/BackendSession.php b/app/code/Magento/Signifyd/Model/QuoteSession/Adminhtml/BackendSession.php deleted file mode 100644 index 9be02719545c7..0000000000000 --- a/app/code/Magento/Signifyd/Model/QuoteSession/Adminhtml/BackendSession.php +++ /dev/null @@ -1,40 +0,0 @@ -<?php -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ -namespace Magento\Signifyd\Model\QuoteSession\Adminhtml; - -use Magento\Backend\Model\Session\Quote as BackendQuoteSession; -use Magento\Signifyd\Model\QuoteSession\QuoteSessionInterface; - -/** - * Implementation of QuoteSessionInterface for Magento backend checkout. - */ -class BackendSession implements QuoteSessionInterface -{ - /** - * @var BackendQuoteSession - */ - private $backendQuoteSession; - - /** - * BackendSession constructor. - * - * Class uses backend session for retrieving quote. - * - * @param BackendQuoteSession $backendQuoteSession - */ - public function __construct(BackendQuoteSession $backendQuoteSession) - { - $this->backendQuoteSession = $backendQuoteSession; - } - - /** - * @inheritdoc - */ - public function getQuote() - { - return $this->backendQuoteSession->getQuote(); - } -} diff --git a/app/code/Magento/Signifyd/Model/QuoteSession/FrontendSession.php b/app/code/Magento/Signifyd/Model/QuoteSession/FrontendSession.php deleted file mode 100644 index 44c226ae4a47e..0000000000000 --- a/app/code/Magento/Signifyd/Model/QuoteSession/FrontendSession.php +++ /dev/null @@ -1,39 +0,0 @@ -<?php -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ -namespace Magento\Signifyd\Model\QuoteSession; - -use Magento\Checkout\Model\Session as CheckoutSession; - -/** - * Implementation of QuoteSessionInterface for Magento frontend checkout. - */ -class FrontendSession implements QuoteSessionInterface -{ - /** - * @var CheckoutSession - */ - private $checkoutSession; - - /** - * FrontendSession constructor. - * - * Class uses checkout session for retrieving quote. - * - * @param CheckoutSession $checkoutSession - */ - public function __construct(CheckoutSession $checkoutSession) - { - $this->checkoutSession = $checkoutSession; - } - - /** - * @inheritdoc - */ - public function getQuote() - { - return $this->checkoutSession->getQuote(); - } -} diff --git a/app/code/Magento/Signifyd/Model/QuoteSession/QuoteSessionInterface.php b/app/code/Magento/Signifyd/Model/QuoteSession/QuoteSessionInterface.php deleted file mode 100644 index 14958ac65a6ee..0000000000000 --- a/app/code/Magento/Signifyd/Model/QuoteSession/QuoteSessionInterface.php +++ /dev/null @@ -1,19 +0,0 @@ -<?php -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ -namespace Magento\Signifyd\Model\QuoteSession; - -/** - * Interface QuoteSessionInterface - */ -interface QuoteSessionInterface -{ - /** - * Returns quote from session. - * - * @return \Magento\Quote\Api\Data\CartInterface - */ - public function getQuote(); -} diff --git a/app/code/Magento/Signifyd/Model/ResourceModel/CaseEntity.php b/app/code/Magento/Signifyd/Model/ResourceModel/CaseEntity.php deleted file mode 100644 index 9c6ffde4504b9..0000000000000 --- a/app/code/Magento/Signifyd/Model/ResourceModel/CaseEntity.php +++ /dev/null @@ -1,22 +0,0 @@ -<?php -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ -namespace Magento\Signifyd\Model\ResourceModel; - -use Magento\Framework\Model\ResourceModel\Db\AbstractDb; - -/** - * Implementation of case resource model - */ -class CaseEntity extends AbstractDb -{ - /** - * @inheritdoc - */ - protected function _construct() - { - $this->_init('signifyd_case', 'entity_id'); - } -} diff --git a/app/code/Magento/Signifyd/Model/ResourceModel/CaseEntity/Collection.php b/app/code/Magento/Signifyd/Model/ResourceModel/CaseEntity/Collection.php deleted file mode 100644 index 92e233dd42dbc..0000000000000 --- a/app/code/Magento/Signifyd/Model/ResourceModel/CaseEntity/Collection.php +++ /dev/null @@ -1,24 +0,0 @@ -<?php -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ -namespace Magento\Signifyd\Model\ResourceModel\CaseEntity; - -use Magento\Framework\Model\ResourceModel\Db\Collection\AbstractCollection; -use Magento\Signifyd\Model\CaseEntity; -use Magento\Signifyd\Model\ResourceModel\CaseEntity as CaseResourceModel; - -/** - * Collection of case entities - */ -class Collection extends AbstractCollection -{ - /** - * @inheritdoc - */ - public function _construct() - { - $this->_init(CaseEntity::class, CaseResourceModel::class); - } -} diff --git a/app/code/Magento/Signifyd/Model/SalesOrderGrid/NotSyncedOrderIdListProvider.php b/app/code/Magento/Signifyd/Model/SalesOrderGrid/NotSyncedOrderIdListProvider.php deleted file mode 100644 index 360225ae37b7b..0000000000000 --- a/app/code/Magento/Signifyd/Model/SalesOrderGrid/NotSyncedOrderIdListProvider.php +++ /dev/null @@ -1,54 +0,0 @@ -<?php -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ -namespace Magento\Signifyd\Model\SalesOrderGrid; - -use Magento\Sales\Model\ResourceModel\Provider\NotSyncedDataProviderInterface; -use Magento\Signifyd\Model\ResourceModel; -use Magento\Signifyd\Model\ResourceModel\CaseEntity; - -/** - * Provides order ids list which Signifyd Case guaranty status were changed - */ -class NotSyncedOrderIdListProvider implements NotSyncedDataProviderInterface -{ - /** - * @var ResourceModel\CaseEntity - */ - private $caseEntity; - - /** - * @param ResourceModel\CaseEntity $caseEntity - */ - public function __construct( - CaseEntity $caseEntity - ) { - $this->caseEntity = $caseEntity; - } - - /** - * @inheritdoc - */ - public function getIds($mainTableName, $gridTableName) - { - $connection = $this->caseEntity->getConnection(); - $select = $connection->select() - ->from($this->caseEntity->getMainTable(), ['order_id']) - ->joinLeft( - [$gridTableName => $connection->getTableName($gridTableName)], - sprintf( - '%s.%s = %s.%s', - $this->caseEntity->getMainTable(), - 'order_id', - $gridTableName, - 'entity_id' - ), - [] - ) - ->where('guarantee_disposition != signifyd_guarantee_status'); - - return $connection->fetchAll($select, [], \Zend_Db::FETCH_COLUMN); - } -} diff --git a/app/code/Magento/Signifyd/Model/SalesOrderGrid/OrderGridUpdater.php b/app/code/Magento/Signifyd/Model/SalesOrderGrid/OrderGridUpdater.php deleted file mode 100644 index fff42b300be58..0000000000000 --- a/app/code/Magento/Signifyd/Model/SalesOrderGrid/OrderGridUpdater.php +++ /dev/null @@ -1,55 +0,0 @@ -<?php -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ -namespace Magento\Signifyd\Model\SalesOrderGrid; - -use Magento\Framework\App\Config\ScopeConfigInterface; -use Magento\Sales\Model\ResourceModel\GridInterface; - -/** - * Perfoms sales order grid updating operations. - * - * Serves order grid updates in both synchronous and asynchronous modes. - */ -class OrderGridUpdater -{ - /** - * @var ScopeConfigInterface - */ - private $globalConfig; - - /** - * @var GridInterface - */ - private $entityGrid; - - /** - * @param GridInterface $entityGrid - * @param ScopeConfigInterface $globalConfig - */ - public function __construct( - GridInterface $entityGrid, - ScopeConfigInterface $globalConfig - ) { - $this->globalConfig = $globalConfig; - $this->entityGrid = $entityGrid; - } - - /** - * Handles synchronous updating order entity in grid. - * - * Works only if asynchronous grid indexing is disabled - * in global settings. - * - * @param int $orderId - * @return void - */ - public function update($orderId) - { - if (!$this->globalConfig->getValue('dev/grid/async_indexing')) { - $this->entityGrid->refresh($orderId); - } - } -} diff --git a/app/code/Magento/Signifyd/Model/SignifydGateway/ApiCallException.php b/app/code/Magento/Signifyd/Model/SignifydGateway/ApiCallException.php deleted file mode 100644 index 73338c8ea4d62..0000000000000 --- a/app/code/Magento/Signifyd/Model/SignifydGateway/ApiCallException.php +++ /dev/null @@ -1,39 +0,0 @@ -<?php -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ -namespace Magento\Signifyd\Model\SignifydGateway; - -/** - * Exception of interaction with Signifyd API - */ -class ApiCallException extends GatewayException -{ - /** - * @var string - */ - private $requestData; - - /** - * ApiCallException constructor. - * @param string $message - * @param int $code - * @param \Exception|null $previous - * @param string $requestData in JSON format - */ - public function __construct($message = '', $code = 0, \Exception $previous = null, $requestData = '') - { - $this->requestData = $requestData; - parent::__construct($message, $code, $previous); - } - - /** - * Gets request data for unsuccessful request in JSON format - * @return string - */ - public function getRequestData() - { - return $this->requestData; - } -} diff --git a/app/code/Magento/Signifyd/Model/SignifydGateway/ApiClient.php b/app/code/Magento/Signifyd/Model/SignifydGateway/ApiClient.php deleted file mode 100644 index 2d6d57a510ae3..0000000000000 --- a/app/code/Magento/Signifyd/Model/SignifydGateway/ApiClient.php +++ /dev/null @@ -1,49 +0,0 @@ -<?php -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ -namespace Magento\Signifyd\Model\SignifydGateway; - -use Magento\Signifyd\Model\SignifydGateway\Client\RequestBuilder; - -/** - * Encapsulates Signifyd API protocol. - */ -class ApiClient -{ - /** - * @var RequestBuilder - */ - private $requestBuilder; - - /** - * ApiClient constructor. - * - * @param RequestBuilder $requestBuilder - */ - public function __construct( - RequestBuilder $requestBuilder - ) { - $this->requestBuilder = $requestBuilder; - } - - /** - * Perform call to Signifyd API. - * - * Method returns associative array that corresponds to successful result. - * Current implementation do not expose details in case of failure. - * - * @param string $url - * @param string $method - * @param array $params - * @param int|null $storeId - * @return array - */ - public function makeApiCall($url, $method, array $params = [], $storeId = null): array - { - $result = $this->requestBuilder->doRequest($url, $method, $params, $storeId); - - return $result; - } -} diff --git a/app/code/Magento/Signifyd/Model/SignifydGateway/Client/HttpClientFactory.php b/app/code/Magento/Signifyd/Model/SignifydGateway/Client/HttpClientFactory.php deleted file mode 100644 index 2a9b933b98b5d..0000000000000 --- a/app/code/Magento/Signifyd/Model/SignifydGateway/Client/HttpClientFactory.php +++ /dev/null @@ -1,146 +0,0 @@ -<?php -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ -namespace Magento\Signifyd\Model\SignifydGateway\Client; - -use Magento\Framework\HTTP\ZendClient; -use Magento\Framework\HTTP\ZendClientFactory; -use Magento\Framework\Json\EncoderInterface; -use Magento\Signifyd\Model\Config; - -/** - * Class HttpClientFactory - * Creates and configures HTTP client for RequestBuilder - */ -class HttpClientFactory -{ - /** - * Specifies basic HTTP access authentication Header. - * - * @var string - */ - private static $authorizationType = 'Authorization'; - - /** - * JSON HTTP Content-Type Header. - * - * @var string - */ - private static $jsonDataType = 'application/json'; - - /** - * @var string - */ - private static $urlSeparator = '/'; - - /** - * @var Config - */ - private $config; - - /** - * @var ZendClientFactory - */ - private $clientFactory; - - /** - * @var EncoderInterface - */ - private $dataEncoder; - - /** - * HttpClientCreator constructor. - * - * @param Config $config - * @param ZendClientFactory $clientFactory - * @param EncoderInterface $dataEncoder - */ - public function __construct( - Config $config, - ZendClientFactory $clientFactory, - EncoderInterface $dataEncoder - ) { - $this->config = $config; - $this->clientFactory = $clientFactory; - $this->dataEncoder = $dataEncoder; - } - - /** - * Creates and configures HTTP client. - * - * @param string $url - * @param string $method - * @param array $params - * @param int|null $storeId - * @return ZendClient - */ - public function create($url, $method, array $params = [], $storeId = null): ZendClient - { - $apiKey = $this->getApiKey($storeId); - $apiUrl = $this->buildFullApiUrl($url, $storeId); - - $client = $this->createNewClient(); - $client->setHeaders( - self::$authorizationType, - sprintf('Basic %s', base64_encode($apiKey)) - ); - if (!empty($params)) { - $encodedData = $this->dataEncoder->encode($params); - $client->setRawData($encodedData, self::$jsonDataType); - } - $client->setMethod($method); - $client->setUri($apiUrl); - - return $client; - } - - /** - * @return ZendClient - */ - private function createNewClient() - { - return $this->clientFactory->create(); - } - - /** - * Signifyd API key for merchant account. - * - * @see https://www.signifyd.com/docs/api/#/introduction/authentication - * @param int|null $storeId - * @return string - */ - private function getApiKey($storeId): string - { - return $this->config->getApiKey($storeId); - } - - /** - * Full URL for Singifyd API based on relative URL. - * - * @param string $url - * @param int|null $storeId - * @return string - */ - private function buildFullApiUrl($url, $storeId): string - { - $baseApiUrl = $this->getBaseApiUrl($storeId); - $fullUrl = $baseApiUrl . self::$urlSeparator . ltrim($url, self::$urlSeparator); - - return $fullUrl; - } - - /** - * Base Sigifyd API URL without trailing slash. - * - * @param int|null $storeId - * @return string - */ - private function getBaseApiUrl($storeId): string - { - $baseApiUrl = $this->config->getApiUrl($storeId); - - return rtrim($baseApiUrl, self::$urlSeparator); - } -} diff --git a/app/code/Magento/Signifyd/Model/SignifydGateway/Client/RequestBuilder.php b/app/code/Magento/Signifyd/Model/SignifydGateway/Client/RequestBuilder.php deleted file mode 100644 index ee079a74d345f..0000000000000 --- a/app/code/Magento/Signifyd/Model/SignifydGateway/Client/RequestBuilder.php +++ /dev/null @@ -1,63 +0,0 @@ -<?php -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ -namespace Magento\Signifyd\Model\SignifydGateway\Client; - -/** - * Class RequestBuilder - * Creates HTTP client, sends request to Signifyd and handles response - */ -class RequestBuilder -{ - /** - * @var HttpClientFactory - */ - private $clientCreator; - - /** - * @var RequestSender - */ - private $requestSender; - - /** - * @var ResponseHandler - */ - private $responseHandler; - - /** - * RequestBuilder constructor. - * - * @param HttpClientFactory $clientCreator - * @param RequestSender $requestSender - * @param ResponseHandler $responseHandler - */ - public function __construct( - HttpClientFactory $clientCreator, - RequestSender $requestSender, - ResponseHandler $responseHandler - ) { - $this->clientCreator = $clientCreator; - $this->requestSender = $requestSender; - $this->responseHandler = $responseHandler; - } - - /** - * Creates HTTP client for API call. - * - * @param string $url - * @param string $method - * @param array $params - * @param int|null $storeId - * @return array - */ - public function doRequest($url, $method, array $params = [], $storeId = null): array - { - $client = $this->clientCreator->create($url, $method, $params, $storeId); - $response = $this->requestSender->send($client, $storeId); - $result = $this->responseHandler->handle($response); - - return $result; - } -} diff --git a/app/code/Magento/Signifyd/Model/SignifydGateway/Client/RequestSender.php b/app/code/Magento/Signifyd/Model/SignifydGateway/Client/RequestSender.php deleted file mode 100644 index a63331e055c1c..0000000000000 --- a/app/code/Magento/Signifyd/Model/SignifydGateway/Client/RequestSender.php +++ /dev/null @@ -1,74 +0,0 @@ -<?php -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ -namespace Magento\Signifyd\Model\SignifydGateway\Client; - -use Magento\Signifyd\Model\SignifydGateway\Debugger\DebuggerFactory; -use Magento\Signifyd\Model\SignifydGateway\ApiCallException; -use Magento\Framework\HTTP\ZendClient; - -/** - * Class RequestSender - * Gets HTTP client end sends request to Signifyd API - */ -class RequestSender -{ - /** - * @var DebuggerFactory - */ - private $debuggerFactory; - - /** - * RequestSender constructor. - * - * @param DebuggerFactory $debuggerFactory - */ - public function __construct( - DebuggerFactory $debuggerFactory - ) { - $this->debuggerFactory = $debuggerFactory; - } - - /** - * Sends HTTP request to Signifyd API with configured client. - * - * Each request/response pair is handled by debugger. - * If debug mode for Signifyd integration enabled in configuration - * debug information is recorded to debug.log. - * - * @param ZendClient $client - * @param int|null $storeId - * @return \Zend_Http_Response - * @throws ApiCallException - */ - public function send(ZendClient $client, $storeId = null): \Zend_Http_Response - { - try { - $response = $client->request(); - - $this->debuggerFactory->create($storeId)->success( - $client->getUri(true), - $client->getLastRequest(), - $response->getStatus() . ' ' . $response->getMessage(), - $response->getBody() - ); - - return $response; - } catch (\Exception $e) { - $this->debuggerFactory->create($storeId)->failure( - $client->getUri(true), - $client->getLastRequest(), - $e - ); - - throw new ApiCallException( - 'Unable to process Signifyd API: ' . $e->getMessage(), - $e->getCode(), - $e, - $client->getLastRequest() - ); - } - } -} diff --git a/app/code/Magento/Signifyd/Model/SignifydGateway/Client/ResponseHandler.php b/app/code/Magento/Signifyd/Model/SignifydGateway/Client/ResponseHandler.php deleted file mode 100644 index 614e59b7c29a2..0000000000000 --- a/app/code/Magento/Signifyd/Model/SignifydGateway/Client/ResponseHandler.php +++ /dev/null @@ -1,124 +0,0 @@ -<?php -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ -namespace Magento\Signifyd\Model\SignifydGateway\Client; - -use Magento\Signifyd\Model\SignifydGateway\ApiCallException; -use Magento\Framework\Json\DecoderInterface; - -/** - * Class ResponseHandler - */ -class ResponseHandler -{ - /** - * Successful HTTP response codes. - * - * @var array - */ - private static $successResponseCodes = [200, 201, 204]; - - /** - * Current servers PHP version id. - */ - private static $phpVersionId = PHP_VERSION_ID; - - /** - * Failure HTTP response codes with messages. - * - * @var array - */ - private static $failureResponses = [ - 400 => 'Bad Request - The request could not be parsed. Response: %s', - 401 => 'Unauthorized - user is not logged in, could not be authenticated. Response: %s', - 403 => 'Forbidden - Cannot access resource. Response: %s', - 404 => 'Not Found - resource does not exist. Response: %s', - 409 => 'Conflict - with state of the resource on server. Can occur with (too rapid) PUT requests. Response: %s', - 500 => 'Server error. Response: %s' - ]; - - /** - * Unexpected Signifyd API response message. - * - * @var string - */ - private static $unexpectedResponse = 'Unexpected Signifyd API response code "%s" with content "%s".'; - - /** - * @var DecoderInterface - */ - private $dataDecoder; - - /** - * ResponseHandler constructor. - * - * @param DecoderInterface $dataDecoder - */ - public function __construct( - DecoderInterface $dataDecoder - ) { - $this->dataDecoder = $dataDecoder; - } - - /** - * Reads result of successful operation and throws exception in case of any failure. - * - * @param \Zend_Http_Response $response - * @return array - * @throws ApiCallException - */ - public function handle(\Zend_Http_Response $response) - { - $responseCode = $response->getStatus(); - - if (!in_array($responseCode, self::$successResponseCodes)) { - $errorMessage = $this->buildApiCallFailureMessage($response); - throw new ApiCallException($errorMessage); - } - - $responseBody = (string)$response->getBody(); - - if (self::$phpVersionId < 70000 && empty($responseBody)) { - /* - * Only since PHP 7.0 empty string treated as JSON syntax error - * http://php.net/manual/en/function.json-decode.php - */ - throw new ApiCallException('Response is not valid JSON: Decoding failed: Syntax error'); - } - - try { - $decodedResponseBody = $this->dataDecoder->decode($responseBody); - } catch (\Exception $e) { - throw new ApiCallException( - 'Response is not valid JSON: ' . $e->getMessage(), - $e->getCode(), - $e - ); - } - - return $decodedResponseBody; - } - - /** - * Error message for request rejected by Signify. - * - * @param \Zend_Http_Response $response - * @return string - */ - private function buildApiCallFailureMessage(\Zend_Http_Response $response) - { - $responseBody = $response->getBody(); - - if (key_exists($response->getStatus(), self::$failureResponses)) { - return sprintf(self::$failureResponses[$response->getStatus()], $responseBody); - } - - return sprintf( - self::$unexpectedResponse, - $response->getStatus(), - $responseBody - ); - } -} diff --git a/app/code/Magento/Signifyd/Model/SignifydGateway/Debugger/BlackHole.php b/app/code/Magento/Signifyd/Model/SignifydGateway/Debugger/BlackHole.php deleted file mode 100644 index 7057313b5e415..0000000000000 --- a/app/code/Magento/Signifyd/Model/SignifydGateway/Debugger/BlackHole.php +++ /dev/null @@ -1,33 +0,0 @@ -<?php -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ -namespace Magento\Signifyd\Model\SignifydGateway\Debugger; - -use Exception; - -/** - * This debugger ignores any information. - * Optimal production environment. - */ -class BlackHole implements DebuggerInterface -{ - /** - * {@inheritdoc} - * @SuppressWarnings(PHPMD.UnusedFormalParameter) - */ - public function success($requestUrl, $requestData, $responseStatus, $responseBody) - { - // ignore - } - - /** - * {@inheritdoc} - * @SuppressWarnings(PHPMD.UnusedFormalParameter) - */ - public function failure($requestUrl, $requestData, Exception $exception) - { - // ignore - } -} diff --git a/app/code/Magento/Signifyd/Model/SignifydGateway/Debugger/DebuggerFactory.php b/app/code/Magento/Signifyd/Model/SignifydGateway/Debugger/DebuggerFactory.php deleted file mode 100644 index 1e61a313899cc..0000000000000 --- a/app/code/Magento/Signifyd/Model/SignifydGateway/Debugger/DebuggerFactory.php +++ /dev/null @@ -1,58 +0,0 @@ -<?php -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ -namespace Magento\Signifyd\Model\SignifydGateway\Debugger; - -use Magento\Framework\ObjectManagerInterface; -use Magento\Signifyd\Model\Config; - -/** - * Factory produces debugger based on runtime configuration. - * - * Configuration may be changed by - * - config.xml - * - at Admin panel (Stores > Configuration > Sales > Fraud Detection > Signifyd > Debug) - */ -class DebuggerFactory -{ - /** - * @var ObjectManagerInterface - */ - private $objectManager; - - /** - * @var Config - */ - private $config; - - /** - * DebuggerFactory constructor. - * - * @param ObjectManagerInterface $objectManager - * @param Config $config - */ - public function __construct( - ObjectManagerInterface $objectManager, - Config $config - ) { - $this->objectManager = $objectManager; - $this->config = $config; - } - - /** - * Create debugger instance - * - * @param int|null $storeId - * @return DebuggerInterface - */ - public function create($storeId = null): DebuggerInterface - { - if (!$this->config->isDebugModeEnabled($storeId)) { - return $this->objectManager->get(BlackHole::class); - } - - return $this->objectManager->get(Log::class); - } -} diff --git a/app/code/Magento/Signifyd/Model/SignifydGateway/Debugger/DebuggerInterface.php b/app/code/Magento/Signifyd/Model/SignifydGateway/Debugger/DebuggerInterface.php deleted file mode 100644 index f4a2f9cc56a8f..0000000000000 --- a/app/code/Magento/Signifyd/Model/SignifydGateway/Debugger/DebuggerInterface.php +++ /dev/null @@ -1,35 +0,0 @@ -<?php -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ -namespace Magento\Signifyd\Model\SignifydGateway\Debugger; - -use Exception; - -/** - * Interface for debugging interaction with Signifyd API - */ -interface DebuggerInterface -{ - /** - * Register debug information about accepted request to Signifyd API - * - * @param string $requestUrl - * @param string $requestData - * @param string $responseStatus - * @param string $responseBody - * @return void - */ - public function success($requestUrl, $requestData, $responseStatus, $responseBody); - - /** - * Register debug information about failed request to Signifyd API - * - * @param string $requestUrl - * @param string $requestData - * @param Exception $exception - * @return mixed - */ - public function failure($requestUrl, $requestData, Exception $exception); -} diff --git a/app/code/Magento/Signifyd/Model/SignifydGateway/Debugger/Log.php b/app/code/Magento/Signifyd/Model/SignifydGateway/Debugger/Log.php deleted file mode 100644 index 4b7258180f53e..0000000000000 --- a/app/code/Magento/Signifyd/Model/SignifydGateway/Debugger/Log.php +++ /dev/null @@ -1,146 +0,0 @@ -<?php -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ -namespace Magento\Signifyd\Model\SignifydGateway\Debugger; - -use Psr\Log\LoggerInterface; -use Exception; - -/** - * Debugger writes information about request, response and possible exception to standard system log. - */ -class Log implements DebuggerInterface -{ - /** - * @var LoggerInterface - */ - private $logger; - - /** - * Log constructor. - * - * @param LoggerInterface $logger - */ - public function __construct(LoggerInterface $logger) - { - $this->logger = $logger; - } - - /** - * {@inheritdoc} - */ - public function success($requestUrl, $requestData, $responseStatus, $responseBody) - { - $requestInfo = $this->buildRequestInfo($requestUrl, $requestData); - $responseInfo = $this->buildResponseInfo($responseStatus, $responseBody); - - $info = $requestInfo - . $responseInfo; - - $this->writeToLog($info); - } - - /** - * {@inheritdoc} - */ - public function failure($requestUrl, $requestData, Exception $exception) - { - $requestInfo = $this->buildRequestInfo($requestUrl, $requestData); - $exceptionInfo = $this->buildExceptionInfo($exception); - - $info = $requestInfo - . $exceptionInfo; - - $this->writeToLog($info); - } - - /** - * Build string with request URL and body - * - * @param string $requestUrl - * @param string $requestData - * @return string - */ - private function buildRequestInfo($requestUrl, $requestData) - { - $infoContent = $this->buildInfoSection('URL', $requestUrl) - . $this->buildInfoSection('Body', $requestData); - - $info = $this->buildInfoSection('Request', $infoContent); - return $info; - } - - /** - * Build string with response status code and body - * - * @param string $responseStatus - * @param string $responseBody - * @return string - */ - private function buildResponseInfo($responseStatus, $responseBody) - { - $infoContent = $this->buildInfoSection('Status', $responseStatus) - . $this->buildInfoSection('Body', $responseBody); - - $info = $this->buildInfoSection('Response', $infoContent); - return $info; - } - - /** - * Build string with exception information - * - * @param Exception $exception - * @return string - */ - private function buildExceptionInfo(Exception $exception) - { - $infoContent = (string)$exception; - $info = $this->buildInfoSection('Exception', $infoContent); - return $info; - } - - /** - * Write debug information to log file (var/log/debug.log by default) - * - * @param string $info - * @return void - */ - private function writeToLog($info) - { - $logMessage = $this->buildInfoSection('Signifyd API integration debug info', $info); - $this->logger->debug($logMessage); - } - - /** - * Build unified debug section string - * - * @param string $title - * @param string $content - * @return string - */ - private function buildInfoSection($title, $content) - { - $formattedInfo = $title . ":\n" - . $this->addIndent($content) . "\n"; - return $formattedInfo; - } - - /** - * Add indent to each line in content - * - * @param string $content - * @param string $indent - * @return string - */ - private function addIndent($content, $indent = ' ') - { - $contentLines = explode("\n", $content); - $contentLinesWithIndent = array_map(function ($line) use ($indent) { - return $indent . $line; - }, $contentLines); - $content = implode("\n", $contentLinesWithIndent); - return $content; - } -} diff --git a/app/code/Magento/Signifyd/Model/SignifydGateway/Gateway.php b/app/code/Magento/Signifyd/Model/SignifydGateway/Gateway.php deleted file mode 100644 index 9f7a053c58724..0000000000000 --- a/app/code/Magento/Signifyd/Model/SignifydGateway/Gateway.php +++ /dev/null @@ -1,225 +0,0 @@ -<?php -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ -namespace Magento\Signifyd\Model\SignifydGateway; - -use Magento\Sales\Api\OrderRepositoryInterface; -use Magento\Signifyd\Api\CaseRepositoryInterface; -use Magento\Signifyd\Model\SignifydGateway\Request\CreateCaseBuilderInterface; - -/** - * Signifyd Gateway. - * - * Encapsulates interaction with Signifyd API. - */ -class Gateway -{ - /**#@+ - * Constants for case available statuses - */ - const STATUS_OPEN = 'OPEN'; - const STATUS_PROCESSING = 'PROCESSING'; - const STATUS_FLAGGED = 'FLAGGED'; - const STATUS_DISMISSED = 'DISMISSED'; - /**#@-*/ - - /**#@+ - * Constants for guarantee available statuses - * @see https://www.signifyd.com/resources/manual/signifyd-guarantee/signifyd-guarantee/ - */ - const GUARANTEE_APPROVED = 'APPROVED'; - const GUARANTEE_DECLINED = 'DECLINED'; - const GUARANTEE_PENDING = 'PENDING'; - const GUARANTEE_CANCELED = 'CANCELED'; - const GUARANTEE_IN_REVIEW = 'IN_REVIEW'; - const GUARANTEE_UNREQUESTED = 'UNREQUESTED'; - /**#@-*/ - - /**#@+ - * Constants for case available review dispositions - */ - const DISPOSITION_GOOD = 'GOOD'; - const DISPOSITION_FRAUDULENT = 'FRAUDULENT'; - const DISPOSITION_UNSET = 'UNSET'; - - /** - * @var CreateCaseBuilderInterface - */ - private $createCaseBuilder; - - /** - * @var ApiClient - */ - private $apiClient; - - /** - * @var OrderRepositoryInterface - */ - private $orderRepository; - - /** - * @var CaseRepositoryInterface - */ - private $caseRepository; - - /** - * Gateway constructor. - * - * @param CreateCaseBuilderInterface $createCaseBuilder - * @param ApiClient $apiClient - * @param OrderRepositoryInterface $orderRepository - * @param CaseRepositoryInterface $caseRepository - */ - public function __construct( - CreateCaseBuilderInterface $createCaseBuilder, - ApiClient $apiClient, - OrderRepositoryInterface $orderRepository, - CaseRepositoryInterface $caseRepository - ) { - $this->createCaseBuilder = $createCaseBuilder; - $this->apiClient = $apiClient; - $this->orderRepository = $orderRepository; - $this->caseRepository = $caseRepository; - } - - /** - * Returns id of created case (investigation) on Signifyd service - * @see https://www.signifyd.com/docs/api/#/reference/cases/create-a-case - * - * @param int $orderId - * @return int Signifyd case (investigation) identifier - * @throws GatewayException - */ - public function createCase($orderId) - { - $caseParams = $this->createCaseBuilder->build($orderId); - $storeId = $this->getStoreIdFromOrder($orderId); - - $caseCreationResult = $this->apiClient->makeApiCall( - '/cases', - 'POST', - $caseParams, - $storeId - ); - - if (!isset($caseCreationResult['investigationId'])) { - throw new GatewayException('Expected field "investigationId" missed.'); - } - - return (int)$caseCreationResult['investigationId']; - } - - /** - * Returns guaranty decision result - * @see https://www.signifyd.com/docs/api/#/reference/guarantees/submit-a-case-for-guarantee - * - * @param int $signifydCaseId - * @return string - * @throws GatewayException - */ - public function submitCaseForGuarantee($signifydCaseId) - { - $storeId = $this->getStoreIdFromCase($signifydCaseId); - $guaranteeCreationResult = $this->apiClient->makeApiCall( - '/guarantees', - 'POST', - [ - 'caseId' => $signifydCaseId, - ], - $storeId - ); - - $disposition = $this->processDispositionResult($guaranteeCreationResult); - return $disposition; - } - - /** - * Sends request to cancel guarantee and returns disposition. - * - * @see https://www.signifyd.com/docs/api/#/reference/guarantees/submit-a-case-for-guarantee/cancel-guarantee - * @param int $caseId - * @return string - * @throws GatewayException - */ - public function cancelGuarantee($caseId) - { - $storeId = $this->getStoreIdFromCase($caseId); - $result = $this->apiClient->makeApiCall( - '/cases/' . $caseId . '/guarantee', - 'PUT', - [ - 'guaranteeDisposition' => self::GUARANTEE_CANCELED - ], - $storeId - ); - - $disposition = $this->processDispositionResult($result); - if ($disposition !== self::GUARANTEE_CANCELED) { - throw new GatewayException("API returned unexpected disposition: $disposition."); - } - - return $disposition; - } - - /** - * Processes result from Signifyd API. - * Throws the GatewayException is result does not contain guarantee disposition in response or - * disposition has unknown status. - * - * @param array $result - * @return string - * @throws GatewayException - */ - private function processDispositionResult(array $result) - { - if (!isset($result['disposition'])) { - throw new GatewayException('Expected field "disposition" missed.'); - } - - $disposition = strtoupper($result['disposition']); - - if (!in_array($disposition, [ - self::GUARANTEE_APPROVED, - self::GUARANTEE_DECLINED, - self::GUARANTEE_PENDING, - self::GUARANTEE_CANCELED, - self::GUARANTEE_IN_REVIEW, - self::GUARANTEE_UNREQUESTED - ])) { - throw new GatewayException( - sprintf('API returns unknown guaranty disposition "%s".', $disposition) - ); - } - - return $disposition; - } - - /** - * Returns store id by case. - * - * @param int $caseId - * @return int|null - */ - private function getStoreIdFromCase(int $caseId) - { - $case = $this->caseRepository->getByCaseId($caseId); - $orderId = $case->getOrderId(); - - return $this->getStoreIdFromOrder($orderId); - } - - /** - * Returns store id from order. - * - * @param int $orderId - * @return int|null - */ - private function getStoreIdFromOrder(int $orderId) - { - $order = $this->orderRepository->get($orderId); - - return $order->getStoreId(); - } -} diff --git a/app/code/Magento/Signifyd/Model/SignifydGateway/GatewayException.php b/app/code/Magento/Signifyd/Model/SignifydGateway/GatewayException.php deleted file mode 100644 index 666217f8ccc85..0000000000000 --- a/app/code/Magento/Signifyd/Model/SignifydGateway/GatewayException.php +++ /dev/null @@ -1,14 +0,0 @@ -<?php -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ -namespace Magento\Signifyd\Model\SignifydGateway; - -/** - * Exception of interaction with Signifyd API - */ -class GatewayException extends \Exception -{ - -} diff --git a/app/code/Magento/Signifyd/Model/SignifydGateway/Request/AddressBuilder.php b/app/code/Magento/Signifyd/Model/SignifydGateway/Request/AddressBuilder.php deleted file mode 100644 index 482f243f6f05d..0000000000000 --- a/app/code/Magento/Signifyd/Model/SignifydGateway/Request/AddressBuilder.php +++ /dev/null @@ -1,46 +0,0 @@ -<?php -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ -namespace Magento\Signifyd\Model\SignifydGateway\Request; - -use Magento\Sales\Api\Data\OrderAddressInterface; - -/** - * Prepare address data - */ -class AddressBuilder -{ - /** - * Returns address data params based on OrderAddressInterface - * - * @param OrderAddressInterface $address - * @return array - */ - public function build(OrderAddressInterface $address) - { - return [ - 'streetAddress' => $this->getStreetLine(1, $address->getStreet()), - 'unit' => $this->getStreetLine(2, $address->getStreet()), - 'city' => $address->getCity(), - 'provinceCode' => $address->getRegionCode(), - 'postalCode' => $address->getPostcode(), - 'countryCode' => $address->getCountryId() - ]; - } - - /** - * Get street line by number - * - * @param int $number - * @param string[]|null $street - * @return string - */ - private function getStreetLine($number, $street) - { - $lines = is_array($street) ? $street : []; - - return $lines[$number - 1] ?? ''; - } -} diff --git a/app/code/Magento/Signifyd/Model/SignifydGateway/Request/CardBuilder.php b/app/code/Magento/Signifyd/Model/SignifydGateway/Request/CardBuilder.php deleted file mode 100644 index 5e3a1a83e7aeb..0000000000000 --- a/app/code/Magento/Signifyd/Model/SignifydGateway/Request/CardBuilder.php +++ /dev/null @@ -1,56 +0,0 @@ -<?php -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ -namespace Magento\Signifyd\Model\SignifydGateway\Request; - -use Magento\Sales\Model\Order; - -/** - * Prepare data related to the card that was used for the purchase and its cardholder. - */ -class CardBuilder -{ - /** - * @var AddressBuilder - */ - private $addressBuilder; - - /** - * @param AddressBuilder $addressBuilder - */ - public function __construct( - AddressBuilder $addressBuilder - ) { - $this->addressBuilder = $addressBuilder; - } - - /** - * Returns card data params based on payment and billing address info - * - * @param Order $order - * @return array - */ - public function build(Order $order) - { - $result = []; - $address = $order->getBillingAddress(); - if ($address === null) { - return $result; - } - - $payment = $order->getPayment(); - $result = [ - 'card' => [ - 'cardHolderName' => $address->getFirstname() . ' ' . $address->getLastname(), - 'last4' => $payment->getCcLast4(), - 'expiryMonth' => $payment->getCcExpMonth(), - 'expiryYear' => $payment->getCcExpYear(), - 'billingAddress' => $this->addressBuilder->build($address) - ] - ]; - - return $result; - } -} diff --git a/app/code/Magento/Signifyd/Model/SignifydGateway/Request/ClientVersionBuilder.php b/app/code/Magento/Signifyd/Model/SignifydGateway/Request/ClientVersionBuilder.php deleted file mode 100644 index 8db06473b96d8..0000000000000 --- a/app/code/Magento/Signifyd/Model/SignifydGateway/Request/ClientVersionBuilder.php +++ /dev/null @@ -1,50 +0,0 @@ -<?php -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ -namespace Magento\Signifyd\Model\SignifydGateway\Request; - -use Magento\Framework\App\ProductMetadataInterface; - -/** - * Provides platform name, edition and version info - */ -class ClientVersionBuilder -{ - /** - * @var string - */ - private static $clientVersion = '1.0'; - - /** - * @var ProductMetadataInterface - */ - private $productMetadata; - - /** - * @param ProductMetadataInterface $productMetadata - */ - public function __construct( - ProductMetadataInterface $productMetadata - ) { - $this->productMetadata = $productMetadata; - } - - /** - * Returns version info - * - * @return array - */ - public function build() - { - return [ - 'platformAndClient' => [ - 'storePlatform' => $this->productMetadata->getName() . ' ' . $this->productMetadata->getEdition(), - 'storePlatformVersion' => $this->productMetadata->getVersion(), - 'signifydClientApp' => $this->productMetadata->getName(), - 'signifydClientAppVersion' => self::$clientVersion, - ] - ]; - } -} diff --git a/app/code/Magento/Signifyd/Model/SignifydGateway/Request/CreateCaseBuilder.php b/app/code/Magento/Signifyd/Model/SignifydGateway/Request/CreateCaseBuilder.php deleted file mode 100644 index 3e41003d47842..0000000000000 --- a/app/code/Magento/Signifyd/Model/SignifydGateway/Request/CreateCaseBuilder.php +++ /dev/null @@ -1,131 +0,0 @@ -<?php -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ -namespace Magento\Signifyd\Model\SignifydGateway\Request; - -use Magento\Sales\Model\OrderFactory; - -/** - * Signifyd case creation request builder. - * - * Handles the conversion from Magento Order to Signifyd Case. - * @SuppressWarnings(PHPMD.CouplingBetweenObjects) - */ -class CreateCaseBuilder implements CreateCaseBuilderInterface -{ - /** - * @var OrderFactory - */ - private $orderFactory; - - /** - * @var PurchaseBuilder - */ - private $purchaseBuilder; - - /** - * @var CardBuilder - */ - private $cardBuilder; - - /** - * @var RecipientBuilder - */ - private $recipientBuilder; - - /** - * @var SellerBuilder - */ - private $sellerBuilder; - - /** - * @var ClientVersionBuilder - */ - private $clientVersionBuilder; - - /** - * @var UserAccountBuilder - */ - private $userAccountBuilder; - - /** - * @param OrderFactory $orderFactory - * @param PurchaseBuilder $purchaseBuilder - * @param CardBuilder $cardBuilder - * @param RecipientBuilder $recipientBuilder - * @param SellerBuilder $sellerBuilder - * @param ClientVersionBuilder $clientVersionBuilder - * @param UserAccountBuilder $userAccountBuilder - */ - public function __construct( - OrderFactory $orderFactory, - PurchaseBuilder $purchaseBuilder, - CardBuilder $cardBuilder, - RecipientBuilder $recipientBuilder, - SellerBuilder $sellerBuilder, - ClientVersionBuilder $clientVersionBuilder, - UserAccountBuilder $userAccountBuilder - ) { - $this->orderFactory = $orderFactory; - $this->purchaseBuilder = $purchaseBuilder; - $this->cardBuilder = $cardBuilder; - $this->recipientBuilder = $recipientBuilder; - $this->sellerBuilder = $sellerBuilder; - $this->clientVersionBuilder = $clientVersionBuilder; - $this->userAccountBuilder = $userAccountBuilder; - } - - /** - * @inheritdoc - */ - public function build($orderId) - { - /* @var $order \Magento\Sales\Model\Order */ - $order = $this->orderFactory->create()->load($orderId); - - return $this->removeEmptyValues( - array_merge( - $this->purchaseBuilder->build($order), - $this->cardBuilder->build($order), - $this->recipientBuilder->build($order), - $this->userAccountBuilder->build($order), - $this->sellerBuilder->build($order), - $this->clientVersionBuilder->build() - ) - ); - } - - /** - * Remove empty and null values. - * - * @param array $data - * @return array - */ - private function removeEmptyValues($data) - { - foreach ($data as $key => $value) { - if (is_array($value)) { - $data[$key] = $this->removeEmptyValues($data[$key]); - } - - if ($this->isEmpty($data[$key])) { - unset($data[$key]); - } - } - - return $data; - } - - /** - * Empty values are null, empty string and empty array. - * - * @param mixed $value - * @return bool - */ - private function isEmpty($value) - { - return $value === null || (is_array($value) && empty($value)); - } -} diff --git a/app/code/Magento/Signifyd/Model/SignifydGateway/Request/CreateCaseBuilderInterface.php b/app/code/Magento/Signifyd/Model/SignifydGateway/Request/CreateCaseBuilderInterface.php deleted file mode 100644 index 56662f69e7c5a..0000000000000 --- a/app/code/Magento/Signifyd/Model/SignifydGateway/Request/CreateCaseBuilderInterface.php +++ /dev/null @@ -1,22 +0,0 @@ -<?php -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ -namespace Magento\Signifyd\Model\SignifydGateway\Request; - -/** - * Collects information about order and build array with parameters required by Signifyd API - * - * @see https://www.signifyd.com/docs/api/#/reference/cases/create-a-case - */ -interface CreateCaseBuilderInterface -{ - /** - * Returns params for Case creation request - * - * @param int $orderId - * @return array - */ - public function build($orderId); -} diff --git a/app/code/Magento/Signifyd/Model/SignifydGateway/Request/PurchaseBuilder.php b/app/code/Magento/Signifyd/Model/SignifydGateway/Request/PurchaseBuilder.php deleted file mode 100644 index 5e544e4b4048e..0000000000000 --- a/app/code/Magento/Signifyd/Model/SignifydGateway/Request/PurchaseBuilder.php +++ /dev/null @@ -1,227 +0,0 @@ -<?php -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ -namespace Magento\Signifyd\Model\SignifydGateway\Request; - -use Magento\Framework\App\Area; -use Magento\Framework\Config\ScopeInterface; -use Magento\Framework\Exception\ConfigurationMismatchException; -use Magento\Framework\Intl\DateTimeFactory; -use Magento\Sales\Api\Data\OrderPaymentInterface; -use Magento\Sales\Model\Order; -use Magento\Signifyd\Model\PaymentMethodMapper\PaymentMethodMapper; -use Magento\Signifyd\Model\PaymentVerificationFactory; -use Magento\Signifyd\Model\SignifydOrderSessionId; - -/** - * Prepare data related to purchase event represented in case creation request. - */ -class PurchaseBuilder -{ - /** - * @var DateTimeFactory - */ - private $dateTimeFactory; - - /** - * @var ScopeInterface - */ - private $scope; - - /** - * @var SignifydOrderSessionId - */ - private $signifydOrderSessionId; - - /** - * @var PaymentVerificationFactory - */ - private $paymentVerificationFactory; - - /** - * @var PaymentMethodMapper - */ - private $paymentMethodMapper; - - /** - * PurchaseBuilder constructor. - * - * @param DateTimeFactory $dateTimeFactory - * @param ScopeInterface $scope - * @param SignifydOrderSessionId $signifydOrderSessionId - * @param PaymentVerificationFactory $paymentVerificationFactory - * @param PaymentMethodMapper $paymentMethodMapper - */ - public function __construct( - DateTimeFactory $dateTimeFactory, - ScopeInterface $scope, - SignifydOrderSessionId $signifydOrderSessionId, - PaymentVerificationFactory $paymentVerificationFactory, - PaymentMethodMapper $paymentMethodMapper - ) { - $this->dateTimeFactory = $dateTimeFactory; - $this->scope = $scope; - $this->signifydOrderSessionId = $signifydOrderSessionId; - $this->paymentVerificationFactory = $paymentVerificationFactory; - $this->paymentMethodMapper = $paymentMethodMapper; - } - - /** - * Returns purchase data params - * - * @param Order $order - * @return array - * @throws ConfigurationMismatchException - */ - public function build(Order $order) - { - $orderPayment = $order->getPayment(); - $createdAt = $this->dateTimeFactory->create( - $order->getCreatedAt(), - new \DateTimeZone('UTC') - ); - - $result = [ - 'purchase' => [ - 'orderSessionId' => $this->signifydOrderSessionId->get($order->getQuoteId()), - 'browserIpAddress' => $order->getRemoteIp(), - 'orderId' => $order->getIncrementId(), - 'createdAt' => $createdAt->format(\DateTime::ATOM), - 'paymentGateway' => $this->getPaymentGateway($orderPayment->getMethod()), - 'transactionId' => $orderPayment->getLastTransId(), - 'currency' => $order->getOrderCurrencyCode(), - 'avsResponseCode' => $this->getAvsCode($orderPayment), - 'cvvResponseCode' => $this->getCvvCode($orderPayment), - 'orderChannel' => $this->getOrderChannel(), - 'totalPrice' => $order->getGrandTotal(), - 'paymentMethod' => $this->paymentMethodMapper - ->getSignifydPaymentMethodCode($orderPayment->getMethod()) - ], - ]; - - $shippingDescription = $order->getShippingDescription(); - if ($shippingDescription !== null) { - $result['purchase']['shipments'] = [ - [ - 'shipper' => $this->getShipper($order->getShippingDescription()), - 'shippingMethod' => $this->getShippingMethod($order->getShippingDescription()), - 'shippingPrice' => $order->getShippingAmount() - ] - ]; - } - - $products = $this->getProducts($order); - if (!empty($products)) { - $result['purchase']['products'] = $products; - } - - return $result; - } - - /** - * Returns the products purchased in the transaction. - * - * @param Order $order - * @return array - */ - private function getProducts(Order $order) - { - $result = []; - foreach ($order->getAllItems() as $orderItem) { - $result[] = [ - 'itemId' => $orderItem->getSku(), - 'itemName' => $orderItem->getName(), - 'itemPrice' => $orderItem->getPrice(), - 'itemQuantity' => (int)$orderItem->getQtyOrdered(), - 'itemUrl' => $orderItem->getProduct()->getProductUrl(), - 'itemWeight' => $orderItem->getProduct()->getWeight() - ]; - } - - return $result; - } - - /** - * Returns the name of the shipper - * - * @param string $shippingDescription - * @return string - */ - private function getShipper($shippingDescription) - { - $result = explode(' - ', $shippingDescription, 2); - - return count($result) == 2 ? $result[0] : ''; - } - - /** - * Returns the type of the shipment method used - * - * @param string $shippingDescription - * @return string - */ - private function getShippingMethod($shippingDescription) - { - $result = explode(' - ', $shippingDescription, 2); - - return count($result) == 2 ? $result[1] : ''; - } - - /** - * Returns the gateway that processed the transaction. For PayPal orders should be paypal_account. - * - * @param string $gatewayCode - * @return string - */ - private function getPaymentGateway($gatewayCode) - { - $payPalCodeList = [ - 'paypal_express', - 'braintree_paypal', - 'payflowpro', - 'payflow_express', - 'payflow_link', - 'payflow_advanced', - 'hosted_pro', - ]; - return in_array($gatewayCode, $payPalCodeList) ? 'paypal_account' : $gatewayCode; - } - - /** - * Returns WEB for web-orders, PHONE for orders created by Admin - * - * @return string - */ - private function getOrderChannel() - { - return $this->scope->getCurrentScope() === Area::AREA_ADMINHTML ? 'PHONE' : 'WEB'; - } - - /** - * Gets AVS code for order payment method. - * - * @param OrderPaymentInterface $orderPayment - * @return string - * @throws ConfigurationMismatchException - */ - private function getAvsCode(OrderPaymentInterface $orderPayment) - { - $avsAdapter = $this->paymentVerificationFactory->createPaymentAvs($orderPayment->getMethod()); - return $avsAdapter->getCode($orderPayment); - } - - /** - * Gets CVV code for order payment method. - * - * @param OrderPaymentInterface $orderPayment - * @return string - * @throws ConfigurationMismatchException - */ - private function getCvvCode(OrderPaymentInterface $orderPayment) - { - $cvvAdapter = $this->paymentVerificationFactory->createPaymentCvv($orderPayment->getMethod()); - return $cvvAdapter->getCode($orderPayment); - } -} diff --git a/app/code/Magento/Signifyd/Model/SignifydGateway/Request/RecipientBuilder.php b/app/code/Magento/Signifyd/Model/SignifydGateway/Request/RecipientBuilder.php deleted file mode 100644 index d9d26c8943b88..0000000000000 --- a/app/code/Magento/Signifyd/Model/SignifydGateway/Request/RecipientBuilder.php +++ /dev/null @@ -1,55 +0,0 @@ -<?php -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ -namespace Magento\Signifyd\Model\SignifydGateway\Request; - -use Magento\Sales\Model\Order; - -/** - * Prepare data related to person or organization receiving the items purchased - */ -class RecipientBuilder -{ - /** - * @var AddressBuilder - */ - private $addressBuilder; - - /** - * @param AddressBuilder $addressBuilder - */ - public function __construct( - AddressBuilder $addressBuilder - ) { - $this->addressBuilder = $addressBuilder; - } - - /** - * Returns recipient data params based on shipping address - * - * @param Order $order - * @return array - */ - public function build(Order $order) - { - $result = []; - $address = $order->getShippingAddress(); - if ($address === null) { - return $result; - } - - $result = [ - 'recipient' => [ - 'fullName' => $address->getName(), - 'confirmationEmail' => $address->getEmail(), - 'confirmationPhone' => $address->getTelephone(), - 'organization' => $address->getCompany(), - 'deliveryAddress' => $this->addressBuilder->build($address) - ] - ]; - - return $result; - } -} diff --git a/app/code/Magento/Signifyd/Model/SignifydGateway/Request/SellerBuilder.php b/app/code/Magento/Signifyd/Model/SignifydGateway/Request/SellerBuilder.php deleted file mode 100644 index b2cf0401b247f..0000000000000 --- a/app/code/Magento/Signifyd/Model/SignifydGateway/Request/SellerBuilder.php +++ /dev/null @@ -1,136 +0,0 @@ -<?php -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ -namespace Magento\Signifyd\Model\SignifydGateway\Request; - -use Magento\Directory\Model\RegionFactory; -use Magento\Framework\App\Config\ScopeConfigInterface; -use Magento\Sales\Model\Order; -use Magento\Sales\Model\Order\Shipment; -use Magento\Store\Api\Data\StoreInterface; -use Magento\Store\Model\Information; -use Magento\Store\Model\ScopeInterface; - -/** - * Prepare data related to the seller of the product. - * - * This information is optional unless you are operating a marketplace, - * listing goods on behalf of multiple sellers who each hold a seller account registered with your site. - */ -class SellerBuilder -{ - /** - * @var ScopeConfigInterface - */ - private $scopeConfig; - - /** - * @var RegionFactory - */ - private $regionFactory; - - /** - * @var array - */ - private $regionCodes = []; - - /** - * @param ScopeConfigInterface $scopeConfig - * @param RegionFactory $regionFactory - */ - public function __construct( - ScopeConfigInterface $scopeConfig, - RegionFactory $regionFactory - ) { - $this->scopeConfig = $scopeConfig; - $this->regionFactory = $regionFactory; - } - - /** - * Returns seller data params - * - * @param Order $order - * @return array - */ - public function build(Order $order) - { - $store = $order->getStore(); - - return [ - 'seller' => [ - 'name' => $this->getConfigValue(Information::XML_PATH_STORE_INFO_NAME, $store), - 'domain' => $this->getPublicDomain($store), - 'shipFromAddress' => [ - 'streetAddress' => $this->getConfigValue(Shipment::XML_PATH_STORE_ADDRESS1, $store), - 'unit' => $this->getConfigValue(Shipment::XML_PATH_STORE_ADDRESS2, $store), - 'city' => $this->getConfigValue(Shipment::XML_PATH_STORE_CITY, $store), - 'provinceCode' => $this->getRegionCodeById( - $this->getConfigValue(Shipment::XML_PATH_STORE_REGION_ID, $store) - ), - 'postalCode' => $this->getConfigValue(Shipment::XML_PATH_STORE_ZIP, $store), - 'countryCode' => $this->getConfigValue(Shipment::XML_PATH_STORE_COUNTRY_ID, $store), - ], - 'corporateAddress' => [ - 'streetAddress' => $this->getConfigValue(Information::XML_PATH_STORE_INFO_STREET_LINE1, $store), - 'unit' => $this->getConfigValue(Information::XML_PATH_STORE_INFO_STREET_LINE2, $store), - 'city' => $this->getConfigValue(Information::XML_PATH_STORE_INFO_CITY, $store), - 'provinceCode' => $this->getRegionCodeById( - $this->getConfigValue(Information::XML_PATH_STORE_INFO_REGION_CODE, $store) - ), - 'postalCode' => $this->getConfigValue(Information::XML_PATH_STORE_INFO_POSTCODE, $store), - 'countryCode' => $this->getConfigValue(Information::XML_PATH_STORE_INFO_COUNTRY_CODE, $store), - ] - ] - ]; - } - - /** - * Returns region code by id - * - * @param int $regionId - * @return string - */ - private function getRegionCodeById($regionId) - { - if (!isset($this->regionCodes[$regionId])) { - $this->regionCodes[$regionId] = $this->regionFactory->create()->load($regionId)->getCode(); - } - - return $this->regionCodes[$regionId]; - } - - /** - * Returns value from config - * - * @param string $value - * @param StoreInterface $store - * @return mixed - */ - private function getConfigValue($value, StoreInterface $store) - { - return $this->scopeConfig->getValue( - $value, - ScopeInterface::SCOPE_STORE, - $store - ); - } - - /** - * Returns public domain name - * - * @param StoreInterface $store - * @return string|null null if no DNS records corresponding to a current host found - */ - private function getPublicDomain(StoreInterface $store) - { - $baseUrl = $store->getBaseUrl(); - $domain = parse_url($baseUrl, PHP_URL_HOST); - if (\function_exists('checkdnsrr') && false === \checkdnsrr($domain)) { - return null; - } - - return $domain; - } -} diff --git a/app/code/Magento/Signifyd/Model/SignifydGateway/Request/UserAccountBuilder.php b/app/code/Magento/Signifyd/Model/SignifydGateway/Request/UserAccountBuilder.php deleted file mode 100644 index 0da49b85da869..0000000000000 --- a/app/code/Magento/Signifyd/Model/SignifydGateway/Request/UserAccountBuilder.php +++ /dev/null @@ -1,100 +0,0 @@ -<?php -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ -namespace Magento\Signifyd\Model\SignifydGateway\Request; - -use Magento\Sales\Model\Order; -use Magento\Signifyd\Model\CustomerOrders; - -/** - * Prepares details based on registered user account info - */ -class UserAccountBuilder -{ - /** - * @var \Magento\Customer\Api\CustomerRepositoryInterface - */ - private $customerRepository; - - /** - * @var \Magento\Framework\Intl\DateTimeFactory - */ - private $dateTimeFactory; - - /** - * @var CustomerOrders - */ - private $customerOrders; - - /** - * @param \Magento\Customer\Api\CustomerRepositoryInterface $customerRepository - * @param CustomerOrders $customerOrders - * @param \Magento\Framework\Intl\DateTimeFactory $dateTimeFactory - */ - public function __construct( - \Magento\Customer\Api\CustomerRepositoryInterface $customerRepository, - CustomerOrders $customerOrders, - \Magento\Framework\Intl\DateTimeFactory $dateTimeFactory - ) { - $this->customerRepository = $customerRepository; - $this->dateTimeFactory = $dateTimeFactory; - $this->customerOrders = $customerOrders; - } - - /** - * Returns user account data params. - * Only for registered customers. - * - * @param Order $order - * @return array - */ - public function build(Order $order) - { - $result = []; - - $customerId = $order->getCustomerId(); - if (null === $customerId) { - return $result; - } - - $customer = $this->customerRepository->getById($customerId); - $result = [ - 'userAccount' => [ - 'email' => $customer->getEmail(), - 'username' => $customer->getEmail(), - 'phone' => $order->getBillingAddress()->getTelephone(), - 'accountNumber' => $customerId, - 'createdDate' => $this->formatDate($customer->getCreatedAt()), - 'lastUpdateDate' => $this->formatDate($customer->getUpdatedAt()) - ] - ]; - - $ordersInfo = $this->customerOrders->getAggregatedOrdersInfo($customerId); - if (isset($ordersInfo['aggregateOrderCount'])) { - $result['userAccount']['aggregateOrderCount'] = $ordersInfo['aggregateOrderCount']; - } - if (isset($ordersInfo['aggregateOrderDollars'])) { - $result['userAccount']['aggregateOrderDollars'] = $ordersInfo['aggregateOrderDollars']; - } - - return $result; - } - - /** - * Returns date formatted according to ISO8601. - * - * @param string $date - * @return string - */ - private function formatDate($date) - { - $result = $this->dateTimeFactory->create( - $date, - new \DateTimeZone('UTC') - ); - - return $result->format(\DateTime::ATOM); - } -} diff --git a/app/code/Magento/Signifyd/Model/SignifydGateway/Response/WebhookMessage.php b/app/code/Magento/Signifyd/Model/SignifydGateway/Response/WebhookMessage.php deleted file mode 100644 index f77db737473c0..0000000000000 --- a/app/code/Magento/Signifyd/Model/SignifydGateway/Response/WebhookMessage.php +++ /dev/null @@ -1,64 +0,0 @@ -<?php -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ -namespace Magento\Signifyd\Model\SignifydGateway\Response; - -/** - * Webhooks are messages sent by SIGNIFYD via HTTP POST to a url you configure on your - * Notifications page in the SIGNIFYD settings. - * - * WebhookMessage messages are sent when certain events occur in the life of an investigation. - * They allow your application to receive pushed updates about a case, rather than poll SIGNIFYD for status changes. - * - * @see https://www.signifyd.com/docs/api/#/reference/webhooks - */ -class WebhookMessage -{ - /** - * Decoded webhook request body. - * - * @var array - */ - private $data; - - /** - * Event topic identifier. - * - * @var string - */ - private $eventTopic; - - /** - * @param array $data - * @param string $eventTopic - */ - public function __construct( - array $data, - $eventTopic - ) { - $this->data = $data; - $this->eventTopic = $eventTopic; - } - - /** - * Returns decoded webhook request body. - * - * @return array - */ - public function getData() - { - return $this->data; - } - - /** - * Returns event topic identifier. - * - * @return string - */ - public function getEventTopic() - { - return $this->eventTopic; - } -} diff --git a/app/code/Magento/Signifyd/Model/SignifydGateway/Response/WebhookMessageReader.php b/app/code/Magento/Signifyd/Model/SignifydGateway/Response/WebhookMessageReader.php deleted file mode 100644 index 50389102359b1..0000000000000 --- a/app/code/Magento/Signifyd/Model/SignifydGateway/Response/WebhookMessageReader.php +++ /dev/null @@ -1,65 +0,0 @@ -<?php -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ -namespace Magento\Signifyd\Model\SignifydGateway\Response; - -use Magento\Framework\Json\DecoderInterface; - -/** - * Reads request and produces webhook message data object based on request params. - */ -class WebhookMessageReader -{ - /** - * @var DecoderInterface - */ - private $dataDecoder; - - /** - * @var WebhookMessageFactory - */ - private $webhookMessageFactory; - - /** - * @param DecoderInterface $decoder - * @param WebhookMessageFactory $webhookMessageFactory - */ - public function __construct( - DecoderInterface $decoder, - WebhookMessageFactory $webhookMessageFactory - ) { - $this->dataDecoder = $decoder; - $this->webhookMessageFactory = $webhookMessageFactory; - } - - /** - * Returns webhook message data object. - * - * @param WebhookRequest $request - * @return WebhookMessage - * @throws \InvalidArgumentException - */ - public function read(WebhookRequest $request) - { - try { - $decodedData = $this->dataDecoder->decode($request->getBody()); - } catch (\Exception $e) { - throw new \InvalidArgumentException( - 'Webhook request body is not valid JSON: ' . $e->getMessage(), - $e->getCode(), - $e - ); - } - - $webhookMessage = $this->webhookMessageFactory->create( - [ - 'data' => $decodedData, - 'eventTopic' => $request->getEventTopic() - ] - ); - - return $webhookMessage; - } -} diff --git a/app/code/Magento/Signifyd/Model/SignifydGateway/Response/WebhookRequest.php b/app/code/Magento/Signifyd/Model/SignifydGateway/Response/WebhookRequest.php deleted file mode 100644 index 214ccf0eeb70f..0000000000000 --- a/app/code/Magento/Signifyd/Model/SignifydGateway/Response/WebhookRequest.php +++ /dev/null @@ -1,58 +0,0 @@ -<?php -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ -namespace Magento\Signifyd\Model\SignifydGateway\Response; - -use Magento\Framework\App\Request\Http; - -/** - * Reads Signifyd webhook request data. - */ -class WebhookRequest -{ - /** - * @var Http - */ - private $request; - - /** - * @param Http $request - */ - public function __construct( - Http $request - ) { - $this->request = $request; - } - - /** - * Returns Base64 encoded output of the HMAC SHA256 encoding of the JSON body of the message. - * - * @return string - */ - public function getHash() - { - return (string)$this->request->getHeader('X-SIGNIFYD-SEC-HMAC-SHA256'); - } - - /** - * Returns event topic identifier. - * - * @return string - */ - public function getEventTopic() - { - return (string)$this->request->getHeader('X-SIGNIFYD-TOPIC'); - } - - /** - * Returns raw data from the request body. - * - * @return string - */ - public function getBody() - { - return (string)$this->request->getContent(); - } -} diff --git a/app/code/Magento/Signifyd/Model/SignifydGateway/Response/WebhookRequestValidator.php b/app/code/Magento/Signifyd/Model/SignifydGateway/Response/WebhookRequestValidator.php deleted file mode 100644 index 274ef2f854684..0000000000000 --- a/app/code/Magento/Signifyd/Model/SignifydGateway/Response/WebhookRequestValidator.php +++ /dev/null @@ -1,113 +0,0 @@ -<?php -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ -namespace Magento\Signifyd\Model\SignifydGateway\Response; - -use Magento\Framework\Json\DecoderInterface; -use Magento\Signifyd\Model\Config; - -/** - * Validates webhook request. - * - */ -class WebhookRequestValidator -{ - /** - * Allowed topic identifiers which will be sent in the X-SIGNIFYD-TOPIC header of the webhook. - * - * @var array - */ - private $allowedTopicValues = [ - 'cases/creation', - 'cases/rescore', - 'cases/review', - 'guarantees/completion', - 'cases/test' - ]; - - /** - * @var Config - */ - private $config; - - /** - * @var DecoderInterface - */ - private $decoder; - - /** - * @param Config $config - * @param DecoderInterface $decoder - */ - public function __construct( - Config $config, - DecoderInterface $decoder - ) { - $this->config = $config; - $this->decoder = $decoder; - } - - /** - * Validates webhook request. - * - * @param WebhookRequest $webhookRequest - * @return bool - */ - public function validate(WebhookRequest $webhookRequest) - { - $body = $webhookRequest->getBody(); - $eventTopic = $webhookRequest->getEventTopic(); - $hash = $webhookRequest->getHash(); - - return $this->isValidTopic($eventTopic) - && $this->isValidBody($body) - && $this->isValidHash($eventTopic, $body, $hash); - } - - /** - * Checks if value of topic identifier is in allowed list - * - * @param string $topic topic identifier. - * @return bool - */ - private function isValidTopic($topic) - { - return in_array($topic, $this->allowedTopicValues); - } - - /** - * Verifies a webhook request body is valid JSON and not empty. - * - * @param string $body - * @return bool - */ - private function isValidBody($body) - { - try { - $decodedBody = $this->decoder->decode($body); - } catch (\Exception $e) { - return false; - } - - return !empty($decodedBody); - } - - /** - * Verifies a webhook request has in fact come from SIGNIFYD. - * - * @param string $eventTopic - * @param string $body - * @param string $hash - * @return bool - */ - private function isValidHash($eventTopic, $body, $hash) - { - // In the case that this is a webhook test, the encoding ABCDE is allowed - $apiKey = $eventTopic == 'cases/test' ? 'ABCDE' : $this->config->getApiKey(); - $actualHash = base64_encode(hash_hmac('sha256', $body, $apiKey, true)); - - return $hash === $actualHash; - } -} diff --git a/app/code/Magento/Signifyd/Model/SignifydOrderSessionId.php b/app/code/Magento/Signifyd/Model/SignifydOrderSessionId.php deleted file mode 100644 index 52746bc4ec6c5..0000000000000 --- a/app/code/Magento/Signifyd/Model/SignifydOrderSessionId.php +++ /dev/null @@ -1,39 +0,0 @@ -<?php -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ -namespace Magento\Signifyd\Model; - -use Magento\Framework\DataObject\IdentityGeneratorInterface; - -/** - * Encapsulates generation of uuid by quote id. - */ -class SignifydOrderSessionId -{ - /** - * @var IdentityGeneratorInterface - */ - private $identityGenerator; - - /** - * @param IdentityGeneratorInterface $identityGenerator - */ - public function __construct( - IdentityGeneratorInterface $identityGenerator - ) { - $this->identityGenerator = $identityGenerator; - } - - /** - * Returns unique identifier through generation uuid by quote id. - * - * @param int $quoteId - * @return string - */ - public function get($quoteId) - { - return $this->identityGenerator->generateIdForData($quoteId); - } -} diff --git a/app/code/Magento/Signifyd/Observer/PlaceOrder.php b/app/code/Magento/Signifyd/Observer/PlaceOrder.php deleted file mode 100644 index 7c451a129cccd..0000000000000 --- a/app/code/Magento/Signifyd/Observer/PlaceOrder.php +++ /dev/null @@ -1,112 +0,0 @@ -<?php -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ -namespace Magento\Signifyd\Observer; - -use Magento\Framework\Event; -use Magento\Framework\Event\Observer; -use Magento\Framework\Event\ObserverInterface; -use Magento\Framework\Exception\AlreadyExistsException; -use Magento\Sales\Api\Data\OrderInterface; -use Magento\Sales\Model\Order; -use Magento\Signifyd\Api\CaseCreationServiceInterface; -use Magento\Signifyd\Model\Config; -use Psr\Log\LoggerInterface; - -/** - * Observer should be triggered when new order is created and placed. - * If Signifyd integration enabled in configuration then new case will be created. - */ -class PlaceOrder implements ObserverInterface -{ - /** - * @var Config - */ - private $signifydIntegrationConfig; - - /** - * @var CaseCreationServiceInterface - */ - private $caseCreationService; - - /** - * @var LoggerInterface - */ - private $logger; - - /** - * @param Config $signifydIntegrationConfig - * @param CaseCreationServiceInterface $caseCreationService - * @param LoggerInterface $logger - */ - public function __construct( - Config $signifydIntegrationConfig, - CaseCreationServiceInterface $caseCreationService, - LoggerInterface $logger - ) { - $this->signifydIntegrationConfig = $signifydIntegrationConfig; - $this->caseCreationService = $caseCreationService; - $this->logger = $logger; - } - - /** - * {@inheritdoc} - */ - public function execute(Observer $observer) - { - $orders = $this->extractOrders( - $observer->getEvent() - ); - - if (null === $orders) { - return; - } - - foreach ($orders as $order) { - $storeId = $order->getStoreId(); - if ($this->signifydIntegrationConfig->isActive($storeId)) { - $this->createCaseForOrder($order); - } - } - } - - /** - * Creates Signifyd case for single order with online payment method. - * - * @param OrderInterface $order - * @return void - */ - private function createCaseForOrder($order) - { - $orderId = $order->getEntityId(); - if (null === $orderId - || $order->getPayment()->getMethodInstance()->isOffline() - || $order->getState() === Order::STATE_PENDING_PAYMENT) { - return; - } - - try { - $this->caseCreationService->createForOrder($orderId); - } catch (AlreadyExistsException $e) { - $this->logger->error($e->getMessage()); - } - } - - /** - * Returns Orders entity list from Event data container - * - * @param Event $event - * @return OrderInterface[]|null - */ - private function extractOrders(Event $event) - { - $order = $event->getData('order'); - if (null !== $order) { - return [$order]; - } - - return $event->getData('orders'); - } -} diff --git a/app/code/Magento/Signifyd/Plugin/OrderPlugin.php b/app/code/Magento/Signifyd/Plugin/OrderPlugin.php deleted file mode 100644 index 663409d0eb824..0000000000000 --- a/app/code/Magento/Signifyd/Plugin/OrderPlugin.php +++ /dev/null @@ -1,52 +0,0 @@ -<?php -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ -namespace Magento\Signifyd\Plugin; - -use Magento\Sales\Api\Data\OrderInterface; -use Magento\Sales\Model\Order; -use Magento\Signifyd\Api\GuaranteeCancelingServiceInterface; - -/** - * Plugin for Magento\Sales\Model\Order. - * - * @see Order - */ -class OrderPlugin -{ - /** - * @var GuaranteeCancelingServiceInterface - */ - private $guaranteeCancelingService; - - /** - * @param GuaranteeCancelingServiceInterface $guaranteeCancelingService - */ - public function __construct( - GuaranteeCancelingServiceInterface $guaranteeCancelingService - ) { - $this->guaranteeCancelingService = $guaranteeCancelingService; - } - - /** - * Performs Signifyd guarantee cancel operation after order canceling - * if cancel order operation was successful. - * - * @see Order::cancel - * @param Order $order - * @param OrderInterface $result - * @return OrderInterface - */ - public function afterCancel(Order $order, $result) - { - if ($order->isCanceled()) { - $this->guaranteeCancelingService->cancelForOrder( - $order->getEntityId() - ); - } - - return $result; - } -} diff --git a/app/code/Magento/Signifyd/Plugin/PaymentPlugin.php b/app/code/Magento/Signifyd/Plugin/PaymentPlugin.php deleted file mode 100644 index 17cf4d7e7dbe9..0000000000000 --- a/app/code/Magento/Signifyd/Plugin/PaymentPlugin.php +++ /dev/null @@ -1,67 +0,0 @@ -<?php -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ -namespace Magento\Signifyd\Plugin; - -use Magento\Payment\Model\InfoInterface; -use Magento\Payment\Model\MethodInterface; -use Magento\Signifyd\Api\GuaranteeCancelingServiceInterface; - -/** - * Plugin for Magento\Payment\Model\MethodInterface. - * - * @see MethodInterface - */ -class PaymentPlugin -{ - /** - * @var GuaranteeCancelingServiceInterface - */ - private $guaranteeCancelingService; - - /** - * @param GuaranteeCancelingServiceInterface $guaranteeCancelingService - */ - public function __construct( - GuaranteeCancelingServiceInterface $guaranteeCancelingService - ) { - $this->guaranteeCancelingService = $guaranteeCancelingService; - } - - /** - * Performs Signifyd guarantee cancel operation after payment denying. - * - * @see MethodInterface::denyPayment - * @SuppressWarnings(PHPMD.UnusedFormalParameter) - * - * @param MethodInterface $subject - * @param MethodInterface|bool $result - * @param InfoInterface $payment - * @return bool|MethodInterface - */ - public function afterDenyPayment(MethodInterface $subject, $result, InfoInterface $payment) - { - if ($this->isPaymentDenied($payment, $result)) { - $this->guaranteeCancelingService->cancelForOrder($payment->getParentId()); - } - - return $result; - } - - /** - * Checks if deny payment operation was successful. - * - * Result not false check for payment methods using AbstractMethod. - * Transaction is closed check for payment methods using Gateway. - * - * @param InfoInterface $payment - * @param MethodInterface $result - * @return bool - */ - private function isPaymentDenied($payment, $result) - { - return $result !== false || $payment->getIsTransactionClosed(); - } -} diff --git a/app/code/Magento/Signifyd/README.md b/app/code/Magento/Signifyd/README.md deleted file mode 100644 index 8048716bed444..0000000000000 --- a/app/code/Magento/Signifyd/README.md +++ /dev/null @@ -1,78 +0,0 @@ -# Magento_Signifyd module - -## Overview - -The Magento_Signifyd module provides integration with the [Signifyd](https://www.signifyd.com/) fraud protection system. The integration is based on the Signifyd API; see the [Signifyd API docs](https://www.signifyd.com/docs/api/#/introduction/) for technical details. - -The module implementation allows to: - - - create a [Signifyd case](https://www.signifyd.com/docs/api/#/reference/cases) for a placed order - - automatically receive a [Signifyd guarantee](https://www.signifyd.com/docs/api/#/reference/guarantees) for a created case - - automatically cancel a guarantee when the order is canceled - -## Extensibility - -The Magento_Signifyd module does not add own Events, Layouts, and UI Components as extension points. - -### Public API - -The following interfaces (marked with the `@api` annotation) provide methods that allow to: - -`Magento\Signifyd\Api\Data\CaseInterface` (common abstraction for the Signifyd case entity): - -- set or retrieve all case data fields - -`Magento\Signifyd\Api\CaseManagementInterface`: - -- create a new case entity -- retrieve the existing case entity for a specified order - -`Magento\Signifyd\Api\CaseCreationServiceInterface`: - -- create a case entity for a specified order -- send a request through the Signifyd API to create a new case - -`Magento\Signifyd\Api\CaseRepositoryInterface`: - -- describe methods to work with a case entity - -`Magento\Signifyd\Api\GuaranteeCreationServiceInterface`: - -- send a request through the Signifyd API to create a new case guarantee - -`Magento\Signifyd\Api\GuaranteeCancelingServiceInterface`: -- send a request through the Signifyd API to cancel the Signifyd case guarantee - -`Magento\Signifyd\Api\Data\CaseSearchResultsInterface`: - -- might be used by `Magento\Signifyd\Api\CaseRepositoryInterface` to retrieve a list of case entities by specific conditions - -For information about a public API in Magento 2, see [Public interfaces & APIs](https://devdocs.magento.com/guides/v2.3/extension-dev-guide/api-concepts.html). - -## Additional information - -### Webhooks - -To update the entity data for a case or guarantee, the Magento_Signifyd module uses the [Signifyd Webhooks](https://www.signifyd.com/docs/api/#/reference/webhooks) mechanism. - -The newly created case entities have the `PENDING` status for a case and a guarantee. After receiving Webhook, both statuses are changed to appropriate Signifyd statuses. - -### Debug mode - -The Debug Mode may be enabled in the module configuration. This logs the communication data between the Magento_Signifyd module and the Signifyd service in this file: - - var/log/debug.log - -### Backward incompatible changes - -The Magento_Signifyd module does not introduce backward incompatible changes. - -You can track [backward incompatible changes in patch releases](https://devdocs.magento.com/guides/v2.3/release-notes/backward-incompatible-changes/reference.html). - -### Processing supplementary payment information - -To improve the accuracy of Signifyd's transaction estimation, you may perform these operations (links lead to the Magento Developer Documentation Portal): - -- [Provide custom AVS/CVV mapping](https://devdocs.magento.com/guides/v2.3/payments-integrations/signifyd/signifyd.html#provide-avscvv-response-codes) - -- [Retrieve payment method for a placed order](https://devdocs.magento.com/guides/v2.3/payments-integrations/signifyd/signifyd.html#retrieve-payment-method-for-a-placed-order) diff --git a/app/code/Magento/Signifyd/Test/Mftf/LICENSE.txt b/app/code/Magento/Signifyd/Test/Mftf/LICENSE.txt deleted file mode 100644 index 49525fd99da9c..0000000000000 --- a/app/code/Magento/Signifyd/Test/Mftf/LICENSE.txt +++ /dev/null @@ -1,48 +0,0 @@ - -Open Software License ("OSL") v. 3.0 - -This Open Software License (the "License") applies to any original work of authorship (the "Original Work") whose owner (the "Licensor") has placed the following licensing notice adjacent to the copyright notice for the Original Work: - -Licensed under the Open Software License version 3.0 - - 1. Grant of Copyright License. Licensor grants You a worldwide, royalty-free, non-exclusive, sublicensable license, for the duration of the copyright, to do the following: - - 1. to reproduce the Original Work in copies, either alone or as part of a collective work; - - 2. to translate, adapt, alter, transform, modify, or arrange the Original Work, thereby creating derivative works ("Derivative Works") based upon the Original Work; - - 3. to distribute or communicate copies of the Original Work and Derivative Works to the public, with the proviso that copies of Original Work or Derivative Works that You distribute or communicate shall be licensed under this Open Software License; - - 4. to perform the Original Work publicly; and - - 5. to display the Original Work publicly. - - 2. Grant of Patent License. Licensor grants You a worldwide, royalty-free, non-exclusive, sublicensable license, under patent claims owned or controlled by the Licensor that are embodied in the Original Work as furnished by the Licensor, for the duration of the patents, to make, use, sell, offer for sale, have made, and import the Original Work and Derivative Works. - - 3. Grant of Source Code License. The term "Source Code" means the preferred form of the Original Work for making modifications to it and all available documentation describing how to modify the Original Work. Licensor agrees to provide a machine-readable copy of the Source Code of the Original Work along with each copy of the Original Work that Licensor distributes. Licensor reserves the right to satisfy this obligation by placing a machine-readable copy of the Source Code in an information repository reasonably calculated to permit inexpensive and convenient access by You for as long as Licensor continues to distribute the Original Work. - - 4. Exclusions From License Grant. Neither the names of Licensor, nor the names of any contributors to the Original Work, nor any of their trademarks or service marks, may be used to endorse or promote products derived from this Original Work without express prior permission of the Licensor. Except as expressly stated herein, nothing in this License grants any license to Licensor's trademarks, copyrights, patents, trade secrets or any other intellectual property. No patent license is granted to make, use, sell, offer for sale, have made, or import embodiments of any patent claims other than the licensed claims defined in Section 2. No license is granted to the trademarks of Licensor even if such marks are included in the Original Work. Nothing in this License shall be interpreted to prohibit Licensor from licensing under terms different from this License any Original Work that Licensor otherwise would have a right to license. - - 5. External Deployment. The term "External Deployment" means the use, distribution, or communication of the Original Work or Derivative Works in any way such that the Original Work or Derivative Works may be used by anyone other than You, whether those works are distributed or communicated to those persons or made available as an application intended for use over a network. As an express condition for the grants of license hereunder, You must treat any External Deployment by You of the Original Work or a Derivative Work as a distribution under section 1(c). - - 6. Attribution Rights. You must retain, in the Source Code of any Derivative Works that You create, all copyright, patent, or trademark notices from the Source Code of the Original Work, as well as any notices of licensing and any descriptive text identified therein as an "Attribution Notice." You must cause the Source Code for any Derivative Works that You create to carry a prominent Attribution Notice reasonably calculated to inform recipients that You have modified the Original Work. - - 7. Warranty of Provenance and Disclaimer of Warranty. Licensor warrants that the copyright in and to the Original Work and the patent rights granted herein by Licensor are owned by the Licensor or are sublicensed to You under the terms of this License with the permission of the contributor(s) of those copyrights and patent rights. Except as expressly stated in the immediately preceding sentence, the Original Work is provided under this License on an "AS IS" BASIS and WITHOUT WARRANTY, either express or implied, including, without limitation, the warranties of non-infringement, merchantability or fitness for a particular purpose. THE ENTIRE RISK AS TO THE QUALITY OF THE ORIGINAL WORK IS WITH YOU. This DISCLAIMER OF WARRANTY constitutes an essential part of this License. No license to the Original Work is granted by this License except under this disclaimer. - - 8. Limitation of Liability. Under no circumstances and under no legal theory, whether in tort (including negligence), contract, or otherwise, shall the Licensor be liable to anyone for any indirect, special, incidental, or consequential damages of any character arising as a result of this License or the use of the Original Work including, without limitation, damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses. This limitation of liability shall not apply to the extent applicable law prohibits such limitation. - - 9. Acceptance and Termination. If, at any time, You expressly assented to this License, that assent indicates your clear and irrevocable acceptance of this License and all of its terms and conditions. If You distribute or communicate copies of the Original Work or a Derivative Work, You must make a reasonable effort under the circumstances to obtain the express assent of recipients to the terms of this License. This License conditions your rights to undertake the activities listed in Section 1, including your right to create Derivative Works based upon the Original Work, and doing so without honoring these terms and conditions is prohibited by copyright law and international treaty. Nothing in this License is intended to affect copyright exceptions and limitations (including 'fair use' or 'fair dealing'). This License shall terminate immediately and You may no longer exercise any of the rights granted to You by this License upon your failure to honor the conditions in Section 1(c). - - 10. Termination for Patent Action. This License shall terminate automatically and You may no longer exercise any of the rights granted to You by this License as of the date You commence an action, including a cross-claim or counterclaim, against Licensor or any licensee alleging that the Original Work infringes a patent. This termination provision shall not apply for an action alleging patent infringement by combinations of the Original Work with other software or hardware. - - 11. Jurisdiction, Venue and Governing Law. Any action or suit relating to this License may be brought only in the courts of a jurisdiction wherein the Licensor resides or in which Licensor conducts its primary business, and under the laws of that jurisdiction excluding its conflict-of-law provisions. The application of the United Nations Convention on Contracts for the International Sale of Goods is expressly excluded. Any use of the Original Work outside the scope of this License or after its termination shall be subject to the requirements and penalties of copyright or patent law in the appropriate jurisdiction. This section shall survive the termination of this License. - - 12. Attorneys' Fees. In any action to enforce the terms of this License or seeking damages relating thereto, the prevailing party shall be entitled to recover its costs and expenses, including, without limitation, reasonable attorneys' fees and costs incurred in connection with such action, including any appeal of such action. This section shall survive the termination of this License. - - 13. Miscellaneous. If any provision of this License is held to be unenforceable, such provision shall be reformed only to the extent necessary to make it enforceable. - - 14. Definition of "You" in This License. "You" throughout this License, whether in upper or lower case, means an individual or a legal entity exercising rights under, and complying with all of the terms of, this License. For legal entities, "You" includes any entity that controls, is controlled by, or is under common control with you. For purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. - - 15. Right to Use. You may use the Original Work in all ways not otherwise restricted or conditioned by this License or by law, and Licensor promises not to interfere with or be responsible for such uses by You. - - 16. Modification of This License. This License is Copyright (C) 2005 Lawrence Rosen. Permission is granted to copy, distribute, or communicate this License without modification. Nothing in this License permits You to modify this License as applied to the Original Work or to Derivative Works. However, You may modify the text of this License and copy, distribute or communicate your modified version (the "Modified License") and apply it to other original works of authorship subject to the following conditions: (i) You may not indicate in any way that your Modified License is the "Open Software License" or "OSL" and you may not use those names in the name of your Modified License; (ii) You must replace the notice specified in the first paragraph above with the notice "Licensed under <insert your license name here>" or with a notice of your own that is not confusingly similar to the notice in this License; and (iii) You may not claim that your original works are open source software unless your Modified License has been approved by Open Source Initiative (OSI) and You comply with its license review and certification process. \ No newline at end of file diff --git a/app/code/Magento/Signifyd/Test/Mftf/LICENSE_AFL.txt b/app/code/Magento/Signifyd/Test/Mftf/LICENSE_AFL.txt deleted file mode 100644 index f39d641b18a19..0000000000000 --- a/app/code/Magento/Signifyd/Test/Mftf/LICENSE_AFL.txt +++ /dev/null @@ -1,48 +0,0 @@ - -Academic Free License ("AFL") v. 3.0 - -This Academic Free License (the "License") applies to any original work of authorship (the "Original Work") whose owner (the "Licensor") has placed the following licensing notice adjacent to the copyright notice for the Original Work: - -Licensed under the Academic Free License version 3.0 - - 1. Grant of Copyright License. Licensor grants You a worldwide, royalty-free, non-exclusive, sublicensable license, for the duration of the copyright, to do the following: - - 1. to reproduce the Original Work in copies, either alone or as part of a collective work; - - 2. to translate, adapt, alter, transform, modify, or arrange the Original Work, thereby creating derivative works ("Derivative Works") based upon the Original Work; - - 3. to distribute or communicate copies of the Original Work and Derivative Works to the public, under any license of your choice that does not contradict the terms and conditions, including Licensor's reserved rights and remedies, in this Academic Free License; - - 4. to perform the Original Work publicly; and - - 5. to display the Original Work publicly. - - 2. Grant of Patent License. Licensor grants You a worldwide, royalty-free, non-exclusive, sublicensable license, under patent claims owned or controlled by the Licensor that are embodied in the Original Work as furnished by the Licensor, for the duration of the patents, to make, use, sell, offer for sale, have made, and import the Original Work and Derivative Works. - - 3. Grant of Source Code License. The term "Source Code" means the preferred form of the Original Work for making modifications to it and all available documentation describing how to modify the Original Work. Licensor agrees to provide a machine-readable copy of the Source Code of the Original Work along with each copy of the Original Work that Licensor distributes. Licensor reserves the right to satisfy this obligation by placing a machine-readable copy of the Source Code in an information repository reasonably calculated to permit inexpensive and convenient access by You for as long as Licensor continues to distribute the Original Work. - - 4. Exclusions From License Grant. Neither the names of Licensor, nor the names of any contributors to the Original Work, nor any of their trademarks or service marks, may be used to endorse or promote products derived from this Original Work without express prior permission of the Licensor. Except as expressly stated herein, nothing in this License grants any license to Licensor's trademarks, copyrights, patents, trade secrets or any other intellectual property. No patent license is granted to make, use, sell, offer for sale, have made, or import embodiments of any patent claims other than the licensed claims defined in Section 2. No license is granted to the trademarks of Licensor even if such marks are included in the Original Work. Nothing in this License shall be interpreted to prohibit Licensor from licensing under terms different from this License any Original Work that Licensor otherwise would have a right to license. - - 5. External Deployment. The term "External Deployment" means the use, distribution, or communication of the Original Work or Derivative Works in any way such that the Original Work or Derivative Works may be used by anyone other than You, whether those works are distributed or communicated to those persons or made available as an application intended for use over a network. As an express condition for the grants of license hereunder, You must treat any External Deployment by You of the Original Work or a Derivative Work as a distribution under section 1(c). - - 6. Attribution Rights. You must retain, in the Source Code of any Derivative Works that You create, all copyright, patent, or trademark notices from the Source Code of the Original Work, as well as any notices of licensing and any descriptive text identified therein as an "Attribution Notice." You must cause the Source Code for any Derivative Works that You create to carry a prominent Attribution Notice reasonably calculated to inform recipients that You have modified the Original Work. - - 7. Warranty of Provenance and Disclaimer of Warranty. Licensor warrants that the copyright in and to the Original Work and the patent rights granted herein by Licensor are owned by the Licensor or are sublicensed to You under the terms of this License with the permission of the contributor(s) of those copyrights and patent rights. Except as expressly stated in the immediately preceding sentence, the Original Work is provided under this License on an "AS IS" BASIS and WITHOUT WARRANTY, either express or implied, including, without limitation, the warranties of non-infringement, merchantability or fitness for a particular purpose. THE ENTIRE RISK AS TO THE QUALITY OF THE ORIGINAL WORK IS WITH YOU. This DISCLAIMER OF WARRANTY constitutes an essential part of this License. No license to the Original Work is granted by this License except under this disclaimer. - - 8. Limitation of Liability. Under no circumstances and under no legal theory, whether in tort (including negligence), contract, or otherwise, shall the Licensor be liable to anyone for any indirect, special, incidental, or consequential damages of any character arising as a result of this License or the use of the Original Work including, without limitation, damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses. This limitation of liability shall not apply to the extent applicable law prohibits such limitation. - - 9. Acceptance and Termination. If, at any time, You expressly assented to this License, that assent indicates your clear and irrevocable acceptance of this License and all of its terms and conditions. If You distribute or communicate copies of the Original Work or a Derivative Work, You must make a reasonable effort under the circumstances to obtain the express assent of recipients to the terms of this License. This License conditions your rights to undertake the activities listed in Section 1, including your right to create Derivative Works based upon the Original Work, and doing so without honoring these terms and conditions is prohibited by copyright law and international treaty. Nothing in this License is intended to affect copyright exceptions and limitations (including "fair use" or "fair dealing"). This License shall terminate immediately and You may no longer exercise any of the rights granted to You by this License upon your failure to honor the conditions in Section 1(c). - - 10. Termination for Patent Action. This License shall terminate automatically and You may no longer exercise any of the rights granted to You by this License as of the date You commence an action, including a cross-claim or counterclaim, against Licensor or any licensee alleging that the Original Work infringes a patent. This termination provision shall not apply for an action alleging patent infringement by combinations of the Original Work with other software or hardware. - - 11. Jurisdiction, Venue and Governing Law. Any action or suit relating to this License may be brought only in the courts of a jurisdiction wherein the Licensor resides or in which Licensor conducts its primary business, and under the laws of that jurisdiction excluding its conflict-of-law provisions. The application of the United Nations Convention on Contracts for the International Sale of Goods is expressly excluded. Any use of the Original Work outside the scope of this License or after its termination shall be subject to the requirements and penalties of copyright or patent law in the appropriate jurisdiction. This section shall survive the termination of this License. - - 12. Attorneys' Fees. In any action to enforce the terms of this License or seeking damages relating thereto, the prevailing party shall be entitled to recover its costs and expenses, including, without limitation, reasonable attorneys' fees and costs incurred in connection with such action, including any appeal of such action. This section shall survive the termination of this License. - - 13. Miscellaneous. If any provision of this License is held to be unenforceable, such provision shall be reformed only to the extent necessary to make it enforceable. - - 14. Definition of "You" in This License. "You" throughout this License, whether in upper or lower case, means an individual or a legal entity exercising rights under, and complying with all of the terms of, this License. For legal entities, "You" includes any entity that controls, is controlled by, or is under common control with you. For purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. - - 15. Right to Use. You may use the Original Work in all ways not otherwise restricted or conditioned by this License or by law, and Licensor promises not to interfere with or be responsible for such uses by You. - - 16. Modification of This License. This License is Copyright © 2005 Lawrence Rosen. Permission is granted to copy, distribute, or communicate this License without modification. Nothing in this License permits You to modify this License as applied to the Original Work or to Derivative Works. However, You may modify the text of this License and copy, distribute or communicate your modified version (the "Modified License") and apply it to other original works of authorship subject to the following conditions: (i) You may not indicate in any way that your Modified License is the "Academic Free License" or "AFL" and you may not use those names in the name of your Modified License; (ii) You must replace the notice specified in the first paragraph above with the notice "Licensed under <insert your license name here>" or with a notice of your own that is not confusingly similar to the notice in this License; and (iii) You may not claim that your original works are open source software unless your Modified License has been approved by Open Source Initiative (OSI) and You comply with its license review and certification process. diff --git a/app/code/Magento/Signifyd/Test/Mftf/Page/AdminFraudProtectionPage.xml b/app/code/Magento/Signifyd/Test/Mftf/Page/AdminFraudProtectionPage.xml deleted file mode 100644 index 07b58b8594843..0000000000000 --- a/app/code/Magento/Signifyd/Test/Mftf/Page/AdminFraudProtectionPage.xml +++ /dev/null @@ -1,14 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - /** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ ---> - -<pages xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/PageObject.xsd"> - <page name="AdminFraudProtectionPage" url="admin/system_config/edit/section/fraud_protection/" area="admin" module="Magento_Signifyd"> - <section name="AdminSignifydConfigurationSection"/> - </page> -</pages> diff --git a/app/code/Magento/Signifyd/Test/Mftf/README.md b/app/code/Magento/Signifyd/Test/Mftf/README.md deleted file mode 100644 index 9391d7b314ea5..0000000000000 --- a/app/code/Magento/Signifyd/Test/Mftf/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# Signifyd Functional Tests - -The Functional Test Module for **Magento Signifyd** module. diff --git a/app/code/Magento/Signifyd/Test/Mftf/Section/AdminSignifydConfigurationSection.xml b/app/code/Magento/Signifyd/Test/Mftf/Section/AdminSignifydConfigurationSection.xml deleted file mode 100644 index 618e9d520dd87..0000000000000 --- a/app/code/Magento/Signifyd/Test/Mftf/Section/AdminSignifydConfigurationSection.xml +++ /dev/null @@ -1,16 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - /** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ ---> - -<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd"> - <section name="AdminSignifydConfigurationSection"> - <element name="head" type="button" selector="#fraud_protection_signifyd_config-head"/> - <element name="enabled" type="input" selector="#fraud_protection_signifyd_config_active"/> - <element name="url" type="text" selector="#fraud_protection_signifyd_config_api_url"/> - </section> -</sections> diff --git a/app/code/Magento/Signifyd/Test/Mftf/Test/AdminSignifydConfigDependentOnActiveFieldTest.xml b/app/code/Magento/Signifyd/Test/Mftf/Test/AdminSignifydConfigDependentOnActiveFieldTest.xml deleted file mode 100644 index e3275d4097c63..0000000000000 --- a/app/code/Magento/Signifyd/Test/Mftf/Test/AdminSignifydConfigDependentOnActiveFieldTest.xml +++ /dev/null @@ -1,34 +0,0 @@ -<?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="AdminSignifydConfigDependentOnActiveFieldTest"> - <annotations> - <features value="Signifyd"/> - <stories value="Signify ID Settings"/> - <title value="Signifyd config dependent on active field" /> - <description value="Signifyd system configs dependent by Enable this Solution field."/> - <severity value="MINOR"/> - </annotations> - <before> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> - <magentoCLI command="config:set fraud_protection/signifyd/active 1" stepKey="enableSignifyd"/> - </before> - - <after> - <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> - <magentoCLI command="config:set fraud_protection/signifyd/active 0" stepKey="disableSignifyd"/> - </after> - - <amOnPage url="{{AdminFraudProtectionPage.url}}" stepKey="openFraudProtectionPagePage" /> - <conditionalClick dependentSelector="{{AdminSignifydConfigurationSection.enabled}}" visible="false" selector="{{AdminSignifydConfigurationSection.head}}" stepKey="openCollapsibleBlock"/> - <seeInField selector="{{AdminSignifydConfigurationSection.url}}" userInput="https://api.signifyd.com/v2/" stepKey="seeApiUrlField"/> - <selectOption selector="{{AdminSignifydConfigurationSection.enabled}}" userInput="0" stepKey="disableSignifydOption"/> - <dontSeeElement selector="{{AdminSignifydConfigurationSection.url}}" stepKey="dontSeeApiUrlField"/> - </test> -</tests> diff --git a/app/code/Magento/Signifyd/Test/Unit/Block/Adminhtml/CaseInfoTest.php b/app/code/Magento/Signifyd/Test/Unit/Block/Adminhtml/CaseInfoTest.php deleted file mode 100644 index 164cd8018fb69..0000000000000 --- a/app/code/Magento/Signifyd/Test/Unit/Block/Adminhtml/CaseInfoTest.php +++ /dev/null @@ -1,150 +0,0 @@ -<?php -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ -namespace Magento\Signifyd\Test\Unit\Block\Adminhtml; - -use Magento\Framework\App\RequestInterface; -use Magento\Framework\TestFramework\Unit\Helper\ObjectManager; -use Magento\Framework\View\Element\Template\Context; -use Magento\Signifyd\Api\Data\CaseInterface; -use Magento\Signifyd\Block\Adminhtml\CaseInfo; -use Magento\Signifyd\Model\CaseManagement; -use Magento\Signifyd\Model\Config; -use PHPUnit_Framework_MockObject_MockObject as MockObject; - -/** - * Tests for Signifyd block information. - * - * Class CaseInfoTest - */ -class CaseInfoTest extends \PHPUnit\Framework\TestCase -{ - /** - * @var CaseInterface|MockObject - */ - private $caseEntity; - - /** - * @var CaseInfo - */ - private $caseInfo; - - /** - * @var Context|MockObject - */ - private $context; - - /** - * @var Config|MockObject - */ - private $config; - - /** - * @var CaseManagement|MockObject - */ - private $caseManagement; - - /** - * @var RequestInterface|MockObject - */ - private $request; - - /** - * @inheritdoc - */ - protected function setUp() - { - $objectManager = new ObjectManager($this); - - $this->context = $this->getMockBuilder(Context::class) - ->disableOriginalConstructor() - ->getMock(); - - $this->request = $this->getMockBuilder(RequestInterface::class) - ->getMockForAbstractClass(); - - $this->context->expects(self::once()) - ->method('getRequest') - ->willReturn($this->request); - - $this->config = $this->getMockBuilder(Config::class) - ->disableOriginalConstructor() - ->getMock(); - - $this->caseManagement = $this->getMockBuilder(CaseManagement::class) - ->disableOriginalConstructor() - ->getMock(); - - $this->caseEntity = $this->getMockBuilder(CaseInterface::class) - ->disableOriginalConstructor() - ->setMethods(['getScore']) - ->getMockForAbstractClass(); - - $this->caseInfo = $objectManager->getObject(CaseInfo::class, [ - 'context' => $this->context, - 'config' => $this->config, - 'caseManagement' => $this->caseManagement - ]); - } - - /** - * Checks label according to Signifyd Guarantee Disposition. - * - * @param string $guaranteeDisposition - * @param string $expectedLabel - * @covers \Magento\Signifyd\Block\Adminhtml\CaseInfo::getCaseGuaranteeDisposition() - * @dataProvider getGuaranteeLabelDataProvider - */ - public function testGetGuaranteeDisposition($guaranteeDisposition, $expectedLabel) - { - $this->caseManagement->expects(self::once()) - ->method('getByOrderId') - ->willReturn($this->caseEntity); - - $this->caseEntity->expects(self::atLeastOnce()) - ->method('getGuaranteeDisposition') - ->willReturn($guaranteeDisposition); - - self::assertEquals( - $expectedLabel, - $this->caseInfo->getCaseGuaranteeDisposition() - ); - } - - /** - * Case Guarantee Disposition and corresponding label data provider. - * - * @return array - */ - public function getGuaranteeLabelDataProvider() - { - return [ - [CaseInterface::GUARANTEE_APPROVED, __('Approved')], - [CaseInterface::GUARANTEE_DECLINED, __('Declined')], - [CaseInterface::GUARANTEE_PENDING, __('Pending')], - [CaseInterface::GUARANTEE_CANCELED, __('Canceled')], - [CaseInterface::GUARANTEE_IN_REVIEW, __('In Review')], - [CaseInterface::GUARANTEE_UNREQUESTED, __('Unrequested')], - ['Unregistered', ''] - ]; - } - - /** - * Checks case property getter with empty case. - * - * @covers \Magento\Signifyd\Block\Adminhtml\CaseInfo::getCaseProperty - */ - public function testCasePropertyWithEmptyCase() - { - $this->caseManagement->expects(self::once()) - ->method('getByOrderId') - ->willReturn(null); - - self::assertEquals( - '', - $this->caseInfo->getCaseGuaranteeDisposition() - ); - } -} diff --git a/app/code/Magento/Signifyd/Test/Unit/Controller/Webhooks/HandlerTest.php b/app/code/Magento/Signifyd/Test/Unit/Controller/Webhooks/HandlerTest.php deleted file mode 100644 index 8b98be338b973..0000000000000 --- a/app/code/Magento/Signifyd/Test/Unit/Controller/Webhooks/HandlerTest.php +++ /dev/null @@ -1,374 +0,0 @@ -<?php -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ -namespace Magento\Signifyd\Test\Unit\Controller\Webhooks; - -use Magento\Framework\App\Action\Context; -use Magento\Framework\App\Response\Http as ResponseHttp; -use Magento\Framework\App\Response\RedirectInterface; -use Magento\Framework\Exception\LocalizedException; -use Magento\Signifyd\Api\CaseRepositoryInterface; -use Magento\Signifyd\Api\Data\CaseInterface; -use Magento\Signifyd\Controller\Webhooks\Handler; -use Magento\Signifyd\Model\CaseServices\UpdatingService; -use Magento\Signifyd\Model\CaseServices\UpdatingServiceFactory; -use Magento\Signifyd\Model\Config; -use Magento\Signifyd\Model\SignifydGateway\Response\WebhookMessage; -use Magento\Signifyd\Model\SignifydGateway\Response\WebhookMessageReader; -use Magento\Signifyd\Model\SignifydGateway\Response\WebhookRequest; -use Magento\Signifyd\Model\SignifydGateway\Response\WebhookRequestValidator; -use PHPUnit_Framework_MockObject_MockObject as MockObject; -use Psr\Log\LoggerInterface; - -/** - * Class IndexTest - * - * @SuppressWarnings(PHPMD.CouplingBetweenObjects) - */ -class HandlerTest extends \PHPUnit\Framework\TestCase -{ - /** - * @var Handler - */ - private $controller; - - /** - * @var LoggerInterface|MockObject - */ - private $logger; - - /** - * @var RedirectInterface|MockObject - */ - private $redirect; - - /** - * @var ResponseHttp|MockObject - */ - private $response; - - /** - * @var Context|MockObject - */ - private $context; - - /** - * @var WebhookRequest|MockObject - */ - private $webhookRequest; - - /** - * @var WebhookMessageReader|MockObject - */ - private $webhookMessageReader; - - /** - * @var WebhookRequestValidator|MockObject - */ - private $webhookRequestValidator; - - /** - * @var UpdatingServiceFactory|MockObject - */ - private $caseUpdatingServiceFactory; - - /** - * @var CaseRepositoryInterface|MockObject - */ - private $caseRepository; - - /** - * @inheritdoc - */ - protected function setUp() - { - $this->context = $this->getMockBuilder(Context::class) - ->disableOriginalConstructor() - ->getMock(); - - $this->webhookRequest = $this->getMockBuilder(WebhookRequest::class) - ->disableOriginalConstructor() - ->getMock(); - $this->webhookMessageReader = $this->getMockBuilder(WebhookMessageReader::class) - ->disableOriginalConstructor() - ->getMock(); - $this->webhookRequestValidator = $this->getMockBuilder(WebhookRequestValidator::class) - ->disableOriginalConstructor() - ->getMock(); - $this->caseUpdatingServiceFactory = $this->getMockBuilder(UpdatingServiceFactory::class) - ->disableOriginalConstructor() - ->getMock(); - $this->logger = $this->getMockBuilder(LoggerInterface::class) - ->getMockForAbstractClass(); - - $this->response = $this->getMockBuilder(ResponseHttp::class) - ->disableOriginalConstructor() - ->getMock(); - $this->context->expects($this->once()) - ->method('getResponse') - ->willReturn($this->response); - $this->redirect = $this->getMockBuilder(RedirectInterface::class) - ->getMockForAbstractClass(); - $this->context->expects($this->once()) - ->method('getRedirect') - ->willReturn($this->redirect); - $this->caseRepository = $this->getMockBuilder(CaseRepositoryInterface::class) - ->disableOriginalConstructor() - ->setMethods(['getByCaseId']) - ->getMockForAbstractClass(); - - $config = $this->getMockBuilder(Config::class) - ->disableOriginalConstructor() - ->setMethods(['isDebugModeEnabled', 'getByCaseId']) - ->getMock(); - $config->expects(self::any()) - ->method('getByCaseId') - ->willReturn(false); - - $this->controller = new Handler( - $this->context, - $this->webhookRequest, - $this->logger, - $this->webhookMessageReader, - $this->caseUpdatingServiceFactory, - $this->webhookRequestValidator, - $this->caseRepository, - $config - ); - } - - /** - * Successful case - */ - public function testExecuteSuccessfully() - { - $eventTopic = 'cases/creation'; - $caseId = 1; - $data = ['score' => 200, 'caseId' => $caseId]; - - $this->webhookRequestValidator->expects($this->once()) - ->method('validate') - ->willReturn(true); - - $webhookMessage = $this->getMockBuilder(WebhookMessage::class) - ->disableOriginalConstructor() - ->getMock(); - $webhookMessage->expects($this->exactly(2)) - ->method('getEventTopic') - ->willReturn($eventTopic); - $webhookMessage->expects($this->once()) - ->method('getData') - ->willReturn($data); - $this->webhookMessageReader->expects($this->once()) - ->method('read') - ->with($this->webhookRequest) - ->willReturn($webhookMessage); - - $caseEntity = $this->getMockBuilder(CaseInterface::class) - ->disableOriginalConstructor() - ->getMock(); - $this->caseRepository->expects(self::once()) - ->method('getByCaseId') - ->with(self::equalTo($caseId)) - ->willReturn($caseEntity); - - $caseUpdatingService = $this->getMockBuilder(UpdatingService::class) - ->disableOriginalConstructor() - ->getMock(); - $caseUpdatingService->expects($this->once()) - ->method('update') - ->with($caseEntity, $data); - - $this->caseUpdatingServiceFactory->expects($this->once()) - ->method('create') - ->with($eventTopic) - ->willReturn($caseUpdatingService); - - $this->controller->execute(); - } - - /** - * Case when there is exception while updating case - */ - public function testExecuteCaseUpdatingServiceException() - { - $eventTopic = 'cases/creation'; - $caseId = 1; - $data = ['score' => 200, 'caseId' => $caseId]; - - $this->webhookRequestValidator->expects($this->once()) - ->method('validate') - ->willReturn(true); - - $webhookMessage = $this->getMockBuilder(WebhookMessage::class) - ->disableOriginalConstructor() - ->getMock(); - $webhookMessage->expects($this->exactly(2)) - ->method('getEventTopic') - ->willReturn($eventTopic); - $webhookMessage->expects($this->once()) - ->method('getData') - ->willReturn($data); - $this->webhookMessageReader->expects($this->once()) - ->method('read') - ->with($this->webhookRequest) - ->willReturn($webhookMessage); - - $caseEntity = $this->getMockBuilder(CaseInterface::class) - ->disableOriginalConstructor() - ->getMock(); - $this->caseRepository->expects(self::once()) - ->method('getByCaseId') - ->with(self::equalTo($caseId)) - ->willReturn($caseEntity); - - $caseUpdatingService = $this->getMockBuilder(UpdatingService::class) - ->disableOriginalConstructor() - ->getMock(); - $caseUpdatingService->expects($this->once()) - ->method('update') - ->with($caseEntity, $data) - ->willThrowException(new LocalizedException(__('Error'))); - - $this->caseUpdatingServiceFactory->expects($this->once()) - ->method('create') - ->with($eventTopic) - ->willReturn($caseUpdatingService); - - $this->response->expects($this->once()) - ->method('setHttpResponseCode') - ->with(400); - $this->logger->expects($this->once()) - ->method('critical'); - - $this->controller->execute(); - } - - /** - * Case when webhook request validation fails - */ - public function testExecuteRequestValidationFails() - { - $this->webhookRequestValidator->expects($this->once()) - ->method('validate') - ->willReturn(false); - $this->redirect->expects($this->once()) - ->method('redirect') - ->with($this->response, 'noroute', []); - $this->webhookMessageReader->expects($this->never()) - ->method('read'); - $this->caseUpdatingServiceFactory->expects($this->never()) - ->method('create'); - - $this->controller->execute(); - } - - /** - * Case when webhook request has test event topic. - */ - public function testExecuteWithTestEventTopic() - { - $this->webhookRequestValidator->expects($this->once()) - ->method('validate') - ->willReturn(true); - $this->redirect->expects($this->never()) - ->method('redirect'); - - $webhookMessage = $this->getMockBuilder(WebhookMessage::class) - ->disableOriginalConstructor() - ->getMock(); - $webhookMessage->expects($this->once()) - ->method('getEventTopic') - ->willReturn('cases/test'); - $webhookMessage->expects($this->never()) - ->method('getData'); - - $this->webhookMessageReader->expects($this->once()) - ->method('read') - ->with($this->webhookRequest) - ->willReturn($webhookMessage); - - $this->caseUpdatingServiceFactory->expects($this->never()) - ->method('create'); - - $this->controller->execute(); - } - - /** - * Checks a test case when received input data does not contain Signifyd case id. - * - * @covers \Magento\Signifyd\Controller\Webhooks\Handler::execute - */ - public function testExecuteWithMissedCaseId() - { - $this->webhookRequestValidator->expects(self::once()) - ->method('validate') - ->willReturn(true); - - $webhookMessage = $this->getMockBuilder(WebhookMessage::class) - ->disableOriginalConstructor() - ->getMock(); - $webhookMessage->expects($this->once()) - ->method('getEventTopic') - ->willReturn('cases/creation'); - $webhookMessage->expects(self::once()) - ->method('getData') - ->willReturn([ - 'orderId' => '1000101' - ]); - - $this->webhookMessageReader->expects(self::once()) - ->method('read') - ->with($this->webhookRequest) - ->willReturn($webhookMessage); - - $this->redirect->expects(self::once()) - ->method('redirect') - ->with($this->response, 'noroute', []); - - $this->controller->execute(); - } - - /** - * Checks a case when Signifyd case entity not found. - * - * @covers \Magento\Signifyd\Controller\Webhooks\Handler::execute - */ - public function testExecuteWithNotFoundCaseEntity() - { - $caseId = 123; - - $this->webhookRequestValidator->expects(self::once()) - ->method('validate') - ->willReturn(true); - - $webhookMessage = $this->getMockBuilder(WebhookMessage::class) - ->disableOriginalConstructor() - ->setMethods(['getData']) - ->getMock(); - $webhookMessage->expects(self::once()) - ->method('getData') - ->willReturn([ - 'orderId' => '1000101', - 'caseId' => $caseId - ]); - - $this->webhookMessageReader->expects(self::once()) - ->method('read') - ->with($this->webhookRequest) - ->willReturn($webhookMessage); - - $this->caseRepository->expects(self::once()) - ->method('getByCaseId') - ->with(self::equalTo($caseId)) - ->willReturn(null); - - $this->redirect->expects(self::once()) - ->method('redirect') - ->with($this->response, 'noroute', []); - - $this->controller->execute(); - } -} diff --git a/app/code/Magento/Signifyd/Test/Unit/Model/CaseServices/UpdatingServiceFactoryTest.php b/app/code/Magento/Signifyd/Test/Unit/Model/CaseServices/UpdatingServiceFactoryTest.php deleted file mode 100644 index f0184c032b550..0000000000000 --- a/app/code/Magento/Signifyd/Test/Unit/Model/CaseServices/UpdatingServiceFactoryTest.php +++ /dev/null @@ -1,167 +0,0 @@ -<?php -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ -namespace Magento\Signifyd\Test\Unit\Model\CaseServices; - -use Magento\Framework\ObjectManagerInterface; -use Magento\Framework\TestFramework\Unit\Helper\ObjectManager; -use Magento\Signifyd\Model\CaseServices\StubUpdatingService; -use Magento\Signifyd\Model\CaseServices\UpdatingService; -use Magento\Signifyd\Model\CaseServices\UpdatingServiceFactory; -use Magento\Signifyd\Model\Config; -use Magento\Signifyd\Model\MessageGenerators\GeneratorFactory; -use Magento\Signifyd\Model\MessageGenerators\GeneratorInterface; -use PHPUnit_Framework_MockObject_MockObject as MockObject; - -/** - * Contains tests for case updating service factory. - */ -class UpdatingServiceFactoryTest extends \PHPUnit\Framework\TestCase -{ - /** - * @var UpdatingServiceFactory - */ - private $factory; - - /** - * @var Config|MockObject - */ - private $config; - - /** - * @var ObjectManagerInterface|MockObject - */ - private $fakeObjectManager; - - /** - * @var GeneratorFactory|MockObject - */ - private $generatorFactory; - - /** - * @inheritdoc - */ - protected function setUp() - { - $this->config = $this->getMockBuilder(Config::class) - ->disableOriginalConstructor() - ->setMethods(['isActive']) - ->getMock(); - - $this->fakeObjectManager = $this->getMockBuilder(ObjectManagerInterface::class) - ->disableOriginalConstructor() - ->setMethods(['create']) - ->getMockForAbstractClass(); - - $this->generatorFactory = $this->getMockBuilder(GeneratorFactory::class) - ->disableOriginalConstructor() - ->setMethods(['create']) - ->getMock(); - - $objectManager = new ObjectManager($this); - $this->factory = $objectManager->getObject(UpdatingServiceFactory::class, [ - 'objectManager' => $this->fakeObjectManager, - 'generatorFactory' => $this->generatorFactory, - 'config' => $this->config - ]); - } - - /** - * Checks type of instance for updating service if Signifyd is not enabled. - * - * @covers \Magento\Signifyd\Model\CaseServices\UpdatingServiceFactory::create - */ - public function testCreateWithInactiveConfig() - { - $type = 'cases/creation'; - $this->config->expects(self::once()) - ->method('isActive') - ->willReturn(false); - - $this->fakeObjectManager->expects(self::once()) - ->method('create') - ->with(StubUpdatingService::class) - ->willReturn(new StubUpdatingService()); - - $instance = $this->factory->create($type); - static::assertInstanceOf(StubUpdatingService::class, $instance); - } - - /** - * Checks type of instance for updating service if test type is received. - * - * @covers \Magento\Signifyd\Model\CaseServices\UpdatingServiceFactory::create - */ - public function testCreateWithTestType() - { - $type = 'cases/test'; - $this->config->expects(self::once()) - ->method('isActive') - ->willReturn(true); - - $this->fakeObjectManager->expects(self::once()) - ->method('create') - ->with(StubUpdatingService::class) - ->willReturn(new StubUpdatingService()); - - $instance = $this->factory->create($type); - static::assertInstanceOf(StubUpdatingService::class, $instance); - } - - /** - * Checks exception type and message for unknown case type. - * - * @covers \Magento\Signifyd\Model\CaseServices\UpdatingServiceFactory::create - * @expectedException \InvalidArgumentException - * @expectedExceptionMessage Specified message type does not supported. - */ - public function testCreateWithException() - { - $type = 'cases/unknown'; - $this->config->expects(self::once()) - ->method('isActive') - ->willReturn(true); - - $this->generatorFactory->expects(self::once()) - ->method('create') - ->with($type) - ->willThrowException(new \InvalidArgumentException('Specified message type does not supported.')); - - $this->factory->create($type); - } - - /** - * Checks if factory creates correct instance of case updating service. - * - * @covers \Magento\Signifyd\Model\CaseServices\UpdatingServiceFactory::create - */ - public function testCreate() - { - $type = 'case/creation'; - $this->config->expects(self::once()) - ->method('isActive') - ->willReturn(true); - - $messageGenerator = $this->getMockBuilder(GeneratorInterface::class) - ->disableOriginalConstructor() - ->getMock(); - $this->generatorFactory->expects(self::once()) - ->method('create') - ->with($type) - ->willReturn($messageGenerator); - - $service = $this->getMockBuilder(UpdatingService::class) - ->disableOriginalConstructor() - ->getMock(); - - $this->fakeObjectManager->expects(self::once()) - ->method('create') - ->with(UpdatingService::class, ['messageGenerator' => $messageGenerator]) - ->willReturn($service); - - $result = $this->factory->create($type); - static::assertInstanceOf(UpdatingService::class, $result); - } -} diff --git a/app/code/Magento/Signifyd/Test/Unit/Model/CaseServices/UpdatingServiceTest.php b/app/code/Magento/Signifyd/Test/Unit/Model/CaseServices/UpdatingServiceTest.php deleted file mode 100644 index 6eb7e5c37d5fc..0000000000000 --- a/app/code/Magento/Signifyd/Test/Unit/Model/CaseServices/UpdatingServiceTest.php +++ /dev/null @@ -1,316 +0,0 @@ -<?php -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ -namespace Magento\Signifyd\Test\Unit\Model\CaseServices; - -use Magento\Framework\TestFramework\Unit\Helper\ObjectManager; -use Magento\Signifyd\Api\CaseRepositoryInterface; -use Magento\Signifyd\Api\Data\CaseInterface; -use Magento\Signifyd\Model\CaseServices\UpdatingService; -use Magento\Signifyd\Model\CommentsHistoryUpdater; -use Magento\Signifyd\Model\MessageGenerators\GeneratorException; -use Magento\Signifyd\Model\MessageGenerators\GeneratorInterface; -use Magento\Signifyd\Model\OrderStateService; -use Magento\Signifyd\Model\SalesOrderGrid\OrderGridUpdater; -use PHPUnit_Framework_MockObject_MockObject as MockObject; - -/** - * Contains tests with different negative and positive scenarios for case updating service. - */ -class UpdatingServiceTest extends \PHPUnit\Framework\TestCase -{ - /** - * @var UpdatingService - */ - private $service; - - /** - * @var ObjectManager - */ - private $objectManager; - - /** - * @var GeneratorInterface|MockObject - */ - private $messageGenerator; - - /** - * @var CaseRepositoryInterface|MockObject - */ - private $caseRepository; - - /** - * @var CommentsHistoryUpdater|MockObject - */ - private $commentsHistoryUpdater; - - /** - * @var OrderGridUpdater|MockObject - */ - private $orderGridUpdater; - - /** - * @var OrderStateService|MockObject - */ - private $orderStateService; - - /** - * @inheritdoc - */ - protected function setUp() - { - $this->objectManager = new ObjectManager($this); - - $this->messageGenerator = $this->getMockBuilder(GeneratorInterface::class) - ->disableOriginalConstructor() - ->setMethods(['generate']) - ->getMock(); - - $this->caseRepository = $this->getMockBuilder(CaseRepositoryInterface::class) - ->disableOriginalConstructor() - ->setMethods(['getByCaseId']) - ->getMockForAbstractClass(); - - $this->commentsHistoryUpdater = $this->getMockBuilder(CommentsHistoryUpdater::class) - ->disableOriginalConstructor() - ->setMethods(['addComment']) - ->getMock(); - - $this->orderGridUpdater = $this->getMockBuilder(OrderGridUpdater::class) - ->disableOriginalConstructor() - ->getMock(); - - $this->orderStateService = $this->getMockBuilder(OrderStateService::class) - ->disableOriginalConstructor() - ->getMock(); - - $this->service = $this->objectManager->getObject(UpdatingService::class, [ - 'messageGenerator' => $this->messageGenerator, - 'caseRepository' => $this->caseRepository, - 'commentsHistoryUpdater' => $this->commentsHistoryUpdater, - 'orderGridUpdater' => $this->orderGridUpdater, - 'orderStateService' => $this->orderStateService - ]); - } - - /** - * Checks a test case when Signifyd case is empty entity. - * - * @covers \Magento\Signifyd\Model\CaseServices\UpdatingService::update - * @expectedException \Magento\Framework\Exception\LocalizedException - * @expectedExceptionMessage The case entity should not be empty. - */ - public function testUpdateWithEmptyCaseEntity() - { - $data = []; - $caseEntity = $this->withCaseEntity(null, 123, $data); - - $this->service->update($caseEntity, $data); - } - - /** - * Checks a test case when Signifyd case id is not specified for a case entity. - * - * @covers \Magento\Signifyd\Model\CaseServices\UpdatingService::update - * @expectedException \Magento\Framework\Exception\LocalizedException - * @expectedExceptionMessage The case entity should not be empty. - */ - public function testUpdateWithEmptyCaseId() - { - $data = [ - 'caseId' => 123 - ]; - $caseEntity = $this->withCaseEntity(1, null, $data); - - $this->service->update($caseEntity, $data); - } - - /** - * Checks as test case when service cannot save Signifyd case entity - * - * @covers \Magento\Signifyd\Model\CaseServices\UpdatingService::update - * @expectedException \Magento\Framework\Exception\LocalizedException - * @expectedExceptionMessage Cannot update Case entity. - */ - public function testUpdateWithFailedCaseSaving() - { - $caseId = 123; - $data = [ - 'caseId' => $caseId, - 'status' => CaseInterface::STATUS_OPEN, - 'orderId' => '10000012', - 'score' => 500 - ]; - - $caseEntity = $this->withCaseEntity(1, $caseId, $data); - - $this->caseRepository->expects(self::once()) - ->method('save') - ->willThrowException(new \Exception('Something wrong.')); - - $this->service->update($caseEntity, $data); - } - - /** - * Checks as test case when message generator throws an exception - * - * @covers \Magento\Signifyd\Model\CaseServices\UpdatingService::update - * @expectedException \Magento\Framework\Exception\LocalizedException - * @expectedExceptionMessage Cannot update Case entity. - */ - public function testUpdateWithExceptionFromMessageGenerator() - { - $caseId = 123; - $data = [ - 'caseId' => $caseId - ]; - - $caseEntity = $this->withCaseEntity(1, $caseId, $data); - - $this->caseRepository->expects(self::never()) - ->method('save') - ->with($caseEntity) - ->willReturn($caseEntity); - - $this->messageGenerator->expects(self::once()) - ->method('generate') - ->with($data) - ->willThrowException(new GeneratorException(__('Cannot generate message.'))); - - $this->service->update($caseEntity, $data); - } - - /** - * Checks a test case when comments history updater throws an exception. - * - * @covers \Magento\Signifyd\Model\CaseServices\UpdatingService::update - * @expectedException \Magento\Framework\Exception\LocalizedException - * @expectedExceptionMessage Cannot update Case entity. - */ - public function testUpdateWithFailedCommentSaving() - { - $caseId = 123; - $data = [ - 'caseId' => $caseId, - 'orderId' => 1 - ]; - - $caseEntity = $this->withCaseEntity(1, $caseId, $data); - - $this->caseRepository->expects(self::once()) - ->method('save') - ->with($caseEntity) - ->willReturn($caseEntity); - - $this->orderGridUpdater->expects(self::once()) - ->method('update') - ->with($data['orderId']); - - $message = __('Message is generated.'); - $this->messageGenerator->expects(self::once()) - ->method('generate') - ->with($data) - ->willReturn($message); - - $this->commentsHistoryUpdater->expects(self::once()) - ->method('addComment') - ->with($caseEntity, $message) - ->willThrowException(new \Exception('Something wrong')); - - $this->service->update($caseEntity, $data); - } - - /** - * Checks a test case when Signifyd case entity is successfully updated and message stored in comments history. - * - * @covers \Magento\Signifyd\Model\CaseServices\UpdatingService::update - */ - public function testUpdate() - { - $caseId = 123; - $data = [ - 'caseId' => $caseId, - 'orderId' => 1 - ]; - - $caseEntity = $this->withCaseEntity(21, $caseId, $data); - - $caseEntitySaved = clone $caseEntity; - $caseEntitySaved->expects(self::once()) - ->method('getGuaranteeDisposition') - ->willReturn('APPROVED'); - - $this->caseRepository->expects(self::once()) - ->method('save') - ->with($caseEntity) - ->willReturn($caseEntitySaved); - - $message = __('Message is generated.'); - $this->messageGenerator->expects(self::once()) - ->method('generate') - ->with($data) - ->willReturn($message); - - $this->orderGridUpdater->expects(self::once()) - ->method('update') - ->with($data['orderId']); - - $this->commentsHistoryUpdater->expects(self::once()) - ->method('addComment') - ->with($caseEntitySaved, $message); - - $this->orderStateService->expects(self::once()) - ->method('updateByCase') - ->with($caseEntitySaved); - - $this->service->update($caseEntity, $data); - } - - /** - * Create mock for case entity with common scenarios. - * - * @param $caseEntityId - * @param $caseId - * @param array $data - * @return CaseInterface|MockObject - */ - private function withCaseEntity($caseEntityId, $caseId, array $data = []) - { - /** @var CaseInterface|MockObject $caseEntity */ - $caseEntity = $this->getMockBuilder(CaseInterface::class) - ->disableOriginalConstructor() - ->setMethods([ - 'getEntityId', 'getCaseId', 'getOrderId', - 'setCaseId', 'setStatus', 'setOrderId', 'setScore' - ]) - ->getMockForAbstractClass(); - - $caseEntity->expects(self::any()) - ->method('getEntityId') - ->willReturn($caseEntityId); - $caseEntity->expects(self::any()) - ->method('getCaseId') - ->willReturn($caseId); - - foreach ($data as $property => $value) { - $method = 'set' . ucfirst($property); - if ($property === 'orderId') { - $caseEntity->expects(self::never()) - ->method($method); - } - $caseEntity->expects(self::any()) - ->method($method) - ->with(self::equalTo($value)) - ->willReturnSelf(); - - $method = 'get' . ucfirst($property); - $caseEntity->expects(self::any()) - ->method($method) - ->willReturn($value); - } - - return $caseEntity; - } -} diff --git a/app/code/Magento/Signifyd/Test/Unit/Model/CommentsHistoryUpdaterTest.php b/app/code/Magento/Signifyd/Test/Unit/Model/CommentsHistoryUpdaterTest.php deleted file mode 100644 index 5cbb3d8d93cdd..0000000000000 --- a/app/code/Magento/Signifyd/Test/Unit/Model/CommentsHistoryUpdaterTest.php +++ /dev/null @@ -1,176 +0,0 @@ -<?php -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ -namespace Magento\Signifyd\Test\Unit\Model; - -use Magento\Framework\TestFramework\Unit\Helper\ObjectManager; -use Magento\Sales\Api\Data\OrderStatusHistoryInterface; -use Magento\Sales\Model\Order\Status\HistoryFactory; -use Magento\Signifyd\Api\Data\CaseInterface; -use Magento\Signifyd\Model\CommentsHistoryUpdater; -use PHPUnit_Framework_MockObject_MockObject as MockObject; -use Magento\Sales\Api\OrderStatusHistoryRepositoryInterface; - -/** - * Contains tests for comments history updater class. - */ -class CommentsHistoryUpdaterTest extends \PHPUnit\Framework\TestCase -{ - /** - * @var int - */ - private static $orderId = 123; - - /** - * @var string - */ - private static $message = 'Case is created.'; - - /** - * @var string - */ - private static $status = 'On Hold'; - - /** - * @var CommentsHistoryUpdater - */ - private $updater; - - /** - * @var HistoryFactory|MockObject - */ - private $historyFactory; - - /** - * @var CaseInterface|MockObject - */ - private $caseEntity; - - /** - * @var OrderStatusHistoryInterface|MockObject - */ - private $historyEntity; - - /** - * @var OrderStatusHistoryRepositoryInterface|MockObject - */ - private $historyRepository; - - /** - * @inheritdoc - */ - protected function setUp() - { - $objectManager = new ObjectManager($this); - - $this->historyFactory = $this->getMockBuilder(HistoryFactory::class) - ->disableOriginalConstructor() - ->setMethods(['create', 'save']) - ->getMock(); - - $this->historyRepository = $this->getMockBuilder(OrderStatusHistoryRepositoryInterface::class) - ->getMockForAbstractClass(); - - $this->caseEntity = $this->getMockBuilder(CaseInterface::class) - ->disableOriginalConstructor() - ->setMethods(['getOrderId']) - ->getMockForAbstractClass(); - - $this->initCommentMock(); - - $this->updater = $objectManager->getObject(CommentsHistoryUpdater::class, [ - 'historyFactory' => $this->historyFactory, - 'historyRepository' => $this->historyRepository - ]); - } - - /** - * Checks a test case when updater throws an exception while saving history comment. - * - * @covers \Magento\Signifyd\Model\CommentsHistoryUpdater::addComment - * @expectedException \Exception - */ - public function testAddCommentWithException() - { - $this->caseEntity->expects(self::once()) - ->method('getOrderId') - ->willReturn(self::$orderId); - - $this->historyEntity->method('setStatus') - ->with('') - ->willReturnSelf(); - $this->historyRepository->expects(self::once()) - ->method('save') - ->with($this->historyEntity) - ->willThrowException(new \Exception('Cannot save comment message.')); - - $this->updater->addComment($this->caseEntity, __(self::$message)); - } - - /** - * Checks a test case when updater successfully saves history comment. - * - * @covers \Magento\Signifyd\Model\CommentsHistoryUpdater::addComment - */ - public function testAddComment() - { - $this->caseEntity->expects(self::once()) - ->method('getOrderId') - ->willReturn(self::$orderId); - - $this->historyEntity->method('setStatus') - ->with(self::$status) - ->willReturnSelf(); - $this->historyRepository->expects(self::once()) - ->method('save') - ->with($this->historyEntity) - ->willReturnSelf(); - - $this->updater->addComment($this->caseEntity, __(self::$message), self::$status); - } - - /** - * Checks a test when message does not specified. - * - * @covers \Magento\Signifyd\Model\CommentsHistoryUpdater::addComment - */ - public function testAddCommentWithoutMessage() - { - $this->caseEntity->expects(self::never()) - ->method('getOrderId'); - - $this->historyFactory->expects(self::never()) - ->method('save'); - - $phrase = ''; - $this->updater->addComment($this->caseEntity, __($phrase)); - } - - /** - * Creates mock object for history entity. - * - * @return void - */ - private function initCommentMock() - { - $this->historyEntity = $this->getMockBuilder(OrderStatusHistoryInterface::class) - ->disableOriginalConstructor() - ->setMethods(['setParentId', 'setComment', 'setEntityName', 'save']) - ->getMockForAbstractClass(); - - $this->historyFactory->method('create') - ->willReturn($this->historyEntity); - - $this->historyEntity->method('setParentId') - ->with(self::$orderId) - ->willReturnSelf(); - $this->historyEntity->method('setComment') - ->with(self::$message) - ->willReturnSelf(); - $this->historyEntity->method('setEntityName') - ->with('order') - ->willReturnSelf(); - } -} diff --git a/app/code/Magento/Signifyd/Test/Unit/Model/CustomerOrdersTest.php b/app/code/Magento/Signifyd/Test/Unit/Model/CustomerOrdersTest.php deleted file mode 100644 index 02d3b4b9ad7a7..0000000000000 --- a/app/code/Magento/Signifyd/Test/Unit/Model/CustomerOrdersTest.php +++ /dev/null @@ -1,267 +0,0 @@ -<?php -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ -namespace Magento\Signifyd\Test\Unit\Model; - -use Magento\Directory\Model\Currency; -use Magento\Framework\Api\FilterBuilder; -use Magento\Framework\Api\SearchCriteriaBuilder; -use Magento\Framework\TestFramework\Unit\Helper\ObjectManager; -use Magento\Sales\Api\Data\OrderSearchResultInterface; -use Magento\Sales\Model\Order; -use Magento\Signifyd\Model\CustomerOrders; -use PHPUnit_Framework_MockObject_MockObject as MockObject; -use Magento\Sales\Api\OrderRepositoryInterface; -use Psr\Log\LoggerInterface; - -/** - * @SuppressWarnings(PHPMD.CouplingBetweenObjects) - */ -class CustomerOrdersTest extends \PHPUnit\Framework\TestCase -{ - /** - * @var int - */ - private static $customerId = 1; - - /** - * Order amount in EUR - * @var int - */ - private static $eurAmount = 100; - - /** - * Order amount in UAH - * @var int - */ - private static $uahAmount = 270; - - /** - * Order amount in USD - * @var int - */ - private static $usdAmount = 50; - - /** - * @var ObjectManager - */ - private $objectManager; - - /** - * @var FilterBuilder|MockObject - */ - private $filterBuilder; - - /** - * @var Currency|MockObject - */ - private $eurCurrency; - - /** - * @var Currency|MockObject - */ - private $uahCurrency; - - /** - * @var CustomerOrders - */ - private $model; - - /** - * @var OrderRepositoryInterface|MockObject - */ - private $orderRepository; - - /** - * @var SearchCriteriaBuilder|MockObject - */ - private $searchCriteriaBuilder; - - /** - * @var LoggerInterface|MockObject - */ - private $logger; - - /** - * @inheritdoc - */ - protected function setUp() - { - $this->objectManager = new ObjectManager($this); - - $this->orderRepository = $this->getMockBuilder(OrderRepositoryInterface::class) - ->getMockForAbstractClass(); - - $this->logger = $this->getMockBuilder(LoggerInterface::class) - ->getMockForAbstractClass(); - - $this->filterBuilder = $this->getMockBuilder(FilterBuilder::class) - ->disableOriginalConstructor() - ->getMock(); - - $this->searchCriteriaBuilder = $this->getMockBuilder(SearchCriteriaBuilder::class) - ->disableOriginalConstructor() - ->getMock(); - - $this->model = $this->objectManager->getObject(CustomerOrders::class, [ - 'filterBuilder' => $this->filterBuilder, - 'orderRepository' => $this->orderRepository, - 'searchCriteriaBuilder' => $this->searchCriteriaBuilder, - 'logger' => $this->logger - ]); - - $this->initCurrencies(); - $this->initOrderRepository(); - - $this->objectManager->setBackwardCompatibleProperty( - $this->model, - 'currencies', - ['EUR' => $this->eurCurrency, 'UAH' => $this->uahCurrency] - ); - } - - /** - * @covers \Magento\Signifyd\Model\CustomerOrders::getAggregatedOrdersInfo() - */ - public function testGetCountAndTotalAmount() - { - $this->eurCurrency->expects($this->once()) - ->method('convert') - ->with(self::$eurAmount, 'USD') - ->willReturn(109); - - $this->uahCurrency->expects($this->once()) - ->method('convert') - ->with(self::$uahAmount, 'USD') - ->willReturn(10.35); - - $actual = $this->model->getAggregatedOrdersInfo(self::$customerId); - - static::assertEquals(3, $actual['aggregateOrderCount']); - static::assertEquals(169.35, $actual['aggregateOrderDollars']); - } - - /** - * Test case when required currency rate is absent and exception is thrown - * @covers \Magento\Signifyd\Model\CustomerOrders::getAggregatedOrdersInfo() - */ - public function testGetCountAndTotalAmountNegative() - { - $this->eurCurrency->expects($this->once()) - ->method('convert') - ->with(self::$eurAmount, 'USD') - ->willReturn(109); - - $this->uahCurrency->expects($this->once()) - ->method('convert') - ->with(self::$uahAmount, 'USD') - ->willThrowException(new \Exception()); - - $this->logger->expects($this->once()) - ->method('error'); - - $actual = $this->model->getAggregatedOrdersInfo(self::$customerId); - - $this->assertNull($actual['aggregateOrderCount']); - $this->assertNull($actual['aggregateOrderDollars']); - } - - /** - * Populate order repository with mocked orders - */ - private function initOrderRepository() - { - $this->filterBuilder->expects($this->once()) - ->method('setField') - ->willReturnSelf(); - $this->filterBuilder->expects($this->once()) - ->method('setValue') - ->willReturnSelf(); - $filter = $this->getMockBuilder(\Magento\Framework\Api\Filter::class) - ->disableOriginalConstructor() - ->getMock(); - $this->filterBuilder->expects($this->once()) - ->method('create') - ->willReturn($filter); - - $searchCriteria = $this->getMockBuilder(\Magento\Framework\Api\SearchCriteria::class) - ->disableOriginalConstructor() - ->getMock(); - $this->searchCriteriaBuilder->expects($this->once()) - ->method('create') - ->willReturn($searchCriteria); - - $orderSearchResult = $this->getMockBuilder(OrderSearchResultInterface::class) - ->getMockForAbstractClass(); - $orderSearchResult->expects($this->once()) - ->method('getItems') - ->willReturn($this->getOrders()); - $this->orderRepository->expects($this->once()) - ->method('getList') - ->willReturn($orderSearchResult); - } - - /** - * Creates mocks for currencies - * @return void - */ - private function initCurrencies() - { - $this->eurCurrency = $this->getMockBuilder(Currency::class) - ->disableOriginalConstructor() - ->setMethods(['convert']) - ->getMock(); - - $this->uahCurrency = $this->getMockBuilder(Currency::class) - ->disableOriginalConstructor() - ->setMethods(['convert']) - ->getMock(); - } - - /** - * Get list of mocked orders with different currencies - * @return array - */ - private function getOrders() - { - $eurOrder = $this->getMockBuilder(Order::class) - ->disableOriginalConstructor() - ->setMethods(['getBaseGrandTotal', 'getBaseCurrencyCode']) - ->getMock(); - - $eurOrder->expects($this->once()) - ->method('getBaseGrandTotal') - ->willReturn(self::$eurAmount); - $eurOrder->expects($this->once()) - ->method('getBaseCurrencyCode') - ->willReturn('EUR'); - - $uahOrder = $this->getMockBuilder(Order::class) - ->disableOriginalConstructor() - ->setMethods(['getBaseGrandTotal', 'getBaseCurrencyCode']) - ->getMock(); - - $uahOrder->expects($this->once()) - ->method('getBaseGrandTotal') - ->willReturn(self::$uahAmount); - $uahOrder->expects($this->once()) - ->method('getBaseCurrencyCode') - ->willReturn('UAH'); - - $usdOrder = $this->getMockBuilder(Order::class) - ->disableOriginalConstructor() - ->setMethods(['getBaseGrandTotal', 'getBaseCurrencyCode']) - ->getMock(); - - $usdOrder->expects($this->once()) - ->method('getBaseGrandTotal') - ->willReturn(self::$usdAmount); - $usdOrder->expects($this->once()) - ->method('getBaseCurrencyCode') - ->willReturn('USD'); - - return [$usdOrder, $eurOrder, $uahOrder]; - } -} diff --git a/app/code/Magento/Signifyd/Test/Unit/Model/Guarantee/CancelGuaranteeAbilityTest.php b/app/code/Magento/Signifyd/Test/Unit/Model/Guarantee/CancelGuaranteeAbilityTest.php deleted file mode 100644 index f7b4e473a0ec8..0000000000000 --- a/app/code/Magento/Signifyd/Test/Unit/Model/Guarantee/CancelGuaranteeAbilityTest.php +++ /dev/null @@ -1,154 +0,0 @@ -<?php -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ -namespace Magento\Signifyd\Test\Unit\Model\Guarantee; - -use Magento\Framework\Exception\NoSuchEntityException; -use Magento\Sales\Api\Data\OrderInterface; -use Magento\Sales\Api\OrderRepositoryInterface; -use Magento\Signifyd\Api\Data\CaseInterface; -use Magento\Signifyd\Model\CaseEntity; -use Magento\Signifyd\Model\CaseManagement; -use Magento\Signifyd\Model\Guarantee\CancelGuaranteeAbility; - -/** - * @SuppressWarnings(PHPMD.CouplingBetweenObjects) - */ -class CancelGuaranteeAbilityTest extends \PHPUnit\Framework\TestCase -{ - /** - * @var OrderRepositoryInterface|\PHPUnit_Framework_MockObject_MockObject - */ - private $orderRepository; - - /** - * @var CaseManagement|\PHPUnit_Framework_MockObject_MockObject - */ - private $caseManagement; - - /** - * @var CancelGuaranteeAbility - */ - private $cancelGuaranteeAbility; - - /** - * @inheritdoc - */ - protected function setUp() - { - $this->orderRepository = $this->getMockBuilder(OrderRepositoryInterface::class) - ->getMockForAbstractClass(); - - $this->caseManagement = $this->getMockBuilder(CaseManagement::class) - ->disableOriginalConstructor() - ->getMock(); - - $this->cancelGuaranteeAbility = new CancelGuaranteeAbility( - $this->caseManagement, - $this->orderRepository - ); - } - - /** - * Success test for Cancel Guarantee Request button - */ - public function testIsAvailableSuccess() - { - $orderId = 123; - - /** @var CaseInterface|\PHPUnit_Framework_MockObject_MockObject $case */ - $case = $this->getMockBuilder(CaseInterface::class) - ->disableOriginalConstructor() - ->getMock(); - - $case->expects($this->once()) - ->method('getGuaranteeDisposition') - ->willReturn(CaseEntity::GUARANTEE_APPROVED); - - $this->caseManagement->expects($this->once()) - ->method('getByOrderId') - ->with($orderId) - ->willReturn($case); - - /** @var OrderInterface|\PHPUnit_Framework_MockObject_MockObject $order */ - $order = $this->getMockBuilder(OrderInterface::class) - ->getMockForAbstractClass(); - - $this->orderRepository->expects($this->once()) - ->method('get') - ->with($orderId) - ->willReturn($order); - - $this->assertTrue($this->cancelGuaranteeAbility->isAvailable($orderId)); - } - - /** - * Tests case when Case entity doesn't exist for order - */ - public function testIsAvailableWithNullCase() - { - $orderId = 123; - - $this->caseManagement->expects($this->once()) - ->method('getByOrderId') - ->with($orderId) - ->willReturn(null); - - $this->assertFalse($this->cancelGuaranteeAbility->isAvailable($orderId)); - } - - /** - * Tests case when Guarantee Disposition has Canceled states. - */ - public function testIsAvailableWithCanceledGuarantee() - { - $orderId = 123; - - /** @var CaseInterface|\PHPUnit_Framework_MockObject_MockObject $case */ - $case = $this->getMockBuilder(CaseInterface::class) - ->disableOriginalConstructor() - ->getMock(); - - $case->expects($this->once()) - ->method('getGuaranteeDisposition') - ->willReturn(CaseEntity::GUARANTEE_CANCELED); - - $this->caseManagement->expects($this->once()) - ->method('getByOrderId') - ->with($orderId) - ->willReturn($case); - - $this->assertFalse($this->cancelGuaranteeAbility->isAvailable($orderId)); - } - - /** - * Tests case when order does not exist. - */ - public function testIsAvailableWithNullOrder() - { - $orderId = 123; - - /** @var CaseInterface|\PHPUnit_Framework_MockObject_MockObject $case */ - $case = $this->getMockBuilder(CaseInterface::class) - ->disableOriginalConstructor() - ->getMock(); - - $case->expects($this->once()) - ->method('getGuaranteeDisposition') - ->willReturn(CaseEntity::GUARANTEE_APPROVED); - - $this->caseManagement->expects($this->once()) - ->method('getByOrderId') - ->with($orderId) - ->willReturn($case); - - $this->orderRepository->expects($this->once()) - ->method('get') - ->with($orderId) - ->willThrowException(new NoSuchEntityException()); - - $this->assertFalse($this->cancelGuaranteeAbility->isAvailable($orderId)); - } -} diff --git a/app/code/Magento/Signifyd/Test/Unit/Model/Guarantee/CancelingServiceTest.php b/app/code/Magento/Signifyd/Test/Unit/Model/Guarantee/CancelingServiceTest.php deleted file mode 100644 index f8f1d4a4522c9..0000000000000 --- a/app/code/Magento/Signifyd/Test/Unit/Model/Guarantee/CancelingServiceTest.php +++ /dev/null @@ -1,215 +0,0 @@ -<?php -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ -namespace Magento\Signifyd\Test\Unit\Model\Guarantee; - -use Magento\Signifyd\Api\CaseManagementInterface; -use Magento\Signifyd\Api\Data\CaseInterface; -use Magento\Signifyd\Model\CaseServices\StubUpdatingService; -use Magento\Signifyd\Model\CaseServices\UpdatingServiceFactory; -use Magento\Signifyd\Model\Guarantee\CancelGuaranteeAbility; -use Magento\Signifyd\Model\Guarantee\CancelingService; -use Magento\Signifyd\Model\SignifydGateway\Gateway; -use Magento\Signifyd\Model\SignifydGateway\GatewayException; -use PHPUnit_Framework_MockObject_MockObject as MockObject; -use Psr\Log\LoggerInterface; - -/** - * Contains test cases for Signifyd guarantee canceling service. - */ -class CancelingServiceTest extends \PHPUnit\Framework\TestCase -{ - /** - * @var int - */ - private static $orderId = 23; - - /** - * @var int - */ - private static $caseId = 123; - - /** - * @var CancelingService - */ - private $service; - - /** - * @var CaseManagementInterface|MockObject - */ - private $caseManagement; - - /** - * @var UpdatingServiceFactory|MockObject - */ - private $updatingFactory; - - /** - * @var Gateway|MockObject - */ - private $gateway; - - /** - * @var CancelGuaranteeAbility|MockObject - */ - private $guaranteeAbility; - - /** - * @var LoggerInterface|MockObject - */ - private $logger; - - /** - * @inheritdoc - */ - protected function setUp() - { - $this->caseManagement = $this->getMockBuilder(CaseManagementInterface::class) - ->disableOriginalConstructor() - ->setMethods(['getByOrderId']) - ->getMockForAbstractClass(); - - $this->updatingFactory = $this->getMockBuilder(UpdatingServiceFactory::class) - ->disableOriginalConstructor() - ->setMethods(['create']) - ->getMock(); - - $this->gateway = $this->getMockBuilder(Gateway::class) - ->disableOriginalConstructor() - ->setMethods(['cancelGuarantee']) - ->getMock(); - - $this->guaranteeAbility = $this->getMockBuilder(CancelGuaranteeAbility::class) - ->disableOriginalConstructor() - ->setMethods(['isAvailable']) - ->getMock(); - - $this->logger = $this->getMockBuilder(LoggerInterface::class) - ->disableOriginalConstructor() - ->setMethods(['error']) - ->getMockForAbstractClass(); - - $this->service = new CancelingService( - $this->caseManagement, - $this->updatingFactory, - $this->gateway, - $this->guaranteeAbility, - $this->logger - ); - } - - /** - * Checks a test case, when validation for a guarantee is failed. - * - * @covers \Magento\Signifyd\Model\Guarantee\CancelingService::cancelForOrder - */ - public function testCancelForOrderWithUnavailableDisposition() - { - $this->guaranteeAbility->expects(self::once()) - ->method('isAvailable') - ->with(self::equalTo(self::$orderId)) - ->willReturn(false); - - $this->caseManagement->expects(self::never()) - ->method('getByOrderId'); - - $this->gateway->expects(self::never()) - ->method('cancelGuarantee'); - - $this->logger->expects(self::never()) - ->method('error'); - - $this->updatingFactory->expects(self::never()) - ->method('create'); - - $result = $this->service->cancelForOrder(self::$orderId); - self::assertFalse($result); - } - - /** - * Checks a test case, when request to Signifyd API fails. - * - * @covers \Magento\Signifyd\Model\Guarantee\CancelingService::cancelForOrder - */ - public function testCancelForOrderWithFailedRequest() - { - $this->withCaseEntity(); - - $this->gateway->expects(self::once()) - ->method('cancelGuarantee') - ->with(self::equalTo(self::$caseId)) - ->willThrowException(new GatewayException('Something wrong.')); - - $this->logger->expects(self::once()) - ->method('error') - ->with(self::equalTo('Something wrong.')); - - $this->updatingFactory->expects(self::never()) - ->method('create'); - - $result = $this->service->cancelForOrder(self::$orderId); - self::assertFalse($result); - } - - /** - * Checks a test case, when request to Signifyd successfully processed and case entity has been updated. - * - * @covers \Magento\Signifyd\Model\Guarantee\CancelingService::cancelForOrder - */ - public function testCancelForOrder() - { - $case = $this->withCaseEntity(); - - $this->gateway->expects(self::once()) - ->method('cancelGuarantee') - ->with(self::equalTo(self::$caseId)) - ->willReturn(CaseInterface::GUARANTEE_CANCELED); - - $this->logger->expects(self::never()) - ->method('error'); - - $service = $this->getMockBuilder(StubUpdatingService::class) - ->setMethods(['update']) - ->getMock(); - $this->updatingFactory->expects(self::once()) - ->method('create') - ->willReturn($service); - - $service->expects(self::once()) - ->method('update') - ->with(self::equalTo($case), self::equalTo(['guaranteeDisposition' => CaseInterface::GUARANTEE_CANCELED])); - - $result = $this->service->cancelForOrder(self::$orderId); - self::assertTrue($result); - } - - /** - * Gets mock for a case entity. - * - * @return CaseInterface|MockObject - */ - private function withCaseEntity() - { - $this->guaranteeAbility->expects(self::once()) - ->method('isAvailable') - ->with(self::equalTo(self::$orderId)) - ->willReturn(true); - - $caseEntity = $this->getMockBuilder(CaseInterface::class) - ->disableOriginalConstructor() - ->setMethods(['getCaseId']) - ->getMockForAbstractClass(); - - $this->caseManagement->expects(self::once()) - ->method('getByOrderId') - ->with(self::equalTo(self::$orderId)) - ->willReturn($caseEntity); - - $caseEntity->expects(self::once()) - ->method('getCaseId') - ->willReturn(self::$caseId); - return $caseEntity; - } -} diff --git a/app/code/Magento/Signifyd/Test/Unit/Model/Guarantee/CreateGuaranteeAbilityTest.php b/app/code/Magento/Signifyd/Test/Unit/Model/Guarantee/CreateGuaranteeAbilityTest.php deleted file mode 100644 index 6b7a6112a932e..0000000000000 --- a/app/code/Magento/Signifyd/Test/Unit/Model/Guarantee/CreateGuaranteeAbilityTest.php +++ /dev/null @@ -1,260 +0,0 @@ -<?php -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ -namespace Magento\Signifyd\Test\Unit\Model\Guarantee; - -use Magento\Framework\Exception\NoSuchEntityException; -use Magento\Framework\Intl\DateTimeFactory; -use Magento\Sales\Api\Data\OrderInterface; -use Magento\Sales\Api\OrderRepositoryInterface; -use Magento\Sales\Model\Order; -use Magento\Signifyd\Api\Data\CaseInterface; -use Magento\Signifyd\Model\CaseManagement; -use Magento\Signifyd\Model\Guarantee\CreateGuaranteeAbility; - -/** - * @SuppressWarnings(PHPMD.CouplingBetweenObjects) - */ -class CreateGuaranteeAbilityTest extends \PHPUnit\Framework\TestCase -{ - /** - * @var DateTimeFactory - */ - private $dateTimeFactory; - - /** - * @var OrderRepositoryInterface|\PHPUnit_Framework_MockObject_MockObject - */ - private $orderRepository; - - /** - * @var CaseManagement|\PHPUnit_Framework_MockObject_MockObject - */ - private $caseManagement; - - /** - * @var CreateGuaranteeAbility - */ - private $createGuaranteeAbility; - - /** - * @inheritdoc - */ - protected function setUp() - { - $this->dateTimeFactory = new DateTimeFactory(); - $this->orderRepository = $this->getMockBuilder(OrderRepositoryInterface::class) - ->getMockForAbstractClass(); - $this->caseManagement = $this->getMockBuilder(CaseManagement::class) - ->disableOriginalConstructor() - ->getMock(); - - $this->createGuaranteeAbility = new CreateGuaranteeAbility( - $this->caseManagement, - $this->orderRepository, - $this->dateTimeFactory - ); - } - - public function testIsAvailableSuccess() - { - $orderId = 123; - $orderCreatedAt = $this->getDateAgo(6); - - /** @var CaseInterface|\PHPUnit_Framework_MockObject_MockObject $case */ - $case = $this->getMockBuilder(CaseInterface::class) - ->disableOriginalConstructor() - ->getMock(); - $case->expects($this->once()) - ->method('isGuaranteeEligible') - ->willReturn(true); - - $this->caseManagement->expects($this->once()) - ->method('getByOrderId') - ->with($orderId) - ->willReturn($case); - - /** @var OrderInterface|\PHPUnit_Framework_MockObject_MockObject $order */ - $order = $this->getMockBuilder(OrderInterface::class) - ->getMockForAbstractClass(); - $order->expects($this->once()) - ->method('getState') - ->willReturn(Order::STATE_COMPLETE); - $order->expects($this->once()) - ->method('getCreatedAt') - ->willReturn($orderCreatedAt); - - $this->orderRepository->expects($this->once()) - ->method('get') - ->with($orderId) - ->willReturn($order); - - $this->assertTrue($this->createGuaranteeAbility->isAvailable($orderId)); - } - - /** - * Tests case when Case entity doesn't exist for order - */ - public function testIsAvailableWithNullCase() - { - $orderId = 123; - - $this->caseManagement->expects($this->once()) - ->method('getByOrderId') - ->with($orderId) - ->willReturn(null); - - $this->assertFalse($this->createGuaranteeAbility->isAvailable($orderId)); - } - - /** - * Tests case when GuaranteeEligible for Case is false - */ - public function testIsAvailableWithGuarantyEligibleFalse() - { - $orderId = 123; - - /** @var CaseInterface|\PHPUnit_Framework_MockObject_MockObject $case */ - $case = $this->getMockBuilder(CaseInterface::class) - ->disableOriginalConstructor() - ->getMock(); - $case->expects($this->once()) - ->method('isGuaranteeEligible') - ->willReturn(false); - - $this->caseManagement->expects($this->once()) - ->method('getByOrderId') - ->with($orderId) - ->willReturn($case); - - $this->assertFalse($this->createGuaranteeAbility->isAvailable($orderId)); - } - - /** - * Tests case when GuaranteeEligible for Case is false - */ - public function testIsAvailableWithNullOrder() - { - $orderId = 123; - - /** @var CaseInterface|\PHPUnit_Framework_MockObject_MockObject $case */ - $case = $this->getMockBuilder(CaseInterface::class) - ->disableOriginalConstructor() - ->getMock(); - $case->expects($this->once()) - ->method('isGuaranteeEligible') - ->willReturn(true); - - $this->caseManagement->expects($this->once()) - ->method('getByOrderId') - ->with($orderId) - ->willReturn($case); - - $this->orderRepository->expects($this->once()) - ->method('get') - ->with($orderId) - ->willThrowException(new NoSuchEntityException()); - - $this->assertFalse($this->createGuaranteeAbility->isAvailable($orderId)); - } - - /** - * Tests case when order has Canceled Or Closed states. - * - * @param string $state - * @dataProvider isAvailableWithCanceledOrderDataProvider - */ - public function testIsAvailableWithCanceledOrder($state) - { - $orderId = 123; - - /** @var CaseInterface|\PHPUnit_Framework_MockObject_MockObject $case */ - $case = $this->getMockBuilder(CaseInterface::class) - ->disableOriginalConstructor() - ->getMock(); - $case->expects($this->once()) - ->method('isGuaranteeEligible') - ->willReturn(true); - - $this->caseManagement->expects($this->once()) - ->method('getByOrderId') - ->with($orderId) - ->willReturn($case); - - /** @var OrderInterface|\PHPUnit_Framework_MockObject_MockObject $order */ - $order = $this->getMockBuilder(OrderInterface::class) - ->getMockForAbstractClass(); - $order->expects($this->once()) - ->method('getState') - ->willReturn($state); - - $this->orderRepository->expects($this->once()) - ->method('get') - ->with($orderId) - ->willReturn($order); - - $this->assertFalse($this->createGuaranteeAbility->isAvailable($orderId)); - } - - /** - * @return array - */ - public function isAvailableWithCanceledOrderDataProvider() - { - return [ - [Order::STATE_CANCELED], [Order::STATE_CLOSED] - ]; - } - - public function testIsAvailableWithOldOrder() - { - $orderId = 123; - $orderCreatedAt = $this->getDateAgo(8); - - /** @var CaseInterface|\PHPUnit_Framework_MockObject_MockObject $case */ - $case = $this->getMockBuilder(CaseInterface::class) - ->disableOriginalConstructor() - ->getMock(); - $case->expects($this->once()) - ->method('isGuaranteeEligible') - ->willReturn(true); - - $this->caseManagement->expects($this->once()) - ->method('getByOrderId') - ->with($orderId) - ->willReturn($case); - - /** @var OrderInterface|\PHPUnit_Framework_MockObject_MockObject $order */ - $order = $this->getMockBuilder(OrderInterface::class) - ->getMockForAbstractClass(); - $order->expects($this->once()) - ->method('getState') - ->willReturn(Order::STATE_COMPLETE); - $order->expects($this->once()) - ->method('getCreatedAt') - ->willReturn($orderCreatedAt); - - $this->orderRepository->expects($this->once()) - ->method('get') - ->with($orderId) - ->willReturn($order); - - $this->assertFalse($this->createGuaranteeAbility->isAvailable($orderId)); - } - - /** - * Returns date N days ago - * - * @param int $days number of days that will be deducted from the current date - * @return string - */ - private function getDateAgo($days) - { - $createdAtTime = $this->dateTimeFactory->create('now', new \DateTimeZone('UTC')); - $createdAtTime->sub(new \DateInterval('P' . $days . 'D')); - - return $createdAtTime->format('Y-m-d h:i:s'); - } -} diff --git a/app/code/Magento/Signifyd/Test/Unit/Model/Guarantee/CreationServiceTest.php b/app/code/Magento/Signifyd/Test/Unit/Model/Guarantee/CreationServiceTest.php deleted file mode 100644 index db64b38375fe1..0000000000000 --- a/app/code/Magento/Signifyd/Test/Unit/Model/Guarantee/CreationServiceTest.php +++ /dev/null @@ -1,253 +0,0 @@ -<?php -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ -namespace Magento\Signifyd\Test\Unit\Model\Guarantee; - -use Magento\Signifyd\Api\CaseManagementInterface; -use Magento\Signifyd\Api\Data\CaseInterface; -use Magento\Signifyd\Model\CaseServices\UpdatingServiceFactory; -use Magento\Signifyd\Model\CaseServices\UpdatingServiceInterface; -use Magento\Signifyd\Model\Guarantee\CreateGuaranteeAbility; -use Magento\Signifyd\Model\Guarantee\CreationService; -use Magento\Signifyd\Model\SignifydGateway\Gateway; -use Magento\Signifyd\Model\SignifydGateway\GatewayException; -use PHPUnit_Framework_MockObject_MockObject as MockObject; -use \PHPUnit\Framework\TestCase as TestCase; -use Psr\Log\LoggerInterface; - -class CreationServiceTest extends TestCase -{ - /** - * @var CreationService|MockObject - */ - private $service; - - /** - * @var CaseManagementInterface|MockObject - */ - private $caseManagement; - - /** - * @var UpdatingServiceInterface|MockObject - */ - private $caseUpdatingService; - - /** - * @var Gateway|MockObject - */ - private $gateway; - - /** - * @var LoggerInterface|MockObject - */ - private $logger; - - /** - * @var CreateGuaranteeAbility|MockObject - */ - private $createGuaranteeAbility; - - /** - * @inheritdoc - */ - protected function setUp() - { - $this->caseManagement = $this->getMockBuilder(CaseManagementInterface::class) - ->getMockForAbstractClass(); - - $caseUpdatingServiceFactory = $this->getMockBuilder(UpdatingServiceFactory::class) - ->disableOriginalConstructor() - ->getMock(); - $this->caseUpdatingService = $this->getMockBuilder(UpdatingServiceInterface::class) - ->getMockForAbstractClass(); - $caseUpdatingServiceFactory - ->method('create') - ->willReturn($this->caseUpdatingService); - - $this->gateway = $this->getMockBuilder(Gateway::class) - ->disableOriginalConstructor() - ->getMock(); - - $this->createGuaranteeAbility = $this->getMockBuilder(CreateGuaranteeAbility::class) - ->disableOriginalConstructor() - ->setMethods(['isAvailable']) - ->getMock(); - - $this->logger = $this->getMockBuilder(LoggerInterface::class) - ->getMockForAbstractClass(); - - $this->service = new CreationService( - $this->caseManagement, - $caseUpdatingServiceFactory, - $this->gateway, - $this->createGuaranteeAbility, - $this->logger - ); - } - - /** - * Checks a test case, when guarantee ability checker does not allow to submit case for a guarantee. - * - * @covers \Magento\Signifyd\Model\Guarantee\CreationService::createForOrder - */ - public function testCreateForOrderWithNotEligibleCase() - { - $orderId = 1; - - $this->createGuaranteeAbility->expects(self::once()) - ->method('isAvailable') - ->with($orderId) - ->willReturn(false); - - $this->caseManagement->expects(self::never()) - ->method('getByOrderId'); - - $this->gateway->expects(self::never()) - ->method('submitCaseForGuarantee'); - - $result = $this->service->createForOrder($orderId); - self::assertFalse($result); - } - - public function testCreateForOrderWitCase() - { - $dummyOrderId = 1; - $dummyCaseId = 42; - $this->withCaseEntityExistsForOrderId( - $dummyOrderId, - [ - 'caseId' => $dummyCaseId, - ] - ); - - $this->gateway - ->expects($this->once()) - ->method('submitCaseForGuarantee'); - - $this->service->createForOrder($dummyOrderId); - } - - public function testCreateForOrderWithGatewayFailure() - { - $dummyOrderId = 1; - $dummyCaseId = 42; - $dummyGatewayFailureMessage = 'Everything fails sometimes'; - $this->withCaseEntityExistsForOrderId( - $dummyOrderId, - [ - 'caseId' => $dummyCaseId, - ] - ); - $this->withGatewayFailure($dummyGatewayFailureMessage); - - $this->logger - ->expects($this->once()) - ->method('error') - ->with($this->equalTo($dummyGatewayFailureMessage)); - $this->caseUpdatingService - ->expects($this->never()) - ->method('update'); - - $result = $this->service->createForOrder($dummyOrderId); - $this->assertEquals( - false, - $result, - 'Service should return false in case of gateway failure' - ); - } - - public function testCreateForOrderWithGatewaySuccess() - { - $dummyOrderId = 1; - $dummyCaseId = 42; - $dummyGuaranteeDisposition = 'foo'; - $caseEntity = $this->withCaseEntityExistsForOrderId( - $dummyOrderId, - [ - 'caseId' => $dummyCaseId, - ] - ); - $this->withGatewaySuccess($dummyGuaranteeDisposition); - - $this->caseUpdatingService - ->expects($this->once()) - ->method('update') - ->with($caseEntity, $this->equalTo([ - 'caseId' => $dummyCaseId, - 'guaranteeDisposition' => $dummyGuaranteeDisposition, - ])); - - $this->service->createForOrder($dummyOrderId); - } - - public function testCreateForOrderWithCaseUpdate() - { - $dummyOrderId = 1; - $dummyCaseId = 42; - $dummyGuaranteeDisposition = 'foo'; - $this->withCaseEntityExistsForOrderId( - $dummyOrderId, - [ - 'caseId' => $dummyCaseId, - ] - ); - $this->withGatewaySuccess($dummyGuaranteeDisposition); - - $result = $this->service->createForOrder($dummyOrderId); - $this->assertEquals( - true, - $result, - 'Service should return true in case if case update service is called' - ); - } - - /** - * @param $orderId - * @param array $caseData - * @return MockObject - */ - private function withCaseEntityExistsForOrderId($orderId, array $caseData = []) - { - $this->createGuaranteeAbility->expects(self::once()) - ->method('isAvailable') - ->with(self::equalTo($orderId)) - ->willReturn(true); - - $dummyCaseEntity = $this->getMockBuilder(CaseInterface::class) - ->getMockForAbstractClass(); - foreach ($caseData as $caseProperty => $casePropertyValue) { - $dummyCaseEntity - ->method('get' . ucfirst($caseProperty)) - ->willReturn($casePropertyValue); - } - - $this->caseManagement - ->method('getByOrderId') - ->with($this->equalTo($orderId)) - ->willReturn($dummyCaseEntity); - - return $dummyCaseEntity; - } - - /** - * @param $failureMessage - */ - private function withGatewayFailure($failureMessage) - { - $this->gateway - ->method('submitCaseForGuarantee') - ->willThrowException(new GatewayException($failureMessage)); - } - - /** - * @param $gatewayResult - */ - private function withGatewaySuccess($gatewayResult) - { - $this->gateway - ->method('submitCaseForGuarantee') - ->willReturn($gatewayResult); - } -} diff --git a/app/code/Magento/Signifyd/Test/Unit/Model/MessageGenerators/CaseRescoreTest.php b/app/code/Magento/Signifyd/Test/Unit/Model/MessageGenerators/CaseRescoreTest.php deleted file mode 100644 index ba14036cd68d0..0000000000000 --- a/app/code/Magento/Signifyd/Test/Unit/Model/MessageGenerators/CaseRescoreTest.php +++ /dev/null @@ -1,148 +0,0 @@ -<?php -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ -namespace Magento\Signifyd\Test\Unit\Model\MessageGenerators; - -use Magento\Framework\TestFramework\Unit\Helper\ObjectManager; -use Magento\Signifyd\Api\CaseRepositoryInterface; -use Magento\Signifyd\Api\Data\CaseInterface; -use Magento\Signifyd\Model\MessageGenerators\CaseRescore; -use PHPUnit_Framework_MockObject_MockObject as MockObject; - -/** - * Tests for Signifyd CaseRescore message generator. - * - * Class CaseRescoreTest - */ -class CaseRescoreTest extends \PHPUnit\Framework\TestCase -{ - private static $data = [ - 'caseId' => 100, - 'score' => 200 - ]; - - /** - * @var ObjectManager - */ - private $objectManager; - - /** - * @var CaseRepositoryInterface|MockObject - */ - private $caseRepository; - - /** - * @var CaseRescore|MockObject - */ - private $caseRescore; - - /** - * @var CaseInterface|MockObject - */ - private $case; - - /** - * @inheritdoc - */ - protected function setUp() - { - $this->case = $this->getMockBuilder(CaseInterface::class) - ->disableOriginalConstructor() - ->getMock(); - $this->objectManager = new ObjectManager($this); - $this->caseRepository = $this->getMockBuilder(CaseRepositoryInterface::class) - ->disableOriginalConstructor() - ->getMock(); - - $this->caseRescore = $this->objectManager->getObject(CaseRescore::class, [ - 'caseRepository' => $this->caseRepository - ]); - } - - /** - * Data array without required attribute caseId. - * - * @expectedException \Magento\Signifyd\Model\MessageGenerators\GeneratorException - * @expectedExceptionMessage The "caseId" should not be empty - */ - public function testGenerateEmptyCaseIdException() - { - $this->caseRescore->generate([]); - } - - /** - * Case entity was not found in DB. - * - * @expectedException \Magento\Signifyd\Model\MessageGenerators\GeneratorException - * @expectedExceptionMessage Case entity not found. - */ - public function testGenerateNotFoundException() - { - $this->caseRepository->expects($this->once()) - ->method('getByCaseId') - ->with(self::$data['caseId']) - ->willReturn(null); - - $this->caseRescore = $this->objectManager->getObject(CaseRescore::class, [ - 'caseRepository' => $this->caseRepository - ]); - - $this->caseRescore->generate(self::$data); - } - - /** - * Generate case message with not empty previous score. - */ - public function testGenerateWithPreviousScore() - { - $this->case->expects($this->once()) - ->method('getScore') - ->willReturn(self::$data['score']); - - $this->caseRepository->expects($this->once()) - ->method('getByCaseId') - ->with(self::$data['caseId']) - ->willReturn($this->case); - - $this->caseRescore = $this->objectManager->getObject(CaseRescore::class, [ - 'caseRepository' => $this->caseRepository - ]); - - $phrase = __( - 'Case Update: New score for the order is %1. Previous score was %2.', - self::$data['score'], - self::$data['score'] - ); - - $message = $this->caseRescore->generate(self::$data); - - $this->assertEquals($phrase, $message); - } - - /** - * Generate case message with empty previous score. - */ - public function testGenerateWithoutPreviousScore() - { - $this->caseRepository->expects($this->once()) - ->method('getByCaseId') - ->with(self::$data['caseId']) - ->willReturn($this->case); - - $this->caseRescore = $this->objectManager->getObject(CaseRescore::class, [ - 'caseRepository' => $this->caseRepository - ]); - - $phrase = __( - 'Case Update: New score for the order is %1. Previous score was %2.', - self::$data['score'], - null - ); - - $message = $this->caseRescore->generate(self::$data); - - $this->assertEquals($phrase, $message); - } -} diff --git a/app/code/Magento/Signifyd/Test/Unit/Model/MessageGenerators/GeneratorFactoryTest.php b/app/code/Magento/Signifyd/Test/Unit/Model/MessageGenerators/GeneratorFactoryTest.php deleted file mode 100644 index 50f87df3b694f..0000000000000 --- a/app/code/Magento/Signifyd/Test/Unit/Model/MessageGenerators/GeneratorFactoryTest.php +++ /dev/null @@ -1,99 +0,0 @@ -<?php -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ -namespace Magento\Signifyd\Test\Unit\Model\MessageGenerators; - -use Magento\Framework\ObjectManagerInterface; -use Magento\Framework\TestFramework\Unit\Helper\ObjectManager; -use Magento\Signifyd\Model\MessageGenerators\PatternGenerator; -use Magento\Signifyd\Model\MessageGenerators\CaseRescore; -use Magento\Signifyd\Model\MessageGenerators\GeneratorFactory; -use PHPUnit_Framework_MockObject_MockObject as MockObject; - -/** - * Contains tests for messages generators factory. - */ -class GeneratorFactoryTest extends \PHPUnit\Framework\TestCase -{ - /** - * @var GeneratorFactory - */ - private $factory; - - /** - * @var ObjectManagerInterface|MockObject - */ - private $fakeObjectManager; - - /** - * @inheritdoc - */ - protected function setUp() - { - $objectManager = new ObjectManager($this); - - $this->fakeObjectManager = $this->getMockBuilder(ObjectManagerInterface::class) - ->disableOriginalConstructor() - ->setMethods(['create']) - ->getMockForAbstractClass(); - - $this->factory = $objectManager->getObject(GeneratorFactory::class, [ - 'objectManager' => $this->fakeObjectManager - ]); - } - - /** - * Checks if factory returns correct instance of message generator. - * - * @covers \Magento\Signifyd\Model\MessageGenerators\GeneratorFactory::create - * @param string $type - * @param string $className - * @dataProvider typeDataProvider - */ - public function testCreate($type, $className) - { - $generator = $this->getMockBuilder($className) - ->disableOriginalConstructor() - ->getMock(); - - $this->fakeObjectManager->expects(self::once()) - ->method('create') - ->with($className) - ->willReturn($generator); - - $instance = $this->factory->create($type); - self::assertInstanceOf($className, $instance); - } - - /** - * Get list of available messages generators types and equal class names. - * - * @return array - */ - public function typeDataProvider() - { - return [ - ['cases/creation', PatternGenerator::class], - ['cases/review', PatternGenerator::class], - ['cases/rescore', CaseRescore::class], - ['guarantees/completion', PatternGenerator::class], - ['guarantees/creation', PatternGenerator::class], - ['guarantees/cancel', PatternGenerator::class], - ]; - } - - /** - * Checks correct exception message for unknown type of message generator. - * - * @covers \Magento\Signifyd\Model\MessageGenerators\GeneratorFactory::create - * @expectedException \InvalidArgumentException - * @expectedExceptionMessage Specified message type does not supported. - */ - public function testCreateWithException() - { - $type = 'cases/unknown'; - $this->factory->create($type); - } -} diff --git a/app/code/Magento/Signifyd/Test/Unit/Model/MessageGenerators/PatternGeneratorTest.php b/app/code/Magento/Signifyd/Test/Unit/Model/MessageGenerators/PatternGeneratorTest.php deleted file mode 100644 index 9d5f71f657a1e..0000000000000 --- a/app/code/Magento/Signifyd/Test/Unit/Model/MessageGenerators/PatternGeneratorTest.php +++ /dev/null @@ -1,83 +0,0 @@ -<?php -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ -namespace Magento\Signifyd\Test\Unit\Model\MessageGenerators; - -use Magento\Signifyd\Model\MessageGenerators\PatternGenerator; - -/** - * Contains tests for different variations like empty data, wrong required arguments, or bad placeholders. - */ -class PatternGeneratorTest extends \PHPUnit\Framework\TestCase -{ - /** - * Checks an exception if generators does not receives required data. - * - * @covers \Magento\Signifyd\Model\MessageGenerators\PatternGenerator::generate - * @expectedException \Magento\Signifyd\Model\MessageGenerators\GeneratorException - * @expectedExceptionMessage The "caseId" should not be empty. - */ - public function testGenerateThrowsException() - { - $data = []; - $generator = new PatternGenerator('Signifyd Case %1 has been created for order.', ['caseId']); - $generator->generate($data); - } - - /** - * Checks cases with different template placeholders and input data. - * - * @covers \Magento\Signifyd\Model\MessageGenerators\PatternGenerator::generate - * @param string $template - * @param array $requiredFields - * @param string $expected - * @dataProvider messageDataProvider - */ - public function testGenerate($template, array $requiredFields, $expected) - { - $data = [ - 'caseId' => 123, - 'reviewDisposition' => 'Good', - 'guaranteeDisposition' => 'Approved', - 'score' => 500, - 'case_score' => 300 - ]; - - $generator = new PatternGenerator($template, $requiredFields); - $actual = $generator->generate($data); - self::assertEquals($expected, $actual); - } - - /** - * Get list of variations with message templates, required fields and expected generated messages. - * - * @return array - */ - public function messageDataProvider() - { - return [ - [ - 'Signifyd Case %1 has been created for order.', - ['caseId'], - 'Signifyd Case 123 has been created for order.' - ], - [ - 'Case Update: Case Review was completed. Review Deposition is %1.', - ['reviewDisposition'], - 'Case Update: Case Review was completed. Review Deposition is Good.' - ], - [ - 'Case Update: New score for the order is %1. Previous score was %2.', - ['score', 'case_score'], - 'Case Update: New score for the order is 500. Previous score was 300.' - ], - [ - 'Case Update: Case is submitted for guarantee.', - [], - 'Case Update: Case is submitted for guarantee.' - ], - ]; - } -} diff --git a/app/code/Magento/Signifyd/Test/Unit/Model/OrderStateServiceTest.php b/app/code/Magento/Signifyd/Test/Unit/Model/OrderStateServiceTest.php deleted file mode 100644 index 3a567a79891f8..0000000000000 --- a/app/code/Magento/Signifyd/Test/Unit/Model/OrderStateServiceTest.php +++ /dev/null @@ -1,204 +0,0 @@ -<?php -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ -namespace Magento\Signifyd\Test\Unit\Model; - -use Magento\Sales\Api\OrderManagementInterface; -use Magento\Sales\Model\Order; -use Magento\Sales\Model\OrderFactory; -use Magento\Signifyd\Api\Data\CaseInterface; -use Magento\Signifyd\Model\CommentsHistoryUpdater; -use Magento\Signifyd\Model\OrderStateService; -use PHPUnit_Framework_MockObject_MockObject as MockObject; - -class OrderStateServiceTest extends \PHPUnit\Framework\TestCase -{ - /** - * @var int - */ - private static $orderId = 123; - - /** - * @var OrderFactory|MockObject - */ - private $orderFactory; - - /** - * @var OrderManagementInterface|MockObject - */ - private $orderManagement; - - /** - * @var CommentsHistoryUpdater|MockObject - */ - private $commentsHistoryUpdater; - - /** - * @var CaseInterface|MockObject - */ - private $caseEntity; - - /** - * @var Order|MockObject - */ - private $order; - - /** - * @var OrderStateService - */ - private $orderStateService; - - /** - * @inheritdoc - */ - protected function setUp() - { - $this->orderManagement = $this->getMockBuilder(OrderManagementInterface::class) - ->getMockForAbstractClass(); - - $this->commentsHistoryUpdater = $this->getMockBuilder(CommentsHistoryUpdater::class) - ->disableOriginalConstructor() - ->getMock(); - - $this->orderFactory = $this->getMockBuilder(OrderFactory::class) - ->setMethods(['create']) - ->disableOriginalConstructor() - ->getMock(); - - $this->order = $this->getMockBuilder(Order::class) - ->disableOriginalConstructor() - ->getMock(); - $this->order->expects($this->once()) - ->method('load') - ->willReturnSelf(); - - $this->orderFactory->expects($this->once()) - ->method('create') - ->willReturn($this->order); - - $this->caseEntity = $this->getMockBuilder(CaseInterface::class) - ->disableOriginalConstructor() - ->getMockForAbstractClass(); - $this->caseEntity->expects($this->once()) - ->method('getOrderId') - ->willReturn(self::$orderId); - - $this->orderStateService = new OrderStateService( - $this->orderFactory, - $this->orderManagement, - $this->commentsHistoryUpdater - ); - } - - /** - * Tests update order state flow when case guarantee disposition is PENDING. - * - * @param bool $canHold - * @param bool $hold - * @param int $addCommentCall - * @dataProvider updateByCaseWithGuaranteePendingDataProvider - */ - public function testUpdateByCaseWithGuaranteePending($canHold, $hold, $addCommentCall) - { - $this->caseEntity->expects($this->once()) - ->method('getGuaranteeDisposition') - ->willReturn(CaseInterface::GUARANTEE_PENDING); - $this->order->expects($this->any()) - ->method('canHold') - ->willReturn($canHold); - $this->orderManagement->expects($this->any()) - ->method('hold') - ->willReturn($hold); - $this->commentsHistoryUpdater->expects($this->exactly($addCommentCall)) - ->method('addComment') - ->with( - $this->caseEntity, - __('Awaiting the Signifyd guarantee disposition.'), - Order::STATE_HOLDED - ); - - $this->orderStateService->updateByCase($this->caseEntity); - } - - /** - * @return array - */ - public function updateByCaseWithGuaranteePendingDataProvider() - { - return [ - ['canHold' => true, 'hold' => true, 'addCommentCall' => 1], - ['canHold' => false, 'hold' => true, 'addCommentCall' => 0], - ['canHold' => true, 'hold' => false, 'addCommentCall' => 0], - ]; - } - - /** - * Tests update order state flow when case guarantee disposition is APPROVED. - * - * @param bool $canUnhold - * @param int $unholdCall - * @dataProvider updateByCaseWithGuaranteeApprovedDataProvider - */ - public function testUpdateByCaseWithGuaranteeApproved($canUnhold, $unholdCall) - { - $this->caseEntity->expects($this->once()) - ->method('getGuaranteeDisposition') - ->willReturn(CaseInterface::GUARANTEE_APPROVED); - $this->order->expects($this->any()) - ->method('canUnhold') - ->willReturn($canUnhold); - $this->orderManagement->expects($this->exactly($unholdCall)) - ->method('unHold'); - $this->commentsHistoryUpdater->expects($this->never()) - ->method('addComment'); - - $this->orderStateService->updateByCase($this->caseEntity); - } - - /** - * @return array - */ - public function updateByCaseWithGuaranteeApprovedDataProvider() - { - return [ - ['canUnhold' => true, 'unholdCall' => 1], - ['canUnhold' => false, 'unholdCall' => 0] - ]; - } - - /** - * Tests update order state flow when case guarantee disposition is DECLINED. - * - * @param bool $canHold - * @param int $holdCall - * @dataProvider updateByCaseWithGuaranteeDeclinedDataProvider - */ - public function testUpdateByCaseWithGuaranteeDeclined($canHold, $holdCall) - { - $this->caseEntity->expects($this->once()) - ->method('getGuaranteeDisposition') - ->willReturn(CaseInterface::GUARANTEE_DECLINED); - $this->order->expects($this->any()) - ->method('canHold') - ->willReturn($canHold); - $this->orderManagement->expects($this->exactly($holdCall)) - ->method('hold'); - $this->commentsHistoryUpdater->expects($this->never()) - ->method('addComment'); - - $this->orderStateService->updateByCase($this->caseEntity); - } - - /** - * @return array - */ - public function updateByCaseWithGuaranteeDeclinedDataProvider() - { - return [ - ['canHold' => true, 'holdCall' => 1], - ['canHold' => false, 'holdCall' => 0] - ]; - } -} diff --git a/app/code/Magento/Signifyd/Test/Unit/Model/PaymentMethodMapper/XmlToArrayConfigConverterTest.php b/app/code/Magento/Signifyd/Test/Unit/Model/PaymentMethodMapper/XmlToArrayConfigConverterTest.php deleted file mode 100644 index 319229e326c4b..0000000000000 --- a/app/code/Magento/Signifyd/Test/Unit/Model/PaymentMethodMapper/XmlToArrayConfigConverterTest.php +++ /dev/null @@ -1,76 +0,0 @@ -<?php -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ -namespace Magento\Signifyd\Test\Unit\Model\PaymentMethodMapper; - -use Magento\Signifyd\Model\PaymentMethodMapper\XmlToArrayConfigConverter; -use Magento\Framework\TestFramework\Unit\Helper\ObjectManager; -use Magento\Framework\Config\Dom\ValidationSchemaException; - -class XmlToArrayConfigConverterTest extends \PHPUnit\Framework\TestCase -{ - /** - * @var XmlToArrayConfigConverter - */ - private $converter; - - /** - * @var string - */ - private $filePath; - - public function setUp() - { - $this->filePath = realpath(__DIR__) . '/_files/'; - - $objectManagerHelper = new ObjectManager($this); - $this->converter = $objectManagerHelper->getObject( - XmlToArrayConfigConverter::class - ); - } - - public function testConvert() - { - $testDom = $this->filePath . 'signifyd_payment_mapping.xml'; - $dom = new \DOMDocument(); - $dom->load($testDom); - $mapping = $this->converter->convert($dom); - $expectedArray = include $this->filePath . 'expected_array.php'; - - $this->assertEquals($expectedArray, $mapping); - } - - /** - * @expectedException \Magento\Framework\Config\Dom\ValidationSchemaException - * @expectedExceptionMessage Only single entrance of "magento_code" node is required. - */ - public function testConvertEmptyPaymentMethodException() - { - $dom = new \DOMDocument(); - $element = $dom->createElement('payment_method'); - $subelement = $dom->createElement('signifyd_code', 'test'); - $element->appendChild($subelement); - $dom->appendChild($element); - - $this->converter->convert($dom); - } - - /** - * @expectedException \Magento\Framework\Config\Dom\ValidationSchemaException - * @expectedExceptionMessage Not empty value for "signifyd_code" node is required. - */ - public function testConvertEmptySygnifydPaymentMethodException() - { - $dom = new \DOMDocument(); - $element = $dom->createElement('payment_method'); - $subelement = $dom->createElement('magento_code', 'test'); - $subelement2 = $dom->createElement('signifyd_code', ''); - $element->appendChild($subelement); - $element->appendChild($subelement2); - $dom->appendChild($element); - - $this->converter->convert($dom); - } -} diff --git a/app/code/Magento/Signifyd/Test/Unit/Model/PaymentMethodMapper/_files/expected_array.php b/app/code/Magento/Signifyd/Test/Unit/Model/PaymentMethodMapper/_files/expected_array.php deleted file mode 100644 index f5d3436ae6b7b..0000000000000 --- a/app/code/Magento/Signifyd/Test/Unit/Model/PaymentMethodMapper/_files/expected_array.php +++ /dev/null @@ -1,12 +0,0 @@ -<?php -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ -return [ - 'payment_method_1' => 'PAYMENT_CARD', - 'payment_method_2' => 'PAYPAL_ACCOUNT', - 'payment_method_3' => 'CHECK', - 'payment_method_4' => 'CASH', - 'payment_method_5' => 'FREE' -]; diff --git a/app/code/Magento/Signifyd/Test/Unit/Model/PaymentMethodMapper/_files/signifyd_payment_mapping.xml b/app/code/Magento/Signifyd/Test/Unit/Model/PaymentMethodMapper/_files/signifyd_payment_mapping.xml deleted file mode 100644 index f70763e22c418..0000000000000 --- a/app/code/Magento/Signifyd/Test/Unit/Model/PaymentMethodMapper/_files/signifyd_payment_mapping.xml +++ /dev/null @@ -1,32 +0,0 @@ -<?xml version="1.0" ?> -<!-- -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ ---> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Signifyd:etc/payment_mapping.xsd"> - <payment_method_list> - <payment_method> - <magento_code>payment_method_1</magento_code> - <signifyd_code>PAYMENT_CARD</signifyd_code> - </payment_method> - <payment_method> - <magento_code>payment_method_2</magento_code> - <signifyd_code>PAYPAL_ACCOUNT</signifyd_code> - </payment_method> - <payment_method> - <magento_code>payment_method_3</magento_code> - <signifyd_code>CHECK</signifyd_code> - </payment_method> - <payment_method> - <magento_code>payment_method_4</magento_code> - <signifyd_code>CASH</signifyd_code> - </payment_method> - <payment_method> - <magento_code>payment_method_5</magento_code> - <signifyd_code>FREE</signifyd_code> - </payment_method> - </payment_method_list> -</config> diff --git a/app/code/Magento/Signifyd/Test/Unit/Model/PaymentVerificationFactoryTest.php b/app/code/Magento/Signifyd/Test/Unit/Model/PaymentVerificationFactoryTest.php deleted file mode 100644 index b0f9239d43bfa..0000000000000 --- a/app/code/Magento/Signifyd/Test/Unit/Model/PaymentVerificationFactoryTest.php +++ /dev/null @@ -1,222 +0,0 @@ -<?php -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ -namespace Magento\Signifyd\Test\Unit\Model; - -use Magento\Framework\ObjectManagerInterface; -use Magento\Payment\Api\PaymentVerificationInterface; -use Magento\Signifyd\Model\PaymentVerificationFactory; -use Magento\Framework\TestFramework\Unit\Helper\ObjectManager; -use PHPUnit_Framework_MockObject_MockObject as MockObject; -use Magento\Payment\Gateway\ConfigInterface; - -class PaymentVerificationFactoryTest extends \PHPUnit\Framework\TestCase -{ - /** - * @var PaymentVerificationFactory - */ - private $factory; - - /** - * @var ObjectManager - */ - private $objectManager; - - /** - * @var ObjectManagerInterface|MockObject - */ - private $fakeObjectManager; - - /** - * @var ConfigInterface|MockObject - */ - private $config; - - /** - * @var PaymentVerificationInterface|MockObject - */ - private $avsDefaultAdapter; - - /** - * @var PaymentVerificationInterface|MockObject - */ - private $cvvDefaultAdapter; - - /** - * @inheritdoc - */ - protected function setUp() - { - $this->objectManager = new ObjectManager($this); - - $this->fakeObjectManager = $this->getMockBuilder(ObjectManagerInterface::class) - ->disableOriginalConstructor() - ->getMock(); - - $this->config = $this->getMockBuilder(ConfigInterface::class) - ->disableOriginalConstructor() - ->getMock(); - - $this->avsDefaultAdapter = $this->getMockBuilder(PaymentVerificationInterface::class) - ->disableOriginalConstructor() - ->getMock(); - - $this->cvvDefaultAdapter = $this->getMockBuilder(PaymentVerificationInterface::class) - ->disableOriginalConstructor() - ->getMock(); - - $this->factory = $this->objectManager->getObject(PaymentVerificationFactory::class, [ - 'objectManager' => $this->fakeObjectManager, - 'config' => $this->config, - 'avsDefaultAdapter' => $this->avsDefaultAdapter, - 'cvvDefaultAdapter' => $this->cvvDefaultAdapter - ]); - } - - /** - * Checks a test case when factory creates CVV mapper for provided payment method. - * - * @covers \Magento\Signifyd\Model\PaymentVerificationFactory::createPaymentCvv - */ - public function testCreatePaymentCvv() - { - $paymentMethodCode = 'exists_payment'; - - $this->config->expects(self::once()) - ->method('setMethodCode') - ->with(self::equalTo($paymentMethodCode)) - ->willReturnSelf(); - - $this->config->expects(self::once()) - ->method('getValue') - ->with('cvv_ems_adapter') - ->willReturn(PaymentVerificationInterface::class); - - /** @var PaymentVerificationInterface|MockObject $cvvAdapter */ - $cvvAdapter = $this->getMockBuilder(PaymentVerificationInterface::class) - ->disableOriginalConstructor() - ->getMock(); - - $this->fakeObjectManager->expects(self::once()) - ->method('create') - ->with(self::equalTo(PaymentVerificationInterface::class)) - ->willReturn($cvvAdapter); - - $mapper = $this->factory->createPaymentCvv($paymentMethodCode); - self::assertInstanceOf(PaymentVerificationInterface::class, $mapper); - } - - /** - * Checks a test case, when provided payment method does not have cvv mapper. - * - * @covers \Magento\Signifyd\Model\PaymentVerificationFactory::createPaymentCvv - */ - public function testCreateDefaultCvvMapper() - { - $paymentMethodCode = 'non_exists_payment'; - - $this->config->expects(self::once()) - ->method('setMethodCode') - ->with(self::equalTo($paymentMethodCode)) - ->willReturnSelf(); - - $this->config->expects(self::once()) - ->method('getValue') - ->with('cvv_ems_adapter') - ->willReturn(null); - - $this->fakeObjectManager->expects(self::never()) - ->method('create'); - - $mapper = $this->factory->createPaymentCvv($paymentMethodCode); - self::assertSame($this->cvvDefaultAdapter, $mapper); - } - - /** - * Checks a test case, when mapper implementation does not corresponding to PaymentVerificationInterface. - * - * @covers \Magento\Signifyd\Model\PaymentVerificationFactory::createPaymentCvv - * @expectedException \Magento\Framework\Exception\ConfigurationMismatchException - * @expectedExceptionMessage stdClass must implement Magento\Payment\Api\PaymentVerificationInterface - */ - public function testCreateWithUnsupportedImplementation() - { - $paymentMethodCode = 'exists_payment'; - - $this->config->expects(self::once()) - ->method('setMethodCode') - ->with(self::equalTo($paymentMethodCode)) - ->willReturnSelf(); - - $this->config->expects(self::once()) - ->method('getValue') - ->with('cvv_ems_adapter') - ->willReturn(\stdClass::class); - - $cvvAdapter = new \stdClass(); - $this->fakeObjectManager->expects(self::once()) - ->method('create') - ->with(self::equalTo(\stdClass::class)) - ->willReturn($cvvAdapter); - - $this->factory->createPaymentCvv($paymentMethodCode); - } - - /** - * Checks a test case when factory creates AVS mapper for provided payment method. - * - * @covers \Magento\Signifyd\Model\PaymentVerificationFactory::createPaymentAvs - */ - public function testCreatePaymentAvs() - { - $paymentMethodCode = 'exists_payment'; - - $this->config->expects(self::once()) - ->method('setMethodCode') - ->with(self::equalTo($paymentMethodCode)) - ->willReturnSelf(); - - $this->config->expects(self::once()) - ->method('getValue') - ->with('avs_ems_adapter') - ->willReturn(PaymentVerificationInterface::class); - - $avsAdapter = $this->getMockBuilder(PaymentVerificationInterface::class) - ->disableOriginalConstructor() - ->getMock(); - - $this->fakeObjectManager->expects(self::once()) - ->method('create') - ->with(self::equalTo(PaymentVerificationInterface::class)) - ->willReturn($avsAdapter); - - $mapper = $this->factory->createPaymentAvs($paymentMethodCode); - self::assertInstanceOf(PaymentVerificationInterface::class, $mapper); - } - - /** - * Checks a test case when provided payment method does not support - */ - public function testCreateDefaultAvsMapper() - { - $paymentMethodCode = 'non_exists_payment'; - - $this->config->expects(self::once()) - ->method('setMethodCode') - ->with(self::equalTo($paymentMethodCode)) - ->willReturnSelf(); - - $this->config->expects(self::once()) - ->method('getValue') - ->with('avs_ems_adapter') - ->willReturn(null); - - $this->fakeObjectManager->expects(self::never()) - ->method('create'); - - $mapper = $this->factory->createPaymentAvs($paymentMethodCode); - self::assertSame($this->avsDefaultAdapter, $mapper); - } -} diff --git a/app/code/Magento/Signifyd/Test/Unit/Model/SalesOrderGrid/OrderGridUpdaterTest.php b/app/code/Magento/Signifyd/Test/Unit/Model/SalesOrderGrid/OrderGridUpdaterTest.php deleted file mode 100644 index 885c9f018a488..0000000000000 --- a/app/code/Magento/Signifyd/Test/Unit/Model/SalesOrderGrid/OrderGridUpdaterTest.php +++ /dev/null @@ -1,72 +0,0 @@ -<?php -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ -namespace Magento\Signifyd\Test\Unit\Model\SalesOrderGrid; - -use Magento\Framework\App\Config\ScopeConfigInterface; -use Magento\Sales\Model\ResourceModel\GridInterface; -use Magento\Signifyd\Model\SalesOrderGrid\OrderGridUpdater; -use PHPUnit_Framework_MockObject_MockObject as MockObject; - -class OrderGridUpdaterTest extends \PHPUnit\Framework\TestCase -{ - /** - * @var GridInterface|MockObject - */ - private $orderGrid; - - /** - * @var ScopeConfigInterface|MockObject - */ - private $globalConfig; - - /** - * @var OrderGridUpdater - */ - private $model; - - /** - * Sets up testing class and dependency mocks. - */ - protected function setUp() - { - $this->orderGrid = $this->getMockBuilder(GridInterface::class) - ->getMockForAbstractClass(); - $this->globalConfig = $this->getMockBuilder(ScopeConfigInterface::class) - ->getMockForAbstractClass(); - - $this->model = new OrderGridUpdater($this->orderGrid, $this->globalConfig); - } - - public function testUpdateInSyncMode() - { - $orderId = 1; - - $this->globalConfig->expects($this->once()) - ->method('getValue') - ->with('dev/grid/async_indexing', 'default', null) - ->willReturn(false); - $this->orderGrid->expects($this->once()) - ->method('refresh') - ->with($orderId); - - $this->model->update($orderId); - } - - public function testUpdateInAsyncMode() - { - $orderId = 1; - - $this->globalConfig->expects($this->once()) - ->method('getValue') - ->with('dev/grid/async_indexing', 'default', null) - ->willReturn(true); - $this->orderGrid->expects($this->never()) - ->method('refresh') - ->with($orderId); - - $this->model->update($orderId); - } -} diff --git a/app/code/Magento/Signifyd/Test/Unit/Model/SignifydGateway/Client/HttpClientFactoryTest.php b/app/code/Magento/Signifyd/Test/Unit/Model/SignifydGateway/Client/HttpClientFactoryTest.php deleted file mode 100644 index 4aefd63355773..0000000000000 --- a/app/code/Magento/Signifyd/Test/Unit/Model/SignifydGateway/Client/HttpClientFactoryTest.php +++ /dev/null @@ -1,131 +0,0 @@ -<?php -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ -namespace Magento\Signifyd\Test\Unit\Model\SignifydGateway\Client; - -use Magento\Signifyd\Model\SignifydGateway\Client\HttpClientFactory; -use Magento\Framework\TestFramework\Unit\Helper\ObjectManager; -use Magento\Signifyd\Model\Config; -use Magento\Framework\HTTP\ZendClient; -use Magento\Framework\HTTP\ZendClientFactory; -use Magento\Framework\Json\EncoderInterface; -use \PHPUnit_Framework_MockObject_MockObject as MockObject; - -class HttpClientFactoryTest extends \PHPUnit\Framework\TestCase -{ - /** - * @var string - */ - private static $dummy = 'dummy'; - - /** - * @var ObjectManager - */ - private $objectManager; - - /** - * @var Config - */ - private $config; - - /** - * @var ZendClientFactory|MockObject - */ - private $clientFactory; - - /** - * @var ZendClient|MockObject - */ - private $client; - - /** - * @var EncoderInterface|MockObject - */ - private $dataEncoder; - - /** - * @var ZendClient|MockObject - */ - private $httpClient; - - public function setUp() - { - $this->objectManager = new ObjectManager($this); - - $this->config = $this->getMockBuilder(Config::class) - ->disableOriginalConstructor() - ->getMock(); - - $this->client = $this->getMockBuilder(ZendClient::class) - ->disableOriginalConstructor() - ->setMethods(['setHeaders', 'setMethod', 'setUri', 'setRawData']) - ->getMock(); - - $this->clientFactory = $this->getMockBuilder(ZendClientFactory::class) - ->disableOriginalConstructor() - ->setMethods(['create']) - ->getMock(); - - $this->clientFactory->expects($this->once()) - ->method('create') - ->willReturn($this->client); - - $this->dataEncoder = $this->getMockBuilder(EncoderInterface::class) - ->disableOriginalConstructor() - ->getMock(); - - $this->httpClient = $this->objectManager->getObject(HttpClientFactory::class, [ - 'config' => $this->config, - 'clientFactory' => $this->clientFactory, - 'dataEncoder' => $this->dataEncoder - ]); - } - - public function testCreateHttpClient() - { - $this->config->expects($this->once()) - ->method('getApiKey') - ->willReturn('testKey'); - - $this->config->expects($this->once()) - ->method('getApiUrl') - ->willReturn('testUrl'); - - $client = $this->httpClient->create('url', 'method'); - - $this->assertInstanceOf(ZendClient::class, $client); - } - - public function testCreateWithParams() - { - $param = ['id' => 1]; - $storeId = 1; - $json = '{"id":1}'; - - $this->config->expects($this->once()) - ->method('getApiKey') - ->with($storeId) - ->willReturn('testKey'); - - $this->config->expects($this->once()) - ->method('getApiUrl') - ->with($storeId) - ->willReturn(self::$dummy); - - $this->dataEncoder->expects($this->once()) - ->method('encode') - ->with($this->equalTo($param)) - ->willReturn($json); - - $this->client->expects($this->once()) - ->method('setRawData') - ->with($this->equalTo($json), 'application/json') - ->willReturnSelf(); - - $client = $this->httpClient->create('url', 'method', $param, $storeId); - - $this->assertInstanceOf(ZendClient::class, $client); - } -} diff --git a/app/code/Magento/Signifyd/Test/Unit/Model/SignifydGateway/Client/ResponseHandlerTest.php b/app/code/Magento/Signifyd/Test/Unit/Model/SignifydGateway/Client/ResponseHandlerTest.php deleted file mode 100644 index 1ee55d7ad150c..0000000000000 --- a/app/code/Magento/Signifyd/Test/Unit/Model/SignifydGateway/Client/ResponseHandlerTest.php +++ /dev/null @@ -1,182 +0,0 @@ -<?php -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ -namespace Magento\Signifyd\Test\Unit\Model\SignifydGateway\Client; - -use Magento\Signifyd\Model\SignifydGateway\Client\ResponseHandler; -use Magento\Framework\Json\DecoderInterface; -use Magento\Signifyd\Model\SignifydGateway\ApiCallException; -use Magento\Framework\TestFramework\Unit\Helper\ObjectManager; -use \Zend_Http_Response as Response; -use \PHPUnit_Framework_MockObject_MockObject as MockObject; - -class ResponseHandlerTest extends \PHPUnit\Framework\TestCase -{ - /** - * @var string - */ - private static $errorMessage = 'Some error'; - - /** - * @var string - */ - private static $testJson = '{"id": 1}'; - - /** - * @var int - */ - private static $successfulCode = 200; - - /** - * @var int - */ - private static $phpVersionId = 50000; - - /** - * @var ObjectManager - */ - private $objectManager; - - /** - * @var ResponseHandler|MockObject - */ - private $responseHandler; - - /** - * @var DecoderInterface|MockObject - */ - private $dataDecoder; - - /** - * @var Response|MockObject - */ - private $response; - - public function setUp() - { - $this->objectManager = new ObjectManager($this); - - $this->dataDecoder = $this->getMockBuilder(DecoderInterface::class) - ->disableOriginalConstructor() - ->getMock(); - - $this->response = $this->getMockBuilder(Response::class) - ->disableOriginalConstructor() - ->setMethods(['getStatus', 'getBody']) - ->getMock(); - - $this->responseHandler = $this->objectManager->getObject(ResponseHandler::class, [ - 'dataDecoder' => $this->dataDecoder - ]); - } - - /** - * @dataProvider errorsProvider - */ - public function testHandleFailureMessage($code, $message) - { - $this->response->expects($this->any()) - ->method('getStatus') - ->willReturn($code); - - $this->response->expects($this->once()) - ->method('getBody') - ->willReturn(self::$errorMessage); - - try { - $this->responseHandler->handle($this->response); - } catch (ApiCallException $e) { - $this->assertEquals($e->getMessage(), sprintf($message, self::$errorMessage)); - } - } - - /** - * @return array - */ - public function errorsProvider() - { - return [ - [400, 'Bad Request - The request could not be parsed. Response: %s'], - [401, 'Unauthorized - user is not logged in, could not be authenticated. Response: %s'], - [403, 'Forbidden - Cannot access resource. Response: %s'], - [404, 'Not Found - resource does not exist. Response: %s'], - [ - 409, - 'Conflict - with state of the resource on server. Can occur with (too rapid) PUT requests. Response: %s' - ], - [500, 'Server error. Response: %s'] - ]; - } - - /** - * @expectedException \Magento\Signifyd\Model\SignifydGateway\ApiCallException - * @expectedExceptionMessage Response is not valid JSON: Decoding failed: Syntax error - */ - public function testHandleEmptyJsonException() - { - $this->response->expects($this->any()) - ->method('getStatus') - ->willReturn(self::$successfulCode); - - $this->response->expects($this->once()) - ->method('getBody') - ->willReturn(''); - - $r = new \ReflectionObject($this->responseHandler); - $prop = $r->getProperty('phpVersionId'); - $prop->setAccessible(true); - $prop->setValue(self::$phpVersionId); - - $this->responseHandler->handle($this->response); - } - - /** - * @expectedException \Magento\Signifyd\Model\SignifydGateway\ApiCallException - * @expectedExceptionMessage Response is not valid JSON: Some error - */ - public function testHandleInvalidJson() - { - $this->response->expects($this->any()) - ->method('getStatus') - ->willReturn(self::$successfulCode); - - $this->response->expects($this->once()) - ->method('getBody') - ->willReturn('param'); - - $this->dataDecoder = $this->getMockBuilder(DecoderInterface::class) - ->disableOriginalConstructor() - ->getMock(); - - $this->dataDecoder->expects($this->once()) - ->method('decode') - ->with('param') - ->willThrowException(new \Exception(self::$errorMessage, 30)); - - $this->responseHandler = $this->objectManager->getObject(ResponseHandler::class, [ - 'dataDecoder' => $this->dataDecoder - ]); - - $this->responseHandler->handle($this->response); - } - - public function testHandle() - { - $this->response->expects($this->any()) - ->method('getStatus') - ->willReturn(self::$successfulCode); - - $this->response->expects($this->once()) - ->method('getBody') - ->willReturn(self::$testJson); - - $this->dataDecoder->expects($this->once()) - ->method('decode') - ->willReturn(json_decode(self::$testJson, 1)); - - $decodedResponseBody = $this->responseHandler->handle($this->response); - $this->assertEquals($decodedResponseBody, ['id' => 1]); - } -} diff --git a/app/code/Magento/Signifyd/Test/Unit/Model/SignifydGateway/GatewayTest.php b/app/code/Magento/Signifyd/Test/Unit/Model/SignifydGateway/GatewayTest.php deleted file mode 100644 index ba82ff4619ad3..0000000000000 --- a/app/code/Magento/Signifyd/Test/Unit/Model/SignifydGateway/GatewayTest.php +++ /dev/null @@ -1,448 +0,0 @@ -<?php -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ -namespace Magento\Signifyd\Test\Unit\Model\SignifydGateway; - -use Magento\Sales\Api\Data\OrderInterface; -use Magento\Sales\Api\OrderRepositoryInterface; -use Magento\Signifyd\Api\CaseRepositoryInterface; -use Magento\Signifyd\Api\Data\CaseInterface; -use PHPUnit_Framework_MockObject_MockObject as MockObject; -use Magento\Signifyd\Model\SignifydGateway\Gateway; -use Magento\Signifyd\Model\SignifydGateway\GatewayException; -use Magento\Signifyd\Model\SignifydGateway\Request\CreateCaseBuilderInterface; -use Magento\Signifyd\Model\SignifydGateway\ApiClient; -use Magento\Signifyd\Model\SignifydGateway\ApiCallException; - -class GatewayTest extends \PHPUnit\Framework\TestCase -{ - /** - * @var CreateCaseBuilderInterface|MockObject - */ - private $createCaseBuilder; - - /** - * @var ApiClient|MockObject - */ - private $apiClient; - - /** - * @var Gateway - */ - private $gateway; - - /** - * @var OrderRepositoryInterface|MockObject - */ - private $orderRepository; - - /** - * @var CaseRepositoryInterface|MockObject - */ - private $caseRepository; - - public function setUp() - { - $this->createCaseBuilder = $this->getMockBuilder(CreateCaseBuilderInterface::class) - ->getMockForAbstractClass(); - - $this->apiClient = $this->getMockBuilder(ApiClient::class) - ->disableOriginalConstructor() - ->getMock(); - - $this->orderRepository = $this->getMockBuilder(OrderRepositoryInterface::class) - ->getMockForAbstractClass(); - - $this->caseRepository= $this->getMockBuilder(CaseRepositoryInterface::class) - ->getMockForAbstractClass(); - - $this->gateway = new Gateway( - $this->createCaseBuilder, - $this->apiClient, - $this->orderRepository, - $this->caseRepository - ); - } - - public function testCreateCaseForSpecifiedOrder() - { - $dummyOrderId = 1; - $dummyStoreId = 2; - $dummySignifydInvestigationId = 42; - - $this->withOrderEntity($dummyOrderId, $dummyStoreId); - $this->apiClient - ->method('makeApiCall') - ->willReturn([ - 'investigationId' => $dummySignifydInvestigationId - ]); - - $this->createCaseBuilder - ->expects($this->atLeastOnce()) - ->method('build') - ->with($this->equalTo($dummyOrderId)) - ->willReturn([]); - - $result = $this->gateway->createCase($dummyOrderId); - $this->assertEquals(42, $result); - } - - public function testCreateCaseCallsValidApiMethod() - { - $dummyOrderId = 1; - $dummyStoreId = 2; - $dummySignifydInvestigationId = 42; - - $this->withOrderEntity($dummyOrderId, $dummyStoreId); - $this->createCaseBuilder - ->method('build') - ->willReturn([]); - - $this->apiClient - ->expects($this->atLeastOnce()) - ->method('makeApiCall') - ->with( - $this->equalTo('/cases'), - $this->equalTo('POST'), - $this->isType('array'), - $this->equalTo($dummyStoreId) - ) - ->willReturn([ - 'investigationId' => $dummySignifydInvestigationId - ]); - - $result = $this->gateway->createCase($dummyOrderId); - $this->assertEquals(42, $result); - } - - public function testCreateCaseNormalFlow() - { - $dummyOrderId = 1; - $dummyStoreId = 2; - $dummySignifydInvestigationId = 42; - - $this->withOrderEntity($dummyOrderId, $dummyStoreId); - $this->createCaseBuilder - ->method('build') - ->willReturn([]); - $this->apiClient - ->method('makeApiCall') - ->willReturn([ - 'investigationId' => $dummySignifydInvestigationId - ]); - - $returnedInvestigationId = $this->gateway->createCase($dummyOrderId); - $this->assertEquals( - $dummySignifydInvestigationId, - $returnedInvestigationId, - 'Method must return value specified in "investigationId" response parameter' - ); - } - - public function testCreateCaseWithFailedApiCall() - { - $dummyOrderId = 1; - $dummyStoreId = 2; - $apiCallFailureMessage = 'Api call failed'; - - $this->withOrderEntity($dummyOrderId, $dummyStoreId); - $this->createCaseBuilder - ->method('build') - ->willReturn([]); - $this->apiClient - ->method('makeApiCall') - ->willThrowException(new ApiCallException($apiCallFailureMessage)); - - $this->expectException(GatewayException::class); - $this->expectExceptionMessage($apiCallFailureMessage); - $this->gateway->createCase($dummyOrderId); - } - - public function testCreateCaseWithMissedResponseRequiredData() - { - $dummyOrderId = 1; - $dummyStoreId = 2; - - $this->withOrderEntity($dummyOrderId, $dummyStoreId); - $this->createCaseBuilder - ->method('build') - ->willReturn([]); - $this->apiClient - ->method('makeApiCall') - ->willReturn([ - 'someOtherParameter' => 'foo', - ]); - - $this->expectException(GatewayException::class); - $this->gateway->createCase($dummyOrderId); - } - - public function testCreateCaseWithAdditionalResponseData() - { - $dummyOrderId = 1; - $dummyStoreId = 2; - $dummySignifydInvestigationId = 42; - - $this->withOrderEntity($dummyOrderId, $dummyStoreId); - $this->createCaseBuilder - ->method('build') - ->willReturn([]); - $this->apiClient - ->method('makeApiCall') - ->willReturn([ - 'investigationId' => $dummySignifydInvestigationId, - 'someOtherParameter' => 'foo', - ]); - - $returnedInvestigationId = $this->gateway->createCase($dummyOrderId); - $this->assertEquals( - $dummySignifydInvestigationId, - $returnedInvestigationId, - 'Method must return value specified in "investigationId" response parameter and ignore any other parameters' - ); - } - - public function testSubmitCaseForGuaranteeCallsValidApiMethod() - { - $dummySygnifydCaseId = 42; - $dummyStoreId = 1; - $dummyDisposition = 'APPROVED'; - - $this->withCaseEntity($dummySygnifydCaseId, $dummyStoreId); - $this->apiClient - ->expects($this->atLeastOnce()) - ->method('makeApiCall') - ->with( - $this->equalTo('/guarantees'), - $this->equalTo('POST'), - $this->equalTo([ - 'caseId' => $dummySygnifydCaseId - ]), - $this->equalTo($dummyStoreId) - )->willReturn([ - 'disposition' => $dummyDisposition - ]); - - $result = $this->gateway->submitCaseForGuarantee($dummySygnifydCaseId); - $this->assertEquals('APPROVED', $result); - } - - public function testSubmitCaseForGuaranteeWithFailedApiCall() - { - $dummySygnifydCaseId = 42; - $dummyStoreId = 1; - $apiCallFailureMessage = 'Api call failed'; - - $this->withCaseEntity($dummySygnifydCaseId, $dummyStoreId); - $this->apiClient - ->method('makeApiCall') - ->willThrowException(new ApiCallException($apiCallFailureMessage)); - - $this->expectException(GatewayException::class); - $this->expectExceptionMessage($apiCallFailureMessage); - $result = $this->gateway->submitCaseForGuarantee($dummySygnifydCaseId); - $this->assertEquals('Api call failed', $result); - } - - public function testSubmitCaseForGuaranteeReturnsDisposition() - { - $dummySygnifydCaseId = 42; - $dummyStoreId = 1; - $dummyDisposition = 'APPROVED'; - $dummyGuaranteeId = 123; - $dummyRereviewCount = 0; - - $this->withCaseEntity($dummySygnifydCaseId, $dummyStoreId); - $this->apiClient - ->method('makeApiCall') - ->willReturn([ - 'guaranteeId' => $dummyGuaranteeId, - 'disposition' => $dummyDisposition, - 'rereviewCount' => $dummyRereviewCount, - ]); - - $actualDisposition = $this->gateway->submitCaseForGuarantee($dummySygnifydCaseId); - $this->assertEquals( - $dummyDisposition, - $actualDisposition, - 'Method must return guarantee disposition retrieved in Signifyd API response as a result' - ); - } - - public function testSubmitCaseForGuaranteeWithMissedDisposition() - { - $dummySygnifydCaseId = 42; - $dummyStoreId = 1; - $dummyGuaranteeId = 123; - $dummyRereviewCount = 0; - - $this->withCaseEntity($dummySygnifydCaseId, $dummyStoreId); - $this->apiClient - ->method('makeApiCall') - ->willReturn([ - 'guaranteeId' => $dummyGuaranteeId, - 'rereviewCount' => $dummyRereviewCount, - ]); - - $this->expectException(GatewayException::class); - $this->gateway->submitCaseForGuarantee($dummySygnifydCaseId); - } - - public function testSubmitCaseForGuaranteeWithUnexpectedDisposition() - { - $dummySygnifydCaseId = 42; - $dummyStoreId = 1; - $dummyUnexpectedDisposition = 'UNEXPECTED'; - - $this->withCaseEntity($dummySygnifydCaseId, $dummyStoreId); - $this->apiClient - ->method('makeApiCall') - ->willReturn([ - 'disposition' => $dummyUnexpectedDisposition, - ]); - - $this->expectException(GatewayException::class); - $result = $this->gateway->submitCaseForGuarantee($dummySygnifydCaseId); - $this->assertEquals('UNEXPECTED', $result); - } - - /** - * @dataProvider supportedGuaranteeDispositionsProvider - */ - public function testSubmitCaseForGuaranteeWithExpectedDisposition($dummyExpectedDisposition) - { - $dummySygnifydCaseId = 42; - $dummyStoreId = 1; - - $this->withCaseEntity($dummySygnifydCaseId, $dummyStoreId); - $this->apiClient - ->method('makeApiCall') - ->willReturn([ - 'disposition' => $dummyExpectedDisposition, - ]); - - try { - $result = $this->gateway->submitCaseForGuarantee($dummySygnifydCaseId); - $this->assertEquals($dummyExpectedDisposition, $result); - } catch (GatewayException $e) { - $this->fail(sprintf( - 'Expected disposition "%s" was not accepted with message "%s"', - $dummyExpectedDisposition, - $e->getMessage() - )); - } - } - - /** - * Checks a test case when guarantee for a case is successfully canceled - * - * @covers \Magento\Signifyd\Model\SignifydGateway\Gateway::cancelGuarantee - */ - public function testCancelGuarantee() - { - $caseId = 123; - $dummyStoreId = 1; - - $this->withCaseEntity($caseId, $dummyStoreId); - $this->apiClient->expects(self::once()) - ->method('makeApiCall') - ->with( - '/cases/' . $caseId . '/guarantee', - 'PUT', - ['guaranteeDisposition' => Gateway::GUARANTEE_CANCELED], - $dummyStoreId - ) - ->willReturn( - ['disposition' => Gateway::GUARANTEE_CANCELED] - ); - - $result = $this->gateway->cancelGuarantee($caseId); - self::assertEquals(Gateway::GUARANTEE_CANCELED, $result); - } - - /** - * Checks a case when API request returns unexpected guarantee disposition. - * - * @covers \Magento\Signifyd\Model\SignifydGateway\Gateway::cancelGuarantee - * @expectedException \Magento\Signifyd\Model\SignifydGateway\GatewayException - * @expectedExceptionMessage API returned unexpected disposition: DECLINED. - */ - public function testCancelGuaranteeWithUnexpectedDisposition() - { - $caseId = 123; - $dummyStoreId = 1; - - $this->withCaseEntity($caseId, $dummyStoreId); - $this->apiClient->expects(self::once()) - ->method('makeApiCall') - ->with( - '/cases/' . $caseId . '/guarantee', - 'PUT', - ['guaranteeDisposition' => Gateway::GUARANTEE_CANCELED], - $dummyStoreId - ) - ->willReturn(['disposition' => Gateway::GUARANTEE_DECLINED]); - - $result = $this->gateway->cancelGuarantee($caseId); - $this->assertEquals(Gateway::GUARANTEE_CANCELED, $result); - } - - /** - * @return array - */ - public function supportedGuaranteeDispositionsProvider() - { - return [ - 'APPROVED' => ['APPROVED'], - 'DECLINED' => ['DECLINED'], - 'PENDING' => ['PENDING'], - 'CANCELED' => ['CANCELED'], - 'IN_REVIEW' => ['IN_REVIEW'], - 'UNREQUESTED' => ['UNREQUESTED'], - ]; - } - - /** - * Specifies order entity mock execution. - * - * @param int $orderId - * @param int $storeId - * @return void - */ - private function withOrderEntity(int $orderId, int $storeId): void - { - $orderEntity = $this->getMockBuilder(OrderInterface::class) - ->disableOriginalConstructor() - ->getMock(); - $orderEntity->method('getStoreId') - ->willReturn($storeId); - $this->orderRepository->method('get') - ->with($orderId) - ->willReturn($orderEntity); - } - - /** - * Specifies case entity mock execution. - * - * @param int $caseId - * @param int $storeId - * @return void - */ - private function withCaseEntity(int $caseId, int $storeId): void - { - $orderId = 1; - - $caseEntity = $this->getMockBuilder(CaseInterface::class) - ->disableOriginalConstructor() - ->getMock(); - $caseEntity->method('getOrderId') - ->willReturn($orderId); - $this->caseRepository->method('getByCaseId') - ->with($caseId) - ->willReturn($caseEntity); - - $this->withOrderEntity($orderId, $storeId); - } -} diff --git a/app/code/Magento/Signifyd/Test/Unit/Model/SignifydGateway/Response/WebhookMessageReaderTest.php b/app/code/Magento/Signifyd/Test/Unit/Model/SignifydGateway/Response/WebhookMessageReaderTest.php deleted file mode 100644 index 0dfdf4980fb58..0000000000000 --- a/app/code/Magento/Signifyd/Test/Unit/Model/SignifydGateway/Response/WebhookMessageReaderTest.php +++ /dev/null @@ -1,114 +0,0 @@ -<?php -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ -namespace Magento\Signifyd\Test\Unit\Model\SignifydGateway\Response; - -use Magento\Framework\Json\DecoderInterface; -use Magento\Signifyd\Model\SignifydGateway\Response\WebhookRequest; -use Magento\Signifyd\Model\SignifydGateway\Response\WebhookMessageReader; -use Magento\Signifyd\Model\SignifydGateway\Response\WebhookMessage; -use Magento\Signifyd\Model\SignifydGateway\Response\WebhookMessageFactory; - -/** - * Class WebhookMessageReaderTest - */ -class WebhookMessageReaderTest extends \PHPUnit\Framework\TestCase -{ - /** - * @var WebhookMessageReader - */ - private $model; - - /** - * @var DecoderInterface|\PHPUnit_Framework_MockObject_MockObject - */ - private $decoder; - - /** - * @var WebhookMessageFactory|\PHPUnit_Framework_MockObject_MockObject - */ - private $webhookMessageFactory; - - /** - * @var WebhookRequest|\PHPUnit_Framework_MockObject_MockObject - */ - private $webhookRequest; - - /** - * @inheritdoc - */ - protected function setUp() - { - $this->decoder = $this->getMockBuilder(DecoderInterface::class) - ->getMockForAbstractClass(); - - $this->webhookMessageFactory = $this->getMockBuilder(WebhookMessageFactory::class) - ->setMethods(['create']) - ->disableOriginalConstructor() - ->getMock(); - - $this->webhookRequest = $this->getMockBuilder(WebhookRequest::class) - ->disableOriginalConstructor() - ->getMock(); - - $this->model = new WebhookMessageReader( - $this->decoder, - $this->webhookMessageFactory - ); - } - - /** - * Tests successful reading webhook message from request. - * - */ - public function testReadSuccess() - { - $rawBody = 'body'; - $topic = 'topic'; - $decodedData = ['status' => "DISMISSED", 'orderId' => '19418']; - - $this->webhookRequest->expects($this->once()) - ->method('getBody') - ->willReturn($rawBody); - $this->webhookRequest->expects($this->once()) - ->method('getEventTopic') - ->willReturn('topic'); - $this->decoder->expects($this->once()) - ->method('decode') - ->with($rawBody) - ->willReturn($decodedData); - $webhookMessage = $this->getMockBuilder(WebhookMessage::class) - ->disableOriginalConstructor() - ->getMock(); - $this->webhookMessageFactory->expects($this->once()) - ->method('create') - ->with( - [ - 'data' => $decodedData, - 'eventTopic' => $topic - ] - ) - ->willReturn($webhookMessage); - - $this->assertEquals( - $webhookMessage, - $this->model->read($this->webhookRequest) - ); - } - - /** - * Tests reading failure webhook message from request. - * - * @expectedException \InvalidArgumentException - */ - public function testReadFail() - { - $this->decoder->expects($this->once()) - ->method('decode') - ->willThrowException(new \Exception('Error')); - - $this->model->read($this->webhookRequest); - } -} diff --git a/app/code/Magento/Signifyd/Test/Unit/Model/SignifydGateway/Response/WebhookRequestValidatorTest.php b/app/code/Magento/Signifyd/Test/Unit/Model/SignifydGateway/Response/WebhookRequestValidatorTest.php deleted file mode 100644 index 5ae6b95a77548..0000000000000 --- a/app/code/Magento/Signifyd/Test/Unit/Model/SignifydGateway/Response/WebhookRequestValidatorTest.php +++ /dev/null @@ -1,231 +0,0 @@ -<?php -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ -namespace Magento\Signifyd\Test\Unit\Model\SignifydGateway\Response; - -use Magento\Framework\Json\DecoderInterface; -use Magento\Signifyd\Model\Config; -use Magento\Signifyd\Model\SignifydGateway\Response\WebhookRequestValidator; -use Magento\Signifyd\Model\SignifydGateway\Response\WebhookRequest; - -/** - * Class WebhookRequestValidatorTest - */ -class WebhookRequestValidatorTest extends \PHPUnit\Framework\TestCase -{ - /** - * @var WebhookRequestValidator - */ - private $model; - - /** - * @var Config|\PHPUnit_Framework_MockObject_MockObject - */ - private $config; - - /** - * @var DecoderInterface|\PHPUnit_Framework_MockObject_MockObject - */ - private $decoder; - - /** - * @inheritdoc - */ - protected function setUp() - { - $this->config = $this->getMockBuilder(Config::class) - ->disableOriginalConstructor() - ->getMock(); - - $this->decoder = $this->getMockBuilder(DecoderInterface::class) - ->getMockForAbstractClass(); - - $this->model = new WebhookRequestValidator( - $this->config, - $this->decoder - ); - } - - /** - * Tests successful cases. - * - * @param string $body - * @param string $topic - * @param string $hash - * @param int$callConfigCount - * @dataProvider validateSuccessDataProvider - */ - public function testValidateSuccess($body, $topic, $hash, $callConfigCount) - { - $this->config->expects($this->exactly($callConfigCount)) - ->method('getApiKey') - ->willReturn('GpFZZnxGgIxuI8BazSm3v6eGK'); - - $this->decoder->expects($this->once()) - ->method('decode') - ->with($body) - ->willReturn(['status' => "DISMISSED", 'orderId' => '19418']); - - $webhookRequest = $this->createWebhookRequest($body, $topic, $hash); - - $this->assertTrue( - $this->model->validate($webhookRequest) - ); - } - - /** - * @case 1. All data are correct, event topic has real value - * @case 2. All data are correct, event topic has test value - * @return array - */ - public function validateSuccessDataProvider() - { - return [ - 1 => [ - 'body' => '{ status: "DISMISSED", orderId: "19418" }', - 'topic' => 'cases/creation', - 'hash' => 'KWR8Bzu3tinEpDviw1opWSMJGFqfpA79nNGp0TEYM6Q=', - 'callConfigCount' => 1 - ], - 2 => [ - 'body' => '{ status: "DISMISSED", orderId: "19418" }', - 'topic' => 'cases/test', - 'hash' => '6npAahliNbzYo/Qi4+g+JeqPhLFgg19sIbuxDLmvobw=', - 'callConfigCount' => 0 - ] - ]; - } - - /** - * Case with wrong event topic - * - * @param string $topic - * @dataProvider validationTopicFailsDataProvider - */ - public function testValidationTopicFails($topic) - { - $body = '{ status: "DISMISSED", orderId: "19418" }'; - $hash = 'KWR8Bzu3tinEpDviw1opWSMJGFqfpA79nNGp0TEYM6Q='; - - $this->config->expects($this->never()) - ->method('getApiKey'); - - $this->decoder->expects($this->never()) - ->method('decode'); - - $webhookRequest = $this->createWebhookRequest($body, $topic, $hash); - - $this->assertFalse( - $this->model->validate($webhookRequest), - 'Negative webhook event topic value validation fails' - ); - } - - /** - * @return array - */ - public function validationTopicFailsDataProvider() - { - return [ - ['wrong topic' => 'bla-bla-topic'], - ['empty topic' => ''] - ]; - } - - /** - * Case with wrong webhook request body - * - * @param string $body - * @dataProvider validationBodyFailsDataProvider - */ - public function testValidationBodyFails($body) - { - $topic = 'cases/creation'; - $hash = 'KWR8Bzu3tinEpDviw1opWSMJGFqfpA79nNGp0TEYM6Q='; - $webhookRequest = $this->createWebhookRequest($body, $topic, $hash); - - $this->config->expects($this->never()) - ->method('getApiKey'); - - if (empty($body)) { - $this->decoder->expects($this->once()) - ->method('decode') - ->with($body) - ->willReturn(''); - } else { - $this->decoder->expects($this->once()) - ->method('decode') - ->with($body) - ->willThrowException(new \Exception('Error')); - } - - $this->assertFalse( - $this->model->validate($webhookRequest), - 'Negative webhook request body validation fails' - ); - } - - /** - * @return array - */ - public function validationBodyFailsDataProvider() - { - return [ - ['Empty request body' => ''], - ['Bad request body' => '{ bad data}'] - ]; - } - - /** - * Case with wrong hash - */ - public function testValidationHashFails() - { - $topic = 'cases/creation'; - $body = '{ status: "DISMISSED", orderId: "19418" }'; - $hash = 'wrong hash'; - $webhookRequest = $this->createWebhookRequest($body, $topic, $hash); - - $this->config->expects($this->once()) - ->method('getApiKey') - ->willReturn('GpFZZnxGgIxuI8BazSm3v6eGK'); - - $this->decoder->expects($this->once()) - ->method('decode') - ->with($body) - ->willReturn(['status' => "DISMISSED", 'orderId' => '19418']); - - $this->assertFalse( - $this->model->validate($webhookRequest), - 'Negative webhook hash validation fails' - ); - } - - /** - * Returns mocked WebhookRequest - * - * @param string $body - * @param string $topic - * @param string $hash - * @return WebhookRequest|\PHPUnit_Framework_MockObject_MockObject - */ - private function createWebhookRequest($body, $topic, $hash) - { - $webhookRequest = $this->getMockBuilder(WebhookRequest::class) - ->disableOriginalConstructor() - ->getMock(); - $webhookRequest->expects($this->once()) - ->method('getBody') - ->willReturn($body); - $webhookRequest->expects($this->once()) - ->method('getEventTopic') - ->willReturn($topic); - $webhookRequest->expects($this->once()) - ->method('getHash') - ->willReturn($hash); - - return $webhookRequest; - } -} diff --git a/app/code/Magento/Signifyd/Test/Unit/Model/SignifydOrderSessionIdTest.php b/app/code/Magento/Signifyd/Test/Unit/Model/SignifydOrderSessionIdTest.php deleted file mode 100644 index 9d3061f240c21..0000000000000 --- a/app/code/Magento/Signifyd/Test/Unit/Model/SignifydOrderSessionIdTest.php +++ /dev/null @@ -1,60 +0,0 @@ -<?php -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ -namespace Magento\Signifyd\Test\Unit\Model; - -use Magento\Checkout\Model\Session as CheckoutSession; -use Magento\Framework\DataObject\IdentityGeneratorInterface; -use Magento\Signifyd\Model\SignifydOrderSessionId; -use PHPUnit_Framework_MockObject_MockObject as MockObject; - -/** - * Class SignifydOrderSessionIdTest tests that SignifydOrderSessionId class dependencies - * follow the contracts. - */ -class SignifydOrderSessionIdTest extends \PHPUnit\Framework\TestCase -{ - /** - * @var SignifydOrderSessionId - */ - private $signifydOrderSessionId; - - /** - * @var IdentityGeneratorInterface|MockObject - */ - private $identityGenerator; - - /** - * Sets up testing class and dependency mocks. - */ - protected function setUp() - { - $this->identityGenerator = $this->getMockBuilder(IdentityGeneratorInterface::class) - ->getMockForAbstractClass(); - - $this->signifydOrderSessionId = new SignifydOrderSessionId($this->identityGenerator); - } - - /** - * Tests method by passing quoteId parameter - * - * @covers \Magento\Signifyd\Model\SignifydOrderSessionId::get - */ - public function testGetByQuoteId() - { - $quoteId = 1; - $signifydOrderSessionId = 'asdfzxcv'; - - $this->identityGenerator->expects(self::once()) - ->method('generateIdForData') - ->with($quoteId) - ->willReturn($signifydOrderSessionId); - - $this->assertEquals( - $signifydOrderSessionId, - $this->signifydOrderSessionId->get($quoteId) - ); - } -} diff --git a/app/code/Magento/Signifyd/Test/Unit/Observer/PlaceOrderTest.php b/app/code/Magento/Signifyd/Test/Unit/Observer/PlaceOrderTest.php deleted file mode 100644 index d63831b1d4a8e..0000000000000 --- a/app/code/Magento/Signifyd/Test/Unit/Observer/PlaceOrderTest.php +++ /dev/null @@ -1,284 +0,0 @@ -<?php -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ -namespace Magento\Signifyd\Test\Unit\Observer; - -use Magento\Framework\Event; -use Magento\Framework\Event\Observer; -use Magento\Framework\Exception\AlreadyExistsException; -use Magento\Payment\Model\MethodInterface; -use Magento\Sales\Api\Data\OrderInterface; -use Magento\Sales\Model\Order; -use Magento\Sales\Model\Order\Payment; -use Magento\Signifyd\Api\CaseCreationServiceInterface; -use Magento\Signifyd\Model\Config; -use Magento\Signifyd\Observer\PlaceOrder; -use PHPUnit_Framework_MockObject_MockObject as MockObject; -use Psr\Log\LoggerInterface; - -class PlaceOrderTest extends \PHPUnit\Framework\TestCase -{ - /** - * @var Config|MockObject - */ - private $config; - - /** - * @var CaseCreationServiceInterface|MockObject - */ - private $creationService; - - /** - * @var LoggerInterface|MockObject - */ - private $logger; - - /** - * @var Observer|MockObject - */ - private $observer; - - /** - * @var Event|MockObject - */ - private $event; - - /** - * @var OrderInterface|MockObject - */ - private $orderEntity; - - /** - * @var PlaceOrder - */ - private $placeOrder; - - /** - * @inheritdoc - */ - protected function setUp() - { - $this->config = $this->getMockBuilder(Config::class) - ->disableOriginalConstructor() - ->setMethods(['isActive']) - ->getMock(); - - $this->logger = $this->getMockBuilder(LoggerInterface::class) - ->disableOriginalConstructor() - ->getMock(); - - $this->creationService = $this->getMockBuilder(CaseCreationServiceInterface::class) - ->disableOriginalConstructor() - ->setMethods(['createForOrder']) - ->getMock(); - - $this->observer = $this->getMockBuilder(Observer::class) - ->disableOriginalConstructor() - ->setMethods(['getEvent']) - ->getMock(); - - $this->event = $this->getMockBuilder(Event::class) - ->disableOriginalConstructor() - ->setMethods(['getData']) - ->getMock(); - - $this->placeOrder = new PlaceOrder( - $this->config, - $this->creationService, - $this->logger - ); - } - - /** - * Checks a test case when Signifyd module is disabled. - * - * @covers \Magento\Signifyd\Observer\PlaceOrder::execute - */ - public function testExecuteWithDisabledModule() - { - $orderId = 1; - $storeId = 2; - $this->withActiveSignifydIntegration(false, $storeId); - $this->withOrderEntity($orderId, $storeId); - - $this->creationService->expects(self::never()) - ->method('createForOrder'); - - $this->placeOrder->execute($this->observer); - } - - /** - * Checks a test case when the observer event returns empty an order entity. - * - * @covers \Magento\Signifyd\Observer\PlaceOrder::execute - */ - public function testExecuteWithoutOrder() - { - $this->withActiveSignifydIntegration(true); - $this->withOrderEntity(null, null); - - $this->creationService->expects(self::never()) - ->method('createForOrder'); - - $this->placeOrder->execute($this->observer); - } - - /** - * Checks a test case when the order placed with offline payment method. - * - * @covers \Magento\Signifyd\Observer\PlaceOrder::execute - */ - public function testExecuteWithOfflinePayment() - { - $orderId = 1; - $storeId = 2; - $this->withActiveSignifydIntegration(true, $storeId); - $this->withOrderEntity($orderId, $storeId); - $this->withAvailablePaymentMethod(false); - - $this->creationService->expects(self::never()) - ->method('createForOrder'); - - $this->placeOrder->execute($this->observer); - } - - /** - * Checks a test case when case creation service fails. - * - * @covers \Magento\Signifyd\Observer\PlaceOrder::execute - */ - public function testExecuteWithFailedCaseCreation() - { - $orderId = 1; - $storeId = 2; - $exceptionMessage = __('Case with the same order id already exists.'); - - $this->withActiveSignifydIntegration(true, $storeId); - $this->withOrderEntity($orderId, $storeId); - $this->withAvailablePaymentMethod(true); - - $this->creationService->method('createForOrder') - ->with(self::equalTo($orderId)) - ->willThrowException(new AlreadyExistsException($exceptionMessage)); - - $this->logger->method('error') - ->with(self::equalTo($exceptionMessage)); - - $result = $this->placeOrder->execute($this->observer); - $this->assertNull($result); - } - - /** - * Checks a test case when observer successfully calls case creation service. - * - * @covers \Magento\Signifyd\Observer\PlaceOrder::execute - */ - public function testExecute() - { - $orderId = 1; - $storeId = 2; - - $this->withActiveSignifydIntegration(true, $storeId); - $this->withOrderEntity($orderId, $storeId); - $this->withAvailablePaymentMethod(true); - - $this->creationService - ->method('createForOrder') - ->with(self::equalTo($orderId)); - - $this->logger->expects(self::never()) - ->method('error'); - - $this->placeOrder->execute($this->observer); - } - - public function testExecuteWithOrderPendingPayment() - { - $orderId = 1; - $storeId = 2; - - $this->withActiveSignifydIntegration(true, $storeId); - $this->withOrderEntity($orderId, $storeId); - $this->orderEntity->method('getState') - ->willReturn(Order::STATE_PENDING_PAYMENT); - $this->withAvailablePaymentMethod(true); - - $this->creationService->expects(self::never()) - ->method('createForOrder'); - - $this->placeOrder->execute($this->observer); - } - - /** - * Specifies order entity mock execution. - * - * @param int|null $orderId - * @param int|null $storeId - * @return void - */ - private function withOrderEntity($orderId, $storeId): void - { - $this->orderEntity = $this->getMockBuilder(OrderInterface::class) - ->disableOriginalConstructor() - ->getMock(); - - $this->orderEntity->method('getEntityId') - ->willReturn($orderId); - $this->orderEntity->method('getStoreId') - ->willReturn($storeId); - - $this->observer->method('getEvent') - ->willReturn($this->event); - - $this->event->method('getData') - ->with('order') - ->willReturn($this->orderEntity); - } - - /** - * Specifies config mock execution. - * - * @param bool $isActive - * @param int|null $storeId - * @return void - */ - private function withActiveSignifydIntegration(bool $isActive, $storeId = null): void - { - $this->config->method('isActive') - ->with($storeId) - ->willReturn($isActive); - } - - /** - * Specifies payment method mock execution. - * - * @param bool $isAvailable - * @return void - */ - private function withAvailablePaymentMethod($isAvailable) - { - /** @var MethodInterface|MockObject $paymentMethod */ - $paymentMethod = $this->getMockBuilder(MethodInterface::class) - ->disableOriginalConstructor() - ->getMock(); - - /** - * The code depends on implementation but not interface - * because order payment implements two interfaces - */ - /** @var Payment|MockObject $orderPayment */ - $orderPayment = $this->getMockBuilder(Payment::class) - ->disableOriginalConstructor() - ->getMock(); - $this->orderEntity->method('getPayment') - ->willReturn($orderPayment); - - $orderPayment->method('getMethodInstance') - ->willReturn($paymentMethod); - - $paymentMethod->method('isOffline') - ->willReturn(!$isAvailable); - } -} diff --git a/app/code/Magento/Signifyd/Ui/Component/Listing/Column/Guarantee/Options.php b/app/code/Magento/Signifyd/Ui/Component/Listing/Column/Guarantee/Options.php deleted file mode 100644 index 1e6234a8e27a9..0000000000000 --- a/app/code/Magento/Signifyd/Ui/Component/Listing/Column/Guarantee/Options.php +++ /dev/null @@ -1,56 +0,0 @@ -<?php -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ -namespace Magento\Signifyd\Ui\Component\Listing\Column\Guarantee; - -use Magento\Framework\Escaper; -use Magento\Framework\Data\OptionSourceInterface; -use Magento\Signifyd\Api\Data\CaseInterface; - -/** - * Class Options - */ -class Options implements OptionSourceInterface -{ - /** - * @var Escaper - */ - private $escaper; - - /** - * Constructor - * - * @param Escaper $escaper - */ - public function __construct(Escaper $escaper) - { - $this->escaper = $escaper; - } - - /** - * {@inheritdoc} - */ - public function toOptionArray() - { - return [ - [ - 'value' => CaseInterface::GUARANTEE_DECLINED, - 'label' => $this->escaper->escapeHtml(__('Declined')) - ], - [ - 'value' => CaseInterface::GUARANTEE_APPROVED, - 'label' => $this->escaper->escapeHtml(__('Approved')) - ], - [ - 'value' => CaseInterface::GUARANTEE_CANCELED, - 'label' => $this->escaper->escapeHtml(__('Canceled')) - ], - [ - 'value' => CaseInterface::GUARANTEE_PENDING, - 'label' => $this->escaper->escapeHtml(__('Pending')) - ] - ]; - } -} diff --git a/app/code/Magento/Signifyd/composer.json b/app/code/Magento/Signifyd/composer.json deleted file mode 100644 index c0214e9a2813c..0000000000000 --- a/app/code/Magento/Signifyd/composer.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "name": "magento/module-signifyd", - "description": "Submitting Case Entry to Signifyd on Order Creation", - "config": { - "sort-packages": true - }, - "require": { - "magento/framework": "*", - "magento/module-backend": "*", - "magento/module-checkout": "*", - "magento/module-config": "*", - "magento/module-customer": "*", - "magento/module-directory": "*", - "magento/module-payment": "*", - "magento/module-sales": "*", - "magento/module-store": "*", - "php": "~7.1.3||~7.2.0||~7.3.0" - }, - "suggest": { - "magento/module-config": "*" - }, - "type": "magento2-module", - "license": [ - "OSL-3.0", - "AFL-3.0" - ], - "autoload": { - "files": [ - "registration.php" - ], - "psr-4": { - "Magento\\Signifyd\\": "" - } - } -} diff --git a/app/code/Magento/Signifyd/etc/acl.xml b/app/code/Magento/Signifyd/etc/acl.xml deleted file mode 100644 index 32f0493fbcad9..0000000000000 --- a/app/code/Magento/Signifyd/etc/acl.xml +++ /dev/null @@ -1,22 +0,0 @@ -<?xml version="1.0"?> -<!-- -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ ---> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Acl/etc/acl.xsd"> - <acl> - <resources> - <resource id="Magento_Backend::admin"> - <resource id="Magento_Backend::stores"> - <resource id="Magento_Backend::stores_settings"> - <resource id="Magento_Config::config"> - <resource id="Magento_Sales::fraud_protection" title="Fraud Protection Section" translate="title" /> - </resource> - </resource> - </resource> - </resource> - </resources> - </acl> -</config> diff --git a/app/code/Magento/Signifyd/etc/adminhtml/di.xml b/app/code/Magento/Signifyd/etc/adminhtml/di.xml deleted file mode 100644 index c771d67216d43..0000000000000 --- a/app/code/Magento/Signifyd/etc/adminhtml/di.xml +++ /dev/null @@ -1,10 +0,0 @@ -<?xml version="1.0"?> -<!-- -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ ---> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> - <preference for="Magento\Signifyd\Model\QuoteSession\QuoteSessionInterface" type="Magento\Signifyd\Model\QuoteSession\Adminhtml\BackendSession" /> -</config> diff --git a/app/code/Magento/Signifyd/etc/adminhtml/routes.xml b/app/code/Magento/Signifyd/etc/adminhtml/routes.xml deleted file mode 100644 index c078ab3c8c4c1..0000000000000 --- a/app/code/Magento/Signifyd/etc/adminhtml/routes.xml +++ /dev/null @@ -1,14 +0,0 @@ -<?xml version="1.0"?> -<!-- -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ ---> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:App/etc/routes.xsd"> - <router id="admin"> - <route id="signifyd" frontName="signifyd"> - <module name="Magento_Signifyd" before="Magento_Backend" /> - </route> - </router> -</config> diff --git a/app/code/Magento/Signifyd/etc/adminhtml/system.xml b/app/code/Magento/Signifyd/etc/adminhtml/system.xml deleted file mode 100644 index 182a67e4e1f35..0000000000000 --- a/app/code/Magento/Signifyd/etc/adminhtml/system.xml +++ /dev/null @@ -1,77 +0,0 @@ -<?xml version="1.0"?> -<!-- -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ ---> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Config:etc/system_file.xsd"> - <system> - <section id="fraud_protection" translate="label" type="text" sortOrder="410" showInDefault="1" showInWebsite="1" showInStore="1"> - <label>Fraud Protection</label> - <tab>sales</tab> - <resource>Magento_Sales::fraud_protection</resource> - <group id="signifyd" type="text" sortOrder="10" showInDefault="1" showInWebsite="1"> - <fieldset_css>signifyd-logo-header</fieldset_css> - <group id="about" translate="label comment" sortOrder="15" showInDefault="1" showInWebsite="1"> - <frontend_model>Magento\Signifyd\Block\Adminhtml\System\Config\Fieldset\Info</frontend_model> - <fieldset_css>signifyd-about-header</fieldset_css> - <label><![CDATA[Protect your store from fraud with Guaranteed Fraud Protection by Signifyd.]]></label> - <comment><![CDATA[Signifyd automatically reviews your orders for fraud, telling you in seconds which orders to ship, and which to reject. - We back our approvals with 100% chargeback protection, reimbursing you the full order amount plus fees should you ever receive a fraudulent chargeback. - <p>Benefits:<ul> - <li>Grow your business without fear of fraud</li> - <li>Accept more orders and maximize your revenue</li> - <li>Automate order review and shift fraud off your plate</li></ul></p>]]> - </comment> - <more_url>https://www.signifyd.com/magento-guaranteed-fraud-protection</more_url> - </group> - <group id="config" translate="label comment" sortOrder="15" showInDefault="1" showInWebsite="1"> - <fieldset_css>signifyd-about-header</fieldset_css> - <label>Configuration</label> - <comment><![CDATA[<a href="https://www.signifyd.com/resources/manual/magento-2/signifyd-on-magento-integration-guide/" target="_blank">View our setup guide</a> for step-by-step instructions on how to integrate Signifyd with Magento.<br />For support contact <a href="mailto:support@signifyd.com">support@signifyd.com</a>.]]> - </comment> - <field id="active" translate="label" type="select" showInDefault="1" showInWebsite="1"> - <label>Enable this Solution</label> - <source_model>Magento\Config\Model\Config\Source\Yesno</source_model> - <config_path>fraud_protection/signifyd/active</config_path> - </field> - <field id="api_key" translate="label" type="obscure" sortOrder="20" showInDefault="1" showInWebsite="1"> - <label>API Key</label> - <comment><![CDATA[Your API key can be found on the <a href="http://signifyd.com/settings" target="_blank">settings page</a> in the Signifyd console.]]></comment> - <config_path>fraud_protection/signifyd/api_key</config_path> - <backend_model>Magento\Config\Model\Config\Backend\Encrypted</backend_model> - <depends> - <field id="active">1</field> - </depends> - </field> - <field id="api_url" translate="label" type="text" sortOrder="30" showInDefault="1" showInWebsite="1"> - <label>API URL</label> - <config_path>fraud_protection/signifyd/api_url</config_path> - <comment>Don’t change unless asked to do so.</comment> - <depends> - <field id="active">1</field> - </depends> - </field> - <field id="debug" translate="label" type="select" sortOrder="40" showInDefault="1" showInWebsite="1"> - <label>Debug</label> - <source_model>Magento\Config\Model\Config\Source\Yesno</source_model> - <config_path>fraud_protection/signifyd/debug</config_path> - <depends> - <field id="active">1</field> - </depends> - </field> - <field id="webhook_url" translate="label comment" type="text" sortOrder="50" showInDefault="1" showInWebsite="1"> - <label>Webhook URL</label> - <comment><![CDATA[Your webhook URL will be used to <a href="https://app.signifyd.com/settings/notifications" target="_blank">configure</a> a guarantee completed webhook in Signifyd. Webhooks are used to sync Signifyd`s guarantee decisions back to Magento.]]></comment> - <attribute type="handler_url">signifyd/webhooks/handler</attribute> - <frontend_model>Magento\Signifyd\Block\Adminhtml\System\Config\Field\WebhookUrl</frontend_model> - <depends> - <field id="active">1</field> - </depends> - </field> - </group> - </group> - </section> - </system> -</config> diff --git a/app/code/Magento/Signifyd/etc/config.xml b/app/code/Magento/Signifyd/etc/config.xml deleted file mode 100644 index 804342a14bb08..0000000000000 --- a/app/code/Magento/Signifyd/etc/config.xml +++ /dev/null @@ -1,19 +0,0 @@ -<?xml version="1.0"?> -<!-- -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ ---> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Store:etc/config.xsd"> - <default> - <fraud_protection> - <signifyd> - <active>0</active> - <api_url>https://api.signifyd.com/v2/</api_url> - <api_key backend_model="Magento\Config\Model\Config\Backend\Encrypted" /> - <debug>0</debug> - </signifyd> - </fraud_protection> - </default> -</config> diff --git a/app/code/Magento/Signifyd/etc/db_schema.xml b/app/code/Magento/Signifyd/etc/db_schema.xml deleted file mode 100644 index 8d47321c38b29..0000000000000 --- a/app/code/Magento/Signifyd/etc/db_schema.xml +++ /dev/null @@ -1,43 +0,0 @@ -<?xml version="1.0"?> -<!-- -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ ---> -<schema xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="urn:magento:framework:Setup/Declaration/Schema/etc/schema.xsd"> - <table name="signifyd_case" resource="sales" engine="innodb" comment="signifyd_case"> - <column xsi:type="int" name="entity_id" padding="10" unsigned="true" nullable="false" identity="true" - comment="Entity_id"/> - <column xsi:type="int" name="order_id" padding="10" unsigned="true" nullable="true" identity="false" - comment="Order_id"/> - <column xsi:type="int" name="case_id" padding="10" unsigned="true" nullable="true" identity="false" - comment="Case_id"/> - <column xsi:type="boolean" name="guarantee_eligible" nullable="true" comment="Guarantee_eligible"/> - <column xsi:type="varchar" name="guarantee_disposition" nullable="true" length="32" default="PENDING" - comment="Guarantee_disposition"/> - <column xsi:type="varchar" name="status" nullable="true" length="32" default="PENDING" comment="Status"/> - <column xsi:type="int" name="score" padding="10" unsigned="true" nullable="true" identity="false" - comment="Score"/> - <column xsi:type="text" name="associated_team" nullable="true" comment="Associated_team"/> - <column xsi:type="varchar" name="review_disposition" nullable="true" length="32" comment="Review_disposition"/> - <column xsi:type="timestamp" name="created_at" on_update="false" nullable="true" comment="Created_at"/> - <column xsi:type="timestamp" name="updated_at" on_update="false" nullable="true" comment="Updated_at"/> - <constraint xsi:type="primary" referenceId="PRIMARY"> - <column name="entity_id"/> - </constraint> - <constraint xsi:type="foreign" referenceId="SIGNIFYD_CASE_ORDER_ID_SALES_ORDER_ENTITY_ID" table="signifyd_case" - column="order_id" referenceTable="sales_order" referenceColumn="entity_id" onDelete="SET NULL"/> - <constraint xsi:type="unique" referenceId="SIGNIFYD_CASE_ORDER_ID"> - <column name="order_id"/> - </constraint> - <constraint xsi:type="unique" referenceId="SIGNIFYD_CASE_CASE_ID"> - <column name="case_id"/> - </constraint> - </table> - <table name="sales_order_grid" resource="sales" comment="Sales Flat Order Grid"> - <column xsi:type="varchar" name="signifyd_guarantee_status" nullable="true" length="32" - comment="Signifyd Guarantee Disposition Status"/> - </table> -</schema> diff --git a/app/code/Magento/Signifyd/etc/db_schema_whitelist.json b/app/code/Magento/Signifyd/etc/db_schema_whitelist.json deleted file mode 100644 index 69d164b23d9e7..0000000000000 --- a/app/code/Magento/Signifyd/etc/db_schema_whitelist.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "signifyd_case": { - "column": { - "entity_id": true, - "order_id": true, - "case_id": true, - "guarantee_eligible": true, - "guarantee_disposition": true, - "status": true, - "score": true, - "associated_team": true, - "review_disposition": true, - "created_at": true, - "updated_at": true - }, - "constraint": { - "PRIMARY": true, - "SIGNIFYD_CASE_ORDER_ID_SALES_ORDER_ENTITY_ID": true, - "SIGNIFYD_CASE_ORDER_ID": true, - "SIGNIFYD_CASE_CASE_ID": true - } - }, - "sales_order_grid": { - "column": { - "signifyd_guarantee_status": true - } - } -} \ No newline at end of file diff --git a/app/code/Magento/Signifyd/etc/di.xml b/app/code/Magento/Signifyd/etc/di.xml deleted file mode 100644 index e82e8f84b3584..0000000000000 --- a/app/code/Magento/Signifyd/etc/di.xml +++ /dev/null @@ -1,105 +0,0 @@ -<?xml version="1.0"?> -<!-- -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ ---> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> - <preference for="Magento\Signifyd\Api\Data\CaseInterface" type="Magento\Signifyd\Model\CaseEntity" /> - <preference for="Magento\Signifyd\Api\CaseRepositoryInterface" type="Magento\Signifyd\Model\CaseRepository" /> - <preference for="Magento\Signifyd\Api\CaseManagementInterface" type="Magento\Signifyd\Model\CaseManagement" /> - <preference for="Magento\Signifyd\Api\Data\CaseSearchResultsInterface" type="Magento\Signifyd\Model\CaseSearchResults" /> - <preference for="Magento\Signifyd\Api\CaseCreationServiceInterface" type="Magento\Signifyd\Model\CaseServices\CreationService" /> - <preference for="Magento\Signifyd\Api\GuaranteeCreationServiceInterface" type="Magento\Signifyd\Model\Guarantee\CreationService" /> - <preference for="Magento\Signifyd\Api\GuaranteeCancelingServiceInterface" type="Magento\Signifyd\Model\Guarantee\CancelingService" /> - <preference for="Magento\Signifyd\Model\SignifydGateway\Request\CreateCaseBuilderInterface" type="Magento\Signifyd\Model\SignifydGateway\Request\CreateCaseBuilder" /> - - <virtualType name="SignifydAvsDefaultMapper" type="Magento\Signifyd\Model\PredefinedVerificationCode" /> - <virtualType name="SignifydCvvDefaultMapper" type="Magento\Signifyd\Model\PredefinedVerificationCode" /> - - <type name="Magento\Signifyd\Model\PaymentVerificationFactory"> - <arguments> - <argument name="config" xsi:type="object">Magento\Payment\Gateway\Config\Config</argument> - <argument name="avsDefaultAdapter" xsi:type="object">SignifydAvsDefaultMapper</argument> - <argument name="cvvDefaultAdapter" xsi:type="object">SignifydCvvDefaultMapper</argument> - </arguments> - </type> - <type name="Magento\Signifyd\Model\SalesOrderGrid\OrderGridUpdater"> - <arguments> - <argument name="entityGrid" xsi:type="object">Magento\Sales\Model\ResourceModel\Order\Grid</argument> - </arguments> - </type> - <virtualType name="SignifydIdListProvider" type="Magento\Sales\Model\ResourceModel\Provider\NotSyncedDataProvider"> - <arguments> - <argument name="providers" xsi:type="array"> - <item name="signifyd" xsi:type="string">Magento\Signifyd\Model\SalesOrderGrid\NotSyncedOrderIdListProvider</item> - </argument> - </arguments> - </virtualType> - <virtualType name="Magento\Sales\Model\ResourceModel\Order\Grid"> - <arguments> - <argument name="idListProvider" xsi:type="object">SignifydIdListProvider</argument> - <argument name="joins" xsi:type="array"> - <item name="signifyd_case" xsi:type="array"> - <item name="table" xsi:type="string">signifyd_case</item> - <item name="origin_column" xsi:type="string">entity_id</item> - <item name="target_column" xsi:type="string">order_id</item> - </item> - </argument> - <argument name="columns" xsi:type="array"> - <item name="signifyd_guarantee_status" xsi:type="string">signifyd_case.guarantee_disposition</item> - </argument> - </arguments> - </virtualType> - <type name="Magento\Signifyd\Model\ResourceModel\CaseEntity"> - <arguments> - <argument name="connectionName" xsi:type="string">sales</argument> - </arguments> - </type> - <virtualType name="PaymentMapperSchemaLocator" type="Magento\Framework\Config\GenericSchemaLocator"> - <arguments> - <argument name="moduleName" xsi:type="string">Magento_Signifyd</argument> - <argument name="schema" xsi:type="string">signifyd_payment_mapping.xsd</argument> - </arguments> - </virtualType> - <virtualType name="PaymentMapperConfigReader" type="Magento\Framework\Config\Reader\Filesystem"> - <arguments> - <argument name="converter" xsi:type="object">Magento\Signifyd\Model\PaymentMethodMapper\XmlToArrayConfigConverter</argument> - <argument name="schemaLocator" xsi:type="object">PaymentMapperSchemaLocator</argument> - <argument name="fileName" xsi:type="string">signifyd_payment_mapping.xml</argument> - <argument name="idAttributes" xsi:type="array"> - <item name="/config/payment_method_list/payment_method" xsi:type="string">name</item> - </argument> - </arguments> - </virtualType> - <virtualType name="PaymentMethodConfigData" type="Magento\Framework\Config\Data"> - <arguments> - <argument name="reader" xsi:type="object">PaymentMapperConfigReader</argument> - <argument name="cacheId" xsi:type="string">signifyd_payment_list_cache</argument> - </arguments> - </virtualType> - <type name="Magento\Signifyd\Model\PaymentMethodMapper\PaymentMethodMapper"> - <arguments> - <argument name="paymentMapping" xsi:type="object">PaymentMethodConfigData</argument> - </arguments> - </type> - <type name="Magento\Config\Model\Config\TypePool"> - <arguments> - <argument name="sensitive" xsi:type="array"> - <item name="fraud_protection/signifyd/api_key" xsi:type="string">1</item> - <item name="fraud_protection/signifyd/api_url" xsi:type="string">1</item> - </argument> - <argument name="environment" xsi:type="array"> - <item name="fraud_protection/signifyd/api_key" xsi:type="string">1</item> - <item name="fraud_protection/signifyd/api_url" xsi:type="string">1</item> - </argument> - </arguments> - </type> - <type name="Magento\Sales\Model\Order"> - <plugin name="cancelGuaranteeAfterOrderCancel" type="Magento\Signifyd\Plugin\OrderPlugin" /> - </type> - <type name="Magento\Payment\Model\MethodInterface"> - <plugin name="cancelGuaranteeAfterPaymentDeny" type="Magento\Signifyd\Plugin\PaymentPlugin" /> - </type> -</config> diff --git a/app/code/Magento/Signifyd/etc/events.xml b/app/code/Magento/Signifyd/etc/events.xml deleted file mode 100644 index d44665f9fb97b..0000000000000 --- a/app/code/Magento/Signifyd/etc/events.xml +++ /dev/null @@ -1,18 +0,0 @@ -<?xml version="1.0"?> -<!-- -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ ---> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd"> - <event name="checkout_submit_all_after"> - <observer name="signifyd_place_order_observer" instance="Magento\Signifyd\Observer\PlaceOrder" /> - </event> - <event name="paypal_checkout_success"> - <observer name="signifyd_place_order_checkout_success_observer" instance="Magento\Signifyd\Observer\PlaceOrder" /> - </event> - <event name="checkout_onepage_controller_success_action"> - <observer name="signifyd_place_order_checkout_success_observer" instance="Magento\Signifyd\Observer\PlaceOrder" /> - </event> -</config> diff --git a/app/code/Magento/Signifyd/etc/frontend/di.xml b/app/code/Magento/Signifyd/etc/frontend/di.xml deleted file mode 100644 index 08a690d1a9930..0000000000000 --- a/app/code/Magento/Signifyd/etc/frontend/di.xml +++ /dev/null @@ -1,10 +0,0 @@ -<?xml version="1.0"?> -<!-- -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ ---> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> - <preference for="Magento\Signifyd\Model\QuoteSession\QuoteSessionInterface" type="Magento\Signifyd\Model\QuoteSession\FrontendSession" /> -</config> diff --git a/app/code/Magento/Signifyd/etc/frontend/routes.xml b/app/code/Magento/Signifyd/etc/frontend/routes.xml deleted file mode 100644 index 5803f59d8624b..0000000000000 --- a/app/code/Magento/Signifyd/etc/frontend/routes.xml +++ /dev/null @@ -1,14 +0,0 @@ -<?xml version="1.0"?> -<!-- -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ ---> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:App/etc/routes.xsd"> - <router id="standard"> - <route id="signifyd" frontName="signifyd"> - <module name="Magento_Signifyd" /> - </route> - </router> -</config> diff --git a/app/code/Magento/Signifyd/etc/module.xml b/app/code/Magento/Signifyd/etc/module.xml deleted file mode 100644 index 264f295e8c528..0000000000000 --- a/app/code/Magento/Signifyd/etc/module.xml +++ /dev/null @@ -1,20 +0,0 @@ -<?xml version="1.0"?> -<!-- -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ ---> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd"> - <module name="Magento_Signifyd" > - <sequence> - <module name="Magento_Sales" /> - <module name="Magento_Store" /> - <module name="Magento_Customer" /> - <module name="Magento_Directory" /> - <module name="Magento_Checkout" /> - <module name="Magento_Backend" /> - <module name="Magento_Payment" /> - </sequence> - </module> -</config> diff --git a/app/code/Magento/Signifyd/etc/signifyd_payment_mapping.xml b/app/code/Magento/Signifyd/etc/signifyd_payment_mapping.xml deleted file mode 100644 index 9ff952d04925d..0000000000000 --- a/app/code/Magento/Signifyd/etc/signifyd_payment_mapping.xml +++ /dev/null @@ -1,82 +0,0 @@ -<?xml version="1.0" ?> -<!-- -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ - /** - * Custom payment method might adds a block in payment_method_list e.g. - * <payment_method name="custom_payment_method"> - * <magento_code>custom_payment_method</magento_code> - * <signifyd_code>PAYMENT_CARD</signifyd_code> - * </payment_method> - * Appropriate value for the <signifyd_code> tag from Signifyd documentation: - * @see https://www.signifyd.com/docs/api/#/reference/webhooks/manage-single-webhooks/create-a-case - * Create a Case -> Request -> ATTRIBUTES -> paymentMethod - */ ---> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Signifyd:etc/signifyd_payment_mapping.xsd"> - <payment_method_list> - <payment_method name="braintree"> - <magento_code>braintree</magento_code> - <signifyd_code>PAYMENT_CARD</signifyd_code> - </payment_method> - <payment_method name="braintree_paypal"> - <magento_code>braintree_paypal</magento_code> - <signifyd_code>PAYPAL_ACCOUNT</signifyd_code> - </payment_method> - <payment_method name="paypal_express"> - <magento_code>paypal_express</magento_code> - <signifyd_code>PAYPAL_ACCOUNT</signifyd_code> - </payment_method> - <payment_method name="paypal_express_bml"> - <magento_code>paypal_express_bml</magento_code> - <signifyd_code>PAYPAL_ACCOUNT</signifyd_code> - </payment_method> - <payment_method name="payflow_express"> - <magento_code>payflow_express</magento_code> - <signifyd_code>PAYPAL_ACCOUNT</signifyd_code> - </payment_method> - <payment_method name="payflow_express_bml"> - <magento_code>payflow_express_bml</magento_code> - <signifyd_code>PAYPAL_ACCOUNT</signifyd_code> - </payment_method> - <payment_method name="payflowpro"> - <magento_code>payflowpro</magento_code> - <signifyd_code>PAYMENT_CARD</signifyd_code> - </payment_method> - <payment_method name="payflow_link"> - <magento_code>payflow_link</magento_code> - <signifyd_code>PAYMENT_CARD</signifyd_code> - </payment_method> - <payment_method name="payflow_advanced"> - <magento_code>payflow_advanced</magento_code> - <signifyd_code>PAYMENT_CARD</signifyd_code> - </payment_method> - <payment_method name="hosted_pro"> - <magento_code>hosted_pro</magento_code> - <signifyd_code>PAYMENT_CARD</signifyd_code> - </payment_method> - <payment_method name="authorizenet_directpost"> - <magento_code>authorizenet_directpost</magento_code> - <signifyd_code>PAYMENT_CARD</signifyd_code> - </payment_method> - <payment_method name="worldpay"> - <magento_code>worldpay</magento_code> - <signifyd_code>PAYMENT_CARD</signifyd_code> - </payment_method> - <payment_method name="eway"> - <magento_code>eway</magento_code> - <signifyd_code>PAYMENT_CARD</signifyd_code> - </payment_method> - <payment_method name="cybersource"> - <magento_code>cybersource</magento_code> - <signifyd_code>PAYMENT_CARD</signifyd_code> - </payment_method> - <payment_method name="free"> - <magento_code>free</magento_code> - <signifyd_code>FREE</signifyd_code> - </payment_method> - </payment_method_list> -</config> diff --git a/app/code/Magento/Signifyd/etc/signifyd_payment_mapping.xsd b/app/code/Magento/Signifyd/etc/signifyd_payment_mapping.xsd deleted file mode 100644 index bb3b3036d0c9c..0000000000000 --- a/app/code/Magento/Signifyd/etc/signifyd_payment_mapping.xsd +++ /dev/null @@ -1,34 +0,0 @@ -<?xml version="1.0" ?> -<!-- -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ ---> -<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"> - <xs:element name="config"> - <xs:complexType> - <xs:sequence> - <xs:element minOccurs="1" maxOccurs="unbounded" name="payment_method_list" type="payment_method_list"/> - </xs:sequence> - </xs:complexType> - </xs:element> - <xs:complexType name="payment_method_list"> - <xs:sequence> - <xs:element minOccurs="1" maxOccurs="unbounded" name="payment_method" type="payment_method"/> - </xs:sequence> - </xs:complexType> - <xs:complexType name="payment_method"> - <xs:sequence> - <xs:element minOccurs="1" name="magento_code"/> - <xs:element minOccurs="1" name="signifyd_code"/> - </xs:sequence> - <xs:attribute name="name" type="xs:string" use="optional"> - <xs:annotation> - <xs:documentation> - Element's unique identifier. - </xs:documentation> - </xs:annotation> - </xs:attribute> - </xs:complexType> -</xs:schema> diff --git a/app/code/Magento/Signifyd/i18n/en_US.csv b/app/code/Magento/Signifyd/i18n/en_US.csv deleted file mode 100644 index 40772188dac9e..0000000000000 --- a/app/code/Magento/Signifyd/i18n/en_US.csv +++ /dev/null @@ -1,46 +0,0 @@ -OPEN,Open -PROCESSING,Processing -FLAGGED,Flagged -DISMISSED,Dismissed -HELD,Held -GOOD,Good -FRAUDULENT,Fraudulent -UNSET,Unset -NULL,Unset -APPROVED,Approved -DECLINED,Declined -PENDING,Pending -CANCELED,Canceled -IN_REVIEW,"In review" -Approved,Approved -Declined,Declined -Pending,Pending -Canceled,Canceled -"In Review","In Review" -Unrequested,Unrequested -"Learn more","Learn more" -"This order already has associated case entity","This order already has associated case entity" -"The case entity should not be empty.","The case entity should not be empty." -"Cannot update Case entity.","Cannot update Case entity." -"The ""%1"" should not be empty.","The ""%1"" should not be empty." -"Case entity not found.","Case entity not found." -"Case Update: New score for the order is %1. Previous score was %2.","Case Update: New score for the order is %1. Previous score was %2." -"Awaiting the Signifyd guarantee disposition.","Awaiting the Signifyd guarantee disposition." -"Only single entrance of ""%1"" node is required.","Only single entrance of ""%1"" node is required." -"Not empty value for ""%1"" node is required.","Not empty value for ""%1"" node is required." -"%1 must implement %2","%1 must implement %2" -Error,Error -"Cannot generate message.","Cannot generate message." -"Message is generated.","Message is generated." -"Case with the same order id already exists.","Case with the same order id already exists." -"Fraud Protection Information","Fraud Protection Information" -"Signifyd Guarantee Decision","Signifyd Guarantee Decision" -"Fraud Protection Section","Fraud Protection Section" -"Fraud Protection","Fraud Protection" -"Protect your store from fraud with Guaranteed Fraud Protection by Signifyd.","Protect your store from fraud with Guaranteed Fraud Protection by Signifyd." -Configuration,Configuration -"Enable this Solution","Enable this Solution" -"API Key","API Key" -"API URL","API URL" -Debug,Debug -"Webhook URL","Webhook URL" diff --git a/app/code/Magento/Signifyd/registration.php b/app/code/Magento/Signifyd/registration.php deleted file mode 100644 index e7fa9cfd2f9b3..0000000000000 --- a/app/code/Magento/Signifyd/registration.php +++ /dev/null @@ -1,9 +0,0 @@ -<?php -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ - -use Magento\Framework\Component\ComponentRegistrar; - -ComponentRegistrar::register(ComponentRegistrar::MODULE, 'Magento_Signifyd', __DIR__); diff --git a/app/code/Magento/Signifyd/view/adminhtml/layout/sales_order_view.xml b/app/code/Magento/Signifyd/view/adminhtml/layout/sales_order_view.xml deleted file mode 100644 index ad62b2c6e01cf..0000000000000 --- a/app/code/Magento/Signifyd/view/adminhtml/layout/sales_order_view.xml +++ /dev/null @@ -1,14 +0,0 @@ -<?xml version="1.0"?> -<!-- -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ ---> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> - <body> - <referenceBlock name="order_additional_info"> - <block class="Magento\Signifyd\Block\Adminhtml\CaseInfo" name="order_case_info" template="Magento_Signifyd::case_info.phtml"/> - </referenceBlock> - </body> -</page> diff --git a/app/code/Magento/Signifyd/view/adminhtml/templates/case_info.phtml b/app/code/Magento/Signifyd/view/adminhtml/templates/case_info.phtml deleted file mode 100644 index 07f1b2c2e4ae6..0000000000000 --- a/app/code/Magento/Signifyd/view/adminhtml/templates/case_info.phtml +++ /dev/null @@ -1,31 +0,0 @@ -<?php -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ -?> -<?php /** @var $block Magento\Signifyd\Block\Adminhtml\CaseInfo */ ?> -<?php -if ($block->isEmptyCase()) { - return ''; -} -?> -<section class="admin__page-section order-case-info"> - <div class="admin__page-section-title"> - <span class="title"><?= $block->escapeHtml(__('Fraud Protection Information')) ?></span> - </div> - <div class="admin__page-section-content"> - <div class="admin__page-section-item case-information"> - <div class="admin__table-wrapper"> - <table class="admin__table-secondary order-case-table"> - <tbody> - <tr> - <th class="col-guarantee-disposition"><?= $block->escapeHtml(__('Signifyd Guarantee Decision')) ?></th> - <td class="col-guarantee-disposition"><?= $block->escapeHtml($block->getCaseGuaranteeDisposition()) ?></td> - </tr> - </tbody> - </table> - </div> - </div> - </div> -</section> diff --git a/app/code/Magento/Signifyd/view/adminhtml/ui_component/sales_order_grid.xml b/app/code/Magento/Signifyd/view/adminhtml/ui_component/sales_order_grid.xml deleted file mode 100644 index 91053d617f31f..0000000000000 --- a/app/code/Magento/Signifyd/view/adminhtml/ui_component/sales_order_grid.xml +++ /dev/null @@ -1,20 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - ~ /** - ~ * Copyright © Magento, Inc. All rights reserved. - ~ * See COPYING.txt for license details. - ~ */ - --> -<listing xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Ui:etc/ui_configuration.xsd"> - <columns name="sales_order_columns"> - <column name="signifyd_guarantee_status" component="Magento_Ui/js/grid/columns/select"> - <settings> - <filter>select</filter> - <options class="Magento\Signifyd\Ui\Component\Listing\Column\Guarantee\Options"/> - <visible>true</visible> - <dataType>select</dataType> - <label translate="true">Signifyd Guarantee Decision</label> - </settings> - </column> - </columns> -</listing> diff --git a/app/code/Magento/Signifyd/view/adminhtml/web/images/logo.png b/app/code/Magento/Signifyd/view/adminhtml/web/images/logo.png deleted file mode 100644 index 7c6645e7c6c93..0000000000000 Binary files a/app/code/Magento/Signifyd/view/adminhtml/web/images/logo.png and /dev/null differ diff --git a/app/code/Magento/Signifyd/view/adminhtml/web/js/request-send.js b/app/code/Magento/Signifyd/view/adminhtml/web/js/request-send.js deleted file mode 100644 index f55170336ca03..0000000000000 --- a/app/code/Magento/Signifyd/view/adminhtml/web/js/request-send.js +++ /dev/null @@ -1,24 +0,0 @@ -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ - -define([ - 'mageUtils', - 'Magento_Ui/js/form/components/button' -], function (utils, Button) { - 'use strict'; - - return Button.extend({ - - /** - * Creates and submits form for Guarantee create/cancel - */ - sendRequest: function () { - utils.submit({ - url: this.requestURL, - data: this.data - }); - } - }); -}); diff --git a/app/code/Magento/Signifyd/view/frontend/layout/checkout_cart_index.xml b/app/code/Magento/Signifyd/view/frontend/layout/checkout_cart_index.xml deleted file mode 100644 index 30472ae5e9ae9..0000000000000 --- a/app/code/Magento/Signifyd/view/frontend/layout/checkout_cart_index.xml +++ /dev/null @@ -1,14 +0,0 @@ -<?xml version="1.0"?> -<!-- -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ ---> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> - <body> - <referenceBlock name="head.components"> - <block class="Magento\Signifyd\Block\Fingerprint" name="signifyd.fingerprint" /> - </referenceBlock> - </body> -</page> diff --git a/app/code/Magento/Signifyd/view/frontend/layout/checkout_index_index.xml b/app/code/Magento/Signifyd/view/frontend/layout/checkout_index_index.xml deleted file mode 100644 index 30472ae5e9ae9..0000000000000 --- a/app/code/Magento/Signifyd/view/frontend/layout/checkout_index_index.xml +++ /dev/null @@ -1,14 +0,0 @@ -<?xml version="1.0"?> -<!-- -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ ---> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> - <body> - <referenceBlock name="head.components"> - <block class="Magento\Signifyd\Block\Fingerprint" name="signifyd.fingerprint" /> - </referenceBlock> - </body> -</page> diff --git a/app/code/Magento/Signifyd/view/frontend/templates/fingerprint.phtml b/app/code/Magento/Signifyd/view/frontend/templates/fingerprint.phtml deleted file mode 100644 index 657043b895f60..0000000000000 --- a/app/code/Magento/Signifyd/view/frontend/templates/fingerprint.phtml +++ /dev/null @@ -1,16 +0,0 @@ -<?php -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ - -/** @var $block Magento\Signifyd\Block\Fingerprint */ -?> -<?php if ($block->isModuleActive()) : ?> - <script - async - id="sig-api" - data-order-session-id="<?= $block->escapeHtml($block->getSignifydOrderSessionId()) ?>" - src="https://cdn-scripts.signifyd.com/api/script-tag.js"> - </script> -<?php endif; ?> diff --git a/app/code/Magento/Sitemap/Test/Mftf/Test/AdminMarketingSiteMapCreateNewTest.xml b/app/code/Magento/Sitemap/Test/Mftf/Test/AdminMarketingSiteMapCreateNewTest.xml index 0ddc0640b56df..01c8ab5658186 100644 --- a/app/code/Magento/Sitemap/Test/Mftf/Test/AdminMarketingSiteMapCreateNewTest.xml +++ b/app/code/Magento/Sitemap/Test/Mftf/Test/AdminMarketingSiteMapCreateNewTest.xml @@ -18,7 +18,7 @@ <group value="sitemap"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="LoginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="LoginAsAdmin"/> </before> <after> <actionGroup ref="AdminMarketingSiteDeleteByNameActionGroup" stepKey="deleteSiteMap"> diff --git a/app/code/Magento/Sitemap/Test/Mftf/Test/AdminMarketingSiteMapNavigateMenuTest.xml b/app/code/Magento/Sitemap/Test/Mftf/Test/AdminMarketingSiteMapNavigateMenuTest.xml index 608b284f247f3..2a9b17ad49bff 100644 --- a/app/code/Magento/Sitemap/Test/Mftf/Test/AdminMarketingSiteMapNavigateMenuTest.xml +++ b/app/code/Magento/Sitemap/Test/Mftf/Test/AdminMarketingSiteMapNavigateMenuTest.xml @@ -20,7 +20,7 @@ <group value="mtf_migrated"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="LoginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="LoginAsAdmin"/> </before> <after> <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> diff --git a/app/code/Magento/Store/App/Config/Source/InitialConfigSource.php b/app/code/Magento/Store/App/Config/Source/InitialConfigSource.php index d6e98c0ddcdaa..4598a70e99397 100644 --- a/app/code/Magento/Store/App/Config/Source/InitialConfigSource.php +++ b/app/code/Magento/Store/App/Config/Source/InitialConfigSource.php @@ -52,6 +52,7 @@ public function __construct( /** * Return whole config data from config file for specified config type. + * * Ignore $path argument due to config source must return all config data * * @param string $path @@ -65,7 +66,7 @@ public function get($path = '') * * @see \Magento\Store\Model\Config\Importer To import store configs */ - if ($this->deploymentConfig->isAvailable()) { + if ($this->deploymentConfig->isAvailable() || $this->deploymentConfig->isDbAvailable()) { return []; } diff --git a/app/code/Magento/Store/Test/Mftf/Test/AdminCreateWebsiteTest.xml b/app/code/Magento/Store/Test/Mftf/Test/AdminCreateWebsiteTest.xml index 208ed316e2e51..d25e7dbb0056a 100644 --- a/app/code/Magento/Store/Test/Mftf/Test/AdminCreateWebsiteTest.xml +++ b/app/code/Magento/Store/Test/Mftf/Test/AdminCreateWebsiteTest.xml @@ -19,7 +19,7 @@ </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> </before> <after> <actionGroup ref="AdminDeleteWebsiteActionGroup" stepKey="deleteWebsite"> diff --git a/app/code/Magento/Swagger/Controller/Index/Index.php b/app/code/Magento/Swagger/Controller/Index/Index.php index 162367aaf81f9..c486989c0b1bc 100644 --- a/app/code/Magento/Swagger/Controller/Index/Index.php +++ b/app/code/Magento/Swagger/Controller/Index/Index.php @@ -3,42 +3,38 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ +declare(strict_types=1); + namespace Magento\Swagger\Controller\Index; -/** - * Class Index - * - * @package Magento\Swagger\Controller\Index - */ -class Index extends \Magento\Framework\App\Action\Action +use Magento\Framework\App\Action\HttpGetActionInterface; +use Magento\Framework\View\Page\Config as PageConfig; +use Magento\Framework\View\Result\PageFactory as PageFactory; + +class Index implements HttpGetActionInterface { /** - * @var \Magento\Framework\View\Page\Config + * @var PageConfig */ private $pageConfig; /** - * @var \Magento\Framework\View\Result\PageFactory + * @var PageFactory */ private $pageFactory; /** - * @param \Magento\Framework\App\Action\Context $context - * @param \Magento\Framework\View\Page\Config $pageConfig - * @param \Magento\Framework\View\Result\PageFactory $pageFactory + * @param PageConfig $pageConfig + * @param PageFactory $pageFactory */ - public function __construct( - \Magento\Framework\App\Action\Context $context, - \Magento\Framework\View\Page\Config $pageConfig, - \Magento\Framework\View\Result\PageFactory $pageFactory - ) { - parent::__construct($context); + public function __construct(PageConfig $pageConfig, PageFactory $pageFactory) + { $this->pageConfig = $pageConfig; $this->pageFactory = $pageFactory; } /** - * @return \Magento\Framework\View\Result\Page + * @inheritDoc */ public function execute() { diff --git a/app/code/Magento/Swagger/Test/Unit/Controller/Index/IndexTest.php b/app/code/Magento/Swagger/Test/Unit/Controller/Index/IndexTest.php index c409cd6ca7504..abfc40d7e5437 100644 --- a/app/code/Magento/Swagger/Test/Unit/Controller/Index/IndexTest.php +++ b/app/code/Magento/Swagger/Test/Unit/Controller/Index/IndexTest.php @@ -8,29 +8,29 @@ namespace Magento\Swagger\Test\Unit\Controller\Index; -class IndexTest extends \PHPUnit\Framework\TestCase +use Magento\Framework\View\Page\Config as PageConfig; +use Magento\Framework\View\Result\PageFactory; +use Magento\Swagger\Controller\Index\Index; +use PHPUnit\Framework\MockObject\MockObject; +use PHPUnit\Framework\TestCase; + +class IndexTest extends TestCase { public function testExecute() { - $objectManager = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this); - - $pageConfigMock = $this->getMockBuilder(\Magento\Framework\View\Page\Config::class) + /** @var MockObject|PageConfig $pageConfigMock */ + $pageConfigMock = $this->getMockBuilder(PageConfig::class) ->disableOriginalConstructor() ->getMock(); - $resultPageFactory = $this->getMockBuilder(\Magento\Framework\View\Result\PageFactory::class) + /** @var MockObject|PageFactory $resultPageFactory */ + $resultPageFactory = $this->getMockBuilder(PageFactory::class) ->disableOriginalConstructor() ->getMock(); $pageConfigMock->expects($this->once())->method('addBodyClass')->with('swagger-section'); $resultPageFactory->expects($this->once())->method('create'); - $model = $objectManager->getObject( - \Magento\Swagger\Controller\Index\Index::class, - [ - 'pageConfig' => $pageConfigMock, - 'pageFactory' => $resultPageFactory - ] - ); - $model->execute(); + $indexAction = new Index($pageConfigMock, $resultPageFactory); + $indexAction->execute(); } } diff --git a/app/code/Magento/Swatches/Test/Mftf/Test/AdminCheckColorUploadChooserVisualSwatchTest.xml b/app/code/Magento/Swatches/Test/Mftf/Test/AdminCheckColorUploadChooserVisualSwatchTest.xml index 65ac017072917..a4fc0bdcfd1fb 100644 --- a/app/code/Magento/Swatches/Test/Mftf/Test/AdminCheckColorUploadChooserVisualSwatchTest.xml +++ b/app/code/Magento/Swatches/Test/Mftf/Test/AdminCheckColorUploadChooserVisualSwatchTest.xml @@ -17,7 +17,7 @@ <group value="Swatches"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> </before> <amOnPage url="{{ProductAttributePage.url}}" stepKey="addNewProductAttribute"/> <selectOption selector="{{AttributePropertiesSection.InputType}}" diff --git a/app/code/Magento/Swatches/Test/Mftf/Test/AdminCheckTextSwatchAttributeAddedViaApiTest.xml b/app/code/Magento/Swatches/Test/Mftf/Test/AdminCheckTextSwatchAttributeAddedViaApiTest.xml index 5e5515aa25a74..6ac5f2a55f3cf 100644 --- a/app/code/Magento/Swatches/Test/Mftf/Test/AdminCheckTextSwatchAttributeAddedViaApiTest.xml +++ b/app/code/Magento/Swatches/Test/Mftf/Test/AdminCheckTextSwatchAttributeAddedViaApiTest.xml @@ -18,7 +18,7 @@ </annotations> <before> <!-- Login as Admin --> - <actionGroup ref="LoginAsAdmin" stepKey="loginToAdminPanel"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginToAdminPanel"/> <!-- Create an attribute with two options to be used in the first child product --> <createData entity="textSwatchProductAttribute" stepKey="createTextSwatchConfigProductAttribute"/> <!-- Add the attribute just created to default attribute set --> @@ -29,7 +29,7 @@ <after> <!-- Delete Created Data --> <deleteData createDataKey="createTextSwatchConfigProductAttribute" stepKey="deleteAttribute"/> - <actionGroup ref="logout" stepKey="logout"/> + <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> <!-- Reindex invalidated indices after product attribute has been created/deleted --> <actionGroup ref="CliRunReindexUsingCronJobsActionGroup" stepKey="reindexInvalidatedIndices"/> </after> diff --git a/app/code/Magento/Swatches/Test/Mftf/Test/AdminCreateImageSwatchTest.xml b/app/code/Magento/Swatches/Test/Mftf/Test/AdminCreateImageSwatchTest.xml index ff1286d8092fc..a42aadc497a7a 100644 --- a/app/code/Magento/Swatches/Test/Mftf/Test/AdminCreateImageSwatchTest.xml +++ b/app/code/Magento/Swatches/Test/Mftf/Test/AdminCreateImageSwatchTest.xml @@ -20,7 +20,7 @@ </annotations> <before> <createData entity="ApiCategory" stepKey="createCategory"/> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> </before> <after> <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> diff --git a/app/code/Magento/Swatches/Test/Mftf/Test/AdminCreateTextSwatchTest.xml b/app/code/Magento/Swatches/Test/Mftf/Test/AdminCreateTextSwatchTest.xml index 5437489fd5697..6b2a29d8ec451 100644 --- a/app/code/Magento/Swatches/Test/Mftf/Test/AdminCreateTextSwatchTest.xml +++ b/app/code/Magento/Swatches/Test/Mftf/Test/AdminCreateTextSwatchTest.xml @@ -18,7 +18,7 @@ <group value="Swatches"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> </before> <after> <actionGroup ref="AdminLogoutActionGroup" stepKey="adminLogout"/> diff --git a/app/code/Magento/Swatches/Test/Mftf/Test/AdminCreateVisualSwatchTest.xml b/app/code/Magento/Swatches/Test/Mftf/Test/AdminCreateVisualSwatchTest.xml index 7599111260980..1a6c0341c0704 100644 --- a/app/code/Magento/Swatches/Test/Mftf/Test/AdminCreateVisualSwatchTest.xml +++ b/app/code/Magento/Swatches/Test/Mftf/Test/AdminCreateVisualSwatchTest.xml @@ -20,7 +20,7 @@ </annotations> <before> <createData entity="ApiCategory" stepKey="createCategory"/> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> </before> <after> <!-- Clean up our modifications to the existing color attribute --> diff --git a/app/code/Magento/Swatches/Test/Mftf/Test/AdminCreateVisualSwatchWithNonValidOptionsTest.xml b/app/code/Magento/Swatches/Test/Mftf/Test/AdminCreateVisualSwatchWithNonValidOptionsTest.xml index 5660922962b47..e93a27d377a52 100644 --- a/app/code/Magento/Swatches/Test/Mftf/Test/AdminCreateVisualSwatchWithNonValidOptionsTest.xml +++ b/app/code/Magento/Swatches/Test/Mftf/Test/AdminCreateVisualSwatchWithNonValidOptionsTest.xml @@ -17,7 +17,7 @@ <group value="Swatches"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="login"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="login"/> </before> <after> <!-- Remove attribute --> diff --git a/app/code/Magento/Swatches/Test/Mftf/Test/AdminDisablingSwatchTooltipsTest.xml b/app/code/Magento/Swatches/Test/Mftf/Test/AdminDisablingSwatchTooltipsTest.xml index 7d3d1aafd8d6d..8fd21acbd51d9 100644 --- a/app/code/Magento/Swatches/Test/Mftf/Test/AdminDisablingSwatchTooltipsTest.xml +++ b/app/code/Magento/Swatches/Test/Mftf/Test/AdminDisablingSwatchTooltipsTest.xml @@ -22,7 +22,7 @@ <createData entity="ApiCategory" stepKey="createCategory"/> <!-- Log in --> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> </before> <after> <!-- Clean up our modifications to the existing color attribute --> diff --git a/app/code/Magento/Swatches/Test/Mftf/Test/AdminSaveConfigurableProductWithAttributesImagesAndSwatchesTest.xml b/app/code/Magento/Swatches/Test/Mftf/Test/AdminSaveConfigurableProductWithAttributesImagesAndSwatchesTest.xml index 0ca0561be0a0d..06a51575e68fb 100644 --- a/app/code/Magento/Swatches/Test/Mftf/Test/AdminSaveConfigurableProductWithAttributesImagesAndSwatchesTest.xml +++ b/app/code/Magento/Swatches/Test/Mftf/Test/AdminSaveConfigurableProductWithAttributesImagesAndSwatchesTest.xml @@ -20,7 +20,7 @@ </annotations> <before> <!-- Login as admin --> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <!-- Create a new product attribute --> <actionGroup ref="AdminOpenProductAttributePageActionGroup" stepKey="openProductAttributePage"/> diff --git a/app/code/Magento/Swatches/Test/Mftf/Test/AdminSetUpWatermarkForSwatchImageTest.xml b/app/code/Magento/Swatches/Test/Mftf/Test/AdminSetUpWatermarkForSwatchImageTest.xml index d5bc8dbadfb56..3e133dacc66c1 100644 --- a/app/code/Magento/Swatches/Test/Mftf/Test/AdminSetUpWatermarkForSwatchImageTest.xml +++ b/app/code/Magento/Swatches/Test/Mftf/Test/AdminSetUpWatermarkForSwatchImageTest.xml @@ -22,7 +22,7 @@ <before> <!-- Login as Admin --> <comment userInput="Login as Admin" stepKey="commentLoginAsAdmin"/> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> </before> <after> <!-- Log out --> diff --git a/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontConfigurableProductSwatchMinimumPriceTest/StorefrontConfigurableProductSwatchMinimumPriceProductPageTest.xml b/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontConfigurableProductSwatchMinimumPriceTest/StorefrontConfigurableProductSwatchMinimumPriceProductPageTest.xml index fdc8fb631dd8a..62444fd9d30e1 100644 --- a/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontConfigurableProductSwatchMinimumPriceTest/StorefrontConfigurableProductSwatchMinimumPriceProductPageTest.xml +++ b/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontConfigurableProductSwatchMinimumPriceTest/StorefrontConfigurableProductSwatchMinimumPriceProductPageTest.xml @@ -21,7 +21,7 @@ <!-- Create category --> <createData entity="ApiCategory" stepKey="createCategory"/> <!-- Login as Admin --> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin1"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin1"/> </before> <after> <!-- Delete configurable product and all child products --> diff --git a/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontFilterByImageSwatchTest.xml b/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontFilterByImageSwatchTest.xml index 1fe46c20a542d..47018a1b142b2 100644 --- a/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontFilterByImageSwatchTest.xml +++ b/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontFilterByImageSwatchTest.xml @@ -24,7 +24,7 @@ <createData entity="ApiSimpleProduct" stepKey="createSimpleProduct"> <requiredEntity createDataKey="createCategory"/> </createData> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> </before> <after> diff --git a/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontFilterByTextSwatchTest.xml b/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontFilterByTextSwatchTest.xml index 820150b10d06a..82dbff950d62f 100644 --- a/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontFilterByTextSwatchTest.xml +++ b/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontFilterByTextSwatchTest.xml @@ -23,7 +23,7 @@ <createData entity="ApiSimpleProduct" stepKey="createSimpleProduct"> <requiredEntity createDataKey="createCategory"/> </createData> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> </before> <after> <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> diff --git a/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontFilterByVisualSwatchTest.xml b/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontFilterByVisualSwatchTest.xml index 76ec3658243bf..b6b3e58bd7c01 100644 --- a/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontFilterByVisualSwatchTest.xml +++ b/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontFilterByVisualSwatchTest.xml @@ -24,7 +24,7 @@ <createData entity="ApiSimpleProduct" stepKey="createSimpleProduct"> <requiredEntity createDataKey="createCategory"/> </createData> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> </before> <after> diff --git a/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontImageColorWhenFilterByColorFilterTest.xml b/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontImageColorWhenFilterByColorFilterTest.xml index d15d5dcb3d63c..47ca8ce44bec3 100644 --- a/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontImageColorWhenFilterByColorFilterTest.xml +++ b/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontImageColorWhenFilterByColorFilterTest.xml @@ -25,7 +25,7 @@ <createData entity="ApiConfigurableProduct" stepKey="createConfigProduct"> <requiredEntity createDataKey="createCategory"/> </createData> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> </before> <after> <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> diff --git a/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontSeeProductImagesMatchingProductSwatchesTest.xml b/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontSeeProductImagesMatchingProductSwatchesTest.xml index 22ce176da8233..43944ceef33ef 100644 --- a/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontSeeProductImagesMatchingProductSwatchesTest.xml +++ b/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontSeeProductImagesMatchingProductSwatchesTest.xml @@ -21,7 +21,7 @@ <before> <createData entity="SimpleProduct2" stepKey="createSimpleProduct"/> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> </before> <after> diff --git a/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontSwatchAttributesDisplayInWidgetCMSTest.xml b/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontSwatchAttributesDisplayInWidgetCMSTest.xml index 9acfdf394be4b..a1d346ffa2744 100644 --- a/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontSwatchAttributesDisplayInWidgetCMSTest.xml +++ b/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontSwatchAttributesDisplayInWidgetCMSTest.xml @@ -54,7 +54,7 @@ <actionGroup ref="AdminLogoutActionGroup" stepKey="logoutFromAdmin"/> </after> <!--Login--> - <actionGroup ref="LoginAsAdmin" stepKey="loginToAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginToAdmin"/> <!--Create a configurable swatch product via the UI --> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="goToProductIndex"/> <waitForPageLoad stepKey="waitForProductPage"/> @@ -86,7 +86,7 @@ <seeElement selector="{{StorefrontProductInfoMainSection.productSwatch(visualSwatchOption2.default_label)}}" stepKey="assertAddedWidgetM"/> <!--Login to delete CMS page--> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <actionGroup ref="DeletePageByUrlKeyActionGroup" stepKey="deletePage"> <argument name="UrlKey" value="$grabTextFromUrlKey"/> </actionGroup> diff --git a/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontSwatchProductWithFileCustomOptionTest.xml b/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontSwatchProductWithFileCustomOptionTest.xml index 5c0ad3bc4ea77..e027a41cd9d2a 100644 --- a/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontSwatchProductWithFileCustomOptionTest.xml +++ b/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontSwatchProductWithFileCustomOptionTest.xml @@ -29,7 +29,7 @@ <actionGroup ref="AdminLogoutActionGroup" stepKey="adminLogout"/> </after> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <!-- Create a configurable swatch product via the UI --> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="goToProductIndex"/> diff --git a/app/code/Magento/Tax/Test/Mftf/Test/AdminCheckCreditMemoTotalsTest.xml b/app/code/Magento/Tax/Test/Mftf/Test/AdminCheckCreditMemoTotalsTest.xml index dce8852ac5628..fc4b6dd8b84c5 100644 --- a/app/code/Magento/Tax/Test/Mftf/Test/AdminCheckCreditMemoTotalsTest.xml +++ b/app/code/Magento/Tax/Test/Mftf/Test/AdminCheckCreditMemoTotalsTest.xml @@ -33,7 +33,7 @@ <!--Create customer--> <createData entity="Simple_US_Customer_NY" stepKey="createCustomer"/> <!--Login as admin--> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <!--Create tax rule--> <actionGroup ref="AdminCreateTaxRuleCustomProductTaxClassActionGroup" stepKey="createTaxRuleCustomProductTaxClass"> <argument name="productTaxClassName" value="$createProductTaxClass.taxClass[class_name]$"/> diff --git a/app/code/Magento/Tax/Test/Mftf/Test/AdminCheckingTaxReportGridTest.xml b/app/code/Magento/Tax/Test/Mftf/Test/AdminCheckingTaxReportGridTest.xml index 3e0998b79c3f5..0990daf1ecfbf 100644 --- a/app/code/Magento/Tax/Test/Mftf/Test/AdminCheckingTaxReportGridTest.xml +++ b/app/code/Magento/Tax/Test/Mftf/Test/AdminCheckingTaxReportGridTest.xml @@ -46,7 +46,7 @@ </getData> <!-- Login to Admin --> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <!-- Go to Tax Rule page, add Tax Rate, unassign Default Tax Rate --> <amOnPage url="{{AdminEditTaxRulePage.url($createTaxRule.id$)}}" stepKey="goToTaxRulePage"/> @@ -119,7 +119,7 @@ <actionGroup ref="ClearFiltersAdminDataGridActionGroup" stepKey="clearFilterCustomer"/> <!-- Logout Admin --> - <actionGroup ref="logout" stepKey="logoutFromAdmin"/> + <actionGroup ref="AdminLogoutActionGroup" stepKey="logoutFromAdmin"/> </after> <!--Open Created product. In Tax Class select new created Product Tax class.--> diff --git a/app/code/Magento/Tax/Test/Mftf/Test/AdminCreateDefaultsTaxRuleTest.xml b/app/code/Magento/Tax/Test/Mftf/Test/AdminCreateDefaultsTaxRuleTest.xml index e632f6265f438..3a5f905d89dd5 100644 --- a/app/code/Magento/Tax/Test/Mftf/Test/AdminCreateDefaultsTaxRuleTest.xml +++ b/app/code/Magento/Tax/Test/Mftf/Test/AdminCreateDefaultsTaxRuleTest.xml @@ -20,7 +20,7 @@ </annotations> <before> <createData entity="defaultTaxRate" stepKey="initialTaxRate"/> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> </before> <after> <actionGroup ref="AdminDeleteTaxRule" stepKey="deleteTaxRule"> diff --git a/app/code/Magento/Tax/Test/Mftf/Test/AdminCreateTaxRateAllPostCodesTest.xml b/app/code/Magento/Tax/Test/Mftf/Test/AdminCreateTaxRateAllPostCodesTest.xml index b63ca1953157f..06160eb09b787 100644 --- a/app/code/Magento/Tax/Test/Mftf/Test/AdminCreateTaxRateAllPostCodesTest.xml +++ b/app/code/Magento/Tax/Test/Mftf/Test/AdminCreateTaxRateAllPostCodesTest.xml @@ -19,7 +19,7 @@ <group value="mtf_migrated"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> </before> <after> <amOnPage url="{{AdminTaxRateGridPage.url}}" stepKey="goToTaxRateIndex"/> diff --git a/app/code/Magento/Tax/Test/Mftf/Test/AdminCreateTaxRateInvalidPostcodeTestLengthTest.xml b/app/code/Magento/Tax/Test/Mftf/Test/AdminCreateTaxRateInvalidPostcodeTestLengthTest.xml index 3befada509afa..3a6e4dfef5bac 100644 --- a/app/code/Magento/Tax/Test/Mftf/Test/AdminCreateTaxRateInvalidPostcodeTestLengthTest.xml +++ b/app/code/Magento/Tax/Test/Mftf/Test/AdminCreateTaxRateInvalidPostcodeTestLengthTest.xml @@ -19,7 +19,7 @@ <group value="mtf_migrated"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> </before> <amOnPage url="{{AdminTaxRateGridPage.url}}" stepKey="goToTaxRateIndex1"/> diff --git a/app/code/Magento/Tax/Test/Mftf/Test/AdminCreateTaxRateLargeRateTest.xml b/app/code/Magento/Tax/Test/Mftf/Test/AdminCreateTaxRateLargeRateTest.xml index cb79de19ce23a..b55ec35fa9eb1 100644 --- a/app/code/Magento/Tax/Test/Mftf/Test/AdminCreateTaxRateLargeRateTest.xml +++ b/app/code/Magento/Tax/Test/Mftf/Test/AdminCreateTaxRateLargeRateTest.xml @@ -19,7 +19,7 @@ <group value="mtf_migrated"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> </before> <after> <amOnPage url="{{AdminTaxRateGridPage.url}}" stepKey="goToTaxRateIndex"/> diff --git a/app/code/Magento/Tax/Test/Mftf/Test/AdminCreateTaxRateSpecificPostcodeTest.xml b/app/code/Magento/Tax/Test/Mftf/Test/AdminCreateTaxRateSpecificPostcodeTest.xml index 696d6c4c87763..379164d134448 100644 --- a/app/code/Magento/Tax/Test/Mftf/Test/AdminCreateTaxRateSpecificPostcodeTest.xml +++ b/app/code/Magento/Tax/Test/Mftf/Test/AdminCreateTaxRateSpecificPostcodeTest.xml @@ -19,7 +19,7 @@ <group value="mtf_migrated"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> </before> <after> <amOnPage url="{{AdminTaxRateGridPage.url}}" stepKey="goToTaxRateIndex"/> diff --git a/app/code/Magento/Tax/Test/Mftf/Test/AdminCreateTaxRateWiderZipCodeRangeTest.xml b/app/code/Magento/Tax/Test/Mftf/Test/AdminCreateTaxRateWiderZipCodeRangeTest.xml index c6c5e318cc791..d276a6a276b2c 100644 --- a/app/code/Magento/Tax/Test/Mftf/Test/AdminCreateTaxRateWiderZipCodeRangeTest.xml +++ b/app/code/Magento/Tax/Test/Mftf/Test/AdminCreateTaxRateWiderZipCodeRangeTest.xml @@ -19,7 +19,7 @@ <group value="mtf_migrated"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> </before> <after> <amOnPage url="{{AdminTaxRateGridPage.url}}" stepKey="goToTaxRateIndex"/> diff --git a/app/code/Magento/Tax/Test/Mftf/Test/AdminCreateTaxRateZipCodeRangeTest.xml b/app/code/Magento/Tax/Test/Mftf/Test/AdminCreateTaxRateZipCodeRangeTest.xml index f75fa716e9d30..998c948d869d0 100644 --- a/app/code/Magento/Tax/Test/Mftf/Test/AdminCreateTaxRateZipCodeRangeTest.xml +++ b/app/code/Magento/Tax/Test/Mftf/Test/AdminCreateTaxRateZipCodeRangeTest.xml @@ -19,7 +19,7 @@ <group value="mtf_migrated"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> </before> <after> <amOnPage url="{{AdminTaxRateGridPage.url}}" stepKey="goToTaxRateIndex"/> diff --git a/app/code/Magento/Tax/Test/Mftf/Test/AdminCreateTaxRuleWithCustomerAndProductTaxClassTest.xml b/app/code/Magento/Tax/Test/Mftf/Test/AdminCreateTaxRuleWithCustomerAndProductTaxClassTest.xml index 03b12c8f28098..6e2ca794379f6 100644 --- a/app/code/Magento/Tax/Test/Mftf/Test/AdminCreateTaxRuleWithCustomerAndProductTaxClassTest.xml +++ b/app/code/Magento/Tax/Test/Mftf/Test/AdminCreateTaxRuleWithCustomerAndProductTaxClassTest.xml @@ -28,7 +28,7 @@ <getData entity="productTaxClass" stepKey="productTaxClass"> <requiredEntity createDataKey="createProductTaxClass"/> </getData> - <actionGroup ref="LoginAsAdmin" stepKey="LoginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="LoginAsAdmin"/> </before> <after> <actionGroup ref="AdminDeleteTaxRule" stepKey="deleteTaxRule"> diff --git a/app/code/Magento/Tax/Test/Mftf/Test/AdminCreateTaxRuleWithNewAndExistingTaxRateAndCustomerAndProductTaxClassTest.xml b/app/code/Magento/Tax/Test/Mftf/Test/AdminCreateTaxRuleWithNewAndExistingTaxRateAndCustomerAndProductTaxClassTest.xml index abff31803a165..895bb920973c8 100644 --- a/app/code/Magento/Tax/Test/Mftf/Test/AdminCreateTaxRuleWithNewAndExistingTaxRateAndCustomerAndProductTaxClassTest.xml +++ b/app/code/Magento/Tax/Test/Mftf/Test/AdminCreateTaxRuleWithNewAndExistingTaxRateAndCustomerAndProductTaxClassTest.xml @@ -29,7 +29,7 @@ <getData entity="productTaxClass" stepKey="productTaxClass"> <requiredEntity createDataKey="createProductTaxClass"/> </getData> - <actionGroup ref="LoginAsAdmin" stepKey="LoginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="LoginAsAdmin"/> </before> <after> <actionGroup ref="AdminDeleteTaxRule" stepKey="deleteTaxRule"> diff --git a/app/code/Magento/Tax/Test/Mftf/Test/AdminCreateTaxRuleWithNewTaxClassesAndTaxRateTest.xml b/app/code/Magento/Tax/Test/Mftf/Test/AdminCreateTaxRuleWithNewTaxClassesAndTaxRateTest.xml index 6e9b81743ddf0..43ce4059ad84e 100644 --- a/app/code/Magento/Tax/Test/Mftf/Test/AdminCreateTaxRuleWithNewTaxClassesAndTaxRateTest.xml +++ b/app/code/Magento/Tax/Test/Mftf/Test/AdminCreateTaxRuleWithNewTaxClassesAndTaxRateTest.xml @@ -29,7 +29,7 @@ <getData entity="productTaxClass" stepKey="productTaxClass"> <requiredEntity createDataKey="createProductTaxClass"/> </getData> - <actionGroup ref="LoginAsAdmin" stepKey="LoginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="LoginAsAdmin"/> </before> <after> <actionGroup ref="AdminDeleteTaxRule" stepKey="deleteTaxRule"> diff --git a/app/code/Magento/Tax/Test/Mftf/Test/AdminCreateTaxRuleWithZipRangeTest.xml b/app/code/Magento/Tax/Test/Mftf/Test/AdminCreateTaxRuleWithZipRangeTest.xml index 6a9bf30811ff5..0293e04293daf 100644 --- a/app/code/Magento/Tax/Test/Mftf/Test/AdminCreateTaxRuleWithZipRangeTest.xml +++ b/app/code/Magento/Tax/Test/Mftf/Test/AdminCreateTaxRuleWithZipRangeTest.xml @@ -29,7 +29,7 @@ <getData entity="productTaxClass" stepKey="productTaxClass"> <requiredEntity createDataKey="createProductTaxClass"/> </getData> - <actionGroup ref="LoginAsAdmin" stepKey="LoginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="LoginAsAdmin"/> </before> <after> <actionGroup ref="AdminDeleteTaxRule" stepKey="deleteTaxRule"> diff --git a/app/code/Magento/Tax/Test/Mftf/Test/AdminDeleteTaxRuleTest.xml b/app/code/Magento/Tax/Test/Mftf/Test/AdminDeleteTaxRuleTest.xml index 72adf7b0dae1e..770cdd1e3b2c4 100644 --- a/app/code/Magento/Tax/Test/Mftf/Test/AdminDeleteTaxRuleTest.xml +++ b/app/code/Magento/Tax/Test/Mftf/Test/AdminDeleteTaxRuleTest.xml @@ -23,7 +23,7 @@ <createData entity="defaultTaxRule" stepKey="initialTaxRule"/> <createData entity="ApiSimplePrice100Qty100v2" stepKey="simpleProduct"/> <createData entity="Simple_US_Utah_Customer" stepKey="customer" /> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> </before> <after> <deleteData stepKey="deleteSimpleProduct" createDataKey="simpleProduct" /> diff --git a/app/code/Magento/Tax/Test/Mftf/Test/AdminStoresTaxRulesNavigateMenuTest.xml b/app/code/Magento/Tax/Test/Mftf/Test/AdminStoresTaxRulesNavigateMenuTest.xml index 219cb309820d8..fd5b07a88b52f 100644 --- a/app/code/Magento/Tax/Test/Mftf/Test/AdminStoresTaxRulesNavigateMenuTest.xml +++ b/app/code/Magento/Tax/Test/Mftf/Test/AdminStoresTaxRulesNavigateMenuTest.xml @@ -20,7 +20,7 @@ <group value="mtf_migrated"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="LoginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="LoginAsAdmin"/> </before> <after> <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> diff --git a/app/code/Magento/Tax/Test/Mftf/Test/AdminStoresTaxZonesAndRatesNavigateMenuTest.xml b/app/code/Magento/Tax/Test/Mftf/Test/AdminStoresTaxZonesAndRatesNavigateMenuTest.xml index 73c8c63be0318..824d6d1630162 100644 --- a/app/code/Magento/Tax/Test/Mftf/Test/AdminStoresTaxZonesAndRatesNavigateMenuTest.xml +++ b/app/code/Magento/Tax/Test/Mftf/Test/AdminStoresTaxZonesAndRatesNavigateMenuTest.xml @@ -20,7 +20,7 @@ <group value="mtf_migrated"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="LoginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="LoginAsAdmin"/> </before> <after> <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> diff --git a/app/code/Magento/Tax/Test/Mftf/Test/AdminSystemImportExportTaxRatesNavigateMenuTest.xml b/app/code/Magento/Tax/Test/Mftf/Test/AdminSystemImportExportTaxRatesNavigateMenuTest.xml index 2b2e0c5184d4a..a6939bf14c4a1 100644 --- a/app/code/Magento/Tax/Test/Mftf/Test/AdminSystemImportExportTaxRatesNavigateMenuTest.xml +++ b/app/code/Magento/Tax/Test/Mftf/Test/AdminSystemImportExportTaxRatesNavigateMenuTest.xml @@ -20,7 +20,7 @@ <group value="mtf_migrated"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="LoginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="LoginAsAdmin"/> </before> <after> <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> diff --git a/app/code/Magento/Tax/Test/Mftf/Test/AdminUpdateDefaultTaxRuleTest.xml b/app/code/Magento/Tax/Test/Mftf/Test/AdminUpdateDefaultTaxRuleTest.xml index 0390542544060..61b09eabe7d35 100644 --- a/app/code/Magento/Tax/Test/Mftf/Test/AdminUpdateDefaultTaxRuleTest.xml +++ b/app/code/Magento/Tax/Test/Mftf/Test/AdminUpdateDefaultTaxRuleTest.xml @@ -29,7 +29,7 @@ <getData entity="productTaxClass" stepKey="productTaxClass"> <requiredEntity createDataKey="createProductTaxClass"/> </getData> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> </before> <after> <deleteData stepKey="deleteTaxRule" createDataKey="initialTaxRule" /> diff --git a/app/code/Magento/Tax/Test/Mftf/Test/AdminUpdateTaxRuleWithCustomClassesTest.xml b/app/code/Magento/Tax/Test/Mftf/Test/AdminUpdateTaxRuleWithCustomClassesTest.xml index 0e87f268f8825..b7ffe05ebf5c2 100644 --- a/app/code/Magento/Tax/Test/Mftf/Test/AdminUpdateTaxRuleWithCustomClassesTest.xml +++ b/app/code/Magento/Tax/Test/Mftf/Test/AdminUpdateTaxRuleWithCustomClassesTest.xml @@ -30,7 +30,7 @@ <getData entity="productTaxClass" stepKey="productTaxClass"> <requiredEntity createDataKey="createProductTaxClass"/> </getData> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> </before> <after> <deleteData stepKey="deleteTaxRule" createDataKey="initialTaxRule" /> diff --git a/app/code/Magento/Tax/Test/Mftf/Test/AdminUpdateTaxRuleWithFixedZipUtahTest.xml b/app/code/Magento/Tax/Test/Mftf/Test/AdminUpdateTaxRuleWithFixedZipUtahTest.xml index a96a57cbfec55..14df3f8987f5e 100644 --- a/app/code/Magento/Tax/Test/Mftf/Test/AdminUpdateTaxRuleWithFixedZipUtahTest.xml +++ b/app/code/Magento/Tax/Test/Mftf/Test/AdminUpdateTaxRuleWithFixedZipUtahTest.xml @@ -32,7 +32,7 @@ </getData> <createData entity="ApiSimplePrice100Qty100v2" stepKey="simpleProduct"/> <createData entity="Simple_US_Utah_Customer" stepKey="customer" /> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> </before> <after> <deleteData stepKey="deleteTaxRule" createDataKey="initialTaxRule" /> diff --git a/app/code/Magento/Tax/Test/Mftf/Test/DeleteTaxRateEntityTest.xml b/app/code/Magento/Tax/Test/Mftf/Test/DeleteTaxRateEntityTest.xml index 5f855f5bb750d..4b34121b10829 100644 --- a/app/code/Magento/Tax/Test/Mftf/Test/DeleteTaxRateEntityTest.xml +++ b/app/code/Magento/Tax/Test/Mftf/Test/DeleteTaxRateEntityTest.xml @@ -20,7 +20,7 @@ </annotations> <before> <createData entity="defaultTaxRate" stepKey="initialTaxRate"/> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> </before> <!-- Search the tax rate on tax grid page --> diff --git a/app/code/Magento/Tax/Test/Mftf/Test/StorefrontTaxQuoteCartTest/StorefrontTaxQuoteCartGuestSimpleTest.xml b/app/code/Magento/Tax/Test/Mftf/Test/StorefrontTaxQuoteCartTest/StorefrontTaxQuoteCartGuestSimpleTest.xml index b4070081519d7..959aa323308be 100644 --- a/app/code/Magento/Tax/Test/Mftf/Test/StorefrontTaxQuoteCartTest/StorefrontTaxQuoteCartGuestSimpleTest.xml +++ b/app/code/Magento/Tax/Test/Mftf/Test/StorefrontTaxQuoteCartTest/StorefrontTaxQuoteCartGuestSimpleTest.xml @@ -18,7 +18,7 @@ <group value="Tax"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <createData entity="SimpleProduct2" stepKey="simpleProduct1"/> <!-- Fill in rules to display tax in the cart --> diff --git a/app/code/Magento/Tax/Test/Mftf/Test/StorefrontTaxQuoteCartTest/StorefrontTaxQuoteCartGuestVirtualTest.xml b/app/code/Magento/Tax/Test/Mftf/Test/StorefrontTaxQuoteCartTest/StorefrontTaxQuoteCartGuestVirtualTest.xml index 9469f6a7a6f20..c1268638c7104 100644 --- a/app/code/Magento/Tax/Test/Mftf/Test/StorefrontTaxQuoteCartTest/StorefrontTaxQuoteCartGuestVirtualTest.xml +++ b/app/code/Magento/Tax/Test/Mftf/Test/StorefrontTaxQuoteCartTest/StorefrontTaxQuoteCartGuestVirtualTest.xml @@ -18,7 +18,7 @@ <group value="Tax"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <createData entity="VirtualProduct" stepKey="virtualProduct1"/> <!-- Fill in rules to display tax in the cart --> diff --git a/app/code/Magento/Tax/Test/Mftf/Test/StorefrontTaxQuoteCartTest/StorefrontTaxQuoteCartLoggedInSimpleTest.xml b/app/code/Magento/Tax/Test/Mftf/Test/StorefrontTaxQuoteCartTest/StorefrontTaxQuoteCartLoggedInSimpleTest.xml index 4f7e5534e85bb..609c8c7b27980 100644 --- a/app/code/Magento/Tax/Test/Mftf/Test/StorefrontTaxQuoteCartTest/StorefrontTaxQuoteCartLoggedInSimpleTest.xml +++ b/app/code/Magento/Tax/Test/Mftf/Test/StorefrontTaxQuoteCartTest/StorefrontTaxQuoteCartLoggedInSimpleTest.xml @@ -18,7 +18,7 @@ <group value="Tax"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <createData entity="SimpleProduct2" stepKey="simpleProduct1"/> <!-- Fill in rules to display tax in the cart --> diff --git a/app/code/Magento/Tax/Test/Mftf/Test/StorefrontTaxQuoteCartTest/StorefrontTaxQuoteCartLoggedInVirtualTest.xml b/app/code/Magento/Tax/Test/Mftf/Test/StorefrontTaxQuoteCartTest/StorefrontTaxQuoteCartLoggedInVirtualTest.xml index bd935113fe051..724831d9409be 100644 --- a/app/code/Magento/Tax/Test/Mftf/Test/StorefrontTaxQuoteCartTest/StorefrontTaxQuoteCartLoggedInVirtualTest.xml +++ b/app/code/Magento/Tax/Test/Mftf/Test/StorefrontTaxQuoteCartTest/StorefrontTaxQuoteCartLoggedInVirtualTest.xml @@ -18,7 +18,7 @@ <group value="Tax"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <createData entity="VirtualProduct" stepKey="virtualProduct1"/> <!-- Fill in rules to display tax in the cart --> diff --git a/app/code/Magento/Tax/Test/Mftf/Test/StorefrontTaxQuoteCheckoutTest/StorefrontTaxQuoteCheckoutGuestSimpleTest.xml b/app/code/Magento/Tax/Test/Mftf/Test/StorefrontTaxQuoteCheckoutTest/StorefrontTaxQuoteCheckoutGuestSimpleTest.xml index 14615c101b9a7..d005f4b657448 100644 --- a/app/code/Magento/Tax/Test/Mftf/Test/StorefrontTaxQuoteCheckoutTest/StorefrontTaxQuoteCheckoutGuestSimpleTest.xml +++ b/app/code/Magento/Tax/Test/Mftf/Test/StorefrontTaxQuoteCheckoutTest/StorefrontTaxQuoteCheckoutGuestSimpleTest.xml @@ -18,7 +18,7 @@ <group value="Tax"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <createData entity="SimpleProduct2" stepKey="simpleProduct1"/> <!-- Fill in rules to display tax in the cart --> diff --git a/app/code/Magento/Tax/Test/Mftf/Test/StorefrontTaxQuoteCheckoutTest/StorefrontTaxQuoteCheckoutGuestVirtualTest.xml b/app/code/Magento/Tax/Test/Mftf/Test/StorefrontTaxQuoteCheckoutTest/StorefrontTaxQuoteCheckoutGuestVirtualTest.xml index 248828aa94a4b..d1fc0654fc496 100644 --- a/app/code/Magento/Tax/Test/Mftf/Test/StorefrontTaxQuoteCheckoutTest/StorefrontTaxQuoteCheckoutGuestVirtualTest.xml +++ b/app/code/Magento/Tax/Test/Mftf/Test/StorefrontTaxQuoteCheckoutTest/StorefrontTaxQuoteCheckoutGuestVirtualTest.xml @@ -18,7 +18,7 @@ <group value="Tax"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <createData entity="VirtualProduct" stepKey="virtualProduct1"/> <!-- Fill in rules to display tax in the cart --> diff --git a/app/code/Magento/Tax/Test/Mftf/Test/StorefrontTaxQuoteCheckoutTest/StorefrontTaxQuoteCheckoutLoggedInSimpleTest.xml b/app/code/Magento/Tax/Test/Mftf/Test/StorefrontTaxQuoteCheckoutTest/StorefrontTaxQuoteCheckoutLoggedInSimpleTest.xml index 187f079434ddc..3a67276c42737 100644 --- a/app/code/Magento/Tax/Test/Mftf/Test/StorefrontTaxQuoteCheckoutTest/StorefrontTaxQuoteCheckoutLoggedInSimpleTest.xml +++ b/app/code/Magento/Tax/Test/Mftf/Test/StorefrontTaxQuoteCheckoutTest/StorefrontTaxQuoteCheckoutLoggedInSimpleTest.xml @@ -18,7 +18,7 @@ <group value="Tax"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <createData entity="SimpleProduct2" stepKey="simpleProduct1"/> <!-- Fill in rules to display tax in the cart --> diff --git a/app/code/Magento/Tax/Test/Mftf/Test/StorefrontTaxQuoteCheckoutTest/StorefrontTaxQuoteCheckoutLoggedInVirtualTest.xml b/app/code/Magento/Tax/Test/Mftf/Test/StorefrontTaxQuoteCheckoutTest/StorefrontTaxQuoteCheckoutLoggedInVirtualTest.xml index a0396cd2793bf..793468b7f0b1e 100644 --- a/app/code/Magento/Tax/Test/Mftf/Test/StorefrontTaxQuoteCheckoutTest/StorefrontTaxQuoteCheckoutLoggedInVirtualTest.xml +++ b/app/code/Magento/Tax/Test/Mftf/Test/StorefrontTaxQuoteCheckoutTest/StorefrontTaxQuoteCheckoutLoggedInVirtualTest.xml @@ -18,7 +18,7 @@ <group value="Tax"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <createData entity="VirtualProduct" stepKey="virtualProduct1"/> <!-- Fill in rules to display tax in the cart --> diff --git a/app/code/Magento/Tax/Test/Mftf/Test/Update01TaxRateEntityTest.xml b/app/code/Magento/Tax/Test/Mftf/Test/Update01TaxRateEntityTest.xml index 2ed31c2e20488..306216422adea 100644 --- a/app/code/Magento/Tax/Test/Mftf/Test/Update01TaxRateEntityTest.xml +++ b/app/code/Magento/Tax/Test/Mftf/Test/Update01TaxRateEntityTest.xml @@ -20,7 +20,7 @@ </annotations> <before> <createData entity="defaultTaxRate" stepKey="initialTaxRate"/> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> </before> <after> <deleteData stepKey="deleteTaxRate" createDataKey="initialTaxRate" /> diff --git a/app/code/Magento/Tax/Test/Mftf/Test/Update100TaxRateEntityTest.xml b/app/code/Magento/Tax/Test/Mftf/Test/Update100TaxRateEntityTest.xml index 27a7f2c51724e..c22bab774de29 100644 --- a/app/code/Magento/Tax/Test/Mftf/Test/Update100TaxRateEntityTest.xml +++ b/app/code/Magento/Tax/Test/Mftf/Test/Update100TaxRateEntityTest.xml @@ -20,7 +20,7 @@ </annotations> <before> <createData entity="defaultTaxRate" stepKey="initialTaxRate"/> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> </before> <after> <deleteData stepKey="deleteTaxRate" createDataKey="initialTaxRate" /> diff --git a/app/code/Magento/Tax/Test/Mftf/Test/Update1299TaxRateEntityTest.xml b/app/code/Magento/Tax/Test/Mftf/Test/Update1299TaxRateEntityTest.xml index aa46a5fdae0e1..6f93d07b76eed 100644 --- a/app/code/Magento/Tax/Test/Mftf/Test/Update1299TaxRateEntityTest.xml +++ b/app/code/Magento/Tax/Test/Mftf/Test/Update1299TaxRateEntityTest.xml @@ -20,7 +20,7 @@ </annotations> <before> <createData entity="defaultTaxRate" stepKey="initialTaxRate"/> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> </before> <after> <deleteData stepKey="deleteTaxRate" createDataKey="initialTaxRate" /> diff --git a/app/code/Magento/Tax/Test/Mftf/Test/UpdateAnyRegionTaxRateEntityTest.xml b/app/code/Magento/Tax/Test/Mftf/Test/UpdateAnyRegionTaxRateEntityTest.xml index d7b25da6c14ae..c3986e6a8d0cc 100644 --- a/app/code/Magento/Tax/Test/Mftf/Test/UpdateAnyRegionTaxRateEntityTest.xml +++ b/app/code/Magento/Tax/Test/Mftf/Test/UpdateAnyRegionTaxRateEntityTest.xml @@ -20,7 +20,7 @@ </annotations> <before> <createData entity="defaultTaxRate" stepKey="initialTaxRate"/> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> </before> <after> <deleteData stepKey="deleteTaxRate" createDataKey="initialTaxRate" /> diff --git a/app/code/Magento/Tax/Test/Mftf/Test/UpdateDecimalTaxRateEntityTest.xml b/app/code/Magento/Tax/Test/Mftf/Test/UpdateDecimalTaxRateEntityTest.xml index 3002452196904..fb1eff1d74067 100644 --- a/app/code/Magento/Tax/Test/Mftf/Test/UpdateDecimalTaxRateEntityTest.xml +++ b/app/code/Magento/Tax/Test/Mftf/Test/UpdateDecimalTaxRateEntityTest.xml @@ -20,7 +20,7 @@ </annotations> <before> <createData entity="defaultTaxRate" stepKey="initialTaxRate"/> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> </before> <after> <deleteData stepKey="deleteTaxRate" createDataKey="initialTaxRate" /> diff --git a/app/code/Magento/Tax/Test/Mftf/Test/UpdateLargeTaxRateEntityTest.xml b/app/code/Magento/Tax/Test/Mftf/Test/UpdateLargeTaxRateEntityTest.xml index 6c81a6aeb3f11..1f0406244a926 100644 --- a/app/code/Magento/Tax/Test/Mftf/Test/UpdateLargeTaxRateEntityTest.xml +++ b/app/code/Magento/Tax/Test/Mftf/Test/UpdateLargeTaxRateEntityTest.xml @@ -20,7 +20,7 @@ </annotations> <before> <createData entity="defaultTaxRate" stepKey="initialTaxRate"/> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> </before> <after> <deleteData stepKey="deleteTaxRate" createDataKey="initialTaxRate" /> diff --git a/app/code/Magento/Theme/Test/Mftf/Test/AdminContentThemeSortTest.xml b/app/code/Magento/Theme/Test/Mftf/Test/AdminContentThemeSortTest.xml index 4a074a484537d..056b4c3f914fe 100644 --- a/app/code/Magento/Theme/Test/Mftf/Test/AdminContentThemeSortTest.xml +++ b/app/code/Magento/Theme/Test/Mftf/Test/AdminContentThemeSortTest.xml @@ -19,7 +19,7 @@ <group value="menu"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="LoginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="LoginAsAdmin"/> </before> <after> <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> diff --git a/app/code/Magento/Theme/Test/Mftf/Test/AdminContentThemesNavigateMenuTest.xml b/app/code/Magento/Theme/Test/Mftf/Test/AdminContentThemesNavigateMenuTest.xml index 2d0dc4501dfa1..167191ee69a79 100644 --- a/app/code/Magento/Theme/Test/Mftf/Test/AdminContentThemesNavigateMenuTest.xml +++ b/app/code/Magento/Theme/Test/Mftf/Test/AdminContentThemesNavigateMenuTest.xml @@ -20,7 +20,7 @@ <group value="mtf_migrated"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="LoginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="LoginAsAdmin"/> </before> <after> <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> diff --git a/app/code/Magento/Theme/Test/Mftf/Test/AdminDesignConfigMediaGalleryImageUploadTest.xml b/app/code/Magento/Theme/Test/Mftf/Test/AdminDesignConfigMediaGalleryImageUploadTest.xml index ae0ebe2ed7ef3..07db3a5a18b73 100644 --- a/app/code/Magento/Theme/Test/Mftf/Test/AdminDesignConfigMediaGalleryImageUploadTest.xml +++ b/app/code/Magento/Theme/Test/Mftf/Test/AdminDesignConfigMediaGalleryImageUploadTest.xml @@ -19,7 +19,7 @@ <group value="Content"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="loginToAdminArea"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginToAdminArea"/> </before> <after> <actionGroup ref="AdminLogoutActionGroup" stepKey="logoutOfAdmin"/> diff --git a/app/code/Magento/Theme/Test/Mftf/Test/AdminWatermarkUploadTest.xml b/app/code/Magento/Theme/Test/Mftf/Test/AdminWatermarkUploadTest.xml index 666d01e1090c1..fbe1d5ac936d7 100644 --- a/app/code/Magento/Theme/Test/Mftf/Test/AdminWatermarkUploadTest.xml +++ b/app/code/Magento/Theme/Test/Mftf/Test/AdminWatermarkUploadTest.xml @@ -22,7 +22,7 @@ <group value="Watermark"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="loginToAdminArea"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginToAdminArea"/> </before> <after> <actionGroup ref="AdminLogoutActionGroup" stepKey="logoutOfAdmin"/> diff --git a/app/code/Magento/Theme/Test/Mftf/Test/ThemeTest.xml b/app/code/Magento/Theme/Test/Mftf/Test/ThemeTest.xml index 56041c6ccc99a..0f9ff05af3d89 100644 --- a/app/code/Magento/Theme/Test/Mftf/Test/ThemeTest.xml +++ b/app/code/Magento/Theme/Test/Mftf/Test/ThemeTest.xml @@ -22,7 +22,7 @@ <actionGroup ref="AdminLogoutActionGroup" stepKey="logoutOfAdmin"/> </after> <!--Login to Admin Area--> - <actionGroup ref="LoginAsAdmin" stepKey="loginToAdminArea"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginToAdminArea"/> <!--Navigate to Themes page--> <amOnPage url="{{ThemesPageIndex.url}}" stepKey="navigateToThemesIndexPage" /> <waitForPageLoad stepKey="wait1"/> diff --git a/app/code/Magento/Translation/Test/Mftf/Test/AdminInlineTranslationOnCheckoutTest.xml b/app/code/Magento/Translation/Test/Mftf/Test/AdminInlineTranslationOnCheckoutTest.xml index c6f2bb0713f48..7a107f059a84a 100644 --- a/app/code/Magento/Translation/Test/Mftf/Test/AdminInlineTranslationOnCheckoutTest.xml +++ b/app/code/Magento/Translation/Test/Mftf/Test/AdminInlineTranslationOnCheckoutTest.xml @@ -19,7 +19,7 @@ <group value="checkout"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="LoginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="LoginAsAdmin"/> <!--Product and a customer is created --> <createData entity="Simple_US_Customer_Multiple_Addresses" stepKey="createCustomer"/> diff --git a/app/code/Magento/Ui/view/base/web/js/grid/sortBy.js b/app/code/Magento/Ui/view/base/web/js/grid/sortBy.js new file mode 100644 index 0000000000000..50cbb6881a6f1 --- /dev/null +++ b/app/code/Magento/Ui/view/base/web/js/grid/sortBy.js @@ -0,0 +1,78 @@ +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +define([ + 'uiElement' +], function (Element) { + 'use strict'; + + return Element.extend({ + defaults: { + template: 'ui/grid/sortBy', + options: [], + applied: {}, + sorting: 'asc', + columnsProvider: 'ns = ${ $.ns }, componentType = columns', + selectedOption: '', + isVisible: true, + listens: { + 'selectedOption': 'applyChanges' + }, + statefull: { + selectedOption: true, + applied: true + }, + exports: { + applied: '${ $.provider }:params.sorting' + }, + imports: { + preparedOptions: '${ $.columnsProvider }:elems' + }, + modules: { + columns: '${ $.columnsProvider }' + } + }, + + /** + * @inheritdoc + */ + initObservable: function () { + return this._super() + .observe([ + 'applied', + 'selectedOption', + 'isVisible' + ]); + }, + + /** + * Prepared sort order options + */ + preparedOptions: function (columns) { + if (columns && columns.length > 0) { + columns.map(function (column) { + if (column.sortable === true) { + this.options.push({ + value: column.index, + label: column.label + }); + this.isVisible(true); + } else { + this.isVisible(false); + } + }.bind(this)); + } + }, + + /** + * Apply changes + */ + applyChanges: function () { + this.applied({ + field: this.selectedOption(), + direction: this.sorting + }); + } + }); +}); diff --git a/app/code/Magento/Ui/view/base/web/js/modal/prompt.js b/app/code/Magento/Ui/view/base/web/js/modal/prompt.js index 443d35f1b0ded..84e9494a8e781 100644 --- a/app/code/Magento/Ui/view/base/web/js/modal/prompt.js +++ b/app/code/Magento/Ui/view/base/web/js/modal/prompt.js @@ -111,6 +111,7 @@ define([ _create: function () { this.options.focus = this.options.promptField; this.options.validation = this.options.validation && this.options.validationRules.length; + this.options.outerClickHandler = this.options.outerClickHandler || _.bind(this.closeModal, this, false); this._super(); this.modal.find(this.options.modalContent).append(this.getFormTemplate()); this.modal.find(this.options.modalCloseBtn).off().on('click', _.bind(this.closeModal, this, false)); diff --git a/app/code/Magento/Ui/view/base/web/templates/grid/sortBy.html b/app/code/Magento/Ui/view/base/web/templates/grid/sortBy.html new file mode 100644 index 0000000000000..104c92bf784f0 --- /dev/null +++ b/app/code/Magento/Ui/view/base/web/templates/grid/sortBy.html @@ -0,0 +1,15 @@ +<!-- +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> +<div if="isVisible" class="masonry-image-sortby"> + <b><!-- ko i18n: 'Sort by' --><!-- /ko -->:</b> + <select class="admin__control-select" data-bind=" + options: options, + optionsValue: 'value', + optionsText: 'label', + value: selectedOption + "></select> +</div> diff --git a/app/code/Magento/Ups/Test/Mftf/Test/DefaultConfigForUPSTypeTest.xml b/app/code/Magento/Ups/Test/Mftf/Test/DefaultConfigForUPSTypeTest.xml index f4f30d4317a57..58ac4ef53861c 100644 --- a/app/code/Magento/Ups/Test/Mftf/Test/DefaultConfigForUPSTypeTest.xml +++ b/app/code/Magento/Ups/Test/Mftf/Test/DefaultConfigForUPSTypeTest.xml @@ -20,7 +20,7 @@ <group value="ups"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> </before> <after> <!--Collapse UPS tab and logout--> diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminAutoUpdateURLRewriteWhenCategoryIsDeletedTest.xml b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminAutoUpdateURLRewriteWhenCategoryIsDeletedTest.xml index 089f74411ac58..fe9f38d1b541c 100644 --- a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminAutoUpdateURLRewriteWhenCategoryIsDeletedTest.xml +++ b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminAutoUpdateURLRewriteWhenCategoryIsDeletedTest.xml @@ -19,7 +19,7 @@ </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="login"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="login"/> <createData entity="SimpleSubCategory" stepKey="createCategory"/> <createData entity="SimpleProduct" stepKey="createSimpleProduct"> <requiredEntity createDataKey="createCategory"/> diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCheckUrlRewritesCorrectlyGeneratedForMultipleStoreviewsDuringProductImportTest/AdminCheckUrlRewritesCorrectlyGeneratedForMultipleStoreviewsDuringProductImportTest.xml b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCheckUrlRewritesCorrectlyGeneratedForMultipleStoreviewsDuringProductImportTest/AdminCheckUrlRewritesCorrectlyGeneratedForMultipleStoreviewsDuringProductImportTest.xml index 70ce7e2d64fb3..b9f726aec668e 100644 --- a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCheckUrlRewritesCorrectlyGeneratedForMultipleStoreviewsDuringProductImportTest/AdminCheckUrlRewritesCorrectlyGeneratedForMultipleStoreviewsDuringProductImportTest.xml +++ b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCheckUrlRewritesCorrectlyGeneratedForMultipleStoreviewsDuringProductImportTest/AdminCheckUrlRewritesCorrectlyGeneratedForMultipleStoreviewsDuringProductImportTest.xml @@ -21,7 +21,7 @@ <createData entity="ApiCategory" stepKey="createCategory"> <field key="name">category-admin</field> </createData> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <!-- Create Store View EN --> <actionGroup ref="AdminCreateStoreViewActionGroup" stepKey="createStoreViewEn"> <argument name="customStore" value="customStoreENNotUnique"/> diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCheckUrlRewritesCorrectlyGeneratedForMultipleStoreviewsDuringProductImportTest/AdminCheckUrlRewritesCorrectlyGeneratedForMultipleStoreviewsDuringProductImportTestWithConfigurationTurnedOffTest.xml b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCheckUrlRewritesCorrectlyGeneratedForMultipleStoreviewsDuringProductImportTest/AdminUrlRewriteGeneratedForMultipleStoreviewsDuringProductImportWithConfigTurnedOffTest.xml similarity index 98% rename from app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCheckUrlRewritesCorrectlyGeneratedForMultipleStoreviewsDuringProductImportTest/AdminCheckUrlRewritesCorrectlyGeneratedForMultipleStoreviewsDuringProductImportTestWithConfigurationTurnedOffTest.xml rename to app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCheckUrlRewritesCorrectlyGeneratedForMultipleStoreviewsDuringProductImportTest/AdminUrlRewriteGeneratedForMultipleStoreviewsDuringProductImportWithConfigTurnedOffTest.xml index a9a5cf4a05b66..f9003ce8c0897 100644 --- a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCheckUrlRewritesCorrectlyGeneratedForMultipleStoreviewsDuringProductImportTest/AdminCheckUrlRewritesCorrectlyGeneratedForMultipleStoreviewsDuringProductImportTestWithConfigurationTurnedOffTest.xml +++ b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCheckUrlRewritesCorrectlyGeneratedForMultipleStoreviewsDuringProductImportTest/AdminUrlRewriteGeneratedForMultipleStoreviewsDuringProductImportWithConfigTurnedOffTest.xml @@ -7,7 +7,7 @@ --> <tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> - <test name="AdminCheckUrlRewritesCorrectlyGeneratedForMultipleStoreviewsDuringProductImportTestWithConfigurationTurnedOffTest"> + <test name="AdminUrlRewriteGeneratedForMultipleStoreviewsDuringProductImportWithConfigTurnedOffTest"> <annotations> <features value="Url Rewrite"/> <stories value="Url Rewrites for Multiple Storeviews"/> @@ -26,7 +26,7 @@ <createData entity="ApiCategory" stepKey="createCategory"> <field key="name">category-admin</field> </createData> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <!-- Create Store View EN --> <actionGroup ref="AdminCreateStoreViewActionGroup" stepKey="createStoreViewEn"> <argument name="customStore" value="customStoreENNotUnique"/> diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCheckUrlRewritesInCatalogCategoriesAfterChangingUrlKeyForStoreViewAndMovingCategory2Test.xml b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCheckUrlRewritesInCatalogCategoriesAfterChangingUrlKeyForStoreViewAndMovingCategory2Test.xml index 734b8bb667674..b4d87df4b4a36 100644 --- a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCheckUrlRewritesInCatalogCategoriesAfterChangingUrlKeyForStoreViewAndMovingCategory2Test.xml +++ b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCheckUrlRewritesInCatalogCategoriesAfterChangingUrlKeyForStoreViewAndMovingCategory2Test.xml @@ -31,7 +31,7 @@ </createData> <!-- Log in to backend --> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <!--Create additional Store View in Main Website Store --> <actionGroup ref="AdminCreateStoreViewActionGroup" stepKey="createStoreView"/> diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCheckUrlRewritesInCatalogCategoriesAfterChangingUrlKeyForStoreViewAndMovingCategoryTest.xml b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCheckUrlRewritesInCatalogCategoriesAfterChangingUrlKeyForStoreViewAndMovingCategoryTest.xml index d337da37e0d2a..f430fb8921f80 100644 --- a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCheckUrlRewritesInCatalogCategoriesAfterChangingUrlKeyForStoreViewAndMovingCategoryTest.xml +++ b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCheckUrlRewritesInCatalogCategoriesAfterChangingUrlKeyForStoreViewAndMovingCategoryTest.xml @@ -33,7 +33,7 @@ </createData> <!-- Log in to backend --> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <!--Create additional Store View in Main Website Store --> <actionGroup ref="AdminCreateStoreViewActionGroup" stepKey="createStoreView"/> diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCreateCategoryUrlRewriteAndAddNoRedirectTest.xml b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCreateCategoryUrlRewriteAndAddNoRedirectTest.xml index 2d5f70f4e7328..f8136fbb6b59d 100644 --- a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCreateCategoryUrlRewriteAndAddNoRedirectTest.xml +++ b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCreateCategoryUrlRewriteAndAddNoRedirectTest.xml @@ -19,7 +19,7 @@ </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="loginToAdminPanel"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginToAdminPanel"/> <createData entity="_defaultCategory" stepKey="category"/> </before> <after> diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCreateCategoryUrlRewriteAndAddPermanentRedirectTest.xml b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCreateCategoryUrlRewriteAndAddPermanentRedirectTest.xml index cf963bea12fa6..5aedbe9ff79c2 100644 --- a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCreateCategoryUrlRewriteAndAddPermanentRedirectTest.xml +++ b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCreateCategoryUrlRewriteAndAddPermanentRedirectTest.xml @@ -19,7 +19,7 @@ </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="loginToAdminPanel"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginToAdminPanel"/> <createData entity="_defaultCategory" stepKey="category"/> </before> <after> diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCreateCategoryUrlRewriteAndAddTemporaryRedirectTest.xml b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCreateCategoryUrlRewriteAndAddTemporaryRedirectTest.xml index 401ce09f1a149..ba810817052f0 100644 --- a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCreateCategoryUrlRewriteAndAddTemporaryRedirectTest.xml +++ b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCreateCategoryUrlRewriteAndAddTemporaryRedirectTest.xml @@ -19,7 +19,7 @@ </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="loginToAdminPanel"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginToAdminPanel"/> <createData entity="_defaultCategory" stepKey="category"/> </before> <after> diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCreateCustomCMSPageUrlRewriteAndAddPermanentRedirectTest.xml b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCreateCustomCMSPageUrlRewriteAndAddPermanentRedirectTest.xml index b6007d63290b8..aee47c5e9df95 100644 --- a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCreateCustomCMSPageUrlRewriteAndAddPermanentRedirectTest.xml +++ b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCreateCustomCMSPageUrlRewriteAndAddPermanentRedirectTest.xml @@ -20,7 +20,7 @@ <before> <createData entity="simpleCmsPage" stepKey="createCMSPage"/> - <actionGroup ref="LoginAsAdmin" stepKey="login"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="login"/> </before> <after> <deleteData createDataKey="createCMSPage" stepKey="deleteCMSPage"/> diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCreateCustomCMSPageUrlRewriteAndAddTemporaryRedirectTest.xml b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCreateCustomCMSPageUrlRewriteAndAddTemporaryRedirectTest.xml index 33e1969be38ff..3986717b16b2a 100644 --- a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCreateCustomCMSPageUrlRewriteAndAddTemporaryRedirectTest.xml +++ b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCreateCustomCMSPageUrlRewriteAndAddTemporaryRedirectTest.xml @@ -20,7 +20,7 @@ <before> <createData entity="simpleCmsPage" stepKey="createCMSPage"/> - <actionGroup ref="LoginAsAdmin" stepKey="login"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="login"/> </before> <after> <deleteData createDataKey="createCMSPage" stepKey="deleteCMSPage"/> diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCreateCustomCategoryUrlRewriteAndAddPermanentRedirectTest.xml b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCreateCustomCategoryUrlRewriteAndAddPermanentRedirectTest.xml index 1c6c1572b3206..56b558a94960a 100644 --- a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCreateCustomCategoryUrlRewriteAndAddPermanentRedirectTest.xml +++ b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCreateCustomCategoryUrlRewriteAndAddPermanentRedirectTest.xml @@ -20,7 +20,7 @@ <before> <createData entity="SimpleSubCategory" stepKey="category"/> - <actionGroup ref="LoginAsAdmin" stepKey="login"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="login"/> </before> <after> <deleteData createDataKey="category" stepKey="deleteCategory"/> diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCreateCustomProductUrlRewriteAndAddTemporaryRedirectTest.xml b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCreateCustomProductUrlRewriteAndAddTemporaryRedirectTest.xml index 3191de550bd52..d2fecea9234ba 100644 --- a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCreateCustomProductUrlRewriteAndAddTemporaryRedirectTest.xml +++ b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCreateCustomProductUrlRewriteAndAddTemporaryRedirectTest.xml @@ -20,7 +20,7 @@ <before> <createData entity="defaultSimpleProduct" stepKey="createProduct"/> - <actionGroup ref="LoginAsAdmin" stepKey="login"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="login"/> </before> <after> <deleteData createDataKey="createProduct" stepKey="deleteProduct"/> diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCreateProductURLRewriteAndAddNoRedirectTest.xml b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCreateProductURLRewriteAndAddNoRedirectTest.xml index c34dce4ab0b91..e3e187c1cb358 100644 --- a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCreateProductURLRewriteAndAddNoRedirectTest.xml +++ b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCreateProductURLRewriteAndAddNoRedirectTest.xml @@ -19,7 +19,7 @@ </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="login"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="login"/> <createData entity="defaultSimpleProduct" stepKey="createSimpleProduct"/> </before> <after> diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCreateProductURLRewriteWithCategoryAndAddTemporaryRedirectTest.xml b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCreateProductURLRewriteWithCategoryAndAddTemporaryRedirectTest.xml index 26bc86bdabae7..a0efcb02361c0 100644 --- a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCreateProductURLRewriteWithCategoryAndAddTemporaryRedirectTest.xml +++ b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCreateProductURLRewriteWithCategoryAndAddTemporaryRedirectTest.xml @@ -19,7 +19,7 @@ </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="login"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="login"/> <createData entity="SimpleSubCategory" stepKey="createCategory"/> <createData entity="SimpleProduct" stepKey="createSimpleProduct"> <requiredEntity createDataKey="createCategory"/> diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCreateProductUrLRewriteAndAddPermanentRedirectTest.xml b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCreateProductUrLRewriteAndAddPermanentRedirectTest.xml index 5276cac8625ec..d4d5b163a1881 100644 --- a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCreateProductUrLRewriteAndAddPermanentRedirectTest.xml +++ b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCreateProductUrLRewriteAndAddPermanentRedirectTest.xml @@ -18,7 +18,7 @@ <group value="urlRewrite"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="login"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="login"/> <createData entity="defaultSimpleProduct" stepKey="createSimpleProduct"/> </before> <after> diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCreateProductUrLRewriteAndAddTemporaryRedirectTest.xml b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCreateProductUrLRewriteAndAddTemporaryRedirectTest.xml index 2136918fa6186..540b38a9b33fb 100644 --- a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCreateProductUrLRewriteAndAddTemporaryRedirectTest.xml +++ b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCreateProductUrLRewriteAndAddTemporaryRedirectTest.xml @@ -19,7 +19,7 @@ </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="login"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="login"/> <createData entity="defaultSimpleProduct" stepKey="createSimpleProduct"/> </before> <after> diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminDeleteCMSPageNoRedirectUrlRewriteTest.xml b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminDeleteCMSPageNoRedirectUrlRewriteTest.xml index e26a283861ecd..450ecb8ba5601 100644 --- a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminDeleteCMSPageNoRedirectUrlRewriteTest.xml +++ b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminDeleteCMSPageNoRedirectUrlRewriteTest.xml @@ -19,7 +19,7 @@ </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="login"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="login"/> <createData entity="simpleCmsPage" stepKey="createCMSPage"/> </before> <after> diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminDeleteCMSPagePermanentRedirectUrlRewriteTest.xml b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminDeleteCMSPagePermanentRedirectUrlRewriteTest.xml index 86f7f84f9f1a5..3051ac2764ce9 100644 --- a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminDeleteCMSPagePermanentRedirectUrlRewriteTest.xml +++ b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminDeleteCMSPagePermanentRedirectUrlRewriteTest.xml @@ -19,7 +19,7 @@ </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="login"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="login"/> <createData entity="simpleCmsPage" stepKey="createCMSPage"/> </before> <after> diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminDeleteCMSPageTemporaryRedirectUrlRewriteTest.xml b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminDeleteCMSPageTemporaryRedirectUrlRewriteTest.xml index d04cafc3602b6..2646c3631101d 100644 --- a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminDeleteCMSPageTemporaryRedirectUrlRewriteTest.xml +++ b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminDeleteCMSPageTemporaryRedirectUrlRewriteTest.xml @@ -19,7 +19,7 @@ </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="login"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="login"/> <createData entity="simpleCmsPage" stepKey="createCMSPage"/> </before> <after> diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminDeleteCategoryUrlRewriteHypenAsRequestPathTest.xml b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminDeleteCategoryUrlRewriteHypenAsRequestPathTest.xml index fe71094e49064..6dddc0f333ca5 100644 --- a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminDeleteCategoryUrlRewriteHypenAsRequestPathTest.xml +++ b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminDeleteCategoryUrlRewriteHypenAsRequestPathTest.xml @@ -20,7 +20,7 @@ </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="loginToAdminPanel"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginToAdminPanel"/> <createData entity="_defaultCategory" stepKey="category"/> </before> <after> diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminDeleteCategoryUrlRewriteTest.xml b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminDeleteCategoryUrlRewriteTest.xml index 2e753e5fca7d8..5a33e63c5e08c 100644 --- a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminDeleteCategoryUrlRewriteTest.xml +++ b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminDeleteCategoryUrlRewriteTest.xml @@ -17,7 +17,7 @@ <group value="urlRewrite"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="loginToAdminPanel"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginToAdminPanel"/> <createData entity="_defaultCategory" stepKey="category"/> </before> <after> diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminDeleteCategoryUrlRewriteWithRequestPathTest.xml b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminDeleteCategoryUrlRewriteWithRequestPathTest.xml index 06b5745c32be3..8113d4511d8da 100644 --- a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminDeleteCategoryUrlRewriteWithRequestPathTest.xml +++ b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminDeleteCategoryUrlRewriteWithRequestPathTest.xml @@ -20,7 +20,7 @@ </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="loginToAdminPanel"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginToAdminPanel"/> <createData entity="_defaultCategory" stepKey="category"/> </before> <after> diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminDeleteCmsPageUrlRewriteWithNoRedirectsTest.xml b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminDeleteCmsPageUrlRewriteWithNoRedirectsTest.xml index c8ef5470eef3a..65544f414140c 100644 --- a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminDeleteCmsPageUrlRewriteWithNoRedirectsTest.xml +++ b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminDeleteCmsPageUrlRewriteWithNoRedirectsTest.xml @@ -20,7 +20,7 @@ </annotations> <before> <createData entity="simpleCmsPage" stepKey="createCMSPage"/> - <actionGroup ref="LoginAsAdmin" stepKey="loginToAdminPanel"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginToAdminPanel"/> </before> <after> <deleteData createDataKey="createCMSPage" stepKey="deleteCMSPage"/> diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminDeleteCmsPageUrlRewriteWithPermanentRedirectTest.xml b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminDeleteCmsPageUrlRewriteWithPermanentRedirectTest.xml index e1228c47b9030..61e9847308263 100644 --- a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminDeleteCmsPageUrlRewriteWithPermanentRedirectTest.xml +++ b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminDeleteCmsPageUrlRewriteWithPermanentRedirectTest.xml @@ -20,7 +20,7 @@ </annotations> <before> <createData entity="simpleCmsPage" stepKey="createCMSPage"/> - <actionGroup ref="LoginAsAdmin" stepKey="loginToAdminPanel"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginToAdminPanel"/> </before> <after> <deleteData createDataKey="createCMSPage" stepKey="deleteCMSPage"/> diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminDeleteCmsPageUrlRewriteWithTemporaryRedirectTest.xml b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminDeleteCmsPageUrlRewriteWithTemporaryRedirectTest.xml index 1efd063a23708..b9f20b8651320 100644 --- a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminDeleteCmsPageUrlRewriteWithTemporaryRedirectTest.xml +++ b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminDeleteCmsPageUrlRewriteWithTemporaryRedirectTest.xml @@ -20,7 +20,7 @@ </annotations> <before> <createData entity="simpleCmsPage" stepKey="createCMSPage"/> - <actionGroup ref="LoginAsAdmin" stepKey="loginToAdminPanel"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginToAdminPanel"/> </before> <after> <deleteData createDataKey="createCMSPage" stepKey="deleteCMSPage"/> diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminDeleteCustomUrlRewriteTest.xml b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminDeleteCustomUrlRewriteTest.xml index c03c21abb9e7e..293c412570742 100644 --- a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminDeleteCustomUrlRewriteTest.xml +++ b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminDeleteCustomUrlRewriteTest.xml @@ -20,7 +20,7 @@ <before> <createData entity="defaultUrlRewrite" stepKey="urlRewrite" /> - <actionGroup ref="LoginAsAdmin" stepKey="loginToAdminPanel"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginToAdminPanel"/> </before> <after> <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminDeleteProductURLRewriteEntityTest.xml b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminDeleteProductURLRewriteEntityTest.xml index 6803816f42d85..4ad6e99b0b424 100644 --- a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminDeleteProductURLRewriteEntityTest.xml +++ b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminDeleteProductURLRewriteEntityTest.xml @@ -19,7 +19,7 @@ </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="login"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="login"/> <createData entity="SimpleSubCategory" stepKey="createCategory"/> <createData entity="SimpleProduct" stepKey="createSimpleProduct"> <requiredEntity createDataKey="createCategory"/> diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminDeleteProductUrlRewriteTest.xml b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminDeleteProductUrlRewriteTest.xml index 80fe34a3099f1..dff59c1ca9770 100644 --- a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminDeleteProductUrlRewriteTest.xml +++ b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminDeleteProductUrlRewriteTest.xml @@ -17,7 +17,7 @@ <group value="urlRewrite"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="login"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="login"/> <createData entity="defaultSimpleProduct" stepKey="simpleProduct"/> </before> <after> diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminGenerateUrlRewritesForProductInCategoriesSwitchOffTest.xml b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminGenerateUrlRewritesForProductInCategoriesSwitchOffTest.xml index 63e76717dd6b6..9d6b267055f70 100644 --- a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminGenerateUrlRewritesForProductInCategoriesSwitchOffTest.xml +++ b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminGenerateUrlRewritesForProductInCategoriesSwitchOffTest.xml @@ -24,7 +24,7 @@ <!--Flush cache--> <magentoCLI command="cache:flush" stepKey="cleanCache1"/> - <actionGroup ref="LoginAsAdmin" stepKey="login"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="login"/> <createData entity="SimpleSubCategory" stepKey="createCategory"/> <createData entity="SimpleProduct" stepKey="createSimpleProduct"> <requiredEntity createDataKey="createCategory"/> diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminMarketingUrlRewritesNavigateMenuTest.xml b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminMarketingUrlRewritesNavigateMenuTest.xml index 0111a35508fd9..136b2fc226566 100644 --- a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminMarketingUrlRewritesNavigateMenuTest.xml +++ b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminMarketingUrlRewritesNavigateMenuTest.xml @@ -21,7 +21,7 @@ <group value="urlRewrite"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="LoginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="LoginAsAdmin"/> </before> <after> <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminProductCreateUrlRewriteForCustomStoreViewTest.xml b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminProductCreateUrlRewriteForCustomStoreViewTest.xml index f3b0ca2237975..f03d9ae1bad67 100644 --- a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminProductCreateUrlRewriteForCustomStoreViewTest.xml +++ b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminProductCreateUrlRewriteForCustomStoreViewTest.xml @@ -26,7 +26,7 @@ <createData entity="SimpleProduct" stepKey="createProductForUrlRewrite"> <requiredEntity createDataKey="createCategory" /> </createData> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <!-- Create second store view --> <actionGroup ref="AdminCreateStoreViewActionGroup" stepKey="createCustomStoreView"> <argument name="customStore" value="customStore"/> diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUpdateCategoryUrlRewriteAndAddAspxRequestPathTest.xml b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUpdateCategoryUrlRewriteAndAddAspxRequestPathTest.xml index d47b700dab790..37c5226e4cf46 100644 --- a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUpdateCategoryUrlRewriteAndAddAspxRequestPathTest.xml +++ b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUpdateCategoryUrlRewriteAndAddAspxRequestPathTest.xml @@ -20,7 +20,7 @@ <before> <createData entity="SimpleSubCategory" stepKey="category"/> - <actionGroup ref="LoginAsAdmin" stepKey="login"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="login"/> </before> <after> <deleteData createDataKey="category" stepKey="deleteCategory"/> diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUpdateCategoryUrlRewriteAndAddNoRedirectTest.xml b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUpdateCategoryUrlRewriteAndAddNoRedirectTest.xml index 5a9aa4df336e0..4606465f1b8dd 100644 --- a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUpdateCategoryUrlRewriteAndAddNoRedirectTest.xml +++ b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUpdateCategoryUrlRewriteAndAddNoRedirectTest.xml @@ -20,7 +20,7 @@ <before> <createData entity="SimpleSubCategory" stepKey="category"/> - <actionGroup ref="LoginAsAdmin" stepKey="login"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="login"/> </before> <after> <deleteData createDataKey="category" stepKey="deleteCategory"/> diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUpdateCategoryUrlRewriteAndAddPermanentRedirectTest.xml b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUpdateCategoryUrlRewriteAndAddPermanentRedirectTest.xml index 788d29a4d4f9f..62ed25fd47212 100644 --- a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUpdateCategoryUrlRewriteAndAddPermanentRedirectTest.xml +++ b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUpdateCategoryUrlRewriteAndAddPermanentRedirectTest.xml @@ -20,7 +20,7 @@ <before> <createData entity="SimpleSubCategory" stepKey="category"/> - <actionGroup ref="LoginAsAdmin" stepKey="login"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="login"/> </before> <after> <deleteData createDataKey="category" stepKey="deleteCategory"/> diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUpdateCategoryUrlRewriteAndAddTemporaryRedirectTest.xml b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUpdateCategoryUrlRewriteAndAddTemporaryRedirectTest.xml index 3d890854f5e09..c6bc35c227ef3 100644 --- a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUpdateCategoryUrlRewriteAndAddTemporaryRedirectTest.xml +++ b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUpdateCategoryUrlRewriteAndAddTemporaryRedirectTest.xml @@ -20,7 +20,7 @@ <before> <createData entity="SimpleSubCategory" stepKey="category"/> - <actionGroup ref="LoginAsAdmin" stepKey="login"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="login"/> </before> <after> <deleteData createDataKey="category" stepKey="deleteCategory"/> diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUpdateCmsPageRewriteEntityWithNoRedirectTest.xml b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUpdateCmsPageRewriteEntityWithNoRedirectTest.xml index 95b509ac38a8a..5692323fbb9e6 100644 --- a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUpdateCmsPageRewriteEntityWithNoRedirectTest.xml +++ b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUpdateCmsPageRewriteEntityWithNoRedirectTest.xml @@ -20,7 +20,7 @@ <before> <createData entity="simpleCmsPage" stepKey="createCMSPage"/> - <actionGroup ref="LoginAsAdmin" stepKey="login"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="login"/> </before> <after> <deleteData createDataKey="createCMSPage" stepKey="deleteCMSPage"/> diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUpdateCmsPageRewriteEntityWithPermanentReirectTest.xml b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUpdateCmsPageRewriteEntityWithPermanentReirectTest.xml index da97bc5988512..d36e2e9645727 100644 --- a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUpdateCmsPageRewriteEntityWithPermanentReirectTest.xml +++ b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUpdateCmsPageRewriteEntityWithPermanentReirectTest.xml @@ -20,7 +20,7 @@ <before> <createData entity="simpleCmsPage" stepKey="createCMSPage"/> - <actionGroup ref="LoginAsAdmin" stepKey="login"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="login"/> </before> <after> <deleteData createDataKey="createCMSPage" stepKey="deleteCMSPage"/> diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUpdateCmsPageRewriteEntityWithTemporaryRedirectTest.xml b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUpdateCmsPageRewriteEntityWithTemporaryRedirectTest.xml index 5ac0330ab80b2..53d78cdf57bdb 100644 --- a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUpdateCmsPageRewriteEntityWithTemporaryRedirectTest.xml +++ b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUpdateCmsPageRewriteEntityWithTemporaryRedirectTest.xml @@ -20,7 +20,7 @@ <before> <createData entity="simpleCmsPage" stepKey="createCMSPage"/> - <actionGroup ref="LoginAsAdmin" stepKey="login"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="login"/> </before> <after> <deleteData createDataKey="createCMSPage" stepKey="deleteCMSPage"/> diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUpdateCmsPageUrlRewriteAndAddNoRedirectTest.xml b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUpdateCmsPageUrlRewriteAndAddNoRedirectTest.xml index b5fa9267c581b..167a11548064f 100644 --- a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUpdateCmsPageUrlRewriteAndAddNoRedirectTest.xml +++ b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUpdateCmsPageUrlRewriteAndAddNoRedirectTest.xml @@ -18,7 +18,7 @@ <group value="urlRewrite"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="login"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="login"/> <createData entity="simpleCmsPage" stepKey="createCMSPage"/> </before> <after> diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUpdateCmsPageUrlRewriteAndAddPermanentRedirectTest.xml b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUpdateCmsPageUrlRewriteAndAddPermanentRedirectTest.xml index f9eb150ad6113..801bc90d106c6 100644 --- a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUpdateCmsPageUrlRewriteAndAddPermanentRedirectTest.xml +++ b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUpdateCmsPageUrlRewriteAndAddPermanentRedirectTest.xml @@ -18,7 +18,7 @@ <group value="urlRewrite"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="login"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="login"/> <createData entity="simpleCmsPage" stepKey="createCMSPage"/> </before> <after> diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUpdateCmsPageUrlRewriteAndAddTemporaryRedirectTest.xml b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUpdateCmsPageUrlRewriteAndAddTemporaryRedirectTest.xml index 34318b3dd8ac0..7d7bc753307d4 100644 --- a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUpdateCmsPageUrlRewriteAndAddTemporaryRedirectTest.xml +++ b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUpdateCmsPageUrlRewriteAndAddTemporaryRedirectTest.xml @@ -18,7 +18,7 @@ <group value="urlRewrite"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="login"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="login"/> <createData entity="simpleCmsPage" stepKey="createCMSPage"/> </before> <after> diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUpdateCustomURLRewritesPermanentTest.xml b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUpdateCustomURLRewritesPermanentTest.xml index 79376dfd7be35..9b739b157cddc 100644 --- a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUpdateCustomURLRewritesPermanentTest.xml +++ b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUpdateCustomURLRewritesPermanentTest.xml @@ -20,7 +20,7 @@ <before> <createData entity="defaultUrlRewrite" stepKey="urlRewrite"/> - <actionGroup ref="LoginAsAdmin" stepKey="loginToAdminPanel"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginToAdminPanel"/> </before> <after> <actionGroup ref="AdminDeleteUrlRewriteActionGroup" stepKey="deleteCustomUrlRewrite"> diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUpdateCustomURLRewritesTemporaryTest.xml b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUpdateCustomURLRewritesTemporaryTest.xml index 9253cad21f936..f450d7640d360 100644 --- a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUpdateCustomURLRewritesTemporaryTest.xml +++ b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUpdateCustomURLRewritesTemporaryTest.xml @@ -21,7 +21,7 @@ <before> <createData entity="defaultUrlRewrite" stepKey="urlRewrite"/> <createData entity="defaultSimpleProduct" stepKey="createProduct"/> - <actionGroup ref="LoginAsAdmin" stepKey="loginToAdminPanel"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginToAdminPanel"/> </before> <after> <deleteData createDataKey="createProduct" stepKey="deleteProduct"/> diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUpdateProductUrlRewriteAndAddTemporaryRedirectTest.xml b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUpdateProductUrlRewriteAndAddTemporaryRedirectTest.xml index 0c1298672db51..a7e2eb2335eef 100644 --- a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUpdateProductUrlRewriteAndAddTemporaryRedirectTest.xml +++ b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUpdateProductUrlRewriteAndAddTemporaryRedirectTest.xml @@ -20,7 +20,7 @@ <before> <createData entity="defaultSimpleProduct" stepKey="createProduct"/> - <actionGroup ref="LoginAsAdmin" stepKey="login"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="login"/> </before> <after> <deleteData createDataKey="createProduct" stepKey="deleteProduct"/> diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUrlRewritesForProductAfterImportTest.xml b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUrlRewritesForProductAfterImportTest.xml index 2a0152c9da34c..a70065dc1d307 100644 --- a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUrlRewritesForProductAfterImportTest.xml +++ b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUrlRewritesForProductAfterImportTest.xml @@ -47,7 +47,7 @@ </after> <comment userInput="1. Log in to Admin " stepKey="commentAdminLogin" /> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <comment userInput="2. Open Marketing - SEO and Search - URL Rewrites " stepKey="commentVerifyUrlRewrite" /> <amOnPage url="{{AdminUrlRewriteIndexPage.url}}" stepKey="amOnUrlRewriteIndexPage"/> diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUrlRewritesForProductInAnchorCategoriesTest/AdminUrlRewritesForProductInAnchorCategoriesTest.xml b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUrlRewritesForProductInAnchorCategoriesTest/AdminUrlRewritesForProductInAnchorCategoriesTest.xml index e666a2aad1738..cce0cd11e0199 100644 --- a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUrlRewritesForProductInAnchorCategoriesTest/AdminUrlRewritesForProductInAnchorCategoriesTest.xml +++ b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUrlRewritesForProductInAnchorCategoriesTest/AdminUrlRewritesForProductInAnchorCategoriesTest.xml @@ -43,7 +43,7 @@ </after> <!-- Steps --> <!-- 1. Log in to Admin --> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <!-- 2. Open Marketing - SEO & Search - URL Rewrites --> <amOnPage url="{{AdminUrlRewriteIndexPage.url}}" stepKey="amOnUrlRewriteIndexPage"/> <click selector="{{AdminDataGridHeaderSection.filters}}" stepKey="openUrlRewriteGridFilters"/> diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUrlRewritesForProductInAnchorCategoriesTest/AdminUrlRewritesForProductInAnchorCategoriesTestWithConfigurationTurnedOffTest.xml b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUrlRewritesForProductInAnchorCategoriesTest/AdminUrlRewritesForProductInAnchorCategoriesTestWithConfigurationTurnedOffTest.xml index e3fc730a3549a..639cd2c57f7d1 100644 --- a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUrlRewritesForProductInAnchorCategoriesTest/AdminUrlRewritesForProductInAnchorCategoriesTestWithConfigurationTurnedOffTest.xml +++ b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUrlRewritesForProductInAnchorCategoriesTest/AdminUrlRewritesForProductInAnchorCategoriesTestWithConfigurationTurnedOffTest.xml @@ -54,7 +54,7 @@ </after> <!-- Steps --> <!-- 1. Log in to Admin --> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <!-- 2. Open Marketing - SEO & Search - URL Rewrites --> <amOnPage url="{{AdminUrlRewriteIndexPage.url}}" stepKey="amOnUrlRewriteIndexPage"/> <click selector="{{AdminDataGridHeaderSection.filters}}" stepKey="openUrlRewriteGridFilters"/> diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUrlRewritesForProductInAnchorCategoriesTest/AdminUrlRewritesForProductsWithConfigurationTurnedOffTest.xml b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUrlRewritesForProductInAnchorCategoriesTest/AdminUrlRewritesForProductsWithConfigurationTurnedOffTest.xml index 4618e901d42e3..1d460b9b668a0 100644 --- a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUrlRewritesForProductInAnchorCategoriesTest/AdminUrlRewritesForProductsWithConfigurationTurnedOffTest.xml +++ b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUrlRewritesForProductInAnchorCategoriesTest/AdminUrlRewritesForProductsWithConfigurationTurnedOffTest.xml @@ -42,7 +42,7 @@ <magentoCLI command="cache:flush" stepKey="cleanCache2"/> </after> <!-- 1. Log in to Admin --> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <!-- 2. Open Marketing - SEO & Search - URL Rewrites --> <amOnPage url="{{AdminUrlRewriteIndexPage.url}}" stepKey="amOnUrlRewriteIndexPage"/> <click selector="{{AdminDataGridHeaderSection.filters}}" stepKey="openUrlRewriteGridFilters"/> diff --git a/app/code/Magento/User/Test/Mftf/ActionGroup/AdminCreateUserWithRoleAndIsInactiveActionGroup.xml b/app/code/Magento/User/Test/Mftf/ActionGroup/AdminCreateUserWithRoleAndIsInactiveActionGroup.xml new file mode 100644 index 0000000000000..3c7db628e1378 --- /dev/null +++ b/app/code/Magento/User/Test/Mftf/ActionGroup/AdminCreateUserWithRoleAndIsInactiveActionGroup.xml @@ -0,0 +1,14 @@ +<?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="AdminCreateUserWithRoleAndIsInactiveActionGroup" extends="AdminCreateUserActionGroup"> + <checkOption selector="{{AdminNewUserFormSection.userInactive}}" stepKey="checkIsInactive" after="confirmPassword"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/User/Test/Mftf/ActionGroup/AdminDeleteUserActionGroup.xml b/app/code/Magento/User/Test/Mftf/ActionGroup/AdminDeleteUserActionGroup.xml index 67075eb52a678..82a3a37cdd724 100644 --- a/app/code/Magento/User/Test/Mftf/ActionGroup/AdminDeleteUserActionGroup.xml +++ b/app/code/Magento/User/Test/Mftf/ActionGroup/AdminDeleteUserActionGroup.xml @@ -18,7 +18,7 @@ <amOnPage stepKey="amOnAdminUsersPage" url="{{AdminUsersPage.url}}"/> <waitForPageLoad stepKey="waitForAdminUserPageLoad"/> - <click stepKey="openTheUser" selector="{{AdminDeleteUserSection.role(user.name)}}"/> + <click stepKey="openTheUser" selector="{{AdminDeleteUserSection.role(user.username)}}"/> <fillField stepKey="TypeCurrentPassword" selector="{{AdminDeleteUserSection.password}}" userInput="{{_ENV.MAGENTO_ADMIN_PASSWORD}}"/> <scrollToTopOfPage stepKey="scrollToTop"/> <click stepKey="clickToDeleteRole" selector="{{AdminDeleteUserSection.delete}}"/> diff --git a/app/code/Magento/User/Test/Mftf/ActionGroup/AssertAdminImpossibleDeleteYourOwnAccountActionGroup.xml b/app/code/Magento/User/Test/Mftf/ActionGroup/AssertAdminImpossibleDeleteYourOwnAccountActionGroup.xml new file mode 100644 index 0000000000000..54fe82831ef02 --- /dev/null +++ b/app/code/Magento/User/Test/Mftf/ActionGroup/AssertAdminImpossibleDeleteYourOwnAccountActionGroup.xml @@ -0,0 +1,21 @@ +<?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="AssertAdminImpossibleDeleteYourOwnAccountActionGroup"> + <arguments> + <argument name="currentAdminPassword" type="string" defaultValue="{{_ENV.MAGENTO_ADMIN_PASSWORD}}"/> + </arguments> + <fillField selector="{{AdminEditUserSection.currentPasswordField}}" userInput="{{currentAdminPassword}}" stepKey="enterThePassword" /> + <click selector="{{AdminMainActionsSection.delete}}" stepKey="deleteUser"/> + <waitForElementVisible selector="{{AdminConfirmationModalSection.message}}" stepKey="waitForConfirmModal"/> + <click selector="{{AdminConfirmationModalSection.ok}}" stepKey="confirmDelete"/> + <waitForElementVisible selector="{{AdminMessagesSection.error}}" stepKey="waitErrorMessage"/> + <see selector="{{AdminMessagesSection.error}}" userInput="You cannot delete your own account." stepKey="seeErrorMessage"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/User/Test/Mftf/ActionGroup/AssertAdminRoleInGridActionGroup.xml b/app/code/Magento/User/Test/Mftf/ActionGroup/AssertAdminRoleInGridActionGroup.xml new file mode 100644 index 0000000000000..93ff97e8bbf8c --- /dev/null +++ b/app/code/Magento/User/Test/Mftf/ActionGroup/AssertAdminRoleInGridActionGroup.xml @@ -0,0 +1,20 @@ +<?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="AssertAdminRoleInGridActionGroup"> + <arguments> + <argument name="roleName" type="string"/> + </arguments> + <amOnPage url="{{AdminRolesPage.url}}" stepKey="navigateToRolesGrid"/> + <fillField selector="{{AdminRoleGridSection.roleNameFilterTextField}}" userInput="{{roleName}}" stepKey="enterRoleName"/> + <click selector="{{AdminRoleGridSection.searchButton}}" stepKey="clickSearch"/> + <waitForPageLoad stepKey="waitForGridToLoad" time="15"/> + <see selector="{{AdminRoleGridSection.roleNameInFirstRow}}" userInput="{{roleName}}" stepKey="seeTheRole"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/User/Test/Mftf/ActionGroup/AssertAdminRoleNotInGridActionGroup.xml b/app/code/Magento/User/Test/Mftf/ActionGroup/AssertAdminRoleNotInGridActionGroup.xml new file mode 100644 index 0000000000000..bb6af04e0e7b6 --- /dev/null +++ b/app/code/Magento/User/Test/Mftf/ActionGroup/AssertAdminRoleNotInGridActionGroup.xml @@ -0,0 +1,20 @@ +<?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="AssertAdminRoleNotInGridActionGroup"> + <arguments> + <argument name="roleName" type="string"/> + </arguments> + <amOnPage url="{{AdminRolesPage.url}}" stepKey="navigateToRolesGrid"/> + <fillField selector="{{AdminRoleGridSection.roleNameFilterTextField}}" userInput="{{roleName}}" stepKey="enterRoleName"/> + <click selector="{{AdminRoleGridSection.searchButton}}" stepKey="clickSearch"/> + <waitForPageLoad stepKey="waitForGridToLoad" time="15"/> + <see selector="{{AdminRoleGridSection.emptyRecords}}" userInput="We couldn't find any records." stepKey="seeEmptyRecordMessage"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/User/Test/Mftf/ActionGroup/AssertAdminUserInGridActionGroup.xml b/app/code/Magento/User/Test/Mftf/ActionGroup/AssertAdminUserInGridActionGroup.xml new file mode 100644 index 0000000000000..b0ade7b3a8ce8 --- /dev/null +++ b/app/code/Magento/User/Test/Mftf/ActionGroup/AssertAdminUserInGridActionGroup.xml @@ -0,0 +1,22 @@ +<?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="AssertAdminUserInGridActionGroup"> + <arguments> + <argument name="userName" type="string"/> + </arguments> + <amOnPage url="{{AdminUsersPage.url}}" stepKey="navigateToUsersGrid"/> + <click selector="{{AdminUserGridSection.resetButton}}" stepKey="resetGridFilter"/> + <waitForPageLoad stepKey="waitForFiltersReset"/> + <fillField selector="{{AdminUserGridSection.usernameFilterTextField}}" userInput="{{userName}}" stepKey="enterUserName"/> + <click selector="{{AdminUserGridSection.searchButton}}" stepKey="clickSearch"/> + <waitForPageLoad stepKey="waitForGridToLoad" time="15"/> + <see selector="{{AdminUserGridSection.usernameInFirstRow}}" userInput="{{userName}}" stepKey="seeUser"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/User/Test/Mftf/ActionGroup/AssertAdminUserNotInGridActionGroup.xml b/app/code/Magento/User/Test/Mftf/ActionGroup/AssertAdminUserNotInGridActionGroup.xml new file mode 100644 index 0000000000000..ed5c82aba84db --- /dev/null +++ b/app/code/Magento/User/Test/Mftf/ActionGroup/AssertAdminUserNotInGridActionGroup.xml @@ -0,0 +1,22 @@ +<?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="AssertAdminUserNotInGridActionGroup"> + <arguments> + <argument name="userName" type="string"/> + </arguments> + <amOnPage url="{{AdminUsersPage.url}}" stepKey="navigateToUsersGrid"/> + <click selector="{{AdminUserGridSection.resetButton}}" stepKey="resetGridFilter"/> + <waitForPageLoad stepKey="waitForFiltersReset"/> + <fillField selector="{{AdminUserGridSection.usernameFilterTextField}}" userInput="{{userName}}" stepKey="enterUserName"/> + <click selector="{{AdminUserGridSection.searchButton}}" stepKey="clickSearch"/> + <waitForPageLoad stepKey="waitForGridToLoad" time="15"/> + <see selector="{{AdminUserGridSection.emptyRecords}}" userInput="We couldn't find any records." stepKey="seeEmptyRecordMessage"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/User/Test/Mftf/Data/UserData.xml b/app/code/Magento/User/Test/Mftf/Data/UserData.xml index 7947c8ee3c161..cf15c77810791 100644 --- a/app/code/Magento/User/Test/Mftf/Data/UserData.xml +++ b/app/code/Magento/User/Test/Mftf/Data/UserData.xml @@ -145,6 +145,38 @@ <data key="username">admin_user_with_correct_password</data> <data key="password">123123123q</data> </entity> + <entity name="activeAdmin" type="user"> + <data key="username" unique="suffix">AdminUser</data> + <data key="firstname" unique="suffix">FirstName</data> + <data key="lastname" unique="suffix">LastName</data> + <data key="email" unique="prefix">admin@example.com</data> + <data key="password">123123q</data> + <data key="password_confirmation">123123q</data> + <data key="interface_local">en_US</data> + <data key="interface_local_label">English (United States)</data> + <data key="current_password">{{_ENV.MAGENTO_ADMIN_PASSWORD}}</data> + <data key="role">Administrators</data> + <data key="is_active">1</data> + <array key="roles"> + <item>1</item> + </array> + </entity> + <entity name="inactiveAdmin" type="user"> + <data key="username" unique="suffix">AdminUser</data> + <data key="firstname" unique="suffix">FirstName</data> + <data key="lastname" unique="suffix">LastName</data> + <data key="email" unique="prefix">admin@example.com</data> + <data key="password">123123q</data> + <data key="password_confirmation">123123q</data> + <data key="interface_local">en_US</data> + <data key="interface_local_label">English (United States)</data> + <data key="current_password">{{_ENV.MAGENTO_ADMIN_PASSWORD}}</data> + <data key="role">Administrators</data> + <data key="is_active">0</data> + <array key="roles"> + <item>1</item> + </array> + </entity> <!-- Since User delete action is performed via POST request we created this entity to be able to delete it. Please use "AdminDeleteUserViaCurlActionGroup". diff --git a/app/code/Magento/User/Test/Mftf/Data/UserRoleData.xml b/app/code/Magento/User/Test/Mftf/Data/UserRoleData.xml index a39e6cf47c295..4eec00ec4049b 100644 --- a/app/code/Magento/User/Test/Mftf/Data/UserRoleData.xml +++ b/app/code/Magento/User/Test/Mftf/Data/UserRoleData.xml @@ -15,6 +15,13 @@ <data key="access">1</data> </entity> + <entity name="roleDefaultAdministrator" type="role"> + <data key="name">Administrators</data> + <data key="rolename">Administrators</data> + <data key="scope">1</data> + <data key="access">1</data> + </entity> + <entity name="roleAdministrator" type="user_role"> <data key="name" unique="suffix">Administrator </data> <data key="rolename" unique="suffix">Administrator </data> diff --git a/app/code/Magento/User/Test/Mftf/Section/AdminRoleGridSection/AdminRoleGridSection.xml b/app/code/Magento/User/Test/Mftf/Section/AdminRoleGridSection/AdminRoleGridSection.xml index 3d0c8b855e53b..f1826d360fb88 100644 --- a/app/code/Magento/User/Test/Mftf/Section/AdminRoleGridSection/AdminRoleGridSection.xml +++ b/app/code/Magento/User/Test/Mftf/Section/AdminRoleGridSection/AdminRoleGridSection.xml @@ -14,5 +14,6 @@ <element name="resetButton" type="button" selector="button[title='Reset Filter']"/> <element name="roleNameInFirstRow" type="text" selector=".col-role_name"/> <element name="searchResultFirstRow" type="text" selector=".data-grid>tbody>tr"/> + <element name="emptyRecords" type="text" selector="//tr[@class='data-grid-tr-no-data even']/td[@class='empty-text']"/> </section> </sections> diff --git a/app/code/Magento/User/Test/Mftf/Section/AdminUserGridSection/AdminUserGridSection.xml b/app/code/Magento/User/Test/Mftf/Section/AdminUserGridSection/AdminUserGridSection.xml index 137cfd233577f..8e6b5f612a7b1 100644 --- a/app/code/Magento/User/Test/Mftf/Section/AdminUserGridSection/AdminUserGridSection.xml +++ b/app/code/Magento/User/Test/Mftf/Section/AdminUserGridSection/AdminUserGridSection.xml @@ -14,5 +14,6 @@ <element name="usernameInFirstRow" type="text" selector=".col-username"/> <element name="searchResultFirstRow" type="text" selector=".data-grid>tbody>tr"/> <element name="successMessage" type="text" selector=".message-success"/> + <element name="emptyRecords" type="text" selector="//tr[@class='data-grid-tr-no-data even']/td[@class='empty-text']"/> </section> </sections> diff --git a/app/code/Magento/User/Test/Mftf/Test/AdminBulkOperationsLogIsNotAccessibleForAdminUserWithLimitedAccessTest.xml b/app/code/Magento/User/Test/Mftf/Test/AdminBulkOperationsLogIsNotAccessibleForAdminUserWithLimitedAccessTest.xml index e0db8d8b25b96..e192bea3a25e0 100644 --- a/app/code/Magento/User/Test/Mftf/Test/AdminBulkOperationsLogIsNotAccessibleForAdminUserWithLimitedAccessTest.xml +++ b/app/code/Magento/User/Test/Mftf/Test/AdminBulkOperationsLogIsNotAccessibleForAdminUserWithLimitedAccessTest.xml @@ -20,11 +20,11 @@ </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="LoginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="LoginAsAdmin"/> </before> <after> - <actionGroup ref="LoginAsAdmin" stepKey="LoginAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="LoginAdmin"/> <!-- Delete User --> <actionGroup ref="AdminDeleteCustomUserActionGroup" stepKey="deleteLimitedUser"> @@ -47,8 +47,9 @@ <actionGroup ref="AdminLogoutActionGroup" stepKey="logoutAdmin"/> <!-- Login as user2 --> - <actionGroup ref="LoginAsAdmin" stepKey="LoginAsUser"> - <argument name="adminUser" value="NewAdminUser"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="LoginAsUser"> + <argument name="username" value="{{NewAdminUser.username}}"/> + <argument name="password" value="{{NewAdminUser.password}}"/> </actionGroup> <!-- Bulk operation menu item isn't visible( System > Action Logs > -Bulk Actions-) --> diff --git a/app/code/Magento/User/Test/Mftf/Test/AdminCreateActiveUserEntityTest.xml b/app/code/Magento/User/Test/Mftf/Test/AdminCreateActiveUserEntityTest.xml index 218be4e282b4a..668ae550f1b3d 100644 --- a/app/code/Magento/User/Test/Mftf/Test/AdminCreateActiveUserEntityTest.xml +++ b/app/code/Magento/User/Test/Mftf/Test/AdminCreateActiveUserEntityTest.xml @@ -14,36 +14,34 @@ <stories value="Create Admin User"/> <title value="Admin user should be able to create active admin user"/> <description value="Admin user should be able to create active admin user"/> - <testCaseId value=""/> + <testCaseId value="MC-33044"/> <severity value="CRITICAL"/> <group value="user"/> <group value="mtf_migrated"/> </annotations> - <before> - <actionGroup ref="LoginAsAdmin" stepKey="LoginAsAdmin"/> - </before> <after> - <actionGroup ref="LoginAsAdmin" stepKey="LoginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="adminLogin"/> <actionGroup ref="AdminDeleteUserActionGroup" stepKey="deleteUser"> <argument name="user" value="activeAdmin"/> </actionGroup> + <actionGroup ref="AdminLogoutActionGroup" stepKey="adminLogout"/> </after> - <actionGroup ref="AdminCreateUserWithRoleAndIsActiveActionGroup" stepKey="createAdminUser"> - <argument name="role" value="genericAdminRole"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="adminLogin"/> + <actionGroup ref="AdminCreateUserWithRoleActionGroup" stepKey="createAdminUser"> <argument name="user" value="activeAdmin"/> + <argument name="role" value="roleDefaultAdministrator"/> </actionGroup> <actionGroup ref="AdminLogoutActionGroup" stepKey="logoutMasterAdmin"/> - <amOnPage url="{{AdminLoginPage.url}}" stepKey="navigateToAdmin"/> - <fillField selector="{{AdminLoginFormSection.username}}" userInput="{{activeAdmin.username}}" stepKey="fillUsername"/> - <fillField selector="{{AdminLoginFormSection.password}}" userInput="{{activeAdmin.password}}" stepKey="fillPassword"/> - <click selector="{{AdminLoginFormSection.signIn}}" stepKey="clickLogin"/> - <closeAdminNotification stepKey="closeAdminNotification"/> + + <actionGroup ref="AdminLoginActionGroup" stepKey="loginToNewAdmin"> + <argument name="username" value="{{activeAdmin.username}}"/> + <argument name="password" value="{{activeAdmin.password}}"/> + </actionGroup> <amOnPage url="{{AdminUsersPage.url}}" stepKey="navigateToAdminUsersGrid"/> - <fillField selector="{{AdminUserGridSection.usernameFilterTextField}}" userInput="{{activeAdmin.username}}" stepKey="fillUsernameSearch"/> - <click selector="{{AdminUserGridSection.searchButton}}" stepKey="clickSearchButton"/> - <waitForPageLoad time="10" stepKey="wait1"/> - <see selector="{{AdminUserGridSection.usernameInFirstRow}}" userInput="{{activeAdmin.username}}" stepKey="seeFoundUsername"/> + <actionGroup ref="AssertAdminUserIsInGridActionGroup" stepKey="assertAdminIsInGrid"> + <argument name="user" value="activeAdmin"/> + </actionGroup> <actionGroup ref="AdminLogoutActionGroup" stepKey="logoutCreatedUser"/> </test> </tests> diff --git a/app/code/Magento/User/Test/Mftf/Test/AdminCreateInactiveUserEntityTest.xml b/app/code/Magento/User/Test/Mftf/Test/AdminCreateInactiveUserEntityTest.xml index d52cafa13b7b8..23a30246bd999 100644 --- a/app/code/Magento/User/Test/Mftf/Test/AdminCreateInactiveUserEntityTest.xml +++ b/app/code/Magento/User/Test/Mftf/Test/AdminCreateInactiveUserEntityTest.xml @@ -14,35 +14,28 @@ <stories value="Create Admin User"/> <title value="Admin user should be able to create inactive admin user"/> <description value="Admin user should be able to create inactive admin user"/> - <testCaseId value=""/> + <testCaseId value="MC-33045"/> <severity value="CRITICAL"/> <group value="user"/> <group value="mtf_migrated"/> </annotations> - <before> - <actionGroup ref="LoginAsAdmin" stepKey="LoginAsAdmin"/> - </before> - <after> - <actionGroup ref="LoginAsAdmin" stepKey="LoginAsAdmin"/> - <actionGroup ref="AdminDeleteUserActionGroup" stepKey="deleteUser"> - <argument name="user" value="inactiveAdmin"/> - </actionGroup> - </after> + <actionGroup ref="AdminLoginActionGroup" stepKey="adminMasterLogin"/> <actionGroup ref="AdminCreateUserWithRoleAndIsActiveActionGroup" stepKey="createAdminUser"> - <argument name="role" value="genericAdminRole"/> <argument name="user" value="inactiveAdmin"/> + <argument name="role" value="roleDefaultAdministrator"/> </actionGroup> <amOnPage url="{{AdminUsersPage.url}}" stepKey="navigateToAdminUsersGrid"/> - <fillField selector="{{AdminUserGridSection.usernameFilterTextField}}" userInput="{{inactiveAdmin.username}}" stepKey="fillUsernameSearch"/> - <click selector="{{AdminUserGridSection.searchButton}}" stepKey="clickSearchButton"/> - <waitForPageLoad time="10" stepKey="wait1"/> - <see selector="{{AdminUserGridSection.usernameInFirstRow}}" userInput="{{inactiveAdmin.username}}" stepKey="seeFoundUsername"/> - <actionGroup ref="AdminLogoutActionGroup" stepKey="logoutMasterAdmin"/> - <amOnPage url="{{AdminLoginPage.url}}" stepKey="navigateToAdmin"/> - <fillField selector="{{AdminLoginFormSection.username}}" userInput="{{inactiveAdmin.username}}" stepKey="fillUsername"/> - <fillField selector="{{AdminLoginFormSection.password}}" userInput="{{inactiveAdmin.password}}" stepKey="fillPassword"/> - <click selector="{{AdminLoginFormSection.signIn}}" stepKey="clickLogin"/> + <actionGroup ref="AssertAdminUserIsInGridActionGroup" stepKey="assertAdminIsInGrid"> + <argument name="user" value="inactiveAdmin"/> + </actionGroup> + <actionGroup ref="AdminLogoutActionGroup" stepKey="adminMasterLogout"/> + + <actionGroup ref="AdminLoginActionGroup" stepKey="adminNewLogin"> + <argument name="username" value="{{inactiveAdmin.username}}"/> + <argument name="password" value="{{inactiveAdmin.password}}"/> + </actionGroup> <actionGroup ref="AssertMessageOnAdminLoginActionGroup" stepKey="seeUserErrorMessage" /> + <actionGroup ref="AdminLogoutActionGroup" stepKey="adminNewLogout"/> </test> </tests> diff --git a/app/code/Magento/User/Test/Mftf/Test/AdminCreateUserRoleEntityTest.xml b/app/code/Magento/User/Test/Mftf/Test/AdminCreateUserRoleEntityTest.xml new file mode 100644 index 0000000000000..d373bc6676deb --- /dev/null +++ b/app/code/Magento/User/Test/Mftf/Test/AdminCreateUserRoleEntityTest.xml @@ -0,0 +1,79 @@ +<?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="AdminCreateUserRoleEntityTest"> + <annotations> + <features value="User"/> + <stories value="Create User Role"/> + <title value="Creating a new role with different data sets"/> + <description value="Creating a new role with different data sets"/> + <testCaseId value="MC-14258"/> + <group value="user"/> + <group value="mtf_migrated"/> + </annotations> + + <before> + <actionGroup ref="AdminLoginActionGroup" stepKey="logIn"/> + </before> + <after> + <actionGroup ref="AdminLogoutActionGroup" stepKey="logOut"/> + </after> + + <!--Create a new role with custom access--> + <actionGroup ref="AdminOpenCreateRolePageActionGroup" stepKey="goToNewRolePage"/> + <actionGroup ref="AdminFillUserRoleFormActionGroup" stepKey="fillNewRoleForm"> + <argument name="role" value="roleSales"/> + </actionGroup> + <actionGroup ref="AdminClickSaveButtonOnUserRoleFormActionGroup" stepKey="saveNewRole"/> + <actionGroup ref="AssertMessageInAdminPanelActionGroup" stepKey="assertSuccessMessage"> + <argument name="message" value="You saved the role."/> + </actionGroup> + <actionGroup ref="AssertAdminRoleInGridActionGroup" stepKey="assertRoleInGrid"> + <argument name="roleName" value="{{roleSales.name}}"/> + </actionGroup> + <!--Delete the new role with custom access--> + <actionGroup ref="AdminDeleteUserRoleActionGroup" stepKey="deleteSaleRole"> + <argument name="roleName" value="{{roleSales.name}}"/> + </actionGroup> + + <!--Create a new role with full access--> + <actionGroup ref="AdminOpenCreateRolePageActionGroup" stepKey="goToNewRolePageSecondTime"/> + <actionGroup ref="AdminFillUserRoleFormActionGroup" stepKey="fillNewRoleFormSecondTime"> + <argument name="role" value="roleAdministrator"/> + </actionGroup> + <actionGroup ref="AdminClickSaveButtonOnUserRoleFormActionGroup" stepKey="saveNewRoleSecondTime"/> + <actionGroup ref="AssertMessageInAdminPanelActionGroup" stepKey="assertSuccessMessageSecondTime"> + <argument name="message" value="You saved the role."/> + </actionGroup> + <actionGroup ref="AssertAdminRoleInGridActionGroup" stepKey="assertRoleInGridSecondTime"> + <argument name="roleName" value="{{roleAdministrator.name}}"/> + </actionGroup> + <!--Delete the new role with full access--> + <actionGroup ref="AdminDeleteUserRoleActionGroup" stepKey="deleteAdministratorRole"> + <argument name="roleName" value="{{roleAdministrator.name}}"/> + </actionGroup> + + <!--Create a new role using incorrect current_password--> + <actionGroup ref="AdminOpenCreateRolePageActionGroup" stepKey="goToNewRolePageThirdTime"/> + <actionGroup ref="AdminFillUserRoleFormActionGroup" stepKey="fillNewRoleFormThirdTime"> + <argument name="role" value="roleAdministrator"/> + <argument name="currentAdminPassword" value="{{_ENV.MAGENTO_ADMIN_PASSWORD}}INVALID"/> + </actionGroup> + <actionGroup ref="AdminClickSaveButtonOnUserRoleFormActionGroup" stepKey="saveNewRoleThirdTime"/> + <actionGroup ref="AssertMessageInAdminPanelActionGroup" stepKey="assertErrorMessage"> + <argument name="messageType" value="error"/> + <argument name="message" value="The password entered for the current user is invalid. Verify the password and try again."/> + </actionGroup> + <actionGroup ref="AssertAdminRoleNotInGridActionGroup" stepKey="assertRoleNotInGrid"> + <argument name="roleName" value="{{roleAdministrator.name}}"/> + </actionGroup> + + </test> +</tests> diff --git a/app/code/Magento/User/Test/Mftf/Test/AdminDeleteAdminUserEntityTest.xml b/app/code/Magento/User/Test/Mftf/Test/AdminDeleteAdminUserEntityTest.xml new file mode 100644 index 0000000000000..60f6089e56a41 --- /dev/null +++ b/app/code/Magento/User/Test/Mftf/Test/AdminDeleteAdminUserEntityTest.xml @@ -0,0 +1,46 @@ +<?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="AdminDeleteAdminUserEntityTest"> + <annotations> + <features value="User"/> + <stories value="Delete Admin User"/> + <title value="Admin user is able to delete a user account"/> + <description value="Admin user is able to delete a user account"/> + <testCaseId value="MC-14270"/> + <group value="user"/> + <group value="mtf_migrated"/> + </annotations> + + <before> + <!--Create New Admin User--> + <createData entity="NewAdminUser" stepKey="user"> + <field key="current_password">{{DefaultAdminUser.password}}</field> + </createData> + + <actionGroup ref="AdminLoginActionGroup" stepKey="logIn"/> + </before> + + <after> + <actionGroup ref="AdminLogoutActionGroup" stepKey="logOut"/> + </after> + + <!--Delete New Admin User--> + <actionGroup ref="AdminDeleteCustomUserActionGroup" stepKey="deleteNewUser"> + <argument name="user" value="$$user$$"/> + </actionGroup> + <actionGroup ref="AssertMessageInAdminPanelActionGroup" stepKey="assertSuccessMessage"> + <argument name="message" value="You deleted the user."/> + </actionGroup> + <actionGroup ref="AssertAdminUserNotInGridActionGroup" stepKey="assertUserNotInGrid"> + <argument name="userName" value="$$user.username$$"/> + </actionGroup> + </test> +</tests> diff --git a/app/code/Magento/User/Test/Mftf/Test/AdminDeleteOwnAdminUserAccountTest.xml b/app/code/Magento/User/Test/Mftf/Test/AdminDeleteOwnAdminUserAccountTest.xml new file mode 100644 index 0000000000000..1019d58edcaf2 --- /dev/null +++ b/app/code/Magento/User/Test/Mftf/Test/AdminDeleteOwnAdminUserAccountTest.xml @@ -0,0 +1,54 @@ +<?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="AdminDeleteOwnAdminUserAccountTest"> + <annotations> + <features value="User"/> + <stories value="Delete Admin User"/> + <title value="Admin user is not able to delete the own account"/> + <description value="Admin user is not able to delete the own account"/> + <testCaseId value="MC-14271"/> + <group value="user"/> + <group value="mtf_migrated"/> + </annotations> + + <before> + <!--Create New Admin User--> + <executeJS function="return '{{DefaultAdminUser.password}}'" stepKey="adminPassword" /> + <createData entity="NewAdminUser" stepKey="user"> + <field key="current_password">{$adminPassword}</field> + </createData> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsNewUser"> + <argument name="username" value="$$user.username$$"/> + <argument name="password" value="$$user.password$$"/> + </actionGroup> + </before> + <after> + <!-- Delete New Admin User --> + <actionGroup ref="AdminLoginActionGroup" stepKey="LoginAdmin"/> + <actionGroup ref="AdminDeleteUserViaCurlActionGroup" stepKey="deleteUser"> + <argument name="user" value="$$user$$" /> + </actionGroup> + <actionGroup ref="AdminLogoutActionGroup" stepKey="logOut"/> + </after> + + <!--Assert Impossible Delete Your Own Account--> + <actionGroup ref="AdminOpenUserEditPageActionGroup" stepKey="openUserEditPageForDeleting"> + <argument name="user" value="$$user$$"/> + </actionGroup> + <actionGroup ref="AssertAdminImpossibleDeleteYourOwnAccountActionGroup" stepKey="assertErrorMessage"> + <argument name="currentAdminPassword" value="$$user.password$$"/> + </actionGroup> + <actionGroup ref="AssertAdminUserInGridActionGroup" stepKey="assertUserInGrid"> + <argument name="userName" value="$$user.username$$"/> + </actionGroup> + <actionGroup ref="AdminLogoutActionGroup" stepKey="logOutAsNewUser"/> + </test> +</tests> diff --git a/app/code/Magento/User/Test/Mftf/Test/AdminLockAdminUserEntityTest.xml b/app/code/Magento/User/Test/Mftf/Test/AdminLockAdminUserEntityTest.xml index c367bddc8d999..850fa04549e84 100644 --- a/app/code/Magento/User/Test/Mftf/Test/AdminLockAdminUserEntityTest.xml +++ b/app/code/Magento/User/Test/Mftf/Test/AdminLockAdminUserEntityTest.xml @@ -19,16 +19,17 @@ <group value="user"/> <group value="mtf_migrated"/> </annotations> - <before> <magentoCLI command="config:set admin/captcha/enable 0" stepKey="disableAdminCaptcha"/> + <magentoCLI command="config:set admin/security/lockout_failures 2" stepKey="setDefaultMaximumLoginFailures"/> <magentoCLI command="cache:clean config full_page" stepKey="cleanInvalidatedCaches1"/> - <actionGroup ref="LoginAsAdmin" stepKey="logIn"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="adminLogin"/> </before> <after> <magentoCLI command="config:set admin/captcha/enable 1" stepKey="enableAdminCaptcha"/> + <magentoCLI command="config:set admin/security/lockout_failures 6" stepKey="setDefaultMaximumLoginFailures"/> <magentoCLI command="cache:clean config full_page" stepKey="cleanInvalidatedCaches"/> - <actionGroup ref="AdminLogoutActionGroup" stepKey="logOut"/> + <actionGroup ref="AdminLogoutActionGroup" stepKey="adminLogout"/> </after> <!--Create New User--> @@ -38,33 +39,28 @@ </actionGroup> <actionGroup ref="AdminClickSaveButtonOnUserFormActionGroup" stepKey="saveNewUser"/> - <!--Set 'Maximum Login Failures to Lockout Account'--> - <actionGroup ref="AdminOpenConfigAdminPageActionGroup" stepKey="goToConfigAdminSectionPage"/> - <actionGroup ref="AdminExpandSecurityTabActionGroup" stepKey="openSecurityTab"/> - <actionGroup ref="AdminSetMaximumLoginFailuresToLockoutAccountActionGroup" stepKey="setMaximumLoginFailures"> - <argument name="qty" value="2"/> - </actionGroup> - <actionGroup ref="AdminSaveConfigActionGroup" stepKey="saveChanges"/> - <!-- Log in to Admin Panel with incorrect password specified number of times--> <actionGroup ref="AdminLogoutActionGroup" stepKey="logoutAsDefaultUser"/> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsNewUserFirstAttempt"> - <argument name="adminUser" value="adminUserIncorrectPassword"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsNewUserFirstAttempt"> + <argument name="username" value="{{adminUserIncorrectPassword.username}}"/> + <argument name="password" value="{{adminUserIncorrectPassword.password}}"/> </actionGroup> <actionGroup ref="AssertMessageOnAdminLoginActionGroup" stepKey="checkLoginErrorFirstAttempt"/> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsNewUserSecondAttempt"> - <argument name="adminUser" value="adminUserIncorrectPassword"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsNewUserSecondAttempt"> + <argument name="username" value="{{adminUserIncorrectPassword.username}}"/> + <argument name="password" value="{{adminUserIncorrectPassword.password}}"/> </actionGroup> <actionGroup ref="AssertMessageOnAdminLoginActionGroup" stepKey="checkLoginErrorSecondAttempt"/> <!-- Log in to Admin Panel with correct password--> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsNewUserThirdAttempt"> - <argument name="adminUser" value="adminUserCorrectPassword"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsNewUserThirdAttempt"> + <argument name="username" value="{{adminUserCorrectPassword.username}}"/> + <argument name="password" value="{{adminUserCorrectPassword.password}}"/> </actionGroup> <actionGroup ref="AssertMessageOnAdminLoginActionGroup" stepKey="checkLoginErrorThirdAttempt"/> <!--Login as default admin user--> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsDefaultAdminUser"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsDefaultAdminUser"/> <!--Delete new User--> <actionGroup ref="AdminDeleteCustomUserActionGroup" stepKey="deleteNewUser"> diff --git a/app/code/Magento/User/Test/Mftf/Test/AdminSystemAllUsersNavigateMenuTest.xml b/app/code/Magento/User/Test/Mftf/Test/AdminSystemAllUsersNavigateMenuTest.xml index 57e2ab0faccf6..9793387b02289 100644 --- a/app/code/Magento/User/Test/Mftf/Test/AdminSystemAllUsersNavigateMenuTest.xml +++ b/app/code/Magento/User/Test/Mftf/Test/AdminSystemAllUsersNavigateMenuTest.xml @@ -20,7 +20,7 @@ <group value="mtf_migrated"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="LoginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="LoginAsAdmin"/> </before> <after> <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> diff --git a/app/code/Magento/User/Test/Mftf/Test/AdminSystemLockedUsersNavigateMenuTest.xml b/app/code/Magento/User/Test/Mftf/Test/AdminSystemLockedUsersNavigateMenuTest.xml index 963af44ac3bc0..e32f0736f880b 100644 --- a/app/code/Magento/User/Test/Mftf/Test/AdminSystemLockedUsersNavigateMenuTest.xml +++ b/app/code/Magento/User/Test/Mftf/Test/AdminSystemLockedUsersNavigateMenuTest.xml @@ -20,7 +20,7 @@ <group value="mtf_migrated"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="LoginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="LoginAsAdmin"/> </before> <after> <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> diff --git a/app/code/Magento/User/Test/Mftf/Test/AdminSystemManageEncryptionKeyNavigateMenuTest.xml b/app/code/Magento/User/Test/Mftf/Test/AdminSystemManageEncryptionKeyNavigateMenuTest.xml index d6a4318c7d7be..8c7bdfc9360b5 100644 --- a/app/code/Magento/User/Test/Mftf/Test/AdminSystemManageEncryptionKeyNavigateMenuTest.xml +++ b/app/code/Magento/User/Test/Mftf/Test/AdminSystemManageEncryptionKeyNavigateMenuTest.xml @@ -20,7 +20,7 @@ <group value="mtf_migrated"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="LoginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="LoginAsAdmin"/> </before> <after> <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> diff --git a/app/code/Magento/User/Test/Mftf/Test/AdminSystemUserRolesNavigateMenuTest.xml b/app/code/Magento/User/Test/Mftf/Test/AdminSystemUserRolesNavigateMenuTest.xml index ef9cb5ebfa5fe..5abf119f18d4a 100644 --- a/app/code/Magento/User/Test/Mftf/Test/AdminSystemUserRolesNavigateMenuTest.xml +++ b/app/code/Magento/User/Test/Mftf/Test/AdminSystemUserRolesNavigateMenuTest.xml @@ -20,7 +20,7 @@ <group value="mtf_migrated"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="LoginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="LoginAsAdmin"/> </before> <after> <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> diff --git a/app/code/Magento/User/Test/Mftf/Test/AdminUpdateUserTest.xml b/app/code/Magento/User/Test/Mftf/Test/AdminUpdateUserTest.xml index 39d7954ef7729..d1034c7a5945f 100644 --- a/app/code/Magento/User/Test/Mftf/Test/AdminUpdateUserTest.xml +++ b/app/code/Magento/User/Test/Mftf/Test/AdminUpdateUserTest.xml @@ -23,7 +23,7 @@ </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="logIn"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="logIn"/> <!--Create New User--> <actionGroup ref="AdminOpenNewUserPageActionGroup" stepKey="goToNewUserPage"/> @@ -42,7 +42,7 @@ <after> <!--Delete new User--> <actionGroup ref="AdminLogoutActionGroup" stepKey="logoutAsSaleRoleUser"/> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsDefaultAdminUser"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsDefaultAdminUser"/> <actionGroup ref="AdminDeleteCustomUserActionGroup" stepKey="deleteNewUser"> <argument name="user" value="AdminUserWithUpdatedUserRoleToSales"/> </actionGroup> @@ -71,7 +71,7 @@ <argument name="user" value="AdminUserWithUpdatedUserRoleToSales"/> </actionGroup> <actionGroup ref="AdminLogoutActionGroup" stepKey="logOutFromAdminPanel"/> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsSaleRoleUser"> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsSaleRoleUser"> <argument name="adminUser" value="AdminUserWithUpdatedUserRoleToSales"/> </actionGroup> <actionGroup ref="AssertAdminSuccessLoginActionGroup" stepKey="seeSuccessloginMessage"/> diff --git a/app/code/Magento/Variable/Test/Mftf/Test/AdminCreateCustomVariableEntityTest.xml b/app/code/Magento/Variable/Test/Mftf/Test/AdminCreateCustomVariableEntityTest.xml index ee7368a44616d..1c6e222a242d8 100644 --- a/app/code/Magento/Variable/Test/Mftf/Test/AdminCreateCustomVariableEntityTest.xml +++ b/app/code/Magento/Variable/Test/Mftf/Test/AdminCreateCustomVariableEntityTest.xml @@ -20,7 +20,7 @@ <group value="mtf_migrated"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> </before> <after> <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> diff --git a/app/code/Magento/Variable/Test/Mftf/Test/AdminSystemCustomVariablesNavigateMenuTest.xml b/app/code/Magento/Variable/Test/Mftf/Test/AdminSystemCustomVariablesNavigateMenuTest.xml index c5d85907d15fc..8197f9a5b5752 100644 --- a/app/code/Magento/Variable/Test/Mftf/Test/AdminSystemCustomVariablesNavigateMenuTest.xml +++ b/app/code/Magento/Variable/Test/Mftf/Test/AdminSystemCustomVariablesNavigateMenuTest.xml @@ -20,7 +20,7 @@ <group value="mtf_migrated"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="LoginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="LoginAsAdmin"/> </before> <after> <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> diff --git a/app/code/Magento/Version/Controller/Index/Index.php b/app/code/Magento/Version/Controller/Index/Index.php index 53bcd4b4ff700..2c874c601ea08 100644 --- a/app/code/Magento/Version/Controller/Index/Index.php +++ b/app/code/Magento/Version/Controller/Index/Index.php @@ -1,6 +1,5 @@ <?php /** - * * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ @@ -8,51 +7,55 @@ namespace Magento\Version\Controller\Index; -use Magento\Framework\App\Action\Action; -use Magento\Framework\App\Action\Context; -use Magento\Framework\App\Action\HttpGetActionInterface as HttpGetActionInterface; +use Magento\Framework\App\Action\HttpGetActionInterface; use Magento\Framework\App\ProductMetadataInterface; +use Magento\Framework\Controller\Result\RawFactory as RawResponseFactory; /** - * Magento Version controller + * Magento Version controller: Sets the response body to ProductName/Major.MinorVersion (Edition). */ -class Index extends Action implements HttpGetActionInterface +class Index implements HttpGetActionInterface { const DEV_PREFIX = 'dev-'; /** * @var ProductMetadataInterface */ - protected $productMetadata; + private $productMetadata; /** - * @param Context $context + * @var RawResponseFactory + */ + private $rawFactory; + + /** + * @param RawResponseFactory $rawFactory * @param ProductMetadataInterface $productMetadata */ - public function __construct(Context $context, ProductMetadataInterface $productMetadata) + public function __construct(RawResponseFactory $rawFactory, ProductMetadataInterface $productMetadata) { + $this->rawFactory = $rawFactory; $this->productMetadata = $productMetadata; - parent::__construct($context); } /** - * Sets the response body to ProductName/Major.MinorVersion (Edition). - * - * @return void + * @inheritDoc */ - public function execute(): void + public function execute() { + $rawResponse = $this->rawFactory->create(); + $version = $this->productMetadata->getVersion(); $versionParts = explode('.', $version); - if ($this->isGitBasedInstallation($version) || !$this->isCorrectVersion($versionParts)) { - return; + if (!$this->isGitBasedInstallation($version) && $this->isCorrectVersion($versionParts)) { + $rawResponse->setContents( + $this->productMetadata->getName() . '/' . + $this->getMajorMinorVersion($versionParts) . + ' (' . $this->productMetadata->getEdition() . ')' + ); } - $this->getResponse()->setBody( - $this->productMetadata->getName() . '/' . - $this->getMajorMinorVersion($versionParts) . - ' (' . $this->productMetadata->getEdition() . ')' - ); + return $rawResponse; } /** diff --git a/app/code/Magento/Version/Test/Unit/Controller/Index/IndexTest.php b/app/code/Magento/Version/Test/Unit/Controller/Index/IndexTest.php index 3fc2cecabe990..69aed915bd513 100644 --- a/app/code/Magento/Version/Test/Unit/Controller/Index/IndexTest.php +++ b/app/code/Magento/Version/Test/Unit/Controller/Index/IndexTest.php @@ -7,67 +7,43 @@ namespace Magento\Version\Test\Unit\Controller\Index; -use Magento\Framework\App\Action\Context; use Magento\Framework\App\ProductMetadataInterface; use Magento\Framework\App\ResponseInterface; -use Magento\Framework\TestFramework\Unit\Helper\ObjectManager; +use Magento\Framework\Controller\Result\Raw; +use Magento\Framework\Controller\Result\RawFactory; use Magento\Version\Controller\Index\Index as VersionIndex; +use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\TestCase; class IndexTest extends TestCase { - /** - * @var VersionIndex - */ - private $model; - - /** - * @var Context - */ - private $contextMock; + /** @var VersionIndex */ + private $versionController; - /** - * @var ProductMetadataInterface - */ + /** @var MockObject|ProductMetadataInterface */ private $productMetadataMock; - /** - * @var ResponseInterface - */ - private $responseMock; + /** @var MockObject|RawFactory */ + private $rawResponseFactoryMock; + + /** @var MockObject|Raw */ + private $rawResponseMock; /** * Prepare test preconditions */ protected function setUp() { - $this->contextMock = $this->getMockBuilder(Context::class) - ->disableOriginalConstructor() - ->getMock(); - $this->productMetadataMock = $this->getMockBuilder(ProductMetadataInterface::class) ->disableOriginalConstructor() ->setMethods(['getName', 'getEdition', 'getVersion']) ->getMock(); - $this->responseMock = $this->getMockBuilder(ResponseInterface::class) - ->disableOriginalConstructor() - ->setMethods(['setBody', 'sendResponse']) - ->getMock(); - - $this->contextMock->expects($this->any()) - ->method('getResponse') - ->willReturn($this->responseMock); - - $objectManager = new ObjectManager($this); + $this->rawResponseFactoryMock = $this->createPartialMock(RawFactory::class, ['create']); + $this->rawResponseMock = $this->createPartialMock(Raw::class, ['setContents']); + $this->rawResponseFactoryMock->method('create')->willReturn($this->rawResponseMock); - $this->model = $objectManager->getObject( - VersionIndex::class, - [ - 'context' => $this->contextMock, - 'productMetadata' => $this->productMetadataMock - ] - ); + $this->versionController = new VersionIndex($this->rawResponseFactoryMock, $this->productMetadataMock); } /** @@ -79,10 +55,10 @@ public function testGitBasedInstallationDoesNotReturnVersion(): void ->method('getVersion') ->willReturn('dev-2.3'); - $this->responseMock->expects($this->never()) - ->method('setBody'); + $this->rawResponseMock->expects($this->never()) + ->method('setContents'); - $this->assertNull($this->model->execute()); + $this->versionController->execute(); } /** @@ -94,10 +70,10 @@ public function testCommunityVersionDisplaysMajorMinorVersionAndEditionName(): v $this->productMetadataMock->expects($this->any())->method('getEdition')->willReturn('Community'); $this->productMetadataMock->expects($this->any())->method('getName')->willReturn('Magento'); - $this->responseMock->expects($this->once())->method('setBody') + $this->rawResponseMock->expects($this->once())->method('setContents') ->with('Magento/2.3 (Community)') ->will($this->returnSelf()); - $this->model->execute(); + $this->versionController->execute(); } } diff --git a/app/code/Magento/WebapiAsync/Model/OperationRepository.php b/app/code/Magento/WebapiAsync/Model/OperationRepository.php index 695cab2ae4402..7af8ff877ebbc 100644 --- a/app/code/Magento/WebapiAsync/Model/OperationRepository.php +++ b/app/code/Magento/WebapiAsync/Model/OperationRepository.php @@ -97,6 +97,6 @@ public function create($topicName, $entityParams, $groupId, $operationId): Opera /** @var OperationInterface $operation */ $operation = $this->operationFactory->create($data); - return $this->entityManager->save($operation); + return $operation; } } diff --git a/app/code/Magento/Weee/Test/Mftf/Test/AdminFixedTaxValSavedForSpecificWebsiteTest.xml b/app/code/Magento/Weee/Test/Mftf/Test/AdminFixedTaxValSavedForSpecificWebsiteTest.xml index b542d6a4d0364..3e9635e2a1492 100644 --- a/app/code/Magento/Weee/Test/Mftf/Test/AdminFixedTaxValSavedForSpecificWebsiteTest.xml +++ b/app/code/Magento/Weee/Test/Mftf/Test/AdminFixedTaxValSavedForSpecificWebsiteTest.xml @@ -32,7 +32,7 @@ <createData entity="ApiSimpleProduct" stepKey="createProduct"> <requiredEntity createDataKey="createCategory"/> </createData> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <!-- Create website, store and store view --> <comment userInput="Create website, store and store view" stepKey="createWebsite"/> <actionGroup ref="AdminCreateWebsiteActionGroup" stepKey="createSecondWebsite"> diff --git a/app/code/Magento/Weee/Test/Mftf/Test/AdminRemoveProductWeeeAttributeOptionTest.xml b/app/code/Magento/Weee/Test/Mftf/Test/AdminRemoveProductWeeeAttributeOptionTest.xml index d3f39e9aee664..60c39dd5058b5 100644 --- a/app/code/Magento/Weee/Test/Mftf/Test/AdminRemoveProductWeeeAttributeOptionTest.xml +++ b/app/code/Magento/Weee/Test/Mftf/Test/AdminRemoveProductWeeeAttributeOptionTest.xml @@ -23,7 +23,7 @@ <requiredEntity createDataKey="createProductFPTAttribute"/> </createData> <createData entity="SimpleProduct2" stepKey="createSimpleProduct"/> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <actionGroup ref="SearchForProductOnBackendActionGroup" stepKey="searchForSimpleProductInitial"> <argument name="product" value="$$createSimpleProduct$$"/> </actionGroup> diff --git a/app/code/Magento/Weee/Test/Mftf/Test/StorefrontFPTTaxInformationInShoppingCartForCustomerPhysicalQuoteTest.xml b/app/code/Magento/Weee/Test/Mftf/Test/StorefrontFPTTaxInformationInShoppingCartForCustomerPhysicalQuoteTest.xml index c35a6309f1f3d..74d6c2a97b089 100644 --- a/app/code/Magento/Weee/Test/Mftf/Test/StorefrontFPTTaxInformationInShoppingCartForCustomerPhysicalQuoteTest.xml +++ b/app/code/Magento/Weee/Test/Mftf/Test/StorefrontFPTTaxInformationInShoppingCartForCustomerPhysicalQuoteTest.xml @@ -41,7 +41,7 @@ </createData> <!-- Customer is created with default addresses: --> <createData entity="Simple_US_Customer_CA" stepKey="createCustomer"/> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <actionGroup ref="AdminProductPageOpenByIdActionGroup" stepKey="openProductEditPage"> <argument name="productId" value="$createSimpleProduct.id$"/> </actionGroup> diff --git a/app/code/Magento/Weee/Test/Mftf/Test/StorefrontFPTTaxInformationInShoppingCartForCustomerVirtualQuoteTest.xml b/app/code/Magento/Weee/Test/Mftf/Test/StorefrontFPTTaxInformationInShoppingCartForCustomerVirtualQuoteTest.xml index 92936c2ed77c5..dda125835110a 100644 --- a/app/code/Magento/Weee/Test/Mftf/Test/StorefrontFPTTaxInformationInShoppingCartForCustomerVirtualQuoteTest.xml +++ b/app/code/Magento/Weee/Test/Mftf/Test/StorefrontFPTTaxInformationInShoppingCartForCustomerVirtualQuoteTest.xml @@ -40,7 +40,7 @@ <!-- Customer is created with default addresses: --> <createData entity="Simple_US_Customer_NY" stepKey="createCustomer"/> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <magentoCron groups="index" stepKey="reindexBrokenIndices"/> </before> diff --git a/app/code/Magento/Weee/Test/Mftf/Test/StorefrontFPTTaxInformationInShoppingCartForGuestPhysicalQuoteTest.xml b/app/code/Magento/Weee/Test/Mftf/Test/StorefrontFPTTaxInformationInShoppingCartForGuestPhysicalQuoteTest.xml index d2246f07dd7cb..92f526c79e926 100644 --- a/app/code/Magento/Weee/Test/Mftf/Test/StorefrontFPTTaxInformationInShoppingCartForGuestPhysicalQuoteTest.xml +++ b/app/code/Magento/Weee/Test/Mftf/Test/StorefrontFPTTaxInformationInShoppingCartForGuestPhysicalQuoteTest.xml @@ -39,7 +39,7 @@ <createData entity="SimpleProduct2" stepKey="createSimpleProduct"> <field key="price">10.00</field> </createData> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <actionGroup ref="AdminProductPageOpenByIdActionGroup" stepKey="openProductEditPage"> <argument name="productId" value="$createSimpleProduct.id$"/> </actionGroup> diff --git a/app/code/Magento/Weee/Test/Mftf/Test/StorefrontFPTTaxInformationInShoppingCartForGuestVirtualQuoteTest.xml b/app/code/Magento/Weee/Test/Mftf/Test/StorefrontFPTTaxInformationInShoppingCartForGuestVirtualQuoteTest.xml index 82685910bc717..495b9a990a465 100644 --- a/app/code/Magento/Weee/Test/Mftf/Test/StorefrontFPTTaxInformationInShoppingCartForGuestVirtualQuoteTest.xml +++ b/app/code/Magento/Weee/Test/Mftf/Test/StorefrontFPTTaxInformationInShoppingCartForGuestVirtualQuoteTest.xml @@ -38,7 +38,7 @@ <field key="price">40.00</field> </createData> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <magentoCron groups="index" stepKey="reindexBrokenIndices"/> </before> diff --git a/app/code/Magento/WeeeGraphQl/Test/Unit/FixedProductTaxTest.php b/app/code/Magento/WeeeGraphQl/Test/Unit/FixedProductTaxTest.php index 9e5812282545a..b289c7d1dac55 100644 --- a/app/code/Magento/WeeeGraphQl/Test/Unit/FixedProductTaxTest.php +++ b/app/code/Magento/WeeeGraphQl/Test/Unit/FixedProductTaxTest.php @@ -58,7 +58,7 @@ protected function setUp() ->getMock(); $this->extensionAttributesMock = $this->getMockBuilder(ContextExtensionInterface::class) - ->setMethods(['getStore']) + ->setMethods(['getStore', 'setStore', 'getIsCustomer', 'setIsCustomer']) ->getMock(); $this->contextMock->method('getExtensionAttributes') diff --git a/app/code/Magento/Widget/Test/Mftf/Test/AdminContentWidgetsMassDeletesTest.xml b/app/code/Magento/Widget/Test/Mftf/Test/AdminContentWidgetsMassDeletesTest.xml index 073cdabf37698..6e83687207341 100644 --- a/app/code/Magento/Widget/Test/Mftf/Test/AdminContentWidgetsMassDeletesTest.xml +++ b/app/code/Magento/Widget/Test/Mftf/Test/AdminContentWidgetsMassDeletesTest.xml @@ -18,10 +18,10 @@ <group value="widget"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="LoginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="LoginAsAdmin"/> </before> <after> - <actionGroup ref="logout" stepKey="logout"/> + <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> </after> <actionGroup ref="AdminNavigateMenuActionGroup" stepKey="navigateToContentWidgetsPageFirst"> <argument name="menuUiId" value="{{AdminMenuContent.dataUiId}}"/> diff --git a/app/code/Magento/Widget/Test/Mftf/Test/AdminContentWidgetsNavigateMenuTest.xml b/app/code/Magento/Widget/Test/Mftf/Test/AdminContentWidgetsNavigateMenuTest.xml index e62383d57fc93..b599feeef76db 100644 --- a/app/code/Magento/Widget/Test/Mftf/Test/AdminContentWidgetsNavigateMenuTest.xml +++ b/app/code/Magento/Widget/Test/Mftf/Test/AdminContentWidgetsNavigateMenuTest.xml @@ -20,7 +20,7 @@ <group value="mtf_migrated"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="LoginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="LoginAsAdmin"/> </before> <after> <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> diff --git a/app/code/Magento/Widget/Test/Mftf/Test/NewProductsListWidgetTest.xml b/app/code/Magento/Widget/Test/Mftf/Test/NewProductsListWidgetTest.xml index 0550c1cc2ca42..04218c76a4b7b 100644 --- a/app/code/Magento/Widget/Test/Mftf/Test/NewProductsListWidgetTest.xml +++ b/app/code/Magento/Widget/Test/Mftf/Test/NewProductsListWidgetTest.xml @@ -22,7 +22,7 @@ </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <actionGroup ref="DisabledWYSIWYGActionGroup" stepKey="disableWYSIWYG"/> </before> diff --git a/app/code/Magento/Widget/Test/Mftf/Test/ProductsListWidgetTest.xml b/app/code/Magento/Widget/Test/Mftf/Test/ProductsListWidgetTest.xml index d7be487382c56..30b4f46c791e8 100644 --- a/app/code/Magento/Widget/Test/Mftf/Test/ProductsListWidgetTest.xml +++ b/app/code/Magento/Widget/Test/Mftf/Test/ProductsListWidgetTest.xml @@ -23,7 +23,7 @@ <createData entity="ApiSimpleProduct" stepKey="createSimpleProduct"> <requiredEntity createDataKey="createCategory"/> </createData> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> </before> <after> <conditionalClick selector="{{CmsPagesPageActionsSection.clearAllButton}}" dependentSelector="{{CmsPagesPageActionsSection.activeFilters}}" stepKey="clickToResetFilter" visible="true"/> diff --git a/app/code/Magento/Wishlist/Test/Mftf/Test/AdminCustomerWishListShareOptionsInputValidationTest.xml b/app/code/Magento/Wishlist/Test/Mftf/Test/AdminCustomerWishListShareOptionsInputValidationTest.xml index 32c16ff7f5a55..aaf7980e46aac 100755 --- a/app/code/Magento/Wishlist/Test/Mftf/Test/AdminCustomerWishListShareOptionsInputValidationTest.xml +++ b/app/code/Magento/Wishlist/Test/Mftf/Test/AdminCustomerWishListShareOptionsInputValidationTest.xml @@ -19,7 +19,7 @@ <testCaseId value="N/a"/> </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin1"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin1"/> </before> <after> <actionGroup ref="setEmailTextLengthLimitActionGroup" stepKey="rollbackEmailTextLengthLimit"> diff --git a/app/code/Magento/Wishlist/Test/Mftf/Test/ConfProdAddToCartWishListWithUnselectedAttrTest.xml b/app/code/Magento/Wishlist/Test/Mftf/Test/ConfProdAddToCartWishListWithUnselectedAttrTest.xml index 4e4d5c1a0696f..fbda4b97f6e5c 100644 --- a/app/code/Magento/Wishlist/Test/Mftf/Test/ConfProdAddToCartWishListWithUnselectedAttrTest.xml +++ b/app/code/Magento/Wishlist/Test/Mftf/Test/ConfProdAddToCartWishListWithUnselectedAttrTest.xml @@ -20,7 +20,7 @@ </annotations> <before> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin1"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin1"/> <createData entity="ApiCategory" stepKey="createCategory"/> <!--Create Configurable product--> <actionGroup ref="CreateConfigurableProductActionGroup" stepKey="createProduct"> diff --git a/app/code/Magento/Wishlist/Test/Mftf/Test/ConfigurableProductChildImageShouldBeShownOnWishListTest.xml b/app/code/Magento/Wishlist/Test/Mftf/Test/ConfigurableProductChildImageShouldBeShownOnWishListTest.xml index 9d6482248df0a..738bbc6bda35c 100644 --- a/app/code/Magento/Wishlist/Test/Mftf/Test/ConfigurableProductChildImageShouldBeShownOnWishListTest.xml +++ b/app/code/Magento/Wishlist/Test/Mftf/Test/ConfigurableProductChildImageShouldBeShownOnWishListTest.xml @@ -21,7 +21,7 @@ <before> <magentoCLI command="config:set checkout/cart/configurable_product_image 0" stepKey="setProductImageSettingUnderCofigurationSalesCheckout"/> <createData entity="ApiCategory" stepKey="createCategory"/> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin1"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin1"/> <actionGroup ref="CreateConfigurableProductActionGroup" stepKey="createProduct"> <argument name="product" value="_defaultProduct"/> diff --git a/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontAddMultipleStoreProductsToWishlistTest.xml b/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontAddMultipleStoreProductsToWishlistTest.xml index 2a84043584dbe..eed4dc8d4767e 100644 --- a/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontAddMultipleStoreProductsToWishlistTest.xml +++ b/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontAddMultipleStoreProductsToWishlistTest.xml @@ -29,7 +29,7 @@ </createData> <createData entity="Simple_US_Customer" stepKey="customer"/> <!-- Create new store view and assign it to non default store --> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin1"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin1"/> <actionGroup ref="CreateCustomStoreViewActionGroup" stepKey="createCustomStoreView"> <argument name="storeGroupName" value="$$storeGroup.group[name]$$"/> </actionGroup> diff --git a/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontDeleteBundleDynamicProductFromWishlistTest.xml b/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontDeleteBundleDynamicProductFromWishlistTest.xml index 6238f0dcbff09..8ba45035e7b70 100644 --- a/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontDeleteBundleDynamicProductFromWishlistTest.xml +++ b/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontDeleteBundleDynamicProductFromWishlistTest.xml @@ -47,7 +47,7 @@ <requiredEntity createDataKey="simpleProduct2"/> </createData> - <actionGroup ref="LoginAsAdmin" stepKey="LoginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="LoginAsAdmin"/> <actionGroup ref="AdminProductPageOpenByIdActionGroup" stepKey="goToProduct"> <argument name="productId" value="$$createBundleProduct.id$$"/> </actionGroup> diff --git a/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontMoveDynamicBundleProductFromShoppingCartToWishlistTest.xml b/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontMoveDynamicBundleProductFromShoppingCartToWishlistTest.xml index e07315e0ee0a4..6932d56b2f56a 100644 --- a/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontMoveDynamicBundleProductFromShoppingCartToWishlistTest.xml +++ b/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontMoveDynamicBundleProductFromShoppingCartToWishlistTest.xml @@ -45,7 +45,7 @@ <requiredEntity createDataKey="createBundleOption1_1"/> <requiredEntity createDataKey="simpleProduct2"/> </createData> - <actionGroup ref="LoginAsAdmin" stepKey="LoginAsAdmin"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="LoginAsAdmin"/> <actionGroup ref="AdminProductPageOpenByIdActionGroup" stepKey="goToProduct"> <argument name="productId" value="$$createBundleProduct.id$$"/> </actionGroup> diff --git a/app/code/Magento/Wishlist/Test/Mftf/Test/WishListWithDisabledProductTest.xml b/app/code/Magento/Wishlist/Test/Mftf/Test/WishListWithDisabledProductTest.xml index 227212cd05ae8..689b76e42e6f1 100644 --- a/app/code/Magento/Wishlist/Test/Mftf/Test/WishListWithDisabledProductTest.xml +++ b/app/code/Magento/Wishlist/Test/Mftf/Test/WishListWithDisabledProductTest.xml @@ -39,7 +39,7 @@ <argument name="productVar" value="$$createProduct$$"/> </actionGroup> <openNewTab stepKey="openNewTab"/> - <actionGroup ref="LoginAsAdmin" stepKey="loginToAdminArea"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginToAdminArea"/> <actionGroup ref="AdminProductPageOpenByIdActionGroup" stepKey="goToProductEditPage"> <argument name="productId" value="$$createProduct.id$$"/> </actionGroup> diff --git a/app/code/Magento/WishlistGraphQl/Test/Unit/CustomerWishlistResolverTest.php b/app/code/Magento/WishlistGraphQl/Test/Unit/CustomerWishlistResolverTest.php index f5baa5183e558..67c38561c7e41 100644 --- a/app/code/Magento/WishlistGraphQl/Test/Unit/CustomerWishlistResolverTest.php +++ b/app/code/Magento/WishlistGraphQl/Test/Unit/CustomerWishlistResolverTest.php @@ -58,7 +58,7 @@ protected function setUp() ->getMock(); $this->extensionAttributesMock = $this->getMockBuilder(ContextExtensionInterface::class) - ->setMethods(['getIsCustomer']) + ->setMethods(['getStore', 'setStore', 'getIsCustomer', 'setIsCustomer']) ->getMock(); $this->contextMock->method('getExtensionAttributes') diff --git a/app/design/adminhtml/Magento/backend/Magento_Signifyd/web/css/source/_module.less b/app/design/adminhtml/Magento/backend/Magento_Signifyd/web/css/source/_module.less deleted file mode 100644 index 3f0875da552a3..0000000000000 --- a/app/design/adminhtml/Magento/backend/Magento_Signifyd/web/css/source/_module.less +++ /dev/null @@ -1,7 +0,0 @@ -// /** -// * Copyright © Magento, Inc. All rights reserved. -// * See COPYING.txt for license details. -// */ - -@import 'module/_order.less'; -@import 'module/_config.less'; diff --git a/app/design/adminhtml/Magento/backend/Magento_Signifyd/web/css/source/module/_config.less b/app/design/adminhtml/Magento/backend/Magento_Signifyd/web/css/source/module/_config.less deleted file mode 100644 index b66c9c753aa83..0000000000000 --- a/app/design/adminhtml/Magento/backend/Magento_Signifyd/web/css/source/module/_config.less +++ /dev/null @@ -1,25 +0,0 @@ -// /** -// * Copyright © Magento, Inc. All rights reserved. -// * See COPYING.txt for license details. -// */ - -@image-signifyd-logo-path: '../Magento_Signifyd/images/logo.png'; - -// -// Outer slider of configuration -// -.signifyd-logo-header { - > .entry-edit-head { - > a:after { - content: url(@image-signifyd-logo-path); - } - } - - ul { - margin-left: 5em; - } - - .webhook-url { - word-break: break-all; - } -} diff --git a/app/design/adminhtml/Magento/backend/Magento_Signifyd/web/css/source/module/_order.less b/app/design/adminhtml/Magento/backend/Magento_Signifyd/web/css/source/module/_order.less deleted file mode 100644 index d0ae877b3f18c..0000000000000 --- a/app/design/adminhtml/Magento/backend/Magento_Signifyd/web/css/source/module/_order.less +++ /dev/null @@ -1,23 +0,0 @@ -// /** -// * Copyright © Magento, Inc. All rights reserved. -// * See COPYING.txt for license details. -// */ - -// -// Order Case Info -// --------------------------------------------- - -.order-case-table { - &:extend(.abs-order-tables all); - &:extend(.abs-order-tbody-border all); -} - -// -// Layout -// --------------------------------------------- -.media-width(@extremum, @break) when (@extremum = 'min') and (@break = @screen__m) { - .case-information { - float: left; - #mix-grid .width(6,12); - } -} diff --git a/app/design/adminhtml/Magento/backend/Magento_Ui/web/css/source/module/_masonry-grid.less b/app/design/adminhtml/Magento/backend/Magento_Ui/web/css/source/module/_masonry-grid.less index 9dd42246dac3f..237395db8cb43 100644 --- a/app/design/adminhtml/Magento/backend/Magento_Ui/web/css/source/module/_masonry-grid.less +++ b/app/design/adminhtml/Magento/backend/Magento_Ui/web/css/source/module/_masonry-grid.less @@ -114,5 +114,16 @@ } } } + + &-sortby { + select { + background-image: url(../images/arrows-bg.svg); + border: none; + padding-right: 3.2rem; + &:active { + background-image+: url('../images/arrows-bg.svg'); + } + } + } } } diff --git a/app/design/frontend/Magento/blank/Magento_Checkout/web/css/source/module/_minicart.less b/app/design/frontend/Magento/blank/Magento_Checkout/web/css/source/module/_minicart.less index c9b1d41857eee..9ed7e3a1ba839 100644 --- a/app/design/frontend/Magento/blank/Magento_Checkout/web/css/source/module/_minicart.less +++ b/app/design/frontend/Magento/blank/Magento_Checkout/web/css/source/module/_minicart.less @@ -135,7 +135,7 @@ .product { .actions { float: right; - margin: -24px 0 0; + margin: -28px 0 0; text-align: right; > .primary, diff --git a/app/design/frontend/Magento/luma/Magento_Checkout/web/css/source/module/_minicart.less b/app/design/frontend/Magento/luma/Magento_Checkout/web/css/source/module/_minicart.less index 14c754623cf03..a97cc041b1c42 100644 --- a/app/design/frontend/Magento/luma/Magento_Checkout/web/css/source/module/_minicart.less +++ b/app/design/frontend/Magento/luma/Magento_Checkout/web/css/source/module/_minicart.less @@ -145,7 +145,7 @@ .product { .actions { float: right; - margin: -24px 0 0; + margin: -28px 0 0; > .primary, > .secondary { diff --git a/composer.json b/composer.json index fbd5b0ea3bbea..769885ef305bf 100644 --- a/composer.json +++ b/composer.json @@ -242,7 +242,6 @@ "magento/module-send-friend": "*", "magento/module-send-friend-graph-ql": "*", "magento/module-shipping": "*", - "magento/module-signifyd": "*", "magento/module-sitemap": "*", "magento/module-store": "*", "magento/module-store-graph-ql": "*", diff --git a/composer.lock b/composer.lock index d3cdaa36326f6..550de1d904aec 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "3b2c88252ab70b75998cb4e200257796", + "content-hash": "b801d92bd57ad3f2d51d2b264e9c37ac", "packages": [ { "name": "braintree/braintree_php", diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/CategoriesQuery/CategoriesFilterTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/CategoriesQuery/CategoriesFilterTest.php index b30eb24da6a2d..2bea5832126e8 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/CategoriesQuery/CategoriesFilterTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/CategoriesQuery/CategoriesFilterTest.php @@ -188,8 +188,8 @@ public function testQueryChildCategoriesWithProducts() //Check base category products $expectedBaseCategoryProducts = [ ['sku' => 'simple', 'name' => 'Simple Product'], - ['sku' => '12345', 'name' => 'Simple Product Two'], - ['sku' => 'simple-4', 'name' => 'Simple Product Three'] + ['sku' => 'simple-4', 'name' => 'Simple Product Three'], + ['sku' => '12345', 'name' => 'Simple Product Two'] ]; $this->assertCategoryProducts($baseCategory, $expectedBaseCategoryProducts); //Check base category children @@ -204,8 +204,8 @@ public function testQueryChildCategoriesWithProducts() $this->assertEquals('Category 1.1', $firstChildCategory['name']); $this->assertEquals('Category 1.1 description.', $firstChildCategory['description']); $firstChildCategoryExpectedProducts = [ - ['sku' => 'simple', 'name' => 'Simple Product'], ['sku' => '12345', 'name' => 'Simple Product Two'], + ['sku' => 'simple', 'name' => 'Simple Product'] ]; $this->assertCategoryProducts($firstChildCategory, $firstChildCategoryExpectedProducts); $firstChildCategoryChildren = [['name' =>'Category 1.1.1']]; @@ -215,8 +215,8 @@ public function testQueryChildCategoriesWithProducts() $this->assertEquals('Category 1.2', $secondChildCategory['name']); $this->assertEquals('Its a description of Test Category 1.2', $secondChildCategory['description']); $firstChildCategoryExpectedProducts = [ - ['sku' => 'simple', 'name' => 'Simple Product'], - ['sku' => 'simple-4', 'name' => 'Simple Product Three'] + ['sku' => 'simple-4', 'name' => 'Simple Product Three'], + ['sku' => 'simple', 'name' => 'Simple Product'] ]; $this->assertCategoryProducts($secondChildCategory, $firstChildCategoryExpectedProducts); $firstChildCategoryChildren = []; @@ -281,8 +281,8 @@ public function testQueryCategoryWithDisabledChildren() //Check base category products $expectedBaseCategoryProducts = [ ['sku' => 'simple', 'name' => 'Simple Product'], - ['sku' => '12345', 'name' => 'Simple Product Two'], - ['sku' => 'simple-4', 'name' => 'Simple Product Three'] + ['sku' => 'simple-4', 'name' => 'Simple Product Three'], + ['sku' => '12345', 'name' => 'Simple Product Two'] ]; $this->assertCategoryProducts($baseCategory, $expectedBaseCategoryProducts); //Check base category children @@ -297,8 +297,8 @@ public function testQueryCategoryWithDisabledChildren() $this->assertEquals('Its a description of Test Category 1.2', $firstChildCategory['description']); $firstChildCategoryExpectedProducts = [ - ['sku' => 'simple', 'name' => 'Simple Product'], - ['sku' => 'simple-4', 'name' => 'Simple Product Three'] + ['sku' => 'simple-4', 'name' => 'Simple Product Three'], + ['sku' => 'simple', 'name' => 'Simple Product'] ]; $this->assertCategoryProducts($firstChildCategory, $firstChildCategoryExpectedProducts); $firstChildCategoryChildren = []; diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/CategoryListTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/CategoryListTest.php index 4831671dec450..82a606dad7dec 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/CategoryListTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/CategoryListTest.php @@ -187,8 +187,8 @@ public function testQueryChildCategoriesWithProducts() //Check base category products $expectedBaseCategoryProducts = [ ['sku' => 'simple', 'name' => 'Simple Product'], - ['sku' => '12345', 'name' => 'Simple Product Two'], - ['sku' => 'simple-4', 'name' => 'Simple Product Three'] + ['sku' => 'simple-4', 'name' => 'Simple Product Three'], + ['sku' => '12345', 'name' => 'Simple Product Two'] ]; $this->assertCategoryProducts($baseCategory, $expectedBaseCategoryProducts); //Check base category children @@ -203,8 +203,8 @@ public function testQueryChildCategoriesWithProducts() $this->assertEquals('Category 1.1', $firstChildCategory['name']); $this->assertEquals('Category 1.1 description.', $firstChildCategory['description']); $firstChildCategoryExpectedProducts = [ - ['sku' => 'simple', 'name' => 'Simple Product'], ['sku' => '12345', 'name' => 'Simple Product Two'], + ['sku' => 'simple', 'name' => 'Simple Product'], ]; $this->assertCategoryProducts($firstChildCategory, $firstChildCategoryExpectedProducts); $firstChildCategoryChildren = [['name' =>'Category 1.1.1']]; @@ -214,8 +214,8 @@ public function testQueryChildCategoriesWithProducts() $this->assertEquals('Category 1.2', $secondChildCategory['name']); $this->assertEquals('Its a description of Test Category 1.2', $secondChildCategory['description']); $firstChildCategoryExpectedProducts = [ + ['sku' => 'simple-4', 'name' => 'Simple Product Three'], ['sku' => 'simple', 'name' => 'Simple Product'], - ['sku' => 'simple-4', 'name' => 'Simple Product Three'] ]; $this->assertCategoryProducts($secondChildCategory, $firstChildCategoryExpectedProducts); $firstChildCategoryChildren = []; @@ -278,8 +278,8 @@ public function testQueryCategoryWithDisabledChildren() //Check base category products $expectedBaseCategoryProducts = [ ['sku' => 'simple', 'name' => 'Simple Product'], - ['sku' => '12345', 'name' => 'Simple Product Two'], - ['sku' => 'simple-4', 'name' => 'Simple Product Three'] + ['sku' => 'simple-4', 'name' => 'Simple Product Three'], + ['sku' => '12345', 'name' => 'Simple Product Two'] ]; $this->assertCategoryProducts($baseCategory, $expectedBaseCategoryProducts); //Check base category children @@ -294,8 +294,8 @@ public function testQueryCategoryWithDisabledChildren() $this->assertEquals('Its a description of Test Category 1.2', $firstChildCategory['description']); $firstChildCategoryExpectedProducts = [ - ['sku' => 'simple', 'name' => 'Simple Product'], - ['sku' => 'simple-4', 'name' => 'Simple Product Three'] + ['sku' => 'simple-4', 'name' => 'Simple Product Three'], + ['sku' => 'simple', 'name' => 'Simple Product'] ]; $this->assertCategoryProducts($firstChildCategory, $firstChildCategoryExpectedProducts); $firstChildCategoryChildren = []; diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/ProductSearchTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/ProductSearchTest.php index f367e70fa7397..d7f7a3601b7e9 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/ProductSearchTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/ProductSearchTest.php @@ -364,6 +364,8 @@ private function reIndexAndCleanCache() : void $out = ''; // phpcs:ignore Magento2.Security.InsecureFunction exec("php -f {$appDir}/bin/magento indexer:reindex catalog_category_product", $out); + // phpcs:ignore Magento2.Security.InsecureFunction + exec("php -f {$appDir}/bin/magento indexer:reindex catalogsearch_fulltext", $out); CacheCleaner::cleanAll(); } @@ -670,7 +672,7 @@ public function testFilterByCategoryIdAndCustomAttribute() $productRepository = ObjectManager::getInstance()->get(ProductRepositoryInterface::class); $product1 = $productRepository->get('simple'); $product2 = $productRepository->get('simple-4'); - $filteredProducts = [$product1, $product2]; + $filteredProducts = [$product2, $product1]; $productItemsInResponse = array_map(null, $response['products']['items'], $filteredProducts); //phpcs:ignore Generic.CodeAnalysis.ForLoopWithTestFunctionCall for ($itemIndex = 0; $itemIndex < count($filteredProducts); $itemIndex++) { @@ -678,7 +680,8 @@ public function testFilterByCategoryIdAndCustomAttribute() //validate that correct products are returned $this->assertResponseFields( $productItemsInResponse[$itemIndex][0], - [ 'name' => $filteredProducts[$itemIndex]->getName(), + [ + 'name' => $filteredProducts[$itemIndex]->getName(), 'sku' => $filteredProducts[$itemIndex]->getSku() ] ); @@ -1121,6 +1124,7 @@ public function testFilterWithinSpecificPriceRangeSortedByNameDesc() */ public function testSortByPosition() { + $this->reIndexAndCleanCache(); // Get category ID for filtering /** @var Collection $categoryCollection */ $categoryCollection = Bootstrap::getObjectManager()->get(Collection::class); @@ -1141,7 +1145,8 @@ public function testSortByPosition() $resultAsc = $this->graphQlQuery($queryAsc); $this->assertArrayNotHasKey('errors', $resultAsc); $productsAsc = array_column($resultAsc['products']['items'], 'sku'); - $expectedProductsAsc = ['simple1000', 'simple1001', 'simple1002']; + $expectedProductsAsc = ['simple1002', 'simple1001', 'simple1000']; + // position equal and secondary sort by entity_id DESC $this->assertEquals($expectedProductsAsc, $productsAsc); $queryDesc = <<<QUERY @@ -1158,23 +1163,25 @@ public function testSortByPosition() $resultDesc = $this->graphQlQuery($queryDesc); $this->assertArrayNotHasKey('errors', $resultDesc); $productsDesc = array_column($resultDesc['products']['items'], 'sku'); - $expectedProductsDesc = array_reverse($expectedProductsAsc); - $this->assertEquals($expectedProductsDesc, $productsDesc); + // position equal and secondary sort by entity_id DESC + $this->assertEquals($expectedProductsAsc, $productsDesc); //revert position $productPositions = $category->getProductsPosition(); - $count = 3; + $count = 1; foreach ($productPositions as $productId => $position) { $productPositions[$productId] = $count; - $count--; + $count++; } + ksort($productPositions); $category->setPostedProducts($productPositions); $category->save(); + $this->reIndexAndCleanCache(); $queryDesc = <<<QUERY { - products(filter: {category_id: {eq: "$categoryId"}}, sort: {position: DESC}) { + products(filter: {category_id: {eq: "$categoryId"}}, sort: {position: ASC}) { total_count items { sku @@ -1186,8 +1193,8 @@ public function testSortByPosition() $resultDesc = $this->graphQlQuery($queryDesc); $this->assertArrayNotHasKey('errors', $resultDesc); $productsDesc = array_column($resultDesc['products']['items'], 'sku'); - $expectedProductsDesc = $expectedProductsAsc; - $this->assertEquals($expectedProductsDesc, $productsDesc); + // position NOT equal and oldest entity first + $this->assertEquals(array_reverse($expectedProductsAsc), $productsDesc); } /** @@ -1532,6 +1539,7 @@ public function testFilterProductsBySingleCategoryId() $categoryRepository = ObjectManager::getInstance()->get(CategoryRepositoryInterface::class); $links = $productLinks->getAssignedProducts($queryCategoryId); + $links = array_reverse($links); foreach ($response['products']['items'] as $itemIndex => $itemData) { $this->assertNotEmpty($itemData); $this->assertEquals($response['products']['items'][$itemIndex]['sku'], $links[$itemIndex]->getSku()); diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/SetBillingAddressOnCartTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/SetBillingAddressOnCartTest.php index 1af44012bb515..b7376e91f705e 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/SetBillingAddressOnCartTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/SetBillingAddressOnCartTest.php @@ -954,6 +954,88 @@ public function testSetBillingAddressAndPlaceOrder() } } + /** + * @magentoApiDataFixture Magento/Customer/_files/customer.php + * @magentoApiDataFixture Magento/GraphQl/Catalog/_files/simple_product.php + * @magentoApiDataFixture Magento/GraphQl/Quote/_files/customer/create_empty_cart.php + * @magentoApiDataFixture Magento/GraphQl/Quote/_files/add_simple_product.php + */ + public function testSetBillingAddressWithDefaultValueOfSaveInAddressBookAndPlaceOrder() + { + $maskedQuoteId = $this->getMaskedQuoteIdByReservedOrderId->execute('test_quote'); + $query = <<<QUERY +mutation { + setBillingAddressOnCart( + input: { + cart_id: "$maskedQuoteId" + billing_address: { + same_as_shipping: true + address: { + firstname: "test firstname" + lastname: "test lastname" + company: "test company" + street: ["test street 1", "test street 2"] + city: "test city" + region: "AZ" + postcode: "88776" + country_code: "US" + telephone: "88776655" + } + } + } + ) { + cart { + billing_address { + firstname + lastname + company + street + city + postcode + telephone + country { + code + label + } + __typename + } + } + } +} +QUERY; + $response = $this->graphQlMutation($query, [], '', $this->getHeaderMap()); + $this->graphQlMutation( + $this->getSetShippingMethodsQuery($maskedQuoteId, 'flatrate', 'flatrate'), + [], + '', + $this->getHeaderMap() + ); + $this->graphQlMutation( + $this->getSetPaymentMethodQuery( + $maskedQuoteId, + 'checkmo' + ), + [], + '', + $this->getHeaderMap() + ); + $this->graphQlMutation( + $this->getPlaceOrderQuery($maskedQuoteId), + [], + '', + $this->getHeaderMap() + ); + $customer = $this->customerRepository->get('customer@example.com'); + $searchCriteria = $this->searchCriteriaBuilder->addFilter('parent_id', $customer->getId())->create(); + $addresses = $this->customerAddressRepository->getList($searchCriteria)->getItems(); + + $this->assertCount(1, $addresses); + $this->assertArrayHasKey('cart', $response['setBillingAddressOnCart']); + foreach ($addresses as $address) { + $this->customerAddressRepository->delete($address); + } + } + /** * @magentoApiDataFixture Magento/Customer/_files/customer.php * @magentoApiDataFixture Magento/GraphQl/Catalog/_files/simple_product.php @@ -1208,9 +1290,9 @@ private function getSetShippingMethodsQuery( ): string { return <<<QUERY mutation { - setShippingMethodsOnCart(input: + setShippingMethodsOnCart(input: { - cart_id: "$maskedQuoteId", + cart_id: "$maskedQuoteId", shipping_methods: [{ carrier_code: "$shippingCarrierCode" method_code: "$shippingMethodCode" @@ -1251,7 +1333,7 @@ private function getSetPaymentMethodQuery( payment_method: { code: "$methodCode" } - }) { + }) { cart { selected_payment_method { code diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/SetShippingAddressOnCartTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/SetShippingAddressOnCartTest.php index cedbf4bf61d17..9256c1c41b49f 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/SetShippingAddressOnCartTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/SetShippingAddressOnCartTest.php @@ -1046,6 +1046,98 @@ public function testSetNewShippingAddressAndPlaceOrder() } } + /** + * @magentoApiDataFixture Magento/Customer/_files/customer.php + * @magentoApiDataFixture Magento/GraphQl/Catalog/_files/simple_product.php + * @magentoApiDataFixture Magento/GraphQl/Quote/_files/customer/create_empty_cart.php + * @magentoApiDataFixture Magento/GraphQl/Quote/_files/add_simple_product.php + * @magentoApiDataFixture Magento/GraphQl/Quote/_files/set_new_billing_address.php + */ + public function testSetNewShippingAddressWithDefaultValueOfSaveInAddressBookAndPlaceOrder() + { + $maskedQuoteId = $this->getMaskedQuoteIdByReservedOrderId->execute('test_quote'); + $query = <<<QUERY +mutation { + setShippingAddressesOnCart( + input: { + cart_id: "$maskedQuoteId" + shipping_addresses: [ + { + address: { + firstname: "test firstname" + lastname: "test lastname" + company: "test company" + street: ["test street 1", "test street 2"] + city: "test city" + region: "AZ" + postcode: "887766" + country_code: "US" + telephone: "88776655" + } + customer_notes: "Test note" + } + ] + } + ) { + cart { + shipping_addresses { + firstname + lastname + company + street + city + postcode + telephone + country { + code + label + } + __typename + customer_notes + } + } + } +} +QUERY; + $response = $this->graphQlMutation($query, [], '', $this->getHeaderMap()); + $this->graphQlMutation( + $this->getSetShippingMethodsQuery($maskedQuoteId, 'flatrate', 'flatrate'), + [], + '', + $this->getHeaderMap() + ); + $this->graphQlMutation( + $this->getSetPaymentMethodQuery( + $maskedQuoteId, + 'checkmo' + ), + [], + '', + $this->getHeaderMap() + ); + $this->graphQlMutation( + $this->getPlaceOrderQuery($maskedQuoteId), + [], + '', + $this->getHeaderMap() + ); + $customer = $this->customerRepository->get('customer@example.com'); + $searchCriteria = $this->searchCriteriaBuilder->addFilter('parent_id', $customer->getId())->create(); + $addresses = $this->customerAddressRepository->getList($searchCriteria)->getItems(); + + $this->assertCount(1, $addresses); + $this->assertArrayHasKey('cart', $response['setShippingAddressesOnCart']); + + $cartResponse = $response['setShippingAddressesOnCart']['cart']; + $this->assertArrayHasKey('shipping_addresses', $cartResponse); + $shippingAddressResponse = current($cartResponse['shipping_addresses']); + $this->assertNewShippingAddressFields($shippingAddressResponse); + + foreach ($addresses as $address) { + $this->customerAddressRepository->delete($address); + } + } + /** * @magentoApiDataFixture Magento/Customer/_files/customer.php * @magentoApiDataFixture Magento/GraphQl/Catalog/_files/simple_product.php @@ -1201,9 +1293,9 @@ private function getSetShippingMethodsQuery( ): string { return <<<QUERY mutation { - setShippingMethodsOnCart(input: + setShippingMethodsOnCart(input: { - cart_id: "$maskedQuoteId", + cart_id: "$maskedQuoteId", shipping_methods: [{ carrier_code: "$shippingCarrierCode" method_code: "$shippingMethodCode" @@ -1244,7 +1336,7 @@ private function getSetPaymentMethodQuery( payment_method: { code: "$methodCode" } - }) { + }) { cart { selected_payment_method { code diff --git a/dev/tests/functional/credentials.xml.dist b/dev/tests/functional/credentials.xml.dist index 01e3a35be9a2d..89ea0f23ef30e 100644 --- a/dev/tests/functional/credentials.xml.dist +++ b/dev/tests/functional/credentials.xml.dist @@ -79,6 +79,4 @@ <field path="payment/paypal_alternative_payment_methods/express_checkout_us/express_checkout_required/express_checkout_required_express_checkout/api_username" value="" /> <field path="payment/paypal_alternative_payment_methods/express_checkout_us/express_checkout_required/express_checkout_required_express_checkout/api_password" value="" /> <field path="payment/paypal_alternative_payment_methods/express_checkout_us/express_checkout_required/express_checkout_required_express_checkout/api_signature" value="" /> - - <field path="fraud_protection/signifyd/api_key" value="" /> </replace> diff --git a/dev/tests/functional/etc/repository_replacer_payments.xml b/dev/tests/functional/etc/repository_replacer_payments.xml index a0ecca61eb372..2b20e7220f537 100644 --- a/dev/tests/functional/etc/repository_replacer_payments.xml +++ b/dev/tests/functional/etc/repository_replacer_payments.xml @@ -21,11 +21,4 @@ <field name="password" xsi:type="string">AUTHORIZENET_PASSWORD</field> </dataset> </repository> - - <repository class="Magento\Signifyd\Test\Repository\SignifydAccount"> - <dataset name="sandbox_default"> - <field name="email" xsi:type="string">SIGNIFYD_EMAIL</field> - <field name="password" xsi:type="string">SIGNIFYD_PASSWORD</field> - </dataset> - </repository> </config> diff --git a/dev/tests/functional/tests/app/Magento/CheckoutAgreements/Test/TestCase/DeleteTermEntityTest.xml b/dev/tests/functional/tests/app/Magento/CheckoutAgreements/Test/TestCase/DeleteTermEntityTest.xml index e16d5881e2ee4..b8298ffcee3c9 100644 --- a/dev/tests/functional/tests/app/Magento/CheckoutAgreements/Test/TestCase/DeleteTermEntityTest.xml +++ b/dev/tests/functional/tests/app/Magento/CheckoutAgreements/Test/TestCase/DeleteTermEntityTest.xml @@ -8,7 +8,7 @@ <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/etc/variations.xsd"> <testCase name="Magento\CheckoutAgreements\Test\TestCase\DeleteTermEntityTest" summary="Delete Terms And Conditions" ticketId="MAGETWO-29687"> <variation name="DeleteTermEntityTestVariation1"> - <data name="tag" xsi:type="string">severity:S3</data> + <data name="tag" xsi:type="string">severity:S3, mftf_migrated:yes</data> <data name="configData" xsi:type="string">checkout_term_condition</data> <data name="products/0" xsi:type="string">catalogProductSimple::default</data> <data name="agreement/dataset" xsi:type="string">term_enabled_text</data> diff --git a/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/CreateCmsBlockEntityTest.xml b/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/CreateCmsBlockEntityTest.xml index 5f537baf9c979..bd9db3f34bdd7 100644 --- a/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/CreateCmsBlockEntityTest.xml +++ b/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/CreateCmsBlockEntityTest.xml @@ -8,7 +8,7 @@ <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/etc/variations.xsd"> <testCase name="Magento\Cms\Test\TestCase\CreateCmsBlockEntityTest" summary="Create CMS Block" ticketId="MAGETWO-25578"> <variation name="CreateCmsBlockEntityTestVariation1"> - <data name="tag" xsi:type="string">test_type:extended_acceptance_test, severity:S1</data> + <data name="tag" xsi:type="string">test_type:extended_acceptance_test, severity:S1, mftf_migrated:yes</data> <data name="cmsBlock/data/title" xsi:type="string">block_%isolation%</data> <data name="cmsBlock/data/identifier" xsi:type="string">identifier_%isolation%</data> <data name="cmsBlock/data/stores/dataset/option_0" xsi:type="string">All Store Views</data> @@ -19,7 +19,7 @@ <constraint name="Magento\Cms\Test\Constraint\AssertCmsBlockOnCategoryPage" /> </variation> <variation name="CreateCmsBlockEntityTestVariation2"> - <data name="tag" xsi:type="string">severity:S2</data> + <data name="tag" xsi:type="string">severity:S2, mftf_migrated:yes</data> <data name="cmsBlock/data/title" xsi:type="string">block_%isolation%</data> <data name="cmsBlock/data/identifier" xsi:type="string">identifier_%isolation%</data> <data name="cmsBlock/data/stores/dataset/option_0" xsi:type="string">default</data> diff --git a/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/UpdateCmsPageEntityTest.xml b/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/UpdateCmsPageEntityTest.xml index 4bee113add071..61ca945adcad9 100644 --- a/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/UpdateCmsPageEntityTest.xml +++ b/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/UpdateCmsPageEntityTest.xml @@ -8,7 +8,7 @@ <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/etc/variations.xsd"> <testCase name="Magento\Cms\Test\TestCase\UpdateCmsPageEntityTest" summary="Update Cms Page" ticketId="MAGETWO-25186"> <variation name="UpdateCmsPageEntityTestVariation1"> - <data name="tag" xsi:type="string">severity:S3</data> + <data name="tag" xsi:type="string">severity:S3, mftf_migrated:yes</data> <data name="cms/data/title" xsi:type="string">CmsPageEdited%isolation%</data> <data name="cms/data/is_active" xsi:type="string">No</data> <data name="cms/data/content/content" xsi:type="string">cms_page_text_content_after_edit</data> @@ -16,7 +16,7 @@ <constraint name="Magento\Cms\Test\Constraint\AssertCmsPageDisabledOnFrontend" /> </variation> <variation name="UpdateCmsPageEntityTestVariation2"> - <data name="tag" xsi:type="string">severity:S1</data> + <data name="tag" xsi:type="string">severity:S1, mftf_migrated:yes</data> <data name="cms/data/title" xsi:type="string">CmsPageEdited%isolation%</data> <data name="cms/data/identifier" xsi:type="string">cms_page_url_edited_%isolation%</data> <data name="cms/data/content_heading" xsi:type="string">Content Heading TextEdited</data> diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/DeleteSystemCustomerGroupTest.xml b/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/DeleteSystemCustomerGroupTest.xml index c8cf44a674b28..822cbcfbcb7ee 100644 --- a/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/DeleteSystemCustomerGroupTest.xml +++ b/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/DeleteSystemCustomerGroupTest.xml @@ -10,10 +10,12 @@ <variation name="DeleteSystemCustomerGroup1" summary="Checks that NOT LOGGED IN Customer Group cannot be deleted"> <data name="customerGroup/dataset" xsi:type="string">NOT_LOGGED_IN</data> <constraint name="Magento\Customer\Test\Constraint\AssertNoDeleteForSystemCustomerGroup" /> + <data name="tag" xsi:type="string">mftf_migrated:yes</data> </variation> <variation name="DeleteSystemCustomerGroup2" summary="Checks that General Customer Group cannot be deleted"> <data name="customerGroup/dataset" xsi:type="string">General</data> <constraint name="Magento\Customer\Test\Constraint\AssertNoDeleteForSystemCustomerGroup" /> + <data name="tag" xsi:type="string">mftf_migrated:yes</data> </variation> </testCase> </config> diff --git a/dev/tests/functional/tests/app/Magento/Security/Test/TestCase/SecureChangingCustomerEmailTest.xml b/dev/tests/functional/tests/app/Magento/Security/Test/TestCase/SecureChangingCustomerEmailTest.xml index bd8a417d48bf3..8c7f35add2a8d 100644 --- a/dev/tests/functional/tests/app/Magento/Security/Test/TestCase/SecureChangingCustomerEmailTest.xml +++ b/dev/tests/functional/tests/app/Magento/Security/Test/TestCase/SecureChangingCustomerEmailTest.xml @@ -8,7 +8,7 @@ <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/etc/variations.xsd"> <testCase name="Magento\Security\Test\TestCase\SecureChangingCustomerEmailTest" summary="Secure Changing Customer Email" ticketId="MAGETWO-49041"> <variation name="SecureChangingEmailV1" summary="Change Email checkbox is checked, enter new email, correct password"> - <data name="tag" xsi:type="string">severity:S1</data> + <data name="tag" xsi:type="string">severity:S1, mftf_migrated:yes</data> <data name="initialCustomer/dataset" xsi:type="string">default</data> <data name="customer/data/email" xsi:type="string">JaneDoe_%isolation%@example.com</data> <data name="customer/data/current_password" xsi:type="string">123123^q</data> @@ -16,7 +16,7 @@ <constraint name="Magento\Security\Test\Constraint\AssertCustomerEmailChanged" /> </variation> <variation name="SecureChangingEmailV2" summary="Change Email checkbox is checked, enter new email, wrong password"> - <data name="tag" xsi:type="string">severity:S2</data> + <data name="tag" xsi:type="string">severity:S2, mftf_migrated:yes</data> <data name="initialCustomer/dataset" xsi:type="string">default</data> <data name="customer/data/email" xsi:type="string">JaneDoe_%isolation%@example.com</data> <data name="customer/data/current_password" xsi:type="string">123123123</data> diff --git a/dev/tests/functional/tests/app/Magento/Security/Test/TestCase/SecureChangingCustomerPasswordTest.xml b/dev/tests/functional/tests/app/Magento/Security/Test/TestCase/SecureChangingCustomerPasswordTest.xml index da5e312cf0bc9..1c5807401ca7b 100644 --- a/dev/tests/functional/tests/app/Magento/Security/Test/TestCase/SecureChangingCustomerPasswordTest.xml +++ b/dev/tests/functional/tests/app/Magento/Security/Test/TestCase/SecureChangingCustomerPasswordTest.xml @@ -8,7 +8,7 @@ <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/etc/variations.xsd"> <testCase name="Magento\Security\Test\TestCase\SecureChangingCustomerPasswordTest" summary="Secure Changing Customer Password" ticketId="MAGETWO-49043"> <variation name="SecureChangingPasswordV1" summary="Change Password checkbox is checked, enter correct password"> - <data name="tag" xsi:type="string">severity:S1</data> + <data name="tag" xsi:type="string">severity:S1, mftf_migrated:yes</data> <data name="initialCustomer/dataset" xsi:type="string">default</data> <data name="customer/data/current_password" xsi:type="string">123123^q</data> <data name="customer/data/password" xsi:type="string">123123Qa</data> @@ -18,7 +18,7 @@ <constraint name="Magento\Customer\Test\Constraint\AssertCustomerPasswordChanged" /> </variation> <variation name="SecureChangingPasswordV2" summary="Change Password checkbox is checked, enter wrong password"> - <data name="tag" xsi:type="string">severity:S2</data> + <data name="tag" xsi:type="string">severity:S2, mftf_migrated:yes</data> <data name="initialCustomer/dataset" xsi:type="string">default</data> <data name="customer/data/current_password" xsi:type="string">123123123</data> <data name="customer/data/password" xsi:type="string">123123Qa</data> @@ -27,7 +27,7 @@ <constraint name="Magento\Customer\Test\Constraint\AssertChangePasswordFailMessage" /> </variation> <variation name="SecureChangingPasswordV3" summary="Change Password checkbox is unchecked"> - <data name="tag" xsi:type="string">severity:S3</data> + <data name="tag" xsi:type="string">severity:S3, mftf_migrated:yes</data> <data name="initialCustomer/dataset" xsi:type="string">default</data> <data name="check" xsi:type="string">0</data> <constraint name="Magento\Security\Test\Constraint\AssertDefaultAccountInformation" /> diff --git a/dev/tests/functional/tests/app/Magento/Signifyd/Test/Block/Adminhtml/Order/Grid.php b/dev/tests/functional/tests/app/Magento/Signifyd/Test/Block/Adminhtml/Order/Grid.php deleted file mode 100644 index 54f580f48dcf4..0000000000000 --- a/dev/tests/functional/tests/app/Magento/Signifyd/Test/Block/Adminhtml/Order/Grid.php +++ /dev/null @@ -1,33 +0,0 @@ -<?php -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ -namespace Magento\Signifyd\Test\Block\Adminhtml\Order; - -use Magento\Ui\Test\Block\Adminhtml\DataGrid; - -/** - * Admin Data Grid for managing "Sales Order" entities. - */ -class Grid extends DataGrid -{ - /** - * Filters array mapping. - * - * @var array - */ - protected $filters = [ - 'id' => [ - 'selector' => '[name="increment_id"]', - ], - 'status' => [ - 'selector' => '[name="status"]', - 'input' => 'select', - ], - 'signifyd_guarantee_status' => [ - 'selector' => '[name="signifyd_guarantee_status"]', - 'input' => 'select' - ] - ]; -} diff --git a/dev/tests/functional/tests/app/Magento/Signifyd/Test/Block/Adminhtml/Order/View/FraudProtection.php b/dev/tests/functional/tests/app/Magento/Signifyd/Test/Block/Adminhtml/Order/View/FraudProtection.php deleted file mode 100644 index e2b4e6f748977..0000000000000 --- a/dev/tests/functional/tests/app/Magento/Signifyd/Test/Block/Adminhtml/Order/View/FraudProtection.php +++ /dev/null @@ -1,31 +0,0 @@ -<?php -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ -namespace Magento\Signifyd\Test\Block\Adminhtml\Order\View; - -use Magento\Mtf\Block\Block; - -/** - * Information about fraud protection on order page. - */ -class FraudProtection extends Block -{ - /** - * Case Guarantee Disposition. - * - * @var string - */ - private $caseGuaranteeDisposition = 'td.col-guarantee-disposition'; - - /** - * Get Case Guarantee Disposition status. - * - * @return string - */ - public function getCaseGuaranteeDisposition() - { - return $this->_rootElement->find($this->caseGuaranteeDisposition)->getText(); - } -} diff --git a/dev/tests/functional/tests/app/Magento/Signifyd/Test/Block/SignifydConsole/CaseInfo.php b/dev/tests/functional/tests/app/Magento/Signifyd/Test/Block/SignifydConsole/CaseInfo.php deleted file mode 100644 index 1529755fdc3c9..0000000000000 --- a/dev/tests/functional/tests/app/Magento/Signifyd/Test/Block/SignifydConsole/CaseInfo.php +++ /dev/null @@ -1,245 +0,0 @@ -<?php -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ -namespace Magento\Signifyd\Test\Block\SignifydConsole; - -use Magento\Mtf\Block\Block; - -/** - * Case information block. - */ -class CaseInfo extends Block -{ - /** - * Css selector of "Flag Case As Good" button. - * - * @var string - */ - private $flagCaseAsGoodButton = '[class*="flag-case-good"]'; - - /** - * Css selector of "Flag Case As Bad" button. - * - * @var string - */ - private $flagCaseAsBadButton = '[class*="flag-case-bad"]'; - - /** - * Css selector of guarantee status. - * - * @var string - */ - private $guaranteeDisposition = '[class*="guarantee-status"]'; - - /** - * Css selector of CVV response description. - * - * @var string - */ - private $cvvResponseDescription = '[ng-bind="caseOrderSummary.cvvResponseDescription"]'; - - /** - * Css selector of CVV response code. - * - * @var string - */ - private $cvvResponseCode = '[ng-bind="caseOrderSummary.cvvResponseCode"]'; - - /** - * Css selector of AVS response description. - * - * @var string - */ - private $avsResponseDescription = '[ng-bind="caseOrderSummary.avsResponseDescription"]'; - - /** - * Css selector of AVS response code. - * - * @var string - */ - private $avsResponseCode = '[ng-bind="caseOrderSummary.avsResponseCode"]'; - - /** - * Css selector of displayed case order id. - * - * @var string - */ - private $orderId = '[ng-bind="currentCase.caseIdDisplay"]'; - - /** - * Css selector of displayed order amount. - * - * @var string - */ - private $orderAmount = '[ng-bind*="currentCase.orderTotalAmount"]'; - - /** - * Locator value for order amount currency. - * - * @var string - */ - private $orderAmountCurrency = '[ng-bind*="currentCase.currency"]'; - - /** - * Css selector of displayed card holder name. - * - * @var string - */ - private $cardHolder = '[data-dropdown="peopleLinks0_card_holders"]'; - - /** - * Css selector of displayed billing address. - * - * @var string - */ - private $billingAddress = '[data-dropdown="streetLinks0"]'; - - /** - * Locator value for "No analysis available" block in "Device" container. - * - * @var string - */ - private $noDeviceAnalysisAvailable = '[ng-hide^="caseAnalysis.deviceAnalysis.details.length"]'; - - /** - * Locator value for "Shipping Price" block. - * - * @var string - */ - private $shippingPrice = '[ng-if="shipment.shippingPrice"]'; - - /** - * Check if device data are present. - * - * @return bool - */ - public function isAvailableDeviceData() - { - return !$this->_rootElement->find($this->noDeviceAnalysisAvailable)->isVisible(); - } - - /** - * Returns shipping price. - * - * @return string - */ - public function getShippingPrice() - { - return $this->_rootElement->find($this->shippingPrice)->getText(); - } - - /** - * Flags case as good or bad. - * - * @param string $flagType - * @return void - */ - public function flagCase($flagType) - { - $flagSelector = ($flagType === 'Good') - ? $this->flagCaseAsGoodButton - : $this->flagCaseAsBadButton; - - $this->_rootElement->find($flagSelector)->click(); - } - - /** - * Flags case as bad. - * - * @return void - */ - public function flagCaseAsBad() - { - $this->_rootElement->find($this->flagCaseAsBadButton)->click(); - } - - /** - * Gets guarantee disposition. - * - * @return string - */ - public function getGuaranteeDisposition() - { - return $this->_rootElement->find($this->guaranteeDisposition)->getText(); - } - - /** - * Gets CVV response. - * - * @return string - */ - public function getCvvResponse() - { - return sprintf( - '%s (%s)', - $this->_rootElement->find($this->cvvResponseDescription)->getText(), - $this->_rootElement->find($this->cvvResponseCode)->getText() - ); - } - - /** - * Gets AVS response. - * - * @return string - */ - public function getAvsResponse() - { - return sprintf( - '%s (%s)', - $this->_rootElement->find($this->avsResponseDescription)->getText(), - $this->_rootElement->find($this->avsResponseCode)->getText() - ); - } - - /** - * Gets displayed order id. - * - * @return string - */ - public function getOrderId() - { - return $this->_rootElement->find($this->orderId)->getText(); - } - - /** - * Gets displayed order amount. - * - * @return string - */ - public function getOrderAmount() - { - return $this->_rootElement->find($this->orderAmount)->getText(); - } - - /** - * Returns displayed order amount currency. - * - * @return string - */ - public function getOrderAmountCurrency() - { - return $this->_rootElement->find($this->orderAmountCurrency)->getText(); - } - - /** - * Gets displayed card holder name. - * - * @return string - */ - public function getCardHolder() - { - return $this->_rootElement->find($this->cardHolder)->getText(); - } - - /** - * Gets displayed billing address. - * - * @return string - */ - public function getBillingAddress() - { - return $this->_rootElement->find($this->billingAddress)->getText(); - } -} diff --git a/dev/tests/functional/tests/app/Magento/Signifyd/Test/Block/SignifydConsole/CaseSearch.php b/dev/tests/functional/tests/app/Magento/Signifyd/Test/Block/SignifydConsole/CaseSearch.php deleted file mode 100644 index 16621f9a0cd48..0000000000000 --- a/dev/tests/functional/tests/app/Magento/Signifyd/Test/Block/SignifydConsole/CaseSearch.php +++ /dev/null @@ -1,119 +0,0 @@ -<?php -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ -namespace Magento\Signifyd\Test\Block\SignifydConsole; - -use Magento\Mtf\Block\Form; - -/** - * Side block with case search and cases list. - */ -class CaseSearch extends Form -{ - /** - * Css selector of search input. - * - * @var string - */ - private $searchBar = '[id=queueSearchBar]'; - - /** - * Css selector of search submit button. - * - * @var string - */ - private $submitButton = '[type=submit]'; - - /** - * Css selector of searched element in cases list. - * - * @var string - */ - private $selectCaseLink = 'ul[case-list=cases] li[case-list-case=case] a'; - - /** - * Locator for resolving applied filters list. - * - * @var string - */ - private $appliedFilters = '.app-taglist > ul > li > a'; - - /** - * Locator for loading spinner. - * - * @var string - */ - private $spinner = '.cases-loading-spinner'; - - /** - * Fill search input with customer name and submit. - * - * @param string $customerName - * @return void - */ - public function searchCaseByCustomerName($customerName) - { - $this->resetFilters(); - $this->_rootElement->find($this->searchBar)->setValue($customerName); - $this->_rootElement->find($this->submitButton)->click(); - $this->waitLoadingSpinner(); - } - - /** - * Reset applied filters. - * - * @return void - */ - private function resetFilters(): void - { - $filters = $this->_rootElement->getElements($this->appliedFilters); - if (!empty($filters)) { - foreach ($filters as $filter) { - $filter->click(); - $this->waitLoadingSpinner(); - } - } - } - - /** - * Wait until loading spinner disappeared. - * - * @return void - */ - private function waitLoadingSpinner(): void - { - $this->waitForElementNotVisible($this->spinner); - } - - /** - * Checks if any case is visible. - * - * @return bool - */ - public function isAnyCaseVisible(): bool - { - return $this->_rootElement->find($this->selectCaseLink)->isVisible(); - } - - /** - * Select searched case. - * - * @return void - */ - public function selectCase() - { - $this->_rootElement->find($this->selectCaseLink)->click(); - } - - /** - * Waiting of case page loading. - * - * @return void - */ - public function waitForLoading() - { - $this->waitForElementVisible($this->searchBar); - } -} diff --git a/dev/tests/functional/tests/app/Magento/Signifyd/Test/Block/SignifydConsole/SignifydLogin.php b/dev/tests/functional/tests/app/Magento/Signifyd/Test/Block/SignifydConsole/SignifydLogin.php deleted file mode 100644 index 7705a67360e55..0000000000000 --- a/dev/tests/functional/tests/app/Magento/Signifyd/Test/Block/SignifydConsole/SignifydLogin.php +++ /dev/null @@ -1,64 +0,0 @@ -<?php -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ -namespace Magento\Signifyd\Test\Block\SignifydConsole; - -use Magento\Mtf\Block\Form; -use Magento\Mtf\Client\Element\SimpleElement; -use Magento\Mtf\Fixture\FixtureInterface; - -/** - * Signifyd login block. - */ -class SignifydLogin extends Form -{ - /** - * Css selector of Signifyd login button. - * - * @var string - */ - private $loginButton = '[type=submit]'; - - /** - * Locator for admin form notification window. - * - * @var string - */ - private $notificationCloseButton = '.wm-close-button'; - - /** - * @inheritdoc - */ - public function fill(FixtureInterface $fixture, SimpleElement $element = null) - { - $this->closeNotification(); - - return parent::fill($fixture, $element); - } - - /** - * Login to Signifyd. - * - * @return void - */ - public function login() - { - $this->closeNotification(); - $this->_rootElement->find($this->loginButton)->click(); - } - - /** - * Close notification popup. - * - * @return void - */ - private function closeNotification(): void - { - $notification = $this->browser->find($this->notificationCloseButton); - if ($notification->isVisible()) { - $notification->click(); - } - } -} diff --git a/dev/tests/functional/tests/app/Magento/Signifyd/Test/Block/SignifydConsole/Webhooks.php b/dev/tests/functional/tests/app/Magento/Signifyd/Test/Block/SignifydConsole/Webhooks.php deleted file mode 100644 index 424d5681c07c6..0000000000000 --- a/dev/tests/functional/tests/app/Magento/Signifyd/Test/Block/SignifydConsole/Webhooks.php +++ /dev/null @@ -1,216 +0,0 @@ -<?php -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ -namespace Magento\Signifyd\Test\Block\SignifydConsole; - -use Magento\Mtf\Block\Block; -use Magento\Mtf\Client\ElementInterface; -use Magento\Mtf\Client\Locator; - -/** - * Signifyd webhook addition block. - */ -class Webhooks extends Block -{ - /** - * Map of webhook event select option values on names of events in webhook grid. - * - * @var array - */ - private $webhookEventOptionsMap = [ - 'CASE_CREATION' => 'Case Creation', - 'CASE_REVIEW' => 'Case Review', - 'GUARANTEE_COMPLETION' => 'Guarantee Completion' - ]; - - /** - * XPath selector of webhook element added into grid. - * - * @var string - */ - private $webhookAddedElement = '//table[@id="webhooks"]//tr[./td/span/text()="%s" and ./td/span/text()="%s"]'; - - /** - * Css selector of webhook url input. - * - * @var string - */ - private $webhookUrl = '[id="webhookUrl"]'; - - /** - * XPath selector of test team select option. - * - * @var string - */ - private $webhookTeamOption = './/select[@id="webhookTeams"]//option[text()="%s"]'; - - /** - * Css selector of webhook event select option. - * - * @var string - */ - private $webhookEventOption = 'select[id="webhookEvent"] option[value="%s"]'; - - /** - * Css selector of webhook addition button. - * - * @var string - */ - private $webhookAddButton = '[id="addWebhook"] [type=submit]'; - - /** - * Css selector of delete button in element of webhook grid. - * - * @var string - */ - private $webhookDeleteButton = '[class*="webhook-delete"]'; - - /** - * Css selector of confirming button for deleting webhook. - * - * @var string - */ - private $webhookDeleteConfirmButton = '[class="appriseOuter"] button[value="ok"]'; - - /** - * Creates new set of webhooks, if it not exists. - * - * @param string $team - * @return void - */ - public function create($team) - { - $handlerUrl = $this->getHandlerUrl(); - - foreach ($this->webhookEventOptionsMap as $webhookEventCode => $webhookEventName) { - if ($this->getWebhook($team, $webhookEventName)) { - continue; - } - - $this->addWebhook($handlerUrl, $webhookEventCode, $team); - } - } - - /** - * Deletes set of webhooks. - * - * @param string $team - * @return void - */ - public function cleanup($team) - { - foreach ($this->webhookEventOptionsMap as $webhookEventName) { - if ($webhook = $this->getWebhook($team, $webhookEventName)) { - $this->deleteWebhook($webhook); - } - } - } - - /** - * Gets webhook if exists. - * - * @param string $team - * @param string $webhookEventName - * @return ElementInterface|null - */ - private function getWebhook($team, $webhookEventName) - { - $webhook = $this->_rootElement->find( - sprintf($this->webhookAddedElement, $team, $webhookEventName), - Locator::SELECTOR_XPATH - ); - - return $webhook->isPresent() ? $webhook : null; - } - - /** - * Delete webhook element with confirmation popup. - * - * @param ElementInterface $webhook - * @return void - */ - private function deleteWebhook(ElementInterface $webhook) - { - $webhook->find($this->webhookDeleteButton)->click(); - $this->_rootElement->find($this->webhookDeleteConfirmButton)->click(); - } - - /** - * Sets webhook data and add it. - * - * @param string $handlerUrl - * @param string $webhookEventCode - * @param string $team - * @return void - */ - private function addWebhook( - $handlerUrl, - $webhookEventCode, - $team - ) { - $this->setEvent($webhookEventCode); - $this->setTeam($team); - $this->setUrl($handlerUrl); - $this->submit(); - } - - /** - * Sets appropriate webhook event select option by code. - * - * @param string $webhookEventCode - * @return void - */ - private function setEvent($webhookEventCode) - { - $this->_rootElement->find( - sprintf($this->webhookEventOption, $webhookEventCode) - )->click(); - } - - /** - * Sets test team select option. - * - * @param string $team - * @return void - */ - private function setTeam($team) - { - $this->_rootElement->find( - sprintf($this->webhookTeamOption, $team), - Locator::SELECTOR_XPATH - )->click(); - } - - /** - * Sets webhook handler url input value. - * - * @param string $handlerUrl - * @return void - */ - private function setUrl($handlerUrl) - { - $this->_rootElement->find($this->webhookUrl)->setValue($handlerUrl); - } - - /** - * Add webhook element. - * - * @return void - */ - private function submit() - { - $this->_rootElement->find($this->webhookAddButton)->click(); - } - - /** - * Gets webhook handler url. - * - * @return string - */ - private function getHandlerUrl() - { - return $_ENV['app_frontend_url'] . 'signifyd/webhooks/handler'; - } -} diff --git a/dev/tests/functional/tests/app/Magento/Signifyd/Test/Constraint/AssertAwaitingSignifydGuaranteeInCommentsHistory.php b/dev/tests/functional/tests/app/Magento/Signifyd/Test/Constraint/AssertAwaitingSignifydGuaranteeInCommentsHistory.php deleted file mode 100644 index f85e77a5c421b..0000000000000 --- a/dev/tests/functional/tests/app/Magento/Signifyd/Test/Constraint/AssertAwaitingSignifydGuaranteeInCommentsHistory.php +++ /dev/null @@ -1,73 +0,0 @@ -<?php -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ -namespace Magento\Signifyd\Test\Constraint; - -use Magento\Mtf\Constraint\AbstractConstraint; -use Magento\Sales\Test\Page\Adminhtml\OrderIndex; -use Magento\Sales\Test\Page\Adminhtml\SalesOrderView; - -/** - * Assert that comment about awaiting the Signifyd guarantee disposition - * exists in Comments History section on order page in Admin. - */ -class AssertAwaitingSignifydGuaranteeInCommentsHistory extends AbstractConstraint -{ - /** - * Expected history comment. - */ - private $historyComment = 'Awaiting the Signifyd guarantee disposition.'; - - /** - * Expected history status. - */ - private $historyCommentStatus = 'On Hold'; - - /** - * @param SalesOrderView $salesOrderView - * @param OrderIndex $salesOrder - * @param string $orderId - * @return void - */ - public function processAssert( - SalesOrderView $salesOrderView, - OrderIndex $salesOrder, - $orderId - ) { - $salesOrder->open(); - $salesOrder->getSalesOrderGrid()->searchAndOpen(['id' => $orderId]); - - /** @var \Magento\Sales\Test\Block\Adminhtml\Order\View\Tab\Info $infoTab */ - $infoTab = $salesOrderView->getOrderForm()->openTab('info')->getTab('info'); - $orderComments = $infoTab->getCommentsHistoryBlock()->getComments(); - - $key = array_search( - $this->historyComment, - array_column($orderComments, 'comment') - ); - - \PHPUnit\Framework\Assert::assertNotFalse( - $key, - 'There is no message about awaiting the Signifyd guarantee disposition' . - ' in Comments History section for the order #' . $orderId - ); - - \PHPUnit\Framework\Assert::assertEquals( - $this->historyCommentStatus, - $orderComments[$key]['status'], - 'Message about awaiting the Signifyd guarantee disposition' . - ' doesn\'t have status "'. $this->historyCommentStatus.'"' . - ' in Comments History section for the order #' . $orderId - ); - } - - /** - * @inheritdoc - */ - public function toString() - { - return "Message about awaiting the Signifyd guarantee disposition is available in Comments History section."; - } -} diff --git a/dev/tests/functional/tests/app/Magento/Signifyd/Test/Constraint/AssertCaseInfoOnAdmin.php b/dev/tests/functional/tests/app/Magento/Signifyd/Test/Constraint/AssertCaseInfoOnAdmin.php deleted file mode 100644 index 298b957131395..0000000000000 --- a/dev/tests/functional/tests/app/Magento/Signifyd/Test/Constraint/AssertCaseInfoOnAdmin.php +++ /dev/null @@ -1,85 +0,0 @@ -<?php -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ -namespace Magento\Signifyd\Test\Constraint; - -use Magento\Sales\Test\Page\Adminhtml\OrderIndex; -use Magento\Sales\Test\Page\Adminhtml\SalesOrderView; -use Magento\Mtf\Constraint\AbstractConstraint; -use Magento\Signifyd\Test\Fixture\SignifydData; - -/** - * Assert that Order Case Entity is correct on order page in Admin. - */ -class AssertCaseInfoOnAdmin extends AbstractConstraint -{ - /** - * Customized order view page. - * - * @var SalesOrderView - */ - private $orderView; - - /** - * Signifyd data fixture. - * - * @var SignifydData - */ - private $signifydData; - - /** - * Order id. - * - * @var string - */ - private $orderId; - - /** - * Assert that Signifyd Case information is correct in Admin. - * - * @param SalesOrderView $orderView - * @param OrderIndex $salesOrder - * @param SignifydData $signifydData - * @param string $orderId - * @return void - */ - public function processAssert( - SalesOrderView $orderView, - OrderIndex $salesOrder, - SignifydData $signifydData, - $orderId - ) { - $salesOrder->open(); - $salesOrder->getSalesOrderGrid()->searchAndOpen(['id' => $orderId]); - - $this->orderView = $orderView; - $this->signifydData = $signifydData; - $this->orderId = $orderId; - - $this->checkCaseGuaranteeDisposition(); - } - - /** - * Checks case guarantee disposition is correct. - * - * @return void - */ - private function checkCaseGuaranteeDisposition() - { - \PHPUnit\Framework\Assert::assertEquals( - $this->signifydData->getGuaranteeDisposition(), - $this->orderView->getFraudProtectionBlock()->getCaseGuaranteeDisposition(), - 'Case Guarantee Disposition status is wrong for order #' . $this->orderId - ); - } - - /** - * @inheritdoc - */ - public function toString() - { - return 'Signifyd Case information is correct in Admin.'; - } -} diff --git a/dev/tests/functional/tests/app/Magento/Signifyd/Test/Constraint/AssertCaseInfoOnSignifydConsole.php b/dev/tests/functional/tests/app/Magento/Signifyd/Test/Constraint/AssertCaseInfoOnSignifydConsole.php deleted file mode 100644 index a8a1f735d004c..0000000000000 --- a/dev/tests/functional/tests/app/Magento/Signifyd/Test/Constraint/AssertCaseInfoOnSignifydConsole.php +++ /dev/null @@ -1,214 +0,0 @@ -<?php -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ -namespace Magento\Signifyd\Test\Constraint; - -use Magento\Mtf\Constraint\AbstractConstraint; -use Magento\Signifyd\Test\Fixture\SignifydAddress; -use Magento\Signifyd\Test\Fixture\SignifydData; -use Magento\Signifyd\Test\Page\SignifydConsole\SignifydCases; - -/** - * Assert that order information is correct on Signifyd case info page. - */ -class AssertCaseInfoOnSignifydConsole extends AbstractConstraint -{ - /** - * Signifyd cases page. - * - * @var SignifydCases - */ - private $signifydCases; - - /** - * @param SignifydCases $signifydCases - * @param SignifydAddress $billingAddress - * @param SignifydData $signifydData - * @param array $prices - * @param string $orderId - * @param string $customerFullName - * @return void - */ - public function processAssert( - SignifydCases $signifydCases, - SignifydAddress $billingAddress, - SignifydData $signifydData, - array $prices, - $orderId, - $customerFullName - ) { - $this->signifydCases = $signifydCases; - - $this->checkDeviceData(); - $this->checkShippingPrice($signifydData->getShippingPrice()); - $this->checkGuaranteeDisposition($signifydData->getGuaranteeDisposition()); - $cvvResponse = $signifydData->getCvvResponse(); - if (isset($cvvResponse)) { - $this->checkCvvResponse($cvvResponse); - } - $this->checkAvsResponse($signifydData->getAvsResponse()); - $this->checkOrderId($orderId); - $this->checkOrderAmount($prices['grandTotal']); - $this->checkOrderAmountCurrency($prices['grandTotalCurrency']); - $this->checkCardHolder($customerFullName); - $this->checkBillingAddress($billingAddress); - } - - /** - * Checks device data are present. - * - * @return void - */ - private function checkDeviceData() - { - \PHPUnit\Framework\Assert::assertTrue( - $this->signifydCases->getCaseInfoBlock()->isAvailableDeviceData(), - 'Device data are not available on case page in Signifyd console.' - ); - } - - /** - * Checks shipping price is correct. - * - * @param string $shippingPrice - * @return void - */ - private function checkShippingPrice($shippingPrice) - { - \PHPUnit\Framework\Assert::assertContains( - $shippingPrice, - $this->signifydCases->getCaseInfoBlock()->getShippingPrice(), - 'Shipping price is incorrect on case page in Signifyd console.' - ); - } - - /** - * Checks guarantee disposition is correct. - * - * @param string $guaranteeDisposition - * @return void - */ - private function checkGuaranteeDisposition($guaranteeDisposition) - { - \PHPUnit\Framework\Assert::assertEquals( - $guaranteeDisposition, - $this->signifydCases->getCaseInfoBlock()->getGuaranteeDisposition(), - 'Guarantee disposition is incorrect on case page in Signifyd console.' - ); - } - - /** - * Checks CVV response is correct. - * - * @param string $cvvResponse - * @return void - */ - private function checkCvvResponse($cvvResponse) - { - \PHPUnit\Framework\Assert::assertEquals( - $cvvResponse, - $this->signifydCases->getCaseInfoBlock()->getCvvResponse(), - 'CVV response is incorrect on case page in Signifyd console.' - ); - } - - /** - * Checks AVS response is correct. - * - * @param string $avsResponse - * @return void - */ - private function checkAvsResponse($avsResponse) - { - \PHPUnit\Framework\Assert::assertEquals( - $avsResponse, - $this->signifydCases->getCaseInfoBlock()->getAvsResponse(), - 'AVS response is incorrect on case page in Signifyd console.' - ); - } - - /** - * Checks order id is correct. - * - * @param string $orderId - * @return void - */ - private function checkOrderId($orderId) - { - \PHPUnit\Framework\Assert::assertEquals( - $orderId, - $this->signifydCases->getCaseInfoBlock()->getOrderId(), - 'Order id is incorrect on case page in Signifyd console.' - ); - } - - /** - * Checks order amount is correct. - * - * @param string $amount - * @return void - */ - private function checkOrderAmount($amount) - { - \PHPUnit\Framework\Assert::assertEquals( - number_format($amount, 2), - $this->signifydCases->getCaseInfoBlock()->getOrderAmount(), - 'Order amount is incorrect on case page in Signifyd console.' - ); - } - - /** - * Checks order amount currency is correct. - * - * @param string $currency - * @return void - */ - private function checkOrderAmountCurrency($currency) - { - \PHPUnit\Framework\Assert::assertEquals( - $currency, - $this->signifydCases->getCaseInfoBlock()->getOrderAmountCurrency(), - 'Order amount currency is incorrect on case page in Signifyd console.' - ); - } - - /** - * Checks card holder is correct. - * - * @param string $customerFullName - * @return void - */ - private function checkCardHolder($customerFullName) - { - \PHPUnit\Framework\Assert::assertEquals( - $customerFullName, - $this->signifydCases->getCaseInfoBlock()->getCardHolder(), - 'Card holder name is incorrect on case page in Signifyd console.' - ); - } - - /** - * Checks billing address is correct. - * - * @param SignifydAddress $billingAddress - * @return void - */ - private function checkBillingAddress(SignifydAddress $billingAddress) - { - \PHPUnit\Framework\Assert::assertContains( - $billingAddress->getStreet(), - $this->signifydCases->getCaseInfoBlock()->getBillingAddress(), - 'Billing address is incorrect on case page in Signifyd console.' - ); - } - - /** - * @inheritdoc - */ - public function toString() - { - return 'Case information is correct on case page in Signifyd console.'; - } -} diff --git a/dev/tests/functional/tests/app/Magento/Signifyd/Test/Constraint/AssertSignifydCaseInCommentsHistory.php b/dev/tests/functional/tests/app/Magento/Signifyd/Test/Constraint/AssertSignifydCaseInCommentsHistory.php deleted file mode 100644 index ea919f9410d4d..0000000000000 --- a/dev/tests/functional/tests/app/Magento/Signifyd/Test/Constraint/AssertSignifydCaseInCommentsHistory.php +++ /dev/null @@ -1,56 +0,0 @@ -<?php -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ -namespace Magento\Signifyd\Test\Constraint; - -use Magento\Sales\Test\Page\Adminhtml\OrderIndex; -use Magento\Sales\Test\Page\Adminhtml\SalesOrderView; -use Magento\Mtf\Constraint\AbstractConstraint; - -/** - * Assert that comment about created Signifyd Case - * exists in Comments History section on order page in Admin. - */ -class AssertSignifydCaseInCommentsHistory extends AbstractConstraint -{ - /** - * Pattern of message about created Signifyd Case in order. - */ - const CASE_CREATED_PATTERN = '/Signifyd Case (\d)+ has been created for order\./'; - - /** - * @param SalesOrderView $salesOrderView - * @param OrderIndex $salesOrder - * @param string $orderId - * @return void - */ - public function processAssert( - SalesOrderView $salesOrderView, - OrderIndex $salesOrder, - $orderId - ) { - $salesOrder->open(); - $salesOrder->getSalesOrderGrid()->searchAndOpen(['id' => $orderId]); - - /** @var \Magento\Sales\Test\Block\Adminhtml\Order\View\Tab\Info $infoTab */ - $infoTab = $salesOrderView->getOrderForm()->openTab('info')->getTab('info'); - $orderComments = $infoTab->getCommentsHistoryBlock()->getComments(); - $commentsMessages = array_column($orderComments, 'comment'); - - \PHPUnit\Framework\Assert::assertRegExp( - self::CASE_CREATED_PATTERN, - implode('. ', $commentsMessages), - 'Signifyd case is not created for the order #' . $orderId - ); - } - - /** - * @inheritdoc - */ - public function toString() - { - return "Message about Signifyd Case is available in Comments History section."; - } -} diff --git a/dev/tests/functional/tests/app/Magento/Signifyd/Test/Constraint/AssertSignifydCaseInOrdersGrid.php b/dev/tests/functional/tests/app/Magento/Signifyd/Test/Constraint/AssertSignifydCaseInOrdersGrid.php deleted file mode 100644 index bdf3598d4f46a..0000000000000 --- a/dev/tests/functional/tests/app/Magento/Signifyd/Test/Constraint/AssertSignifydCaseInOrdersGrid.php +++ /dev/null @@ -1,50 +0,0 @@ -<?php -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ -namespace Magento\Signifyd\Test\Constraint; - -use Magento\Signifyd\Test\Fixture\SignifydData; -use Magento\Signifyd\Test\Page\Adminhtml\OrdersGrid; -use Magento\Mtf\Constraint\AbstractConstraint; - -/** - * Assert that Signifyd Guarantee Status is present in Orders grid. - */ -class AssertSignifydCaseInOrdersGrid extends AbstractConstraint -{ - /** - * @param string $orderId - * @param OrdersGrid $ordersGrid - * @param SignifydData $signifydData - * @return void - */ - public function processAssert( - $orderId, - OrdersGrid $ordersGrid, - SignifydData $signifydData - ) { - $filter = [ - 'id' => $orderId, - 'signifyd_guarantee_status' => $signifydData->getGuaranteeDisposition() - ]; - - $errorMessage = implode(', ', $filter); - - $ordersGrid->open(); - - \PHPUnit\Framework\Assert::assertTrue( - $ordersGrid->getSignifydOrdersGrid()->isRowVisible(array_filter($filter)), - 'Order with following data \'' . $errorMessage . '\' is absent in orders grid.' - ); - } - - /** - * @inheritdoc - */ - public function toString() - { - return 'Signifyd guarantee status is displayed in sales orders grid.'; - } -} diff --git a/dev/tests/functional/tests/app/Magento/Signifyd/Test/Constraint/AssertSignifydGuaranteeCancelInCommentsHistory.php b/dev/tests/functional/tests/app/Magento/Signifyd/Test/Constraint/AssertSignifydGuaranteeCancelInCommentsHistory.php deleted file mode 100644 index 618d77885736c..0000000000000 --- a/dev/tests/functional/tests/app/Magento/Signifyd/Test/Constraint/AssertSignifydGuaranteeCancelInCommentsHistory.php +++ /dev/null @@ -1,57 +0,0 @@ -<?php -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ -namespace Magento\Signifyd\Test\Constraint; - -use Magento\Mtf\Constraint\AbstractConstraint; -use Magento\Sales\Test\Page\Adminhtml\OrderIndex; -use Magento\Sales\Test\Page\Adminhtml\SalesOrderView; - -/** - * Assert that comment about created Signifyd Case guarantee - * has been cancelled exists in Comments History section on order page in Admin. - */ -class AssertSignifydGuaranteeCancelInCommentsHistory extends AbstractConstraint -{ - /** - * Signifyd case guarantee cancel message in order view. - */ - private $guaranteeCancelMessage = 'Case Update: Case guarantee has been cancelled.'; - - /** - * @param SalesOrderView $salesOrderView - * @param OrderIndex $salesOrder - * @param string $orderId - * @return void - */ - public function processAssert( - SalesOrderView $salesOrderView, - OrderIndex $salesOrder, - $orderId - ) { - $salesOrder->open(); - $salesOrder->getSalesOrderGrid()->searchAndOpen(['id' => $orderId]); - - /** @var \Magento\Sales\Test\Block\Adminhtml\Order\View\Tab\Info $infoTab */ - $infoTab = $salesOrderView->getOrderForm()->openTab('info')->getTab('info'); - $orderComments = $infoTab->getCommentsHistoryBlock()->getComments(); - $commentsMessages = array_column($orderComments, 'comment'); - - \PHPUnit\Framework\Assert::assertContains( - $this->guaranteeCancelMessage, - implode('. ', $commentsMessages), - 'There is no message regarding Signifyd guarantee cancel in Comments History section for the order #' - . $orderId - ); - } - - /** - * @inheritdoc - */ - public function toString() - { - return "Message about Signifyd guarantee cancel is available in Comments History section."; - } -} diff --git a/dev/tests/functional/tests/app/Magento/Signifyd/Test/Fixture/SignifydAccount.xml b/dev/tests/functional/tests/app/Magento/Signifyd/Test/Fixture/SignifydAccount.xml deleted file mode 100644 index 8b1455811d003..0000000000000 --- a/dev/tests/functional/tests/app/Magento/Signifyd/Test/Fixture/SignifydAccount.xml +++ /dev/null @@ -1,17 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ - --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/etc/fixture.xsd"> - <fixture name="signifyd_account" - module="Magento_Signifyd" - type="virtual" - repository_class="Magento\Signifyd\Test\Repository\SignifydAccount" - class="Magento\Signifyd\Test\Fixture\SignifydAccount"> - <field name="email" /> - <field name="password" /> - </fixture> -</config> diff --git a/dev/tests/functional/tests/app/Magento/Signifyd/Test/Fixture/SignifydAddress.xml b/dev/tests/functional/tests/app/Magento/Signifyd/Test/Fixture/SignifydAddress.xml deleted file mode 100644 index 02b5cc8211d89..0000000000000 --- a/dev/tests/functional/tests/app/Magento/Signifyd/Test/Fixture/SignifydAddress.xml +++ /dev/null @@ -1,15 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ - --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/etc/fixture.xsd"> - <fixture name="signifydAddress" - module="Magento_Signifyd" - class="Magento\Signifyd\Test\Fixture\SignifydAddress" - extends="\Magento\Customer\Test\Fixture\Address"> - <field name="firstname" source="Magento\Signifyd\Test\Fixture\SignifydAddress\Firstname" is_required="1" /> - </fixture> -</config> diff --git a/dev/tests/functional/tests/app/Magento/Signifyd/Test/Fixture/SignifydAddress/Firstname.php b/dev/tests/functional/tests/app/Magento/Signifyd/Test/Fixture/SignifydAddress/Firstname.php deleted file mode 100644 index 9e4930484eef0..0000000000000 --- a/dev/tests/functional/tests/app/Magento/Signifyd/Test/Fixture/SignifydAddress/Firstname.php +++ /dev/null @@ -1,46 +0,0 @@ -<?php -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ -namespace Magento\Signifyd\Test\Fixture\SignifydAddress; - -use Magento\Mtf\Fixture\DataSource; - -/** - * Source handler for `firstname` field in shipping address fixture. - */ -class Firstname extends DataSource -{ - /** - * @param string $data - */ - public function __construct($data = '') - { - $this->data = $data; - } - - /** - * Add isolation for `firstname` field. - * - * @param null $key - * @return string - */ - public function getData($key = null) - { - $this->data = str_replace('%signifyd_isolation%', $this->generateIsolation(), $this->data); - - return parent::getData($key); - } - - /** - * Generates character isolation. - * - * @param int $length - * @return string - */ - private function generateIsolation($length = 10) - { - return substr(str_shuffle(str_repeat("abcdefghijklmnopqrstuvwxyz", $length)), 0, $length); - } -} diff --git a/dev/tests/functional/tests/app/Magento/Signifyd/Test/Fixture/SignifydData.xml b/dev/tests/functional/tests/app/Magento/Signifyd/Test/Fixture/SignifydData.xml deleted file mode 100644 index 23ee2cddf434a..0000000000000 --- a/dev/tests/functional/tests/app/Magento/Signifyd/Test/Fixture/SignifydData.xml +++ /dev/null @@ -1,21 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ - --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/etc/fixture.xsd"> - <fixture name="signifyd_data" - module="Magento_Signifyd" - type="virtual" - repository_class="Magento\Signifyd\Test\Repository\SignifydData" - class="Magento\Signifyd\Test\Fixture\SignifydData"> - <field name="team" /> - <field name="caseFlag" /> - <field name="guaranteeDisposition" /> - <field name="cvvResponse" /> - <field name="avsResponse" /> - <field name="shippingPrice" /> - </fixture> -</config> diff --git a/dev/tests/functional/tests/app/Magento/Signifyd/Test/Page/Adminhtml/OrdersGrid.xml b/dev/tests/functional/tests/app/Magento/Signifyd/Test/Page/Adminhtml/OrdersGrid.xml deleted file mode 100644 index 749d91c3ed395..0000000000000 --- a/dev/tests/functional/tests/app/Magento/Signifyd/Test/Page/Adminhtml/OrdersGrid.xml +++ /dev/null @@ -1,12 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ - --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../vendor/magento/mtf/etc/pages.xsd"> - <page name="ordersGrid" area="Adminhtml" mca="sales/order" module="Magento_Signifyd"> - <block name="signifydOrdersGrid" class="Magento\Signifyd\Test\Block\Adminhtml\Order\Grid" locator="//div[contains(@data-bind, 'sales_order_grid')]" strategy="xpath" /> - </page> -</config> diff --git a/dev/tests/functional/tests/app/Magento/Signifyd/Test/Page/Adminhtml/SalesOrderView.xml b/dev/tests/functional/tests/app/Magento/Signifyd/Test/Page/Adminhtml/SalesOrderView.xml deleted file mode 100644 index 36d77723dfcee..0000000000000 --- a/dev/tests/functional/tests/app/Magento/Signifyd/Test/Page/Adminhtml/SalesOrderView.xml +++ /dev/null @@ -1,12 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ - --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../vendor/magento/mtf/etc/pages.xsd"> - <page name="SalesOrderView" area="Adminhtml" mca="sales/order/view"> - <block name="fraudProtectionBlock" class="Magento\Signifyd\Test\Block\Adminhtml\Order\View\FraudProtection" locator=".admin__page-section.order-case-info" strategy="css selector" /> - </page> -</config> diff --git a/dev/tests/functional/tests/app/Magento/Signifyd/Test/Page/SignifydConsole/SignifydCases.xml b/dev/tests/functional/tests/app/Magento/Signifyd/Test/Page/SignifydConsole/SignifydCases.xml deleted file mode 100644 index cfe889bb8de44..0000000000000 --- a/dev/tests/functional/tests/app/Magento/Signifyd/Test/Page/SignifydConsole/SignifydCases.xml +++ /dev/null @@ -1,13 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ - --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../vendor/magento/mtf/etc/pages.xsd"> - <page name="SignifydCases" area="SignifydConsole" mca="https://app.signifyd.com/cases" module="Magento_Signifyd"> - <block name="caseSearchBlock" class="Magento\Signifyd\Test\Block\SignifydConsole\CaseSearch" locator="[class$=app-sidebar]" strategy="css selector" /> - <block name="caseInfoBlock" class="Magento\Signifyd\Test\Block\SignifydConsole\CaseInfo" locator="[class*=app-wrapper]" strategy="css selector" /> - </page> -</config> diff --git a/dev/tests/functional/tests/app/Magento/Signifyd/Test/Page/SignifydConsole/SignifydLogin.xml b/dev/tests/functional/tests/app/Magento/Signifyd/Test/Page/SignifydConsole/SignifydLogin.xml deleted file mode 100644 index 5fe5da6d28013..0000000000000 --- a/dev/tests/functional/tests/app/Magento/Signifyd/Test/Page/SignifydConsole/SignifydLogin.xml +++ /dev/null @@ -1,12 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ - --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../vendor/magento/mtf/etc/pages.xsd"> - <page name="SignifydLogin" area="SignifydConsole" mca="https://app.signifyd.com/login" module="Magento_Signifyd"> - <block name="loginBlock" class="Magento\Signifyd\Test\Block\SignifydConsole\SignifydLogin" locator="[id=loginForm]" strategy="css selector" /> - </page> -</config> diff --git a/dev/tests/functional/tests/app/Magento/Signifyd/Test/Page/SignifydConsole/SignifydNotifications.xml b/dev/tests/functional/tests/app/Magento/Signifyd/Test/Page/SignifydConsole/SignifydNotifications.xml deleted file mode 100644 index dd12f14c28800..0000000000000 --- a/dev/tests/functional/tests/app/Magento/Signifyd/Test/Page/SignifydConsole/SignifydNotifications.xml +++ /dev/null @@ -1,12 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ - --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../vendor/magento/mtf/etc/pages.xsd"> - <page name="SignifydNotifications" area="SignifydConsole" mca="https://app.signifyd.com/settings/notifications" module="Magento_Signifyd"> - <block name="webhooksBlock" class="Magento\Signifyd\Test\Block\SignifydConsole\Webhooks" locator="[id=body]" strategy="css selector" /> - </page> -</config> diff --git a/dev/tests/functional/tests/app/Magento/Signifyd/Test/Repository/Address.xml b/dev/tests/functional/tests/app/Magento/Signifyd/Test/Repository/Address.xml deleted file mode 100644 index a534cbc6107fe..0000000000000 --- a/dev/tests/functional/tests/app/Magento/Signifyd/Test/Repository/Address.xml +++ /dev/null @@ -1,22 +0,0 @@ -<?xml version="1.0" ?> -<!-- -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ ---> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/Magento/Mtf/Repository/etc/repository.xsd"> - <repository class="Magento\Customer\Test\Repository\Address"> - <dataset name="signifyd_us_shipping_address"> - <field name="firstname" xsi:type="string">John%signifyd_isolation%</field> - <field name="lastname" xsi:type="string">Doe</field> - <field name="company" xsi:type="string">Magento</field> - <field name="city" xsi:type="string">Culver City</field> - <field name="street" xsi:type="string">6161 West Centinela Avenue</field> - <field name="telephone" xsi:type="string">555-55-555-55</field> - <field name="country_id" xsi:type="string">United States</field> - <field name="region_id" xsi:type="string">California</field> - <field name="postcode" xsi:type="string">90230</field> - </dataset> - </repository> -</config> diff --git a/dev/tests/functional/tests/app/Magento/Signifyd/Test/Repository/ConfigData.xml b/dev/tests/functional/tests/app/Magento/Signifyd/Test/Repository/ConfigData.xml deleted file mode 100644 index 2af46f077b304..0000000000000 --- a/dev/tests/functional/tests/app/Magento/Signifyd/Test/Repository/ConfigData.xml +++ /dev/null @@ -1,45 +0,0 @@ -<?xml version="1.0"?> -<!-- -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ ---> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/Magento/Mtf/Repository/etc/repository.xsd"> - <repository class="Magento\Config\Test\Repository\ConfigData"> - <dataset name="signifyd"> - <field name="fraud_protection/signifyd/active" xsi:type="array"> - <item name="scope" xsi:type="string">fraud_protection</item> - <item name="scope_id" xsi:type="number">1</item> - <item name="label" xsi:type="string">Yes</item> - <item name="value" xsi:type="number">1</item> - </field> - <field name="fraud_protection/signifyd/config/api_key" xsi:type="array"> - <item name="scope" xsi:type="string">fraud_protection</item> - <item name="scope_id" xsi:type="number">1</item> - <item name="label" xsi:type="string"/> - <item name="value" xsi:type="string">SIGNIFYD_CONFIG_API_KEY</item> - </field> - <field name="fraud_protection/signifyd/api_url" xsi:type="array"> - <item name="scope" xsi:type="string">fraud_protection</item> - <item name="scope_id" xsi:type="number">1</item> - <item name="label" xsi:type="string"/> - <item name="value" xsi:type="string">https://api.signifyd.com/v2/</item> - </field> - <field name="fraud_protection/signifyd/debug" xsi:type="array"> - <item name="scope" xsi:type="string">fraud_protection</item> - <item name="scope_id" xsi:type="number">1</item> - <item name="label" xsi:type="string">Yes</item> - <item name="value" xsi:type="number">1</item> - </field> - </dataset> - <dataset name="signifyd_rollback"> - <field name="fraud_protection/signifyd/active" xsi:type="array"> - <item name="scope" xsi:type="string">fraud_protection</item> - <item name="scope_id" xsi:type="number">1</item> - <item name="label" xsi:type="string">Yes</item> - <item name="value" xsi:type="number">0</item> - </field> - </dataset> - </repository> -</config> diff --git a/dev/tests/functional/tests/app/Magento/Signifyd/Test/Repository/Customer.xml b/dev/tests/functional/tests/app/Magento/Signifyd/Test/Repository/Customer.xml deleted file mode 100644 index b45e3d01b8ec8..0000000000000 --- a/dev/tests/functional/tests/app/Magento/Signifyd/Test/Repository/Customer.xml +++ /dev/null @@ -1,25 +0,0 @@ -<?xml version="1.0" ?> -<!-- -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ ---> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/Magento/Mtf/Repository/etc/repository.xsd"> - <repository class="Magento\Customer\Test\Repository\Customer"> - <dataset name="signifyd_approve_us_customer"> - <field name="firstname" xsi:type="string">John</field> - <field name="lastname" xsi:type="string">Doe</field> - <field name="email" xsi:type="string">testapprove@magento.com</field> - <field name="password" xsi:type="string">123123^q</field> - <field name="password_confirmation" xsi:type="string">123123^q</field> - </dataset> - <dataset name="signifyd_decline_us_customer"> - <field name="firstname" xsi:type="string">John</field> - <field name="lastname" xsi:type="string">Doe</field> - <field name="email" xsi:type="string">testdecline@magento.com</field> - <field name="password" xsi:type="string">123123^q</field> - <field name="password_confirmation" xsi:type="string">123123^q</field> - </dataset> - </repository> -</config> diff --git a/dev/tests/functional/tests/app/Magento/Signifyd/Test/Repository/SignifydAccount.xml b/dev/tests/functional/tests/app/Magento/Signifyd/Test/Repository/SignifydAccount.xml deleted file mode 100644 index 4d3dd5229eae3..0000000000000 --- a/dev/tests/functional/tests/app/Magento/Signifyd/Test/Repository/SignifydAccount.xml +++ /dev/null @@ -1,15 +0,0 @@ -<?xml version="1.0" ?> -<!-- -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ ---> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/Magento/Mtf/Repository/etc/repository.xsd"> - <repository class="Magento\Signifyd\Test\Repository\SignifydAccount"> - <dataset name="sandbox_default"> - <field name="email" xsi:type="string">SIGNIFYD_EMAIL</field> - <field name="password" xsi:type="string">SIGNIFYD_PASSWORD</field> - </dataset> - </repository> -</config> diff --git a/dev/tests/functional/tests/app/Magento/Signifyd/Test/Repository/SignifydData.xml b/dev/tests/functional/tests/app/Magento/Signifyd/Test/Repository/SignifydData.xml deleted file mode 100644 index 02037534b0149..0000000000000 --- a/dev/tests/functional/tests/app/Magento/Signifyd/Test/Repository/SignifydData.xml +++ /dev/null @@ -1,33 +0,0 @@ -<?xml version="1.0" ?> -<!-- -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ ---> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/Magento/Mtf/Repository/etc/repository.xsd"> - <repository class="Magento\Signifyd\Test\Repository\SignifydData"> - <dataset name="signifyd_guarantee_approve"> - <field name="team" xsi:type="string">autotest</field> - <field name="caseFlag" xsi:type="string">Good</field> - <field name="guaranteeDisposition" xsi:type="string">Approved</field> - <field name="cvvResponse" xsi:type="string">CVV2 Match (M)</field> - <field name="avsResponse" xsi:type="string">Full match (Y)</field> - <field name="shippingPrice" xsi:type="string">USD 5.00</field> - </dataset> - <dataset name="signifyd_guarantee_decline"> - <field name="team" xsi:type="string">autotest</field> - <field name="caseFlag" xsi:type="string">Bad</field> - <field name="guaranteeDisposition" xsi:type="string">Declined</field> - <field name="cvvResponse" xsi:type="string">CVV2 Match (M)</field> - <field name="avsResponse" xsi:type="string">Full match (Y)</field> - <field name="shippingPrice" xsi:type="string">USD 5.00</field> - </dataset> - <dataset name="signifyd_guarantee_fraudulent"> - <field name="team" xsi:type="string">autotest</field> - <field name="caseFlag" xsi:type="string">Bad</field> - <field name="guaranteeDisposition" xsi:type="string">Declined</field> - <field name="shippingPrice" xsi:type="string">GBP 10.00</field> - </dataset> - </repository> -</config> diff --git a/dev/tests/functional/tests/app/Magento/Signifyd/Test/TestCase/AcceptPaymentWithSignifydGuaranteeDeclinedTest.php b/dev/tests/functional/tests/app/Magento/Signifyd/Test/TestCase/AcceptPaymentWithSignifydGuaranteeDeclinedTest.php deleted file mode 100644 index 1dd742c9f7096..0000000000000 --- a/dev/tests/functional/tests/app/Magento/Signifyd/Test/TestCase/AcceptPaymentWithSignifydGuaranteeDeclinedTest.php +++ /dev/null @@ -1,63 +0,0 @@ -<?php -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ -namespace Magento\Signifyd\Test\TestCase; - -use Magento\Mtf\TestCase\Scenario; - -/** - * * Preconditions: - * 1. Configure shipping method. - * 2. Configure payment method. - * 3. Configure Signifyd fraud protection tool - * 4. Create products. - * 5. Create and setup customer. - * - * Steps: - * 1. Log in to Signifyd account. - * 2. Remove all existing webhooks by test team. - * 3. Add new webhook set. - * 4. Log in Storefront. - * 5. Add products to the Shopping Cart. - * 6. Click the 'Proceed to Checkout' button. - * 7. Fill shipping information. - * 8. Select shipping method. - * 9. Select Hosted Pro method. - * 10. Click 'Continue' button. - * 11. Specify credit card data in Paypal iframe. - * 12. Click 'Pay Now' button. - * 13. Log in to Signifyd account and search for created case. - * 14. Open created case. - * 15. Click "Flag case as bad" button. - * 16. Perform case info assertions. - * 17. Log in to Admin. - * 18. Proceed to order grid. - * 19. Perform Signifyd guarantee status assertions. - * 20. Proceed to order view. - * 21. Perform order status and case info assertions. - * 22. Click Accept Payment button. - * 23. Perform remaining assertions. - * - * @group Signifyd - * @ZephyrId MAGETWO-65333 - */ -class AcceptPaymentWithSignifydGuaranteeDeclinedTest extends Scenario -{ - /* tags */ - const MVP = 'yes'; - const TEST_TYPE = '3rd_party_test_single_flow'; - const SEVERITY = 'S2'; - /* end tags */ - - /** - * Runs one page checkout test. - * - * @return void - */ - public function test() - { - $this->executeScenario(); - } -} diff --git a/dev/tests/functional/tests/app/Magento/Signifyd/Test/TestCase/AcceptPaymentWithSignifydGuaranteeDeclinedTest.xml b/dev/tests/functional/tests/app/Magento/Signifyd/Test/TestCase/AcceptPaymentWithSignifydGuaranteeDeclinedTest.xml deleted file mode 100644 index 6391081e5e161..0000000000000 --- a/dev/tests/functional/tests/app/Magento/Signifyd/Test/TestCase/AcceptPaymentWithSignifydGuaranteeDeclinedTest.xml +++ /dev/null @@ -1,38 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ - --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/etc/variations.xsd"> - <testCase name="Magento\Signifyd\Test\TestCase\AcceptPaymentWithSignifydGuaranteeDeclinedTest" - summary="One Page Checkout with Signifyd, PayPal Payments Pro Hosted Solution with Fraud filters triggered."> - <variation name="AcceptPaymentWithSignifydGuaranteeDeclinedWithHostedProVariation1" summary="Accept order placed within PayPal Payments Pro Hosted Solution with Fraud filters triggered and Signifyd Guarantee Declined" ticketId="MAGETWO-65333"> - <data name="products/0" xsi:type="string">catalogProductSimple::product_100_dollar</data> - <data name="customer/dataset" xsi:type="string">signifyd_decline_us_customer</data> - <data name="checkoutMethod" xsi:type="string">login</data> - <data name="shipping/shipping_service" xsi:type="string">Flat Rate</data> - <data name="shipping/shipping_method" xsi:type="string">Fixed</data> - <data name="payment/method" xsi:type="string">hosted_pro</data> - <data name="prices" xsi:type="array"> - <item name="grandTotal" xsi:type="string">210.00</item> - <item name="grandTotalCurrency" xsi:type="string">GBP</item> - </data> - <data name="creditCardClass" xsi:type="string">credit_card_hostedpro</data> - <data name="creditCard/dataset" xsi:type="string">visa_hosted_pro</data> - <data name="isVaultPresent" xsi:type="boolean">false</data> - <data name="configData" xsi:type="string">merchant_country_gb, hosted_pro, config_base_currency_gb, signifyd</data> - <data name="placeOrderStatus" xsi:type="string">Suspected Fraud</data> - <data name="signifydAddress/dataset" xsi:type="string">signifyd_us_shipping_address</data> - <data name="signifydAccount/dataset" xsi:type="string">sandbox_default</data> - <data name="signifydData/dataset" xsi:type="string">signifyd_guarantee_fraudulent</data> - <data name="status" xsi:type="string">Processing</data> - <data name="tag" xsi:type="string">test_type:3rd_party_test_single_flow, severity:S2</data> - <constraint name="Magento\Sales\Test\Constraint\AssertOrderGrandTotal" /> - <constraint name="Magento\Signifyd\Test\Constraint\AssertSignifydCaseInCommentsHistory" /> - <constraint name="Magento\Sales\Test\Constraint\AssertAcceptPaymentMessageInCommentsHistory" /> - <constraint name="Magento\Sales\Test\Constraint\AssertOrderStatusIsCorrect" /> - </variation> - </testCase> -</config> diff --git a/dev/tests/functional/tests/app/Magento/Signifyd/Test/TestCase/CreateSignifydGuaranteeAndCancelOrderTest.php b/dev/tests/functional/tests/app/Magento/Signifyd/Test/TestCase/CreateSignifydGuaranteeAndCancelOrderTest.php deleted file mode 100644 index 5ca76ff70479f..0000000000000 --- a/dev/tests/functional/tests/app/Magento/Signifyd/Test/TestCase/CreateSignifydGuaranteeAndCancelOrderTest.php +++ /dev/null @@ -1,62 +0,0 @@ -<?php -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ -namespace Magento\Signifyd\Test\TestCase; - -use Magento\Mtf\TestCase\Scenario; - -/** - * Preconditions: - * 1. Configure shipping method. - * 2. Configure payment method. - * 3. Configure Signifyd fraud protection tool - * 4. Create products. - * 5. Create and setup customer. - * - * Steps: - * 1. Log in to Signifyd account. - * 2. Remove all existing webhooks by test team. - * 3. Add new webhook set. - * 4. Log in Storefront. - * 5. Add products to the Shopping Cart. - * 6. Click the 'Proceed to Checkout' button. - * 7. Fill shipping information. - * 8. Select shipping method. - * 9. Select payment method. - * 10. Specify credit card data. - * 11. Click 'Place order' button. - * 12. Search for created case. - * 13. Open created case. - * 14. Click "Flag case as good" or "Flag case as bad" button. - * 15. Perform case info assertions. - * 16. Log in to Admin. - * 17. Proceed to order grid. - * 18. Perform Signifyd guarantee status assertions. - * 19. Proceed to order view. - * 20. Perform order status and case info assertions. - * 21. Click Cancel button. - * 22. Perform remaining assertions. - * - * @group Signifyd - * @ZephyrId MAGETWO-62120, MAGETWO-63221, MAGETWO-64305, MAGETWO-65253 - */ -class CreateSignifydGuaranteeAndCancelOrderTest extends Scenario -{ - /* tags */ - const MVP = 'yes'; - const TEST_TYPE = '3rd_party_test_single_flow'; - const SEVERITY = 'S1'; - /* end tags */ - - /** - * Runs one page checkout test. - * - * @return void - */ - public function test() - { - $this->executeScenario(); - } -} diff --git a/dev/tests/functional/tests/app/Magento/Signifyd/Test/TestCase/CreateSignifydGuaranteeAndCancelOrderTest.xml b/dev/tests/functional/tests/app/Magento/Signifyd/Test/TestCase/CreateSignifydGuaranteeAndCancelOrderTest.xml deleted file mode 100644 index 082627fe5821d..0000000000000 --- a/dev/tests/functional/tests/app/Magento/Signifyd/Test/TestCase/CreateSignifydGuaranteeAndCancelOrderTest.xml +++ /dev/null @@ -1,67 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ - --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/etc/variations.xsd"> - <testCase name="Magento\Signifyd\Test\TestCase\CreateSignifydGuaranteeAndCancelOrderTest" - summary="One Page Checkout with Signifyd and cancel order."> - <variation name="CreateSignifydGuaranteeAndCancelOrderWithBraintreeVariation1" - summary="Cancel order placed within Braintree credit card with Signifyd approved guarantee." - ticketId="MAGETWO-62120,MAGETWO-63221"> - <data name="products/0" xsi:type="string">catalogProductSimple::product_10_dollar</data> - <data name="checkoutMethod" xsi:type="string">login</data> - <data name="customer/dataset" xsi:type="string">signifyd_approve_us_customer</data> - <data name="shipping/shipping_service" xsi:type="string">Flat Rate</data> - <data name="shipping/shipping_method" xsi:type="string">Fixed</data> - <data name="payment/method" xsi:type="string">braintree</data> - <data name="paymentForm" xsi:type="string">braintree</data> - <data name="prices/grandTotal" xsi:type="string">15.00</data> - <data name="prices/grandTotalCurrency" xsi:type="string">USD</data> - <data name="creditCard/dataset" xsi:type="string">visa_default</data> - <data name="creditCard/data/payment_code" xsi:type="string">braintree</data> - <data name="configData" xsi:type="string">braintree,signifyd</data> - <data name="placeOrderStatus" xsi:type="string">Processing</data> - <data name="signifydAddress/dataset" xsi:type="string">signifyd_us_shipping_address</data> - <data name="signifydAccount/dataset" xsi:type="string">sandbox_default</data> - <data name="signifydData/dataset" xsi:type="string">signifyd_guarantee_approve</data> - <data name="tag" xsi:type="string">test_type:3rd_party_test_single_flow, severity:S1</data> - <constraint name="Magento\Sales\Test\Constraint\AssertAuthorizationInCommentsHistory" /> - <constraint name="Magento\Sales\Test\Constraint\AssertOrderGrandTotal" /> - <constraint name="Magento\Sales\Test\Constraint\AssertOrderStatusIsCanceled" /> - <constraint name="Magento\Sales\Test\Constraint\AssertCancelInCommentsHistory" /> - <constraint name="Magento\Signifyd\Test\Constraint\AssertSignifydCaseInCommentsHistory" /> - <constraint name="Magento\Signifyd\Test\Constraint\AssertAwaitingSignifydGuaranteeInCommentsHistory" /> - <constraint name="Magento\Signifyd\Test\Constraint\AssertSignifydGuaranteeCancelInCommentsHistory" /> - </variation> - <variation name="CreateSignifydGuaranteeAndCancelOrderWithBraintreeVariation2" - summary="Cancel order placed within Braintree credit card with Signifyd declined guarantee." - ticketId="MAGETWO-64305, MAGETWO-65253"> - <data name="products/0" xsi:type="string">catalogProductSimple::product_10_dollar</data> - <data name="checkoutMethod" xsi:type="string">login</data> - <data name="customer/dataset" xsi:type="string">signifyd_decline_us_customer</data> - <data name="shipping/shipping_service" xsi:type="string">Flat Rate</data> - <data name="shipping/shipping_method" xsi:type="string">Fixed</data> - <data name="payment/method" xsi:type="string">braintree</data> - <data name="paymentForm" xsi:type="string">braintree</data> - <data name="prices/grandTotal" xsi:type="string">15.00</data> - <data name="prices/grandTotalCurrency" xsi:type="string">USD</data> - <data name="creditCard/dataset" xsi:type="string">visa_default</data> - <data name="creditCard/data/payment_code" xsi:type="string">braintree</data> - <data name="configData" xsi:type="string">braintree,signifyd</data> - <data name="placeOrderStatus" xsi:type="string">On Hold</data> - <data name="signifydAddress/dataset" xsi:type="string">signifyd_us_shipping_address</data> - <data name="signifydAccount/dataset" xsi:type="string">sandbox_default</data> - <data name="signifydData/dataset" xsi:type="string">signifyd_guarantee_decline</data> - <data name="tag" xsi:type="string">test_type:3rd_party_test_single_flow, severity:S1</data> - <constraint name="Magento\Sales\Test\Constraint\AssertAuthorizationInCommentsHistory" /> - <constraint name="Magento\Sales\Test\Constraint\AssertOrderGrandTotal" /> - <constraint name="Magento\Sales\Test\Constraint\AssertOrderStatusIsCanceled" /> - <constraint name="Magento\Sales\Test\Constraint\AssertCancelInCommentsHistory" /> - <constraint name="Magento\Signifyd\Test\Constraint\AssertSignifydCaseInCommentsHistory" /> - <constraint name="Magento\Signifyd\Test\Constraint\AssertAwaitingSignifydGuaranteeInCommentsHistory" /> - </variation> - </testCase> -</config> diff --git a/dev/tests/functional/tests/app/Magento/Signifyd/Test/TestCase/DenyPaymentWithSignifydGuaranteeDeclinedTest.php b/dev/tests/functional/tests/app/Magento/Signifyd/Test/TestCase/DenyPaymentWithSignifydGuaranteeDeclinedTest.php deleted file mode 100644 index 698861da26018..0000000000000 --- a/dev/tests/functional/tests/app/Magento/Signifyd/Test/TestCase/DenyPaymentWithSignifydGuaranteeDeclinedTest.php +++ /dev/null @@ -1,63 +0,0 @@ -<?php -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ -namespace Magento\Signifyd\Test\TestCase; - -use Magento\Mtf\TestCase\Scenario; - -/** - * * Preconditions: - * 1. Configure shipping method. - * 2. Configure payment method. - * 3. Configure Signifyd fraud protection tool - * 4. Create products. - * 5. Create and setup customer. - * - * Steps: - * 1. Log in to Signifyd account. - * 2. Remove all existing webhooks by test team. - * 3. Add new webhook set. - * 4. Log in Storefront. - * 5. Add products to the Shopping Cart. - * 6. Click the 'Proceed to Checkout' button. - * 7. Fill shipping information. - * 8. Select shipping method. - * 9. Select Hosted Pro method. - * 10. Click 'Continue' button. - * 11. Specify credit card data in Paypal iframe. - * 12. Click 'Pay Now' button. - * 13. Log in to Signifyd account and search for created case. - * 14. Open created case. - * 15. Click "Flag case as bad" button. - * 16. Perform case info assertions. - * 17. Log in to Admin. - * 18. Proceed to order grid. - * 19. Perform Signifyd guarantee status assertions. - * 20. Proceed to order view. - * 21. Perform order status and case info assertions. - * 22. Click Deny Payment button. - * 23. Perform remaining assertions. - * - * @group Signifyd - * @ZephyrId MAGETWO-65332 - */ -class DenyPaymentWithSignifydGuaranteeDeclinedTest extends Scenario -{ - /* tags */ - const MVP = 'yes'; - const TEST_TYPE = '3rd_party_test_single_flow'; - const SEVERITY = 'S2'; - /* end tags */ - - /** - * Runs one page checkout test. - * - * @return void - */ - public function test() - { - $this->executeScenario(); - } -} diff --git a/dev/tests/functional/tests/app/Magento/Signifyd/Test/TestCase/DenyPaymentWithSignifydGuaranteeDeclinedTest.xml b/dev/tests/functional/tests/app/Magento/Signifyd/Test/TestCase/DenyPaymentWithSignifydGuaranteeDeclinedTest.xml deleted file mode 100644 index 5496619fe1bf9..0000000000000 --- a/dev/tests/functional/tests/app/Magento/Signifyd/Test/TestCase/DenyPaymentWithSignifydGuaranteeDeclinedTest.xml +++ /dev/null @@ -1,39 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ - --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/etc/variations.xsd"> - <testCase name="Magento\Signifyd\Test\TestCase\DenyPaymentWithSignifydGuaranteeDeclinedTest" - summary="One Page Checkout with Signifyd, PayPal Payments Pro Hosted Solution with Fraud filters triggered."> - <variation name="DenyPaymentWithSignifydGuaranteeDeclinedWithHostedProVariation1" summary="Deny order placed within PayPal Payments Pro Hosted Solution with Fraud filters triggered and Signifyd Guarantee Declined" ticketId="MAGETWO-65332"> - <data name="products/0" xsi:type="string">catalogProductSimple::product_100_dollar</data> - <data name="customer/dataset" xsi:type="string">signifyd_decline_us_customer</data> - <data name="checkoutMethod" xsi:type="string">login</data> - <data name="shipping/shipping_service" xsi:type="string">Flat Rate</data> - <data name="shipping/shipping_method" xsi:type="string">Fixed</data> - <data name="payment/method" xsi:type="string">hosted_pro</data> - <data name="prices" xsi:type="array"> - <item name="grandTotal" xsi:type="string">210.00</item> - <item name="grandTotalCurrency" xsi:type="string">GBP</item> - </data> - <data name="creditCardClass" xsi:type="string">credit_card_hostedpro</data> - <data name="creditCard/dataset" xsi:type="string">visa_hosted_pro</data> - <data name="isVaultPresent" xsi:type="boolean">false</data> - <data name="configData" xsi:type="string">merchant_country_gb, hosted_pro, config_base_currency_gb, signifyd</data> - <data name="placeOrderStatus" xsi:type="string">Suspected Fraud</data> - <data name="status" xsi:type="string">Canceled</data> - <data name="signifydAddress/dataset" xsi:type="string">signifyd_us_shipping_address</data> - <data name="signifydAccount/dataset" xsi:type="string">sandbox_default</data> - <data name="signifydData/dataset" xsi:type="string">signifyd_guarantee_fraudulent</data> - <data name="tag" xsi:type="string">test_type:3rd_party_test_single_flow, severity:S2</data> - <constraint name="Magento\Sales\Test\Constraint\AssertOrderGrandTotal" /> - <constraint name="Magento\Signifyd\Test\Constraint\AssertSignifydCaseInCommentsHistory" /> - <constraint name="Magento\Sales\Test\Constraint\AssertDenyPaymentMessageInCommentsHistory" /> - <constraint name="Magento\Sales\Test\Constraint\AssertOrderStatusIsCorrect" /> - <constraint name="Magento\Signifyd\Test\Constraint\AssertSignifydGuaranteeCancelInCommentsHistory" /> - </variation> - </testCase> -</config> diff --git a/dev/tests/functional/tests/app/Magento/Signifyd/Test/TestStep/OpenOrderGridStep.php b/dev/tests/functional/tests/app/Magento/Signifyd/Test/TestStep/OpenOrderGridStep.php deleted file mode 100644 index 409dffc8340b7..0000000000000 --- a/dev/tests/functional/tests/app/Magento/Signifyd/Test/TestStep/OpenOrderGridStep.php +++ /dev/null @@ -1,173 +0,0 @@ -<?php -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ -namespace Magento\Signifyd\Test\TestStep; - -use Magento\Mtf\TestStep\TestStepInterface; -use Magento\Sales\Test\Page\Adminhtml\OrderIndex; -use Magento\Sales\Test\Page\Adminhtml\SalesOrderView; -use Magento\Sales\Test\Constraint\AssertOrderStatusIsCorrect as AssertOrderStatus; -use Magento\Signifyd\Test\Constraint\AssertSignifydCaseInOrdersGrid as AssertOrdersGrid; -use Magento\Signifyd\Test\Constraint\AssertCaseInfoOnAdmin; -use Magento\Signifyd\Test\Fixture\SignifydData; -use Magento\Signifyd\Test\Page\Adminhtml\OrdersGrid; - -/** - * Open order grid step. - */ -class OpenOrderGridStep implements TestStepInterface -{ - /** - * Magento order status assertion. - * - * @var AssertOrderStatus - */ - private $assertOrderStatus; - - /** - * Case information on Magento Admin assertion. - * - * @var AssertCaseInfoOnAdmin - */ - private $assertCaseInfo; - - /** - * Case information on Magento order grid assertion. - * - * @var AssertOrdersGrid - */ - private $assertOrdersGrid; - - /** - * Magento order status. - * - * @var string - */ - private $placeOrderStatus; - - /** - * Magento order id. - * - * @var int - */ - private $orderId; - - /** - * Order View Page. - * - * @var SalesOrderView - */ - private $salesOrderView; - - /** - * Orders grid page. - * - * @var OrdersGrid - */ - private $ordersGrid; - - /** - * Signifyd data fixture. - * - * @var array - */ - private $signifydData; - - /** - * Orders Page. - * - * @var OrderIndex - */ - private $orderIndex; - - /** - * @param string $placeOrderStatus - * @param int $orderId - * @param OrderIndex $orderIndex - * @param SalesOrderView $salesOrderView - * @param OrdersGrid $ordersGrid - * @param AssertOrderStatus $assertOrderStatus - * @param AssertCaseInfoOnAdmin $assertCaseInfo - * @param AssertOrdersGrid $assertOrdersGrid - * @param SignifydData $signifydData - */ - public function __construct( - $placeOrderStatus, - $orderId, - OrderIndex $orderIndex, - SalesOrderView $salesOrderView, - OrdersGrid $ordersGrid, - AssertOrderStatus $assertOrderStatus, - AssertCaseInfoOnAdmin $assertCaseInfo, - AssertOrdersGrid $assertOrdersGrid, - SignifydData $signifydData - ) { - $this->placeOrderStatus = $placeOrderStatus; - $this->orderId = $orderId; - $this->orderIndex = $orderIndex; - $this->salesOrderView = $salesOrderView; - $this->ordersGrid = $ordersGrid; - $this->assertOrderStatus = $assertOrderStatus; - $this->assertCaseInfo = $assertCaseInfo; - $this->assertOrdersGrid = $assertOrdersGrid; - $this->signifydData = $signifydData; - } - - /** - * Open order. - * - * @return void - */ - public function run() - { - $this->checkOrdersGrid(); - $this->checkCaseInfo(); - $this->checkOrderStatus(); - } - - /** - * Run assert to check Signifyd Case Disposition status in orders grid. - * - * @return void - */ - private function checkOrdersGrid() - { - $this->assertOrdersGrid->processAssert( - $this->orderId, - $this->ordersGrid, - $this->signifydData - ); - } - - /** - * Run assert to check order status is valid. - * - * @return void - */ - private function checkOrderStatus() - { - $this->assertOrderStatus->processAssert( - $this->placeOrderStatus, - $this->orderId, - $this->orderIndex, - $this->salesOrderView - ); - } - - /** - * Run assert to check Signifyd Case information is correct in Admin. - * - * @return void - */ - private function checkCaseInfo() - { - $this->assertCaseInfo->processAssert( - $this->salesOrderView, - $this->orderIndex, - $this->signifydData, - $this->orderId - ); - } -} diff --git a/dev/tests/functional/tests/app/Magento/Signifyd/Test/TestStep/SignifydCancelOrderStep.php b/dev/tests/functional/tests/app/Magento/Signifyd/Test/TestStep/SignifydCancelOrderStep.php deleted file mode 100644 index 54f4dd75223e0..0000000000000 --- a/dev/tests/functional/tests/app/Magento/Signifyd/Test/TestStep/SignifydCancelOrderStep.php +++ /dev/null @@ -1,105 +0,0 @@ -<?php -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ -namespace Magento\Signifyd\Test\TestStep; - -use Magento\Mtf\TestStep\TestStepFactory; -use Magento\Mtf\TestStep\TestStepInterface; -use Magento\Sales\Test\Fixture\OrderInjectable; -use Magento\Sales\Test\Page\Adminhtml\OrderIndex; -use Magento\Sales\Test\Page\Adminhtml\SalesOrderView; -use Magento\Sales\Test\TestStep\CancelOrderStep; -use Magento\Sales\Test\TestStep\DenyPaymentStep; -use Magento\Sales\Test\TestStep\UnholdOrderStep; - -/** - * Rollback step for Signifyd scenarios. - */ -class SignifydCancelOrderStep implements TestStepInterface -{ - /** - * Order index page. - * - * @var OrderIndex - */ - private $orderIndex; - - /** - * Order fixture. - * - * @var OrderInjectable - */ - private $order; - - /** - * Order View page. - * - * @var SalesOrderView - */ - private $salesOrderView; - - /** - * Test step factory. - * - * @var TestStepFactory - */ - private $testStepFactory; - - /** - * @param OrderIndex $orderIndex - * @param OrderInjectable $order - * @param SalesOrderView $salesOrderView - * @param TestStepFactory $testStepFactory - */ - public function __construct( - OrderIndex $orderIndex, - OrderInjectable $order, - SalesOrderView $salesOrderView, - TestStepFactory $testStepFactory - ) { - $this->orderIndex = $orderIndex; - $this->order = $order; - $this->salesOrderView = $salesOrderView; - $this->testStepFactory = $testStepFactory; - } - - /** - * @inheritdoc - */ - public function run() - { - $this->orderIndex->open(); - $this->orderIndex->getSalesOrderGrid() - ->searchAndOpen(['id' => $this->order->getId()]); - - switch ($this->salesOrderView->getOrderInfoBlock()->getOrderStatus()) { - case 'Suspected Fraud': - $this->getStepInstance(DenyPaymentStep::class)->run(); - break; - case 'On Hold': - $this->getStepInstance(UnholdOrderStep::class)->run(); - $this->getStepInstance(CancelOrderStep::class)->run(); - break; - case 'Canceled': - break; - default: - $this->getStepInstance(CancelOrderStep::class)->run(); - } - } - - /** - * Creates test step instance with preset params. - * - * @param string $class - * @return TestStepInterface - */ - private function getStepInstance($class) - { - return $this->testStepFactory->create( - $class, - ['order' => $this->order] - ); - } -} diff --git a/dev/tests/functional/tests/app/Magento/Signifyd/Test/TestStep/SignifydCreateCustomerStep.php b/dev/tests/functional/tests/app/Magento/Signifyd/Test/TestStep/SignifydCreateCustomerStep.php deleted file mode 100644 index 5fec5988d2c9f..0000000000000 --- a/dev/tests/functional/tests/app/Magento/Signifyd/Test/TestStep/SignifydCreateCustomerStep.php +++ /dev/null @@ -1,77 +0,0 @@ -<?php -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ -namespace Magento\Signifyd\Test\TestStep; - -use Magento\Customer\Test\Fixture\Customer; -use Magento\Customer\Test\TestStep\CreateCustomerStep; -use Magento\Customer\Test\TestStep\DeleteCustomerStep; -use Magento\Mtf\TestStep\TestStepFactory; -use Magento\Mtf\TestStep\TestStepInterface; - -/** - * Customized create customer step with remove cleanup. - */ -class SignifydCreateCustomerStep implements TestStepInterface -{ - /** - * Customer fixture. - * - * @var Customer - */ - private $customer; - - /** - * Test step factory. - * - * @var TestStepFactory - */ - private $testStepFactory; - - /** - * @param Customer $customer - * @param TestStepFactory $testStepFactory - */ - public function __construct( - Customer $customer, - TestStepFactory $testStepFactory - ) { - $this->customer = $customer; - $this->testStepFactory = $testStepFactory; - } - - /** - * Run step flow. - * - * @return void - */ - public function run() - { - $this->getStepInstance(CreateCustomerStep::class)->run(); - } - - /** - * @return void - */ - public function cleanup() - { - $this->getStepInstance(CreateCustomerStep::class)->cleanup(); - $this->getStepInstance(DeleteCustomerStep::class)->run(); - } - - /** - * Creates test step instance with preset params. - * - * @param string $class - * @return TestStepInterface - */ - private function getStepInstance($class) - { - return $this->testStepFactory->create( - $class, - ['customer' => $this->customer] - ); - } -} diff --git a/dev/tests/functional/tests/app/Magento/Signifyd/Test/TestStep/SignifydFillShippingAddressStep.php b/dev/tests/functional/tests/app/Magento/Signifyd/Test/TestStep/SignifydFillShippingAddressStep.php deleted file mode 100644 index 0b1dda1d0a46a..0000000000000 --- a/dev/tests/functional/tests/app/Magento/Signifyd/Test/TestStep/SignifydFillShippingAddressStep.php +++ /dev/null @@ -1,70 +0,0 @@ -<?php -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ -namespace Magento\Signifyd\Test\TestStep; - -use Magento\Checkout\Test\TestStep\FillShippingAddressStep; -use Magento\Checkout\Test\Page\CheckoutOnepage; -use Magento\Mtf\Fixture\FixtureFactory; -use Magento\Customer\Test\Fixture\Customer; -use Magento\Mtf\ObjectManager; -use Magento\Signifyd\Test\Fixture\SignifydAddress; - -/** - * Class SignifydFillShippingAddressStep only overrides type of $shippingAddress. - * - * We cannot configure Checkout_FillShippingAddressStep this via di.xml, - * because 'source' handler Firstname, specified in SignifydAddress - * fixture did not apply when the step was called from testcase.xml scenario. - * - * Note. When fixture was called directly in the class constructor, - * source handlers applied correctly. - */ -class SignifydFillShippingAddressStep extends FillShippingAddressStep -{ - /** - * @var SignifydAddress|null - */ - private $signifydAddress; - - /** - * @param CheckoutOnepage $checkoutOnepage - * @param Customer $customer - * @param ObjectManager $objectManager - * @param FixtureFactory $fixtureFactory - * @param SignifydAddress|null $signifydAddress - * @param null $shippingAddressCustomer - */ - public function __construct( - CheckoutOnepage $checkoutOnepage, - Customer $customer, - ObjectManager $objectManager, - FixtureFactory $fixtureFactory, - SignifydAddress $signifydAddress = null, - $shippingAddressCustomer = null - ) { - parent::__construct( - $checkoutOnepage, - $customer, - $objectManager, - $fixtureFactory, - $signifydAddress, - $shippingAddressCustomer - ); - $this->signifydAddress = $signifydAddress; - } - - /** - * @inheritdoc - */ - public function run() - { - parent::run(); - - return [ - 'signifydAddress' => $this->signifydAddress, - ]; - } -} diff --git a/dev/tests/functional/tests/app/Magento/Signifyd/Test/TestStep/SignifydLoginStep.php b/dev/tests/functional/tests/app/Magento/Signifyd/Test/TestStep/SignifydLoginStep.php deleted file mode 100644 index 3dd1b94d6b505..0000000000000 --- a/dev/tests/functional/tests/app/Magento/Signifyd/Test/TestStep/SignifydLoginStep.php +++ /dev/null @@ -1,68 +0,0 @@ -<?php -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ -namespace Magento\Signifyd\Test\TestStep; - -use Magento\Mtf\TestStep\TestStepInterface; -use Magento\Signifyd\Test\Fixture\SignifydAccount; -use Magento\Signifyd\Test\Page\SignifydConsole\SignifydCases; -use Magento\Signifyd\Test\Page\SignifydConsole\SignifydLogin; - -/** - * Login into Signifyd console step. - */ -class SignifydLoginStep implements TestStepInterface -{ - /** - * Signifyd account fixture. - * - * @var SignifydAccount - */ - private $signifydAccount; - - /** - * Signifyd login page. - * - * @var SignifydLogin - */ - private $signifydLogin; - - /** - * Signifyd cases page. - * - * @var SignifydCases - */ - private $signifydCases; - - /** - * @param SignifydAccount $signifydAccount - * @param SignifydLogin $signifydLogin - * @param SignifydCases $signifydCases - */ - public function __construct( - SignifydAccount $signifydAccount, - SignifydLogin $signifydLogin, - SignifydCases $signifydCases - ) { - $this->signifydAccount = $signifydAccount; - $this->signifydLogin = $signifydLogin; - $this->signifydCases = $signifydCases; - } - - /** - * @inheritdoc - */ - public function run() - { - $this->signifydLogin->open(); - - if ($this->signifydLogin->getLoginBlock()->isVisible()) { - $this->signifydLogin->getLoginBlock()->fill($this->signifydAccount); - $this->signifydLogin->getLoginBlock()->login(); - } - - $this->signifydCases->getCaseSearchBlock()->waitForLoading(); - } -} diff --git a/dev/tests/functional/tests/app/Magento/Signifyd/Test/TestStep/SignifydObserveCaseStep.php b/dev/tests/functional/tests/app/Magento/Signifyd/Test/TestStep/SignifydObserveCaseStep.php deleted file mode 100644 index c00c81fa237e0..0000000000000 --- a/dev/tests/functional/tests/app/Magento/Signifyd/Test/TestStep/SignifydObserveCaseStep.php +++ /dev/null @@ -1,165 +0,0 @@ -<?php -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ -namespace Magento\Signifyd\Test\TestStep; - -use Magento\Mtf\TestStep\TestStepFactory; -use Magento\Mtf\TestStep\TestStepInterface; -use Magento\Sales\Test\Fixture\OrderInjectable; -use Magento\Signifyd\Test\Constraint\AssertCaseInfoOnSignifydConsole; -use Magento\Signifyd\Test\Fixture\SignifydAddress; -use Magento\Signifyd\Test\Fixture\SignifydData; -use Magento\Signifyd\Test\Page\SignifydConsole\SignifydCases; -use Magento\Signifyd\Test\Page\SignifydConsole\SignifydNotifications; - -/** - * Observe case information in Signifyd console step. - */ -class SignifydObserveCaseStep implements TestStepInterface -{ - /** - * Case information on Signifyd console assertion. - * - * @var AssertCaseInfoOnSignifydConsole - */ - private $assertCaseInfo; - - /** - * Billing address fixture. - * - * @var SignifydAddress - */ - private $signifydAddress; - - /** - * Signifyd cases page. - * - * @var SignifydCases - */ - private $signifydCases; - - /** - * Signifyd notifications page. - * - * @var SignifydNotifications - */ - private $signifydNotifications; - - /** - * Signifyd data fixture. - * - * @var array - */ - private $signifydData; - - /** - * Prices list. - * - * @var array - */ - private $prices; - - /** - * Order fixture. - * - * @var string - */ - private $order; - - /** - * Test step factory. - * - * @var TestStepFactory - */ - private $testStepFactory; - - /** - * @var int - */ - private $searchAttempts = 10; - - /** - * @param AssertCaseInfoOnSignifydConsole $assertCaseInfoOnSignifydConsole - * @param SignifydAddress $signifydAddress - * @param SignifydCases $signifydCases - * @param SignifydNotifications $signifydNotifications - * @param SignifydData $signifydData - * @param OrderInjectable $order - * @param TestStepFactory $testStepFactory - * @param array $prices - */ - public function __construct( - AssertCaseInfoOnSignifydConsole $assertCaseInfoOnSignifydConsole, - SignifydAddress $signifydAddress, - SignifydCases $signifydCases, - SignifydNotifications $signifydNotifications, - SignifydData $signifydData, - OrderInjectable $order, - TestStepFactory $testStepFactory, - array $prices - ) { - $this->assertCaseInfo = $assertCaseInfoOnSignifydConsole; - $this->signifydAddress = $signifydAddress; - $this->signifydCases = $signifydCases; - $this->signifydNotifications = $signifydNotifications; - $this->signifydData = $signifydData; - $this->order = $order; - $this->testStepFactory = $testStepFactory; - $this->prices = $prices; - } - - /** - * @inheritdoc - */ - public function run() - { - $this->signifydCases->open(); - // Search case few times because it can appear with delay. - for ($attempts = $this->searchAttempts; $attempts > 0; $attempts--) { - $this->signifydCases->getCaseSearchBlock() - ->searchCaseByCustomerName($this->signifydAddress->getFirstname()); - if ($this->signifydCases->getCaseSearchBlock()->isAnyCaseVisible()) { - break; - } - sleep(3); - } - - $this->signifydCases->getCaseSearchBlock()->selectCase(); - $this->signifydCases->getCaseInfoBlock()->flagCase($this->signifydData->getCaseFlag()); - - $this->assertCaseInfo->processAssert( - $this->signifydCases, - $this->signifydAddress, - $this->signifydData, - $this->prices, - $this->order->getId(), - $this->getCustomerFullName($this->signifydAddress) - ); - } - - /** - * Cancel order if test fails, or in the end of variation. - * - * @return void - */ - public function cleanup() - { - $this->testStepFactory->create( - SignifydCancelOrderStep::class, - ['order' => $this->order] - )->run(); - } - - /** - * Gets customer full name. - * - * @param SignifydAddress $billingAddress - * @return string - */ - private function getCustomerFullName(SignifydAddress $billingAddress) - { - return sprintf('%s %s', $billingAddress->getFirstname(), $billingAddress->getLastname()); - } -} diff --git a/dev/tests/functional/tests/app/Magento/Signifyd/Test/TestStep/SignifydSetWebhookHandlersStep.php b/dev/tests/functional/tests/app/Magento/Signifyd/Test/TestStep/SignifydSetWebhookHandlersStep.php deleted file mode 100644 index 2b630b8c1dac8..0000000000000 --- a/dev/tests/functional/tests/app/Magento/Signifyd/Test/TestStep/SignifydSetWebhookHandlersStep.php +++ /dev/null @@ -1,64 +0,0 @@ -<?php -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ -namespace Magento\Signifyd\Test\TestStep; - -use Magento\Mtf\TestStep\TestStepInterface; -use Magento\Signifyd\Test\Fixture\SignifydData; -use Magento\Signifyd\Test\Page\SignifydConsole\SignifydNotifications; - -/** - * Set webhook handlers in Signifyd console step. - */ -class SignifydSetWebhookHandlersStep implements TestStepInterface -{ - /** - * Signifyd Notifications page. - * - * @var SignifydNotifications - */ - private $signifydNotifications; - - /** - * Signifyd data fixture. - * - * @var array - */ - private $signifydData; - - /** - * @param SignifydNotifications $signifydNotifications - * @param SignifydData $signifydData - */ - public function __construct( - SignifydNotifications $signifydNotifications, - SignifydData $signifydData - ) { - $this->signifydNotifications = $signifydNotifications; - $this->signifydData = $signifydData; - } - - /** - * @inheritdoc - */ - public function run() - { - $this->signifydNotifications->open(); - $this->signifydNotifications->getWebhooksBlock() - ->create($this->signifydData->getTeam()); - } - - /** - * Removes webhooks if test fails, or in the end of variation execution. - * - * @return void - */ - public function cleanup() - { - $this->signifydNotifications->open(); - $this->signifydNotifications->getWebhooksBlock() - ->cleanup($this->signifydData->getTeam()); - } -} diff --git a/dev/tests/functional/tests/app/Magento/Signifyd/Test/TestStep/UnholdAndCancelOrderStep.php b/dev/tests/functional/tests/app/Magento/Signifyd/Test/TestStep/UnholdAndCancelOrderStep.php deleted file mode 100644 index 0c90b1b76937b..0000000000000 --- a/dev/tests/functional/tests/app/Magento/Signifyd/Test/TestStep/UnholdAndCancelOrderStep.php +++ /dev/null @@ -1,84 +0,0 @@ -<?php -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ -namespace Magento\Signifyd\Test\TestStep; - -use Magento\Mtf\TestStep\TestStepFactory; -use Magento\Mtf\TestStep\TestStepInterface; -use Magento\Sales\Test\Fixture\OrderInjectable; -use Magento\Sales\Test\TestStep\CancelOrderStep; -use Magento\Sales\Test\TestStep\UnholdOrderStep; - -/** - * Unhold and cancel order. - */ -class UnholdAndCancelOrderStep implements TestStepInterface -{ - /** - * Magento order status. - * - * @var string - */ - private $placeOrderStatus; - - /** - * Order fixture. - * - * @var OrderInjectable - */ - private $order; - - /** - * Test step factory. - * - * @var TestStepFactory - */ - private $testStepFactory; - - /** - * @param string $placeOrderStatus - * @param OrderInjectable $order - * @param TestStepFactory $testStepFactory - */ - public function __construct( - $placeOrderStatus, - OrderInjectable $order, - TestStepFactory $testStepFactory - ) { - $this->placeOrderStatus = $placeOrderStatus; - $this->order = $order; - $this->testStepFactory = $testStepFactory; - } - - /** - * Cancel order step. - * - * If order was held - unhold and then cancel the order. - * - * @return void - */ - public function run() - { - if ($this->placeOrderStatus === 'On Hold') { - $this->getStepInstance(UnholdOrderStep::class)->run(); - } - - $this->getStepInstance(CancelOrderStep::class)->run(); - } - - /** - * Creates test step instance with preset params. - * - * @param string $class - * @return TestStepInterface - */ - private function getStepInstance($class) - { - return $this->testStepFactory->create( - $class, - ['order' => $this->order] - ); - } -} diff --git a/dev/tests/functional/tests/app/Magento/Signifyd/Test/etc/di.xml b/dev/tests/functional/tests/app/Magento/Signifyd/Test/etc/di.xml deleted file mode 100644 index 2ba4b6c97d33f..0000000000000 --- a/dev/tests/functional/tests/app/Magento/Signifyd/Test/etc/di.xml +++ /dev/null @@ -1,34 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ - --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> - <type name="Magento\Signifyd\Test\Constraint\AssertCaseInfoOnAdmin"> - <arguments> - <argument name="severity" xsi:type="string">S1</argument> - </arguments> - </type> - <type name="Magento\Signifyd\Test\Constraint\AssertCaseInfoOnSignifydConsole"> - <arguments> - <argument name="severity" xsi:type="string">S1</argument> - </arguments> - </type> - <type name="Magento\Signifyd\Test\Constraint\AssertSignifydCaseInCommentsHistory"> - <arguments> - <argument name="severity" xsi:type="string">S1</argument> - </arguments> - </type> - <type name="Magento\Signifyd\Test\Constraint\AssertSignifydCaseInOrdersGrid"> - <arguments> - <argument name="severity" xsi:type="string">S1</argument> - </arguments> - </type> - <type name="Magento\Signifyd\Test\Constraint\AssertSignifydGuaranteeCancelInCommentsHistory"> - <arguments> - <argument name="severity" xsi:type="string">S2</argument> - </arguments> - </type> -</config> diff --git a/dev/tests/functional/tests/app/Magento/Signifyd/Test/etc/testcase.xml b/dev/tests/functional/tests/app/Magento/Signifyd/Test/etc/testcase.xml deleted file mode 100644 index cfbd2e6ace2b4..0000000000000 --- a/dev/tests/functional/tests/app/Magento/Signifyd/Test/etc/testcase.xml +++ /dev/null @@ -1,58 +0,0 @@ -<?xml version="1.0"?> -<!-- -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ ---> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/Magento/Mtf/TestCase/etc/testcase.xsd"> - <scenario name="CreateSignifydGuaranteeAndCancelOrderTest" firstStep="signifydLogin"> - <step name="signifydLogin" module="Magento_Signifyd" next="signifydSetWebhookHandlers" /> - <step name="signifydSetWebhookHandlers" module="Magento_Signifyd" next="setupConfiguration" /> - <step name="setupConfiguration" module="Magento_Config" next="createProducts" /> - <step name="createProducts" module="Magento_Catalog" next="addProductsToTheCart" /> - <step name="addProductsToTheCart" module="Magento_Checkout" next="proceedToCheckoutFromMiniShoppingCart" /> - <step name="proceedToCheckoutFromMiniShoppingCart" module="Magento_Checkout" next="signifydCreateCustomer" /> - <step name="signifydCreateCustomer" module="Magento_Signifyd" next="selectCheckoutMethod" /> - <step name="selectCheckoutMethod" module="Magento_Checkout" next="signifydFillShippingAddress" /> - <step name="signifydFillShippingAddress" module="Magento_Signifyd" next="fillShippingMethod" /> - <step name="fillShippingMethod" module="Magento_Checkout" next="selectPaymentMethod" /> - <step name="selectPaymentMethod" module="Magento_Checkout" next="placeOrder" /> - <step name="placeOrder" module="Magento_Checkout" next="signifydObserveCase" /> - <step name="signifydObserveCase" module="Magento_Signifyd" next="openOrderGrid" /> - <step name="openOrderGrid" module="Magento_Signifyd" next="unholdAndCancelOrder" /> - <step name="unholdAndCancelOrder" module="Magento_Signifyd" /> - </scenario> - <scenario name="AcceptPaymentWithSignifydGuaranteeDeclinedTest" firstStep="signifydLogin"> - <step name="signifydLogin" module="Magento_Signifyd" next="signifydSetWebhookHandlers" /> - <step name="signifydSetWebhookHandlers" module="Magento_Signifyd" next="setupConfiguration" /> - <step name="setupConfiguration" module="Magento_Config" next="createProducts" /> - <step name="createProducts" module="Magento_Catalog" next="addProductsToTheCart" /> - <step name="addProductsToTheCart" module="Magento_Checkout" next="proceedToCheckoutFromMiniShoppingCart" /> - <step name="proceedToCheckoutFromMiniShoppingCart" module="Magento_Checkout" next="signifydCreateCustomer" /> - <step name="signifydCreateCustomer" module="Magento_Signifyd" next="selectCheckoutMethod" /> - <step name="selectCheckoutMethod" module="Magento_Checkout" next="signifydFillShippingAddress" /> - <step name="signifydFillShippingAddress" module="Magento_Signifyd" next="fillShippingMethod" /> - <step name="fillShippingMethod" module="Magento_Checkout" next="placeOrderWithHostedPro" /> - <step name="placeOrderWithHostedPro" module="Magento_Paypal" next="signifydObserveCase" /> - <step name="signifydObserveCase" module="Magento_Signifyd" next="openOrderGrid" /> - <step name="openOrderGrid" module="Magento_Signifyd" next="acceptPayment" /> - <step name="acceptPayment" module="Magento_Sales" /> - </scenario> - <scenario name="DenyPaymentWithSignifydGuaranteeDeclinedTest" firstStep="signifydLogin"> - <step name="signifydLogin" module="Magento_Signifyd" next="signifydSetWebhookHandlers" /> - <step name="signifydSetWebhookHandlers" module="Magento_Signifyd" next="setupConfiguration" /> - <step name="setupConfiguration" module="Magento_Config" next="createProducts" /> - <step name="createProducts" module="Magento_Catalog" next="addProductsToTheCart" /> - <step name="addProductsToTheCart" module="Magento_Checkout" next="proceedToCheckoutFromMiniShoppingCart" /> - <step name="proceedToCheckoutFromMiniShoppingCart" module="Magento_Checkout" next="signifydCreateCustomer" /> - <step name="signifydCreateCustomer" module="Magento_Signifyd" next="selectCheckoutMethod" /> - <step name="selectCheckoutMethod" module="Magento_Checkout" next="signifydFillShippingAddress" /> - <step name="signifydFillShippingAddress" module="Magento_Signifyd" next="fillShippingMethod" /> - <step name="fillShippingMethod" module="Magento_Checkout" next="placeOrderWithHostedPro" /> - <step name="placeOrderWithHostedPro" module="Magento_Paypal" next="signifydObserveCase" /> - <step name="signifydObserveCase" module="Magento_Signifyd" next="openOrderGrid" /> - <step name="openOrderGrid" module="Magento_Signifyd" next="denyPayment" /> - <step name="denyPayment" module="Magento_Sales" /> - </scenario> -</config> diff --git a/dev/tests/functional/tests/app/Magento/User/Test/TestCase/CreateAdminUserRoleEntityTest.xml b/dev/tests/functional/tests/app/Magento/User/Test/TestCase/CreateAdminUserRoleEntityTest.xml index 19b7406139584..4ae4c476a959b 100644 --- a/dev/tests/functional/tests/app/Magento/User/Test/TestCase/CreateAdminUserRoleEntityTest.xml +++ b/dev/tests/functional/tests/app/Magento/User/Test/TestCase/CreateAdminUserRoleEntityTest.xml @@ -8,7 +8,7 @@ <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/etc/variations.xsd"> <testCase name="Magento\User\Test\TestCase\CreateAdminUserRoleEntityTest" summary="Create Admin User Role" ticketId="MAGETWO-23413"> <variation name="CreateAdminUserRoleEntityTestVariation1"> - <data name="tag" xsi:type="string">test_type:extended_acceptance_test</data> + <data name="tag" xsi:type="string">test_type:extended_acceptance_test, mftf_migrated:yes</data> <data name="role/data/rolename" xsi:type="string">AdminRole%isolation%</data> <data name="role/data/current_password" xsi:type="string">%current_password%</data> <data name="role/data/resource_access" xsi:type="string">Custom</data> @@ -22,6 +22,7 @@ <data name="role/data/resource_access" xsi:type="string">All</data> <constraint name="Magento\User\Test\Constraint\AssertRoleSuccessSaveMessage" /> <constraint name="Magento\User\Test\Constraint\AssertRoleInGrid" /> + <data name="tag" xsi:type="string">mftf_migrated:yes</data> </variation> <variation name="CreateAdminUserRoleEntityTestVariation3"> <data name="role/data/rolename" xsi:type="string">AdminRole%isolation%</data> @@ -29,6 +30,7 @@ <data name="role/data/resource_access" xsi:type="string">All</data> <constraint name="Magento\User\Test\Constraint\AssertIncorrectUserPassword" /> <constraint name="Magento\User\Test\Constraint\AssertRoleNotInGrid" /> + <data name="tag" xsi:type="string">mftf_migrated:yes</data> </variation> </testCase> </config> diff --git a/dev/tests/functional/tests/app/Magento/User/Test/TestCase/DeleteAdminUserEntityTest.xml b/dev/tests/functional/tests/app/Magento/User/Test/TestCase/DeleteAdminUserEntityTest.xml index 2d44f86a17fe1..58e3fc4e76b30 100644 --- a/dev/tests/functional/tests/app/Magento/User/Test/TestCase/DeleteAdminUserEntityTest.xml +++ b/dev/tests/functional/tests/app/Magento/User/Test/TestCase/DeleteAdminUserEntityTest.xml @@ -12,12 +12,14 @@ <data name="systemAdmin/dataset" xsi:type="string">system_admin</data> <constraint name="Magento\User\Test\Constraint\AssertImpossibleDeleteYourOwnAccount" /> <constraint name="Magento\User\Test\Constraint\AssertUserInGrid" /> + <data name="tag" xsi:type="string">mftf_migrated:yes</data> </variation> <variation name="DeleteAdminUserEntityTestVariation2"> <data name="isDefaultUser" xsi:type="string">1</data> <data name="systemAdmin/dataset" xsi:type="string">system_admin</data> <constraint name="Magento\User\Test\Constraint\AssertUserSuccessDeleteMessage" /> <constraint name="Magento\User\Test\Constraint\AssertUserNotInGrid" /> + <data name="tag" xsi:type="string">mftf_migrated:yes</data> </variation> </testCase> </config> diff --git a/dev/tests/integration/testsuite/Magento/AsynchronousOperations/Model/SaveMultipleOperationsTest.php b/dev/tests/integration/testsuite/Magento/AsynchronousOperations/Model/SaveMultipleOperationsTest.php new file mode 100644 index 0000000000000..cbf20d9e8ab59 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/AsynchronousOperations/Model/SaveMultipleOperationsTest.php @@ -0,0 +1,117 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +namespace Magento\AsynchronousOperations\Model; + +use Magento\AsynchronousOperations\Api\Data\OperationInterface; +use Magento\AsynchronousOperations\Api\Data\OperationInterfaceFactory; +use Magento\AsynchronousOperations\Api\SaveMultipleOperationsInterface; +use Magento\AsynchronousOperations\Model\BulkStatus; +use Magento\AsynchronousOperations\Api\Data\BulkSummaryInterface; +use Magento\AsynchronousOperations\Api\Data\BulkSummaryInterfaceFactory; +use Magento\Framework\EntityManager\EntityManager; + +class SaveMultipleOperationsTest extends \PHPUnit\Framework\TestCase +{ + + private const BULK_UUID = "bulk-uuid-multiple-0"; + + /** + * @var BulkStatus + */ + private $bulkStatusManagement; + + /** + * @var OperationInterfaceFactory + */ + private $operationFactory; + + /** + * @var SaveMultipleOperationsInterface + */ + private $saveMultipleOperationsInterface; + + /** + * @var EntityManager + */ + private $entityManager; + + /** + * @var BulkSummaryInterfaceFactory + */ + private $bulkSummaryFactory; + + /** + * Set Up the test + */ + protected function setUp() + { + $this->saveMultipleOperationsInterface = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create( + SaveMultipleOperationsInterface::class + ); + $this->operationFactory = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create( + OperationInterfaceFactory::class + ); + $this->bulkStatusManagement = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create( + BulkStatus::class + ); + $this->bulkSummaryFactory = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create( + BulkSummaryInterfaceFactory::class + ); + $this->entityManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create( + EntityManager::class + ); + } + + /** + * Test execute() of SaveMultipleOperations + */ + public function testExecute() + { + $operation = $this->createOperation(); + $operations = [$operation, $operation, $operation]; + + $bulkSummary = $this->bulkSummaryFactory->create(); + $this->entityManager->load($bulkSummary, self::BULK_UUID); + $bulkSummary->setBulkId(self::BULK_UUID); + $bulkSummary->setDescription("Test Bulk"); + $bulkSummary->setUserId(1); + $bulkSummary->setUserType(1); + $bulkSummary->setOperationCount(count($operations)); + $this->entityManager->save($bulkSummary); + + $this->saveMultipleOperationsInterface->execute($operations); + $operationsCount = $this->bulkStatusManagement + ->getOperationsCountByBulkIdAndStatus(self::BULK_UUID, OperationInterface::STATUS_TYPE_OPEN); + $this->assertEquals($operationsCount, 3); + } + + /** + * Create Operation object and pre-fill with test data + * @return OperationInterface + */ + public function createOperation() + { + $serializedData = [ + 'entity_id' => null, + 'entity_link' => '', + 'meta_information' => json_encode([ + 'entity_id' => 5, + 'meta_information' => 'Test' + ]) + ]; + + $data = [ + 'data' => [ + OperationInterface::BULK_ID => self::BULK_UUID, + OperationInterface::TOPIC_NAME => "topic-4", + OperationInterface::SERIALIZED_DATA => json_encode($serializedData), + OperationInterface::STATUS => OperationInterface::STATUS_TYPE_OPEN, + ], + ]; + return $this->operationFactory->create($data); + } +} diff --git a/dev/tests/integration/testsuite/Magento/Customer/Controller/Account/LoginPostTest.php b/dev/tests/integration/testsuite/Magento/Customer/Controller/Account/LoginPostTest.php index 80502833cb2d7..10476eb01f306 100644 --- a/dev/tests/integration/testsuite/Magento/Customer/Controller/Account/LoginPostTest.php +++ b/dev/tests/integration/testsuite/Magento/Customer/Controller/Account/LoginPostTest.php @@ -11,6 +11,7 @@ use Magento\Customer\Model\Url; use Magento\Framework\App\Request\Http as HttpRequest; use Magento\Framework\Message\MessageInterface; +use Magento\Framework\Phrase; use Magento\Framework\Url\EncoderInterface; use Magento\TestFramework\TestCase\AbstractController; @@ -151,6 +152,28 @@ public function testLoginWithRedirectToDashboard(): void $this->assertRedirect($this->stringContains('customer/account/')); } + /** + * @magentoConfigFixture current_store customer/startup/redirect_dashboard 1 + * @magentoConfigFixture current_store customer/captcha/enable 0 + * + * @magentoDataFixture Magento/Customer/_files/customer.php + * + * @return void + */ + public function testNoFormKeyLoginPostAction(): void + { + $this->prepareRequest('customer@example.com', 'password'); + $this->getRequest()->setPostValue('form_key', null); + $this->getRequest()->setParam(Url::REFERER_QUERY_PARAM_NAME, $this->urlEncoder->encode('test_redirect')); + $this->dispatch('customer/account/loginPost'); + $this->assertFalse($this->session->isLoggedIn()); + $this->assertRedirect($this->stringContains('customer/account/')); + $this->assertSessionMessages( + $this->equalTo([new Phrase('Invalid Form Key. Please refresh the page.')]), + MessageInterface::TYPE_ERROR + ); + } + /** * Prepare request * diff --git a/dev/tests/integration/testsuite/Magento/Customer/Controller/AccountTest.php b/dev/tests/integration/testsuite/Magento/Customer/Controller/AccountTest.php index c5fdd050bb46b..7b0a4823f701e 100644 --- a/dev/tests/integration/testsuite/Magento/Customer/Controller/AccountTest.php +++ b/dev/tests/integration/testsuite/Magento/Customer/Controller/AccountTest.php @@ -16,6 +16,7 @@ use Magento\Framework\App\Request\Http as HttpRequest; use Magento\Framework\Data\Form\FormKey; use Magento\Framework\Message\MessageInterface; +use Magento\Framework\Phrase; use Magento\Framework\Serialize\Serializer\Json; use Magento\Framework\Stdlib\CookieManagerInterface; use Magento\Store\Model\StoreManager; @@ -227,6 +228,10 @@ public function testNoFormKeyCreatePostAction() $this->assertNull($this->getCustomerByEmail('test1@email.com')); $this->assertRedirect($this->stringEndsWith('customer/account/create/')); + $this->assertSessionMessages( + $this->equalTo([new Phrase('Invalid Form Key. Please refresh the page.')]), + MessageInterface::TYPE_ERROR + ); } /** @@ -612,6 +617,10 @@ public function testWrongConfirmationEditPostAction() * * @magentoDataFixture Magento/Customer/_files/customer_confirmation_config_enable.php * @return void + * @throws \Magento\Framework\Exception\InputException + * @throws \Magento\Framework\Exception\LocalizedException + * @throws \Magento\Framework\Exception\NoSuchEntityException + * @throws \Magento\Framework\Stdlib\Cookie\FailureToSendException */ public function testRegisterCustomerWithEmailConfirmation(): void { @@ -725,6 +734,10 @@ public function testConfirmationEmailWithSpecialCharacters(): void * @magentoConfigFixture current_store customer/captcha/enable 0 * * @return void + * @throws \Magento\Framework\Exception\InputException + * @throws \Magento\Framework\Exception\LocalizedException + * @throws \Magento\Framework\Exception\NoSuchEntityException + * @throws \Magento\Framework\Exception\State\InputMismatchException */ public function testResetPasswordWhenEmailChanged(): void { diff --git a/dev/tests/integration/testsuite/Magento/Framework/Composer/_files/testFromCreateProject/composer.lock b/dev/tests/integration/testsuite/Magento/Framework/Composer/_files/testFromCreateProject/composer.lock index e723549288cda..69b6d314ee64d 100644 --- a/dev/tests/integration/testsuite/Magento/Framework/Composer/_files/testFromCreateProject/composer.lock +++ b/dev/tests/integration/testsuite/Magento/Framework/Composer/_files/testFromCreateProject/composer.lock @@ -8437,45 +8437,6 @@ ], "description": "N/A" }, - { - "name": "magento/module-signifyd", - "version": "100.3.1", - "dist": { - "type": "zip", - "url": "https://repo.magento.com/archives/magento/module-signifyd/magento-module-signifyd-100.3.1.0.zip", - "reference": null, - "shasum": "768442b807e31bacfb5bbf914e155bac3ca88dde" - }, - "require": { - "magento/framework": "102.0.*", - "magento/module-backend": "101.0.*", - "magento/module-checkout": "100.3.*", - "magento/module-config": "101.1.*", - "magento/module-customer": "102.0.*", - "magento/module-directory": "100.3.*", - "magento/module-payment": "100.3.*", - "magento/module-sales": "102.0.*", - "magento/module-store": "101.0.*", - "php": "~7.1.3||~7.2.0" - }, - "suggest": { - "magento/module-config": "101.1.*" - }, - "type": "magento2-module", - "autoload": { - "files": [ - "registration.php" - ], - "psr-4": { - "Magento\\Signifyd\\": "" - } - }, - "license": [ - "OSL-3.0", - "AFL-3.0" - ], - "description": "Submitting Case Entry to Signifyd on Order Creation" - }, { "name": "magento/module-sitemap", "version": "100.3.1", @@ -9816,7 +9777,6 @@ "magento/module-send-friend": "100.3.1", "magento/module-send-friend-graph-ql": "100.3.0", "magento/module-shipping": "100.3.1", - "magento/module-signifyd": "100.3.1", "magento/module-sitemap": "100.3.1", "magento/module-store": "101.0.1", "magento/module-store-graph-ql": "100.3.1", diff --git a/dev/tests/integration/testsuite/Magento/Framework/Composer/_files/testSkeleton/composer.lock b/dev/tests/integration/testsuite/Magento/Framework/Composer/_files/testSkeleton/composer.lock index 2e2fa561fa4cc..151c2b5eca565 100644 --- a/dev/tests/integration/testsuite/Magento/Framework/Composer/_files/testSkeleton/composer.lock +++ b/dev/tests/integration/testsuite/Magento/Framework/Composer/_files/testSkeleton/composer.lock @@ -8437,45 +8437,6 @@ ], "description": "N/A" }, - { - "name": "magento/module-signifyd", - "version": "100.3.1", - "dist": { - "type": "zip", - "url": "https://repo.magento.com/archives/magento/module-signifyd/magento-module-signifyd-100.3.1.0.zip", - "reference": null, - "shasum": "768442b807e31bacfb5bbf914e155bac3ca88dde" - }, - "require": { - "magento/framework": "102.0.*", - "magento/module-backend": "101.0.*", - "magento/module-checkout": "100.3.*", - "magento/module-config": "101.1.*", - "magento/module-customer": "102.0.*", - "magento/module-directory": "100.3.*", - "magento/module-payment": "100.3.*", - "magento/module-sales": "102.0.*", - "magento/module-store": "101.0.*", - "php": "~7.1.3||~7.2.0" - }, - "suggest": { - "magento/module-config": "101.1.*" - }, - "type": "magento2-module", - "autoload": { - "files": [ - "registration.php" - ], - "psr-4": { - "Magento\\Signifyd\\": "" - } - }, - "license": [ - "OSL-3.0", - "AFL-3.0" - ], - "description": "Submitting Case Entry to Signifyd on Order Creation" - }, { "name": "magento/module-sitemap", "version": "100.3.1", @@ -9816,7 +9777,6 @@ "magento/module-send-friend": "100.3.1", "magento/module-send-friend-graph-ql": "100.3.0", "magento/module-shipping": "100.3.1", - "magento/module-signifyd": "100.3.1", "magento/module-sitemap": "100.3.1", "magento/module-store": "101.0.1", "magento/module-store-graph-ql": "100.3.1", diff --git a/dev/tests/integration/testsuite/Magento/Framework/Filesystem/Driver/FileTest.php b/dev/tests/integration/testsuite/Magento/Framework/Filesystem/Driver/FileTest.php index c8719ea7e0a0a..5dec995f83827 100644 --- a/dev/tests/integration/testsuite/Magento/Framework/Filesystem/Driver/FileTest.php +++ b/dev/tests/integration/testsuite/Magento/Framework/Filesystem/Driver/FileTest.php @@ -64,6 +64,32 @@ protected function tearDown(): void $this->removeGeneratedDirectory(); } + /** + * Tests read directory with symlynked folders. + * + * @return void + */ + public function testReadDirectoryRecursivelyWithSymlinkedFolders(): void + { + $sourceDirectory = $this->generatedPath . '/source'; + $destinationDirectory = $this->generatedPath . '/destination'; + + $this->driver->createDirectory($sourceDirectory); + $this->driver->createDirectory($sourceDirectory . '/directory1'); + $this->driver->createDirectory($destinationDirectory); + + $linkName = $destinationDirectory . '/link'; + $this->driver->symlink($sourceDirectory, $linkName); + + $paths = [ + $destinationDirectory . '/link' . '/directory1', + $destinationDirectory . '/link' + + ]; + $actual = $this->driver->readDirectoryRecursively($destinationDirectory); + $this->assertEquals($paths, $actual); + } + /** * Tests directory recursive read. * diff --git a/dev/tests/integration/testsuite/Magento/Sales/_files/order_list_with_invoice.php b/dev/tests/integration/testsuite/Magento/Sales/_files/order_list_with_invoice.php index d1f74c746b64f..1460f5742c1fc 100644 --- a/dev/tests/integration/testsuite/Magento/Sales/_files/order_list_with_invoice.php +++ b/dev/tests/integration/testsuite/Magento/Sales/_files/order_list_with_invoice.php @@ -45,7 +45,8 @@ 'base_grand_total' => 130.00, 'grand_total' => 130.00, 'subtotal' => 130.00, - 'created_at' => $dateTime->modify('-1 day')->format(DateTime::DATETIME_PHP_FORMAT), + 'created_at' => max($dateTime->modify('-1 day'), $dateTime->modify('first day of this month')) + ->format(DateTime::DATETIME_PHP_FORMAT), ], [ 'increment_id' => '100000004', diff --git a/dev/tests/integration/testsuite/Magento/Signifyd/Block/Adminhtml/CaseInfoTest.php b/dev/tests/integration/testsuite/Magento/Signifyd/Block/Adminhtml/CaseInfoTest.php deleted file mode 100644 index 7607526b1389e..0000000000000 --- a/dev/tests/integration/testsuite/Magento/Signifyd/Block/Adminhtml/CaseInfoTest.php +++ /dev/null @@ -1,123 +0,0 @@ -<?php -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ -namespace Magento\Signifyd\Block\Adminhtml; - -use Magento\Framework\App\RequestInterface; -use Magento\Framework\ObjectManagerInterface; -use Magento\Framework\View\Element\Template\Context; -use Magento\Sales\Model\Order; -use Magento\TestFramework\Helper\Bootstrap; - -class CaseInfoTest extends \PHPUnit\Framework\TestCase -{ - /** - * @var ObjectManagerInterface - */ - private $objectManager; - - /** - * @var Order - */ - private $order; - - /** - * @var \Magento\Framework\View\LayoutFactory - */ - protected $layoutFactory; - - /** - * @inheritdoc - */ - protected function setUp() - { - $this->objectManager = Bootstrap::getObjectManager(); - $this->order = $this->objectManager->create(Order::class); - $this->layoutFactory = $this->objectManager->get(\Magento\Framework\View\LayoutFactory::class); - } - - /** - * Checks that block has contents when case entity for order is exists - * even if Signifyd module is inactive. - * - * @magentoConfigFixture current_store fraud_protection/signifyd/active 0 - * @magentoDataFixture Magento/Signifyd/_files/case.php - * @magentoAppArea adminhtml - */ - public function testModuleIsInactive() - { - $this->order->loadByIncrementId('100000001'); - - self::assertNotEmpty($this->getBlock()->toHtml()); - } - - /** - * Checks that block does not give contents - * if there is no case entity created for order. - * - * @covers \Magento\Signifyd\Block\Adminhtml\CaseInfo::getCaseEntity - * @magentoConfigFixture current_store fraud_protection/signifyd/active 1 - * @magentoDataFixture Magento/Signifyd/_files/order_with_customer_and_two_simple_products.php - * @magentoAppArea adminhtml - */ - public function testCaseEntityNotExists() - { - $this->order->loadByIncrementId('100000001'); - - self::assertEmpty($this->getBlock()->toHtml()); - } - - /** - * Checks that: - * - block give contents - * - block contents guarantee decision field - * - * @covers \Magento\Signifyd\Block\Adminhtml\CaseInfo::getScoreClass - * @magentoConfigFixture current_store fraud_protection/signifyd/active 1 - * @magentoDataFixture Magento/Signifyd/_files/case.php - * @magentoAppArea adminhtml - */ - public function testCaseEntityExists() - { - $this->order->loadByIncrementId('100000001'); - - $block = $this->getBlock(); - self::assertNotEmpty($block->toHtml()); - self::assertContains((string) $block->getCaseGuaranteeDisposition(), $block->toHtml()); - } - - /** - * Gets block. - * - * @return CaseInfo - */ - private function getBlock() - { - $layout = $this->layoutFactory->create(); - - $layout->addContainer('order_additional_info', 'Container'); - - /** @var CaseInfo $block */ - $block = $layout->addBlock(CaseInfo::class, 'order_case_info', 'order_additional_info'); - $block->setAttribute('context', $this->getContext()); - $block->setTemplate('Magento_Signifyd::case_info.phtml'); - - return $block; - } - - /** - * Creates template context with necessary order id param. - * - * @return Context - */ - private function getContext() - { - /** @var RequestInterface $request */ - $request = $this->objectManager->get(RequestInterface::class); - $request->setParams(['order_id' => $this->order->getEntityId()]); - - return $this->objectManager->create(Context::class, ['request' => $request]); - } -} diff --git a/dev/tests/integration/testsuite/Magento/Signifyd/Block/FingerprintTest.php b/dev/tests/integration/testsuite/Magento/Signifyd/Block/FingerprintTest.php deleted file mode 100644 index 1efbb8b6d33e4..0000000000000 --- a/dev/tests/integration/testsuite/Magento/Signifyd/Block/FingerprintTest.php +++ /dev/null @@ -1,63 +0,0 @@ -<?php -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ -namespace Magento\Signifyd\Block; - -use Magento\Framework\App\Area; -use Magento\Framework\App\ObjectManager; -use Magento\Framework\View\LayoutInterface; -use Magento\TestFramework\Helper\Bootstrap; - -class FingerprintTest extends \PHPUnit\Framework\TestCase -{ - /** - * @var ObjectManager - */ - private $objectManager; - - /** - * @inheritdoc - */ - protected function setUp() - { - $bootstrap = Bootstrap::getInstance(); - $bootstrap->loadArea(Area::AREA_FRONTEND); - - $this->objectManager = Bootstrap::getObjectManager(); - } - - /** - * Checks if session id attribute is present when the module is enabled. - * - * @magentoConfigFixture current_store fraud_protection/signifyd/active 1 - */ - public function testSessionIdPresent() - { - self::assertContains('data-order-session-id', $this->getBlockContents()); - } - - /** - * Checks if block is an empty when the module is disabled. - * - * @magentoConfigFixture current_store fraud_protection/signifyd/active 0 - */ - public function testBlockEmpty() - { - self::assertEmpty($this->getBlockContents()); - } - - /** - * Renders block contents. - * - * @return string - */ - private function getBlockContents() - { - $block = $this->objectManager->get(LayoutInterface::class) - ->createBlock(Fingerprint::class); - - return $block->fetchView($block->getTemplateFile()); - } -} diff --git a/dev/tests/integration/testsuite/Magento/Signifyd/Controller/Webhooks/HandlerTest.php b/dev/tests/integration/testsuite/Magento/Signifyd/Controller/Webhooks/HandlerTest.php deleted file mode 100644 index 667cb079f9096..0000000000000 --- a/dev/tests/integration/testsuite/Magento/Signifyd/Controller/Webhooks/HandlerTest.php +++ /dev/null @@ -1,135 +0,0 @@ -<?php -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ -namespace Magento\Signifyd\Controller\Webhooks; - -use Magento\TestFramework\TestCase\AbstractController; -use Magento\Signifyd\Model\SignifydGateway\Response\WebhookRequest; -use Magento\Signifyd\Api\CaseRepositoryInterface; -use Magento\Signifyd\Api\Data\CaseInterface; -use Magento\Sales\Api\Data\OrderStatusHistoryInterface; -use Magento\Sales\Api\OrderRepositoryInterface; - -/** - * Class tests handling webhook post from Signifyd service. - */ -class HandlerTest extends AbstractController -{ - /** - * @var string - */ - private static $entryPoint = 'signifyd/webhooks/handler'; - - /** - * Tests handling webhook message of cases/rescore type. - * Checks updated case entity and comment in order history. - * - * @covers \Magento\Signifyd\Controller\Webhooks\Handler::execute - * @magentoConfigFixture current_store fraud_protection/signifyd/active 1 - * @magentoConfigFixture current_store fraud_protection/signifyd/api_key ApFZZvxGgIxuP8BazSm3v8eGN - * @magentoDataFixture Magento/Signifyd/_files/case.php - */ - public function testExecuteSuccess() - { - $caseId = 123; - $webhookRequest = $this->getWebhookRequest(); - $this->_objectManager->addSharedInstance($webhookRequest, WebhookRequest::class); - - $this->dispatch(self::$entryPoint); - - /** @var CaseRepositoryInterface $caseManagement */ - $caseRepository = $this->_objectManager->get(CaseRepositoryInterface::class); - /** @var CaseInterface $caseEntity */ - $caseEntity = $caseRepository->getByCaseId($caseId); - $orderEntityId = $caseEntity->getOrderId(); - - self::assertNotEmpty($caseEntity); - self::assertEquals('2017-01-06 12:47:03', $caseEntity->getCreatedAt()); - self::assertEquals('2017-01-06 12:47:03', $caseEntity->getUpdatedAt()); - self::assertEquals('Magento', $caseEntity->getAssociatedTeam()['teamName']); - self::assertEquals(true, $caseEntity->isGuaranteeEligible()); - self::assertEquals(CaseInterface::STATUS_OPEN, $caseEntity->getStatus()); - self::assertEquals($orderEntityId, $caseEntity->getOrderId()); - - /** @var OrderRepositoryInterface $orderRepository */ - $orderRepository = $this->_objectManager->get(OrderRepositoryInterface::class); - $order = $orderRepository->get($caseEntity->getOrderId()); - $histories = $order->getStatusHistories(); - self::assertNotEmpty($histories); - - /** @var OrderStatusHistoryInterface $caseCreationComment */ - $caseComment = array_pop($histories); - self::assertInstanceOf(OrderStatusHistoryInterface::class, $caseComment); - - self::assertEquals( - "Case Update: New score for the order is 384. Previous score was 553.", - $caseComment->getComment() - ); - - $this->_objectManager->removeSharedInstance(WebhookRequest::class); - } - - /** - * Tests handling webhook message of cases/test type. - * Controller should response with code 200. - * - * @covers \Magento\Signifyd\Controller\Webhooks\Handler::execute - * @magentoConfigFixture current_store fraud_protection/signifyd/active 1 - */ - public function testExecuteTestSuccess() - { - $webhookRequest = $this->getTestWebhookRequest(); - $this->_objectManager->addSharedInstance($webhookRequest, WebhookRequest::class); - $this->dispatch(self::$entryPoint); - $this->assertEquals(200, $this->getResponse()->getHttpResponseCode()); - $this->_objectManager->removeSharedInstance(WebhookRequest::class); - } - - /** - * Returns mocked WebhookRequest - * - * @return WebhookRequest|\PHPUnit\Framework\MockObject_MockObject - */ - private function getWebhookRequest() - { - $webhookRequest = $this->getMockBuilder(WebhookRequest::class) - ->disableOriginalConstructor() - ->getMock(); - $webhookRequest->expects($this->any()) - ->method('getBody') - ->willReturn(file_get_contents(__DIR__ . '/../../_files/webhook_body.json')); - $webhookRequest->expects($this->any()) - ->method('getEventTopic') - ->willReturn('cases/rescore'); - $webhookRequest->expects($this->any()) - ->method('getHash') - ->willReturn('m/X29RcHWPSCDPgQuSXjnyTfKISJDopcdGbVsRLeqy8='); - - return $webhookRequest; - } - - /** - * Returns mocked test WebhookRequest - * - * @return WebhookRequest|\PHPUnit\Framework\MockObject_MockObject - */ - private function getTestWebhookRequest() - { - $webhookRequest = $this->getMockBuilder(WebhookRequest::class) - ->disableOriginalConstructor() - ->getMock(); - $webhookRequest->expects($this->any()) - ->method('getBody') - ->willReturn(file_get_contents(__DIR__ . '/../../_files/webhook_body.json')); - $webhookRequest->expects($this->any()) - ->method('getEventTopic') - ->willReturn('cases/test'); - $webhookRequest->expects($this->any()) - ->method('getHash') - ->willReturn('wyG0r9mOmv1IqVlN6ZqJ5sgA635yKW6lbSsqlYF2b8U='); - - return $webhookRequest; - } -} diff --git a/dev/tests/integration/testsuite/Magento/Signifyd/Model/CaseManagementTest.php b/dev/tests/integration/testsuite/Magento/Signifyd/Model/CaseManagementTest.php deleted file mode 100644 index 30603baf867ff..0000000000000 --- a/dev/tests/integration/testsuite/Magento/Signifyd/Model/CaseManagementTest.php +++ /dev/null @@ -1,83 +0,0 @@ -<?php -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ -namespace Magento\Signifyd\Model; - -use Magento\Framework\Api\SearchCriteriaBuilder; -use Magento\Framework\App\ObjectManager; -use Magento\Sales\Api\Data\OrderInterface; -use Magento\Sales\Api\OrderRepositoryInterface; -use Magento\Signifyd\Api\Data\CaseInterface; -use Magento\TestFramework\Helper\Bootstrap; - -/** - * Contains test methods for case management service - */ -class CaseManagementTest extends \PHPUnit\Framework\TestCase -{ - /** - * @var CaseManagement - */ - private $caseManagement; - - /** - * @var ObjectManager - */ - private $objectManager; - - protected function setup() - { - $this->objectManager = Bootstrap::getObjectManager(); - $this->caseManagement = $this->objectManager->get(CaseManagement::class); - } - - /** - * @covers \Magento\Signifyd\Model\CaseManagement::create - * @magentoDataFixture Magento/Signifyd/_files/order_with_customer_and_two_simple_products.php - */ - public function testCreate() - { - $order = $this->getOrder(); - $case = $this->caseManagement->create($order->getEntityId()); - - self::assertNotEmpty($case->getEntityId()); - self::assertEquals(CaseInterface::STATUS_PENDING, $case->getStatus()); - self::assertEquals(CaseInterface::GUARANTEE_PENDING, $case->getGuaranteeDisposition()); - } - - /** - * @covers \Magento\Signifyd\Model\CaseManagement::getByOrderId - * @magentoDataFixture Magento/Signifyd/_files/case.php - */ - public function testGetByOrderId() - { - $order = $this->getOrder(); - $case = $this->caseManagement->getByOrderId($order->getEntityId()); - - self::assertEquals(CaseInterface::STATUS_PROCESSING, $case->getStatus()); - self::assertEquals(CaseInterface::DISPOSITION_GOOD, $case->getReviewDisposition()); - self::assertEquals('2016-12-12 15:17:17', $case->getCreatedAt()); - self::assertEquals('2016-12-12 19:23:16', $case->getUpdatedAt()); - } - - /** - * Get stored order - * @return OrderInterface - */ - private function getOrder() - { - /** @var SearchCriteriaBuilder $searchCriteriaBuilder */ - $searchCriteriaBuilder = $this->objectManager->get(SearchCriteriaBuilder::class); - $searchCriteria = $searchCriteriaBuilder->addFilter(OrderInterface::INCREMENT_ID, '100000001') - ->create(); - - $orderRepository = $this->objectManager->get(OrderRepositoryInterface::class); - $orders = $orderRepository->getList($searchCriteria) - ->getItems(); - - /** @var OrderInterface $order */ - return array_pop($orders); - } -} diff --git a/dev/tests/integration/testsuite/Magento/Signifyd/Model/CaseRepositoryTest.php b/dev/tests/integration/testsuite/Magento/Signifyd/Model/CaseRepositoryTest.php deleted file mode 100644 index ca98a20b15bec..0000000000000 --- a/dev/tests/integration/testsuite/Magento/Signifyd/Model/CaseRepositoryTest.php +++ /dev/null @@ -1,148 +0,0 @@ -<?php -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ -namespace Magento\Signifyd\Model; - -use Magento\Framework\Api\FilterBuilder; -use Magento\Framework\Api\SearchCriteriaBuilder; -use Magento\Framework\App\ObjectManager; -use Magento\Signifyd\Api\Data\CaseInterface; -use Magento\TestFramework\Helper\Bootstrap; - -/** - * Testing case repository - */ -class CaseRepositoryTest extends \PHPUnit\Framework\TestCase -{ - /** - * @var ObjectManager - */ - private $objectManager; - - /** - * @var FilterBuilder - */ - private $filterBuilder; - - /** - * @var SearchCriteriaBuilder - */ - private $searchCriteriaBuilder; - - /** - * @var CaseRepository - */ - private $repository; - - /** - * @inheritdoc - */ - protected function setUp() - { - $this->objectManager = Bootstrap::getObjectManager(); - $this->filterBuilder = $this->objectManager->get(FilterBuilder::class); - $this->searchCriteriaBuilder = $this->objectManager->get(SearchCriteriaBuilder::class); - $this->repository = $this->objectManager->get(CaseRepository::class); - } - - /** - * @covers \Magento\Signifyd\Model\CaseRepository::delete - * @magentoDataFixture Magento/Signifyd/_files/case.php - */ - public function testDelete() - { - $filters = [ - $this->filterBuilder->setField('case_id') - ->setValue(123) - ->create() - ]; - $searchCriteria = $this->searchCriteriaBuilder->addFilters($filters)->create(); - $cases = $this->repository->getList($searchCriteria) - ->getItems(); - - $case = array_pop($cases); - $this->repository->delete($case); - - self::assertEmpty($this->repository->getList($searchCriteria)->getItems()); - } - - /** - * @covers \Magento\Signifyd\Model\CaseRepository::getById - * @magentoDataFixture Magento/Signifyd/_files/case.php - */ - public function testGetById() - { - $filters = [ - $this->filterBuilder->setField('case_id') - ->setValue(123) - ->create() - ]; - $searchCriteria = $this->searchCriteriaBuilder->addFilters($filters)->create(); - $cases = $this->repository->getList($searchCriteria) - ->getItems(); - - $case = array_pop($cases); - - $found = $this->repository->getById($case->getEntityId()); - - self::assertNotEmpty($found->getEntityId()); - self::assertEquals($case->getEntityId(), $found->getEntityId()); - self::assertEquals($case->getOrderId(), $found->getOrderId()); - } - - /** - * @covers \Magento\Signifyd\Model\CaseRepository::getList - * @magentoDataFixture Magento/Signifyd/_files/multiple_cases.php - */ - public function testGetListDateInterval() - { - $startDateInterval = [ - $this->filterBuilder->setField('created_at') - ->setConditionType('gteq') - ->setValue('2016-12-01 00:00:01') - ->create() - ]; - $endDateInterval = [ - $this->filterBuilder->setField('created_at') - ->setConditionType('lteq') - ->setValue('2016-12-03 23:59:59') - ->create() - ]; - - $this->searchCriteriaBuilder->addFilters($startDateInterval); - $searchCriteria = $this->searchCriteriaBuilder->addFilters($endDateInterval)->create(); - $items = $this->repository->getList($searchCriteria) - ->getItems(); - - self::assertCount(3, $items); - - for ($i = 1; $i < 4; $i ++) { - $current = array_shift($items); - self::assertEquals($i, $current->getCaseId()); - } - } - - /** - * @covers \Magento\Signifyd\Model\CaseRepository::getList - * @magentoDataFixture Magento/Signifyd/_files/multiple_cases.php - */ - public function testGetListStatusProcessing() - { - $filters = [ - $this->filterBuilder->setField('status') - ->setValue(CaseInterface::STATUS_PROCESSING) - ->create() - ]; - - $searchCriteria = $this->searchCriteriaBuilder->addFilters($filters)->create(); - $items = $this->repository->getList($searchCriteria) - ->getItems(); - - self::assertCount(1, $items); - - $case = array_pop($items); - self::assertEquals(123, $case->getCaseId()); - } -} diff --git a/dev/tests/integration/testsuite/Magento/Signifyd/Model/CaseServices/CreationServiceTest.php b/dev/tests/integration/testsuite/Magento/Signifyd/Model/CaseServices/CreationServiceTest.php deleted file mode 100644 index 6cf1e0bfddc9a..0000000000000 --- a/dev/tests/integration/testsuite/Magento/Signifyd/Model/CaseServices/CreationServiceTest.php +++ /dev/null @@ -1,245 +0,0 @@ -<?php -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ -namespace Magento\Signifyd\Model\CaseServices; - -use Magento\Framework\Api\SearchCriteriaBuilder; -use Magento\Framework\App\ObjectManager; -use Magento\Sales\Api\Data\OrderInterface; -use Magento\Sales\Api\Data\OrderStatusHistoryInterface; -use Magento\Sales\Api\OrderRepositoryInterface; -use Magento\Sales\Model\Order; -use Magento\Sales\Model\ResourceModel\Order\Grid\Collection; -use Magento\Signifyd\Api\CaseRepositoryInterface; -use Magento\Signifyd\Model\SignifydGateway\ApiCallException; -use Magento\Signifyd\Model\SignifydGateway\ApiClient; -use Magento\Signifyd\Model\SignifydGateway\Client\RequestBuilder; -use Magento\Signifyd\Model\SignifydGateway\Gateway; -use Magento\TestFramework\Helper\Bootstrap; -use PHPUnit\Framework\MockObject_MockObject as MockObject; -use Psr\Log\LoggerInterface; - -/** - * Class tests interaction with Signifyd Case creation service - * - * @SuppressWarnings(PHPMD.CouplingBetweenObjects) - */ -class CreationServiceTest extends \PHPUnit\Framework\TestCase -{ - /** - * @var ObjectManager - */ - private $objectManager; - - /** - * @var OrderInterface - */ - private $order; - - /** - * @var RequestBuilder|MockObject - */ - private $requestBuilder; - - /** - * @var LoggerInterface|MockObject - */ - private $logger; - - /** - * @var CreationService - */ - private $service; - - /** - * @inheritdoc - */ - protected function setUp() - { - $this->objectManager = Bootstrap::getObjectManager(); - - $this->requestBuilder = $this->getMockBuilder(RequestBuilder::class) - ->disableOriginalConstructor() - ->setMethods(['doRequest']) - ->getMock(); - - $apiClient = $this->objectManager->create( - ApiClient::class, - ['requestBuilder' => $this->requestBuilder] - ); - - $gateway = $this->objectManager->create( - Gateway::class, - ['apiClient' => $apiClient] - ); - - $this->logger = $this->getMockBuilder(LoggerInterface::class) - ->disableOriginalConstructor() - ->setMethods(['error']) - ->getMockForAbstractClass(); - - $this->service = $this->objectManager->create( - CreationService::class, - [ - 'signifydGateway' => $gateway, - 'logger' => $this->logger - ] - ); - } - - /** - * @covers \Magento\Signifyd\Model\CaseServices\CreationService::createForOrder - * @magentoDataFixture Magento/Signifyd/_files/order_with_customer_and_two_simple_products.php - */ - public function testCreateForOrderWithEmptyResponse() - { - $order = $this->getOrder(); - $exceptionMessage = 'Response is not valid JSON: Decoding failed: Syntax error'; - - $this->requestBuilder->expects(self::once()) - ->method('doRequest') - ->willThrowException(new ApiCallException($exceptionMessage)); - - $this->logger->expects(self::once()) - ->method('error') - ->with($exceptionMessage); - - $result = $this->service->createForOrder($order->getEntityId()); - self::assertTrue($result); - } - - /** - * @covers \Magento\Signifyd\Model\CaseServices\CreationService::createForOrder - * @magentoDataFixture Magento/Signifyd/_files/order_with_customer_and_two_simple_products.php - */ - public function testCreateForOrderWithBadResponse() - { - $order = $this->getOrder(); - $responseData = [ - 'messages' => [ - 'Something wrong' - ] - ]; - $exceptionMessage = 'Bad Request - The request could not be parsed. Response: ' . json_encode($responseData); - - $this->requestBuilder->expects(self::once()) - ->method('doRequest') - ->willThrowException(new ApiCallException($exceptionMessage)); - - $this->logger->expects(self::once()) - ->method('error') - ->with($exceptionMessage); - - $result = $this->service->createForOrder($order->getEntityId()); - self::assertTrue($result); - } - - /** - * @covers \Magento\Signifyd\Model\CaseServices\CreationService::createForOrder - * @magentoDataFixture Magento/Signifyd/_files/order_with_customer_and_two_simple_products.php - */ - public function testCreateOrderWithEmptyInvestigationId() - { - $order = $this->getOrder(); - - $this->requestBuilder->expects(self::once()) - ->method('doRequest') - ->willReturn([]); - - $this->logger->expects(self::once()) - ->method('error') - ->with('Expected field "investigationId" missed.'); - - $result = $this->service->createForOrder($order->getEntityId()); - self::assertTrue($result); - } - - /** - * @covers \Magento\Signifyd\Model\CaseServices\CreationService::createForOrder - * @magentoDataFixture Magento/Signifyd/_files/order_with_customer_and_two_simple_products.php - */ - public function testCreateForOrder() - { - $order = $this->getOrder(); - - $this->requestBuilder->expects(self::once()) - ->method('doRequest') - ->willReturn(['investigationId' => 123123]); - - $this->logger->expects(self::never()) - ->method('error'); - - $result = $this->service->createForOrder($order->getEntityId()); - self::assertTrue($result); - - /** @var CaseRepositoryInterface $caseRepository */ - $caseRepository = $this->objectManager->get(CaseRepositoryInterface::class); - $caseEntity = $caseRepository->getByCaseId(123123); - $gridGuarantyStatus = $this->getOrderGridGuarantyStatus($caseEntity->getOrderId()); - - self::assertNotEmpty($caseEntity); - self::assertEquals($order->getEntityId(), $caseEntity->getOrderId()); - self::assertEquals( - $gridGuarantyStatus, - $caseEntity->getGuaranteeDisposition(), - 'Signifyd guaranty status in sales_order_grid table does not match case entity guaranty status' - ); - - /** @var OrderRepositoryInterface $orderRepository */ - $orderRepository = $this->objectManager->get(OrderRepositoryInterface::class); - $order = $orderRepository->get($caseEntity->getOrderId()); - self::assertEquals(Order::STATE_HOLDED, $order->getState()); - - $histories = $order->getStatusHistories(); - self::assertNotEmpty($histories); - - /** @var OrderStatusHistoryInterface $orderHoldComment */ - $orderHoldComment = array_pop($histories); - self::assertInstanceOf(OrderStatusHistoryInterface::class, $orderHoldComment); - self::assertEquals("Awaiting the Signifyd guarantee disposition.", $orderHoldComment->getComment()); - } - - /** - * Get stored order - * - * @return OrderInterface - */ - private function getOrder() - { - if ($this->order === null) { - - /** @var SearchCriteriaBuilder $searchCriteriaBuilder */ - $searchCriteriaBuilder = $this->objectManager->get(SearchCriteriaBuilder::class); - $searchCriteria = $searchCriteriaBuilder->addFilter(OrderInterface::INCREMENT_ID, '100000001') - ->create(); - - $orderRepository = $this->objectManager->get(OrderRepositoryInterface::class); - $orders = $orderRepository->getList($searchCriteria) - ->getItems(); - - $this->order = array_pop($orders); - } - - return $this->order; - } - - /** - * Returns value of signifyd_guarantee_status column from sales order grid - * - * @param int $orderEntityId - * @return string|null - */ - private function getOrderGridGuarantyStatus($orderEntityId) - { - /** @var Collection $orderGridCollection */ - $orderGridCollection = $this->objectManager->get(Collection::class); - - $items = $orderGridCollection->addFilter($orderGridCollection->getIdFieldName(), $orderEntityId) - ->getItems(); - $result = array_pop($items); - - return isset($result['signifyd_guarantee_status']) ? $result['signifyd_guarantee_status'] : null; - } -} diff --git a/dev/tests/integration/testsuite/Magento/Signifyd/Model/CaseServices/UpdatingServiceTest.php b/dev/tests/integration/testsuite/Magento/Signifyd/Model/CaseServices/UpdatingServiceTest.php deleted file mode 100644 index 50e510ca072be..0000000000000 --- a/dev/tests/integration/testsuite/Magento/Signifyd/Model/CaseServices/UpdatingServiceTest.php +++ /dev/null @@ -1,186 +0,0 @@ -<?php -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ -namespace Magento\Signifyd\Model\CaseServices; - -use Magento\Framework\App\ObjectManager; -use Magento\Sales\Api\Data\OrderStatusHistoryInterface; -use Magento\Sales\Api\OrderRepositoryInterface; -use Magento\Sales\Model\Order; -use Magento\Sales\Model\ResourceModel\Order\Grid\Collection; -use Magento\Signifyd\Api\CaseRepositoryInterface; -use Magento\Signifyd\Api\Data\CaseInterface; -use Magento\Signifyd\Model\MessageGenerators\GeneratorFactory; -use Magento\TestFramework\Helper\Bootstrap; - -/** - * Contains tests for case entity updating service. - */ -class UpdatingServiceTest extends \PHPUnit\Framework\TestCase -{ - /** - * @var ObjectManager - */ - private $objectManager; - - /** - * @var UpdatingService - */ - private $service; - - /** - * @inheritdoc - */ - protected function setUp() - { - $this->objectManager = Bootstrap::getObjectManager(); - - /** @var GeneratorFactory $messageFactory */ - $messageFactory = $this->objectManager->get(GeneratorFactory::class); - $messageGenerator = $messageFactory->create('cases/creation'); - - $this->service = $this->objectManager->create(UpdatingService::class, [ - 'messageGenerator' => $messageGenerator - ]); - } - - /** - * Checks case updating flow and messages in order comments history. - * Also checks that order is unholded when case guarantee disposition is APPROVED. - * - * @covers \Magento\Signifyd\Model\CaseServices\UpdatingService::update - * @magentoDataFixture Magento/Signifyd/_files/case.php - */ - public function testUpdate() - { - $caseId = 123; - $data = [ - 'caseId' => $caseId, - 'score' => 750, - 'orderId' => '100000001', - 'reviewDisposition' => CaseInterface::DISPOSITION_FRAUDULENT, - 'associatedTeam' => [ - 'teamName' => 'AnyTeam', - 'teamId' => 26, - 'getAutoDismiss' => true, - 'getTeamDismissalDays' => 2 - ], - 'createdAt' => '2017-01-05T14:23:26-0800', - 'updatedAt' => '2017-01-05T14:44:26-0800', - 'guaranteeDisposition' => CaseInterface::GUARANTEE_APPROVED - ]; - - /** @var CaseRepositoryInterface $caseRepository */ - $caseRepository = $this->objectManager->get(CaseRepositoryInterface::class); - /** @var CaseInterface $caseEntity */ - $caseEntity = $caseRepository->getByCaseId($caseId); - - $this->service->update($caseEntity, $data); - - $caseEntity = $caseRepository->getByCaseId($caseId); - $orderEntityId = $caseEntity->getOrderId(); - $gridGuarantyStatus = $this->getOrderGridGuarantyStatus($orderEntityId); - - self::assertNotEmpty($caseEntity); - self::assertEquals('2017-01-05 22:23:26', $caseEntity->getCreatedAt()); - self::assertEquals(CaseInterface::GUARANTEE_APPROVED, $caseEntity->getGuaranteeDisposition()); - self::assertEquals('AnyTeam', $caseEntity->getAssociatedTeam()['teamName']); - self::assertEquals(true, $caseEntity->isGuaranteeEligible()); - self::assertEquals(CaseInterface::STATUS_PROCESSING, $caseEntity->getStatus()); - self::assertEquals($orderEntityId, $caseEntity->getOrderId()); - self::assertEquals( - $gridGuarantyStatus, - $caseEntity->getGuaranteeDisposition(), - 'Signifyd guaranty status in sales_order_grid table does not match case entity guaranty status' - ); - - /** @var OrderRepositoryInterface $orderRepository */ - $orderRepository = $this->objectManager->get(OrderRepositoryInterface::class); - $order = $orderRepository->get($caseEntity->getOrderId()); - self::assertEquals(Order::STATE_PROCESSING, $order->getState()); - $histories = $order->getStatusHistories(); - self::assertNotEmpty($histories); - - /** @var OrderStatusHistoryInterface $caseCreationComment */ - $caseCreationComment = array_pop($histories); - self::assertInstanceOf(OrderStatusHistoryInterface::class, $caseCreationComment); - self::assertEquals("Signifyd Case $caseId has been created for order.", $caseCreationComment->getComment()); - } - - /** - * Checks that order is holded when case guarantee disposition is DECLINED. - * - * @covers \Magento\Signifyd\Model\CaseServices\UpdatingService::update - * @magentoDataFixture Magento/Signifyd/_files/approved_case.php - */ - public function testOrderStateAfterDeclinedGuaranteeDisposition() - { - $caseId = 123; - $data = [ - 'caseId' => $caseId, - 'orderId' => '100000001', - 'guaranteeDisposition' => CaseInterface::GUARANTEE_DECLINED - ]; - - /** @var CaseRepositoryInterface $caseRepository */ - $caseRepository = $this->objectManager->get(CaseRepositoryInterface::class); - $caseEntity = $caseRepository->getByCaseId($caseId); - - $this->service->update($caseEntity, $data); - - /** @var OrderRepositoryInterface $orderRepository */ - $orderRepository = $this->objectManager->get(OrderRepositoryInterface::class); - $order = $orderRepository->get($caseEntity->getOrderId()); - - self::assertEquals(Order::STATE_HOLDED, $order->getState()); - } - - /** - * Checks that order doesn't become holded - * when previous case guarantee disposition was DECLINED - * and webhook without guarantee disposition was received. - * - * @covers \Magento\Signifyd\Model\CaseServices\UpdatingService::update - * @magentoDataFixture Magento/Signifyd/_files/declined_case.php - */ - public function testOrderStateAfterWebhookWithoutGuaranteeDisposition() - { - $caseId = 123; - $data = [ - 'caseId' => $caseId, - 'orderId' => '100000001' - ]; - - /** @var CaseRepositoryInterface $caseRepository */ - $caseRepository = $this->objectManager->get(CaseRepositoryInterface::class); - $caseEntity = $caseRepository->getByCaseId($caseId); - - $this->service->update($caseEntity, $data); - - /** @var OrderRepositoryInterface $orderRepository */ - $orderRepository = $this->objectManager->get(OrderRepositoryInterface::class); - $order = $orderRepository->get($caseEntity->getOrderId()); - - self::assertEquals(Order::STATE_PROCESSING, $order->getState()); - } - - /** - * Returns value of signifyd_guarantee_status column from sales order grid - * - * @param int $orderEntityId - * @return string|null - */ - private function getOrderGridGuarantyStatus($orderEntityId) - { - /** @var Collection $orderGridCollection */ - $orderGridCollection = $this->objectManager->get(Collection::class); - - $items = $orderGridCollection->addFilter($orderGridCollection->getIdFieldName(), $orderEntityId) - ->getItems(); - $result = array_pop($items); - - return isset($result['signifyd_guarantee_status']) ? $result['signifyd_guarantee_status'] : null; - } -} diff --git a/dev/tests/integration/testsuite/Magento/Signifyd/Model/Guarantee/CancelingServiceTest.php b/dev/tests/integration/testsuite/Magento/Signifyd/Model/Guarantee/CancelingServiceTest.php deleted file mode 100644 index 2cc7a9a1f240a..0000000000000 --- a/dev/tests/integration/testsuite/Magento/Signifyd/Model/Guarantee/CancelingServiceTest.php +++ /dev/null @@ -1,158 +0,0 @@ -<?php -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ -namespace Magento\Signifyd\Model\Guarantee; - -use Magento\Framework\App\ObjectManager; -use Magento\Sales\Api\Data\OrderStatusHistoryInterface; -use Magento\Sales\Api\OrderRepositoryInterface; -use Magento\Signifyd\Api\CaseRepositoryInterface; -use Magento\Signifyd\Api\Data\CaseInterface; -use Magento\Signifyd\Model\SignifydGateway\Gateway; -use Magento\Signifyd\Model\SignifydGateway\GatewayException; -use Magento\TestFramework\Helper\Bootstrap; -use PHPUnit\Framework\MockObject_MockObject as MockObject; -use Psr\Log\LoggerInterface; - -/** - * Contains test cases for canceling Signifyd guarantee flow. - */ -class CancelingServiceTest extends \PHPUnit\Framework\TestCase -{ - private static $caseId = 123; - - /** - * @var ObjectManager - */ - private $objectManager; - - /** - * @var Gateway|MockObject - */ - private $gateway; - - /** - * @var LoggerInterface|MockObject - */ - private $logger; - - /** - * @var CancelingService; - */ - private $service; - - /** - * @inheritdoc - */ - protected function setUp() - { - $this->objectManager = Bootstrap::getObjectManager(); - - $this->gateway = $this->getMockBuilder(Gateway::class) - ->disableOriginalConstructor() - ->setMethods(['cancelGuarantee']) - ->getMock(); - - $this->logger = $this->getMockBuilder(LoggerInterface::class) - ->disableOriginalConstructor() - ->getMock(); - - $this->service = $this->objectManager->create(CancelingService::class, [ - 'gateway' => $this->gateway, - 'logger' => $this->logger - ]); - } - - /** - * Checks a test case, when Signifyd guarantee was canceled. - * - * @covers \Magento\Signifyd\Model\Guarantee\CancelingService::cancelForOrder - * @magentoDataFixture Magento/Signifyd/_files/case.php - * @magentoConfigFixture current_store fraud_protection/signifyd/active 1 - */ - public function testCancelForOrderWithCanceledGuarantee() - { - /** @var CaseRepositoryInterface $caseRepository */ - $caseRepository = $this->objectManager->get(CaseRepositoryInterface::class); - $caseEntity = $caseRepository->getByCaseId(self::$caseId); - $caseEntity->setGuaranteeDisposition(CaseInterface::GUARANTEE_CANCELED); - $caseRepository->save($caseEntity); - - $this->gateway->expects(self::never()) - ->method('cancelGuarantee'); - - $this->logger->expects(self::never()) - ->method('error'); - - $result = $this->service->cancelForOrder($caseEntity->getOrderId()); - self::assertFalse($result); - } - - /** - * Checks a test case, when Signifyd gateway throws an exception. - * - * @covers \Magento\Signifyd\Model\Guarantee\CancelingService::cancelForOrder - * @magentoDataFixture Magento/Signifyd/_files/approved_case.php - * @magentoConfigFixture current_store fraud_protection/signifyd/active 1 - */ - public function testCancelForOrderWithFailedRequest() - { - $exceptionMessage = 'Something wrong.'; - /** @var CaseRepositoryInterface $caseRepository */ - $caseRepository = $this->objectManager->get(CaseRepositoryInterface::class); - $caseEntity = $caseRepository->getByCaseId(self::$caseId); - - $this->gateway->expects(self::once()) - ->method('cancelGuarantee') - ->with(self::equalTo(self::$caseId)) - ->willThrowException(new GatewayException($exceptionMessage)); - - $this->logger->expects(self::once()) - ->method('error') - ->with(self::equalTo($exceptionMessage)); - - $result = $this->service->cancelForOrder($caseEntity->getOrderId()); - self::assertFalse($result); - } - - /** - * Checks a test case, when request to cancel is submitted and case entity is updated successfully. - * - * @covers \Magento\Signifyd\Model\Guarantee\CancelingService::cancelForOrder - * @magentoDataFixture Magento/Signifyd/_files/approved_case.php - * @magentoConfigFixture current_store fraud_protection/signifyd/active 1 - */ - public function testCancelForOrder() - { - /** @var CaseRepositoryInterface $caseRepository */ - $caseRepository = $this->objectManager->get(CaseRepositoryInterface::class); - $caseEntity = $caseRepository->getByCaseId(self::$caseId); - - $this->gateway->expects(self::once()) - ->method('cancelGuarantee') - ->with(self::equalTo(self::$caseId)) - ->willReturn(CaseInterface::GUARANTEE_CANCELED); - - $this->logger->expects(self::never()) - ->method('error'); - - $result = $this->service->cancelForOrder($caseEntity->getOrderId()); - self::assertTrue($result); - - $updatedCase = $caseRepository->getByCaseId(self::$caseId); - self::assertEquals(CaseInterface::GUARANTEE_CANCELED, $updatedCase->getGuaranteeDisposition()); - - /** @var OrderRepositoryInterface $orderRepository */ - $orderRepository = $this->objectManager->get(OrderRepositoryInterface::class); - $order = $orderRepository->get($updatedCase->getOrderId()); - $histories = $order->getStatusHistories(); - self::assertNotEmpty($histories); - - /** @var OrderStatusHistoryInterface $caseCreationComment */ - $caseCreationComment = array_pop($histories); - self::assertInstanceOf(OrderStatusHistoryInterface::class, $caseCreationComment); - self::assertEquals('Case Update: Case guarantee has been cancelled.', $caseCreationComment->getComment()); - } -} diff --git a/dev/tests/integration/testsuite/Magento/Signifyd/Model/Guarantee/CreationServiceTest.php b/dev/tests/integration/testsuite/Magento/Signifyd/Model/Guarantee/CreationServiceTest.php deleted file mode 100644 index 157e3270648b3..0000000000000 --- a/dev/tests/integration/testsuite/Magento/Signifyd/Model/Guarantee/CreationServiceTest.php +++ /dev/null @@ -1,155 +0,0 @@ -<?php -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ -namespace Magento\Signifyd\Model\Guarantee; - -use Magento\Framework\App\ObjectManager; -use Magento\Sales\Api\Data\OrderStatusHistoryInterface; -use Magento\Sales\Api\OrderRepositoryInterface; -use Magento\Signifyd\Api\CaseRepositoryInterface; -use Magento\Signifyd\Api\Data\CaseInterface; -use Magento\Signifyd\Model\SignifydGateway\Gateway; -use Magento\Signifyd\Model\SignifydGateway\GatewayException; -use Magento\TestFramework\Helper\Bootstrap; -use PHPUnit\Framework\MockObject_MockObject as MockObject; -use Psr\Log\LoggerInterface; - -/** - * Contains positive and negative test cases for Signifyd case guarantee creation flow. - */ -class CreationServiceTest extends \PHPUnit\Framework\TestCase -{ - /** - * @var CreationService - */ - private $service; - - /** - * @var Gateway|MockObject - */ - private $gateway; - - /** - * @var LoggerInterface|MockObject - */ - private $logger; - - /** - * @var ObjectManager - */ - private $objectManager; - - /** - * @inheritdoc - */ - protected function setUp() - { - /** @var ObjectManager $objectManager */ - $this->objectManager = Bootstrap::getObjectManager(); - - $this->gateway = $this->getMockBuilder(Gateway::class) - ->disableOriginalConstructor() - ->setMethods(['submitCaseForGuarantee']) - ->getMock(); - - $this->logger = $this->getMockBuilder(LoggerInterface::class) - ->disableOriginalConstructor() - ->getMock(); - - $this->service = $this->objectManager->create(CreationService::class, [ - 'gateway' => $this->gateway, - 'logger' => $this->logger - ]); - } - - /** - * Checks a test case, when Signifyd case entity cannot be found - * for a specified order. - * - * @covers \Magento\Signifyd\Model\Guarantee\CreationService::createForOrder - */ - public function testCreateWithoutCaseEntity() - { - $orderId = 123; - - $this->gateway->expects(self::never()) - ->method('submitCaseForGuarantee'); - - $result = $this->service->createForOrder($orderId); - self::assertFalse($result); - } - - /** - * Checks a test case, when request is failing. - * - * @covers \Magento\Signifyd\Model\Guarantee\CreationService::createForOrder - * @magentoDataFixture Magento/Signifyd/_files/case.php - */ - public function testCreateWithFailedRequest() - { - $caseEntity = $this->getCaseEntity(); - - $this->gateway->expects(self::once()) - ->method('submitCaseForGuarantee') - ->willThrowException(new GatewayException('Something wrong')); - - $this->logger->expects(self::once()) - ->method('error') - ->with('Something wrong'); - - $result = $this->service->createForOrder($caseEntity->getOrderId()); - self::assertFalse($result); - } - - /** - * Checks a test case, when case entity is updated successfully. - * - * @covers \Magento\Signifyd\Model\Guarantee\CreationService::createForOrder - * @magentoDataFixture Magento/Signifyd/_files/case.php - * @magentoConfigFixture current_store fraud_protection/signifyd/active 1 - */ - public function testCreate() - { - $caseEntity = $this->getCaseEntity(); - - $this->gateway->expects(self::once()) - ->method('submitCaseForGuarantee') - ->with($caseEntity->getCaseId()) - ->willReturn(CaseInterface::GUARANTEE_IN_REVIEW); - - $this->logger->expects(self::never()) - ->method('error'); - - $result = $this->service->createForOrder($caseEntity->getOrderId()); - self::assertTrue($result); - - $updatedCase = $this->getCaseEntity(); - self::assertEquals(CaseInterface::GUARANTEE_IN_REVIEW, $updatedCase->getGuaranteeDisposition()); - self::assertEquals(CaseInterface::STATUS_PROCESSING, $updatedCase->getStatus()); - - /** @var OrderRepositoryInterface $orderRepository */ - $orderRepository = $this->objectManager->get(OrderRepositoryInterface::class); - $order = $orderRepository->get($updatedCase->getOrderId()); - $histories = $order->getStatusHistories(); - self::assertNotEmpty($histories); - - /** @var OrderStatusHistoryInterface $caseCreationComment */ - $caseCreationComment = array_pop($histories); - self::assertInstanceOf(OrderStatusHistoryInterface::class, $caseCreationComment); - self::assertEquals('Case Update: Case is submitted for guarantee.', $caseCreationComment->getComment()); - } - - /** - * Gets case entity. - * - * @return \Magento\Signifyd\Api\Data\CaseInterface|null - */ - private function getCaseEntity() - { - /** @var CaseRepositoryInterface $caseRepository */ - $caseRepository = $this->objectManager->get(CaseRepositoryInterface::class); - return $caseRepository->getByCaseId(123); - } -} diff --git a/dev/tests/integration/testsuite/Magento/Signifyd/Model/SignifydGateway/Request/CreateCaseBuilderTest.php b/dev/tests/integration/testsuite/Magento/Signifyd/Model/SignifydGateway/Request/CreateCaseBuilderTest.php deleted file mode 100644 index 594c065185ac7..0000000000000 --- a/dev/tests/integration/testsuite/Magento/Signifyd/Model/SignifydGateway/Request/CreateCaseBuilderTest.php +++ /dev/null @@ -1,291 +0,0 @@ -<?php -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ -namespace Magento\Signifyd\Model\SignifydGateway\Request; - -use Magento\Framework\Config\ScopeInterface; -use Magento\Signifyd\Model\SignifydOrderSessionId; -use Magento\TestFramework\Helper\Bootstrap; -use Magento\Framework\App\Area; -use Magento\Framework\Intl\DateTimeFactory; -use Magento\Framework\ObjectManagerInterface; -use Magento\Sales\Model\Order; -use Magento\Customer\Api\CustomerRepositoryInterface; -use Magento\Framework\App\ProductMetadataInterface; - -/** - * Class CreateCaseBuilderTest - * @magentoAppIsolation enabled - * @SuppressWarnings(PHPMD.CouplingBetweenObjects) - */ -class CreateCaseBuilderTest extends \PHPUnit\Framework\TestCase -{ - /** - * @var ObjectManagerInterface - */ - private $objectManager; - - /** - * @var CreateCaseBuilder - */ - private $caseBuilder; - - /** - * @var DateTimeFactory - */ - private $dateTimeFactory; - - /** - * Initial setup - */ - protected function setUp() - { - $bootstrap = Bootstrap::getInstance(); - $bootstrap->loadArea(Area::AREA_FRONTEND); - $this->objectManager = Bootstrap::getObjectManager(); - $this->dateTimeFactory = $this->objectManager->create(DateTimeFactory::class); - $this->caseBuilder = $this->objectManager->create(CreateCaseBuilder::class); - } - - /** - * Test builder on order with customer, simple product, frontend area, - * PayPal gateway, shipping and billing addresses, with two orders - * - * @covers \Magento\Signifyd\Model\SignifydGateway\Request\CreateCaseBuilder::build() - * @magentoDataFixture Magento/Signifyd/_files/order_with_customer_and_two_simple_products.php - * @SuppressWarnings(PHPMD.ExcessiveMethodLength) - */ - public function testCreateCaseBuilderWithFullSetOfData() - { - /** @var Order $order */ - $order = $this->objectManager->create(Order::class); - $order->loadByIncrementId('100000001'); - - $orderItems = $order->getAllItems(); - $payment = $order->getPayment(); - $billingAddress = $order->getBillingAddress(); - $shippingAddress = $order->getShippingAddress(); - - /** @var CustomerRepositoryInterface $customerRepository */ - $customerRepository = $this->objectManager->create(CustomerRepositoryInterface::class); - $customer = $customerRepository->getById($order->getCustomerId()); - - $productMetadata = $this->objectManager->create(ProductMetadataInterface::class); - - /** @var SignifydOrderSessionId $signifydOrderSessionId */ - $signifydOrderSessionId = $this->objectManager->create(SignifydOrderSessionId::class); - - $expected = [ - 'purchase' => [ - 'orderSessionId' => $signifydOrderSessionId->get($order->getQuoteId()), - 'browserIpAddress' => $order->getRemoteIp(), - 'orderId' => $order->getIncrementId(), - 'createdAt' => date('c', strtotime(date('Y-m-d 00:00:55'))), - 'paymentGateway' => 'paypal_account', - 'transactionId' => $payment->getLastTransId(), - 'currency' => $order->getOrderCurrencyCode(), - 'avsResponseCode' => '', - 'cvvResponseCode' => '', - 'orderChannel' => 'WEB', - 'totalPrice' => $order->getGrandTotal(), - 'shipments' => [ - 0 => [ - 'shipper' => 'Flat Rate', - 'shippingMethod' => 'Fixed', - 'shippingPrice' => $order->getShippingAmount() - ] - ], - 'products' => [ - 0 => [ - 'itemId' => $orderItems[0]->getSku(), - 'itemName' => $orderItems[0]->getName(), - 'itemPrice' => $orderItems[0]->getPrice(), - 'itemQuantity' => $orderItems[0]->getQtyOrdered(), - 'itemUrl' => $orderItems[0]->getProduct()->getProductUrl(), - 'itemWeight' => $orderItems[0]->getProduct()->getWeight() - ], - 1 => [ - 'itemId' => $orderItems[1]->getSku(), - 'itemName' => $orderItems[1]->getName(), - 'itemPrice' => $orderItems[1]->getPrice(), - 'itemQuantity' => $orderItems[1]->getQtyOrdered(), - 'itemUrl' => $orderItems[1]->getProduct()->getProductUrl(), - 'itemWeight' => $orderItems[1]->getProduct()->getWeight() - ] - ], - 'paymentMethod' => 'PAYPAL_ACCOUNT' - ], - 'card' => [ - 'cardHolderName' => 'firstname lastname', - 'last4' => $payment->getCcLast4(), - 'expiryMonth' => $payment->getCcExpMonth(), - 'expiryYear' => $payment->getCcExpYear(), - 'billingAddress' => [ - 'streetAddress' => 'street', - 'city' => $billingAddress->getCity(), - 'provinceCode' => $billingAddress->getRegionCode(), - 'postalCode' => $billingAddress->getPostcode(), - 'countryCode' => $billingAddress->getCountryId(), - 'unit' => '' - ] - ], - 'recipient' => [ - 'fullName' => $shippingAddress->getName(), - 'confirmationEmail' => $shippingAddress->getEmail(), - 'confirmationPhone' => $shippingAddress->getTelephone(), - 'deliveryAddress' => [ - 'streetAddress' => '6161 West Centinela Avenue', - 'unit' => 'app. 33', - 'city' => $shippingAddress->getCity(), - 'provinceCode' => $shippingAddress->getRegionCode(), - 'postalCode' => $shippingAddress->getPostcode(), - 'countryCode' => $shippingAddress->getCountryId() - ] - ], - 'userAccount' => [ - 'email' => $customer->getEmail(), - 'username' => $customer->getEmail(), - 'phone' => $order->getBillingAddress()->getTelephone(), - 'accountNumber' => $customer->getId(), - 'createdDate' => $this->formatDate($customer->getCreatedAt()), - 'lastUpdateDate' => $this->formatDate($customer->getUpdatedAt()), - 'aggregateOrderCount' => 2, - 'aggregateOrderDollars' => 150.0 - ], - 'seller' => $this->getSellerData(), - 'platformAndClient' => [ - 'storePlatform' => $productMetadata->getName() . ' ' . $productMetadata->getEdition(), - 'storePlatformVersion' => $productMetadata->getVersion(), - 'signifydClientApp' => $productMetadata->getName(), - 'signifydClientAppVersion' => '1.0' - ] - ]; - - self::assertEquals( - $expected, - $this->caseBuilder->build($order->getEntityId()) - ); - } - - /** - * Test builder on order with guest, virtual product, admin area, - * none PayPal gateway, no shipping address, without credit card data - * - * @covers \Magento\Signifyd\Model\SignifydGateway\Request\CreateCaseBuilder::build() - * @magentoDataFixture Magento/Signifyd/_files/order_with_guest_and_virtual_product.php - */ - public function testCreateCaseBuilderWithVirtualProductAndGuest() - { - /** @var Order $order */ - $order = $this->objectManager->create(Order::class); - $order->loadByIncrementId('100000002'); - - $scope = $this->objectManager->get(ScopeInterface::class); - $scope->setCurrentScope(Area::AREA_ADMINHTML); - - $orderItems = $order->getAllItems(); - $product = $orderItems[0]->getProduct(); - $payment = $order->getPayment(); - $billingAddress = $order->getBillingAddress(); - $productMetadata = $this->objectManager->create(ProductMetadataInterface::class); - - /** @var SignifydOrderSessionId $quoteSessionId */ - $quoteSessionId = $this->objectManager->create(SignifydOrderSessionId::class); - - $expected = [ - 'purchase' => [ - 'orderSessionId' => $quoteSessionId->get($order->getQuoteId()), - 'browserIpAddress' => $order->getRemoteIp(), - 'orderId' => $order->getIncrementId(), - 'createdAt' => '2016-12-12T12:00:55+00:00', - 'paymentGateway' => $payment->getMethod(), - 'transactionId' => $payment->getLastTransId(), - 'currency' => $order->getOrderCurrencyCode(), - 'avsResponseCode' => 'Y', - 'cvvResponseCode' => 'M', - 'orderChannel' => 'PHONE', - 'totalPrice' => $order->getGrandTotal(), - 'products' => [ - 0 => [ - 'itemId' => $orderItems[0]->getSku(), - 'itemName' => $orderItems[0]->getName(), - 'itemPrice' => $orderItems[0]->getPrice(), - 'itemQuantity' => $orderItems[0]->getQtyOrdered(), - 'itemUrl' => $product->getProductUrl() - ], - ], - 'paymentMethod' => 'PAYMENT_CARD' - ], - 'card' => [ - 'cardHolderName' => 'firstname lastname', - 'billingAddress' => [ - 'streetAddress' => 'street', - 'city' => $billingAddress->getCity(), - 'provinceCode' => $billingAddress->getRegionCode(), - 'postalCode' => $billingAddress->getPostcode(), - 'countryCode' => $billingAddress->getCountryId(), - 'unit' => '' - ] - ], - 'seller' => $this->getSellerData(), - 'platformAndClient' => [ - 'storePlatform' => $productMetadata->getName() . ' ' . $productMetadata->getEdition(), - 'storePlatformVersion' => $productMetadata->getVersion(), - 'signifydClientApp' => $productMetadata->getName(), - 'signifydClientAppVersion' => '1.0' - ] - ]; - - self::assertEquals( - $expected, - $this->caseBuilder->build($order->getEntityId()) - ); - } - - /** - * Return seller data according to fixture - * - * @return array - */ - private function getSellerData() - { - return [ - 'name' => 'Sample Store', - 'domain' => 'm2.com', - 'shipFromAddress' => [ - 'streetAddress' => '6161 West Centinela Avenue', - 'unit' => 'app. 111', - 'city' => 'Culver City', - 'provinceCode' => 'AE', - 'postalCode' => '90230', - 'countryCode' => 'US', - ], - 'corporateAddress' => [ - 'streetAddress' => '5th Avenue', - 'unit' => '75', - 'city' => 'New York', - 'provinceCode' => 'MH', - 'postalCode' => '19032', - 'countryCode' => 'US', - ], - ]; - } - - /** - * Format date in ISO8601 - * - * @param string $date - * @return string - */ - private function formatDate($date) - { - $result = $this->dateTimeFactory->create( - $date, - new \DateTimeZone('UTC') - ); - - return $result->format(\DateTime::ATOM); - } -} diff --git a/dev/tests/integration/testsuite/Magento/Signifyd/Observer/PlaceOrderTest.php b/dev/tests/integration/testsuite/Magento/Signifyd/Observer/PlaceOrderTest.php deleted file mode 100644 index e547187be5ed7..0000000000000 --- a/dev/tests/integration/testsuite/Magento/Signifyd/Observer/PlaceOrderTest.php +++ /dev/null @@ -1,218 +0,0 @@ -<?php -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ -namespace Magento\Signifyd\Observer; - -use Magento\Framework\Api\SearchCriteriaBuilder; -use Magento\Framework\App\ObjectManager; -use Magento\Framework\Event; -use Magento\Framework\Event\Observer; -use Magento\Sales\Api\Data\OrderInterface; -use Magento\Sales\Api\OrderRepositoryInterface; -use Magento\Signifyd\Api\CaseCreationServiceInterface; -use Magento\Store\Api\StoreRepositoryInterface; -use Magento\Store\Model\StoreManagerInterface; -use Magento\TestFramework\Helper\Bootstrap; -use PHPUnit\Framework\MockObject_MockObject as MockObject; -use Psr\Log\LoggerInterface; - -/** - * Test for Magento\Signifyd\Observer\PlaceOrderTest class. - * - * @SuppressWarnings(PHPMD.CouplingBetweenObjects) - */ -class PlaceOrderTest extends \PHPUnit\Framework\TestCase -{ - /** - * @var CaseCreationServiceInterface|MockObject - */ - private $creationService; - - /** - * @var LoggerInterface|MockObject - */ - private $logger; - - /** - * @var PlaceOrder - */ - private $placeOrder; - - /** - * @var ObjectManager - */ - private $objectManager; - - /** - * @inheritdoc - */ - protected function setUp() - { - $this->objectManager = Bootstrap::getObjectManager(); - - $this->creationService = $this->getMockBuilder(CaseCreationServiceInterface::class) - ->disableOriginalConstructor() - ->setMethods(['createForOrder']) - ->getMock(); - - $this->logger = $this->getMockBuilder(LoggerInterface::class) - ->disableOriginalConstructor() - ->getMock(); - - $this->placeOrder = $this->objectManager->create(PlaceOrder::class, [ - 'caseCreationService' => $this->creationService, - 'logger' => $this->logger - ]); - } - - /** - * Checks a case when order placed with offline payment method. - * - * @covers \Magento\Signifyd\Observer\PlaceOrder::execute - * @magentoConfigFixture current_store fraud_protection/signifyd/active 1 - * @magentoDataFixture Magento/Signifyd/_files/order_with_customer_and_two_simple_products.php - */ - public function testExecuteWithOfflinePayment() - { - $order = $this->getOrder('100000005'); - $this->creationService->expects(self::never()) - ->method('createForOrder'); - - $event = $this->objectManager->create( - Event::class, - [ - 'data' => ['order' => $order] - ] - ); - - /** @var Observer $observer */ - $observer = $this->objectManager->get(Observer::class); - $observer->setEvent($event); - - $this->placeOrder->execute($observer); - } - - /** - * Checks a test case when order placed with online payment method. - * - * @covers \Magento\Signifyd\Observer\PlaceOrder::execute - * @magentoConfigFixture current_store fraud_protection/signifyd/active 1 - * @magentoDataFixture Magento/Signifyd/_files/order_with_customer_and_two_simple_products.php - */ - public function testExecute() - { - $order = $this->getOrder('100000001'); - - $this->creationService->expects(self::once()) - ->method('createForOrder') - ->with(self::equalTo($order->getEntityId())); - - $event = $this->objectManager->create( - Event::class, - [ - 'data' => ['order' => $order], - ] - ); - - /** @var Observer $observer */ - $observer = $this->objectManager->get(Observer::class); - $observer->setEvent($event); - - $this->placeOrder->execute($observer); - } - - /** - * Signifyd is enabled for default store. - * Checks a test case when order placed with website where signifyd is disabled. - * - * @return void - * @covers \Magento\Signifyd\Observer\PlaceOrder::execute - * @magentoDataFixture Magento/Signifyd/_files/order_with_customer_and_two_simple_products.php - * @magentoDataFixture Magento/Signifyd/_files/website_configuration.php - */ - public function testExecuteWithWebsiteConfiguration(): void - { - /** @var StoreRepositoryInterface $storeRepository */ - $storeRepository = $this->objectManager->get(StoreRepositoryInterface::class); - $store = $storeRepository->get('test_second_store'); - - /** @var StoreManagerInterface $storeManager */ - $storeManager = $this->objectManager->get(StoreManagerInterface::class); - $storeManager->setCurrentStore($store->getId()); - - $order = $this->getOrder('100000001'); - $order->setStoreId($store->getId()); - - $this->creationService->expects(self::never()) - ->method('createForOrder'); - - $event = $this->objectManager->create( - Event::class, - [ - 'data' => ['order' => $order], - ] - ); - - /** @var Observer $observer */ - $observer = $this->objectManager->get(Observer::class); - $observer->setEvent($event); - - $this->placeOrder->execute($observer); - } - - /** - * Checks a test case when observer event contains two orders: - * one order with offline payment and one order with online payment. - * - * @covers \Magento\Signifyd\Observer\PlaceOrder::execute - * @magentoConfigFixture current_store fraud_protection/signifyd/active 1 - * @magentoDataFixture Magento/Signifyd/_files/order_with_customer_and_two_simple_products.php - */ - public function testExecuteWithMultipleOrders() - { - $orderWithOnlinePayment = $this->getOrder('100000001'); - $orderWithOfflinePayment = $this->getOrder('100000005'); - - // this service mock should be called only once for the order with online payment method. - $this->creationService->expects(self::once()) - ->method('createForOrder') - ->with(self::equalTo($orderWithOnlinePayment->getEntityId())); - - $event = $this->objectManager->create( - Event::class, - [ - 'data' => ['orders' => [$orderWithOfflinePayment, $orderWithOnlinePayment]] - ] - ); - - /** @var Observer $observer */ - $observer = $this->objectManager->get(Observer::class); - $observer->setEvent($event); - - $this->placeOrder->execute($observer); - } - - /** - * Gets stored order. - * - * @param string $incrementId - * @return OrderInterface - */ - private function getOrder($incrementId) - { - /** @var SearchCriteriaBuilder $searchCriteriaBuilder */ - $searchCriteriaBuilder = $this->objectManager->get(SearchCriteriaBuilder::class); - $searchCriteria = $searchCriteriaBuilder->addFilter(OrderInterface::INCREMENT_ID, $incrementId) - ->create(); - - $orderRepository = $this->objectManager->get(OrderRepositoryInterface::class); - $orders = $orderRepository->getList($searchCriteria) - ->getItems(); - - $order = array_pop($orders); - - return $order; - } -} diff --git a/dev/tests/integration/testsuite/Magento/Signifyd/Plugin/CancelOrderTest.php b/dev/tests/integration/testsuite/Magento/Signifyd/Plugin/CancelOrderTest.php deleted file mode 100644 index 7c1af95bdb89c..0000000000000 --- a/dev/tests/integration/testsuite/Magento/Signifyd/Plugin/CancelOrderTest.php +++ /dev/null @@ -1,114 +0,0 @@ -<?php -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ -namespace Magento\Signifyd\Plugin; - -use Magento\Framework\Api\SearchCriteriaBuilder; -use Magento\Sales\Api\Data\OrderInterface; -use Magento\Sales\Api\OrderManagementInterface; -use Magento\Sales\Api\OrderRepositoryInterface; -use Magento\Signifyd\Api\CaseRepositoryInterface; -use Magento\Signifyd\Api\Data\CaseInterface; -use Magento\Signifyd\Model\SignifydGateway\ApiClient; -use Magento\TestFramework\Helper\Bootstrap; -use Magento\TestFramework\ObjectManager; -use PHPUnit\Framework\MockObject_MockObject as MockObject; - -class CancelOrderTest extends \PHPUnit\Framework\TestCase -{ - /** - * @var int - */ - private static $caseId = 123; - - /** - * @var ObjectManager - */ - private $objectManager; - - /** - * @var ApiClient|MockObject - */ - private $apiClient; - - /** - * @inheritdoc - */ - protected function setUp() - { - $this->objectManager = Bootstrap::getObjectManager(); - - $this->apiClient = $this->getMockBuilder(ApiClient::class) - ->disableOriginalConstructor() - ->setMethods(['makeApiCall']) - ->getMock(); - - $this->objectManager->addSharedInstance($this->apiClient, ApiClient::class); - } - - /** - * @inheritdoc - */ - protected function tearDown() - { - $this->objectManager->removeSharedInstance(ApiClient::class); - } - - /** - * Checks a test case, when order has been cancelled - * and calls plugin to cancel Signifyd case guarantee. - * - * @covers \Magento\Signifyd\Plugin\OrderPlugin::afterCancel - * @magentoDataFixture Magento/Signifyd/_files/approved_case.php - * @magentoConfigFixture current_store fraud_protection/signifyd/active 1 - */ - public function testAfterCancel() - { - $order = $this->getOrder(); - - $this->apiClient->expects(self::once()) - ->method('makeApiCall') - ->with( - self::equalTo('/cases/' . self::$caseId . '/guarantee'), - 'PUT', - [ - 'guaranteeDisposition' => CaseInterface::GUARANTEE_CANCELED - ] - ) - ->willReturn([ - 'disposition' => CaseInterface::GUARANTEE_CANCELED - ]); - - /** @var OrderManagementInterface $orderService */ - $orderService = $this->objectManager->get(OrderManagementInterface::class); - $orderService->cancel($order->getEntityId()); - - /** @var CaseRepositoryInterface $caseRepository */ - $caseRepository = $this->objectManager->get(CaseRepositoryInterface::class); - $case = $caseRepository->getByCaseId(self::$caseId); - - self::assertEquals(CaseInterface::GUARANTEE_CANCELED, $case->getGuaranteeDisposition()); - } - - /** - * Get stored order. - * - * @return OrderInterface - */ - private function getOrder() - { - /** @var SearchCriteriaBuilder $searchCriteriaBuilder */ - $searchCriteriaBuilder = $this->objectManager->get(SearchCriteriaBuilder::class); - $searchCriteria = $searchCriteriaBuilder->addFilter(OrderInterface::INCREMENT_ID, '100000001') - ->create(); - - $orderRepository = $this->objectManager->get(OrderRepositoryInterface::class); - $orders = $orderRepository->getList($searchCriteria) - ->getItems(); - - /** @var OrderInterface $order */ - return array_pop($orders); - } -} diff --git a/dev/tests/integration/testsuite/Magento/Signifyd/Plugin/DenyPaymentTest.php b/dev/tests/integration/testsuite/Magento/Signifyd/Plugin/DenyPaymentTest.php deleted file mode 100644 index 72da71a630dff..0000000000000 --- a/dev/tests/integration/testsuite/Magento/Signifyd/Plugin/DenyPaymentTest.php +++ /dev/null @@ -1,209 +0,0 @@ -<?php -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ -namespace Magento\Signifyd\Plugin; - -use Magento\Framework\Api\SearchCriteriaBuilder; -use Magento\Framework\Registry; -use Magento\Payment\Model\Info as PaymentInfo; -use Magento\Paypal\Model\Api\Nvp; -use Magento\Paypal\Model\Config; -use Magento\Paypal\Model\Express; -use Magento\Paypal\Model\Info; -use Magento\Paypal\Model\Pro; -use Magento\Paypal\Model\ProFactory; -use Magento\Sales\Api\Data\OrderInterface; -use Magento\Sales\Api\OrderRepositoryInterface; -use Magento\Signifyd\Api\CaseRepositoryInterface; -use Magento\Signifyd\Api\Data\CaseInterface; -use Magento\Signifyd\Model\SignifydGateway\ApiClient; -use Magento\TestFramework\Helper\Bootstrap; -use Magento\TestFramework\ObjectManager; -use PHPUnit\Framework\MockObject_MockObject as MockObject; - -/** - * @SuppressWarnings(PHPMD.CouplingBetweenObjects) - */ -class DenyPaymentTest extends \PHPUnit\Framework\TestCase -{ - /** - * @var int - */ - private static $caseId = 123; - - /** - * @var ObjectManager - */ - private $objectManager; - - /** - * @var ApiClient|MockObject - */ - private $apiClient; - - /** - * @var Registry - */ - private $registry; - - /** - * @inheritdoc - */ - protected function setUp() - { - $this->objectManager = Bootstrap::getObjectManager(); - - $this->apiClient = $this->getMockBuilder(ApiClient::class) - ->disableOriginalConstructor() - ->setMethods(['makeApiCall']) - ->getMock(); - - $this->registry = $this->objectManager->get(Registry::class); - - $this->objectManager->addSharedInstance($this->apiClient, ApiClient::class); - } - - /** - * @inheritdoc - */ - protected function tearDown() - { - $this->objectManager->removeSharedInstance(ApiClient::class); - } - - /** - * Checks a test case, when payment has been denied - * and calls plugin to cancel Signifyd case guarantee. - * - * @covers \Magento\Signifyd\Plugin\PaymentPlugin::afterDenyPayment - * @magentoDataFixture Magento/Signifyd/_files/approved_case.php - * @magentoConfigFixture current_store fraud_protection/signifyd/active 1 - */ - public function testAfterDenyPayment() - { - $order = $this->getOrder(); - $this->registry->register('current_order', $order); - - $this->apiClient->expects(self::once()) - ->method('makeApiCall') - ->with( - self::equalTo('/cases/' . self::$caseId . '/guarantee'), - 'PUT', - [ - 'guaranteeDisposition' => CaseInterface::GUARANTEE_CANCELED - ] - ) - ->willReturn([ - 'disposition' => CaseInterface::GUARANTEE_CANCELED - ]); - - /** @var \Magento\Sales\Model\Order\Payment $payment */ - $payment = $order->getPayment(); - $payment->setData('method_instance', $this->getMethodInstance()); - $payment->deny(); - - /** @var CaseRepositoryInterface $caseRepository */ - $caseRepository = $this->objectManager->get(CaseRepositoryInterface::class); - $case = $caseRepository->getByCaseId(self::$caseId); - - self::assertEquals(CaseInterface::GUARANTEE_CANCELED, $case->getGuaranteeDisposition()); - } - - /** - * Get stored order. - * - * @return OrderInterface - */ - private function getOrder() - { - /** @var SearchCriteriaBuilder $searchCriteriaBuilder */ - $searchCriteriaBuilder = $this->objectManager->get(SearchCriteriaBuilder::class); - $searchCriteria = $searchCriteriaBuilder->addFilter(OrderInterface::INCREMENT_ID, '100000001') - ->create(); - - $orderRepository = $this->objectManager->get(OrderRepositoryInterface::class); - $orders = $orderRepository->getList($searchCriteria) - ->getItems(); - - /** @var OrderInterface $order */ - return array_pop($orders); - } - - /** - * Gets payment method instance. - * - * @return Express - */ - private function getMethodInstance() - { - /** @var PaymentInfo $infoInstance */ - $infoInstance = $this->objectManager->get(PaymentInfo::class); - $infoInstance->setAdditionalInformation( - Info::PAYMENT_STATUS_GLOBAL, - Info::PAYMENTSTATUS_PENDING - ); - $infoInstance->setAdditionalInformation( - Info::PENDING_REASON_GLOBAL, - Info::PAYMENTSTATUS_PENDING - ); - - /** @var Express $methodInstance */ - $methodInstance = $this->objectManager->create( - Express::class, - ['proFactory' => $this->getProFactory()] - ); - $methodInstance->setData('info_instance', $infoInstance); - - return $methodInstance; - } - - /** - * Gets Pro factory mock. - * - * @return ProFactory|MockObject - */ - protected function getProFactory() - { - $pro = $this->getMockBuilder(Pro::class) - ->disableOriginalConstructor() - ->setMethods(['getApi', 'setMethod', 'getConfig', '__wakeup', 'reviewPayment']) - ->getMock(); - $nvpClient = $this->getMockBuilder(Nvp::class) - ->disableOriginalConstructor() - ->getMock(); - - $pro->method('getConfig') - ->willReturn($this->getConfig()); - $pro->method('getApi') - ->willReturn($nvpClient); - $pro->method('reviewPayment') - ->willReturn(true); - - $proFactory = $this->getMockBuilder(ProFactory::class) - ->disableOriginalConstructor() - ->getMock(); - $proFactory->method('create') - ->willReturn($pro); - - return $proFactory; - } - - /** - * Gets config mock. - * - * @return Config|MockObject - */ - protected function getConfig() - { - $config = $this->getMockBuilder(Config::class) - ->disableOriginalConstructor() - ->getMock(); - $config->method('getValue') - ->with('payment_action') - ->willReturn(Config::PAYMENT_ACTION_AUTH); - - return $config; - } -} diff --git a/dev/tests/integration/testsuite/Magento/Signifyd/_files/approved_case.php b/dev/tests/integration/testsuite/Magento/Signifyd/_files/approved_case.php deleted file mode 100644 index eaa3622c04e0e..0000000000000 --- a/dev/tests/integration/testsuite/Magento/Signifyd/_files/approved_case.php +++ /dev/null @@ -1,38 +0,0 @@ -<?php -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ - -use Magento\Signifyd\Api\CaseRepositoryInterface; -use Magento\Signifyd\Api\Data\CaseInterface; -use Magento\Signifyd\Api\Data\CaseInterfaceFactory; - -require __DIR__ . '/order_with_customer_and_two_simple_products.php'; - -/** @var CaseInterfaceFactory $caseFactory */ -$caseFactory = $objectManager->get(CaseInterfaceFactory::class); - -$associatedTeam = [ - 'teamName' => 'Some Team', - 'teamId' => 123, - 'getAutoDismiss' => true, - 'getTeamDismissalDays' => 3 -]; - -/** @var CaseInterface $case */ -$case = $caseFactory->create(); -$case->setCaseId(123) - ->setGuaranteeEligible(false) - ->setGuaranteeDisposition(CaseInterface::GUARANTEE_APPROVED) - ->setStatus(CaseInterface::STATUS_PROCESSING) - ->setScore(553) - ->setOrderId($order->getEntityId()) - ->setAssociatedTeam($associatedTeam) - ->setReviewDisposition(CaseInterface::DISPOSITION_GOOD) - ->setCreatedAt('2016-12-12T15:17:17+0000') - ->setUpdatedAt('2016-12-12T19:23:16+0000'); - -/** @var CaseRepositoryInterface $caseRepository */ -$caseRepository = $objectManager->get(CaseRepositoryInterface::class); -$caseRepository->save($case); diff --git a/dev/tests/integration/testsuite/Magento/Signifyd/_files/case.php b/dev/tests/integration/testsuite/Magento/Signifyd/_files/case.php deleted file mode 100644 index 4102233f6fb1f..0000000000000 --- a/dev/tests/integration/testsuite/Magento/Signifyd/_files/case.php +++ /dev/null @@ -1,42 +0,0 @@ -<?php -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ -use Magento\Sales\Api\OrderManagementInterface; -use Magento\Signifyd\Api\CaseRepositoryInterface; -use Magento\Signifyd\Api\Data\CaseInterface; -use Magento\Signifyd\Api\Data\CaseInterfaceFactory; - -require __DIR__ . '/order_with_customer_and_two_simple_products.php'; - -/** @var OrderManagementInterface $orderManagement */ -$orderManagement = $objectManager->create(OrderManagementInterface::class); -$orderManagement->hold($order->getEntityId()); - -/** @var CaseInterfaceFactory $caseFactory */ -$caseFactory = $objectManager->get(CaseInterfaceFactory::class); - -$associatedTeam = [ - 'teamName' => 'Some Team', - 'teamId' => 123, - 'getAutoDismiss' => true, - 'getTeamDismissalDays' => 3 -]; - -/** @var CaseInterface $case */ -$case = $caseFactory->create(); -$case->setCaseId(123) - ->setGuaranteeEligible(true) - ->setStatus(CaseInterface::STATUS_PROCESSING) - ->setScore(553) - ->setOrderId($order->getEntityId()) - ->setAssociatedTeam($associatedTeam) - ->setReviewDisposition(CaseInterface::DISPOSITION_GOOD) - ->setGuaranteeDisposition(CaseInterface::GUARANTEE_PENDING) - ->setCreatedAt('2016-12-12T15:17:17+0000') - ->setUpdatedAt('2016-12-12T19:23:16+0000'); - -/** @var CaseRepositoryInterface $caseRepository */ -$caseRepository = $objectManager->get(CaseRepositoryInterface::class); -$caseRepository->save($case); diff --git a/dev/tests/integration/testsuite/Magento/Signifyd/_files/customer.php b/dev/tests/integration/testsuite/Magento/Signifyd/_files/customer.php deleted file mode 100644 index 7c5f34cd203fa..0000000000000 --- a/dev/tests/integration/testsuite/Magento/Signifyd/_files/customer.php +++ /dev/null @@ -1,38 +0,0 @@ -<?php -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ - -use Magento\Customer\Model\Customer; -use Magento\TestFramework\Helper\Bootstrap; -use Magento\Customer\Api\Data\CustomerInterface; -use Magento\Customer\Model\CustomerRegistry; - -$objectManager = Bootstrap::getObjectManager(); -/** @var CustomerRegistry $customerRegistry */ -$customerRegistry = $objectManager->get(CustomerRegistry::class); -$customer = $objectManager->create(Customer::class); - -/** @var CustomerInterface $customer */ -$customer->setWebsiteId(1) - ->setId(1) - ->setEmail('customer@example.com') - ->setGroupId(1) - ->setStoreId(1) - ->setPrefix('Mr.') - ->setFirstname('John') - ->setMiddlename('A') - ->setLastname('Smith') - ->setSuffix('Esq.') - ->setDefaultBilling(1) - ->setDefaultShipping(1) - ->setTaxvat('12') - ->setGender(0) - ->setCreatedAt('2016-12-12T11:00:00+0000') - ->setUpdatedAt('2016-12-12T11:05:00+0000'); - -$customer->isObjectNew(true); -$customer->save(); - -$customerRegistry->remove($customer->getId()); diff --git a/dev/tests/integration/testsuite/Magento/Signifyd/_files/declined_case.php b/dev/tests/integration/testsuite/Magento/Signifyd/_files/declined_case.php deleted file mode 100644 index 041cdb0291d83..0000000000000 --- a/dev/tests/integration/testsuite/Magento/Signifyd/_files/declined_case.php +++ /dev/null @@ -1,38 +0,0 @@ -<?php -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ - -use Magento\Signifyd\Api\CaseRepositoryInterface; -use Magento\Signifyd\Api\Data\CaseInterface; -use Magento\Signifyd\Api\Data\CaseInterfaceFactory; - -require __DIR__ . '/order_with_customer_and_two_simple_products.php'; - -/** @var CaseInterfaceFactory $caseFactory */ -$caseFactory = $objectManager->get(CaseInterfaceFactory::class); - -$associatedTeam = [ - 'teamName' => 'Some Team', - 'teamId' => 123, - 'getAutoDismiss' => true, - 'getTeamDismissalDays' => 3 -]; - -/** @var CaseInterface $case */ -$case = $caseFactory->create(); -$case->setCaseId(123) - ->setGuaranteeEligible(false) - ->setGuaranteeDisposition(CaseInterface::GUARANTEE_DECLINED) - ->setStatus(CaseInterface::STATUS_PROCESSING) - ->setScore(553) - ->setOrderId($order->getEntityId()) - ->setAssociatedTeam($associatedTeam) - ->setReviewDisposition(CaseInterface::DISPOSITION_FRAUDULENT) - ->setCreatedAt('2016-12-12T15:17:17+0000') - ->setUpdatedAt('2016-12-12T19:23:16+0000'); - -/** @var CaseRepositoryInterface $caseRepository */ -$caseRepository = $objectManager->get(CaseRepositoryInterface::class); -$caseRepository->save($case); diff --git a/dev/tests/integration/testsuite/Magento/Signifyd/_files/multiple_cases.php b/dev/tests/integration/testsuite/Magento/Signifyd/_files/multiple_cases.php deleted file mode 100644 index 4930906954148..0000000000000 --- a/dev/tests/integration/testsuite/Magento/Signifyd/_files/multiple_cases.php +++ /dev/null @@ -1,27 +0,0 @@ -<?php -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ -use Magento\Signifyd\Api\Data\CaseInterface; - -require __DIR__ . '/case.php'; - -for ($i = 1; $i < 4; $i ++) { - $newOrder = clone $order; - $newOrder->setEntityId(null) - ->setIncrementId($order->getIncrementId() + $i); - - $orderRepository->save($newOrder); - - $newCase = clone $case; - $newCase->setEntityId(null) - ->setCaseId($i) - ->setOrderId($newOrder->getEntityId()) - ->setStatus(CaseInterface::STATUS_OPEN) - ->setCreatedAt('2016-12-0' . $i . 'T15:' . $i . ':17+0000') - ->setUpdatedAt('2016-12-12T0' . $i . ':23:16+0000') - ->setId(null); - - $caseRepository->save($newCase); -} diff --git a/dev/tests/integration/testsuite/Magento/Signifyd/_files/order_with_customer_and_two_simple_products.php b/dev/tests/integration/testsuite/Magento/Signifyd/_files/order_with_customer_and_two_simple_products.php deleted file mode 100644 index 49a0a2d33e236..0000000000000 --- a/dev/tests/integration/testsuite/Magento/Signifyd/_files/order_with_customer_and_two_simple_products.php +++ /dev/null @@ -1,119 +0,0 @@ -<?php -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ -use Magento\Sales\Model\Order; -use Magento\Sales\Model\Order\Payment; -use Magento\Sales\Model\Order\Address; -use Magento\Sales\Model\Order\Item; -use Magento\Sales\Api\OrderRepositoryInterface; -use Magento\TestFramework\Helper\Bootstrap; - -require __DIR__ . '/../../../Magento/Catalog/_files/product_simple.php'; -require __DIR__ . '/../../../Magento/Customer/_files/customer.php'; -require __DIR__ . '/store.php'; - -$addressData = include __DIR__ . '/../../../Magento/Sales/_files/address_data.php'; - -$objectManager = Bootstrap::getObjectManager(); - -$billingAddress = $objectManager->create(Address::class, ['data' => $addressData]); -$billingAddress->setAddressType('billing'); - -$shippingAddress = clone $billingAddress; -$shippingAddress->setId(null) - ->setAddressType('shipping') - ->setStreet(['6161 West Centinela Avenue', 'app. 33']) - ->setFirstname('John') - ->setLastname('Doe') - ->setShippingMethod('flatrate_flatrate'); - -$payment = $objectManager->create(Payment::class); -$payment->setMethod('paypal_express') - ->setLastTransId('00001') - ->setCcLast4('1234') - ->setCcExpMonth('01') - ->setCcExpYear('21'); - -/** @var Item $orderItem */ -$orderItem1 = $objectManager->create(Item::class); -$orderItem1->setProductId($product->getId()) - ->setSku($product->getSku()) - ->setName($product->getName()) - ->setQtyOrdered(1) - ->setBasePrice($product->getPrice()) - ->setPrice($product->getPrice()) - ->setRowTotal($product->getPrice()) - ->setProductType($product->getTypeId()); - -/** @var Item $orderItem */ -$orderItem2 = $objectManager->create(Item::class); -$orderItem2->setProductId($product->getId()) - ->setSku('simple2') - ->setName('Simple product') - ->setPrice(100) - ->setQtyOrdered(2) - ->setBasePrice($product->getPrice()) - ->setPrice($product->getPrice()) - ->setRowTotal($product->getPrice()) - ->setProductType($product->getTypeId()); - -$orderAmount = 100; -$customerEmail = $billingAddress->getEmail(); - -/** @var Order $order */ -$order = $objectManager->create(Order::class); -$order->setIncrementId('100000001') - ->setState(Order::STATE_PROCESSING) - ->setStatus(Order::STATE_PROCESSING) - ->setCustomerId($customer->getId()) - ->setCustomerIsGuest(false) - ->setRemoteIp('127.0.0.1') - ->setCreatedAt(date('Y-m-d 00:00:55')) - ->setOrderCurrencyCode('USD') - ->setBaseCurrencyCode('USD') - ->setSubtotal($orderAmount) - ->setGrandTotal($orderAmount) - ->setBaseSubtotal($orderAmount) - ->setBaseGrandTotal($orderAmount) - ->setCustomerEmail($customerEmail) - ->setBillingAddress($billingAddress) - ->setShippingAddress($shippingAddress) - ->setShippingDescription('Flat Rate - Fixed') - ->setShippingAmount(10) - ->setStoreId($store->getId()) - ->addItem($orderItem1) - ->addItem($orderItem2) - ->setPayment($payment) - ->setQuoteId(1); - -/** @var OrderRepositoryInterface $orderRepository */ -$orderRepository = $objectManager->get(OrderRepositoryInterface::class); -$orderRepository->save($order); - -$orderAmount2 = 50; -$payment2 = $objectManager->create(Payment::class); -$payment2->setMethod('checkmo'); -/** @var Order $order2 */ -$order2 = $objectManager->create(Order::class); -$order2->setIncrementId('100000005') - ->setCustomerId($customer->getId()) - ->setCustomerIsGuest(false) - ->setRemoteIp('127.0.0.1') - ->setCreatedAt('2016-12-12T12:00:55+0000') - ->setOrderCurrencyCode('USD') - ->setBaseCurrencyCode('USD') - ->setGrandTotal($orderAmount2) - ->setBaseGrandTotal($orderAmount2) - ->setCustomerEmail($customerEmail) - ->setBillingAddress($billingAddress) - ->setShippingAddress($shippingAddress) - ->setShippingDescription('Flat Rate - Fixed') - ->setShippingAmount(10) - ->setStoreId($store->getId()) - ->addItem($orderItem1) - ->setPayment($payment2) - ->setQuoteId(2); - -$orderRepository->save($order2); diff --git a/dev/tests/integration/testsuite/Magento/Signifyd/_files/order_with_guest_and_virtual_product.php b/dev/tests/integration/testsuite/Magento/Signifyd/_files/order_with_guest_and_virtual_product.php deleted file mode 100644 index ba0e92687dc17..0000000000000 --- a/dev/tests/integration/testsuite/Magento/Signifyd/_files/order_with_guest_and_virtual_product.php +++ /dev/null @@ -1,68 +0,0 @@ -<?php -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ -use Magento\Sales\Model\Order; -use Magento\Sales\Model\Order\Payment; -use Magento\Sales\Model\Order\Address; -use Magento\Sales\Model\Order\Item; -use Magento\Sales\Api\OrderRepositoryInterface; -use Magento\TestFramework\Helper\Bootstrap; -use Magento\Sales\Api\Data\OrderPaymentInterface; - -require __DIR__ . '/../../../Magento/Catalog/_files/product_virtual.php'; -require __DIR__ . '/store.php'; -$addressData = include __DIR__ . '/../../../Magento/Sales/_files/address_data.php'; - -$objectManager = Bootstrap::getObjectManager(); - -$billingAddress = $objectManager->create(Address::class, ['data' => $addressData]); -$billingAddress->setAddressType('billing'); - -/** @var OrderPaymentInterface $payment */ -$payment = $objectManager->create(Payment::class); -$payment->setMethod('braintree') - ->setLastTransId('00001') - ->setAdditionalInformation('avsPostalCodeResponseCode', 'M') - ->setAdditionalInformation('avsStreetAddressResponseCode', 'M') - ->setAdditionalInformation('cvvResponseCode', 'M'); - -/** @var Item $orderItem */ -$orderItem1 = $objectManager->create(Item::class); -$orderItem1->setProductId($product->getId()) - ->setSku($product->getSku()) - ->setName($product->getName()) - ->setQtyOrdered(1) - ->setBasePrice($product->getPrice()) - ->setPrice($product->getPrice()) - ->setRowTotal($product->getPrice()) - ->setProductType($product->getTypeId()); - -$orderAmount = 100; -$customerEmail = $billingAddress->getEmail(); - -/** @var Order $order */ -$order = $objectManager->create(Order::class); -$order->setIncrementId('100000002') - ->setState(Order::STATE_PROCESSING) - ->setStatus(Order::STATE_PROCESSING) - ->setCustomerIsGuest(true) - ->setRemoteIp('127.0.0.1') - ->setCreatedAt('2016-12-12T12:00:55+0000') - ->setOrderCurrencyCode('USD') - ->setBaseCurrencyCode('USD') - ->setSubtotal($orderAmount) - ->setGrandTotal($orderAmount) - ->setBaseSubtotal($orderAmount) - ->setBaseGrandTotal($orderAmount) - ->setCustomerEmail($customerEmail) - ->setBillingAddress($billingAddress) - ->setStoreId($store->getId()) - ->addItem($orderItem1) - ->setPayment($payment) - ->setQuoteId(1); - -/** @var OrderRepositoryInterface $orderRepository */ -$orderRepository = $objectManager->get(OrderRepositoryInterface::class); -$orderRepository->save($order); diff --git a/dev/tests/integration/testsuite/Magento/Signifyd/_files/store.php b/dev/tests/integration/testsuite/Magento/Signifyd/_files/store.php deleted file mode 100644 index b814263bdc5ef..0000000000000 --- a/dev/tests/integration/testsuite/Magento/Signifyd/_files/store.php +++ /dev/null @@ -1,33 +0,0 @@ -<?php -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ - -use Magento\Store\Model\Store; -use Magento\Store\Model\Information; -use Magento\Store\Model\ScopeInterface; -use Magento\Store\Model\StoreManagerInterface; -use Magento\Sales\Model\Order\Shipment; -use Magento\Framework\App\Config\MutableScopeConfigInterface; -use Magento\TestFramework\Helper\Bootstrap; - -$objectManager = Bootstrap::getObjectManager(); -$store = $objectManager->get(StoreManagerInterface::class)->getStore(); -/** @var MutableScopeConfigInterface $mutableConfig */ -$mutableConfig = $objectManager->get(MutableScopeConfigInterface::class); -$mutableConfig->setValue(Information::XML_PATH_STORE_INFO_NAME, 'Sample Store', ScopeInterface::SCOPE_STORE); -$mutableConfig->setValue(Store::XML_PATH_UNSECURE_BASE_LINK_URL, 'http://m2.com/', ScopeInterface::SCOPE_STORE); -$mutableConfig->setValue(Shipment::XML_PATH_STORE_ADDRESS1, '6161 West Centinela Avenue', ScopeInterface::SCOPE_STORE); -$mutableConfig->setValue(Shipment::XML_PATH_STORE_ADDRESS2, 'app. 111', ScopeInterface::SCOPE_STORE); -$mutableConfig->setValue(Shipment::XML_PATH_STORE_CITY, 'Culver City', ScopeInterface::SCOPE_STORE); -$mutableConfig->setValue(Shipment::XML_PATH_STORE_REGION_ID, 10, ScopeInterface::SCOPE_STORE); -$mutableConfig->setValue(Shipment::XML_PATH_STORE_ZIP, '90230', ScopeInterface::SCOPE_STORE); -$mutableConfig->setValue(Shipment::XML_PATH_STORE_COUNTRY_ID, 'US', ScopeInterface::SCOPE_STORE); - -$mutableConfig->setValue(Information::XML_PATH_STORE_INFO_STREET_LINE1, '5th Avenue', ScopeInterface::SCOPE_STORE); -$mutableConfig->setValue(Information::XML_PATH_STORE_INFO_STREET_LINE2, '75', ScopeInterface::SCOPE_STORE); -$mutableConfig->setValue(Information::XML_PATH_STORE_INFO_CITY, 'New York', ScopeInterface::SCOPE_STORE); -$mutableConfig->setValue(Information::XML_PATH_STORE_INFO_REGION_CODE, 30, ScopeInterface::SCOPE_STORE); -$mutableConfig->setValue(Information::XML_PATH_STORE_INFO_POSTCODE, '19032', ScopeInterface::SCOPE_STORE); -$mutableConfig->setValue(Information::XML_PATH_STORE_INFO_COUNTRY_CODE, 'US', ScopeInterface::SCOPE_STORE); diff --git a/dev/tests/integration/testsuite/Magento/Signifyd/_files/webhook_body.json b/dev/tests/integration/testsuite/Magento/Signifyd/_files/webhook_body.json deleted file mode 100644 index 4308c8bf833ef..0000000000000 --- a/dev/tests/integration/testsuite/Magento/Signifyd/_files/webhook_body.json +++ /dev/null @@ -1 +0,0 @@ -{"investigationId":123,"analysisUrl":"https://signifyd.com/v2/cases/185088720/analysis","entriesUrl":"https://signifyd.com/v2/cases/185088720/entries","notesUrl":"https://signifyd.com/v2/cases/185088720/notes","orderUrl":"https://signifyd.com/v2/cases/185088720/order","currency":"USD","uuid":"368df42c-d25f-44ef-a1d9-92755f743901","createdAt":"2017-01-06T12:47:03+0000","updatedAt":"2017-01-06T12:47:03+0000","status":"OPEN","caseId":123,"score":384,"headline":"John Doe","orderId":"000000003","adjustedScore":385,"orderDate":"2017-01-06T12:46:58+0000","orderAmount":5.85,"orderOutcome":"SUCCESSFUL","associatedTeam":{"teamName":"Magento","teamId":7940},"testInvestigation":true,"reviewDisposition":null} \ No newline at end of file diff --git a/dev/tests/integration/testsuite/Magento/Signifyd/_files/website_configuration.php b/dev/tests/integration/testsuite/Magento/Signifyd/_files/website_configuration.php deleted file mode 100644 index e53b0431503e7..0000000000000 --- a/dev/tests/integration/testsuite/Magento/Signifyd/_files/website_configuration.php +++ /dev/null @@ -1,67 +0,0 @@ -<?php -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ -declare(strict_types=1); - -use Magento\Config\Model\Config; -use Magento\Framework\App\Config\ScopeConfigInterface; -use Magento\Store\Model\ResourceModel\Store as StoreResourceModel; -use Magento\Store\Model\ResourceModel\Website as WebsiteResourceModel; -use Magento\Store\Model\ScopeInterface; -use Magento\Store\Model\Store; -use Magento\Store\Model\StoreManagerInterface; -use Magento\Store\Model\Website; -use Magento\TestFramework\Helper\Bootstrap; - -$objectManager = Bootstrap::getObjectManager(); - -/** @var $website Website */ -$website = $objectManager->create(Website::class); -$website->setData(['code' => 'test_website', 'name' => 'Test Website', 'default_group_id' => '1', 'is_default' => '0']); -$websiteResourceModel = $objectManager->create(WebsiteResourceModel::class); -$websiteResourceModel->save($website); - -$websiteId = $website->getId(); -$store = $objectManager->create(Store::class); -$groupId = Bootstrap::getObjectManager()->get(StoreManagerInterface::class) - ->getWebsite() - ->getDefaultGroupId(); -$store->setCode('test_second_store') - ->setWebsiteId($websiteId) - ->setGroupId($groupId) - ->setName('Test Second Store') - ->setSortOrder(10) - ->setIsActive(1); -$storeResourceModel = $objectManager->create(StoreResourceModel::class); -$storeResourceModel->save($store); - -/* Refresh stores memory cache */ -$objectManager->get(StoreManagerInterface::class)->reinitStores(); - -$processConfigData = function (Config $config, array $data) { - foreach ($data as $key => $value) { - $config->setDataByPath($key, $value); - $config->save(); - } -}; - -// save signifyd configuration for the default scope -$configData = [ - 'fraud_protection/signifyd/active' => '1', -]; -/** @var Config $defConfig */ -$defConfig = $objectManager->create(Config::class); -$defConfig->setScope(ScopeConfigInterface::SCOPE_TYPE_DEFAULT); -$processConfigData($defConfig, $configData); - -// save signifyd website config data -$websiteConfigData = [ - 'fraud_protection/signifyd/active' => '0', -]; -/** @var Config $websiteConfig */ -$websiteConfig = $objectManager->create(Config::class); -$websiteConfig->setScope(ScopeInterface::SCOPE_WEBSITES); -$websiteConfig->setWebsite($websiteId); -$processConfigData($websiteConfig, $websiteConfigData); diff --git a/dev/tests/integration/testsuite/Magento/Signifyd/_files/website_configuration_rollback.php b/dev/tests/integration/testsuite/Magento/Signifyd/_files/website_configuration_rollback.php deleted file mode 100644 index 9b731813fea3b..0000000000000 --- a/dev/tests/integration/testsuite/Magento/Signifyd/_files/website_configuration_rollback.php +++ /dev/null @@ -1,44 +0,0 @@ -<?php -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ -declare(strict_types=1); - -use Magento\Framework\App\Config\ScopeConfigInterface; -use Magento\Framework\App\Config\Storage\WriterInterface; -use Magento\Store\Api\WebsiteRepositoryInterface; -use Magento\Store\Model\ScopeInterface; -use Magento\Store\Model\Store; -use Magento\Store\Model\Website; -use Magento\TestFramework\Helper\Bootstrap; - -$objectManager = Bootstrap::getObjectManager(); - -$deleteConfigData = function (WriterInterface $writer, $scope, $scopeId) { - $configData = [ - 'fraud_protection/signifyd/active', - ]; - foreach ($configData as $path) { - $writer->delete($path, $scope, $scopeId); - } -}; - -/** @var WriterInterface $configWriter */ -$configWriter = $objectManager->get(WriterInterface::class); -$deleteConfigData($configWriter, ScopeConfigInterface::SCOPE_TYPE_DEFAULT, null); - -/** @var WebsiteRepositoryInterface $websiteRepository */ -$websiteRepository = $objectManager->get(WebsiteRepositoryInterface::class); -$website = $websiteRepository->get('test_website'); -$deleteConfigData($configWriter, ScopeInterface::SCOPE_WEBSITES, $website->getId()); - -$website = $objectManager->create(Website::class); -/** @var $website Website */ -if ($website->load('test_website', 'code')->getId()) { - $website->delete(); -} -$store = $objectManager->create(Store::class); -if ($store->load('test_second_store', 'code')->getId()) { - $store->delete(); -} diff --git a/dev/tests/integration/testsuite/Magento/Store/App/Config/Source/InitialConfigSourceTest.php b/dev/tests/integration/testsuite/Magento/Store/App/Config/Source/InitialConfigSourceTest.php new file mode 100644 index 0000000000000..282b2d1cc24bb --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Store/App/Config/Source/InitialConfigSourceTest.php @@ -0,0 +1,175 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Store\App\Config\Source; + +use Magento\Framework\App\DeploymentConfig\FileReader; +use Magento\Framework\App\DeploymentConfig\Writer; +use Magento\Framework\App\Filesystem\DirectoryList; +use Magento\Framework\Config\File\ConfigFilePool; +use Magento\Framework\Filesystem; +use Magento\Store\Model\StoreManagerInterface; +use Magento\TestFramework\Helper\Bootstrap; +use PHPUnit\Framework\TestCase; + +/** + * Test that initial scopes config are loaded if database is available + */ +class InitialConfigSourceTest extends TestCase +{ + /** + * @var Filesystem + */ + private $filesystem; + + /** + * @var ConfigFilePool + */ + private $configFilePool; + + /** + * @var FileReader + */ + private $reader; + + /** + * @var Writer + */ + private $writer; + + /** + * @var array + */ + private $config; + + /** + * @var array + */ + private $envConfig; + + /** + * @var StoreManagerInterface + */ + private $storeManager; + + /** + * @inheritdoc + */ + protected function setUp() + { + $objectManager = Bootstrap::getObjectManager(); + $this->reader = $objectManager->get(FileReader::class); + $this->writer = $objectManager->get(Writer::class); + $this->filesystem = $objectManager->get(Filesystem::class); + $this->configFilePool = $objectManager->get(ConfigFilePool::class); + $this->storeManager = $objectManager->get(StoreManagerInterface::class); + $this->config = $this->loadConfig(); + $this->envConfig = $this->loadEnvConfig(); + $this->loadDumpConfig(); + $this->storeManager->reinitStores(); + } + + /** + * @inheritdoc + */ + public function tearDown() + { + $this->clearConfig(ConfigFilePool::APP_CONFIG); + $this->clearConfig(ConfigFilePool::APP_ENV); + $this->writer->saveConfig([ConfigFilePool::APP_CONFIG => $this->config]); + $this->writer->saveConfig([ConfigFilePool::APP_ENV => $this->envConfig]); + $this->storeManager->reinitStores(); + } + + /** + * Test that initial scopes config are loaded if database is available + * + * @param array $websites + * @param string $defaultWebsite + * @param bool $offline + * @throws \Magento\Framework\Exception\LocalizedException + * @dataProvider getDefaultDataProvider + */ + public function testGetWebsites(array $websites, string $defaultWebsite, bool $offline = false): void + { + if ($offline) { + // remove application environment config for emulate work without db + $this->clearConfig(ConfigFilePool::APP_ENV); + } + $this->assertEquals($defaultWebsite, $this->storeManager->getWebsite()->getCode()); + $this->assertEquals($websites, array_keys($this->storeManager->getWebsites(true, true)), '', 0.0, 10, true); + } + + /** + * @return array + */ + public function getDefaultDataProvider(): array + { + return [ + [ + [ + 'admin', + 'base', + ], + 'base', + false + ], + [ + [ + 'admin', + 'main', + ], + 'main', + true + ] + ]; + } + + private function clearConfig(string $type): void + { + $this->filesystem->getDirectoryWrite(DirectoryList::CONFIG)->writeFile( + $this->configFilePool->getPath($type), + "<?php\n return [];\n" + ); + } + + /** + * @return void + */ + private function loadDumpConfig(): void + { + $data = array_replace_recursive( + $this->config, + $this->getDumpConfig() + ); + $this->writer->saveConfig([ConfigFilePool::APP_CONFIG => $data], true); + } + + /** + * @return array + */ + private function getDumpConfig(): array + { + return require __DIR__ . '/../../../_files/dump_config.php'; + } + + /** + * @return array + */ + private function loadConfig(): array + { + return $this->reader->load(ConfigFilePool::APP_CONFIG); + } + + /** + * @return array + */ + private function loadEnvConfig(): array + { + return $this->reader->load(ConfigFilePool::APP_ENV); + } +} diff --git a/dev/tests/integration/testsuite/Magento/Store/_files/dump_config.php b/dev/tests/integration/testsuite/Magento/Store/_files/dump_config.php new file mode 100644 index 0000000000000..7e4337ee65200 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Store/_files/dump_config.php @@ -0,0 +1,65 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +return [ + 'scopes' => [ + 'websites' => [ + 'admin' => [ + 'website_id' => '0', + 'code' => 'admin', + 'name' => 'Admin', + 'sort_order' => '0', + 'default_group_id' => '0', + 'is_default' => '0', + ], + 'main' => [ // base website code was changed to main + 'website_id' => '1', + 'code' => 'main', + 'name' => 'Main Website', + 'sort_order' => '0', + 'default_group_id' => '1', + 'is_default' => '1', + ], + ], + 'groups' => [ + 0 => [ + 'group_id' => '0', + 'website_id' => '0', + 'code' => 'default', + 'name' => 'Default', + 'root_category_id' => '0', + 'default_store_id' => '0', + ], + 1 => [ + 'group_id' => '1', + 'website_id' => '1', + 'code' => 'main_website_store', + 'name' => 'Main Website Store', + 'root_category_id' => '2', + 'default_store_id' => '1', + ], + ], + 'stores' => [ + 'admin' => [ + 'store_id' => '0', + 'code' => 'admin', + 'website_id' => '0', + 'group_id' => '0', + 'name' => 'Admin', + 'sort_order' => '0', + 'is_active' => '1', + ], + 'default' => [ + 'store_id' => '1', + 'code' => 'default', + 'website_id' => '1', + 'group_id' => '1', + 'name' => 'Default Store View', + 'sort_order' => '0', + 'is_active' => '1', + ], + ], + ] +]; diff --git a/dev/tests/integration/testsuite/Magento/Test/Integrity/Modular/_files/skip_blocks_ce.php b/dev/tests/integration/testsuite/Magento/Test/Integrity/Modular/_files/skip_blocks_ce.php index 229207aa03899..7a8f04d0160ff 100644 --- a/dev/tests/integration/testsuite/Magento/Test/Integrity/Modular/_files/skip_blocks_ce.php +++ b/dev/tests/integration/testsuite/Magento/Test/Integrity/Modular/_files/skip_blocks_ce.php @@ -20,5 +20,6 @@ // Fails because of dependence on registry \Magento\Reminder\Block\Adminhtml\Reminder\Edit\Tab\Customers::class, \Magento\LayeredNavigation\Block\Navigation::class, - \Magento\LayeredNavigation\Block\Navigation\State::class + \Magento\LayeredNavigation\Block\Navigation\State::class, + \Magento\Paypal\Block\Express\InContext\Minicart\Button::class, ]; diff --git a/dev/tests/integration/testsuite/Magento/Test/Integrity/Modular/_files/skip_template_blocks_ce.php b/dev/tests/integration/testsuite/Magento/Test/Integrity/Modular/_files/skip_template_blocks_ce.php index 91d74b0908078..1edb23738820f 100644 --- a/dev/tests/integration/testsuite/Magento/Test/Integrity/Modular/_files/skip_template_blocks_ce.php +++ b/dev/tests/integration/testsuite/Magento/Test/Integrity/Modular/_files/skip_template_blocks_ce.php @@ -12,4 +12,5 @@ \Magento\Reminder\Block\Adminhtml\Reminder\Edit\Tab\Customers::class, \Magento\LayeredNavigation\Block\Navigation::class, \Magento\LayeredNavigation\Block\Navigation\State::class, + \Magento\Paypal\Block\Express\InContext\Minicart\Button::class, ]; diff --git a/dev/tests/js/jasmine/tests/app/code/Magento/Checkout/frontend/js/sidebar.test.js b/dev/tests/js/jasmine/tests/app/code/Magento/Checkout/frontend/js/sidebar.test.js index 7c21a8aae2f26..e9b606eebac3d 100644 --- a/dev/tests/js/jasmine/tests/app/code/Magento/Checkout/frontend/js/sidebar.test.js +++ b/dev/tests/js/jasmine/tests/app/code/Magento/Checkout/frontend/js/sidebar.test.js @@ -67,7 +67,9 @@ define([ sidebar._removeItemAfter(elem); expect(mocks['Magento_Customer/js/customer-data'].get).toHaveBeenCalledWith('cart'); expect(jQuery('body').trigger).toHaveBeenCalledWith('ajax:removeFromCart', { - 'productIds': ['5'] + 'productIds': ['5'], 'productInfo': [{ + 'id': '5' + }] }); }); diff --git a/dev/tests/js/jasmine/tests/app/code/Magento/Signifyd/frontend/js/Fingerprint.test.js b/dev/tests/js/jasmine/tests/app/code/Magento/Signifyd/frontend/js/Fingerprint.test.js deleted file mode 100644 index a9d9fe8d08047..0000000000000 --- a/dev/tests/js/jasmine/tests/app/code/Magento/Signifyd/frontend/js/Fingerprint.test.js +++ /dev/null @@ -1,47 +0,0 @@ -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ - -define([ - 'jquery' -], function ($) { - 'use strict'; - - /*eslint max-nested-callbacks: ["error", 5]*/ - describe('Signifyd device fingerprint client script', function () { - var originalTimeout; - - beforeEach(function () { - originalTimeout = jasmine.DEFAULT_TIMEOUT_INTERVAL; - jasmine.DEFAULT_TIMEOUT_INTERVAL = 12000; - }); - - afterEach(function () { - jasmine.DEFAULT_TIMEOUT_INTERVAL = originalTimeout; - }); - - it('SIGNIFYD_GLOBAL object initialization check', function (done) { - var script = document.createElement('script'); - - script.setAttribute('src', 'https://cdn-scripts.signifyd.com/api/script-tag.js'); - script.setAttribute('id', 'sig-api'); - script.setAttribute('type', 'text/javascript'); - script.setAttribute('async', ''); - script.setAttribute('data-order-session-id', 'mage-jasmin-test'); - - $(document.body).append(script); - - setTimeout(function () { - var signifyd = window.SIGNIFYD_GLOBAL; - - expect(signifyd).toBeDefined(); - expect(typeof signifyd).toBe('object'); - expect(signifyd.scriptTagHasLoaded).toBeDefined(); - expect(typeof signifyd.scriptTagHasLoaded).toBe('function'); - expect(signifyd.scriptTagHasLoaded()).toBe(true); - done(); - }, 10000); - }); - }); -}); diff --git a/dev/tests/js/jasmine/tests/app/code/Magento/Ui/base/js/grid/sortBy.test.js b/dev/tests/js/jasmine/tests/app/code/Magento/Ui/base/js/grid/sortBy.test.js new file mode 100644 index 0000000000000..064329ac3bce1 --- /dev/null +++ b/dev/tests/js/jasmine/tests/app/code/Magento/Ui/base/js/grid/sortBy.test.js @@ -0,0 +1,83 @@ +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +/*eslint max-nested-callbacks: 0*/ +define([ + 'Magento_Ui/js/grid/sortBy' +], function (SortBy) { + 'use strict'; + + describe('Magento_Ui/js/grid/sortBy', function () { + + var sortByObj; + + beforeEach(function () { + sortByObj = new SortBy({ + options: [] + }); + }); + + describe('"preparedOptions" method', function () { + it('sort option will not available if sorting is disabled for the columns', function () { + var columns = { + sortable: false, + label: 'magento', + index: 'name' + }; + + sortByObj.preparedOptions([columns]); + expect(sortByObj.options[0]).toBeUndefined(); + expect(sortByObj.options[0]).toBeUndefined(); + }); + + it('sort option will available if sorting is enabled for the columns', function () { + var columns = { + sortable: true, + label: 'magento', + index: 'name' + }; + + sortByObj.preparedOptions([columns]); + expect(sortByObj.options[0].value).toEqual('name'); + expect(sortByObj.options[0].label).toEqual('magento'); + }); + + it('return "isVisible" method true if sorting is enabled for column', function () { + var columns = { + sortable: true, + label: 'magento', + index: 'name' + }; + + sortByObj.preparedOptions([columns]); + expect(sortByObj.isVisible()).toBeTruthy(); + }); + + it('return "isVisible" method false if sorting is disabled for column', function () { + var columns = { + sortable: false, + label: 'magento', + index: 'name' + }; + + sortByObj.preparedOptions([columns]); + expect(sortByObj.isVisible()).toBeFalsy(); + }); + }); + describe('"applyChanges" method', function () { + it('return applied options for sorting column', function () { + var applied = { + field: 'selectedOption', + direction: 'asc' + }; + + spyOn(sortByObj, 'selectedOption').and.returnValue('selectedOption'); + sortByObj.applyChanges(); + expect(sortByObj.applied()).toEqual(applied); + expect(sortByObj.selectedOption).toHaveBeenCalled(); + }); + }); + }); +}); diff --git a/dev/tests/js/jasmine/tests/app/code/Magento/Ui/base/js/modal/prompt.test.js b/dev/tests/js/jasmine/tests/app/code/Magento/Ui/base/js/modal/prompt.test.js index f2c74729e0ee8..7a0d3ac3fef91 100644 --- a/dev/tests/js/jasmine/tests/app/code/Magento/Ui/base/js/modal/prompt.test.js +++ b/dev/tests/js/jasmine/tests/app/code/Magento/Ui/base/js/modal/prompt.test.js @@ -10,8 +10,20 @@ define([ 'use strict'; describe('ui/js/modal/prompt', function () { - var element = $('<div>some element</div>'), + + var element, + prompt, + widget; + + beforeEach(function () { + element = $('<div id="element">some element</div>'), prompt = element.prompt({}); + widget = element.prompt({}).data('mage-prompt'); + }); + + afterEach(function () { + $('#element').remove(); + }); it('Check for modal definition', function () { expect(prompt).toBeDefined(); @@ -23,5 +35,12 @@ define([ it('Integration: modal created on page', function () { expect(prompt.length).toEqual(1); }); + it('Check cancel action', function () { + var cancel = spyOn(widget.options.actions, 'cancel'); + + jQuery('.modals-overlay').click(); + expect(widget.options.outerClickHandler).toBeDefined(); + expect(cancel).toHaveBeenCalled(); + }); }); }); diff --git a/dev/tests/js/jasmine/tests/lib/mage/translate.test.js b/dev/tests/js/jasmine/tests/lib/mage/translate.test.js index dc6c6ce7eb966..a29dbab63232b 100644 --- a/dev/tests/js/jasmine/tests/lib/mage/translate.test.js +++ b/dev/tests/js/jasmine/tests/lib/mage/translate.test.js @@ -33,7 +33,8 @@ define([ translation = { 'Hello World!': 'Hallo Welt!', - 'Some text with symbols!-+"%#*': 'Ein Text mit Symbolen!-+"%#*' + 'Some text with symbols!-+"%#*': 'Ein Text mit Symbolen!-+"%#*', + 'Text with empty value': '' }; $.mage.translate.add(translation); diff --git a/dev/tests/static/testsuite/Magento/Test/Integrity/_files/blacklist/exception_hierarchy.txt b/dev/tests/static/testsuite/Magento/Test/Integrity/_files/blacklist/exception_hierarchy.txt index 8eb3392476400..195c88274ae4a 100644 --- a/dev/tests/static/testsuite/Magento/Test/Integrity/_files/blacklist/exception_hierarchy.txt +++ b/dev/tests/static/testsuite/Magento/Test/Integrity/_files/blacklist/exception_hierarchy.txt @@ -10,6 +10,4 @@ \Magento\Framework\DB\DataConverter\DataConversionException \Magento\Framework\DB\FieldDataConversionException \Magento\Catalog\Model\Product\Image\NotLoadInfoImageException -\Magento\Signifyd\Model\SignifydGateway\GatewayException -\Magento\Signifyd\Model\SignifydGateway\ApiCallException \Magento\Framework\MessageQueue\ConnectionLostException diff --git a/dev/tests/static/testsuite/Magento/Test/Legacy/_files/obsolete_namespaces.php b/dev/tests/static/testsuite/Magento/Test/Legacy/_files/obsolete_namespaces.php index f2411cdad86de..168ac5cde16cb 100644 --- a/dev/tests/static/testsuite/Magento/Test/Legacy/_files/obsolete_namespaces.php +++ b/dev/tests/static/testsuite/Magento/Test/Legacy/_files/obsolete_namespaces.php @@ -201,4 +201,5 @@ ['Magento\MysqlMq\Model\Resource', 'Magento\MysqlMq\Model\ResourceModel'], ['Magento\BulkOperations', 'Magento\AsynchronousOperations'], ['Zend', 'Laminas'], + ['Magento\Signifyd'], ]; diff --git a/lib/internal/Magento/Framework/App/FrontController.php b/lib/internal/Magento/Framework/App/FrontController.php index 2e6ce65970b97..d72c548be4fba 100644 --- a/lib/internal/Magento/Framework/App/FrontController.php +++ b/lib/internal/Magento/Framework/App/FrontController.php @@ -5,14 +5,15 @@ */ namespace Magento\Framework\App; +use Magento\Framework\App\Action\AbstractAction; +use Magento\Framework\App\Request\Http as HttpRequest; use Magento\Framework\App\Request\InvalidRequestException; -use Magento\Framework\Controller\ResultInterface; use Magento\Framework\App\Request\ValidatorInterface as RequestValidator; +use Magento\Framework\Controller\ResultInterface; +use Magento\Framework\Exception\LocalizedException; use Magento\Framework\Exception\NotFoundException; use Magento\Framework\Message\ManagerInterface as MessageManager; -use Magento\Framework\App\Action\AbstractAction; use Psr\Log\LoggerInterface; -use Magento\Framework\App\Request\Http as HttpRequest; /** * Front controller responsible for dispatching application requests @@ -51,19 +52,33 @@ class FrontController implements FrontControllerInterface */ private $validatedRequest = false; + /** + * @var State + */ + private $appState; + + /** + * @var AreaList + */ + private $areaList; + /** * @param RouterListInterface $routerList * @param ResponseInterface $response * @param RequestValidator|null $requestValidator * @param MessageManager|null $messageManager * @param LoggerInterface|null $logger + * @param State $appState + * @param AreaList $areaList */ public function __construct( RouterListInterface $routerList, ResponseInterface $response, ?RequestValidator $requestValidator = null, ?MessageManager $messageManager = null, - ?LoggerInterface $logger = null + ?LoggerInterface $logger = null, + ?State $appState = null, + ?AreaList $areaList = null ) { $this->_routerList = $routerList; $this->response = $response; @@ -73,6 +88,10 @@ public function __construct( ?? ObjectManager::getInstance()->get(MessageManager::class); $this->logger = $logger ?? ObjectManager::getInstance()->get(LoggerInterface::class); + $this->appState = $appState + ?? ObjectManager::getInstance()->get(State::class); + $this->areaList = $areaList + ?? ObjectManager::getInstance()->get(AreaList::class); } /** @@ -81,6 +100,7 @@ public function __construct( * @param RequestInterface|HttpRequest $request * @return ResponseInterface|ResultInterface * @throws \LogicException + * @throws LocalizedException */ public function dispatch(RequestInterface $request) { @@ -120,9 +140,10 @@ public function dispatch(RequestInterface $request) * * @param HttpRequest $request * @param ActionInterface $actionInstance - * @throws NotFoundException - * * @return ResponseInterface|ResultInterface + * @throws LocalizedException + * + * @throws NotFoundException */ private function processRequest( HttpRequest $request, @@ -147,6 +168,9 @@ private function processRequest( ["exception" => $exception] ); $result = $exception->getReplaceResult(); + $area = $this->areaList->getArea($this->appState->getAreaCode()); + $area->load(Area::PART_DESIGN); + $area->load(Area::PART_TRANSLATE); if ($messages = $exception->getMessages()) { foreach ($messages as $message) { $this->messages->addErrorMessage($message); diff --git a/lib/internal/Magento/Framework/App/Test/Unit/FrontControllerTest.php b/lib/internal/Magento/Framework/App/Test/Unit/FrontControllerTest.php index e088bb92c8782..727e27080569c 100644 --- a/lib/internal/Magento/Framework/App/Test/Unit/FrontControllerTest.php +++ b/lib/internal/Magento/Framework/App/Test/Unit/FrontControllerTest.php @@ -6,8 +6,12 @@ namespace Magento\Framework\App\Test\Unit; +use Magento\Framework\App\Area; +use Magento\Framework\App\AreaInterface; +use Magento\Framework\App\AreaList; use Magento\Framework\App\Request\InvalidRequestException; use Magento\Framework\App\Request\ValidatorInterface; +use Magento\Framework\App\State; use Magento\Framework\Exception\NotFoundException; use Magento\Framework\Message\ManagerInterface as MessageManager; use Psr\Log\LoggerInterface; @@ -57,6 +61,21 @@ class FrontControllerTest extends \PHPUnit\Framework\TestCase */ private $logger; + /** + * @var \PHPUnit\Framework\MockObject\MockObject|AreaList + */ + private $areaListMock; + + /** + * @var \PHPUnit\Framework\MockObject\MockObject|State + */ + private $appStateMock; + + /** + * @var \PHPUnit\Framework\MockObject\MockObject|AreaInterface + */ + private $areaMock; + protected function setUp() { $this->request = $this->getMockBuilder(\Magento\Framework\App\Request\Http::class) @@ -70,12 +89,19 @@ protected function setUp() $this->requestValidator = $this->createMock(ValidatorInterface::class); $this->messages = $this->createMock(MessageManager::class); $this->logger = $this->createMock(LoggerInterface::class); + $this->appStateMock = $this->getMockBuilder(State::class) + ->disableOriginalConstructor() + ->getMock(); + $this->areaListMock = $this->createMock(AreaList::class); + $this->areaMock = $this->createMock(AreaInterface::class); $this->model = new \Magento\Framework\App\FrontController( $this->routerList, $this->response, $this->requestValidator, $this->messages, - $this->logger + $this->logger, + $this->appStateMock, + $this->areaListMock ); } @@ -114,6 +140,10 @@ public function testAddingValidationFailureMessageToDebugLog() $exceptionMessage = 'exception_message'; $exception = new InvalidRequestException($exceptionMessage); + $this->appStateMock->expects($this->any())->method('getAreaCode')->willReturn('frontend'); + $this->areaMock->expects($this->at(0))->method('load')->with(Area::PART_DESIGN)->willReturnSelf(); + $this->areaMock->expects($this->at(1))->method('load')->with(Area::PART_TRANSLATE)->willReturnSelf(); + $this->areaListMock->expects($this->any())->method('getArea')->will($this->returnValue($this->areaMock)); $this->routerList->expects($this->any()) ->method('valid') ->will($this->returnValue(true)); diff --git a/lib/internal/Magento/Framework/Filesystem/Driver/File.php b/lib/internal/Magento/Framework/Filesystem/Driver/File.php index 27df19f66c7aa..aec9a64a132fe 100644 --- a/lib/internal/Magento/Framework/Filesystem/Driver/File.php +++ b/lib/internal/Magento/Framework/Filesystem/Driver/File.php @@ -254,7 +254,10 @@ private function mkdirRecursive($path, $permissions = 0777) public function readDirectory($path) { try { - $flags = \FilesystemIterator::SKIP_DOTS | \FilesystemIterator::UNIX_PATHS; + $flags = \FilesystemIterator::SKIP_DOTS | + \FilesystemIterator::UNIX_PATHS | + \RecursiveDirectoryIterator::FOLLOW_SYMLINKS; + $iterator = new \FilesystemIterator($path, $flags); $result = []; /** @var \FilesystemIterator $file */ @@ -946,7 +949,10 @@ protected function getScheme($scheme = null) public function readDirectoryRecursively($path = null) { $result = []; - $flags = \FilesystemIterator::SKIP_DOTS | \FilesystemIterator::UNIX_PATHS; + $flags = \FilesystemIterator::SKIP_DOTS | + \FilesystemIterator::UNIX_PATHS | + \RecursiveDirectoryIterator::FOLLOW_SYMLINKS; + try { $iterator = new \RecursiveIteratorIterator( new \RecursiveDirectoryIterator($path, $flags), diff --git a/lib/internal/Magento/Framework/Stdlib/Test/Unit/DateTime/DateTimeTest.php b/lib/internal/Magento/Framework/Stdlib/Test/Unit/DateTime/DateTimeTest.php index 3c7f49671d74a..210e36ee05ef1 100644 --- a/lib/internal/Magento/Framework/Stdlib/Test/Unit/DateTime/DateTimeTest.php +++ b/lib/internal/Magento/Framework/Stdlib/Test/Unit/DateTime/DateTimeTest.php @@ -5,13 +5,18 @@ */ namespace Magento\Framework\Stdlib\Test\Unit\DateTime; +use DateTimeImmutable; +use DateTimeInterface; +use Exception; use Magento\Framework\Stdlib\DateTime\DateTime; use Magento\Framework\Stdlib\DateTime\TimezoneInterface; +use PHPUnit\Framework\MockObject\MockObject; +use PHPUnit\Framework\TestCase; /** - * Magento\Framework\Stdlib\DateTimeTest test case + * Tests for @see DateTime */ -class DateTimeTest extends \PHPUnit\Framework\TestCase +class DateTimeTest extends TestCase { /** * @var string @@ -19,12 +24,14 @@ class DateTimeTest extends \PHPUnit\Framework\TestCase private $testDate = '2015-04-02 21:03:00'; /** - * @param int|string|\DateTimeInterface $input + * @param int|string|DateTimeInterface $input + * @throws Exception + * * @dataProvider dateTimeInputDataProvider */ public function testGmtTimestamp($input) { - /** @var TimezoneInterface|\PHPUnit_Framework_MockObject_MockObject $timezone */ + /** @var TimezoneInterface|MockObject $timezone */ $timezone = $this->getMockBuilder(TimezoneInterface::class)->getMock(); $timezone->method('date')->willReturn(new \DateTime($this->testDate)); @@ -33,12 +40,14 @@ public function testGmtTimestamp($input) } /** - * @param int|string|\DateTimeInterface $input + * @param int|string|DateTimeInterface $input + * @throws Exception + * * @dataProvider dateTimeInputDataProvider */ public function testTimestamp($input) { - /** @var TimezoneInterface|\PHPUnit_Framework_MockObject_MockObject $timezone */ + /** @var TimezoneInterface|MockObject $timezone */ $timezone = $this->getMockBuilder(TimezoneInterface::class)->getMock(); $timezone->method('date')->willReturn(new \DateTime($this->testDate)); @@ -48,28 +57,50 @@ public function testTimestamp($input) public function testGtmOffset() { - /** @var TimezoneInterface|\PHPUnit_Framework_MockObject_MockObject $timezone */ + /** @var TimezoneInterface|MockObject $timezone */ $timezone = $this->getMockBuilder(TimezoneInterface::class)->getMock(); $timezone->method('getConfigTimezone')->willReturn('Europe/Amsterdam'); - /** @var DateTime|\PHPUnit_Framework_MockObject_MockObject $dateTime */ + /** @var DateTime|MockObject $dateTime */ $dateTime = $this->getMockBuilder(DateTime::class) ->setConstructorArgs([$timezone]) ->setMethods(null) ->getMock(); - $this->assertEquals(3600, $dateTime->getGmtOffset()); + $this->assertEquals( + $this->getExpectedGtmOffset($timezone->getConfigTimezone()), + $dateTime->getGmtOffset() + ); } /** + * Returns expected offset according to Daylight Saving Time in timezone + * + * @param string $timezoneIdentifier + * @return int + */ + private function getExpectedGtmOffset(string $timezoneIdentifier): int + { + $timeZoneToReturn = date_default_timezone_get(); + date_default_timezone_set($timezoneIdentifier); + $expectedOffset = (date('I', time()) + 1) * 3600; + date_default_timezone_set($timeZoneToReturn); + + return (int) $expectedOffset; + } + + /** + * Data provider + * * @return array + * @throws Exception */ public function dateTimeInputDataProvider() { return [ 'string' => [$this->testDate], 'int' => [strtotime($this->testDate)], - \DateTimeInterface::class => [new \DateTimeImmutable($this->testDate)], + DateTimeInterface::class => [new DateTimeImmutable($this->testDate)], ]; } } diff --git a/lib/web/mage/translate.js b/lib/web/mage/translate.js index 0a385da8dcf38..8c5c218b2498f 100644 --- a/lib/web/mage/translate.js +++ b/lib/web/mage/translate.js @@ -39,7 +39,7 @@ define([ * @return {String} */ translate: function (text) { - return _data[text] ? _data[text] : text; + return typeof _data[text] !== 'undefined' ? _data[text] : text; } }; }()) diff --git a/lib/web/mage/validation.js b/lib/web/mage/validation.js index 18e7b6413bc96..10f9dab6bdd9b 100644 --- a/lib/web/mage/validation.js +++ b/lib/web/mage/validation.js @@ -6,10 +6,11 @@ define([ 'jquery', 'moment', + 'mageUtils', 'jquery-ui-modules/widget', 'jquery/validate', 'mage/translate' -], function ($, moment) { +], function ($, moment, utils) { 'use strict'; var creditCartTypes, rules, showLabel, originValidateDelegate; @@ -1032,7 +1033,7 @@ define([ ], 'validate-date': [ function (value, params, additionalParams) { - var test = moment(value, additionalParams.dateFormat); + var test = moment(value, utils.convertToMomentFormat(additionalParams.dateFormat)); return $.mage.isEmptyNoTrim(value) || test.isValid(); }, diff --git a/setup/src/Magento/Setup/Controller/Navigation.php b/setup/src/Magento/Setup/Controller/Navigation.php index c1d42d905b3eb..e3f2091accbbd 100644 --- a/setup/src/Magento/Setup/Controller/Navigation.php +++ b/setup/src/Magento/Setup/Controller/Navigation.php @@ -8,8 +8,11 @@ use Laminas\Mvc\Controller\AbstractActionController; use Laminas\View\Model\JsonModel; use Laminas\View\Model\ViewModel; +use Magento\Backend\Model\UrlInterface; +use Magento\Framework\ObjectManagerInterface; use Magento\Setup\Model\Cron\Status; use Magento\Setup\Model\Navigation as NavModel; +use Magento\Setup\Model\ObjectManagerProvider; /** * Navigation controller @@ -32,13 +35,20 @@ class Navigation extends AbstractActionController protected $view; /** - * @param NavModel $navigation - * @param Status $status + * @var ObjectManagerInterface */ - public function __construct(NavModel $navigation, Status $status) + private $objectManagerProvider; + + /** + * @param NavModel $navigation + * @param Status $status + * @param ObjectManagerProvider $objectManagerProvider + */ + public function __construct(NavModel $navigation, Status $status, ObjectManagerProvider $objectManagerProvider) { $this->navigation = $navigation; $this->status = $status; + $this->objectManagerProvider = $objectManagerProvider->get(); $this->view = new ViewModel(); $this->view->setVariable('menu', $this->navigation->getMenuItems()); $this->view->setVariable('main', $this->navigation->getMainItems()); @@ -80,8 +90,11 @@ public function menuAction() */ public function sideMenuAction() { + /** @var UrlInterface $backendUrl */ + $backendUrl = $this->objectManagerProvider->get(UrlInterface::class); $this->view->setTemplate('/magento/setup/navigation/side-menu.phtml'); $this->view->setVariable('isInstaller', $this->navigation->getType() == NavModel::NAV_INSTALLER); + $this->view->setVariable('backendUrl', $backendUrl->getRouteUrl('adminhtml')); $this->view->setTerminal(true); return $this->view; } diff --git a/setup/src/Magento/Setup/Model/ConfigOptionsList/DriverOptions.php b/setup/src/Magento/Setup/Model/ConfigOptionsList/DriverOptions.php index 1d9fdd6098cbb..6d5235cffec77 100644 --- a/setup/src/Magento/Setup/Model/ConfigOptionsList/DriverOptions.php +++ b/setup/src/Magento/Setup/Model/ConfigOptionsList/DriverOptions.php @@ -46,6 +46,7 @@ public function getDriverOptions(array $options): array */ private function optionExists($options, $driverOptionKey): bool { - return $options[$driverOptionKey] === false || !empty($options[$driverOptionKey]); + return isset($options[$driverOptionKey]) + && ($options[$driverOptionKey] === false || !empty($options[$driverOptionKey])); } } diff --git a/setup/view/magento/setup/navigation/side-menu.phtml b/setup/view/magento/setup/navigation/side-menu.phtml index f34a6c7c72e69..b731881e8bf4f 100644 --- a/setup/view/magento/setup/navigation/side-menu.phtml +++ b/setup/view/magento/setup/navigation/side-menu.phtml @@ -20,9 +20,11 @@ ng-show="<?= implode( '&&', $expressions) ?>" > <nav class="admin__menu" ng-controller="mainController"> - <span class="logo logo-static" data-edition="Community Edition"> - <img class="logo-img" src="<?= $this->basePath() ?>/pub/images/logo.svg" alt="Magento Admin Panel"> - </span> + <a href="<?= $this->backendUrl ?>" class="logo" data-edition="Community Edition"> + <span> + <img class="logo-img" src="<?= $this->basePath() ?>/pub/images/logo.svg" alt="Magento Admin Panel"> + </span> + </a> <ul id="nav" role="menubar"> <li class="item-home level-0" ng-class="{_active: $state.current.name === 'root.home'}"> <a href="" ui-sref="root.home">