From aa12503923ac994873724ecaa759e1eb14b318dc Mon Sep 17 00:00:00 2001 From: Jason Woods Date: Wed, 8 Jul 2020 10:44:26 +0100 Subject: [PATCH 001/171] Add warning to deadlock cron retrier to log any future failures for investigation Change key for cron_schedule to cover all queries currently run, ensuring range is on the end of the key Refactor cron locking to remove UPDATE+JOIN which causes shared locks on the join followed by exclusive locks for the update, which can deadlock, to instead use an explicit full exclusive lock on all entries using forUpdate Implement cleanup of jobs that were running but did not complete and did not error, which can occur if PHP crashes or is killed, or database is restored from backup or migrated to staging environments --- .../Magento/Cron/Model/DeadlockRetrier.php | 15 ++++++++ .../Cron/Model/ResourceModel/Schedule.php | 36 +++++++++++++------ .../Observer/ProcessCronQueueObserver.php | 30 ++++++++++++++++ .../Test/Unit/Model/DeadlockRetrierTest.php | 13 ++++++- .../Observer/ProcessCronQueueObserverTest.php | 26 +++++++++++--- app/code/Magento/Cron/etc/db_schema.xml | 6 ++-- 6 files changed, 107 insertions(+), 19 deletions(-) diff --git a/app/code/Magento/Cron/Model/DeadlockRetrier.php b/app/code/Magento/Cron/Model/DeadlockRetrier.php index 15497910a089b..63f7453c8df3c 100644 --- a/app/code/Magento/Cron/Model/DeadlockRetrier.php +++ b/app/code/Magento/Cron/Model/DeadlockRetrier.php @@ -17,6 +17,20 @@ */ class DeadlockRetrier implements DeadlockRetrierInterface { + /** + * @var \Psr\Log\LoggerInterface + */ + private $logger; + + /** + * @param \Psr\Log\LoggerInterface $logger + */ + public function __construct( + \Psr\Log\LoggerInterface $logger + ) { + $this->logger = $logger; + } + /** * @inheritdoc */ @@ -30,6 +44,7 @@ public function execute(callable $callback, AdapterInterface $connection) try { return $callback(); } catch (DeadlockException $e) { + $this->logger->warning(sprintf("Deadlock detected in cron cleanup: %s", $e->getMessage())); continue; } } diff --git a/app/code/Magento/Cron/Model/ResourceModel/Schedule.php b/app/code/Magento/Cron/Model/ResourceModel/Schedule.php index 25ebaec5582c9..120e0ce6432c5 100644 --- a/app/code/Magento/Cron/Model/ResourceModel/Schedule.php +++ b/app/code/Magento/Cron/Model/ResourceModel/Schedule.php @@ -65,31 +65,47 @@ public function trySetJobStatusAtomic($scheduleId, $newStatus, $currentStatus) public function trySetJobUniqueStatusAtomic($scheduleId, $newStatus, $currentStatus) { $connection = $this->getConnection(); + $connection->beginTransaction(); // this condition added to avoid cron jobs locking after incorrect termination of running job $match = $connection->quoteInto( 'existing.job_code = current.job_code ' . - 'AND (existing.executed_at > UTC_TIMESTAMP() - INTERVAL 1 DAY OR existing.executed_at IS NULL) ' . - 'AND existing.status = ?', + 'AND existing.status = ? ' . + 'AND (existing.executed_at > UTC_TIMESTAMP() - INTERVAL 1 DAY OR existing.executed_at IS NULL)', $newStatus ); + // Select and lock all related schedules - this prevents deadlock in case cron overlaps and two jobs of + // the same code attempt to lock at the same time, and force them to serialize $selectIfUnlocked = $connection->select() + ->from( + ['current' => $this->getTable('cron_schedule')], + [] + ) ->joinLeft( ['existing' => $this->getTable('cron_schedule')], $match, - ['status' => new \Zend_Db_Expr($connection->quote($newStatus))] + ['existing.schedule_id'] ) ->where('current.schedule_id = ?', $scheduleId) ->where('current.status = ?', $currentStatus) - ->where('existing.schedule_id IS NULL'); - - $update = $connection->updateFromSelect($selectIfUnlocked, ['current' => $this->getTable('cron_schedule')]); - $result = $connection->query($update)->rowCount(); + ->forUpdate(true); - if ($result == 1) { - return true; + $scheduleId = $connection->fetchOne($selectIfUnlocked); + if (!empty($scheduleId)) { + // Existing running schedule found + $connection->commit(); + return false; } - return false; + + // Mark our schedule as running + $connection->update( + $this->getTable('cron_schedule'), + ['status' => new \Zend_Db_Expr($connection->quote($newStatus))], + ['schedule_id = ?' => $scheduleId] + ); + + $connection->commit(); + return true; } } diff --git a/app/code/Magento/Cron/Observer/ProcessCronQueueObserver.php b/app/code/Magento/Cron/Observer/ProcessCronQueueObserver.php index acffba02eb461..a6a8f77c039d8 100644 --- a/app/code/Magento/Cron/Observer/ProcessCronQueueObserver.php +++ b/app/code/Magento/Cron/Observer/ProcessCronQueueObserver.php @@ -550,6 +550,7 @@ private function cleanupJobs($groupId, $currentTime) ); $this->cleanupDisabledJobs($groupId); + $this->cleanupRunningJobs($groupId); $historySuccess = (int)$this->getCronGroupConfigurationValue($groupId, self::XML_PATH_HISTORY_SUCCESS); $historyFailure = (int)$this->getCronGroupConfigurationValue($groupId, self::XML_PATH_HISTORY_FAILURE); @@ -696,6 +697,35 @@ private function cleanupDisabledJobs($groupId) } } + /** + * Cleanup jobs that were left in a running state due to an unexpected stop + * + * @param string $groupId + * @return void + */ + private function cleanupRunningJobs($groupId) + { + $scheduleResource = $this->_scheduleFactory->create()->getResource(); + $connection = $scheduleResource->getConnection(); + + $jobs = $this->_config->getJobs(); + + $connection->update( + $scheduleResource->getMainTable(), + [ + 'status' => \Magento\Cron\Model\Schedule::STATUS_ERROR, + 'messages' => 'Time out' + ], + $connection->quoteInto( + 'status = ? ' . + 'AND job_code IN (?) ' . + 'AND (scheduled_at < UTC_TIMESTAMP() - INTERVAL 1 DAY)', + \Magento\Cron\Model\Schedule::STATUS_RUNNING, + array_keys($jobs[$groupId]) + ) + ); + } + /** * Get cron expression of cron job. * diff --git a/app/code/Magento/Cron/Test/Unit/Model/DeadlockRetrierTest.php b/app/code/Magento/Cron/Test/Unit/Model/DeadlockRetrierTest.php index 60eaa091a761f..36e4537383aa6 100644 --- a/app/code/Magento/Cron/Test/Unit/Model/DeadlockRetrierTest.php +++ b/app/code/Magento/Cron/Test/Unit/Model/DeadlockRetrierTest.php @@ -13,6 +13,7 @@ use Magento\Framework\DB\Adapter\AdapterInterface; use Magento\Framework\DB\Adapter\DeadlockException; use PHPUnit\Framework\MockObject\MockObject; +use Psr\Log\LoggerInterface; class DeadlockRetrierTest extends \PHPUnit\Framework\TestCase { @@ -27,6 +28,11 @@ class DeadlockRetrierTest extends \PHPUnit\Framework\TestCase */ private $adapterMock; + /** + * @var LoggerInterface|MockObject + */ + private $loggerMock; + /** * @var AbstractModel|MockObject */ @@ -38,8 +44,9 @@ class DeadlockRetrierTest extends \PHPUnit\Framework\TestCase protected function setUp(): void { $this->adapterMock = $this->getMockForAbstractClass(AdapterInterface::class); + $this->loggerMock = $this->getMockForAbstractClass(LoggerInterface::class); $this->modelMock = $this->createMock(AbstractModel::class); - $this->retrier = new DeadlockRetrier(); + $this->retrier = new DeadlockRetrier($this->loggerMock); } /** @@ -75,6 +82,8 @@ public function testRetry(): void $this->modelMock->expects($this->exactly(DeadlockRetrierInterface::MAX_RETRIES)) ->method('getId') ->willThrowException(new DeadlockException()); + $this->loggerMock->expects($this->exactly(DeadlockRetrierInterface::MAX_RETRIES - 1)) + ->method('warning'); $this->retrier->execute( function () { @@ -95,6 +104,8 @@ public function testRetrySecond(): void $this->modelMock->expects($this->at(1)) ->method('getId') ->willReturn(2); + $this->loggerMock->expects($this->once()) + ->method('warning'); $this->retrier->execute( function () { diff --git a/app/code/Magento/Cron/Test/Unit/Observer/ProcessCronQueueObserverTest.php b/app/code/Magento/Cron/Test/Unit/Observer/ProcessCronQueueObserverTest.php index e1e28ff6f06a3..9414680ce0e45 100644 --- a/app/code/Magento/Cron/Test/Unit/Observer/ProcessCronQueueObserverTest.php +++ b/app/code/Magento/Cron/Test/Unit/Observer/ProcessCronQueueObserverTest.php @@ -1047,8 +1047,8 @@ public function testMissedJobsCleanedInTime() $this->scheduleCollectionMock->expects($this->any())->method('load')->willReturnSelf(); $scheduleMock->expects($this->any())->method('getCollection')->willReturn($this->scheduleCollectionMock); - $scheduleMock->expects($this->exactly(9))->method('getResource')->willReturn($this->scheduleResourceMock); - $this->scheduleFactoryMock->expects($this->exactly(10))->method('create')->willReturn($scheduleMock); + $scheduleMock->expects($this->exactly(10))->method('getResource')->willReturn($this->scheduleResourceMock); + $this->scheduleFactoryMock->expects($this->exactly(11))->method('create')->willReturn($scheduleMock); $connectionMock = $this->getMockForAbstractClass(AdapterInterface::class); @@ -1078,11 +1078,29 @@ public function testMissedJobsCleanedInTime() ) ->willReturn(1); - $this->scheduleResourceMock->expects($this->exactly(5)) + $connectionMock->expects($this->once()) + ->method('quoteInto') + ->with( + 'status = ? AND job_code IN (?) AND (scheduled_at < UTC_TIMESTAMP() - INTERVAL 1 DAY)', + ['test_job1'], + 'running' + ) + ->willReturn(''); + + $connectionMock->expects($this->once()) + ->method('update') + ->with( + $tableName, + ['status' => 'error', 'messages' => 'Time out'], + '' + ) + ->willReturn(0); + + $this->scheduleResourceMock->expects($this->exactly(6)) ->method('getTable') ->with($tableName) ->willReturn($tableName); - $this->scheduleResourceMock->expects($this->exactly(14)) + $this->scheduleResourceMock->expects($this->exactly(15)) ->method('getConnection') ->willReturn($connectionMock); diff --git a/app/code/Magento/Cron/etc/db_schema.xml b/app/code/Magento/Cron/etc/db_schema.xml index f26b6feea3b3b..527cdbcc5fb86 100644 --- a/app/code/Magento/Cron/etc/db_schema.xml +++ b/app/code/Magento/Cron/etc/db_schema.xml @@ -21,12 +21,10 @@ - + + - - - From b0b72b0f8486ca119015e84b7786dfab13d2e475 Mon Sep 17 00:00:00 2001 From: Jason Woods Date: Thu, 16 Jul 2020 14:53:52 +0100 Subject: [PATCH 002/171] Higher cardinality first after tested shown still no deadlocks --- app/code/Magento/Cron/etc/db_schema.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/code/Magento/Cron/etc/db_schema.xml b/app/code/Magento/Cron/etc/db_schema.xml index 527cdbcc5fb86..72b1428756898 100644 --- a/app/code/Magento/Cron/etc/db_schema.xml +++ b/app/code/Magento/Cron/etc/db_schema.xml @@ -21,9 +21,9 @@ - - + + From 96029b55f7cd00b58967637aedac67ddd1767bad Mon Sep 17 00:00:00 2001 From: Jason Woods Date: Fri, 21 Aug 2020 10:37:47 +0100 Subject: [PATCH 003/171] Fix test --- .../Cron/Test/Unit/Observer/ProcessCronQueueObserverTest.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/code/Magento/Cron/Test/Unit/Observer/ProcessCronQueueObserverTest.php b/app/code/Magento/Cron/Test/Unit/Observer/ProcessCronQueueObserverTest.php index 9414680ce0e45..98ec3c918f539 100644 --- a/app/code/Magento/Cron/Test/Unit/Observer/ProcessCronQueueObserverTest.php +++ b/app/code/Magento/Cron/Test/Unit/Observer/ProcessCronQueueObserverTest.php @@ -1082,8 +1082,8 @@ public function testMissedJobsCleanedInTime() ->method('quoteInto') ->with( 'status = ? AND job_code IN (?) AND (scheduled_at < UTC_TIMESTAMP() - INTERVAL 1 DAY)', - ['test_job1'], - 'running' + 'running', + ['test_job1'] ) ->willReturn(''); From 68d679b7bd7d371c5266d4803f03f204893f7af2 Mon Sep 17 00:00:00 2001 From: Jason Woods Date: Fri, 21 Aug 2020 12:04:43 +0100 Subject: [PATCH 004/171] Reduce line count to fix static testing --- .../Observer/ProcessCronQueueObserverTest.php | 40 +++++-------------- 1 file changed, 10 insertions(+), 30 deletions(-) diff --git a/app/code/Magento/Cron/Test/Unit/Observer/ProcessCronQueueObserverTest.php b/app/code/Magento/Cron/Test/Unit/Observer/ProcessCronQueueObserverTest.php index 98ec3c918f539..816fdb6173d8b 100644 --- a/app/code/Magento/Cron/Test/Unit/Observer/ProcessCronQueueObserverTest.php +++ b/app/code/Magento/Cron/Test/Unit/Observer/ProcessCronQueueObserverTest.php @@ -764,22 +764,17 @@ function ($callback) { ->method('getCollection')->willReturn($this->scheduleCollectionMock); $scheduleMock->expects($this->any()) ->method('getResource')->willReturn($this->scheduleResourceMock); - $this->scheduleFactoryMock->expects($this->once(2)) + $this->scheduleFactoryMock->expects($this->once()) ->method('create')->willReturn($scheduleMock); $testCronJob = $this->getMockBuilder('CronJob') ->setMethods(['execute'])->getMock(); $testCronJob->expects($this->atLeastOnce())->method('execute')->with($schedule); - $this->objectManagerMock->expects( - $this->once() - )->method( - 'create' - )->with( - 'CronJob' - )->willReturn( - $testCronJob - ); + $this->objectManagerMock->expects($this->once()) + ->method('create') + ->with('CronJob') + ->willReturn($testCronJob); $this->cronQueueObserver->execute($this->observerMock); } @@ -1055,26 +1050,11 @@ public function testMissedJobsCleanedInTime() $connectionMock->expects($this->exactly(5)) ->method('delete') ->withConsecutive( - [ - $tableName, - ['status = ?' => 'pending', 'job_code in (?)' => ['test_job1']] - ], - [ - $tableName, - ['status = ?' => 'success', 'job_code in (?)' => ['test_job1'], 'scheduled_at < ?' => null] - ], - [ - $tableName, - ['status = ?' => 'missed', 'job_code in (?)' => ['test_job1'], 'scheduled_at < ?' => null] - ], - [ - $tableName, - ['status = ?' => 'error', 'job_code in (?)' => ['test_job1'], 'scheduled_at < ?' => null] - ], - [ - $tableName, - ['status = ?' => 'pending', 'job_code in (?)' => ['test_job1'], 'scheduled_at < ?' => null] - ] + [$tableName, ['status = ?' => 'pending', 'job_code in (?)' => ['test_job1']]], + [$tableName, ['status = ?' => 'success', 'job_code in (?)' => ['test_job1'], 'scheduled_at < ?' => null]], + [$tableName, ['status = ?' => 'missed', 'job_code in (?)' => ['test_job1'], 'scheduled_at < ?' => null]], + [$tableName, ['status = ?' => 'error', 'job_code in (?)' => ['test_job1'], 'scheduled_at < ?' => null]], + [$tableName, ['status = ?' => 'pending', 'job_code in (?)' => ['test_job1'], 'scheduled_at < ?' => null]] ) ->willReturn(1); From a90161907aedae371cb307759b685cc254efe2d8 Mon Sep 17 00:00:00 2001 From: Jason Woods Date: Fri, 21 Aug 2020 13:10:43 +0100 Subject: [PATCH 005/171] Fix test failure due to table fetch --- app/code/Magento/Cron/Observer/ProcessCronQueueObserver.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/Cron/Observer/ProcessCronQueueObserver.php b/app/code/Magento/Cron/Observer/ProcessCronQueueObserver.php index a6a8f77c039d8..de42027742c6e 100644 --- a/app/code/Magento/Cron/Observer/ProcessCronQueueObserver.php +++ b/app/code/Magento/Cron/Observer/ProcessCronQueueObserver.php @@ -711,7 +711,7 @@ private function cleanupRunningJobs($groupId) $jobs = $this->_config->getJobs(); $connection->update( - $scheduleResource->getMainTable(), + $scheduleResource->getTable('cron_schedule'), [ 'status' => \Magento\Cron\Model\Schedule::STATUS_ERROR, 'messages' => 'Time out' From dda5c72c9303f9476ce7041743c87079cada87f6 Mon Sep 17 00:00:00 2001 From: Ihor Sviziev Date: Tue, 25 Aug 2020 13:40:25 +0300 Subject: [PATCH 006/171] Cron cleanup repeatedly hits deadlocks on large environments Fix failing tests --- .../Observer/ProcessCronQueueObserver.php | 47 +++++----- .../Observer/ProcessCronQueueObserverTest.php | 90 +++++++++++++------ .../Magento/Cron/etc/db_schema_whitelist.json | 5 +- 3 files changed, 87 insertions(+), 55 deletions(-) diff --git a/app/code/Magento/Cron/Observer/ProcessCronQueueObserver.php b/app/code/Magento/Cron/Observer/ProcessCronQueueObserver.php index de42027742c6e..0f266b5d62d83 100644 --- a/app/code/Magento/Cron/Observer/ProcessCronQueueObserver.php +++ b/app/code/Magento/Cron/Observer/ProcessCronQueueObserver.php @@ -9,6 +9,7 @@ */ namespace Magento\Cron\Observer; +use Magento\Cron\Model\ResourceModel\Schedule\Collection as ScheduleCollection; use Magento\Cron\Model\Schedule; use Magento\Framework\App\State; use Magento\Framework\Console\Cli; @@ -83,7 +84,7 @@ class ProcessCronQueueObserver implements ObserverInterface const MAX_RETRIES = 5; /** - * @var \Magento\Cron\Model\ResourceModel\Schedule\Collection + * @var ScheduleCollection */ protected $_pendingSchedules; @@ -278,12 +279,12 @@ function ($groupId) use ($currentTime) { * * It should be taken by standalone (child) process, not by the parent process. * - * @param int $groupId + * @param string $groupId * @param callable $callback * * @return void */ - private function lockGroup($groupId, callable $callback) + private function lockGroup(string $groupId, callable $callback): void { if (!$this->lockManager->lock(self::LOCK_PREFIX . $groupId, self::LOCK_TIMEOUT)) { $this->logger->warning( @@ -399,7 +400,7 @@ function () use ($schedule) { * @param string $jobName * @return void */ - private function startProfiling(string $jobName = '') + private function startProfiling(string $jobName = ''): void { $this->statProfiler->clear(); $this->statProfiler->start( @@ -416,7 +417,7 @@ private function startProfiling(string $jobName = '') * @param string $jobName * @return void */ - private function stopProfiling(string $jobName = '') + private function stopProfiling(string $jobName = ''): void { $this->statProfiler->stop( sprintf(self::CRON_TIMERID, $jobName), @@ -445,9 +446,9 @@ private function getProfilingStat(string $jobName): string * Return job collection from data base with status 'pending'. * * @param string $groupId - * @return \Magento\Cron\Model\ResourceModel\Schedule\Collection + * @return ScheduleCollection */ - private function getPendingSchedules($groupId) + private function getPendingSchedules(string $groupId): ScheduleCollection { $jobs = $this->_config->getJobs(); $pendingJobs = $this->_scheduleFactory->create()->getCollection(); @@ -462,7 +463,7 @@ private function getPendingSchedules($groupId) * @param string $groupId * @return $this */ - private function generateSchedules($groupId) + private function generateSchedules(string $groupId): self { /** * check if schedule generation is needed @@ -533,13 +534,13 @@ protected function _generateJobs($jobs, $exists, $groupId) * @param int $currentTime * @return void */ - private function cleanupJobs($groupId, $currentTime) + private function cleanupJobs(string $groupId, int $currentTime): void { // check if history cleanup is needed $lastCleanup = (int)$this->_cache->load(self::CACHE_KEY_LAST_HISTORY_CLEANUP_AT . $groupId); $historyCleanUp = (int)$this->getCronGroupConfigurationValue($groupId, self::XML_PATH_HISTORY_CLEANUP_EVERY); if ($lastCleanup > $this->dateTime->gmtTimestamp() - $historyCleanUp * self::SECONDS_IN_MINUTE) { - return $this; + return; } // save time history cleanup was ran with no expiration $this->_cache->save( @@ -674,7 +675,7 @@ protected function getScheduleTimeInterval($groupId) * @param string $groupId * @return void */ - private function cleanupDisabledJobs($groupId) + private function cleanupDisabledJobs(string $groupId): void { $jobs = $this->_config->getJobs(); $jobsToCleanup = []; @@ -703,7 +704,7 @@ private function cleanupDisabledJobs($groupId) * @param string $groupId * @return void */ - private function cleanupRunningJobs($groupId) + private function cleanupRunningJobs(string $groupId): void { $scheduleResource = $this->_scheduleFactory->create()->getResource(); $connection = $scheduleResource->getConnection(); @@ -716,13 +717,11 @@ private function cleanupRunningJobs($groupId) 'status' => \Magento\Cron\Model\Schedule::STATUS_ERROR, 'messages' => 'Time out' ], - $connection->quoteInto( - 'status = ? ' . - 'AND job_code IN (?) ' . - 'AND (scheduled_at < UTC_TIMESTAMP() - INTERVAL 1 DAY)', - \Magento\Cron\Model\Schedule::STATUS_RUNNING, - array_keys($jobs[$groupId]) - ) + [ + $connection->quoteInto('status = ?', \Magento\Cron\Model\Schedule::STATUS_RUNNING), + $connection->quoteInto('job_code IN (?)', array_keys($jobs[$groupId])), + 'scheduled_at < UTC_TIMESTAMP() - INTERVAL 1 DAY' + ] ); } @@ -803,13 +802,13 @@ private function isGroupInFilter($groupId): bool * @param array $jobsRoot * @param int $currentTime */ - private function processPendingJobs($groupId, $jobsRoot, $currentTime) + private function processPendingJobs(string $groupId, array $jobsRoot, int $currentTime): void { - $procesedJobs = []; + $processedJobs = []; $pendingJobs = $this->getPendingSchedules($groupId); /** @var Schedule $schedule */ foreach ($pendingJobs as $schedule) { - if (isset($procesedJobs[$schedule->getJobCode()])) { + if (isset($processedJobs[$schedule->getJobCode()])) { // process only on job per run continue; } @@ -826,7 +825,7 @@ private function processPendingJobs($groupId, $jobsRoot, $currentTime) $this->tryRunJob($scheduledTime, $currentTime, $jobConfig, $schedule, $groupId); if ($schedule->getStatus() === Schedule::STATUS_SUCCESS) { - $procesedJobs[$schedule->getJobCode()] = true; + $processedJobs[$schedule->getJobCode()] = true; } $this->retrier->execute( @@ -851,7 +850,7 @@ private function tryRunJob($scheduledTime, $currentTime, $jobConfig, $schedule, { // use sha1 to limit length // phpcs:ignore Magento2.Security.InsecureFunction - $lockName = self::LOCK_PREFIX . md5($groupId . '_' . $schedule->getJobCode()); + $lockName = self::LOCK_PREFIX . md5($groupId . '_' . $schedule->getJobCode()); try { for ($retries = self::MAX_RETRIES; $retries > 0; $retries--) { diff --git a/app/code/Magento/Cron/Test/Unit/Observer/ProcessCronQueueObserverTest.php b/app/code/Magento/Cron/Test/Unit/Observer/ProcessCronQueueObserverTest.php index 816fdb6173d8b..134d4ea04d171 100644 --- a/app/code/Magento/Cron/Test/Unit/Observer/ProcessCronQueueObserverTest.php +++ b/app/code/Magento/Cron/Test/Unit/Observer/ProcessCronQueueObserverTest.php @@ -1045,53 +1045,85 @@ public function testMissedJobsCleanedInTime() $scheduleMock->expects($this->exactly(10))->method('getResource')->willReturn($this->scheduleResourceMock); $this->scheduleFactoryMock->expects($this->exactly(11))->method('create')->willReturn($scheduleMock); + $connectionMock = $this->prepareConnectionMock($tableName); + + $this->scheduleResourceMock->expects($this->exactly(6)) + ->method('getTable') + ->with($tableName) + ->willReturn($tableName); + $this->scheduleResourceMock->expects($this->exactly(15)) + ->method('getConnection') + ->willReturn($connectionMock); + + $this->retrierMock->expects($this->exactly(5)) + ->method('execute') + ->willReturnCallback( + function ($callback) { + return $callback(); + } + ); + + $this->cronQueueObserver->execute($this->observerMock); + } + + /** + * @param string $tableName + * @return AdapterInterface|MockObject + */ + private function prepareConnectionMock(string $tableName) + { $connectionMock = $this->getMockForAbstractClass(AdapterInterface::class); $connectionMock->expects($this->exactly(5)) ->method('delete') ->withConsecutive( - [$tableName, ['status = ?' => 'pending', 'job_code in (?)' => ['test_job1']]], - [$tableName, ['status = ?' => 'success', 'job_code in (?)' => ['test_job1'], 'scheduled_at < ?' => null]], - [$tableName, ['status = ?' => 'missed', 'job_code in (?)' => ['test_job1'], 'scheduled_at < ?' => null]], - [$tableName, ['status = ?' => 'error', 'job_code in (?)' => ['test_job1'], 'scheduled_at < ?' => null]], - [$tableName, ['status = ?' => 'pending', 'job_code in (?)' => ['test_job1'], 'scheduled_at < ?' => null]] + [ + $tableName, + ['status = ?' => 'pending', 'job_code in (?)' => ['test_job1']] + ], + [ + $tableName, + ['status = ?' => 'success', 'job_code in (?)' => ['test_job1'], 'scheduled_at < ?' => null] + ], + [ + $tableName, + ['status = ?' => 'missed', 'job_code in (?)' => ['test_job1'], 'scheduled_at < ?' => null] + ], + [ + $tableName, + ['status = ?' => 'error', 'job_code in (?)' => ['test_job1'], 'scheduled_at < ?' => null] + ], + [ + $tableName, + ['status = ?' => 'pending', 'job_code in (?)' => ['test_job1'], 'scheduled_at < ?' => null] + ] ) ->willReturn(1); - $connectionMock->expects($this->once()) + $connectionMock->expects($this->any()) ->method('quoteInto') - ->with( - 'status = ? AND job_code IN (?) AND (scheduled_at < UTC_TIMESTAMP() - INTERVAL 1 DAY)', - 'running', - ['test_job1'] + ->withConsecutive( + ['status = ?', \Magento\Cron\Model\Schedule::STATUS_RUNNING], + ['job_code IN (?)', ['test_job1']], ) - ->willReturn(''); + ->willReturnOnConsecutiveCalls( + "status = 'running'", + "job_code IN ('test_job1')" + ); $connectionMock->expects($this->once()) ->method('update') ->with( $tableName, ['status' => 'error', 'messages' => 'Time out'], - '' + [ + "status = 'running'", + "job_code IN ('test_job1')", + 'scheduled_at < UTC_TIMESTAMP() - INTERVAL 1 DAY' + ] ) ->willReturn(0); - $this->scheduleResourceMock->expects($this->exactly(6)) - ->method('getTable') - ->with($tableName) - ->willReturn($tableName); - $this->scheduleResourceMock->expects($this->exactly(15)) - ->method('getConnection') - ->willReturn($connectionMock); - - $this->retrierMock->expects($this->exactly(5)) - ->method('execute') - ->willReturnCallback( - function ($callback) { - return $callback(); - } - ); - - $this->cronQueueObserver->execute($this->observerMock); + return $connectionMock; } } diff --git a/app/code/Magento/Cron/etc/db_schema_whitelist.json b/app/code/Magento/Cron/etc/db_schema_whitelist.json index c8666896627e2..74836c0be8a2e 100644 --- a/app/code/Magento/Cron/etc/db_schema_whitelist.json +++ b/app/code/Magento/Cron/etc/db_schema_whitelist.json @@ -12,10 +12,11 @@ }, "index": { "CRON_SCHEDULE_JOB_CODE": true, - "CRON_SCHEDULE_SCHEDULED_AT_STATUS": true + "CRON_SCHEDULE_SCHEDULED_AT_STATUS": true, + "CRON_SCHEDULE_JOB_CODE_STATUS_SCHEDULED_AT": true }, "constraint": { "PRIMARY": true } } -} \ No newline at end of file +} From 7d6f8bb0846b863d8a2aa78b8ce1e480a7cf7413 Mon Sep 17 00:00:00 2001 From: saphaljha Date: Fri, 11 Sep 2020 11:01:41 +0530 Subject: [PATCH 007/171] Fixed issue when using dynamic elements --- .../View/Helper/SecureHtmlRenderer.php | 21 ++++++++++++------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/lib/internal/Magento/Framework/View/Helper/SecureHtmlRenderer.php b/lib/internal/Magento/Framework/View/Helper/SecureHtmlRenderer.php index ae8ab3f15bc96..d7369416f44bf 100644 --- a/lib/internal/Magento/Framework/View/Helper/SecureHtmlRenderer.php +++ b/lib/internal/Magento/Framework/View/Helper/SecureHtmlRenderer.php @@ -111,16 +111,21 @@ public function renderEventListenerAsTag( function {$listenerFunction} () { {$attributeJavascript}; } - var {$elementName} = document.querySelector("{$elementSelector}"); - if ({$elementName}) { - {$elementName}.{$eventName} = function (event) { - var targetElement = {$elementName}; - if (event && event.target) { - targetElement = event.target; + var {$elementName}Array = document.querySelectorAll("{$elementSelector}"); + + {$elementName}Array.forEach(function(element){ + if (element) { + element.{$eventName} = function (event) { + var targetElement = element; + if (event && event.target) { + targetElement = event.target; + } + {$listenerFunction}.apply(targetElement); } - {$listenerFunction}.apply(targetElement); } - } + }); + + script; return $this->renderTag('script', ['type' => 'text/javascript'], $script, false); From 1f0fe69c7965997b43995848119a3b5ec004de27 Mon Sep 17 00:00:00 2001 From: saphaljha Date: Sat, 12 Sep 2020 20:06:59 +0530 Subject: [PATCH 008/171] Updated code for validate empty nodeList and covered MFTF --- ...dDeleteMultipleLayoutWidgetActionGroup.xml | 38 +++++++++++++++++++ .../Mftf/Section/AdminNewWidgetSection.xml | 4 ++ ...AddAndDeleteMultipleLayoutSectionsTest.xml | 36 ++++++++++++++++++ .../View/Helper/SecureHtmlRenderer.php | 22 +++++------ 4 files changed, 89 insertions(+), 11 deletions(-) create mode 100644 app/code/Magento/Widget/Test/Mftf/ActionGroup/AdminCreateAndDeleteMultipleLayoutWidgetActionGroup.xml create mode 100644 app/code/Magento/Widget/Test/Mftf/Test/AdminWidgetAddAndDeleteMultipleLayoutSectionsTest.xml diff --git a/app/code/Magento/Widget/Test/Mftf/ActionGroup/AdminCreateAndDeleteMultipleLayoutWidgetActionGroup.xml b/app/code/Magento/Widget/Test/Mftf/ActionGroup/AdminCreateAndDeleteMultipleLayoutWidgetActionGroup.xml new file mode 100644 index 0000000000000..b7ebd09c2fcc6 --- /dev/null +++ b/app/code/Magento/Widget/Test/Mftf/ActionGroup/AdminCreateAndDeleteMultipleLayoutWidgetActionGroup.xml @@ -0,0 +1,38 @@ + + + + + + Goes to the Admin Widget creation page. Add and delete multiple layouts + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/app/code/Magento/Widget/Test/Mftf/Section/AdminNewWidgetSection.xml b/app/code/Magento/Widget/Test/Mftf/Section/AdminNewWidgetSection.xml index 0777e6cbd58d9..373274aef8584 100644 --- a/app/code/Magento/Widget/Test/Mftf/Section/AdminNewWidgetSection.xml +++ b/app/code/Magento/Widget/Test/Mftf/Section/AdminNewWidgetSection.xml @@ -40,5 +40,9 @@ + + + + diff --git a/app/code/Magento/Widget/Test/Mftf/Test/AdminWidgetAddAndDeleteMultipleLayoutSectionsTest.xml b/app/code/Magento/Widget/Test/Mftf/Test/AdminWidgetAddAndDeleteMultipleLayoutSectionsTest.xml new file mode 100644 index 0000000000000..5a5652e1e9049 --- /dev/null +++ b/app/code/Magento/Widget/Test/Mftf/Test/AdminWidgetAddAndDeleteMultipleLayoutSectionsTest.xml @@ -0,0 +1,36 @@ + + + + + + + + + <description value="Admin should be able to Add and Delete multiple layouts"/> + <severity value="CRITICAL"/> + <group value="Widget"/> + </annotations> + <before> + <actionGroup ref="AdminLoginActionGroup" stepKey="LoginAsAdmin"/> + </before> + <after> + <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> + </after> + <actionGroup ref="AdminNavigateMenuActionGroup" stepKey="navigateToContentWidgetsPageFirst"> + <argument name="menuUiId" value="{{AdminMenuContent.dataUiId}}"/> + <argument name="submenuUiId" value="{{AdminMenuContentElementsWidgets.dataUiId}}"/> + </actionGroup> + <actionGroup ref="AdminAssertPageTitleActionGroup" stepKey="seePageTitleFirst"> + <argument name="title" value="{{AdminMenuContentElementsWidgets.pageTitle}}"/> + </actionGroup> + <waitForLoadingMaskToDisappear stepKey="waitForLoadingMaskToDisappear1"/> + <actionGroup ref="AdminCreateAndDeleteMultipleLayoutWidgetActionGroup" stepKey="addWidgetForTest"> + <argument name="widget" value="ProductsListWidget"/> + </actionGroup> + </test> +</tests> diff --git a/lib/internal/Magento/Framework/View/Helper/SecureHtmlRenderer.php b/lib/internal/Magento/Framework/View/Helper/SecureHtmlRenderer.php index d7369416f44bf..ebc4b8870538f 100644 --- a/lib/internal/Magento/Framework/View/Helper/SecureHtmlRenderer.php +++ b/lib/internal/Magento/Framework/View/Helper/SecureHtmlRenderer.php @@ -112,19 +112,19 @@ function {$listenerFunction} () { {$attributeJavascript}; } var {$elementName}Array = document.querySelectorAll("{$elementSelector}"); - - {$elementName}Array.forEach(function(element){ - if (element) { - element.{$eventName} = function (event) { - var targetElement = element; - if (event && event.target) { - targetElement = event.target; + if({$elementName}Array.lenght !== 'undefined'){ + {$elementName}Array.forEach(function(element){ + if (element) { + element.{$eventName} = function (event) { + var targetElement = element; + if (event && event.target) { + targetElement = event.target; + } + {$listenerFunction}.apply(targetElement); } - {$listenerFunction}.apply(targetElement); } - } - }); - + }); + } script; From e95d2fefefb62150e566f000a4a17f58f6716af5 Mon Sep 17 00:00:00 2001 From: Jason Woods <devel@jasonwoods.me.uk> Date: Mon, 21 Sep 2020 16:36:46 +0100 Subject: [PATCH 009/171] Revert #27391 changes Status field is no longer used in that query after this PR --- app/code/Magento/Cron/etc/db_schema.xml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/app/code/Magento/Cron/etc/db_schema.xml b/app/code/Magento/Cron/etc/db_schema.xml index de7ebf3fc50b6..72b1428756898 100644 --- a/app/code/Magento/Cron/etc/db_schema.xml +++ b/app/code/Magento/Cron/etc/db_schema.xml @@ -26,9 +26,5 @@ <column name="status"/> <column name="scheduled_at"/> </index> - <index referenceId="CRON_SCHEDULE_SCHEDULE_ID_STATUS" indexType="btree"> - <column name="schedule_id"/> - <column name="status"/> - </index> </table> </schema> From 916bc93138f7a81f65c2e8b5069eeb0f35fceb43 Mon Sep 17 00:00:00 2001 From: Jason Woods <devel@jasonwoods.me.uk> Date: Mon, 21 Sep 2020 16:40:43 +0100 Subject: [PATCH 010/171] Revert #27391 changes Status field is no longer used in the query --- app/code/Magento/Cron/etc/db_schema_whitelist.json | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app/code/Magento/Cron/etc/db_schema_whitelist.json b/app/code/Magento/Cron/etc/db_schema_whitelist.json index a598c6d213c55..74836c0be8a2e 100644 --- a/app/code/Magento/Cron/etc/db_schema_whitelist.json +++ b/app/code/Magento/Cron/etc/db_schema_whitelist.json @@ -13,8 +13,7 @@ "index": { "CRON_SCHEDULE_JOB_CODE": true, "CRON_SCHEDULE_SCHEDULED_AT_STATUS": true, - "CRON_SCHEDULE_JOB_CODE_STATUS_SCHEDULED_AT": true, - "CRON_SCHEDULE_SCHEDULE_ID_STATUS": true + "CRON_SCHEDULE_JOB_CODE_STATUS_SCHEDULED_AT": true }, "constraint": { "PRIMARY": true From edd77531f8847f7b13dbaca9aefa315ba4aa5e57 Mon Sep 17 00:00:00 2001 From: Ihor Sviziev <ihor-sviziev@users.noreply.github.com> Date: Mon, 21 Sep 2020 22:23:38 +0300 Subject: [PATCH 011/171] Fix SVC failure --- app/code/Magento/Cron/etc/db_schema_whitelist.json | 1 + 1 file changed, 1 insertion(+) diff --git a/app/code/Magento/Cron/etc/db_schema_whitelist.json b/app/code/Magento/Cron/etc/db_schema_whitelist.json index 74836c0be8a2e..2e5cc6e0a4618 100644 --- a/app/code/Magento/Cron/etc/db_schema_whitelist.json +++ b/app/code/Magento/Cron/etc/db_schema_whitelist.json @@ -13,6 +13,7 @@ "index": { "CRON_SCHEDULE_JOB_CODE": true, "CRON_SCHEDULE_SCHEDULED_AT_STATUS": true, + "CRON_SCHEDULE_SCHEDULE_ID_STATUS": true, "CRON_SCHEDULE_JOB_CODE_STATUS_SCHEDULED_AT": true }, "constraint": { From ff1a003de96805fda207c5f9c6cef95d08ba20c8 Mon Sep 17 00:00:00 2001 From: govindasharma974 <govindpokhrelsharma@cedcommerce.com> Date: Sat, 10 Oct 2020 14:11:32 +0530 Subject: [PATCH 012/171] Fixed issue related with wrong invoice id ,creditmemo id and shipmen id in url of view page. --- .../Adminhtml/Order/Creditmemo/View.php | 9 +-- .../Adminhtml/Order/CreditmemoLoader.php | 6 +- .../Adminhtml/Order/Invoice/View.php | 7 +- .../AdminGoToCreditmemoViewActionGroup.xml | 22 +++++++ ...pmentViewPageWithWrongCreditmemoIdTest.xml | 39 +++++++++++ .../Adminhtml/Order/Creditmemo/ViewTest.php | 50 +++++++++++--- .../Adminhtml/Order/Shipment/View.php | 9 +-- .../Adminhtml/Order/ShipmentLoader.php | 7 +- .../AdminGoToShipmentViewActionGroup.xml | 22 +++++++ .../Test/Mftf/Page/AdminShipmentViewPage.xml | 13 ++++ ...hipmentViewPageWithWrongShipmentIdTest.xml | 39 +++++++++++ .../Adminhtml/Order/Shipment/ViewTest.php | 65 +++++++++++++++---- 12 files changed, 254 insertions(+), 34 deletions(-) create mode 100644 app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminGoToCreditmemoViewActionGroup.xml create mode 100644 app/code/Magento/Sales/Test/Mftf/Test/AdminOpenShipmentViewPageWithWrongCreditmemoIdTest.xml create mode 100644 app/code/Magento/Shipping/Test/Mftf/ActionGroup/AdminGoToShipmentViewActionGroup.xml create mode 100644 app/code/Magento/Shipping/Test/Mftf/Page/AdminShipmentViewPage.xml create mode 100644 app/code/Magento/Shipping/Test/Mftf/Test/AdminOpenShipmentViewPageWithWrongShipmentIdTest.xml diff --git a/app/code/Magento/Sales/Controller/Adminhtml/Order/Creditmemo/View.php b/app/code/Magento/Sales/Controller/Adminhtml/Order/Creditmemo/View.php index be0afdb4a043b..c5832f64547c1 100644 --- a/app/code/Magento/Sales/Controller/Adminhtml/Order/Creditmemo/View.php +++ b/app/code/Magento/Sales/Controller/Adminhtml/Order/Creditmemo/View.php @@ -6,8 +6,9 @@ namespace Magento\Sales\Controller\Adminhtml\Order\Creditmemo; use Magento\Backend\App\Action; +use Magento\Framework\App\Action\HttpGetActionInterface as HttpGetActionInterface; -class View extends \Magento\Backend\App\Action +class View extends \Magento\Backend\App\Action implements HttpGetActionInterface { /** * Authorization level of a basic admin session @@ -75,9 +76,9 @@ public function execute() } return $resultPage; } else { - $resultForward = $this->resultForwardFactory->create(); - $resultForward->forward('noroute'); - return $resultForward; + $resultRedirect = $this->resultRedirectFactory->create(); + $resultRedirect->setPath('sales/creditmemo'); + return $resultRedirect; } } } diff --git a/app/code/Magento/Sales/Controller/Adminhtml/Order/CreditmemoLoader.php b/app/code/Magento/Sales/Controller/Adminhtml/Order/CreditmemoLoader.php index 0c5864e954a4f..dbcf22bc7bcf9 100644 --- a/app/code/Magento/Sales/Controller/Adminhtml/Order/CreditmemoLoader.php +++ b/app/code/Magento/Sales/Controller/Adminhtml/Order/CreditmemoLoader.php @@ -181,7 +181,11 @@ public function load() $creditmemoId = $this->getCreditmemoId(); $orderId = $this->getOrderId(); if ($creditmemoId) { - $creditmemo = $this->creditmemoRepository->get($creditmemoId); + try { + $creditmemo = $this->creditmemoRepository->get($creditmemoId); + } catch (\Exception $e) { + $this->messageManager->addErrorMessage(__('This creditmemo no longer exists.')); + return false; } elseif ($orderId) { $data = $this->getCreditmemo(); $order = $this->orderFactory->create()->load($orderId); diff --git a/app/code/Magento/Sales/Controller/Adminhtml/Order/Invoice/View.php b/app/code/Magento/Sales/Controller/Adminhtml/Order/Invoice/View.php index da700aae2f78a..b0e860d7f2e2d 100644 --- a/app/code/Magento/Sales/Controller/Adminhtml/Order/Invoice/View.php +++ b/app/code/Magento/Sales/Controller/Adminhtml/Order/Invoice/View.php @@ -44,9 +44,10 @@ public function execute() { $invoice = $this->getInvoice(); if (!$invoice) { - /** @var \Magento\Framework\Controller\Result\Forward $resultForward */ - $resultForward = $this->resultForwardFactory->create(); - return $resultForward->forward('noroute'); + /** @var \Magento\Framework\Controller\Result\RedirectFactory $resultRedirect */ + $resultRedirect = $this->resultRedirectFactory->create(); + $resultRedirect->setPath('sales/invoice'); + return $resultRedirect; } /** @var \Magento\Backend\Model\View\Result\Page $resultPage */ diff --git a/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminGoToCreditmemoViewActionGroup.xml b/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminGoToCreditmemoViewActionGroup.xml new file mode 100644 index 0000000000000..b55a7e8d6e5ed --- /dev/null +++ b/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminGoToCreditmemoViewActionGroup.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="AdminGoToCreditmemoViewActionGroup"> + <annotations> + <description>Goes to the Order Creditmemo View Page.</description> + </annotations> + <arguments> + <argument name="identifier" type="string"/> + </arguments> + + <amOnPage url="{{AdminCreditmemoViewPage.url}}/{{identifier}}" stepKey="amOnCreditmemoViewPage"/> + <waitForPageLoad stepKey="waitForPageLoad"/> + </actionGroup> +</actionGroups> \ No newline at end of file diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminOpenShipmentViewPageWithWrongCreditmemoIdTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminOpenShipmentViewPageWithWrongCreditmemoIdTest.xml new file mode 100644 index 0000000000000..f04629708e0cd --- /dev/null +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminOpenShipmentViewPageWithWrongCreditmemoIdTest.xml @@ -0,0 +1,39 @@ +<?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="AdminOpenCreditmemoViewPageWithWrongCreditmemoIdTest"> + <annotations> + <stories value="Creditmemo Page With Wrong Creditmemo Id"/> + <title value="Open Creditmemo View Page with Wrong Creditmemo Id"/> + <description value="Open Creditmemo View Page with Wrong Creditmemo Id."/> + <severity value="MAJOR"/> + <group value="sales"/> + </annotations> + + <before> + <actionGroup ref="AdminLoginActionGroup" stepKey="LoginAsAdmin"/> + </before> + + <after> + <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> + </after> + + <actionGroup ref="AdminGoToCreditmemoViewActionGroup" stepKey="navigateOpenCreditmemoViewPage"> + <argument name="identifier" value="test"/> + </actionGroup> + + <waitForPageLoad stepKey="waitForPageLoad"/> + + <seeInCurrentUrl url="{{AdminCreditmemosGridPage.url}}" stepKey="redirectToCreditmemosGridPage"/> + + <see selector="{{AdminMessagesSection.error}}" userInput='This creditmemo no longer exists.' + stepKey="seeErrorMessage"/> + </test> +</tests> \ No newline at end of file diff --git a/app/code/Magento/Sales/Test/Unit/Controller/Adminhtml/Order/Creditmemo/ViewTest.php b/app/code/Magento/Sales/Test/Unit/Controller/Adminhtml/Order/Creditmemo/ViewTest.php index 46c3113c8edc2..e7556fe309ecf 100644 --- a/app/code/Magento/Sales/Test/Unit/Controller/Adminhtml/Order/Creditmemo/ViewTest.php +++ b/app/code/Magento/Sales/Test/Unit/Controller/Adminhtml/Order/Creditmemo/ViewTest.php @@ -13,6 +13,8 @@ use Magento\Backend\Model\View\Result\Forward; use Magento\Backend\Model\View\Result\ForwardFactory; use Magento\Backend\Model\View\Result\Page; +use Magento\Backend\Model\View\Result\Redirect; +use Magento\Backend\Model\View\Result\RedirectFactory; use Magento\Framework\App\ActionFlag; use Magento\Framework\App\Request\Http; use Magento\Framework\Message\Manager; @@ -105,6 +107,17 @@ class ViewTest extends TestCase */ protected $pageTitleMock; + /** + * @var \Magento\Shipping\Controller\Adminhtml\Order\Creditmemo\View + * @var RedirectFactory|MockObject + */ + protected $resultRedirectFactoryMock; + + /** + * @var Redirect|MockObject + */ + protected $resultRedirectMock; + /** * @var PageFactory|MockObject */ @@ -239,7 +252,8 @@ protected function setUp(): void 'context' => $this->contextMock, 'creditmemoLoader' => $this->loaderMock, 'resultPageFactory' => $this->resultPageFactoryMock, - 'resultForwardFactory' => $this->resultForwardFactoryMock + 'resultForwardFactory' => $this->resultForwardFactoryMock, + 'resultRedirectFactory' => $this->resultRedirectFactoryMock ] ); } @@ -252,16 +266,11 @@ public function testExecuteNoCreditMemo() $this->loaderMock->expects($this->once()) ->method('load') ->willReturn(false); - $this->resultForwardFactoryMock->expects($this->once()) - ->method('create') - ->willReturn($this->resultForwardMock); - $this->resultForwardMock->expects($this->once()) - ->method('forward') - ->with('noroute') - ->willReturnSelf(); - + + $this->prepareRedirect(); + $this->setPath('sales/creditmemo'); $this->assertInstanceOf( - Forward::class, + Redirect::class, $this->controller->execute() ); } @@ -322,4 +331,25 @@ public function executeDataProvider() [$this->invoiceMock] ]; } + + /** + * prepareRedirect + */ + protected function prepareRedirect() + { + $this->resultRedirectFactoryMock->expects($this->once()) + ->method('create') + ->willReturn($this->resultRedirectMock); + } + + /** + * @param string $path + * @param array $params + */ + protected function setPath($path, $params = []) + { + $this->resultRedirectMock->expects($this->once()) + ->method('setPath') + ->with($path, $params); + } } diff --git a/app/code/Magento/Shipping/Controller/Adminhtml/Order/Shipment/View.php b/app/code/Magento/Shipping/Controller/Adminhtml/Order/Shipment/View.php index d8fda0bfe781b..d903a1a7d5889 100644 --- a/app/code/Magento/Shipping/Controller/Adminhtml/Order/Shipment/View.php +++ b/app/code/Magento/Shipping/Controller/Adminhtml/Order/Shipment/View.php @@ -7,8 +7,9 @@ namespace Magento\Shipping\Controller\Adminhtml\Order\Shipment; use Magento\Backend\App\Action; +use Magento\Framework\App\Action\HttpGetActionInterface as HttpGetActionInterface; -class View extends \Magento\Backend\App\Action +class View extends \Magento\Backend\App\Action implements HttpGetActionInterface { /** * Authorization level of a basic admin session @@ -71,9 +72,9 @@ public function execute() $resultPage->getConfig()->getTitle()->prepend("#" . $shipment->getIncrementId()); return $resultPage; } else { - $resultForward = $this->resultForwardFactory->create(); - $resultForward->forward('noroute'); - return $resultForward; + $resultRedirect = $this->resultRedirectFactory->create(); + $resultRedirect->setPath('sales/shipment'); + return $resultRedirect; } } } diff --git a/app/code/Magento/Shipping/Controller/Adminhtml/Order/ShipmentLoader.php b/app/code/Magento/Shipping/Controller/Adminhtml/Order/ShipmentLoader.php index c4094a63ec527..4f44bfb6458b1 100644 --- a/app/code/Magento/Shipping/Controller/Adminhtml/Order/ShipmentLoader.php +++ b/app/code/Magento/Shipping/Controller/Adminhtml/Order/ShipmentLoader.php @@ -110,7 +110,12 @@ public function load() $orderId = $this->getOrderId(); $shipmentId = $this->getShipmentId(); if ($shipmentId) { - $shipment = $this->shipmentRepository->get($shipmentId); + try { + $shipment = $this->shipmentRepository->get($shipmentId); + } catch (\Exception $e) { + $this->messageManager->addErrorMessage(__('This shipment no longer exists.')); + return false; + } } elseif ($orderId) { $order = $this->orderRepository->get($orderId); diff --git a/app/code/Magento/Shipping/Test/Mftf/ActionGroup/AdminGoToShipmentViewActionGroup.xml b/app/code/Magento/Shipping/Test/Mftf/ActionGroup/AdminGoToShipmentViewActionGroup.xml new file mode 100644 index 0000000000000..09f74839b3a30 --- /dev/null +++ b/app/code/Magento/Shipping/Test/Mftf/ActionGroup/AdminGoToShipmentViewActionGroup.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="AdminGoToShipmentViewActionGroup"> + <annotations> + <description>Goes to the Order Shipment View Page.</description> + </annotations> + <arguments> + <argument name="identifier" type="string"/> + </arguments> + + <amOnPage url="{{AdminShipmentViewPage.url}}/{{identifier}}" stepKey="amOnShipmentViewPage"/> + <waitForPageLoad stepKey="waitForPageLoad"/> + </actionGroup> +</actionGroups> \ No newline at end of file diff --git a/app/code/Magento/Shipping/Test/Mftf/Page/AdminShipmentViewPage.xml b/app/code/Magento/Shipping/Test/Mftf/Page/AdminShipmentViewPage.xml new file mode 100644 index 0000000000000..5a965db2b4efe --- /dev/null +++ b/app/code/Magento/Shipping/Test/Mftf/Page/AdminShipmentViewPage.xml @@ -0,0 +1,13 @@ +<?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="AdminShipmentViewPage" url="sales/shipment/view/shipment_id" area="admin" module="Shipping"> + </page> +</pages> \ No newline at end of file diff --git a/app/code/Magento/Shipping/Test/Mftf/Test/AdminOpenShipmentViewPageWithWrongShipmentIdTest.xml b/app/code/Magento/Shipping/Test/Mftf/Test/AdminOpenShipmentViewPageWithWrongShipmentIdTest.xml new file mode 100644 index 0000000000000..0311ebc320b59 --- /dev/null +++ b/app/code/Magento/Shipping/Test/Mftf/Test/AdminOpenShipmentViewPageWithWrongShipmentIdTest.xml @@ -0,0 +1,39 @@ +<?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="AdminOpenShipmentViewPageWithWrongShipmentIdTest"> + <annotations> + <stories value="Shipment Page With Wrong Shipment Id"/> + <title value="Open Shipment View Page with Wrong Shipment Id"/> + <description value="Open Shipment View Page with Wrong Shipment Id."/> + <severity value="MAJOR"/> + <group value="shipping"/> + </annotations> + + <before> + <actionGroup ref="AdminLoginActionGroup" stepKey="LoginAsAdmin"/> + </before> + + <after> + <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> + </after> + + <actionGroup ref="AdminGoToShipmentViewActionGroup" stepKey="navigateOpenShipmentViewPage"> + <argument name="identifier" value="test"/> + </actionGroup> + + <waitForPageLoad stepKey="waitForPageLoad"/> + + <seeInCurrentUrl url="{{AdminShipmentsGridPage.url}}" stepKey="redirectToShipmentsGridPage"/> + + <see selector="{{AdminMessagesSection.error}}" userInput='This shipment no longer exists.' + stepKey="seeErrorMessage"/> + </test> +</tests> \ No newline at end of file diff --git a/app/code/Magento/Shipping/Test/Unit/Controller/Adminhtml/Order/Shipment/ViewTest.php b/app/code/Magento/Shipping/Test/Unit/Controller/Adminhtml/Order/Shipment/ViewTest.php index 04b357eeaefca..d99ce83d91de2 100644 --- a/app/code/Magento/Shipping/Test/Unit/Controller/Adminhtml/Order/Shipment/ViewTest.php +++ b/app/code/Magento/Shipping/Test/Unit/Controller/Adminhtml/Order/Shipment/ViewTest.php @@ -11,6 +11,8 @@ use Magento\Backend\Model\View\Result\Forward; use Magento\Backend\Model\View\Result\ForwardFactory; use Magento\Backend\Model\View\Result\Page; +use Magento\Backend\Model\View\Result\Redirect; +use Magento\Backend\Model\View\Result\RedirectFactory; use Magento\Framework\App\RequestInterface; use Magento\Framework\ObjectManagerInterface; use Magento\Framework\TestFramework\Unit\Helper\ObjectManager; @@ -21,6 +23,7 @@ use Magento\Sales\Model\Order\Shipment; use Magento\Shipping\Block\Adminhtml\View; use Magento\Shipping\Controller\Adminhtml\Order\ShipmentLoader; +use Magento\Shipping\Controller\Adminhtml\Order\Shipment\View as OrderShipmentView; use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\TestCase; @@ -84,11 +87,24 @@ class ViewTest extends TestCase */ protected $pageTitleMock; + /** * @var \Magento\Shipping\Controller\Adminhtml\Order\Shipment\View + * @var RedirectFactory|MockObject + */ + protected $resultRedirectFactoryMock; + + /** + * @var Redirect|MockObject + */ + protected $resultRedirectMock; + + /** + * @var OrderShipmentView */ protected $controller; + protected function setUp(): void { $this->requestMock = $this->getMockBuilder(RequestInterface::class) @@ -130,16 +146,25 @@ protected function setUp(): void ['updateBackButtonUrl'] ); + $this->resultRedirectFactoryMock = $this->getMockBuilder(RedirectFactory::class) + ->disableOriginalConstructor() + ->setMethods(['create']) + ->getMock(); + $this->resultRedirectMock = $this->getMockBuilder(Redirect::class) + ->disableOriginalConstructor() + ->getMock(); + $objectManager = new ObjectManager($this); $context = $objectManager->getObject( Context::class, [ 'request' => $this->requestMock, - 'objectManager' => $this->objectManagerMock + 'objectManager' => $this->objectManagerMock, + 'resultRedirectFactory' => $this->resultRedirectFactoryMock ] ); $this->controller = $objectManager->getObject( - \Magento\Shipping\Controller\Adminhtml\Order\Shipment\View::class, + OrderShipmentView::class, [ 'context' => $context, 'shipmentLoader' => $this->shipmentLoaderMock, @@ -216,15 +241,12 @@ public function testExecuteNoShipment() $tracking = []; $this->loadShipment($orderId, $shipmentId, $shipment, $tracking, null, false); - $this->resultForwardFactoryMock->expects($this->once()) - ->method('create') - ->willReturn($this->resultForwardMock); - $this->resultForwardMock->expects($this->once()) - ->method('forward') - ->with('noroute') - ->willReturnSelf(); - - $this->assertEquals($this->resultForwardMock, $this->controller->execute()); + $this->prepareRedirect(); + $this->setPath('sales/shipment'); + $this->assertInstanceOf( + Redirect::class, + $this->controller->execute() + ); } /** @@ -255,4 +277,25 @@ protected function loadShipment($orderId, $shipmentId, $shipment, $tracking, $co ->method('load') ->willReturn($returnShipment); } + + /** + * prepareRedirect + */ + protected function prepareRedirect() + { + $this->resultRedirectFactoryMock->expects($this->once()) + ->method('create') + ->willReturn($this->resultRedirectMock); + } + + /** + * @param string $path + * @param array $params + */ + protected function setPath($path, $params = []) + { + $this->resultRedirectMock->expects($this->once()) + ->method('setPath') + ->with($path, $params); + } } From 0e78fe405442b1eb8955c1e53bc2c65f539b6f63 Mon Sep 17 00:00:00 2001 From: govindasharma974 <govindpokhrelsharma@cedcommerce.com> Date: Sat, 10 Oct 2020 14:18:21 +0530 Subject: [PATCH 013/171] Fixed issue related with wrong invoice id ,creditmemo id and shipmen id in url of view page. --- ...l => AdminOpenCreditmemoViewPageWithWrongCreditmemoIdTest.xml} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename app/code/Magento/Sales/Test/Mftf/Test/{AdminOpenShipmentViewPageWithWrongCreditmemoIdTest.xml => AdminOpenCreditmemoViewPageWithWrongCreditmemoIdTest.xml} (100%) diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminOpenShipmentViewPageWithWrongCreditmemoIdTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminOpenCreditmemoViewPageWithWrongCreditmemoIdTest.xml similarity index 100% rename from app/code/Magento/Sales/Test/Mftf/Test/AdminOpenShipmentViewPageWithWrongCreditmemoIdTest.xml rename to app/code/Magento/Sales/Test/Mftf/Test/AdminOpenCreditmemoViewPageWithWrongCreditmemoIdTest.xml From ff5de32bd53e7a7b7b357bf3e3606092dd777681 Mon Sep 17 00:00:00 2001 From: Govind Sharma <govindpokhrelsharma@cedcoss.com> Date: Sat, 10 Oct 2020 16:27:48 +0530 Subject: [PATCH 014/171] Update ViewTest.php --- .../Controller/Adminhtml/Order/Creditmemo/ViewTest.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/app/code/Magento/Sales/Test/Unit/Controller/Adminhtml/Order/Creditmemo/ViewTest.php b/app/code/Magento/Sales/Test/Unit/Controller/Adminhtml/Order/Creditmemo/ViewTest.php index e7556fe309ecf..b6935269e3da7 100644 --- a/app/code/Magento/Sales/Test/Unit/Controller/Adminhtml/Order/Creditmemo/ViewTest.php +++ b/app/code/Magento/Sales/Test/Unit/Controller/Adminhtml/Order/Creditmemo/ViewTest.php @@ -216,7 +216,13 @@ protected function setUp(): void $this->resultForwardMock = $this->getMockBuilder(Forward::class) ->disableOriginalConstructor() ->getMock(); - + $this->resultRedirectFactoryMock = $this->getMockBuilder(RedirectFactory::class) + ->disableOriginalConstructor() + ->setMethods(['create']) + ->getMock(); + $this->resultRedirectMock = $this->getMockBuilder(Redirect::class) + ->disableOriginalConstructor() + ->getMock(); $this->contextMock->expects($this->any()) ->method('getSession') ->willReturn($this->sessionMock); From 6b1837b2db974a986f9e16264e89bf3c01fed5ea Mon Sep 17 00:00:00 2001 From: govindasharma974 <govindpokhrelsharma@cedcommerce.com> Date: Mon, 12 Oct 2020 10:47:39 +0530 Subject: [PATCH 015/171] Added new line to to mftf files, added words to csv and fixed compilation issue --- .../Adminhtml/Order/CreditmemoLoader.php | 3 +- .../AdminGoToCreditmemoViewActionGroup.xml | 2 +- ...tmemoViewPageWithWrongCreditmemoIdTest.xml | 2 +- app/code/Magento/Sales/i18n/en_US.csv | 1293 +++++++++-------- .../AdminGoToShipmentViewActionGroup.xml | 2 +- .../Test/Mftf/Page/AdminShipmentViewPage.xml | 2 +- ...hipmentViewPageWithWrongShipmentIdTest.xml | 2 +- app/code/Magento/Shipping/i18n/en_US.csv | 261 ++-- 8 files changed, 785 insertions(+), 782 deletions(-) diff --git a/app/code/Magento/Sales/Controller/Adminhtml/Order/CreditmemoLoader.php b/app/code/Magento/Sales/Controller/Adminhtml/Order/CreditmemoLoader.php index dbcf22bc7bcf9..7bb0b38a8d5ff 100644 --- a/app/code/Magento/Sales/Controller/Adminhtml/Order/CreditmemoLoader.php +++ b/app/code/Magento/Sales/Controller/Adminhtml/Order/CreditmemoLoader.php @@ -183,9 +183,10 @@ public function load() if ($creditmemoId) { try { $creditmemo = $this->creditmemoRepository->get($creditmemoId); - } catch (\Exception $e) { + } catch (\Exception $e) { $this->messageManager->addErrorMessage(__('This creditmemo no longer exists.')); return false; + } } elseif ($orderId) { $data = $this->getCreditmemo(); $order = $this->orderFactory->create()->load($orderId); diff --git a/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminGoToCreditmemoViewActionGroup.xml b/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminGoToCreditmemoViewActionGroup.xml index b55a7e8d6e5ed..041ebc7baa84d 100644 --- a/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminGoToCreditmemoViewActionGroup.xml +++ b/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminGoToCreditmemoViewActionGroup.xml @@ -19,4 +19,4 @@ <amOnPage url="{{AdminCreditmemoViewPage.url}}/{{identifier}}" stepKey="amOnCreditmemoViewPage"/> <waitForPageLoad stepKey="waitForPageLoad"/> </actionGroup> -</actionGroups> \ No newline at end of file +</actionGroups> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminOpenCreditmemoViewPageWithWrongCreditmemoIdTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminOpenCreditmemoViewPageWithWrongCreditmemoIdTest.xml index f04629708e0cd..c6522cb22cdf3 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminOpenCreditmemoViewPageWithWrongCreditmemoIdTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminOpenCreditmemoViewPageWithWrongCreditmemoIdTest.xml @@ -36,4 +36,4 @@ <see selector="{{AdminMessagesSection.error}}" userInput='This creditmemo no longer exists.' stepKey="seeErrorMessage"/> </test> -</tests> \ No newline at end of file +</tests> diff --git a/app/code/Magento/Sales/i18n/en_US.csv b/app/code/Magento/Sales/i18n/en_US.csv index 97c1706f975da..059569775e419 100644 --- a/app/code/Magento/Sales/i18n/en_US.csv +++ b/app/code/Magento/Sales/i18n/en_US.csv @@ -1,344 +1,344 @@ -"Credit Memos","Credit Memos" +Credit Memos,Credit Memos Orders,Orders Invoices,Invoices -"We can't get the order instance right now.","We can't get the order instance right now." -"Create New Order","Create New Order" -"Save Order Address","Save Order Address" +We can't get the order instance right now.,We can't get the order instance right now. +Create New Order,Create New Order +Save Order Address,Save Order Address Shipping,Shipping Billing,Billing -"Edit Order %1 %2 Address","Edit Order %1 %2 Address" -"Order Address Information","Order Address Information" -"Please correct the parent block for this block.","Please correct the parent block for this block." -"Submit Comment","Submit Comment" -"Submit Order","Submit Order" -"Are you sure you want to cancel this order?","Are you sure you want to cancel this order?" +Edit Order %1 %2 Address,Edit Order %1 %2 Address +Order Address Information,Order Address Information +Please correct the parent block for this block.,Please correct the parent block for this block. +Submit Comment,Submit Comment +Submit Order,Submit Order +Are you sure you want to cancel this order?,Are you sure you want to cancel this order? Cancel,Cancel -"Billing Address","Billing Address" -"Payment Method","Payment Method" -"Order Comment","Order Comment" +Billing Address,Billing Address +Payment Method,Payment Method +Order Comment,Order Comment Coupons,Coupons -"Please select a customer","Please select a customer" -"Create New Customer","Create New Customer" -"Account Information","Account Information" +Please select a customer,Please select a customer +Create New Customer,Create New Customer +Account Information,Account Information From,From To,To Message,Message -"Edit Order #%1","Edit Order #%1" -"Create New Order for %1 in %2","Create New Order for %1 in %2" -"Create New Order in %1","Create New Order in %1" -"Create New Order for %1","Create New Order for %1" -"Create New Order for New Customer","Create New Order for New Customer" -"Items Ordered","Items Ordered" -"This product is disabled.","This product is disabled." -"Buy %1 for price %2","Buy %1 for price %2" -"Item ordered qty","Item ordered qty" -"%1 with %2 discount each","%1 with %2 discount each" -"%1 for %2","%1 for %2" -"* - Enter custom price including tax","* - Enter custom price including tax" -"* - Enter custom price excluding tax","* - Enter custom price excluding tax" +Edit Order #%1,Edit Order #%1 +Create New Order for %1 in %2,Create New Order for %1 in %2 +Create New Order in %1,Create New Order in %1 +Create New Order for %1,Create New Order for %1 +Create New Order for New Customer,Create New Order for New Customer +Items Ordered,Items Ordered +This product is disabled.,This product is disabled. +Buy %1 for price %2,Buy %1 for price %2 +Item ordered qty,Item ordered qty +%1 with %2 discount each,%1 with %2 discount each +%1 for %2,%1 for %2 +* - Enter custom price including tax,* - Enter custom price including tax +* - Enter custom price excluding tax,* - Enter custom price excluding tax Configure,Configure -"This product does not have any configurable options","This product does not have any configurable options" -"Newsletter Subscription","Newsletter Subscription" -"Please select products","Please select products" -"Add Selected Product(s) to Order","Add Selected Product(s) to Order" +This product does not have any configurable options,This product does not have any configurable options +Newsletter Subscription,Newsletter Subscription +Please select products,Please select products +Add Selected Product(s) to Order,Add Selected Product(s) to Order ID,ID Product,Product SKU,SKU Price,Price Select,Select Quantity,Quantity -"Shipping Address","Shipping Address" -"Shipping Method","Shipping Method" -"Update Changes","Update Changes" -"Shopping Cart","Shopping Cart" -"Are you sure you want to delete all items from shopping cart?","Are you sure you want to delete all items from shopping cart?" -"Clear Shopping Cart","Clear Shopping Cart" -"Products in Comparison List","Products in Comparison List" -"Recently Compared Products","Recently Compared Products" -"Recently Viewed Products","Recently Viewed Products" -"Last Ordered Items","Last Ordered Items" -"Recently Viewed","Recently Viewed" -"Wish List","Wish List" -"Please select a store","Please select a store" -"Order Totals","Order Totals" -"Shipping Incl. Tax (%1)","Shipping Incl. Tax (%1)" -"Shipping Excl. Tax (%1)","Shipping Excl. Tax (%1)" -"New Credit Memo for Invoice #%1","New Credit Memo for Invoice #%1" -"New Credit Memo for Order #%1","New Credit Memo for Order #%1" -"Refund Shipping (Incl. Tax)","Refund Shipping (Incl. Tax)" -"Refund Shipping (Excl. Tax)","Refund Shipping (Excl. Tax)" -"Refund Shipping","Refund Shipping" -"Update Qty's","Update Qty's" +Shipping Address,Shipping Address +Shipping Method,Shipping Method +Update Changes,Update Changes +Shopping Cart,Shopping Cart +Are you sure you want to delete all items from shopping cart?,Are you sure you want to delete all items from shopping cart? +Clear Shopping Cart,Clear Shopping Cart +Products in Comparison List,Products in Comparison List +Recently Compared Products,Recently Compared Products +Recently Viewed Products,Recently Viewed Products +Last Ordered Items,Last Ordered Items +Recently Viewed,Recently Viewed +Wish List,Wish List +Please select a store,Please select a store +Order Totals,Order Totals +Shipping Incl. Tax (%1),Shipping Incl. Tax (%1) +Shipping Excl. Tax (%1),Shipping Excl. Tax (%1) +New Credit Memo for Invoice #%1,New Credit Memo for Invoice #%1 +New Credit Memo for Order #%1,New Credit Memo for Order #%1 +Refund Shipping (Incl. Tax),Refund Shipping (Incl. Tax) +Refund Shipping (Excl. Tax),Refund Shipping (Excl. Tax) +Refund Shipping,Refund Shipping +Update Qty's,Update Qty's Refund,Refund -"Refund Offline","Refund Offline" -"Paid Amount","Paid Amount" -"Refund Amount","Refund Amount" -"Shipping Amount","Shipping Amount" -"Shipping Refund","Shipping Refund" -"Order Grand Total","Order Grand Total" -"Adjustment Refund","Adjustment Refund" -"Adjustment Fee","Adjustment Fee" -"Send Email","Send Email" -"Are you sure you want to send a credit memo email to customer?","Are you sure you want to send a credit memo email to customer?" +Refund Offline,Refund Offline +Paid Amount,Paid Amount +Refund Amount,Refund Amount +Shipping Amount,Shipping Amount +Shipping Refund,Shipping Refund +Order Grand Total,Order Grand Total +Adjustment Refund,Adjustment Refund +Adjustment Fee,Adjustment Fee +Send Email,Send Email +Are you sure you want to send a credit memo email to customer?,Are you sure you want to send a credit memo email to customer? Void,Void Print,Print -"The credit memo email was sent.","The credit memo email was sent." -"The credit memo email wasn't sent.","The credit memo email wasn't sent." -"Credit Memo #%1 | %3 | %2 (%4)","Credit Memo #%1 | %3 | %2 (%4)" -"Total Refund","Total Refund" -"New Invoice and Shipment for Order #%1","New Invoice and Shipment for Order #%1" -"New Invoice for Order #%1","New Invoice for Order #%1" -"Submit Invoice and Shipment","Submit Invoice and Shipment" -"Submit Invoice","Submit Invoice" -"Are you sure you want to send an invoice email to customer?","Are you sure you want to send an invoice email to customer?" -"Credit Memo","Credit Memo" +The credit memo email was sent.,The credit memo email was sent. +The credit memo email wasn't sent.,The credit memo email wasn't sent. +Credit Memo #%1 | %3 | %2 (%4),Credit Memo #%1 | %3 | %2 (%4) +Total Refund,Total Refund +New Invoice and Shipment for Order #%1,New Invoice and Shipment for Order #%1 +New Invoice for Order #%1,New Invoice for Order #%1 +Submit Invoice and Shipment,Submit Invoice and Shipment +Submit Invoice,Submit Invoice +Are you sure you want to send an invoice email to customer?,Are you sure you want to send an invoice email to customer? +Credit Memo,Credit Memo Capture,Capture -"The invoice email was sent.","The invoice email was sent." -"The invoice email wasn't sent.","The invoice email wasn't sent." -"Invoice #%1 | %2 | %4 (%3)","Invoice #%1 | %2 | %4 (%3)" -"Invalid parent block for this block","Invalid parent block for this block" -"Order Statuses","Order Statuses" -"Create New Status","Create New Status" -"Assign Status to State","Assign Status to State" -"Save Status Assignment","Save Status Assignment" -"Assign Order Status to State","Assign Order Status to State" -"Assignment Information","Assignment Information" -"Order Status","Order Status" -"Order State","Order State" -"Use Order Status As Default","Use Order Status As Default" -"Visible On Storefront","Visible On Storefront" -"Edit Order Status","Edit Order Status" -"Save Status","Save Status" -"New Order Status","New Order Status" -"Order Status Information","Order Status Information" -"Status Code","Status Code" -"Status Label","Status Label" -"Store View Specific Labels","Store View Specific Labels" -"Total Paid","Total Paid" -"Total Refunded","Total Refunded" -"Total Due","Total Due" -"Total Canceled","Total Canceled" +The invoice email was sent.,The invoice email was sent. +The invoice email wasn't sent.,The invoice email wasn't sent. +Invoice #%1 | %2 | %4 (%3),Invoice #%1 | %2 | %4 (%3) +Invalid parent block for this block,Invalid parent block for this block +Order Statuses,Order Statuses +Create New Status,Create New Status +Assign Status to State,Assign Status to State +Save Status Assignment,Save Status Assignment +Assign Order Status to State,Assign Order Status to State +Assignment Information,Assignment Information +Order Status,Order Status +Order State,Order State +Use Order Status As Default,Use Order Status As Default +Visible On Storefront,Visible On Storefront +Edit Order Status,Edit Order Status +Save Status,Save Status +New Order Status,New Order Status +Order Status Information,Order Status Information +Status Code,Status Code +Status Label,Status Label +Store View Specific Labels,Store View Specific Labels +Total Paid,Total Paid +Total Refunded,Total Refunded +Total Due,Total Due +Total Canceled,Total Canceled Edit,Edit -"Are you sure you want to send an order email to customer?","Are you sure you want to send an order email to customer?" +Are you sure you want to send an order email to customer?,Are you sure you want to send an order email to customer? "This will create an offline refund. To create an online refund, open an invoice and create credit memo for it. Do you want to continue?","This will create an offline refund. To create an online refund, open an invoice and create credit memo for it. Do you want to continue?" -"Are you sure you want to void the payment?","Are you sure you want to void the payment?" +Are you sure you want to void the payment?,Are you sure you want to void the payment? Hold,Hold hold,hold Unhold,Unhold unhold,unhold -"Are you sure you want to accept this payment?","Are you sure you want to accept this payment?" -"Accept Payment","Accept Payment" -"Are you sure you want to deny this payment?","Are you sure you want to deny this payment?" -"Deny Payment","Deny Payment" -"Get Payment Update","Get Payment Update" -"Invoice and Ship","Invoice and Ship" +Are you sure you want to accept this payment?,Are you sure you want to accept this payment? +Accept Payment,Accept Payment +Are you sure you want to deny this payment?,Are you sure you want to deny this payment? +Deny Payment,Deny Payment +Get Payment Update,Get Payment Update +Invoice and Ship,Invoice and Ship Invoice,Invoice Ship,Ship Reorder,Reorder -"Order # %1 %2 | %3","Order # %1 %2 | %3" +Order # %1 %2 | %3,Order # %1 %2 | %3 "This order contains (%1) items and therefore cannot be edited through the admin interface. If you wish to continue editing, the (%2) items will be removed, the order will be canceled and a new order will be placed.","This order contains (%1) items and therefore cannot be edited through the admin interface. If you wish to continue editing, the (%2) items will be removed, the order will be canceled and a new order will be placed." -"Are you sure? This order will be canceled and a new one will be created instead.","Are you sure? This order will be canceled and a new one will be created instead." -"Save Gift Message","Save Gift Message" -" [deleted]"," [deleted]" -"Order Credit Memos","Order Credit Memos" -"Credit memo #%1 created","Credit memo #%1 created" -"Credit memo #%1 comment added","Credit memo #%1 comment added" -"Shipment #%1 created","Shipment #%1 created" -"Shipment #%1 comment added","Shipment #%1 comment added" -"Invoice #%1 created","Invoice #%1 created" -"Invoice #%1 comment added","Invoice #%1 comment added" -"Tracking number %1 for %2 assigned","Tracking number %1 for %2 assigned" -"Comments History","Comments History" -"Order History","Order History" +Are you sure? This order will be canceled and a new one will be created instead.,Are you sure? This order will be canceled and a new one will be created instead. +Save Gift Message,Save Gift Message + [deleted], [deleted] +Order Credit Memos,Order Credit Memos +Credit memo #%1 created,Credit memo #%1 created +Credit memo #%1 comment added,Credit memo #%1 comment added +Shipment #%1 created,Shipment #%1 created +Shipment #%1 comment added,Shipment #%1 comment added +Invoice #%1 created,Invoice #%1 created +Invoice #%1 comment added,Invoice #%1 comment added +Tracking number %1 for %2 assigned,Tracking number %1 for %2 assigned +Comments History,Comments History +Order History,Order History Information,Information -"Order Information","Order Information" -"Order Invoices","Order Invoices" +Order Information,Order Information +Order Invoices,Order Invoices Shipments,Shipments -"Order Shipments","Order Shipments" +Order Shipments,Order Shipments Transactions,Transactions -"Order View","Order View" +Order View,Order View Any,Any Specified,Specified -"Applies to Any of the Specified Order Statuses except canceled orders","Applies to Any of the Specified Order Statuses except canceled orders" -"Cart Price Rule","Cart Price Rule" +Applies to Any of the Specified Order Statuses except canceled orders,Applies to Any of the Specified Order Statuses except canceled orders +Cart Price Rule,Cart Price Rule Yes,Yes No,No -"Show Actual Values","Show Actual Values" -"New Order RSS","New Order RSS" +Show Actual Values,Show Actual Values +New Order RSS,New Order RSS Subtotal,Subtotal -"Shipping & Handling","Shipping & Handling" -"Discount (%1)","Discount (%1)" +Shipping & Handling,Shipping & Handling +Discount (%1),Discount (%1) Discount,Discount -"Grand Total","Grand Total" +Grand Total,Grand Total Back,Back Fetch,Fetch -"Transaction # %1 | %2","Transaction # %1 | %2" +Transaction # %1 | %2,Transaction # %1 | %2 N/A,N/A Key,Key Value,Value -"We found an invalid entity model.","We found an invalid entity model." -"Order # %1","Order # %1" -"Back to My Orders","Back to My Orders" -"View Another Order","View Another Order" -"About Your Refund","About Your Refund" -"My Orders","My Orders" -"Subscribe to Order Status","Subscribe to Order Status" -"About Your Invoice","About Your Invoice" -"Print Order # %1","Print Order # %1" -"Grand Total to be Charged","Grand Total to be Charged" +We found an invalid entity model.,We found an invalid entity model. +Order # %1,Order # %1 +Back to My Orders,Back to My Orders +View Another Order,View Another Order +About Your Refund,About Your Refund +My Orders,My Orders +Subscribe to Order Status,Subscribe to Order Status +About Your Invoice,About Your Invoice +Print Order # %1,Print Order # %1 +Grand Total to be Charged,Grand Total to be Charged Unassign,Unassign -"We can't add this item to your shopping cart right now.","We can't add this item to your shopping cart right now." -"You sent the message.","You sent the message." +We can't add this item to your shopping cart right now.,We can't add this item to your shopping cart right now. +You sent the message.,You sent the message. Sales,Sales -"Invoice capturing error","Invoice capturing error" -"This order no longer exists.","This order no longer exists." -"Please enter a comment.","Please enter a comment." -"We cannot add order history.","We cannot add order history." -"You updated the order address.","You updated the order address." -"We can't update the order address right now.","We can't update the order address right now." -"You have not canceled the item.","You have not canceled the item." -"You canceled the order.","You canceled the order." +Invoice capturing error,Invoice capturing error +This order no longer exists.,This order no longer exists. +Please enter a comment.,Please enter a comment. +We cannot add order history.,We cannot add order history. +You updated the order address.,You updated the order address. +We can't update the order address right now.,We can't update the order address right now. +You have not canceled the item.,You have not canceled the item. +You canceled the order.,You canceled the order. """%1"" coupon code was not applied. Do not apply discount is selected for item(s)","""%1"" coupon code was not applied. Do not apply discount is selected for item(s)" """%1"" coupon code is not valid.","""%1"" coupon code is not valid." -"The coupon code has been accepted.","The coupon code has been accepted." -"Quote item id is not received.","Quote item id is not received." -"Quote item is not loaded.","Quote item is not loaded." -"New Order","New Order" -"You created the order.","You created the order." -"Order saving error: %1","Order saving error: %1" -"Cannot add new comment.","Cannot add new comment." -"The credit memo has been canceled.","The credit memo has been canceled." -"Credit memo has not been canceled.","Credit memo has not been canceled." -"New Memo for #%1","New Memo for #%1" -"New Memo","New Memo" -"The credit memo's total must be positive.","The credit memo's total must be positive." -"Cannot create online refund for Refund to Store Credit.","Cannot create online refund for Refund to Store Credit." -"You created the credit memo.","You created the credit memo." -"We can't save the credit memo right now.","We can't save the credit memo right now." -"We can't update the item's quantity right now.","We can't update the item's quantity right now." -"View Memo for #%1","View Memo for #%1" -"View Memo","View Memo" -"You voided the credit memo.","You voided the credit memo." -"We can't void the credit memo.","We can't void the credit memo." -"The order no longer exists.","The order no longer exists." -"We can't create credit memo for the order.","We can't create credit memo for the order." -"Edit Order","Edit Order" -"You sent the order email.","You sent the order email." -"We can't send the email order right now.","We can't send the email order right now." -"You have not put the order on hold.","You have not put the order on hold." -"You put the order on hold.","You put the order on hold." -"You canceled the invoice.","You canceled the invoice." -"Invoice canceling error","Invoice canceling error" -"The invoice has been captured.","The invoice has been captured." -"The order does not allow an invoice to be created.","The order does not allow an invoice to be created." -"You can't create an invoice without products.","You can't create an invoice without products." -"New Invoice","New Invoice" -"We can't save the invoice right now.","We can't save the invoice right now." -"You created the invoice and shipment.","You created the invoice and shipment." -"The invoice has been created.","The invoice has been created." -"We can't send the invoice email right now.","We can't send the invoice email right now." -"We can't send the shipment right now.","We can't send the shipment right now." -"Cannot update item quantity.","Cannot update item quantity." -"The invoice has been voided.","The invoice has been voided." -"Invoice voiding error","Invoice voiding error" -"%1 order(s) cannot be canceled.","%1 order(s) cannot be canceled." -"You cannot cancel the order(s).","You cannot cancel the order(s)." -"We canceled %1 order(s).","We canceled %1 order(s)." -"%1 order(s) were not put on hold.","%1 order(s) were not put on hold." -"No order(s) were put on hold.","No order(s) were put on hold." -"You have put %1 order(s) on hold.","You have put %1 order(s) on hold." -"%1 order(s) were not released from on hold status.","%1 order(s) were not released from on hold status." -"No order(s) were released from on hold status.","No order(s) were released from on hold status." -"%1 order(s) have been released from on hold status.","%1 order(s) have been released from on hold status." -"There are no printable documents related to selected orders.","There are no printable documents related to selected orders." -"The payment has been accepted.","The payment has been accepted." -"The payment has been denied.","The payment has been denied." -"Transaction has been approved.","Transaction has been approved." -"Transaction has been voided/declined.","Transaction has been voided/declined." -"There is no update for the transaction.","There is no update for the transaction." -"We can't update the payment right now.","We can't update the payment right now." -"You assigned the order status.","You assigned the order status." -"Something went wrong while assigning the order status.","Something went wrong while assigning the order status." -"We can't find this order status.","We can't find this order status." -"Create New Order Status","Create New Order Status" -"We found another order status with the same order status code.","We found another order status with the same order status code." -"You saved the order status.","You saved the order status." -"We can't add the order status right now.","We can't add the order status right now." -"You have unassigned the order status.","You have unassigned the order status." -"Something went wrong while unassigning the order.","Something went wrong while unassigning the order." -"Can't unhold order.","Can't unhold order." -"You released the order from holding status.","You released the order from holding status." -"The order was not on hold.","The order was not on hold." -"Exception occurred during order load","Exception occurred during order load" -"Something went wrong while saving the gift message.","Something went wrong while saving the gift message." -"You saved the gift card message.","You saved the gift card message." -"The payment has been voided.","The payment has been voided." -"We can't void the payment right now.","We can't void the payment right now." -"Please correct the transaction ID and try again.","Please correct the transaction ID and try again." -"The transaction details have been updated.","The transaction details have been updated." -"We can't update the transaction details.","We can't update the transaction details." -"Orders and Returns","Orders and Returns" -"You entered incorrect data. Please try again.","You entered incorrect data. Please try again." +The coupon code has been accepted.,The coupon code has been accepted. +Quote item id is not received.,Quote item id is not received. +Quote item is not loaded.,Quote item is not loaded. +New Order,New Order +You created the order.,You created the order. +Order saving error: %1,Order saving error: %1 +Cannot add new comment.,Cannot add new comment. +The credit memo has been canceled.,The credit memo has been canceled. +Credit memo has not been canceled.,Credit memo has not been canceled. +New Memo for #%1,New Memo for #%1 +New Memo,New Memo +The credit memo's total must be positive.,The credit memo's total must be positive. +Cannot create online refund for Refund to Store Credit.,Cannot create online refund for Refund to Store Credit. +You created the credit memo.,You created the credit memo. +We can't save the credit memo right now.,We can't save the credit memo right now. +We can't update the item's quantity right now.,We can't update the item's quantity right now. +View Memo for #%1,View Memo for #%1 +View Memo,View Memo +You voided the credit memo.,You voided the credit memo. +We can't void the credit memo.,We can't void the credit memo. +The order no longer exists.,The order no longer exists. +We can't create credit memo for the order.,We can't create credit memo for the order. +Edit Order,Edit Order +You sent the order email.,You sent the order email. +We can't send the email order right now.,We can't send the email order right now. +You have not put the order on hold.,You have not put the order on hold. +You put the order on hold.,You put the order on hold. +You canceled the invoice.,You canceled the invoice. +Invoice canceling error,Invoice canceling error +The invoice has been captured.,The invoice has been captured. +The order does not allow an invoice to be created.,The order does not allow an invoice to be created. +You can't create an invoice without products.,You can't create an invoice without products. +New Invoice,New Invoice +We can't save the invoice right now.,We can't save the invoice right now. +You created the invoice and shipment.,You created the invoice and shipment. +The invoice has been created.,The invoice has been created. +We can't send the invoice email right now.,We can't send the invoice email right now. +We can't send the shipment right now.,We can't send the shipment right now. +Cannot update item quantity.,Cannot update item quantity. +The invoice has been voided.,The invoice has been voided. +Invoice voiding error,Invoice voiding error +%1 order(s) cannot be canceled.,%1 order(s) cannot be canceled. +You cannot cancel the order(s).,You cannot cancel the order(s). +We canceled %1 order(s).,We canceled %1 order(s). +%1 order(s) were not put on hold.,%1 order(s) were not put on hold. +No order(s) were put on hold.,No order(s) were put on hold. +You have put %1 order(s) on hold.,You have put %1 order(s) on hold. +%1 order(s) were not released from on hold status.,%1 order(s) were not released from on hold status. +No order(s) were released from on hold status.,No order(s) were released from on hold status. +%1 order(s) have been released from on hold status.,%1 order(s) have been released from on hold status. +There are no printable documents related to selected orders.,There are no printable documents related to selected orders. +The payment has been accepted.,The payment has been accepted. +The payment has been denied.,The payment has been denied. +Transaction has been approved.,Transaction has been approved. +Transaction has been voided/declined.,Transaction has been voided/declined. +There is no update for the transaction.,There is no update for the transaction. +We can't update the payment right now.,We can't update the payment right now. +You assigned the order status.,You assigned the order status. +Something went wrong while assigning the order status.,Something went wrong while assigning the order status. +We can't find this order status.,We can't find this order status. +Create New Order Status,Create New Order Status +We found another order status with the same order status code.,We found another order status with the same order status code. +You saved the order status.,You saved the order status. +We can't add the order status right now.,We can't add the order status right now. +You have unassigned the order status.,You have unassigned the order status. +Something went wrong while unassigning the order.,Something went wrong while unassigning the order. +Can't unhold order.,Can't unhold order. +You released the order from holding status.,You released the order from holding status. +The order was not on hold.,The order was not on hold. +Exception occurred during order load,Exception occurred during order load +Something went wrong while saving the gift message.,Something went wrong while saving the gift message. +You saved the gift card message.,You saved the gift card message. +The payment has been voided.,The payment has been voided. +We can't void the payment right now.,We can't void the payment right now. +Please correct the transaction ID and try again.,Please correct the transaction ID and try again. +The transaction details have been updated.,The transaction details have been updated. +We can't update the transaction details.,We can't update the transaction details. +Orders and Returns,Orders and Returns +You entered incorrect data. Please try again.,You entered incorrect data. Please try again. Home,Home -"Go to Home Page","Go to Home Page" -"We can't find this wish list.","We can't find this wish list." +Go to Home Page,Go to Home Page +We can't find this wish list.,We can't find this wish list. "We could not add a product to cart by the ID ""%1"".","We could not add a product to cart by the ID ""%1""." -"There is an error in one of the option rows.","There is an error in one of the option rows." -"Shipping Address: ","Shipping Address: " -"Billing Address: ","Billing Address: " -"Please specify order items.","Please specify order items." -"Please specify a shipping method.","Please specify a shipping method." -"Please specify a payment method.","Please specify a payment method." -"This payment method is not available.","This payment method is not available." -"Validation is failed.","Validation is failed." -"You did not email your customer. Please check your email settings.","You did not email your customer. Please check your email settings." -"-- Please Select --","-- Please Select --" +There is an error in one of the option rows.,There is an error in one of the option rows. +Shipping Address: ,Shipping Address: +Billing Address: ,Billing Address: +Please specify order items.,Please specify order items. +Please specify a shipping method.,Please specify a shipping method. +Please specify a payment method.,Please specify a payment method. +This payment method is not available.,This payment method is not available. +Validation is failed.,Validation is failed. +You did not email your customer. Please check your email settings.,You did not email your customer. Please check your email settings. +-- Please Select --,-- Please Select -- "Path ""%1"" is not part of allowed directory ""%2""","Path ""%1"" is not part of allowed directory ""%2""" -"Identifying Fields required","Identifying Fields required" -"Id required","Id required" +Identifying Fields required,Identifying Fields required +Id required,Id required """Invoice Document Validation Error(s):\n"" .","""Invoice Document Validation Error(s):\n"" ." "Could not save an invoice, see error log for details","Could not save an invoice, see error log for details" -"A hold action is not available.","A hold action is not available." -"You cannot remove the hold.","You cannot remove the hold." -"We cannot cancel this order.","We cannot cancel this order." +A hold action is not available.,A hold action is not available. +You cannot remove the hold.,You cannot remove the hold. +We cannot cancel this order.,We cannot cancel this order. Guest,Guest -"Please enter the first name.","Please enter the first name." -"Please enter the last name.","Please enter the last name." -"Please enter the street.","Please enter the street." -"Please enter the city.","Please enter the city." -"Please enter the phone number.","Please enter the phone number." -"Please enter the company.","Please enter the company." -"Please enter the fax number.","Please enter the fax number." -"Please enter the zip/postal code.","Please enter the zip/postal code." -"Please enter the country.","Please enter the country." -"Please enter the state/province.","Please enter the state/province." -"Requested entity doesn't exist","Requested entity doesn't exist" -"Could not delete order address","Could not delete order address" -"Could not save order address","Could not save order address" +Please enter the first name.,Please enter the first name. +Please enter the last name.,Please enter the last name. +Please enter the street.,Please enter the street. +Please enter the city.,Please enter the city. +Please enter the phone number.,Please enter the phone number. +Please enter the company.,Please enter the company. +Please enter the fax number.,Please enter the fax number. +Please enter the zip/postal code.,Please enter the zip/postal code. +Please enter the country.,Please enter the country. +Please enter the state/province.,Please enter the state/province. +Requested entity doesn't exist,Requested entity doesn't exist +Could not delete order address,Could not delete order address +Could not save order address,Could not save order address Pending,Pending Refunded,Refunded Canceled,Canceled -"Unknown State","Unknown State" +Unknown State,Unknown State "We found an invalid quantity to refund item ""%1"".","We found an invalid quantity to refund item ""%1""." -"The creditmemo contains product item that is not part of the original order.","The creditmemo contains product item that is not part of the original order." -"The quantity to refund must not be greater than the unrefunded quantity.","The quantity to refund must not be greater than the unrefunded quantity." -"Maximum shipping amount allowed to refund is: %1","Maximum shipping amount allowed to refund is: %1" -"Order Id is required for creditmemo document","Order Id is required for creditmemo document" +The creditmemo contains product item that is not part of the original order.,The creditmemo contains product item that is not part of the original order. +The quantity to refund must not be greater than the unrefunded quantity.,The quantity to refund must not be greater than the unrefunded quantity. +Maximum shipping amount allowed to refund is: %1,Maximum shipping amount allowed to refund is: %1 +Order Id is required for creditmemo document,Order Id is required for creditmemo document "The creditmemo contains product SKU ""%1"" that is not part of the original order.","The creditmemo contains product SKU ""%1"" that is not part of the original order." "The quantity to creditmemo must not be greater than the unrefunded quantity for product SKU ""%1"".","The quantity to creditmemo must not be greater than the unrefunded quantity for product SKU ""%1""." -"You can't create a creditmemo without products.","You can't create a creditmemo without products." -"The most money available to refund is %1.","The most money available to refund is %1." -"Could not delete credit memo","Could not delete credit memo" -"Could not save credit memo","Could not save credit memo" -"This order already has associated customer account","This order already has associated customer account" +You can't create a creditmemo without products.,You can't create a creditmemo without products. +The most money available to refund is %1.,The most money available to refund is %1. +Could not delete credit memo,Could not delete credit memo +Could not save credit memo,Could not save credit memo +This order already has associated customer account,This order already has associated customer account Paid,Paid -"We cannot register an existing invoice","We cannot register an existing invoice" -"We can't create creditmemo for the invoice.","We can't create creditmemo for the invoice." -"Order Id is required for invoice document","Order Id is required for invoice document" +We cannot register an existing invoice,We cannot register an existing invoice +We can't create creditmemo for the invoice.,We can't create creditmemo for the invoice. +Order Id is required for invoice document,Order Id is required for invoice document "The quantity to invoice must not be greater than the uninvoiced quantity for product SKU ""%1"".","The quantity to invoice must not be greater than the uninvoiced quantity for product SKU ""%1""." -"The invoice contains one or more items that are not part of the original order.","The invoice contains one or more items that are not part of the original order." -"ID required","ID required" -"Unknown Status","Unknown Status" +The invoice contains one or more items that are not part of the original order.,The invoice contains one or more items that are not part of the original order. +ID required,ID required +Unknown Status,Unknown Status Ordered,Ordered Shipped,Shipped Invoiced,Invoiced @@ -346,460 +346,461 @@ Backordered,Backordered Returned,Returned Partial,Partial Mixed,Mixed -"Registered a Void notification.","Registered a Void notification." +Registered a Void notification.,Registered a Void notification. "If the invoice was created offline, try creating an offline credit memo.","If the invoice was created offline, try creating an offline credit memo." -"We refunded %1 online.","We refunded %1 online." -"We refunded %1 offline.","We refunded %1 offline." +We refunded %1 online.,We refunded %1 online. +We refunded %1 offline.,We refunded %1 offline. "IPN ""Refunded"". Refund issued by merchant. Registered notification about refunded amount of %1. Transaction ID: ""%2"". Credit Memo has not been created. Please create offline Credit Memo.","IPN ""Refunded"". Refund issued by merchant. Registered notification about refunded amount of %1. Transaction ID: ""%2"". Credit Memo has not been created. Please create offline Credit Memo." -"The credit memo has been created automatically.","The credit memo has been created automatically." -"Registered notification about refunded amount of %1.","Registered notification about refunded amount of %1." -"Canceled order online","Canceled order online" -"Canceled order offline","Canceled order offline" -"Approved the payment online.","Approved the payment online." -"There is no need to approve this payment.","There is no need to approve this payment." -"Denied the payment online","Denied the payment online" -"Registered update about approved payment.","Registered update about approved payment." -"Registered update about denied payment.","Registered update about denied payment." -"There is no update for the payment.","There is no update for the payment." -"Voided authorization.","Voided authorization." -"Amount: %1.","Amount: %1." +The credit memo has been created automatically.,The credit memo has been created automatically. +Registered notification about refunded amount of %1.,Registered notification about refunded amount of %1. +Canceled order online,Canceled order online +Canceled order offline,Canceled order offline +Approved the payment online.,Approved the payment online. +There is no need to approve this payment.,There is no need to approve this payment. +Denied the payment online,Denied the payment online +Registered update about approved payment.,Registered update about approved payment. +Registered update about denied payment.,Registered update about denied payment. +There is no update for the payment.,There is no update for the payment. +Voided authorization.,Voided authorization. +Amount: %1.,Amount: %1. "Transaction ID: ""%1""","Transaction ID: ""%1""" -"The payment method you requested is not available.","The payment method you requested is not available." -"The payment disallows storing objects.","The payment disallows storing objects." +The payment method you requested is not available.,The payment method you requested is not available. +The payment disallows storing objects.,The payment disallows storing objects. "The transaction ""%1"" cannot be captured yet.","The transaction ""%1"" cannot be captured yet." -"The order amount of %1 is pending approval on the payment gateway.","The order amount of %1 is pending approval on the payment gateway." -"Ordered amount of %1","Ordered amount of %1" -"An amount of %1 will be captured after being approved at the payment gateway.","An amount of %1 will be captured after being approved at the payment gateway." -"Registered notification about captured amount of %1.","Registered notification about captured amount of %1." -"Order is suspended as its capture amount %1 is suspected to be fraudulent.","Order is suspended as its capture amount %1 is suspected to be fraudulent." -"The parent transaction ID must have a transaction ID.","The parent transaction ID must have a transaction ID." -"Payment transactions disallow storing objects.","Payment transactions disallow storing objects." +The order amount of %1 is pending approval on the payment gateway.,The order amount of %1 is pending approval on the payment gateway. +Ordered amount of %1,Ordered amount of %1 +An amount of %1 will be captured after being approved at the payment gateway.,An amount of %1 will be captured after being approved at the payment gateway. +Registered notification about captured amount of %1.,Registered notification about captured amount of %1. +Order is suspended as its capture amount %1 is suspected to be fraudulent.,Order is suspended as its capture amount %1 is suspected to be fraudulent. +The parent transaction ID must have a transaction ID.,The parent transaction ID must have a transaction ID. +Payment transactions disallow storing objects.,Payment transactions disallow storing objects. "The transaction ""%1"" (%2) is already closed.","The transaction ""%1"" (%2) is already closed." -"Set order for existing transactions not allowed","Set order for existing transactions not allowed" +Set order for existing transactions not allowed,Set order for existing transactions not allowed "At minimum, you need to set a payment ID.","At minimum, you need to set a payment ID." Order,Order Authorization,Authorization "We found an unsupported transaction type ""%1"".","We found an unsupported transaction type ""%1""." -"Please set a proper payment and order id.","Please set a proper payment and order id." -"Please enter a Transaction ID.","Please enter a Transaction ID." -"You can't do this without a transaction object.","You can't do this without a transaction object." -"Order # ","Order # " -"Order Date: ","Order Date: " -"Sold to:","Sold to:" -"Ship to:","Ship to:" -"Payment Method:","Payment Method:" -"Shipping Method:","Shipping Method:" -"Total Shipping Charges","Total Shipping Charges" +Please set a proper payment and order id.,Please set a proper payment and order id. +Please enter a Transaction ID.,Please enter a Transaction ID. +You can't do this without a transaction object.,You can't do this without a transaction object. +Order # ,Order # +Order Date: ,Order Date: +Sold to:,Sold to: +Ship to:,Ship to: +Payment Method:,Payment Method: +Shipping Method:,Shipping Method: +Total Shipping Charges,Total Shipping Charges Title,Title Number,Number -"We found an invalid renderer model.","We found an invalid renderer model." -"Please define the PDF object before using.","Please define the PDF object before using." +We found an invalid renderer model.,We found an invalid renderer model. +Please define the PDF object before using.,Please define the PDF object before using. "We don't recognize the draw line data. Please define the ""lines"" array.","We don't recognize the draw line data. Please define the ""lines"" array." Products,Products -"Total (ex)","Total (ex)" +Total (ex),Total (ex) Qty,Qty Tax,Tax -"Total (inc)","Total (inc)" -"Credit Memo # ","Credit Memo # " -"Invoice # ","Invoice # " -"The order object is not specified.","The order object is not specified." -"The source object is not specified.","The source object is not specified." -"An item object is not specified.","An item object is not specified." -"A PDF object is not specified.","A PDF object is not specified." -"A PDF page object is not specified.","A PDF page object is not specified." -"Excl. Tax","Excl. Tax" -"Incl. Tax","Incl. Tax" -"Packing Slip # ","Packing Slip # " +Total (inc),Total (inc) +Credit Memo # ,Credit Memo # +Invoice # ,Invoice # +The order object is not specified.,The order object is not specified. +The source object is not specified.,The source object is not specified. +An item object is not specified.,An item object is not specified. +A PDF object is not specified.,A PDF object is not specified. +A PDF page object is not specified.,A PDF page object is not specified. +Excl. Tax,Excl. Tax +Incl. Tax,Incl. Tax +Packing Slip # ,Packing Slip # title,title -"The PDF total model %1 must be or extend \Magento\Sales\Model\Order\Pdf\Total\DefaultTotal.","The PDF total model %1 must be or extend \Magento\Sales\Model\Order\Pdf\Total\DefaultTotal." -"We cannot register an existing shipment","We cannot register an existing shipment" -"Parent shipment cannot be loaded for track object.","Parent shipment cannot be loaded for track object." -"Order Id is required for shipment document","Order Id is required for shipment document" -"You can't create a shipment without products.","You can't create a shipment without products." +The PDF total model %1 must be or extend \Magento\Sales\Model\Order\Pdf\Total\DefaultTotal.,The PDF total model %1 must be or extend \Magento\Sales\Model\Order\Pdf\Total\DefaultTotal. +We cannot register an existing shipment,We cannot register an existing shipment +Parent shipment cannot be loaded for track object.,Parent shipment cannot be loaded for track object. +Order Id is required for shipment document,Order Id is required for shipment document +You can't create a shipment without products.,You can't create a shipment without products. "The shipment contains product SKU ""%1"" that is not part of the original order.","The shipment contains product SKU ""%1"" that is not part of the original order." "The quantity to ship must not be greater than the unshipped quantity for product SKU ""%1"".","The quantity to ship must not be greater than the unshipped quantity for product SKU ""%1""." -"Please enter a tracking number.","Please enter a tracking number." -"Could not delete shipment","Could not delete shipment" -"Could not save shipment","Could not save shipment" -"The last status can't be unassigned from its current state.","The last status can't be unassigned from its current state." +Please enter a tracking number.,Please enter a tracking number. +Could not delete shipment,Could not delete shipment +Could not save shipment,Could not save shipment +The last status can't be unassigned from its current state.,The last status can't be unassigned from its current state. "Status can't be unassigned, because it is used by existing order(s).","Status can't be unassigned, because it is used by existing order(s)." -"The total model should be extended from \Magento\Sales\Model\Order\Total\AbstractTotal.","The total model should be extended from \Magento\Sales\Model\Order\Total\AbstractTotal." -"An invoice cannot be created when an order has a status of %1","An invoice cannot be created when an order has a status of %1" -"A creditmemo can not be created when an order has a status of %1","A creditmemo can not be created when an order has a status of %1" -"The order does not allow a creditmemo to be created.","The order does not allow a creditmemo to be created." -"A shipment cannot be created when an order has a status of %1","A shipment cannot be created when an order has a status of %1" -"The order does not allow a shipment to be created.","The order does not allow a shipment to be created." +The total model should be extended from \Magento\Sales\Model\Order\Total\AbstractTotal.,The total model should be extended from \Magento\Sales\Model\Order\Total\AbstractTotal. +An invoice cannot be created when an order has a status of %1,An invoice cannot be created when an order has a status of %1 +A creditmemo can not be created when an order has a status of %1,A creditmemo can not be created when an order has a status of %1 +The order does not allow a creditmemo to be created.,The order does not allow a creditmemo to be created. +A shipment cannot be created when an order has a status of %1,A shipment cannot be created when an order has a status of %1 +The order does not allow a shipment to be created.,The order does not allow a shipment to be created. """Creditmemo Document Validation Error(s):\n"" .","""Creditmemo Document Validation Error(s):\n"" ." "Could not save a Creditmemo, see error log for details","Could not save a Creditmemo, see error log for details" -"We cannot determine the field name.","We cannot determine the field name." +We cannot determine the field name.,We cannot determine the field name. City,City Company,Company Country,Country Email,Email -"First Name","First Name" -"Last Name","Last Name" +First Name,First Name +Last Name,Last Name State/Province,State/Province -"Street Address","Street Address" -"Phone Number","Phone Number" -"Zip/Postal Code","Zip/Postal Code" -"We can't save the address:\n%1","We can't save the address:\n%1" -"Cannot save comment:\n%1","Cannot save comment:\n%1" -"We don't have enough information to save the parent transaction ID.","We don't have enough information to save the parent transaction ID." -"We cannot create an empty shipment.","We cannot create an empty shipment." -"Cannot save track:\n%1","Cannot save track:\n%1" -"Cannot unassign status from state","Cannot unassign status from state" -"New Orders","New Orders" -"Order #%1 created at %2","Order #%1 created at %2" -"Details for %1 #%2","Details for %1 #%2" -"Notified Date: %1","Notified Date: %1" -"Comment: %1<br/>","Comment: %1<br/>" -"Current Status: %1<br/>","Current Status: %1<br/>" -"Total: %1<br/>","Total: %1<br/>" -"Order # %1 Notification(s)","Order # %1 Notification(s)" -"You can not cancel Credit Memo","You can not cancel Credit Memo" -"Could not cancel creditmemo","Could not cancel creditmemo" -"We cannot register an existing credit memo.","We cannot register an existing credit memo." +Street Address,Street Address +Phone Number,Phone Number +Zip/Postal Code,Zip/Postal Code +We can't save the address:\n%1,We can't save the address:\n%1 +Cannot save comment:\n%1,Cannot save comment:\n%1 +We don't have enough information to save the parent transaction ID.,We don't have enough information to save the parent transaction ID. +We cannot create an empty shipment.,We cannot create an empty shipment. +Cannot save track:\n%1,Cannot save track:\n%1 +Cannot unassign status from state,Cannot unassign status from state +New Orders,New Orders +Order #%1 created at %2,Order #%1 created at %2 +Details for %1 #%2,Details for %1 #%2 +Notified Date: %1,Notified Date: %1 +Comment: %1<br/>,Comment: %1<br/> +Current Status: %1<br/>,Current Status: %1<br/> +Total: %1<br/>,Total: %1<br/> +Order # %1 Notification(s),Order # %1 Notification(s) +You can not cancel Credit Memo,You can not cancel Credit Memo +Could not cancel creditmemo,Could not cancel creditmemo +We cannot register an existing credit memo.,We cannot register an existing credit memo. "We found an invalid quantity to invoice item ""%1"".","We found an invalid quantity to invoice item ""%1""." "The Order State ""%1"" must not be set manually.","The Order State ""%1"" must not be set manually." """Shipment Document Validation Error(s):\n"" .","""Shipment Document Validation Error(s):\n"" ." "Could not save a shipment, see error log for details","Could not save a shipment, see error log for details" -"VAT Request Identifier","VAT Request Identifier" -"VAT Request Date","VAT Request Date" -"Pending Payment","Pending Payment" +VAT Request Identifier,VAT Request Identifier +VAT Request Date,VAT Request Date +Pending Payment,Pending Payment Processing,Processing -"On Hold","On Hold" +On Hold,On Hold Complete,Complete Closed,Closed -"Suspected Fraud","Suspected Fraud" -"Payment Review","Payment Review" +Suspected Fraud,Suspected Fraud +Payment Review,Payment Review New,New -"test message","test message" -"Email has not been sent","Email has not been sent" -"Authorized amount of %1.","Authorized amount of %1." -"We will authorize %1 after the payment is approved at the payment gateway.","We will authorize %1 after the payment is approved at the payment gateway." -"Authorized amount of %1. Order is suspended as its authorizing amount %1 is suspected to be fraudulent.","Authorized amount of %1. Order is suspended as its authorizing amount %1 is suspected to be fraudulent." -"Captured amount of %1 online.","Captured amount of %1 online." -"Authorized amount of %1","Authorized amount of %1" +test message,test message +Email has not been sent,Email has not been sent +Authorized amount of %1.,Authorized amount of %1. +We will authorize %1 after the payment is approved at the payment gateway.,We will authorize %1 after the payment is approved at the payment gateway. +Authorized amount of %1. Order is suspended as its authorizing amount %1 is suspected to be fraudulent.,Authorized amount of %1. Order is suspended as its authorizing amount %1 is suspected to be fraudulent. +Captured amount of %1 online.,Captured amount of %1 online. +Authorized amount of %1,Authorized amount of %1 " Transaction ID: ""%1"""," Transaction ID: ""%1""" View,View -"Group was removed","Group was removed" +Group was removed,Group was removed "Changing address information will not recalculate shipping, tax or other order amount.","Changing address information will not recalculate shipping, tax or other order amount." -"Comment Text","Comment Text" -"Notify Customer by Email","Notify Customer by Email" -"Visible on Storefront","Visible on Storefront" +Comment Text,Comment Text +Notify Customer by Email,Notify Customer by Email +Visible on Storefront,Visible on Storefront Customer,Customer Notified,Notified -"Not Notified","Not Notified" -"No Payment Methods","No Payment Methods" -"Order Comments","Order Comments" -"Apply Coupon Code","Apply Coupon Code" +Not Notified,Not Notified +No Payment Methods,No Payment Methods +Order Comments,Order Comments +Apply Coupon Code,Apply Coupon Code Apply,Apply -"Remove Coupon Code","Remove Coupon Code" +Remove Coupon Code,Remove Coupon Code Remove,Remove -"Address Information","Address Information" -"Payment & Shipping Information","Payment & Shipping Information" -"Order Total","Order Total" -"Order Currency:","Order Currency:" -"Same As Billing Address","Same As Billing Address" -"Select from existing customer addresses:","Select from existing customer addresses:" -"Add New Address","Add New Address" -"Save in address book","Save in address book" -"You don't need to select a shipping address.","You don't need to select a shipping address." -"Gift Message for the Entire Order","Gift Message for the Entire Order" -"Leave this box blank if you don't want to leave a gift message for the entire order.","Leave this box blank if you don't want to leave a gift message for the entire order." -"Row Subtotal","Row Subtotal" +Address Information,Address Information +Payment & Shipping Information,Payment & Shipping Information +Order Total,Order Total +Order Currency:,Order Currency: +Same As Billing Address,Same As Billing Address +Select from existing customer addresses:,Select from existing customer addresses: +Add New Address,Add New Address +Save in address book,Save in address book +You don't need to select a shipping address.,You don't need to select a shipping address. +Gift Message for the Entire Order,Gift Message for the Entire Order +Leave this box blank if you don't want to leave a gift message for the entire order.,Leave this box blank if you don't want to leave a gift message for the entire order. +Row Subtotal,Row Subtotal Action,Action -"No ordered items","No ordered items" -"Update Items and Quantities","Update Items and Quantities" -"Total %1 product(s)","Total %1 product(s)" +No ordered items,No ordered items +Update Items and Quantities,Update Items and Quantities +Total %1 product(s),Total %1 product(s) Subtotal:,Subtotal: -"Tier Pricing","Tier Pricing" -"Custom Price","Custom Price" -"Please select","Please select" -"Move to Shopping Cart","Move to Shopping Cart" -"Move to Wish List","Move to Wish List" -"Subscribe to Newsletter","Subscribe to Newsletter" -"Click to change shipping method","Click to change shipping method" +Tier Pricing,Tier Pricing +Custom Price,Custom Price +Please select,Please select +Move to Shopping Cart,Move to Shopping Cart +Move to Wish List,Move to Wish List +Subscribe to Newsletter,Subscribe to Newsletter +Click to change shipping method,Click to change shipping method "Sorry, no quotes are available for this order.","Sorry, no quotes are available for this order." -"Get shipping methods and rates","Get shipping methods and rates" -"You don't need to select a shipping method.","You don't need to select a shipping method." -"Customer's Activities","Customer's Activities" +Get shipping methods and rates,Get shipping methods and rates +You don't need to select a shipping method.,You don't need to select a shipping method. +Customer's Activities,Customer's Activities Refresh,Refresh Item,Item -"Add To Order","Add To Order" -"Configure and Add to Order","Configure and Add to Order" -"No items","No items" -"Append Comments","Append Comments" -"Email Order Confirmation","Email Order Confirmation" -"Grand Total Excl. Tax","Grand Total Excl. Tax" -"Grand Total Incl. Tax","Grand Total Incl. Tax" -"Subtotal (Excl. Tax)","Subtotal (Excl. Tax)" -"Subtotal (Incl. Tax)","Subtotal (Incl. Tax)" -"Payment & Shipping Method","Payment & Shipping Method" -"Payment Information","Payment Information" -"The order was placed using %1.","The order was placed using %1." -"Shipping Information","Shipping Information" -"Items to Refund","Items to Refund" -"Return to Stock","Return to Stock" -"Qty to Refund","Qty to Refund" -"Tax Amount","Tax Amount" -"Discount Amount","Discount Amount" -"Row Total","Row Total" -"No Items To Refund","No Items To Refund" -"Credit Memo Comments","Credit Memo Comments" -"Refund Totals","Refund Totals" -"Email Copy of Credit Memo","Email Copy of Credit Memo" -"Please enter a positive number in this field.","Please enter a positive number in this field." -"Items Refunded","Items Refunded" -"No Items","No Items" -"Memo Total","Memo Total" -"Credit Memo History","Credit Memo History" -"Credit Memo Totals","Credit Memo Totals" -"Customer Name: %1","Customer Name: %1" -"Purchased From: %1","Purchased From: %1" -"Gift Message","Gift Message" +Add To Order,Add To Order +Configure and Add to Order,Configure and Add to Order +No items,No items +Append Comments,Append Comments +Email Order Confirmation,Email Order Confirmation +Grand Total Excl. Tax,Grand Total Excl. Tax +Grand Total Incl. Tax,Grand Total Incl. Tax +Subtotal (Excl. Tax),Subtotal (Excl. Tax) +Subtotal (Incl. Tax),Subtotal (Incl. Tax) +Payment & Shipping Method,Payment & Shipping Method +Payment Information,Payment Information +The order was placed using %1.,The order was placed using %1. +Shipping Information,Shipping Information +Items to Refund,Items to Refund +Return to Stock,Return to Stock +Qty to Refund,Qty to Refund +Tax Amount,Tax Amount +Discount Amount,Discount Amount +Row Total,Row Total +No Items To Refund,No Items To Refund +Credit Memo Comments,Credit Memo Comments +Refund Totals,Refund Totals +Email Copy of Credit Memo,Email Copy of Credit Memo +Please enter a positive number in this field.,Please enter a positive number in this field. +Items Refunded,Items Refunded +No Items,No Items +Memo Total,Memo Total +Credit Memo History,Credit Memo History +Credit Memo Totals,Credit Memo Totals +Customer Name: %1,Customer Name: %1 +Purchased From: %1,Purchased From: %1 +Gift Message,Gift Message From:,From: To:,To: Message:,Message: -"Shipping & Handling","Shipping & Handling" -"Gift Options","Gift Options" -"Create Shipment","Create Shipment" -"Invoice and shipment types do not match for some items on this order. You can create a shipment only after creating the invoice.","Invoice and shipment types do not match for some items on this order. You can create a shipment only after creating the invoice." +Shipping & Handling,Shipping & Handling +Gift Options,Gift Options +Create Shipment,Create Shipment +Invoice and shipment types do not match for some items on this order. You can create a shipment only after creating the invoice.,Invoice and shipment types do not match for some items on this order. You can create a shipment only after creating the invoice. %1,%1 -"Qty to Invoice","Qty to Invoice" -"Invoice History","Invoice History" -"Invoice Comments","Invoice Comments" -"Invoice Totals","Invoice Totals" +Qty to Invoice,Qty to Invoice +Invoice History,Invoice History +Invoice Comments,Invoice Comments +Invoice Totals,Invoice Totals Amount,Amount -"Capture Online","Capture Online" -"Capture Offline","Capture Offline" -"Not Capture","Not Capture" -"The invoice will be created offline without the payment gateway.","The invoice will be created offline without the payment gateway." -"Email Copy of Invoice","Email Copy of Invoice" -"Items Invoiced","Items Invoiced" -"Total Tax","Total Tax" -"From Name","From Name" -"To Name","To Name" +Capture Online,Capture Online +Capture Offline,Capture Offline +Not Capture,Not Capture +The invoice will be created offline without the payment gateway.,The invoice will be created offline without the payment gateway. +Email Copy of Invoice,Email Copy of Invoice +Items Invoiced,Items Invoiced +Total Tax,Total Tax +From Name,From Name +To Name,To Name Status,Status Comment,Comment -"Notification Not Applicable","Notification Not Applicable" -"Order & Account Information","Order & Account Information" -"The order confirmation email was sent","The order confirmation email was sent" -"The order confirmation email is not sent","The order confirmation email is not sent" -"Order Date","Order Date" -"Order Date (%1)","Order Date (%1)" -"Purchased From","Purchased From" -"Link to the New Order","Link to the New Order" -"Link to the Previous Order","Link to the Previous Order" -"Placed from IP","Placed from IP" -"%1 / %2 rate:","%1 / %2 rate:" -"Customer Name","Customer Name" -"Customer Group","Customer Group" -"Notes for this Order","Notes for this Order" -"Comment added","Comment added" -"Transaction Data","Transaction Data" -"Transaction ID","Transaction ID" -"Parent Transaction ID","Parent Transaction ID" -"Order ID","Order ID" -"Transaction Type","Transaction Type" -"Is Closed","Is Closed" -"Created At","Created At" -"Child Transactions","Child Transactions" -"Transaction Details","Transaction Details" +Notification Not Applicable,Notification Not Applicable +Order & Account Information,Order & Account Information +The order confirmation email was sent,The order confirmation email was sent +The order confirmation email is not sent,The order confirmation email is not sent +Order Date,Order Date +Order Date (%1),Order Date (%1) +Purchased From,Purchased From +Link to the New Order,Link to the New Order +Link to the Previous Order,Link to the Previous Order +Placed from IP,Placed from IP +%1 / %2 rate:,%1 / %2 rate: +Customer Name,Customer Name +Customer Group,Customer Group +Notes for this Order,Notes for this Order +Comment added,Comment added +Transaction Data,Transaction Data +Transaction ID,Transaction ID +Parent Transaction ID,Parent Transaction ID +Order ID,Order ID +Transaction Type,Transaction Type +Is Closed,Is Closed +Created At,Created At +Child Transactions,Child Transactions +Transaction Details,Transaction Details Items,Items -"Gift Message for this Order","Gift Message for this Order" -"Shipped By","Shipped By" -"Tracking Number","Tracking Number" -"Billing Last Name","Billing Last Name" -"Find Order By","Find Order By" -"ZIP Code","ZIP Code" -"Billing ZIP Code","Billing ZIP Code" +Gift Message for this Order,Gift Message for this Order +Shipped By,Shipped By +Tracking Number,Tracking Number +Billing Last Name,Billing Last Name +Find Order By,Find Order By +ZIP Code,ZIP Code +Billing ZIP Code,Billing ZIP Code Continue,Continue -"Print All Refunds","Print All Refunds" -"Refund #","Refund #" -"Print Refund","Print Refund" -"Product Name","Product Name" -"Order #","Order #" +Print All Refunds,Print All Refunds +Refund #,Refund # +Print Refund,Print Refund +Product Name,Product Name +Order #,Order # Date,Date -"Ship To","Ship To" +Ship To,Ship To Actions,Actions -"View Order","View Order" -"You have placed no orders.","You have placed no orders." -"No shipping information available","No shipping information available" -"Print Order","Print Order" -"Print All Invoices","Print All Invoices" -"Invoice #","Invoice #" -"Print Invoice","Print Invoice" -"Qty Invoiced","Qty Invoiced" +View Order,View Order +You have placed no orders.,You have placed no orders. +No shipping information available,No shipping information available +Print Order,Print Order +Print All Invoices,Print All Invoices +Invoice #,Invoice # +Print Invoice,Print Invoice +Qty Invoiced,Qty Invoiced Close,Close -"About Your Order","About Your Order" +About Your Order,About Your Order "<span class=""label"">Order Date:</span> %1","<span class=""label"">Order Date:</span> %1" -"Refund #%1","Refund #%1" -"Shipment #%1","Shipment #%1" -"Qty Shipped","Qty Shipped" -"Recent Orders","Recent Orders" -"View All","View All" -"Gift Message for This Order","Gift Message for This Order" -"Recently Ordered","Recently Ordered" -"Add to Cart","Add to Cart" +Refund #%1,Refund #%1 +Shipment #%1,Shipment #%1 +Qty Shipped,Qty Shipped +Recent Orders,Recent Orders +View All,View All +Gift Message for This Order,Gift Message for This Order +Recently Ordered,Recently Ordered +Add to Cart,Add to Cart Search,Search -"Credit memo for your %store_name order","Credit memo for your %store_name order" +Credit memo for your %store_name order,Credit memo for your %store_name order "%name,","%name," -"Thank you for your order from %store_name.","Thank you for your order from %store_name." +Thank you for your order from %store_name.,Thank you for your order from %store_name. "You can check the status of your order by <a href=""%account_url"">logging into your account</a>.","You can check the status of your order by <a href=""%account_url"">logging into your account</a>." "If you have questions about your order, you can email us at <a href=""mailto:%store_email"">%store_email</a>","If you have questions about your order, you can email us at <a href=""mailto:%store_email"">%store_email</a>" "or call us at <a href=""tel:%store_phone"">%store_phone</a>","or call us at <a href=""tel:%store_phone"">%store_phone</a>" "Our hours are <span class=""no-link"">%store_hours</span>.","Our hours are <span class=""no-link"">%store_hours</span>." -"Your Credit Memo #%creditmemo_id for Order #%order_id","Your Credit Memo #%creditmemo_id for Order #%order_id" -"Billing Info","Billing Info" -"Shipping Info","Shipping Info" -"Update to your %store_name credit memo","Update to your %store_name credit memo" -"Your order #%increment_id has been updated with a status of <strong>%order_status</strong>.","Your order #%increment_id has been updated with a status of <strong>%order_status</strong>." -"Invoice for your %store_name order","Invoice for your %store_name order" -"Your Invoice #%invoice_id for Order #%order_id","Your Invoice #%invoice_id for Order #%order_id" -"Update to your %store_name invoice","Update to your %store_name invoice" -"Your %store_name order confirmation","Your %store_name order confirmation" +Your Credit Memo #%creditmemo_id for Order #%order_id,Your Credit Memo #%creditmemo_id for Order #%order_id +Billing Info,Billing Info +Shipping Info,Shipping Info +Update to your %store_name credit memo,Update to your %store_name credit memo +Your order #%increment_id has been updated with a status of <strong>%order_status</strong>.,Your order #%increment_id has been updated with a status of <strong>%order_status</strong>. +Invoice for your %store_name order,Invoice for your %store_name order +Your Invoice #%invoice_id for Order #%order_id,Your Invoice #%invoice_id for Order #%order_id +Update to your %store_name invoice,Update to your %store_name invoice +Your %store_name order confirmation,Your %store_name order confirmation "%customer_name,","%customer_name," -"Once your package ships we will send you a tracking number.","Once your package ships we will send you a tracking number." +Once your package ships we will send you a tracking number.,Once your package ships we will send you a tracking number. "Your Order <span class=""no-link"">#%increment_id</span>","Your Order <span class=""no-link"">#%increment_id</span>" "Placed on <span class=""no-link"">%created_at</span>","Placed on <span class=""no-link"">%created_at</span>" -"Once your package ships we will send an email with a link to track your order.","Once your package ships we will send an email with a link to track your order." -"Update to your %store_name order","Update to your %store_name order" -"Your %store_name order has shipped","Your %store_name order has shipped" -"Your shipping confirmation is below. Thank you again for your business.","Your shipping confirmation is below. Thank you again for your business." -"Your Shipment #%shipment_id for Order #%order_id","Your Shipment #%shipment_id for Order #%order_id" -"Update to your %store_name shipment","Update to your %store_name shipment" -"Gift Options for ","Gift Options for " -"Add Products","Add Products" -"You have item changes","You have item changes" +Once your package ships we will send an email with a link to track your order.,Once your package ships we will send an email with a link to track your order. +Update to your %store_name order,Update to your %store_name order +Your %store_name order has shipped,Your %store_name order has shipped +Your shipping confirmation is below. Thank you again for your business.,Your shipping confirmation is below. Thank you again for your business. +Your Shipment #%shipment_id for Order #%order_id,Your Shipment #%shipment_id for Order #%order_id +Update to your %store_name shipment,Update to your %store_name shipment +Gift Options for ,Gift Options for +Add Products,Add Products +You have item changes,You have item changes Ok,Ok Operations,Operations Create,Create -"Send Order Email","Send Order Email" -"Accept or Deny Payment","Accept or Deny Payment" -"Send Sales Emails","Send Sales Emails" -"Sales Section","Sales Section" -"Sales Emails Section","Sales Emails Section" +Send Order Email,Send Order Email +Accept or Deny Payment,Accept or Deny Payment +Send Sales Emails,Send Sales Emails +Sales Section,Sales Section +Sales Emails Section,Sales Emails Section General,General -"Hide Customer IP","Hide Customer IP" +Hide Customer IP,Hide Customer IP "Choose whether a customer IP is shown in orders, invoices, shipments, and credit memos.","Choose whether a customer IP is shown in orders, invoices, shipments, and credit memos." -"Checkout Totals Sort Order","Checkout Totals Sort Order" -"Allow Reorder","Allow Reorder" -"Invoice and Packing Slip Design","Invoice and Packing Slip Design" -"Logo for PDF Print-outs (200x50)","Logo for PDF Print-outs (200x50)" +Checkout Totals Sort Order,Checkout Totals Sort Order +Allow Reorder,Allow Reorder +Invoice and Packing Slip Design,Invoice and Packing Slip Design +Logo for PDF Print-outs (200x50),Logo for PDF Print-outs (200x50) "Your default logo will be used in PDF and HTML documents.<br />(jpeg, tiff, png) If your pdf image is distorted, try to use larger file-size image.","Your default logo will be used in PDF and HTML documents.<br />(jpeg, tiff, png) If your pdf image is distorted, try to use larger file-size image." -"Logo for HTML Print View","Logo for HTML Print View" +Logo for HTML Print View,Logo for HTML Print View "Logo for HTML documents only. If empty, default will be used.<br />(jpeg, gif, png)","Logo for HTML documents only. If empty, default will be used.<br />(jpeg, gif, png)" Address,Address -"Minimum Order Amount","Minimum Order Amount" +Minimum Order Amount,Minimum Order Amount Enable,Enable -"Minimum Amount","Minimum Amount" -"Subtotal after discount","Subtotal after discount" -"Include Tax to Amount","Include Tax to Amount" -"Description Message","Description Message" -"This message will be shown in the shopping cart when the subtotal (after discount) is lower than the minimum allowed amount.","This message will be shown in the shopping cart when the subtotal (after discount) is lower than the minimum allowed amount." -"Error to Show in Shopping Cart","Error to Show in Shopping Cart" -"Validate Each Address Separately in Multi-address Checkout","Validate Each Address Separately in Multi-address Checkout" -"Multi-address Description Message","Multi-address Description Message" -"We'll use the default description above if you leave this empty.","We'll use the default description above if you leave this empty." -"Multi-address Error to Show in Shopping Cart","Multi-address Error to Show in Shopping Cart" -"We'll use the default error above if you leave this empty.","We'll use the default error above if you leave this empty." +Minimum Amount,Minimum Amount +Subtotal after discount,Subtotal after discount +Include Tax to Amount,Include Tax to Amount +Description Message,Description Message +This message will be shown in the shopping cart when the subtotal (after discount) is lower than the minimum allowed amount.,This message will be shown in the shopping cart when the subtotal (after discount) is lower than the minimum allowed amount. +Error to Show in Shopping Cart,Error to Show in Shopping Cart +Validate Each Address Separately in Multi-address Checkout,Validate Each Address Separately in Multi-address Checkout +Multi-address Description Message,Multi-address Description Message +We'll use the default description above if you leave this empty.,We'll use the default description above if you leave this empty. +Multi-address Error to Show in Shopping Cart,Multi-address Error to Show in Shopping Cart +We'll use the default error above if you leave this empty.,We'll use the default error above if you leave this empty. Dashboard,Dashboard -"Use Aggregated Data","Use Aggregated Data" -"Orders Cron Settings","Orders Cron Settings" -"Pending Payment Order Lifetime (minutes)","Pending Payment Order Lifetime (minutes)" -"Sales Emails","Sales Emails" -"Asynchronous sending","Asynchronous sending" +Use Aggregated Data,Use Aggregated Data +Orders Cron Settings,Orders Cron Settings +Pending Payment Order Lifetime (minutes),Pending Payment Order Lifetime (minutes) +Sales Emails,Sales Emails +Asynchronous sending,Asynchronous sending Enabled,Enabled -"New Order Confirmation Email Sender","New Order Confirmation Email Sender" -"New Order Confirmation Template","New Order Confirmation Template" +New Order Confirmation Email Sender,New Order Confirmation Email Sender +New Order Confirmation Template,New Order Confirmation Template "Email template chosen based on theme fallback when ""Default"" option is selected.","Email template chosen based on theme fallback when ""Default"" option is selected." -"New Order Confirmation Template for Guest","New Order Confirmation Template for Guest" -"Send Order Email Copy To","Send Order Email Copy To" +New Order Confirmation Template for Guest,New Order Confirmation Template for Guest +Send Order Email Copy To,Send Order Email Copy To Comma-separated,Comma-separated -"Send Order Email Copy Method","Send Order Email Copy Method" -"Order Comment Email Sender","Order Comment Email Sender" -"Order Comment Email Template","Order Comment Email Template" -"Order Comment Email Template for Guest","Order Comment Email Template for Guest" -"Send Order Comment Email Copy To","Send Order Comment Email Copy To" -"Send Order Comments Email Copy Method","Send Order Comments Email Copy Method" -"Invoice Email Sender","Invoice Email Sender" -"Invoice Email Template","Invoice Email Template" -"Invoice Email Template for Guest","Invoice Email Template for Guest" -"Send Invoice Email Copy To","Send Invoice Email Copy To" -"Send Invoice Email Copy Method","Send Invoice Email Copy Method" -"Invoice Comment Email Sender","Invoice Comment Email Sender" -"Invoice Comment Email Template","Invoice Comment Email Template" -"Invoice Comment Email Template for Guest","Invoice Comment Email Template for Guest" -"Send Invoice Comment Email Copy To","Send Invoice Comment Email Copy To" -"Send Invoice Comments Email Copy Method","Send Invoice Comments Email Copy Method" +Send Order Email Copy Method,Send Order Email Copy Method +Order Comment Email Sender,Order Comment Email Sender +Order Comment Email Template,Order Comment Email Template +Order Comment Email Template for Guest,Order Comment Email Template for Guest +Send Order Comment Email Copy To,Send Order Comment Email Copy To +Send Order Comments Email Copy Method,Send Order Comments Email Copy Method +Invoice Email Sender,Invoice Email Sender +Invoice Email Template,Invoice Email Template +Invoice Email Template for Guest,Invoice Email Template for Guest +Send Invoice Email Copy To,Send Invoice Email Copy To +Send Invoice Email Copy Method,Send Invoice Email Copy Method +Invoice Comment Email Sender,Invoice Comment Email Sender +Invoice Comment Email Template,Invoice Comment Email Template +Invoice Comment Email Template for Guest,Invoice Comment Email Template for Guest +Send Invoice Comment Email Copy To,Send Invoice Comment Email Copy To +Send Invoice Comments Email Copy Method,Send Invoice Comments Email Copy Method Shipment,Shipment -"Shipment Email Sender","Shipment Email Sender" -"Shipment Email Template","Shipment Email Template" -"Shipment Email Template for Guest","Shipment Email Template for Guest" -"Send Shipment Email Copy To","Send Shipment Email Copy To" -"Send Shipment Email Copy Method","Send Shipment Email Copy Method" -"Shipment Comments","Shipment Comments" -"Shipment Comment Email Sender","Shipment Comment Email Sender" -"Shipment Comment Email Template","Shipment Comment Email Template" -"Shipment Comment Email Template for Guest","Shipment Comment Email Template for Guest" -"Send Shipment Comment Email Copy To","Send Shipment Comment Email Copy To" -"Send Shipment Comments Email Copy Method","Send Shipment Comments Email Copy Method" -"Credit Memo Email Sender","Credit Memo Email Sender" -"Credit Memo Email Template","Credit Memo Email Template" -"Credit Memo Email Template for Guest","Credit Memo Email Template for Guest" -"Send Credit Memo Email Copy To","Send Credit Memo Email Copy To" -"Send Credit Memo Email Copy Method","Send Credit Memo Email Copy Method" -"Credit Memo Comment Email Sender","Credit Memo Comment Email Sender" -"Credit Memo Comment Email Template","Credit Memo Comment Email Template" -"Credit Memo Comment Email Template for Guest","Credit Memo Comment Email Template for Guest" -"Send Credit Memo Comment Email Copy To","Send Credit Memo Comment Email Copy To" -"Send Credit Memo Comments Email Copy Method","Send Credit Memo Comments Email Copy Method" -"PDF Print-outs","PDF Print-outs" -"Display Order ID in Header","Display Order ID in Header" -"Customer Order Status Notification","Customer Order Status Notification" -"Asynchronous indexing","Asynchronous indexing" -"Orders and Returns Search Form","Orders and Returns Search Form" -"Anchor Custom Title","Anchor Custom Title" +Shipment Email Sender,Shipment Email Sender +Shipment Email Template,Shipment Email Template +Shipment Email Template for Guest,Shipment Email Template for Guest +Send Shipment Email Copy To,Send Shipment Email Copy To +Send Shipment Email Copy Method,Send Shipment Email Copy Method +Shipment Comments,Shipment Comments +Shipment Comment Email Sender,Shipment Comment Email Sender +Shipment Comment Email Template,Shipment Comment Email Template +Shipment Comment Email Template for Guest,Shipment Comment Email Template for Guest +Send Shipment Comment Email Copy To,Send Shipment Comment Email Copy To +Send Shipment Comments Email Copy Method,Send Shipment Comments Email Copy Method +Credit Memo Email Sender,Credit Memo Email Sender +Credit Memo Email Template,Credit Memo Email Template +Credit Memo Email Template for Guest,Credit Memo Email Template for Guest +Send Credit Memo Email Copy To,Send Credit Memo Email Copy To +Send Credit Memo Email Copy Method,Send Credit Memo Email Copy Method +Credit Memo Comment Email Sender,Credit Memo Comment Email Sender +Credit Memo Comment Email Template,Credit Memo Comment Email Template +Credit Memo Comment Email Template for Guest,Credit Memo Comment Email Template for Guest +Send Credit Memo Comment Email Copy To,Send Credit Memo Comment Email Copy To +Send Credit Memo Comments Email Copy Method,Send Credit Memo Comments Email Copy Method +PDF Print-outs,PDF Print-outs +Display Order ID in Header,Display Order ID in Header +Customer Order Status Notification,Customer Order Status Notification +Asynchronous indexing,Asynchronous indexing +Orders and Returns Search Form,Orders and Returns Search Form +Anchor Custom Title,Anchor Custom Title Template,Template -"Default Template","Default Template" +Default Template,Default Template Name,Name Phone,Phone -"ZIP/Post Code","ZIP/Post Code" -"Signed-up Point","Signed-up Point" +ZIP/Post Code,ZIP/Post Code +Signed-up Point,Signed-up Point Website,Website -"Bill-to Name","Bill-to Name" +Bill-to Name,Bill-to Name Created,Created -"Invoice Date","Invoice Date" -"Ship-to Name","Ship-to Name" -"Ship Date","Ship Date" -"Total Quantity","Total Quantity" -"Default Status","Default Status" -"State Code and Title","State Code and Title" -"Item Status","Item Status" -"Original Price","Original Price" -"Tax Percent","Tax Percent" -"All Store Views","All Store Views" -"PDF Credit Memos","PDF Credit Memos" -"Purchase Point","Purchase Point" -"Print Invoices","Print Invoices" -"Print Packing Slips","Print Packing Slips" -"Print Credit Memos","Print Credit Memos" -"Print All","Print All" -"Print Shipping Labels","Print Shipping Labels" -"Purchase Date","Purchase Date" -"Grand Total (Base)","Grand Total (Base)" -"Grand Total (Purchased)","Grand Total (Purchased)" -"Customer Email","Customer Email" -"Shipping and Handling","Shipping and Handling" -"PDF Invoices","PDF Invoices" -"PDF Shipments","PDF Shipments" -"PDF Creditmemos","PDF Creditmemos" +Invoice Date,Invoice Date +Ship-to Name,Ship-to Name +Ship Date,Ship Date +Total Quantity,Total Quantity +Default Status,Default Status +State Code and Title,State Code and Title +Item Status,Item Status +Original Price,Original Price +Tax Percent,Tax Percent +All Store Views,All Store Views +PDF Credit Memos,PDF Credit Memos +Purchase Point,Purchase Point +Print Invoices,Print Invoices +Print Packing Slips,Print Packing Slips +Print Credit Memos,Print Credit Memos +Print All,Print All +Print Shipping Labels,Print Shipping Labels +Purchase Date,Purchase Date +Grand Total (Base),Grand Total (Base) +Grand Total (Purchased),Grand Total (Purchased) +Customer Email,Customer Email +Shipping and Handling,Shipping and Handling +PDF Invoices,PDF Invoices +PDF Shipments,PDF Shipments +PDF Creditmemos,PDF Creditmemos Refunds,Refunds -"Allow Zero GrandTotal for Creditmemo","Allow Zero GrandTotal for Creditmemo" -"Allow Zero GrandTotal","Allow Zero GrandTotal" +Allow Zero GrandTotal for Creditmemo,Allow Zero GrandTotal for Creditmemo +Allow Zero GrandTotal,Allow Zero GrandTotal Email is required field for Admin order creation,Email is required field for Admin order creation If set YES Email field will be required during Admin order creation for new Customer.,If set YES Email field will be required during Admin order creation for new Customer. -"Could not save the shipment tracking","Could not save the shipment tracking" -"Please enter a coupon code!","Please enter a coupon code!" -"Reorder is not available.","Reorder is not available." +Could not save the shipment tracking,Could not save the shipment tracking +Please enter a coupon code!,Please enter a coupon code! +Reorder is not available.,Reorder is not available. +This creditmemo no longer exists.,This creditmemo no longer exists. diff --git a/app/code/Magento/Shipping/Test/Mftf/ActionGroup/AdminGoToShipmentViewActionGroup.xml b/app/code/Magento/Shipping/Test/Mftf/ActionGroup/AdminGoToShipmentViewActionGroup.xml index 09f74839b3a30..14587e17f75ba 100644 --- a/app/code/Magento/Shipping/Test/Mftf/ActionGroup/AdminGoToShipmentViewActionGroup.xml +++ b/app/code/Magento/Shipping/Test/Mftf/ActionGroup/AdminGoToShipmentViewActionGroup.xml @@ -19,4 +19,4 @@ <amOnPage url="{{AdminShipmentViewPage.url}}/{{identifier}}" stepKey="amOnShipmentViewPage"/> <waitForPageLoad stepKey="waitForPageLoad"/> </actionGroup> -</actionGroups> \ No newline at end of file +</actionGroups> diff --git a/app/code/Magento/Shipping/Test/Mftf/Page/AdminShipmentViewPage.xml b/app/code/Magento/Shipping/Test/Mftf/Page/AdminShipmentViewPage.xml index 5a965db2b4efe..e78a4d5b2701c 100644 --- a/app/code/Magento/Shipping/Test/Mftf/Page/AdminShipmentViewPage.xml +++ b/app/code/Magento/Shipping/Test/Mftf/Page/AdminShipmentViewPage.xml @@ -10,4 +10,4 @@ xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/PageObject.xsd"> <page name="AdminShipmentViewPage" url="sales/shipment/view/shipment_id" area="admin" module="Shipping"> </page> -</pages> \ No newline at end of file +</pages> diff --git a/app/code/Magento/Shipping/Test/Mftf/Test/AdminOpenShipmentViewPageWithWrongShipmentIdTest.xml b/app/code/Magento/Shipping/Test/Mftf/Test/AdminOpenShipmentViewPageWithWrongShipmentIdTest.xml index 0311ebc320b59..13688afd0efe9 100644 --- a/app/code/Magento/Shipping/Test/Mftf/Test/AdminOpenShipmentViewPageWithWrongShipmentIdTest.xml +++ b/app/code/Magento/Shipping/Test/Mftf/Test/AdminOpenShipmentViewPageWithWrongShipmentIdTest.xml @@ -36,4 +36,4 @@ <see selector="{{AdminMessagesSection.error}}" userInput='This shipment no longer exists.' stepKey="seeErrorMessage"/> </test> -</tests> \ No newline at end of file +</tests> diff --git a/app/code/Magento/Shipping/i18n/en_US.csv b/app/code/Magento/Shipping/i18n/en_US.csv index f777e64ef98c9..831c361382490 100644 --- a/app/code/Magento/Shipping/i18n/en_US.csv +++ b/app/code/Magento/Shipping/i18n/en_US.csv @@ -1,179 +1,180 @@ -"New Shipment for Order #%1","New Shipment for Order #%1" -"Submit Shipment","Submit Shipment" -"You are trying to add a quantity for some products that doesn't match the quantity that was shipped.","You are trying to add a quantity for some products that doesn't match the quantity that was shipped." -"Products should be added to package(s)","Products should be added to package(s)" -"The value that you entered is not valid.","The value that you entered is not valid." -"Add Tracking Number","Add Tracking Number" -"Custom Value","Custom Value" +New Shipment for Order #%1,New Shipment for Order #%1 +Submit Shipment,Submit Shipment +You are trying to add a quantity for some products that doesn't match the quantity that was shipped.,You are trying to add a quantity for some products that doesn't match the quantity that was shipped. +Products should be added to package(s),Products should be added to package(s) +The value that you entered is not valid.,The value that you entered is not valid. +Add Tracking Number,Add Tracking Number +Custom Value,Custom Value Add,Add -"Send Tracking Information","Send Tracking Information" -"Are you sure you want to send a Shipment email to customer?","Are you sure you want to send a Shipment email to customer?" +Send Tracking Information,Send Tracking Information +Are you sure you want to send a Shipment email to customer?,Are you sure you want to send a Shipment email to customer? Print,Print -"the shipment email was sent","the shipment email was sent" -"the shipment email is not sent","the shipment email is not sent" -"Shipment #%1 | %3 (%2)","Shipment #%1 | %3 (%2)" -"Create Shipping Label...","Create Shipping Label..." -"Print Shipping Label","Print Shipping Label" -"Show Packages","Show Packages" -"About Your Shipment","About Your Shipment" -"Order # %1","Order # %1" -"Back to My Orders","Back to My Orders" -"View Another Order","View Another Order" -"Please enter a comment.","Please enter a comment." -"Cannot add new comment.","Cannot add new comment." -"Please specify a carrier.","Please specify a carrier." -"Please enter a tracking number.","Please enter a tracking number." +the shipment email was sent,the shipment email was sent +the shipment email is not sent,the shipment email is not sent +Shipment #%1 | %3 (%2),Shipment #%1 | %3 (%2) +Create Shipping Label...,Create Shipping Label... +Print Shipping Label,Print Shipping Label +Show Packages,Show Packages +About Your Shipment,About Your Shipment +Order # %1,Order # %1 +Back to My Orders,Back to My Orders +View Another Order,View Another Order +Please enter a comment.,Please enter a comment. +Cannot add new comment.,Cannot add new comment. +Please specify a carrier.,Please specify a carrier. +Please enter a tracking number.,Please enter a tracking number. Shipments,Shipments -"We can't initialize shipment for adding tracking number.","We can't initialize shipment for adding tracking number." -"Cannot add tracking number.","Cannot add tracking number." -"You created the shipping label.","You created the shipping label." -"An error occurred while creating shipping label.","An error occurred while creating shipping label." -"You sent the shipment.","You sent the shipment." -"Cannot send shipment information.","Cannot send shipment information." -"There are no shipping labels related to selected orders.","There are no shipping labels related to selected orders." -"New Shipment","New Shipment" -"We don't recognize or support the file extension in this shipment: %1.","We don't recognize or support the file extension in this shipment: %1." -"We can't initialize shipment for delete tracking number.","We can't initialize shipment for delete tracking number." -"We can't delete tracking number.","We can't delete tracking number." -"We can't load track with retrieving identifier right now.","We can't load track with retrieving identifier right now." -"We can't save the shipment right now.","We can't save the shipment right now." +We can't initialize shipment for adding tracking number.,We can't initialize shipment for adding tracking number. +Cannot add tracking number.,Cannot add tracking number. +You created the shipping label.,You created the shipping label. +An error occurred while creating shipping label.,An error occurred while creating shipping label. +You sent the shipment.,You sent the shipment. +Cannot send shipment information.,Cannot send shipment information. +There are no shipping labels related to selected orders.,There are no shipping labels related to selected orders. +New Shipment,New Shipment +We don't recognize or support the file extension in this shipment: %1.,We don't recognize or support the file extension in this shipment: %1. +We can't initialize shipment for delete tracking number.,We can't initialize shipment for delete tracking number. +We can't delete tracking number.,We can't delete tracking number. +We can't load track with retrieving identifier right now.,We can't load track with retrieving identifier right now. +We can't save the shipment right now.,We can't save the shipment right now. """Shipment Document Validation Error(s):\n"" .","""Shipment Document Validation Error(s):\n"" ." -"The shipment has been created.","The shipment has been created." -"Cannot save shipment.","Cannot save shipment." -"The order no longer exists.","The order no longer exists." -"Cannot do shipment for the order separately from invoice.","Cannot do shipment for the order separately from invoice." -"Cannot do shipment for the order.","Cannot do shipment for the order." -"There are no shipping labels related to selected shipments.","There are no shipping labels related to selected shipments." -"Page not found.","Page not found." -"Tracking Information","Tracking Information" +The shipment has been created.,The shipment has been created. +Cannot save shipment.,Cannot save shipment. +The order no longer exists.,The order no longer exists. +Cannot do shipment for the order separately from invoice.,Cannot do shipment for the order separately from invoice. +Cannot do shipment for the order.,Cannot do shipment for the order. +There are no shipping labels related to selected shipments.,There are no shipping labels related to selected shipments. +Page not found.,Page not found. +Tracking Information,Tracking Information "Sorry, but we can't deliver to the destination country with this shipping module.","Sorry, but we can't deliver to the destination country with this shipping module." -"The shipping module is not available.","The shipping module is not available." -"This shipping method is not available. Please specify the zip code.","This shipping method is not available. Please specify the zip code." -"No packages for request","No packages for request" -"Security validation of XML document has been failed.","Security validation of XML document has been failed." -"All Allowed Countries","All Allowed Countries" -"Specific Countries","Specific Countries" +The shipping module is not available.,The shipping module is not available. +This shipping method is not available. Please specify the zip code.,This shipping method is not available. Please specify the zip code. +No packages for request,No packages for request +Security validation of XML document has been failed.,Security validation of XML document has been failed. +All Allowed Countries,All Allowed Countries +Specific Countries,Specific Countries Development,Development Live,Live -"Divide to equal weight (one request)","Divide to equal weight (one request)" -"Use origin weight (few requests)","Use origin weight (few requests)" +Divide to equal weight (one request),Divide to equal weight (one request) +Use origin weight (few requests),Use origin weight (few requests) Packages,Packages Package,Package Type,Type Length,Length -"Signature Confirmation","Signature Confirmation" -"Customs Value","Customs Value" +Signature Confirmation,Signature Confirmation +Customs Value,Customs Value Width,Width Contents,Contents -"Total Weight","Total Weight" +Total Weight,Total Weight Height,Height Size,Size Girth,Girth -"Items in the Package","Items in the Package" +Items in the Package,Items in the Package Product,Product Weight,Weight -"Qty Ordered","Qty Ordered" +Qty Ordered,Qty Ordered Qty,Qty "No detail for number ""%1""","No detail for number ""%1""" -"Shipping labels is not available.","Shipping labels is not available." -"Response info is not exist.","Response info is not exist." -"Invalid carrier: %1","Invalid carrier: %1" -"We don't have enough information to create shipping labels. Please make sure your store information and settings are complete.","We don't have enough information to create shipping labels. Please make sure your store information and settings are complete." -"Per Order","Per Order" -"Per Package","Per Package" +Shipping labels is not available.,Shipping labels is not available. +Response info is not exist.,Response info is not exist. +Invalid carrier: %1,Invalid carrier: %1 +We don't have enough information to create shipping labels. Please make sure your store information and settings are complete.,We don't have enough information to create shipping labels. Please make sure your store information and settings are complete. +Per Order,Per Order +Per Package,Per Package Fixed,Fixed Percent,Percent -"Tracking information is unavailable.","Tracking information is unavailable." +Tracking information is unavailable.,Tracking information is unavailable. message,message -"Email has not been sent","Email has not been sent" -"Payment & Shipping Method","Payment & Shipping Method" -"Payment Information","Payment Information" -"The order was placed using %1.","The order was placed using %1." -"Shipping Information","Shipping Information" -"Total Shipping Charges","Total Shipping Charges" -"Incl. Tax","Incl. Tax" -"Items to Ship","Items to Ship" -"Qty to Ship","Qty to Ship" +Email has not been sent,Email has not been sent +Payment & Shipping Method,Payment & Shipping Method +Payment Information,Payment Information +The order was placed using %1.,The order was placed using %1. +Shipping Information,Shipping Information +Total Shipping Charges,Total Shipping Charges +Incl. Tax,Incl. Tax +Items to Ship,Items to Ship +Qty to Ship,Qty to Ship Ship,Ship -"Shipment Total","Shipment Total" -"Shipment Comments","Shipment Comments" -"Comment Text","Comment Text" -"Shipment Options","Shipment Options" -"Create Shipping Label","Create Shipping Label" -"Append Comments","Append Comments" -"Email Copy of Shipment","Email Copy of Shipment" -"Invalid value(s) for Qty to Ship","Invalid value(s) for Qty to Ship" -"Select All","Select All" -"Product Name","Product Name" +Shipment Total,Shipment Total +Shipment Comments,Shipment Comments +Comment Text,Comment Text +Shipment Options,Shipment Options +Create Shipping Label,Create Shipping Label +Append Comments,Append Comments +Email Copy of Shipment,Email Copy of Shipment +Invalid value(s) for Qty to Ship,Invalid value(s) for Qty to Ship +Select All,Select All +Product Name,Product Name Delete,Delete -"Create Packages","Create Packages" +Create Packages,Create Packages Cancel,Cancel Save,Save -"Add Package","Add Package" -"Add Selected Product(s) to Package","Add Selected Product(s) to Package" -"Add Products to Package","Add Products to Package" -"USPS domestic shipments don't use package types.","USPS domestic shipments don't use package types." +Add Package,Add Package +Add Selected Product(s) to Package,Add Selected Product(s) to Package +Add Products to Package,Add Products to Package +USPS domestic shipments don't use package types.,USPS domestic shipments don't use package types. in,in cm,cm lb,lb kg,kg -"Delete Package","Delete Package" +Delete Package,Delete Package Explanation,Explanation Carrier,Carrier Title,Title Number,Number Action,Action -"Are you sure?","Are you sure?" -"Shipping & Handling Information","Shipping & Handling Information" -"Track Order","Track Order" -"No shipping information available","No shipping information available" -"Shipping and Tracking Information","Shipping and Tracking Information" -"Track this shipment","Track this shipment" -"Items Shipped","Items Shipped" -"Order Total","Order Total" -"Shipment History","Shipment History" -"Qty Shipped","Qty Shipped" -"Print All Shipments","Print All Shipments" -"Shipment #","Shipment #" -"Print Shipment","Print Shipment" -"Tracking Number(s):","Tracking Number(s):" +Are you sure?,Are you sure? +Shipping & Handling Information,Shipping & Handling Information +Track Order,Track Order +No shipping information available,No shipping information available +Shipping and Tracking Information,Shipping and Tracking Information +Track this shipment,Track this shipment +Items Shipped,Items Shipped +Order Total,Order Total +Shipment History,Shipment History +Qty Shipped,Qty Shipped +Print All Shipments,Print All Shipments +Shipment #,Shipment # +Print Shipment,Print Shipment +Tracking Number(s):,Tracking Number(s): SKU,SKU -"Order tracking","Order tracking" -"Tracking Number:","Tracking Number:" +Order tracking,Order tracking +Tracking Number:,Tracking Number: Carrier:,Carrier: Error:,Error: -"Tracking information is currently not available. Please ","Tracking information is currently not available. Please " -"contact us","contact us" -" for more information or "," for more information or " -"email us at ","email us at " +Tracking information is currently not available. Please ,Tracking information is currently not available. Please +contact us,contact us + for more information or , for more information or +email us at ,email us at Info:,Info: Track:,Track: -". ':'",". ':'" -"Delivered on:","Delivered on:" +. ':',. ':' +Delivered on:,Delivered on: N/A,N/A -"There is no tracking available for this shipment.","There is no tracking available for this shipment." -"There is no tracking available.","There is no tracking available." -"Close Window","Close Window" -"Track history","Track history" +There is no tracking available for this shipment.,There is no tracking available for this shipment. +There is no tracking available.,There is no tracking available. +Close Window,Close Window +Track history,Track history Location,Location Date,Date -"Local Time","Local Time" +Local Time,Local Time Description,Description -"See our Shipping Policy","See our Shipping Policy" -"Shipping Settings Section","Shipping Settings Section" -"Shipping Policy Parameters Section","Shipping Policy Parameters Section" -"Shipping Methods Section","Shipping Methods Section" -"Shipping Settings","Shipping Settings" +See our Shipping Policy,See our Shipping Policy +Shipping Settings Section,Shipping Settings Section +Shipping Policy Parameters Section,Shipping Policy Parameters Section +Shipping Methods Section,Shipping Methods Section +Shipping Settings,Shipping Settings Origin,Origin Country,Country Region/State,Region/State -"ZIP/Postal Code","ZIP/Postal Code" +ZIP/Postal Code,ZIP/Postal Code City,City -"Street Address","Street Address" -"Street Address Line 2","Street Address Line 2" -"Shipping Policy Parameters","Shipping Policy Parameters" -"Apply custom Shipping Policy","Apply custom Shipping Policy" -"Shipping Policy","Shipping Policy" -"Shipping Methods","Shipping Methods" -"Track your order","Track your order" -"Track All Shipments","Track All Shipments" +Street Address,Street Address +Street Address Line 2,Street Address Line 2 +Shipping Policy Parameters,Shipping Policy Parameters +Apply custom Shipping Policy,Apply custom Shipping Policy +Shipping Policy,Shipping Policy +Shipping Methods,Shipping Methods +Track your order,Track your order +Track All Shipments,Track All Shipments +This shipment no longer exists.,This shipment no longer exists. From 4ba689a035c8aba55e6dc4d8c9cb48871db5d47f Mon Sep 17 00:00:00 2001 From: govindasharma974 <govindpokhrelsharma@cedcommerce.com> Date: Wed, 14 Oct 2020 11:04:51 +0530 Subject: [PATCH 016/171] Fixed some test case issues --- .../Sales/Controller/Adminhtml/Order/CreditmemoLoader.php | 2 +- .../AdminOpenCreditmemoViewPageWithWrongCreditmemoIdTest.xml | 2 +- .../Test/Unit/Controller/Adminhtml/Order/Shipment/ViewTest.php | 2 -- 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/app/code/Magento/Sales/Controller/Adminhtml/Order/CreditmemoLoader.php b/app/code/Magento/Sales/Controller/Adminhtml/Order/CreditmemoLoader.php index 7bb0b38a8d5ff..2451b76a5de1a 100644 --- a/app/code/Magento/Sales/Controller/Adminhtml/Order/CreditmemoLoader.php +++ b/app/code/Magento/Sales/Controller/Adminhtml/Order/CreditmemoLoader.php @@ -183,7 +183,7 @@ public function load() if ($creditmemoId) { try { $creditmemo = $this->creditmemoRepository->get($creditmemoId); - } catch (\Exception $e) { + } catch (\Exception $e) { $this->messageManager->addErrorMessage(__('This creditmemo no longer exists.')); return false; } diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminOpenCreditmemoViewPageWithWrongCreditmemoIdTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminOpenCreditmemoViewPageWithWrongCreditmemoIdTest.xml index c6522cb22cdf3..696a9f0db2eb0 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminOpenCreditmemoViewPageWithWrongCreditmemoIdTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminOpenCreditmemoViewPageWithWrongCreditmemoIdTest.xml @@ -31,7 +31,7 @@ <waitForPageLoad stepKey="waitForPageLoad"/> - <seeInCurrentUrl url="{{AdminCreditmemosGridPage.url}}" stepKey="redirectToCreditmemosGridPage"/> + <seeInCurrentUrl url="{{AdminCreditMemosGridPage.url}}" stepKey="redirectToCreditMemosGridPage"/> <see selector="{{AdminMessagesSection.error}}" userInput='This creditmemo no longer exists.' stepKey="seeErrorMessage"/> diff --git a/app/code/Magento/Shipping/Test/Unit/Controller/Adminhtml/Order/Shipment/ViewTest.php b/app/code/Magento/Shipping/Test/Unit/Controller/Adminhtml/Order/Shipment/ViewTest.php index d99ce83d91de2..aa983aa5c86ce 100644 --- a/app/code/Magento/Shipping/Test/Unit/Controller/Adminhtml/Order/Shipment/ViewTest.php +++ b/app/code/Magento/Shipping/Test/Unit/Controller/Adminhtml/Order/Shipment/ViewTest.php @@ -87,7 +87,6 @@ class ViewTest extends TestCase */ protected $pageTitleMock; - /** * @var \Magento\Shipping\Controller\Adminhtml\Order\Shipment\View * @var RedirectFactory|MockObject @@ -104,7 +103,6 @@ class ViewTest extends TestCase */ protected $controller; - protected function setUp(): void { $this->requestMock = $this->getMockBuilder(RequestInterface::class) From 9e99f43aeca1692343abf7450b61c91b2428b95f Mon Sep 17 00:00:00 2001 From: govindasharma974 <govindpokhrelsharma@cedcommerce.com> Date: Wed, 14 Oct 2020 16:21:52 +0530 Subject: [PATCH 017/171] Fixed MFTF issue --- .../Mftf/ActionGroup/AdminGoToCreditmemoViewActionGroup.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminGoToCreditmemoViewActionGroup.xml b/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminGoToCreditmemoViewActionGroup.xml index 041ebc7baa84d..d417a6c5ed314 100644 --- a/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminGoToCreditmemoViewActionGroup.xml +++ b/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminGoToCreditmemoViewActionGroup.xml @@ -16,7 +16,7 @@ <argument name="identifier" type="string"/> </arguments> - <amOnPage url="{{AdminCreditmemoViewPage.url}}/{{identifier}}" stepKey="amOnCreditmemoViewPage"/> + <amOnPage url="{{AdminCreditMemoViewPage.url}}/{{identifier}}" stepKey="amOnCreditmemoViewPage"/> <waitForPageLoad stepKey="waitForPageLoad"/> </actionGroup> </actionGroups> From 87be948915016ff3398a3eec9af903cfd4dbc844 Mon Sep 17 00:00:00 2001 From: saphaljha <saphal.jha@krishtechnolabs.com> Date: Thu, 22 Oct 2020 02:07:59 +0530 Subject: [PATCH 018/171] Converted TEST into automic groups for reusable actions --- ...dDeleteMultipleLayoutWidgetActionGroup.xml | 38 ------------------- ...minCreateWidgetWthoutLayoutActionGroup.xml | 26 +++++++++++++ .../AdminWidgetAddLayoutUpdateActionGroup.xml | 18 +++++++++ ...minWidgetDeleteLayoutUpdateActionGroup.xml | 17 +++++++++ .../Mftf/Section/AdminNewWidgetSection.xml | 4 +- ...AddAndDeleteMultipleLayoutSectionsTest.xml | 11 +++++- .../View/Helper/SecureHtmlRenderer.php | 2 +- 7 files changed, 73 insertions(+), 43 deletions(-) delete mode 100644 app/code/Magento/Widget/Test/Mftf/ActionGroup/AdminCreateAndDeleteMultipleLayoutWidgetActionGroup.xml create mode 100644 app/code/Magento/Widget/Test/Mftf/ActionGroup/AdminCreateWidgetWthoutLayoutActionGroup.xml create mode 100644 app/code/Magento/Widget/Test/Mftf/ActionGroup/AdminWidgetAddLayoutUpdateActionGroup.xml create mode 100644 app/code/Magento/Widget/Test/Mftf/ActionGroup/AdminWidgetDeleteLayoutUpdateActionGroup.xml diff --git a/app/code/Magento/Widget/Test/Mftf/ActionGroup/AdminCreateAndDeleteMultipleLayoutWidgetActionGroup.xml b/app/code/Magento/Widget/Test/Mftf/ActionGroup/AdminCreateAndDeleteMultipleLayoutWidgetActionGroup.xml deleted file mode 100644 index b7ebd09c2fcc6..0000000000000 --- a/app/code/Magento/Widget/Test/Mftf/ActionGroup/AdminCreateAndDeleteMultipleLayoutWidgetActionGroup.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. - */ ---> -<actionGroups - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> - <actionGroup name="AdminCreateAndDeleteMultipleLayoutWidgetActionGroup"> - <annotations> - <description>Goes to the Admin Widget creation page. Add and delete multiple layouts</description> - </annotations> - <arguments> - <argument name="widget"/> - </arguments> - <amOnPage url="{{AdminNewWidgetPage.url}}" stepKey="amOnAdminNewWidgetPage"/> - <selectOption selector="{{AdminNewWidgetSection.widgetType}}" userInput="{{widget.type}}" stepKey="setWidgetType"/> - <selectOption selector="{{AdminNewWidgetSection.widgetDesignTheme}}" userInput="{{widget.design_theme}}" stepKey="setWidgetDesignTheme"/> - <click selector="{{AdminNewWidgetSection.continue}}" stepKey="clickContinue"/> - <fillField selector="{{AdminNewWidgetSection.widgetTitle}}" userInput="{{widget.name}}" stepKey="fillTitle"/> - <selectOption selector="{{AdminNewWidgetSection.widgetStoreIds}}" userInput="{{widget.store_ids[0]}}" stepKey="setWidgetStoreIds"/> - <click selector="{{AdminNewWidgetSection.addLayoutUpdate}}" stepKey="clickAddLayoutUpdate"/> - <waitForAjaxLoad stepKey="waitForLoad"/> - <click selector="{{AdminNewWidgetSection.addLayoutUpdate}}" stepKey="clickAddLayoutUpdate2"/> - <waitForAjaxLoad stepKey="waitForLoad2"/> - <click selector="{{AdminNewWidgetSection.addLayoutUpdate}}" stepKey="clickAddLayoutUpdate3"/> - <waitForAjaxLoad stepKey="waitForLoad3"/> - <seeNumberOfElements userInput="3" selector="{{AdminNewWidgetSection.CountDeleteButtons}}" stepKey="seeThreeDeleteButtons"/> - <click selector="{{AdminNewWidgetSection.deleteActionThird}}" stepKey="clickThirdDeleteButton"/> - <seeNumberOfElements userInput="2" selector="{{AdminNewWidgetSection.CountDeleteButtons}}" stepKey="seeTwoDeleteButtons"/> - <click selector="{{AdminNewWidgetSection.deleteActionSecond}}" stepKey="clickSecondDeleteButton"/> - <seeNumberOfElements userInput="1" selector="{{AdminNewWidgetSection.CountDeleteButtons}}" stepKey="seeOneDeleteButtons"/> - <click selector="{{AdminNewWidgetSection.deleteActionFirst}}" stepKey="clickFirstDeleteButton"/> - <seeNumberOfElements userInput="0" selector="{{AdminNewWidgetSection.CountDeleteButtons}}" stepKey="seeZeroDeleteButtons"/> - </actionGroup> -</actionGroups> diff --git a/app/code/Magento/Widget/Test/Mftf/ActionGroup/AdminCreateWidgetWthoutLayoutActionGroup.xml b/app/code/Magento/Widget/Test/Mftf/ActionGroup/AdminCreateWidgetWthoutLayoutActionGroup.xml new file mode 100644 index 0000000000000..e9ee80c1a5f2a --- /dev/null +++ b/app/code/Magento/Widget/Test/Mftf/ActionGroup/AdminCreateWidgetWthoutLayoutActionGroup.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="AdminCreateWidgetWthoutLayoutActionGroup"> + <annotations> + <description>Goes to the Admin Widget creation page without saving it</description> + </annotations> + <arguments> + <argument name="widget"/> + </arguments> + <amOnPage url="{{AdminNewWidgetPage.url}}" stepKey="amOnAdminNewWidgetPage"/> + <selectOption selector="{{AdminNewWidgetSection.widgetType}}" userInput="{{widget.type}}" stepKey="setWidgetType"/> + <selectOption selector="{{AdminNewWidgetSection.widgetDesignTheme}}" userInput="{{widget.design_theme}}" stepKey="setWidgetDesignTheme"/> + <click selector="{{AdminNewWidgetSection.continue}}" stepKey="clickContinue"/> + <fillField selector="{{AdminNewWidgetSection.widgetTitle}}" userInput="{{widget.name}}" stepKey="fillTitle"/> + <selectOption selector="{{AdminNewWidgetSection.widgetStoreIds}}" userInput="{{widget.store_ids[0]}}" stepKey="setWidgetStoreIds"/> + <click selector="{{AdminNewWidgetSection.addLayoutUpdate}}" stepKey="clickAddLayoutUpdate"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Widget/Test/Mftf/ActionGroup/AdminWidgetAddLayoutUpdateActionGroup.xml b/app/code/Magento/Widget/Test/Mftf/ActionGroup/AdminWidgetAddLayoutUpdateActionGroup.xml new file mode 100644 index 0000000000000..fa73fa4926e10 --- /dev/null +++ b/app/code/Magento/Widget/Test/Mftf/ActionGroup/AdminWidgetAddLayoutUpdateActionGroup.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="AdminWidgetAddLayoutUpdateActionGroup"> + <annotations> + <description>Add layouts during widgets creation</description> + </annotations> + <waitForAjaxLoad stepKey="waitForLoad"/> + <click selector="{{AdminNewWidgetSection.addLayoutUpdate}}" stepKey="clickAddLayoutUpdate"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Widget/Test/Mftf/ActionGroup/AdminWidgetDeleteLayoutUpdateActionGroup.xml b/app/code/Magento/Widget/Test/Mftf/ActionGroup/AdminWidgetDeleteLayoutUpdateActionGroup.xml new file mode 100644 index 0000000000000..e52fb1a7f6514 --- /dev/null +++ b/app/code/Magento/Widget/Test/Mftf/ActionGroup/AdminWidgetDeleteLayoutUpdateActionGroup.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="AdminWidgetDeleteLayoutUpdateActionGroup"> + <annotations> + <description>Delete layouts during widgets creation</description> + </annotations> + <click selector="{{AdminNewWidgetSection.deleteWidgetLayoutAction}}" stepKey="clickFirstDeleteButton"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Widget/Test/Mftf/Section/AdminNewWidgetSection.xml b/app/code/Magento/Widget/Test/Mftf/Section/AdminNewWidgetSection.xml index 373274aef8584..ea2a858c63885 100644 --- a/app/code/Magento/Widget/Test/Mftf/Section/AdminNewWidgetSection.xml +++ b/app/code/Magento/Widget/Test/Mftf/Section/AdminNewWidgetSection.xml @@ -40,9 +40,7 @@ <element name="displayMode" type="select" selector="select[id*='display_mode']"/> <element name="restrictTypes" type="select" selector="select[id*='types']"/> <element name="saveAndContinue" type="button" selector="#save_and_edit_button" timeout="30"/> - <element name="deleteActionFirst" type="button" selector="#page_group_container_0 > div.fieldset-wrapper-title > div > .action-default.action-delete"/> - <element name="deleteActionSecond" type="button" selector="#page_group_container_1 > div.fieldset-wrapper-title > div > .action-default.action-delete"/> - <element name="deleteActionThird" type="button" selector="#page_group_container_2 > div.fieldset-wrapper-title > div > .action-default.action-delete"/> + <element name="deleteWidgetLayoutAction" type="button" selector="#page_group_container > div:first-of-type > div.fieldset-wrapper-title > div > .action-default.action-delete"/> <element name="CountDeleteButtons" type="button" selector="#page_group_container > .fieldset-wrapper.page_group_container > div.fieldset-wrapper-title > div > .action-default.action-delete"/> </section> </sections> diff --git a/app/code/Magento/Widget/Test/Mftf/Test/AdminWidgetAddAndDeleteMultipleLayoutSectionsTest.xml b/app/code/Magento/Widget/Test/Mftf/Test/AdminWidgetAddAndDeleteMultipleLayoutSectionsTest.xml index 5a5652e1e9049..eee6058836f2e 100644 --- a/app/code/Magento/Widget/Test/Mftf/Test/AdminWidgetAddAndDeleteMultipleLayoutSectionsTest.xml +++ b/app/code/Magento/Widget/Test/Mftf/Test/AdminWidgetAddAndDeleteMultipleLayoutSectionsTest.xml @@ -29,8 +29,17 @@ <argument name="title" value="{{AdminMenuContentElementsWidgets.pageTitle}}"/> </actionGroup> <waitForLoadingMaskToDisappear stepKey="waitForLoadingMaskToDisappear1"/> - <actionGroup ref="AdminCreateAndDeleteMultipleLayoutWidgetActionGroup" stepKey="addWidgetForTest"> + <actionGroup ref="AdminCreateWidgetWthoutLayoutActionGroup" stepKey="addWidgetForTest"> <argument name="widget" value="ProductsListWidget"/> </actionGroup> + <actionGroup ref="AdminWidgetAddLayoutUpdateActionGroup" stepKey="AddSecondLayout"/> + <actionGroup ref="AdminWidgetAddLayoutUpdateActionGroup" stepKey="AddThirdLayout"/> + <seeNumberOfElements userInput="3" selector="{{AdminNewWidgetSection.CountDeleteButtons}}" stepKey="seeThreeDeleteButtons"/> + <actionGroup ref="AdminWidgetDeleteLayoutUpdateActionGroup" stepKey="DeleteFirstLayoutForWidget"></actionGroup> + <seeNumberOfElements userInput="2" selector="{{AdminNewWidgetSection.CountDeleteButtons}}" stepKey="seeTwoDeleteButtons"/> + <actionGroup ref="AdminWidgetDeleteLayoutUpdateActionGroup" stepKey="DeleteSecondLayoutForWidget"></actionGroup> + <seeNumberOfElements userInput="1" selector="{{AdminNewWidgetSection.CountDeleteButtons}}" stepKey="seeOneDeleteButtons"/> + <actionGroup ref="AdminWidgetDeleteLayoutUpdateActionGroup" stepKey="DeleteThirdLayoutForWidget"></actionGroup> + <seeNumberOfElements userInput="0" selector="{{AdminNewWidgetSection.CountDeleteButtons}}" stepKey="seeZeroDeleteButtons"/> </test> </tests> diff --git a/lib/internal/Magento/Framework/View/Helper/SecureHtmlRenderer.php b/lib/internal/Magento/Framework/View/Helper/SecureHtmlRenderer.php index ebc4b8870538f..87d4e88295356 100644 --- a/lib/internal/Magento/Framework/View/Helper/SecureHtmlRenderer.php +++ b/lib/internal/Magento/Framework/View/Helper/SecureHtmlRenderer.php @@ -112,7 +112,7 @@ function {$listenerFunction} () { {$attributeJavascript}; } var {$elementName}Array = document.querySelectorAll("{$elementSelector}"); - if({$elementName}Array.lenght !== 'undefined'){ + if({$elementName}Array.length !== 'undefined'){ {$elementName}Array.forEach(function(element){ if (element) { element.{$eventName} = function (event) { From 9f9d2cbf492634a89cb97326fba68a02d9e7c175 Mon Sep 17 00:00:00 2001 From: saphaljha <saphal.jha@krishtechnolabs.com> Date: Fri, 11 Sep 2020 11:01:41 +0530 Subject: [PATCH 019/171] Fixed issue when using dynamic elements --- .../View/Helper/SecureHtmlRenderer.php | 21 ++++++++++++------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/lib/internal/Magento/Framework/View/Helper/SecureHtmlRenderer.php b/lib/internal/Magento/Framework/View/Helper/SecureHtmlRenderer.php index ae8ab3f15bc96..d7369416f44bf 100644 --- a/lib/internal/Magento/Framework/View/Helper/SecureHtmlRenderer.php +++ b/lib/internal/Magento/Framework/View/Helper/SecureHtmlRenderer.php @@ -111,16 +111,21 @@ public function renderEventListenerAsTag( function {$listenerFunction} () { {$attributeJavascript}; } - var {$elementName} = document.querySelector("{$elementSelector}"); - if ({$elementName}) { - {$elementName}.{$eventName} = function (event) { - var targetElement = {$elementName}; - if (event && event.target) { - targetElement = event.target; + var {$elementName}Array = document.querySelectorAll("{$elementSelector}"); + + {$elementName}Array.forEach(function(element){ + if (element) { + element.{$eventName} = function (event) { + var targetElement = element; + if (event && event.target) { + targetElement = event.target; + } + {$listenerFunction}.apply(targetElement); } - {$listenerFunction}.apply(targetElement); } - } + }); + + script; return $this->renderTag('script', ['type' => 'text/javascript'], $script, false); From 89d3814530f20248a32b678fd9636bd990a5f9fb Mon Sep 17 00:00:00 2001 From: saphaljha <saphal.jha@krishtechnolabs.com> Date: Sat, 12 Sep 2020 20:06:59 +0530 Subject: [PATCH 020/171] Updated code for validate empty nodeList and covered MFTF --- ...dDeleteMultipleLayoutWidgetActionGroup.xml | 38 +++++++++++++++++++ .../Mftf/Section/AdminNewWidgetSection.xml | 2 + ...AddAndDeleteMultipleLayoutSectionsTest.xml | 36 ++++++++++++++++++ .../View/Helper/SecureHtmlRenderer.php | 22 +++++------ 4 files changed, 87 insertions(+), 11 deletions(-) create mode 100644 app/code/Magento/Widget/Test/Mftf/ActionGroup/AdminCreateAndDeleteMultipleLayoutWidgetActionGroup.xml create mode 100644 app/code/Magento/Widget/Test/Mftf/Test/AdminWidgetAddAndDeleteMultipleLayoutSectionsTest.xml diff --git a/app/code/Magento/Widget/Test/Mftf/ActionGroup/AdminCreateAndDeleteMultipleLayoutWidgetActionGroup.xml b/app/code/Magento/Widget/Test/Mftf/ActionGroup/AdminCreateAndDeleteMultipleLayoutWidgetActionGroup.xml new file mode 100644 index 0000000000000..b7ebd09c2fcc6 --- /dev/null +++ b/app/code/Magento/Widget/Test/Mftf/ActionGroup/AdminCreateAndDeleteMultipleLayoutWidgetActionGroup.xml @@ -0,0 +1,38 @@ +<?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="AdminCreateAndDeleteMultipleLayoutWidgetActionGroup"> + <annotations> + <description>Goes to the Admin Widget creation page. Add and delete multiple layouts</description> + </annotations> + <arguments> + <argument name="widget"/> + </arguments> + <amOnPage url="{{AdminNewWidgetPage.url}}" stepKey="amOnAdminNewWidgetPage"/> + <selectOption selector="{{AdminNewWidgetSection.widgetType}}" userInput="{{widget.type}}" stepKey="setWidgetType"/> + <selectOption selector="{{AdminNewWidgetSection.widgetDesignTheme}}" userInput="{{widget.design_theme}}" stepKey="setWidgetDesignTheme"/> + <click selector="{{AdminNewWidgetSection.continue}}" stepKey="clickContinue"/> + <fillField selector="{{AdminNewWidgetSection.widgetTitle}}" userInput="{{widget.name}}" stepKey="fillTitle"/> + <selectOption selector="{{AdminNewWidgetSection.widgetStoreIds}}" userInput="{{widget.store_ids[0]}}" stepKey="setWidgetStoreIds"/> + <click selector="{{AdminNewWidgetSection.addLayoutUpdate}}" stepKey="clickAddLayoutUpdate"/> + <waitForAjaxLoad stepKey="waitForLoad"/> + <click selector="{{AdminNewWidgetSection.addLayoutUpdate}}" stepKey="clickAddLayoutUpdate2"/> + <waitForAjaxLoad stepKey="waitForLoad2"/> + <click selector="{{AdminNewWidgetSection.addLayoutUpdate}}" stepKey="clickAddLayoutUpdate3"/> + <waitForAjaxLoad stepKey="waitForLoad3"/> + <seeNumberOfElements userInput="3" selector="{{AdminNewWidgetSection.CountDeleteButtons}}" stepKey="seeThreeDeleteButtons"/> + <click selector="{{AdminNewWidgetSection.deleteActionThird}}" stepKey="clickThirdDeleteButton"/> + <seeNumberOfElements userInput="2" selector="{{AdminNewWidgetSection.CountDeleteButtons}}" stepKey="seeTwoDeleteButtons"/> + <click selector="{{AdminNewWidgetSection.deleteActionSecond}}" stepKey="clickSecondDeleteButton"/> + <seeNumberOfElements userInput="1" selector="{{AdminNewWidgetSection.CountDeleteButtons}}" stepKey="seeOneDeleteButtons"/> + <click selector="{{AdminNewWidgetSection.deleteActionFirst}}" stepKey="clickFirstDeleteButton"/> + <seeNumberOfElements userInput="0" selector="{{AdminNewWidgetSection.CountDeleteButtons}}" stepKey="seeZeroDeleteButtons"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Widget/Test/Mftf/Section/AdminNewWidgetSection.xml b/app/code/Magento/Widget/Test/Mftf/Section/AdminNewWidgetSection.xml index 4064f8eb394ca..d6b1601854683 100644 --- a/app/code/Magento/Widget/Test/Mftf/Section/AdminNewWidgetSection.xml +++ b/app/code/Magento/Widget/Test/Mftf/Section/AdminNewWidgetSection.xml @@ -49,6 +49,8 @@ <element name="displayPageControl" type="select" selector="[name='parameters[show_pager]']"/> <element name="numberOfProductsToDisplay" type="input" selector="[name='parameters[products_count]']"/> <element name="cacheLifetime" type="input" selector="[name='parameters[cache_lifetime]']"/> + <element name="deleteWidgetLayoutAction" type="button" selector="#page_group_container > div:first-of-type > div.fieldset-wrapper-title > div > .action-default.action-delete"/> + <element name="CountDeleteButtons" type="button" selector="#page_group_container > .fieldset-wrapper.page_group_container > div.fieldset-wrapper-title > div > .action-default.action-delete"/> </section> </sections> diff --git a/app/code/Magento/Widget/Test/Mftf/Test/AdminWidgetAddAndDeleteMultipleLayoutSectionsTest.xml b/app/code/Magento/Widget/Test/Mftf/Test/AdminWidgetAddAndDeleteMultipleLayoutSectionsTest.xml new file mode 100644 index 0000000000000..5a5652e1e9049 --- /dev/null +++ b/app/code/Magento/Widget/Test/Mftf/Test/AdminWidgetAddAndDeleteMultipleLayoutSectionsTest.xml @@ -0,0 +1,36 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> + <test name="AdminWidgetAddAndDeleteMultipleLayoutSectionsTest"> + <annotations> + <features value="Widget"/> + <stories value="Add and Delete multiple layouts when creating a Widget"/> + <title value="Add and Delete multiple layouts"/> + <description value="Admin should be able to Add and Delete multiple layouts"/> + <severity value="CRITICAL"/> + <group value="Widget"/> + </annotations> + <before> + <actionGroup ref="AdminLoginActionGroup" stepKey="LoginAsAdmin"/> + </before> + <after> + <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> + </after> + <actionGroup ref="AdminNavigateMenuActionGroup" stepKey="navigateToContentWidgetsPageFirst"> + <argument name="menuUiId" value="{{AdminMenuContent.dataUiId}}"/> + <argument name="submenuUiId" value="{{AdminMenuContentElementsWidgets.dataUiId}}"/> + </actionGroup> + <actionGroup ref="AdminAssertPageTitleActionGroup" stepKey="seePageTitleFirst"> + <argument name="title" value="{{AdminMenuContentElementsWidgets.pageTitle}}"/> + </actionGroup> + <waitForLoadingMaskToDisappear stepKey="waitForLoadingMaskToDisappear1"/> + <actionGroup ref="AdminCreateAndDeleteMultipleLayoutWidgetActionGroup" stepKey="addWidgetForTest"> + <argument name="widget" value="ProductsListWidget"/> + </actionGroup> + </test> +</tests> diff --git a/lib/internal/Magento/Framework/View/Helper/SecureHtmlRenderer.php b/lib/internal/Magento/Framework/View/Helper/SecureHtmlRenderer.php index d7369416f44bf..ebc4b8870538f 100644 --- a/lib/internal/Magento/Framework/View/Helper/SecureHtmlRenderer.php +++ b/lib/internal/Magento/Framework/View/Helper/SecureHtmlRenderer.php @@ -112,19 +112,19 @@ function {$listenerFunction} () { {$attributeJavascript}; } var {$elementName}Array = document.querySelectorAll("{$elementSelector}"); - - {$elementName}Array.forEach(function(element){ - if (element) { - element.{$eventName} = function (event) { - var targetElement = element; - if (event && event.target) { - targetElement = event.target; + if({$elementName}Array.lenght !== 'undefined'){ + {$elementName}Array.forEach(function(element){ + if (element) { + element.{$eventName} = function (event) { + var targetElement = element; + if (event && event.target) { + targetElement = event.target; + } + {$listenerFunction}.apply(targetElement); } - {$listenerFunction}.apply(targetElement); } - } - }); - + }); + } script; From 08ca835531a52d74649e1dd01bccd3b1c9f1cf8f Mon Sep 17 00:00:00 2001 From: saphaljha <saphal.jha@krishtechnolabs.com> Date: Thu, 22 Oct 2020 02:07:59 +0530 Subject: [PATCH 021/171] Converted TEST into automic groups for reusable actions --- ...dDeleteMultipleLayoutWidgetActionGroup.xml | 38 ------------------- ...minCreateWidgetWthoutLayoutActionGroup.xml | 26 +++++++++++++ .../AdminWidgetAddLayoutUpdateActionGroup.xml | 18 +++++++++ ...minWidgetDeleteLayoutUpdateActionGroup.xml | 17 +++++++++ ...AddAndDeleteMultipleLayoutSectionsTest.xml | 11 +++++- .../View/Helper/SecureHtmlRenderer.php | 2 +- 6 files changed, 72 insertions(+), 40 deletions(-) delete mode 100644 app/code/Magento/Widget/Test/Mftf/ActionGroup/AdminCreateAndDeleteMultipleLayoutWidgetActionGroup.xml create mode 100644 app/code/Magento/Widget/Test/Mftf/ActionGroup/AdminCreateWidgetWthoutLayoutActionGroup.xml create mode 100644 app/code/Magento/Widget/Test/Mftf/ActionGroup/AdminWidgetAddLayoutUpdateActionGroup.xml create mode 100644 app/code/Magento/Widget/Test/Mftf/ActionGroup/AdminWidgetDeleteLayoutUpdateActionGroup.xml diff --git a/app/code/Magento/Widget/Test/Mftf/ActionGroup/AdminCreateAndDeleteMultipleLayoutWidgetActionGroup.xml b/app/code/Magento/Widget/Test/Mftf/ActionGroup/AdminCreateAndDeleteMultipleLayoutWidgetActionGroup.xml deleted file mode 100644 index b7ebd09c2fcc6..0000000000000 --- a/app/code/Magento/Widget/Test/Mftf/ActionGroup/AdminCreateAndDeleteMultipleLayoutWidgetActionGroup.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. - */ ---> -<actionGroups - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> - <actionGroup name="AdminCreateAndDeleteMultipleLayoutWidgetActionGroup"> - <annotations> - <description>Goes to the Admin Widget creation page. Add and delete multiple layouts</description> - </annotations> - <arguments> - <argument name="widget"/> - </arguments> - <amOnPage url="{{AdminNewWidgetPage.url}}" stepKey="amOnAdminNewWidgetPage"/> - <selectOption selector="{{AdminNewWidgetSection.widgetType}}" userInput="{{widget.type}}" stepKey="setWidgetType"/> - <selectOption selector="{{AdminNewWidgetSection.widgetDesignTheme}}" userInput="{{widget.design_theme}}" stepKey="setWidgetDesignTheme"/> - <click selector="{{AdminNewWidgetSection.continue}}" stepKey="clickContinue"/> - <fillField selector="{{AdminNewWidgetSection.widgetTitle}}" userInput="{{widget.name}}" stepKey="fillTitle"/> - <selectOption selector="{{AdminNewWidgetSection.widgetStoreIds}}" userInput="{{widget.store_ids[0]}}" stepKey="setWidgetStoreIds"/> - <click selector="{{AdminNewWidgetSection.addLayoutUpdate}}" stepKey="clickAddLayoutUpdate"/> - <waitForAjaxLoad stepKey="waitForLoad"/> - <click selector="{{AdminNewWidgetSection.addLayoutUpdate}}" stepKey="clickAddLayoutUpdate2"/> - <waitForAjaxLoad stepKey="waitForLoad2"/> - <click selector="{{AdminNewWidgetSection.addLayoutUpdate}}" stepKey="clickAddLayoutUpdate3"/> - <waitForAjaxLoad stepKey="waitForLoad3"/> - <seeNumberOfElements userInput="3" selector="{{AdminNewWidgetSection.CountDeleteButtons}}" stepKey="seeThreeDeleteButtons"/> - <click selector="{{AdminNewWidgetSection.deleteActionThird}}" stepKey="clickThirdDeleteButton"/> - <seeNumberOfElements userInput="2" selector="{{AdminNewWidgetSection.CountDeleteButtons}}" stepKey="seeTwoDeleteButtons"/> - <click selector="{{AdminNewWidgetSection.deleteActionSecond}}" stepKey="clickSecondDeleteButton"/> - <seeNumberOfElements userInput="1" selector="{{AdminNewWidgetSection.CountDeleteButtons}}" stepKey="seeOneDeleteButtons"/> - <click selector="{{AdminNewWidgetSection.deleteActionFirst}}" stepKey="clickFirstDeleteButton"/> - <seeNumberOfElements userInput="0" selector="{{AdminNewWidgetSection.CountDeleteButtons}}" stepKey="seeZeroDeleteButtons"/> - </actionGroup> -</actionGroups> diff --git a/app/code/Magento/Widget/Test/Mftf/ActionGroup/AdminCreateWidgetWthoutLayoutActionGroup.xml b/app/code/Magento/Widget/Test/Mftf/ActionGroup/AdminCreateWidgetWthoutLayoutActionGroup.xml new file mode 100644 index 0000000000000..e9ee80c1a5f2a --- /dev/null +++ b/app/code/Magento/Widget/Test/Mftf/ActionGroup/AdminCreateWidgetWthoutLayoutActionGroup.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="AdminCreateWidgetWthoutLayoutActionGroup"> + <annotations> + <description>Goes to the Admin Widget creation page without saving it</description> + </annotations> + <arguments> + <argument name="widget"/> + </arguments> + <amOnPage url="{{AdminNewWidgetPage.url}}" stepKey="amOnAdminNewWidgetPage"/> + <selectOption selector="{{AdminNewWidgetSection.widgetType}}" userInput="{{widget.type}}" stepKey="setWidgetType"/> + <selectOption selector="{{AdminNewWidgetSection.widgetDesignTheme}}" userInput="{{widget.design_theme}}" stepKey="setWidgetDesignTheme"/> + <click selector="{{AdminNewWidgetSection.continue}}" stepKey="clickContinue"/> + <fillField selector="{{AdminNewWidgetSection.widgetTitle}}" userInput="{{widget.name}}" stepKey="fillTitle"/> + <selectOption selector="{{AdminNewWidgetSection.widgetStoreIds}}" userInput="{{widget.store_ids[0]}}" stepKey="setWidgetStoreIds"/> + <click selector="{{AdminNewWidgetSection.addLayoutUpdate}}" stepKey="clickAddLayoutUpdate"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Widget/Test/Mftf/ActionGroup/AdminWidgetAddLayoutUpdateActionGroup.xml b/app/code/Magento/Widget/Test/Mftf/ActionGroup/AdminWidgetAddLayoutUpdateActionGroup.xml new file mode 100644 index 0000000000000..fa73fa4926e10 --- /dev/null +++ b/app/code/Magento/Widget/Test/Mftf/ActionGroup/AdminWidgetAddLayoutUpdateActionGroup.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="AdminWidgetAddLayoutUpdateActionGroup"> + <annotations> + <description>Add layouts during widgets creation</description> + </annotations> + <waitForAjaxLoad stepKey="waitForLoad"/> + <click selector="{{AdminNewWidgetSection.addLayoutUpdate}}" stepKey="clickAddLayoutUpdate"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Widget/Test/Mftf/ActionGroup/AdminWidgetDeleteLayoutUpdateActionGroup.xml b/app/code/Magento/Widget/Test/Mftf/ActionGroup/AdminWidgetDeleteLayoutUpdateActionGroup.xml new file mode 100644 index 0000000000000..e52fb1a7f6514 --- /dev/null +++ b/app/code/Magento/Widget/Test/Mftf/ActionGroup/AdminWidgetDeleteLayoutUpdateActionGroup.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="AdminWidgetDeleteLayoutUpdateActionGroup"> + <annotations> + <description>Delete layouts during widgets creation</description> + </annotations> + <click selector="{{AdminNewWidgetSection.deleteWidgetLayoutAction}}" stepKey="clickFirstDeleteButton"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Widget/Test/Mftf/Test/AdminWidgetAddAndDeleteMultipleLayoutSectionsTest.xml b/app/code/Magento/Widget/Test/Mftf/Test/AdminWidgetAddAndDeleteMultipleLayoutSectionsTest.xml index 5a5652e1e9049..eee6058836f2e 100644 --- a/app/code/Magento/Widget/Test/Mftf/Test/AdminWidgetAddAndDeleteMultipleLayoutSectionsTest.xml +++ b/app/code/Magento/Widget/Test/Mftf/Test/AdminWidgetAddAndDeleteMultipleLayoutSectionsTest.xml @@ -29,8 +29,17 @@ <argument name="title" value="{{AdminMenuContentElementsWidgets.pageTitle}}"/> </actionGroup> <waitForLoadingMaskToDisappear stepKey="waitForLoadingMaskToDisappear1"/> - <actionGroup ref="AdminCreateAndDeleteMultipleLayoutWidgetActionGroup" stepKey="addWidgetForTest"> + <actionGroup ref="AdminCreateWidgetWthoutLayoutActionGroup" stepKey="addWidgetForTest"> <argument name="widget" value="ProductsListWidget"/> </actionGroup> + <actionGroup ref="AdminWidgetAddLayoutUpdateActionGroup" stepKey="AddSecondLayout"/> + <actionGroup ref="AdminWidgetAddLayoutUpdateActionGroup" stepKey="AddThirdLayout"/> + <seeNumberOfElements userInput="3" selector="{{AdminNewWidgetSection.CountDeleteButtons}}" stepKey="seeThreeDeleteButtons"/> + <actionGroup ref="AdminWidgetDeleteLayoutUpdateActionGroup" stepKey="DeleteFirstLayoutForWidget"></actionGroup> + <seeNumberOfElements userInput="2" selector="{{AdminNewWidgetSection.CountDeleteButtons}}" stepKey="seeTwoDeleteButtons"/> + <actionGroup ref="AdminWidgetDeleteLayoutUpdateActionGroup" stepKey="DeleteSecondLayoutForWidget"></actionGroup> + <seeNumberOfElements userInput="1" selector="{{AdminNewWidgetSection.CountDeleteButtons}}" stepKey="seeOneDeleteButtons"/> + <actionGroup ref="AdminWidgetDeleteLayoutUpdateActionGroup" stepKey="DeleteThirdLayoutForWidget"></actionGroup> + <seeNumberOfElements userInput="0" selector="{{AdminNewWidgetSection.CountDeleteButtons}}" stepKey="seeZeroDeleteButtons"/> </test> </tests> diff --git a/lib/internal/Magento/Framework/View/Helper/SecureHtmlRenderer.php b/lib/internal/Magento/Framework/View/Helper/SecureHtmlRenderer.php index ebc4b8870538f..87d4e88295356 100644 --- a/lib/internal/Magento/Framework/View/Helper/SecureHtmlRenderer.php +++ b/lib/internal/Magento/Framework/View/Helper/SecureHtmlRenderer.php @@ -112,7 +112,7 @@ function {$listenerFunction} () { {$attributeJavascript}; } var {$elementName}Array = document.querySelectorAll("{$elementSelector}"); - if({$elementName}Array.lenght !== 'undefined'){ + if({$elementName}Array.length !== 'undefined'){ {$elementName}Array.forEach(function(element){ if (element) { element.{$eventName} = function (event) { From 788c26c8ed32630e8ab352c3f48d0764708cc0c6 Mon Sep 17 00:00:00 2001 From: saphaljha <saphal.jha@krishtechnolabs.com> Date: Mon, 26 Oct 2020 17:32:16 +0530 Subject: [PATCH 022/171] Added event prevent code --- .../Magento/Framework/View/Helper/SecureHtmlRenderer.php | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/internal/Magento/Framework/View/Helper/SecureHtmlRenderer.php b/lib/internal/Magento/Framework/View/Helper/SecureHtmlRenderer.php index 87d4e88295356..d3d94dbb7f1eb 100644 --- a/lib/internal/Magento/Framework/View/Helper/SecureHtmlRenderer.php +++ b/lib/internal/Magento/Framework/View/Helper/SecureHtmlRenderer.php @@ -116,6 +116,7 @@ function {$listenerFunction} () { {$elementName}Array.forEach(function(element){ if (element) { element.{$eventName} = function (event) { + event.preventDefault(); var targetElement = element; if (event && event.target) { targetElement = event.target; From 6359ac54873ff9d106f830e5b27c251823617b71 Mon Sep 17 00:00:00 2001 From: govindasharma974 <govindpokhrelsharma@cedcommerce.com> Date: Wed, 28 Oct 2020 16:50:53 +0530 Subject: [PATCH 023/171] Fixed MFTF issue --- .../Magento/Sales/Test/Mftf/Page/AdminCreditMemoViewPage.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/Sales/Test/Mftf/Page/AdminCreditMemoViewPage.xml b/app/code/Magento/Sales/Test/Mftf/Page/AdminCreditMemoViewPage.xml index 2e61424b29a56..2a3bc814364ae 100644 --- a/app/code/Magento/Sales/Test/Mftf/Page/AdminCreditMemoViewPage.xml +++ b/app/code/Magento/Sales/Test/Mftf/Page/AdminCreditMemoViewPage.xml @@ -8,7 +8,7 @@ <pages xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/PageObject.xsd"> - <page name="AdminCreditMemoViewPage" url="sales/order_creditmemo/view/creditmemo_id/{{memoId}}/" parameterized="true" area="admin" module="Magento_Sales"> + <page name="AdminCreditMemoViewPage" url="sales/creditmemo/view/creditmemo_id/" area="admin" module="Magento_Sales"> <section name="AdminCreditMemoViewItemsSection"/> <section name="AdminCreditMemoViewTotalSection"/> </page> From ade5168bb1a2228e5b18b65d4e295be4be74af4c Mon Sep 17 00:00:00 2001 From: govindasharma974 <govindpokhrelsharma@cedcommerce.com> Date: Thu, 29 Oct 2020 17:29:42 +0530 Subject: [PATCH 024/171] updated test files --- .../Adminhtml/Order/Creditmemo/ViewTest.php | 2 +- .../Adminhtml/Order/Invoice/ViewTest.php | 55 ++++++++++++++++--- 2 files changed, 47 insertions(+), 10 deletions(-) diff --git a/app/code/Magento/Sales/Test/Unit/Controller/Adminhtml/Order/Creditmemo/ViewTest.php b/app/code/Magento/Sales/Test/Unit/Controller/Adminhtml/Order/Creditmemo/ViewTest.php index b6935269e3da7..6e04f4caadc8f 100644 --- a/app/code/Magento/Sales/Test/Unit/Controller/Adminhtml/Order/Creditmemo/ViewTest.php +++ b/app/code/Magento/Sales/Test/Unit/Controller/Adminhtml/Order/Creditmemo/ViewTest.php @@ -108,7 +108,7 @@ class ViewTest extends TestCase protected $pageTitleMock; /** - * @var \Magento\Shipping\Controller\Adminhtml\Order\Creditmemo\View + * @var \Magento\Sales\Controller\Adminhtml\Order\Creditmemo\View * @var RedirectFactory|MockObject */ protected $resultRedirectFactoryMock; diff --git a/app/code/Magento/Sales/Test/Unit/Controller/Adminhtml/Order/Invoice/ViewTest.php b/app/code/Magento/Sales/Test/Unit/Controller/Adminhtml/Order/Invoice/ViewTest.php index c8376ab379b6f..a29ab201e0bd9 100644 --- a/app/code/Magento/Sales/Test/Unit/Controller/Adminhtml/Order/Invoice/ViewTest.php +++ b/app/code/Magento/Sales/Test/Unit/Controller/Adminhtml/Order/Invoice/ViewTest.php @@ -13,6 +13,8 @@ use Magento\Backend\Model\View\Result\Forward; use Magento\Backend\Model\View\Result\ForwardFactory; use Magento\Backend\Model\View\Result\Page; +use Magento\Backend\Model\View\Result\Redirect; +use Magento\Backend\Model\View\Result\RedirectFactory; use Magento\Framework\App\ActionFlag; use Magento\Framework\App\Request\Http; use Magento\Framework\TestFramework\Unit\Helper\ObjectManager; @@ -82,6 +84,17 @@ class ViewTest extends TestCase */ protected $pageTitleMock; + /** + * @var \Magento\Sales\Controller\Adminhtml\Order\Invoice\View + * @var RedirectFactory|MockObject + */ + protected $resultRedirectFactoryMock; + + /** + * @var Redirect|MockObject + */ + protected $resultRedirectMock; + /** * @var View */ @@ -194,6 +207,13 @@ protected function setUp(): void )->disableOriginalConstructor() ->setMethods(['create']) ->getMock(); + $this->resultRedirectFactoryMock = $this->getMockBuilder(RedirectFactory::class) + ->disableOriginalConstructor() + ->setMethods(['create']) + ->getMock(); + $this->resultRedirectMock = $this->getMockBuilder(Redirect::class) + ->disableOriginalConstructor() + ->getMock(); $this->invoiceRepository = $this->getMockBuilder(InvoiceRepositoryInterface::class) ->disableOriginalConstructor() ->getMockForAbstractClass(); @@ -203,7 +223,8 @@ protected function setUp(): void [ 'context' => $contextMock, 'resultPageFactory' => $this->resultPageFactoryMock, - 'resultForwardFactory' => $this->resultForwardFactoryMock + 'resultForwardFactory' => $this->resultForwardFactoryMock, + 'resultRedirectFactory' => $this->resultRedirectFactoryMock ] ); @@ -287,16 +308,32 @@ public function testExecuteNoInvoice() ->method('get') ->willReturn(null); - $resultForward = $this->getMockBuilder(Forward::class) - ->disableOriginalConstructor() - ->setMethods([]) - ->getMock(); - $resultForward->expects($this->once())->method('forward')->with(('noroute'))->willReturnSelf(); + $this->prepareRedirect(); + $this->setPath('sales/invoice'); + $this->assertInstanceOf( + Redirect::class, + $this->controller->execute() + ); + } - $this->resultForwardFactoryMock->expects($this->once()) + /** + * prepareRedirect + */ + protected function prepareRedirect() + { + $this->resultRedirectFactoryMock->expects($this->once()) ->method('create') - ->willReturn($resultForward); + ->willReturn($this->resultRedirectMock); + } - $this->assertSame($resultForward, $this->controller->execute()); + /** + * @param string $path + * @param array $params + */ + protected function setPath($path, $params = []) + { + $this->resultRedirectMock->expects($this->once()) + ->method('setPath') + ->with($path, $params); } } From 4fef4b43473d3ee4dc0fdb4a25cd29724b2bc801 Mon Sep 17 00:00:00 2001 From: Serhii Kovalenko <ganster3012@gmail.com> Date: Thu, 3 Sep 2020 16:09:12 +0300 Subject: [PATCH 025/171] Mview patch update --- .../Framework/Mview/Config/Converter.php | 2 + lib/internal/Magento/Framework/Mview/View.php | 40 +++++++--- .../Mview/View/ChangeLogBatchIterator.php | 78 +++++++++++++++++++ .../View/ChangeLogBatchIteratorInterface.php | 30 +++++++ .../Framework/Mview/View/Changelog.php | 44 ++++++++++- .../Mview/View/ChangelogInterface.php | 5 ++ .../Framework/Mview/View/Subscription.php | 64 ++++++++++++--- .../Magento/Framework/Mview/etc/mview.xsd | 2 + 8 files changed, 239 insertions(+), 26 deletions(-) create mode 100644 lib/internal/Magento/Framework/Mview/View/ChangeLogBatchIterator.php create mode 100644 lib/internal/Magento/Framework/Mview/View/ChangeLogBatchIteratorInterface.php diff --git a/lib/internal/Magento/Framework/Mview/Config/Converter.php b/lib/internal/Magento/Framework/Mview/Config/Converter.php index 5c33ac150d00a..9cfa84483571c 100644 --- a/lib/internal/Magento/Framework/Mview/Config/Converter.php +++ b/lib/internal/Magento/Framework/Mview/Config/Converter.php @@ -28,6 +28,8 @@ public function convert($source) $data['view_id'] = $viewId; $data['action_class'] = $this->getAttributeValue($viewNode, 'class'); $data['group'] = $this->getAttributeValue($viewNode, 'group'); + $data['store_scope'] = $this->getAttributeValue($viewNode, 'store_scope'); + $data['attribute_scope'] = $this->getAttributeValue($viewNode, 'attribute_scope'); $data['subscriptions'] = []; /** @var $childNode \DOMNode */ diff --git a/lib/internal/Magento/Framework/Mview/View.php b/lib/internal/Magento/Framework/Mview/View.php index dade475a20482..98d54044c3b8f 100644 --- a/lib/internal/Magento/Framework/Mview/View.php +++ b/lib/internal/Magento/Framework/Mview/View.php @@ -10,6 +10,7 @@ use InvalidArgumentException; use Magento\Framework\DataObject; +use Magento\Framework\Mview\View\ChangeLogBatchIteratorInterface; use Magento\Framework\Mview\View\ChangelogTableNotExistsException; use Magento\Framework\Mview\View\SubscriptionFactory; use Exception; @@ -67,6 +68,11 @@ class View extends DataObject implements ViewInterface */ private $changelogBatchSize; + /** + * @var ChangeLogBatchIteratorInterface[] + */ + private $strategies; + /** * @param ConfigInterface $config * @param ActionFactory $actionFactory @@ -75,6 +81,7 @@ class View extends DataObject implements ViewInterface * @param SubscriptionFactory $subscriptionFactory * @param array $data * @param array $changelogBatchSize + * @param array $strategies */ public function __construct( ConfigInterface $config, @@ -83,7 +90,8 @@ public function __construct( View\ChangelogInterface $changelog, SubscriptionFactory $subscriptionFactory, array $data = [], - array $changelogBatchSize = [] + array $changelogBatchSize = [], + array $strategies = [] ) { $this->config = $config; $this->actionFactory = $actionFactory; @@ -92,6 +100,7 @@ public function __construct( $this->subscriptionFactory = $subscriptionFactory; $this->changelogBatchSize = $changelogBatchSize; parent::__construct($data); + $this->strategies = $strategies; } /** @@ -196,7 +205,7 @@ public function load($viewId) */ public function subscribe() { - if ($this->getState()->getMode() !== View\StateInterface::MODE_ENABLED) { + //if ($this->getState()->getMode() !== View\StateInterface::MODE_ENABLED) { // Create changelog table $this->getChangelog()->create(); @@ -206,7 +215,7 @@ public function subscribe() // Update view state $this->getState()->setMode(View\StateInterface::MODE_ENABLED)->save(); - } + // } return $this; } @@ -240,7 +249,7 @@ public function unsubscribe() */ public function update() { - if (!$this->isIdle() || !$this->isEnabled()) { + if (!$this->isEnabled()) { return; } @@ -256,7 +265,7 @@ public function update() try { $this->getState()->setStatus(View\StateInterface::STATUS_WORKING)->save(); - $this->executeAction($action, $lastVersionId, $currentVersionId); + $this->executeAction($action, 0, 1); $this->getState()->loadByView($this->getId()); $statusToRestore = $this->getState()->getStatus() === View\StateInterface::STATUS_SUSPENDED @@ -297,13 +306,24 @@ private function executeAction(ActionInterface $action, int $lastVersionId, int $vsFrom = $lastVersionId; while ($vsFrom < $currentVersionId) { - $ids = $this->getBatchOfIds($vsFrom, $currentVersionId); - // We run the actual indexer in batches. - // Chunked AFTER loading to avoid duplicates in separate chunks. - $chunks = array_chunk($ids, $batchSize); - foreach ($chunks as $ids) { + if (isset($this->strategies[$this->changelog->getViewId()])) { + $changelogData = [ + 'name' => $this->changelog->getName(), + 'column_name' => $this->changelog->getColumnName(), + 'view_id' => $this->changelog->getViewId() + ]; + $ids = $this->strategies[$this->changelog->getViewId()]->walk($changelogData, $vsFrom, $batchSize); $action->execute($ids); + } else { + $ids = $this->getBatchOfIds($vsFrom, $currentVersionId); + // We run the actual indexer in batches. + // Chunked AFTER loading to avoid duplicates in separate chunks. + $chunks = array_chunk($ids, $batchSize); + foreach ($chunks as $ids) { + $action->execute($ids); + } } + } } diff --git a/lib/internal/Magento/Framework/Mview/View/ChangeLogBatchIterator.php b/lib/internal/Magento/Framework/Mview/View/ChangeLogBatchIterator.php new file mode 100644 index 0000000000000..bc4aff56b941d --- /dev/null +++ b/lib/internal/Magento/Framework/Mview/View/ChangeLogBatchIterator.php @@ -0,0 +1,78 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +namespace Magento\Framework\Mview\View; + +use Magento\Framework\App\ResourceConnection; +use Magento\Framework\DB\Sql\Expression; +use Magento\Framework\Mview\Config; +use Magento\Framework\Phrase; + +/** + * Interface \Magento\Framework\Mview\View\ChangeLogBatchIterator + * + */ +class ChangeLogBatchIterator implements ChangeLogBatchIteratorInterface +{ + /** + * @var ResourceConnection + */ + private $resourceConnection; + + /** + * @var Config + */ + private $mviewConfig; + + /** + * ChangeLogBatchIterator constructor. + * @param ResourceConnection $resourceConnection + * @param Config $mviewConfig + */ + public function __construct( + ResourceConnection $resourceConnection, + Config $mviewConfig + ) { + $this->resourceConnection = $resourceConnection; + $this->mviewConfig = $mviewConfig; + } + + /** + * Walk through batches + * + * @param array $changeLogData + * @param $fromVersionId + * @param int $batchSize + * @return mixed + * @throws ChangelogTableNotExistsException + */ + public function walk(array $changeLogData, $fromVersionId, int $batchSize) + { + $configuration = $this->mviewConfig->getView($changeLogData['view_id']); + $connection = $this->resourceConnection->getConnection(); + $changelogTableName = $this->resourceConnection->getTableName($changeLogData['name']); + if (!$connection->isTableExists($changelogTableName)) { + throw new ChangelogTableNotExistsException(new Phrase("Table %1 does not exist", [$changelogTableName])); + } + $columns = [$changeLogData['column_name']]; + $select = $connection->select()->distinct(true) + ->where( + 'version_id > ?', + (int)$fromVersionId + ) + ->group([$changeLogData['column_name'], 'store_id']) + ->limit($batchSize); + + $columns = [ + $changeLogData['column_name'], + 'attribute_ids' => new Expression('GROUP_CONCAT(attribute_id)'), + 'store_id' + ]; + + $select->from($changelogTableName, $columns); + return $connection->fetchAll($select); + } +} diff --git a/lib/internal/Magento/Framework/Mview/View/ChangeLogBatchIteratorInterface.php b/lib/internal/Magento/Framework/Mview/View/ChangeLogBatchIteratorInterface.php new file mode 100644 index 0000000000000..ec225a24c2963 --- /dev/null +++ b/lib/internal/Magento/Framework/Mview/View/ChangeLogBatchIteratorInterface.php @@ -0,0 +1,30 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +namespace Magento\Framework\Mview\View; + +use Magento\Framework\App\ResourceConnection; +use Magento\Framework\DB\Sql\Expression; +use Magento\Framework\Mview\Config; +use Magento\Framework\Phrase; + +/** + * Interface \Magento\Framework\Mview\View\ChangeLogBatchIteratorInterface + * + */ +interface ChangeLogBatchIteratorInterface +{ + /** + * Walk through batches + * + * @param array $changeLogData + * @param $fromVersionId + * @param int $batchSize + * @return mixed + * @throws ChangelogTableNotExistsException + */ + public function walk(array $changeLogData, $fromVersionId, int $batchSize); +} diff --git a/lib/internal/Magento/Framework/Mview/View/Changelog.php b/lib/internal/Magento/Framework/Mview/View/Changelog.php index ce88a88556fe0..88ca9cd162c67 100644 --- a/lib/internal/Magento/Framework/Mview/View/Changelog.php +++ b/lib/internal/Magento/Framework/Mview/View/Changelog.php @@ -7,7 +7,9 @@ namespace Magento\Framework\Mview\View; use Magento\Framework\DB\Adapter\ConnectionException; +use Magento\Framework\DB\Sql\Expression; use Magento\Framework\Exception\RuntimeException; +use Magento\Framework\Mview\Config; use Magento\Framework\Phrase; /** @@ -25,6 +27,11 @@ class Changelog implements ChangelogInterface */ const COLUMN_NAME = 'entity_id'; + /** + * Version ID column name + */ + const VERSION_ID_COLUMN_NAME = 'version_id'; + /** * Database connection * @@ -44,15 +51,24 @@ class Changelog implements ChangelogInterface */ protected $resource; + /** + * @var Config + */ + private $mviewConfig; + /** * @param \Magento\Framework\App\ResourceConnection $resource + * @param Config $mviewConfig * @throws ConnectionException */ - public function __construct(\Magento\Framework\App\ResourceConnection $resource) - { + public function __construct( + \Magento\Framework\App\ResourceConnection $resource, + Config $mviewConfig + ) { $this->connection = $resource->getConnection(); $this->resource = $resource; $this->checkConnection(); + $this->mviewConfig = $mviewConfig; } /** @@ -78,12 +94,13 @@ protected function checkConnection() */ public function create() { + $config = $this->mviewConfig->getView($this->getViewId()); $changelogTableName = $this->resource->getTableName($this->getName()); if (!$this->connection->isTableExists($changelogTableName)) { $table = $this->connection->newTable( $changelogTableName )->addColumn( - 'version_id', + self::VERSION_ID_COLUMN_NAME, \Magento\Framework\DB\Ddl\Table::TYPE_INTEGER, null, ['identity' => true, 'unsigned' => true, 'nullable' => false, 'primary' => true], @@ -95,6 +112,25 @@ public function create() ['unsigned' => true, 'nullable' => false, 'default' => '0'], 'Entity ID' ); + if ($config[self::ATTRIBUTE_SCOPE_SUPPORT]) { + $table->addColumn( + self::ATTRIBUTE_COLUMN, + \Magento\Framework\DB\Ddl\Table::TYPE_INTEGER, + null, + ['unsigned' => true, 'nullable' => false, 'default' => '0'], + 'Attribute ID' + ); + } + if ($config[self::STORE_SCOPE_SUPPORT]) { + $table->addColumn( + self::STORE_COLUMN, + \Magento\Framework\DB\Ddl\Table::TYPE_INTEGER, + null, + ['unsigned' => true, 'nullable' => false, 'default' => '0'], + 'Store ID' + ); + } + $this->connection->createTable($table); } } @@ -139,7 +175,7 @@ public function clear($versionId) * * @param int $fromVersionId * @param int $toVersionId - * @return int[] + * @return array * @throws ChangelogTableNotExistsException */ public function getList($fromVersionId, $toVersionId) diff --git a/lib/internal/Magento/Framework/Mview/View/ChangelogInterface.php b/lib/internal/Magento/Framework/Mview/View/ChangelogInterface.php index b00c1ca3a2e33..79f998cbe02b6 100644 --- a/lib/internal/Magento/Framework/Mview/View/ChangelogInterface.php +++ b/lib/internal/Magento/Framework/Mview/View/ChangelogInterface.php @@ -11,6 +11,11 @@ */ interface ChangelogInterface { + const ATTRIBUTE_SCOPE_SUPPORT = 'attribute_scope'; + const STORE_SCOPE_SUPPORT = 'store_scope'; + const ATTRIBUTE_COLUMN = 'attribute_id'; + const STORE_COLUMN = 'store_id'; + /** * Create changelog table * diff --git a/lib/internal/Magento/Framework/Mview/View/Subscription.php b/lib/internal/Magento/Framework/Mview/View/Subscription.php index ddfa39f0a089f..2b94b9c26a21d 100644 --- a/lib/internal/Magento/Framework/Mview/View/Subscription.php +++ b/lib/internal/Magento/Framework/Mview/View/Subscription.php @@ -6,8 +6,10 @@ namespace Magento\Framework\Mview\View; +use Magento\Framework\App\ObjectManager; use Magento\Framework\App\ResourceConnection; use Magento\Framework\DB\Ddl\Trigger; +use Magento\Framework\Mview\Config; use Magento\Framework\Mview\View\StateInterface; /** @@ -68,12 +70,17 @@ class Subscription implements SubscriptionInterface * @var Resource */ protected $resource; + /** + * @var Config + */ + private $mviewConfig; /** * @param ResourceConnection $resource * @param \Magento\Framework\DB\Ddl\TriggerFactory $triggerFactory * @param \Magento\Framework\Mview\View\CollectionInterface $viewCollection * @param \Magento\Framework\Mview\ViewInterface $view + * @param Config $mviewConfig * @param string $tableName * @param string $columnName * @param array $ignoredUpdateColumns @@ -85,7 +92,8 @@ public function __construct( \Magento\Framework\Mview\ViewInterface $view, $tableName, $columnName, - $ignoredUpdateColumns = [] + $ignoredUpdateColumns = [], + Config $mviewConfig = null ) { $this->connection = $resource->getConnection(); $this->triggerFactory = $triggerFactory; @@ -95,6 +103,7 @@ public function __construct( $this->columnName = $columnName; $this->resource = $resource; $this->ignoredUpdateColumns = $ignoredUpdateColumns; + $this->mviewConfig = $mviewConfig ?? ObjectManager::getInstance()->get(Config::class); } /** @@ -198,13 +207,10 @@ protected function getLinkedViews() */ protected function buildStatement($event, $changelog) { + $trigger = "INSERT IGNORE INTO %s (%s) VALUES (%s);"; switch ($event) { - case Trigger::EVENT_INSERT: - $trigger = "INSERT IGNORE INTO %s (%s) VALUES (NEW.%s);"; - break; case Trigger::EVENT_UPDATE: $tableName = $this->resource->getTableName($this->getTableName()); - $trigger = "INSERT IGNORE INTO %s (%s) VALUES (NEW.%s);"; if ($this->connection->isTableExists($tableName) && $describe = $this->connection->describeTable($tableName) ) { @@ -226,20 +232,54 @@ protected function buildStatement($event, $changelog) } } break; - case Trigger::EVENT_DELETE: - $trigger = "INSERT IGNORE INTO %s (%s) VALUES (OLD.%s);"; - break; - default: - return ''; } + list($columnNames, $columnValues) = $this->prepareTriggerBody($changelog, $event); return sprintf( $trigger, $this->connection->quoteIdentifier($this->resource->getTableName($changelog->getName())), - $this->connection->quoteIdentifier($changelog->getColumnName()), - $this->connection->quoteIdentifier($this->getColumnName()) + $columnNames, + $columnValues ); } + /** + * Prepare column names and column values for trigger body + * + * @param ChangelogInterface $changelog + * @param string $eventType + * @return array + */ + public function prepareTriggerBody(ChangelogInterface $changelog, string $eventType) + { + $prefix = $eventType === Trigger::EVENT_DELETE ? 'OLD.' : 'NEW.'; + $describedSubscribedColumns = array_column( + $this->connection->describeTable($this->getTableName()), + 'COLUMN_NAME' + ); + $viewConfig = $this->mviewConfig->getView($this->getView()->getId()); + $columnNames = [$this->connection->quoteIdentifier($changelog->getColumnName())]; + $columnValues = [$this->connection->quoteIdentifier($this->getColumnName())]; + //If we need to add attributes + if ($viewConfig[ChangelogInterface::ATTRIBUTE_SCOPE_SUPPORT] && + array_search(Changelog::ATTRIBUTE_COLUMN, $describedSubscribedColumns) + ) { + $columnValues[] = $prefix . $this->connection->quoteIdentifier(Changelog::ATTRIBUTE_COLUMN); + $columnNames[] = $this->connection->quoteIdentifier(Changelog::ATTRIBUTE_COLUMN); + } + //If we need to add stores + if ($viewConfig[ChangelogInterface::STORE_SCOPE_SUPPORT] && + array_search(Changelog::STORE_COLUMN, $describedSubscribedColumns) + ) { + $columnValues[] = $prefix . $this->connection->quoteIdentifier(Changelog::STORE_COLUMN); + $columnNames[] = $this->connection->quoteIdentifier(Changelog::STORE_COLUMN); + } + + return [ + implode(",", $columnNames), + implode(",", $columnValues) + ]; + } + /** * Build an "after" event for the given table and event * diff --git a/lib/internal/Magento/Framework/Mview/etc/mview.xsd b/lib/internal/Magento/Framework/Mview/etc/mview.xsd index dfff4964f6587..5b264efdf5445 100644 --- a/lib/internal/Magento/Framework/Mview/etc/mview.xsd +++ b/lib/internal/Magento/Framework/Mview/etc/mview.xsd @@ -46,6 +46,8 @@ <xs:attribute name="id" type="xs:string" use="required" /> <xs:attribute name="class" type="classType" use="required" /> <xs:attribute name="group" type="xs:string" use="required" /> + <xs:attribute name="store_scope" type="xs:boolean" use="optional" /> + <xs:attribute name="attribute_scope" type="xs:boolean" use="optional" /> </xs:complexType> <xs:simpleType name="classType"> From 0d18cce39964a8c4bda4a8cd71ddcee44d8fdcba Mon Sep 17 00:00:00 2001 From: Serhii Kovalenko <ganster3012@gmail.com> Date: Thu, 3 Sep 2020 16:16:11 +0300 Subject: [PATCH 026/171] Mview patch update --- lib/internal/Magento/Framework/Mview/View.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/internal/Magento/Framework/Mview/View.php b/lib/internal/Magento/Framework/Mview/View.php index 98d54044c3b8f..bc795915e6f7d 100644 --- a/lib/internal/Magento/Framework/Mview/View.php +++ b/lib/internal/Magento/Framework/Mview/View.php @@ -205,7 +205,7 @@ public function load($viewId) */ public function subscribe() { - //if ($this->getState()->getMode() !== View\StateInterface::MODE_ENABLED) { + if ($this->getState()->getMode() !== View\StateInterface::MODE_ENABLED) { // Create changelog table $this->getChangelog()->create(); @@ -215,7 +215,7 @@ public function subscribe() // Update view state $this->getState()->setMode(View\StateInterface::MODE_ENABLED)->save(); - // } + } return $this; } From dcc2ca25d847ae84af46a362cadfe3c4ae62eccc Mon Sep 17 00:00:00 2001 From: Serhii Kovalenko <ganster3012@gmail.com> Date: Thu, 3 Sep 2020 16:18:34 +0300 Subject: [PATCH 027/171] Mview patch update --- lib/internal/Magento/Framework/Mview/View.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/internal/Magento/Framework/Mview/View.php b/lib/internal/Magento/Framework/Mview/View.php index bc795915e6f7d..999c8c187735b 100644 --- a/lib/internal/Magento/Framework/Mview/View.php +++ b/lib/internal/Magento/Framework/Mview/View.php @@ -249,7 +249,7 @@ public function unsubscribe() */ public function update() { - if (!$this->isEnabled()) { + if (!$this->isIdle() || !$this->isEnabled()) { return; } From a77c41ced019ec483b21faa3267186ce2cecd5de Mon Sep 17 00:00:00 2001 From: Serhii Kovalenko <ganster3012@gmail.com> Date: Thu, 3 Sep 2020 16:20:17 +0300 Subject: [PATCH 028/171] Mview patch update --- lib/internal/Magento/Framework/Mview/View.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/internal/Magento/Framework/Mview/View.php b/lib/internal/Magento/Framework/Mview/View.php index 999c8c187735b..3cd5f9b28bcaf 100644 --- a/lib/internal/Magento/Framework/Mview/View.php +++ b/lib/internal/Magento/Framework/Mview/View.php @@ -265,7 +265,7 @@ public function update() try { $this->getState()->setStatus(View\StateInterface::STATUS_WORKING)->save(); - $this->executeAction($action, 0, 1); + $this->executeAction($action, $lastVersionId, $currentVersionId); $this->getState()->loadByView($this->getId()); $statusToRestore = $this->getState()->getStatus() === View\StateInterface::STATUS_SUSPENDED From 6071c5a5caadf2f146395dde679f4a51cd0d5174 Mon Sep 17 00:00:00 2001 From: Serhii Kovalenko <ganster3012@gmail.com> Date: Tue, 8 Sep 2020 17:24:07 +0300 Subject: [PATCH 029/171] Mview patch update --- lib/internal/Magento/Framework/Mview/View.php | 1 + .../Framework/Mview/View/Changelog.php | 4 ++-- .../Framework/Mview/View/Subscription.php | 22 ++++++++++++++++--- 3 files changed, 22 insertions(+), 5 deletions(-) diff --git a/lib/internal/Magento/Framework/Mview/View.php b/lib/internal/Magento/Framework/Mview/View.php index 3cd5f9b28bcaf..1ad70aa2c33d3 100644 --- a/lib/internal/Magento/Framework/Mview/View.php +++ b/lib/internal/Magento/Framework/Mview/View.php @@ -313,6 +313,7 @@ private function executeAction(ActionInterface $action, int $lastVersionId, int 'view_id' => $this->changelog->getViewId() ]; $ids = $this->strategies[$this->changelog->getViewId()]->walk($changelogData, $vsFrom, $batchSize); + $vsFrom += $batchSize; $action->execute($ids); } else { $ids = $this->getBatchOfIds($vsFrom, $currentVersionId); diff --git a/lib/internal/Magento/Framework/Mview/View/Changelog.php b/lib/internal/Magento/Framework/Mview/View/Changelog.php index 88ca9cd162c67..2ade739d3197c 100644 --- a/lib/internal/Magento/Framework/Mview/View/Changelog.php +++ b/lib/internal/Magento/Framework/Mview/View/Changelog.php @@ -117,7 +117,7 @@ public function create() self::ATTRIBUTE_COLUMN, \Magento\Framework\DB\Ddl\Table::TYPE_INTEGER, null, - ['unsigned' => true, 'nullable' => false, 'default' => '0'], + ['unsigned' => true, 'nullable' => true], 'Attribute ID' ); } @@ -126,7 +126,7 @@ public function create() self::STORE_COLUMN, \Magento\Framework\DB\Ddl\Table::TYPE_INTEGER, null, - ['unsigned' => true, 'nullable' => false, 'default' => '0'], + ['unsigned' => true, 'nullable' => true], 'Store ID' ); } diff --git a/lib/internal/Magento/Framework/Mview/View/Subscription.php b/lib/internal/Magento/Framework/Mview/View/Subscription.php index 2b94b9c26a21d..460db5260f008 100644 --- a/lib/internal/Magento/Framework/Mview/View/Subscription.php +++ b/lib/internal/Magento/Framework/Mview/View/Subscription.php @@ -242,6 +242,15 @@ protected function buildStatement($event, $changelog) ); } + /** + * @param string $prefix + * @return string + */ + public function getEntityColumn(string $prefix): string + { + return $prefix . $this->connection->quoteIdentifier($this->getColumnName()); + } + /** * Prepare column names and column values for trigger body * @@ -256,19 +265,26 @@ public function prepareTriggerBody(ChangelogInterface $changelog, string $eventT $this->connection->describeTable($this->getTableName()), 'COLUMN_NAME' ); + $describedClColumns = array_column( + $this->connection->describeTable($changelog->getName()), + 'COLUMN_NAME' + ); $viewConfig = $this->mviewConfig->getView($this->getView()->getId()); $columnNames = [$this->connection->quoteIdentifier($changelog->getColumnName())]; - $columnValues = [$this->connection->quoteIdentifier($this->getColumnName())]; + $columnValues = [$this->getEntityColumn($prefix)]; //If we need to add attributes if ($viewConfig[ChangelogInterface::ATTRIBUTE_SCOPE_SUPPORT] && - array_search(Changelog::ATTRIBUTE_COLUMN, $describedSubscribedColumns) + array_search(Changelog::ATTRIBUTE_COLUMN, $describedSubscribedColumns) && + array_search(Changelog::ATTRIBUTE_COLUMN, $describedClColumns) + ) { $columnValues[] = $prefix . $this->connection->quoteIdentifier(Changelog::ATTRIBUTE_COLUMN); $columnNames[] = $this->connection->quoteIdentifier(Changelog::ATTRIBUTE_COLUMN); } //If we need to add stores if ($viewConfig[ChangelogInterface::STORE_SCOPE_SUPPORT] && - array_search(Changelog::STORE_COLUMN, $describedSubscribedColumns) + array_search(Changelog::STORE_COLUMN, $describedSubscribedColumns) && + array_search(Changelog::STORE_COLUMN, $describedClColumns) ) { $columnValues[] = $prefix . $this->connection->quoteIdentifier(Changelog::STORE_COLUMN); $columnNames[] = $this->connection->quoteIdentifier(Changelog::STORE_COLUMN); From 0e66e6cb6c58882704d39643b230966d8c0e7407 Mon Sep 17 00:00:00 2001 From: Serhii Kovalenko <ganster3012@gmail.com> Date: Fri, 11 Sep 2020 18:00:05 +0300 Subject: [PATCH 030/171] Mview patch update -- move framework logic to saas-export --- lib/internal/Magento/Framework/Mview/View/Changelog.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/internal/Magento/Framework/Mview/View/Changelog.php b/lib/internal/Magento/Framework/Mview/View/Changelog.php index 2ade739d3197c..bbfb47807d4d6 100644 --- a/lib/internal/Magento/Framework/Mview/View/Changelog.php +++ b/lib/internal/Magento/Framework/Mview/View/Changelog.php @@ -112,7 +112,8 @@ public function create() ['unsigned' => true, 'nullable' => false, 'default' => '0'], 'Entity ID' ); - if ($config[self::ATTRIBUTE_SCOPE_SUPPORT]) { + + if ($config && $config[self::ATTRIBUTE_SCOPE_SUPPORT]) { $table->addColumn( self::ATTRIBUTE_COLUMN, \Magento\Framework\DB\Ddl\Table::TYPE_INTEGER, @@ -121,7 +122,7 @@ public function create() 'Attribute ID' ); } - if ($config[self::STORE_SCOPE_SUPPORT]) { + if ($config && $config[self::STORE_SCOPE_SUPPORT]) { $table->addColumn( self::STORE_COLUMN, \Magento\Framework\DB\Ddl\Table::TYPE_INTEGER, From c5d8fc649a007ba2aeb359c70ceabf3947f4124b Mon Sep 17 00:00:00 2001 From: Serhii Kovalenko <ganster3012@gmail.com> Date: Wed, 16 Sep 2020 15:31:14 +0300 Subject: [PATCH 031/171] Mview patch update -- move framework logic to saas-export --- .../Magento/Eav/Model/Mview/BatchIterator.php | 67 +++++++++++++ .../Framework/Mview/Config/Converter.php | 30 +++++- .../Mview/Test/Unit/View/ChangelogTest.php | 22 ++++- .../Mview/Test/Unit/View/SubscriptionTest.php | 37 +++++--- lib/internal/Magento/Framework/Mview/View.php | 66 +++++-------- .../AdditionalColumnProcessorInterface.php | 39 ++++++++ .../DefaultProcessor.php | 73 +++++++++++++++ .../Mview/View/ChangeLogBatchIterator.php | 44 +++------ .../View/ChangeLogBatchIteratorInterface.php | 8 +- .../Framework/Mview/View/Changelog.php | 47 ++++++---- .../Framework/Mview/View/Subscription.php | 93 +++++++++---------- .../Magento/Framework/Mview/etc/mview.xsd | 18 +++- 12 files changed, 381 insertions(+), 163 deletions(-) create mode 100644 app/code/Magento/Eav/Model/Mview/BatchIterator.php create mode 100644 lib/internal/Magento/Framework/Mview/View/AdditionalColumnProcessorInterface.php create mode 100644 lib/internal/Magento/Framework/Mview/View/AdditionalColumnsProcessors/DefaultProcessor.php diff --git a/app/code/Magento/Eav/Model/Mview/BatchIterator.php b/app/code/Magento/Eav/Model/Mview/BatchIterator.php new file mode 100644 index 0000000000000..b7dd69abd45ff --- /dev/null +++ b/app/code/Magento/Eav/Model/Mview/BatchIterator.php @@ -0,0 +1,67 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +namespace Magento\Eav\Mview; + +use Magento\Framework\App\ResourceConnection; +use Magento\Framework\DB\Sql\Expression; +use Magento\Framework\Mview\View\ChangeLogBatchIteratorInterface; +use Magento\Framework\Mview\View\ChangelogInterface; +use Magento\Framework\Mview\View\ChangelogTableNotExistsException; +use Magento\Framework\Phrase; + +/** + * Class BatchIterator + */ +class BatchIterator implements ChangeLogBatchIteratorInterface +{ + /** + * @var ResourceConnection + */ + private $resourceConnection; + + /** + * @param ResourceConnection $resourceConnection + */ + public function __construct( + ResourceConnection $resourceConnection + ) { + $this->resourceConnection = $resourceConnection; + } + + /** + * @inheritdoc + */ + public function walk(ChangelogInterface $changelog, int $fromVersionId, int $toVersion, int $batchSize) + { + $connection = $this->resourceConnection->getConnection(); + if (!$connection->isTableExists($changelog->getName())) { + throw new ChangelogTableNotExistsException( + new Phrase("Table %1 does not exist", [$changelog->getName()]) + ); + } + $select = $connection->select()->distinct(true) + ->where( + 'version_id > ?', + (int)$fromVersionId + ) + ->where( + 'version_id <= ?', + $toVersion + ) + ->group([$changelog->getColumnName(), 'store_id']) + ->limit($batchSize); + + $columns = [ + $changelog->getColumnName(), + 'attribute_ids' => new Expression('GROUP_CONCAT(attribute_id)'), + 'store_id' + ]; + + $select->from($changelog->getName(), $columns); + return $connection->fetchAll($select); + } +} diff --git a/lib/internal/Magento/Framework/Mview/Config/Converter.php b/lib/internal/Magento/Framework/Mview/Config/Converter.php index 9cfa84483571c..2737f8db84b7c 100644 --- a/lib/internal/Magento/Framework/Mview/Config/Converter.php +++ b/lib/internal/Magento/Framework/Mview/Config/Converter.php @@ -29,7 +29,7 @@ public function convert($source) $data['action_class'] = $this->getAttributeValue($viewNode, 'class'); $data['group'] = $this->getAttributeValue($viewNode, 'group'); $data['store_scope'] = $this->getAttributeValue($viewNode, 'store_scope'); - $data['attribute_scope'] = $this->getAttributeValue($viewNode, 'attribute_scope'); + $data['iterator'] = $this->getAttributeValue($viewNode, 'iterator'); $data['subscriptions'] = []; /** @var $childNode \DOMNode */ @@ -78,6 +78,7 @@ protected function convertChild(\DOMNode $childNode, $data) $name = $this->getAttributeValue($subscription, 'name'); $column = $this->getAttributeValue($subscription, 'entity_column'); $subscriptionModel = $this->getAttributeValue($subscription, 'subscription_model'); + if (!empty($subscriptionModel) && !in_array( SubscriptionInterface::class, @@ -91,11 +92,36 @@ class_implements(ltrim($subscriptionModel, '\\')) $data['subscriptions'][$name] = [ 'name' => $name, 'column' => $column, - 'subscription_model' => $subscriptionModel + 'subscription_model' => $subscriptionModel, + 'additional_columns' => $this->getAdditionalColumns($subscription), + 'processor' => $this->getAttributeValue($subscription, 'processor') ]; } break; } return $data; } + + /** + * Retrieve additional columns of subscription table + * + * @param \DOMNode $subscription + * @return array + */ + private function getAdditionalColumns(\DOMNode $subscription): array + { + $additionalColumns = []; + foreach ($subscription->childNodes as $childNode) { + if ($childNode->nodeType != XML_ELEMENT_NODE || $childNode->nodeName != 'additionalColumns') { + continue; + } + + $additionalColumns[] = [ + 'name' => $this->getAttributeValue($childNode, 'name'), + 'cl_name' => $this->getAttributeValue($childNode, 'cl_name'), + ]; + } + + return $additionalColumns; + } } diff --git a/lib/internal/Magento/Framework/Mview/Test/Unit/View/ChangelogTest.php b/lib/internal/Magento/Framework/Mview/Test/Unit/View/ChangelogTest.php index 0a4e8a3840749..2642bf20bc6d6 100644 --- a/lib/internal/Magento/Framework/Mview/Test/Unit/View/ChangelogTest.php +++ b/lib/internal/Magento/Framework/Mview/Test/Unit/View/ChangelogTest.php @@ -11,6 +11,7 @@ use Magento\Framework\DB\Adapter\Pdo\Mysql; use Magento\Framework\DB\Ddl\Table; use Magento\Framework\DB\Select; +use Magento\Framework\Mview\Config; use Magento\Framework\Mview\View\Changelog; use Magento\Framework\Mview\View\ChangelogInterface; use PHPUnit\Framework\MockObject\MockObject; @@ -46,7 +47,22 @@ protected function setUp(): void $this->resourceMock = $this->createMock(ResourceConnection::class); $this->mockGetConnection($this->connectionMock); - $this->model = new Changelog($this->resourceMock); + $this->model = new Changelog($this->resourceMock, $this->getMviewConfigMock()); + } + + /** + * @return Config|MockObject + */ + private function getMviewConfigMock() + { + $mviewConfigMock = $this->createMock(Config::class); + $mviewConfigMock->expects($this->any()) + ->method('getView') + ->willReturn([ + 'attribute_scope' => false, + 'store_scope' => false + ]); + return $mviewConfigMock; } public function testInstanceOf() @@ -54,7 +70,7 @@ public function testInstanceOf() $resourceMock = $this->createMock(ResourceConnection::class); $resourceMock->expects($this->once())->method('getConnection')->willReturn(true); - $model = new Changelog($resourceMock); + $model = new Changelog($resourceMock, $this->getMviewConfigMock()); $this->assertInstanceOf(ChangelogInterface::class, $model); } @@ -65,7 +81,7 @@ public function testCheckConnectionException() $resourceMock = $this->createMock(ResourceConnection::class); $resourceMock->expects($this->once())->method('getConnection')->willReturn(null); - $model = new Changelog($resourceMock); + $model = new Changelog($resourceMock, $this->getMviewConfigMock()); $model->setViewId('ViewIdTest'); $this->assertNull($model); } diff --git a/lib/internal/Magento/Framework/Mview/Test/Unit/View/SubscriptionTest.php b/lib/internal/Magento/Framework/Mview/Test/Unit/View/SubscriptionTest.php index b91c0b525390f..559309c10c27c 100644 --- a/lib/internal/Magento/Framework/Mview/Test/Unit/View/SubscriptionTest.php +++ b/lib/internal/Magento/Framework/Mview/Test/Unit/View/SubscriptionTest.php @@ -11,6 +11,7 @@ use Magento\Framework\DB\Adapter\Pdo\Mysql; use Magento\Framework\DB\Ddl\Trigger; use Magento\Framework\DB\Ddl\TriggerFactory; +use Magento\Framework\Mview\Config; use Magento\Framework\Mview\View\ChangelogInterface; use Magento\Framework\Mview\View\CollectionInterface; use Magento\Framework\Mview\View\StateInterface; @@ -55,6 +56,10 @@ protected function setUp(): void ->method('quoteIdentifier') ->willReturnArgument(0); + $this->connectionMock->expects($this->any()) + ->method('describeTable') + ->willReturn([]); + $this->resourceMock->expects($this->atLeastOnce()) ->method('getConnection') ->willReturn($this->connectionMock); @@ -78,18 +83,29 @@ protected function setUp(): void true, [] ); - + $this->viewMock->expects($this->any()) + ->method('getId') + ->willReturn(1); $this->resourceMock->expects($this->any()) ->method('getTableName') ->willReturnArgument(0); - + $mviewConfigMock = $this->createMock(Config::class); + $mviewConfigMock->expects($this->any()) + ->method('getView') + ->willReturn([ + 'attribute_scope' => false, + 'store_scope' => false + ]); + $this->mviewConfig = $mviewConfigMock; $this->model = new Subscription( $this->resourceMock, $this->triggerFactoryMock, $this->viewCollectionMock, $this->viewMock, $this->tableName, - 'columnName' + 'columnName', + [], + $mviewConfigMock ); } @@ -122,7 +138,7 @@ public function testCreate() $triggerMock->expects($this->exactly(3)) ->method('setName') ->with($triggerName)->willReturnSelf(); - $triggerMock->expects($this->exactly(3)) + $triggerMock->expects($this->any()) ->method('getName') ->willReturn('triggerName'); $triggerMock->expects($this->exactly(3)) @@ -167,7 +183,7 @@ public function testCreate() true, [] ); - $changelogMock->expects($this->exactly(3)) + $changelogMock->expects($this->any()) ->method('getName') ->willReturn('test_view_cl'); $changelogMock->expects($this->exactly(3)) @@ -191,7 +207,7 @@ public function testCreate() true, [] ); - $otherChangelogMock->expects($this->exactly(3)) + $otherChangelogMock->expects($this->any()) ->method('getName') ->willReturn('other_test_view_cl'); $otherChangelogMock->expects($this->exactly(3)) @@ -217,7 +233,7 @@ public function testCreate() ->method('getChangelog') ->willReturn($otherChangelogMock); - $this->viewMock->expects($this->exactly(3)) + $this->viewMock->expects($this->any()) ->method('getId') ->willReturn('this_id'); $this->viewMock->expects($this->never()) @@ -235,7 +251,6 @@ public function testCreate() $this->connectionMock->expects($this->exactly(3)) ->method('createTrigger') ->with($triggerMock); - $this->model->create(); } @@ -244,7 +259,7 @@ public function testRemove() $triggerMock = $this->createMock(Trigger::class); $triggerMock->expects($this->exactly(3)) ->method('setName')->willReturnSelf(); - $triggerMock->expects($this->exactly(3)) + $triggerMock->expects($this->any()) ->method('getName') ->willReturn('triggerName'); $triggerMock->expects($this->exactly(3)) @@ -271,7 +286,7 @@ public function testRemove() true, [] ); - $otherChangelogMock->expects($this->exactly(3)) + $otherChangelogMock->expects($this->any()) ->method('getName') ->willReturn('other_test_view_cl'); $otherChangelogMock->expects($this->exactly(3)) @@ -297,7 +312,7 @@ public function testRemove() ->method('getChangelog') ->willReturn($otherChangelogMock); - $this->viewMock->expects($this->exactly(3)) + $this->viewMock->expects($this->any()) ->method('getId') ->willReturn('this_id'); $this->viewMock->expects($this->never()) diff --git a/lib/internal/Magento/Framework/Mview/View.php b/lib/internal/Magento/Framework/Mview/View.php index 1ad70aa2c33d3..ac80004068236 100644 --- a/lib/internal/Magento/Framework/Mview/View.php +++ b/lib/internal/Magento/Framework/Mview/View.php @@ -9,6 +9,7 @@ namespace Magento\Framework\Mview; use InvalidArgumentException; +use Magento\Framework\App\ObjectManager; use Magento\Framework\DataObject; use Magento\Framework\Mview\View\ChangeLogBatchIteratorInterface; use Magento\Framework\Mview\View\ChangelogTableNotExistsException; @@ -28,11 +29,6 @@ class View extends DataObject implements ViewInterface */ const DEFAULT_BATCH_SIZE = 1000; - /** - * Max versions to load from database at a time - */ - private static $maxVersionQueryBatch = 100000; - /** * @var string */ @@ -306,52 +302,38 @@ private function executeAction(ActionInterface $action, int $lastVersionId, int $vsFrom = $lastVersionId; while ($vsFrom < $currentVersionId) { - if (isset($this->strategies[$this->changelog->getViewId()])) { - $changelogData = [ - 'name' => $this->changelog->getName(), - 'column_name' => $this->changelog->getColumnName(), - 'view_id' => $this->changelog->getViewId() - ]; - $ids = $this->strategies[$this->changelog->getViewId()]->walk($changelogData, $vsFrom, $batchSize); - $vsFrom += $batchSize; - $action->execute($ids); - } else { - $ids = $this->getBatchOfIds($vsFrom, $currentVersionId); - // We run the actual indexer in batches. - // Chunked AFTER loading to avoid duplicates in separate chunks. - $chunks = array_chunk($ids, $batchSize); - foreach ($chunks as $ids) { - $action->execute($ids); - } - } - + $iterator = $this->createIterator(); + $ids = $iterator->walk($this->getChangelog(), $vsFrom, $currentVersionId, $batchSize); + $vsFrom += $batchSize; + $action->execute($ids); } } /** - * Get batch of entity ids + * Create and validate iterator class for changelog * - * @param int $lastVersionId - * @param int $currentVersionId - * @return array + * @return ChangeLogBatchIteratorInterface|mixed + * @throws Exception */ - private function getBatchOfIds(int &$lastVersionId, int $currentVersionId): array + private function createIterator() { - $ids = []; - $versionBatchSize = self::$maxVersionQueryBatch; - $idsBatchSize = self::$maxVersionQueryBatch; - for ($vsFrom = $lastVersionId; $vsFrom < $currentVersionId; $vsFrom += $versionBatchSize) { - // Don't go past the current version for atomicity. - $versionTo = min($currentVersionId, $vsFrom + $versionBatchSize); - /** To avoid duplicate ids need to flip and merge the array */ - $ids += array_flip($this->getChangelog()->getList($vsFrom, $versionTo)); - $lastVersionId = $versionTo; - if (count($ids) >= $idsBatchSize) { - break; - } + $config = $this->config->getView($this->changelog->getViewId()); + $iteratorClass = $config['iterator']; + + if (!class_exists($iteratorClass)) { + throw new \Exception('Iterator class does not exist for view: ' . $this->changelog->getViewId()); + } + + $iterator = ObjectManager::getInstance()->get($iteratorClass); + + if (!$iterator instanceof ChangeLogBatchIteratorInterface) { + throw new \Exception( + 'Iterator does not implement the right interface for view: ' . + $this->changelog->getViewId() + ); } - return array_keys($ids); + return $iterator; } /** diff --git a/lib/internal/Magento/Framework/Mview/View/AdditionalColumnProcessorInterface.php b/lib/internal/Magento/Framework/Mview/View/AdditionalColumnProcessorInterface.php new file mode 100644 index 0000000000000..6a38437c5a848 --- /dev/null +++ b/lib/internal/Magento/Framework/Mview/View/AdditionalColumnProcessorInterface.php @@ -0,0 +1,39 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +namespace Magento\Framework\Mview\View; + +use Magento\Framework\DB\Ddl\Table; +use Magento\Tests\NamingConvention\true\string; + +interface AdditionalColumnProcessorInterface +{ + /** + * Return triggers columns that should participate in trigger creation + * + * @param string $eventPrefix + * @param array $additionalColumns + * @return array + */ + public function getTriggerColumns(string $eventPrefix, array $additionalColumns): array ; + + /** + * Process column for DDL table + * + * @param Table $table + * @param string $columnName + * @return void + */ + public function processColumnForCLTable(Table $table, string $columnName): void ; + + /** + * Retrieve pre-statement for trigger + * For instance DQL + * + * @return string + */ + public function getPreStatements(): string; +} diff --git a/lib/internal/Magento/Framework/Mview/View/AdditionalColumnsProcessors/DefaultProcessor.php b/lib/internal/Magento/Framework/Mview/View/AdditionalColumnsProcessors/DefaultProcessor.php new file mode 100644 index 0000000000000..3733e7a9499b3 --- /dev/null +++ b/lib/internal/Magento/Framework/Mview/View/AdditionalColumnsProcessors/DefaultProcessor.php @@ -0,0 +1,73 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +namespace Magento\Framework\Mview\View\AdditionalColumnsProcessor; + +use Magento\Framework\App\ResourceConnection; +use Magento\Framework\DB\Ddl\Table; +use Magento\Framework\Mview\View\AdditionalColumnProcessorInterface; +use Magento\Tests\NamingConvention\true\string; + +class DefaultProcessor implements AdditionalColumnProcessorInterface +{ + /** + * @var ResourceConnection + */ + private $resourceConnection; + + /** + * @param ResourceConnection $resourceConnection + */ + public function __construct( + ResourceConnection $resourceConnection + ) { + $this->resourceConnection = $resourceConnection; + } + + /** + * @inheritDoc + */ + public function getTriggerColumns(string $eventPrefix, array $additionalColumns): array + { + $resource = $this->resourceConnection->getConnection(); + $triggersColumns = [ + 'column_names' => [], + 'column_values' => [] + ]; + + foreach ($additionalColumns as $additionalColumn) { + $triggersColumns['column_names'][$additionalColumn['name']] = $resource->quoteIdentifier( + $additionalColumn['cl_name'] + ); + $triggersColumns['column_values'][$additionalColumn['name']] = $eventPrefix . + $resource->quoteIdentifier($additionalColumn['name']); + } + + return $triggersColumns; + } + + /** + * @return string + */ + public function getPreStatements(): string + { + return ''; + } + + /** + * @inheritDoc + */ + public function processColumnForCLTable(Table $table, string $columnName): void + { + $table->addColumn( + $columnName, + \Magento\Framework\DB\Ddl\Table::TYPE_INTEGER, + null, + ['unsigned' => true, 'nullable' => false, 'default' => null], + $columnName + ); + } +} diff --git a/lib/internal/Magento/Framework/Mview/View/ChangeLogBatchIterator.php b/lib/internal/Magento/Framework/Mview/View/ChangeLogBatchIterator.php index bc4aff56b941d..9165fc4a0d3cc 100644 --- a/lib/internal/Magento/Framework/Mview/View/ChangeLogBatchIterator.php +++ b/lib/internal/Magento/Framework/Mview/View/ChangeLogBatchIterator.php @@ -8,7 +8,6 @@ use Magento\Framework\App\ResourceConnection; use Magento\Framework\DB\Sql\Expression; -use Magento\Framework\Mview\Config; use Magento\Framework\Phrase; /** @@ -23,56 +22,39 @@ class ChangeLogBatchIterator implements ChangeLogBatchIteratorInterface private $resourceConnection; /** - * @var Config - */ - private $mviewConfig; - - /** - * ChangeLogBatchIterator constructor. * @param ResourceConnection $resourceConnection - * @param Config $mviewConfig */ public function __construct( - ResourceConnection $resourceConnection, - Config $mviewConfig + ResourceConnection $resourceConnection ) { $this->resourceConnection = $resourceConnection; - $this->mviewConfig = $mviewConfig; } /** - * Walk through batches - * - * @param array $changeLogData - * @param $fromVersionId - * @param int $batchSize - * @return mixed - * @throws ChangelogTableNotExistsException + * @inheritdoc */ - public function walk(array $changeLogData, $fromVersionId, int $batchSize) + public function walk(ChangelogInterface $changelog, int $fromVersionId, int $toVersion, int $batchSize) { - $configuration = $this->mviewConfig->getView($changeLogData['view_id']); $connection = $this->resourceConnection->getConnection(); - $changelogTableName = $this->resourceConnection->getTableName($changeLogData['name']); + $changelogTableName = $this->resourceConnection->getTableName($changelog->getName()); + if (!$connection->isTableExists($changelogTableName)) { throw new ChangelogTableNotExistsException(new Phrase("Table %1 does not exist", [$changelogTableName])); } - $columns = [$changeLogData['column_name']]; + $select = $connection->select()->distinct(true) ->where( 'version_id > ?', - (int)$fromVersionId + $fromVersionId + ) + ->where( + 'version_id <= ?', + $toVersion ) - ->group([$changeLogData['column_name'], 'store_id']) + ->group([$changelog->getColumnName()]) ->limit($batchSize); - $columns = [ - $changeLogData['column_name'], - 'attribute_ids' => new Expression('GROUP_CONCAT(attribute_id)'), - 'store_id' - ]; - - $select->from($changelogTableName, $columns); + $select->from($changelogTableName, [$changelog->getColumnName()]); return $connection->fetchAll($select); } } diff --git a/lib/internal/Magento/Framework/Mview/View/ChangeLogBatchIteratorInterface.php b/lib/internal/Magento/Framework/Mview/View/ChangeLogBatchIteratorInterface.php index ec225a24c2963..5e86e0753aec9 100644 --- a/lib/internal/Magento/Framework/Mview/View/ChangeLogBatchIteratorInterface.php +++ b/lib/internal/Magento/Framework/Mview/View/ChangeLogBatchIteratorInterface.php @@ -20,11 +20,11 @@ interface ChangeLogBatchIteratorInterface /** * Walk through batches * - * @param array $changeLogData - * @param $fromVersionId + * @param ChangelogInterface $changelog + * @param int $fromVersionId + * @param int $lastVersionId * @param int $batchSize * @return mixed - * @throws ChangelogTableNotExistsException */ - public function walk(array $changeLogData, $fromVersionId, int $batchSize); + public function walk(ChangelogInterface $changelog, int $fromVersionId, int $lastVersionId, int $batchSize); } diff --git a/lib/internal/Magento/Framework/Mview/View/Changelog.php b/lib/internal/Magento/Framework/Mview/View/Changelog.php index bbfb47807d4d6..3bbd14bf19fbe 100644 --- a/lib/internal/Magento/Framework/Mview/View/Changelog.php +++ b/lib/internal/Magento/Framework/Mview/View/Changelog.php @@ -28,7 +28,7 @@ class Changelog implements ChangelogInterface const COLUMN_NAME = 'entity_id'; /** - * Version ID column name + * Column name for Version ID */ const VERSION_ID_COLUMN_NAME = 'version_id'; @@ -94,7 +94,6 @@ protected function checkConnection() */ public function create() { - $config = $this->mviewConfig->getView($this->getViewId()); $changelogTableName = $this->resource->getTableName($this->getName()); if (!$this->connection->isTableExists($changelogTableName)) { $table = $this->connection->newTable( @@ -113,29 +112,39 @@ public function create() 'Entity ID' ); - if ($config && $config[self::ATTRIBUTE_SCOPE_SUPPORT]) { - $table->addColumn( - self::ATTRIBUTE_COLUMN, - \Magento\Framework\DB\Ddl\Table::TYPE_INTEGER, - null, - ['unsigned' => true, 'nullable' => true], - 'Attribute ID' - ); - } - if ($config && $config[self::STORE_SCOPE_SUPPORT]) { - $table->addColumn( - self::STORE_COLUMN, - \Magento\Framework\DB\Ddl\Table::TYPE_INTEGER, - null, - ['unsigned' => true, 'nullable' => true], - 'Store ID' - ); + foreach ($this->initAdditionalColumnData() as $columnData) { + /** @var AdditionalColumnProcessorInterface $processor */ + $processor = $columnData['processor']; + $processor->processColumnForCLTable($table, $columnData['cl_name']); } $this->connection->createTable($table); } } + /** + * Retrieve additional column data + * + * @return array + * @throws \Exception + */ + private function initAdditionalColumnData(): array + { + $config = $this->mviewConfig->getView($this->getViewId()); + $additionalColumns = []; + + foreach ($config['subscriptions'] as $subscription) { + if (isset($subscription['additional_columns'])) { + foreach ($subscription['additional_columns'] as $additionalColumn) { + //We are gatherig unique change log column names in order to create them later + $additionalColumns[$additionalColumn['cl_name']] = $additionalColumn; + } + } + } + + return $additionalColumns; + } + /** * Drop changelog table * diff --git a/lib/internal/Magento/Framework/Mview/View/Subscription.php b/lib/internal/Magento/Framework/Mview/View/Subscription.php index 460db5260f008..e68e928bd9229 100644 --- a/lib/internal/Magento/Framework/Mview/View/Subscription.php +++ b/lib/internal/Magento/Framework/Mview/View/Subscription.php @@ -80,10 +80,10 @@ class Subscription implements SubscriptionInterface * @param \Magento\Framework\DB\Ddl\TriggerFactory $triggerFactory * @param \Magento\Framework\Mview\View\CollectionInterface $viewCollection * @param \Magento\Framework\Mview\ViewInterface $view - * @param Config $mviewConfig * @param string $tableName * @param string $columnName * @param array $ignoredUpdateColumns + * @param Config|null $mviewConfig */ public function __construct( ResourceConnection $resource, @@ -207,7 +207,9 @@ protected function getLinkedViews() */ protected function buildStatement($event, $changelog) { - $trigger = "INSERT IGNORE INTO %s (%s) VALUES (%s);"; + $processor = $this->getProcessor(); + $prefix = $event === Trigger::EVENT_DELETE ? 'OLD.' : 'NEW.'; + $trigger = "%sINSERT IGNORE INTO %s (%s) VALUES (%s);"; switch ($event) { case Trigger::EVENT_UPDATE: $tableName = $this->resource->getTableName($this->getTableName()); @@ -233,67 +235,60 @@ protected function buildStatement($event, $changelog) } break; } - list($columnNames, $columnValues) = $this->prepareTriggerBody($changelog, $event); + + $columns = [ + 'column_names' => [ + 'entity_id' => $this->connection->quoteIdentifier($changelog->getColumnName()) + ], + 'column_values' => [ + 'entity_id' => $this->getEntityColumn($prefix) + ] + ]; + + if (isset($subscriptionData['additional_columns'])) { + $columns = array_replace_recursive( + $columns, + $processor->getTriggerColumns($prefix, $subscriptionData['additional_columns']) + ); + } + return sprintf( $trigger, + $processor->getPreStatements(), $this->connection->quoteIdentifier($this->resource->getTableName($changelog->getName())), - $columnNames, - $columnValues + implode(", " , $columns['column_names']), + implode(", ", $columns['column_values']) ); } /** - * @param string $prefix - * @return string + * Instantiate and retrieve additional columns processor + * + * @return AdditionalColumnProcessorInterface + * @throws \Exception */ - public function getEntityColumn(string $prefix): string + private function getProcessor(): AdditionalColumnProcessorInterface { - return $prefix . $this->connection->quoteIdentifier($this->getColumnName()); + $subscriptionData = $this->mviewConfig->getView($this->getView()->getId())['subscriptions']; + $processorClass = $subscriptionData['processor']; + $processor = ObjectManager::getInstance()->get($processorClass); + + if (!$processor instanceof AdditionalColumnProcessorInterface) { + throw new \Exception( + 'Processor should implements ' . AdditionalColumnProcessorInterface::class + ); + } + + return $processor; } /** - * Prepare column names and column values for trigger body - * - * @param ChangelogInterface $changelog - * @param string $eventType - * @return array + * @param string $prefix + * @return string */ - public function prepareTriggerBody(ChangelogInterface $changelog, string $eventType) + public function getEntityColumn(string $prefix): string { - $prefix = $eventType === Trigger::EVENT_DELETE ? 'OLD.' : 'NEW.'; - $describedSubscribedColumns = array_column( - $this->connection->describeTable($this->getTableName()), - 'COLUMN_NAME' - ); - $describedClColumns = array_column( - $this->connection->describeTable($changelog->getName()), - 'COLUMN_NAME' - ); - $viewConfig = $this->mviewConfig->getView($this->getView()->getId()); - $columnNames = [$this->connection->quoteIdentifier($changelog->getColumnName())]; - $columnValues = [$this->getEntityColumn($prefix)]; - //If we need to add attributes - if ($viewConfig[ChangelogInterface::ATTRIBUTE_SCOPE_SUPPORT] && - array_search(Changelog::ATTRIBUTE_COLUMN, $describedSubscribedColumns) && - array_search(Changelog::ATTRIBUTE_COLUMN, $describedClColumns) - - ) { - $columnValues[] = $prefix . $this->connection->quoteIdentifier(Changelog::ATTRIBUTE_COLUMN); - $columnNames[] = $this->connection->quoteIdentifier(Changelog::ATTRIBUTE_COLUMN); - } - //If we need to add stores - if ($viewConfig[ChangelogInterface::STORE_SCOPE_SUPPORT] && - array_search(Changelog::STORE_COLUMN, $describedSubscribedColumns) && - array_search(Changelog::STORE_COLUMN, $describedClColumns) - ) { - $columnValues[] = $prefix . $this->connection->quoteIdentifier(Changelog::STORE_COLUMN); - $columnNames[] = $this->connection->quoteIdentifier(Changelog::STORE_COLUMN); - } - - return [ - implode(",", $columnNames), - implode(",", $columnValues) - ]; + return $prefix . $this->connection->quoteIdentifier($this->getColumnName()); } /** diff --git a/lib/internal/Magento/Framework/Mview/etc/mview.xsd b/lib/internal/Magento/Framework/Mview/etc/mview.xsd index 5b264efdf5445..ada98d87d5ca3 100644 --- a/lib/internal/Magento/Framework/Mview/etc/mview.xsd +++ b/lib/internal/Magento/Framework/Mview/etc/mview.xsd @@ -46,8 +46,7 @@ <xs:attribute name="id" type="xs:string" use="required" /> <xs:attribute name="class" type="classType" use="required" /> <xs:attribute name="group" type="xs:string" use="required" /> - <xs:attribute name="store_scope" type="xs:boolean" use="optional" /> - <xs:attribute name="attribute_scope" type="xs:boolean" use="optional" /> + <xs:attribute name="iterator" type="classType" default="Magento\Framework\Mview\View\LegacyChangeLogBatchIterator" /> </xs:complexType> <xs:simpleType name="classType"> @@ -78,9 +77,24 @@ Table declaration. </xs:documentation> </xs:annotation> + <xs:sequence> + <xs:element minOccurs="0" name="additionalColumns" type="additionalColumnsType" /> + </xs:sequence> <xs:attribute name="name" type="tableNameType" use="required" /> <xs:attribute name="entity_column" type="entityColumnType" use="required" /> <xs:attribute name="subscription_model" type="subscriptionModelType" /> + <xs:attribute name="processor" type="classType" default="Magento\Framework\Mview\View\AdditionalColumnsProcessor\DefaultProcessor" /> + </xs:complexType> + + <xs:complexType name="additionalColumnsType"> + <xs:sequence> + <xs:element minOccurs="1" maxOccurs="unbounded" name="column" type="additionalColumnAttributeType" /> + </xs:sequence> + </xs:complexType> + + <xs:complexType name="additionalColumnAttributeType"> + <xs:attribute name="name" type="xs:string" /> + <xs:attribute name="cl_name" type="xs:string" /> </xs:complexType> <xs:simpleType name="entityColumnType"> From b1a759237f1b3030ff47483cbd2eb6732207d449 Mon Sep 17 00:00:00 2001 From: Serhii Kovalenko <ganster3012@gmail.com> Date: Thu, 17 Sep 2020 15:12:11 +0300 Subject: [PATCH 032/171] Mview patch update -- move framework logic to saas-export --- .../Framework/Mview/Config/Converter.php | 42 ++++++++++++-- .../AdditionalColumnProcessorInterface.php | 1 - .../DefaultProcessor.php | 11 ++-- .../Framework/Mview/View/Changelog.php | 5 +- .../Framework/Mview/View/Subscription.php | 56 ++++++++++++------- .../Magento/Framework/Mview/etc/mview.xsd | 1 + 6 files changed, 83 insertions(+), 33 deletions(-) rename lib/internal/Magento/Framework/Mview/View/{AdditionalColumnsProcessors => AdditionalColumnsProcessor}/DefaultProcessor.php (83%) diff --git a/lib/internal/Magento/Framework/Mview/Config/Converter.php b/lib/internal/Magento/Framework/Mview/Config/Converter.php index 2737f8db84b7c..f63766d729d5d 100644 --- a/lib/internal/Magento/Framework/Mview/Config/Converter.php +++ b/lib/internal/Magento/Framework/Mview/Config/Converter.php @@ -5,10 +5,34 @@ */ namespace Magento\Framework\Mview\Config; +use Magento\Framework\Mview\View\AdditionalColumnsProcessor\DefaultProcessor; +use Magento\Framework\Mview\View\ChangeLogBatchIterator; use Magento\Framework\Mview\View\SubscriptionInterface; class Converter implements \Magento\Framework\Config\ConverterInterface { + /** + * @var string + */ + private $defaultProcessor; + + /** + * @var string + */ + private $defaultIterator; + + /** + * @param string $defaultProcessor + * @param string $defaultIterator + */ + public function __construct( + string $defaultProcessor = DefaultProcessor::class, + string $defaultIterator = ChangeLogBatchIterator::class + ) { + $this->defaultProcessor = $defaultProcessor; + $this->defaultIterator = $defaultIterator; + } + /** * Convert dom node tree to array * @@ -29,7 +53,7 @@ public function convert($source) $data['action_class'] = $this->getAttributeValue($viewNode, 'class'); $data['group'] = $this->getAttributeValue($viewNode, 'group'); $data['store_scope'] = $this->getAttributeValue($viewNode, 'store_scope'); - $data['iterator'] = $this->getAttributeValue($viewNode, 'iterator'); + $data['iterator'] = $this->getAttributeValue($viewNode, 'iterator') ?: $this->defaultIterator; $data['subscriptions'] = []; /** @var $childNode \DOMNode */ @@ -95,6 +119,7 @@ class_implements(ltrim($subscriptionModel, '\\')) 'subscription_model' => $subscriptionModel, 'additional_columns' => $this->getAdditionalColumns($subscription), 'processor' => $this->getAttributeValue($subscription, 'processor') + ?: $this->defaultProcessor ]; } break; @@ -116,10 +141,17 @@ private function getAdditionalColumns(\DOMNode $subscription): array continue; } - $additionalColumns[] = [ - 'name' => $this->getAttributeValue($childNode, 'name'), - 'cl_name' => $this->getAttributeValue($childNode, 'cl_name'), - ]; + foreach ($childNode->childNodes as $columnNode) { + if ($columnNode->nodeName !== 'column') { + continue; + } + + $additionalColumns[$this->getAttributeValue($columnNode, 'name')] = [ + 'name' => $this->getAttributeValue($columnNode, 'name'), + 'cl_name' => $this->getAttributeValue($columnNode, 'cl_name'), + 'constant' => $this->getAttributeValue($columnNode, 'constant'), + ]; + } } return $additionalColumns; diff --git a/lib/internal/Magento/Framework/Mview/View/AdditionalColumnProcessorInterface.php b/lib/internal/Magento/Framework/Mview/View/AdditionalColumnProcessorInterface.php index 6a38437c5a848..c89fbce074a13 100644 --- a/lib/internal/Magento/Framework/Mview/View/AdditionalColumnProcessorInterface.php +++ b/lib/internal/Magento/Framework/Mview/View/AdditionalColumnProcessorInterface.php @@ -7,7 +7,6 @@ namespace Magento\Framework\Mview\View; use Magento\Framework\DB\Ddl\Table; -use Magento\Tests\NamingConvention\true\string; interface AdditionalColumnProcessorInterface { diff --git a/lib/internal/Magento/Framework/Mview/View/AdditionalColumnsProcessors/DefaultProcessor.php b/lib/internal/Magento/Framework/Mview/View/AdditionalColumnsProcessor/DefaultProcessor.php similarity index 83% rename from lib/internal/Magento/Framework/Mview/View/AdditionalColumnsProcessors/DefaultProcessor.php rename to lib/internal/Magento/Framework/Mview/View/AdditionalColumnsProcessor/DefaultProcessor.php index 3733e7a9499b3..96d9865998131 100644 --- a/lib/internal/Magento/Framework/Mview/View/AdditionalColumnsProcessors/DefaultProcessor.php +++ b/lib/internal/Magento/Framework/Mview/View/AdditionalColumnsProcessor/DefaultProcessor.php @@ -9,7 +9,6 @@ use Magento\Framework\App\ResourceConnection; use Magento\Framework\DB\Ddl\Table; use Magento\Framework\Mview\View\AdditionalColumnProcessorInterface; -use Magento\Tests\NamingConvention\true\string; class DefaultProcessor implements AdditionalColumnProcessorInterface { @@ -42,8 +41,10 @@ public function getTriggerColumns(string $eventPrefix, array $additionalColumns) $triggersColumns['column_names'][$additionalColumn['name']] = $resource->quoteIdentifier( $additionalColumn['cl_name'] ); - $triggersColumns['column_values'][$additionalColumn['name']] = $eventPrefix . - $resource->quoteIdentifier($additionalColumn['name']); + + $triggersColumns['column_values'][$additionalColumn['name']] = isset($additionalColumn['constant']) ? + $resource->quote($additionalColumn['constant']) : + $eventPrefix . $resource->quoteIdentifier($additionalColumn['name']); } return $triggersColumns; @@ -64,9 +65,9 @@ public function processColumnForCLTable(Table $table, string $columnName): void { $table->addColumn( $columnName, - \Magento\Framework\DB\Ddl\Table::TYPE_INTEGER, + \Magento\Framework\DB\Ddl\Table::TYPE_TEXT, null, - ['unsigned' => true, 'nullable' => false, 'default' => null], + ['unsigned' => true, 'nullable' => true, 'default' => null], $columnName ); } diff --git a/lib/internal/Magento/Framework/Mview/View/Changelog.php b/lib/internal/Magento/Framework/Mview/View/Changelog.php index 3bbd14bf19fbe..df4e55fe54850 100644 --- a/lib/internal/Magento/Framework/Mview/View/Changelog.php +++ b/lib/internal/Magento/Framework/Mview/View/Changelog.php @@ -6,6 +6,7 @@ namespace Magento\Framework\Mview\View; +use Magento\Framework\App\ObjectManager; use Magento\Framework\DB\Adapter\ConnectionException; use Magento\Framework\DB\Sql\Expression; use Magento\Framework\Exception\RuntimeException; @@ -114,7 +115,8 @@ public function create() foreach ($this->initAdditionalColumnData() as $columnData) { /** @var AdditionalColumnProcessorInterface $processor */ - $processor = $columnData['processor']; + $processorClass = $columnData['processor']; + $processor = ObjectManager::getInstance()->get($processorClass); $processor->processColumnForCLTable($table, $columnData['cl_name']); } @@ -138,6 +140,7 @@ private function initAdditionalColumnData(): array foreach ($subscription['additional_columns'] as $additionalColumn) { //We are gatherig unique change log column names in order to create them later $additionalColumns[$additionalColumn['cl_name']] = $additionalColumn; + $additionalColumns[$additionalColumn['cl_name']]['processor'] = $subscription['processor']; } } } diff --git a/lib/internal/Magento/Framework/Mview/View/Subscription.php b/lib/internal/Magento/Framework/Mview/View/Subscription.php index e68e928bd9229..79d31e2a76d69 100644 --- a/lib/internal/Magento/Framework/Mview/View/Subscription.php +++ b/lib/internal/Magento/Framework/Mview/View/Subscription.php @@ -198,6 +198,38 @@ protected function getLinkedViews() return $this->linkedViews; } + /** + * Prepare columns for trigger statement. Should be protected in order to serve new approach + * + * @param ChangelogInterface $changelog + * @param string $event + * @return array + * @throws \Exception + */ + protected function prepareColumns(ChangelogInterface $changelog, string $event): array + { + $prefix = $event === Trigger::EVENT_DELETE ? 'OLD.' : 'NEW.'; + $subscriptionData = $this->mviewConfig->getView($changelog->getViewId())['subscriptions'][$this->getTableName()]; + $columns = [ + 'column_names' => [ + 'entity_id' => $this->connection->quoteIdentifier($changelog->getColumnName()) + ], + 'column_values' => [ + 'entity_id' => $this->getEntityColumn($prefix) + ] + ]; + + if (!empty($subscriptionData['additional_columns'])) { + $processor = $this->getProcessor(); + $columns = array_replace_recursive( + $columns, + $processor->getTriggerColumns($prefix, $subscriptionData['additional_columns']) + ); + } + + return $columns; + } + /** * Build trigger statement for INSERT, UPDATE, DELETE events * @@ -207,8 +239,6 @@ protected function getLinkedViews() */ protected function buildStatement($event, $changelog) { - $processor = $this->getProcessor(); - $prefix = $event === Trigger::EVENT_DELETE ? 'OLD.' : 'NEW.'; $trigger = "%sINSERT IGNORE INTO %s (%s) VALUES (%s);"; switch ($event) { case Trigger::EVENT_UPDATE: @@ -235,26 +265,10 @@ protected function buildStatement($event, $changelog) } break; } - - $columns = [ - 'column_names' => [ - 'entity_id' => $this->connection->quoteIdentifier($changelog->getColumnName()) - ], - 'column_values' => [ - 'entity_id' => $this->getEntityColumn($prefix) - ] - ]; - - if (isset($subscriptionData['additional_columns'])) { - $columns = array_replace_recursive( - $columns, - $processor->getTriggerColumns($prefix, $subscriptionData['additional_columns']) - ); - } - + $columns = $this->prepareColumns($changelog, $event); return sprintf( $trigger, - $processor->getPreStatements(), + $this->getProcessor()->getPreStatements(), $this->connection->quoteIdentifier($this->resource->getTableName($changelog->getName())), implode(", " , $columns['column_names']), implode(", ", $columns['column_values']) @@ -270,7 +284,7 @@ protected function buildStatement($event, $changelog) private function getProcessor(): AdditionalColumnProcessorInterface { $subscriptionData = $this->mviewConfig->getView($this->getView()->getId())['subscriptions']; - $processorClass = $subscriptionData['processor']; + $processorClass = $subscriptionData[$this->getTableName()]['processor']; $processor = ObjectManager::getInstance()->get($processorClass); if (!$processor instanceof AdditionalColumnProcessorInterface) { diff --git a/lib/internal/Magento/Framework/Mview/etc/mview.xsd b/lib/internal/Magento/Framework/Mview/etc/mview.xsd index ada98d87d5ca3..053d1b2853f66 100644 --- a/lib/internal/Magento/Framework/Mview/etc/mview.xsd +++ b/lib/internal/Magento/Framework/Mview/etc/mview.xsd @@ -95,6 +95,7 @@ <xs:complexType name="additionalColumnAttributeType"> <xs:attribute name="name" type="xs:string" /> <xs:attribute name="cl_name" type="xs:string" /> + <xs:attribute name="constant" type="xs:string" /> </xs:complexType> <xs:simpleType name="entityColumnType"> From 7237a30eaa00c12008bc159f034bfcd07c183193 Mon Sep 17 00:00:00 2001 From: Serhii Kovalenko <ganster3012@gmail.com> Date: Thu, 17 Sep 2020 17:47:32 +0300 Subject: [PATCH 033/171] Mview patch update -- move framework logic to saas-export --- .../Magento/Framework/Mview/View/ChangeLogBatchIterator.php | 2 +- lib/internal/Magento/Framework/Mview/View/Changelog.php | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/internal/Magento/Framework/Mview/View/ChangeLogBatchIterator.php b/lib/internal/Magento/Framework/Mview/View/ChangeLogBatchIterator.php index 9165fc4a0d3cc..f3ae87b847cb1 100644 --- a/lib/internal/Magento/Framework/Mview/View/ChangeLogBatchIterator.php +++ b/lib/internal/Magento/Framework/Mview/View/ChangeLogBatchIterator.php @@ -55,6 +55,6 @@ public function walk(ChangelogInterface $changelog, int $fromVersionId, int $toV ->limit($batchSize); $select->from($changelogTableName, [$changelog->getColumnName()]); - return $connection->fetchAll($select); + return $connection->fetchCol($select); } } diff --git a/lib/internal/Magento/Framework/Mview/View/Changelog.php b/lib/internal/Magento/Framework/Mview/View/Changelog.php index df4e55fe54850..94ce4c19874ce 100644 --- a/lib/internal/Magento/Framework/Mview/View/Changelog.php +++ b/lib/internal/Magento/Framework/Mview/View/Changelog.php @@ -135,6 +135,10 @@ private function initAdditionalColumnData(): array $config = $this->mviewConfig->getView($this->getViewId()); $additionalColumns = []; + if (!$config) { + return $additionalColumns; + } + foreach ($config['subscriptions'] as $subscription) { if (isset($subscription['additional_columns'])) { foreach ($subscription['additional_columns'] as $additionalColumn) { From 99133052528df4752db1f582bb79e3c83250db46 Mon Sep 17 00:00:00 2001 From: Serhii Kovalenko <ganster3012@gmail.com> Date: Thu, 17 Sep 2020 18:31:16 +0300 Subject: [PATCH 034/171] Mview patch update -- move framework logic to saas-export --- .../Framework/Mview/Config/Converter.php | 1 - .../Mview/Test/Unit/View/ChangelogTest.php | 3 +- .../Mview/Test/Unit/View/SubscriptionTest.php | 15 +++++-- .../Framework/Mview/Test/Unit/ViewTest.php | 41 +++++++++++-------- .../Mview/Test/Unit/_files/mview_config.php | 9 +++- lib/internal/Magento/Framework/Mview/View.php | 23 +++++++---- 6 files changed, 60 insertions(+), 32 deletions(-) diff --git a/lib/internal/Magento/Framework/Mview/Config/Converter.php b/lib/internal/Magento/Framework/Mview/Config/Converter.php index f63766d729d5d..bb15287f9482a 100644 --- a/lib/internal/Magento/Framework/Mview/Config/Converter.php +++ b/lib/internal/Magento/Framework/Mview/Config/Converter.php @@ -52,7 +52,6 @@ public function convert($source) $data['view_id'] = $viewId; $data['action_class'] = $this->getAttributeValue($viewNode, 'class'); $data['group'] = $this->getAttributeValue($viewNode, 'group'); - $data['store_scope'] = $this->getAttributeValue($viewNode, 'store_scope'); $data['iterator'] = $this->getAttributeValue($viewNode, 'iterator') ?: $this->defaultIterator; $data['subscriptions'] = []; diff --git a/lib/internal/Magento/Framework/Mview/Test/Unit/View/ChangelogTest.php b/lib/internal/Magento/Framework/Mview/Test/Unit/View/ChangelogTest.php index 2642bf20bc6d6..4af3f65be6883 100644 --- a/lib/internal/Magento/Framework/Mview/Test/Unit/View/ChangelogTest.php +++ b/lib/internal/Magento/Framework/Mview/Test/Unit/View/ChangelogTest.php @@ -59,8 +59,7 @@ private function getMviewConfigMock() $mviewConfigMock->expects($this->any()) ->method('getView') ->willReturn([ - 'attribute_scope' => false, - 'store_scope' => false + 'subscriptions' => [] ]); return $mviewConfigMock; } diff --git a/lib/internal/Magento/Framework/Mview/Test/Unit/View/SubscriptionTest.php b/lib/internal/Magento/Framework/Mview/Test/Unit/View/SubscriptionTest.php index 559309c10c27c..2178009eda436 100644 --- a/lib/internal/Magento/Framework/Mview/Test/Unit/View/SubscriptionTest.php +++ b/lib/internal/Magento/Framework/Mview/Test/Unit/View/SubscriptionTest.php @@ -7,11 +7,13 @@ namespace Magento\Framework\Mview\Test\Unit\View; +use Magento\Framework\App\ObjectManager; use Magento\Framework\App\ResourceConnection; use Magento\Framework\DB\Adapter\Pdo\Mysql; use Magento\Framework\DB\Ddl\Trigger; use Magento\Framework\DB\Ddl\TriggerFactory; use Magento\Framework\Mview\Config; +use Magento\Framework\Mview\View\AdditionalColumnsProcessor\DefaultProcessor; use Magento\Framework\Mview\View\ChangelogInterface; use Magento\Framework\Mview\View\CollectionInterface; use Magento\Framework\Mview\View\StateInterface; @@ -49,6 +51,7 @@ class SubscriptionTest extends TestCase protected function setUp(): void { + $this->tableName = 'test_table'; $this->connectionMock = $this->createMock(Mysql::class); $this->resourceMock = $this->createMock(ResourceConnection::class); @@ -63,7 +66,10 @@ protected function setUp(): void $this->resourceMock->expects($this->atLeastOnce()) ->method('getConnection') ->willReturn($this->connectionMock); - + ObjectManager::getInstance()->expects($this->any()) + ->method('get') + ->with(DefaultProcessor::class) + ->willReturn(2); $this->triggerFactoryMock = $this->createMock(TriggerFactory::class); $this->viewCollectionMock = $this->getMockForAbstractClass( CollectionInterface::class, @@ -93,8 +99,11 @@ protected function setUp(): void $mviewConfigMock->expects($this->any()) ->method('getView') ->willReturn([ - 'attribute_scope' => false, - 'store_scope' => false + 'subscriptions' => [ + $this->tableName => [ + 'processor' => DefaultProcessor::class + ] + ] ]); $this->mviewConfig = $mviewConfigMock; $this->model = new Subscription( diff --git a/lib/internal/Magento/Framework/Mview/Test/Unit/ViewTest.php b/lib/internal/Magento/Framework/Mview/Test/Unit/ViewTest.php index 7d69ff43f158b..8d460ac99a46b 100644 --- a/lib/internal/Magento/Framework/Mview/Test/Unit/ViewTest.php +++ b/lib/internal/Magento/Framework/Mview/Test/Unit/ViewTest.php @@ -7,6 +7,7 @@ namespace Magento\Framework\Mview\Test\Unit; +use Laminas\Log\Filter\Mock; use Magento\Framework\Mview\ActionFactory; use Magento\Framework\Mview\ActionInterface; use Magento\Framework\Mview\ConfigInterface; @@ -53,6 +54,11 @@ class ViewTest extends TestCase */ protected $subscriptionFactoryMock; + /** + * @var MockObject|View\ChangeLogBatchIteratorInterface + */ + private $iteratorMock; + /** * @inheritdoc */ @@ -67,6 +73,7 @@ protected function setUp(): void true, ['getView'] ); + $this->iteratorMock = $this->createMock(View\ChangeLogBatchIteratorInterface::class); $this->actionFactoryMock = $this->createPartialMock(ActionFactory::class, ['get']); $this->stateMock = $this->createPartialMock( State::class, @@ -97,7 +104,10 @@ protected function setUp(): void $this->actionFactoryMock, $this->stateMock, $this->changelogMock, - $this->subscriptionFactoryMock + $this->subscriptionFactoryMock, + [], + [], + $this->iteratorMock ); } @@ -334,7 +344,7 @@ public function testUpdate() $currentVersionId ); $this->changelogMock->expects( - $this->once() + $this->any() )->method( 'getList' )->with( @@ -345,6 +355,7 @@ public function testUpdate() ); $actionMock = $this->getMockForAbstractClass(ActionInterface::class); + $this->iteratorMock->expects($this->once())->method('walk')->willReturn($listId); $actionMock->expects($this->once())->method('execute')->with($listId)->willReturnSelf(); $this->actionFactoryMock->expects( $this->once() @@ -390,7 +401,7 @@ public function testUpdateEx(): void ->expects($this->once()) ->method('getVersion') ->willReturn($currentVersionId); - + $this->iteratorMock->expects($this->any())->method('walk')->willReturn($this->generateChangeLog(150, 1, 150)); $this->changelogMock->method('getList') ->willReturnMap( [ @@ -401,7 +412,7 @@ public function testUpdateEx(): void ); $actionMock = $this->getMockForAbstractClass(ActionInterface::class); - $actionMock->expects($this->once()) + $actionMock->expects($this->any()) ->method('execute') ->with($this->generateChangeLog(150, 1, 150)) ->willReturnSelf(); @@ -457,7 +468,7 @@ public function testUpdateWithException() $this->stateMock->expects($this->atLeastOnce()) ->method('getMode') ->willReturn(StateInterface::MODE_ENABLED); - $this->stateMock->expects($this->exactly(2)) + $this->stateMock->expects($this->any()) ->method('getStatus') ->willReturn(StateInterface::STATUS_IDLE); $this->stateMock->expects($this->exactly(2)) @@ -472,16 +483,9 @@ public function testUpdateWithException() )->willReturn( $currentVersionId ); - $this->changelogMock->expects( - $this->once() - )->method( - 'getList' - )->with( - $lastVersionId, - $currentVersionId - )->willReturn( - $listId - ); + $this->iteratorMock->expects($this->any()) + ->method('walk') + ->willReturn([2,3]); $actionMock = $this->createPartialMock(ActionInterface::class, ['execute']); $actionMock->expects($this->once())->method('execute')->with($listId)->willReturnCallback( @@ -767,8 +771,11 @@ public function testGetUpdated() protected function loadView() { $viewId = 'view_test'; + $this->changelogMock->expects($this->any()) + ->method('getViewId') + ->willReturn($viewId); $this->configMock->expects( - $this->once() + $this->any() )->method( 'getView' )->with( @@ -788,7 +795,7 @@ protected function getViewData() 'view_id' => 'view_test', 'action_class' => 'Some\Class\Name', 'group' => 'some_group', - 'subscriptions' => ['some_entity' => ['name' => 'some_entity', 'column' => 'entity_id']] + 'subscriptions' => ['some_entity' => ['name' => 'some_entity', 'column' => 'entity_id']], ]; } } diff --git a/lib/internal/Magento/Framework/Mview/Test/Unit/_files/mview_config.php b/lib/internal/Magento/Framework/Mview/Test/Unit/_files/mview_config.php index a19f90546bac3..36e7dca899047 100644 --- a/lib/internal/Magento/Framework/Mview/Test/Unit/_files/mview_config.php +++ b/lib/internal/Magento/Framework/Mview/Test/Unit/_files/mview_config.php @@ -20,14 +20,19 @@ 'some_entity' => [ 'name' => 'some_entity', 'column' => 'entity_id', - 'subscription_model' => null + 'subscription_model' => null, + 'additional_columns' => [], + 'processor' => \Magento\Framework\Mview\View\AdditionalColumnsProcessor\DefaultProcessor::class ], 'some_product_relation' => [ 'name' => 'some_product_relation', 'column' => 'product_id', - 'subscription_model' => null + 'subscription_model' => null, + 'additional_columns' => [], + 'processor' => \Magento\Framework\Mview\View\AdditionalColumnsProcessor\DefaultProcessor::class ], ], + 'iterator' => \Magento\Framework\Mview\View\ChangeLogBatchIterator::class ], ] ]; diff --git a/lib/internal/Magento/Framework/Mview/View.php b/lib/internal/Magento/Framework/Mview/View.php index ac80004068236..fe8f4c675284b 100644 --- a/lib/internal/Magento/Framework/Mview/View.php +++ b/lib/internal/Magento/Framework/Mview/View.php @@ -11,6 +11,7 @@ use InvalidArgumentException; use Magento\Framework\App\ObjectManager; use Magento\Framework\DataObject; +use Magento\Framework\Mview\View\ChangeLogBatchIterator; use Magento\Framework\Mview\View\ChangeLogBatchIteratorInterface; use Magento\Framework\Mview\View\ChangelogTableNotExistsException; use Magento\Framework\Mview\View\SubscriptionFactory; @@ -65,9 +66,9 @@ class View extends DataObject implements ViewInterface private $changelogBatchSize; /** - * @var ChangeLogBatchIteratorInterface[] + * @var ChangeLogBatchIteratorInterface */ - private $strategies; + private $iterator; /** * @param ConfigInterface $config @@ -77,7 +78,7 @@ class View extends DataObject implements ViewInterface * @param SubscriptionFactory $subscriptionFactory * @param array $data * @param array $changelogBatchSize - * @param array $strategies + * @param ChangeLogBatchIteratorInterface|null $changeLogBatchIterator */ public function __construct( ConfigInterface $config, @@ -87,7 +88,7 @@ public function __construct( SubscriptionFactory $subscriptionFactory, array $data = [], array $changelogBatchSize = [], - array $strategies = [] + ChangeLogBatchIteratorInterface $changeLogBatchIterator = null ) { $this->config = $config; $this->actionFactory = $actionFactory; @@ -96,7 +97,7 @@ public function __construct( $this->subscriptionFactory = $subscriptionFactory; $this->changelogBatchSize = $changelogBatchSize; parent::__construct($data); - $this->strategies = $strategies; + $this->iterator = $changeLogBatchIterator; } /** @@ -302,8 +303,12 @@ private function executeAction(ActionInterface $action, int $lastVersionId, int $vsFrom = $lastVersionId; while ($vsFrom < $currentVersionId) { - $iterator = $this->createIterator(); + $iterator = $this->getIterator(); $ids = $iterator->walk($this->getChangelog(), $vsFrom, $currentVersionId, $batchSize); + + if (empty($ids)) { + break; + } $vsFrom += $batchSize; $action->execute($ids); } @@ -315,8 +320,12 @@ private function executeAction(ActionInterface $action, int $lastVersionId, int * @return ChangeLogBatchIteratorInterface|mixed * @throws Exception */ - private function createIterator() + private function getIterator() { + if ($this->iterator) { + return $this->iterator; + } + $config = $this->config->getView($this->changelog->getViewId()); $iteratorClass = $config['iterator']; From e4a2d3cdd2a1d427a35009c89b52fe570aba2847 Mon Sep 17 00:00:00 2001 From: Serhii Kovalenko <ganster3012@gmail.com> Date: Mon, 21 Sep 2020 16:10:11 +0300 Subject: [PATCH 035/171] Mview patch update proposal --- .../Magento/Eav/Model/Mview/BatchIterator.php | 67 ---------- .../Eav/Model/Mview/ChangeLogBatchWalker.php | 120 ++++++++++++++++++ .../Framework/Mview/Config/Converter.php | 6 +- lib/internal/Magento/Framework/Mview/View.php | 47 +++---- .../ProcessorFactory.php | 38 ++++++ ...hIterator.php => ChangeLogBatchWalker.php} | 5 +- .../View/ChangeLogBatchWalkerFactory.php | 37 ++++++ ....php => ChangeLogBatchWalkerInterface.php} | 4 +- .../Framework/Mview/View/Changelog.php | 13 +- .../Magento/Framework/Mview/etc/mview.xsd | 2 +- 10 files changed, 229 insertions(+), 110 deletions(-) delete mode 100644 app/code/Magento/Eav/Model/Mview/BatchIterator.php create mode 100644 app/code/Magento/Eav/Model/Mview/ChangeLogBatchWalker.php create mode 100644 lib/internal/Magento/Framework/Mview/View/AdditionalColumnsProcessor/ProcessorFactory.php rename lib/internal/Magento/Framework/Mview/View/{ChangeLogBatchIterator.php => ChangeLogBatchWalker.php} (89%) create mode 100644 lib/internal/Magento/Framework/Mview/View/ChangeLogBatchWalkerFactory.php rename lib/internal/Magento/Framework/Mview/View/{ChangeLogBatchIteratorInterface.php => ChangeLogBatchWalkerInterface.php} (84%) diff --git a/app/code/Magento/Eav/Model/Mview/BatchIterator.php b/app/code/Magento/Eav/Model/Mview/BatchIterator.php deleted file mode 100644 index b7dd69abd45ff..0000000000000 --- a/app/code/Magento/Eav/Model/Mview/BatchIterator.php +++ /dev/null @@ -1,67 +0,0 @@ -<?php -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ - -namespace Magento\Eav\Mview; - -use Magento\Framework\App\ResourceConnection; -use Magento\Framework\DB\Sql\Expression; -use Magento\Framework\Mview\View\ChangeLogBatchIteratorInterface; -use Magento\Framework\Mview\View\ChangelogInterface; -use Magento\Framework\Mview\View\ChangelogTableNotExistsException; -use Magento\Framework\Phrase; - -/** - * Class BatchIterator - */ -class BatchIterator implements ChangeLogBatchIteratorInterface -{ - /** - * @var ResourceConnection - */ - private $resourceConnection; - - /** - * @param ResourceConnection $resourceConnection - */ - public function __construct( - ResourceConnection $resourceConnection - ) { - $this->resourceConnection = $resourceConnection; - } - - /** - * @inheritdoc - */ - public function walk(ChangelogInterface $changelog, int $fromVersionId, int $toVersion, int $batchSize) - { - $connection = $this->resourceConnection->getConnection(); - if (!$connection->isTableExists($changelog->getName())) { - throw new ChangelogTableNotExistsException( - new Phrase("Table %1 does not exist", [$changelog->getName()]) - ); - } - $select = $connection->select()->distinct(true) - ->where( - 'version_id > ?', - (int)$fromVersionId - ) - ->where( - 'version_id <= ?', - $toVersion - ) - ->group([$changelog->getColumnName(), 'store_id']) - ->limit($batchSize); - - $columns = [ - $changelog->getColumnName(), - 'attribute_ids' => new Expression('GROUP_CONCAT(attribute_id)'), - 'store_id' - ]; - - $select->from($changelog->getName(), $columns); - return $connection->fetchAll($select); - } -} diff --git a/app/code/Magento/Eav/Model/Mview/ChangeLogBatchWalker.php b/app/code/Magento/Eav/Model/Mview/ChangeLogBatchWalker.php new file mode 100644 index 0000000000000..fdc71faa90902 --- /dev/null +++ b/app/code/Magento/Eav/Model/Mview/ChangeLogBatchWalker.php @@ -0,0 +1,120 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +namespace Magento\Eav\Model\Mview; + +use Magento\Framework\App\ResourceConnection; +use Magento\Framework\DB\Sql\Expression; +use Magento\Framework\Mview\View\ChangeLogBatchWalkerInterface; +use Magento\Framework\Mview\View\ChangelogInterface; + +/** + * Class BatchIterator + */ +class ChangeLogBatchWalker implements ChangeLogBatchWalkerInterface +{ + private const GROUP_CONCAT_MAX_VARIABLE = 'group_concat_max_len'; + /** ID is defined as small int. Default size of it is 5 */ + private const DEFAULT_ID_SIZE = 5; + + /** + * @var ResourceConnection + */ + private $resourceConnection; + + /** + * @var array + */ + private $entityTypeCodes; + + /** + * @param ResourceConnection $resourceConnection + * @param array $entityTypeCodes + */ + public function __construct( + ResourceConnection $resourceConnection, + array $entityTypeCodes = [] + ) { + $this->resourceConnection = $resourceConnection; + $this->entityTypeCodes = $entityTypeCodes; + } + + /** + * Calculate EAV attributes size + * + * @param ChangelogInterface $changelog + * @return int + * @throws \Exception + */ + private function calculateEavAttributeSize(ChangelogInterface $changelog): int + { + $connection = $this->resourceConnection->getConnection(); + + if (!isset($this->entityTypeCodes[$changelog->getViewId()])) { + throw new \Exception('Entity type for view was not defined'); + } + + $select = $connection->select(); + $select->from( + $this->resourceConnection->getTableName('eav_attribute'), + new Expression('COUNT(*)') + ) + ->joinInner( + ['type' => $connection->getTableName('eav_entity_type')], + 'type.entity_type_id=eav_attribute.entity_type_id' + ) + ->where('type.entity_type_code = ?', $this->entityTypeCodes[$changelog->getViewId()]); + + return (int) $connection->fetchOne($select); + } + + /** + * Prepare group max concat + * + * @param int $numberOfAttributes + * @return void + * @throws \Exception + */ + private function setGroupConcatMax(int $numberOfAttributes): void + { + $connection = $this->resourceConnection->getConnection(); + $connection->query(sprintf( + 'SET SESSION %s=%s', + self::GROUP_CONCAT_MAX_VARIABLE, + $numberOfAttributes * (self::DEFAULT_ID_SIZE + 1) + )); + } + + /** + * @inheritdoc + * @throws \Exception + */ + public function walk(ChangelogInterface $changelog, int $fromVersionId, int $toVersion, int $batchSize) + { + $connection = $this->resourceConnection->getConnection(); + $numberOfAttributes = $this->calculateEavAttributeSize($changelog); + $this->setGroupConcatMax($numberOfAttributes); + $select = $connection->select()->distinct(true) + ->where( + 'version_id > ?', + (int) $fromVersionId + ) + ->where( + 'version_id <= ?', + $toVersion + ) + ->group([$changelog->getColumnName(), 'store_id']) + ->limit($batchSize); + + $columns = [ + $changelog->getColumnName(), + 'attribute_ids' => new Expression('GROUP_CONCAT(attribute_id)'), + 'store_id' + ]; + $select->from($changelog->getName(), $columns); + return $connection->fetchAll($select); + } +} diff --git a/lib/internal/Magento/Framework/Mview/Config/Converter.php b/lib/internal/Magento/Framework/Mview/Config/Converter.php index bb15287f9482a..988cffa8b7ce2 100644 --- a/lib/internal/Magento/Framework/Mview/Config/Converter.php +++ b/lib/internal/Magento/Framework/Mview/Config/Converter.php @@ -6,7 +6,7 @@ namespace Magento\Framework\Mview\Config; use Magento\Framework\Mview\View\AdditionalColumnsProcessor\DefaultProcessor; -use Magento\Framework\Mview\View\ChangeLogBatchIterator; +use Magento\Framework\Mview\View\ChangeLogBatchWalker; use Magento\Framework\Mview\View\SubscriptionInterface; class Converter implements \Magento\Framework\Config\ConverterInterface @@ -27,7 +27,7 @@ class Converter implements \Magento\Framework\Config\ConverterInterface */ public function __construct( string $defaultProcessor = DefaultProcessor::class, - string $defaultIterator = ChangeLogBatchIterator::class + string $defaultIterator = ChangeLogBatchWalker::class ) { $this->defaultProcessor = $defaultProcessor; $this->defaultIterator = $defaultIterator; @@ -52,7 +52,7 @@ public function convert($source) $data['view_id'] = $viewId; $data['action_class'] = $this->getAttributeValue($viewNode, 'class'); $data['group'] = $this->getAttributeValue($viewNode, 'group'); - $data['iterator'] = $this->getAttributeValue($viewNode, 'iterator') ?: $this->defaultIterator; + $data['walker'] = $this->getAttributeValue($viewNode, 'walker') ?: $this->defaultIterator; $data['subscriptions'] = []; /** @var $childNode \DOMNode */ diff --git a/lib/internal/Magento/Framework/Mview/View.php b/lib/internal/Magento/Framework/Mview/View.php index fe8f4c675284b..420702c434103 100644 --- a/lib/internal/Magento/Framework/Mview/View.php +++ b/lib/internal/Magento/Framework/Mview/View.php @@ -11,8 +11,8 @@ use InvalidArgumentException; use Magento\Framework\App\ObjectManager; use Magento\Framework\DataObject; -use Magento\Framework\Mview\View\ChangeLogBatchIterator; -use Magento\Framework\Mview\View\ChangeLogBatchIteratorInterface; +use Magento\Framework\Mview\View\ChangeLogBatchWalkerFactory; +use Magento\Framework\Mview\View\ChangeLogBatchWalkerInterface; use Magento\Framework\Mview\View\ChangelogTableNotExistsException; use Magento\Framework\Mview\View\SubscriptionFactory; use Exception; @@ -66,9 +66,9 @@ class View extends DataObject implements ViewInterface private $changelogBatchSize; /** - * @var ChangeLogBatchIteratorInterface + * @var ChangeLogBatchWalkerFactory */ - private $iterator; + private $changeLogBatchWalkerFactory; /** * @param ConfigInterface $config @@ -78,7 +78,7 @@ class View extends DataObject implements ViewInterface * @param SubscriptionFactory $subscriptionFactory * @param array $data * @param array $changelogBatchSize - * @param ChangeLogBatchIteratorInterface|null $changeLogBatchIterator + * @param ChangeLogBatchWalkerFactory $changeLogBatchWalkerFactory */ public function __construct( ConfigInterface $config, @@ -88,7 +88,7 @@ public function __construct( SubscriptionFactory $subscriptionFactory, array $data = [], array $changelogBatchSize = [], - ChangeLogBatchIteratorInterface $changeLogBatchIterator = null + ChangeLogBatchWalkerFactory $changeLogBatchWalkerFactory = null ) { $this->config = $config; $this->actionFactory = $actionFactory; @@ -97,7 +97,8 @@ public function __construct( $this->subscriptionFactory = $subscriptionFactory; $this->changelogBatchSize = $changelogBatchSize; parent::__construct($data); - $this->iterator = $changeLogBatchIterator; + $this->changeLogBatchWalkerFactory = $changeLogBatchWalkerFactory ?: + ObjectManager::getInstance()->get(ChangeLogBatchWalkerFactory::class); } /** @@ -303,8 +304,8 @@ private function executeAction(ActionInterface $action, int $lastVersionId, int $vsFrom = $lastVersionId; while ($vsFrom < $currentVersionId) { - $iterator = $this->getIterator(); - $ids = $iterator->walk($this->getChangelog(), $vsFrom, $currentVersionId, $batchSize); + $walker = $this->getWalker(); + $ids = $walker->walk($this->getChangelog(), $vsFrom, $currentVersionId, $batchSize); if (empty($ids)) { break; @@ -315,34 +316,16 @@ private function executeAction(ActionInterface $action, int $lastVersionId, int } /** - * Create and validate iterator class for changelog + * Create and validate walker class for changelog * - * @return ChangeLogBatchIteratorInterface|mixed + * @return ChangeLogBatchWalkerInterface|mixed * @throws Exception */ - private function getIterator() + private function getWalker(): ChangeLogBatchWalkerInterface { - if ($this->iterator) { - return $this->iterator; - } - $config = $this->config->getView($this->changelog->getViewId()); - $iteratorClass = $config['iterator']; - - if (!class_exists($iteratorClass)) { - throw new \Exception('Iterator class does not exist for view: ' . $this->changelog->getViewId()); - } - - $iterator = ObjectManager::getInstance()->get($iteratorClass); - - if (!$iterator instanceof ChangeLogBatchIteratorInterface) { - throw new \Exception( - 'Iterator does not implement the right interface for view: ' . - $this->changelog->getViewId() - ); - } - - return $iterator; + $walkerClass = $config['walker']; + return $this->changeLogBatchWalkerFactory->create($walkerClass); } /** diff --git a/lib/internal/Magento/Framework/Mview/View/AdditionalColumnsProcessor/ProcessorFactory.php b/lib/internal/Magento/Framework/Mview/View/AdditionalColumnsProcessor/ProcessorFactory.php new file mode 100644 index 0000000000000..5907cefbffd50 --- /dev/null +++ b/lib/internal/Magento/Framework/Mview/View/AdditionalColumnsProcessor/ProcessorFactory.php @@ -0,0 +1,38 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +namespace Magento\Framework\Mview\View\AdditionalColumnsProcessor; + +use Magento\Framework\Mview\View\AdditionalColumnProcessorInterface; +use Magento\Framework\ObjectManagerInterface; + +class ProcessorFactory +{ + /** + * @var ObjectManagerInterface + */ + private $objectManager; + + /** + * ProcessorFactory constructor. + * @param ObjectManagerInterface $objectManager + */ + public function __construct(ObjectManagerInterface $objectManager) + { + $this->objectManager = $objectManager; + } + + /** + * Instantiate additional columns processor + * + * @param string $processorClassName + * @return AdditionalColumnProcessorInterface + */ + public function create(string $processorClassName): AdditionalColumnProcessorInterface + { + return $this->objectManager->create($processorClassName); + } +} diff --git a/lib/internal/Magento/Framework/Mview/View/ChangeLogBatchIterator.php b/lib/internal/Magento/Framework/Mview/View/ChangeLogBatchWalker.php similarity index 89% rename from lib/internal/Magento/Framework/Mview/View/ChangeLogBatchIterator.php rename to lib/internal/Magento/Framework/Mview/View/ChangeLogBatchWalker.php index f3ae87b847cb1..7a767e656c3ca 100644 --- a/lib/internal/Magento/Framework/Mview/View/ChangeLogBatchIterator.php +++ b/lib/internal/Magento/Framework/Mview/View/ChangeLogBatchWalker.php @@ -7,14 +7,13 @@ namespace Magento\Framework\Mview\View; use Magento\Framework\App\ResourceConnection; -use Magento\Framework\DB\Sql\Expression; use Magento\Framework\Phrase; /** - * Interface \Magento\Framework\Mview\View\ChangeLogBatchIterator + * Interface \Magento\Framework\Mview\View\ChangeLogBatchWalkerInterface * */ -class ChangeLogBatchIterator implements ChangeLogBatchIteratorInterface +class ChangeLogBatchWalker implements ChangeLogBatchWalkerInterface { /** * @var ResourceConnection diff --git a/lib/internal/Magento/Framework/Mview/View/ChangeLogBatchWalkerFactory.php b/lib/internal/Magento/Framework/Mview/View/ChangeLogBatchWalkerFactory.php new file mode 100644 index 0000000000000..98d814775f62b --- /dev/null +++ b/lib/internal/Magento/Framework/Mview/View/ChangeLogBatchWalkerFactory.php @@ -0,0 +1,37 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +namespace Magento\Framework\Mview\View; + +use Magento\Framework\ObjectManagerInterface; + +class ChangeLogBatchWalkerFactory +{ + /** + * @var ObjectManagerInterface + */ + private $objectManager; + + /** + * ChangeLogBatchWalkerFactory constructor. + * @param ObjectManagerInterface $objectManager + */ + public function __construct(ObjectManagerInterface $objectManager) + { + $this->objectManager = $objectManager; + } + + /** + * Instantiate BatchWalker interface + * + * @param string $batchWalkerClassName + * @return ChangeLogBatchWalkerInterface + */ + public function create(string $batchWalkerClassName): ChangeLogBatchWalkerInterface + { + return $this->objectManager->create($batchWalkerClassName); + } +} diff --git a/lib/internal/Magento/Framework/Mview/View/ChangeLogBatchIteratorInterface.php b/lib/internal/Magento/Framework/Mview/View/ChangeLogBatchWalkerInterface.php similarity index 84% rename from lib/internal/Magento/Framework/Mview/View/ChangeLogBatchIteratorInterface.php rename to lib/internal/Magento/Framework/Mview/View/ChangeLogBatchWalkerInterface.php index 5e86e0753aec9..d9079c550403c 100644 --- a/lib/internal/Magento/Framework/Mview/View/ChangeLogBatchIteratorInterface.php +++ b/lib/internal/Magento/Framework/Mview/View/ChangeLogBatchWalkerInterface.php @@ -12,10 +12,10 @@ use Magento\Framework\Phrase; /** - * Interface \Magento\Framework\Mview\View\ChangeLogBatchIteratorInterface + * Interface \Magento\Framework\Mview\View\ChangeLogBatchWalkerInterface * */ -interface ChangeLogBatchIteratorInterface +interface ChangeLogBatchWalkerInterface { /** * Walk through batches diff --git a/lib/internal/Magento/Framework/Mview/View/Changelog.php b/lib/internal/Magento/Framework/Mview/View/Changelog.php index 94ce4c19874ce..d26d816e34fea 100644 --- a/lib/internal/Magento/Framework/Mview/View/Changelog.php +++ b/lib/internal/Magento/Framework/Mview/View/Changelog.php @@ -11,6 +11,7 @@ use Magento\Framework\DB\Sql\Expression; use Magento\Framework\Exception\RuntimeException; use Magento\Framework\Mview\Config; +use Magento\Framework\Mview\View\AdditionalColumnsProcessor\ProcessorFactory; use Magento\Framework\Phrase; /** @@ -57,19 +58,27 @@ class Changelog implements ChangelogInterface */ private $mviewConfig; + /** + * @var ProcessorFactory + */ + private $additionalColumnsProcessorFactory; + /** * @param \Magento\Framework\App\ResourceConnection $resource * @param Config $mviewConfig + * @param ProcessorFactory $additionalColumnsProcessorFactory * @throws ConnectionException */ public function __construct( \Magento\Framework\App\ResourceConnection $resource, - Config $mviewConfig + Config $mviewConfig, + ProcessorFactory $additionalColumnsProcessorFactory ) { $this->connection = $resource->getConnection(); $this->resource = $resource; $this->checkConnection(); $this->mviewConfig = $mviewConfig; + $this->additionalColumnsProcessorFactory = $additionalColumnsProcessorFactory; } /** @@ -116,7 +125,7 @@ public function create() foreach ($this->initAdditionalColumnData() as $columnData) { /** @var AdditionalColumnProcessorInterface $processor */ $processorClass = $columnData['processor']; - $processor = ObjectManager::getInstance()->get($processorClass); + $processor = $this->additionalColumnsProcessorFactory->create($processorClass); $processor->processColumnForCLTable($table, $columnData['cl_name']); } diff --git a/lib/internal/Magento/Framework/Mview/etc/mview.xsd b/lib/internal/Magento/Framework/Mview/etc/mview.xsd index 053d1b2853f66..04754fa499249 100644 --- a/lib/internal/Magento/Framework/Mview/etc/mview.xsd +++ b/lib/internal/Magento/Framework/Mview/etc/mview.xsd @@ -46,7 +46,7 @@ <xs:attribute name="id" type="xs:string" use="required" /> <xs:attribute name="class" type="classType" use="required" /> <xs:attribute name="group" type="xs:string" use="required" /> - <xs:attribute name="iterator" type="classType" default="Magento\Framework\Mview\View\LegacyChangeLogBatchIterator" /> + <xs:attribute name="walker" type="classType" default="Magento\Framework\Mview\View\ChangeLogBatchWalker" /> </xs:complexType> <xs:simpleType name="classType"> From 34039643885be75dd1c47d8bad0f0c153a7bf247 Mon Sep 17 00:00:00 2001 From: Serhii Kovalenko <ganster3012@gmail.com> Date: Wed, 4 Nov 2020 17:25:05 +0200 Subject: [PATCH 036/171] Make --- .../Magento/Framework/Mview/View/ChangelogInterface.php | 5 ----- 1 file changed, 5 deletions(-) diff --git a/lib/internal/Magento/Framework/Mview/View/ChangelogInterface.php b/lib/internal/Magento/Framework/Mview/View/ChangelogInterface.php index 79f998cbe02b6..b00c1ca3a2e33 100644 --- a/lib/internal/Magento/Framework/Mview/View/ChangelogInterface.php +++ b/lib/internal/Magento/Framework/Mview/View/ChangelogInterface.php @@ -11,11 +11,6 @@ */ interface ChangelogInterface { - const ATTRIBUTE_SCOPE_SUPPORT = 'attribute_scope'; - const STORE_SCOPE_SUPPORT = 'store_scope'; - const ATTRIBUTE_COLUMN = 'attribute_id'; - const STORE_COLUMN = 'store_id'; - /** * Create changelog table * From 937f9e5b767fb9beac965b22c22c8866d9595d95 Mon Sep 17 00:00:00 2001 From: "vadim.malesh" <engcom-vendorworker-charlie@adobe.com> Date: Fri, 6 Nov 2020 17:11:47 +0200 Subject: [PATCH 037/171] fix mftf, static --- .../Adminhtml/Order/CreditmemoLoader.php | 14 +++++++++----- ...CreditmemoViewPageWithWrongCreditmemoIdTest.xml | 3 +-- .../Adminhtml/Order/Creditmemo/ViewTest.php | 8 +------- .../Adminhtml/Order/Invoice/ViewTest.php | 7 ------- .../Controller/Adminhtml/Order/ShipmentLoader.php | 3 +-- 5 files changed, 12 insertions(+), 23 deletions(-) diff --git a/app/code/Magento/Sales/Controller/Adminhtml/Order/CreditmemoLoader.php b/app/code/Magento/Sales/Controller/Adminhtml/Order/CreditmemoLoader.php index 2451b76a5de1a..c1e79b95af038 100644 --- a/app/code/Magento/Sales/Controller/Adminhtml/Order/CreditmemoLoader.php +++ b/app/code/Magento/Sales/Controller/Adminhtml/Order/CreditmemoLoader.php @@ -8,12 +8,12 @@ use Magento\Framework\DataObject; use Magento\Sales\Api\CreditmemoRepositoryInterface; -use \Magento\Sales\Model\Order\CreditmemoFactory; +use Magento\Sales\Model\Order; +use Magento\Sales\Model\Order\CreditmemoFactory; /** - * Class CreditmemoLoader + * Loader for creditmemo * - * @package Magento\Sales\Controller\Adminhtml\Order * @method CreditmemoLoader setCreditmemoId($id) * @method CreditmemoLoader setCreditmemo($creditMemo) * @method CreditmemoLoader setInvoiceId($id) @@ -22,6 +22,7 @@ * @method string getCreditmemo() * @method int getInvoiceId() * @method int getOrderId() + * @SuppressWarnings(PHPMD.CookieAndSessionMisuse) */ class CreditmemoLoader extends DataObject { @@ -129,7 +130,8 @@ protected function _getItemData() /** * Check if creditmeno can be created for order - * @param \Magento\Sales\Model\Order $order + * + * @param Order $order * @return bool */ protected function _canCreditmemo($order) @@ -153,7 +155,9 @@ protected function _canCreditmemo($order) } /** - * @param \Magento\Sales\Model\Order $order + * Inits invoice + * + * @param Order $order * @return $this|bool */ protected function _initInvoice($order) diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminOpenCreditmemoViewPageWithWrongCreditmemoIdTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminOpenCreditmemoViewPageWithWrongCreditmemoIdTest.xml index 696a9f0db2eb0..cf7f61aa12a20 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminOpenCreditmemoViewPageWithWrongCreditmemoIdTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminOpenCreditmemoViewPageWithWrongCreditmemoIdTest.xml @@ -33,7 +33,6 @@ <seeInCurrentUrl url="{{AdminCreditMemosGridPage.url}}" stepKey="redirectToCreditMemosGridPage"/> - <see selector="{{AdminMessagesSection.error}}" userInput='This creditmemo no longer exists.' - stepKey="seeErrorMessage"/> + <actionGroup ref="AssertAdminPageIs404ActionGroup" stepKey="see404PageOnAdmin"/> </test> </tests> diff --git a/app/code/Magento/Sales/Test/Unit/Controller/Adminhtml/Order/Creditmemo/ViewTest.php b/app/code/Magento/Sales/Test/Unit/Controller/Adminhtml/Order/Creditmemo/ViewTest.php index 6e04f4caadc8f..b7249e2af295c 100644 --- a/app/code/Magento/Sales/Test/Unit/Controller/Adminhtml/Order/Creditmemo/ViewTest.php +++ b/app/code/Magento/Sales/Test/Unit/Controller/Adminhtml/Order/Creditmemo/ViewTest.php @@ -143,9 +143,6 @@ class ViewTest extends TestCase */ protected function setUp(): void { - $titleMock = $this->getMockBuilder(\Magento\Framework\App\Action\Title::class) - ->disableOriginalConstructor() - ->getMock(); $this->invoiceMock = $this->getMockBuilder(Invoice::class) ->disableOriginalConstructor() ->getMock(); @@ -238,9 +235,6 @@ protected function setUp(): void $this->contextMock->expects($this->any()) ->method('getObjectManager') ->willReturn($this->objectManagerMock); - $this->contextMock->expects($this->any()) - ->method('getTitle') - ->willReturn($titleMock); $this->contextMock->expects($this->any()) ->method('getMessageManager') ->willReturn($this->messageManagerMock); @@ -272,7 +266,7 @@ public function testExecuteNoCreditMemo() $this->loaderMock->expects($this->once()) ->method('load') ->willReturn(false); - + $this->prepareRedirect(); $this->setPath('sales/creditmemo'); $this->assertInstanceOf( diff --git a/app/code/Magento/Sales/Test/Unit/Controller/Adminhtml/Order/Invoice/ViewTest.php b/app/code/Magento/Sales/Test/Unit/Controller/Adminhtml/Order/Invoice/ViewTest.php index a29ab201e0bd9..d9003b7b4f061 100644 --- a/app/code/Magento/Sales/Test/Unit/Controller/Adminhtml/Order/Invoice/ViewTest.php +++ b/app/code/Magento/Sales/Test/Unit/Controller/Adminhtml/Order/Invoice/ViewTest.php @@ -127,10 +127,6 @@ protected function setUp(): void ->disableOriginalConstructor() ->setMethods([]) ->getMock(); - $this->titleMock = $this->getMockBuilder(\Magento\Framework\App\Action\Title::class) - ->disableOriginalConstructor() - ->setMethods([]) - ->getMock(); $this->viewMock = $this->getMockBuilder(\Magento\Framework\App\View::class) ->disableOriginalConstructor() ->setMethods([]) @@ -176,9 +172,6 @@ protected function setUp(): void $contextMock->expects($this->any()) ->method('getResponse') ->willReturn($this->responseMock); - $contextMock->expects($this->any()) - ->method('getTitle') - ->willReturn($this->titleMock); $contextMock->expects($this->any()) ->method('getView') ->willReturn($this->viewMock); diff --git a/app/code/Magento/Shipping/Controller/Adminhtml/Order/ShipmentLoader.php b/app/code/Magento/Shipping/Controller/Adminhtml/Order/ShipmentLoader.php index 4f44bfb6458b1..5f0a2fb24c96f 100644 --- a/app/code/Magento/Shipping/Controller/Adminhtml/Order/ShipmentLoader.php +++ b/app/code/Magento/Shipping/Controller/Adminhtml/Order/ShipmentLoader.php @@ -18,9 +18,8 @@ use Magento\Sales\Api\Data\ShipmentItemCreationInterface; /** - * Class ShipmentLoader + * Loader for shipment * - * @package Magento\Shipping\Controller\Adminhtml\Order * @method ShipmentLoader setOrderId($id) * @method ShipmentLoader setShipmentId($id) * @method ShipmentLoader setShipment($shipment) From 6bb81585f10eb347cd4f35c9a286eab0a2d82d39 Mon Sep 17 00:00:00 2001 From: Anna Pak <a.pak@atwix.com> Date: Fri, 6 Nov 2020 18:37:18 +0200 Subject: [PATCH 038/171] AddOutOfStockProductToCompareListTest refactored --- ...tHoverProductOnCategoryPageActionGroup.xml | 19 +++ .../AddOutOfStockProductToCompareListTest.xml | 120 ++++++++---------- 2 files changed, 72 insertions(+), 67 deletions(-) create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontHoverProductOnCategoryPageActionGroup.xml diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontHoverProductOnCategoryPageActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontHoverProductOnCategoryPageActionGroup.xml new file mode 100644 index 0000000000000..661d40fd4f13a --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontHoverProductOnCategoryPageActionGroup.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="StorefrontHoverProductOnCategoryPageActionGroup"> + <annotations> + <description>Hover product on the Category page</description> + </annotations> + + <moveMouseOver selector="{{StorefrontCategoryMainSection.ProductItemInfo}}" stepKey="hoverOverProduct"/> + + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AddOutOfStockProductToCompareListTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AddOutOfStockProductToCompareListTest.xml index 92be79fdfe720..b2fbf2ae3810a 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AddOutOfStockProductToCompareListTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AddOutOfStockProductToCompareListTest.xml @@ -20,7 +20,6 @@ <group value="Catalog"/> </annotations> <before> - <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <magentoCLI command="config:set {{CatalogInventoryOptionsShowOutOfStockDisable.path}} {{CatalogInventoryOptionsShowOutOfStockDisable.value}}" stepKey="setConfigShowOutOfStockFalse"/> <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> <argument name="tags" value=""/> @@ -30,81 +29,68 @@ <requiredEntity createDataKey="category"/> </createData> </before> + <after> - <magentoCLI command="config:set {{CatalogInventoryOptionsShowOutOfStockDisable.path}} {{CatalogInventoryOptionsShowOutOfStockDisable.value}}" stepKey="setConfigShowOutOfStockFalse"/> + <magentoCLI command="config:set {{CatalogInventoryOptionsShowOutOfStockDisable.path}} {{CatalogInventoryOptionsShowOutOfStockDisable.value}}" stepKey="setConfigShowOutOfStockFalse"/> <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> <argument name="tags" value=""/> </actionGroup> - <deleteData createDataKey="product" stepKey="deleteProduct"/> - <deleteData createDataKey="category" stepKey="deleteCategory"/> - <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> + <deleteData createDataKey="product" stepKey="deleteProduct"/> + <deleteData createDataKey="category" stepKey="deleteCategory"/> </after> - <!--Open product page--> - <comment userInput="Open product page" stepKey="openProdPage"/> - <amOnPage url="{{StorefrontProductPage.url($$product.custom_attributes[url_key]$$)}}" stepKey="goToSimpleProductPage"/> - <waitForPageLoad stepKey="waitForSimpleProductPage"/> - <!--'Add to compare' link is not available--> - <comment userInput="'Add to compare' link is not available" stepKey="addToCompareLinkAvailability"/> + + <actionGroup ref="StorefrontOpenProductPageActionGroup" stepKey="openProductStorefront"> + <argument name="productUrl" value="$$product.custom_attributes[url_key]$$"/> + </actionGroup> + <dontSeeElement selector="{{StorefrontProductInfoMainSection.productAddToCompare}}" stepKey="dontSeeAddToCompareLink"/> - <!--Turn on 'out on stock' config--> - <comment userInput="Turn on 'out of stock' config" stepKey="onOutOfStockConfig"/> + <magentoCLI command="config:set {{CatalogInventoryOptionsShowOutOfStockEnable.path}} {{CatalogInventoryOptionsShowOutOfStockEnable.value}}" stepKey="setConfigShowOutOfStockTrue"/> - <!--Clear cache and reindex--> - <comment userInput="Clear cache and reindex" stepKey="cleanCache"/> + <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> - <argument name="indices" value=""/> -</actionGroup> + <argument name="indices" value=""/> + </actionGroup> <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> - <argument name="tags" value=""/> -</actionGroup> - <!--Open product page--> - <comment userInput="Open product page" stepKey="openProductPage"/> - <amOnPage url="{{StorefrontProductPage.url($$product.custom_attributes[url_key]$$)}}" stepKey="goToSimpleProductPage2"/> - <waitForPageLoad stepKey="waitForSimpleProductPage2"/> - <!--Click on 'Add to Compare' link--> - <waitForElementVisible selector="{{StorefrontProductInfoMainSection.productAddToCompare}}" stepKey="seeAddToCompareLink"/> - <comment userInput="Click on 'Add to Compare' link" stepKey="clickOnAddToCompareLink"/> - <click selector="{{StorefrontProductInfoMainSection.productAddToCompare}}" stepKey="clickOnAddToCompare"/> - <waitForPageLoad stepKey="waitForProdAddToCmpList"/> - <!--Assert success message--> - <comment userInput="Assert success message" stepKey="assertSuccessMsg"/> - <grabTextFrom selector="{{StorefrontMessagesSection.success}}" stepKey="grabTextFromSuccessMessage"/> - <assertEquals stepKey="assertSuccessMessage"> - <actualResult type="const">($grabTextFromSuccessMessage)</actualResult> - <expectedResult type="string">You added product $$product.name$$ to the comparison list.</expectedResult> - </assertEquals> - <!--See product in the comparison list--> - <comment userInput="See product in the comparison list" stepKey="seeProductInComparisonList"/> - <amOnPage url="{{StorefrontProductComparePage.url}}" stepKey="navigateToComparePage"/> - <waitForPageLoad stepKey="waitForStorefrontProductComparePageLoad"/> - <seeElement selector="{{StorefrontProductCompareMainSection.ProductLinkByName($product.name$)}}" stepKey="seeProductInCompareList"/> - <!--Go to Category page and delete product from comparison list--> - <comment userInput="Go to Category page and delete product from comparison list" stepKey="deleteProdFromCmpList"/> - <amOnPage url="{{StorefrontCategoryPage.url($$category.name$$)}}" stepKey="onCategoryPage"/> - <waitForPageLoad time="30" stepKey="waitForPageLoad1"/> - <click selector="{{StorefrontComparisonSidebarSection.ClearAll}}" stepKey="clickClearAll"/> - <waitForPageLoad time="30" stepKey="waitForConfirmPageLoad"/> - <click selector="{{AdminDeleteRoleSection.confirm}}" stepKey="confirmProdDelate"/> - <waitForPageLoad time="30" stepKey="waitForConfirmLoad"/> - <!--Add product to compare list from Category page--> - <comment userInput="Add product to compare list fom Category page" stepKey="addToCmpFromCategPage"/> - <moveMouseOver selector="{{StorefrontCategoryMainSection.ProductItemInfo}}" stepKey="hoverOverProduct"/> - <click selector="{{StorefrontProductInfoMainSection.productAddToCompare}}" stepKey="clickAddToCompare"/> - <waitForPageLoad stepKey="waitProdAddingToCmpList"/> - <!--Assert success message--> - <comment userInput="Assert success message" stepKey="assertSuccessMsg2"/> - <grabTextFrom selector="{{StorefrontMessagesSection.success}}" stepKey="grabTextFromSuccessMessage2"/> - <assertEquals stepKey="assertSuccessMessage2"> - <actualResult type="const">($grabTextFromSuccessMessage)</actualResult> - <expectedResult type="string">You added product $$product.name$$ to the comparison list.</expectedResult> - </assertEquals> - <!--Check that product displays on add to compare widget--> - <comment userInput="Check that product displays on add to compare widget" stepKey="checkProdNameOnWidget"/> + <argument name="tags" value=""/> + </actionGroup> + + <actionGroup ref="StorefrontOpenProductPageActionGroup" stepKey="openProductStorefront1"> + <argument name="productUrl" value="$$product.custom_attributes[url_key]$$"/> + </actionGroup> + + <actionGroup ref="StorefrontAddProductToCompareActionGroup" stepKey="addProductToCompare1"> + <argument name="productVar" value="$$product$$"/> + </actionGroup> + + <actionGroup ref="StorefrontGoToCategoryPageActionGroup" stepKey="openCategoryPage"> + <argument name="categoryName" value="$$category.name$$"/> + </actionGroup> + + <actionGroup ref="StorefrontOpenAndCheckComparisionActionGroup" stepKey="compareOpenComparePage"/> + + <actionGroup ref="SeeProductInComparisonListActionGroup" stepKey="seeProductInComparisonList"> + <argument name="productVar" value="$$product$$"/> + </actionGroup> + + <actionGroup ref="StorefrontGoToCategoryPageActionGroup" stepKey="openCategoryPage1"> + <argument name="categoryName" value="$$category.name$$"/> + </actionGroup> + + <actionGroup ref="StorefrontClearCompareActionGroup" stepKey="clearList"/> + + <actionGroup ref="StorefrontHoverProductOnCategoryPageActionGroup" stepKey="hoverProduct"/> + + <actionGroup ref="StorefrontAddProductToCompareActionGroup" stepKey="addProductToCompare2"> + <argument name="productVar" value="$$product$$"/> + </actionGroup> + <seeElement selector="{{StorefrontComparisonSidebarSection.ProductTitleByName($$product.name$$)}}" stepKey="seeProdNameOnCmpWidget"/> - <!--See product in the compare page--> - <comment userInput="See product in the compare page" stepKey="seeProductInComparePage"/> - <amOnPage url="{{StorefrontProductComparePage.url}}" stepKey="navigateToComparePage2"/> - <waitForPageLoad stepKey="waitForStorefrontProductComparePageLoad2"/> - <seeElement selector="{{StorefrontProductCompareMainSection.ProductLinkByName($product.name$)}}" stepKey="seeProductInCompareList2"/> + + <actionGroup ref="StorefrontOpenAndCheckComparisionActionGroup" stepKey="compareOpenComparePage1"/> + + <actionGroup ref="SeeProductInComparisonListActionGroup" stepKey="seeProductInComparisonList1"> + <argument name="productVar" value="$$product$$"/> + </actionGroup> + </test> </tests> From 9bea792f606ab0b87e8bfed0ba1652e78ddf9a2a Mon Sep 17 00:00:00 2001 From: Oleh Usik <o.usik@atwix.com> Date: Sat, 7 Nov 2020 17:55:10 +0200 Subject: [PATCH 039/171] add Assert link action group --- .../ActionGroup/AssertLinkActionGroup.xml | 22 +++++++ .../Test/Mftf/Test/AdminPrivacyPolicyTest.xml | 59 +++++++++++++------ 2 files changed, 62 insertions(+), 19 deletions(-) create mode 100644 app/code/Magento/Backend/Test/Mftf/ActionGroup/AssertLinkActionGroup.xml diff --git a/app/code/Magento/Backend/Test/Mftf/ActionGroup/AssertLinkActionGroup.xml b/app/code/Magento/Backend/Test/Mftf/ActionGroup/AssertLinkActionGroup.xml new file mode 100644 index 0000000000000..6fa63d14b9612 --- /dev/null +++ b/app/code/Magento/Backend/Test/Mftf/ActionGroup/AssertLinkActionGroup.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="AssertLinkActionGroup"> + <annotations> + <description>Assert text and url of the links.</description> + </annotations> + <arguments> + <argument name="text" type="string"/> + <argument name="url" type="string"/> + </arguments> + + <seeLink userInput="{{text}}" url="{{url}}" stepKey="assertLinks"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Backend/Test/Mftf/Test/AdminPrivacyPolicyTest.xml b/app/code/Magento/Backend/Test/Mftf/Test/AdminPrivacyPolicyTest.xml index b0fbdb8b5b596..8b0bf1dc963ff 100644 --- a/app/code/Magento/Backend/Test/Mftf/Test/AdminPrivacyPolicyTest.xml +++ b/app/code/Magento/Backend/Test/Mftf/Test/AdminPrivacyPolicyTest.xml @@ -23,70 +23,91 @@ <!-- Logging in Magento admin and checking for Privacy policy footer in dashboard --> <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <closeAdminNotification stepKey="closeAdminNotification"/> - <seeLink userInput="Privacy Policy" url="https://magento.com/sites/default/files/REVISED-MAGENTO-PRIVACY-POLICY.pdf" stepKey="seePrivacyPolicyLinkDashboard"/> - + <actionGroup ref="AssertLinkActionGroup" stepKey="seePrivacyPolicyLinkDashboard"> + <argument name="text" value="Privacy Policy"/> + <argument name="url" value="https://magento.com/sites/default/files/REVISED-MAGENTO-PRIVACY-POLICY.pdf"/> + </actionGroup> <!-- Checking for Privacy policy footer in salesOrderPage --> <actionGroup ref="AdminNavigateMenuActionGroup" stepKey="navigateToSalesOrder"> <argument name="menuUiId" value="magento-sales-sales"/> <argument name="submenuUiId" value="magento-sales-sales-order"/> </actionGroup> - <seeLink userInput="Privacy Policy" url="https://magento.com/sites/default/files/REVISED-MAGENTO-PRIVACY-POLICY.pdf" stepKey="seePrivacyPolicyLinkSalesOrder"/> - + <actionGroup ref="AssertLinkActionGroup" stepKey="seePrivacyPolicyLinkSalesOrder"> + <argument name="text" value="Privacy Policy"/> + <argument name="url" value="https://magento.com/sites/default/files/REVISED-MAGENTO-PRIVACY-POLICY.pdf"/> + </actionGroup> <!-- Checking for Privacy policy footer in catalogProductsPage --> <actionGroup ref="AdminNavigateMenuActionGroup" stepKey="navigateToCatalogProducts"> <argument name="menuUiId" value="magento-catalog-catalog"/> <argument name="submenuUiId" value="magento-catalog-catalog-products"/> </actionGroup> - <seeLink userInput="Privacy Policy" url="https://magento.com/sites/default/files/REVISED-MAGENTO-PRIVACY-POLICY.pdf" stepKey="seePrivacyPolicyLinkCatalogProducts"/> - + <actionGroup ref="AssertLinkActionGroup" stepKey="seePrivacyPolicyLinkCatalogProducts"> + <argument name="text" value="Privacy Policy"/> + <argument name="url" value="https://magento.com/sites/default/files/REVISED-MAGENTO-PRIVACY-POLICY.pdf"/> + </actionGroup> <!-- Checking for Privacy policy footer in customersAllCustomersPage --> <actionGroup ref="AdminNavigateMenuActionGroup" stepKey="navigateToCustomersAllCustomers"> <argument name="menuUiId" value="magento-customer-customer"/> <argument name="submenuUiId" value="magento-customer-customer-manage"/> </actionGroup> - <seeLink userInput="Privacy Policy" url="https://magento.com/sites/default/files/REVISED-MAGENTO-PRIVACY-POLICY.pdf" stepKey="seePrivacyPolicyLinkCustomersAllCustomers"/> - + <actionGroup ref="AssertLinkActionGroup" stepKey="seePrivacyPolicyLinkCustomersAllCustomers"> + <argument name="text" value="Privacy Policy"/> + <argument name="url" value="https://magento.com/sites/default/files/REVISED-MAGENTO-PRIVACY-POLICY.pdf"/> + </actionGroup> <!-- Checking for Privacy policy footer in marketingCatalogPriceRulePage --> <actionGroup ref="AdminNavigateMenuActionGroup" stepKey="navigateToMarketingCatalogPriceRule"> <argument name="menuUiId" value="magento-backend-marketing"/> <argument name="submenuUiId" value="magento-catalogrule-promo-catalog"/> </actionGroup> - <seeLink userInput="Privacy Policy" url="https://magento.com/sites/default/files/REVISED-MAGENTO-PRIVACY-POLICY.pdf" stepKey="seePrivacyPolicyLinkMarketingCatalogPriceRule"/> - + <actionGroup ref="AssertLinkActionGroup" stepKey="seePrivacyPolicyLinkMarketingCatalogPriceRule"> + <argument name="text" value="Privacy Policy"/> + <argument name="url" value="https://magento.com/sites/default/files/REVISED-MAGENTO-PRIVACY-POLICY.pdf"/> + </actionGroup> <!-- Checking for Privacy policy footer in contentBlocksPage --> <actionGroup ref="AdminNavigateMenuActionGroup" stepKey="navigateToContentBlocks"> <argument name="menuUiId" value="magento-backend-content"/> <argument name="submenuUiId" value="magento-cms-cms-block"/> </actionGroup> - <seeLink userInput="Privacy Policy" url="https://magento.com/sites/default/files/REVISED-MAGENTO-PRIVACY-POLICY.pdf" stepKey="seePrivacyPolicyLinkContentBlocks"/> - + <actionGroup ref="AssertLinkActionGroup" stepKey="seePrivacyPolicyLinkContentBlocks"> + <argument name="text" value="Privacy Policy"/> + <argument name="url" value="https://magento.com/sites/default/files/REVISED-MAGENTO-PRIVACY-POLICY.pdf"/> + </actionGroup> <!-- Checking for Privacy policy footer in reportSearcbTermsPage --> <actionGroup ref="AdminNavigateMenuActionGroup" stepKey="navigateToReportsSearchTerms"> <argument name="menuUiId" value="magento-reports-report"/> <argument name="submenuUiId" value="magento-search-report-search-term"/> </actionGroup> - <seeLink userInput="Privacy Policy" url="https://magento.com/sites/default/files/REVISED-MAGENTO-PRIVACY-POLICY.pdf" stepKey="seePrivacyPolicyLinkReportsSearchTerms"/> - + <actionGroup ref="AssertLinkActionGroup" stepKey="seePrivacyPolicyLinkReportsSearchTerms"> + <argument name="text" value="Privacy Policy"/> + <argument name="url" value="https://magento.com/sites/default/files/REVISED-MAGENTO-PRIVACY-POLICY.pdf"/> + </actionGroup> <!-- Checking for Privacy policy footer in storesAllStoresPage --> <actionGroup ref="AdminNavigateMenuActionGroup" stepKey="navigateToStoresAllStores"> <argument name="menuUiId" value="magento-backend-stores"/> <argument name="submenuUiId" value="magento-backend-system-store"/> </actionGroup> - <seeLink userInput="Privacy Policy" url="https://magento.com/sites/default/files/REVISED-MAGENTO-PRIVACY-POLICY.pdf" stepKey="seePrivacyPolicyLinkStoresAllStores"/> - + <actionGroup ref="AssertLinkActionGroup" stepKey="seePrivacyPolicyLinkStoresAllStores"> + <argument name="text" value="Privacy Policy"/> + <argument name="url" value="https://magento.com/sites/default/files/REVISED-MAGENTO-PRIVACY-POLICY.pdf"/> + </actionGroup> <!-- Checking for Privacy policy footer in systemImportPage --> <actionGroup ref="AdminNavigateMenuActionGroup" stepKey="navigateToSystemImport"> <argument name="menuUiId" value="magento-backend-system"/> <argument name="submenuUiId" value="magento-importexport-system-convert-import"/> </actionGroup> - <seeLink userInput="Privacy Policy" url="https://magento.com/sites/default/files/REVISED-MAGENTO-PRIVACY-POLICY.pdf" stepKey="seePrivacyPolicyLinkSystemImport"/> - + <actionGroup ref="AssertLinkActionGroup" stepKey="seePrivacyPolicyLinkSystemImport"> + <argument name="text" value="Privacy Policy"/> + <argument name="url" value="https://magento.com/sites/default/files/REVISED-MAGENTO-PRIVACY-POLICY.pdf"/> + </actionGroup> <!-- Checking for Privacy policy footer in findPartnersAndExtensionsPage --> <actionGroup ref="AdminNavigateMenuActionGroup" stepKey="navigateToFindPartnersAndExtensions"> <argument name="menuUiId" value="magento-marketplace-partners"/> <argument name="submenuUiId" value="magento-marketplace-partners"/> </actionGroup> - <seeLink userInput="Privacy Policy" url="https://magento.com/sites/default/files/REVISED-MAGENTO-PRIVACY-POLICY.pdf" stepKey="seePrivacyPolicyLinkFindPartnersAndExtensions"/> + <actionGroup ref="AssertLinkActionGroup" stepKey="seePrivacyPolicyLinkFindPartnersAndExtensions"> + <argument name="text" value="Privacy Policy"/> + <argument name="url" value="https://magento.com/sites/default/files/REVISED-MAGENTO-PRIVACY-POLICY.pdf"/> + </actionGroup> </test> </tests> From a4f66bd38ebf2d889dbc90ca517d2c4ef1f8869f Mon Sep 17 00:00:00 2001 From: Zach Nanninga <zach@mediotype.com> Date: Wed, 11 Nov 2020 11:25:51 -0600 Subject: [PATCH 040/171] ISSUE-30880 - Add CSP entry to allow google analytics ajax --- app/code/Magento/GoogleAdwords/etc/csp_whitelist.xml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/code/Magento/GoogleAdwords/etc/csp_whitelist.xml b/app/code/Magento/GoogleAdwords/etc/csp_whitelist.xml index d700b0e9e7668..6d8d42a5d3f8f 100644 --- a/app/code/Magento/GoogleAdwords/etc/csp_whitelist.xml +++ b/app/code/Magento/GoogleAdwords/etc/csp_whitelist.xml @@ -14,6 +14,11 @@ <value id="google_analytics" type="host">www.google-analytics.com</value> </values> </policy> + <policy id="connect-src"> + <values> + <value id="google_analytics" type="host">www.google-analytics.com</value> + </values> + </policy> <policy id="img-src"> <values> <value id="google_ad_services" type="host">www.googleadservices.com</value> From 32ae2ffa2441992e13b45e5606b2a0c8fb5d76f0 Mon Sep 17 00:00:00 2001 From: "vadim.malesh" <engcom-vendorworker-charlie@adobe.com> Date: Mon, 16 Nov 2020 13:48:07 +0200 Subject: [PATCH 041/171] fix static --- .../Test/Unit/Controller/Adminhtml/Order/Invoice/ViewTest.php | 1 + 1 file changed, 1 insertion(+) diff --git a/app/code/Magento/Sales/Test/Unit/Controller/Adminhtml/Order/Invoice/ViewTest.php b/app/code/Magento/Sales/Test/Unit/Controller/Adminhtml/Order/Invoice/ViewTest.php index d9003b7b4f061..3429b3df85b8a 100644 --- a/app/code/Magento/Sales/Test/Unit/Controller/Adminhtml/Order/Invoice/ViewTest.php +++ b/app/code/Magento/Sales/Test/Unit/Controller/Adminhtml/Order/Invoice/ViewTest.php @@ -31,6 +31,7 @@ /** * @SuppressWarnings(PHPMD.CouplingBetweenObjects) * @SuppressWarnings(PHPMD.ExcessiveMethodLength) + * @SuppressWarnings(PHPMD.TooManyFields) */ class ViewTest extends TestCase { From e38122ae332af8b324a14d1f93de979023a126e8 Mon Sep 17 00:00:00 2001 From: "vadim.malesh" <engcom-vendorworker-charlie@adobe.com> Date: Wed, 18 Nov 2020 13:44:15 +0200 Subject: [PATCH 042/171] fix i18n --- app/code/Magento/Sales/i18n/en_US.csv | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/app/code/Magento/Sales/i18n/en_US.csv b/app/code/Magento/Sales/i18n/en_US.csv index dea0b76437ca7..c429a10411af4 100644 --- a/app/code/Magento/Sales/i18n/en_US.csv +++ b/app/code/Magento/Sales/i18n/en_US.csv @@ -284,8 +284,8 @@ Go to Home Page,Go to Home Page We can't find this wish list.,We can't find this wish list. "We could not add a product to cart by the ID ""%1"".","We could not add a product to cart by the ID ""%1""." There is an error in one of the option rows.,There is an error in one of the option rows. -Shipping Address: ,Shipping Address: -Billing Address: ,Billing Address: +"Shipping Address: ","Shipping Address: " +"Billing Address: ","Billing Address: " Please specify order items.,Please specify order items. Please specify a shipping method.,Please specify a shipping method. Please specify a payment method.,Please specify a payment method. @@ -383,8 +383,8 @@ Authorization,Authorization Please set a proper payment and order id.,Please set a proper payment and order id. Please enter a Transaction ID.,Please enter a Transaction ID. You can't do this without a transaction object.,You can't do this without a transaction object. -Order # ,Order # -Order Date: ,Order Date: +"Order # ","Order # " +"Order Date: ","Order Date: " Sold to:,Sold to: Ship to:,Ship to: Payment Method:,Payment Method: @@ -400,8 +400,8 @@ Total (ex),Total (ex) Qty,Qty Tax,Tax Total (inc),Total (inc) -Credit Memo # ,Credit Memo # -Invoice # ,Invoice # +"Credit Memo # ","Credit Memo # " +"Invoice # ","Invoice # " The order object is not specified.,The order object is not specified. The source object is not specified.,The source object is not specified. An item object is not specified.,An item object is not specified. @@ -409,7 +409,7 @@ A PDF object is not specified.,A PDF object is not specified. A PDF page object is not specified.,A PDF page object is not specified. Excl. Tax,Excl. Tax Incl. Tax,Incl. Tax -Packing Slip # ,Packing Slip # +"Packing Slip # ","Packing Slip # " title,title The PDF total model %1 must be or extend \Magento\Sales\Model\Order\Pdf\Total\DefaultTotal.,The PDF total model %1 must be or extend \Magento\Sales\Model\Order\Pdf\Total\DefaultTotal. We cannot register an existing shipment,We cannot register an existing shipment @@ -669,7 +669,7 @@ Your %store_name order has shipped,Your %store_name order has shipped Your shipping confirmation is below. Thank you again for your business.,Your shipping confirmation is below. Thank you again for your business. Your Shipment #%shipment_id for Order #%order_id,Your Shipment #%shipment_id for Order #%order_id Update to your %store_name shipment,Update to your %store_name shipment -Gift Options for ,Gift Options for +"Gift Options for ","Gift Options for " Add Products,Add Products You have item changes,You have item changes Ok,Ok From 54788a81bbe47a963d68d4de0e2ed3732d5fda51 Mon Sep 17 00:00:00 2001 From: Zach Nanninga <zach@mediotype.com> Date: Wed, 18 Nov 2020 13:27:16 -0600 Subject: [PATCH 043/171] ISSUE-30286 - Change layout update removal button rendering from a block to directly in the template to prevent inaccurate js element selection in SecureHtmlRenderer event listener generation. --- .../Widget/Instance/Edit/Tab/Main/Layout.php | 19 ------------------- .../templates/instance/edit/layout.phtml | 3 ++- 2 files changed, 2 insertions(+), 20 deletions(-) diff --git a/app/code/Magento/Widget/Block/Adminhtml/Widget/Instance/Edit/Tab/Main/Layout.php b/app/code/Magento/Widget/Block/Adminhtml/Widget/Instance/Edit/Tab/Main/Layout.php index c48bf9e7e4c7a..a704a5676f632 100644 --- a/app/code/Magento/Widget/Block/Adminhtml/Widget/Instance/Edit/Tab/Main/Layout.php +++ b/app/code/Magento/Widget/Block/Adminhtml/Widget/Instance/Edit/Tab/Main/Layout.php @@ -315,25 +315,6 @@ public function getAddLayoutButtonHtml() return $button->toHtml(); } - /** - * Retrieve remove layout button html - * - * @return string - */ - public function getRemoveLayoutButtonHtml() - { - $button = $this->getLayout()->createBlock( - \Magento\Backend\Block\Widget\Button::class - )->setData( - [ - 'label' => $this->escapeHtmlAttr(__('Remove Layout Update')), - 'onclick' => 'WidgetInstance.removePageGroup(this)', - 'class' => 'action-delete', - ] - ); - return $button->toHtml(); - } - /** * Prepare and retrieve page groups data of widget instance * diff --git a/app/code/Magento/Widget/view/adminhtml/templates/instance/edit/layout.phtml b/app/code/Magento/Widget/view/adminhtml/templates/instance/edit/layout.phtml index 93c5cac33f947..2d4f88709fd91 100644 --- a/app/code/Magento/Widget/view/adminhtml/templates/instance/edit/layout.phtml +++ b/app/code/Magento/Widget/view/adminhtml/templates/instance/edit/layout.phtml @@ -38,7 +38,8 @@ var pageGroupTemplate = '<div class="fieldset-wrapper page_group_container" id=" '<label for="widget_instance[<%- data.id %>][page_group]">Display on <span class="required">*</span></label>'+ '{$block->getDisplayOnSelectHtml()}'+ '<div class="actions">'+ - {$jsonHelper->jsonEncode($block->getRemoveLayoutButtonHtml())} + + '<button title="{$escaper->escapeHtmlAttr(__('Remove Layout Update'))}" type="button"'+ + ' class="action-default scalable action-delete" onclick="WidgetInstance.removePageGroup(this)" />'+ '</div>'+ '</div>'+ '<div class="fieldset-wrapper-content">'+ From 2fbfb1fc1e99da956a1ac579e63eb1af1adce90e Mon Sep 17 00:00:00 2001 From: lykhachov <ilyalykhachov.com.ua> Date: Thu, 19 Nov 2020 10:07:47 +0200 Subject: [PATCH 044/171] added "changelog" to whitelist --- .../static/testsuite/Magento/Test/Legacy/_files/words_ce.xml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/dev/tests/static/testsuite/Magento/Test/Legacy/_files/words_ce.xml b/dev/tests/static/testsuite/Magento/Test/Legacy/_files/words_ce.xml index 92e7b15efed29..ccad52fae453e 100644 --- a/dev/tests/static/testsuite/Magento/Test/Legacy/_files/words_ce.xml +++ b/dev/tests/static/testsuite/Magento/Test/Legacy/_files/words_ce.xml @@ -73,5 +73,9 @@ <path>app/design/adminhtml/Magento/backend/Magento_Rma/web/css/source/_module.less</path> <word>rma</word> </item> + <item> + <path>app/code/Magento/Eav/Model/Mview/ChangeLogBatchWalker.php</path> + <word>changelog</word> + </item> </whitelist> </config> From 8cfc5393e16b818ef0ade5fc6a8c32b225bdbffd Mon Sep 17 00:00:00 2001 From: Anna Pak <a.pak@atwix.com> Date: Thu, 19 Nov 2020 16:19:27 +0200 Subject: [PATCH 045/171] adding AdminFillAccountInformationOnCreateOrderPageActionGroup --- ...nformationOnCreateOrderPageActionGroup.xml | 19 +++++++++++++++++++ ...vailabilityCreditMemoWithNoPaymentTest.xml | 6 ++++-- ...reateOrderWithMinimumAmountEnabledTest.xml | 8 +++++--- ...ubmitsOrderPaymentMethodValidationTest.xml | 8 +++++--- ...minSubmitsOrderWithAndWithoutEmailTest.xml | 6 ++++-- ...rderWithAndWithoutFieldsValidationTest.xml | 6 ++++-- .../Test/AdminCheckingTaxReportGridTest.xml | 6 ++++-- 7 files changed, 45 insertions(+), 14 deletions(-) create mode 100644 app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminFillAccountInformationOnCreateOrderPageActionGroup.xml diff --git a/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminFillAccountInformationOnCreateOrderPageActionGroup.xml b/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminFillAccountInformationOnCreateOrderPageActionGroup.xml new file mode 100644 index 0000000000000..acf4ff8b43eca --- /dev/null +++ b/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminFillAccountInformationOnCreateOrderPageActionGroup.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="AdminFillAccountInformationOnCreateOrderPageActionGroup"> + <arguments> + <argument name="group" defaultValue="{{GeneralCustomerGroup.code}}" type="string"/> + <argument name="email" type="string"/> + </arguments> + <selectOption selector="{{AdminOrderFormAccountSection.group}}" userInput="{{group}}" stepKey="selectCustomerGroup"/> + <fillField selector="{{AdminOrderFormAccountSection.email}}" userInput="{{email}}" stepKey="fillCustomerEmail"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminAvailabilityCreditMemoWithNoPaymentTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminAvailabilityCreditMemoWithNoPaymentTest.xml index 182549a6fe301..4379fc283510d 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminAvailabilityCreditMemoWithNoPaymentTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminAvailabilityCreditMemoWithNoPaymentTest.xml @@ -61,8 +61,10 @@ <click selector="{{AdminOrderFormItemsSection.updateItemsAndQuantities}}" stepKey="clickUpdateItemsAndQuantitiesButton"/> <!--Fill customer group and customer email--> - <selectOption selector="{{AdminOrderFormAccountSection.group}}" userInput="{{GeneralCustomerGroup.code}}" stepKey="selectCustomerGroup"/> - <fillField selector="{{AdminOrderFormAccountSection.email}}" userInput="{{Simple_US_Customer.email}}" stepKey="fillCustomerEmail"/> + <comment userInput="Fill Account Information" stepKey="selectCustomerGroup"/> + <actionGroup ref="AdminFillAccountInformationOnCreateOrderPageActionGroup" stepKey="fillCustomerEmail"> + <argument name="email" value="{{Simple_US_Customer.email}}"/> + </actionGroup> <!--Fill customer address information--> <actionGroup ref="FillOrderCustomerInformationActionGroup" stepKey="fillCustomerAddress"> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateOrderWithMinimumAmountEnabledTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateOrderWithMinimumAmountEnabledTest.xml index b5c9e9443d1f9..2d8b8e9b8fb46 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateOrderWithMinimumAmountEnabledTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateOrderWithMinimumAmountEnabledTest.xml @@ -45,9 +45,11 @@ </actionGroup> <!--Fill customer group information--> - <selectOption selector="{{AdminOrderFormAccountSection.group}}" userInput="{{GeneralCustomerGroup.code}}" stepKey="selectGroup"/> - <fillField selector="{{AdminOrderFormAccountSection.email}}" userInput="{{Simple_US_Customer.email}}" stepKey="fillEmail"/> - + <comment userInput="Fill Account Information" stepKey="selectGroup"/> + <actionGroup ref="AdminFillAccountInformationOnCreateOrderPageActionGroup" stepKey="fillEmail"> + <argument name="email" value="{{Simple_US_Customer.email}}"/> + </actionGroup> + <!--Fill customer address information--> <actionGroup ref="FillOrderCustomerInformationActionGroup" stepKey="fillCustomerAddress"> <argument name="customer" value="Simple_US_Customer"/> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminSubmitsOrderPaymentMethodValidationTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminSubmitsOrderPaymentMethodValidationTest.xml index bd6a21e3112ca..5956a1a619fab 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminSubmitsOrderPaymentMethodValidationTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminSubmitsOrderPaymentMethodValidationTest.xml @@ -48,9 +48,11 @@ <scrollToTopOfPage stepKey="scrollToTopOfOrderFormPage" after="seePaymentMethodRequired"/> <!--Fill customer group and customer email--> - <selectOption selector="{{AdminOrderFormAccountSection.group}}" userInput="{{GeneralCustomerGroup.code}}" stepKey="selectCustomerGroup" after="scrollToTopOfOrderFormPage"/> - <fillField selector="{{AdminOrderFormAccountSection.email}}" userInput="{{Simple_US_Customer.email}}" stepKey="fillCustomerEmail" after="selectCustomerGroup"/> - + <comment userInput="Fill Account Information" stepKey="selectCustomerGroup"/> + <actionGroup ref="AdminFillAccountInformationOnCreateOrderPageActionGroup" stepKey="fillCustomerEmail"> + <argument name="email" value="{{Simple_US_Customer.email}}"/> + </actionGroup> + <!--Fill customer address information--> <actionGroup ref="FillOrderCustomerInformationActionGroup" stepKey="fillCustomerAddress" after="fillCustomerEmail"> <argument name="customer" value="Simple_US_Customer"/> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminSubmitsOrderWithAndWithoutEmailTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminSubmitsOrderWithAndWithoutEmailTest.xml index 727aef99352ec..215c888833885 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminSubmitsOrderWithAndWithoutEmailTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminSubmitsOrderWithAndWithoutEmailTest.xml @@ -46,8 +46,10 @@ </actionGroup> <!--Fill customer group and customer email--> - <selectOption selector="{{AdminOrderFormAccountSection.group}}" userInput="{{GeneralCustomerGroup.code}}" stepKey="selectCustomerGroup" after="addSimpleProductToOrder"/> - <fillField selector="{{AdminOrderFormAccountSection.email}}" userInput="{{Simple_US_Customer.email}}" stepKey="fillCustomerEmail" after="selectCustomerGroup"/> + <comment userInput="Fill Account Information" stepKey="selectCustomerGroup" after="addSimpleProductToOrder"/> + <actionGroup ref="AdminFillAccountInformationOnCreateOrderPageActionGroup" stepKey="fillCustomerEmail" after="selectCustomerGroup"> + <argument name="email" value="{{Simple_US_Customer.email}}"/> + </actionGroup> <!--Fill customer address information--> <actionGroup ref="FillOrderCustomerInformationActionGroup" stepKey="fillCustomerAddress" after="fillCustomerEmail"> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminSubmitsOrderWithAndWithoutFieldsValidationTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminSubmitsOrderWithAndWithoutFieldsValidationTest.xml index 2bedb16f3d1dc..48ce356a43174 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminSubmitsOrderWithAndWithoutFieldsValidationTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminSubmitsOrderWithAndWithoutFieldsValidationTest.xml @@ -45,8 +45,10 @@ </actionGroup> <!--Fill customer group and customer email--> - <selectOption selector="{{AdminOrderFormAccountSection.group}}" userInput="{{GeneralCustomerGroup.code}}" stepKey="selectCustomerGroup" after="addSimpleProductToOrder"/> - <fillField selector="{{AdminOrderFormAccountSection.email}}" userInput="{{Simple_US_Customer.email}}" stepKey="fillCustomerEmail" after="selectCustomerGroup"/> + <comment userInput="Fill Account Information" stepKey="selectCustomerGroup" after="addSimpleProductToOrder"/> + <actionGroup ref="AdminFillAccountInformationOnCreateOrderPageActionGroup" stepKey="fillCustomerEmail" after="selectCustomerGroup"> + <argument name="email" value="{{Simple_US_Customer.email}}"/> + </actionGroup> <!--Fill wrong customer address information--> <actionGroup ref="FillOrderCustomerInformationActionGroup" stepKey="fillWrongCustomerAddress" after="fillCustomerEmail"> diff --git a/app/code/Magento/Tax/Test/Mftf/Test/AdminCheckingTaxReportGridTest.xml b/app/code/Magento/Tax/Test/Mftf/Test/AdminCheckingTaxReportGridTest.xml index 84278468a0590..61482d7f5a567 100644 --- a/app/code/Magento/Tax/Test/Mftf/Test/AdminCheckingTaxReportGridTest.xml +++ b/app/code/Magento/Tax/Test/Mftf/Test/AdminCheckingTaxReportGridTest.xml @@ -154,8 +154,10 @@ </actionGroup> <!--Fill customer group and customer email--> - <selectOption selector="{{AdminOrderFormAccountSection.group}}" userInput="{{GeneralCustomerGroup.code}}" stepKey="selectCustomerGroup"/> - <fillField selector="{{AdminOrderFormAccountSection.email}}" userInput="{{Simple_US_Customer.email}}" stepKey="fillCustomerEmail"/> + <comment userInput="Fill Account Information" stepKey="selectCustomerGroup"/> + <actionGroup ref="AdminFillAccountInformationOnCreateOrderPageActionGroup" stepKey="fillCustomerEmail"> + <argument name="email" value="{{Simple_US_Customer.email}}"/> + </actionGroup> <!--Fill customer address information--> <actionGroup ref="FillOrderCustomerInformationActionGroup" stepKey="fillCustomerAddress"> From b2a767dcd923431b6f624b13c840556cb2d29196 Mon Sep 17 00:00:00 2001 From: Anna Pak <a.pak@atwix.com> Date: Thu, 19 Nov 2020 16:31:12 +0200 Subject: [PATCH 046/171] updating before/after attributes in AdminSubmitsOrderPaymentMethodValidationTest --- .../Test/AdminSubmitsOrderPaymentMethodValidationTest.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminSubmitsOrderPaymentMethodValidationTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminSubmitsOrderPaymentMethodValidationTest.xml index 5956a1a619fab..1e09f308018d2 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminSubmitsOrderPaymentMethodValidationTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminSubmitsOrderPaymentMethodValidationTest.xml @@ -48,8 +48,8 @@ <scrollToTopOfPage stepKey="scrollToTopOfOrderFormPage" after="seePaymentMethodRequired"/> <!--Fill customer group and customer email--> - <comment userInput="Fill Account Information" stepKey="selectCustomerGroup"/> - <actionGroup ref="AdminFillAccountInformationOnCreateOrderPageActionGroup" stepKey="fillCustomerEmail"> + <comment userInput="Fill Account Information" stepKey="selectCustomerGroup" after="scrollToTopOfOrderFormPage"/> + <actionGroup ref="AdminFillAccountInformationOnCreateOrderPageActionGroup" stepKey="fillCustomerEmail" after="selectCustomerGroup"> <argument name="email" value="{{Simple_US_Customer.email}}"/> </actionGroup> From 1089f15b276cbbe30c2279349a934716148321be Mon Sep 17 00:00:00 2001 From: Anna Pak <a.pak@atwix.com> Date: Thu, 19 Nov 2020 19:08:10 +0200 Subject: [PATCH 047/171] restoring stepKeys --- .../AddOutOfStockProductToCompareListTest.xml | 60 ++++++++++++++----- 1 file changed, 46 insertions(+), 14 deletions(-) diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AddOutOfStockProductToCompareListTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AddOutOfStockProductToCompareListTest.xml index b2fbf2ae3810a..c28c5a040e553 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AddOutOfStockProductToCompareListTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AddOutOfStockProductToCompareListTest.xml @@ -38,15 +38,21 @@ <deleteData createDataKey="product" stepKey="deleteProduct"/> <deleteData createDataKey="category" stepKey="deleteCategory"/> </after> + <comment userInput="Open product page | Comment is kept to preserve the step key for backward compatibility" stepKey="openProdPage"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="goToSimpleProductPage"/> - <actionGroup ref="StorefrontOpenProductPageActionGroup" stepKey="openProductStorefront"> + <actionGroup ref="StorefrontOpenProductPageActionGroup" stepKey="waitForSimpleProductPage"> <argument name="productUrl" value="$$product.custom_attributes[url_key]$$"/> </actionGroup> - + + <comment userInput="'Add to compare' link is not available | Comment is kept to preserve the step key for backward compatibility" stepKey="addToCompareLinkAvailability"/> + <dontSeeElement selector="{{StorefrontProductInfoMainSection.productAddToCompare}}" stepKey="dontSeeAddToCompareLink"/> + <comment userInput="Turn on 'out of stock' config | Comment is kept to preserve the step key for backward compatibility" stepKey="onOutOfStockConfig"/> <magentoCLI command="config:set {{CatalogInventoryOptionsShowOutOfStockEnable.path}} {{CatalogInventoryOptionsShowOutOfStockEnable.value}}" stepKey="setConfigShowOutOfStockTrue"/> + <comment userInput="Clear cache and reindex | Comment is kept to preserve the step key for backward compatibility" stepKey="cleanCache"/> <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> <argument name="indices" value=""/> </actionGroup> @@ -54,41 +60,67 @@ <argument name="tags" value=""/> </actionGroup> - <actionGroup ref="StorefrontOpenProductPageActionGroup" stepKey="openProductStorefront1"> + <comment userInput="Open product page | Comment is kept to preserve the step key for backward compatibility" stepKey="openProductPage"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="goToSimpleProductPage2"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForSimpleProductPage2"/> + <actionGroup ref="StorefrontOpenProductPageActionGroup" stepKey="seeAddToCompareLink"> <argument name="productUrl" value="$$product.custom_attributes[url_key]$$"/> </actionGroup> + + <comment userInput="Click on 'Add to Compare' link | Comment is kept to preserve the step key for backward compatibility" stepKey="clickOnAddToCompareLink"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="clickOnAddToCompare"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForProdAddToCmpList"/> + <comment userInput="Assert success message | Comment is kept to preserve the step key for backward compatibility" stepKey="assertSuccessMsg"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="grabTextFromSuccessMessage"/> - <actionGroup ref="StorefrontAddProductToCompareActionGroup" stepKey="addProductToCompare1"> + <actionGroup ref="StorefrontAddProductToCompareActionGroup" stepKey="assertSuccessMessage"> <argument name="productVar" value="$$product$$"/> </actionGroup> - <actionGroup ref="StorefrontGoToCategoryPageActionGroup" stepKey="openCategoryPage"> + <comment userInput="See product in the comparison list | Comment is kept to preserve the step key for backward compatibility" stepKey="seeProductInComparisonList"/> + + <actionGroup ref="StorefrontGoToCategoryPageActionGroup" stepKey="openCategoryPage"> <argument name="categoryName" value="$$category.name$$"/> </actionGroup> - <actionGroup ref="StorefrontOpenAndCheckComparisionActionGroup" stepKey="compareOpenComparePage"/> + <actionGroup ref="StorefrontOpenAndCheckComparisionActionGroup" stepKey="navigateToComparePage"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForStorefrontProductComparePageLoad"/> - <actionGroup ref="SeeProductInComparisonListActionGroup" stepKey="seeProductInComparisonList"> + <actionGroup ref="SeeProductInComparisonListActionGroup" stepKey="seeProductInCompareList"> <argument name="productVar" value="$$product$$"/> </actionGroup> - <actionGroup ref="StorefrontGoToCategoryPageActionGroup" stepKey="openCategoryPage1"> + + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="deleteProdFromCmpList"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="onCategoryPage"/> + <actionGroup ref="StorefrontGoToCategoryPageActionGroup" stepKey="waitForPageLoad1"> <argument name="categoryName" value="$$category.name$$"/> </actionGroup> - <actionGroup ref="StorefrontClearCompareActionGroup" stepKey="clearList"/> + <actionGroup ref="StorefrontClearCompareActionGroup" stepKey="clickClearAll"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForConfirmPageLoad"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="confirmProdDelate"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForConfirmLoad"/> + <comment userInput="Add product to compare list fom Category page | Comment is kept to preserve the step key for backward compatibility" stepKey="addToCmpFromCategPage"/> - <actionGroup ref="StorefrontHoverProductOnCategoryPageActionGroup" stepKey="hoverProduct"/> + <actionGroup ref="StorefrontHoverProductOnCategoryPageActionGroup" stepKey="hoverOverProduct"/> - <actionGroup ref="StorefrontAddProductToCompareActionGroup" stepKey="addProductToCompare2"> + <actionGroup ref="StorefrontAddProductToCompareActionGroup" stepKey="clickAddToCompare"> <argument name="productVar" value="$$product$$"/> </actionGroup> - + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitProdAddingToCmpList"/> + <comment userInput="Assert success message | Comment is kept to preserve the step key for backward compatibility" stepKey="assertSuccessMsg2"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="grabTextFromSuccessMessage2"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="assertSuccessMessage2"/> + + <comment userInput="Check that product displays on add to compare widget | Comment is kept to preserve the step key for backward compatibility" stepKey="checkProdNameOnWidget"/> <seeElement selector="{{StorefrontComparisonSidebarSection.ProductTitleByName($$product.name$$)}}" stepKey="seeProdNameOnCmpWidget"/> - <actionGroup ref="StorefrontOpenAndCheckComparisionActionGroup" stepKey="compareOpenComparePage1"/> + <comment userInput="See product in the compare page" stepKey="seeProductInComparePage"/> + <actionGroup ref="StorefrontOpenAndCheckComparisionActionGroup" stepKey="navigateToComparePage2"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForStorefrontProductComparePageLoad2"/> - <actionGroup ref="SeeProductInComparisonListActionGroup" stepKey="seeProductInComparisonList1"> + <actionGroup ref="SeeProductInComparisonListActionGroup" stepKey="seeProductInCompareList2"> <argument name="productVar" value="$$product$$"/> </actionGroup> From 1921d68f1d57924e089d794ae72e4724107383b0 Mon Sep 17 00:00:00 2001 From: Zach Nanninga <zach@mediotype.com> Date: Thu, 19 Nov 2020 14:51:43 -0600 Subject: [PATCH 048/171] ISSU-30286 - Update MFTF widget test to confirm add layout / remove layout buttons work as expected. --- .../Test/Mftf/ActionGroup/AdminCreateWidgetActionGroup.xml | 4 ++++ .../Widget/Test/Mftf/Section/AdminNewWidgetSection.xml | 2 ++ 2 files changed, 6 insertions(+) diff --git a/app/code/Magento/Widget/Test/Mftf/ActionGroup/AdminCreateWidgetActionGroup.xml b/app/code/Magento/Widget/Test/Mftf/ActionGroup/AdminCreateWidgetActionGroup.xml index e657b3eb73b53..5cf135f158130 100644 --- a/app/code/Magento/Widget/Test/Mftf/ActionGroup/AdminCreateWidgetActionGroup.xml +++ b/app/code/Magento/Widget/Test/Mftf/ActionGroup/AdminCreateWidgetActionGroup.xml @@ -23,6 +23,10 @@ <fillField selector="{{AdminNewWidgetSection.widgetTitle}}" userInput="{{widget.name}}" stepKey="fillTitle"/> <selectOption selector="{{AdminNewWidgetSection.widgetStoreIds}}" userInput="{{widget.store_ids[0]}}" stepKey="setWidgetStoreIds"/> <click selector="{{AdminNewWidgetSection.addLayoutUpdate}}" stepKey="clickAddLayoutUpdate"/> + <click selector="{{AdminNewWidgetSection.addLayoutUpdate}}" stepKey="clickAddLayoutUpdate2"/> + <seeNumberOfElements userInput="2" selector="{{AdminNewWidgetSection.layoutUpdate}}" stepKey="seeTwoLayoutUpdates"/> + <click selector="{{AdminNewWidgetSection.removeLastLayoutUpdate}}" stepKey="clickRemoveLastLayoutUpdate"/> + <seeNumberOfElements userInput="1" selector="{{AdminNewWidgetSection.layoutUpdate}}" stepKey="seeOneLayoutUpdate"/> <selectOption selector="{{AdminNewWidgetSection.selectDisplayOn}}" userInput="{{widget.display_on}}" stepKey="setDisplayOn"/> <waitForAjaxLoad stepKey="waitForLoad"/> <selectOption selector="{{AdminNewWidgetSection.selectContainer}}" userInput="{{widget.container}}" stepKey="setContainer"/> diff --git a/app/code/Magento/Widget/Test/Mftf/Section/AdminNewWidgetSection.xml b/app/code/Magento/Widget/Test/Mftf/Section/AdminNewWidgetSection.xml index 8a17b589d7ab2..217375fb85a19 100644 --- a/app/code/Magento/Widget/Test/Mftf/Section/AdminNewWidgetSection.xml +++ b/app/code/Magento/Widget/Test/Mftf/Section/AdminNewWidgetSection.xml @@ -17,6 +17,8 @@ <element name="widgetStoreIds" type="select" selector="#store_ids"/> <element name="widgetSortOrder" type="input" selector="#sort_order"/> <element name="addLayoutUpdate" type="button" selector=".action-default.scalable.action-add"/> + <element name="layoutUpdate" type="block" selector=".page_group_container"/> + <element name="removeLastLayoutUpdate" type="button" selector=".page_group_container:last-child .action-default.scalable.action-delete"/> <element name="selectDisplayOn" type="select" selector="#widget_instance[0][page_group]"/> <element name="selectContainer" type="select" selector="#all_pages_0>table>tbody>tr>td:nth-child(1)>div>div>select"/> <element name="displayOnByIndex" type="select" selector="select[name='widget_instance[{{index}}][page_group]']" parameterized="true"/> From ff2451b8420076f7362f3b547f090024f78c0813 Mon Sep 17 00:00:00 2001 From: Sergiy Vasiutynskyi <s.vasiutynskyi@atwix.com> Date: Fri, 20 Nov 2020 08:49:18 +0200 Subject: [PATCH 049/171] Removed 'cache:flush' commands from tests --- .../Test/StorefrontOnlyXProductLeftForSimpleProductsTest.xml | 2 +- ...rifyCheckboxIsDisabledCreatePermanentRedirectSetNoTest.xml | 4 ++-- .../Test/AdminLoginAsCustomerAddProductToWishlistTest.xml | 4 ++-- .../Test/Mftf/Test/AdminLoginAsCustomerAutoDetectionTest.xml | 4 ++-- .../Test/AdminLoginAsCustomerDirectlyToCustomWebsiteTest.xml | 4 ++-- .../Test/AdminLoginAsCustomerEditCustomersAddressTest.xml | 4 ++-- ...oginAsCustomerLogNotShownIfLoginAsCustomerDisabledTest.xml | 2 +- .../Test/Mftf/Test/AdminLoginAsCustomerLoggingTest.xml | 4 ++-- .../AdminLoginAsCustomerManualChooseFromOrderPageTest.xml | 4 ++-- .../Test/Mftf/Test/AdminLoginAsCustomerManualChooseTest.xml | 4 ++-- .../Test/AdminLoginAsCustomerMultishippingLoggingTest.xml | 4 ++-- .../Test/Mftf/Test/AdminLoginAsCustomerPlaceOrderTest.xml | 4 ++-- .../Test/Mftf/Test/AdminLoginAsCustomerReorderTest.xml | 4 ++-- .../Test/AdminLoginAsCustomerSubscribeToNewsletterTest.xml | 4 ++-- .../Test/Mftf/Test/AdminLoginAsCustomerUserLogoutTest.xml | 4 ++-- .../Mftf/Test/AdminLoginAsCustomerUserSingleSessionTest.xml | 4 ++-- .../Mftf/Test/AdminNoAccessToLoginAsCustomerButtonTest.xml | 4 ++-- .../Test/AdminNoAccessToLoginAsCustomerConfigurationTest.xml | 4 ++-- .../Test/AdminUINotShownIfLoginAsCustomerDisabledTest.xml | 2 +- .../Test/StorefrontLoginAsCustomerNotificationBannerTest.xml | 4 ++-- 20 files changed, 37 insertions(+), 37 deletions(-) diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontOnlyXProductLeftForSimpleProductsTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontOnlyXProductLeftForSimpleProductsTest.xml index dc608a7f12dd3..2063054a94d0b 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontOnlyXProductLeftForSimpleProductsTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontOnlyXProductLeftForSimpleProductsTest.xml @@ -23,7 +23,7 @@ <requiredEntity createDataKey="createCategory"/> </createData> <magentoCLI command="config:set {{CatalogInventoryOptionsOnlyXleftThreshold.path}} 10000" stepKey="setStockThresholdQty"/> - <magentoCLI command="cache:flush config" stepKey="flushCache"/> + <comment userInput="Adding the comment to replace 'cache:flush' command for preserving Backward Compatibility" stepKey="flushCache"/> </before> <after> <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> diff --git a/app/code/Magento/CatalogUrlRewrite/Test/Mftf/Test/AdminVerifyCheckboxIsDisabledCreatePermanentRedirectSetNoTest.xml b/app/code/Magento/CatalogUrlRewrite/Test/Mftf/Test/AdminVerifyCheckboxIsDisabledCreatePermanentRedirectSetNoTest.xml index d529c6dd3ecc3..fc9eb8529da6f 100644 --- a/app/code/Magento/CatalogUrlRewrite/Test/Mftf/Test/AdminVerifyCheckboxIsDisabledCreatePermanentRedirectSetNoTest.xml +++ b/app/code/Magento/CatalogUrlRewrite/Test/Mftf/Test/AdminVerifyCheckboxIsDisabledCreatePermanentRedirectSetNoTest.xml @@ -18,7 +18,7 @@ </annotations> <before> <magentoCLI command="config:set {{DisableCreatePermanentRedirect.path}} {{DisableCreatePermanentRedirect.value}}" stepKey="enableCreatePermanentRedirect"/> - <magentoCLI command="cache:flush" stepKey="flushCache"/> + <comment userInput="Adding the comment to replace 'cache:flush' command for preserving Backward Compatibility" stepKey="flushCache"/> <createData entity="_defaultCategory" stepKey="createDefaultCategory"/> <createData entity="SimpleProduct" stepKey="createSimpleProduct"> <requiredEntity createDataKey="createDefaultCategory"/> @@ -29,7 +29,7 @@ <deleteData createDataKey="createSimpleProduct" stepKey="deleteSimpleProduct"/> <deleteData createDataKey="createDefaultCategory" stepKey="deleteDefaultCategory"/> <magentoCLI command="config:set {{EnableCreatePermanentRedirect.path}} {{EnableCreatePermanentRedirect.value}}" stepKey="disableCreatePermanentRedirect"/> - <magentoCLI command="cache:flush" stepKey="flushCache"/> + <comment userInput="Adding the comment to replace 'cache:flush' command for preserving Backward Compatibility" stepKey="flushCache"/> <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> </after> <actionGroup ref="AdminProductPageOpenByIdActionGroup" stepKey="goToProductEditPage"> diff --git a/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerAddProductToWishlistTest.xml b/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerAddProductToWishlistTest.xml index c083383dd8861..f5919c6ccbb80 100644 --- a/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerAddProductToWishlistTest.xml +++ b/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerAddProductToWishlistTest.xml @@ -23,7 +23,7 @@ stepKey="enableLoginAsCustomer"/> <magentoCLI command="config:set {{LoginAsCustomerStoreViewLogin.path}} 0" stepKey="enableLoginAsCustomerAutoDetection"/> - <magentoCLI command="cache:flush config" stepKey="flushCacheBeforeTestRun"/> + <comment userInput="Adding the comment to replace 'cache:flush' command for preserving Backward Compatibility" stepKey="flushCacheBeforeTestRun"/> <createData entity="_defaultCategory" stepKey="createCategory"/> <createData entity="SimpleProduct" stepKey="createSimpleProduct"> <requiredEntity createDataKey="createCategory"/> @@ -38,7 +38,7 @@ <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> <magentoCLI command="config:set {{LoginAsCustomerConfigDataEnabled.path}} 0" stepKey="disableLoginAsCustomer"/> - <magentoCLI command="cache:flush config" stepKey="flushCacheAfterTestRun"/> + <comment userInput="Adding the comment to replace 'cache:flush' command for preserving Backward Compatibility" stepKey="flushCacheAfterTestRun"/> </after> <!-- Admin Login as Customer from Customer page --> diff --git a/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerAutoDetectionTest.xml b/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerAutoDetectionTest.xml index 1175103395427..09e48b5c61aaf 100644 --- a/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerAutoDetectionTest.xml +++ b/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerAutoDetectionTest.xml @@ -28,7 +28,7 @@ <magentoCLI command="config:set {{StorefrontEnableAddStoreCodeToUrls.path}} {{StorefrontEnableAddStoreCodeToUrls.value}}" stepKey="enableAddStoreCodeToUrls"/> - <magentoCLI command="cache:flush config" stepKey="flushCacheBeforeTestRun"/> + <comment userInput="Adding the comment to replace 'cache:flush' command for preserving Backward Compatibility" stepKey="flushCacheBeforeTestRun"/> <actionGroup ref="AdminLoginActionGroup" stepKey="adminLogin"/> <actionGroup ref="AdminCreateStoreViewActionGroup" stepKey="createCustomStoreView"/> </before> @@ -43,7 +43,7 @@ <magentoCLI command="config:set {{StorefrontDisableAddStoreCodeToUrls.path}} {{StorefrontDisableAddStoreCodeToUrls.value}}" stepKey="disableAddStoreCodeToUrls"/> - <magentoCLI command="cache:flush config" stepKey="flushCacheAfterTestRun"/> + <comment userInput="Adding the comment to replace 'cache:flush' command for preserving Backward Compatibility" stepKey="flushCacheAfterTestRun"/> </after> <!-- Login as Customer from Customer page --> diff --git a/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerDirectlyToCustomWebsiteTest.xml b/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerDirectlyToCustomWebsiteTest.xml index f9418a9cf1e1b..3b2f61339b921 100644 --- a/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerDirectlyToCustomWebsiteTest.xml +++ b/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerDirectlyToCustomWebsiteTest.xml @@ -26,7 +26,7 @@ <magentoCLI command="config:set {{StorefrontEnableAddStoreCodeToUrls.path}} {{StorefrontEnableAddStoreCodeToUrls.value}}" stepKey="enableAddStoreCodeToUrls"/> - <magentoCLI command="cache:flush config" stepKey="flushCacheBeforeTestRun"/> + <comment userInput="Adding the comment to replace 'cache:flush' command for preserving Backward Compatibility" stepKey="flushCacheBeforeTestRun"/> <actionGroup ref="AdminLoginActionGroup" stepKey="adminLogin"/> <actionGroup ref="AdminCreateWebsiteActionGroup" stepKey="createCustomWebsite"> <argument name="newWebsiteName" value="{{customWebsite.name}}"/> @@ -60,7 +60,7 @@ <magentoCLI command="config:set {{StorefrontDisableAddStoreCodeToUrls.path}} {{StorefrontDisableAddStoreCodeToUrls.value}}" stepKey="disableAddStoreCodeToUrls"/> - <magentoCLI command="cache:flush config" stepKey="flushCacheAfterTestRun"/> + <comment userInput="Adding the comment to replace 'cache:flush' command for preserving Backward Compatibility" stepKey="flushCacheAfterTestRun"/> </after> <!-- Login as Customer from Customer page --> diff --git a/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerEditCustomersAddressTest.xml b/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerEditCustomersAddressTest.xml index cf90f0b6a8511..3a80bbb7a6f2e 100644 --- a/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerEditCustomersAddressTest.xml +++ b/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerEditCustomersAddressTest.xml @@ -23,7 +23,7 @@ stepKey="enableLoginAsCustomer"/> <magentoCLI command="config:set {{LoginAsCustomerStoreViewLogin.path}} 0" stepKey="enableLoginAsCustomerAutoDetection"/> - <magentoCLI command="cache:flush config" stepKey="flushCacheBeforeTestRun"/> + <comment userInput="Adding the comment to replace 'cache:flush' command for preserving Backward Compatibility" stepKey="flushCacheBeforeTestRun"/> <createData entity="Simple_US_Customer_Assistance_Allowed" stepKey="createCustomer"/> <actionGroup ref="AdminLoginActionGroup" stepKey="loginAdmin"/> </before> @@ -32,7 +32,7 @@ <deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/> <magentoCLI command="config:set {{LoginAsCustomerConfigDataEnabled.path}} 0" stepKey="disableLoginAsCustomer"/> - <magentoCLI command="cache:flush config" stepKey="flushCacheAfterTestRun"/> + <comment userInput="Adding the comment to replace 'cache:flush' command for preserving Backward Compatibility" stepKey="flushCacheAfterTestRun"/> </after> <!-- Login as Customer Login from Customer page --> diff --git a/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerLogNotShownIfLoginAsCustomerDisabledTest.xml b/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerLogNotShownIfLoginAsCustomerDisabledTest.xml index 4ef72d949065d..e4a6767ce7b22 100644 --- a/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerLogNotShownIfLoginAsCustomerDisabledTest.xml +++ b/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerLogNotShownIfLoginAsCustomerDisabledTest.xml @@ -19,7 +19,7 @@ </annotations> <before> <magentoCLI command="config:set {{LoginAsCustomerConfigDataEnabled.path}} 0" stepKey="disableLoginAsCustomer"/> - <magentoCLI command="cache:flush config" stepKey="flushCacheBeforeTestRun"/> + <comment userInput="Adding the comment to replace 'cache:flush' command for preserving Backward Compatibility" stepKey="flushCacheBeforeTestRun"/> <actionGroup ref="AdminLoginActionGroup" stepKey="login"/> </before> <after> diff --git a/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerLoggingTest.xml b/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerLoggingTest.xml index 5b5e9e21113c8..6ae6ddfeccb47 100644 --- a/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerLoggingTest.xml +++ b/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerLoggingTest.xml @@ -24,7 +24,7 @@ stepKey="enableLoginAsCustomer"/> <magentoCLI command="config:set {{LoginAsCustomerStoreViewLogin.path}} 0" stepKey="enableLoginAsCustomerAutoDetection"/> - <magentoCLI command="cache:flush config" stepKey="flushCacheBeforeTestRun"/> + <comment userInput="Adding the comment to replace 'cache:flush' command for preserving Backward Compatibility" stepKey="flushCacheBeforeTestRun"/> <createData entity="NewAdminUser" stepKey="createNewAdmin"/> <createData entity="Simple_US_Customer_Assistance_Allowed" stepKey="createFirstCustomer"/> <createData entity="Simple_US_CA_Customer_Assistance_Allowed" stepKey="createSecondCustomer"/> @@ -40,7 +40,7 @@ <actionGroup ref="AdminLogoutActionGroup" stepKey="logoutAfter"/> <magentoCLI command="config:set {{LoginAsCustomerConfigDataEnabled.path}} 0" stepKey="disableLoginAsCustomer"/> - <magentoCLI command="cache:flush config" stepKey="flushCacheAfterTestRun"/> + <comment userInput="Adding the comment to replace 'cache:flush' command for preserving Backward Compatibility" stepKey="flushCacheAfterTestRun"/> </after> <!-- Login into First Customer account --> diff --git a/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerManualChooseFromOrderPageTest.xml b/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerManualChooseFromOrderPageTest.xml index e4f0209c55233..8493fda17636a 100644 --- a/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerManualChooseFromOrderPageTest.xml +++ b/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerManualChooseFromOrderPageTest.xml @@ -29,7 +29,7 @@ stepKey="enableLoginAsCustomer"/> <magentoCLI command="config:set {{LoginAsCustomerStoreViewLogin.path}} 1" stepKey="enableLoginAsCustomerManualChoose"/> - <magentoCLI command="cache:flush config" stepKey="flushCacheBeforeTestRun"/> + <comment userInput="Adding the comment to replace 'cache:flush' command for preserving Backward Compatibility" stepKey="flushCacheBeforeTestRun"/> <actionGroup ref="AdminLoginActionGroup" stepKey="adminLogin"/> <actionGroup ref="AdminCreateNewStoreGroupActionGroup" stepKey="createCustomStore"> <argument name="website" value="{{_defaultWebsite.name}}"/> @@ -54,7 +54,7 @@ stepKey="disableLoginAsCustomer"/> <magentoCLI command="config:set {{LoginAsCustomerStoreViewLogin.path}} 0" stepKey="enableLoginAsCustomerAutoDetection"/> - <magentoCLI command="cache:flush config" stepKey="flushCacheAfterTestRun"/> + <comment userInput="Adding the comment to replace 'cache:flush' command for preserving Backward Compatibility" stepKey="flushCacheAfterTestRun"/> <deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/> <deleteData createDataKey="createProduct" stepKey="deleteProduct"/> <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> diff --git a/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerManualChooseTest.xml b/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerManualChooseTest.xml index 5f706a814eb71..551139fb8095e 100644 --- a/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerManualChooseTest.xml +++ b/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerManualChooseTest.xml @@ -25,7 +25,7 @@ stepKey="enableLoginAsCustomer"/> <magentoCLI command="config:set {{LoginAsCustomerStoreViewLogin.path}} 1" stepKey="enableLoginAsCustomerManualChoose"/> - <magentoCLI command="cache:flush config" stepKey="flushCacheBeforeTestRun"/> + <comment userInput="Adding the comment to replace 'cache:flush' command for preserving Backward Compatibility" stepKey="flushCacheBeforeTestRun"/> <actionGroup ref="AdminLoginActionGroup" stepKey="adminLogin"/> <actionGroup ref="AdminCreateNewStoreGroupActionGroup" stepKey="createCustomStore"> <argument name="website" value="{{_defaultWebsite.name}}"/> @@ -50,7 +50,7 @@ stepKey="disableLoginAsCustomer"/> <magentoCLI command="config:set {{LoginAsCustomerStoreViewLogin.path}} 0" stepKey="enableLoginAsCustomerAutoDetection"/> - <magentoCLI command="cache:flush config" stepKey="flushCacheAfterTestRun"/> + <comment userInput="Adding the comment to replace 'cache:flush' command for preserving Backward Compatibility" stepKey="flushCacheAfterTestRun"/> <deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/> </after> diff --git a/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerMultishippingLoggingTest.xml b/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerMultishippingLoggingTest.xml index 79c7571a08cfb..bde6f34e86f1a 100644 --- a/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerMultishippingLoggingTest.xml +++ b/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerMultishippingLoggingTest.xml @@ -30,7 +30,7 @@ stepKey="enableLoginAsCustomer"/> <magentoCLI command="config:set {{LoginAsCustomerStoreViewLogin.path}} 0" stepKey="enableLoginAsCustomerAutoDetection"/> - <magentoCLI command="cache:flush config" stepKey="flushCacheBeforeTestRun"/> + <comment userInput="Adding the comment to replace 'cache:flush' command for preserving Backward Compatibility" stepKey="flushCacheBeforeTestRun"/> <createData entity="SimpleProduct2" stepKey="createProduct1"/> <createData entity="SimpleProduct2" stepKey="createProduct2"/> <createData entity="Simple_US_Customer_Assistance_Allowed_Two_Addresses" stepKey="createCustomer"/> @@ -44,7 +44,7 @@ <actionGroup ref="AdminOrdersGridClearFiltersActionGroup" stepKey="clearAllOrdersGridFilters"/> <actionGroup ref="AdminLogoutActionGroup" stepKey="adminLogout"/> <magentoCLI command="config:set {{DisableFreeShippingMethod.path}} {{DisableFreeShippingMethod.value}}" stepKey="disableFreeShipping"/> - <magentoCLI command="cache:flush config" stepKey="flushCacheAfterTestRun"/> + <comment userInput="Adding the comment to replace 'cache:flush' command for preserving Backward Compatibility" stepKey="flushCacheAfterTestRun"/> </after> <!-- Login as Customer from Customer page --> diff --git a/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerPlaceOrderTest.xml b/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerPlaceOrderTest.xml index 8169b9df4c43d..8afaaabbc92bf 100644 --- a/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerPlaceOrderTest.xml +++ b/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerPlaceOrderTest.xml @@ -23,7 +23,7 @@ stepKey="enableLoginAsCustomer"/> <magentoCLI command="config:set {{LoginAsCustomerStoreViewLogin.path}} 0" stepKey="enableLoginAsCustomerAutoDetection"/> - <magentoCLI command="cache:flush config" stepKey="flushCacheBeforeTestRun"/> + <comment userInput="Adding the comment to replace 'cache:flush' command for preserving Backward Compatibility" stepKey="flushCacheBeforeTestRun"/> <createData entity="_defaultCategory" stepKey="createCategory"/> <createData entity="SimpleProduct" stepKey="createProduct"> <requiredEntity createDataKey="createCategory"/> @@ -59,7 +59,7 @@ <magentoCLI command="config:set {{LoginAsCustomerConfigDataEnabled.path}} 0" stepKey="disableLoginAsCustomer"/> - <magentoCLI command="cache:flush config" stepKey="flushCacheAfterTestRun"/> + <comment userInput="Adding the comment to replace 'cache:flush' command for preserving Backward Compatibility" stepKey="flushCacheAfterTestRun"/> </after> <!-- Login as Customer from Customer page --> diff --git a/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerReorderTest.xml b/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerReorderTest.xml index 11d622319af33..8bef9fce9995b 100644 --- a/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerReorderTest.xml +++ b/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerReorderTest.xml @@ -23,7 +23,7 @@ stepKey="enableLoginAsCustomer"/> <magentoCLI command="config:set {{LoginAsCustomerStoreViewLogin.path}} 0" stepKey="enableLoginAsCustomerAutoDetection"/> - <magentoCLI command="cache:flush config" stepKey="flushCacheBeforeTestRun"/> + <comment userInput="Adding the comment to replace 'cache:flush' command for preserving Backward Compatibility" stepKey="flushCacheBeforeTestRun"/> <createData entity="_defaultCategory" stepKey="createCategory"/> <createData entity="SimpleProduct" stepKey="createProduct"> <requiredEntity createDataKey="createCategory"/> @@ -59,7 +59,7 @@ <magentoCLI command="config:set {{LoginAsCustomerConfigDataEnabled.path}} 0" stepKey="disableLoginAsCustomer"/> - <magentoCLI command="cache:flush config" stepKey="flushCacheAfterTestRun"/> + <comment userInput="Adding the comment to replace 'cache:flush' command for preserving Backward Compatibility" stepKey="flushCacheAfterTestRun"/> </after> <!-- Login to storefront as Customer --> diff --git a/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerSubscribeToNewsletterTest.xml b/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerSubscribeToNewsletterTest.xml index bc4c4adc3ac5a..1c3ae6e790089 100644 --- a/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerSubscribeToNewsletterTest.xml +++ b/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerSubscribeToNewsletterTest.xml @@ -23,7 +23,7 @@ stepKey="enableLoginAsCustomer"/> <magentoCLI command="config:set {{LoginAsCustomerStoreViewLogin.path}} 0" stepKey="enableLoginAsCustomerAutoDetection"/> - <magentoCLI command="cache:flush config" stepKey="flushCacheBeforeTestRun"/> + <comment userInput="Adding the comment to replace 'cache:flush' command for preserving Backward Compatibility" stepKey="flushCacheBeforeTestRun"/> <createData entity="Simple_US_Customer_Assistance_Allowed" stepKey="createCustomer"/> <actionGroup ref="AdminLoginActionGroup" stepKey="login"/> </before> @@ -31,7 +31,7 @@ <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> <magentoCLI command="config:set {{LoginAsCustomerConfigDataEnabled.path}} 0" stepKey="disableLoginAsCustomer"/> - <magentoCLI command="cache:flush config" stepKey="flushCacheAfterTestRun"/> + <comment userInput="Adding the comment to replace 'cache:flush' command for preserving Backward Compatibility" stepKey="flushCacheAfterTestRun"/> </after> <!-- Admin Login as Customer from Customer page --> diff --git a/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerUserLogoutTest.xml b/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerUserLogoutTest.xml index e7b5de55a56cb..ae99a4dda5593 100644 --- a/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerUserLogoutTest.xml +++ b/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerUserLogoutTest.xml @@ -24,7 +24,7 @@ stepKey="enableLoginAsCustomer"/> <magentoCLI command="config:set {{LoginAsCustomerStoreViewLogin.path}} 0" stepKey="enableLoginAsCustomerAutoDetection"/> - <magentoCLI command="cache:flush config" stepKey="flushCacheBeforeTestRun"/> + <comment userInput="Adding the comment to replace 'cache:flush' command for preserving Backward Compatibility" stepKey="flushCacheBeforeTestRun"/> <createData entity="Simple_US_Customer_Assistance_Allowed" stepKey="createCustomer"/> <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsDefaultUser"/> </before> @@ -33,7 +33,7 @@ <actionGroup ref="AdminLogoutActionGroup" stepKey="logoutAfter"/> <magentoCLI command="config:set {{LoginAsCustomerConfigDataEnabled.path}} 0" stepKey="disableLoginAsCustomer"/> - <magentoCLI command="cache:flush config" stepKey="flushCacheAfterTestRun"/> + <comment userInput="Adding the comment to replace 'cache:flush' command for preserving Backward Compatibility" stepKey="flushCacheAfterTestRun"/> </after> <!-- Login into Customer account --> diff --git a/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerUserSingleSessionTest.xml b/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerUserSingleSessionTest.xml index 5bbc218e0a948..51a4d1cf9fbed 100644 --- a/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerUserSingleSessionTest.xml +++ b/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminLoginAsCustomerUserSingleSessionTest.xml @@ -22,7 +22,7 @@ <magentoCLI command="config:set {{LoginAsCustomerConfigDataEnabled.path}} 1" stepKey="enableLoginAsCustomer"/> <magentoCLI command="config:set {{LoginAsCustomerStoreViewLogin.path}} 0" stepKey="enableLoginAsCustomerAutoDetection"/> - <magentoCLI command="cache:flush config" stepKey="flushCacheBeforeTestRun"/> + <comment userInput="Adding the comment to replace 'cache:flush' command for preserving Backward Compatibility" stepKey="flushCacheBeforeTestRun"/> <createData entity="Simple_US_Customer_Assistance_Allowed" stepKey="createFirstCustomer"/> <createData entity="Simple_US_CA_Customer_Assistance_Allowed" stepKey="createSecondCustomer"/> <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsDefaultUser"/> @@ -33,7 +33,7 @@ <actionGroup ref="AdminLogoutActionGroup" stepKey="logoutAfter"/> <magentoCLI command="config:set {{LoginAsCustomerConfigDataEnabled.path}} 0" stepKey="disableLoginAsCustomer"/> - <magentoCLI command="cache:flush config" stepKey="flushCacheAfterTestRun"/> + <comment userInput="Adding the comment to replace 'cache:flush' command for preserving Backward Compatibility" stepKey="flushCacheAfterTestRun"/> </after> <!-- Login into First Customer account --> diff --git a/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminNoAccessToLoginAsCustomerButtonTest.xml b/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminNoAccessToLoginAsCustomerButtonTest.xml index 50513797d06e9..9c95ab3c3c5cc 100644 --- a/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminNoAccessToLoginAsCustomerButtonTest.xml +++ b/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminNoAccessToLoginAsCustomerButtonTest.xml @@ -24,7 +24,7 @@ <magentoCLI command="config:set {{LoginAsCustomerConfigDataEnabled.path}} 1" stepKey="enableLoginAsCustomer"/> <magentoCLI command="config:set {{LoginAsCustomerStoreViewLogin.path}} 0" stepKey="enableLoginAsCustomerAutoDetection"/> - <magentoCLI command="cache:flush config" stepKey="flushCacheBeforeTestRun"/> + <comment userInput="Adding the comment to replace 'cache:flush' command for preserving Backward Compatibility" stepKey="flushCacheBeforeTestRun"/> <createData entity="_defaultCategory" stepKey="createCategory"/> <createData entity="SimpleProduct" stepKey="createSimpleProduct"> <requiredEntity createDataKey="createCategory"/> @@ -67,7 +67,7 @@ <actionGroup ref="AdminLogoutActionGroup" stepKey="logOut"/> <magentoCLI command="config:set {{LoginAsCustomerConfigDataEnabled.path}} 0" stepKey="disableLoginAsCustomer"/> - <magentoCLI command="cache:flush config" stepKey="flushCacheAfterTestRun"/> + <comment userInput="Adding the comment to replace 'cache:flush' command for preserving Backward Compatibility" stepKey="flushCacheAfterTestRun"/> </after> <!-- Login as new User --> diff --git a/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminNoAccessToLoginAsCustomerConfigurationTest.xml b/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminNoAccessToLoginAsCustomerConfigurationTest.xml index d48f167656301..4032aff6d122f 100644 --- a/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminNoAccessToLoginAsCustomerConfigurationTest.xml +++ b/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminNoAccessToLoginAsCustomerConfigurationTest.xml @@ -26,7 +26,7 @@ stepKey="enableLoginAsCustomer"/> <magentoCLI command="config:set {{LoginAsCustomerStoreViewLogin.path}} 0" stepKey="enableLoginAsCustomerAutoDetection"/> - <magentoCLI command="cache:flush config" stepKey="flushCacheBeforeTestRun"/> + <comment userInput="Adding the comment to replace 'cache:flush' command for preserving Backward Compatibility" stepKey="flushCacheBeforeTestRun"/> <createData entity="_defaultCategory" stepKey="createCategory"/> <createData entity="SimpleProduct" stepKey="createSimpleProduct"> <requiredEntity createDataKey="createCategory"/> @@ -70,7 +70,7 @@ <magentoCLI command="config:set {{LoginAsCustomerConfigDataEnabled.path}} 0" stepKey="disableLoginAsCustomer"/> - <magentoCLI command="cache:flush config" stepKey="flushCacheAfterTestRun"/> + <comment userInput="Adding the comment to replace 'cache:flush' command for preserving Backward Compatibility" stepKey="flushCacheAfterTestRun"/> </after> <!-- Login as new User --> diff --git a/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminUINotShownIfLoginAsCustomerDisabledTest.xml b/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminUINotShownIfLoginAsCustomerDisabledTest.xml index e1ea363bdf6bc..10bff7c2ef68f 100644 --- a/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminUINotShownIfLoginAsCustomerDisabledTest.xml +++ b/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/AdminUINotShownIfLoginAsCustomerDisabledTest.xml @@ -19,7 +19,7 @@ </annotations> <before> <magentoCLI command="config:set {{LoginAsCustomerConfigDataEnabled.path}} 0" stepKey="disableLoginAsCustomer"/> - <magentoCLI command="cache:flush config" stepKey="flushCacheBeforeTestRun"/> + <comment userInput="Adding the comment to replace 'cache:flush' command for preserving Backward Compatibility" stepKey="flushCacheBeforeTestRun"/> <createData entity="_defaultCategory" stepKey="createCategory"/> <createData entity="SimpleProduct" stepKey="createSimpleProduct"> <requiredEntity createDataKey="createCategory"/> diff --git a/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/StorefrontLoginAsCustomerNotificationBannerTest.xml b/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/StorefrontLoginAsCustomerNotificationBannerTest.xml index 351a3c569ce24..6a83e820039d8 100644 --- a/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/StorefrontLoginAsCustomerNotificationBannerTest.xml +++ b/app/code/Magento/LoginAsCustomer/Test/Mftf/Test/StorefrontLoginAsCustomerNotificationBannerTest.xml @@ -24,7 +24,7 @@ stepKey="enableLoginAsCustomer"/> <magentoCLI command="config:set {{LoginAsCustomerStoreViewLogin.path}} 0" stepKey="enableLoginAsCustomerAutoDetection"/> - <magentoCLI command="cache:flush config" stepKey="flushCacheBeforeTestRun"/> + <comment userInput="Adding the comment to replace 'cache:flush' command for preserving Backward Compatibility" stepKey="flushCacheBeforeTestRun"/> <actionGroup ref="AdminLoginActionGroup" stepKey="adminLogin"/> </before> <after> @@ -32,7 +32,7 @@ <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> <magentoCLI command="config:set {{LoginAsCustomerConfigDataEnabled.path}} 0" stepKey="disableLoginAsCustomer"/> - <magentoCLI command="cache:flush config" stepKey="flushCacheAfterTestRun"/> + <comment userInput="Adding the comment to replace 'cache:flush' command for preserving Backward Compatibility" stepKey="flushCacheAfterTestRun"/> </after> <!-- Login as Customer from Customer page --> From 2baf801a9e34f1be2aee737663ad6d5a1f47574c Mon Sep 17 00:00:00 2001 From: saphaljha <saphal.jha@krishtechnolabs.com> Date: Fri, 11 Sep 2020 11:01:41 +0530 Subject: [PATCH 050/171] Fixed issue when using dynamic elements --- .../View/Helper/SecureHtmlRenderer.php | 21 ++++++++++++------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/lib/internal/Magento/Framework/View/Helper/SecureHtmlRenderer.php b/lib/internal/Magento/Framework/View/Helper/SecureHtmlRenderer.php index ae8ab3f15bc96..d7369416f44bf 100644 --- a/lib/internal/Magento/Framework/View/Helper/SecureHtmlRenderer.php +++ b/lib/internal/Magento/Framework/View/Helper/SecureHtmlRenderer.php @@ -111,16 +111,21 @@ public function renderEventListenerAsTag( function {$listenerFunction} () { {$attributeJavascript}; } - var {$elementName} = document.querySelector("{$elementSelector}"); - if ({$elementName}) { - {$elementName}.{$eventName} = function (event) { - var targetElement = {$elementName}; - if (event && event.target) { - targetElement = event.target; + var {$elementName}Array = document.querySelectorAll("{$elementSelector}"); + + {$elementName}Array.forEach(function(element){ + if (element) { + element.{$eventName} = function (event) { + var targetElement = element; + if (event && event.target) { + targetElement = event.target; + } + {$listenerFunction}.apply(targetElement); } - {$listenerFunction}.apply(targetElement); } - } + }); + + script; return $this->renderTag('script', ['type' => 'text/javascript'], $script, false); From bedee3d6471396b4a04e27d53d42568ee796714f Mon Sep 17 00:00:00 2001 From: saphaljha <saphal.jha@krishtechnolabs.com> Date: Sat, 12 Sep 2020 20:06:59 +0530 Subject: [PATCH 051/171] Updated code for validate empty nodeList and covered MFTF --- ...dDeleteMultipleLayoutWidgetActionGroup.xml | 38 +++++++++++++++++++ .../Mftf/Section/AdminNewWidgetSection.xml | 2 + ...AddAndDeleteMultipleLayoutSectionsTest.xml | 36 ++++++++++++++++++ .../View/Helper/SecureHtmlRenderer.php | 22 +++++------ 4 files changed, 87 insertions(+), 11 deletions(-) create mode 100644 app/code/Magento/Widget/Test/Mftf/ActionGroup/AdminCreateAndDeleteMultipleLayoutWidgetActionGroup.xml create mode 100644 app/code/Magento/Widget/Test/Mftf/Test/AdminWidgetAddAndDeleteMultipleLayoutSectionsTest.xml diff --git a/app/code/Magento/Widget/Test/Mftf/ActionGroup/AdminCreateAndDeleteMultipleLayoutWidgetActionGroup.xml b/app/code/Magento/Widget/Test/Mftf/ActionGroup/AdminCreateAndDeleteMultipleLayoutWidgetActionGroup.xml new file mode 100644 index 0000000000000..b7ebd09c2fcc6 --- /dev/null +++ b/app/code/Magento/Widget/Test/Mftf/ActionGroup/AdminCreateAndDeleteMultipleLayoutWidgetActionGroup.xml @@ -0,0 +1,38 @@ +<?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="AdminCreateAndDeleteMultipleLayoutWidgetActionGroup"> + <annotations> + <description>Goes to the Admin Widget creation page. Add and delete multiple layouts</description> + </annotations> + <arguments> + <argument name="widget"/> + </arguments> + <amOnPage url="{{AdminNewWidgetPage.url}}" stepKey="amOnAdminNewWidgetPage"/> + <selectOption selector="{{AdminNewWidgetSection.widgetType}}" userInput="{{widget.type}}" stepKey="setWidgetType"/> + <selectOption selector="{{AdminNewWidgetSection.widgetDesignTheme}}" userInput="{{widget.design_theme}}" stepKey="setWidgetDesignTheme"/> + <click selector="{{AdminNewWidgetSection.continue}}" stepKey="clickContinue"/> + <fillField selector="{{AdminNewWidgetSection.widgetTitle}}" userInput="{{widget.name}}" stepKey="fillTitle"/> + <selectOption selector="{{AdminNewWidgetSection.widgetStoreIds}}" userInput="{{widget.store_ids[0]}}" stepKey="setWidgetStoreIds"/> + <click selector="{{AdminNewWidgetSection.addLayoutUpdate}}" stepKey="clickAddLayoutUpdate"/> + <waitForAjaxLoad stepKey="waitForLoad"/> + <click selector="{{AdminNewWidgetSection.addLayoutUpdate}}" stepKey="clickAddLayoutUpdate2"/> + <waitForAjaxLoad stepKey="waitForLoad2"/> + <click selector="{{AdminNewWidgetSection.addLayoutUpdate}}" stepKey="clickAddLayoutUpdate3"/> + <waitForAjaxLoad stepKey="waitForLoad3"/> + <seeNumberOfElements userInput="3" selector="{{AdminNewWidgetSection.CountDeleteButtons}}" stepKey="seeThreeDeleteButtons"/> + <click selector="{{AdminNewWidgetSection.deleteActionThird}}" stepKey="clickThirdDeleteButton"/> + <seeNumberOfElements userInput="2" selector="{{AdminNewWidgetSection.CountDeleteButtons}}" stepKey="seeTwoDeleteButtons"/> + <click selector="{{AdminNewWidgetSection.deleteActionSecond}}" stepKey="clickSecondDeleteButton"/> + <seeNumberOfElements userInput="1" selector="{{AdminNewWidgetSection.CountDeleteButtons}}" stepKey="seeOneDeleteButtons"/> + <click selector="{{AdminNewWidgetSection.deleteActionFirst}}" stepKey="clickFirstDeleteButton"/> + <seeNumberOfElements userInput="0" selector="{{AdminNewWidgetSection.CountDeleteButtons}}" stepKey="seeZeroDeleteButtons"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Widget/Test/Mftf/Section/AdminNewWidgetSection.xml b/app/code/Magento/Widget/Test/Mftf/Section/AdminNewWidgetSection.xml index 8a17b589d7ab2..fecad673e494e 100644 --- a/app/code/Magento/Widget/Test/Mftf/Section/AdminNewWidgetSection.xml +++ b/app/code/Magento/Widget/Test/Mftf/Section/AdminNewWidgetSection.xml @@ -52,6 +52,8 @@ <element name="displayPageControl" type="select" selector="[name='parameters[show_pager]']"/> <element name="numberOfProductsToDisplay" type="input" selector="[name='parameters[products_count]']"/> <element name="cacheLifetime" type="input" selector="[name='parameters[cache_lifetime]']"/> + <element name="deleteWidgetLayoutAction" type="button" selector="#page_group_container > div:first-of-type > div.fieldset-wrapper-title > div > .action-default.action-delete"/> + <element name="CountDeleteButtons" type="button" selector="#page_group_container > .fieldset-wrapper.page_group_container > div.fieldset-wrapper-title > div > .action-default.action-delete"/> </section> </sections> diff --git a/app/code/Magento/Widget/Test/Mftf/Test/AdminWidgetAddAndDeleteMultipleLayoutSectionsTest.xml b/app/code/Magento/Widget/Test/Mftf/Test/AdminWidgetAddAndDeleteMultipleLayoutSectionsTest.xml new file mode 100644 index 0000000000000..5a5652e1e9049 --- /dev/null +++ b/app/code/Magento/Widget/Test/Mftf/Test/AdminWidgetAddAndDeleteMultipleLayoutSectionsTest.xml @@ -0,0 +1,36 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> + <test name="AdminWidgetAddAndDeleteMultipleLayoutSectionsTest"> + <annotations> + <features value="Widget"/> + <stories value="Add and Delete multiple layouts when creating a Widget"/> + <title value="Add and Delete multiple layouts"/> + <description value="Admin should be able to Add and Delete multiple layouts"/> + <severity value="CRITICAL"/> + <group value="Widget"/> + </annotations> + <before> + <actionGroup ref="AdminLoginActionGroup" stepKey="LoginAsAdmin"/> + </before> + <after> + <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> + </after> + <actionGroup ref="AdminNavigateMenuActionGroup" stepKey="navigateToContentWidgetsPageFirst"> + <argument name="menuUiId" value="{{AdminMenuContent.dataUiId}}"/> + <argument name="submenuUiId" value="{{AdminMenuContentElementsWidgets.dataUiId}}"/> + </actionGroup> + <actionGroup ref="AdminAssertPageTitleActionGroup" stepKey="seePageTitleFirst"> + <argument name="title" value="{{AdminMenuContentElementsWidgets.pageTitle}}"/> + </actionGroup> + <waitForLoadingMaskToDisappear stepKey="waitForLoadingMaskToDisappear1"/> + <actionGroup ref="AdminCreateAndDeleteMultipleLayoutWidgetActionGroup" stepKey="addWidgetForTest"> + <argument name="widget" value="ProductsListWidget"/> + </actionGroup> + </test> +</tests> diff --git a/lib/internal/Magento/Framework/View/Helper/SecureHtmlRenderer.php b/lib/internal/Magento/Framework/View/Helper/SecureHtmlRenderer.php index d7369416f44bf..ebc4b8870538f 100644 --- a/lib/internal/Magento/Framework/View/Helper/SecureHtmlRenderer.php +++ b/lib/internal/Magento/Framework/View/Helper/SecureHtmlRenderer.php @@ -112,19 +112,19 @@ function {$listenerFunction} () { {$attributeJavascript}; } var {$elementName}Array = document.querySelectorAll("{$elementSelector}"); - - {$elementName}Array.forEach(function(element){ - if (element) { - element.{$eventName} = function (event) { - var targetElement = element; - if (event && event.target) { - targetElement = event.target; + if({$elementName}Array.lenght !== 'undefined'){ + {$elementName}Array.forEach(function(element){ + if (element) { + element.{$eventName} = function (event) { + var targetElement = element; + if (event && event.target) { + targetElement = event.target; + } + {$listenerFunction}.apply(targetElement); } - {$listenerFunction}.apply(targetElement); } - } - }); - + }); + } script; From e03e17ea488b91388f296ffef7978f12bb33f3d9 Mon Sep 17 00:00:00 2001 From: saphaljha <saphal.jha@krishtechnolabs.com> Date: Thu, 22 Oct 2020 02:07:59 +0530 Subject: [PATCH 052/171] Converted TEST into automic groups for reusable actions --- ...dDeleteMultipleLayoutWidgetActionGroup.xml | 38 ------------------- ...minCreateWidgetWthoutLayoutActionGroup.xml | 26 +++++++++++++ .../AdminWidgetAddLayoutUpdateActionGroup.xml | 18 +++++++++ ...minWidgetDeleteLayoutUpdateActionGroup.xml | 17 +++++++++ ...AddAndDeleteMultipleLayoutSectionsTest.xml | 11 +++++- .../View/Helper/SecureHtmlRenderer.php | 2 +- 6 files changed, 72 insertions(+), 40 deletions(-) delete mode 100644 app/code/Magento/Widget/Test/Mftf/ActionGroup/AdminCreateAndDeleteMultipleLayoutWidgetActionGroup.xml create mode 100644 app/code/Magento/Widget/Test/Mftf/ActionGroup/AdminCreateWidgetWthoutLayoutActionGroup.xml create mode 100644 app/code/Magento/Widget/Test/Mftf/ActionGroup/AdminWidgetAddLayoutUpdateActionGroup.xml create mode 100644 app/code/Magento/Widget/Test/Mftf/ActionGroup/AdminWidgetDeleteLayoutUpdateActionGroup.xml diff --git a/app/code/Magento/Widget/Test/Mftf/ActionGroup/AdminCreateAndDeleteMultipleLayoutWidgetActionGroup.xml b/app/code/Magento/Widget/Test/Mftf/ActionGroup/AdminCreateAndDeleteMultipleLayoutWidgetActionGroup.xml deleted file mode 100644 index b7ebd09c2fcc6..0000000000000 --- a/app/code/Magento/Widget/Test/Mftf/ActionGroup/AdminCreateAndDeleteMultipleLayoutWidgetActionGroup.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. - */ ---> -<actionGroups - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> - <actionGroup name="AdminCreateAndDeleteMultipleLayoutWidgetActionGroup"> - <annotations> - <description>Goes to the Admin Widget creation page. Add and delete multiple layouts</description> - </annotations> - <arguments> - <argument name="widget"/> - </arguments> - <amOnPage url="{{AdminNewWidgetPage.url}}" stepKey="amOnAdminNewWidgetPage"/> - <selectOption selector="{{AdminNewWidgetSection.widgetType}}" userInput="{{widget.type}}" stepKey="setWidgetType"/> - <selectOption selector="{{AdminNewWidgetSection.widgetDesignTheme}}" userInput="{{widget.design_theme}}" stepKey="setWidgetDesignTheme"/> - <click selector="{{AdminNewWidgetSection.continue}}" stepKey="clickContinue"/> - <fillField selector="{{AdminNewWidgetSection.widgetTitle}}" userInput="{{widget.name}}" stepKey="fillTitle"/> - <selectOption selector="{{AdminNewWidgetSection.widgetStoreIds}}" userInput="{{widget.store_ids[0]}}" stepKey="setWidgetStoreIds"/> - <click selector="{{AdminNewWidgetSection.addLayoutUpdate}}" stepKey="clickAddLayoutUpdate"/> - <waitForAjaxLoad stepKey="waitForLoad"/> - <click selector="{{AdminNewWidgetSection.addLayoutUpdate}}" stepKey="clickAddLayoutUpdate2"/> - <waitForAjaxLoad stepKey="waitForLoad2"/> - <click selector="{{AdminNewWidgetSection.addLayoutUpdate}}" stepKey="clickAddLayoutUpdate3"/> - <waitForAjaxLoad stepKey="waitForLoad3"/> - <seeNumberOfElements userInput="3" selector="{{AdminNewWidgetSection.CountDeleteButtons}}" stepKey="seeThreeDeleteButtons"/> - <click selector="{{AdminNewWidgetSection.deleteActionThird}}" stepKey="clickThirdDeleteButton"/> - <seeNumberOfElements userInput="2" selector="{{AdminNewWidgetSection.CountDeleteButtons}}" stepKey="seeTwoDeleteButtons"/> - <click selector="{{AdminNewWidgetSection.deleteActionSecond}}" stepKey="clickSecondDeleteButton"/> - <seeNumberOfElements userInput="1" selector="{{AdminNewWidgetSection.CountDeleteButtons}}" stepKey="seeOneDeleteButtons"/> - <click selector="{{AdminNewWidgetSection.deleteActionFirst}}" stepKey="clickFirstDeleteButton"/> - <seeNumberOfElements userInput="0" selector="{{AdminNewWidgetSection.CountDeleteButtons}}" stepKey="seeZeroDeleteButtons"/> - </actionGroup> -</actionGroups> diff --git a/app/code/Magento/Widget/Test/Mftf/ActionGroup/AdminCreateWidgetWthoutLayoutActionGroup.xml b/app/code/Magento/Widget/Test/Mftf/ActionGroup/AdminCreateWidgetWthoutLayoutActionGroup.xml new file mode 100644 index 0000000000000..e9ee80c1a5f2a --- /dev/null +++ b/app/code/Magento/Widget/Test/Mftf/ActionGroup/AdminCreateWidgetWthoutLayoutActionGroup.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="AdminCreateWidgetWthoutLayoutActionGroup"> + <annotations> + <description>Goes to the Admin Widget creation page without saving it</description> + </annotations> + <arguments> + <argument name="widget"/> + </arguments> + <amOnPage url="{{AdminNewWidgetPage.url}}" stepKey="amOnAdminNewWidgetPage"/> + <selectOption selector="{{AdminNewWidgetSection.widgetType}}" userInput="{{widget.type}}" stepKey="setWidgetType"/> + <selectOption selector="{{AdminNewWidgetSection.widgetDesignTheme}}" userInput="{{widget.design_theme}}" stepKey="setWidgetDesignTheme"/> + <click selector="{{AdminNewWidgetSection.continue}}" stepKey="clickContinue"/> + <fillField selector="{{AdminNewWidgetSection.widgetTitle}}" userInput="{{widget.name}}" stepKey="fillTitle"/> + <selectOption selector="{{AdminNewWidgetSection.widgetStoreIds}}" userInput="{{widget.store_ids[0]}}" stepKey="setWidgetStoreIds"/> + <click selector="{{AdminNewWidgetSection.addLayoutUpdate}}" stepKey="clickAddLayoutUpdate"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Widget/Test/Mftf/ActionGroup/AdminWidgetAddLayoutUpdateActionGroup.xml b/app/code/Magento/Widget/Test/Mftf/ActionGroup/AdminWidgetAddLayoutUpdateActionGroup.xml new file mode 100644 index 0000000000000..fa73fa4926e10 --- /dev/null +++ b/app/code/Magento/Widget/Test/Mftf/ActionGroup/AdminWidgetAddLayoutUpdateActionGroup.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="AdminWidgetAddLayoutUpdateActionGroup"> + <annotations> + <description>Add layouts during widgets creation</description> + </annotations> + <waitForAjaxLoad stepKey="waitForLoad"/> + <click selector="{{AdminNewWidgetSection.addLayoutUpdate}}" stepKey="clickAddLayoutUpdate"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Widget/Test/Mftf/ActionGroup/AdminWidgetDeleteLayoutUpdateActionGroup.xml b/app/code/Magento/Widget/Test/Mftf/ActionGroup/AdminWidgetDeleteLayoutUpdateActionGroup.xml new file mode 100644 index 0000000000000..e52fb1a7f6514 --- /dev/null +++ b/app/code/Magento/Widget/Test/Mftf/ActionGroup/AdminWidgetDeleteLayoutUpdateActionGroup.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="AdminWidgetDeleteLayoutUpdateActionGroup"> + <annotations> + <description>Delete layouts during widgets creation</description> + </annotations> + <click selector="{{AdminNewWidgetSection.deleteWidgetLayoutAction}}" stepKey="clickFirstDeleteButton"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Widget/Test/Mftf/Test/AdminWidgetAddAndDeleteMultipleLayoutSectionsTest.xml b/app/code/Magento/Widget/Test/Mftf/Test/AdminWidgetAddAndDeleteMultipleLayoutSectionsTest.xml index 5a5652e1e9049..eee6058836f2e 100644 --- a/app/code/Magento/Widget/Test/Mftf/Test/AdminWidgetAddAndDeleteMultipleLayoutSectionsTest.xml +++ b/app/code/Magento/Widget/Test/Mftf/Test/AdminWidgetAddAndDeleteMultipleLayoutSectionsTest.xml @@ -29,8 +29,17 @@ <argument name="title" value="{{AdminMenuContentElementsWidgets.pageTitle}}"/> </actionGroup> <waitForLoadingMaskToDisappear stepKey="waitForLoadingMaskToDisappear1"/> - <actionGroup ref="AdminCreateAndDeleteMultipleLayoutWidgetActionGroup" stepKey="addWidgetForTest"> + <actionGroup ref="AdminCreateWidgetWthoutLayoutActionGroup" stepKey="addWidgetForTest"> <argument name="widget" value="ProductsListWidget"/> </actionGroup> + <actionGroup ref="AdminWidgetAddLayoutUpdateActionGroup" stepKey="AddSecondLayout"/> + <actionGroup ref="AdminWidgetAddLayoutUpdateActionGroup" stepKey="AddThirdLayout"/> + <seeNumberOfElements userInput="3" selector="{{AdminNewWidgetSection.CountDeleteButtons}}" stepKey="seeThreeDeleteButtons"/> + <actionGroup ref="AdminWidgetDeleteLayoutUpdateActionGroup" stepKey="DeleteFirstLayoutForWidget"></actionGroup> + <seeNumberOfElements userInput="2" selector="{{AdminNewWidgetSection.CountDeleteButtons}}" stepKey="seeTwoDeleteButtons"/> + <actionGroup ref="AdminWidgetDeleteLayoutUpdateActionGroup" stepKey="DeleteSecondLayoutForWidget"></actionGroup> + <seeNumberOfElements userInput="1" selector="{{AdminNewWidgetSection.CountDeleteButtons}}" stepKey="seeOneDeleteButtons"/> + <actionGroup ref="AdminWidgetDeleteLayoutUpdateActionGroup" stepKey="DeleteThirdLayoutForWidget"></actionGroup> + <seeNumberOfElements userInput="0" selector="{{AdminNewWidgetSection.CountDeleteButtons}}" stepKey="seeZeroDeleteButtons"/> </test> </tests> diff --git a/lib/internal/Magento/Framework/View/Helper/SecureHtmlRenderer.php b/lib/internal/Magento/Framework/View/Helper/SecureHtmlRenderer.php index ebc4b8870538f..87d4e88295356 100644 --- a/lib/internal/Magento/Framework/View/Helper/SecureHtmlRenderer.php +++ b/lib/internal/Magento/Framework/View/Helper/SecureHtmlRenderer.php @@ -112,7 +112,7 @@ function {$listenerFunction} () { {$attributeJavascript}; } var {$elementName}Array = document.querySelectorAll("{$elementSelector}"); - if({$elementName}Array.lenght !== 'undefined'){ + if({$elementName}Array.length !== 'undefined'){ {$elementName}Array.forEach(function(element){ if (element) { element.{$eventName} = function (event) { From 0fee9a1ab949b29ae86fd4eca4150d4f6a10c895 Mon Sep 17 00:00:00 2001 From: saphaljha <saphal.jha@krishtechnolabs.com> Date: Fri, 11 Sep 2020 11:01:41 +0530 Subject: [PATCH 053/171] Fixed issue when using dynamic elements --- .../Magento/Framework/View/Helper/SecureHtmlRenderer.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/lib/internal/Magento/Framework/View/Helper/SecureHtmlRenderer.php b/lib/internal/Magento/Framework/View/Helper/SecureHtmlRenderer.php index 87d4e88295356..aedb2026e4bb5 100644 --- a/lib/internal/Magento/Framework/View/Helper/SecureHtmlRenderer.php +++ b/lib/internal/Magento/Framework/View/Helper/SecureHtmlRenderer.php @@ -116,6 +116,7 @@ function {$listenerFunction} () { {$elementName}Array.forEach(function(element){ if (element) { element.{$eventName} = function (event) { + event.preventDefault(); var targetElement = element; if (event && event.target) { targetElement = event.target; @@ -124,10 +125,8 @@ function {$listenerFunction} () { } } }); - } - -script; - + } + script; return $this->renderTag('script', ['type' => 'text/javascript'], $script, false); } From 20275ce6331957c854162c71742f7c9c7da25a50 Mon Sep 17 00:00:00 2001 From: saphaljha <saphal.jha@krishtechnolabs.com> Date: Sat, 12 Sep 2020 20:06:59 +0530 Subject: [PATCH 054/171] Updated code for validate empty nodeList and covered MFTF --- ...dDeleteMultipleLayoutWidgetActionGroup.xml | 38 +++++++++++++++++++ ...AddAndDeleteMultipleLayoutSectionsTest.xml | 2 +- 2 files changed, 39 insertions(+), 1 deletion(-) create mode 100644 app/code/Magento/Widget/Test/Mftf/ActionGroup/AdminCreateAndDeleteMultipleLayoutWidgetActionGroup.xml diff --git a/app/code/Magento/Widget/Test/Mftf/ActionGroup/AdminCreateAndDeleteMultipleLayoutWidgetActionGroup.xml b/app/code/Magento/Widget/Test/Mftf/ActionGroup/AdminCreateAndDeleteMultipleLayoutWidgetActionGroup.xml new file mode 100644 index 0000000000000..b7ebd09c2fcc6 --- /dev/null +++ b/app/code/Magento/Widget/Test/Mftf/ActionGroup/AdminCreateAndDeleteMultipleLayoutWidgetActionGroup.xml @@ -0,0 +1,38 @@ +<?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="AdminCreateAndDeleteMultipleLayoutWidgetActionGroup"> + <annotations> + <description>Goes to the Admin Widget creation page. Add and delete multiple layouts</description> + </annotations> + <arguments> + <argument name="widget"/> + </arguments> + <amOnPage url="{{AdminNewWidgetPage.url}}" stepKey="amOnAdminNewWidgetPage"/> + <selectOption selector="{{AdminNewWidgetSection.widgetType}}" userInput="{{widget.type}}" stepKey="setWidgetType"/> + <selectOption selector="{{AdminNewWidgetSection.widgetDesignTheme}}" userInput="{{widget.design_theme}}" stepKey="setWidgetDesignTheme"/> + <click selector="{{AdminNewWidgetSection.continue}}" stepKey="clickContinue"/> + <fillField selector="{{AdminNewWidgetSection.widgetTitle}}" userInput="{{widget.name}}" stepKey="fillTitle"/> + <selectOption selector="{{AdminNewWidgetSection.widgetStoreIds}}" userInput="{{widget.store_ids[0]}}" stepKey="setWidgetStoreIds"/> + <click selector="{{AdminNewWidgetSection.addLayoutUpdate}}" stepKey="clickAddLayoutUpdate"/> + <waitForAjaxLoad stepKey="waitForLoad"/> + <click selector="{{AdminNewWidgetSection.addLayoutUpdate}}" stepKey="clickAddLayoutUpdate2"/> + <waitForAjaxLoad stepKey="waitForLoad2"/> + <click selector="{{AdminNewWidgetSection.addLayoutUpdate}}" stepKey="clickAddLayoutUpdate3"/> + <waitForAjaxLoad stepKey="waitForLoad3"/> + <seeNumberOfElements userInput="3" selector="{{AdminNewWidgetSection.CountDeleteButtons}}" stepKey="seeThreeDeleteButtons"/> + <click selector="{{AdminNewWidgetSection.deleteActionThird}}" stepKey="clickThirdDeleteButton"/> + <seeNumberOfElements userInput="2" selector="{{AdminNewWidgetSection.CountDeleteButtons}}" stepKey="seeTwoDeleteButtons"/> + <click selector="{{AdminNewWidgetSection.deleteActionSecond}}" stepKey="clickSecondDeleteButton"/> + <seeNumberOfElements userInput="1" selector="{{AdminNewWidgetSection.CountDeleteButtons}}" stepKey="seeOneDeleteButtons"/> + <click selector="{{AdminNewWidgetSection.deleteActionFirst}}" stepKey="clickFirstDeleteButton"/> + <seeNumberOfElements userInput="0" selector="{{AdminNewWidgetSection.CountDeleteButtons}}" stepKey="seeZeroDeleteButtons"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Widget/Test/Mftf/Test/AdminWidgetAddAndDeleteMultipleLayoutSectionsTest.xml b/app/code/Magento/Widget/Test/Mftf/Test/AdminWidgetAddAndDeleteMultipleLayoutSectionsTest.xml index eee6058836f2e..04c1552d53522 100644 --- a/app/code/Magento/Widget/Test/Mftf/Test/AdminWidgetAddAndDeleteMultipleLayoutSectionsTest.xml +++ b/app/code/Magento/Widget/Test/Mftf/Test/AdminWidgetAddAndDeleteMultipleLayoutSectionsTest.xml @@ -42,4 +42,4 @@ <actionGroup ref="AdminWidgetDeleteLayoutUpdateActionGroup" stepKey="DeleteThirdLayoutForWidget"></actionGroup> <seeNumberOfElements userInput="0" selector="{{AdminNewWidgetSection.CountDeleteButtons}}" stepKey="seeZeroDeleteButtons"/> </test> -</tests> +</tests> \ No newline at end of file From a1f731f86f6fd3a5257ab042d952e48f5ace0440 Mon Sep 17 00:00:00 2001 From: saphaljha <saphal.jha@krishtechnolabs.com> Date: Thu, 22 Oct 2020 02:07:59 +0530 Subject: [PATCH 055/171] Converted TEST into automic groups for reusable actions --- ...dDeleteMultipleLayoutWidgetActionGroup.xml | 38 ------------------- 1 file changed, 38 deletions(-) delete mode 100644 app/code/Magento/Widget/Test/Mftf/ActionGroup/AdminCreateAndDeleteMultipleLayoutWidgetActionGroup.xml diff --git a/app/code/Magento/Widget/Test/Mftf/ActionGroup/AdminCreateAndDeleteMultipleLayoutWidgetActionGroup.xml b/app/code/Magento/Widget/Test/Mftf/ActionGroup/AdminCreateAndDeleteMultipleLayoutWidgetActionGroup.xml deleted file mode 100644 index b7ebd09c2fcc6..0000000000000 --- a/app/code/Magento/Widget/Test/Mftf/ActionGroup/AdminCreateAndDeleteMultipleLayoutWidgetActionGroup.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. - */ ---> -<actionGroups - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> - <actionGroup name="AdminCreateAndDeleteMultipleLayoutWidgetActionGroup"> - <annotations> - <description>Goes to the Admin Widget creation page. Add and delete multiple layouts</description> - </annotations> - <arguments> - <argument name="widget"/> - </arguments> - <amOnPage url="{{AdminNewWidgetPage.url}}" stepKey="amOnAdminNewWidgetPage"/> - <selectOption selector="{{AdminNewWidgetSection.widgetType}}" userInput="{{widget.type}}" stepKey="setWidgetType"/> - <selectOption selector="{{AdminNewWidgetSection.widgetDesignTheme}}" userInput="{{widget.design_theme}}" stepKey="setWidgetDesignTheme"/> - <click selector="{{AdminNewWidgetSection.continue}}" stepKey="clickContinue"/> - <fillField selector="{{AdminNewWidgetSection.widgetTitle}}" userInput="{{widget.name}}" stepKey="fillTitle"/> - <selectOption selector="{{AdminNewWidgetSection.widgetStoreIds}}" userInput="{{widget.store_ids[0]}}" stepKey="setWidgetStoreIds"/> - <click selector="{{AdminNewWidgetSection.addLayoutUpdate}}" stepKey="clickAddLayoutUpdate"/> - <waitForAjaxLoad stepKey="waitForLoad"/> - <click selector="{{AdminNewWidgetSection.addLayoutUpdate}}" stepKey="clickAddLayoutUpdate2"/> - <waitForAjaxLoad stepKey="waitForLoad2"/> - <click selector="{{AdminNewWidgetSection.addLayoutUpdate}}" stepKey="clickAddLayoutUpdate3"/> - <waitForAjaxLoad stepKey="waitForLoad3"/> - <seeNumberOfElements userInput="3" selector="{{AdminNewWidgetSection.CountDeleteButtons}}" stepKey="seeThreeDeleteButtons"/> - <click selector="{{AdminNewWidgetSection.deleteActionThird}}" stepKey="clickThirdDeleteButton"/> - <seeNumberOfElements userInput="2" selector="{{AdminNewWidgetSection.CountDeleteButtons}}" stepKey="seeTwoDeleteButtons"/> - <click selector="{{AdminNewWidgetSection.deleteActionSecond}}" stepKey="clickSecondDeleteButton"/> - <seeNumberOfElements userInput="1" selector="{{AdminNewWidgetSection.CountDeleteButtons}}" stepKey="seeOneDeleteButtons"/> - <click selector="{{AdminNewWidgetSection.deleteActionFirst}}" stepKey="clickFirstDeleteButton"/> - <seeNumberOfElements userInput="0" selector="{{AdminNewWidgetSection.CountDeleteButtons}}" stepKey="seeZeroDeleteButtons"/> - </actionGroup> -</actionGroups> From 7d3d9c96f9dfbf7a828fc4874875d8f1436515e5 Mon Sep 17 00:00:00 2001 From: lykhachov <ilyalykhachov.com.ua> Date: Fri, 20 Nov 2020 12:10:20 +0200 Subject: [PATCH 056/171] replace changelog to changelogData --- .../Eav/Model/Mview/ChangeLogBatchWalker.php | 18 +++++++++--------- .../Magento/Test/Legacy/_files/words_ce.xml | 4 ---- 2 files changed, 9 insertions(+), 13 deletions(-) diff --git a/app/code/Magento/Eav/Model/Mview/ChangeLogBatchWalker.php b/app/code/Magento/Eav/Model/Mview/ChangeLogBatchWalker.php index fdc71faa90902..ff9268117d464 100644 --- a/app/code/Magento/Eav/Model/Mview/ChangeLogBatchWalker.php +++ b/app/code/Magento/Eav/Model/Mview/ChangeLogBatchWalker.php @@ -45,15 +45,15 @@ public function __construct( /** * Calculate EAV attributes size * - * @param ChangelogInterface $changelog + * @param ChangelogInterface $changelogData * @return int * @throws \Exception */ - private function calculateEavAttributeSize(ChangelogInterface $changelog): int + private function calculateEavAttributeSize(ChangelogInterface $changelogData): int { $connection = $this->resourceConnection->getConnection(); - if (!isset($this->entityTypeCodes[$changelog->getViewId()])) { + if (!isset($this->entityTypeCodes[$changelogData->getViewId()])) { throw new \Exception('Entity type for view was not defined'); } @@ -66,7 +66,7 @@ private function calculateEavAttributeSize(ChangelogInterface $changelog): int ['type' => $connection->getTableName('eav_entity_type')], 'type.entity_type_id=eav_attribute.entity_type_id' ) - ->where('type.entity_type_code = ?', $this->entityTypeCodes[$changelog->getViewId()]); + ->where('type.entity_type_code = ?', $this->entityTypeCodes[$changelogData->getViewId()]); return (int) $connection->fetchOne($select); } @@ -92,10 +92,10 @@ private function setGroupConcatMax(int $numberOfAttributes): void * @inheritdoc * @throws \Exception */ - public function walk(ChangelogInterface $changelog, int $fromVersionId, int $toVersion, int $batchSize) + public function walk(ChangelogInterface $changelogData, int $fromVersionId, int $toVersion, int $batchSize) { $connection = $this->resourceConnection->getConnection(); - $numberOfAttributes = $this->calculateEavAttributeSize($changelog); + $numberOfAttributes = $this->calculateEavAttributeSize($changelogData); $this->setGroupConcatMax($numberOfAttributes); $select = $connection->select()->distinct(true) ->where( @@ -106,15 +106,15 @@ public function walk(ChangelogInterface $changelog, int $fromVersionId, int $toV 'version_id <= ?', $toVersion ) - ->group([$changelog->getColumnName(), 'store_id']) + ->group([$changelogData->getColumnName(), 'store_id']) ->limit($batchSize); $columns = [ - $changelog->getColumnName(), + $changelogData->getColumnName(), 'attribute_ids' => new Expression('GROUP_CONCAT(attribute_id)'), 'store_id' ]; - $select->from($changelog->getName(), $columns); + $select->from($changelogData->getName(), $columns); return $connection->fetchAll($select); } } diff --git a/dev/tests/static/testsuite/Magento/Test/Legacy/_files/words_ce.xml b/dev/tests/static/testsuite/Magento/Test/Legacy/_files/words_ce.xml index ccad52fae453e..92e7b15efed29 100644 --- a/dev/tests/static/testsuite/Magento/Test/Legacy/_files/words_ce.xml +++ b/dev/tests/static/testsuite/Magento/Test/Legacy/_files/words_ce.xml @@ -73,9 +73,5 @@ <path>app/design/adminhtml/Magento/backend/Magento_Rma/web/css/source/_module.less</path> <word>rma</word> </item> - <item> - <path>app/code/Magento/Eav/Model/Mview/ChangeLogBatchWalker.php</path> - <word>changelog</word> - </item> </whitelist> </config> From 80a192467d74c1291d8a1da00a34d0fdb6090a77 Mon Sep 17 00:00:00 2001 From: lykhachov <ilyalykhachov.com.ua> Date: Fri, 20 Nov 2020 14:28:09 +0200 Subject: [PATCH 057/171] put "changelog" back --- .../Eav/Model/Mview/ChangeLogBatchWalker.php | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/app/code/Magento/Eav/Model/Mview/ChangeLogBatchWalker.php b/app/code/Magento/Eav/Model/Mview/ChangeLogBatchWalker.php index ff9268117d464..fdc71faa90902 100644 --- a/app/code/Magento/Eav/Model/Mview/ChangeLogBatchWalker.php +++ b/app/code/Magento/Eav/Model/Mview/ChangeLogBatchWalker.php @@ -45,15 +45,15 @@ public function __construct( /** * Calculate EAV attributes size * - * @param ChangelogInterface $changelogData + * @param ChangelogInterface $changelog * @return int * @throws \Exception */ - private function calculateEavAttributeSize(ChangelogInterface $changelogData): int + private function calculateEavAttributeSize(ChangelogInterface $changelog): int { $connection = $this->resourceConnection->getConnection(); - if (!isset($this->entityTypeCodes[$changelogData->getViewId()])) { + if (!isset($this->entityTypeCodes[$changelog->getViewId()])) { throw new \Exception('Entity type for view was not defined'); } @@ -66,7 +66,7 @@ private function calculateEavAttributeSize(ChangelogInterface $changelogData): i ['type' => $connection->getTableName('eav_entity_type')], 'type.entity_type_id=eav_attribute.entity_type_id' ) - ->where('type.entity_type_code = ?', $this->entityTypeCodes[$changelogData->getViewId()]); + ->where('type.entity_type_code = ?', $this->entityTypeCodes[$changelog->getViewId()]); return (int) $connection->fetchOne($select); } @@ -92,10 +92,10 @@ private function setGroupConcatMax(int $numberOfAttributes): void * @inheritdoc * @throws \Exception */ - public function walk(ChangelogInterface $changelogData, int $fromVersionId, int $toVersion, int $batchSize) + public function walk(ChangelogInterface $changelog, int $fromVersionId, int $toVersion, int $batchSize) { $connection = $this->resourceConnection->getConnection(); - $numberOfAttributes = $this->calculateEavAttributeSize($changelogData); + $numberOfAttributes = $this->calculateEavAttributeSize($changelog); $this->setGroupConcatMax($numberOfAttributes); $select = $connection->select()->distinct(true) ->where( @@ -106,15 +106,15 @@ public function walk(ChangelogInterface $changelogData, int $fromVersionId, int 'version_id <= ?', $toVersion ) - ->group([$changelogData->getColumnName(), 'store_id']) + ->group([$changelog->getColumnName(), 'store_id']) ->limit($batchSize); $columns = [ - $changelogData->getColumnName(), + $changelog->getColumnName(), 'attribute_ids' => new Expression('GROUP_CONCAT(attribute_id)'), 'store_id' ]; - $select->from($changelogData->getName(), $columns); + $select->from($changelog->getName(), $columns); return $connection->fetchAll($select); } } From 906441de5d9237919192cf54556059a7ad167204 Mon Sep 17 00:00:00 2001 From: lykhachov <ilyalykhachov.com.ua> Date: Fri, 20 Nov 2020 15:51:11 +0200 Subject: [PATCH 058/171] added AdditionalColumnProcessorFactory class to unit tests --- .../Mview/Test/Unit/View/ChangelogTest.php | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/lib/internal/Magento/Framework/Mview/Test/Unit/View/ChangelogTest.php b/lib/internal/Magento/Framework/Mview/Test/Unit/View/ChangelogTest.php index 4af3f65be6883..16fc3a91924b8 100644 --- a/lib/internal/Magento/Framework/Mview/Test/Unit/View/ChangelogTest.php +++ b/lib/internal/Magento/Framework/Mview/Test/Unit/View/ChangelogTest.php @@ -12,6 +12,7 @@ use Magento\Framework\DB\Ddl\Table; use Magento\Framework\DB\Select; use Magento\Framework\Mview\Config; +use Magento\Framework\Mview\View\AdditionalColumnsProcessor\ProcessorFactory; use Magento\Framework\Mview\View\Changelog; use Magento\Framework\Mview\View\ChangelogInterface; use PHPUnit\Framework\MockObject\MockObject; @@ -41,13 +42,19 @@ class ChangelogTest extends TestCase */ protected $resourceMock; + /** + * @var ProcessorFactory|MockObject + */ + protected $processorFactory; + protected function setUp(): void { $this->connectionMock = $this->createMock(Mysql::class); $this->resourceMock = $this->createMock(ResourceConnection::class); $this->mockGetConnection($this->connectionMock); + $this->processorFactory = $this->createMock(ProcessorFactory::class); - $this->model = new Changelog($this->resourceMock, $this->getMviewConfigMock()); + $this->model = new Changelog($this->resourceMock, $this->getMviewConfigMock(), $this->processorFactory); } /** @@ -69,7 +76,7 @@ public function testInstanceOf() $resourceMock = $this->createMock(ResourceConnection::class); $resourceMock->expects($this->once())->method('getConnection')->willReturn(true); - $model = new Changelog($resourceMock, $this->getMviewConfigMock()); + $model = new Changelog($resourceMock, $this->getMviewConfigMock(), $this->processorFactory); $this->assertInstanceOf(ChangelogInterface::class, $model); } @@ -80,7 +87,7 @@ public function testCheckConnectionException() $resourceMock = $this->createMock(ResourceConnection::class); $resourceMock->expects($this->once())->method('getConnection')->willReturn(null); - $model = new Changelog($resourceMock, $this->getMviewConfigMock()); + $model = new Changelog($resourceMock, $this->getMviewConfigMock(), $this->processorFactory); $model->setViewId('ViewIdTest'); $this->assertNull($model); } From e5b24273467e80dc0994cb7d5c9ae79c64d3ae3a Mon Sep 17 00:00:00 2001 From: lykhachov <ilyalykhachov.com.ua> Date: Fri, 20 Nov 2020 17:08:11 +0200 Subject: [PATCH 059/171] changes to Unit Tests --- .../Magento/Framework/Mview/Test/Unit/_files/mview_config.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/internal/Magento/Framework/Mview/Test/Unit/_files/mview_config.php b/lib/internal/Magento/Framework/Mview/Test/Unit/_files/mview_config.php index 36e7dca899047..af488ecf5589e 100644 --- a/lib/internal/Magento/Framework/Mview/Test/Unit/_files/mview_config.php +++ b/lib/internal/Magento/Framework/Mview/Test/Unit/_files/mview_config.php @@ -32,7 +32,7 @@ 'processor' => \Magento\Framework\Mview\View\AdditionalColumnsProcessor\DefaultProcessor::class ], ], - 'iterator' => \Magento\Framework\Mview\View\ChangeLogBatchIterator::class + 'walker' => \Magento\Framework\Mview\View\ChangeLogBatchWalker::class ], ] ]; From 98c0b0bb8bdec475109fcd822fd27d86c689bbd6 Mon Sep 17 00:00:00 2001 From: Anna Pak <a.pak@atwix.com> Date: Sun, 22 Nov 2020 12:37:08 +0200 Subject: [PATCH 060/171] adjusted comments to clarify that they were added for preserving backward compatibility --- .../Mftf/Test/AdminAvailabilityCreditMemoWithNoPaymentTest.xml | 2 +- .../Mftf/Test/AdminCreateOrderWithMinimumAmountEnabledTest.xml | 2 +- .../Mftf/Test/AdminSubmitsOrderPaymentMethodValidationTest.xml | 2 +- .../Test/Mftf/Test/AdminSubmitsOrderWithAndWithoutEmailTest.xml | 2 +- .../AdminSubmitsOrderWithAndWithoutFieldsValidationTest.xml | 2 +- .../Tax/Test/Mftf/Test/AdminCheckingTaxReportGridTest.xml | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminAvailabilityCreditMemoWithNoPaymentTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminAvailabilityCreditMemoWithNoPaymentTest.xml index 4379fc283510d..afede97556513 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminAvailabilityCreditMemoWithNoPaymentTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminAvailabilityCreditMemoWithNoPaymentTest.xml @@ -61,7 +61,7 @@ <click selector="{{AdminOrderFormItemsSection.updateItemsAndQuantities}}" stepKey="clickUpdateItemsAndQuantitiesButton"/> <!--Fill customer group and customer email--> - <comment userInput="Fill Account Information" stepKey="selectCustomerGroup"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="selectCustomerGroup"/> <actionGroup ref="AdminFillAccountInformationOnCreateOrderPageActionGroup" stepKey="fillCustomerEmail"> <argument name="email" value="{{Simple_US_Customer.email}}"/> </actionGroup> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateOrderWithMinimumAmountEnabledTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateOrderWithMinimumAmountEnabledTest.xml index 2d8b8e9b8fb46..6b714e0d18726 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateOrderWithMinimumAmountEnabledTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateOrderWithMinimumAmountEnabledTest.xml @@ -45,7 +45,7 @@ </actionGroup> <!--Fill customer group information--> - <comment userInput="Fill Account Information" stepKey="selectGroup"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="selectGroup"/> <actionGroup ref="AdminFillAccountInformationOnCreateOrderPageActionGroup" stepKey="fillEmail"> <argument name="email" value="{{Simple_US_Customer.email}}"/> </actionGroup> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminSubmitsOrderPaymentMethodValidationTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminSubmitsOrderPaymentMethodValidationTest.xml index 1e09f308018d2..addf978235af4 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminSubmitsOrderPaymentMethodValidationTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminSubmitsOrderPaymentMethodValidationTest.xml @@ -48,7 +48,7 @@ <scrollToTopOfPage stepKey="scrollToTopOfOrderFormPage" after="seePaymentMethodRequired"/> <!--Fill customer group and customer email--> - <comment userInput="Fill Account Information" stepKey="selectCustomerGroup" after="scrollToTopOfOrderFormPage"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="selectCustomerGroup" after="scrollToTopOfOrderFormPage"/> <actionGroup ref="AdminFillAccountInformationOnCreateOrderPageActionGroup" stepKey="fillCustomerEmail" after="selectCustomerGroup"> <argument name="email" value="{{Simple_US_Customer.email}}"/> </actionGroup> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminSubmitsOrderWithAndWithoutEmailTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminSubmitsOrderWithAndWithoutEmailTest.xml index 215c888833885..7c2309eeb7be3 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminSubmitsOrderWithAndWithoutEmailTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminSubmitsOrderWithAndWithoutEmailTest.xml @@ -46,7 +46,7 @@ </actionGroup> <!--Fill customer group and customer email--> - <comment userInput="Fill Account Information" stepKey="selectCustomerGroup" after="addSimpleProductToOrder"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="selectCustomerGroup" after="addSimpleProductToOrder"/> <actionGroup ref="AdminFillAccountInformationOnCreateOrderPageActionGroup" stepKey="fillCustomerEmail" after="selectCustomerGroup"> <argument name="email" value="{{Simple_US_Customer.email}}"/> </actionGroup> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminSubmitsOrderWithAndWithoutFieldsValidationTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminSubmitsOrderWithAndWithoutFieldsValidationTest.xml index 48ce356a43174..db779a7340b07 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminSubmitsOrderWithAndWithoutFieldsValidationTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminSubmitsOrderWithAndWithoutFieldsValidationTest.xml @@ -45,7 +45,7 @@ </actionGroup> <!--Fill customer group and customer email--> - <comment userInput="Fill Account Information" stepKey="selectCustomerGroup" after="addSimpleProductToOrder"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="selectCustomerGroup" after="addSimpleProductToOrder"/> <actionGroup ref="AdminFillAccountInformationOnCreateOrderPageActionGroup" stepKey="fillCustomerEmail" after="selectCustomerGroup"> <argument name="email" value="{{Simple_US_Customer.email}}"/> </actionGroup> diff --git a/app/code/Magento/Tax/Test/Mftf/Test/AdminCheckingTaxReportGridTest.xml b/app/code/Magento/Tax/Test/Mftf/Test/AdminCheckingTaxReportGridTest.xml index 61482d7f5a567..8bacc134c7ab8 100644 --- a/app/code/Magento/Tax/Test/Mftf/Test/AdminCheckingTaxReportGridTest.xml +++ b/app/code/Magento/Tax/Test/Mftf/Test/AdminCheckingTaxReportGridTest.xml @@ -154,7 +154,7 @@ </actionGroup> <!--Fill customer group and customer email--> - <comment userInput="Fill Account Information" stepKey="selectCustomerGroup"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="selectCustomerGroup"/> <actionGroup ref="AdminFillAccountInformationOnCreateOrderPageActionGroup" stepKey="fillCustomerEmail"> <argument name="email" value="{{Simple_US_Customer.email}}"/> </actionGroup> From 84e6e1e0d9cf8b3faa983627a37f7643aa135134 Mon Sep 17 00:00:00 2001 From: Anna Pak <a.pak@atwix.com> Date: Mon, 23 Nov 2020 16:33:47 +0200 Subject: [PATCH 061/171] refactored AdminCreateOrderAddProductCheckboxTest --- ...ductToOrderAndCheckCheckboxActionGroup.xml | 19 +++++++++++++++++++ ...AdminCreateOrderAddProductCheckboxTest.xml | 19 +++++++++++-------- 2 files changed, 30 insertions(+), 8 deletions(-) create mode 100644 app/code/Magento/Sales/Test/Mftf/ActionGroup/AddSimpleProductToOrderAndCheckCheckboxActionGroup.xml diff --git a/app/code/Magento/Sales/Test/Mftf/ActionGroup/AddSimpleProductToOrderAndCheckCheckboxActionGroup.xml b/app/code/Magento/Sales/Test/Mftf/ActionGroup/AddSimpleProductToOrderAndCheckCheckboxActionGroup.xml new file mode 100644 index 0000000000000..8aa50526519b8 --- /dev/null +++ b/app/code/Magento/Sales/Test/Mftf/ActionGroup/AddSimpleProductToOrderAndCheckCheckboxActionGroup.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="AddSimpleProductToOrderAndCheckCheckboxActionGroup" extends="AddSimpleProductToOrderActionGroup"> + <annotations> + <description>Adds the provided Simple Product to an Order. Checks of checkbox is checkedFills in the provided Product Qty. Clicks on 'Add Selected Product(s) to Order'.</description> + </annotations> + + <seeCheckboxIsChecked selector="{{AdminOrderFormItemsSection.rowCheck('1')}}" stepKey="verifyProductChecked" after="selectProduct"/> + + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateOrderAddProductCheckboxTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateOrderAddProductCheckboxTest.xml index baef605ad52af..718464f215fcb 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateOrderAddProductCheckboxTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateOrderAddProductCheckboxTest.xml @@ -34,17 +34,20 @@ <argument name="customer" value="$$createSimpleCustomer$$"/> </actionGroup> - <click selector="{{AdminOrderFormItemsSection.addProducts}}" stepKey="clickAddProducts"/> - <fillField selector="{{AdminOrderFormItemsSection.skuFilter}}" userInput="$$createSimpleProduct.sku$$" stepKey="fillSkuFilterBundle"/> - <click selector="{{AdminOrderFormItemsSection.search}}" stepKey="clickSearchBundle"/> - <scrollTo selector="{{AdminOrderFormItemsSection.rowCheck('1')}}" x="0" y="-100" stepKey="scrollToCheckColumn"/> - <checkOption selector="{{AdminOrderFormItemsSection.rowCheck('1')}}" stepKey="selectProduct"/> - <seeCheckboxIsChecked selector="{{AdminOrderFormItemsSection.rowCheck('1')}}" stepKey="verifyProductChecked"/> - + <actionGroup ref="AddSimpleProductToOrderAndCheckCheckboxActionGroup" stepKey="clickAddProducts"> + <argument name="product" value="$createSimpleProduct$"/> + </actionGroup> + + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="fillSkuFilterBundle"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="clickSearchBundle"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="scrollToCheckColumn"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="selectProduct"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="verifyProductChecked"/> + <after> <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> <deleteData createDataKey="createSimpleProduct" stepKey="deleteSimpleProduct"/> <deleteData createDataKey="createSimpleCustomer" stepKey="deleteSimpleCustomer"/> </after> </test> -</tests> +</tests> \ No newline at end of file From 3838099a2a35e4087365db405c3d8ce75d7c3b49 Mon Sep 17 00:00:00 2001 From: Anna Pak <a.pak@atwix.com> Date: Mon, 23 Nov 2020 16:42:51 +0200 Subject: [PATCH 062/171] refactored --- .../AddSimpleProductToOrderAndCheckCheckboxActionGroup.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/Sales/Test/Mftf/ActionGroup/AddSimpleProductToOrderAndCheckCheckboxActionGroup.xml b/app/code/Magento/Sales/Test/Mftf/ActionGroup/AddSimpleProductToOrderAndCheckCheckboxActionGroup.xml index 8aa50526519b8..b26a592d3442a 100644 --- a/app/code/Magento/Sales/Test/Mftf/ActionGroup/AddSimpleProductToOrderAndCheckCheckboxActionGroup.xml +++ b/app/code/Magento/Sales/Test/Mftf/ActionGroup/AddSimpleProductToOrderAndCheckCheckboxActionGroup.xml @@ -10,7 +10,7 @@ xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> <actionGroup name="AddSimpleProductToOrderAndCheckCheckboxActionGroup" extends="AddSimpleProductToOrderActionGroup"> <annotations> - <description>Adds the provided Simple Product to an Order. Checks of checkbox is checkedFills in the provided Product Qty. Clicks on 'Add Selected Product(s) to Order'.</description> + <description>Adds the provided Simple Product to an Order. Checks if checkbox is checked. Fills in the provided Product Qty. Clicks on 'Add Selected Product(s) to Order'.</description> </annotations> <seeCheckboxIsChecked selector="{{AdminOrderFormItemsSection.rowCheck('1')}}" stepKey="verifyProductChecked" after="selectProduct"/> From 60460f6c4963e18ca8a7a8e36bb51b14ce71fe2b Mon Sep 17 00:00:00 2001 From: Anna Pak <a.pak@atwix.com> Date: Mon, 23 Nov 2020 21:18:57 +0200 Subject: [PATCH 063/171] refactored --- .../AddSimpleProductToOrderAndCheckCheckboxActionGroup.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/Sales/Test/Mftf/ActionGroup/AddSimpleProductToOrderAndCheckCheckboxActionGroup.xml b/app/code/Magento/Sales/Test/Mftf/ActionGroup/AddSimpleProductToOrderAndCheckCheckboxActionGroup.xml index b26a592d3442a..67b10d6955775 100644 --- a/app/code/Magento/Sales/Test/Mftf/ActionGroup/AddSimpleProductToOrderAndCheckCheckboxActionGroup.xml +++ b/app/code/Magento/Sales/Test/Mftf/ActionGroup/AddSimpleProductToOrderAndCheckCheckboxActionGroup.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="AddSimpleProductToOrderAndCheckCheckboxActionGroup" extends="AddSimpleProductToOrderActionGroup"> + <actionGroup name="AdminAddSimpleProductToOrderAndCheckCheckboxActionGroup" extends="AddSimpleProductToOrderActionGroup"> <annotations> <description>Adds the provided Simple Product to an Order. Checks if checkbox is checked. Fills in the provided Product Qty. Clicks on 'Add Selected Product(s) to Order'.</description> </annotations> From b61c19ee94bbe294f6d42f807cedd9d26c715450 Mon Sep 17 00:00:00 2001 From: Anna Pak <a.pak@atwix.com> Date: Mon, 23 Nov 2020 21:19:57 +0200 Subject: [PATCH 064/171] refactored --- .../Test/Mftf/Test/AdminCreateOrderAddProductCheckboxTest.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateOrderAddProductCheckboxTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateOrderAddProductCheckboxTest.xml index 718464f215fcb..13b91fa605bca 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateOrderAddProductCheckboxTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateOrderAddProductCheckboxTest.xml @@ -34,7 +34,7 @@ <argument name="customer" value="$$createSimpleCustomer$$"/> </actionGroup> - <actionGroup ref="AddSimpleProductToOrderAndCheckCheckboxActionGroup" stepKey="clickAddProducts"> + <actionGroup ref="AdminAddSimpleProductToOrderAndCheckCheckboxActionGroup" stepKey="clickAddProducts"> <argument name="product" value="$createSimpleProduct$"/> </actionGroup> From ba1a3393e5b09a141a2a06e11d15dad91a8e041c Mon Sep 17 00:00:00 2001 From: Evangelos Pallis <info.vpsnak@gmail.com> Date: Mon, 23 Nov 2020 22:17:20 +0200 Subject: [PATCH 065/171] Fix wrong format error DHL shipping label MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fix "The response is in wrong format." error while generating dhl shipping label. When product name has unicode characters substr() is sending � in <PieceContents> causing erros dhl syntax errors. --- app/code/Magento/Dhl/Model/Carrier.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/Dhl/Model/Carrier.php b/app/code/Magento/Dhl/Model/Carrier.php index c5eb27b21e58b..ac82120893698 100644 --- a/app/code/Magento/Dhl/Model/Carrier.php +++ b/app/code/Magento/Dhl/Model/Carrier.php @@ -1748,7 +1748,7 @@ protected function _shipmentDetails($xml, $rawRequest, $originRegion = '') foreach ($package['items'] as $item) { $content[] = $item['name']; } - $nodePiece->addChild('PieceContents', substr(implode(',', $content), 0, 34)); + $nodePiece->addChild('PieceContents', $this->string->substr(implode(',', $content), 0, 34)); } $nodeShipmentDetails->addChild('Weight', sprintf('%.3f', $rawRequest->getPackageWeight())); From fc4481c60a770a548814e60aae1d493a8ef93384 Mon Sep 17 00:00:00 2001 From: Sergiy Vasiutynskyi <s.vasiutynskyi@atwix.com> Date: Tue, 24 Nov 2020 11:08:13 +0200 Subject: [PATCH 066/171] Removed 'indexer:reindex', 'cache:flush' commands and usage of AdminReindexAndFlushCache action group from tests --- ...tBundlePlaceOrderWithVirtualAndSimpleChildrenTest.xml | 3 +-- ...CheckNoAppearDefaultOptionConfigurableProductTest.xml | 2 +- .../AdminCreateCatalogPriceRuleForCustomerGroupTest.xml | 3 +-- ...onfigurableProductWithAssignedSimpleProducts2Test.xml | 2 +- ...CatalogRuleForConfigurableProductWithOptions2Test.xml | 2 +- ...heckboxIsDisabledCreatePermanentRedirectSetNoTest.xml | 4 ++-- ...ountDownloadableProductLinkAfterPartialRefundTest.xml | 9 ++++----- .../ActionGroup/AdminReindexAndFlushCacheActionGroup.xml | 9 +++++++++ ...ontPaypalSmartButtonWithFranceMerchantCountryTest.xml | 2 +- .../Test/Mftf/Test/StorefrontReorderAsGuestTest.xml | 5 ++--- 10 files changed, 23 insertions(+), 18 deletions(-) diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontBundlePlaceOrderWithVirtualAndSimpleChildrenTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontBundlePlaceOrderWithVirtualAndSimpleChildrenTest.xml index fe4faed29d144..8b19753067593 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontBundlePlaceOrderWithVirtualAndSimpleChildrenTest.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontBundlePlaceOrderWithVirtualAndSimpleChildrenTest.xml @@ -48,8 +48,7 @@ <argument name="productId" value="$createFixedBundleProduct.id$"/> </actionGroup> <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct"/> - <!--Perform reindex and flush cache--> - <actionGroup ref="AdminReindexAndFlushCache" stepKey="reindexAndFlushCache"/> + <comment userInput="Adding the comment to replace AdminReindexAndFlushCache action group ('indexer:reindex', 'cache:flush' commands) for preserving Backward Compatibility" stepKey="reindexAndFlushCache"/> </before> <after> <deleteData createDataKey="createSimpleProduct" stepKey="deleteSimpleProductForBundleItem"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontCheckNoAppearDefaultOptionConfigurableProductTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontCheckNoAppearDefaultOptionConfigurableProductTest.xml index 507e4ae14e83c..2f38e16a44476 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontCheckNoAppearDefaultOptionConfigurableProductTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontCheckNoAppearDefaultOptionConfigurableProductTest.xml @@ -44,7 +44,7 @@ </actionGroup> <actionGroup ref="AdminSetQuantityToEachSkusConfigurableProductActionGroup" stepKey="saveConfigurable"/> <grabValueFrom selector="{{NewProductPageSection.sku}}" stepKey="grabSkuProduct"/> - <magentoCLI command="indexer:reindex" stepKey="reindex"/> + <comment userInput="Adding the comment to replace 'indexer:reindex' command for preserving Backward Compatibility" stepKey="reindex"/> <actionGroup ref="SelectStorefrontSideBarAttributeOption" stepKey="expandOption"> <argument name="categoryName" value="$$createCategory.name$$"/> 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 fb218297b646d..3c08fbdf641e4 100644 --- a/app/code/Magento/CatalogRule/Test/Mftf/Test/AdminCreateCatalogPriceRuleTest/AdminCreateCatalogPriceRuleForCustomerGroupTest.xml +++ b/app/code/Magento/CatalogRule/Test/Mftf/Test/AdminCreateCatalogPriceRuleTest/AdminCreateCatalogPriceRuleForCustomerGroupTest.xml @@ -27,8 +27,7 @@ <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <actionGroup ref="AdminCatalogPriceRuleDeleteAllActionGroup" stepKey="deleteAllCatalogPriceRule"/> - <!-- Perform reindex and flush cache --> - <actionGroup ref="AdminReindexAndFlushCache" stepKey="reindexAndFlushCache"/> + <comment userInput="Adding the comment to replace AdminReindexAndFlushCache action group ('indexer:reindex', 'cache:flush' commands) for preserving Backward Compatibility" stepKey="reindexAndFlushCache"/> </before> <after> diff --git a/app/code/Magento/CatalogRuleConfigurable/Test/Mftf/Test/AdminApplyCatalogRuleForConfigurableProductWithAssignedSimpleProducts2Test.xml b/app/code/Magento/CatalogRuleConfigurable/Test/Mftf/Test/AdminApplyCatalogRuleForConfigurableProductWithAssignedSimpleProducts2Test.xml index 48f53da8e2a2e..ca9017b7c5f29 100644 --- a/app/code/Magento/CatalogRuleConfigurable/Test/Mftf/Test/AdminApplyCatalogRuleForConfigurableProductWithAssignedSimpleProducts2Test.xml +++ b/app/code/Magento/CatalogRuleConfigurable/Test/Mftf/Test/AdminApplyCatalogRuleForConfigurableProductWithAssignedSimpleProducts2Test.xml @@ -190,7 +190,7 @@ </actionGroup> <actionGroup ref="AdminCatalogPriceRuleSaveAndApplyActionGroup" stepKey="saveAndApplyCatalogPriceRule"/> - <actionGroup ref="AdminReindexAndFlushCache" stepKey="reindexAndFlushCache"/> + <comment userInput="Adding the comment to replace AdminReindexAndFlushCache action group ('indexer:reindex', 'cache:flush' commands) for preserving Backward Compatibility" stepKey="reindexAndFlushCache"/> <!-- Login to storefront from customer --> <actionGroup ref="LoginToStorefrontActionGroup" stepKey="loginCustomerOnStorefront"> diff --git a/app/code/Magento/CatalogRuleConfigurable/Test/Mftf/Test/AdminApplyCatalogRuleForConfigurableProductWithOptions2Test.xml b/app/code/Magento/CatalogRuleConfigurable/Test/Mftf/Test/AdminApplyCatalogRuleForConfigurableProductWithOptions2Test.xml index 350f896606c19..b20bd34106e03 100644 --- a/app/code/Magento/CatalogRuleConfigurable/Test/Mftf/Test/AdminApplyCatalogRuleForConfigurableProductWithOptions2Test.xml +++ b/app/code/Magento/CatalogRuleConfigurable/Test/Mftf/Test/AdminApplyCatalogRuleForConfigurableProductWithOptions2Test.xml @@ -173,7 +173,7 @@ </actionGroup> <actionGroup ref="AdminCatalogPriceRuleSaveAndApplyActionGroup" stepKey="saveAndApplySecondPriceRule"/> - <actionGroup ref="AdminReindexAndFlushCache" stepKey="reindexAndFlushCache"/> + <comment userInput="Adding the comment to replace AdminReindexAndFlushCache action group ('indexer:reindex', 'cache:flush' commands) for preserving Backward Compatibility" stepKey="reindexAndFlushCache"/> <!-- Assert product in storefront product page --> <amOnPage url="{{StorefrontProductPage.url($$createConfigProduct.custom_attributes[url_key]$$)}}" stepKey="amOnProductPage"/> diff --git a/app/code/Magento/CatalogUrlRewrite/Test/Mftf/Test/AdminVerifyCheckboxIsDisabledCreatePermanentRedirectSetNoTest.xml b/app/code/Magento/CatalogUrlRewrite/Test/Mftf/Test/AdminVerifyCheckboxIsDisabledCreatePermanentRedirectSetNoTest.xml index d529c6dd3ecc3..fc9eb8529da6f 100644 --- a/app/code/Magento/CatalogUrlRewrite/Test/Mftf/Test/AdminVerifyCheckboxIsDisabledCreatePermanentRedirectSetNoTest.xml +++ b/app/code/Magento/CatalogUrlRewrite/Test/Mftf/Test/AdminVerifyCheckboxIsDisabledCreatePermanentRedirectSetNoTest.xml @@ -18,7 +18,7 @@ </annotations> <before> <magentoCLI command="config:set {{DisableCreatePermanentRedirect.path}} {{DisableCreatePermanentRedirect.value}}" stepKey="enableCreatePermanentRedirect"/> - <magentoCLI command="cache:flush" stepKey="flushCache"/> + <comment userInput="Adding the comment to replace 'cache:flush' command for preserving Backward Compatibility" stepKey="flushCache"/> <createData entity="_defaultCategory" stepKey="createDefaultCategory"/> <createData entity="SimpleProduct" stepKey="createSimpleProduct"> <requiredEntity createDataKey="createDefaultCategory"/> @@ -29,7 +29,7 @@ <deleteData createDataKey="createSimpleProduct" stepKey="deleteSimpleProduct"/> <deleteData createDataKey="createDefaultCategory" stepKey="deleteDefaultCategory"/> <magentoCLI command="config:set {{EnableCreatePermanentRedirect.path}} {{EnableCreatePermanentRedirect.value}}" stepKey="disableCreatePermanentRedirect"/> - <magentoCLI command="cache:flush" stepKey="flushCache"/> + <comment userInput="Adding the comment to replace 'cache:flush' command for preserving Backward Compatibility" stepKey="flushCache"/> <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> </after> <actionGroup ref="AdminProductPageOpenByIdActionGroup" stepKey="goToProductEditPage"> diff --git a/app/code/Magento/Downloadable/Test/Mftf/Test/StorefrontAccountDownloadableProductLinkAfterPartialRefundTest.xml b/app/code/Magento/Downloadable/Test/Mftf/Test/StorefrontAccountDownloadableProductLinkAfterPartialRefundTest.xml index d82cc25b0eccf..dc48f600167a2 100644 --- a/app/code/Magento/Downloadable/Test/Mftf/Test/StorefrontAccountDownloadableProductLinkAfterPartialRefundTest.xml +++ b/app/code/Magento/Downloadable/Test/Mftf/Test/StorefrontAccountDownloadableProductLinkAfterPartialRefundTest.xml @@ -30,9 +30,8 @@ <createData entity="downloadableLink1" stepKey="addDownloadableLink1"> <requiredEntity createDataKey="createDownloadableProduct"/> </createData> - - <magentoCLI command="indexer:reindex" stepKey="reindex"/> - <magentoCLI command="cache:flush" stepKey="flushCache"/> + <comment userInput="Adding the comment to replace 'indexer:reindex' command for preserving Backward Compatibility" stepKey="reindex"/> + <comment userInput="Adding the comment to replace 'cache:flush' command for preserving Backward Compatibility" stepKey="flushCache"/> <createData entity="Simple_US_Customer_Multiple_Addresses" stepKey="createCustomer"/> <actionGroup ref="LoginToStorefrontActionGroup" stepKey="signIn"> @@ -51,8 +50,8 @@ <magentoCLI stepKey="removeDownloadableDomain" command="downloadable:domains:remove example.com static.magento.com"/> <magentoCLI command="config:set {{EnableFlatRateConfigData.path}} {{EnableFlatRateConfigData.value}}" stepKey="enableFlatRate"/> - <magentoCLI command="indexer:reindex" stepKey="reindex"/> - <magentoCLI command="cache:flush" stepKey="flushCache"/> + <comment userInput="Adding the comment to replace 'indexer:reindex' command for preserving Backward Compatibility" stepKey="reindex"/> + <comment userInput="Adding the comment to replace 'cache:flush' command for preserving Backward Compatibility" stepKey="flushCache"/> </after> <actionGroup ref="StorefrontAddSimpleProductToShoppingCartActionGroup" stepKey="addSimpleProductToCart"> diff --git a/app/code/Magento/Indexer/Test/Mftf/ActionGroup/AdminReindexAndFlushCacheActionGroup.xml b/app/code/Magento/Indexer/Test/Mftf/ActionGroup/AdminReindexAndFlushCacheActionGroup.xml index d474094dcd54b..e7e7ba82bf09c 100644 --- a/app/code/Magento/Indexer/Test/Mftf/ActionGroup/AdminReindexAndFlushCacheActionGroup.xml +++ b/app/code/Magento/Indexer/Test/Mftf/ActionGroup/AdminReindexAndFlushCacheActionGroup.xml @@ -9,6 +9,15 @@ xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> <actionGroup name="AdminReindexAndFlushCache"> <annotations> + <!-- + PLEASE NOTE: + The action group runs commands to reindex ALL indexers and to flush ALL cache types. + It's better to specify needed index (for reindexing) / cache type (for cache flushing). + Please use the following action groups: + - CliIndexerReindexActionGroup - run reindex by CLI with specified indexers + - CliCacheCleanActionGroup - run cache:clean by CLI with specified cache tags + - CliCacheFlushActionGroup - run cache:flush by CLI with specified cache tags + --> <description>Run reindex and flush cache.</description> </annotations> diff --git a/app/code/Magento/Paypal/Test/Mftf/Test/StorefrontPaypalSmartButtonWithFranceMerchantCountryTest.xml b/app/code/Magento/Paypal/Test/Mftf/Test/StorefrontPaypalSmartButtonWithFranceMerchantCountryTest.xml index a4d99ecbf7e61..7e3c4dab4588e 100644 --- a/app/code/Magento/Paypal/Test/Mftf/Test/StorefrontPaypalSmartButtonWithFranceMerchantCountryTest.xml +++ b/app/code/Magento/Paypal/Test/Mftf/Test/StorefrontPaypalSmartButtonWithFranceMerchantCountryTest.xml @@ -29,7 +29,7 @@ <!--Enable Advanced Setting--> <magentoCLI command="config:set {{StorefrontPaypalEnableSkipOrderReviewStepConfigData.path}} {{StorefrontPaypalEnableSkipOrderReviewStepConfigData.value}}" stepKey="enableSkipOrderReview"/> <createData entity="FreeShippinMethodConfig" stepKey="enableFreeShipping"/> - <magentoCLI command="cache:flush" stepKey="flushCache"/> + <comment userInput="Adding the comment to replace 'cache:flush' command for preserving Backward Compatibility" stepKey="flushCache"/> </before> <after> <magentoCLI command="config:set {{StorefrontPaypalDisableSkipOrderReviewStepConfigData.path}} {{StorefrontPaypalDisableSkipOrderReviewStepConfigData.value}}" stepKey="disableSkipOrderReview"/> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/StorefrontReorderAsGuestTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/StorefrontReorderAsGuestTest.xml index 0718783534925..2b60c1d7ba550 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/StorefrontReorderAsGuestTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/StorefrontReorderAsGuestTest.xml @@ -24,9 +24,8 @@ </createData> <!-- Create Customer Account --> <createData entity="Simple_US_Customer" stepKey="createCustomer"/> - <!-- Reindex and flush cache --> - <magentoCLI command="indexer:reindex" stepKey="reindex"/> - <magentoCLI command="cache:flush" stepKey="flushCache"/> + <comment userInput="Adding the comment to replace 'indexer:reindex' command for preserving Backward Compatibility" stepKey="reindex"/> + <comment userInput="Adding the comment to replace 'cache:flush' command for preserving Backward Compatibility" stepKey="flushCache"/> </before> <after> <deleteData createDataKey="createCustomer" stepKey="deleteCreateCustomer"/> From 92dc76438063e68f7523d5ab036a57d7faf7bc03 Mon Sep 17 00:00:00 2001 From: Jason Woods <devel@jasonwoods.me.uk> Date: Tue, 24 Nov 2020 17:26:00 +0000 Subject: [PATCH 067/171] Update app/code/Magento/Cron/Model/DeadlockRetrier.php Co-authored-by: Buba Suma <bubasuma@users.noreply.github.com> --- app/code/Magento/Cron/Model/DeadlockRetrier.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/Cron/Model/DeadlockRetrier.php b/app/code/Magento/Cron/Model/DeadlockRetrier.php index 63f7453c8df3c..ab180e93e0ca3 100644 --- a/app/code/Magento/Cron/Model/DeadlockRetrier.php +++ b/app/code/Magento/Cron/Model/DeadlockRetrier.php @@ -44,7 +44,7 @@ public function execute(callable $callback, AdapterInterface $connection) try { return $callback(); } catch (DeadlockException $e) { - $this->logger->warning(sprintf("Deadlock detected in cron cleanup: %s", $e->getMessage())); + $this->logger->warning(sprintf("Deadlock detected in cron: %s", $e->getMessage())); continue; } } From be7872aa9374e45ac089d732c93f50df9faaa373 Mon Sep 17 00:00:00 2001 From: Oleh Usik <o.usik@atwix.com> Date: Wed, 25 Nov 2020 13:10:29 +0200 Subject: [PATCH 068/171] remove clearing cache for integration tests --- .../testsuite/Magento/GraphQl/Catalog/ProductSearchTest.php | 3 +-- .../Magento/GraphQl/CatalogUrlRewrite/UrlResolverTest.php | 2 -- .../Magento/Catalog/Controller/Adminhtml/ProductTest.php | 3 --- .../testsuite/Magento/Catalog/Model/ConfigTest.php | 3 --- .../Product/Attribute/Source/CountryofmanufactureTest.php | 1 - .../Model/ResourceModel/Attribute/Entity/AttributeTest.php | 1 - .../DataProvider/Product/Form/Modifier/CategoriesTest.php | 1 - .../Magento/Customer/Model/AddressMetadataTest.php | 1 - .../Magento/Customer/Model/CustomerMetadataTest.php | 1 - .../testsuite/Magento/Directory/Block/DataTest.php | 2 -- .../integration/testsuite/Magento/Eav/Model/ConfigTest.php | 6 ------ .../Model/Entity/Attribute/Frontend/DefaultFrontendTest.php | 1 - .../Magento/Eav/Model/Entity/AttributeLoaderTest.php | 1 - .../testsuite/Magento/Framework/App/Config/InitialTest.php | 2 -- .../Framework/App/ObjectManager/ConfigLoaderTest.php | 1 - .../testsuite/Magento/Framework/App/Route/ConfigTest.php | 1 - .../Magento/Framework/DB/Adapter/Pdo/MysqlTest.php | 1 - .../Magento/Framework/Reflection/MethodsMapTest.php | 2 -- .../testsuite/Magento/Framework/TranslateTest.php | 1 - .../Element/UiComponent/Config/Provider/TemplateTest.php | 1 - .../testsuite/Magento/ProductAlert/Model/ObserverTest.php | 1 - .../Controller/Adminhtml/Dashboard/IndexTest.php | 3 --- .../testsuite/Magento/Store/Model/StoreResolverTest.php | 1 - .../Magento/Theme/Model/Theme/ThemeProviderTest.php | 1 - .../Magento/Translation/Model/Js/PreProcessorTest.php | 1 - 25 files changed, 1 insertion(+), 41 deletions(-) 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 7b14fe9159c57..2d0892b78c246 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/ProductSearchTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/ProductSearchTest.php @@ -154,7 +154,6 @@ private function compareFilterNames(array $a, array $b) */ public function testLayeredNavigationForConfigurableProducts() { - CacheCleaner::cleanAll(); $attributeCode = 'test_configurable'; /** @var Config $eavConfig */ @@ -258,7 +257,7 @@ private function getQueryProductsWithArrayOfCustomAttributes($attributeCode, $fi */ public function testFilterProductsByDropDownCustomAttribute() { - CacheCleaner::cleanAll(); + CacheCleaner::clean(['eav']); $attributeCode = 'second_test_configurable'; $optionValue = $this->getDefaultAttributeOptionValue($attributeCode); $query = <<<QUERY diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/CatalogUrlRewrite/UrlResolverTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/CatalogUrlRewrite/UrlResolverTest.php index b12630d70713a..d93f6d486c504 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/CatalogUrlRewrite/UrlResolverTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/CatalogUrlRewrite/UrlResolverTest.php @@ -224,8 +224,6 @@ public function testRedirectsAndCustomInput() $urlRewriteModel->setId($urlRewriteModel->getId()); $urlRewriteModel->save(); - ObjectManager::getInstance()->get(\Magento\TestFramework\Helper\CacheCleaner::class)->cleanAll(); - //modifying query by adding spaces to avoid getting cached values. $this->queryUrlAndAssertResponse( (int) $product->getEntityId(), diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Controller/Adminhtml/ProductTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Controller/Adminhtml/ProductTest.php index 7032199e9fc4c..8b18f89542494 100644 --- a/dev/tests/integration/testsuite/Magento/Catalog/Controller/Adminhtml/ProductTest.php +++ b/dev/tests/integration/testsuite/Magento/Catalog/Controller/Adminhtml/ProductTest.php @@ -138,9 +138,6 @@ public function testSaveActionAndDuplicateWithUrlPathAttribute() $urlPathAttribute = $product->getCustomAttribute('url_path'); $this->assertEquals($urlPathAttribute->getValue(), $product->getSku()); - // clean cache - CacheCleaner::cleanAll(); - // dispatch Save&Duplicate action and check it $this->assertSaveAndDuplicateAction($product); } diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Model/ConfigTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Model/ConfigTest.php index 36379adcee601..8320ef979180f 100644 --- a/dev/tests/integration/testsuite/Magento/Catalog/Model/ConfigTest.php +++ b/dev/tests/integration/testsuite/Magento/Catalog/Model/ConfigTest.php @@ -31,7 +31,6 @@ protected function setUp(): void public function testGetEntityAttributeCodes() { $entityType = 'catalog_product'; - CacheCleaner::cleanAll(); $this->assertEquals( $this->config->getEntityAttributeCodes($entityType), $this->config->getEntityAttributeCodes($entityType) @@ -42,7 +41,6 @@ public function testGetAttribute() { $entityType = 'catalog_product'; $attributeCode = 'color'; - CacheCleaner::cleanAll(); $this->assertEquals( $this->config->getAttribute($entityType, $attributeCode), $this->config->getAttribute($entityType, $attributeCode) @@ -52,7 +50,6 @@ public function testGetAttribute() public function testGetEntityType() { $entityType = 'catalog_product'; - CacheCleaner::cleanAll(); $this->assertEquals( $this->config->getEntityType($entityType), $this->config->getEntityType($entityType) diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/Attribute/Source/CountryofmanufactureTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/Attribute/Source/CountryofmanufactureTest.php index 33e82e9f6ddcc..8b8f54af2d387 100644 --- a/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/Attribute/Source/CountryofmanufactureTest.php +++ b/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/Attribute/Source/CountryofmanufactureTest.php @@ -24,7 +24,6 @@ protected function setUp(): void public function testGetAllOptions() { - CacheCleaner::cleanAll(); $allOptions = $this->model->getAllOptions(); $cachedAllOptions = $this->model->getAllOptions(); $this->assertEquals($allOptions, $cachedAllOptions); diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Model/ResourceModel/Attribute/Entity/AttributeTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Model/ResourceModel/Attribute/Entity/AttributeTest.php index 5b9c7b267f188..7d9e9a48093cb 100644 --- a/dev/tests/integration/testsuite/Magento/Catalog/Model/ResourceModel/Attribute/Entity/AttributeTest.php +++ b/dev/tests/integration/testsuite/Magento/Catalog/Model/ResourceModel/Attribute/Entity/AttributeTest.php @@ -52,7 +52,6 @@ class AttributeTest extends \PHPUnit\Framework\TestCase */ protected function setUp(): void { - CacheCleaner::cleanAll(); $this->objectManager = Bootstrap::getObjectManager(); $this->productRepository = $this->objectManager->get(ProductRepositoryInterface::class); $this->attributeRepository = $this->objectManager->get(AttributeRepository::class); diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Ui/DataProvider/Product/Form/Modifier/CategoriesTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Ui/DataProvider/Product/Form/Modifier/CategoriesTest.php index 8ad346af068b4..d5e7d94ec0cae 100644 --- a/dev/tests/integration/testsuite/Magento/Catalog/Ui/DataProvider/Product/Form/Modifier/CategoriesTest.php +++ b/dev/tests/integration/testsuite/Magento/Catalog/Ui/DataProvider/Product/Form/Modifier/CategoriesTest.php @@ -39,7 +39,6 @@ public function testModifyMeta() { $inputMeta = include __DIR__ . '/_files/input_meta_for_categories.php'; $expectedCategories = include __DIR__ . '/_files/expected_categories.php'; - CacheCleaner::cleanAll(); $this->assertCategoriesInMeta($expectedCategories, $this->object->modifyMeta($inputMeta)); // Verify cached data $this->assertCategoriesInMeta($expectedCategories, $this->object->modifyMeta($inputMeta)); diff --git a/dev/tests/integration/testsuite/Magento/Customer/Model/AddressMetadataTest.php b/dev/tests/integration/testsuite/Magento/Customer/Model/AddressMetadataTest.php index 647c386e2b784..4443d170e388a 100644 --- a/dev/tests/integration/testsuite/Magento/Customer/Model/AddressMetadataTest.php +++ b/dev/tests/integration/testsuite/Magento/Customer/Model/AddressMetadataTest.php @@ -19,7 +19,6 @@ class AddressMetadataTest extends \PHPUnit\Framework\TestCase protected function setUp(): void { - CacheCleaner::cleanAll(); $objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); $objectManager->configure( [ diff --git a/dev/tests/integration/testsuite/Magento/Customer/Model/CustomerMetadataTest.php b/dev/tests/integration/testsuite/Magento/Customer/Model/CustomerMetadataTest.php index c3e08b5294679..63d7019ee4f61 100644 --- a/dev/tests/integration/testsuite/Magento/Customer/Model/CustomerMetadataTest.php +++ b/dev/tests/integration/testsuite/Magento/Customer/Model/CustomerMetadataTest.php @@ -29,7 +29,6 @@ class CustomerMetadataTest extends \PHPUnit\Framework\TestCase protected function setUp(): void { - CacheCleaner::cleanAll(); $objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); $objectManager->configure( [\Magento\Framework\Api\ExtensionAttribute\Config\Reader::class => [ diff --git a/dev/tests/integration/testsuite/Magento/Directory/Block/DataTest.php b/dev/tests/integration/testsuite/Magento/Directory/Block/DataTest.php index ea2368a35c2f2..ccc1ea3f2f0b9 100644 --- a/dev/tests/integration/testsuite/Magento/Directory/Block/DataTest.php +++ b/dev/tests/integration/testsuite/Magento/Directory/Block/DataTest.php @@ -22,7 +22,6 @@ protected function setUp(): void public function testGetCountryHtmlSelect() { - CacheCleaner::cleanAll(); $result = $this->block->getCountryHtmlSelect(); $resultTwo = $this->block->getCountryHtmlSelect(); $this->assertEquals($result, $resultTwo); @@ -30,7 +29,6 @@ public function testGetCountryHtmlSelect() public function testGetRegionHtmlSelect() { - CacheCleaner::cleanAll(); $result = $this->block->getRegionHtmlSelect(); $resultTwo = $this->block->getRegionHtmlSelect(); $this->assertEquals($result, $resultTwo); diff --git a/dev/tests/integration/testsuite/Magento/Eav/Model/ConfigTest.php b/dev/tests/integration/testsuite/Magento/Eav/Model/ConfigTest.php index a2865d52517fa..63fcfbd061877 100644 --- a/dev/tests/integration/testsuite/Magento/Eav/Model/ConfigTest.php +++ b/dev/tests/integration/testsuite/Magento/Eav/Model/ConfigTest.php @@ -33,7 +33,6 @@ protected function setUp(): void public function testGetEntityAttributeCodes() { $entityType = 'test'; - CacheCleaner::cleanAll(); $entityAttributeCodes1 = $this->config->getEntityAttributeCodes($entityType); $this->assertEquals( [ @@ -60,7 +59,6 @@ public function testGetEntityAttributeCodesWithObject() $testEntityType = Bootstrap::getObjectManager()->create(\Magento\Eav\Model\Entity\Type::class) ->loadByCode('test'); $attributeSetId = $testEntityType->getDefaultAttributeSetId(); - CacheCleaner::cleanAll(); $object = new DataObject( [ 'attribute_set_id' => $attributeSetId, @@ -86,7 +84,6 @@ public function testGetEntityAttributeCodesWithObject() public function testGetAttributes() { $entityType = 'test'; - CacheCleaner::cleanAll(); $attributes1 = $this->config->getAttributes($entityType); $expectedAttributeCodes = [ 'attribute_for_search_1', @@ -111,7 +108,6 @@ public function testGetAttributes() public function testGetAttribute() { $entityType = 'test'; - CacheCleaner::cleanAll(); $attribute1 = $this->config->getAttribute($entityType, 'attribute_for_search_1'); $this->assertEquals('attribute_for_search_1', $attribute1->getAttributeCode()); $this->assertEquals('varchar', $attribute1->getBackendType()); @@ -153,8 +149,6 @@ public function testGetAttributeWithCacheUserDefinedAttribute() $config = Bootstrap::getObjectManager()->create(\Magento\Eav\Model\Config::class); $updatedAttribute = $config->getAttribute($entityType, 'foo'); $this->assertEquals('foo', $updatedAttribute->getFrontendLabel()); - // Clean cache - CacheCleaner::cleanAll(); $config = Bootstrap::getObjectManager()->create(\Magento\Eav\Model\Config::class); // Check that attribute data has changed $updatedAttributeAfterCacheClean = $config->getAttribute($entityType, 'foo'); diff --git a/dev/tests/integration/testsuite/Magento/Eav/Model/Entity/Attribute/Frontend/DefaultFrontendTest.php b/dev/tests/integration/testsuite/Magento/Eav/Model/Entity/Attribute/Frontend/DefaultFrontendTest.php index b27e81129e1c3..cb7d288deb75a 100644 --- a/dev/tests/integration/testsuite/Magento/Eav/Model/Entity/Attribute/Frontend/DefaultFrontendTest.php +++ b/dev/tests/integration/testsuite/Magento/Eav/Model/Entity/Attribute/Frontend/DefaultFrontendTest.php @@ -55,7 +55,6 @@ class DefaultFrontendTest extends \PHPUnit\Framework\TestCase protected function setUp(): void { - CacheCleaner::cleanAll(); $this->objectManager = Bootstrap::getObjectManager(); $this->defaultFrontend = $this->objectManager->get(DefaultFrontend::class); diff --git a/dev/tests/integration/testsuite/Magento/Eav/Model/Entity/AttributeLoaderTest.php b/dev/tests/integration/testsuite/Magento/Eav/Model/Entity/AttributeLoaderTest.php index 7a0c66e7e2db2..817c37bca528b 100644 --- a/dev/tests/integration/testsuite/Magento/Eav/Model/Entity/AttributeLoaderTest.php +++ b/dev/tests/integration/testsuite/Magento/Eav/Model/Entity/AttributeLoaderTest.php @@ -32,7 +32,6 @@ class AttributeLoaderTest extends \PHPUnit\Framework\TestCase protected function setUp(): void { - CacheCleaner::cleanAll(); $this->objectManager = Bootstrap::getObjectManager(); $this->attributeLoader = $this->objectManager->get(AttributeLoader::class); $entityType = $this->objectManager->create(\Magento\Eav\Model\Entity\Type::class) diff --git a/dev/tests/integration/testsuite/Magento/Framework/App/Config/InitialTest.php b/dev/tests/integration/testsuite/Magento/Framework/App/Config/InitialTest.php index 43203d38e308f..2b3ebc217ab7b 100644 --- a/dev/tests/integration/testsuite/Magento/Framework/App/Config/InitialTest.php +++ b/dev/tests/integration/testsuite/Magento/Framework/App/Config/InitialTest.php @@ -24,7 +24,6 @@ protected function setUp(): void public function testGetMetadata() { - CacheCleaner::cleanAll(); $this->assertEquals( $this->objectManager->create(Config::class)->getMetadata(), $this->objectManager->create(Config::class)->getMetadata() @@ -37,7 +36,6 @@ public function testGetMetadata() */ public function testGetData($scope) { - CacheCleaner::cleanAll(); $this->assertEquals( $this->objectManager->create(Config::class)->getData($scope), $this->objectManager->create(Config::class)->getData($scope) diff --git a/dev/tests/integration/testsuite/Magento/Framework/App/ObjectManager/ConfigLoaderTest.php b/dev/tests/integration/testsuite/Magento/Framework/App/ObjectManager/ConfigLoaderTest.php index 1a2b8772c2dc5..ed4e15bd78a0c 100644 --- a/dev/tests/integration/testsuite/Magento/Framework/App/ObjectManager/ConfigLoaderTest.php +++ b/dev/tests/integration/testsuite/Magento/Framework/App/ObjectManager/ConfigLoaderTest.php @@ -24,7 +24,6 @@ protected function setUp(): void public function testLoad() { - CacheCleaner::cleanAll(); $data = $this->object->load('global'); $this->assertNotEmpty($data); $cachedData = $this->object->load('global'); diff --git a/dev/tests/integration/testsuite/Magento/Framework/App/Route/ConfigTest.php b/dev/tests/integration/testsuite/Magento/Framework/App/Route/ConfigTest.php index ff37b7d847921..d0c8c6083caee 100644 --- a/dev/tests/integration/testsuite/Magento/Framework/App/Route/ConfigTest.php +++ b/dev/tests/integration/testsuite/Magento/Framework/App/Route/ConfigTest.php @@ -28,7 +28,6 @@ protected function setUp(): void */ public function testGetRouteFrontName($route, $scope) { - CacheCleaner::cleanAll(); $this->assertEquals( $this->objectManager->create(Config::class)->getRouteFrontName($route, $scope), $this->objectManager->create(Config::class)->getRouteFrontName($route, $scope) diff --git a/dev/tests/integration/testsuite/Magento/Framework/DB/Adapter/Pdo/MysqlTest.php b/dev/tests/integration/testsuite/Magento/Framework/DB/Adapter/Pdo/MysqlTest.php index 6e3391bd8959f..a93e8c198336e 100644 --- a/dev/tests/integration/testsuite/Magento/Framework/DB/Adapter/Pdo/MysqlTest.php +++ b/dev/tests/integration/testsuite/Magento/Framework/DB/Adapter/Pdo/MysqlTest.php @@ -27,7 +27,6 @@ protected function setUp(): void set_error_handler(null); $this->resourceConnection = Bootstrap::getObjectManager() ->get(ResourceConnection::class); - CacheCleaner::cleanAll(); } protected function tearDown(): void diff --git a/dev/tests/integration/testsuite/Magento/Framework/Reflection/MethodsMapTest.php b/dev/tests/integration/testsuite/Magento/Framework/Reflection/MethodsMapTest.php index 585933422edb8..cbe3c552544d4 100644 --- a/dev/tests/integration/testsuite/Magento/Framework/Reflection/MethodsMapTest.php +++ b/dev/tests/integration/testsuite/Magento/Framework/Reflection/MethodsMapTest.php @@ -24,7 +24,6 @@ protected function setUp(): void public function testGetMethodsMap() { - CacheCleaner::cleanAll(); $data = $this->object->getMethodsMap(\Magento\Framework\Reflection\MethodsMap::class); $this->assertArrayHasKey('getMethodsMap', $data); $cachedData = $this->object->getMethodsMap(\Magento\Framework\Reflection\MethodsMap::class); @@ -33,7 +32,6 @@ public function testGetMethodsMap() public function testGetMethodParams() { - CacheCleaner::cleanAll(); $data = $this->object->getMethodParams( \Magento\Framework\Reflection\MethodsMap::class, 'getMethodParams' diff --git a/dev/tests/integration/testsuite/Magento/Framework/TranslateTest.php b/dev/tests/integration/testsuite/Magento/Framework/TranslateTest.php index 5b48a9169c577..b216831bde33e 100644 --- a/dev/tests/integration/testsuite/Magento/Framework/TranslateTest.php +++ b/dev/tests/integration/testsuite/Magento/Framework/TranslateTest.php @@ -94,7 +94,6 @@ protected function setUp(): void public function testLoadData() { $data = $this->translate->loadData(null, true)->getData(); - CacheCleaner::cleanAll(); $this->translate->loadData()->getData(); $dataCached = $this->translate->loadData()->getData(); $this->assertEquals($data, $dataCached); diff --git a/dev/tests/integration/testsuite/Magento/Framework/View/Element/UiComponent/Config/Provider/TemplateTest.php b/dev/tests/integration/testsuite/Magento/Framework/View/Element/UiComponent/Config/Provider/TemplateTest.php index f58882ee51493..92a51b85c8c4b 100644 --- a/dev/tests/integration/testsuite/Magento/Framework/View/Element/UiComponent/Config/Provider/TemplateTest.php +++ b/dev/tests/integration/testsuite/Magento/Framework/View/Element/UiComponent/Config/Provider/TemplateTest.php @@ -49,7 +49,6 @@ public function testGetTemplate() \Magento\TestFramework\Helper\Bootstrap::getInstance()->loadArea('adminhtml'); $this->objectManager->get(\Magento\Framework\View\DesignInterface::class) ->setDesignTheme('FrameworkViewUiComponent/default'); - CacheCleaner::cleanAll(); $resultOne = $this->model->getTemplate('test.xml'); $resultTwo = $this->model->getTemplate('test.xml'); diff --git a/dev/tests/integration/testsuite/Magento/ProductAlert/Model/ObserverTest.php b/dev/tests/integration/testsuite/Magento/ProductAlert/Model/ObserverTest.php index 287564722ced6..b28788bc649a1 100644 --- a/dev/tests/integration/testsuite/Magento/ProductAlert/Model/ObserverTest.php +++ b/dev/tests/integration/testsuite/Magento/ProductAlert/Model/ObserverTest.php @@ -93,7 +93,6 @@ public function testProcessPortuguese() $secondStore = $storeRepository->get('fixture_second_store'); // check if Portuguese language is specified for the second store - CacheCleaner::cleanAll(); $storeResolver = $this->_objectManager->get(Resolver::class); $storeResolver->emulate($secondStore->getId()); $this->assertEquals('pt_BR', $storeResolver->getLocale()); diff --git a/dev/tests/integration/testsuite/Magento/ReleaseNotification/Controller/Adminhtml/Dashboard/IndexTest.php b/dev/tests/integration/testsuite/Magento/ReleaseNotification/Controller/Adminhtml/Dashboard/IndexTest.php index 9358d761b28b2..63c5e04bac84a 100644 --- a/dev/tests/integration/testsuite/Magento/ReleaseNotification/Controller/Adminhtml/Dashboard/IndexTest.php +++ b/dev/tests/integration/testsuite/Magento/ReleaseNotification/Controller/Adminhtml/Dashboard/IndexTest.php @@ -44,7 +44,6 @@ public function testExecute() { $content = include __DIR__ . '/../../../_files/validContent.php'; - CacheCleaner::cleanAll(); $this->contentProviderMock->expects($this->any()) ->method('getContent') ->willReturn($content); @@ -62,7 +61,6 @@ public function testExecute() public function testExecuteEmptyContent() { - CacheCleaner::cleanAll(); $this->contentProviderMock->expects($this->any()) ->method('getContent') ->willReturn('[]'); @@ -77,7 +75,6 @@ public function testExecuteEmptyContent() public function testExecuteFalseContent() { - CacheCleaner::cleanAll(); $this->contentProviderMock->expects($this->any()) ->method('getContent') ->willReturn(false); diff --git a/dev/tests/integration/testsuite/Magento/Store/Model/StoreResolverTest.php b/dev/tests/integration/testsuite/Magento/Store/Model/StoreResolverTest.php index 53c58cc693a6e..c20b0ed27bf52 100644 --- a/dev/tests/integration/testsuite/Magento/Store/Model/StoreResolverTest.php +++ b/dev/tests/integration/testsuite/Magento/Store/Model/StoreResolverTest.php @@ -28,7 +28,6 @@ public function testGetStoreData() $storeResolver = $this->objectManager->get(\Magento\Store\Model\StoreResolver::class); $storesDataRead = $methodReadStoresData->invoke($storeResolver); - CacheCleaner::cleanAll(); $storesData = $methodGetStoresData->invoke($storeResolver); $storesDataCached = $methodGetStoresData->invoke($storeResolver); $this->assertEquals($storesDataRead, $storesData); diff --git a/dev/tests/integration/testsuite/Magento/Theme/Model/Theme/ThemeProviderTest.php b/dev/tests/integration/testsuite/Magento/Theme/Model/Theme/ThemeProviderTest.php index 2f3d7065e5339..e2895a478b8d9 100644 --- a/dev/tests/integration/testsuite/Magento/Theme/Model/Theme/ThemeProviderTest.php +++ b/dev/tests/integration/testsuite/Magento/Theme/Model/Theme/ThemeProviderTest.php @@ -33,7 +33,6 @@ protected function setUp(): void $this->themeProviderOne = $objectManager->create(ThemeProvider::class); $this->themeProviderTwo = clone $this->themeProviderOne; $this->themeCollection = $objectManager->create(ThemeCollection::class); - CacheCleaner::clean(); } public function testGetThemeById() diff --git a/dev/tests/integration/testsuite/Magento/Translation/Model/Js/PreProcessorTest.php b/dev/tests/integration/testsuite/Magento/Translation/Model/Js/PreProcessorTest.php index 4bc1c5b55ade5..842912546ece8 100644 --- a/dev/tests/integration/testsuite/Magento/Translation/Model/Js/PreProcessorTest.php +++ b/dev/tests/integration/testsuite/Magento/Translation/Model/Js/PreProcessorTest.php @@ -82,7 +82,6 @@ protected function tearDown(): void */ public function testProcess(string $content, string $translation) { - CacheCleaner::cleanAll(); $this->assertEquals($translation, $this->model->translate($content)); } From a8c72b00d7d30a60499e0aea085fade9df480b82 Mon Sep 17 00:00:00 2001 From: "taras.gamanov" <engcom-vendorworker-hotel@adobe.com> Date: Thu, 26 Nov 2020 11:55:55 +0200 Subject: [PATCH 069/171] flaky test has been updated (MC-12599) --- ...ConfigsChangesIsNotAffectedStartedCheckoutProcessTest.xml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/AdminCheckConfigsChangesIsNotAffectedStartedCheckoutProcessTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/AdminCheckConfigsChangesIsNotAffectedStartedCheckoutProcessTest.xml index df229c4b6ed78..ffbd6152af80b 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/AdminCheckConfigsChangesIsNotAffectedStartedCheckoutProcessTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/AdminCheckConfigsChangesIsNotAffectedStartedCheckoutProcessTest.xml @@ -58,6 +58,11 @@ <argument name="address" value="US_Address_TX"/> </actionGroup> + <!-- Select Free Shipping --> + <actionGroup ref="StorefrontSetShippingMethodActionGroup" stepKey="setShippingMethodFreeShipping"> + <argument name="shippingMethodName" value="Free Shipping"/> + </actionGroup> + <!-- Assert Free Shipping checkbox --> <seeCheckboxIsChecked selector="{{CheckoutShippingMethodsSection.shippingMethodFreeShipping}}" stepKey="freeShippingMethodCheckboxIsChecked"/> From 66a0607d8d781b2ae84c90e8afc3ad949706cf7a Mon Sep 17 00:00:00 2001 From: Stanislav Ilnytskyi <stailx1@gmail.com> Date: Thu, 26 Nov 2020 13:12:52 +0100 Subject: [PATCH 070/171] int type for price indexer --- .../Model/Indexer/ProductPriceIndexFilter.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/code/Magento/CatalogInventory/Model/Indexer/ProductPriceIndexFilter.php b/app/code/Magento/CatalogInventory/Model/Indexer/ProductPriceIndexFilter.php index 2ad7ca9f14963..2b37c9099a0e6 100644 --- a/app/code/Magento/CatalogInventory/Model/Indexer/ProductPriceIndexFilter.php +++ b/app/code/Magento/CatalogInventory/Model/Indexer/ProductPriceIndexFilter.php @@ -105,7 +105,7 @@ public function modifyPrice(IndexTableStructure $priceTable, array $entityIds = } if (!empty($entityIds)) { - $select->where('stock_item.product_id in (?)', $entityIds, \Zend_Db::INT_TYPE); + $select->where('stock_item.product_id IN (?)', $entityIds, \Zend_Db::INT_TYPE); } $select->group('stock_item.product_id'); @@ -121,7 +121,7 @@ public function modifyPrice(IndexTableStructure $priceTable, array $entityIds = foreach ($batchSelectIterator as $select) { $productIds = null; foreach ($connection->query($select)->fetchAll() as $row) { - $productIds[] = $row['product_id']; + $productIds[] = (int) $row['product_id']; } if ($productIds !== null) { $where = [$priceTable->getEntityField() .' IN (?)' => $productIds]; From f13157df893426f6a4d5a031b046add21c319693 Mon Sep 17 00:00:00 2001 From: Oleh Usik <o.usik@atwix.com> Date: Thu, 26 Nov 2020 23:46:08 +0200 Subject: [PATCH 071/171] Update dev/tests/api-functional/testsuite/Magento/GraphQl/CatalogUrlRewrite/UrlResolverTest.php --- .../Magento/GraphQl/CatalogUrlRewrite/UrlResolverTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/CatalogUrlRewrite/UrlResolverTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/CatalogUrlRewrite/UrlResolverTest.php index d93f6d486c504..6188e67eaa393 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/CatalogUrlRewrite/UrlResolverTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/CatalogUrlRewrite/UrlResolverTest.php @@ -223,7 +223,7 @@ public function testRedirectsAndCustomInput() $urlRewriteModel->setRedirectType('301'); $urlRewriteModel->setId($urlRewriteModel->getId()); $urlRewriteModel->save(); - +ObjectManager::getInstance()->get(\Magento\TestFramework\Helper\CacheCleaner::class)->clean(['eav']); //modifying query by adding spaces to avoid getting cached values. $this->queryUrlAndAssertResponse( (int) $product->getEntityId(), From 6c2d07c4a3b9cfd3191e2382efdbf2ef834d19cf Mon Sep 17 00:00:00 2001 From: Oleh Usik <o.usik@atwix.com> Date: Thu, 26 Nov 2020 23:46:58 +0200 Subject: [PATCH 072/171] Update dev/tests/api-functional/testsuite/Magento/GraphQl/CatalogUrlRewrite/UrlResolverTest.php --- .../Magento/GraphQl/CatalogUrlRewrite/UrlResolverTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/CatalogUrlRewrite/UrlResolverTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/CatalogUrlRewrite/UrlResolverTest.php index 6188e67eaa393..2f6fc2ee112fa 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/CatalogUrlRewrite/UrlResolverTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/CatalogUrlRewrite/UrlResolverTest.php @@ -223,7 +223,7 @@ public function testRedirectsAndCustomInput() $urlRewriteModel->setRedirectType('301'); $urlRewriteModel->setId($urlRewriteModel->getId()); $urlRewriteModel->save(); -ObjectManager::getInstance()->get(\Magento\TestFramework\Helper\CacheCleaner::class)->clean(['eav']); + ObjectManager::getInstance()->get(\Magento\TestFramework\Helper\CacheCleaner::class)->clean(['eav']); //modifying query by adding spaces to avoid getting cached values. $this->queryUrlAndAssertResponse( (int) $product->getEntityId(), From e7bd3acc0e39f94d090bf5450581016d61f2c5e5 Mon Sep 17 00:00:00 2001 From: Stanislav Ilnytskyi <stailx1@gmail.com> Date: Fri, 27 Nov 2020 08:36:42 +0100 Subject: [PATCH 073/171] add cast to int type in other places --- .../Model/Export/AdvancedPricing.php | 3 ++- .../Bundle/Model/ResourceModel/Selection.php | 3 ++- .../Indexer/Product/Price/AbstractAction.php | 13 ++++++----- .../Catalog/Model/ResourceModel/Attribute.php | 2 +- .../Catalog/Model/ResourceModel/Category.php | 3 ++- .../Catalog/Model/ResourceModel/Url.php | 22 ++++++++++++------- .../DataProvider/AttributeQuery.php | 2 +- .../Model/Indexer/Stock/AbstractAction.php | 4 ++-- .../Indexer/Stock/DefaultStock.php | 2 +- .../Model/ResourceModel/Stock/Status.php | 8 ++++--- .../CatalogRule/Model/ResourceModel/Rule.php | 2 +- .../Indexer/Stock/Configurable.php | 2 +- .../Product/Type/Configurable.php | 2 +- .../ResourceModel/Indexer/Stock/Grouped.php | 2 +- .../Product/Indexer/Price/Grouped.php | 2 +- .../Model/ResourceModel/Video.php | 3 ++- .../ResourceModel/Customer/Collection.php | 3 ++- 17 files changed, 47 insertions(+), 31 deletions(-) diff --git a/app/code/Magento/AdvancedPricingImportExport/Model/Export/AdvancedPricing.php b/app/code/Magento/AdvancedPricingImportExport/Model/Export/AdvancedPricing.php index af43562984134..b63141b510b85 100644 --- a/app/code/Magento/AdvancedPricingImportExport/Model/Export/AdvancedPricing.php +++ b/app/code/Magento/AdvancedPricingImportExport/Model/Export/AdvancedPricing.php @@ -486,7 +486,8 @@ private function fetchTierPrices(array $productIds): array ) ->where( 'ap.' . $productEntityLinkField . ' IN (?)', - $productIds + $productIds, + \Zend_Db::INT_TYPE ); if ($priceFromFilter !== null) { diff --git a/app/code/Magento/Bundle/Model/ResourceModel/Selection.php b/app/code/Magento/Bundle/Model/ResourceModel/Selection.php index ead687faff7bc..45018406277f9 100644 --- a/app/code/Magento/Bundle/Model/ResourceModel/Selection.php +++ b/app/code/Magento/Bundle/Model/ResourceModel/Selection.php @@ -145,7 +145,8 @@ public function getParentIdsByChild($childId) ['e.entity_id as parent_product_id'] )->where( $this->getMainTable() . '.product_id IN(?)', - $childId + $childId, + \Zend_Db::INT_TYPE ); return $connection->fetchCol($select); diff --git a/app/code/Magento/Catalog/Model/Indexer/Product/Price/AbstractAction.php b/app/code/Magento/Catalog/Model/Indexer/Product/Price/AbstractAction.php index f3a4b322e29df..404fd27232b93 100644 --- a/app/code/Magento/Catalog/Model/Indexer/Product/Price/AbstractAction.php +++ b/app/code/Magento/Catalog/Model/Indexer/Product/Price/AbstractAction.php @@ -465,10 +465,11 @@ protected function _copyRelationIndexData($parentIds, $excludeIds = null) [] )->where( 'e.entity_id IN(?)', - $parentIds + $parentIds, + \Zend_Db::INT_TYPE ); if (!empty($excludeIds)) { - $select->where('child_id NOT IN(?)', $excludeIds); + $select->where('child_id NOT IN(?)', $excludeIds, \Zend_Db::INT_TYPE); } $children = $this->getConnection()->fetchCol($select); @@ -479,7 +480,8 @@ protected function _copyRelationIndexData($parentIds, $excludeIds = null) $this->getIndexTargetTableByDimension($dimensions) )->where( 'entity_id IN(?)', - $children + $children, + \Zend_Db::INT_TYPE ); $query = $select->insertFromSelect($this->_defaultIndexerResource->getIdxTable(), [], false); $this->getConnection()->query($query); @@ -578,13 +580,14 @@ private function getParentProductsTypes(array $productsIds) ['e.entity_id as parent_id', 'type_id'] )->where( 'l.child_id IN(?)', - $productsIds + $productsIds, + \Zend_Db::INT_TYPE ); $pairs = $this->getConnection()->fetchPairs($select); $byType = []; foreach ($pairs as $productId => $productType) { - $byType[$productType][$productId] = $productId; + $byType[$productType][$productId] = (int)$productId; } return $byType; diff --git a/app/code/Magento/Catalog/Model/ResourceModel/Attribute.php b/app/code/Magento/Catalog/Model/ResourceModel/Attribute.php index 203126cf1fd8c..03f1edea0ea77 100644 --- a/app/code/Magento/Catalog/Model/ResourceModel/Attribute.php +++ b/app/code/Magento/Catalog/Model/ResourceModel/Attribute.php @@ -101,7 +101,7 @@ protected function _clearUselessAttributeValues(\Magento\Framework\Model\Abstrac $attributeStoreIds = array_keys($this->_storeManager->getStores()); if (!empty($attributeStoreIds)) { $delCondition = [ - 'attribute_id = ?' => $object->getId(), + 'attribute_id = ?' => (int)$object->getId(), 'store_id IN(?)' => $attributeStoreIds, ]; $this->getConnection()->delete($object->getBackendTable(), $delCondition); diff --git a/app/code/Magento/Catalog/Model/ResourceModel/Category.php b/app/code/Magento/Catalog/Model/ResourceModel/Category.php index e19286efc38c0..ed2df0f10ac3b 100644 --- a/app/code/Magento/Catalog/Model/ResourceModel/Category.php +++ b/app/code/Magento/Catalog/Model/ResourceModel/Category.php @@ -575,7 +575,8 @@ public function verifyIds(array $ids) 'entity_id' )->where( 'entity_id IN(?)', - $ids + $ids, + \Zend_Db::INT_TYPE ); return $this->getConnection()->fetchCol($select); diff --git a/app/code/Magento/Catalog/Model/ResourceModel/Url.php b/app/code/Magento/Catalog/Model/ResourceModel/Url.php index be95f088a2477..eceae322fbd8e 100644 --- a/app/code/Magento/Catalog/Model/ResourceModel/Url.php +++ b/app/code/Magento/Catalog/Model/ResourceModel/Url.php @@ -204,7 +204,8 @@ protected function _getCategoryAttribute($attributeCode, $categoryIds, $storeId) ['value' => $attributeCode, 'entity_id' => 'entity_id'] )->where( 'entity_id IN(?)', - $categoryIds + $categoryIds, + \Zend_Db::INT_TYPE ); } elseif ($this->_categoryAttributes[$attributeCode]['is_global'] || $storeId == 0) { $select->from( @@ -216,7 +217,8 @@ protected function _getCategoryAttribute($attributeCode, $categoryIds, $storeId) ['value'] )->where( "t1.{$identifierFiled} IN(?)", - $categoryIds + $categoryIds, + \Zend_Db::INT_TYPE )->where( 'e.attribute_id = :attribute_id' )->where( @@ -245,7 +247,8 @@ protected function _getCategoryAttribute($attributeCode, $categoryIds, $storeId) 't1.attribute_id = :attribute_id' )->where( "e.entity_id IN(?)", - $categoryIds + $categoryIds, + \Zend_Db::INT_TYPE )->group('e.entity_id'); $bind['attribute_id'] = $this->_categoryAttributes[$attributeCode]['attribute_id']; @@ -308,7 +311,8 @@ public function _getProductAttribute($attributeCode, $productIds, $storeId) 0 )->where( 'entity_id IN(?)', - $productIds + $productIds, + \Zend_Db::INT_TYPE ); } else { $valueExpr = $connection->getCheckSql('t2.value_id > 0', 't2.value', 't1.value'); @@ -326,7 +330,8 @@ public function _getProductAttribute($attributeCode, $productIds, $storeId) 't1.attribute_id = :attribute_id' )->where( 't1.entity_id IN(?)', - $productIds + $productIds, + \Zend_Db::INT_TYPE ); $bind['store_id'] = $storeId; } @@ -430,7 +435,7 @@ protected function _getCategories($categoryIds, $storeId = null, $path = null) // Prepare variables for checking whether categories belong to store if ($path === null) { - $select->where('main_table.entity_id IN(?)', $categoryIds); + $select->where('main_table.entity_id IN(?)', $categoryIds, \Zend_Db::INT_TYPE); } else { // Ensure that path ends with '/', otherwise we can get wrong results - e.g. $path = '1/2' will get '1/20' if (substr($path, -1) != '/') { @@ -569,7 +574,7 @@ protected function _getProducts($productIds, $storeId, $entityId, &$lastEntityId $this->_productLimit ); if ($productIds !== null) { - $select->where('e.entity_id IN(?)', $productIds); + $select->where('e.entity_id IN(?)', $productIds, \Zend_Db::INT_TYPE); } $rowSet = $connection->fetchAll($select, $bind); @@ -591,7 +596,8 @@ protected function _getProducts($productIds, $storeId, $entityId, &$lastEntityId ['product_id', 'category_id'] )->where( 'product_id IN(?)', - array_keys($products) + array_keys($products), + \Zend_Db::INT_TYPE ); $categories = $connection->fetchAll($select); foreach ($categories as $category) { diff --git a/app/code/Magento/CatalogGraphQl/DataProvider/AttributeQuery.php b/app/code/Magento/CatalogGraphQl/DataProvider/AttributeQuery.php index b0f085932bb8e..201c70913ca39 100644 --- a/app/code/Magento/CatalogGraphQl/DataProvider/AttributeQuery.php +++ b/app/code/Magento/CatalogGraphQl/DataProvider/AttributeQuery.php @@ -148,7 +148,7 @@ private function getAttributesFromEntityTable( ): Select { $select = $connection->select() ->from(['e' => $entityTableName], $entityTableAttributes) - ->where('e.entity_id IN (?)', $entityIds); + ->where('e.entity_id IN (?)', $entityIds, \Zend_Db::INT_TYPE); return $select; } diff --git a/app/code/Magento/CatalogInventory/Model/Indexer/Stock/AbstractAction.php b/app/code/Magento/CatalogInventory/Model/Indexer/Stock/AbstractAction.php index 4ea6b6bcfde9a..0b5f248331bfd 100644 --- a/app/code/Magento/CatalogInventory/Model/Indexer/Stock/AbstractAction.php +++ b/app/code/Magento/CatalogInventory/Model/Indexer/Stock/AbstractAction.php @@ -167,7 +167,7 @@ public function getRelationsByChild($childIds) )->join( ['relation' => $this->_getTable('catalog_product_relation')], 'relation.parent_id = cpe.' . $linkField - )->where('child_id IN(?)', $childIds); + )->where('child_id IN(?)', $childIds, \Zend_Db::INT_TYPE); return $connection->fetchCol($select); } @@ -262,7 +262,7 @@ private function doReindex($productIds = []) // retrieve product types by processIds $select = $connection->select() ->from($this->_getTable('catalog_product_entity'), ['entity_id', 'type_id']) - ->where('entity_id IN(?)', $productIds); + ->where('entity_id IN(?)', $productIds, \Zend_Db::INT_TYPE); $pairs = $connection->fetchPairs($select); $byType = []; diff --git a/app/code/Magento/CatalogInventory/Model/ResourceModel/Indexer/Stock/DefaultStock.php b/app/code/Magento/CatalogInventory/Model/ResourceModel/Indexer/Stock/DefaultStock.php index c151e5897abd5..dec18044b699e 100644 --- a/app/code/Magento/CatalogInventory/Model/ResourceModel/Indexer/Stock/DefaultStock.php +++ b/app/code/Magento/CatalogInventory/Model/ResourceModel/Indexer/Stock/DefaultStock.php @@ -261,7 +261,7 @@ protected function _getStockStatusSelect($entityIds = null, $usePrimaryTable = f $select->columns(['status' => $this->getStatusExpression($connection, true)]); if ($entityIds !== null) { - $select->where('e.entity_id IN(?)', $entityIds); + $select->where('e.entity_id IN(?)', $entityIds, \Zend_Db::INT_TYPE); } return $select; diff --git a/app/code/Magento/CatalogInventory/Model/ResourceModel/Stock/Status.php b/app/code/Magento/CatalogInventory/Model/ResourceModel/Stock/Status.php index 02e443d09b228..afb7d51335df8 100644 --- a/app/code/Magento/CatalogInventory/Model/ResourceModel/Stock/Status.php +++ b/app/code/Magento/CatalogInventory/Model/ResourceModel/Stock/Status.php @@ -153,7 +153,7 @@ public function getProductsStockStatuses($productIds, $websiteId, $stockId = Sto $select = $this->getConnection()->select() ->from($this->getMainTable(), ['product_id', 'stock_status']) - ->where('product_id IN(?)', $productIds) + ->where('product_id IN(?)', $productIds, \Zend_Db::INT_TYPE) ->where('stock_id=?', (int) $stockId) ->where('website_id=?', (int) $websiteId); return $this->getConnection()->fetchPairs($select); @@ -190,7 +190,8 @@ public function getProductsType($productIds) ['entity_id', 'type_id'] )->where( 'entity_id IN(?)', - $productIds + $productIds, + \Zend_Db::INT_TYPE ); return $this->getConnection()->fetchPairs($select); } @@ -360,7 +361,8 @@ public function getProductStatus($productIds, $storeId = null) $attribute->getAttributeId() )->where( "t1.{$linkField} IN(?)", - $productIds + $productIds, + \Zend_Db::INT_TYPE ); $rows = $connection->fetchPairs($select); diff --git a/app/code/Magento/CatalogRule/Model/ResourceModel/Rule.php b/app/code/Magento/CatalogRule/Model/ResourceModel/Rule.php index 662cdede84ede..dd4f3306b8603 100644 --- a/app/code/Magento/CatalogRule/Model/ResourceModel/Rule.php +++ b/app/code/Magento/CatalogRule/Model/ResourceModel/Rule.php @@ -187,7 +187,7 @@ public function getRulePrices(\DateTimeInterface $date, $websiteId, $customerGro ->where('rule_date = ?', $date->format('Y-m-d')) ->where('website_id = ?', $websiteId) ->where('customer_group_id = ?', $customerGroupId) - ->where('product_id IN(?)', $productIds); + ->where('product_id IN(?)', $productIds, \Zend_Db::INT_TYPE); return $connection->fetchPairs($select); } diff --git a/app/code/Magento/ConfigurableProduct/Model/ResourceModel/Indexer/Stock/Configurable.php b/app/code/Magento/ConfigurableProduct/Model/ResourceModel/Indexer/Stock/Configurable.php index 39fcdf86fdcf4..29c4812cc7b96 100644 --- a/app/code/Magento/ConfigurableProduct/Model/ResourceModel/Indexer/Stock/Configurable.php +++ b/app/code/Magento/ConfigurableProduct/Model/ResourceModel/Indexer/Stock/Configurable.php @@ -101,7 +101,7 @@ protected function _getStockStatusSelect($entityIds = null, $usePrimaryTable = f $select->columns(['status' => $stockStatusExpr]); if ($entityIds !== null) { - $select->where('e.entity_id IN(?)', $entityIds); + $select->where('e.entity_id IN(?)', $entityIds, \Zend_Db::INT_TYPE); } return $select; diff --git a/app/code/Magento/ConfigurableProduct/Model/ResourceModel/Product/Type/Configurable.php b/app/code/Magento/ConfigurableProduct/Model/ResourceModel/Product/Type/Configurable.php index 9d779d9704c29..0dd38062e5a65 100644 --- a/app/code/Magento/ConfigurableProduct/Model/ResourceModel/Product/Type/Configurable.php +++ b/app/code/Magento/ConfigurableProduct/Model/ResourceModel/Product/Type/Configurable.php @@ -203,7 +203,7 @@ public function getParentIdsByChild($childId) ['e' => $this->getTable('catalog_product_entity')], 'e.' . $this->optionProvider->getProductEntityLinkField() . ' = l.parent_id', ['e.entity_id'] - )->where('l.product_id IN(?)', $childId); + )->where('l.product_id IN(?)', $childId, \Zend_Db::INT_TYPE); $parentIds = $this->getConnection()->fetchCol($select); return $parentIds; diff --git a/app/code/Magento/GroupedProduct/Model/ResourceModel/Indexer/Stock/Grouped.php b/app/code/Magento/GroupedProduct/Model/ResourceModel/Indexer/Stock/Grouped.php index 9d29b02f68bf1..b2a8a361564e0 100644 --- a/app/code/Magento/GroupedProduct/Model/ResourceModel/Indexer/Stock/Grouped.php +++ b/app/code/Magento/GroupedProduct/Model/ResourceModel/Indexer/Stock/Grouped.php @@ -94,7 +94,7 @@ protected function _getStockStatusSelect($entityIds = null, $usePrimaryTable = f $select->columns(['status' => $stockStatusExpr]); if ($entityIds !== null) { - $select->where('e.entity_id IN(?)', $entityIds); + $select->where('e.entity_id IN(?)', $entityIds, \Zend_Db::INT_TYPE); } return $select; diff --git a/app/code/Magento/GroupedProduct/Model/ResourceModel/Product/Indexer/Price/Grouped.php b/app/code/Magento/GroupedProduct/Model/ResourceModel/Product/Indexer/Price/Grouped.php index c5f0316feb126..4c24cdb752d3c 100644 --- a/app/code/Magento/GroupedProduct/Model/ResourceModel/Product/Indexer/Price/Grouped.php +++ b/app/code/Magento/GroupedProduct/Model/ResourceModel/Product/Indexer/Price/Grouped.php @@ -166,7 +166,7 @@ private function prepareGroupedProductPriceDataSelect(array $dimensions, array $ ); if ($entityIds !== null) { - $select->where('e.entity_id IN(?)', $entityIds); + $select->where('e.entity_id IN(?)', $entityIds, \Zend_Db::INT_TYPE); } return $select; diff --git a/app/code/Magento/ProductVideo/Model/ResourceModel/Video.php b/app/code/Magento/ProductVideo/Model/ResourceModel/Video.php index 68b593f335797..42fdf8265ee83 100644 --- a/app/code/Magento/ProductVideo/Model/ResourceModel/Video.php +++ b/app/code/Magento/ProductVideo/Model/ResourceModel/Video.php @@ -39,7 +39,8 @@ public function loadByIds(array $ids) $this->getMainTable() )->where( 'value_id IN(?)', - $ids + $ids, + \Zend_Db::INT_TYPE ); return $this->getConnection()->fetchAll($select); diff --git a/app/code/Magento/Reports/Model/ResourceModel/Customer/Collection.php b/app/code/Magento/Reports/Model/ResourceModel/Customer/Collection.php index b6e55af96f4c1..a346ad4ede29b 100644 --- a/app/code/Magento/Reports/Model/ResourceModel/Customer/Collection.php +++ b/app/code/Magento/Reports/Model/ResourceModel/Customer/Collection.php @@ -213,7 +213,8 @@ protected function _addOrdersStatistics() \Magento\Sales\Model\Order::STATE_CANCELED )->where( 'orders.customer_id IN(?)', - $customerIds + $customerIds, + \Zend_Db::INT_TYPE )->group( 'orders.customer_id' ); From 3b0e854a0e9a7dd18c135259d14bfd50a5e7dd5f Mon Sep 17 00:00:00 2001 From: "vadim.malesh" <engcom-vendorworker-charlie@adobe.com> Date: Fri, 27 Nov 2020 13:33:34 +0200 Subject: [PATCH 074/171] fix action group, revert i18n changes --- .../AdminGoToCreditmemoViewActionGroup.xml | 2 +- ...tmemoViewPageWithWrongCreditmemoIdTest.xml | 6 +- app/code/Magento/Sales/i18n/en_US.csv | 1280 ++++++++--------- 3 files changed, 642 insertions(+), 646 deletions(-) diff --git a/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminGoToCreditmemoViewActionGroup.xml b/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminGoToCreditmemoViewActionGroup.xml index d417a6c5ed314..08d02fe2b7bb1 100644 --- a/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminGoToCreditmemoViewActionGroup.xml +++ b/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminGoToCreditmemoViewActionGroup.xml @@ -16,7 +16,7 @@ <argument name="identifier" type="string"/> </arguments> - <amOnPage url="{{AdminCreditMemoViewPage.url}}/{{identifier}}" stepKey="amOnCreditmemoViewPage"/> + <amOnPage url="{{AdminCreditMemoViewPage.url}}{{identifier}}" stepKey="amOnCreditmemoViewPage"/> <waitForPageLoad stepKey="waitForPageLoad"/> </actionGroup> </actionGroups> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminOpenCreditmemoViewPageWithWrongCreditmemoIdTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminOpenCreditmemoViewPageWithWrongCreditmemoIdTest.xml index cf7f61aa12a20..4436aab59874a 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminOpenCreditmemoViewPageWithWrongCreditmemoIdTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminOpenCreditmemoViewPageWithWrongCreditmemoIdTest.xml @@ -16,11 +16,9 @@ <severity value="MAJOR"/> <group value="sales"/> </annotations> - <before> <actionGroup ref="AdminLoginActionGroup" stepKey="LoginAsAdmin"/> </before> - <after> <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> </after> @@ -30,9 +28,7 @@ </actionGroup> <waitForPageLoad stepKey="waitForPageLoad"/> - <seeInCurrentUrl url="{{AdminCreditMemosGridPage.url}}" stepKey="redirectToCreditMemosGridPage"/> - - <actionGroup ref="AssertAdminPageIs404ActionGroup" stepKey="see404PageOnAdmin"/> + <see selector="{{AdminMessagesSection.error}}" userInput='This creditmemo no longer exists.' stepKey="seeErrorMessage"/> </test> </tests> diff --git a/app/code/Magento/Sales/i18n/en_US.csv b/app/code/Magento/Sales/i18n/en_US.csv index c429a10411af4..03589afb1cd19 100644 --- a/app/code/Magento/Sales/i18n/en_US.csv +++ b/app/code/Magento/Sales/i18n/en_US.csv @@ -1,344 +1,344 @@ -Credit Memos,Credit Memos +"Credit Memos","Credit Memos" Orders,Orders Invoices,Invoices -We can't get the order instance right now.,We can't get the order instance right now. -Create New Order,Create New Order -Save Order Address,Save Order Address +"We can't get the order instance right now.","We can't get the order instance right now." +"Create New Order","Create New Order" +"Save Order Address","Save Order Address" Shipping,Shipping Billing,Billing -Edit Order %1 %2 Address,Edit Order %1 %2 Address -Order Address Information,Order Address Information -Please correct the parent block for this block.,Please correct the parent block for this block. -Submit Comment,Submit Comment -Submit Order,Submit Order -Are you sure you want to cancel this order?,Are you sure you want to cancel this order? +"Edit Order %1 %2 Address","Edit Order %1 %2 Address" +"Order Address Information","Order Address Information" +"Please correct the parent block for this block.","Please correct the parent block for this block." +"Submit Comment","Submit Comment" +"Submit Order","Submit Order" +"Are you sure you want to cancel this order?","Are you sure you want to cancel this order?" Cancel,Cancel -Billing Address,Billing Address -Payment Method,Payment Method -Order Comment,Order Comment +"Billing Address","Billing Address" +"Payment Method","Payment Method" +"Order Comment","Order Comment" Coupons,Coupons -Please select a customer,Please select a customer -Create New Customer,Create New Customer -Account Information,Account Information +"Please select a customer","Please select a customer" +"Create New Customer","Create New Customer" +"Account Information","Account Information" From,From To,To Message,Message -Edit Order #%1,Edit Order #%1 -Create New Order for %1 in %2,Create New Order for %1 in %2 -Create New Order in %1,Create New Order in %1 -Create New Order for %1,Create New Order for %1 -Create New Order for New Customer,Create New Order for New Customer -Items Ordered,Items Ordered -This product is disabled.,This product is disabled. -Buy %1 for price %2,Buy %1 for price %2 -Item ordered qty,Item ordered qty -%1 with %2 discount each,%1 with %2 discount each -%1 for %2,%1 for %2 -* - Enter custom price including tax,* - Enter custom price including tax -* - Enter custom price excluding tax,* - Enter custom price excluding tax +"Edit Order #%1","Edit Order #%1" +"Create New Order for %1 in %2","Create New Order for %1 in %2" +"Create New Order in %1","Create New Order in %1" +"Create New Order for %1","Create New Order for %1" +"Create New Order for New Customer","Create New Order for New Customer" +"Items Ordered","Items Ordered" +"This product is disabled.","This product is disabled." +"Buy %1 for price %2","Buy %1 for price %2" +"Item ordered qty","Item ordered qty" +"%1 with %2 discount each","%1 with %2 discount each" +"%1 for %2","%1 for %2" +"* - Enter custom price including tax","* - Enter custom price including tax" +"* - Enter custom price excluding tax","* - Enter custom price excluding tax" Configure,Configure -This product does not have any configurable options,This product does not have any configurable options -Newsletter Subscription,Newsletter Subscription -Please select products,Please select products -Add Selected Product(s) to Order,Add Selected Product(s) to Order +"This product does not have any configurable options","This product does not have any configurable options" +"Newsletter Subscription","Newsletter Subscription" +"Please select products","Please select products" +"Add Selected Product(s) to Order","Add Selected Product(s) to Order" ID,ID Product,Product SKU,SKU Price,Price Select,Select Quantity,Quantity -Shipping Address,Shipping Address -Shipping Method,Shipping Method -Update Changes,Update Changes -Shopping Cart,Shopping Cart -Are you sure you want to delete all items from shopping cart?,Are you sure you want to delete all items from shopping cart? -Clear Shopping Cart,Clear Shopping Cart -Products in Comparison List,Products in Comparison List -Recently Compared Products,Recently Compared Products -Recently Viewed Products,Recently Viewed Products -Last Ordered Items,Last Ordered Items -Recently Viewed,Recently Viewed -Wish List,Wish List -Please select a store,Please select a store -Order Totals,Order Totals -Shipping Incl. Tax (%1),Shipping Incl. Tax (%1) -Shipping Excl. Tax (%1),Shipping Excl. Tax (%1) -New Credit Memo for Invoice #%1,New Credit Memo for Invoice #%1 -New Credit Memo for Order #%1,New Credit Memo for Order #%1 -Refund Shipping (Incl. Tax),Refund Shipping (Incl. Tax) -Refund Shipping (Excl. Tax),Refund Shipping (Excl. Tax) -Refund Shipping,Refund Shipping -Update Qty's,Update Qty's +"Shipping Address","Shipping Address" +"Shipping Method","Shipping Method" +"Update Changes","Update Changes" +"Shopping Cart","Shopping Cart" +"Are you sure you want to delete all items from shopping cart?","Are you sure you want to delete all items from shopping cart?" +"Clear Shopping Cart","Clear Shopping Cart" +"Products in Comparison List","Products in Comparison List" +"Recently Compared Products","Recently Compared Products" +"Recently Viewed Products","Recently Viewed Products" +"Last Ordered Items","Last Ordered Items" +"Recently Viewed","Recently Viewed" +"Wish List","Wish List" +"Please select a store","Please select a store" +"Order Totals","Order Totals" +"Shipping Incl. Tax (%1)","Shipping Incl. Tax (%1)" +"Shipping Excl. Tax (%1)","Shipping Excl. Tax (%1)" +"New Credit Memo for Invoice #%1","New Credit Memo for Invoice #%1" +"New Credit Memo for Order #%1","New Credit Memo for Order #%1" +"Refund Shipping (Incl. Tax)","Refund Shipping (Incl. Tax)" +"Refund Shipping (Excl. Tax)","Refund Shipping (Excl. Tax)" +"Refund Shipping","Refund Shipping" +"Update Qty's","Update Qty's" Refund,Refund -Refund Offline,Refund Offline -Paid Amount,Paid Amount -Refund Amount,Refund Amount -Shipping Amount,Shipping Amount -Shipping Refund,Shipping Refund -Order Grand Total,Order Grand Total -Adjustment Refund,Adjustment Refund -Adjustment Fee,Adjustment Fee -Send Email,Send Email -Are you sure you want to send a credit memo email to customer?,Are you sure you want to send a credit memo email to customer? +"Refund Offline","Refund Offline" +"Paid Amount","Paid Amount" +"Refund Amount","Refund Amount" +"Shipping Amount","Shipping Amount" +"Shipping Refund","Shipping Refund" +"Order Grand Total","Order Grand Total" +"Adjustment Refund","Adjustment Refund" +"Adjustment Fee","Adjustment Fee" +"Send Email","Send Email" +"Are you sure you want to send a credit memo email to customer?","Are you sure you want to send a credit memo email to customer?" Void,Void Print,Print -The credit memo email was sent.,The credit memo email was sent. -The credit memo email wasn't sent.,The credit memo email wasn't sent. -Credit Memo #%1 | %3 | %2 (%4),Credit Memo #%1 | %3 | %2 (%4) -Total Refund,Total Refund -New Invoice and Shipment for Order #%1,New Invoice and Shipment for Order #%1 -New Invoice for Order #%1,New Invoice for Order #%1 -Submit Invoice and Shipment,Submit Invoice and Shipment -Submit Invoice,Submit Invoice -Are you sure you want to send an invoice email to customer?,Are you sure you want to send an invoice email to customer? -Credit Memo,Credit Memo +"The credit memo email was sent.","The credit memo email was sent." +"The credit memo email wasn't sent.","The credit memo email wasn't sent." +"Credit Memo #%1 | %3 | %2 (%4)","Credit Memo #%1 | %3 | %2 (%4)" +"Total Refund","Total Refund" +"New Invoice and Shipment for Order #%1","New Invoice and Shipment for Order #%1" +"New Invoice for Order #%1","New Invoice for Order #%1" +"Submit Invoice and Shipment","Submit Invoice and Shipment" +"Submit Invoice","Submit Invoice" +"Are you sure you want to send an invoice email to customer?","Are you sure you want to send an invoice email to customer?" +"Credit Memo","Credit Memo" Capture,Capture -The invoice email was sent.,The invoice email was sent. -The invoice email wasn't sent.,The invoice email wasn't sent. -Invoice #%1 | %2 | %4 (%3),Invoice #%1 | %2 | %4 (%3) -Invalid parent block for this block,Invalid parent block for this block -Order Statuses,Order Statuses -Create New Status,Create New Status -Assign Status to State,Assign Status to State -Save Status Assignment,Save Status Assignment -Assign Order Status to State,Assign Order Status to State -Assignment Information,Assignment Information -Order Status,Order Status -Order State,Order State -Use Order Status As Default,Use Order Status As Default -Visible On Storefront,Visible On Storefront -Edit Order Status,Edit Order Status -Save Status,Save Status -New Order Status,New Order Status -Order Status Information,Order Status Information -Status Code,Status Code -Status Label,Status Label -Store View Specific Labels,Store View Specific Labels -Total Paid,Total Paid -Total Refunded,Total Refunded -Total Due,Total Due -Total Canceled,Total Canceled +"The invoice email was sent.","The invoice email was sent." +"The invoice email wasn't sent.","The invoice email wasn't sent." +"Invoice #%1 | %2 | %4 (%3)","Invoice #%1 | %2 | %4 (%3)" +"Invalid parent block for this block","Invalid parent block for this block" +"Order Statuses","Order Statuses" +"Create New Status","Create New Status" +"Assign Status to State","Assign Status to State" +"Save Status Assignment","Save Status Assignment" +"Assign Order Status to State","Assign Order Status to State" +"Assignment Information","Assignment Information" +"Order Status","Order Status" +"Order State","Order State" +"Use Order Status As Default","Use Order Status As Default" +"Visible On Storefront","Visible On Storefront" +"Edit Order Status","Edit Order Status" +"Save Status","Save Status" +"New Order Status","New Order Status" +"Order Status Information","Order Status Information" +"Status Code","Status Code" +"Status Label","Status Label" +"Store View Specific Labels","Store View Specific Labels" +"Total Paid","Total Paid" +"Total Refunded","Total Refunded" +"Total Due","Total Due" +"Total Canceled","Total Canceled" Edit,Edit -Are you sure you want to send an order email to customer?,Are you sure you want to send an order email to customer? +"Are you sure you want to send an order email to customer?","Are you sure you want to send an order email to customer?" "This will create an offline refund. To create an online refund, open an invoice and create credit memo for it. Do you want to continue?","This will create an offline refund. To create an online refund, open an invoice and create credit memo for it. Do you want to continue?" -Are you sure you want to void the payment?,Are you sure you want to void the payment? +"Are you sure you want to void the payment?","Are you sure you want to void the payment?" Hold,Hold hold,hold Unhold,Unhold unhold,unhold -Are you sure you want to accept this payment?,Are you sure you want to accept this payment? -Accept Payment,Accept Payment -Are you sure you want to deny this payment?,Are you sure you want to deny this payment? -Deny Payment,Deny Payment -Get Payment Update,Get Payment Update -Invoice and Ship,Invoice and Ship +"Are you sure you want to accept this payment?","Are you sure you want to accept this payment?" +"Accept Payment","Accept Payment" +"Are you sure you want to deny this payment?","Are you sure you want to deny this payment?" +"Deny Payment","Deny Payment" +"Get Payment Update","Get Payment Update" +"Invoice and Ship","Invoice and Ship" Invoice,Invoice Ship,Ship Reorder,Reorder -Order # %1 %2 | %3,Order # %1 %2 | %3 +"Order # %1 %2 | %3","Order # %1 %2 | %3" "This order contains (%1) items and therefore cannot be edited through the admin interface. If you wish to continue editing, the (%2) items will be removed, the order will be canceled and a new order will be placed.","This order contains (%1) items and therefore cannot be edited through the admin interface. If you wish to continue editing, the (%2) items will be removed, the order will be canceled and a new order will be placed." -Are you sure? This order will be canceled and a new one will be created instead.,Are you sure? This order will be canceled and a new one will be created instead. -Save Gift Message,Save Gift Message - [deleted], [deleted] -Order Credit Memos,Order Credit Memos -Credit memo #%1 created,Credit memo #%1 created -Credit memo #%1 comment added,Credit memo #%1 comment added -Shipment #%1 created,Shipment #%1 created -Shipment #%1 comment added,Shipment #%1 comment added -Invoice #%1 created,Invoice #%1 created -Invoice #%1 comment added,Invoice #%1 comment added -Tracking number %1 for %2 assigned,Tracking number %1 for %2 assigned -Comments History,Comments History -Order History,Order History +"Are you sure? This order will be canceled and a new one will be created instead.","Are you sure? This order will be canceled and a new one will be created instead." +"Save Gift Message","Save Gift Message" +" [deleted]"," [deleted]" +"Order Credit Memos","Order Credit Memos" +"Credit memo #%1 created","Credit memo #%1 created" +"Credit memo #%1 comment added","Credit memo #%1 comment added" +"Shipment #%1 created","Shipment #%1 created" +"Shipment #%1 comment added","Shipment #%1 comment added" +"Invoice #%1 created","Invoice #%1 created" +"Invoice #%1 comment added","Invoice #%1 comment added" +"Tracking number %1 for %2 assigned","Tracking number %1 for %2 assigned" +"Comments History","Comments History" +"Order History","Order History" Information,Information -Order Information,Order Information -Order Invoices,Order Invoices +"Order Information","Order Information" +"Order Invoices","Order Invoices" Shipments,Shipments -Order Shipments,Order Shipments +"Order Shipments","Order Shipments" Transactions,Transactions -Order View,Order View +"Order View","Order View" Any,Any Specified,Specified -Applies to Any of the Specified Order Statuses except canceled orders,Applies to Any of the Specified Order Statuses except canceled orders -Cart Price Rule,Cart Price Rule +"Applies to Any of the Specified Order Statuses except canceled orders","Applies to Any of the Specified Order Statuses except canceled orders" +"Cart Price Rule","Cart Price Rule" Yes,Yes No,No -Show Actual Values,Show Actual Values -New Order RSS,New Order RSS +"Show Actual Values","Show Actual Values" +"New Order RSS","New Order RSS" Subtotal,Subtotal -Shipping & Handling,Shipping & Handling -Discount (%1),Discount (%1) +"Shipping & Handling","Shipping & Handling" +"Discount (%1)","Discount (%1)" Discount,Discount -Grand Total,Grand Total +"Grand Total","Grand Total" Back,Back Fetch,Fetch -Transaction # %1 | %2,Transaction # %1 | %2 +"Transaction # %1 | %2","Transaction # %1 | %2" N/A,N/A Key,Key Value,Value -We found an invalid entity model.,We found an invalid entity model. -Order # %1,Order # %1 -Back to My Orders,Back to My Orders -View Another Order,View Another Order -About Your Refund,About Your Refund -My Orders,My Orders -Subscribe to Order Status,Subscribe to Order Status -About Your Invoice,About Your Invoice -Print Order # %1,Print Order # %1 -Grand Total to be Charged,Grand Total to be Charged +"We found an invalid entity model.","We found an invalid entity model." +"Order # %1","Order # %1" +"Back to My Orders","Back to My Orders" +"View Another Order","View Another Order" +"About Your Refund","About Your Refund" +"My Orders","My Orders" +"Subscribe to Order Status","Subscribe to Order Status" +"About Your Invoice","About Your Invoice" +"Print Order # %1","Print Order # %1" +"Grand Total to be Charged","Grand Total to be Charged" Unassign,Unassign -We can't add this item to your shopping cart right now.,We can't add this item to your shopping cart right now. -You sent the message.,You sent the message. +"We can't add this item to your shopping cart right now.","We can't add this item to your shopping cart right now." +"You sent the message.","You sent the message." Sales,Sales -Invoice capturing error,Invoice capturing error -This order no longer exists.,This order no longer exists. -Please enter a comment.,Please enter a comment. -We cannot add order history.,We cannot add order history. -You updated the order address.,You updated the order address. -We can't update the order address right now.,We can't update the order address right now. -You have not canceled the item.,You have not canceled the item. -You canceled the order.,You canceled the order. +"Invoice capturing error","Invoice capturing error" +"This order no longer exists.","This order no longer exists." +"Please enter a comment.","Please enter a comment." +"We cannot add order history.","We cannot add order history." +"You updated the order address.","You updated the order address." +"We can't update the order address right now.","We can't update the order address right now." +"You have not canceled the item.","You have not canceled the item." +"You canceled the order.","You canceled the order." """%1"" coupon code was not applied. Do not apply discount is selected for item(s)","""%1"" coupon code was not applied. Do not apply discount is selected for item(s)" """%1"" coupon code is not valid.","""%1"" coupon code is not valid." -The coupon code has been accepted.,The coupon code has been accepted. -Quote item id is not received.,Quote item id is not received. -Quote item is not loaded.,Quote item is not loaded. -New Order,New Order -You created the order.,You created the order. -Order saving error: %1,Order saving error: %1 -Cannot add new comment.,Cannot add new comment. -The credit memo has been canceled.,The credit memo has been canceled. -Credit memo has not been canceled.,Credit memo has not been canceled. -New Memo for #%1,New Memo for #%1 -New Memo,New Memo -The credit memo's total must be positive.,The credit memo's total must be positive. -Cannot create online refund for Refund to Store Credit.,Cannot create online refund for Refund to Store Credit. -You created the credit memo.,You created the credit memo. -We can't save the credit memo right now.,We can't save the credit memo right now. -We can't update the item's quantity right now.,We can't update the item's quantity right now. -View Memo for #%1,View Memo for #%1 -View Memo,View Memo -You voided the credit memo.,You voided the credit memo. -We can't void the credit memo.,We can't void the credit memo. -The order no longer exists.,The order no longer exists. -We can't create credit memo for the order.,We can't create credit memo for the order. -Edit Order,Edit Order -You sent the order email.,You sent the order email. -We can't send the email order right now.,We can't send the email order right now. -You have not put the order on hold.,You have not put the order on hold. -You put the order on hold.,You put the order on hold. -You canceled the invoice.,You canceled the invoice. -Invoice canceling error,Invoice canceling error -The invoice has been captured.,The invoice has been captured. -The order does not allow an invoice to be created.,The order does not allow an invoice to be created. -You can't create an invoice without products.,You can't create an invoice without products. -New Invoice,New Invoice -We can't save the invoice right now.,We can't save the invoice right now. -You created the invoice and shipment.,You created the invoice and shipment. -The invoice has been created.,The invoice has been created. -We can't send the invoice email right now.,We can't send the invoice email right now. -We can't send the shipment right now.,We can't send the shipment right now. -Cannot update item quantity.,Cannot update item quantity. -The invoice has been voided.,The invoice has been voided. -Invoice voiding error,Invoice voiding error -%1 order(s) cannot be canceled.,%1 order(s) cannot be canceled. -You cannot cancel the order(s).,You cannot cancel the order(s). -We canceled %1 order(s).,We canceled %1 order(s). -%1 order(s) were not put on hold.,%1 order(s) were not put on hold. -No order(s) were put on hold.,No order(s) were put on hold. -You have put %1 order(s) on hold.,You have put %1 order(s) on hold. -%1 order(s) were not released from on hold status.,%1 order(s) were not released from on hold status. -No order(s) were released from on hold status.,No order(s) were released from on hold status. -%1 order(s) have been released from on hold status.,%1 order(s) have been released from on hold status. -There are no printable documents related to selected orders.,There are no printable documents related to selected orders. -The payment has been accepted.,The payment has been accepted. -The payment has been denied.,The payment has been denied. -Transaction has been approved.,Transaction has been approved. -Transaction has been voided/declined.,Transaction has been voided/declined. -There is no update for the transaction.,There is no update for the transaction. -We can't update the payment right now.,We can't update the payment right now. -You assigned the order status.,You assigned the order status. -Something went wrong while assigning the order status.,Something went wrong while assigning the order status. -We can't find this order status.,We can't find this order status. -Create New Order Status,Create New Order Status -We found another order status with the same order status code.,We found another order status with the same order status code. -You saved the order status.,You saved the order status. -We can't add the order status right now.,We can't add the order status right now. -You have unassigned the order status.,You have unassigned the order status. -Something went wrong while unassigning the order.,Something went wrong while unassigning the order. -Can't unhold order.,Can't unhold order. -You released the order from holding status.,You released the order from holding status. -The order was not on hold.,The order was not on hold. -Exception occurred during order load,Exception occurred during order load -Something went wrong while saving the gift message.,Something went wrong while saving the gift message. -You saved the gift card message.,You saved the gift card message. -The payment has been voided.,The payment has been voided. -We can't void the payment right now.,We can't void the payment right now. -Please correct the transaction ID and try again.,Please correct the transaction ID and try again. -The transaction details have been updated.,The transaction details have been updated. -We can't update the transaction details.,We can't update the transaction details. -Orders and Returns,Orders and Returns -You entered incorrect data. Please try again.,You entered incorrect data. Please try again. +"The coupon code has been accepted.","The coupon code has been accepted." +"Quote item id is not received.","Quote item id is not received." +"Quote item is not loaded.","Quote item is not loaded." +"New Order","New Order" +"You created the order.","You created the order." +"Order saving error: %1","Order saving error: %1" +"Cannot add new comment.","Cannot add new comment." +"The credit memo has been canceled.","The credit memo has been canceled." +"Credit memo has not been canceled.","Credit memo has not been canceled." +"New Memo for #%1","New Memo for #%1" +"New Memo","New Memo" +"The credit memo's total must be positive.","The credit memo's total must be positive." +"Cannot create online refund for Refund to Store Credit.","Cannot create online refund for Refund to Store Credit." +"You created the credit memo.","You created the credit memo." +"We can't save the credit memo right now.","We can't save the credit memo right now." +"We can't update the item's quantity right now.","We can't update the item's quantity right now." +"View Memo for #%1","View Memo for #%1" +"View Memo","View Memo" +"You voided the credit memo.","You voided the credit memo." +"We can't void the credit memo.","We can't void the credit memo." +"The order no longer exists.","The order no longer exists." +"We can't create credit memo for the order.","We can't create credit memo for the order." +"Edit Order","Edit Order" +"You sent the order email.","You sent the order email." +"We can't send the email order right now.","We can't send the email order right now." +"You have not put the order on hold.","You have not put the order on hold." +"You put the order on hold.","You put the order on hold." +"You canceled the invoice.","You canceled the invoice." +"Invoice canceling error","Invoice canceling error" +"The invoice has been captured.","The invoice has been captured." +"The order does not allow an invoice to be created.","The order does not allow an invoice to be created." +"You can't create an invoice without products.","You can't create an invoice without products." +"New Invoice","New Invoice" +"We can't save the invoice right now.","We can't save the invoice right now." +"You created the invoice and shipment.","You created the invoice and shipment." +"The invoice has been created.","The invoice has been created." +"We can't send the invoice email right now.","We can't send the invoice email right now." +"We can't send the shipment right now.","We can't send the shipment right now." +"Cannot update item quantity.","Cannot update item quantity." +"The invoice has been voided.","The invoice has been voided." +"Invoice voiding error","Invoice voiding error" +"%1 order(s) cannot be canceled.","%1 order(s) cannot be canceled." +"You cannot cancel the order(s).","You cannot cancel the order(s)." +"We canceled %1 order(s).","We canceled %1 order(s)." +"%1 order(s) were not put on hold.","%1 order(s) were not put on hold." +"No order(s) were put on hold.","No order(s) were put on hold." +"You have put %1 order(s) on hold.","You have put %1 order(s) on hold." +"%1 order(s) were not released from on hold status.","%1 order(s) were not released from on hold status." +"No order(s) were released from on hold status.","No order(s) were released from on hold status." +"%1 order(s) have been released from on hold status.","%1 order(s) have been released from on hold status." +"There are no printable documents related to selected orders.","There are no printable documents related to selected orders." +"The payment has been accepted.","The payment has been accepted." +"The payment has been denied.","The payment has been denied." +"Transaction has been approved.","Transaction has been approved." +"Transaction has been voided/declined.","Transaction has been voided/declined." +"There is no update for the transaction.","There is no update for the transaction." +"We can't update the payment right now.","We can't update the payment right now." +"You assigned the order status.","You assigned the order status." +"Something went wrong while assigning the order status.","Something went wrong while assigning the order status." +"We can't find this order status.","We can't find this order status." +"Create New Order Status","Create New Order Status" +"We found another order status with the same order status code.","We found another order status with the same order status code." +"You saved the order status.","You saved the order status." +"We can't add the order status right now.","We can't add the order status right now." +"You have unassigned the order status.","You have unassigned the order status." +"Something went wrong while unassigning the order.","Something went wrong while unassigning the order." +"Can't unhold order.","Can't unhold order." +"You released the order from holding status.","You released the order from holding status." +"The order was not on hold.","The order was not on hold." +"Exception occurred during order load","Exception occurred during order load" +"Something went wrong while saving the gift message.","Something went wrong while saving the gift message." +"You saved the gift card message.","You saved the gift card message." +"The payment has been voided.","The payment has been voided." +"We can't void the payment right now.","We can't void the payment right now." +"Please correct the transaction ID and try again.","Please correct the transaction ID and try again." +"The transaction details have been updated.","The transaction details have been updated." +"We can't update the transaction details.","We can't update the transaction details." +"Orders and Returns","Orders and Returns" +"You entered incorrect data. Please try again.","You entered incorrect data. Please try again." Home,Home -Go to Home Page,Go to Home Page -We can't find this wish list.,We can't find this wish list. +"Go to Home Page","Go to Home Page" +"We can't find this wish list.","We can't find this wish list." "We could not add a product to cart by the ID ""%1"".","We could not add a product to cart by the ID ""%1""." -There is an error in one of the option rows.,There is an error in one of the option rows. +"There is an error in one of the option rows.","There is an error in one of the option rows." "Shipping Address: ","Shipping Address: " "Billing Address: ","Billing Address: " -Please specify order items.,Please specify order items. -Please specify a shipping method.,Please specify a shipping method. -Please specify a payment method.,Please specify a payment method. -This payment method is not available.,This payment method is not available. -Validation is failed.,Validation is failed. -You did not email your customer. Please check your email settings.,You did not email your customer. Please check your email settings. --- Please Select --,-- Please Select -- +"Please specify order items.","Please specify order items." +"Please specify a shipping method.","Please specify a shipping method." +"Please specify a payment method.","Please specify a payment method." +"This payment method is not available.","This payment method is not available." +"Validation is failed.","Validation is failed." +"You did not email your customer. Please check your email settings.","You did not email your customer. Please check your email settings." +"-- Please Select --","-- Please Select --" "Path ""%1"" is not part of allowed directory ""%2""","Path ""%1"" is not part of allowed directory ""%2""" -Identifying Fields required,Identifying Fields required -Id required,Id required +"Identifying Fields required","Identifying Fields required" +"Id required","Id required" """Invoice Document Validation Error(s):\n"" .","""Invoice Document Validation Error(s):\n"" ." "Could not save an invoice, see error log for details","Could not save an invoice, see error log for details" -A hold action is not available.,A hold action is not available. -You cannot remove the hold.,You cannot remove the hold. -We cannot cancel this order.,We cannot cancel this order. +"A hold action is not available.","A hold action is not available." +"You cannot remove the hold.","You cannot remove the hold." +"We cannot cancel this order.","We cannot cancel this order." Guest,Guest -Please enter the first name.,Please enter the first name. -Please enter the last name.,Please enter the last name. -Please enter the street.,Please enter the street. -Please enter the city.,Please enter the city. -Please enter the phone number.,Please enter the phone number. -Please enter the company.,Please enter the company. -Please enter the fax number.,Please enter the fax number. -Please enter the zip/postal code.,Please enter the zip/postal code. -Please enter the country.,Please enter the country. -Please enter the state/province.,Please enter the state/province. -Requested entity doesn't exist,Requested entity doesn't exist -Could not delete order address,Could not delete order address -Could not save order address,Could not save order address +"Please enter the first name.","Please enter the first name." +"Please enter the last name.","Please enter the last name." +"Please enter the street.","Please enter the street." +"Please enter the city.","Please enter the city." +"Please enter the phone number.","Please enter the phone number." +"Please enter the company.","Please enter the company." +"Please enter the fax number.","Please enter the fax number." +"Please enter the zip/postal code.","Please enter the zip/postal code." +"Please enter the country.","Please enter the country." +"Please enter the state/province.","Please enter the state/province." +"Requested entity doesn't exist","Requested entity doesn't exist" +"Could not delete order address","Could not delete order address" +"Could not save order address","Could not save order address" Pending,Pending Refunded,Refunded Canceled,Canceled -Unknown State,Unknown State +"Unknown State","Unknown State" "We found an invalid quantity to refund item ""%1"".","We found an invalid quantity to refund item ""%1""." -The creditmemo contains product item that is not part of the original order.,The creditmemo contains product item that is not part of the original order. -The quantity to refund must not be greater than the unrefunded quantity.,The quantity to refund must not be greater than the unrefunded quantity. -Maximum shipping amount allowed to refund is: %1,Maximum shipping amount allowed to refund is: %1 -Order Id is required for creditmemo document,Order Id is required for creditmemo document +"The creditmemo contains product item that is not part of the original order.","The creditmemo contains product item that is not part of the original order." +"The quantity to refund must not be greater than the unrefunded quantity.","The quantity to refund must not be greater than the unrefunded quantity." +"Maximum shipping amount allowed to refund is: %1","Maximum shipping amount allowed to refund is: %1" +"Order Id is required for creditmemo document","Order Id is required for creditmemo document" "The creditmemo contains product SKU ""%1"" that is not part of the original order.","The creditmemo contains product SKU ""%1"" that is not part of the original order." "The quantity to creditmemo must not be greater than the unrefunded quantity for product SKU ""%1"".","The quantity to creditmemo must not be greater than the unrefunded quantity for product SKU ""%1""." -You can't create a creditmemo without products.,You can't create a creditmemo without products. -The most money available to refund is %1.,The most money available to refund is %1. -Could not delete credit memo,Could not delete credit memo -Could not save credit memo,Could not save credit memo -This order already has associated customer account,This order already has associated customer account +"You can't create a creditmemo without products.","You can't create a creditmemo without products." +"The most money available to refund is %1.","The most money available to refund is %1." +"Could not delete credit memo","Could not delete credit memo" +"Could not save credit memo","Could not save credit memo" +"This order already has associated customer account","This order already has associated customer account" Paid,Paid -We cannot register an existing invoice,We cannot register an existing invoice -We can't create creditmemo for the invoice.,We can't create creditmemo for the invoice. -Order Id is required for invoice document,Order Id is required for invoice document +"We cannot register an existing invoice","We cannot register an existing invoice" +"We can't create creditmemo for the invoice.","We can't create creditmemo for the invoice." +"Order Id is required for invoice document","Order Id is required for invoice document" "The quantity to invoice must not be greater than the uninvoiced quantity for product SKU ""%1"".","The quantity to invoice must not be greater than the uninvoiced quantity for product SKU ""%1""." -The invoice contains one or more items that are not part of the original order.,The invoice contains one or more items that are not part of the original order. -ID required,ID required -Unknown Status,Unknown Status +"The invoice contains one or more items that are not part of the original order.","The invoice contains one or more items that are not part of the original order." +"ID required","ID required" +"Unknown Status","Unknown Status" Ordered,Ordered Shipped,Shipped Invoiced,Invoiced @@ -346,462 +346,462 @@ Backordered,Backordered Returned,Returned Partial,Partial Mixed,Mixed -Registered a Void notification.,Registered a Void notification. +"Registered a Void notification.","Registered a Void notification." "If the invoice was created offline, try creating an offline credit memo.","If the invoice was created offline, try creating an offline credit memo." -We refunded %1 online.,We refunded %1 online. -We refunded %1 offline.,We refunded %1 offline. +"We refunded %1 online.","We refunded %1 online." +"We refunded %1 offline.","We refunded %1 offline." "IPN ""Refunded"". Refund issued by merchant. Registered notification about refunded amount of %1. Transaction ID: ""%2"". Credit Memo has not been created. Please create offline Credit Memo.","IPN ""Refunded"". Refund issued by merchant. Registered notification about refunded amount of %1. Transaction ID: ""%2"". Credit Memo has not been created. Please create offline Credit Memo." -The credit memo has been created automatically.,The credit memo has been created automatically. -Registered notification about refunded amount of %1.,Registered notification about refunded amount of %1. -Canceled order online,Canceled order online -Canceled order offline,Canceled order offline -Approved the payment online.,Approved the payment online. -There is no need to approve this payment.,There is no need to approve this payment. -Denied the payment online,Denied the payment online -Registered update about approved payment.,Registered update about approved payment. -Registered update about denied payment.,Registered update about denied payment. -There is no update for the payment.,There is no update for the payment. -Voided authorization.,Voided authorization. -Amount: %1.,Amount: %1. +"The credit memo has been created automatically.","The credit memo has been created automatically." +"Registered notification about refunded amount of %1.","Registered notification about refunded amount of %1." +"Canceled order online","Canceled order online" +"Canceled order offline","Canceled order offline" +"Approved the payment online.","Approved the payment online." +"There is no need to approve this payment.","There is no need to approve this payment." +"Denied the payment online","Denied the payment online" +"Registered update about approved payment.","Registered update about approved payment." +"Registered update about denied payment.","Registered update about denied payment." +"There is no update for the payment.","There is no update for the payment." +"Voided authorization.","Voided authorization." +"Amount: %1.","Amount: %1." "Transaction ID: ""%1""","Transaction ID: ""%1""" -The payment method you requested is not available.,The payment method you requested is not available. -The payment disallows storing objects.,The payment disallows storing objects. +"The payment method you requested is not available.","The payment method you requested is not available." +"The payment disallows storing objects.","The payment disallows storing objects." "The transaction ""%1"" cannot be captured yet.","The transaction ""%1"" cannot be captured yet." -The order amount of %1 is pending approval on the payment gateway.,The order amount of %1 is pending approval on the payment gateway. -Ordered amount of %1,Ordered amount of %1 -An amount of %1 will be captured after being approved at the payment gateway.,An amount of %1 will be captured after being approved at the payment gateway. -Registered notification about captured amount of %1.,Registered notification about captured amount of %1. -Order is suspended as its capture amount %1 is suspected to be fraudulent.,Order is suspended as its capture amount %1 is suspected to be fraudulent. -The parent transaction ID must have a transaction ID.,The parent transaction ID must have a transaction ID. -Payment transactions disallow storing objects.,Payment transactions disallow storing objects. +"The order amount of %1 is pending approval on the payment gateway.","The order amount of %1 is pending approval on the payment gateway." +"Ordered amount of %1","Ordered amount of %1" +"An amount of %1 will be captured after being approved at the payment gateway.","An amount of %1 will be captured after being approved at the payment gateway." +"Registered notification about captured amount of %1.","Registered notification about captured amount of %1." +"Order is suspended as its capture amount %1 is suspected to be fraudulent.","Order is suspended as its capture amount %1 is suspected to be fraudulent." +"The parent transaction ID must have a transaction ID.","The parent transaction ID must have a transaction ID." +"Payment transactions disallow storing objects.","Payment transactions disallow storing objects." "The transaction ""%1"" (%2) is already closed.","The transaction ""%1"" (%2) is already closed." -Set order for existing transactions not allowed,Set order for existing transactions not allowed +"Set order for existing transactions not allowed","Set order for existing transactions not allowed" "At minimum, you need to set a payment ID.","At minimum, you need to set a payment ID." Order,Order Authorization,Authorization "We found an unsupported transaction type ""%1"".","We found an unsupported transaction type ""%1""." -Please set a proper payment and order id.,Please set a proper payment and order id. -Please enter a Transaction ID.,Please enter a Transaction ID. -You can't do this without a transaction object.,You can't do this without a transaction object. +"Please set a proper payment and order id.","Please set a proper payment and order id." +"Please enter a Transaction ID.","Please enter a Transaction ID." +"You can't do this without a transaction object.","You can't do this without a transaction object." "Order # ","Order # " "Order Date: ","Order Date: " -Sold to:,Sold to: -Ship to:,Ship to: -Payment Method:,Payment Method: -Shipping Method:,Shipping Method: -Total Shipping Charges,Total Shipping Charges +"Sold to:","Sold to:" +"Ship to:","Ship to:" +"Payment Method:","Payment Method:" +"Shipping Method:","Shipping Method:" +"Total Shipping Charges","Total Shipping Charges" Title,Title Number,Number -We found an invalid renderer model.,We found an invalid renderer model. -Please define the PDF object before using.,Please define the PDF object before using. +"We found an invalid renderer model.","We found an invalid renderer model." +"Please define the PDF object before using.","Please define the PDF object before using." "We don't recognize the draw line data. Please define the ""lines"" array.","We don't recognize the draw line data. Please define the ""lines"" array." Products,Products -Total (ex),Total (ex) +"Total (ex)","Total (ex)" Qty,Qty Tax,Tax -Total (inc),Total (inc) +"Total (inc)","Total (inc)" "Credit Memo # ","Credit Memo # " "Invoice # ","Invoice # " -The order object is not specified.,The order object is not specified. -The source object is not specified.,The source object is not specified. -An item object is not specified.,An item object is not specified. -A PDF object is not specified.,A PDF object is not specified. -A PDF page object is not specified.,A PDF page object is not specified. -Excl. Tax,Excl. Tax -Incl. Tax,Incl. Tax +"The order object is not specified.","The order object is not specified." +"The source object is not specified.","The source object is not specified." +"An item object is not specified.","An item object is not specified." +"A PDF object is not specified.","A PDF object is not specified." +"A PDF page object is not specified.","A PDF page object is not specified." +"Excl. Tax","Excl. Tax" +"Incl. Tax","Incl. Tax" "Packing Slip # ","Packing Slip # " title,title -The PDF total model %1 must be or extend \Magento\Sales\Model\Order\Pdf\Total\DefaultTotal.,The PDF total model %1 must be or extend \Magento\Sales\Model\Order\Pdf\Total\DefaultTotal. -We cannot register an existing shipment,We cannot register an existing shipment -Parent shipment cannot be loaded for track object.,Parent shipment cannot be loaded for track object. -Order Id is required for shipment document,Order Id is required for shipment document -You can't create a shipment without products.,You can't create a shipment without products. +"The PDF total model %1 must be or extend \Magento\Sales\Model\Order\Pdf\Total\DefaultTotal.","The PDF total model %1 must be or extend \Magento\Sales\Model\Order\Pdf\Total\DefaultTotal." +"We cannot register an existing shipment","We cannot register an existing shipment" +"Parent shipment cannot be loaded for track object.","Parent shipment cannot be loaded for track object." +"Order Id is required for shipment document","Order Id is required for shipment document" +"You can't create a shipment without products.","You can't create a shipment without products." "The shipment contains product SKU ""%1"" that is not part of the original order.","The shipment contains product SKU ""%1"" that is not part of the original order." "The quantity to ship must not be greater than the unshipped quantity for product SKU ""%1"".","The quantity to ship must not be greater than the unshipped quantity for product SKU ""%1""." -Please enter a tracking number.,Please enter a tracking number. -Could not delete shipment,Could not delete shipment -Could not save shipment,Could not save shipment -The last status can't be unassigned from its current state.,The last status can't be unassigned from its current state. +"Please enter a tracking number.","Please enter a tracking number." +"Could not delete shipment","Could not delete shipment" +"Could not save shipment","Could not save shipment" +"The last status can't be unassigned from its current state.","The last status can't be unassigned from its current state." "Status can't be unassigned, because it is used by existing order(s).","Status can't be unassigned, because it is used by existing order(s)." -The total model should be extended from \Magento\Sales\Model\Order\Total\AbstractTotal.,The total model should be extended from \Magento\Sales\Model\Order\Total\AbstractTotal. -An invoice cannot be created when an order has a status of %1,An invoice cannot be created when an order has a status of %1 -A creditmemo can not be created when an order has a status of %1,A creditmemo can not be created when an order has a status of %1 -The order does not allow a creditmemo to be created.,The order does not allow a creditmemo to be created. -A shipment cannot be created when an order has a status of %1,A shipment cannot be created when an order has a status of %1 -The order does not allow a shipment to be created.,The order does not allow a shipment to be created. +"The total model should be extended from \Magento\Sales\Model\Order\Total\AbstractTotal.","The total model should be extended from \Magento\Sales\Model\Order\Total\AbstractTotal." +"An invoice cannot be created when an order has a status of %1","An invoice cannot be created when an order has a status of %1" +"A creditmemo can not be created when an order has a status of %1","A creditmemo can not be created when an order has a status of %1" +"The order does not allow a creditmemo to be created.","The order does not allow a creditmemo to be created." +"A shipment cannot be created when an order has a status of %1","A shipment cannot be created when an order has a status of %1" +"The order does not allow a shipment to be created.","The order does not allow a shipment to be created." """Creditmemo Document Validation Error(s):\n"" .","""Creditmemo Document Validation Error(s):\n"" ." "Could not save a Creditmemo, see error log for details","Could not save a Creditmemo, see error log for details" -We cannot determine the field name.,We cannot determine the field name. +"We cannot determine the field name.","We cannot determine the field name." City,City Company,Company Country,Country Email,Email -First Name,First Name -Last Name,Last Name +"First Name","First Name" +"Last Name","Last Name" State/Province,State/Province -Street Address,Street Address -Phone Number,Phone Number -Zip/Postal Code,Zip/Postal Code -We can't save the address:\n%1,We can't save the address:\n%1 -Cannot save comment:\n%1,Cannot save comment:\n%1 -We don't have enough information to save the parent transaction ID.,We don't have enough information to save the parent transaction ID. -We cannot create an empty shipment.,We cannot create an empty shipment. -Cannot save track:\n%1,Cannot save track:\n%1 -Cannot unassign status from state,Cannot unassign status from state -New Orders,New Orders -Order #%1 created at %2,Order #%1 created at %2 -Details for %1 #%2,Details for %1 #%2 -Notified Date: %1,Notified Date: %1 -Comment: %1<br/>,Comment: %1<br/> -Current Status: %1<br/>,Current Status: %1<br/> -Total: %1<br/>,Total: %1<br/> -Order # %1 Notification(s),Order # %1 Notification(s) -You can not cancel Credit Memo,You can not cancel Credit Memo -Could not cancel creditmemo,Could not cancel creditmemo -We cannot register an existing credit memo.,We cannot register an existing credit memo. +"Street Address","Street Address" +"Phone Number","Phone Number" +"Zip/Postal Code","Zip/Postal Code" +"We can't save the address:\n%1","We can't save the address:\n%1" +"Cannot save comment:\n%1","Cannot save comment:\n%1" +"We don't have enough information to save the parent transaction ID.","We don't have enough information to save the parent transaction ID." +"We cannot create an empty shipment.","We cannot create an empty shipment." +"Cannot save track:\n%1","Cannot save track:\n%1" +"Cannot unassign status from state","Cannot unassign status from state" +"New Orders","New Orders" +"Order #%1 created at %2","Order #%1 created at %2" +"Details for %1 #%2","Details for %1 #%2" +"Notified Date: %1","Notified Date: %1" +"Comment: %1<br/>","Comment: %1<br/>" +"Current Status: %1<br/>","Current Status: %1<br/>" +"Total: %1<br/>","Total: %1<br/>" +"Order # %1 Notification(s)","Order # %1 Notification(s)" +"You can not cancel Credit Memo","You can not cancel Credit Memo" +"Could not cancel creditmemo","Could not cancel creditmemo" +"We cannot register an existing credit memo.","We cannot register an existing credit memo." "We found an invalid quantity to invoice item ""%1"".","We found an invalid quantity to invoice item ""%1""." "The Order State ""%1"" must not be set manually.","The Order State ""%1"" must not be set manually." """Shipment Document Validation Error(s):\n"" .","""Shipment Document Validation Error(s):\n"" ." "Could not save a shipment, see error log for details","Could not save a shipment, see error log for details" -VAT Request Identifier,VAT Request Identifier -VAT Request Date,VAT Request Date -Pending Payment,Pending Payment +"VAT Request Identifier","VAT Request Identifier" +"VAT Request Date","VAT Request Date" +"Pending Payment","Pending Payment" Processing,Processing -On Hold,On Hold +"On Hold","On Hold" Complete,Complete Closed,Closed -Suspected Fraud,Suspected Fraud -Payment Review,Payment Review +"Suspected Fraud","Suspected Fraud" +"Payment Review","Payment Review" New,New -test message,test message -Email has not been sent,Email has not been sent -Authorized amount of %1.,Authorized amount of %1. -We will authorize %1 after the payment is approved at the payment gateway.,We will authorize %1 after the payment is approved at the payment gateway. -Authorized amount of %1. Order is suspended as its authorizing amount %1 is suspected to be fraudulent.,Authorized amount of %1. Order is suspended as its authorizing amount %1 is suspected to be fraudulent. -Captured amount of %1 online.,Captured amount of %1 online. -Authorized amount of %1,Authorized amount of %1 +"test message","test message" +"Email has not been sent","Email has not been sent" +"Authorized amount of %1.","Authorized amount of %1." +"We will authorize %1 after the payment is approved at the payment gateway.","We will authorize %1 after the payment is approved at the payment gateway." +"Authorized amount of %1. Order is suspended as its authorizing amount %1 is suspected to be fraudulent.","Authorized amount of %1. Order is suspended as its authorizing amount %1 is suspected to be fraudulent." +"Captured amount of %1 online.","Captured amount of %1 online." +"Authorized amount of %1","Authorized amount of %1" " Transaction ID: ""%1"""," Transaction ID: ""%1""" View,View -Group was removed,Group was removed +"Group was removed","Group was removed" "Changing address information will not recalculate shipping, tax or other order amount.","Changing address information will not recalculate shipping, tax or other order amount." -Comment Text,Comment Text -Notify Customer by Email,Notify Customer by Email -Visible on Storefront,Visible on Storefront +"Comment Text","Comment Text" +"Notify Customer by Email","Notify Customer by Email" +"Visible on Storefront","Visible on Storefront" Customer,Customer Notified,Notified -Not Notified,Not Notified -No Payment Methods,No Payment Methods -Order Comments,Order Comments -Apply Coupon Code,Apply Coupon Code +"Not Notified","Not Notified" +"No Payment Methods","No Payment Methods" +"Order Comments","Order Comments" +"Apply Coupon Code","Apply Coupon Code" Apply,Apply -Remove Coupon Code,Remove Coupon Code +"Remove Coupon Code","Remove Coupon Code" Remove,Remove -Address Information,Address Information -Payment & Shipping Information,Payment & Shipping Information -Order Total,Order Total -Order Currency:,Order Currency: -Same As Billing Address,Same As Billing Address -Select from existing customer addresses:,Select from existing customer addresses: -Add New Address,Add New Address -Save in address book,Save in address book -You don't need to select a shipping address.,You don't need to select a shipping address. -Gift Message for the Entire Order,Gift Message for the Entire Order -Leave this box blank if you don't want to leave a gift message for the entire order.,Leave this box blank if you don't want to leave a gift message for the entire order. -Row Subtotal,Row Subtotal +"Address Information","Address Information" +"Payment & Shipping Information","Payment & Shipping Information" +"Order Total","Order Total" +"Order Currency:","Order Currency:" +"Same As Billing Address","Same As Billing Address" +"Select from existing customer addresses:","Select from existing customer addresses:" +"Add New Address","Add New Address" +"Save in address book","Save in address book" +"You don't need to select a shipping address.","You don't need to select a shipping address." +"Gift Message for the Entire Order","Gift Message for the Entire Order" +"Leave this box blank if you don't want to leave a gift message for the entire order.","Leave this box blank if you don't want to leave a gift message for the entire order." +"Row Subtotal","Row Subtotal" Action,Action -No ordered items,No ordered items -Update Items and Quantities,Update Items and Quantities -Total %1 product(s),Total %1 product(s) +"No ordered items","No ordered items" +"Update Items and Quantities","Update Items and Quantities" +"Total %1 product(s)","Total %1 product(s)" Subtotal:,Subtotal: -Tier Pricing,Tier Pricing -Custom Price,Custom Price -Please select,Please select -Move to Shopping Cart,Move to Shopping Cart -Move to Wish List,Move to Wish List -Subscribe to Newsletter,Subscribe to Newsletter -Click to change shipping method,Click to change shipping method +"Tier Pricing","Tier Pricing" +"Custom Price","Custom Price" +"Please select","Please select" +"Move to Shopping Cart","Move to Shopping Cart" +"Move to Wish List","Move to Wish List" +"Subscribe to Newsletter","Subscribe to Newsletter" +"Click to change shipping method","Click to change shipping method" "Sorry, no quotes are available for this order.","Sorry, no quotes are available for this order." -Get shipping methods and rates,Get shipping methods and rates -You don't need to select a shipping method.,You don't need to select a shipping method. -Customer's Activities,Customer's Activities +"Get shipping methods and rates","Get shipping methods and rates" +"You don't need to select a shipping method.","You don't need to select a shipping method." +"Customer's Activities","Customer's Activities" Refresh,Refresh Item,Item -Add To Order,Add To Order -Configure and Add to Order,Configure and Add to Order -No items,No items -Append Comments,Append Comments -Email Order Confirmation,Email Order Confirmation -Grand Total Excl. Tax,Grand Total Excl. Tax -Grand Total Incl. Tax,Grand Total Incl. Tax -Subtotal (Excl. Tax),Subtotal (Excl. Tax) -Subtotal (Incl. Tax),Subtotal (Incl. Tax) -Payment & Shipping Method,Payment & Shipping Method -Payment Information,Payment Information -The order was placed using %1.,The order was placed using %1. -Shipping Information,Shipping Information -Items to Refund,Items to Refund -Return to Stock,Return to Stock -Qty to Refund,Qty to Refund -Tax Amount,Tax Amount -Discount Amount,Discount Amount -Row Total,Row Total -No Items To Refund,No Items To Refund -Credit Memo Comments,Credit Memo Comments -Refund Totals,Refund Totals -Email Copy of Credit Memo,Email Copy of Credit Memo -Please enter a positive number in this field.,Please enter a positive number in this field. -Items Refunded,Items Refunded -No Items,No Items -Memo Total,Memo Total -Credit Memo History,Credit Memo History -Credit Memo Totals,Credit Memo Totals -Customer Name: %1,Customer Name: %1 -Purchased From: %1,Purchased From: %1 -Gift Message,Gift Message +"Add To Order","Add To Order" +"Configure and Add to Order","Configure and Add to Order" +"No items","No items" +"Append Comments","Append Comments" +"Email Order Confirmation","Email Order Confirmation" +"Grand Total Excl. Tax","Grand Total Excl. Tax" +"Grand Total Incl. Tax","Grand Total Incl. Tax" +"Subtotal (Excl. Tax)","Subtotal (Excl. Tax)" +"Subtotal (Incl. Tax)","Subtotal (Incl. Tax)" +"Payment & Shipping Method","Payment & Shipping Method" +"Payment Information","Payment Information" +"The order was placed using %1.","The order was placed using %1." +"Shipping Information","Shipping Information" +"Items to Refund","Items to Refund" +"Return to Stock","Return to Stock" +"Qty to Refund","Qty to Refund" +"Tax Amount","Tax Amount" +"Discount Amount","Discount Amount" +"Row Total","Row Total" +"No Items To Refund","No Items To Refund" +"Credit Memo Comments","Credit Memo Comments" +"Refund Totals","Refund Totals" +"Email Copy of Credit Memo","Email Copy of Credit Memo" +"Please enter a positive number in this field.","Please enter a positive number in this field." +"Items Refunded","Items Refunded" +"No Items","No Items" +"Memo Total","Memo Total" +"Credit Memo History","Credit Memo History" +"Credit Memo Totals","Credit Memo Totals" +"Customer Name: %1","Customer Name: %1" +"Purchased From: %1","Purchased From: %1" +"Gift Message","Gift Message" From:,From: To:,To: Message:,Message: -Shipping & Handling,Shipping & Handling -Gift Options,Gift Options -Create Shipment,Create Shipment -Invoice and shipment types do not match for some items on this order. You can create a shipment only after creating the invoice.,Invoice and shipment types do not match for some items on this order. You can create a shipment only after creating the invoice. +"Shipping & Handling","Shipping & Handling" +"Gift Options","Gift Options" +"Create Shipment","Create Shipment" +"Invoice and shipment types do not match for some items on this order. You can create a shipment only after creating the invoice.","Invoice and shipment types do not match for some items on this order. You can create a shipment only after creating the invoice." %1,%1 -Qty to Invoice,Qty to Invoice -Invoice History,Invoice History -Invoice Comments,Invoice Comments -Invoice Totals,Invoice Totals +"Qty to Invoice","Qty to Invoice" +"Invoice History","Invoice History" +"Invoice Comments","Invoice Comments" +"Invoice Totals","Invoice Totals" Amount,Amount -Capture Online,Capture Online -Capture Offline,Capture Offline -Not Capture,Not Capture -The invoice will be created offline without the payment gateway.,The invoice will be created offline without the payment gateway. -Email Copy of Invoice,Email Copy of Invoice -Items Invoiced,Items Invoiced -Total Tax,Total Tax -From Name,From Name -To Name,To Name +"Capture Online","Capture Online" +"Capture Offline","Capture Offline" +"Not Capture","Not Capture" +"The invoice will be created offline without the payment gateway.","The invoice will be created offline without the payment gateway." +"Email Copy of Invoice","Email Copy of Invoice" +"Items Invoiced","Items Invoiced" +"Total Tax","Total Tax" +"From Name","From Name" +"To Name","To Name" Status,Status Comment,Comment -Notification Not Applicable,Notification Not Applicable -Order & Account Information,Order & Account Information -The order confirmation email was sent,The order confirmation email was sent -The order confirmation email is not sent,The order confirmation email is not sent -Order Date,Order Date -Order Date (%1),Order Date (%1) -Purchased From,Purchased From -Link to the New Order,Link to the New Order -Link to the Previous Order,Link to the Previous Order -Placed from IP,Placed from IP -%1 / %2 rate:,%1 / %2 rate: -Customer Name,Customer Name -Customer Group,Customer Group -Notes for this Order,Notes for this Order -Comment added,Comment added -Transaction Data,Transaction Data -Transaction ID,Transaction ID -Parent Transaction ID,Parent Transaction ID -Order ID,Order ID -Transaction Type,Transaction Type -Is Closed,Is Closed -Created At,Created At -Child Transactions,Child Transactions -Transaction Details,Transaction Details +"Notification Not Applicable","Notification Not Applicable" +"Order & Account Information","Order & Account Information" +"The order confirmation email was sent","The order confirmation email was sent" +"The order confirmation email is not sent","The order confirmation email is not sent" +"Order Date","Order Date" +"Order Date (%1)","Order Date (%1)" +"Purchased From","Purchased From" +"Link to the New Order","Link to the New Order" +"Link to the Previous Order","Link to the Previous Order" +"Placed from IP","Placed from IP" +"%1 / %2 rate:","%1 / %2 rate:" +"Customer Name","Customer Name" +"Customer Group","Customer Group" +"Notes for this Order","Notes for this Order" +"Comment added","Comment added" +"Transaction Data","Transaction Data" +"Transaction ID","Transaction ID" +"Parent Transaction ID","Parent Transaction ID" +"Order ID","Order ID" +"Transaction Type","Transaction Type" +"Is Closed","Is Closed" +"Created At","Created At" +"Child Transactions","Child Transactions" +"Transaction Details","Transaction Details" Items,Items -Gift Message for this Order,Gift Message for this Order -Shipped By,Shipped By -Tracking Number,Tracking Number -Billing Last Name,Billing Last Name -Find Order By,Find Order By -ZIP Code,ZIP Code -Billing ZIP Code,Billing ZIP Code +"Gift Message for this Order","Gift Message for this Order" +"Shipped By","Shipped By" +"Tracking Number","Tracking Number" +"Billing Last Name","Billing Last Name" +"Find Order By","Find Order By" +"ZIP Code","ZIP Code" +"Billing ZIP Code","Billing ZIP Code" Continue,Continue -Print All Refunds,Print All Refunds -Refund #,Refund # -Print Refund,Print Refund -Product Name,Product Name -Order #,Order # +"Print All Refunds","Print All Refunds" +"Refund #","Refund #" +"Print Refund","Print Refund" +"Product Name","Product Name" +"Order #","Order #" Date,Date -Ship To,Ship To +"Ship To","Ship To" Actions,Actions -View Order,View Order -You have placed no orders.,You have placed no orders. -No shipping information available,No shipping information available -Print Order,Print Order -Print All Invoices,Print All Invoices -Invoice #,Invoice # -Print Invoice,Print Invoice -Qty Invoiced,Qty Invoiced +"View Order","View Order" +"You have placed no orders.","You have placed no orders." +"No shipping information available","No shipping information available" +"Print Order","Print Order" +"Print All Invoices","Print All Invoices" +"Invoice #","Invoice #" +"Print Invoice","Print Invoice" +"Qty Invoiced","Qty Invoiced" Close,Close -About Your Order,About Your Order +"About Your Order","About Your Order" "<span class=""label"">Order Date:</span> %1","<span class=""label"">Order Date:</span> %1" -Refund #%1,Refund #%1 -Shipment #%1,Shipment #%1 -Qty Shipped,Qty Shipped -Recent Orders,Recent Orders -View All,View All -Gift Message for This Order,Gift Message for This Order -Recently Ordered,Recently Ordered -Add to Cart,Add to Cart +"Refund #%1","Refund #%1" +"Shipment #%1","Shipment #%1" +"Qty Shipped","Qty Shipped" +"Recent Orders","Recent Orders" +"View All","View All" +"Gift Message for This Order","Gift Message for This Order" +"Recently Ordered","Recently Ordered" +"Add to Cart","Add to Cart" Search,Search -Credit memo for your %store_name order,Credit memo for your %store_name order +"Credit memo for your %store_name order","Credit memo for your %store_name order" "%name,","%name," -Thank you for your order from %store_name.,Thank you for your order from %store_name. +"Thank you for your order from %store_name.","Thank you for your order from %store_name." "You can check the status of your order by <a href=""%account_url"">logging into your account</a>.","You can check the status of your order by <a href=""%account_url"">logging into your account</a>." "If you have questions about your order, you can email us at <a href=""mailto:%store_email"">%store_email</a>","If you have questions about your order, you can email us at <a href=""mailto:%store_email"">%store_email</a>" "or call us at <a href=""tel:%store_phone"">%store_phone</a>","or call us at <a href=""tel:%store_phone"">%store_phone</a>" "Our hours are <span class=""no-link"">%store_hours</span>.","Our hours are <span class=""no-link"">%store_hours</span>." -Your Credit Memo #%creditmemo_id for Order #%order_id,Your Credit Memo #%creditmemo_id for Order #%order_id -Billing Info,Billing Info -Shipping Info,Shipping Info -Update to your %store_name credit memo,Update to your %store_name credit memo -Your order #%increment_id has been updated with a status of <strong>%order_status</strong>.,Your order #%increment_id has been updated with a status of <strong>%order_status</strong>. -Invoice for your %store_name order,Invoice for your %store_name order -Your Invoice #%invoice_id for Order #%order_id,Your Invoice #%invoice_id for Order #%order_id -Update to your %store_name invoice,Update to your %store_name invoice -Your %store_name order confirmation,Your %store_name order confirmation +"Your Credit Memo #%creditmemo_id for Order #%order_id","Your Credit Memo #%creditmemo_id for Order #%order_id" +"Billing Info","Billing Info" +"Shipping Info","Shipping Info" +"Update to your %store_name credit memo","Update to your %store_name credit memo" +"Your order #%increment_id has been updated with a status of <strong>%order_status</strong>.","Your order #%increment_id has been updated with a status of <strong>%order_status</strong>." +"Invoice for your %store_name order","Invoice for your %store_name order" +"Your Invoice #%invoice_id for Order #%order_id","Your Invoice #%invoice_id for Order #%order_id" +"Update to your %store_name invoice","Update to your %store_name invoice" +"Your %store_name order confirmation","Your %store_name order confirmation" "%customer_name,","%customer_name," -Once your package ships we will send you a tracking number.,Once your package ships we will send you a tracking number. +"Once your package ships we will send you a tracking number.","Once your package ships we will send you a tracking number." "Your Order <span class=""no-link"">#%increment_id</span>","Your Order <span class=""no-link"">#%increment_id</span>" "Placed on <span class=""no-link"">%created_at</span>","Placed on <span class=""no-link"">%created_at</span>" -Once your package ships we will send an email with a link to track your order.,Once your package ships we will send an email with a link to track your order. -Update to your %store_name order,Update to your %store_name order -Your %store_name order has shipped,Your %store_name order has shipped -Your shipping confirmation is below. Thank you again for your business.,Your shipping confirmation is below. Thank you again for your business. -Your Shipment #%shipment_id for Order #%order_id,Your Shipment #%shipment_id for Order #%order_id -Update to your %store_name shipment,Update to your %store_name shipment +"Once your package ships we will send an email with a link to track your order.","Once your package ships we will send an email with a link to track your order." +"Update to your %store_name order","Update to your %store_name order" +"Your %store_name order has shipped","Your %store_name order has shipped" +"Your shipping confirmation is below. Thank you again for your business.","Your shipping confirmation is below. Thank you again for your business." +"Your Shipment #%shipment_id for Order #%order_id","Your Shipment #%shipment_id for Order #%order_id" +"Update to your %store_name shipment","Update to your %store_name shipment" "Gift Options for ","Gift Options for " -Add Products,Add Products -You have item changes,You have item changes +"Add Products","Add Products" +"You have item changes","You have item changes" Ok,Ok Operations,Operations Create,Create -Send Order Email,Send Order Email -Accept or Deny Payment,Accept or Deny Payment -Send Sales Emails,Send Sales Emails -Sales Section,Sales Section -Sales Emails Section,Sales Emails Section +"Send Order Email","Send Order Email" +"Accept or Deny Payment","Accept or Deny Payment" +"Send Sales Emails","Send Sales Emails" +"Sales Section","Sales Section" +"Sales Emails Section","Sales Emails Section" General,General -Hide Customer IP,Hide Customer IP +"Hide Customer IP","Hide Customer IP" "Choose whether a customer IP is shown in orders, invoices, shipments, and credit memos.","Choose whether a customer IP is shown in orders, invoices, shipments, and credit memos." -Checkout Totals Sort Order,Checkout Totals Sort Order -Allow Reorder,Allow Reorder -Invoice and Packing Slip Design,Invoice and Packing Slip Design -Logo for PDF Print-outs (200x50),Logo for PDF Print-outs (200x50) +"Checkout Totals Sort Order","Checkout Totals Sort Order" +"Allow Reorder","Allow Reorder" +"Invoice and Packing Slip Design","Invoice and Packing Slip Design" +"Logo for PDF Print-outs (200x50)","Logo for PDF Print-outs (200x50)" "Your default logo will be used in PDF and HTML documents.<br />(jpeg, tiff, png) If your pdf image is distorted, try to use larger file-size image.","Your default logo will be used in PDF and HTML documents.<br />(jpeg, tiff, png) If your pdf image is distorted, try to use larger file-size image." -Logo for HTML Print View,Logo for HTML Print View +"Logo for HTML Print View","Logo for HTML Print View" "Logo for HTML documents only. If empty, default will be used.<br />(jpeg, gif, png)","Logo for HTML documents only. If empty, default will be used.<br />(jpeg, gif, png)" Address,Address -Minimum Order Amount,Minimum Order Amount +"Minimum Order Amount","Minimum Order Amount" Enable,Enable -Minimum Amount,Minimum Amount -Subtotal after discount,Subtotal after discount -Include Tax to Amount,Include Tax to Amount -Description Message,Description Message -This message will be shown in the shopping cart when the subtotal (after discount) is lower than the minimum allowed amount.,This message will be shown in the shopping cart when the subtotal (after discount) is lower than the minimum allowed amount. -Error to Show in Shopping Cart,Error to Show in Shopping Cart -Validate Each Address Separately in Multi-address Checkout,Validate Each Address Separately in Multi-address Checkout -Multi-address Description Message,Multi-address Description Message -We'll use the default description above if you leave this empty.,We'll use the default description above if you leave this empty. -Multi-address Error to Show in Shopping Cart,Multi-address Error to Show in Shopping Cart -We'll use the default error above if you leave this empty.,We'll use the default error above if you leave this empty. +"Minimum Amount","Minimum Amount" +"Subtotal after discount","Subtotal after discount" +"Include Tax to Amount","Include Tax to Amount" +"Description Message","Description Message" +"This message will be shown in the shopping cart when the subtotal (after discount) is lower than the minimum allowed amount.","This message will be shown in the shopping cart when the subtotal (after discount) is lower than the minimum allowed amount." +"Error to Show in Shopping Cart","Error to Show in Shopping Cart" +"Validate Each Address Separately in Multi-address Checkout","Validate Each Address Separately in Multi-address Checkout" +"Multi-address Description Message","Multi-address Description Message" +"We'll use the default description above if you leave this empty.","We'll use the default description above if you leave this empty." +"Multi-address Error to Show in Shopping Cart","Multi-address Error to Show in Shopping Cart" +"We'll use the default error above if you leave this empty.","We'll use the default error above if you leave this empty." Dashboard,Dashboard -Use Aggregated Data,Use Aggregated Data -Orders Cron Settings,Orders Cron Settings -Pending Payment Order Lifetime (minutes),Pending Payment Order Lifetime (minutes) -Sales Emails,Sales Emails -Asynchronous sending,Asynchronous sending +"Use Aggregated Data","Use Aggregated Data" +"Orders Cron Settings","Orders Cron Settings" +"Pending Payment Order Lifetime (minutes)","Pending Payment Order Lifetime (minutes)" +"Sales Emails","Sales Emails" +"Asynchronous sending","Asynchronous sending" Enabled,Enabled -New Order Confirmation Email Sender,New Order Confirmation Email Sender -New Order Confirmation Template,New Order Confirmation Template +"New Order Confirmation Email Sender","New Order Confirmation Email Sender" +"New Order Confirmation Template","New Order Confirmation Template" "Email template chosen based on theme fallback when ""Default"" option is selected.","Email template chosen based on theme fallback when ""Default"" option is selected." -New Order Confirmation Template for Guest,New Order Confirmation Template for Guest -Send Order Email Copy To,Send Order Email Copy To +"New Order Confirmation Template for Guest","New Order Confirmation Template for Guest" +"Send Order Email Copy To","Send Order Email Copy To" Comma-separated,Comma-separated -Send Order Email Copy Method,Send Order Email Copy Method -Order Comment Email Sender,Order Comment Email Sender -Order Comment Email Template,Order Comment Email Template -Order Comment Email Template for Guest,Order Comment Email Template for Guest -Send Order Comment Email Copy To,Send Order Comment Email Copy To -Send Order Comments Email Copy Method,Send Order Comments Email Copy Method -Invoice Email Sender,Invoice Email Sender -Invoice Email Template,Invoice Email Template -Invoice Email Template for Guest,Invoice Email Template for Guest -Send Invoice Email Copy To,Send Invoice Email Copy To -Send Invoice Email Copy Method,Send Invoice Email Copy Method -Invoice Comment Email Sender,Invoice Comment Email Sender -Invoice Comment Email Template,Invoice Comment Email Template -Invoice Comment Email Template for Guest,Invoice Comment Email Template for Guest -Send Invoice Comment Email Copy To,Send Invoice Comment Email Copy To -Send Invoice Comments Email Copy Method,Send Invoice Comments Email Copy Method +"Send Order Email Copy Method","Send Order Email Copy Method" +"Order Comment Email Sender","Order Comment Email Sender" +"Order Comment Email Template","Order Comment Email Template" +"Order Comment Email Template for Guest","Order Comment Email Template for Guest" +"Send Order Comment Email Copy To","Send Order Comment Email Copy To" +"Send Order Comments Email Copy Method","Send Order Comments Email Copy Method" +"Invoice Email Sender","Invoice Email Sender" +"Invoice Email Template","Invoice Email Template" +"Invoice Email Template for Guest","Invoice Email Template for Guest" +"Send Invoice Email Copy To","Send Invoice Email Copy To" +"Send Invoice Email Copy Method","Send Invoice Email Copy Method" +"Invoice Comment Email Sender","Invoice Comment Email Sender" +"Invoice Comment Email Template","Invoice Comment Email Template" +"Invoice Comment Email Template for Guest","Invoice Comment Email Template for Guest" +"Send Invoice Comment Email Copy To","Send Invoice Comment Email Copy To" +"Send Invoice Comments Email Copy Method","Send Invoice Comments Email Copy Method" Shipment,Shipment -Shipment Email Sender,Shipment Email Sender -Shipment Email Template,Shipment Email Template -Shipment Email Template for Guest,Shipment Email Template for Guest -Send Shipment Email Copy To,Send Shipment Email Copy To -Send Shipment Email Copy Method,Send Shipment Email Copy Method -Shipment Comments,Shipment Comments -Shipment Comment Email Sender,Shipment Comment Email Sender -Shipment Comment Email Template,Shipment Comment Email Template -Shipment Comment Email Template for Guest,Shipment Comment Email Template for Guest -Send Shipment Comment Email Copy To,Send Shipment Comment Email Copy To -Send Shipment Comments Email Copy Method,Send Shipment Comments Email Copy Method -Credit Memo Email Sender,Credit Memo Email Sender -Credit Memo Email Template,Credit Memo Email Template -Credit Memo Email Template for Guest,Credit Memo Email Template for Guest -Send Credit Memo Email Copy To,Send Credit Memo Email Copy To -Send Credit Memo Email Copy Method,Send Credit Memo Email Copy Method -Credit Memo Comment Email Sender,Credit Memo Comment Email Sender -Credit Memo Comment Email Template,Credit Memo Comment Email Template -Credit Memo Comment Email Template for Guest,Credit Memo Comment Email Template for Guest -Send Credit Memo Comment Email Copy To,Send Credit Memo Comment Email Copy To -Send Credit Memo Comments Email Copy Method,Send Credit Memo Comments Email Copy Method -PDF Print-outs,PDF Print-outs -Display Order ID in Header,Display Order ID in Header -Customer Order Status Notification,Customer Order Status Notification -Asynchronous indexing,Asynchronous indexing -Orders and Returns Search Form,Orders and Returns Search Form -Anchor Custom Title,Anchor Custom Title +"Shipment Email Sender","Shipment Email Sender" +"Shipment Email Template","Shipment Email Template" +"Shipment Email Template for Guest","Shipment Email Template for Guest" +"Send Shipment Email Copy To","Send Shipment Email Copy To" +"Send Shipment Email Copy Method","Send Shipment Email Copy Method" +"Shipment Comments","Shipment Comments" +"Shipment Comment Email Sender","Shipment Comment Email Sender" +"Shipment Comment Email Template","Shipment Comment Email Template" +"Shipment Comment Email Template for Guest","Shipment Comment Email Template for Guest" +"Send Shipment Comment Email Copy To","Send Shipment Comment Email Copy To" +"Send Shipment Comments Email Copy Method","Send Shipment Comments Email Copy Method" +"Credit Memo Email Sender","Credit Memo Email Sender" +"Credit Memo Email Template","Credit Memo Email Template" +"Credit Memo Email Template for Guest","Credit Memo Email Template for Guest" +"Send Credit Memo Email Copy To","Send Credit Memo Email Copy To" +"Send Credit Memo Email Copy Method","Send Credit Memo Email Copy Method" +"Credit Memo Comment Email Sender","Credit Memo Comment Email Sender" +"Credit Memo Comment Email Template","Credit Memo Comment Email Template" +"Credit Memo Comment Email Template for Guest","Credit Memo Comment Email Template for Guest" +"Send Credit Memo Comment Email Copy To","Send Credit Memo Comment Email Copy To" +"Send Credit Memo Comments Email Copy Method","Send Credit Memo Comments Email Copy Method" +"PDF Print-outs","PDF Print-outs" +"Display Order ID in Header","Display Order ID in Header" +"Customer Order Status Notification","Customer Order Status Notification" +"Asynchronous indexing","Asynchronous indexing" +"Orders and Returns Search Form","Orders and Returns Search Form" +"Anchor Custom Title","Anchor Custom Title" Template,Template -Default Template,Default Template +"Default Template","Default Template" Name,Name Phone,Phone -ZIP/Post Code,ZIP/Post Code -Signed-up Point,Signed-up Point +"ZIP/Post Code","ZIP/Post Code" +"Signed-up Point","Signed-up Point" Website,Website -Bill-to Name,Bill-to Name +"Bill-to Name","Bill-to Name" Created,Created -Invoice Date,Invoice Date -Ship-to Name,Ship-to Name -Ship Date,Ship Date -Total Quantity,Total Quantity -Default Status,Default Status -State Code and Title,State Code and Title -Item Status,Item Status -Original Price,Original Price -Tax Percent,Tax Percent -All Store Views,All Store Views -PDF Credit Memos,PDF Credit Memos -Purchase Point,Purchase Point -Print Invoices,Print Invoices -Print Packing Slips,Print Packing Slips -Print Credit Memos,Print Credit Memos -Print All,Print All -Print Shipping Labels,Print Shipping Labels -Purchase Date,Purchase Date -Grand Total (Base),Grand Total (Base) -Grand Total (Purchased),Grand Total (Purchased) -Customer Email,Customer Email -Shipping and Handling,Shipping and Handling -PDF Invoices,PDF Invoices -PDF Shipments,PDF Shipments -PDF Creditmemos,PDF Creditmemos +"Invoice Date","Invoice Date" +"Ship-to Name","Ship-to Name" +"Ship Date","Ship Date" +"Total Quantity","Total Quantity" +"Default Status","Default Status" +"State Code and Title","State Code and Title" +"Item Status","Item Status" +"Original Price","Original Price" +"Tax Percent","Tax Percent" +"All Store Views","All Store Views" +"PDF Credit Memos","PDF Credit Memos" +"Purchase Point","Purchase Point" +"Print Invoices","Print Invoices" +"Print Packing Slips","Print Packing Slips" +"Print Credit Memos","Print Credit Memos" +"Print All","Print All" +"Print Shipping Labels","Print Shipping Labels" +"Purchase Date","Purchase Date" +"Grand Total (Base)","Grand Total (Base)" +"Grand Total (Purchased)","Grand Total (Purchased)" +"Customer Email","Customer Email" +"Shipping and Handling","Shipping and Handling" +"PDF Invoices","PDF Invoices" +"PDF Shipments","PDF Shipments" +"PDF Creditmemos","PDF Creditmemos" Refunds,Refunds -Allow Zero GrandTotal for Creditmemo,Allow Zero GrandTotal for Creditmemo -Allow Zero GrandTotal,Allow Zero GrandTotal +"Allow Zero GrandTotal for Creditmemo","Allow Zero GrandTotal for Creditmemo" +"Allow Zero GrandTotal","Allow Zero GrandTotal" Email is required field for Admin order creation,Email is required field for Admin order creation If set YES Email field will be required during Admin order creation for new Customer.,If set YES Email field will be required during Admin order creation for new Customer. -Could not save the shipment tracking,Could not save the shipment tracking -Please enter a coupon code!,Please enter a coupon code! -Reorder is not available.,Reorder is not available. -The coupon code has been removed.,The coupon code has been removed. -This creditmemo no longer exists.,This creditmemo no longer exists. +"Could not save the shipment tracking","Could not save the shipment tracking" +"Please enter a coupon code!","Please enter a coupon code!" +"Reorder is not available.","Reorder is not available." +"The coupon code has been removed.","The coupon code has been removed." +"This creditmemo no longer exists.","This creditmemo no longer exists." From 7006a96ab964cdce624ff95620fa93d83754683d Mon Sep 17 00:00:00 2001 From: "vadim.malesh" <engcom-vendorworker-charlie@adobe.com> Date: Fri, 27 Nov 2020 13:37:35 +0200 Subject: [PATCH 075/171] revert i18n shipping changes --- app/code/Magento/Shipping/i18n/en_US.csv | 262 +++++++++++------------ 1 file changed, 131 insertions(+), 131 deletions(-) diff --git a/app/code/Magento/Shipping/i18n/en_US.csv b/app/code/Magento/Shipping/i18n/en_US.csv index 831c361382490..0989f1bab4a3d 100644 --- a/app/code/Magento/Shipping/i18n/en_US.csv +++ b/app/code/Magento/Shipping/i18n/en_US.csv @@ -1,180 +1,180 @@ -New Shipment for Order #%1,New Shipment for Order #%1 -Submit Shipment,Submit Shipment -You are trying to add a quantity for some products that doesn't match the quantity that was shipped.,You are trying to add a quantity for some products that doesn't match the quantity that was shipped. -Products should be added to package(s),Products should be added to package(s) -The value that you entered is not valid.,The value that you entered is not valid. -Add Tracking Number,Add Tracking Number -Custom Value,Custom Value +"New Shipment for Order #%1","New Shipment for Order #%1" +"Submit Shipment","Submit Shipment" +"You are trying to add a quantity for some products that doesn't match the quantity that was shipped.","You are trying to add a quantity for some products that doesn't match the quantity that was shipped." +"Products should be added to package(s)","Products should be added to package(s)" +"The value that you entered is not valid.","The value that you entered is not valid." +"Add Tracking Number","Add Tracking Number" +"Custom Value","Custom Value" Add,Add -Send Tracking Information,Send Tracking Information -Are you sure you want to send a Shipment email to customer?,Are you sure you want to send a Shipment email to customer? +"Send Tracking Information","Send Tracking Information" +"Are you sure you want to send a Shipment email to customer?","Are you sure you want to send a Shipment email to customer?" Print,Print -the shipment email was sent,the shipment email was sent -the shipment email is not sent,the shipment email is not sent -Shipment #%1 | %3 (%2),Shipment #%1 | %3 (%2) -Create Shipping Label...,Create Shipping Label... -Print Shipping Label,Print Shipping Label -Show Packages,Show Packages -About Your Shipment,About Your Shipment -Order # %1,Order # %1 -Back to My Orders,Back to My Orders -View Another Order,View Another Order -Please enter a comment.,Please enter a comment. -Cannot add new comment.,Cannot add new comment. -Please specify a carrier.,Please specify a carrier. -Please enter a tracking number.,Please enter a tracking number. +"the shipment email was sent","the shipment email was sent" +"the shipment email is not sent","the shipment email is not sent" +"Shipment #%1 | %3 (%2)","Shipment #%1 | %3 (%2)" +"Create Shipping Label...","Create Shipping Label..." +"Print Shipping Label","Print Shipping Label" +"Show Packages","Show Packages" +"About Your Shipment","About Your Shipment" +"Order # %1","Order # %1" +"Back to My Orders","Back to My Orders" +"View Another Order","View Another Order" +"Please enter a comment.","Please enter a comment." +"Cannot add new comment.","Cannot add new comment." +"Please specify a carrier.","Please specify a carrier." +"Please enter a tracking number.","Please enter a tracking number." Shipments,Shipments -We can't initialize shipment for adding tracking number.,We can't initialize shipment for adding tracking number. -Cannot add tracking number.,Cannot add tracking number. -You created the shipping label.,You created the shipping label. -An error occurred while creating shipping label.,An error occurred while creating shipping label. -You sent the shipment.,You sent the shipment. -Cannot send shipment information.,Cannot send shipment information. -There are no shipping labels related to selected orders.,There are no shipping labels related to selected orders. -New Shipment,New Shipment -We don't recognize or support the file extension in this shipment: %1.,We don't recognize or support the file extension in this shipment: %1. -We can't initialize shipment for delete tracking number.,We can't initialize shipment for delete tracking number. -We can't delete tracking number.,We can't delete tracking number. -We can't load track with retrieving identifier right now.,We can't load track with retrieving identifier right now. -We can't save the shipment right now.,We can't save the shipment right now. +"We can't initialize shipment for adding tracking number.","We can't initialize shipment for adding tracking number." +"Cannot add tracking number.","Cannot add tracking number." +"You created the shipping label.","You created the shipping label." +"An error occurred while creating shipping label.","An error occurred while creating shipping label." +"You sent the shipment.","You sent the shipment." +"Cannot send shipment information.","Cannot send shipment information." +"There are no shipping labels related to selected orders.","There are no shipping labels related to selected orders." +"New Shipment","New Shipment" +"We don't recognize or support the file extension in this shipment: %1.","We don't recognize or support the file extension in this shipment: %1." +"We can't initialize shipment for delete tracking number.","We can't initialize shipment for delete tracking number." +"We can't delete tracking number.","We can't delete tracking number." +"We can't load track with retrieving identifier right now.","We can't load track with retrieving identifier right now." +"We can't save the shipment right now.","We can't save the shipment right now." """Shipment Document Validation Error(s):\n"" .","""Shipment Document Validation Error(s):\n"" ." -The shipment has been created.,The shipment has been created. -Cannot save shipment.,Cannot save shipment. -The order no longer exists.,The order no longer exists. -Cannot do shipment for the order separately from invoice.,Cannot do shipment for the order separately from invoice. -Cannot do shipment for the order.,Cannot do shipment for the order. -There are no shipping labels related to selected shipments.,There are no shipping labels related to selected shipments. -Page not found.,Page not found. -Tracking Information,Tracking Information +"The shipment has been created.","The shipment has been created." +"Cannot save shipment.","Cannot save shipment." +"The order no longer exists.","The order no longer exists." +"Cannot do shipment for the order separately from invoice.","Cannot do shipment for the order separately from invoice." +"Cannot do shipment for the order.","Cannot do shipment for the order." +"There are no shipping labels related to selected shipments.","There are no shipping labels related to selected shipments." +"Page not found.","Page not found." +"Tracking Information","Tracking Information" "Sorry, but we can't deliver to the destination country with this shipping module.","Sorry, but we can't deliver to the destination country with this shipping module." -The shipping module is not available.,The shipping module is not available. -This shipping method is not available. Please specify the zip code.,This shipping method is not available. Please specify the zip code. -No packages for request,No packages for request -Security validation of XML document has been failed.,Security validation of XML document has been failed. -All Allowed Countries,All Allowed Countries -Specific Countries,Specific Countries +"The shipping module is not available.","The shipping module is not available." +"This shipping method is not available. Please specify the zip code.","This shipping method is not available. Please specify the zip code." +"No packages for request","No packages for request" +"Security validation of XML document has been failed.","Security validation of XML document has been failed." +"All Allowed Countries","All Allowed Countries" +"Specific Countries","Specific Countries" Development,Development Live,Live -Divide to equal weight (one request),Divide to equal weight (one request) -Use origin weight (few requests),Use origin weight (few requests) +"Divide to equal weight (one request)","Divide to equal weight (one request)" +"Use origin weight (few requests)","Use origin weight (few requests)" Packages,Packages Package,Package Type,Type Length,Length -Signature Confirmation,Signature Confirmation -Customs Value,Customs Value +"Signature Confirmation","Signature Confirmation" +"Customs Value","Customs Value" Width,Width Contents,Contents -Total Weight,Total Weight +"Total Weight","Total Weight" Height,Height Size,Size Girth,Girth -Items in the Package,Items in the Package +"Items in the Package","Items in the Package" Product,Product Weight,Weight -Qty Ordered,Qty Ordered +"Qty Ordered","Qty Ordered" Qty,Qty "No detail for number ""%1""","No detail for number ""%1""" -Shipping labels is not available.,Shipping labels is not available. -Response info is not exist.,Response info is not exist. -Invalid carrier: %1,Invalid carrier: %1 -We don't have enough information to create shipping labels. Please make sure your store information and settings are complete.,We don't have enough information to create shipping labels. Please make sure your store information and settings are complete. -Per Order,Per Order -Per Package,Per Package +"Shipping labels is not available.","Shipping labels is not available." +"Response info is not exist.","Response info is not exist." +"Invalid carrier: %1","Invalid carrier: %1" +"We don't have enough information to create shipping labels. Please make sure your store information and settings are complete.","We don't have enough information to create shipping labels. Please make sure your store information and settings are complete." +"Per Order","Per Order" +"Per Package","Per Package" Fixed,Fixed Percent,Percent -Tracking information is unavailable.,Tracking information is unavailable. +"Tracking information is unavailable.","Tracking information is unavailable." message,message -Email has not been sent,Email has not been sent -Payment & Shipping Method,Payment & Shipping Method -Payment Information,Payment Information -The order was placed using %1.,The order was placed using %1. -Shipping Information,Shipping Information -Total Shipping Charges,Total Shipping Charges -Incl. Tax,Incl. Tax -Items to Ship,Items to Ship -Qty to Ship,Qty to Ship +"Email has not been sent","Email has not been sent" +"Payment & Shipping Method","Payment & Shipping Method" +"Payment Information","Payment Information" +"The order was placed using %1.","The order was placed using %1." +"Shipping Information","Shipping Information" +"Total Shipping Charges","Total Shipping Charges" +"Incl. Tax","Incl. Tax" +"Items to Ship","Items to Ship" +"Qty to Ship","Qty to Ship" Ship,Ship -Shipment Total,Shipment Total -Shipment Comments,Shipment Comments -Comment Text,Comment Text -Shipment Options,Shipment Options -Create Shipping Label,Create Shipping Label -Append Comments,Append Comments -Email Copy of Shipment,Email Copy of Shipment -Invalid value(s) for Qty to Ship,Invalid value(s) for Qty to Ship -Select All,Select All -Product Name,Product Name +"Shipment Total","Shipment Total" +"Shipment Comments","Shipment Comments" +"Comment Text","Comment Text" +"Shipment Options","Shipment Options" +"Create Shipping Label","Create Shipping Label" +"Append Comments","Append Comments" +"Email Copy of Shipment","Email Copy of Shipment" +"Invalid value(s) for Qty to Ship","Invalid value(s) for Qty to Ship" +"Select All","Select All" +"Product Name","Product Name" Delete,Delete -Create Packages,Create Packages +"Create Packages","Create Packages" Cancel,Cancel Save,Save -Add Package,Add Package -Add Selected Product(s) to Package,Add Selected Product(s) to Package -Add Products to Package,Add Products to Package -USPS domestic shipments don't use package types.,USPS domestic shipments don't use package types. +"Add Package","Add Package" +"Add Selected Product(s) to Package","Add Selected Product(s) to Package" +"Add Products to Package","Add Products to Package" +"USPS domestic shipments don't use package types.","USPS domestic shipments don't use package types." in,in cm,cm lb,lb kg,kg -Delete Package,Delete Package +"Delete Package","Delete Package" Explanation,Explanation Carrier,Carrier Title,Title Number,Number Action,Action -Are you sure?,Are you sure? -Shipping & Handling Information,Shipping & Handling Information -Track Order,Track Order -No shipping information available,No shipping information available -Shipping and Tracking Information,Shipping and Tracking Information -Track this shipment,Track this shipment -Items Shipped,Items Shipped -Order Total,Order Total -Shipment History,Shipment History -Qty Shipped,Qty Shipped -Print All Shipments,Print All Shipments -Shipment #,Shipment # -Print Shipment,Print Shipment -Tracking Number(s):,Tracking Number(s): +"Are you sure?","Are you sure?" +"Shipping & Handling Information","Shipping & Handling Information" +"Track Order","Track Order" +"No shipping information available","No shipping information available" +"Shipping and Tracking Information","Shipping and Tracking Information" +"Track this shipment","Track this shipment" +"Items Shipped","Items Shipped" +"Order Total","Order Total" +"Shipment History","Shipment History" +"Qty Shipped","Qty Shipped" +"Print All Shipments","Print All Shipments" +"Shipment #","Shipment #" +"Print Shipment","Print Shipment" +"Tracking Number(s):","Tracking Number(s):" SKU,SKU -Order tracking,Order tracking -Tracking Number:,Tracking Number: +"Order tracking","Order tracking" +"Tracking Number:","Tracking Number:" Carrier:,Carrier: Error:,Error: -Tracking information is currently not available. Please ,Tracking information is currently not available. Please -contact us,contact us - for more information or , for more information or -email us at ,email us at +"Tracking information is currently not available. Please ","Tracking information is currently not available. Please " +"contact us","contact us" +" for more information or "," for more information or " +"email us at ","email us at " Info:,Info: Track:,Track: -. ':',. ':' -Delivered on:,Delivered on: +". ':'",". ':'" +"Delivered on:","Delivered on:" N/A,N/A -There is no tracking available for this shipment.,There is no tracking available for this shipment. -There is no tracking available.,There is no tracking available. -Close Window,Close Window -Track history,Track history +"There is no tracking available for this shipment.","There is no tracking available for this shipment." +"There is no tracking available.","There is no tracking available." +"Close Window","Close Window" +"Track history","Track history" Location,Location Date,Date -Local Time,Local Time +"Local Time","Local Time" Description,Description -See our Shipping Policy,See our Shipping Policy -Shipping Settings Section,Shipping Settings Section -Shipping Policy Parameters Section,Shipping Policy Parameters Section -Shipping Methods Section,Shipping Methods Section -Shipping Settings,Shipping Settings +"See our Shipping Policy","See our Shipping Policy" +"Shipping Settings Section","Shipping Settings Section" +"Shipping Policy Parameters Section","Shipping Policy Parameters Section" +"Shipping Methods Section","Shipping Methods Section" +"Shipping Settings","Shipping Settings" Origin,Origin Country,Country Region/State,Region/State -ZIP/Postal Code,ZIP/Postal Code +"ZIP/Postal Code","ZIP/Postal Code" City,City -Street Address,Street Address -Street Address Line 2,Street Address Line 2 -Shipping Policy Parameters,Shipping Policy Parameters -Apply custom Shipping Policy,Apply custom Shipping Policy -Shipping Policy,Shipping Policy -Shipping Methods,Shipping Methods -Track your order,Track your order -Track All Shipments,Track All Shipments -This shipment no longer exists.,This shipment no longer exists. +"Street Address","Street Address" +"Street Address Line 2","Street Address Line 2" +"Shipping Policy Parameters","Shipping Policy Parameters" +"Apply custom Shipping Policy","Apply custom Shipping Policy" +"Shipping Policy","Shipping Policy" +"Shipping Methods","Shipping Methods" +"Track your order","Track your order" +"Track All Shipments","Track All Shipments" +"This shipment no longer exists.","This shipment no longer exists." From c6aaabc206c335ca9235ff84a403f9d6ac937ebc Mon Sep 17 00:00:00 2001 From: Serhii Balko <serhii.balko@transoftgroup.com> Date: Fri, 27 Nov 2020 16:36:52 +0200 Subject: [PATCH 076/171] MC-38822: Attributes position doesn't affect the ranking in graphql response --- .../Plugin/Search/Request/ConfigReader.php | 3 + .../CategoryAggregationsTest.php | 56 ++++++ ...cts_with_layered_navigation_attributes.php | 165 ++++++++++++++++++ ...layered_navigation_attributes_rollback.php | 63 +++++++ 4 files changed, 287 insertions(+) create mode 100644 dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/CategoriesQuery/CategoryAggregationsTest.php create mode 100644 dev/tests/integration/testsuite/Magento/Catalog/_files/products_with_layered_navigation_attributes.php create mode 100644 dev/tests/integration/testsuite/Magento/Catalog/_files/products_with_layered_navigation_attributes_rollback.php diff --git a/app/code/Magento/CatalogGraphQl/Plugin/Search/Request/ConfigReader.php b/app/code/Magento/CatalogGraphQl/Plugin/Search/Request/ConfigReader.php index 992ab50467c72..b61ecfff4e3f1 100644 --- a/app/code/Magento/CatalogGraphQl/Plugin/Search/Request/ConfigReader.php +++ b/app/code/Magento/CatalogGraphQl/Plugin/Search/Request/ConfigReader.php @@ -106,6 +106,9 @@ private function getSearchableAttributes(): array $productAttributes->addFieldToFilter( ['is_searchable', 'is_visible_in_advanced_search', 'is_filterable', 'is_filterable_in_search'], [1, 1, [1, 2], 1] + )->setOrder( + 'position', + 'ASC' ); /** @var Attribute $attribute */ diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/CategoriesQuery/CategoryAggregationsTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/CategoriesQuery/CategoryAggregationsTest.php new file mode 100644 index 0000000000000..a0f184507a9aa --- /dev/null +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/CategoriesQuery/CategoryAggregationsTest.php @@ -0,0 +1,56 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\GraphQl\Catalog\CategoriesQuery; + +use Magento\TestFramework\TestCase\GraphQlAbstract; + +/** + * Test to return category aggregations + */ +class CategoryAggregationsTest extends GraphQlAbstract +{ + /** + * Test to return category aggregations in sorting by position + * + * @magentoApiDataFixture Magento/Catalog/_files/products_with_layered_navigation_attributes.php + */ + public function testCategoryAggregationSorting(): void + { + $categoryId = 3334; + $query = <<<QUERY +{ + products(filter: {category_id: {eq: "{$categoryId}"}}) { + aggregations{ + label + attribute_code + count + options{ + label + value + count + } + } + } +} +QUERY; + $response = $this->graphQlQuery($query); + $this->assertArrayNotHasKey('errors', $response); + $this->assertArrayHasKey('products', $response); + $this->assertArrayHasKey('aggregations', $response['products']); + + $customAggregation = array_values(array_filter( + $response['products']['aggregations'], + function ($a) { + return in_array($a['attribute_code'], ['test_attribute_1', 'test_attribute_2']); + } + )); + $this->assertCount(2, $customAggregation); + $this->assertEquals('test_attribute_2', $customAggregation[0]['attribute_code']); + $this->assertEquals('test_attribute_1', $customAggregation[1]['attribute_code']); + } +} diff --git a/dev/tests/integration/testsuite/Magento/Catalog/_files/products_with_layered_navigation_attributes.php b/dev/tests/integration/testsuite/Magento/Catalog/_files/products_with_layered_navigation_attributes.php new file mode 100644 index 0000000000000..8764e12916d8b --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Catalog/_files/products_with_layered_navigation_attributes.php @@ -0,0 +1,165 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +use Magento\Catalog\Api\Data\CategoryInterfaceFactory; +use Magento\Catalog\Api\Data\ProductAttributeInterfaceFactory; +use Magento\Catalog\Api\Data\ProductInterfaceFactory; +use Magento\Catalog\Api\ProductAttributeRepositoryInterface; +use Magento\Catalog\Api\ProductRepositoryInterface; +use Magento\Catalog\Model\Product; +use Magento\Catalog\Model\Product\Attribute\Source\Status; +use Magento\Catalog\Model\Product\Type; +use Magento\Catalog\Model\Product\Visibility; +use Magento\Eav\Model\Config; +use Magento\Eav\Setup\EavSetup; +use Magento\Indexer\Model\Indexer; +use Magento\Indexer\Model\Indexer\Collection; +use Magento\Msrp\Model\Product\Attribute\Source\Type as SourceType; +use Magento\Store\Api\WebsiteRepositoryInterface; +use Magento\TestFramework\Helper\Bootstrap; +use Magento\TestFramework\Helper\CacheCleaner; + +$objectManager = Bootstrap::getObjectManager(); + +/** @var Config $eavConfig */ +$eavConfig = $objectManager->get(Config::class); + +/** @var ProductAttributeRepositoryInterface $attributeRepository */ +$attributeRepository = $objectManager->get(ProductAttributeRepositoryInterface::class); +/** @var ProductAttributeInterfaceFactory $attributeFactory */ +$attributeFactory = $objectManager->get(ProductAttributeInterfaceFactory::class); + +/** @var $installer EavSetup */ +$installer = $objectManager->get(EavSetup::class); +$attributeSetId = $installer->getAttributeSetId(Product::ENTITY, 'Default'); +$groupId = $installer->getDefaultAttributeGroupId(Product::ENTITY, $attributeSetId); + +/** @var WebsiteRepositoryInterface $websiteRepository */ +$websiteRepository = $objectManager->get(WebsiteRepositoryInterface::class); +$baseWebsite = $websiteRepository->get('base'); + +for ($i = 1; $i <= 2; $i++) { + $attributeModel = $attributeFactory->create(); + $attributeModel->setData( + [ + 'attribute_code' => 'test_attribute_' . $i, + 'entity_type_id' => $installer->getEntityTypeId(Product::ENTITY), + 'is_global' => 1, + 'is_user_defined' => 1, + 'frontend_input' => 'select', + 'is_unique' => 0, + 'is_required' => 0, + 'is_searchable' => 1, + 'is_visible_in_advanced_search' => 1, + 'is_comparable' => 1, + 'is_filterable' => 1, + 'is_filterable_in_search' => 1, + 'is_used_for_promo_rules' => 0, + 'is_html_allowed_on_front' => 1, + 'is_visible_on_front' => 1, + 'used_in_product_listing' => 1, + 'used_for_sort_by' => 1, + 'frontend_label' => ['Test Attribute ' . $i], + 'backend_type' => 'int', + 'option' => [ + 'value' => ['option_0' => ['Option 1'], 'option_1' => ['Option 2']], + 'order' => ['option_0' => 1, 'option_1' => 2], + ], + 'default' => ['option_0'], + 'position' => 3 - $i + ] + ); + $attribute = $attributeRepository->save($attributeModel); + $installer->addAttributeToGroup(Product::ENTITY, $attributeSetId, $groupId, $attribute->getId()); +} + +CacheCleaner::cleanAll(); +$eavConfig->clear(); + +/** @var ProductRepositoryInterface $productRepository */ +$productRepository = $objectManager->get(ProductRepositoryInterface::class); +/** @var ProductInterfaceFactory $productInterfaceFactory */ +$productInterfaceFactory = $objectManager->get(ProductInterfaceFactory::class); + +/** @var Product $product */ +$product = $productInterfaceFactory->create(); +$product->setTypeId(Type::TYPE_SIMPLE) + ->setAttributeSetId($product->getDefaultAttributeSetId()) + ->setName('Simple Product1') + ->setSku('simple1') + ->setTaxClassId('none') + ->setDescription('description') + ->setShortDescription('short description') + ->setOptionsContainer('container1') + ->setMsrpDisplayActualPriceType(SourceType::TYPE_IN_CART) + ->setPrice(10) + ->setWeight(1) + ->setMetaTitle('meta title') + ->setMetaKeyword('meta keyword') + ->setMetaDescription('meta description') + ->setVisibility(Visibility::VISIBILITY_BOTH) + ->setStatus(Status::STATUS_ENABLED) + ->setWebsiteIds([$baseWebsite->getId()]) + ->setCategoryIds([]) + ->setStockData(['use_config_manage_stock' => 1, 'qty' => 100, 'is_qty_decimal' => 0, 'is_in_stock' => 1]) + ->setSpecialPrice('5.99'); +$simple1 = $productRepository->save($product); + +/** @var Product $product */ +$product = $productInterfaceFactory->create(); +$product->setTypeId(Type::TYPE_SIMPLE) + ->setAttributeSetId($product->getDefaultAttributeSetId()) + ->setName('Simple Product2') + ->setSku('simple2') + ->setTaxClassId('none') + ->setDescription('description') + ->setShortDescription('short description') + ->setOptionsContainer('container1') + ->setMsrpDisplayActualPriceType(SourceType::TYPE_ON_GESTURE) + ->setPrice(20) + ->setWeight(1) + ->setMetaTitle('meta title') + ->setMetaKeyword('meta keyword') + ->setMetaDescription('meta description') + ->setVisibility(Visibility::VISIBILITY_BOTH) + ->setStatus(Status::STATUS_ENABLED) + ->setWebsiteIds([$baseWebsite->getId()]) + ->setCategoryIds([]) + ->setStockData(['use_config_manage_stock' => 1, 'qty' => 50, 'is_qty_decimal' => 0, 'is_in_stock' => 1]) + ->setSpecialPrice('15.99'); +$simple2 = $productRepository->save($product); + +/** @var CategoryInterfaceFactory $categoryInterfaceFactory */ +$categoryInterfaceFactory = $objectManager->get(CategoryInterfaceFactory::class); + +$category = $categoryInterfaceFactory->create(); +$category->isObjectNew(true); +$category->setId(3334) + ->setCreatedAt('2014-06-23 09:50:07') + ->setName('Category 1') + ->setParentId(2) + ->setPath('1/2/333') + ->setLevel(2) + ->setAvailableSortBy(['position', 'name']) + ->setDefaultSortBy('name') + ->setIsActive(true) + ->setPosition(1) + ->setPostedProducts( + [ + $simple1->getId() => 10, + $simple2->getId() => 11 + ] + ); +$category->save(); + +/** @var Collection $indexerCollection */ +$indexerCollection = $objectManager->get(Collection::class); +$indexerCollection->load(); +/** @var Indexer $indexer */ +foreach ($indexerCollection->getItems() as $indexer) { + $indexer->reindexAll(); +} diff --git a/dev/tests/integration/testsuite/Magento/Catalog/_files/products_with_layered_navigation_attributes_rollback.php b/dev/tests/integration/testsuite/Magento/Catalog/_files/products_with_layered_navigation_attributes_rollback.php new file mode 100644 index 0000000000000..49e2b549552e6 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Catalog/_files/products_with_layered_navigation_attributes_rollback.php @@ -0,0 +1,63 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +use Magento\Catalog\Api\CategoryRepositoryInterface; +use Magento\Catalog\Api\ProductAttributeRepositoryInterface; +use Magento\Catalog\Api\ProductRepositoryInterface; +use Magento\Eav\Model\Config; +use Magento\Framework\Exception\NoSuchEntityException; +use Magento\Framework\Registry; +use Magento\TestFramework\Catalog\Model\GetCategoryByName; +use Magento\TestFramework\Helper\Bootstrap; + +$objectManager = Bootstrap::getObjectManager(); +/** @var Registry $registry */ +$registry = $objectManager->get(Registry::class); +$registry->unregister('isSecureArea'); +$registry->register('isSecureArea', true); + +/** @var ProductRepositoryInterface $productRepository */ +$productRepository = $objectManager->get(ProductRepositoryInterface::class); + +foreach (['simple1', 'simple2'] as $sku) { + try { + $product = $productRepository->get($sku, false, null, true); + $productRepository->delete($product); + } catch (NoSuchEntityException $exception) { + //Product already removed + } +} + +/** @var CategoryRepositoryInterface $categoryRepository */ +$categoryRepository = $objectManager->get(CategoryRepositoryInterface::class); +/** @var GetCategoryByName $getCategoryByName */ +$getCategoryByName = $objectManager->get(GetCategoryByName::class); +$category = $getCategoryByName->execute('Category 1'); +try { + if ($category->getId()) { + $categoryRepository->delete($category); + } +} catch (NoSuchEntityException $exception) { + //Category already removed +} + +$eavConfig = $objectManager->get(Config::class); +/** @var ProductAttributeRepositoryInterface $attributeRepository */ +$attributeRepository = $objectManager->get(ProductAttributeRepositoryInterface::class); + +try { + for ($i = 1; $i <= 2; $i++) { + $attribute = $attributeRepository->get('test_attribute_' . $i); + $attributeRepository->delete($attribute); + } +} catch (NoSuchEntityException $exception) { + //Attribute already removed +} +$eavConfig->clear(); + +$registry->unregister('isSecureArea'); +$registry->register('isSecureArea', false); From e567fd6c343cd383bc58b8b6b8b90b45844ded7d Mon Sep 17 00:00:00 2001 From: TuNa <ladiesman9x@gmail.com> Date: Fri, 27 Nov 2020 21:51:16 +0700 Subject: [PATCH 077/171] Fix minisearch not appear when disable suggestions search update up up up up up update update update up update update testCaseId --- .../Section/StorefrontQuickSearchSection.xml | 1 + ...ldVisibilityWhenSuggestionDisabledTest.xml | 54 +++++++++ .../Search/ViewModel/ConfigProvider.php | 21 +++- .../view/frontend/templates/form.mini.phtml | 44 +++---- .../Search/view/frontend/web/js/form-mini.js | 113 +++++++++--------- 5 files changed, 156 insertions(+), 77 deletions(-) create mode 100644 app/code/Magento/Search/Test/Mftf/Test/StorefrontVerifySearchFieldVisibilityWhenSuggestionDisabledTest.xml diff --git a/app/code/Magento/Search/Test/Mftf/Section/StorefrontQuickSearchSection.xml b/app/code/Magento/Search/Test/Mftf/Section/StorefrontQuickSearchSection.xml index 34379fd6d2e4a..088bd5eed4cc3 100644 --- a/app/code/Magento/Search/Test/Mftf/Section/StorefrontQuickSearchSection.xml +++ b/app/code/Magento/Search/Test/Mftf/Section/StorefrontQuickSearchSection.xml @@ -14,5 +14,6 @@ <element name="searchMiniForm" type="input" selector="#search_mini_form"/> <element name="searchDropDownSuggestion" type="text" selector="//div[@id='search_autocomplete']/ul/li/span"/> <element name="searchDropDownName" type="text" selector="//div[@id='search_autocomplete']//span[contains(., '{{searchQuery}}')]" parameterized="true"/> + <element name="searchMagnifierIcon" type="text" selector="//*[@id='search_mini_form']//label[@data-role='minisearch-label']"/> </section> </sections> diff --git a/app/code/Magento/Search/Test/Mftf/Test/StorefrontVerifySearchFieldVisibilityWhenSuggestionDisabledTest.xml b/app/code/Magento/Search/Test/Mftf/Test/StorefrontVerifySearchFieldVisibilityWhenSuggestionDisabledTest.xml new file mode 100644 index 0000000000000..cdd52bd2b524e --- /dev/null +++ b/app/code/Magento/Search/Test/Mftf/Test/StorefrontVerifySearchFieldVisibilityWhenSuggestionDisabledTest.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="StorefrontVerifySearchFieldVisibilityWhenSuggestionDisabledTest"> + <annotations> + <stories value="Search Term"/> + <title value="Mini search field appears if suggestions was disabled"/> + <description value="Mini search field appears if suggestions was disabled"/> + <severity value="AVERAGE"/> + <testCaseId value="MC-39443"/> + <group value="mtf_migrated"/> + </annotations> + + <before> + <!-- Login as admin --> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> + <!-- Disable search suggestion --> + <magentoCLI command="config:set catalog/search/search_suggestion_enabled 0" stepKey="disableSearchSuggestion"/> + + <actionGroup ref="CliCacheCleanActionGroup" stepKey="cleanCacheFirst"> + <argument name="tags" value="config full_page"/> + </actionGroup> + </before> + + <after> + <!-- Enable search suggestion back --> + <magentoCLI command="config:set catalog/search/search_suggestion_enabled 1" stepKey="disableSearchSuggestion"/> + + <actionGroup ref="CliCacheCleanActionGroup" stepKey="cleanCacheSecond"> + <argument name="tags" value="config full_page"/> + </actionGroup> + + <!-- Admin logout --> + <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> + </after> + + <!-- Go to storefront home page --> + <actionGroup ref="StorefrontOpenHomePageActionGroup" stepKey="openStoreFrontHomePage"/> + + <resizeWindow width="767" height="720" stepKey="resizeWindowToMobileView"/> + + <click selector="{{StorefrontQuickSearchSection.searchMagnifierIcon}}" stepKey="clickOnMagnifierSearchIcon"/> + + <waitForElementVisible selector="{{StorefrontQuickSearchSection.searchPhrase}}" after="clickOnMagnifierSearchIcon" stepKey="seeInputSearchActive"/> + + </test> +</tests> diff --git a/app/code/Magento/Search/ViewModel/ConfigProvider.php b/app/code/Magento/Search/ViewModel/ConfigProvider.php index be3366e62e965..b1db5b57e13e0 100644 --- a/app/code/Magento/Search/ViewModel/ConfigProvider.php +++ b/app/code/Magento/Search/ViewModel/ConfigProvider.php @@ -10,6 +10,7 @@ use Magento\Framework\App\Config\ScopeConfigInterface; use Magento\Framework\View\Element\Block\ArgumentInterface; use Magento\Store\Model\ScopeInterface; +use Magento\Search\Helper\Data as SearchHelper; /** * View model for search @@ -26,13 +27,31 @@ class ConfigProvider implements ArgumentInterface */ private $scopeConfig; + /** + * @var SearchHelper + */ + private $searchHelper; + /** * @param ScopeConfigInterface $scopeConfig + * @param SearchHelper $searchHelper */ public function __construct( - ScopeConfigInterface $scopeConfig + ScopeConfigInterface $scopeConfig, + SearchHelper $searchHelper ) { $this->scopeConfig = $scopeConfig; + $this->searchHelper = $searchHelper; + } + + /** + * Retrieve search helper instance for template view + * + * @return SearchHelper + */ + public function getSearchHelperData(): SearchHelper + { + return $this->searchHelper; } /** diff --git a/app/code/Magento/Search/view/frontend/templates/form.mini.phtml b/app/code/Magento/Search/view/frontend/templates/form.mini.phtml index 80e720e2c2fe2..c6b2a6a729575 100644 --- a/app/code/Magento/Search/view/frontend/templates/form.mini.phtml +++ b/app/code/Magento/Search/view/frontend/templates/form.mini.phtml @@ -4,40 +4,42 @@ * See COPYING.txt for license details. */ -// phpcs:disable Magento2.Templates.ThisInTemplate.FoundThis ?> <?php /** @var $block \Magento\Framework\View\Element\Template */ -/** @var $helper \Magento\Search\Helper\Data */ +/** @var $escaper \Magento\Framework\Escaper */ /** @var $configProvider \Magento\Search\ViewModel\ConfigProvider */ -$helper = $this->helper(\Magento\Search\Helper\Data::class); $configProvider = $block->getData('configProvider'); +/** @var $helper \Magento\Search\Helper\Data */ +$helper = $configProvider->getSearchHelperData(); +$allowedSuggestion = $configProvider->isSuggestionsAllowed(); +$quickSearchUrl = $allowedSuggestion ? $escaper->escapeUrl($helper->getSuggestUrl()) : ''; ?> <div class="block block-search"> - <div class="block block-title"><strong><?= $block->escapeHtml(__('Search')) ?></strong></div> + <div class="block block-title"><strong><?= $escaper->escapeHtml(__('Search')) ?></strong></div> <div class="block block-content"> <form class="form minisearch" id="search_mini_form" - action="<?= $block->escapeUrl($helper->getResultUrl()) ?>" method="get"> + action="<?= $escaper->escapeUrl($helper->getResultUrl()) ?>" method="get"> <div class="field search"> <label class="label" for="search" data-role="minisearch-label"> - <span><?= $block->escapeHtml(__('Search')) ?></span> + <span><?= $escaper->escapeHtml(__('Search')) ?></span> </label> <div class="control"> <input id="search" - <?php if ($configProvider->isSuggestionsAllowed()):?> - data-mage-init='{"quickSearch":{ - "formSelector":"#search_mini_form", - "url":"<?= $block->escapeUrl($helper->getSuggestUrl())?>", - "destinationSelector":"#search_autocomplete", - "minSearchLength":"<?= $block->escapeHtml($helper->getMinQueryLength()) ?>"} - }' - <?php endif;?> + data-mage-init='{ + "quickSearch": { + "formSelector": "#search_mini_form", + "url": "<?= /* @noEscape */ $quickSearchUrl ?>", + "destinationSelector": "#search_autocomplete", + "minSearchLength": "<?= $escaper->escapeHtml($helper->getMinQueryLength()) ?>" + } + }' type="text" - name="<?= $block->escapeHtmlAttr($helper->getQueryParamName()) ?>" + name="<?= $escaper->escapeHtmlAttr($helper->getQueryParamName()) ?>" value="<?= /* @noEscape */ $helper->getEscapedQueryText() ?>" - placeholder="<?= $block->escapeHtmlAttr(__('Search entire store here...')) ?>" + placeholder="<?= $escaper->escapeHtmlAttr(__('Search entire store here...')) ?>" class="input-text" - maxlength="<?= $block->escapeHtmlAttr($helper->getMaxQueryLength()) ?>" + maxlength="<?= $escaper->escapeHtmlAttr($helper->getMaxQueryLength()) ?>" role="combobox" aria-haspopup="false" aria-autocomplete="both" @@ -49,11 +51,11 @@ $configProvider = $block->getData('configProvider'); </div> <div class="actions"> <button type="submit" - title="<?= $block->escapeHtml(__('Search')) ?>" - class="action search" - aria-label="Search" + title="<?= $escaper->escapeHtml(__('Search')) ?>" + class="action search" + aria-label="Search" > - <span><?= $block->escapeHtml(__('Search')) ?></span> + <span><?= $escaper->escapeHtml(__('Search')) ?></span> </button> </div> </form> diff --git a/app/code/Magento/Search/view/frontend/web/js/form-mini.js b/app/code/Magento/Search/view/frontend/web/js/form-mini.js index 9b4c814f73d73..b8034fead76d0 100644 --- a/app/code/Magento/Search/view/frontend/web/js/form-mini.js +++ b/app/code/Magento/Search/view/frontend/web/js/form-mini.js @@ -35,12 +35,12 @@ define([ selectClass: 'selected', template: '<li class="<%- data.row_class %>" id="qs-option-<%- data.index %>" role="option">' + - '<span class="qs-option-name">' + - ' <%- data.title %>' + - '</span>' + - '<span aria-hidden="true" class="amount">' + - '<%- data.num_results %>' + - '</span>' + + '<span class="qs-option-name">' + + ' <%- data.title %>' + + '</span>' + + '<span aria-hidden="true" class="amount">' + + '<%- data.num_results %>' + + '</span>' + '</li>', submitBtn: 'button[type="submit"]', searchLabel: '[data-role=minisearch-label]', @@ -300,60 +300,63 @@ define([ if (value.length >= parseInt(this.options.minSearchLength, 10)) { this.submitBtn.disabled = false; - $.getJSON(this.options.url, { - q: value - }, $.proxy(function (data) { - if (data.length) { - $.each(data, function (index, element) { - var html; - - element.index = index; - html = template({ - data: element - }); - dropdown.append(html); - }); - - this._resetResponseList(true); - this.responseList.indexList = this.autoComplete.html(dropdown) - .css(clonePosition) - .show() - .find(this.options.responseFieldElements + ':visible'); - - this.element.removeAttr('aria-activedescendant'); + if (this.options.url !== '') { //eslint-disable-line eqeqeq + $.getJSON(this.options.url, { + q: value + }, $.proxy(function (data) { + if (data.length) { + $.each(data, function (index, element) { + var html; + + element.index = index; + html = template({ + data: element + }); + dropdown.append(html); + }); - if (this.responseList.indexList.length) { - this._updateAriaHasPopup(true); + this._resetResponseList(true); + + this.responseList.indexList = this.autoComplete.html(dropdown) + .css(clonePosition) + .show() + .find(this.options.responseFieldElements + ':visible'); + + this.element.removeAttr('aria-activedescendant'); + + if (this.responseList.indexList.length) { + this._updateAriaHasPopup(true); + } else { + this._updateAriaHasPopup(false); + } + + this.responseList.indexList + .on('click', function (e) { + this.responseList.selected = $(e.currentTarget); + this.searchForm.trigger('submit'); + }.bind(this)) + .on('mouseenter mouseleave', function (e) { + this.responseList.indexList.removeClass(this.options.selectClass); + $(e.target).addClass(this.options.selectClass); + this.responseList.selected = $(e.target); + this.element.attr('aria-activedescendant', $(e.target).attr('id')); + }.bind(this)) + .on('mouseout', function (e) { + if (!this._getLastElement() && + this._getLastElement().hasClass(this.options.selectClass)) { + $(e.target).removeClass(this.options.selectClass); + this._resetResponseList(false); + } + }.bind(this)); } else { + this._resetResponseList(true); + this.autoComplete.hide(); this._updateAriaHasPopup(false); + this.element.removeAttr('aria-activedescendant'); } - - this.responseList.indexList - .on('click', function (e) { - this.responseList.selected = $(e.currentTarget); - this.searchForm.trigger('submit'); - }.bind(this)) - .on('mouseenter mouseleave', function (e) { - this.responseList.indexList.removeClass(this.options.selectClass); - $(e.target).addClass(this.options.selectClass); - this.responseList.selected = $(e.target); - this.element.attr('aria-activedescendant', $(e.target).attr('id')); - }.bind(this)) - .on('mouseout', function (e) { - if (!this._getLastElement() && - this._getLastElement().hasClass(this.options.selectClass)) { - $(e.target).removeClass(this.options.selectClass); - this._resetResponseList(false); - } - }.bind(this)); - } else { - this._resetResponseList(true); - this.autoComplete.hide(); - this._updateAriaHasPopup(false); - this.element.removeAttr('aria-activedescendant'); - } - }, this)); + }, this)); + } } else { this._resetResponseList(true); this.autoComplete.hide(); From f36929ac2be6c65c6386325c8fc38d1d333d77b3 Mon Sep 17 00:00:00 2001 From: Anna Pak <a.pak@atwix.com> Date: Mon, 30 Nov 2020 10:59:10 +0200 Subject: [PATCH 078/171] initial commit --- .../ProductsQtyReturnAfterOrderCancelTest.xml | 49 +++++++++++++------ 1 file changed, 35 insertions(+), 14 deletions(-) diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/ProductsQtyReturnAfterOrderCancelTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/ProductsQtyReturnAfterOrderCancelTest.xml index 0b7bca201ec32..6bcf33e923080 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/ProductsQtyReturnAfterOrderCancelTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/ProductsQtyReturnAfterOrderCancelTest.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="ProductsQtyReturnAfterOrderCancelTest"> + <test name=""> <annotations> <features value="ConfigurableProduct"/> @@ -23,28 +23,44 @@ <before> <createData entity="ApiCategory" stepKey="createCategory"/> - <createData entity="ApiConfigurableProduct" stepKey="createConfigProduct"> + <createData entity="BaseConfigurableProduct" stepKey="createConfigProduct"> <requiredEntity createDataKey="createCategory"/> + <field key="quantity">1000</field> </createData> + + + <actionGroup ref="AdminLoginActionGroup" stepKey="login"/> </before> <after> - <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> - <deleteData createDataKey="createConfigProduct" stepKey="deleteConfigProduct"/> + <!-- <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> + <deleteData createDataKey="createConfigProduct" stepKey="deleteConfigProduct"/> --> <actionGroup ref="AdminLogoutActionGroup" stepKey="amOnLogoutPage"/> </after> <actionGroup ref="AdminOpenCatalogProductPageActionGroup" stepKey="goToCatalogProductPage1"/> - <conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFiltersInitial"/> + <actionGroup ref="ClearFiltersAdminProductGridActionGroup" stepKey="clickClearFiltersInitial"/> <actionGroup ref="OpenEditProductOnBackendActionGroup" stepKey="openEditProduct"> <argument name="product" value="$$createConfigProduct$$"/> </actionGroup> <fillField selector="{{AdminProductFormSection.productQuantity}}" userInput="100" stepKey="changeProductQuantity"/> - <actionGroup ref="AdminProductFormSaveActionGroup" stepKey="saveChanges"/> + <actionGroup ref="AdminProductFormSaveActionGroup" stepKey="saveChanges"/> + + <createData entity="GuestCart" stepKey="createGuestCart"/> + <createData entity="SimpleFourCartItems" stepKey="addCartItem"> + <requiredEntity createDataKey="createGuestCart"/> + <requiredEntity createDataKey="createConfigProduct"/> + </createData> + <createData entity="GuestAddressInformation" stepKey="addGuestOrderAddress"> + <requiredEntity createDataKey="createGuestCart"/> + </createData> + <updateData createDataKey="createGuestCart" entity="GuestOrderPaymentMethod" stepKey="sendGuestPaymentInformation"> + <requiredEntity createDataKey="createGuestCart"/> + </updateData> - <amOnPage url="$$createConfigProduct.sku$$.html" stepKey="navigateToProductPage"/> + <!-- <amOnPage url="$$createConfigProduct.sku$$.html" stepKey="navigateToProductPage"/> <waitForPageLoad stepKey="waitForProductPage"/> <fillField selector="{{StorefrontProductInfoMainSection.qty}}" userInput="4" stepKey="fillQuantity"/> @@ -63,10 +79,10 @@ <argument name="emailYouMessage" value="CONST.successCheckoutEmailYouMessage" /> </actionGroup> - <grabTextFrom selector="{{CheckoutSuccessMainSection.orderNumber}}" stepKey="grabOrderNumber"/> + <grabTextFrom selector="{{CheckoutSuccessMainSection.orderNumber}}" stepKey="grabOrderNumber"/> --> <actionGroup ref="FilterOrderGridByIdActionGroup" stepKey="filterOrderGridById"> - <argument name="orderId" value="$grabOrderNumber"/> + <argument name="orderId" value="$createGuestCart.return$"/> </actionGroup> <actionGroup ref="AdminOrderGridClickFirstRowActionGroup" stepKey="clickOrderRow"/> @@ -75,11 +91,16 @@ <click selector="{{AdminInvoiceItemsSection.updateQty}}" stepKey="updateQuantity"/> <waitForPageLoad stepKey="waitPageToBeLoaded"/> <actionGroup ref="AdminInvoiceClickSubmitActionGroup" stepKey="clickSubmitInvoice"/> - <click selector="{{AdminOrderDetailsMainActionsSection.ship}}" stepKey="clickShipAction"/> - <waitForPageLoad stepKey="waitOrderDetailToLoad"/> - <fillField selector="{{AdminShipmentItemsSection.itemQtyToShip('1')}}" userInput="1" stepKey="changeItemQtyToShip"/> - <click selector="{{AdminShipmentMainActionsSection.submitShipment}}" stepKey="clickSubmitShipment"/> - <waitForPageLoad stepKey="waitShipmentSectionToLoad"/> + <!-- <click selector="{{AdminOrderDetailsMainActionsSection.ship}}" stepKey="clickShipAction"/> + <waitForPageLoad stepKey="waitOrderDetailToLoad"/> --> + <!-- <fillField selector="{{AdminShipmentItemsSection.itemQtyToShip('1')}}" userInput="1" stepKey="changeItemQtyToShip"/> --> + <actionGroup ref="AdminCreateShipmentFromOrderPage" stepKey="clickSubmitShipment"> + <argument name="Qty" value="1"/> + <argument name="Number" value="111"/> + </actionGroup> + + <!-- <click selector="{{AdminShipmentMainActionsSection.submitShipment}}" stepKey="clickSubmitShipment"/> + <waitForPageLoad stepKey="waitShipmentSectionToLoad"/> --> <actionGroup ref="CancelPendingOrderActionGroup" stepKey="cancelPendingOption"> <argument name="orderStatus" value="Complete"/> </actionGroup> From beac203458390fc00814f96daa19d698b0221919 Mon Sep 17 00:00:00 2001 From: Vadim Malesh <51680850+engcom-Charlie@users.noreply.github.com> Date: Mon, 30 Nov 2020 14:08:24 +0200 Subject: [PATCH 079/171] remove redundant spaces --- .../Test/AdminOpenShipmentViewPageWithWrongShipmentIdTest.xml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/app/code/Magento/Shipping/Test/Mftf/Test/AdminOpenShipmentViewPageWithWrongShipmentIdTest.xml b/app/code/Magento/Shipping/Test/Mftf/Test/AdminOpenShipmentViewPageWithWrongShipmentIdTest.xml index 13688afd0efe9..ce8d6414e2882 100644 --- a/app/code/Magento/Shipping/Test/Mftf/Test/AdminOpenShipmentViewPageWithWrongShipmentIdTest.xml +++ b/app/code/Magento/Shipping/Test/Mftf/Test/AdminOpenShipmentViewPageWithWrongShipmentIdTest.xml @@ -16,11 +16,9 @@ <severity value="MAJOR"/> <group value="shipping"/> </annotations> - <before> <actionGroup ref="AdminLoginActionGroup" stepKey="LoginAsAdmin"/> </before> - <after> <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> </after> @@ -30,9 +28,7 @@ </actionGroup> <waitForPageLoad stepKey="waitForPageLoad"/> - <seeInCurrentUrl url="{{AdminShipmentsGridPage.url}}" stepKey="redirectToShipmentsGridPage"/> - <see selector="{{AdminMessagesSection.error}}" userInput='This shipment no longer exists.' stepKey="seeErrorMessage"/> </test> From 94cdcf1827cdb4dbb04af097a668e3303bf3eede Mon Sep 17 00:00:00 2001 From: Anna Pak <a.pak@atwix.com> Date: Mon, 30 Nov 2020 16:38:33 +0200 Subject: [PATCH 080/171] Refactored ProductsQtyReturnAfterOrderCancelTest --- ...minCheckProductQtyAfterOrderCancelling.xml | 89 +++++++++++++++++++ ...nvoiceWIthUpdatedProductQtyActionGroup.xml | 23 +++++ 2 files changed, 112 insertions(+) create mode 100644 app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCheckProductQtyAfterOrderCancelling.xml create mode 100644 app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminInvoiceWIthUpdatedProductQtyActionGroup.xml diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCheckProductQtyAfterOrderCancelling.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCheckProductQtyAfterOrderCancelling.xml new file mode 100644 index 0000000000000..8be37cccbb67a --- /dev/null +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCheckProductQtyAfterOrderCancelling.xml @@ -0,0 +1,89 @@ +<?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="AdminCheckProductQtyAfterOrderCancelling"> + + <annotations> + <features value="ConfigurableProduct"/> + <stories value="Cancel order"/> + <title value="Product quantity return after order cancel"/> + <description value="Check Product quantity return after order cancel"/> + <severity value="CRITICAL"/> + <testCaseId value="MAGETWO-97228"/> + <useCaseId value="MAGETWO-82221"/> + <group value="ConfigurableProduct"/> + </annotations> + + <before> + <createData entity="ApiCategory" stepKey="createCategory"/> + + <createData entity="defaultSimpleProduct" stepKey="createConfigProduct"> + <requiredEntity createDataKey="createCategory"/> + </createData> + + <createData entity="GuestCart" stepKey="createGuestCart"/> + <createData entity="FourCartItems" stepKey="addCartItem"> + <requiredEntity createDataKey="createGuestCart"/> + <requiredEntity createDataKey="createConfigProduct"/> + </createData> + <createData entity="GuestAddressInformation" stepKey="addGuestOrderAddress"> + <requiredEntity createDataKey="createGuestCart"/> + </createData> + <updateData createDataKey="createGuestCart" entity="GuestOrderPaymentMethod" stepKey="sendGuestPaymentInformation"> + <requiredEntity createDataKey="createGuestCart"/> + </updateData> + + <actionGroup ref="AdminLoginActionGroup" stepKey="login"/> + + </before> + + <after> + <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> + <deleteData createDataKey="createConfigProduct" stepKey="deleteConfigProduct"/> + <actionGroup ref="AdminLogoutActionGroup" stepKey="amOnLogoutPage"/> + </after> + + <actionGroup ref="FilterOrderGridByIdActionGroup" stepKey="filterOrderGridById"> + <argument name="orderId" value="$createGuestCart.return$"/> + </actionGroup> + + <actionGroup ref="AdminOrderGridClickFirstRowActionGroup" stepKey="clickOrderRow"/> + + <actionGroup ref="AdminInvoiceWIthUpdatedProductQtyActionGroup" stepKey="ChangeQtyToInvoice"> + <argument name="qty" value="1"/> + </actionGroup> + + <actionGroup ref="AdminCreateShipmentFromOrderPage" stepKey="clickSubmitShipment"> + <argument name="Qty" value="1"/> + <argument name="Number" value="111"/> + </actionGroup> + + <actionGroup ref="CancelPendingOrderActionGroup" stepKey="cancelPendingOption"> + <argument name="orderStatus" value="Complete"/> + </actionGroup> + + <see selector="{{AdminOrderItemsOrderedSection.itemQty('1')}}" userInput="Canceled 3" stepKey="seeCanceledQuantity"/> + + <actionGroup ref="AdminOpenCatalogProductPageActionGroup" stepKey="goToCatalogProductPage"/> + + <actionGroup ref="FilterProductGridBySku2ActionGroup" stepKey="filterProductGridBySku"> + <argument name="sku" value="$$createConfigProduct.sku$$"/> + </actionGroup> + + <actionGroup ref="AssertAdminProductGridCellActionGroup" stepKey="seeProductSkuInGrid"> + <argument name="row" value="1"/> + <argument name="column" value="Quantity"/> + <argument name="value" value="99"/> + </actionGroup> + + <actionGroup ref="AdminClearFiltersActionGroup" stepKey="clearProductFilters"/> + + </test> +</tests> diff --git a/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminInvoiceWIthUpdatedProductQtyActionGroup.xml b/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminInvoiceWIthUpdatedProductQtyActionGroup.xml new file mode 100644 index 0000000000000..092a225c232ea --- /dev/null +++ b/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminInvoiceWIthUpdatedProductQtyActionGroup.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="AdminInvoiceWIthUpdatedProductQtyActionGroup" extends="AdminCreateInvoiceActionGroup"> + <annotations> + <description>The "Create Invoice" page: Update product qty to invoice (there is one product in the Order).</description> + </annotations> + <arguments> + <argument name="qty" type="string"/> + </arguments> + + <fillField selector="{{AdminInvoiceItemsSection.qtyToInvoiceColumn}}" userInput="{{qty}}" stepKey="changeQtyToInvoice" after="waitForInvoicePage"/> + <click selector="{{AdminInvoiceItemsSection.updateQty}}" stepKey="updateQuantity" after="changeQtyToInvoice"/> + <waitForPageLoad stepKey="waitPageToBeLoaded" after="updateQuantity"/> + </actionGroup> +</actionGroups> From 0d32349f8452d84770337eda6fba4d0cce70c6ee Mon Sep 17 00:00:00 2001 From: Anna Pak <a.pak@atwix.com> Date: Mon, 30 Nov 2020 16:49:58 +0200 Subject: [PATCH 081/171] refactored --- ...minCheckProductQtyAfterOrderCancelling.xml | 4 +- .../ProductsQtyReturnAfterOrderCancelTest.xml | 49 ++++++------------- .../Quote/Test/Mftf/Data/CartItemData.xml | 5 ++ ...nvoiceWIthUpdatedProductQtyActionGroup.xml | 5 +- 4 files changed, 25 insertions(+), 38 deletions(-) diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCheckProductQtyAfterOrderCancelling.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCheckProductQtyAfterOrderCancelling.xml index 8be37cccbb67a..71eddf6667368 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCheckProductQtyAfterOrderCancelling.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCheckProductQtyAfterOrderCancelling.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="AdminCheckProductQtyAfterOrderCancelling"> + <test name="AdminCheckProductQtyAfterOrderCancellingTest"> <annotations> <features value="ConfigurableProduct"/> @@ -41,7 +41,7 @@ </updateData> <actionGroup ref="AdminLoginActionGroup" stepKey="login"/> - + </before> <after> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/ProductsQtyReturnAfterOrderCancelTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/ProductsQtyReturnAfterOrderCancelTest.xml index 6bcf33e923080..5270c82a7e977 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/ProductsQtyReturnAfterOrderCancelTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/ProductsQtyReturnAfterOrderCancelTest.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=""> + <test name="ProductsQtyReturnAfterOrderCancelTest" deprecated="Use AdminCheckProductQtyAfterOrderCancellingTest instead"> <annotations> <features value="ConfigurableProduct"/> @@ -23,44 +23,28 @@ <before> <createData entity="ApiCategory" stepKey="createCategory"/> - <createData entity="BaseConfigurableProduct" stepKey="createConfigProduct"> + <createData entity="ApiConfigurableProduct" stepKey="createConfigProduct"> <requiredEntity createDataKey="createCategory"/> - <field key="quantity">1000</field> </createData> - - - <actionGroup ref="AdminLoginActionGroup" stepKey="login"/> </before> <after> - <!-- <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> - <deleteData createDataKey="createConfigProduct" stepKey="deleteConfigProduct"/> --> + <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> + <deleteData createDataKey="createConfigProduct" stepKey="deleteConfigProduct"/> <actionGroup ref="AdminLogoutActionGroup" stepKey="amOnLogoutPage"/> </after> <actionGroup ref="AdminOpenCatalogProductPageActionGroup" stepKey="goToCatalogProductPage1"/> - <actionGroup ref="ClearFiltersAdminProductGridActionGroup" stepKey="clickClearFiltersInitial"/> + <conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFiltersInitial"/> <actionGroup ref="OpenEditProductOnBackendActionGroup" stepKey="openEditProduct"> <argument name="product" value="$$createConfigProduct$$"/> </actionGroup> <fillField selector="{{AdminProductFormSection.productQuantity}}" userInput="100" stepKey="changeProductQuantity"/> - <actionGroup ref="AdminProductFormSaveActionGroup" stepKey="saveChanges"/> - - <createData entity="GuestCart" stepKey="createGuestCart"/> - <createData entity="SimpleFourCartItems" stepKey="addCartItem"> - <requiredEntity createDataKey="createGuestCart"/> - <requiredEntity createDataKey="createConfigProduct"/> - </createData> - <createData entity="GuestAddressInformation" stepKey="addGuestOrderAddress"> - <requiredEntity createDataKey="createGuestCart"/> - </createData> - <updateData createDataKey="createGuestCart" entity="GuestOrderPaymentMethod" stepKey="sendGuestPaymentInformation"> - <requiredEntity createDataKey="createGuestCart"/> - </updateData> + <actionGroup ref="AdminProductFormSaveActionGroup" stepKey="saveChanges"/> - <!-- <amOnPage url="$$createConfigProduct.sku$$.html" stepKey="navigateToProductPage"/> + <amOnPage url="$$createConfigProduct.sku$$.html" stepKey="navigateToProductPage"/> <waitForPageLoad stepKey="waitForProductPage"/> <fillField selector="{{StorefrontProductInfoMainSection.qty}}" userInput="4" stepKey="fillQuantity"/> @@ -79,10 +63,10 @@ <argument name="emailYouMessage" value="CONST.successCheckoutEmailYouMessage" /> </actionGroup> - <grabTextFrom selector="{{CheckoutSuccessMainSection.orderNumber}}" stepKey="grabOrderNumber"/> --> + <grabTextFrom selector="{{CheckoutSuccessMainSection.orderNumber}}" stepKey="grabOrderNumber"/> <actionGroup ref="FilterOrderGridByIdActionGroup" stepKey="filterOrderGridById"> - <argument name="orderId" value="$createGuestCart.return$"/> + <argument name="orderId" value="$grabOrderNumber"/> </actionGroup> <actionGroup ref="AdminOrderGridClickFirstRowActionGroup" stepKey="clickOrderRow"/> @@ -91,16 +75,11 @@ <click selector="{{AdminInvoiceItemsSection.updateQty}}" stepKey="updateQuantity"/> <waitForPageLoad stepKey="waitPageToBeLoaded"/> <actionGroup ref="AdminInvoiceClickSubmitActionGroup" stepKey="clickSubmitInvoice"/> - <!-- <click selector="{{AdminOrderDetailsMainActionsSection.ship}}" stepKey="clickShipAction"/> - <waitForPageLoad stepKey="waitOrderDetailToLoad"/> --> - <!-- <fillField selector="{{AdminShipmentItemsSection.itemQtyToShip('1')}}" userInput="1" stepKey="changeItemQtyToShip"/> --> - <actionGroup ref="AdminCreateShipmentFromOrderPage" stepKey="clickSubmitShipment"> - <argument name="Qty" value="1"/> - <argument name="Number" value="111"/> - </actionGroup> - - <!-- <click selector="{{AdminShipmentMainActionsSection.submitShipment}}" stepKey="clickSubmitShipment"/> - <waitForPageLoad stepKey="waitShipmentSectionToLoad"/> --> + <click selector="{{AdminOrderDetailsMainActionsSection.ship}}" stepKey="clickShipAction"/> + <waitForPageLoad stepKey="waitOrderDetailToLoad"/> + <fillField selector="{{AdminShipmentItemsSection.itemQtyToShip('1')}}" userInput="1" stepKey="changeItemQtyToShip"/> + <click selector="{{AdminShipmentMainActionsSection.submitShipment}}" stepKey="clickSubmitShipment"/> + <waitForPageLoad stepKey="waitShipmentSectionToLoad"/> <actionGroup ref="CancelPendingOrderActionGroup" stepKey="cancelPendingOption"> <argument name="orderStatus" value="Complete"/> </actionGroup> diff --git a/app/code/Magento/Quote/Test/Mftf/Data/CartItemData.xml b/app/code/Magento/Quote/Test/Mftf/Data/CartItemData.xml index a513b6747f612..d24154bcf9da2 100644 --- a/app/code/Magento/Quote/Test/Mftf/Data/CartItemData.xml +++ b/app/code/Magento/Quote/Test/Mftf/Data/CartItemData.xml @@ -23,4 +23,9 @@ <var key="quote_id" entityKey="return" entityType="GuestCart"/> <var key="sku" entityKey="sku" entityType="product"/> </entity> + <entity name="FourCartItems" type="CartItem"> + <data key="qty">4</data> + <var key="quote_id" entityKey="return" entityType="GuestCart"/> + <var key="sku" entityKey="sku" entityType="product"/> + </entity> </entities> diff --git a/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminInvoiceWIthUpdatedProductQtyActionGroup.xml b/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminInvoiceWIthUpdatedProductQtyActionGroup.xml index 092a225c232ea..334061803bb4d 100644 --- a/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminInvoiceWIthUpdatedProductQtyActionGroup.xml +++ b/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminInvoiceWIthUpdatedProductQtyActionGroup.xml @@ -10,7 +10,10 @@ xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> <actionGroup name="AdminInvoiceWIthUpdatedProductQtyActionGroup" extends="AdminCreateInvoiceActionGroup"> <annotations> - <description>The "Create Invoice" page: Update product qty to invoice (there is one product in the Order).</description> + <description>Start order Invoicing. + Update product qty to invoice (there is one product in the Order). + Submit the invoice. + </description> </annotations> <arguments> <argument name="qty" type="string"/> From 9bffc0892aeb17a2b7091caff07b278f987f3811 Mon Sep 17 00:00:00 2001 From: Anna Pak <a.pak@atwix.com> Date: Mon, 30 Nov 2020 16:52:33 +0200 Subject: [PATCH 082/171] refactored --- .../Test/Mftf/Test/ProductsQtyReturnAfterOrderCancelTest.xml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/ProductsQtyReturnAfterOrderCancelTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/ProductsQtyReturnAfterOrderCancelTest.xml index 5270c82a7e977..899ed7f1e60ba 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/ProductsQtyReturnAfterOrderCancelTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/ProductsQtyReturnAfterOrderCancelTest.xml @@ -19,6 +19,9 @@ <testCaseId value="MAGETWO-97228"/> <useCaseId value="MAGETWO-82221"/> <group value="ConfigurableProduct"/> + <skip> + <issueId value="DEPRECATED">Use AdminCheckProductQtyAfterOrderCancellingTest instead</issueId> + </skip> </annotations> <before> From ad511d6c8f8c5ed8ee3458346bdef6bb378f054a Mon Sep 17 00:00:00 2001 From: Anna Pak <a.pak@atwix.com> Date: Mon, 30 Nov 2020 16:56:40 +0200 Subject: [PATCH 083/171] refactored stepKeys --- .../AdminCheckProductQtyAfterOrderCancelling.xml | 14 +++++++------- ...dminInvoiceWIthUpdatedProductQtyActionGroup.xml | 6 +++--- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCheckProductQtyAfterOrderCancelling.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCheckProductQtyAfterOrderCancelling.xml index 71eddf6667368..551269945bd81 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCheckProductQtyAfterOrderCancelling.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCheckProductQtyAfterOrderCancelling.xml @@ -54,22 +54,22 @@ <argument name="orderId" value="$createGuestCart.return$"/> </actionGroup> - <actionGroup ref="AdminOrderGridClickFirstRowActionGroup" stepKey="clickOrderRow"/> + <actionGroup ref="AdminOrderGridClickFirstRowActionGroup" stepKey="openOrder"/> - <actionGroup ref="AdminInvoiceWIthUpdatedProductQtyActionGroup" stepKey="ChangeQtyToInvoice"> + <actionGroup ref="AdminInvoiceWIthUpdatedProductQtyActionGroup" stepKey="createPartialInvoice"> <argument name="qty" value="1"/> </actionGroup> - <actionGroup ref="AdminCreateShipmentFromOrderPage" stepKey="clickSubmitShipment"> + <actionGroup ref="AdminCreateShipmentFromOrderPage" stepKey="createShipment"> <argument name="Qty" value="1"/> <argument name="Number" value="111"/> </actionGroup> - <actionGroup ref="CancelPendingOrderActionGroup" stepKey="cancelPendingOption"> + <actionGroup ref="CancelPendingOrderActionGroup" stepKey="cancelOrder"> <argument name="orderStatus" value="Complete"/> </actionGroup> - <see selector="{{AdminOrderItemsOrderedSection.itemQty('1')}}" userInput="Canceled 3" stepKey="seeCanceledQuantity"/> + <see selector="{{AdminOrderItemsOrderedSection.itemQty('1')}}" userInput="Canceled 3" stepKey="seeCanceledQty"/> <actionGroup ref="AdminOpenCatalogProductPageActionGroup" stepKey="goToCatalogProductPage"/> @@ -77,13 +77,13 @@ <argument name="sku" value="$$createConfigProduct.sku$$"/> </actionGroup> - <actionGroup ref="AssertAdminProductGridCellActionGroup" stepKey="seeProductSkuInGrid"> + <actionGroup ref="AssertAdminProductGridCellActionGroup" stepKey="assertProductDataInGrid"> <argument name="row" value="1"/> <argument name="column" value="Quantity"/> <argument name="value" value="99"/> </actionGroup> - <actionGroup ref="AdminClearFiltersActionGroup" stepKey="clearProductFilters"/> + <actionGroup ref="AdminClearFiltersActionGroup" stepKey="clearFilters"/> </test> </tests> diff --git a/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminInvoiceWIthUpdatedProductQtyActionGroup.xml b/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminInvoiceWIthUpdatedProductQtyActionGroup.xml index 334061803bb4d..cc02bdc66c18b 100644 --- a/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminInvoiceWIthUpdatedProductQtyActionGroup.xml +++ b/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminInvoiceWIthUpdatedProductQtyActionGroup.xml @@ -19,8 +19,8 @@ <argument name="qty" type="string"/> </arguments> - <fillField selector="{{AdminInvoiceItemsSection.qtyToInvoiceColumn}}" userInput="{{qty}}" stepKey="changeQtyToInvoice" after="waitForInvoicePage"/> - <click selector="{{AdminInvoiceItemsSection.updateQty}}" stepKey="updateQuantity" after="changeQtyToInvoice"/> - <waitForPageLoad stepKey="waitPageToBeLoaded" after="updateQuantity"/> + <fillField selector="{{AdminInvoiceItemsSection.qtyToInvoiceColumn}}" userInput="{{qty}}" stepKey="fillQtyField" after="waitForInvoicePage"/> + <click selector="{{AdminInvoiceItemsSection.updateQty}}" stepKey="clickUpdateQuantityButton" after="changeQtyToInvoice"/> + <waitForPageLoad stepKey="waitForPageRefreshed" after="updateQuantity"/> </actionGroup> </actionGroups> From f1b6aed98ee775ae6c6d672c6befbe563483fd2e Mon Sep 17 00:00:00 2001 From: "rostyslav.hymon" <rostyslav.hymon@transoftgroup.com> Date: Mon, 30 Nov 2020 17:04:22 +0200 Subject: [PATCH 084/171] MC-39072: JS error is shown on the checkout --- .../view/frontend/web/template/billing-address/details.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/Checkout/view/frontend/web/template/billing-address/details.html b/app/code/Magento/Checkout/view/frontend/web/template/billing-address/details.html index 23bbce48fee2c..e4000e2d120f9 100644 --- a/app/code/Magento/Checkout/view/frontend/web/template/billing-address/details.html +++ b/app/code/Magento/Checkout/view/frontend/web/template/billing-address/details.html @@ -7,7 +7,7 @@ <div if="isAddressDetailsVisible() && currentBillingAddress()" class="billing-address-details"> <text args="currentBillingAddress().prefix"/> <text args="currentBillingAddress().firstname"/> <text args="currentBillingAddress().middlename"/> <text args="currentBillingAddress().lastname"/> <text args="currentBillingAddress().suffix"/><br/> - <text args="_.values(currentBillingAddress().street).join(', ')"/><br/> + <text args="currentBillingAddress().street"/><br/> <text args="currentBillingAddress().city "/>, <span text="currentBillingAddress().region"></span> <text args="currentBillingAddress().postcode"/><br/> <text args="getCountryName(currentBillingAddress().countryId)"/><br/> <a if="currentBillingAddress().telephone" attr="'href': 'tel:' + currentBillingAddress().telephone" text="currentBillingAddress().telephone"></a><br/> From 7320189463af8d2a08f6138e524ed4838195d179 Mon Sep 17 00:00:00 2001 From: Anna Pak <a.pak@atwix.com> Date: Mon, 30 Nov 2020 17:15:08 +0200 Subject: [PATCH 085/171] refactored --- .../Mftf/Test/AddOutOfStockProductToCompareListTest.xml | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AddOutOfStockProductToCompareListTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AddOutOfStockProductToCompareListTest.xml index c28c5a040e553..d8545c94010dc 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AddOutOfStockProductToCompareListTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AddOutOfStockProductToCompareListTest.xml @@ -87,13 +87,12 @@ <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForStorefrontProductComparePageLoad"/> <actionGroup ref="SeeProductInComparisonListActionGroup" stepKey="seeProductInCompareList"> - <argument name="productVar" value="$$product$$"/> + <argument name="productVar" value="$$product$$"/> </actionGroup> - - <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="deleteProdFromCmpList"/> - <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="onCategoryPage"/> - <actionGroup ref="StorefrontGoToCategoryPageActionGroup" stepKey="waitForPageLoad1"> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="deleteProdFromCmpList"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="onCategoryPage"/> + <actionGroup ref="StorefrontGoToCategoryPageActionGroup" stepKey="waitForPageLoad1"> <argument name="categoryName" value="$$category.name$$"/> </actionGroup> From 234c78407a5f3ab56b6b060824456d872188bd41 Mon Sep 17 00:00:00 2001 From: Anna Pak <a.pak@atwix.com> Date: Mon, 30 Nov 2020 19:52:32 +0200 Subject: [PATCH 086/171] refactoring --- .../Test/Mftf/Test/AdminCheckProductQtyAfterOrderCancelling.xml | 2 +- .../AdminInvoiceWIthUpdatedProductQtyActionGroup.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCheckProductQtyAfterOrderCancelling.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCheckProductQtyAfterOrderCancelling.xml index 551269945bd81..0b9b5c98d9884 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCheckProductQtyAfterOrderCancelling.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCheckProductQtyAfterOrderCancelling.xml @@ -56,7 +56,7 @@ <actionGroup ref="AdminOrderGridClickFirstRowActionGroup" stepKey="openOrder"/> - <actionGroup ref="AdminInvoiceWIthUpdatedProductQtyActionGroup" stepKey="createPartialInvoice"> + <actionGroup ref="AdminInvoiceWithUpdatedProductQtyActionGroup" stepKey="createPartialInvoice"> <argument name="qty" value="1"/> </actionGroup> diff --git a/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminInvoiceWIthUpdatedProductQtyActionGroup.xml b/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminInvoiceWIthUpdatedProductQtyActionGroup.xml index cc02bdc66c18b..c9c9d5bf1e573 100644 --- a/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminInvoiceWIthUpdatedProductQtyActionGroup.xml +++ b/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminInvoiceWIthUpdatedProductQtyActionGroup.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="AdminInvoiceWIthUpdatedProductQtyActionGroup" extends="AdminCreateInvoiceActionGroup"> + <actionGroup name="AdminInvoiceWithUpdatedProductQtyActionGroup" extends="AdminCreateInvoiceActionGroup"> <annotations> <description>Start order Invoicing. Update product qty to invoice (there is one product in the Order). From 56e2026e62d1d73cf91c2382bc95bee5971c1063 Mon Sep 17 00:00:00 2001 From: Anna Pak <a.pak@atwix.com> Date: Mon, 30 Nov 2020 19:54:52 +0200 Subject: [PATCH 087/171] add "DEPRECATED" to title --- .../Test/Mftf/Test/ProductsQtyReturnAfterOrderCancelTest.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/ProductsQtyReturnAfterOrderCancelTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/ProductsQtyReturnAfterOrderCancelTest.xml index 899ed7f1e60ba..4baceead08a07 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/ProductsQtyReturnAfterOrderCancelTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/ProductsQtyReturnAfterOrderCancelTest.xml @@ -13,7 +13,7 @@ <annotations> <features value="ConfigurableProduct"/> <stories value="Cancel order"/> - <title value="Product quantity return after order cancel"/> + <title value="DEPRECATED. Product quantity return after order cancel"/> <description value="Check Product quantity return after order cancel"/> <severity value="CRITICAL"/> <testCaseId value="MAGETWO-97228"/> From 0d93b240eeecfb16c71c35d9090160d4f0774d13 Mon Sep 17 00:00:00 2001 From: Anna Pak <a.pak@atwix.com> Date: Mon, 30 Nov 2020 19:59:56 +0200 Subject: [PATCH 088/171] refactored --- .../AdminInvoiceWIthUpdatedProductQtyActionGroup.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminInvoiceWIthUpdatedProductQtyActionGroup.xml b/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminInvoiceWIthUpdatedProductQtyActionGroup.xml index c9c9d5bf1e573..0f602c42ade25 100644 --- a/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminInvoiceWIthUpdatedProductQtyActionGroup.xml +++ b/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminInvoiceWIthUpdatedProductQtyActionGroup.xml @@ -20,7 +20,7 @@ </arguments> <fillField selector="{{AdminInvoiceItemsSection.qtyToInvoiceColumn}}" userInput="{{qty}}" stepKey="fillQtyField" after="waitForInvoicePage"/> - <click selector="{{AdminInvoiceItemsSection.updateQty}}" stepKey="clickUpdateQuantityButton" after="changeQtyToInvoice"/> - <waitForPageLoad stepKey="waitForPageRefreshed" after="updateQuantity"/> + <click selector="{{AdminInvoiceItemsSection.updateQty}}" stepKey="clickUpdateQuantityButton" after="fillQtyField"/> + <waitForPageLoad stepKey="waitForPageRefreshed" after="clickUpdateQuantityButton"/> </actionGroup> </actionGroups> From 04bd4bda3043fd2d347da36d37f1a8234530f48b Mon Sep 17 00:00:00 2001 From: Anna Pak <58164147+AnnaAPak@users.noreply.github.com> Date: Mon, 30 Nov 2020 20:05:32 +0200 Subject: [PATCH 089/171] Rename AdminInvoiceWIthUpdatedProductQtyActionGroup.xml to AdminInvoiceWithUpdatedProductQtyActionGroup.xml --- ...Group.xml => AdminInvoiceWithUpdatedProductQtyActionGroup.xml} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename app/code/Magento/Sales/Test/Mftf/ActionGroup/{AdminInvoiceWIthUpdatedProductQtyActionGroup.xml => AdminInvoiceWithUpdatedProductQtyActionGroup.xml} (100%) diff --git a/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminInvoiceWIthUpdatedProductQtyActionGroup.xml b/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminInvoiceWithUpdatedProductQtyActionGroup.xml similarity index 100% rename from app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminInvoiceWIthUpdatedProductQtyActionGroup.xml rename to app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminInvoiceWithUpdatedProductQtyActionGroup.xml From 8ba2695458f6c686a1caafb5cd629b0f67a85f10 Mon Sep 17 00:00:00 2001 From: Anna Pak <a.pak@atwix.com> Date: Tue, 1 Dec 2020 08:57:26 +0200 Subject: [PATCH 090/171] fixed indentation --- .../StorefrontHoverProductOnCategoryPageActionGroup.xml | 4 ++-- .../Test/Mftf/Test/AddOutOfStockProductToCompareListTest.xml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontHoverProductOnCategoryPageActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontHoverProductOnCategoryPageActionGroup.xml index 661d40fd4f13a..10d85a91a02c6 100644 --- a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontHoverProductOnCategoryPageActionGroup.xml +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontHoverProductOnCategoryPageActionGroup.xml @@ -10,10 +10,10 @@ xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> <actionGroup name="StorefrontHoverProductOnCategoryPageActionGroup"> <annotations> - <description>Hover product on the Category page</description> + <description>Hover product on the Category page</description> </annotations> - <moveMouseOver selector="{{StorefrontCategoryMainSection.ProductItemInfo}}" stepKey="hoverOverProduct"/> + <moveMouseOver selector="{{StorefrontCategoryMainSection.ProductItemInfo}}" stepKey="hoverOverProduct"/> </actionGroup> </actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AddOutOfStockProductToCompareListTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AddOutOfStockProductToCompareListTest.xml index d8545c94010dc..8911e5d04fe4a 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AddOutOfStockProductToCompareListTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AddOutOfStockProductToCompareListTest.xml @@ -31,7 +31,7 @@ </before> <after> - <magentoCLI command="config:set {{CatalogInventoryOptionsShowOutOfStockDisable.path}} {{CatalogInventoryOptionsShowOutOfStockDisable.value}}" stepKey="setConfigShowOutOfStockFalse"/> + <magentoCLI command="config:set {{CatalogInventoryOptionsShowOutOfStockDisable.path}} {{CatalogInventoryOptionsShowOutOfStockDisable.value}}" stepKey="setConfigShowOutOfStockFalse"/> <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> <argument name="tags" value=""/> </actionGroup> From d001c99173bbf407587b4ece8f8d51fec6e4f56c Mon Sep 17 00:00:00 2001 From: Anna Pak <a.pak@atwix.com> Date: Tue, 1 Dec 2020 09:00:50 +0200 Subject: [PATCH 091/171] fixed indentation --- .../Test/Mftf/Test/AddOutOfStockProductToCompareListTest.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AddOutOfStockProductToCompareListTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AddOutOfStockProductToCompareListTest.xml index 8911e5d04fe4a..7f4228a21f3d5 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AddOutOfStockProductToCompareListTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AddOutOfStockProductToCompareListTest.xml @@ -120,7 +120,7 @@ <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForStorefrontProductComparePageLoad2"/> <actionGroup ref="SeeProductInComparisonListActionGroup" stepKey="seeProductInCompareList2"> - <argument name="productVar" value="$$product$$"/> + <argument name="productVar" value="$$product$$"/> </actionGroup> </test> From ffc0ab716c986735427125dd594449e8aac05f41 Mon Sep 17 00:00:00 2001 From: Vadim Malesh <51680850+engcom-Charlie@users.noreply.github.com> Date: Tue, 1 Dec 2020 10:17:20 +0200 Subject: [PATCH 092/171] update severity, testCaseId --- .../AdminOpenCreditmemoViewPageWithWrongCreditmemoIdTest.xml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminOpenCreditmemoViewPageWithWrongCreditmemoIdTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminOpenCreditmemoViewPageWithWrongCreditmemoIdTest.xml index 4436aab59874a..38b85828c3421 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminOpenCreditmemoViewPageWithWrongCreditmemoIdTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminOpenCreditmemoViewPageWithWrongCreditmemoIdTest.xml @@ -13,7 +13,8 @@ <stories value="Creditmemo Page With Wrong Creditmemo Id"/> <title value="Open Creditmemo View Page with Wrong Creditmemo Id"/> <description value="Open Creditmemo View Page with Wrong Creditmemo Id."/> - <severity value="MAJOR"/> + <severity value="BLOCKER"/> + <testCaseId value="MC-39500"/> <group value="sales"/> </annotations> <before> From 247817a04340e82b5246761888acfca82eee7736 Mon Sep 17 00:00:00 2001 From: Vadim Malesh <51680850+engcom-Charlie@users.noreply.github.com> Date: Tue, 1 Dec 2020 10:18:35 +0200 Subject: [PATCH 093/171] update severity, testCaseId --- .../Test/AdminOpenShipmentViewPageWithWrongShipmentIdTest.xml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/code/Magento/Shipping/Test/Mftf/Test/AdminOpenShipmentViewPageWithWrongShipmentIdTest.xml b/app/code/Magento/Shipping/Test/Mftf/Test/AdminOpenShipmentViewPageWithWrongShipmentIdTest.xml index ce8d6414e2882..d60dca08e6813 100644 --- a/app/code/Magento/Shipping/Test/Mftf/Test/AdminOpenShipmentViewPageWithWrongShipmentIdTest.xml +++ b/app/code/Magento/Shipping/Test/Mftf/Test/AdminOpenShipmentViewPageWithWrongShipmentIdTest.xml @@ -13,7 +13,8 @@ <stories value="Shipment Page With Wrong Shipment Id"/> <title value="Open Shipment View Page with Wrong Shipment Id"/> <description value="Open Shipment View Page with Wrong Shipment Id."/> - <severity value="MAJOR"/> + <severity value="BLOCKER"/> + <testCaseId value="MC-39502"/> <group value="shipping"/> </annotations> <before> From 14b9169b13e1a033a2d185ff2c47ceeefc8bef48 Mon Sep 17 00:00:00 2001 From: Stanislav Ilnytskyi <stailx1@gmail.com> Date: Tue, 1 Dec 2020 10:06:51 +0100 Subject: [PATCH 094/171] fix unit test --- .../Test/Unit/Model/Indexer/ProductPriceIndexFilterTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/CatalogInventory/Test/Unit/Model/Indexer/ProductPriceIndexFilterTest.php b/app/code/Magento/CatalogInventory/Test/Unit/Model/Indexer/ProductPriceIndexFilterTest.php index 0f3d8be212e30..090a74afca050 100644 --- a/app/code/Magento/CatalogInventory/Test/Unit/Model/Indexer/ProductPriceIndexFilterTest.php +++ b/app/code/Magento/CatalogInventory/Test/Unit/Model/Indexer/ProductPriceIndexFilterTest.php @@ -82,7 +82,7 @@ public function testModifyPrice() $connectionMock->expects($this->once())->method('select')->willReturn($selectMock); $selectMock->expects($this->at(2)) ->method('where') - ->with('stock_item.product_id in (?)', $entityIds) + ->with('stock_item.product_id IN (?)', $entityIds) ->willReturn($selectMock); $this->generator->expects($this->once()) ->method('generate') From 9847f03d47e5027c7f27c4e5c800896a5b199582 Mon Sep 17 00:00:00 2001 From: Anna Pak <a.pak@atwix.com> Date: Tue, 1 Dec 2020 11:47:05 +0200 Subject: [PATCH 095/171] init --- .../Sales/Test/Mftf/Metadata/InvoiceMeta.xml | 14 +++++ .../Test/Mftf/Test/AdminCreateInvoice.xml | 53 +++++++++++++++++++ 2 files changed, 67 insertions(+) create mode 100644 app/code/Magento/Sales/Test/Mftf/Metadata/InvoiceMeta.xml create mode 100644 app/code/Magento/Sales/Test/Mftf/Test/AdminCreateInvoice.xml diff --git a/app/code/Magento/Sales/Test/Mftf/Metadata/InvoiceMeta.xml b/app/code/Magento/Sales/Test/Mftf/Metadata/InvoiceMeta.xml new file mode 100644 index 0000000000000..30355882b20df --- /dev/null +++ b/app/code/Magento/Sales/Test/Mftf/Metadata/InvoiceMeta.xml @@ -0,0 +1,14 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<operations xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:DataGenerator/etc/dataOperation.xsd"> + <operation name="CreateInvoice" dataType="Invoice" type="create" auth="adminOauth" url="V1/order/29/invoices" method="POST"> + <contentType>application/json</contentType> + </operation> +</operations> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateInvoice.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateInvoice.xml new file mode 100644 index 0000000000000..74912e1037436 --- /dev/null +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateInvoice.xml @@ -0,0 +1,53 @@ +<?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="AdminCreateInvoice"> + <annotations> + <features value="Sales"/> + <stories value="1Create an Invoice via the Admin"/> + <title value="1111Admin should be able to create an invoice"/> + <description value="1Admin should be able to create an invoice"/> + <severity value="MAJOR"/> + <testCaseId value="1MAGETWO-72096"/> + <group value="sales"/> + </annotations> + <before> + <createData entity="ApiCategory" stepKey="createCategory"/> + + <createData entity="defaultSimpleProduct" stepKey="createConfigProduct"> + <requiredEntity createDataKey="createCategory"/> + </createData> + + <createData entity="GuestCart" stepKey="createGuestCart"/> + <createData entity="SimpleCartItem" stepKey="addCartItem"> + <requiredEntity createDataKey="createGuestCart"/> + <requiredEntity createDataKey="createConfigProduct"/> + </createData> + <createData entity="GuestAddressInformation" stepKey="addGuestOrderAddress"> + <requiredEntity createDataKey="createGuestCart"/> + </createData> + <updateData createDataKey="createGuestCart" entity="GuestOrderPaymentMethod" stepKey="sendGuestPaymentInformation"> + <requiredEntity createDataKey="createGuestCart"/> + </updateData> + + <createData entity="Invoice" stepKey="invoiceOrder"/> + + + </before> + <after> + <!-- <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> + <deleteData createDataKey="createConfigProduct" stepKey="deleteConfigProduct"/> --> + <actionGroup ref="AdminLogoutActionGroup" stepKey="amOnLogoutPage"/> + </after> + + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> + + </test> +</tests> From 901daf6771ca2179c886f25c80604f4105da0f83 Mon Sep 17 00:00:00 2001 From: "vadim.malesh" <engcom-vendorworker-charlie@adobe.com> Date: Tue, 1 Dec 2020 12:10:02 +0200 Subject: [PATCH 096/171] remove preventDefault() --- .../Framework/View/Helper/SecureHtmlRenderer.php | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/lib/internal/Magento/Framework/View/Helper/SecureHtmlRenderer.php b/lib/internal/Magento/Framework/View/Helper/SecureHtmlRenderer.php index d926e85ae4f8f..052c51441d451 100644 --- a/lib/internal/Magento/Framework/View/Helper/SecureHtmlRenderer.php +++ b/lib/internal/Magento/Framework/View/Helper/SecureHtmlRenderer.php @@ -8,7 +8,6 @@ namespace Magento\Framework\View\Helper; -use Magento\Framework\Api\SimpleDataObjectConverter; use Magento\Framework\Math\Random; use Magento\Framework\View\Helper\SecureHtmlRender\EventHandlerData; use Magento\Framework\View\Helper\SecureHtmlRender\HtmlRenderer; @@ -105,27 +104,26 @@ public function renderEventListenerAsTag( } $random = $this->random->getRandomString(10); - $listenerFunction = 'eventListener' .$random; - $elementName = 'listenedElement' .$random; + $listenerFunction = 'eventListener' . $random; + $elementName = 'listenedElement' . $random; $script = <<<script function {$listenerFunction} () { {$attributeJavascript}; } var {$elementName}Array = document.querySelectorAll("{$elementSelector}"); if({$elementName}Array.length !== 'undefined'){ - {$elementName}Array.forEach(function(element){ + {$elementName}Array.forEach(function(element) { if (element) { element.{$eventName} = function (event) { - event.preventDefault(); var targetElement = element; if (event && event.target) { targetElement = event.target; } {$listenerFunction}.apply(targetElement); - } + }; } }); - } + } script; return $this->renderTag('script', ['type' => 'text/javascript'], $script, false); @@ -145,7 +143,7 @@ public function renderStyleAsTag(string $style, string $selector): string throw new \InvalidArgumentException('Invalid style data given'); } - $elementVariable = 'elem' .$this->random->getRandomString(8); + $elementVariable = 'elem' . $this->random->getRandomString(8); /** @var string[] $styles */ $stylesAssignments = ''; foreach ($stylePairs as $stylePair) { @@ -167,7 +165,7 @@ public function renderStyleAsTag(string $style, string $selector): string 'script', ['type' => 'text/javascript'], "var $elementVariable = document.querySelector('$selector');\n" - ."if ($elementVariable) {\n{$stylesAssignments}}", + . "if ($elementVariable) {\n{$stylesAssignments}}", false ); } From e34fc7826d04dcd7e504082d5fa0d7f029343225 Mon Sep 17 00:00:00 2001 From: Anna Pak <a.pak@atwix.com> Date: Tue, 1 Dec 2020 13:10:44 +0200 Subject: [PATCH 097/171] ready --- app/code/Magento/Sales/Test/Mftf/Metadata/InvoiceMeta.xml | 7 ++++++- .../Magento/Sales/Test/Mftf/Test/AdminCreateInvoice.xml | 5 +++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/app/code/Magento/Sales/Test/Mftf/Metadata/InvoiceMeta.xml b/app/code/Magento/Sales/Test/Mftf/Metadata/InvoiceMeta.xml index 30355882b20df..250d657c123ff 100644 --- a/app/code/Magento/Sales/Test/Mftf/Metadata/InvoiceMeta.xml +++ b/app/code/Magento/Sales/Test/Mftf/Metadata/InvoiceMeta.xml @@ -8,7 +8,12 @@ <operations xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:DataGenerator/etc/dataOperation.xsd"> - <operation name="CreateInvoice" dataType="Invoice" type="create" auth="adminOauth" url="V1/order/29/invoices" method="POST"> + <operation name="CreateInvoice" dataType="Invoice" type="create" auth="adminOauth" url="V1/order/{return}/invoice" method="POST"> <contentType>application/json</contentType> + <object key="cartItem" dataType="CartItem"> + <field key="quote_id">string</field> + <field key="sku" type="string">string</field> + <field key="qty">integer</field> + </object> </operation> </operations> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateInvoice.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateInvoice.xml index 74912e1037436..b75be4652c483 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateInvoice.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateInvoice.xml @@ -37,8 +37,9 @@ <requiredEntity createDataKey="createGuestCart"/> </updateData> - <createData entity="Invoice" stepKey="invoiceOrder"/> - + <createData entity="Invoice" stepKey="invoiceOrder"> + <requiredEntity createDataKey="createGuestCart"/> + </createData> </before> <after> From beb0fda08417c7dfec5063a1335639cb356cd9f2 Mon Sep 17 00:00:00 2001 From: Anna Pak <a.pak@atwix.com> Date: Tue, 1 Dec 2020 13:19:17 +0200 Subject: [PATCH 098/171] refactored --- app/code/Magento/Sales/Test/Mftf/Metadata/InvoiceMeta.xml | 2 -- app/code/Magento/Sales/Test/Mftf/Test/AdminCreateInvoice.xml | 4 ++-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/app/code/Magento/Sales/Test/Mftf/Metadata/InvoiceMeta.xml b/app/code/Magento/Sales/Test/Mftf/Metadata/InvoiceMeta.xml index 250d657c123ff..e0bbfa1cd6e5f 100644 --- a/app/code/Magento/Sales/Test/Mftf/Metadata/InvoiceMeta.xml +++ b/app/code/Magento/Sales/Test/Mftf/Metadata/InvoiceMeta.xml @@ -12,8 +12,6 @@ <contentType>application/json</contentType> <object key="cartItem" dataType="CartItem"> <field key="quote_id">string</field> - <field key="sku" type="string">string</field> - <field key="qty">integer</field> </object> </operation> </operations> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateInvoice.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateInvoice.xml index b75be4652c483..51aaa251fa3d9 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateInvoice.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateInvoice.xml @@ -43,8 +43,8 @@ </before> <after> - <!-- <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> - <deleteData createDataKey="createConfigProduct" stepKey="deleteConfigProduct"/> --> + <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> + <deleteData createDataKey="createConfigProduct" stepKey="deleteConfigProduct"/> <actionGroup ref="AdminLogoutActionGroup" stepKey="amOnLogoutPage"/> </after> From 320748f555d4036d50ed83ebb32a81972aa29579 Mon Sep 17 00:00:00 2001 From: Anna Pak <a.pak@atwix.com> Date: Tue, 1 Dec 2020 13:45:26 +0200 Subject: [PATCH 099/171] added Shipment, CreditMemo --- .../Sales/Test/Mftf/Data/CreditMemoData.xml | 17 +++++++++++++++++ .../Sales/Test/Mftf/Data/InvoiceData.xml | 17 +++++++++++++++++ .../Sales/Test/Mftf/Data/ShipmentData.xml | 17 +++++++++++++++++ .../Sales/Test/Mftf/Metadata/CreditMemoMeta.xml | 17 +++++++++++++++++ .../Sales/Test/Mftf/Metadata/ShipmentMeta.xml | 17 +++++++++++++++++ .../Sales/Test/Mftf/Test/AdminCreateInvoice.xml | 10 +++++++++- 6 files changed, 94 insertions(+), 1 deletion(-) create mode 100644 app/code/Magento/Sales/Test/Mftf/Data/CreditMemoData.xml create mode 100644 app/code/Magento/Sales/Test/Mftf/Data/InvoiceData.xml create mode 100644 app/code/Magento/Sales/Test/Mftf/Data/ShipmentData.xml create mode 100644 app/code/Magento/Sales/Test/Mftf/Metadata/CreditMemoMeta.xml create mode 100644 app/code/Magento/Sales/Test/Mftf/Metadata/ShipmentMeta.xml diff --git a/app/code/Magento/Sales/Test/Mftf/Data/CreditMemoData.xml b/app/code/Magento/Sales/Test/Mftf/Data/CreditMemoData.xml new file mode 100644 index 0000000000000..dc6280f7b3444 --- /dev/null +++ b/app/code/Magento/Sales/Test/Mftf/Data/CreditMemoData.xml @@ -0,0 +1,17 @@ +<?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="CreditMemo" type="CreditMemo"> + <var key="quote_id" entityKey="return" entityType="CustomerCart"/> + </entity> + +</entities> diff --git a/app/code/Magento/Sales/Test/Mftf/Data/InvoiceData.xml b/app/code/Magento/Sales/Test/Mftf/Data/InvoiceData.xml new file mode 100644 index 0000000000000..b55ef96932100 --- /dev/null +++ b/app/code/Magento/Sales/Test/Mftf/Data/InvoiceData.xml @@ -0,0 +1,17 @@ +<?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="Invoice" type="Invoice"> + <var key="quote_id" entityKey="return" entityType="CustomerCart"/> + </entity> + +</entities> diff --git a/app/code/Magento/Sales/Test/Mftf/Data/ShipmentData.xml b/app/code/Magento/Sales/Test/Mftf/Data/ShipmentData.xml new file mode 100644 index 0000000000000..96d371d3aaf3a --- /dev/null +++ b/app/code/Magento/Sales/Test/Mftf/Data/ShipmentData.xml @@ -0,0 +1,17 @@ +<?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="Shipment" type="Shipment"> + <var key="quote_id" entityKey="return" entityType="CustomerCart"/> + </entity> + +</entities> diff --git a/app/code/Magento/Sales/Test/Mftf/Metadata/CreditMemoMeta.xml b/app/code/Magento/Sales/Test/Mftf/Metadata/CreditMemoMeta.xml new file mode 100644 index 0000000000000..3b500d61b1c35 --- /dev/null +++ b/app/code/Magento/Sales/Test/Mftf/Metadata/CreditMemoMeta.xml @@ -0,0 +1,17 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<operations xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:DataGenerator/etc/dataOperation.xsd"> + <operation name="CreateCreditMemo" dataType="CreditMemo" type="create" auth="adminOauth" url="V1/order/{return}/refund" method="POST"> + <contentType>application/json</contentType> + <object key="cartItem" dataType="CartItem"> + <field key="quote_id">string</field> + </object> + </operation> +</operations> diff --git a/app/code/Magento/Sales/Test/Mftf/Metadata/ShipmentMeta.xml b/app/code/Magento/Sales/Test/Mftf/Metadata/ShipmentMeta.xml new file mode 100644 index 0000000000000..1c9de02c6a2e7 --- /dev/null +++ b/app/code/Magento/Sales/Test/Mftf/Metadata/ShipmentMeta.xml @@ -0,0 +1,17 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<operations xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:DataGenerator/etc/dataOperation.xsd"> + <operation name="CreateShipment" dataType="Shipment" type="create" auth="adminOauth" url="V1/order/{return}/ship" method="POST"> + <contentType>application/json</contentType> + <object key="cartItem" dataType="CartItem"> + <field key="quote_id">string</field> + </object> + </operation> +</operations> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateInvoice.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateInvoice.xml index 51aaa251fa3d9..3dc1c3ed98d03 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateInvoice.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateInvoice.xml @@ -35,10 +35,18 @@ </createData> <updateData createDataKey="createGuestCart" entity="GuestOrderPaymentMethod" stepKey="sendGuestPaymentInformation"> <requiredEntity createDataKey="createGuestCart"/> - </updateData> + </updateData> <createData entity="Invoice" stepKey="invoiceOrder"> <requiredEntity createDataKey="createGuestCart"/> + </createData> + + <createData entity="Shipment" stepKey="shipOrder"> + <requiredEntity createDataKey="createGuestCart"/> + </createData> + + <createData entity="CreditMemo" stepKey="refundMemo"> + <requiredEntity createDataKey="createGuestCart"/> </createData> </before> From 53b85cce1e95a5cfb60db6dc029e551d053e1f14 Mon Sep 17 00:00:00 2001 From: "rostyslav.hymon" <rostyslav.hymon@transoftgroup.com> Date: Tue, 1 Dec 2020 14:00:14 +0200 Subject: [PATCH 100/171] MC-39072: JS error is shown on the checkout --- .../view/frontend/web/template/billing-address/details.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/Checkout/view/frontend/web/template/billing-address/details.html b/app/code/Magento/Checkout/view/frontend/web/template/billing-address/details.html index e4000e2d120f9..6b3de69d1a21d 100644 --- a/app/code/Magento/Checkout/view/frontend/web/template/billing-address/details.html +++ b/app/code/Magento/Checkout/view/frontend/web/template/billing-address/details.html @@ -7,7 +7,7 @@ <div if="isAddressDetailsVisible() && currentBillingAddress()" class="billing-address-details"> <text args="currentBillingAddress().prefix"/> <text args="currentBillingAddress().firstname"/> <text args="currentBillingAddress().middlename"/> <text args="currentBillingAddress().lastname"/> <text args="currentBillingAddress().suffix"/><br/> - <text args="currentBillingAddress().street"/><br/> + <text args="currentBillingAddress().street.join(', ')"/><br/> <text args="currentBillingAddress().city "/>, <span text="currentBillingAddress().region"></span> <text args="currentBillingAddress().postcode"/><br/> <text args="getCountryName(currentBillingAddress().countryId)"/><br/> <a if="currentBillingAddress().telephone" attr="'href': 'tel:' + currentBillingAddress().telephone" text="currentBillingAddress().telephone"></a><br/> From d2ab2f389d64d349dca0ddc3246654c94c806cc3 Mon Sep 17 00:00:00 2001 From: Anna Pak <a.pak@atwix.com> Date: Tue, 1 Dec 2020 14:25:38 +0200 Subject: [PATCH 101/171] AdminCancelTheOrderWithCashOnDeliveryPaymentMethodTest refactoring (in progress) --- .../Quote/Test/Mftf/Data/CustomerCartData.xml | 7 + ...ssOrdersCancelCompleteAndClosedAPITest.xml | 134 ++++++++++++++++++ ...nMassOrdersCancelCompleteAndClosedTest.xml | 7 +- 3 files changed, 146 insertions(+), 2 deletions(-) create mode 100644 app/code/Magento/Sales/Test/Mftf/Test/AdminMassOrdersCancelCompleteAndClosedAPITest.xml diff --git a/app/code/Magento/Quote/Test/Mftf/Data/CustomerCartData.xml b/app/code/Magento/Quote/Test/Mftf/Data/CustomerCartData.xml index a14be3b533fa8..affebbc07ad61 100755 --- a/app/code/Magento/Quote/Test/Mftf/Data/CustomerCartData.xml +++ b/app/code/Magento/Quote/Test/Mftf/Data/CustomerCartData.xml @@ -24,4 +24,11 @@ <requiredEntity type="payment_method">PaymentMethodCheckMoneyOrder</requiredEntity> <requiredEntity type="billing_address">BillingAddressTX</requiredEntity> </entity> + + <entity name="CustomerOrderPaymentMethod" type="CustomerPaymentInformation"> + <var key="cart_id" entityKey="return" entityType="CustomerCart"/> + <requiredEntity type="payment_method">PaymentMethodCheckMoneyOrder</requiredEntity> + <requiredEntity type="billing_address">BillingAddressTX</requiredEntity> + </entity> + </entities> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminMassOrdersCancelCompleteAndClosedAPITest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminMassOrdersCancelCompleteAndClosedAPITest.xml new file mode 100644 index 0000000000000..5ed660b21c6df --- /dev/null +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminMassOrdersCancelCompleteAndClosedAPITest.xml @@ -0,0 +1,134 @@ +<?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="AdminMassOrdersCancelCompleteAndClosedAPITest"> + <annotations> + <stories value="Mass Update Orders"/> + <title value="Mass cancel orders in status Complete, Closed"/> + <description value="Try to cancel orders in status Complete, Closed"/> + <severity value="MAJOR"/> + <testCaseId value="MC-16183"/> + <group value="sales"/> + <group value="mtf_migrated"/> + </annotations> + <before> + <actionGroup ref="AdminLoginActionGroup" stepKey="LoginAsAdmin"/> + + <createData entity="ApiCategory" stepKey="createCategory"/> + + <createData entity="defaultSimpleProduct" stepKey="createSimpleProduct"> + <requiredEntity createDataKey="createCategory"/> + </createData> + + <createData entity="GuestCart" stepKey="createGuestCartOne"/> + <createData entity="SimpleCartItem" stepKey="addCartItemOne"> + <requiredEntity createDataKey="createGuestCartOne"/> + <requiredEntity createDataKey="createSimpleProduct"/> + </createData> + <createData entity="GuestAddressInformation" stepKey="addGuestOrderAddressOne"> + <requiredEntity createDataKey="createGuestCartOne"/> + </createData> + <updateData createDataKey="createGuestCartOne" entity="GuestOrderPaymentMethod" stepKey="sendGuestPaymentInformationOne"> + <requiredEntity createDataKey="createGuestCartOne"/> + </updateData> + + <createData entity="Invoice" stepKey="invoiceOrderOne"> + <requiredEntity createDataKey="createGuestCartOne"/> + </createData> + + <createData entity="Shipment" stepKey="shipOrderOne"> + <requiredEntity createDataKey="createGuestCartOne"/> + </createData> + + + <createData entity="GuestCart" stepKey="createGuestCartTwo"/> + <createData entity="SimpleCartItem" stepKey="addCartItemTwo"> + <requiredEntity createDataKey="createGuestCartTow"/> + <requiredEntity createDataKey="createSimpleProduct"/> + </createData> + <createData entity="GuestAddressInformation" stepKey="addGuestOrderAddressTwo"> + <requiredEntity createDataKey="createGuestCartTwo"/> + </createData> + <updateData createDataKey="createGuestCartTwo" entity="GuestOrderPaymentMethod" stepKey="sendGuestPaymentInformationTwo"> + <requiredEntity createDataKey="createGuestCartTwo"/> + </updateData> + + <createData entity="Invoice" stepKey="invoiceOrderTwo"> + <requiredEntity createDataKey="createGuestCartTwo"/> + </createData> + + <createData entity="CreditMemo" stepKey="refundOrderTwo"> + <requiredEntity createDataKey="createGuestCartTwo"/> + </createData> + + </before> + <after> + <!-- Delete data --> + <deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/> + <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> + <deleteData createDataKey="createSimpleProduct" stepKey="deleteProduct"/> + <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> + </after> + + <!-- Create first order --> + <!-- <actionGroup ref="CreateOrderActionGroup" stepKey="createFirstOrder"> + <argument name="product" value="$$createProduct$$"/> + <argument name="customer" value="$$createCustomer$$"/> + </actionGroup> + <grabTextFrom selector="|Order # (\d+)|" stepKey="getFirstOrderId"/> + <assertNotEmpty stepKey="assertOrderIdIsNotEmpty" after="getFirstOrderId"> + <actualResult type="const">$getFirstOrderId</actualResult> + </assertNotEmpty> --> + + <!-- Create Shipment for first Order --> + <!-- <actionGroup ref="AdminCreateInvoiceAndShipmentActionGroup" stepKey="createShipmentForFirstOrder"/> --> + + <!-- Create second order --> + <!-- <actionGroup ref="CreateOrderActionGroup" stepKey="createSecondOrder"> + <argument name="product" value="$$createProduct$$"/> + <argument name="customer" value="$$createCustomer$$"/> + </actionGroup> + <grabTextFrom selector="|Order # (\d+)|" stepKey="getSecondOrderId"/> + <assertNotEmpty stepKey="assertSecondOrderIdIsNotEmpty" after="getSecondOrderId"> + <actualResult type="const">$getSecondOrderId</actualResult> + </assertNotEmpty> --> + + <!-- Create CreditMemo for second Order --> + <!-- <actionGroup ref="AdminCreateInvoiceAndCreditMemoActionGroup" stepKey="createCreditMemo"/> --> + + <!-- Navigate to backend: Go to Sales > Orders --> + <actionGroup ref="AdminOrdersPageOpenActionGroup" stepKey="onOrderPage"/> + <actionGroup ref="AdminOrdersGridClearFiltersActionGroup" stepKey="clearFilters"/> + + <!-- Select Mass Action according to dataset: Cancel --> + <actionGroup ref="AdminTwoOrderActionOnGridActionGroup" stepKey="massActionCancel"> + <argument name="action" value="Cancel"/> + <argument name="orderId" value="$createGuestCartOne.return$"/> + <argument name="secondOrderId" value="$createGuestCartTwo.return$"/> + </actionGroup> + <see userInput="You cannot cancel the order(s)." stepKey="assertOrderCancelMassActionFailMessage"/> + + <!--Assert first order in orders grid --> + <actionGroup ref="AdminOrderFilterByOrderIdAndStatusActionGroup" stepKey="seeFirstOrder"> + <argument name="orderId" value="$createGuestCartOne.return$"/> + <argument name="orderStatus" value="Complete"/> + </actionGroup> + <see userInput="$createGuestCartOne.return$" selector="{{AdminOrdersGridSection.gridCell('1','ID')}}" stepKey="assertFirstOrderID"/> + <see userInput="Complete" selector="{{AdminOrdersGridSection.gridCell('1','Status')}}" stepKey="assertFirstOrderStatus"/> + + <!--Assert second order in orders grid --> + <actionGroup ref="AdminOrderFilterByOrderIdAndStatusActionGroup" stepKey="seeSecondOrder"> + <argument name="orderId" value="$createGuestCartTwo.return$"/> + <argument name="orderStatus" value="Closed"/> + </actionGroup> + <see userInput="$createGuestCartTwo.return$" selector="{{AdminOrdersGridSection.gridCell('1','ID')}}" stepKey="assertSecondOrderID"/> + <see userInput="Closed" selector="{{AdminOrdersGridSection.gridCell('1','Status')}}" stepKey="assertSecondStatus"/> + </test> +</tests> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminMassOrdersCancelCompleteAndClosedTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminMassOrdersCancelCompleteAndClosedTest.xml index b337af3753db3..793e1a07950c9 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminMassOrdersCancelCompleteAndClosedTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminMassOrdersCancelCompleteAndClosedTest.xml @@ -8,15 +8,18 @@ <tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> - <test name="AdminMassOrdersCancelCompleteAndClosedTest"> + <test name="AdminMassOrdersCancelCompleteAndClosedTest" deprecated="Use AdminMassOrdersCancelCompleteAndClosedAPITest instead"> <annotations> <stories value="Mass Update Orders"/> - <title value="Mass cancel orders in status Complete, Closed"/> + <title value="DEPRECATED. Mass cancel orders in status Complete, Closed"/> <description value="Try to cancel orders in status Complete, Closed"/> <severity value="MAJOR"/> <testCaseId value="MC-16183"/> <group value="sales"/> <group value="mtf_migrated"/> + <skip> + <issueId value="DEPRECATED">Use AdminMassOrdersCancelCompleteAndClosedAPITest instead</issueId> + </skip> </annotations> <before> <actionGroup ref="AdminLoginActionGroup" stepKey="LoginAsAdmin"/> From 72574a8e5e6257f52aecb21df4bcd1f3990f31c9 Mon Sep 17 00:00:00 2001 From: "taras.gamanov" <engcom-vendorworker-hotel@adobe.com> Date: Tue, 1 Dec 2020 14:46:37 +0200 Subject: [PATCH 102/171] "MC-14715: Add bundle dynamic product to the cart" has been updated --- .../StorefrontAddBundleDynamicProductToShoppingCartTest.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontAddBundleDynamicProductToShoppingCartTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontAddBundleDynamicProductToShoppingCartTest.xml index 3c090900563a5..714a06510952f 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontAddBundleDynamicProductToShoppingCartTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontAddBundleDynamicProductToShoppingCartTest.xml @@ -94,7 +94,7 @@ <actionGroup ref="ClickViewAndEditCartFromMiniCartActionGroup" stepKey="selectViewAndEditCart"/> <!--Assert Shopping Cart Summary--> - <actionGroup ref="AssertStorefrontShoppingCartSummaryWithShippingActionGroup" stepKey="AssertCartSummary" > + <actionGroup ref="StorefrontCheckCartActionGroup" stepKey="AssertCartSummary" > <argument name="subtotal" value="$100.00"/> <argument name="shipping" value="10.00"/> <argument name="total" value="110.00"/> From f5ed249e645a73309438fae73f237dbc1cc3aef8 Mon Sep 17 00:00:00 2001 From: "taras.gamanov" <engcom-vendorworker-hotel@adobe.com> Date: Tue, 1 Dec 2020 14:52:16 +0200 Subject: [PATCH 103/171] "MC-14727: Select one multi select option of a bundle product and add to the shopping cart" has been updated --- ...efrontAddOneBundleMultiSelectOptionToTheShoppingCartTest.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontAddOneBundleMultiSelectOptionToTheShoppingCartTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontAddOneBundleMultiSelectOptionToTheShoppingCartTest.xml index eff18f9081b67..cd6f4215adb5d 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontAddOneBundleMultiSelectOptionToTheShoppingCartTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontAddOneBundleMultiSelectOptionToTheShoppingCartTest.xml @@ -88,7 +88,7 @@ <actionGroup ref="ClickViewAndEditCartFromMiniCartActionGroup" stepKey="selectViewAndEditCart"/> <!--Assert Shopping Cart Summary--> - <actionGroup ref="AssertStorefrontShoppingCartSummaryWithShippingActionGroup" stepKey="AssertCartSummary" > + <actionGroup ref="StorefrontCheckCartActionGroup" stepKey="AssertCartSummary" > <argument name="subtotal" value="$50.00"/> <argument name="shipping" value="5.00"/> <argument name="total" value="55.00"/> From 7dcd88bd75b83a0a7016b36738462a2e256d8d20 Mon Sep 17 00:00:00 2001 From: Anna Pak <a.pak@atwix.com> Date: Wed, 2 Dec 2020 10:38:58 +0200 Subject: [PATCH 104/171] added selector AdminOrdersGridSection.orderIdByIncrementId Please enter the commit message for your changes. Lines starting --- .../Mftf/Section/AdminOrdersGridSection.xml | 1 + .../Test/Mftf/Section/OrdersGridSection.xml | 1 + ...ssOrdersCancelCompleteAndClosedAPITest.xml | 27 +++++++++++++------ 3 files changed, 21 insertions(+), 8 deletions(-) diff --git a/app/code/Magento/Sales/Test/Mftf/Section/AdminOrdersGridSection.xml b/app/code/Magento/Sales/Test/Mftf/Section/AdminOrdersGridSection.xml index 02878e79f3d70..55cd30f1caf2e 100644 --- a/app/code/Magento/Sales/Test/Mftf/Section/AdminOrdersGridSection.xml +++ b/app/code/Magento/Sales/Test/Mftf/Section/AdminOrdersGridSection.xml @@ -41,5 +41,6 @@ <element name="viewLink" type="text" selector="//td/div[contains(.,'{{orderID}}')]/../..//a[@class='action-menu-item']" parameterized="true"/> <element name="selectOrderID" type="checkbox" selector="//td/div[text()='{{orderId}}']/../preceding-sibling::td//input" parameterized="true" timeout="60"/> <element name="orderId" type="text" selector="//table[contains(@class, 'data-grid')]//div[contains(text(), '{{orderId}}')]" parameterized="true"/> + <element name="orderIdByIncrementId" type="text" selector="//input[@class='admin__control-checkbox' and @value={{incrId}}]/parent::label/parent::td/following-sibling::td" parameterized="true"/> </section> </sections> diff --git a/app/code/Magento/Sales/Test/Mftf/Section/OrdersGridSection.xml b/app/code/Magento/Sales/Test/Mftf/Section/OrdersGridSection.xml index a6b856f9f814f..02e11ec62e949 100644 --- a/app/code/Magento/Sales/Test/Mftf/Section/OrdersGridSection.xml +++ b/app/code/Magento/Sales/Test/Mftf/Section/OrdersGridSection.xml @@ -30,5 +30,6 @@ <element name="removeItems" type="select" selector="//span[text()='{{arg}}']/parent::td/following-sibling::td/select[@class='admin__control-select']" parameterized="true"/> <element name="applyCoupon" type="input" selector="#coupons:code"/> <element name="submitOrder" type="button" selector="#submit_order_top_button" timeout="60"/> + </section> </sections> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminMassOrdersCancelCompleteAndClosedAPITest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminMassOrdersCancelCompleteAndClosedAPITest.xml index 5ed660b21c6df..e0ecab5947bfb 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminMassOrdersCancelCompleteAndClosedAPITest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminMassOrdersCancelCompleteAndClosedAPITest.xml @@ -50,7 +50,7 @@ <createData entity="GuestCart" stepKey="createGuestCartTwo"/> <createData entity="SimpleCartItem" stepKey="addCartItemTwo"> - <requiredEntity createDataKey="createGuestCartTow"/> + <requiredEntity createDataKey="createGuestCartTwo"/> <requiredEntity createDataKey="createSimpleProduct"/> </createData> <createData entity="GuestAddressInformation" stepKey="addGuestOrderAddressTwo"> @@ -71,7 +71,6 @@ </before> <after> <!-- Delete data --> - <deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/> <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> <deleteData createDataKey="createSimpleProduct" stepKey="deleteProduct"/> <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> @@ -103,32 +102,44 @@ <!-- Create CreditMemo for second Order --> <!-- <actionGroup ref="AdminCreateInvoiceAndCreditMemoActionGroup" stepKey="createCreditMemo"/> --> + <!-- <actionGroup ref="AdminOpenOrderByEntityIdActionGroup" stepKey="openOrderOne"> + <argument name="entityId" value="$createGuestCartOne.return$"/> + </actionGroup> + <grabTextFrom selector="|Order # (\d+)|" stepKey="getOrderOneId"/> + + <actionGroup ref="AdminOpenOrderByEntityIdActionGroup" stepKey="openOrderTwo"> + <argument name="entityId" value="$createGuestCartTwo.return$"/> + </actionGroup> --> + <!-- Navigate to backend: Go to Sales > Orders --> <actionGroup ref="AdminOrdersPageOpenActionGroup" stepKey="onOrderPage"/> <actionGroup ref="AdminOrdersGridClearFiltersActionGroup" stepKey="clearFilters"/> + <grabTextFrom selector="{{AdminOrdersGridSection.orderIdByIncrementId($createGuestCartOne.return$)}}" stepKey="getOrderOneId"/> + <grabTextFrom selector="{{AdminOrdersGridSection.orderIdByIncrementId($createGuestCartTwo.return$)}}" stepKey="getOrderTwoId"/> + <!-- Select Mass Action according to dataset: Cancel --> <actionGroup ref="AdminTwoOrderActionOnGridActionGroup" stepKey="massActionCancel"> <argument name="action" value="Cancel"/> - <argument name="orderId" value="$createGuestCartOne.return$"/> - <argument name="secondOrderId" value="$createGuestCartTwo.return$"/> + <argument name="orderId" value="$getOrderOneId"/> + <argument name="secondOrderId" value="$getOrderTwoId"/> </actionGroup> <see userInput="You cannot cancel the order(s)." stepKey="assertOrderCancelMassActionFailMessage"/> <!--Assert first order in orders grid --> <actionGroup ref="AdminOrderFilterByOrderIdAndStatusActionGroup" stepKey="seeFirstOrder"> - <argument name="orderId" value="$createGuestCartOne.return$"/> + <argument name="orderId" value="$getOrderOneId"/> <argument name="orderStatus" value="Complete"/> </actionGroup> - <see userInput="$createGuestCartOne.return$" selector="{{AdminOrdersGridSection.gridCell('1','ID')}}" stepKey="assertFirstOrderID"/> + <see userInput="$getOrderOneId" selector="{{AdminOrdersGridSection.gridCell('1','ID')}}" stepKey="assertFirstOrderID"/> <see userInput="Complete" selector="{{AdminOrdersGridSection.gridCell('1','Status')}}" stepKey="assertFirstOrderStatus"/> <!--Assert second order in orders grid --> <actionGroup ref="AdminOrderFilterByOrderIdAndStatusActionGroup" stepKey="seeSecondOrder"> - <argument name="orderId" value="$createGuestCartTwo.return$"/> + <argument name="orderId" value="$getOrderTwoId"/> <argument name="orderStatus" value="Closed"/> </actionGroup> - <see userInput="$createGuestCartTwo.return$" selector="{{AdminOrdersGridSection.gridCell('1','ID')}}" stepKey="assertSecondOrderID"/> + <see userInput="$getOrderTwoId" selector="{{AdminOrdersGridSection.gridCell('1','ID')}}" stepKey="assertSecondOrderID"/> <see userInput="Closed" selector="{{AdminOrdersGridSection.gridCell('1','Status')}}" stepKey="assertSecondStatus"/> </test> </tests> From 732c6ff48720740fa0e399f2b1d85b198dd41c9e Mon Sep 17 00:00:00 2001 From: Anna Pak <a.pak@atwix.com> Date: Wed, 2 Dec 2020 12:07:37 +0200 Subject: [PATCH 105/171] refactored --- ...ssOrdersCancelCompleteAndClosedAPITest.xml | 42 +------------------ 1 file changed, 1 insertion(+), 41 deletions(-) diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminMassOrdersCancelCompleteAndClosedAPITest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminMassOrdersCancelCompleteAndClosedAPITest.xml index e0ecab5947bfb..85f2fde4d1871 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminMassOrdersCancelCompleteAndClosedAPITest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminMassOrdersCancelCompleteAndClosedAPITest.xml @@ -47,7 +47,6 @@ <requiredEntity createDataKey="createGuestCartOne"/> </createData> - <createData entity="GuestCart" stepKey="createGuestCartTwo"/> <createData entity="SimpleCartItem" stepKey="addCartItemTwo"> <requiredEntity createDataKey="createGuestCartTwo"/> @@ -69,56 +68,19 @@ </createData> </before> + <after> - <!-- Delete data --> <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> <deleteData createDataKey="createSimpleProduct" stepKey="deleteProduct"/> <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> </after> - <!-- Create first order --> - <!-- <actionGroup ref="CreateOrderActionGroup" stepKey="createFirstOrder"> - <argument name="product" value="$$createProduct$$"/> - <argument name="customer" value="$$createCustomer$$"/> - </actionGroup> - <grabTextFrom selector="|Order # (\d+)|" stepKey="getFirstOrderId"/> - <assertNotEmpty stepKey="assertOrderIdIsNotEmpty" after="getFirstOrderId"> - <actualResult type="const">$getFirstOrderId</actualResult> - </assertNotEmpty> --> - - <!-- Create Shipment for first Order --> - <!-- <actionGroup ref="AdminCreateInvoiceAndShipmentActionGroup" stepKey="createShipmentForFirstOrder"/> --> - - <!-- Create second order --> - <!-- <actionGroup ref="CreateOrderActionGroup" stepKey="createSecondOrder"> - <argument name="product" value="$$createProduct$$"/> - <argument name="customer" value="$$createCustomer$$"/> - </actionGroup> - <grabTextFrom selector="|Order # (\d+)|" stepKey="getSecondOrderId"/> - <assertNotEmpty stepKey="assertSecondOrderIdIsNotEmpty" after="getSecondOrderId"> - <actualResult type="const">$getSecondOrderId</actualResult> - </assertNotEmpty> --> - - <!-- Create CreditMemo for second Order --> - <!-- <actionGroup ref="AdminCreateInvoiceAndCreditMemoActionGroup" stepKey="createCreditMemo"/> --> - - <!-- <actionGroup ref="AdminOpenOrderByEntityIdActionGroup" stepKey="openOrderOne"> - <argument name="entityId" value="$createGuestCartOne.return$"/> - </actionGroup> - <grabTextFrom selector="|Order # (\d+)|" stepKey="getOrderOneId"/> - - <actionGroup ref="AdminOpenOrderByEntityIdActionGroup" stepKey="openOrderTwo"> - <argument name="entityId" value="$createGuestCartTwo.return$"/> - </actionGroup> --> - - <!-- Navigate to backend: Go to Sales > Orders --> <actionGroup ref="AdminOrdersPageOpenActionGroup" stepKey="onOrderPage"/> <actionGroup ref="AdminOrdersGridClearFiltersActionGroup" stepKey="clearFilters"/> <grabTextFrom selector="{{AdminOrdersGridSection.orderIdByIncrementId($createGuestCartOne.return$)}}" stepKey="getOrderOneId"/> <grabTextFrom selector="{{AdminOrdersGridSection.orderIdByIncrementId($createGuestCartTwo.return$)}}" stepKey="getOrderTwoId"/> - <!-- Select Mass Action according to dataset: Cancel --> <actionGroup ref="AdminTwoOrderActionOnGridActionGroup" stepKey="massActionCancel"> <argument name="action" value="Cancel"/> <argument name="orderId" value="$getOrderOneId"/> @@ -126,7 +88,6 @@ </actionGroup> <see userInput="You cannot cancel the order(s)." stepKey="assertOrderCancelMassActionFailMessage"/> - <!--Assert first order in orders grid --> <actionGroup ref="AdminOrderFilterByOrderIdAndStatusActionGroup" stepKey="seeFirstOrder"> <argument name="orderId" value="$getOrderOneId"/> <argument name="orderStatus" value="Complete"/> @@ -134,7 +95,6 @@ <see userInput="$getOrderOneId" selector="{{AdminOrdersGridSection.gridCell('1','ID')}}" stepKey="assertFirstOrderID"/> <see userInput="Complete" selector="{{AdminOrdersGridSection.gridCell('1','Status')}}" stepKey="assertFirstOrderStatus"/> - <!--Assert second order in orders grid --> <actionGroup ref="AdminOrderFilterByOrderIdAndStatusActionGroup" stepKey="seeSecondOrder"> <argument name="orderId" value="$getOrderTwoId"/> <argument name="orderStatus" value="Closed"/> From a70dfc91c5842aa8ae497912ac91ca2ca93f5020 Mon Sep 17 00:00:00 2001 From: Anna Pak <a.pak@atwix.com> Date: Wed, 2 Dec 2020 12:27:56 +0200 Subject: [PATCH 106/171] refactored --- .../Quote/Test/Mftf/Data/CustomerCartData.xml | 6 -- .../Test/Mftf/Metadata/CreditMemoMeta.xml | 2 +- .../Test/Mftf/Section/OrdersGridSection.xml | 1 - .../Test/Mftf/Test/AdminCreateInvoice.xml | 62 ------------------- ...ssOrdersCancelCompleteAndClosedAPITest.xml | 2 + 5 files changed, 3 insertions(+), 70 deletions(-) delete mode 100644 app/code/Magento/Sales/Test/Mftf/Test/AdminCreateInvoice.xml diff --git a/app/code/Magento/Quote/Test/Mftf/Data/CustomerCartData.xml b/app/code/Magento/Quote/Test/Mftf/Data/CustomerCartData.xml index affebbc07ad61..8c76c4d0dc31a 100755 --- a/app/code/Magento/Quote/Test/Mftf/Data/CustomerCartData.xml +++ b/app/code/Magento/Quote/Test/Mftf/Data/CustomerCartData.xml @@ -25,10 +25,4 @@ <requiredEntity type="billing_address">BillingAddressTX</requiredEntity> </entity> - <entity name="CustomerOrderPaymentMethod" type="CustomerPaymentInformation"> - <var key="cart_id" entityKey="return" entityType="CustomerCart"/> - <requiredEntity type="payment_method">PaymentMethodCheckMoneyOrder</requiredEntity> - <requiredEntity type="billing_address">BillingAddressTX</requiredEntity> - </entity> - </entities> diff --git a/app/code/Magento/Sales/Test/Mftf/Metadata/CreditMemoMeta.xml b/app/code/Magento/Sales/Test/Mftf/Metadata/CreditMemoMeta.xml index 3b500d61b1c35..b051c91ba3b10 100644 --- a/app/code/Magento/Sales/Test/Mftf/Metadata/CreditMemoMeta.xml +++ b/app/code/Magento/Sales/Test/Mftf/Metadata/CreditMemoMeta.xml @@ -11,7 +11,7 @@ <operation name="CreateCreditMemo" dataType="CreditMemo" type="create" auth="adminOauth" url="V1/order/{return}/refund" method="POST"> <contentType>application/json</contentType> <object key="cartItem" dataType="CartItem"> - <field key="quote_id">string</field> + <field key="quote_id">string</field> </object> </operation> </operations> diff --git a/app/code/Magento/Sales/Test/Mftf/Section/OrdersGridSection.xml b/app/code/Magento/Sales/Test/Mftf/Section/OrdersGridSection.xml index 02e11ec62e949..a6b856f9f814f 100644 --- a/app/code/Magento/Sales/Test/Mftf/Section/OrdersGridSection.xml +++ b/app/code/Magento/Sales/Test/Mftf/Section/OrdersGridSection.xml @@ -30,6 +30,5 @@ <element name="removeItems" type="select" selector="//span[text()='{{arg}}']/parent::td/following-sibling::td/select[@class='admin__control-select']" parameterized="true"/> <element name="applyCoupon" type="input" selector="#coupons:code"/> <element name="submitOrder" type="button" selector="#submit_order_top_button" timeout="60"/> - </section> </sections> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateInvoice.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateInvoice.xml deleted file mode 100644 index 3dc1c3ed98d03..0000000000000 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateInvoice.xml +++ /dev/null @@ -1,62 +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="AdminCreateInvoice"> - <annotations> - <features value="Sales"/> - <stories value="1Create an Invoice via the Admin"/> - <title value="1111Admin should be able to create an invoice"/> - <description value="1Admin should be able to create an invoice"/> - <severity value="MAJOR"/> - <testCaseId value="1MAGETWO-72096"/> - <group value="sales"/> - </annotations> - <before> - <createData entity="ApiCategory" stepKey="createCategory"/> - - <createData entity="defaultSimpleProduct" stepKey="createConfigProduct"> - <requiredEntity createDataKey="createCategory"/> - </createData> - - <createData entity="GuestCart" stepKey="createGuestCart"/> - <createData entity="SimpleCartItem" stepKey="addCartItem"> - <requiredEntity createDataKey="createGuestCart"/> - <requiredEntity createDataKey="createConfigProduct"/> - </createData> - <createData entity="GuestAddressInformation" stepKey="addGuestOrderAddress"> - <requiredEntity createDataKey="createGuestCart"/> - </createData> - <updateData createDataKey="createGuestCart" entity="GuestOrderPaymentMethod" stepKey="sendGuestPaymentInformation"> - <requiredEntity createDataKey="createGuestCart"/> - </updateData> - - <createData entity="Invoice" stepKey="invoiceOrder"> - <requiredEntity createDataKey="createGuestCart"/> - </createData> - - <createData entity="Shipment" stepKey="shipOrder"> - <requiredEntity createDataKey="createGuestCart"/> - </createData> - - <createData entity="CreditMemo" stepKey="refundMemo"> - <requiredEntity createDataKey="createGuestCart"/> - </createData> - - </before> - <after> - <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> - <deleteData createDataKey="createConfigProduct" stepKey="deleteConfigProduct"/> - <actionGroup ref="AdminLogoutActionGroup" stepKey="amOnLogoutPage"/> - </after> - - <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> - - </test> -</tests> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminMassOrdersCancelCompleteAndClosedAPITest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminMassOrdersCancelCompleteAndClosedAPITest.xml index 85f2fde4d1871..5cb54f0fd5613 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminMassOrdersCancelCompleteAndClosedAPITest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminMassOrdersCancelCompleteAndClosedAPITest.xml @@ -18,7 +18,9 @@ <group value="sales"/> <group value="mtf_migrated"/> </annotations> + <before> + <actionGroup ref="AdminLoginActionGroup" stepKey="LoginAsAdmin"/> <createData entity="ApiCategory" stepKey="createCategory"/> From a5dd5e99039e17705a42297b14a9a40fcd11d96f Mon Sep 17 00:00:00 2001 From: Anna Pak <a.pak@atwix.com> Date: Wed, 2 Dec 2020 12:29:18 +0200 Subject: [PATCH 107/171] refactored --- app/code/Magento/Quote/Test/Mftf/Data/CustomerCartData.xml | 1 - 1 file changed, 1 deletion(-) diff --git a/app/code/Magento/Quote/Test/Mftf/Data/CustomerCartData.xml b/app/code/Magento/Quote/Test/Mftf/Data/CustomerCartData.xml index 8c76c4d0dc31a..a14be3b533fa8 100755 --- a/app/code/Magento/Quote/Test/Mftf/Data/CustomerCartData.xml +++ b/app/code/Magento/Quote/Test/Mftf/Data/CustomerCartData.xml @@ -24,5 +24,4 @@ <requiredEntity type="payment_method">PaymentMethodCheckMoneyOrder</requiredEntity> <requiredEntity type="billing_address">BillingAddressTX</requiredEntity> </entity> - </entities> From dfad73dbca641d405970f024d53856475be5c242 Mon Sep 17 00:00:00 2001 From: Sergio Vera <svera@adobe.com> Date: Wed, 2 Dec 2020 11:49:04 +0100 Subject: [PATCH 108/171] MC-39542: Change LiveCodeTest php stability test - Check for PHP compatibility using lowest and highest supported PHP versions --- .../Magento/Test/Php/LiveCodeTest.php | 29 ++++++++++++------- 1 file changed, 19 insertions(+), 10 deletions(-) diff --git a/dev/tests/static/testsuite/Magento/Test/Php/LiveCodeTest.php b/dev/tests/static/testsuite/Magento/Test/Php/LiveCodeTest.php index aa1f8b1c259a4..f294e2c2f55e1 100644 --- a/dev/tests/static/testsuite/Magento/Test/Php/LiveCodeTest.php +++ b/dev/tests/static/testsuite/Magento/Test/Php/LiveCodeTest.php @@ -209,14 +209,14 @@ private function getFullWhitelist() } /** - * Retrieves the lowest PHP version specified in <kbd>composer.json</var> of project. + * Retrieves the lowest and highest PHP version specified in <kbd>composer.json</var> of project. * - * @return string + * @return array */ - private function getLowestPhpVersion(): string + private function getTargetPhpVersions(): array { $composerJson = json_decode(file_get_contents(BP . '/composer.json'), true); - $phpVersion = '7.0'; + $versionsRange = []; if (isset($composerJson['require']['php'])) { $versions = explode('||', $composerJson['require']['php']); @@ -232,12 +232,17 @@ private function getLowestPhpVersion(): string //sort versions usort($versions, 'version_compare'); - $lowestVersion = array_shift($versions); - $versionParts = explode('.', $lowestVersion); - $phpVersion = sprintf('%s.%s', $versionParts[0], $versionParts[1] ?? '0'); + $versionsRange[] = array_shift($versions); + if (!empty($versions)) { + $versionsRange[] = array_pop($versions); + } + foreach ($versionsRange as $key => $version) { + $versionParts = explode('.', $versionsRange[$key]); + $versionsRange[$key] = sprintf('%s.%s', $versionParts[0], $versionParts[1] ?? '0'); + } } - return $phpVersion; + return $versionsRange; } /** @@ -408,7 +413,7 @@ public function testStrictTypes() */ public function testPhpCompatibility() { - $targetVersion = $this->getLowestPhpVersion(); + $targetVersions = $this->getTargetPhpVersions(); $reportFile = self::$reportDir . '/phpcompatibility_report.txt'; $rulesetDir = __DIR__ . '/_files/PHPCompatibilityMagento'; @@ -417,7 +422,11 @@ public function testPhpCompatibility() } $codeSniffer = new PhpCompatibility($rulesetDir, $reportFile, new Wrapper()); - $codeSniffer->setTestVersion($targetVersion); + if (count($targetVersions) > 1) { + $codeSniffer->setTestVersion($targetVersions[0] . '-' . $targetVersions[1]); + } else { + $codeSniffer->setTestVersion($targetVersions[0]); + } $result = $codeSniffer->run( $this->isFullScan() ? $this->getFullWhitelist() : self::getWhitelist(['php', 'phtml']) From 8e1a0aef98b3e6fe3cb6c68c483ac0a22007cf46 Mon Sep 17 00:00:00 2001 From: Sergiy Vasiutynskyi <s.vasiutynskyi@atwix.com> Date: Wed, 2 Dec 2020 17:10:16 +0200 Subject: [PATCH 109/171] Removed usage or changed value of CliIndexerReindexActionGroup action group for Bundle, BundleImportExport, CatalogUrlRewrite, ConfigurableProduct modules --- .../Mftf/Test/AdminAssociateBundleProductToWebsitesTest.xml | 5 +---- .../Mftf/Test/AdminDeleteBundleDynamicPriceProductTest.xml | 4 +--- .../Test/Mftf/Test/MassEnableDisableBundleProductsTest.xml | 4 +--- ...frontAddBundleProductWithZeroPriceToShoppingCartTest.xml | 2 +- ...StorefrontCustomerSearchBundleProductsByKeywordsTest.xml | 2 +- .../Mftf/Test/StorefrontSortBundleProductsByPriceTest.xml | 2 +- ...ynamicBundleProductPricesForCombinationOfOptionsTest.xml | 2 +- .../Test/Mftf/Test/UpdateBundleProductViaImportTest.xml | 6 ++---- .../Test/StorefrontCategoryUrlRewriteDifferentStoreTest.xml | 4 +--- .../Test/Mftf/Test/AdminConfigurableProductLongSkuTest.xml | 4 +--- .../Test/AdminCreateConfigurableProductWithImagesTest.xml | 5 +---- .../Test/Mftf/Test/EndToEndB2CLoggedInUserTest.xml | 4 +--- .../Test/StorefrontConfigurableProductChildSearchTest.xml | 4 +--- .../StorefrontConfigurableProductGridViewTest.xml | 4 +--- ...nfigurableProductChildAssignedToSeparateCategoryTest.xml | 4 +--- ...tingByPriceForConfigurableWithCatalogRuleAppliedTest.xml | 4 +--- ...efrontVerifyConfigurableProductLayeredNavigationTest.xml | 5 +---- .../Test/StorefrontVisibilityOfDuplicateProductTest.xml | 4 +--- 18 files changed, 19 insertions(+), 50 deletions(-) diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/AdminAssociateBundleProductToWebsitesTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/AdminAssociateBundleProductToWebsitesTest.xml index f73941c375a41..8818fadc1d10c 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/AdminAssociateBundleProductToWebsitesTest.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/AdminAssociateBundleProductToWebsitesTest.xml @@ -42,10 +42,7 @@ <requiredEntity createDataKey="createSimpleProduct"/> </createData> - <!-- Reindex --> - <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> - <argument name="indices" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> <!-- Login as admin --> <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/AdminDeleteBundleDynamicPriceProductTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/AdminDeleteBundleDynamicPriceProductTest.xml index 8b50fffec091f..6924e389451cd 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/AdminDeleteBundleDynamicPriceProductTest.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/AdminDeleteBundleDynamicPriceProductTest.xml @@ -36,9 +36,7 @@ <requiredEntity createDataKey="createSimpleProduct"/> </createData> <!-- TODO: Remove this action when MC-37719 will be fixed --> - <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindexInvalidatedIndices"> - <argument name="indices" value="cataloginventory_stock"/> - </actionGroup> + <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindexInvalidatedIndices"/> <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> </before> <after> diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/MassEnableDisableBundleProductsTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/MassEnableDisableBundleProductsTest.xml index f8f98384ee8da..0474de1144f4e 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/MassEnableDisableBundleProductsTest.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/MassEnableDisableBundleProductsTest.xml @@ -133,9 +133,7 @@ <click selector="{{AdminProductFiltersSection.enable}}" stepKey="ClickOnEnable"/> <!--Clear Cache - reindex - resets products according to enabled/disabled view--> - <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> - <argument name="indices" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> <argument name="tags" value=""/> </actionGroup> diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontAddBundleProductWithZeroPriceToShoppingCartTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontAddBundleProductWithZeroPriceToShoppingCartTest.xml index 93fac3171e9fb..b68171ba49825 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontAddBundleProductWithZeroPriceToShoppingCartTest.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontAddBundleProductWithZeroPriceToShoppingCartTest.xml @@ -41,7 +41,7 @@ <requiredEntity createDataKey="apiSimple"/> </createData> <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> - <argument name="indices" value=""/> + <argument name="indices" value="cataloginventory_stock"/> </actionGroup> </before> <after> diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontCustomerSearchBundleProductsByKeywordsTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontCustomerSearchBundleProductsByKeywordsTest.xml index 5997cdc14ade8..52cd91385a4b2 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontCustomerSearchBundleProductsByKeywordsTest.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontCustomerSearchBundleProductsByKeywordsTest.xml @@ -40,7 +40,7 @@ <requiredEntity createDataKey="createSimpleProductTwo"/> </createData> <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> - <argument name="indices" value=""/> + <argument name="indices" value="cataloginventory_stock"/> </actionGroup> </before> <after> diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontSortBundleProductsByPriceTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontSortBundleProductsByPriceTest.xml index 7049299987dff..d127f18355643 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontSortBundleProductsByPriceTest.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontSortBundleProductsByPriceTest.xml @@ -96,7 +96,7 @@ <!-- Perform CLI reindex --> <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> - <argument name="indices" value=""/> + <argument name="indices" value="cataloginventory_stock catalog_product_price"/> </actionGroup> </before> <after> diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontVerifyDynamicBundleProductPricesForCombinationOfOptionsTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontVerifyDynamicBundleProductPricesForCombinationOfOptionsTest.xml index 24c481c9ddcb2..3a7550b1484f0 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontVerifyDynamicBundleProductPricesForCombinationOfOptionsTest.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontVerifyDynamicBundleProductPricesForCombinationOfOptionsTest.xml @@ -168,7 +168,7 @@ <see userInput="You saved the configuration." selector="{{AdminCategoryMessagesSection.SuccessMessage}}" stepKey="seeSuccess"/> <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> - <argument name="indices" value=""/> + <argument name="indices" value="cataloginventory_stock"/> </actionGroup> </before> <after> diff --git a/app/code/Magento/BundleImportExport/Test/Mftf/Test/UpdateBundleProductViaImportTest.xml b/app/code/Magento/BundleImportExport/Test/Mftf/Test/UpdateBundleProductViaImportTest.xml index 515c2bc56f067..6ddce634ec957 100644 --- a/app/code/Magento/BundleImportExport/Test/Mftf/Test/UpdateBundleProductViaImportTest.xml +++ b/app/code/Magento/BundleImportExport/Test/Mftf/Test/UpdateBundleProductViaImportTest.xml @@ -42,7 +42,7 @@ <argument name="tags" value="full_page"/> </actionGroup> <actionGroup ref="CliIndexerReindexActionGroup" stepKey="indexerReindexAfterCreate"> - <argument name="indices" value=""/> + <argument name="indices" value="catalog_product_price"/> </actionGroup> <!-- Check Bundle product is visible on the storefront--> @@ -63,9 +63,7 @@ <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCacheAfterUpdate"> <argument name="tags" value="full_page"/> </actionGroup> - <actionGroup ref="CliIndexerReindexActionGroup" stepKey="indexerReindexAfterUpdate"> - <argument name="indices" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="indexerReindexAfterUpdate"/> <!-- Check Bundle product is still visible on the storefront--> <actionGroup ref="StorefrontGoToCategoryPageActionGroup" stepKey="openCategoryPageAfterUpdate"> diff --git a/app/code/Magento/CatalogUrlRewrite/Test/Mftf/Test/StorefrontCategoryUrlRewriteDifferentStoreTest.xml b/app/code/Magento/CatalogUrlRewrite/Test/Mftf/Test/StorefrontCategoryUrlRewriteDifferentStoreTest.xml index 776b5b9b70f33..783d9fa31c996 100644 --- a/app/code/Magento/CatalogUrlRewrite/Test/Mftf/Test/StorefrontCategoryUrlRewriteDifferentStoreTest.xml +++ b/app/code/Magento/CatalogUrlRewrite/Test/Mftf/Test/StorefrontCategoryUrlRewriteDifferentStoreTest.xml @@ -31,9 +31,7 @@ <argument name="storeView" value="customStoreFR"/> </actionGroup> - <actionGroup ref="CliIndexerReindexActionGroup" stepKey="indexerReindexAfterCreate"> - <argument name="indices" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="indexerReindexAfterCreate"/> <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCacheBefore"> <argument name="tags" value=""/> </actionGroup> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductLongSkuTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductLongSkuTest.xml index f8cd1760788a8..4915a17c738a4 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductLongSkuTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductLongSkuTest.xml @@ -91,9 +91,7 @@ <see selector="{{AdminProductFormConfigurationsSection.currentVariationsPriceCells}}" userInput="{{ProductWithLongNameSku.price}}" stepKey="seeConfigurationsPrice"/> <!--Run re-index task--> - <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> - <argument name="indices" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> <!--Assert storefront category list page--> <amOnPage url="/" stepKey="amOnStorefront"/> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductWithImagesTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductWithImagesTest.xml index 120734d679d09..4984d296df5d0 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductWithImagesTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductWithImagesTest.xml @@ -131,10 +131,7 @@ <!-- Save product --> <actionGroup ref="SaveConfigurableProductAddToCurrentAttributeSetActionGroup" stepKey="saveProduct"/> - <!--Run re-index task--> - <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> - <argument name="indices" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> <!-- Assert configurable product in category --> <amOnPage url="$$createCategory.name$$.html" stepKey="amOnCategoryPage"/> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/EndToEndB2CLoggedInUserTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/EndToEndB2CLoggedInUserTest.xml index e34bf7c22f06b..1b8dffbd3ac68 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/EndToEndB2CLoggedInUserTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/EndToEndB2CLoggedInUserTest.xml @@ -78,9 +78,7 @@ <!-- Reindex invalidated indices after product attribute has been created/deleted --> <magentoCron groups="index" stepKey="reindexInvalidatedIndices"/> - <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindexAll"> - <argument name="indices" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindexAll"/> <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> <argument name="tags" value=""/> </actionGroup> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontConfigurableProductChildSearchTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontConfigurableProductChildSearchTest.xml index 4ad2d0dc936eb..ca3065c13ea67 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontConfigurableProductChildSearchTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontConfigurableProductChildSearchTest.xml @@ -144,9 +144,7 @@ <magentoCron groups="index" stepKey="reindexInvalidatedIndices"/> </after> - <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindexAll"> - <argument name="indices" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindexAll"/> <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> <argument name="tags" value=""/> </actionGroup> 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 e20a6dcfa09b8..81a083c5da068 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontConfigurableProductViewTest/StorefrontConfigurableProductGridViewTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontConfigurableProductViewTest/StorefrontConfigurableProductGridViewTest.xml @@ -27,9 +27,7 @@ <argument name="category" value="$$createCategory$$"/> </actionGroup> <!-- TODO: REMOVE AFTER FIX MC-21717 --> - <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> - <argument name="indices" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> <argument name="tags" value="eav"/> </actionGroup> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontShouldSeeOnlyConfigurableProductChildAssignedToSeparateCategoryTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontShouldSeeOnlyConfigurableProductChildAssignedToSeparateCategoryTest.xml index 3519503c1e287..65ba89d5efb1f 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontShouldSeeOnlyConfigurableProductChildAssignedToSeparateCategoryTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontShouldSeeOnlyConfigurableProductChildAssignedToSeparateCategoryTest.xml @@ -112,9 +112,7 @@ <argument name="categoryName" value="$$secondCategory.name$$"/> </actionGroup> - <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindexSearchIndex"> - <argument name="indices" value="catalogsearch_fulltext"/> - </actionGroup> + <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindexSearchIndex"/> <!-- Go to storefront to view child product --> <actionGroup ref="StorefrontNavigateCategoryPageActionGroup" stepKey="goToSecondCategoryStorefront"> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontSortingByPriceForConfigurableWithCatalogRuleAppliedTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontSortingByPriceForConfigurableWithCatalogRuleAppliedTest.xml index 363a8ea4d4fd6..9cbe134116e51 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontSortingByPriceForConfigurableWithCatalogRuleAppliedTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontSortingByPriceForConfigurableWithCatalogRuleAppliedTest.xml @@ -153,9 +153,7 @@ <argument name="discountAmount" value="{{CatalogRuleByPercentWith96Amount.discount_amount}}"/> </actionGroup> <actionGroup ref="AdminCatalogPriceRuleSaveAndApplyActionGroup" stepKey="saveAndApplyCatalogPriceRule"/> - <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindexIndices"> - <argument name="indices" value="catalogsearch_fulltext catalog_category_product catalog_product_price catalogrule_rule"/> - </actionGroup> + <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindexIndices"/> <actionGroup ref="CliCacheCleanActionGroup" stepKey="fullCache"> <argument name="tags" value="full_page"/> </actionGroup> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontVerifyConfigurableProductLayeredNavigationTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontVerifyConfigurableProductLayeredNavigationTest.xml index 9b046d5c71cfc..c5a40be952e2a 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontVerifyConfigurableProductLayeredNavigationTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontVerifyConfigurableProductLayeredNavigationTest.xml @@ -136,10 +136,7 @@ <actionGroup ref="AdminProductFormSaveActionGroup" stepKey="clickOnSaveButton"/> <see selector="{{AdminCategoryMessagesSection.SuccessMessage}}" userInput="You saved the product." stepKey="messageYouSavedTheProductIsShown"/> - <!--Run re-index task--> - <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> - <argument name="indices" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> <!--Open Category in Store Front and select product attribute option from sidebar --> <actionGroup ref="SelectStorefrontSideBarAttributeOption" stepKey="selectStorefrontProductAttributeOption"> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontVisibilityOfDuplicateProductTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontVisibilityOfDuplicateProductTest.xml index 79705e679fb78..8cd4489ba2a36 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontVisibilityOfDuplicateProductTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontVisibilityOfDuplicateProductTest.xml @@ -192,9 +192,7 @@ <click selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="generateConfigsForDuplicatedProduct"/> <waitForPageLoad stepKey="waitForDuplicatedProductPageLoad"/> <actionGroup ref="SaveProductFormActionGroup" stepKey="saveDuplicatedProduct"/> - <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> - <argument name="indices" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> <argument name="tags" value=""/> </actionGroup> From 19c7e10ccb0b6b6f43dd7931394ca0156c756c8b Mon Sep 17 00:00:00 2001 From: saphaljha <saphal.jha@krishtechnolabs.com> Date: Wed, 2 Dec 2020 23:03:56 +0530 Subject: [PATCH 110/171] Removed header from group product grid --- .../Ui/DataProvider/Product/Form/Modifier/Grouped.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/code/Magento/GroupedProduct/Ui/DataProvider/Product/Form/Modifier/Grouped.php b/app/code/Magento/GroupedProduct/Ui/DataProvider/Product/Form/Modifier/Grouped.php index 3ea8c6eb3c2b9..12a21a4ebd04b 100644 --- a/app/code/Magento/GroupedProduct/Ui/DataProvider/Product/Form/Modifier/Grouped.php +++ b/app/code/Magento/GroupedProduct/Ui/DataProvider/Product/Form/Modifier/Grouped.php @@ -562,6 +562,7 @@ protected function fillMeta() 'fit' => true, 'label' => __('Thumbnail'), 'sortOrder' => 20, + 'labelVisible' => false, ], ], ], @@ -586,6 +587,7 @@ protected function fillMeta() 'validation' => [ 'validate-number' => true, ], + 'labelVisible' => false, ], ], ], @@ -601,7 +603,8 @@ protected function fillMeta() 'elementTmpl' => 'Magento_GroupedProduct/components/position', 'sortOrder' => 90, 'fit' => true, - 'dataScope' => 'positionCalculated' + 'dataScope' => 'positionCalculated', + 'labelVisible' => false, ], ], ], @@ -660,6 +663,7 @@ protected function getTextColumn($dataScope, $fit, Phrase $label, $sortOrder) 'fit' => $fit, 'label' => $label, 'sortOrder' => $sortOrder, + 'labelVisible' => false, ], ], ], From d4e1641188e841885329fa2a8adb0cefd4b44879 Mon Sep 17 00:00:00 2001 From: Anna Pak <a.pak@atwix.com> Date: Thu, 3 Dec 2020 13:35:51 +0200 Subject: [PATCH 111/171] refactored AdminApplyTierPriceToProductWithPercentageDiscountTest --- .../Catalog/Test/Mftf/Data/TierPriceData.xml | 6 +++ ...iceToProductWithPercentageDiscountTest.xml | 43 +++++++++++++------ 2 files changed, 36 insertions(+), 13 deletions(-) diff --git a/app/code/Magento/Catalog/Test/Mftf/Data/TierPriceData.xml b/app/code/Magento/Catalog/Test/Mftf/Data/TierPriceData.xml index 731754ef01959..b763fda489b20 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Data/TierPriceData.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Data/TierPriceData.xml @@ -80,4 +80,10 @@ <data key="quantity">1</data> <var key="sku" entityType="product" entityKey="sku" /> </entity> + <entity name="tierPrice01PercentDiscount" type="data"> + <data key="website">All Websites [USD]</data> + <data key="customer_group">ALL GROUPS</data> + <data key="price">0.1</data> + <data key="qty">1</data> + </entity> </entities> 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 45284e69a54e0..37a7e461c2869 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminApplyTierPriceToProductTest/AdminApplyTierPriceToProductWithPercentageDiscountTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminApplyTierPriceToProductTest/AdminApplyTierPriceToProductWithPercentageDiscountTest.xml @@ -23,6 +23,7 @@ <requiredEntity createDataKey="createCategory"/> <field key="price">100</field> </createData> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdminInBefore"/> </before> <after> <deleteData createDataKey="createSimpleProduct" stepKey="deleteSimpleProduct"/> @@ -31,29 +32,45 @@ <actionGroup ref="ResetProductGridToDefaultViewActionGroup" stepKey="resetGridToDefaultKeywordSearch"/> <actionGroup ref="AdminLogoutActionGroup" stepKey="logoutFromAdmin"/> </after> - <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> + + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="loginAsAdmin"/> <actionGroup ref="SearchForProductOnBackendActionGroup" stepKey="searchForSimpleProduct"> <argument name="product" value="$$createSimpleProduct$$"/> </actionGroup> <actionGroup ref="OpenEditProductOnBackendActionGroup" stepKey="openEditProduct1"> <argument name="product" value="$$createSimpleProduct$$"/> </actionGroup> - <scrollToTopOfPage stepKey="scrollToTopOfPage"/> - <click selector="{{AdminProductFormSection.advancedPricingLink}}" stepKey="clickOnAdvancedPricingButton"/> - <waitForElement selector="{{AdminProductFormAdvancedPricingSection.customerGroupPriceAddButton}}" stepKey="waitForCustomerGroupPriceAddButton"/> - <click selector="{{AdminProductFormAdvancedPricingSection.customerGroupPriceAddButton}}" stepKey="addCustomerGroupAllGroupsQty1PriceDiscountAndpercent"/> - <fillField selector="{{AdminProductFormAdvancedPricingSection.productTierPriceQtyInput('0')}}" userInput="1" stepKey="fillProductTierPriceQtyInput"/> - <selectOption selector="{{AdminProductFormAdvancedPricingSection.productTierPriceValueTypeSelect('0')}}" userInput="Discount" stepKey="selectProductTierPriceValueType"/> - <fillField selector="{{AdminProductFormAdvancedPricingSection.productTierPricePercentageValuePriceInput('0')}}" userInput="0.1" stepKey="selectProductTierPricePriceInput"/> - <click selector="{{AdminProductFormAdvancedPricingSection.doneButton}}" stepKey="clickDoneButton"/> + + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="scrollToTopOfPage"/> + <actionGroup ref="AdminProductFormOpenAdvancedPricingDialogActionGroup" stepKey="clickOnAdvancedPricingButton"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="addCustomerGroupAllGroupsQty1PriceDiscountAndpercente"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="fillProductTierPriceQtyInput"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="selectProductTierPriceValueType"/> + + <actionGroup ref="AdminProductFormAdvancedPricingAddTierPriceActionGroup" stepKey="selectProductTierPricePriceInput"> + <argument name="website" value="{{tierPrice01PercentDiscount.website}}"/> + <argument name="customerGroup" value="{{tierPrice01PercentDiscount.customer_group}}"/> + <argument name="quantity" value="{{tierPrice01PercentDiscount.qty}}"/> + <argument name="priceType" value="Discount"/> + <argument name="amount" value="{{tierPrice01PercentDiscount.price}}"/> + </actionGroup> + + <actionGroup ref="AdminProductFormDoneAdvancedPricingDialogActionGroup" stepKey="clickDoneButton"/> <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct1"/> - <amOnPage url="{{StorefrontProductPage.url($$createSimpleProduct.sku$$)}}" stepKey="goProductPageOnStorefront"/> - <waitForPageLoad time="30" stepKey="waitForPageLoad1"/> + + <actionGroup ref="StorefrontOpenProductPageActionGroup" stepKey="goProductPageOnStorefront"> + <argument name="productUrl" value="$$createSimpleProduct.sku$$"/> + </actionGroup> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForPageLoad1"/> <seeElement selector="{{StorefrontCategoryProductSection.productPriceFinal('99.90')}}" stepKey="assertProductFinalPriceProductPage"/> <seeElement selector="{{StorefrontCategoryProductSection.productPriceLabel('Regular Price')}}" stepKey="assertRegularPriceProductPage"/> <seeElement selector="{{StorefrontCategoryProductSection.productPriceOld('100')}}" stepKey="assertRegularPriceAmountProductPage"/> - <amOnPage url="{{StorefrontCategoryPage.url($$createCategory.name$$)}}" stepKey="navigateToCategoryPage"/> - <waitForPageLoad time="30" stepKey="waitForPageLoad2"/> + + <actionGroup ref="StorefrontNavigateCategoryPageActionGroup" stepKey="navigateToCategoryPage"> + <argument name="category" value="$createCategory$"/> + </actionGroup> + + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForPageLoad2"/> <seeElement selector="{{StorefrontCategoryProductSection.productPriceFinal('99.90')}}" stepKey="assertProductFinalPriceCategoryPage"/> <seeElement selector="{{StorefrontCategoryProductSection.productPriceLabel('Regular Price')}}" stepKey="assertRegularPriceLabelCategoryPage"/> <seeElement selector="{{StorefrontCategoryProductSection.productPriceOld('100')}}" stepKey="assertRegularPriceAmountCategoryPage"/> From 00fa24651f2c7c61b7bc78f2b74173ae22633dda Mon Sep 17 00:00:00 2001 From: Sergiy Vasiutynskyi <s.vasiutynskyi@atwix.com> Date: Thu, 3 Dec 2020 13:36:16 +0200 Subject: [PATCH 112/171] Updated value of CliIndexerReindexActionGroup action for failed test --- ...orefrontAddBundleProductWithZeroPriceToShoppingCartTest.xml | 2 +- .../StorefrontCustomerSearchBundleProductsByKeywordsTest.xml | 3 ++- ...fyDynamicBundleProductPricesForCombinationOfOptionsTest.xml | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontAddBundleProductWithZeroPriceToShoppingCartTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontAddBundleProductWithZeroPriceToShoppingCartTest.xml index b68171ba49825..88f992e698181 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontAddBundleProductWithZeroPriceToShoppingCartTest.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontAddBundleProductWithZeroPriceToShoppingCartTest.xml @@ -41,7 +41,7 @@ <requiredEntity createDataKey="apiSimple"/> </createData> <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> - <argument name="indices" value="cataloginventory_stock"/> + <argument name="indices" value="cataloginventory_stock catalog_product_price"/> </actionGroup> </before> <after> diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontCustomerSearchBundleProductsByKeywordsTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontCustomerSearchBundleProductsByKeywordsTest.xml index 52cd91385a4b2..f7bce778cc0d8 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontCustomerSearchBundleProductsByKeywordsTest.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontCustomerSearchBundleProductsByKeywordsTest.xml @@ -39,8 +39,9 @@ <requiredEntity createDataKey="fixedBundleOption"/> <requiredEntity createDataKey="createSimpleProductTwo"/> </createData> + <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> - <argument name="indices" value="cataloginventory_stock"/> + <argument name="indices" value="cataloginventory_stock catalog_product_price"/> </actionGroup> </before> <after> diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontVerifyDynamicBundleProductPricesForCombinationOfOptionsTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontVerifyDynamicBundleProductPricesForCombinationOfOptionsTest.xml index 3a7550b1484f0..927cebdf7e508 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontVerifyDynamicBundleProductPricesForCombinationOfOptionsTest.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontVerifyDynamicBundleProductPricesForCombinationOfOptionsTest.xml @@ -168,7 +168,7 @@ <see userInput="You saved the configuration." selector="{{AdminCategoryMessagesSection.SuccessMessage}}" stepKey="seeSuccess"/> <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> - <argument name="indices" value="cataloginventory_stock"/> + <argument name="indices" value="cataloginventory_stock catalog_product_price"/> </actionGroup> </before> <after> From fe39fba308b4be8b320dda5d84a50af5919a931a Mon Sep 17 00:00:00 2001 From: Anna Pak <a.pak@atwix.com> Date: Thu, 3 Dec 2020 13:43:05 +0200 Subject: [PATCH 113/171] added comment --- .../AdminApplyTierPriceToProductWithPercentageDiscountTest.xml | 1 + 1 file changed, 1 insertion(+) 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 37a7e461c2869..594eb320e439a 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminApplyTierPriceToProductTest/AdminApplyTierPriceToProductWithPercentageDiscountTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminApplyTierPriceToProductTest/AdminApplyTierPriceToProductWithPercentageDiscountTest.xml @@ -44,6 +44,7 @@ <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="scrollToTopOfPage"/> <actionGroup ref="AdminProductFormOpenAdvancedPricingDialogActionGroup" stepKey="clickOnAdvancedPricingButton"/> <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="addCustomerGroupAllGroupsQty1PriceDiscountAndpercente"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForCustomerGroupPriceAddButton"/> <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="fillProductTierPriceQtyInput"/> <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="selectProductTierPriceValueType"/> From 51f5c43dbcf87ee1352d5ed2647479890cec3e9f Mon Sep 17 00:00:00 2001 From: "rostyslav.hymon" <rostyslav.hymon@transoftgroup.com> Date: Fri, 4 Dec 2020 10:28:06 +0200 Subject: [PATCH 114/171] MC-38973: Duplicate address by order from admin --- .../view/adminhtml/templates/order/create/form/address.phtml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/Sales/view/adminhtml/templates/order/create/form/address.phtml b/app/code/Magento/Sales/view/adminhtml/templates/order/create/form/address.phtml index 80083569df889..638ac7e66f769 100644 --- a/app/code/Magento/Sales/view/adminhtml/templates/order/create/form/address.phtml +++ b/app/code/Magento/Sales/view/adminhtml/templates/order/create/form/address.phtml @@ -125,7 +125,7 @@ endif; ?> <?php endif; ?> class="admin__control-checkbox"/> <label for="<?= $block->escapeHtmlAttr($block->getForm()->getHtmlIdPrefix()) ?>save_in_address_book" - class="admin__field-label"><?= $block->escapeHtml(__('Save in address book')) ?></label> + class="admin__field-label"><?= $block->escapeHtml(__('Add to address book')) ?></label> </div> </div> <?php $hideElement = 'address-' . ($block->getIsShipping() ? 'shipping' : 'billing') . '-overlay'; ?> From a119cbeaedeed60b4d5b7b62c05aa756e579a330 Mon Sep 17 00:00:00 2001 From: Dmitry Furs <dmitryfurs@gmail.com> Date: Fri, 4 Dec 2020 13:51:06 +0300 Subject: [PATCH 115/171] Invalid combination of tabs and spaces in phpstan.neon --- .../Test/Php/_files/phpstan/phpstan.neon | 74 +++++++++---------- 1 file changed, 37 insertions(+), 37 deletions(-) diff --git a/dev/tests/static/testsuite/Magento/Test/Php/_files/phpstan/phpstan.neon b/dev/tests/static/testsuite/Magento/Test/Php/_files/phpstan/phpstan.neon index d487fbe602acf..0bdb5861dbf33 100644 --- a/dev/tests/static/testsuite/Magento/Test/Php/_files/phpstan/phpstan.neon +++ b/dev/tests/static/testsuite/Magento/Test/Php/_files/phpstan/phpstan.neon @@ -1,41 +1,41 @@ parameters: - checkExplicitMixedMissingReturn: true - checkPhpDocMissingReturn: true - reportUnmatchedIgnoredErrors: false - excludes_analyse: - - %rootDir%/../../../lib/internal/Magento/Framework/ObjectManager/Test/Unit/* - - %rootDir%/../../../*/_files/* - - %rootDir%/../../../dev/tests/*/Fixtures/* - - %rootDir%/../../../dev/tests/*/tmp/* - - %rootDir%/../../../dev/tests/*/_generated/* - - %rootDir%/../../../pub/* - autoload_directories: - - %rootDir%/../../../dev/tests/static/framework/tests/unit/testsuite/Magento - - %rootDir%/../../../dev/tests/integration/framework/tests/unit/testsuite/Magento - - %rootDir%/../../../dev/tests/api-functional/_files/Magento - autoload_files: - - %rootDir%/../../../dev/tests/static/framework/autoload.php - - %rootDir%/../../../dev/tests/integration/framework/autoload.php - - %rootDir%/../../../dev/tests/api-functional/framework/autoload.php - - %rootDir%/../../../dev/tests/setup-integration/framework/autoload.php - - %rootDir%/../../../dev/tests/static/framework/Magento/PhpStan/autoload.php - ignoreErrors: - # Ignore PHPStan\Rules\Classes\UnusedConstructorParametersRule - - '#Constructor of class [a-zA-Z0-9\\_]+ has an unused parameter#' - # Ignore setCustomErrorHandler function not found in bootstrap files - - '#Function setCustomErrorHandler not found#' - # Ignore 'return statement is missing' error when 'void' is present in return type list - - '#Method (?:.*?) should return (?:.*?)void(?:.*?) but return statement is missing.#' - # Ignore constants, defined dynamically. - - '#Constant TESTS_WEB_API_ADAPTER not found.#' - - '#Constant TESTS_BASE_URL not found.#' - - '#Constant TESTS_XDEBUG_ENABLED not found.#' - - '#Constant TESTS_XDEBUG_SESSION not found.#' - - '#Constant INTEGRATION_TESTS_DIR not found.#' - - '#Constant MAGENTO_MODULES_PATH not found.#' - - '#Constant TESTS_MODULES_PATH not found.#' - - '#Constant TESTS_INSTALLATION_DB_CONFIG_FILE not found.#' - - '#Constant T_[A-Z_]+ not found.#' + checkExplicitMixedMissingReturn: true + checkPhpDocMissingReturn: true + reportUnmatchedIgnoredErrors: false + excludes_analyse: + - %rootDir%/../../../lib/internal/Magento/Framework/ObjectManager/Test/Unit/* + - %rootDir%/../../../*/_files/* + - %rootDir%/../../../dev/tests/*/Fixtures/* + - %rootDir%/../../../dev/tests/*/tmp/* + - %rootDir%/../../../dev/tests/*/_generated/* + - %rootDir%/../../../pub/* + autoload_directories: + - %rootDir%/../../../dev/tests/static/framework/tests/unit/testsuite/Magento + - %rootDir%/../../../dev/tests/integration/framework/tests/unit/testsuite/Magento + - %rootDir%/../../../dev/tests/api-functional/_files/Magento + autoload_files: + - %rootDir%/../../../dev/tests/static/framework/autoload.php + - %rootDir%/../../../dev/tests/integration/framework/autoload.php + - %rootDir%/../../../dev/tests/api-functional/framework/autoload.php + - %rootDir%/../../../dev/tests/setup-integration/framework/autoload.php + - %rootDir%/../../../dev/tests/static/framework/Magento/PhpStan/autoload.php + ignoreErrors: + # Ignore PHPStan\Rules\Classes\UnusedConstructorParametersRule + - '#Constructor of class [a-zA-Z0-9\\_]+ has an unused parameter#' + # Ignore setCustomErrorHandler function not found in bootstrap files + - '#Function setCustomErrorHandler not found#' + # Ignore 'return statement is missing' error when 'void' is present in return type list + - '#Method (?:.*?) should return (?:.*?)void(?:.*?) but return statement is missing.#' + # Ignore constants, defined dynamically. + - '#Constant TESTS_WEB_API_ADAPTER not found.#' + - '#Constant TESTS_BASE_URL not found.#' + - '#Constant TESTS_XDEBUG_ENABLED not found.#' + - '#Constant TESTS_XDEBUG_SESSION not found.#' + - '#Constant INTEGRATION_TESTS_DIR not found.#' + - '#Constant MAGENTO_MODULES_PATH not found.#' + - '#Constant TESTS_MODULES_PATH not found.#' + - '#Constant TESTS_INSTALLATION_DB_CONFIG_FILE not found.#' + - '#Constant T_[A-Z_]+ not found.#' services: From 63810d1471499b0e3adac3b58bd9521e9eed8e58 Mon Sep 17 00:00:00 2001 From: "rostyslav.hymon" <rostyslav.hymon@transoftgroup.com> Date: Fri, 4 Dec 2020 13:22:31 +0200 Subject: [PATCH 116/171] MC-38973: Duplicate address by order from admin --- app/code/Magento/Sales/i18n/en_US.csv | 1 + 1 file changed, 1 insertion(+) diff --git a/app/code/Magento/Sales/i18n/en_US.csv b/app/code/Magento/Sales/i18n/en_US.csv index 0e65131b7c4b0..13afa0832086e 100644 --- a/app/code/Magento/Sales/i18n/en_US.csv +++ b/app/code/Magento/Sales/i18n/en_US.csv @@ -804,3 +804,4 @@ If set YES Email field will be required during Admin order creation for new Cust "Please enter a coupon code!","Please enter a coupon code!" "Reorder is not available.","Reorder is not available." "The coupon code has been removed.","The coupon code has been removed." +"Add to address book","Add to address book" From b85ba435bba0bcfdfe47a136f239eeb3194ef938 Mon Sep 17 00:00:00 2001 From: "vadim.malesh" <engcom-vendorworker-charlie@adobe.com> Date: Fri, 4 Dec 2020 16:27:24 +0200 Subject: [PATCH 117/171] fix integration tests --- dev/tests/integration/testsuite/Magento/Eav/Model/ConfigTest.php | 1 + .../Controller/Adminhtml/Dashboard/IndexTest.php | 1 + 2 files changed, 2 insertions(+) diff --git a/dev/tests/integration/testsuite/Magento/Eav/Model/ConfigTest.php b/dev/tests/integration/testsuite/Magento/Eav/Model/ConfigTest.php index 63fcfbd061877..85bf40b342fb5 100644 --- a/dev/tests/integration/testsuite/Magento/Eav/Model/ConfigTest.php +++ b/dev/tests/integration/testsuite/Magento/Eav/Model/ConfigTest.php @@ -149,6 +149,7 @@ public function testGetAttributeWithCacheUserDefinedAttribute() $config = Bootstrap::getObjectManager()->create(\Magento\Eav\Model\Config::class); $updatedAttribute = $config->getAttribute($entityType, 'foo'); $this->assertEquals('foo', $updatedAttribute->getFrontendLabel()); + CacheCleaner::clean(['eav']); $config = Bootstrap::getObjectManager()->create(\Magento\Eav\Model\Config::class); // Check that attribute data has changed $updatedAttributeAfterCacheClean = $config->getAttribute($entityType, 'foo'); diff --git a/dev/tests/integration/testsuite/Magento/ReleaseNotification/Controller/Adminhtml/Dashboard/IndexTest.php b/dev/tests/integration/testsuite/Magento/ReleaseNotification/Controller/Adminhtml/Dashboard/IndexTest.php index 63c5e04bac84a..ffe2a4d6ca1c5 100644 --- a/dev/tests/integration/testsuite/Magento/ReleaseNotification/Controller/Adminhtml/Dashboard/IndexTest.php +++ b/dev/tests/integration/testsuite/Magento/ReleaseNotification/Controller/Adminhtml/Dashboard/IndexTest.php @@ -34,6 +34,7 @@ protected function setUp(): void protected function tearDown(): void { $this->objectManager->removeSharedInstance(ContentProviderInterface::class); + CacheCleaner::clean(['layout']); parent::tearDown(); } From 424754fe4bc2acec733f6bc9736afde5232553c7 Mon Sep 17 00:00:00 2001 From: Anna Pak <a.pak@atwix.com> Date: Fri, 4 Dec 2020 18:27:06 +0200 Subject: [PATCH 118/171] changed naming --- ...ITest.xml => AdminMassOrdersCancelClosedAndCompleteTest.xml} | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename app/code/Magento/Sales/Test/Mftf/Test/{AdminMassOrdersCancelCompleteAndClosedAPITest.xml => AdminMassOrdersCancelClosedAndCompleteTest.xml} (98%) diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminMassOrdersCancelCompleteAndClosedAPITest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminMassOrdersCancelClosedAndCompleteTest.xml similarity index 98% rename from app/code/Magento/Sales/Test/Mftf/Test/AdminMassOrdersCancelCompleteAndClosedAPITest.xml rename to app/code/Magento/Sales/Test/Mftf/Test/AdminMassOrdersCancelClosedAndCompleteTest.xml index 5cb54f0fd5613..a4f4e006837e1 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminMassOrdersCancelCompleteAndClosedAPITest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminMassOrdersCancelClosedAndCompleteTest.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="AdminMassOrdersCancelCompleteAndClosedAPITest"> + <test name="AdminMassOrdersCancelClosedAndCompleteTest"> <annotations> <stories value="Mass Update Orders"/> <title value="Mass cancel orders in status Complete, Closed"/> From 035442d47019e7a82bc193787adce2086032f3a5 Mon Sep 17 00:00:00 2001 From: Anna Pak <a.pak@atwix.com> Date: Fri, 4 Dec 2020 18:27:58 +0200 Subject: [PATCH 119/171] updated deprecated test --- .../Mftf/Test/AdminMassOrdersCancelCompleteAndClosedTest.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminMassOrdersCancelCompleteAndClosedTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminMassOrdersCancelCompleteAndClosedTest.xml index 793e1a07950c9..10b3ba05aa2bb 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminMassOrdersCancelCompleteAndClosedTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminMassOrdersCancelCompleteAndClosedTest.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="AdminMassOrdersCancelCompleteAndClosedTest" deprecated="Use AdminMassOrdersCancelCompleteAndClosedAPITest instead"> + <test name="AdminMassOrdersCancelCompleteAndClosedTest" deprecated="Use AdminMassOrdersCancelClosedAndCompleteTest instead"> <annotations> <stories value="Mass Update Orders"/> <title value="DEPRECATED. Mass cancel orders in status Complete, Closed"/> @@ -18,7 +18,7 @@ <group value="sales"/> <group value="mtf_migrated"/> <skip> - <issueId value="DEPRECATED">Use AdminMassOrdersCancelCompleteAndClosedAPITest instead</issueId> + <issueId value="DEPRECATED">Use AdminMassOrdersCancelClosedAndCompleteTest instead</issueId> </skip> </annotations> <before> From beb05984b2798ffdb262bac8c65174a5f89355ad Mon Sep 17 00:00:00 2001 From: "rostyslav.hymon" <rostyslav.hymon@transoftgroup.com> Date: Mon, 7 Dec 2020 11:10:56 +0200 Subject: [PATCH 120/171] MC-38973: Duplicate address by order from admin --- .../Test/Mftf/Test/AdminSaveInAddressBookCheckboxStateTest.xml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminSaveInAddressBookCheckboxStateTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminSaveInAddressBookCheckboxStateTest.xml index ac0af3f5b80db..f8136a9071a1a 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminSaveInAddressBookCheckboxStateTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminSaveInAddressBookCheckboxStateTest.xml @@ -47,6 +47,8 @@ <actionGroup ref="AddSimpleProductToOrderActionGroup" stepKey="addSimpleProductToOrder"> <argument name="product" value="$$createSimpleProduct$$"/> </actionGroup> + <!-- By default checkbox 'Add to address book' must be unchecked --> + <dontSeeCheckboxIsChecked selector="{{AdminOrderFormBillingAddressSection.SaveAddress}}" stepKey="checkBoxAddBillingAddressIsUnchecked"/> <!-- Just in case uncheck and check 'Same as Billing Address checkbox' --> <comment userInput="Just in case uncheck and check 'Same as Billing Address checkbox'" stepKey="uncheckAndCheckAgain"/> <uncheckOption selector="{{AdminOrderFormShippingAddressSection.SameAsBilling}}" stepKey="unCheckSameAsShippingAddressCheckbox"/> From edbb92b3e8e72c76e537a1d490fc870630eb2bb3 Mon Sep 17 00:00:00 2001 From: Serhiy Yelahin <serhiy.yelahin@transoftgroup.com> Date: Mon, 7 Dec 2020 12:10:22 +0200 Subject: [PATCH 121/171] MC-39128: Cannot delete second layout update in widget --- app/code/Magento/Backend/Block/Widget/Button.php | 5 ++++- .../Backend/Test/Unit/Block/Widget/ButtonTest.php | 12 ++++++++++++ .../Widget/Instance/Edit/Tab/Main/Layout.php | 2 +- 3 files changed, 17 insertions(+), 2 deletions(-) diff --git a/app/code/Magento/Backend/Block/Widget/Button.php b/app/code/Magento/Backend/Block/Widget/Button.php index 3b5eca6a61779..cb8269f692f02 100644 --- a/app/code/Magento/Backend/Block/Widget/Button.php +++ b/app/code/Magento/Backend/Block/Widget/Button.php @@ -5,9 +5,9 @@ */ namespace Magento\Backend\Block\Widget; +use Magento\Backend\Block\Template\Context; use Magento\Framework\App\ObjectManager; use Magento\Framework\Math\Random; -use Magento\Backend\Block\Template\Context; use Magento\Framework\View\Helper\SecureHtmlRenderer; /** @@ -125,6 +125,9 @@ protected function _prepareAttributes($title, $classes, $disabled) 'value' => $this->getValue(), 'disabled' => $disabled, ]; + if ($this->hasData('onclick_attribute')) { + $attributes['onclick'] = $this->getData('onclick_attribute'); + } if ($this->hasData('backend_button_widget_hook_id')) { $attributes['backend-button-widget-hook-id'] = $this->getData('backend_button_widget_hook_id'); } diff --git a/app/code/Magento/Backend/Test/Unit/Block/Widget/ButtonTest.php b/app/code/Magento/Backend/Test/Unit/Block/Widget/ButtonTest.php index be14a51ffb27b..33667f158b9d9 100644 --- a/app/code/Magento/Backend/Test/Unit/Block/Widget/ButtonTest.php +++ b/app/code/Magento/Backend/Test/Unit/Block/Widget/ButtonTest.php @@ -94,4 +94,16 @@ public function getAttributesHtmlDataProvider() ] ]; } + + /** + * Verifies ability of adding button onclick attribute + * + * @return void + */ + public function testOnClickAttribute(): void + { + $this->_blockMock->setData(['onclick_attribute' => 'value']); + $attributes = $this->_blockMock->getAttributesHtml(); + $this->assertStringContainsString('onclick', $attributes); + } } diff --git a/app/code/Magento/Widget/Block/Adminhtml/Widget/Instance/Edit/Tab/Main/Layout.php b/app/code/Magento/Widget/Block/Adminhtml/Widget/Instance/Edit/Tab/Main/Layout.php index c48bf9e7e4c7a..1d8d1ec37494b 100644 --- a/app/code/Magento/Widget/Block/Adminhtml/Widget/Instance/Edit/Tab/Main/Layout.php +++ b/app/code/Magento/Widget/Block/Adminhtml/Widget/Instance/Edit/Tab/Main/Layout.php @@ -327,7 +327,7 @@ public function getRemoveLayoutButtonHtml() )->setData( [ 'label' => $this->escapeHtmlAttr(__('Remove Layout Update')), - 'onclick' => 'WidgetInstance.removePageGroup(this)', + 'onclick_attribute' => 'WidgetInstance.removePageGroup(this)', 'class' => 'action-delete', ] ); From 32b93deca198a62fc4e2e67012d63ad457c43728 Mon Sep 17 00:00:00 2001 From: "vadim.malesh" <engcom-vendorworker-charlie@adobe.com> Date: Mon, 7 Dec 2020 13:30:04 +0200 Subject: [PATCH 122/171] fix graphql test --- .../Magento/GraphQl/CatalogUrlRewrite/UrlResolverTest.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/CatalogUrlRewrite/UrlResolverTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/CatalogUrlRewrite/UrlResolverTest.php index 2f6fc2ee112fa..c87daafa66728 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/CatalogUrlRewrite/UrlResolverTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/CatalogUrlRewrite/UrlResolverTest.php @@ -223,11 +223,10 @@ public function testRedirectsAndCustomInput() $urlRewriteModel->setRedirectType('301'); $urlRewriteModel->setId($urlRewriteModel->getId()); $urlRewriteModel->save(); - ObjectManager::getInstance()->get(\Magento\TestFramework\Helper\CacheCleaner::class)->clean(['eav']); //modifying query by adding spaces to avoid getting cached values. $this->queryUrlAndAssertResponse( (int) $product->getEntityId(), - $customUrl, + $customUrl . ' ', $actualUrls->getRequestPath(), strtoupper($actualUrls->getEntityType()), 301 From a4403e9006d1bb4a4c75baa71915b7df12e3c7e8 Mon Sep 17 00:00:00 2001 From: Vadim Malesh <51680850+engcom-Charlie@users.noreply.github.com> Date: Mon, 7 Dec 2020 13:55:42 +0200 Subject: [PATCH 123/171] Rename AdminCheckProductQtyAfterOrderCancelling.xml to AdminCheckProductQtyAfterOrderCancellingTest.xml --- ...lling.xml => AdminCheckProductQtyAfterOrderCancellingTest.xml} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename app/code/Magento/ConfigurableProduct/Test/Mftf/Test/{AdminCheckProductQtyAfterOrderCancelling.xml => AdminCheckProductQtyAfterOrderCancellingTest.xml} (100%) diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCheckProductQtyAfterOrderCancelling.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCheckProductQtyAfterOrderCancellingTest.xml similarity index 100% rename from app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCheckProductQtyAfterOrderCancelling.xml rename to app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCheckProductQtyAfterOrderCancellingTest.xml From 0d1c10836b6b8e5cce7ad2706845db2098387f5b Mon Sep 17 00:00:00 2001 From: Serhii Kovalenko <ganster3012@gmail.com> Date: Tue, 8 Dec 2020 02:46:29 +0200 Subject: [PATCH 124/171] Fix unit test subscription --- .../Mview/Test/Unit/View/SubscriptionTest.php | 43 +++++++++++++++---- 1 file changed, 34 insertions(+), 9 deletions(-) diff --git a/lib/internal/Magento/Framework/Mview/Test/Unit/View/SubscriptionTest.php b/lib/internal/Magento/Framework/Mview/Test/Unit/View/SubscriptionTest.php index 3142356d44084..3f3c326beb5a5 100644 --- a/lib/internal/Magento/Framework/Mview/Test/Unit/View/SubscriptionTest.php +++ b/lib/internal/Magento/Framework/Mview/Test/Unit/View/SubscriptionTest.php @@ -49,6 +49,16 @@ class SubscriptionTest extends TestCase /** @var string */ private $tableName; + /** + * @var Config|MockObject + */ + private $mviewConfig; + + /** + * @var DefaultProcessor|MockObject + */ + private $defaultProcessor; + protected function setUp(): void { $this->tableName = 'test_table'; @@ -59,17 +69,14 @@ protected function setUp(): void ->method('quoteIdentifier') ->willReturnArgument(0); - $this->connectionMock->expects($this->any()) - ->method('describeTable') - ->willReturn([]); - + $this->defaultProcessor = $this->createMock(DefaultProcessor::class); $this->resourceMock->expects($this->atLeastOnce()) ->method('getConnection') ->willReturn($this->connectionMock); ObjectManager::getInstance()->expects($this->any()) ->method('get') ->with(DefaultProcessor::class) - ->willReturn(2); + ->willReturn($this->defaultProcessor); $this->triggerFactoryMock = $this->createMock(TriggerFactory::class); $this->viewCollectionMock = $this->getMockForAbstractClass( CollectionInterface::class, @@ -114,6 +121,7 @@ protected function setUp(): void $this->tableName, 'columnName', [], + [], $mviewConfigMock ); } @@ -367,12 +375,24 @@ public function testBuildStatementIgnoredColumnSubscriptionLevel(): void ] ] ]; + $mviewConfigMock = $this->createMock(Config::class); + $mviewConfigMock->expects($this->any()) + ->method('getView') + ->willReturn([ + 'subscriptions' => [ + $tableName => [ + 'processor' => DefaultProcessor::class + ] + ] + ]); - $this->connectionMock->expects($this->once()) + $this->connectionMock->expects($this->any()) ->method('isTableExists') + ->with('cataloginventory_stock_item') ->willReturn(true); - $this->connectionMock->expects($this->once()) + $this->connectionMock->expects($this->any()) ->method('describeTable') + ->with($tableName) ->willReturn([ 'item_id' => ['COLUMN_NAME' => 'item_id'], 'product_id' => ['COLUMN_NAME' => 'product_id'], @@ -383,10 +403,14 @@ public function testBuildStatementIgnoredColumnSubscriptionLevel(): void ]); $otherChangelogMock = $this->getMockForAbstractClass(ChangelogInterface::class); - $otherChangelogMock->expects($this->once()) + $otherChangelogMock->expects($this->any()) ->method('getViewId') ->willReturn($viewId); + $otherChangelogMock->expects($this->once()) + ->method('getColumnName') + ->willReturn('entity_id'); + $model = new Subscription( $this->resourceMock, $this->triggerFactoryMock, @@ -395,7 +419,8 @@ public function testBuildStatementIgnoredColumnSubscriptionLevel(): void $tableName, 'columnName', [], - $ignoredData + $ignoredData, + $mviewConfigMock ); $method = new \ReflectionMethod($model, 'buildStatement'); From 958582ee34a6734f101074d64680ad57f9f70f50 Mon Sep 17 00:00:00 2001 From: "vadim.malesh" <engcom-vendorworker-charlie@adobe.com> Date: Tue, 8 Dec 2020 12:20:49 +0200 Subject: [PATCH 125/171] add mftf --- ...tProductOnGroupedOptionGridActionGroup.xml | 31 +++++++++++++ .../AdminGroupedProductOptionGridSection.xml | 15 +++++++ ...oupedProductNonDefaultAttributeSetTest.xml | 45 +++++++++++++++++++ 3 files changed, 91 insertions(+) create mode 100644 app/code/Magento/GroupedProduct/Test/Mftf/ActionGroup/AdminAssertProductOnGroupedOptionGridActionGroup.xml create mode 100644 app/code/Magento/GroupedProduct/Test/Mftf/Section/AdminGroupedProductOptionGridSection.xml create mode 100644 app/code/Magento/GroupedProduct/Test/Mftf/Test/AdminCreateGroupedProductNonDefaultAttributeSetTest.xml diff --git a/app/code/Magento/GroupedProduct/Test/Mftf/ActionGroup/AdminAssertProductOnGroupedOptionGridActionGroup.xml b/app/code/Magento/GroupedProduct/Test/Mftf/ActionGroup/AdminAssertProductOnGroupedOptionGridActionGroup.xml new file mode 100644 index 0000000000000..2f706f45f834d --- /dev/null +++ b/app/code/Magento/GroupedProduct/Test/Mftf/ActionGroup/AdminAssertProductOnGroupedOptionGridActionGroup.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="AdminAssertProductOnGroupedOptionGridActionGroup"> + <annotations> + <description>Admin assert product on grouped option grid.</description> + </annotations> + <arguments> + <argument name="product"/> + </arguments> + + <grabTextFrom selector="{{AdminGroupedProductOptionGridSection.productName}}" stepKey="grabProductName"/> + <assertEquals stepKey="assertProductName"> + <expectedResult type="string">{{product.name}}</expectedResult> + <actualResult type="variable">$grabProductName</actualResult> + </assertEquals> + + <grabTextFrom selector="{{AdminGroupedProductOptionGridSection.productSku}}" stepKey="grabProductSku"/> + <assertEquals stepKey="assertProductSku"> + <expectedResult type="string">{{product.sku}}</expectedResult> + <actualResult type="variable">$grabProductSku</actualResult> + </assertEquals> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/GroupedProduct/Test/Mftf/Section/AdminGroupedProductOptionGridSection.xml b/app/code/Magento/GroupedProduct/Test/Mftf/Section/AdminGroupedProductOptionGridSection.xml new file mode 100644 index 0000000000000..1fff52c1d30cd --- /dev/null +++ b/app/code/Magento/GroupedProduct/Test/Mftf/Section/AdminGroupedProductOptionGridSection.xml @@ -0,0 +1,15 @@ +<?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="AdminGroupedProductOptionGridSection"> + <element name="productName" type="text" selector=".data-row td[data-index='name']"/> + <element name="productSku" type="text" selector=".data-row td[data-index='sku']"/> + </section> +</sections> diff --git a/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdminCreateGroupedProductNonDefaultAttributeSetTest.xml b/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdminCreateGroupedProductNonDefaultAttributeSetTest.xml new file mode 100644 index 0000000000000..44ea267c7b5d4 --- /dev/null +++ b/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdminCreateGroupedProductNonDefaultAttributeSetTest.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="AdminCreateGroupedProductNonDefaultAttributeSetTest"> + <annotations> + <features value="GroupedProduct"/> + <stories value="Create product"/> + <title value="Create Grouped Product when non-default attribute set is chosen"/> + <description value="Create Grouped Product with simple when non-default attribute set is chosen"/> + <group value="groupedProduct"/> + </annotations> + <before> + <createData entity="ApiProductWithDescription" stepKey="createSimpleProduct"/> + <createData entity="CatalogAttributeSet" stepKey="createAttributeSet"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> + </before> + <after> + <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> + <deleteData createDataKey="createSimpleProduct" stepKey="deleteFirstProduct"/> + <deleteData createDataKey="createAttributeSet" stepKey="deleteAttributeSet"/> + </after> + + <actionGroup ref="GoToSpecifiedCreateProductPageActionGroup" stepKey="createGroupedProduct"> + <argument name="productType" value="grouped"/> + </actionGroup> + <actionGroup ref="AdminProductPageSelectAttributeSetActionGroup" stepKey="selectAttributeSet"> + <argument name="attributeSetName" value="$createAttributeSet.attribute_set_name$"/> + </actionGroup> + <actionGroup ref="FillGroupedProductFormActionGroup" stepKey="fillProductForm"> + <argument name="product" value="GroupedProduct"/> + </actionGroup> + <actionGroup ref="AdminAssignProductToGroupActionGroup" stepKey="addSimpleToGroup"> + <argument name="product" value="$$createSimpleProduct$$"/> + </actionGroup> + <actionGroup ref="AdminAssertProductOnGroupedOptionGridActionGroup" stepKey="assertProductOptionGrid"> + <argument name="product" value="$$createSimpleProduct$$"/> + </actionGroup> + </test> +</tests> From 4bdc98ef49516d2a89dc7ff61df4bcee200007a5 Mon Sep 17 00:00:00 2001 From: Vadim Malesh <51680850+engcom-Charlie@users.noreply.github.com> Date: Tue, 8 Dec 2020 13:04:41 +0200 Subject: [PATCH 126/171] add severity --- .../Test/AdminCreateGroupedProductNonDefaultAttributeSetTest.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdminCreateGroupedProductNonDefaultAttributeSetTest.xml b/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdminCreateGroupedProductNonDefaultAttributeSetTest.xml index 44ea267c7b5d4..95607a83dd26f 100644 --- a/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdminCreateGroupedProductNonDefaultAttributeSetTest.xml +++ b/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdminCreateGroupedProductNonDefaultAttributeSetTest.xml @@ -13,6 +13,7 @@ <stories value="Create product"/> <title value="Create Grouped Product when non-default attribute set is chosen"/> <description value="Create Grouped Product with simple when non-default attribute set is chosen"/> + <severity value="MAJOR"/> <group value="groupedProduct"/> </annotations> <before> From 780419693249f6fae17d4702cd203c2ab4aae61a Mon Sep 17 00:00:00 2001 From: Vadim Malesh <51680850+engcom-Charlie@users.noreply.github.com> Date: Wed, 9 Dec 2020 11:35:17 +0200 Subject: [PATCH 127/171] fix mftf stepKeys order --- .../AdminApplyTierPriceToProductWithPercentageDiscountTest.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 594eb320e439a..143fa6657cd3b 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminApplyTierPriceToProductTest/AdminApplyTierPriceToProductWithPercentageDiscountTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminApplyTierPriceToProductTest/AdminApplyTierPriceToProductWithPercentageDiscountTest.xml @@ -43,8 +43,8 @@ <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="scrollToTopOfPage"/> <actionGroup ref="AdminProductFormOpenAdvancedPricingDialogActionGroup" stepKey="clickOnAdvancedPricingButton"/> - <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="addCustomerGroupAllGroupsQty1PriceDiscountAndpercente"/> <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForCustomerGroupPriceAddButton"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="addCustomerGroupAllGroupsQty1PriceDiscountAndpercente"/> <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="fillProductTierPriceQtyInput"/> <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="selectProductTierPriceValueType"/> From fe6298b0ae448de156a317545463e773a2166258 Mon Sep 17 00:00:00 2001 From: Anna Pak <a.pak@atwix.com> Date: Wed, 9 Dec 2020 12:24:53 +0200 Subject: [PATCH 128/171] refactored AdminUpdateSimpleProductWithRegularPriceInStockEnabledFlatTest --- ...AssertManageStockOnEditPageActionGroup.xml | 22 +++ ...AssertProductInfoOnEditPageActionGroup.xml | 32 ++++ ...ProductIsAssignedToCategoryActionGroup.xml | 22 +++ ...ssignTwoCategoriesToProductActionGroup.xml | 26 +++ .../AdminFillMainProductFormActionGroup.xml | 21 +++ ...uctStockStatusOnProductPageActionGroup.xml | 20 +++ .../AdminProductFormSection.xml | 1 + ...WithRegularPriceInStockEnabledFlatTest.xml | 166 ++++++++---------- 8 files changed, 218 insertions(+), 92 deletions(-) create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminAssertManageStockOnEditPageActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminAssertProductInfoOnEditPageActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminAssertProductIsAssignedToCategoryActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminAssignTwoCategoriesToProductActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminFillMainProductFormActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontAssertProductStockStatusOnProductPageActionGroup.xml diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminAssertManageStockOnEditPageActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminAssertManageStockOnEditPageActionGroup.xml new file mode 100644 index 0000000000000..f9c9098732476 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminAssertManageStockOnEditPageActionGroup.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="AdminAssertManageStockOnEditPageActionGroup"> + <annotations> + <description>Check if manageStock value is correct (the Product Edit page should be opened in Admin prior this check).</description> + </annotations> + <arguments> + <argument name="manageStock" type="string"/> + </arguments> + + <see selector="{{AdminProductFormAdvancedInventorySection.manageStock}}" userInput="{{manageStock}}" stepKey="seeManageStock"/> + + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminAssertProductInfoOnEditPageActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminAssertProductInfoOnEditPageActionGroup.xml new file mode 100644 index 0000000000000..b70c7a4d62dcf --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminAssertProductInfoOnEditPageActionGroup.xml @@ -0,0 +1,32 @@ +<?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="AdminAssertProductInfoOnEditPageActionGroup"> + <annotations> + <description>Validates next fields on the Edit Product Page: name, sku, price, quantity, stock status, tax class, weight, weigh select, visibility, url key</description> + </annotations> + <arguments> + <argument name="product" type="entity"/> + </arguments> + <waitForPageLoad stepKey="waitForProductToLoad"/> + <seeInField selector="{{AdminProductFormSection.productName}}" userInput="{{product.name}}" stepKey="seeProductName"/> + <seeInField selector="{{AdminProductFormSection.productSku}}" userInput="{{product.sku}}" stepKey="seeProductSku"/> + <seeInField selector="{{AdminProductFormSection.productPrice}}" userInput="{{product.price}}" stepKey="seeProductPrice"/> + <seeInField selector="{{AdminProductFormSection.productQuantity}}" userInput="{{product.quantity}}" stepKey="seeProductQuantity"/> + <seeInField selector="{{AdminProductFormSection.productStockStatus}}" userInput="{{product.status}}" stepKey="seeProductStockStatus"/> + <seeInField selector="{{AdminProductFormSection.productTaxClass}}" userInput="{{product.productTaxClass}}" stepKey="seeProductTaxClass"/> + <seeInField selector="{{AdminProductFormSection.productWeight}}" userInput="{{product.weight}}" stepKey="seeSimpleProductWeight"/> + <seeInField selector="{{AdminProductFormSection.productWeightSelect}}" userInput="{{product.weightSelect}}" stepKey="seeSimpleProductWeightSelect"/> + <seeInField selector="{{AdminProductFormSection.visibility}}" userInput="{{product.visibility}}" stepKey="seeVisibility"/> + <scrollTo selector="{{AdminProductSEOSection.sectionHeader}}" x="0" y="-80" stepKey="scrollToAdminProductSEOSection1"/> + <click selector="{{AdminProductSEOSection.sectionHeader}}" stepKey="clickAdminProductSEOSection1"/> + <seeInField selector="{{AdminProductSEOSection.urlKeyInput}}" userInput="{{product.urlKey}}" stepKey="seeUrlKey"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminAssertProductIsAssignedToCategoryActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminAssertProductIsAssignedToCategoryActionGroup.xml new file mode 100644 index 0000000000000..b33e319adc1f4 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminAssertProductIsAssignedToCategoryActionGroup.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="AdminAssertProductIsAssignedToCategoryActionGroup"> + <annotations> + <description>Checks if product is assigned to category (the Product Edit page should be opened in Admin prior this check).</description> + </annotations> + <arguments> + <argument name="categoryName" type="string"/> + </arguments> + + <seeElement selector="{{AdminProductFormSection.categories(categoryName)}}" stepKey="seeCategoryName"/> + + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminAssignTwoCategoriesToProductActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminAssignTwoCategoriesToProductActionGroup.xml new file mode 100644 index 0000000000000..06b4b68630326 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminAssignTwoCategoriesToProductActionGroup.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="AdminAssignTwoCategoriesToProductActionGroup" extends="AdminAssignCategoryToProductAndSaveActionGroup"> + <annotations> + <description>Extends AdminAssignCategoryToProductAndSaveActionGroup + assigns the second category and prevents product saving (the Product Edit page should be opened in Admin prior this check).</description> + </annotations> + <arguments> + <argument name="categoryTwoName" type="string"/> + </arguments> + <click selector="{{AdminProductFormSection.categoriesDropdown}}" stepKey="openDropDown2" after="waitForApplyCategory"/> + <checkOption selector="{{AdminProductFormSection.selectCategory(categoryTwoName)}}" stepKey="selectCategoryTwo"/> + <click selector="{{AdminProductFormSection.done}}" stepKey="clickDone2"/> + <waitForPageLoad stepKey="waitForApplyCategoryTwo"/> + <remove keyForRemoval="clickSave"/> + <remove keyForRemoval="waitForSavingProduct"/> + <remove keyForRemoval="seeSuccessMessage"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminFillMainProductFormActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminFillMainProductFormActionGroup.xml new file mode 100644 index 0000000000000..c5818a4eea51b --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminFillMainProductFormActionGroup.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="AdminFillMainProductFormActionGroup" extends="FillMainProductFormActionGroup"> + <annotations> + <description>Extends FillMainProductFormActionGroup with filling the next fields: Tax Class, Visibility, SEO->URL </description> + </annotations> + + <selectOption selector="{{AdminProductFormSection.productTaxClass}}" userInput="{{product.productTaxClass}}" stepKey="selectProductTaxClass"/> + <selectOption selector="{{AdminProductFormSection.visibility}}" userInput="{{product.visibility}}" stepKey="selectVisibility"/> + <click selector="{{AdminProductSEOSection.sectionHeader}}" stepKey="clickAdminProductSEOSection"/> + <fillField selector="{{AdminProductSEOSection.urlKeyInput}}" userInput="{{product.urlKey}}" stepKey="fillUrlKey"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontAssertProductStockStatusOnProductPageActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontAssertProductStockStatusOnProductPageActionGroup.xml new file mode 100644 index 0000000000000..356302ef26b9c --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontAssertProductStockStatusOnProductPageActionGroup.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="StorefrontAssertProductStockStatusOnProductPageActionGroup"> + <annotations> + <description>Validate that the provided Product Stock Status is present and correct (the Product Detail page should be opened on Storefront prior this check)</description> + </annotations> + <arguments> + <argument name="productStockStatus" type="string"/> + </arguments> + + <see selector="{{StorefrontProductInfoMainSection.productStockStatus}}" userInput="{{productStockStatus}}" stepKey="seeProductStockStatus"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/Section/AdminProductFormSection/AdminProductFormSection.xml b/app/code/Magento/Catalog/Test/Mftf/Section/AdminProductFormSection/AdminProductFormSection.xml index 1ca051e2f6669..d70c48f2b00e3 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Section/AdminProductFormSection/AdminProductFormSection.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Section/AdminProductFormSection/AdminProductFormSection.xml @@ -77,5 +77,6 @@ <element name="newAddedAttribute" type="text" selector="//fieldset[@class='admin__fieldset']//div[contains(@data-index,'{{attributeCode}}')]" parameterized="true"/> <element name="newCategoryButton" type="button" selector="button[data-index='create_category_button']" timeout="30"/> <element name="footerBlock" type="block" selector="//footer"/> + <element name="categories" type="text" selector="//*[@class='admin__action-multiselect-crumb']/span[contains(text(), '{{categoryName}}')]" parameterized="true"/> </section> </sections> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockEnabledFlatTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockEnabledFlatTest.xml index aa1b1ae702914..4bf15199f0db5 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockEnabledFlatTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockEnabledFlatTest.xml @@ -6,7 +6,7 @@ */ --> -<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> <test name="AdminUpdateSimpleProductWithRegularPriceInStockEnabledFlatTest"> <annotations> @@ -37,104 +37,86 @@ <magentoCLI stepKey="unsetFlatCatalogProduct" command="config:set catalog/frontend/flat_catalog_product 0"/> </after> - <!-- Search default simple product in the grid page --> - <actionGroup ref="AdminProductCatalogPageOpenActionGroup" stepKey="openProductCatalogPage"/> - <actionGroup ref="FilterProductGridBySku2ActionGroup" stepKey="filterProductGrid"> - <argument name="sku" value="$$initialSimpleProduct.sku$$"/> + <actionGroup ref="AdminClearFiltersActionGroup" stepKey="openProductCatalogPage"/> + <actionGroup ref="OpenEditProductOnBackendActionGroup" stepKey="openProductPage"> + <argument name="product" value="$$initialSimpleProduct$$"/> </actionGroup> - <click selector="{{AdminProductGridFilterSection.nthRow('1')}}" stepKey="clickFirstRowToOpenDefaultSimpleProduct"/> - <waitForPageLoad stepKey="waitUntilProductIsOpened"/> - <!-- Update simple product with regular price --> - <fillField selector="{{AdminProductFormSection.productName}}" userInput="{{simpleProductEnabledFlat.name}}" stepKey="fillSimpleProductName"/> - <fillField selector="{{AdminProductFormSection.productSku}}" userInput="{{simpleProductEnabledFlat.sku}}" stepKey="fillSimpleProductSku"/> - <fillField selector="{{AdminProductFormSection.productPrice}}" userInput="{{simpleProductEnabledFlat.price}}" stepKey="fillSimpleProductPrice"/> - <selectOption selector="{{AdminProductFormSection.productTaxClass}}" userInput="{{simpleProductEnabledFlat.productTaxClass}}" stepKey="selectProductTaxClass"/> - <fillField selector="{{AdminProductFormSection.productQuantity}}" userInput="{{simpleProductEnabledFlat.quantity}}" stepKey="fillSimpleProductQuantity"/> <actionGroup ref="AdminClickOnAdvancedInventoryLinkActionGroup" stepKey="clickAdvancedInventoryLink"/> - <conditionalClick selector="{{AdminProductFormAdvancedInventorySection.useConfigSettings}}" dependentSelector="{{AdminProductFormAdvancedInventorySection.useConfigSettings}}" visible="true" stepKey="checkUseConfigSettingsCheckBox"/> - <selectOption selector="{{AdminProductFormAdvancedInventorySection.manageStock}}" userInput="No" stepKey="selectManageStock"/> + <actionGroup ref="AdminSetManageStockConfigActionGroup" stepKey="setManageStockConfig"> + <argument name="value" value="No"/> + </actionGroup> <actionGroup ref="AdminSubmitAdvancedInventoryFormActionGroup" stepKey="clickDoneButtonOnAdvancedInventorySection"/> - <selectOption selector="{{AdminProductFormSection.stockStatus}}" userInput="{{simpleProductEnabledFlat.status}}" stepKey="selectStockStatusInStock"/> - <fillField selector="{{AdminProductFormSection.productWeight}}" userInput="{{simpleProductEnabledFlat.weight}}" stepKey="fillSimpleProductWeight"/> - <selectOption selector="{{AdminProductFormSection.productWeightSelect}}" userInput="{{simpleProductEnabledFlat.weightSelect}}" stepKey="selectProductWeight"/> - <click selector="{{AdminProductFormSection.categoriesDropdown}}" stepKey="clickCategoriesDropDown"/> - <fillField selector="{{AdminProductFormSection.searchCategory}}" userInput="$$initialCategoryEntity.name$$" stepKey="fillSearchForInitialCategory" /> - <waitForPageLoad stepKey="waitForCategory1"/> - <click selector="{{AdminProductFormSection.selectCategory($$initialCategoryEntity.name$$)}}" stepKey="unselectInitialCategory"/> - <fillField selector="{{AdminProductFormSection.searchCategory}}" userInput="$$categoryEntity.name$$" stepKey="fillSearchCategory" /> - <waitForPageLoad stepKey="waitForCategory2"/> - <click selector="{{AdminProductFormSection.selectCategory($$categoryEntity.name$$)}}" stepKey="clickOnCategory"/> - <actionGroup ref="AdminSubmitCategoriesPopupActionGroup" stepKey="clickOnDoneAdvancedCategorySelect"/> - <selectOption selector="{{AdminProductFormSection.visibility}}" userInput="{{simpleProductEnabledFlat.visibility}}" stepKey="selectVisibility"/> - <click selector="{{AdminProductSEOSection.sectionHeader}}" stepKey="clickAdminProductSEOSection"/> - <fillField selector="{{AdminProductSEOSection.urlKeyInput}}" userInput="{{simpleProductEnabledFlat.urlKey}}" stepKey="fillUrlKey"/> - <scrollToTopOfPage stepKey="scrollToTopOfAdminProductFormSection"/> + + <actionGroup ref="AdminAssignTwoCategoriesToProductActionGroup" stepKey="assignCategories"> + <argument name="categoryName" value="$$initialCategoryEntity.name$$"/> + <argument name="categoryTwoName" value="$$categoryEntity.name$$"/> + </actionGroup> + + <actionGroup ref="AdminFillMainProductFormActionGroup" stepKey="fillSimpleProductInfo"> + <argument name="product" value="simpleProductEnabledFlat"/> + </actionGroup> + <actionGroup ref="AdminProductFormSaveButtonClickActionGroup" stepKey="clickSaveButton"/> - <!-- Verify customer see success message --> - <see selector="{{AdminProductFormSection.successMessage}}" userInput="You saved the product." stepKey="seeAssertSimpleProductSaveSuccessMessage"/> - - <!-- Search updated simple product(from above step) in the grid page --> - <actionGroup ref="AdminProductCatalogPageOpenActionGroup" stepKey="openProductCatalogPageToSearchUpdatedSimpleProduct"/> - <conditionalClick selector="{{AdminProductGridFilterSection.clearAll}}" dependentSelector="{{AdminProductGridFilterSection.clearAll}}" visible="true" stepKey="clickClearAll"/> - <click selector="{{AdminProductGridFilterSection.filters}}" stepKey="clickFiltersButton"/> - <fillField selector="{{AdminProductGridFilterSection.nameFilter}}" userInput="{{simpleProductEnabledFlat.name}}" stepKey="fillSimpleProductNameInNameFilter"/> - <fillField selector="{{AdminProductGridFilterSection.skuFilter}}" userInput="{{simpleProductEnabledFlat.sku}}" stepKey="fillProductSku"/> - <click selector="{{AdminProductGridFilterSection.applyFilters}}" stepKey="clickApplyFiltersButton"/> - <click selector="{{AdminProductGridFilterSection.nthRow('1')}}" stepKey="clickFirstRowToVerifyUpdatedSimpleProductVisibleInGrid"/> - <waitForPageLoad stepKey="waitUntilSimpleProductPageIsOpened"/> - - <!-- Verify customer see updated simple product in the product form page --> - <seeInField selector="{{AdminProductFormSection.productName}}" userInput="{{simpleProductEnabledFlat.name}}" stepKey="seeSimpleProductName"/> - <seeInField selector="{{AdminProductFormSection.productSku}}" userInput="{{simpleProductEnabledFlat.sku}}" stepKey="seeSimpleProductSku"/> - <seeInField selector="{{AdminProductFormSection.productPrice}}" userInput="{{simpleProductEnabledFlat.price}}" stepKey="seeSimpleProductPrice"/> - <seeInField selector="{{AdminProductFormSection.productTaxClass}}" userInput="{{simpleProductEnabledFlat.productTaxClass}}" stepKey="seeProductTaxClass"/> - <seeInField selector="{{AdminProductFormSection.productQuantity}}" userInput="{{simpleProductEnabledFlat.quantity}}" stepKey="seeSimpleProductQuantity"/> - <actionGroup ref="AdminClickOnAdvancedInventoryLinkActionGroup" stepKey="clickTheAdvancedInventoryLink"/> - <see selector="{{AdminProductFormAdvancedInventorySection.manageStock}}" userInput="No" stepKey="seeManageStock"/> - <click selector="{{AdminProductFormAdvancedInventorySection.advancedInventoryCloseButton}}" stepKey="clickDoneButtonOnAdvancedInventory"/> - <seeInField selector="{{AdminProductFormSection.productStockStatus}}" userInput="{{simpleProductEnabledFlat.status}}" stepKey="seeSimpleProductStockStatus"/> - <seeInField selector="{{AdminProductFormSection.productWeight}}" userInput="{{simpleProductEnabledFlat.weight}}" stepKey="seeSimpleProductWeight"/> - <seeInField selector="{{AdminProductFormSection.productWeightSelect}}" userInput="{{simpleProductEnabledFlat.weightSelect}}" stepKey="seeSimpleProductWeightSelect"/> - <click selector="{{AdminProductFormSection.categoriesDropdown}}" stepKey="clickCategoriesDropDownToVerify"/> - <see selector="{{AdminProductFormSection.selectMultipleCategories}}" userInput="$$categoryEntity.name$$" stepKey="seeSelectedCategories" /> - <seeInField selector="{{AdminProductFormSection.visibility}}" userInput="{{simpleProductEnabledFlat.visibility}}" stepKey="seeVisibility"/> - <scrollTo selector="{{AdminProductSEOSection.sectionHeader}}" x="0" y="-80" stepKey="scrollToAdminProductSEOSection1"/> - <click selector="{{AdminProductSEOSection.sectionHeader}}" stepKey="clickAdminProductSEOSection1"/> - <seeInField selector="{{AdminProductSEOSection.urlKeyInput}}" userInput="{{simpleProductEnabledFlat.urlKey}}" stepKey="seeUrlKey"/> - - <!--Verify customer see updated simple product link on category page --> - <amOnPage url="{{StorefrontCategoryPage.url($$categoryEntity.name$$)}}" stepKey="openCategoryPage"/> - <waitForPageLoad stepKey="waitForCategoryPageLoad"/> - <see selector="{{StorefrontCategoryMainSection.productLink}}" userInput="{{simpleProductEnabledFlat.name}}" stepKey="seeSimpleProductNameOnCategoryPage"/> - - <!-- Verify customer see updated simple product (from the above step) on the storefront page --> - <amOnPage url="{{StorefrontProductPage.url(simpleProductEnabledFlat.urlKey)}}" stepKey="goToProductPage"/> - <waitForPageLoad stepKey="waitForStorefrontProductPageLoad"/> - <see selector="{{StorefrontProductInfoMainSection.productName}}" userInput="{{simpleProductEnabledFlat.name}}" stepKey="seeSimpleProductNameOnStoreFrontPage"/> - <see selector="{{StorefrontProductInfoMainSection.productPrice}}" userInput="{{simpleProductEnabledFlat.price}}" stepKey="seeSimpleProductPriceOnStoreFrontPage"/> - <actionGroup ref="StorefrontAssertProductSkuOnProductPageActionGroup" stepKey="seeSimpleProductSkuOnStoreFrontPage"> + <see selector="{{AdminProductFormSection.successMessage}}" userInput="You saved the product." stepKey="seeSimpleProductSavedSuccessMessage"/> + + <actionGroup ref="AdminClearFiltersActionGroup" stepKey="openProductCatalogPage1"/> + <actionGroup ref="OpenEditProductOnBackendActionGroup" stepKey="openProductPage1"> + <argument name="product" value="simpleProductEnabledFlat"/> + </actionGroup> + + <actionGroup ref="AdminClickOnAdvancedInventoryLinkActionGroup" stepKey="clickTheAdvancedInventoryLink1"/> + <actionGroup ref="AdminAssertManageStockOnEditPageActionGroup" stepKey="assertManageStock1"> + <argument name="manageStock" value="No"/> + </actionGroup> + <actionGroup ref="AdminSubmitAdvancedInventoryFormActionGroup" stepKey="clickDoneButtonOnAdvancedInventorySection1"/> + + <actionGroup ref="AdminAssertProductIsAssignedToCategoryActionGroup" stepKey="checkifProductIsAssignedToInitialCategory"> + <argument name="categoryName" value="$$initialCategoryEntity.name$$"/> + </actionGroup> + + <actionGroup ref="AdminAssertProductIsAssignedToCategoryActionGroup" stepKey="checkifProductIsAssignedToCategoryTwo"> + <argument name="categoryName" value="$$categoryEntity.name$$"/> + </actionGroup> + + <actionGroup ref="AdminAssertProductInfoOnEditPageActionGroup" stepKey="assertProductInfo"> + <argument name="product" value="simpleProductEnabledFlat"/> + </actionGroup> + + <actionGroup ref="StorefrontNavigateCategoryPageActionGroup" stepKey="openCategoryPage"> + <argument name="category" value="$categoryEntity$"/> + </actionGroup> + + <actionGroup ref="AssertStorefrontProductIsPresentOnCategoryPageActionGroup" stepKey="seeSimpleProductNameOnCategoryPage"> + <argument name="productName" value="{{simpleProductEnabledFlat.name}}"/> + </actionGroup> + + <actionGroup ref="OpenStoreFrontProductPageActionGroup" stepKey="goToProductPage"> + <argument name="productUrlKey" value="{{simpleProductEnabledFlat.urlKey}}"/> + </actionGroup> + + <actionGroup ref="StorefrontAssertProductNameOnProductPageActionGroup" stepKey="seeSimpleProductNameOnStoreFrontPage"> + <argument name="productName" value="{{simpleProductEnabledFlat.name}}"/> + </actionGroup> + <actionGroup ref="StorefrontAssertProductPriceOnProductPageActionGroup" stepKey="seeSimpleProductPriceOnStoreFrontPage"> + <argument name="productPrice" value="{{simpleProductEnabledFlat.price}}"/> + </actionGroup> + <actionGroup ref="StorefrontAssertProductSkuOnProductPageActionGroup" stepKey="seeSimpleProductSKUOnStoreFrontPage"> <argument name="productSku" value="{{simpleProductEnabledFlat.sku}}"/> </actionGroup> - <grabTextFrom selector="{{StorefrontProductInfoMainSection.productStockStatus}}" stepKey="productStockAvailableStatus"/> - <assertEquals stepKey="assertStockAvailableOnProductPage"> - <expectedResult type="string">{{simpleProductEnabledFlat.storefrontStatus}}</expectedResult> - <actualResult type="variable">productStockAvailableStatus</actualResult> - </assertEquals> - <grabTextFrom selector="{{StorefrontProductInfoMainSection.productPrice}}" stepKey="productPriceAmount"/> - <assertEquals stepKey="assertOldPriceTextOnProductPage"> - <expectedResult type="string">${{simpleProductEnabledFlat.price}}</expectedResult> - <actualResult type="variable">productPriceAmount</actualResult> - </assertEquals> - - <!--Verify customer see updated simple product link on magento storefront page and is searchable by sku --> - <amOnPage url="{{StorefrontProductPage.url(simpleProductEnabledFlat.urlKey)}}" stepKey="goToMagentoStorefrontPage"/> - <waitForPageLoad stepKey="waitForStoreFrontProductPageLoad"/> - <fillField selector="{{StorefrontQuickSearchResultsSection.searchTextBox}}" userInput="{{simpleProductEnabledFlat.sku}}" stepKey="fillSimpleProductSkuInSearchTextBox"/> - <waitForPageLoad stepKey="waitForSearchTextBox"/> - <click selector="{{StorefrontQuickSearchResultsSection.searchTextBoxButton}}" stepKey="clickSearchTextBoxButton"/> - <waitForPageLoad stepKey="waitForSearch"/> - <see selector="{{StorefrontQuickSearchResultsSection.productLink}}" userInput="{{simpleProductEnabledFlat.name}}" stepKey="seeSimpleProductNameOnMagentoStorefrontPage"/> + <actionGroup ref="StorefrontAssertProductStockStatusOnProductPageActionGroup" stepKey="seeSimpleProductStockStatusOnStoreFrontPage"> + <argument name="productStockStatus" value="{{simpleProductEnabledFlat.storefrontStatus}}"/> + </actionGroup> + + <actionGroup ref="StorefrontOpenHomePageActionGroup" stepKey="goToHomepage"/> + <actionGroup ref="StorefrontCheckQuickSearchStringActionGroup" stepKey="searchForSku"> + <argument name="phrase" value="{{simpleProductEnabledFlat.sku}}"/> + </actionGroup> + <actionGroup ref="StorefrontOpenProductFromQuickSearchActionGroup" stepKey="openAndCheckProduct"> + <argument name="productName" value="{{simpleProductEnabledFlat.name}}"/> + <argument name="productUrlKey" value="{{simpleProductEnabledFlat.urlKey}}"/> + </actionGroup> + </test> </tests> From e4fde6b8c5005c984c7f8dab1c6106c7f5649be5 Mon Sep 17 00:00:00 2001 From: Anna Pak <a.pak@atwix.com> Date: Wed, 9 Dec 2020 12:47:29 +0200 Subject: [PATCH 129/171] added deprecation, refactored --- ...AssertManageStockOnEditPageActionGroup.xml | 3 +- ...AssertProductInfoOnEditPageActionGroup.xml | 2 +- ...uctStockStatusOnProductPageActionGroup.xml | 3 +- ...ularPriceInStockEnabledFlatCatalogTest.xml | 122 ++++++++++++ ...WithRegularPriceInStockEnabledFlatTest.xml | 173 ++++++++++-------- 5 files changed, 224 insertions(+), 79 deletions(-) create mode 100644 app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockEnabledFlatCatalogTest.xml diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminAssertManageStockOnEditPageActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminAssertManageStockOnEditPageActionGroup.xml index f9c9098732476..67df650a24228 100644 --- a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminAssertManageStockOnEditPageActionGroup.xml +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminAssertManageStockOnEditPageActionGroup.xml @@ -10,7 +10,8 @@ xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> <actionGroup name="AdminAssertManageStockOnEditPageActionGroup"> <annotations> - <description>Check if manageStock value is correct (the Product Edit page should be opened in Admin prior this check).</description> + <description>Check if manageStock value is correct + (the Product Edit page->Advanced Inventory section should be opened in Admin prior this check).</description> </annotations> <arguments> <argument name="manageStock" type="string"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminAssertProductInfoOnEditPageActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminAssertProductInfoOnEditPageActionGroup.xml index b70c7a4d62dcf..bbfbcf584fa0a 100644 --- a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminAssertProductInfoOnEditPageActionGroup.xml +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminAssertProductInfoOnEditPageActionGroup.xml @@ -10,7 +10,7 @@ xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> <actionGroup name="AdminAssertProductInfoOnEditPageActionGroup"> <annotations> - <description>Validates next fields on the Edit Product Page: name, sku, price, quantity, stock status, tax class, weight, weigh select, visibility, url key</description> + <description>Validates next fields on the Product Edit Page: name, sku, price, quantity, stock status, tax class, weight, weigh select, visibility, url key</description> </annotations> <arguments> <argument name="product" type="entity"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontAssertProductStockStatusOnProductPageActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontAssertProductStockStatusOnProductPageActionGroup.xml index 356302ef26b9c..5af46bcd734d1 100644 --- a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontAssertProductStockStatusOnProductPageActionGroup.xml +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontAssertProductStockStatusOnProductPageActionGroup.xml @@ -9,7 +9,8 @@ xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> <actionGroup name="StorefrontAssertProductStockStatusOnProductPageActionGroup"> <annotations> - <description>Validate that the provided Product Stock Status is present and correct (the Product Detail page should be opened on Storefront prior this check)</description> + <description>Validates that the provided Product Stock Status is present and correct + (the Product Detail page should be opened on Storefront prior this check)</description> </annotations> <arguments> <argument name="productStockStatus" type="string"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockEnabledFlatCatalogTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockEnabledFlatCatalogTest.xml new file mode 100644 index 0000000000000..c083f827e8930 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockEnabledFlatCatalogTest.xml @@ -0,0 +1,122 @@ +<?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="AdminUpdateSimpleProductWithRegularPriceInStockEnabledFlatCatalogTest"> + <annotations> + <stories value="Update Simple Product"/> + <title value="Update Simple Product with Regular Price (In Stock) Enabled Flat"/> + <description value="Test log in to Update Simple Product and Update Simple Product with Regular Price (In Stock) Enabled Flat"/> + <testCaseId value="MC-10818"/> + <severity value="CRITICAL"/> + <group value="catalog"/> + <group value="mtf_migrated"/> + </annotations> + <before> + <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"> + <requiredEntity createDataKey="initialCategoryEntity"/> + </createData> + <createData entity="SimpleSubCategory" stepKey="categoryEntity"/> + </before> + <after> + <deleteData stepKey="deleteSimpleSubCategory" createDataKey="initialCategoryEntity"/> + <deleteData stepKey="deleteSimpleSubCategory2" createDataKey="categoryEntity"/> + <actionGroup ref="DeleteProductBySkuActionGroup" stepKey="deleteCreatedProduct"> + <argument name="sku" value="{{simpleProductEnabledFlat.sku}}"/> + </actionGroup> + <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> + <magentoCLI stepKey="unsetFlatCatalogProduct" command="config:set catalog/frontend/flat_catalog_product 0"/> + </after> + + <actionGroup ref="AdminClearFiltersActionGroup" stepKey="openProductCatalogPage"/> + <actionGroup ref="OpenEditProductOnBackendActionGroup" stepKey="openProductPage"> + <argument name="product" value="$$initialSimpleProduct$$"/> + </actionGroup> + + <actionGroup ref="AdminClickOnAdvancedInventoryLinkActionGroup" stepKey="clickAdvancedInventoryLink"/> + <actionGroup ref="AdminSetManageStockConfigActionGroup" stepKey="setManageStockConfig"> + <argument name="value" value="No"/> + </actionGroup> + <actionGroup ref="AdminSubmitAdvancedInventoryFormActionGroup" stepKey="clickDoneButtonOnAdvancedInventorySection"/> + + <actionGroup ref="AdminAssignTwoCategoriesToProductActionGroup" stepKey="assignCategories"> + <argument name="categoryName" value="$$initialCategoryEntity.name$$"/> + <argument name="categoryTwoName" value="$$categoryEntity.name$$"/> + </actionGroup> + + <actionGroup ref="AdminFillMainProductFormActionGroup" stepKey="fillSimpleProductInfo"> + <argument name="product" value="simpleProductEnabledFlat"/> + </actionGroup> + + <actionGroup ref="AdminProductFormSaveButtonClickActionGroup" stepKey="clickSaveButton"/> + + <see selector="{{AdminProductFormSection.successMessage}}" userInput="You saved the product." stepKey="seeSimpleProductSavedSuccessMessage"/> + + <actionGroup ref="AdminClearFiltersActionGroup" stepKey="openProductCatalogPage1"/> + <actionGroup ref="OpenEditProductOnBackendActionGroup" stepKey="openProductPage1"> + <argument name="product" value="simpleProductEnabledFlat"/> + </actionGroup> + + <actionGroup ref="AdminClickOnAdvancedInventoryLinkActionGroup" stepKey="clickTheAdvancedInventoryLink1"/> + <actionGroup ref="AdminAssertManageStockOnEditPageActionGroup" stepKey="assertManageStock1"> + <argument name="manageStock" value="No"/> + </actionGroup> + <actionGroup ref="AdminSubmitAdvancedInventoryFormActionGroup" stepKey="clickDoneButtonOnAdvancedInventorySection1"/> + + <actionGroup ref="AdminAssertProductIsAssignedToCategoryActionGroup" stepKey="checkifProductIsAssignedToInitialCategory"> + <argument name="categoryName" value="$$initialCategoryEntity.name$$"/> + </actionGroup> + + <actionGroup ref="AdminAssertProductIsAssignedToCategoryActionGroup" stepKey="checkifProductIsAssignedToCategoryTwo"> + <argument name="categoryName" value="$$categoryEntity.name$$"/> + </actionGroup> + + <actionGroup ref="AdminAssertProductInfoOnEditPageActionGroup" stepKey="assertProductInfo"> + <argument name="product" value="simpleProductEnabledFlat"/> + </actionGroup> + + <actionGroup ref="StorefrontNavigateCategoryPageActionGroup" stepKey="openCategoryPage"> + <argument name="category" value="$categoryEntity$"/> + </actionGroup> + + <actionGroup ref="AssertStorefrontProductIsPresentOnCategoryPageActionGroup" stepKey="seeSimpleProductNameOnCategoryPage"> + <argument name="productName" value="{{simpleProductEnabledFlat.name}}"/> + </actionGroup> + + <actionGroup ref="OpenStoreFrontProductPageActionGroup" stepKey="goToProductPage"> + <argument name="productUrlKey" value="{{simpleProductEnabledFlat.urlKey}}"/> + </actionGroup> + + <actionGroup ref="StorefrontAssertProductNameOnProductPageActionGroup" stepKey="seeSimpleProductNameOnStoreFrontPage"> + <argument name="productName" value="{{simpleProductEnabledFlat.name}}"/> + </actionGroup> + <actionGroup ref="StorefrontAssertProductPriceOnProductPageActionGroup" stepKey="seeSimpleProductPriceOnStoreFrontPage"> + <argument name="productPrice" value="{{simpleProductEnabledFlat.price}}"/> + </actionGroup> + <actionGroup ref="StorefrontAssertProductSkuOnProductPageActionGroup" stepKey="seeSimpleProductSKUOnStoreFrontPage"> + <argument name="productSku" value="{{simpleProductEnabledFlat.sku}}"/> + </actionGroup> + <actionGroup ref="StorefrontAssertProductStockStatusOnProductPageActionGroup" stepKey="seeSimpleProductStockStatusOnStoreFrontPage"> + <argument name="productStockStatus" value="{{simpleProductEnabledFlat.storefrontStatus}}"/> + </actionGroup> + + <actionGroup ref="StorefrontOpenHomePageActionGroup" stepKey="goToHomepage"/> + <actionGroup ref="StorefrontCheckQuickSearchStringActionGroup" stepKey="searchForSku"> + <argument name="phrase" value="{{simpleProductEnabledFlat.sku}}"/> + </actionGroup> + <actionGroup ref="StorefrontOpenProductFromQuickSearchActionGroup" stepKey="openAndCheckProduct"> + <argument name="productName" value="{{simpleProductEnabledFlat.name}}"/> + <argument name="productUrlKey" value="{{simpleProductEnabledFlat.urlKey}}"/> + </actionGroup> + + </test> +</tests> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockEnabledFlatTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockEnabledFlatTest.xml index 4bf15199f0db5..fd8be7be2ea5b 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockEnabledFlatTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockEnabledFlatTest.xml @@ -6,17 +6,20 @@ */ --> -<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> - <test name="AdminUpdateSimpleProductWithRegularPriceInStockEnabledFlatTest"> + <test name="AdminUpdateSimpleProductWithRegularPriceInStockEnabledFlatTest" deprecated="Use AdminUpdateSimpleProductWithRegularPriceInStockEnabledFlatCatalogTest instead"> <annotations> <stories value="Update Simple Product"/> - <title value="Update Simple Product with Regular Price (In Stock) Enabled Flat"/> + <title value="DEPREACTED. Update Simple Product with Regular Price (In Stock) Enabled Flat"/> <description value="Test log in to Update Simple Product and Update Simple Product with Regular Price (In Stock) Enabled Flat"/> <testCaseId value="MC-10818"/> <severity value="CRITICAL"/> <group value="catalog"/> <group value="mtf_migrated"/> + <skip> + <issueId value="DEPRECATED">Use AdminUpdateSimpleProductWithRegularPriceInStockEnabledFlatCatalogTest instead</issueId> + </skip> </annotations> <before> <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> @@ -37,86 +40,104 @@ <magentoCLI stepKey="unsetFlatCatalogProduct" command="config:set catalog/frontend/flat_catalog_product 0"/> </after> - <actionGroup ref="AdminClearFiltersActionGroup" stepKey="openProductCatalogPage"/> - <actionGroup ref="OpenEditProductOnBackendActionGroup" stepKey="openProductPage"> - <argument name="product" value="$$initialSimpleProduct$$"/> + <!-- Search default simple product in the grid page --> + <actionGroup ref="AdminProductCatalogPageOpenActionGroup" stepKey="openProductCatalogPage"/> + <actionGroup ref="FilterProductGridBySku2ActionGroup" stepKey="filterProductGrid"> + <argument name="sku" value="$$initialSimpleProduct.sku$$"/> </actionGroup> + <click selector="{{AdminProductGridFilterSection.nthRow('1')}}" stepKey="clickFirstRowToOpenDefaultSimpleProduct"/> + <waitForPageLoad stepKey="waitUntilProductIsOpened"/> + <!-- Update simple product with regular price --> + <fillField selector="{{AdminProductFormSection.productName}}" userInput="{{simpleProductEnabledFlat.name}}" stepKey="fillSimpleProductName"/> + <fillField selector="{{AdminProductFormSection.productSku}}" userInput="{{simpleProductEnabledFlat.sku}}" stepKey="fillSimpleProductSku"/> + <fillField selector="{{AdminProductFormSection.productPrice}}" userInput="{{simpleProductEnabledFlat.price}}" stepKey="fillSimpleProductPrice"/> + <selectOption selector="{{AdminProductFormSection.productTaxClass}}" userInput="{{simpleProductEnabledFlat.productTaxClass}}" stepKey="selectProductTaxClass"/> + <fillField selector="{{AdminProductFormSection.productQuantity}}" userInput="{{simpleProductEnabledFlat.quantity}}" stepKey="fillSimpleProductQuantity"/> <actionGroup ref="AdminClickOnAdvancedInventoryLinkActionGroup" stepKey="clickAdvancedInventoryLink"/> - <actionGroup ref="AdminSetManageStockConfigActionGroup" stepKey="setManageStockConfig"> - <argument name="value" value="No"/> - </actionGroup> + <conditionalClick selector="{{AdminProductFormAdvancedInventorySection.useConfigSettings}}" dependentSelector="{{AdminProductFormAdvancedInventorySection.useConfigSettings}}" visible="true" stepKey="checkUseConfigSettingsCheckBox"/> + <selectOption selector="{{AdminProductFormAdvancedInventorySection.manageStock}}" userInput="No" stepKey="selectManageStock"/> <actionGroup ref="AdminSubmitAdvancedInventoryFormActionGroup" stepKey="clickDoneButtonOnAdvancedInventorySection"/> - - <actionGroup ref="AdminAssignTwoCategoriesToProductActionGroup" stepKey="assignCategories"> - <argument name="categoryName" value="$$initialCategoryEntity.name$$"/> - <argument name="categoryTwoName" value="$$categoryEntity.name$$"/> - </actionGroup> - - <actionGroup ref="AdminFillMainProductFormActionGroup" stepKey="fillSimpleProductInfo"> - <argument name="product" value="simpleProductEnabledFlat"/> - </actionGroup> - + <selectOption selector="{{AdminProductFormSection.stockStatus}}" userInput="{{simpleProductEnabledFlat.status}}" stepKey="selectStockStatusInStock"/> + <fillField selector="{{AdminProductFormSection.productWeight}}" userInput="{{simpleProductEnabledFlat.weight}}" stepKey="fillSimpleProductWeight"/> + <selectOption selector="{{AdminProductFormSection.productWeightSelect}}" userInput="{{simpleProductEnabledFlat.weightSelect}}" stepKey="selectProductWeight"/> + <click selector="{{AdminProductFormSection.categoriesDropdown}}" stepKey="clickCategoriesDropDown"/> + <fillField selector="{{AdminProductFormSection.searchCategory}}" userInput="$$initialCategoryEntity.name$$" stepKey="fillSearchForInitialCategory" /> + <waitForPageLoad stepKey="waitForCategory1"/> + <click selector="{{AdminProductFormSection.selectCategory($$initialCategoryEntity.name$$)}}" stepKey="unselectInitialCategory"/> + <fillField selector="{{AdminProductFormSection.searchCategory}}" userInput="$$categoryEntity.name$$" stepKey="fillSearchCategory" /> + <waitForPageLoad stepKey="waitForCategory2"/> + <click selector="{{AdminProductFormSection.selectCategory($$categoryEntity.name$$)}}" stepKey="clickOnCategory"/> + <actionGroup ref="AdminSubmitCategoriesPopupActionGroup" stepKey="clickOnDoneAdvancedCategorySelect"/> + <selectOption selector="{{AdminProductFormSection.visibility}}" userInput="{{simpleProductEnabledFlat.visibility}}" stepKey="selectVisibility"/> + <click selector="{{AdminProductSEOSection.sectionHeader}}" stepKey="clickAdminProductSEOSection"/> + <fillField selector="{{AdminProductSEOSection.urlKeyInput}}" userInput="{{simpleProductEnabledFlat.urlKey}}" stepKey="fillUrlKey"/> + <scrollToTopOfPage stepKey="scrollToTopOfAdminProductFormSection"/> <actionGroup ref="AdminProductFormSaveButtonClickActionGroup" stepKey="clickSaveButton"/> - <see selector="{{AdminProductFormSection.successMessage}}" userInput="You saved the product." stepKey="seeSimpleProductSavedSuccessMessage"/> - - <actionGroup ref="AdminClearFiltersActionGroup" stepKey="openProductCatalogPage1"/> - <actionGroup ref="OpenEditProductOnBackendActionGroup" stepKey="openProductPage1"> - <argument name="product" value="simpleProductEnabledFlat"/> - </actionGroup> - - <actionGroup ref="AdminClickOnAdvancedInventoryLinkActionGroup" stepKey="clickTheAdvancedInventoryLink1"/> - <actionGroup ref="AdminAssertManageStockOnEditPageActionGroup" stepKey="assertManageStock1"> - <argument name="manageStock" value="No"/> - </actionGroup> - <actionGroup ref="AdminSubmitAdvancedInventoryFormActionGroup" stepKey="clickDoneButtonOnAdvancedInventorySection1"/> - - <actionGroup ref="AdminAssertProductIsAssignedToCategoryActionGroup" stepKey="checkifProductIsAssignedToInitialCategory"> - <argument name="categoryName" value="$$initialCategoryEntity.name$$"/> - </actionGroup> - - <actionGroup ref="AdminAssertProductIsAssignedToCategoryActionGroup" stepKey="checkifProductIsAssignedToCategoryTwo"> - <argument name="categoryName" value="$$categoryEntity.name$$"/> - </actionGroup> - - <actionGroup ref="AdminAssertProductInfoOnEditPageActionGroup" stepKey="assertProductInfo"> - <argument name="product" value="simpleProductEnabledFlat"/> - </actionGroup> - - <actionGroup ref="StorefrontNavigateCategoryPageActionGroup" stepKey="openCategoryPage"> - <argument name="category" value="$categoryEntity$"/> - </actionGroup> - - <actionGroup ref="AssertStorefrontProductIsPresentOnCategoryPageActionGroup" stepKey="seeSimpleProductNameOnCategoryPage"> - <argument name="productName" value="{{simpleProductEnabledFlat.name}}"/> - </actionGroup> - - <actionGroup ref="OpenStoreFrontProductPageActionGroup" stepKey="goToProductPage"> - <argument name="productUrlKey" value="{{simpleProductEnabledFlat.urlKey}}"/> - </actionGroup> - - <actionGroup ref="StorefrontAssertProductNameOnProductPageActionGroup" stepKey="seeSimpleProductNameOnStoreFrontPage"> - <argument name="productName" value="{{simpleProductEnabledFlat.name}}"/> - </actionGroup> - <actionGroup ref="StorefrontAssertProductPriceOnProductPageActionGroup" stepKey="seeSimpleProductPriceOnStoreFrontPage"> - <argument name="productPrice" value="{{simpleProductEnabledFlat.price}}"/> - </actionGroup> - <actionGroup ref="StorefrontAssertProductSkuOnProductPageActionGroup" stepKey="seeSimpleProductSKUOnStoreFrontPage"> + <!-- Verify customer see success message --> + <see selector="{{AdminProductFormSection.successMessage}}" userInput="You saved the product." stepKey="seeAssertSimpleProductSaveSuccessMessage"/> + + <!-- Search updated simple product(from above step) in the grid page --> + <actionGroup ref="AdminProductCatalogPageOpenActionGroup" stepKey="openProductCatalogPageToSearchUpdatedSimpleProduct"/> + <conditionalClick selector="{{AdminProductGridFilterSection.clearAll}}" dependentSelector="{{AdminProductGridFilterSection.clearAll}}" visible="true" stepKey="clickClearAll"/> + <click selector="{{AdminProductGridFilterSection.filters}}" stepKey="clickFiltersButton"/> + <fillField selector="{{AdminProductGridFilterSection.nameFilter}}" userInput="{{simpleProductEnabledFlat.name}}" stepKey="fillSimpleProductNameInNameFilter"/> + <fillField selector="{{AdminProductGridFilterSection.skuFilter}}" userInput="{{simpleProductEnabledFlat.sku}}" stepKey="fillProductSku"/> + <click selector="{{AdminProductGridFilterSection.applyFilters}}" stepKey="clickApplyFiltersButton"/> + <click selector="{{AdminProductGridFilterSection.nthRow('1')}}" stepKey="clickFirstRowToVerifyUpdatedSimpleProductVisibleInGrid"/> + <waitForPageLoad stepKey="waitUntilSimpleProductPageIsOpened"/> + + <!-- Verify customer see updated simple product in the product form page --> + <seeInField selector="{{AdminProductFormSection.productName}}" userInput="{{simpleProductEnabledFlat.name}}" stepKey="seeSimpleProductName"/> + <seeInField selector="{{AdminProductFormSection.productSku}}" userInput="{{simpleProductEnabledFlat.sku}}" stepKey="seeSimpleProductSku"/> + <seeInField selector="{{AdminProductFormSection.productPrice}}" userInput="{{simpleProductEnabledFlat.price}}" stepKey="seeSimpleProductPrice"/> + <seeInField selector="{{AdminProductFormSection.productTaxClass}}" userInput="{{simpleProductEnabledFlat.productTaxClass}}" stepKey="seeProductTaxClass"/> + <seeInField selector="{{AdminProductFormSection.productQuantity}}" userInput="{{simpleProductEnabledFlat.quantity}}" stepKey="seeSimpleProductQuantity"/> + <actionGroup ref="AdminClickOnAdvancedInventoryLinkActionGroup" stepKey="clickTheAdvancedInventoryLink"/> + <see selector="{{AdminProductFormAdvancedInventorySection.manageStock}}" userInput="No" stepKey="seeManageStock"/> + <click selector="{{AdminProductFormAdvancedInventorySection.advancedInventoryCloseButton}}" stepKey="clickDoneButtonOnAdvancedInventory"/> + <seeInField selector="{{AdminProductFormSection.productStockStatus}}" userInput="{{simpleProductEnabledFlat.status}}" stepKey="seeSimpleProductStockStatus"/> + <seeInField selector="{{AdminProductFormSection.productWeight}}" userInput="{{simpleProductEnabledFlat.weight}}" stepKey="seeSimpleProductWeight"/> + <seeInField selector="{{AdminProductFormSection.productWeightSelect}}" userInput="{{simpleProductEnabledFlat.weightSelect}}" stepKey="seeSimpleProductWeightSelect"/> + <click selector="{{AdminProductFormSection.categoriesDropdown}}" stepKey="clickCategoriesDropDownToVerify"/> + <see selector="{{AdminProductFormSection.selectMultipleCategories}}" userInput="$$categoryEntity.name$$" stepKey="seeSelectedCategories" /> + <seeInField selector="{{AdminProductFormSection.visibility}}" userInput="{{simpleProductEnabledFlat.visibility}}" stepKey="seeVisibility"/> + <scrollTo selector="{{AdminProductSEOSection.sectionHeader}}" x="0" y="-80" stepKey="scrollToAdminProductSEOSection1"/> + <click selector="{{AdminProductSEOSection.sectionHeader}}" stepKey="clickAdminProductSEOSection1"/> + <seeInField selector="{{AdminProductSEOSection.urlKeyInput}}" userInput="{{simpleProductEnabledFlat.urlKey}}" stepKey="seeUrlKey"/> + + <!--Verify customer see updated simple product link on category page --> + <amOnPage url="{{StorefrontCategoryPage.url($$categoryEntity.name$$)}}" stepKey="openCategoryPage"/> + <waitForPageLoad stepKey="waitForCategoryPageLoad"/> + <see selector="{{StorefrontCategoryMainSection.productLink}}" userInput="{{simpleProductEnabledFlat.name}}" stepKey="seeSimpleProductNameOnCategoryPage"/> + + <!-- Verify customer see updated simple product (from the above step) on the storefront page --> + <amOnPage url="{{StorefrontProductPage.url(simpleProductEnabledFlat.urlKey)}}" stepKey="goToProductPage"/> + <waitForPageLoad stepKey="waitForStorefrontProductPageLoad"/> + <see selector="{{StorefrontProductInfoMainSection.productName}}" userInput="{{simpleProductEnabledFlat.name}}" stepKey="seeSimpleProductNameOnStoreFrontPage"/> + <see selector="{{StorefrontProductInfoMainSection.productPrice}}" userInput="{{simpleProductEnabledFlat.price}}" stepKey="seeSimpleProductPriceOnStoreFrontPage"/> + <actionGroup ref="StorefrontAssertProductSkuOnProductPageActionGroup" stepKey="seeSimpleProductSkuOnStoreFrontPage"> <argument name="productSku" value="{{simpleProductEnabledFlat.sku}}"/> </actionGroup> - <actionGroup ref="StorefrontAssertProductStockStatusOnProductPageActionGroup" stepKey="seeSimpleProductStockStatusOnStoreFrontPage"> - <argument name="productStockStatus" value="{{simpleProductEnabledFlat.storefrontStatus}}"/> - </actionGroup> - - <actionGroup ref="StorefrontOpenHomePageActionGroup" stepKey="goToHomepage"/> - <actionGroup ref="StorefrontCheckQuickSearchStringActionGroup" stepKey="searchForSku"> - <argument name="phrase" value="{{simpleProductEnabledFlat.sku}}"/> - </actionGroup> - <actionGroup ref="StorefrontOpenProductFromQuickSearchActionGroup" stepKey="openAndCheckProduct"> - <argument name="productName" value="{{simpleProductEnabledFlat.name}}"/> - <argument name="productUrlKey" value="{{simpleProductEnabledFlat.urlKey}}"/> - </actionGroup> - + <grabTextFrom selector="{{StorefrontProductInfoMainSection.productStockStatus}}" stepKey="productStockAvailableStatus"/> + <assertEquals stepKey="assertStockAvailableOnProductPage"> + <expectedResult type="string">{{simpleProductEnabledFlat.storefrontStatus}}</expectedResult> + <actualResult type="variable">productStockAvailableStatus</actualResult> + </assertEquals> + <grabTextFrom selector="{{StorefrontProductInfoMainSection.productPrice}}" stepKey="productPriceAmount"/> + <assertEquals stepKey="assertOldPriceTextOnProductPage"> + <expectedResult type="string">${{simpleProductEnabledFlat.price}}</expectedResult> + <actualResult type="variable">productPriceAmount</actualResult> + </assertEquals> + + <!--Verify customer see updated simple product link on magento storefront page and is searchable by sku --> + <amOnPage url="{{StorefrontProductPage.url(simpleProductEnabledFlat.urlKey)}}" stepKey="goToMagentoStorefrontPage"/> + <waitForPageLoad stepKey="waitForStoreFrontProductPageLoad"/> + <fillField selector="{{StorefrontQuickSearchResultsSection.searchTextBox}}" userInput="{{simpleProductEnabledFlat.sku}}" stepKey="fillSimpleProductSkuInSearchTextBox"/> + <waitForPageLoad stepKey="waitForSearchTextBox"/> + <click selector="{{StorefrontQuickSearchResultsSection.searchTextBoxButton}}" stepKey="clickSearchTextBoxButton"/> + <waitForPageLoad stepKey="waitForSearch"/> + <see selector="{{StorefrontQuickSearchResultsSection.productLink}}" userInput="{{simpleProductEnabledFlat.name}}" stepKey="seeSimpleProductNameOnMagentoStorefrontPage"/> </test> </tests> From 1dd1046fba15c8b72e50cd2114a554fd65b06eea Mon Sep 17 00:00:00 2001 From: Anna Pak <a.pak@atwix.com> Date: Wed, 9 Dec 2020 12:55:09 +0200 Subject: [PATCH 130/171] fixed a typo --- .../AdminAssertProductInfoOnEditPageActionGroup.xml | 3 ++- ...dateSimpleProductWithRegularPriceInStockEnabledFlatTest.xml | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminAssertProductInfoOnEditPageActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminAssertProductInfoOnEditPageActionGroup.xml index bbfbcf584fa0a..ba67168958fca 100644 --- a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminAssertProductInfoOnEditPageActionGroup.xml +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminAssertProductInfoOnEditPageActionGroup.xml @@ -10,7 +10,8 @@ xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> <actionGroup name="AdminAssertProductInfoOnEditPageActionGroup"> <annotations> - <description>Validates next fields on the Product Edit Page: name, sku, price, quantity, stock status, tax class, weight, weigh select, visibility, url key</description> + <description>Validates next fields on the Product Edit Page: + name, sku, price, quantity, stock status, tax class, weight, weigh select, visibility, url key</description> </annotations> <arguments> <argument name="product" type="entity"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockEnabledFlatTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockEnabledFlatTest.xml index fd8be7be2ea5b..c1b80b94179fa 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockEnabledFlatTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockEnabledFlatTest.xml @@ -11,7 +11,7 @@ <test name="AdminUpdateSimpleProductWithRegularPriceInStockEnabledFlatTest" deprecated="Use AdminUpdateSimpleProductWithRegularPriceInStockEnabledFlatCatalogTest instead"> <annotations> <stories value="Update Simple Product"/> - <title value="DEPREACTED. Update Simple Product with Regular Price (In Stock) Enabled Flat"/> + <title value="DEPRECACTED. Update Simple Product with Regular Price (In Stock) Enabled Flat"/> <description value="Test log in to Update Simple Product and Update Simple Product with Regular Price (In Stock) Enabled Flat"/> <testCaseId value="MC-10818"/> <severity value="CRITICAL"/> From ff979509acc574f3f95a3cdd19c685eba7645a49 Mon Sep 17 00:00:00 2001 From: "vadim.malesh" <engcom-vendorworker-charlie@adobe.com> Date: Wed, 9 Dec 2020 13:27:07 +0200 Subject: [PATCH 131/171] fix for document type --- app/code/Magento/Dhl/Model/Carrier.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/Dhl/Model/Carrier.php b/app/code/Magento/Dhl/Model/Carrier.php index 0f853561571af..513e15c2a4dc4 100644 --- a/app/code/Magento/Dhl/Model/Carrier.php +++ b/app/code/Magento/Dhl/Model/Carrier.php @@ -1776,7 +1776,7 @@ protected function _shipmentDetails($xml, $rawRequest, $originRegion = '') $nodeShipmentDetails->addChild('DoorTo', 'DD'); $nodeShipmentDetails->addChild('DimensionUnit', substr($this->_getDimensionUnit(), 0, 1)); $contentType = isset($package['params']['container']) ? $package['params']['container'] : ''; - $packageType = $contentType === self::DHL_CONTENT_TYPE_NON_DOC ? 'CP' : ''; + $packageType = $contentType === self::DHL_CONTENT_TYPE_NON_DOC ? 'CP' : 'EE'; $nodeShipmentDetails->addChild('PackageType', $packageType); if ($this->isDutiable($rawRequest->getOrigCountryId(), $rawRequest->getDestCountryId())) { $nodeShipmentDetails->addChild('IsDutiable', 'Y'); From c5d2d01e33958ac4d1fdffa5dd0c95aac3c474cc Mon Sep 17 00:00:00 2001 From: Sergiy Vasiutynskyi <s.vasiutynskyi@atwix.com> Date: Wed, 9 Dec 2020 16:16:25 +0200 Subject: [PATCH 132/171] Removed usage or changed value of CliIndexerReindexActionGroup action group for Catalog module --- ...utOfStockProductIsVisibleInCategoryTest.xml | 5 +---- .../AdminCreateCategoryWithAnchorFieldTest.xml | 5 +---- ...tiveFlatCategoryAndUpdateAsInactiveTest.xml | 14 +++----------- .../AdminCreateInactiveFlatCategoryTest.xml | 12 +++--------- ...minCreateInactiveInMenuFlatCategoryTest.xml | 12 +++--------- ...eateProductAttributeFromProductPageTest.xml | 5 +---- ...AdminCreateSimpleProductWithUnicodeTest.xml | 4 +--- ...hCustomOptionsSuiteAndImportOptionsTest.xml | 4 +--- ...inCreateVirtualProductWithTierPriceTest.xml | 5 +---- ...ProductsImageInCaseOfMultipleStoresTest.xml | 9 ++------- ...tCustomizableOptionToProductWithSKUTest.xml | 5 +---- ...veAnchoredCategoryToDefaultCategoryTest.xml | 5 +---- ...dminMoveCategoryAndCheckUrlRewritesTest.xml | 5 +---- ...eCategoryFromParentAnchoredCategoryTest.xml | 5 +---- ...signedToCategoryWithoutCustomURLKeyTest.xml | 5 +---- .../AdminRemoveImageAffectsAllScopesTest.xml | 4 +--- .../Mftf/Test/AdminSortingByWebsitesTest.xml | 4 +--- ...minUpdateFlatCategoryAndAddProductsTest.xml | 18 ++++-------------- ...dateFlatCategoryIncludeInNavigationTest.xml | 3 +-- ...torefrontProductNameWithDoubleQuoteTest.xml | 5 +---- 20 files changed, 30 insertions(+), 104 deletions(-) diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCheckOutOfStockProductIsVisibleInCategoryTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCheckOutOfStockProductIsVisibleInCategoryTest.xml index 9c1ff43587a27..db789d3512acf 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCheckOutOfStockProductIsVisibleInCategoryTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCheckOutOfStockProductIsVisibleInCategoryTest.xml @@ -69,10 +69,7 @@ </actionGroup> <actionGroup ref="AdminSubmitAdvancedInventoryFormActionGroup" stepKey="clickDoneButton"/> <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct"/> - <!--Run re-index task --> - <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> - <argument name="indices" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> <!--Verify product is visible in category front page --> <actionGroup ref="StorefrontOpenHomePageActionGroup" stepKey="goToHomepage"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateCategoryWithAnchorFieldTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateCategoryWithAnchorFieldTest.xml index 3332bc66653e5..8d0534891a29b 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateCategoryWithAnchorFieldTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateCategoryWithAnchorFieldTest.xml @@ -70,10 +70,7 @@ <argument name="targetPath" value="catalog/category/view/id/{$categoryId}"/> </actionGroup> - <!--Clear cache and reindex--> - <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> - <argument name="indices" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> <argument name="tags" value=""/> </actionGroup> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateInactiveFlatCategoryAndUpdateAsInactiveTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateInactiveFlatCategoryAndUpdateAsInactiveTest.xml index 500c95d1120f3..7447c75a778af 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateInactiveFlatCategoryAndUpdateAsInactiveTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateInactiveFlatCategoryAndUpdateAsInactiveTest.xml @@ -30,10 +30,7 @@ <actionGroup ref="CreateStoreViewActionGroup" stepKey="createCustomStoreViewFr"> <argument name="storeView" value="customStoreFR"/> </actionGroup> - <!--Run full reindex and clear caches --> - <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> - <argument name="indices" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> <argument name="tags" value=""/> </actionGroup> @@ -47,9 +44,7 @@ <after> <magentoCLI stepKey="setFlatCatalogCategory" command="config:set catalog/frontend/flat_catalog_category 0 "/> <magentoCLI stepKey="setIndexerMode" command="indexer:set-mode" arguments="realtime" /> - <actionGroup ref="CliIndexerReindexActionGroup" stepKey="indexerReindex"> - <argument name="indices" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="indexerReindex"/> <deleteData stepKey="deleteCategory" createDataKey="createCategory"/> <actionGroup ref="AdminDeleteStoreViewActionGroup" stepKey="deleteStoreViewEn"> <argument name="customStore" value="customStoreEN"/> @@ -68,10 +63,7 @@ <seeElement selector="{{AdminCategoryMessagesSection.SuccessMessage}}" stepKey="seeSuccessMessage"/> <see selector="{{AdminCategoryContentSection.categoryPageTitle}}" userInput="{{CatNotActive.name}}" stepKey="seeUpdatedCategoryTitle"/> <dontSeeCheckboxIsChecked selector="{{AdminCategoryBasicFieldSection.enableCategoryLabel}}" stepKey="verifyInactiveCategory"/> - <!--Run full reindex and clear caches --> - <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> - <argument name="indices" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> <argument name="tags" value=""/> </actionGroup> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateInactiveFlatCategoryTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateInactiveFlatCategoryTest.xml index 2394b41502f84..df2124759686d 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateInactiveFlatCategoryTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateInactiveFlatCategoryTest.xml @@ -30,10 +30,7 @@ <actionGroup ref="CreateStoreViewActionGroup" stepKey="createCustomStoreViewFr"> <argument name="storeView" value="customStoreFR"/> </actionGroup> - <!--Run full reindex and clear caches --> - <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> - <argument name="indices" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> <argument name="tags" value=""/> </actionGroup> @@ -47,9 +44,7 @@ <after> <magentoCLI stepKey="setFlatCatalogCategory" command="config:set catalog/frontend/flat_catalog_category 0 "/> <magentoCLI stepKey="setIndexerMode" command="indexer:set-mode" arguments="realtime" /> - <actionGroup ref="CliIndexerReindexActionGroup" stepKey="indexerReindex"> - <argument name="indices" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="indexerReindex"/> <deleteData stepKey="deleteCategory" createDataKey="createCategory"/> <actionGroup ref="AdminDeleteStoreViewActionGroup" stepKey="deleteStoreViewEn"> <argument name="customStore" value="customStoreEN"/> @@ -69,9 +64,8 @@ <seeElement selector="{{AdminCategoryMessagesSection.SuccessMessage}}" stepKey="seeSuccessMessage"/> <see selector="{{AdminCategoryContentSection.categoryPageTitle}}" userInput="{{SimpleSubCategory.name}}" stepKey="seeUpdatedCategoryTitle"/> <dontSeeCheckboxIsChecked selector="{{AdminCategoryBasicFieldSection.enableCategoryLabel}}" stepKey="verifyInactiveIncludeInMenu"/> - <!--Run full reindex and clear caches --> <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> - <argument name="indices" value=""/> + <argument name="indices" value="catalog_category_flat"/> </actionGroup> <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> <argument name="tags" value=""/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateInactiveInMenuFlatCategoryTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateInactiveInMenuFlatCategoryTest.xml index 35e53273aebf2..2f86209da1eba 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateInactiveInMenuFlatCategoryTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateInactiveInMenuFlatCategoryTest.xml @@ -30,10 +30,7 @@ <actionGroup ref="CreateStoreViewActionGroup" stepKey="createCustomStoreViewFr"> <argument name="storeView" value="customStoreFR"/> </actionGroup> - <!--Run full reindex and clear caches --> - <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> - <argument name="indices" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> <argument name="tags" value=""/> </actionGroup> @@ -47,9 +44,7 @@ <after> <magentoCLI stepKey="setFlatCatalogCategory" command="config:set catalog/frontend/flat_catalog_category 0 "/> <magentoCLI stepKey="setIndexerMode" command="indexer:set-mode" arguments="realtime" /> - <actionGroup ref="CliIndexerReindexActionGroup" stepKey="indexerReindex"> - <argument name="indices" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="indexerReindex"/> <actionGroup ref="AdminDeleteStoreViewActionGroup" stepKey="deleteStoreViewEn"> <argument name="customStore" value="customStoreEN"/> </actionGroup> @@ -70,9 +65,8 @@ <seeElement selector="{{AdminCategoryMessagesSection.SuccessMessage}}" stepKey="seeSuccessMessage"/> <see selector="{{AdminCategoryContentSection.categoryPageTitle}}" userInput="{{SimpleSubCategory.name}}" stepKey="seeUpdatedCategoryTitle"/> <dontSeeCheckboxIsChecked selector="{{AdminCategoryBasicFieldSection.includeInMenuLabel}}" stepKey="verifyInactiveIncludeInMenu"/> - <!--Run full reindex and clear caches --> <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> - <argument name="indices" value=""/> + <argument name="indices" value="catalog_category_flat"/> </actionGroup> <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> <argument name="tags" value=""/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateProductAttributeFromProductPageTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateProductAttributeFromProductPageTest.xml index 61ef389c7909e..2619e5e415686 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateProductAttributeFromProductPageTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateProductAttributeFromProductPageTest.xml @@ -88,10 +88,7 @@ <actionGroup ref="AdminProductFormSaveButtonClickActionGroup" stepKey="saveTheProduct"/> <see selector="{{AdminCategoryMessagesSection.SuccessMessage}}" userInput="You saved the product." stepKey="messageYouSavedTheProductIsShown"/> - <!--Run Re-Index task --> - <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> - <argument name="indices" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> <!--Verify product attribute added in product form --> <scrollTo selector="{{AdminProductFormSection.contentTab}}" stepKey="scrollToContentTab"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateSimpleProductWithUnicodeTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateSimpleProductWithUnicodeTest.xml index 54c3a05651c44..a00714e412b0a 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateSimpleProductWithUnicodeTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateSimpleProductWithUnicodeTest.xml @@ -31,9 +31,7 @@ <argument name="category" value="$$createPreReqCategory$$"/> <argument name="simpleProduct" value="ProductWithUnicode"/> </actionGroup> - <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> - <argument name="indices" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> <argument name="tags" value=""/> </actionGroup> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateVirtualProductWithCustomOptionsSuiteAndImportOptionsTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateVirtualProductWithCustomOptionsSuiteAndImportOptionsTest.xml index 7871f4305575a..3141db87f6976 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateVirtualProductWithCustomOptionsSuiteAndImportOptionsTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateVirtualProductWithCustomOptionsSuiteAndImportOptionsTest.xml @@ -117,9 +117,7 @@ <!-- Verify we see success message --> <see selector="{{AdminProductFormSection.successMessage}}" userInput="You saved the product." stepKey="seeAssertVirtualProductSuccessMessage"/> - <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> - <argument name="indices" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> <argument name="tags" value=""/> </actionGroup> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateVirtualProductWithTierPriceTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateVirtualProductWithTierPriceTest.xml index 994ea76ca33df..f2840758d59a6 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateVirtualProductWithTierPriceTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateVirtualProductWithTierPriceTest.xml @@ -95,10 +95,7 @@ <waitForPageLoad stepKey="waitForCategoryPageToLoad"/> <see selector="{{StorefrontCategoryMainSection.productLink}}" userInput="{{virtualProductBigQty.name}}" stepKey="seeVirtualProductNameOnCategoryPage"/> - <!--Run full reindex and clear caches --> - <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> - <argument name="indices" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> <argument name="tags" value=""/> </actionGroup> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminDeleteProductsImageInCaseOfMultipleStoresTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminDeleteProductsImageInCaseOfMultipleStoresTest.xml index 7e5ee977d679b..3514f53e8b937 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminDeleteProductsImageInCaseOfMultipleStoresTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminDeleteProductsImageInCaseOfMultipleStoresTest.xml @@ -65,9 +65,7 @@ <actionGroup ref="AdminDeleteWebsiteActionGroup" stepKey="deleteWebsite"> <argument name="websiteName" value="{{NewWebSiteData.name}}"/> </actionGroup> - <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> - <argument name="indices" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> <argument name="tags" value=""/> </actionGroup> @@ -96,10 +94,7 @@ <argument name="website" value="{{NewWebSiteData.name}}"/> </actionGroup> <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct2"/> - <!--Reindex and flush cache--> - <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> - <argument name="indices" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> <argument name="tags" value=""/> </actionGroup> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminImportCustomizableOptionToProductWithSKUTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminImportCustomizableOptionToProductWithSKUTest.xml index af31b7c1d5c07..4dd76e55f9330 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminImportCustomizableOptionToProductWithSKUTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminImportCustomizableOptionToProductWithSKUTest.xml @@ -31,10 +31,7 @@ <requiredEntity createDataKey="createCategory"/> </createData> - <!-- TODO: REMOVE AFTER FIX MC-21717 --> - <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> - <argument name="indices" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> <argument name="tags" value=""/> </actionGroup> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminMoveAnchoredCategoryToDefaultCategoryTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminMoveAnchoredCategoryToDefaultCategoryTest.xml index 809a015369ea9..3da19eb598012 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminMoveAnchoredCategoryToDefaultCategoryTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminMoveAnchoredCategoryToDefaultCategoryTest.xml @@ -65,10 +65,7 @@ <actionGroup ref="AdminSaveCategoryActionGroup" stepKey="saveSubCategory2"/> <seeElement selector="{{AdminCategoryMessagesSection.SuccessMessage}}" stepKey="seeSuccessMessage2"/> - <!-- TODO: REMOVE AFTER FIX MC-21717 --> - <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> - <argument name="indices" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> <argument name="tags" value=""/> </actionGroup> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminMoveCategoryAndCheckUrlRewritesTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminMoveCategoryAndCheckUrlRewritesTest.xml index 9100e6027a52f..1c55b09151cf3 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminMoveCategoryAndCheckUrlRewritesTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminMoveCategoryAndCheckUrlRewritesTest.xml @@ -22,10 +22,7 @@ <createData entity="FirstLevelSubCat" stepKey="createDefaultCategory"> <field key="is_active">true</field> </createData> - <!-- Perform reindex and flush cache --> - <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> - <argument name="indices" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> <argument name="tags" value=""/> </actionGroup> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminMoveCategoryFromParentAnchoredCategoryTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminMoveCategoryFromParentAnchoredCategoryTest.xml index 0e056e4bb7078..fe3ffbb4fc1d7 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminMoveCategoryFromParentAnchoredCategoryTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminMoveCategoryFromParentAnchoredCategoryTest.xml @@ -56,10 +56,7 @@ <actionGroup ref="AdminSaveCategoryActionGroup" stepKey="saveSubCategory1"/> <seeElement selector="{{AdminCategoryMessagesSection.SuccessMessage}}" stepKey="seeSuccessMessage"/> - <!--Run re-index task --> - <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> - <argument name="indices" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> <!--Verify category displayed in store front page--> <amOnPage url="/$$createDefaultCategory.name$$/{{SimpleSubCategory.name}}.html" stepKey="seeTheCategoryInStoreFrontPage"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminProductCustomURLKeyPreservedWhenAssignedToCategoryWithoutCustomURLKeyTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminProductCustomURLKeyPreservedWhenAssignedToCategoryWithoutCustomURLKeyTest.xml index 8e728fc6e1f27..e06a7f3c5679c 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminProductCustomURLKeyPreservedWhenAssignedToCategoryWithoutCustomURLKeyTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminProductCustomURLKeyPreservedWhenAssignedToCategoryWithoutCustomURLKeyTest.xml @@ -34,10 +34,7 @@ <argument name="customStore" value="storeViewData"/> </actionGroup> - <!--Run full reindex and clear caches --> - <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> - <argument name="indices" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> <argument name="tags" value="full_page"/> </actionGroup> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminRemoveImageAffectsAllScopesTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminRemoveImageAffectsAllScopesTest.xml index 1707fda9e3edb..e989aa3758cf3 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminRemoveImageAffectsAllScopesTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminRemoveImageAffectsAllScopesTest.xml @@ -65,9 +65,7 @@ </actionGroup> <deleteData createDataKey="category" stepKey="deletePreReqCategory"/> <deleteData createDataKey="product" stepKey="deleteFirstProduct"/> - <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> - <argument name="indices" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> <argument name="tags" value=""/> </actionGroup> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminSortingByWebsitesTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminSortingByWebsitesTest.xml index 73aeed3af4fb0..f5046faf82b6f 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminSortingByWebsitesTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminSortingByWebsitesTest.xml @@ -45,9 +45,7 @@ <actionGroup ref="AdminOpenCatalogProductPageActionGroup" stepKey="goToProductCatalogPage"/> <actionGroup ref="ResetProductGridToDefaultViewActionGroup" stepKey="resetProductGridColumnsInitial"/> <actionGroup ref="ResetWebUrlOptionsActionGroup" stepKey="resetUrlOption"/> - <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> - <argument name="indices" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> <argument name="tags" value=""/> </actionGroup> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateFlatCategoryAndAddProductsTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateFlatCategoryAndAddProductsTest.xml index 208b588493112..f7f87da77b401 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateFlatCategoryAndAddProductsTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateFlatCategoryAndAddProductsTest.xml @@ -35,9 +35,7 @@ <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> <argument name="tags" value=""/> </actionGroup> - <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> - <argument name="indices" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> <!--Enable Flat Catalog Category --> <magentoCLI stepKey="setFlatCatalogCategory" command="config:set catalog/frontend/flat_catalog_category 1"/> <!--Open Index Management Page and Select Index mode "Update by Schedule" --> @@ -48,9 +46,7 @@ <after> <magentoCLI stepKey="setFlatCatalogCategory" command="config:set catalog/frontend/flat_catalog_category 0 "/> <magentoCLI stepKey="setIndexersMode" command="indexer:set-mode" arguments="realtime" /> - <actionGroup ref="CliIndexerReindexActionGroup" stepKey="indexerReindex"> - <argument name="indices" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="indexerReindex"/> <actionGroup ref="AdminDeleteStoreViewActionGroup" stepKey="deleteStoreViewEn"> <argument name="customStore" value="customStoreEN"/> </actionGroup> @@ -61,10 +57,7 @@ <deleteData createDataKey="createSimpleProduct" stepKey="deleteSimpleProduct"/> <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> </after> - <!-- Select Created Category--> - <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindexBeforeFlow"> - <argument name="indices" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindexBeforeFlow"/> <actionGroup ref="AdminOpenCategoryPageActionGroup" stepKey="openAdminCategoryIndexPage"/> <actionGroup ref="AdminExpandCategoryTreeActionGroup" stepKey="clickOnExpandTree"/> <click selector="{{AdminCategorySidebarTreeSection.categoryInTree(SimpleSubCategory.name)}}" stepKey="selectCreatedCategory"/> @@ -82,10 +75,7 @@ <click selector="{{AdminCategoryContentSection.productTableRow}}" stepKey="selectProductFromTableRow"/> <actionGroup ref="AdminSaveCategoryActionGroup" stepKey="saveSubCategory"/> <seeElement selector="{{AdminCategoryMessagesSection.SuccessMessage}}" stepKey="seeSuccessMessage"/> - <!--Open Index Management Page and verify flat categoryIndex status--> - <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> - <argument name="indices" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> <argument name="tags" value=""/> </actionGroup> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateFlatCategoryIncludeInNavigationTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateFlatCategoryIncludeInNavigationTest.xml index a688dea47a0c4..b316e3194c986 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateFlatCategoryIncludeInNavigationTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateFlatCategoryIncludeInNavigationTest.xml @@ -64,9 +64,8 @@ <click selector="{{AdminCategoryBasicFieldSection.includeInMenuLabel}}" stepKey="enableIncludeInMenuOption"/> <actionGroup ref="AdminSaveCategoryActionGroup" stepKey="saveSubCategory"/> <seeElement selector="{{AdminCategoryMessagesSection.SuccessMessage}}" stepKey="seeSuccessMessage"/> - <!--Run full reindex and clear caches --> <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> - <argument name="indices" value=""/> + <argument name="indices" value="catalog_category_flat"/> </actionGroup> <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> <argument name="tags" value=""/> 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 67ca04a0a4594..1032c322053da 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontProductNameWithDoubleQuoteTest/StorefrontProductNameWithDoubleQuoteTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontProductNameWithDoubleQuoteTest/StorefrontProductNameWithDoubleQuoteTest.xml @@ -39,10 +39,7 @@ </actionGroup> <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct"/> - <!--Run re-index task--> - <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> - <argument name="indices" value=""/> - </actionGroup> + <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> <!--Check product in category listing--> <amOnPage url="{{StorefrontCategoryPage.url($$createCategory.name$$)}}" stepKey="goToCategoryPage"/> From 8749553fca0ce2b626bd45d4af2f72815a46c458 Mon Sep 17 00:00:00 2001 From: "vadim.malesh" <engcom-vendorworker-charlie@adobe.com> Date: Wed, 9 Dec 2020 17:51:56 +0200 Subject: [PATCH 133/171] test dhl request when product name contains special chars --- .../Magento/Dhl/Model/CarrierTest.php | 45 ++++++++++++++----- 1 file changed, 35 insertions(+), 10 deletions(-) diff --git a/dev/tests/integration/testsuite/Magento/Dhl/Model/CarrierTest.php b/dev/tests/integration/testsuite/Magento/Dhl/Model/CarrierTest.php index f9a1d2923e5be..552040489e253 100644 --- a/dev/tests/integration/testsuite/Magento/Dhl/Model/CarrierTest.php +++ b/dev/tests/integration/testsuite/Magento/Dhl/Model/CarrierTest.php @@ -17,19 +17,22 @@ use Magento\Quote\Model\Quote\Address\RateRequest; use Magento\Quote\Model\Quote\Address\RateResult\Error; use Magento\Shipping\Model\Shipment\Request; +use Magento\Shipping\Model\Simplexml\Element as ShippingElement; use Magento\Shipping\Model\Tracking\Result\Status; use Magento\Store\Model\ScopeInterface; use Magento\TestFramework\Helper\Bootstrap; use Magento\TestFramework\HTTP\AsyncClientInterfaceMock; -use Magento\Shipping\Model\Simplexml\Element as ShippingElement; +use PHPUnit\Framework\TestCase; /** * Test for DHL integration. * * @SuppressWarnings(PHPMD.CouplingBetweenObjects) */ -class CarrierTest extends \PHPUnit\Framework\TestCase +class CarrierTest extends TestCase { + private const PRODUCT_NAME_SPECIAL_CHARS = 'Φυστίκι Ψημένο με Αλάτι Συσκευασία'; + /** * @var Carrier */ @@ -254,10 +257,16 @@ private function assertTrackingResult($expectedTrackingData, $trackingResults): * @param string $origCountryId * @param string $expectedRegionCode * @param string $destCountryId + * @param bool|null $isProductNameContainsSpecialChars + * @return void * @dataProvider requestToShipmentDataProvider */ - public function testRequestToShip(string $origCountryId, string $expectedRegionCode, string $destCountryId): void - { + public function testRequestToShip( + string $origCountryId, + string $expectedRegionCode, + string $destCountryId, + bool $isProductNameContainsSpecialChars = false + ): void { $this->config->setValue( 'shipping/origin/country_id', $origCountryId, @@ -274,6 +283,8 @@ public function testRequestToShip(string $origCountryId, string $expectedRegionC ) ] ); + $productName = $isProductNameContainsSpecialChars ? self::PRODUCT_NAME_SPECIAL_CHARS : 'item_name'; + //phpcs:enable Magento2.Functions.DiscouragedFunction $request = new Request( [ @@ -291,7 +302,7 @@ public function testRequestToShip(string $origCountryId, string $expectedRegionC ], 'items' => [ 'item1' => [ - 'name' => 'item_name', + 'name' => $productName, ], ], ], @@ -329,10 +340,15 @@ public function testRequestToShip(string $origCountryId, string $expectedRegionC $requestElement->Request->ServiceHeader->MessageReference = 'MAGE_SHIP_28TO32_Char_CHECKED'; $requestElement->Request->ServiceHeader->MessageTime = 'currentTime'; $requestElement->ShipmentDetails->Date = 'currentTime'; - $this->assertXmlStringEqualsXmlString( - $this->getExpectedLabelRequestXml($origCountryId, $destCountryId, $expectedRegionCode), - $requestElement->asXML() + + $expectedLabelRequest = $this->getExpectedLabelRequestXml( + $origCountryId, + $destCountryId, + $expectedRegionCode, + $isProductNameContainsSpecialChars ); + + $this->assertXmlStringEqualsXmlString($expectedLabelRequest, $requestElement->asXML()); } /** @@ -351,7 +367,10 @@ public function requestToShipmentDataProvider(): array ], [ 'DE', 'EU', 'DE' - ] + ], + [ + 'GB', 'EU', 'US', true + ], ]; } @@ -361,12 +380,14 @@ public function requestToShipmentDataProvider(): array * @param string $origCountryId * @param string $destCountryId * @param string $regionCode + * @param bool $isProductNameContainsSpecialChars * @return string */ private function getExpectedLabelRequestXml( string $origCountryId, string $destCountryId, - string $regionCode + string $regionCode, + bool $isProductNameContainsSpecialChars ): string { $countryNames = [ 'US' => 'United States Of America', @@ -387,6 +408,10 @@ private function getExpectedLabelRequestXml( $expectedRequestElement->Shipper->CountryName = $countryNames[$origCountryId]; $expectedRequestElement->RegionCode = $regionCode; + if ($isProductNameContainsSpecialChars) { + $expectedRequestElement->ShipmentDetails->Pieces->Piece->PieceContents = self::PRODUCT_NAME_SPECIAL_CHARS; + } + return $expectedRequestElement->asXML(); } From 50535cf17ac47a384aec9af2bab22b1968869a5a Mon Sep 17 00:00:00 2001 From: OlgaVasyltsun <olga.vasyltsun@transoftgroup.com> Date: Wed, 9 Dec 2020 17:57:48 +0200 Subject: [PATCH 134/171] MC-24840: Infinite redirect in case of backend URL is different from default website URL --- app/code/Magento/Backend/App/Area/FrontNameResolver.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/code/Magento/Backend/App/Area/FrontNameResolver.php b/app/code/Magento/Backend/App/Area/FrontNameResolver.php index 6c586781f2d81..6f78a3d055299 100644 --- a/app/code/Magento/Backend/App/Area/FrontNameResolver.php +++ b/app/code/Magento/Backend/App/Area/FrontNameResolver.php @@ -120,10 +120,10 @@ public function getFrontName($checkHost = false) */ public function isHostBackend() { - if ($this->scopeConfig->getValue(self::XML_PATH_USE_CUSTOM_ADMIN_URL, ScopeInterface::SCOPE_STORE)) { - $backendUrl = $this->scopeConfig->getValue(self::XML_PATH_CUSTOM_ADMIN_URL, ScopeInterface::SCOPE_STORE); + if ($this->config->getValue(self::XML_PATH_USE_CUSTOM_ADMIN_URL)) { + $backendUrl = $this->config->getValue(self::XML_PATH_CUSTOM_ADMIN_URL); } else { - $backendUrl = $this->scopeConfig->getValue(Store::XML_PATH_UNSECURE_BASE_URL, ScopeInterface::SCOPE_STORE); + $backendUrl = $this->config->getValue(Store::XML_PATH_UNSECURE_BASE_URL); } $host = $this->request->getServer('HTTP_HOST', ''); return stripos($this->getHostWithPort($backendUrl), (string) $host) !== false; From 706e63d8995daedacdfcb42dc1c7de700e8f1eb2 Mon Sep 17 00:00:00 2001 From: Anna Pak <a.pak@atwix.com> Date: Thu, 10 Dec 2020 10:38:37 +0200 Subject: [PATCH 135/171] renamed Action Groups --- ...=> AssertAdminManageStockOnEditPageActionGroup.xml} | 2 +- ...=> AssertAdminProductInfoOnEditPageActionGroup.xml} | 2 +- ...ertAdminProductIsAssignedToCategoryActionGroup.xml} | 2 +- ...rontProductStockStatusOnProductPageActionGroup.xml} | 2 +- ...ctWithRegularPriceInStockEnabledFlatCatalogTest.xml | 10 +++++----- 5 files changed, 9 insertions(+), 9 deletions(-) rename app/code/Magento/Catalog/Test/Mftf/ActionGroup/{AdminAssertManageStockOnEditPageActionGroup.xml => AssertAdminManageStockOnEditPageActionGroup.xml} (92%) rename app/code/Magento/Catalog/Test/Mftf/ActionGroup/{AdminAssertProductInfoOnEditPageActionGroup.xml => AssertAdminProductInfoOnEditPageActionGroup.xml} (97%) rename app/code/Magento/Catalog/Test/Mftf/ActionGroup/{AdminAssertProductIsAssignedToCategoryActionGroup.xml => AssertAdminProductIsAssignedToCategoryActionGroup.xml} (92%) rename app/code/Magento/Catalog/Test/Mftf/ActionGroup/{StorefrontAssertProductStockStatusOnProductPageActionGroup.xml => AssertStorefrontProductStockStatusOnProductPageActionGroup.xml} (93%) diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminAssertManageStockOnEditPageActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertAdminManageStockOnEditPageActionGroup.xml similarity index 92% rename from app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminAssertManageStockOnEditPageActionGroup.xml rename to app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertAdminManageStockOnEditPageActionGroup.xml index 67df650a24228..eca989a5de41f 100644 --- a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminAssertManageStockOnEditPageActionGroup.xml +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertAdminManageStockOnEditPageActionGroup.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="AdminAssertManageStockOnEditPageActionGroup"> + <actionGroup name="AssertAdminManageStockOnEditPageActionGroup"> <annotations> <description>Check if manageStock value is correct (the Product Edit page->Advanced Inventory section should be opened in Admin prior this check).</description> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminAssertProductInfoOnEditPageActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertAdminProductInfoOnEditPageActionGroup.xml similarity index 97% rename from app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminAssertProductInfoOnEditPageActionGroup.xml rename to app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertAdminProductInfoOnEditPageActionGroup.xml index ba67168958fca..d91cdfee0489c 100644 --- a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminAssertProductInfoOnEditPageActionGroup.xml +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertAdminProductInfoOnEditPageActionGroup.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="AdminAssertProductInfoOnEditPageActionGroup"> + <actionGroup name="AssertAdminProductInfoOnEditPageActionGroup"> <annotations> <description>Validates next fields on the Product Edit Page: name, sku, price, quantity, stock status, tax class, weight, weigh select, visibility, url key</description> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminAssertProductIsAssignedToCategoryActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertAdminProductIsAssignedToCategoryActionGroup.xml similarity index 92% rename from app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminAssertProductIsAssignedToCategoryActionGroup.xml rename to app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertAdminProductIsAssignedToCategoryActionGroup.xml index b33e319adc1f4..e6b178937a2cc 100644 --- a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminAssertProductIsAssignedToCategoryActionGroup.xml +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertAdminProductIsAssignedToCategoryActionGroup.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="AdminAssertProductIsAssignedToCategoryActionGroup"> + <actionGroup name="AssertAdminProductIsAssignedToCategoryActionGroup"> <annotations> <description>Checks if product is assigned to category (the Product Edit page should be opened in Admin prior this check).</description> </annotations> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontAssertProductStockStatusOnProductPageActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertStorefrontProductStockStatusOnProductPageActionGroup.xml similarity index 93% rename from app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontAssertProductStockStatusOnProductPageActionGroup.xml rename to app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertStorefrontProductStockStatusOnProductPageActionGroup.xml index 5af46bcd734d1..857d88ebc197c 100644 --- a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontAssertProductStockStatusOnProductPageActionGroup.xml +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertStorefrontProductStockStatusOnProductPageActionGroup.xml @@ -7,7 +7,7 @@ <actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> - <actionGroup name="StorefrontAssertProductStockStatusOnProductPageActionGroup"> + <actionGroup name="AssertStorefrontProductStockStatusOnProductPageActionGroup"> <annotations> <description>Validates that the provided Product Stock Status is present and correct (the Product Detail page should be opened on Storefront prior this check)</description> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockEnabledFlatCatalogTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockEnabledFlatCatalogTest.xml index c083f827e8930..3af6de07e561d 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockEnabledFlatCatalogTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockEnabledFlatCatalogTest.xml @@ -67,20 +67,20 @@ </actionGroup> <actionGroup ref="AdminClickOnAdvancedInventoryLinkActionGroup" stepKey="clickTheAdvancedInventoryLink1"/> - <actionGroup ref="AdminAssertManageStockOnEditPageActionGroup" stepKey="assertManageStock1"> + <actionGroup ref="AssertAdminManageStockOnEditPageActionGroup" stepKey="assertManageStock1"> <argument name="manageStock" value="No"/> </actionGroup> <actionGroup ref="AdminSubmitAdvancedInventoryFormActionGroup" stepKey="clickDoneButtonOnAdvancedInventorySection1"/> - <actionGroup ref="AdminAssertProductIsAssignedToCategoryActionGroup" stepKey="checkifProductIsAssignedToInitialCategory"> + <actionGroup ref="AssertAdminProductIsAssignedToCategoryActionGroup" stepKey="checkifProductIsAssignedToInitialCategory"> <argument name="categoryName" value="$$initialCategoryEntity.name$$"/> </actionGroup> - <actionGroup ref="AdminAssertProductIsAssignedToCategoryActionGroup" stepKey="checkifProductIsAssignedToCategoryTwo"> + <actionGroup ref="AssertAdminProductIsAssignedToCategoryActionGroup" stepKey="checkifProductIsAssignedToCategoryTwo"> <argument name="categoryName" value="$$categoryEntity.name$$"/> </actionGroup> - <actionGroup ref="AdminAssertProductInfoOnEditPageActionGroup" stepKey="assertProductInfo"> + <actionGroup ref="AssertAdminProductInfoOnEditPageActionGroup" stepKey="assertProductInfo"> <argument name="product" value="simpleProductEnabledFlat"/> </actionGroup> @@ -105,7 +105,7 @@ <actionGroup ref="StorefrontAssertProductSkuOnProductPageActionGroup" stepKey="seeSimpleProductSKUOnStoreFrontPage"> <argument name="productSku" value="{{simpleProductEnabledFlat.sku}}"/> </actionGroup> - <actionGroup ref="StorefrontAssertProductStockStatusOnProductPageActionGroup" stepKey="seeSimpleProductStockStatusOnStoreFrontPage"> + <actionGroup ref="AssertStorefrontProductStockStatusOnProductPageActionGroup" stepKey="seeSimpleProductStockStatusOnStoreFrontPage"> <argument name="productStockStatus" value="{{simpleProductEnabledFlat.storefrontStatus}}"/> </actionGroup> From 2c4d9b1f0604d2462ea4d231168e8783ce226ff4 Mon Sep 17 00:00:00 2001 From: Sergio Vera <svera@adobe.com> Date: Thu, 10 Dec 2020 11:35:58 +0100 Subject: [PATCH 136/171] MC-39542: : Change LiveCodeTest php stability test - Return error if not PHP supported versions are defined in composer.json --- dev/tests/static/testsuite/Magento/Test/Php/LiveCodeTest.php | 1 + 1 file changed, 1 insertion(+) diff --git a/dev/tests/static/testsuite/Magento/Test/Php/LiveCodeTest.php b/dev/tests/static/testsuite/Magento/Test/Php/LiveCodeTest.php index f294e2c2f55e1..65358cd785066 100644 --- a/dev/tests/static/testsuite/Magento/Test/Php/LiveCodeTest.php +++ b/dev/tests/static/testsuite/Magento/Test/Php/LiveCodeTest.php @@ -414,6 +414,7 @@ public function testStrictTypes() public function testPhpCompatibility() { $targetVersions = $this->getTargetPhpVersions(); + $this->assertNotEmpty($targetVersions, 'No supported versions information in composer.json'); $reportFile = self::$reportDir . '/phpcompatibility_report.txt'; $rulesetDir = __DIR__ . '/_files/PHPCompatibilityMagento'; From e85f913ce5e87bcdef7bf265b5b7e04c4b060535 Mon Sep 17 00:00:00 2001 From: Anna Pak <a.pak@atwix.com> Date: Thu, 10 Dec 2020 13:05:20 +0200 Subject: [PATCH 137/171] adding AssertAdminProductIsAssignedToCategoryActionGroup --- ...ProductIsAssignedToCategoryActionGroup.xml | 22 +++++++++++++++++++ .../AdminProductFormSection.xml | 1 + ...dminUpdateSimpleProductTieredPriceTest.xml | 8 +++++-- ...PriceInStockNotVisibleIndividuallyTest.xml | 8 +++++-- ...ceInStockVisibleInCatalogAndSearchTest.xml | 8 +++++-- ...arPriceInStockVisibleInCatalogOnlyTest.xml | 8 +++++-- ...larPriceInStockVisibleInSearchOnlyTest.xml | 8 +++++-- ...gularPriceInStockWithCustomOptionsTest.xml | 8 +++++-- ...eProductWithRegularPriceOutOfStockTest.xml | 8 +++++-- 9 files changed, 65 insertions(+), 14 deletions(-) create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertAdminProductIsAssignedToCategoryActionGroup.xml diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertAdminProductIsAssignedToCategoryActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertAdminProductIsAssignedToCategoryActionGroup.xml new file mode 100644 index 0000000000000..e6b178937a2cc --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertAdminProductIsAssignedToCategoryActionGroup.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="AssertAdminProductIsAssignedToCategoryActionGroup"> + <annotations> + <description>Checks if product is assigned to category (the Product Edit page should be opened in Admin prior this check).</description> + </annotations> + <arguments> + <argument name="categoryName" type="string"/> + </arguments> + + <seeElement selector="{{AdminProductFormSection.categories(categoryName)}}" stepKey="seeCategoryName"/> + + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/Section/AdminProductFormSection/AdminProductFormSection.xml b/app/code/Magento/Catalog/Test/Mftf/Section/AdminProductFormSection/AdminProductFormSection.xml index 1ca051e2f6669..d70c48f2b00e3 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Section/AdminProductFormSection/AdminProductFormSection.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Section/AdminProductFormSection/AdminProductFormSection.xml @@ -77,5 +77,6 @@ <element name="newAddedAttribute" type="text" selector="//fieldset[@class='admin__fieldset']//div[contains(@data-index,'{{attributeCode}}')]" parameterized="true"/> <element name="newCategoryButton" type="button" selector="button[data-index='create_category_button']" timeout="30"/> <element name="footerBlock" type="block" selector="//footer"/> + <element name="categories" type="text" selector="//*[@class='admin__action-multiselect-crumb']/span[contains(text(), '{{categoryName}}')]" parameterized="true"/> </section> </sections> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductTieredPriceTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductTieredPriceTest.xml index 300b312612253..338df481e3794 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductTieredPriceTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductTieredPriceTest.xml @@ -110,8 +110,12 @@ <seeInField selector="{{AdminProductFormSection.productStockStatus}}" userInput="{{simpleProductTierPrice300InStock.status}}" stepKey="seeSimpleProductStockStatus"/> <seeInField selector="{{AdminProductFormSection.productWeight}}" userInput="{{simpleProductTierPrice300InStock.weight}}" stepKey="seeSimpleProductWeight"/> <seeInField selector="{{AdminProductFormSection.productWeightSelect}}" userInput="{{simpleProductTierPrice300InStock.weightSelect}}" stepKey="seeSimpleProductWeightSelect"/> - <click selector="{{AdminProductFormSection.categoriesDropdown}}" stepKey="clickCategoriesDropDownToVerify"/> - <see selector="{{AdminProductFormSection.selectMultipleCategories}}" userInput="$$categoryEntity.name$$" stepKey="seeSelectedCategories"/> + + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="clickCategoriesDropDownToVerify"/> + <actionGroup ref="AssertAdminProductIsAssignedToCategoryActionGroup" stepKey="seeSelectedCategories"> + <argument name="categoryName" value="$$categoryEntity.name$$"/> + </actionGroup> + <scrollTo selector="{{AdminProductSEOSection.sectionHeader}}" x="0" y="-80" stepKey="scrollToAdminProductSEOSection1"/> <click selector="{{AdminProductSEOSection.sectionHeader}}" stepKey="clickAdminProductSEOSection1"/> <seeInField selector="{{AdminProductSEOSection.urlKeyInput}}" userInput="{{simpleProductTierPrice300InStock.urlKey}}" stepKey="seeUrlKey"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockNotVisibleIndividuallyTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockNotVisibleIndividuallyTest.xml index 86fac835ce44d..3d53501ede4cc 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockNotVisibleIndividuallyTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockNotVisibleIndividuallyTest.xml @@ -84,8 +84,12 @@ <seeInField selector="{{AdminProductFormSection.productQuantity}}" userInput="{{simpleProductNotVisibleIndividually.quantity}}" stepKey="seeSimpleProductQuantity"/> <seeInField selector="{{AdminProductFormSection.productStockStatus}}" userInput="{{simpleProductNotVisibleIndividually.status}}" stepKey="seeSimpleProductStockStatus"/> <seeInField selector="{{AdminProductFormSection.productWeight}}" userInput="{{simpleProductNotVisibleIndividually.weightNoDecimals}}" stepKey="seeSimpleProductWeight"/> - <click selector="{{AdminProductFormSection.categoriesDropdown}}" stepKey="clickCategoriesDropDownToVerify"/> - <see selector="{{AdminProductFormSection.selectMultipleCategories}}" userInput="$$categoryEntity.name$$" stepKey="seeSelectedCategories" /> + + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="clickCategoriesDropDownToVerify"/> + <actionGroup ref="AssertAdminProductIsAssignedToCategoryActionGroup" stepKey="seeSelectedCategories"> + <argument name="categoryName" value="$$categoryEntity.name$$"/> + </actionGroup> + <seeInField selector="{{AdminProductFormSection.visibility}}" userInput="{{simpleProductNotVisibleIndividually.visibility}}" stepKey="seeSimpleProductVisibility"/> <scrollTo selector="{{AdminProductSEOSection.sectionHeader}}" x="0" y="-80" stepKey="scrollToAdminProductSEOSection"/> <click selector="{{AdminProductSEOSection.sectionHeader}}" stepKey="clickAdminProductSEOSectionHeader"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockVisibleInCatalogAndSearchTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockVisibleInCatalogAndSearchTest.xml index 320edba5feeff..e121e239ad334 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockVisibleInCatalogAndSearchTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockVisibleInCatalogAndSearchTest.xml @@ -84,8 +84,12 @@ <seeInField selector="{{AdminProductFormSection.productQuantity}}" userInput="{{simpleProductRegularPrice245InStock.quantity}}" stepKey="seeSimpleProductQuantity"/> <seeInField selector="{{AdminProductFormSection.productStockStatus}}" userInput="{{simpleProductRegularPrice245InStock.status}}" stepKey="seeSimpleProductStockStatus"/> <seeInField selector="{{AdminProductFormSection.productWeight}}" userInput="{{simpleProductRegularPrice245InStock.weight}}" stepKey="seeSimpleProductWeight"/> - <click selector="{{AdminProductFormSection.categoriesDropdown}}" stepKey="clickCategoriesDropDownToVerify"/> - <see selector="{{AdminProductFormSection.selectMultipleCategories}}" userInput="$$categoryEntity.name$$" stepKey="selectedCategories" /> + + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="clickCategoriesDropDownToVerify"/> + <actionGroup ref="AssertAdminProductIsAssignedToCategoryActionGroup" stepKey="selectedCategories"> + <argument name="categoryName" value="$$categoryEntity.name$$"/> + </actionGroup> + <seeInField selector="{{AdminProductFormSection.visibility}}" userInput="{{simpleProductRegularPrice245InStock.visibility}}" stepKey="seeVisibility"/> <scrollTo selector="{{AdminProductSEOSection.sectionHeader}}" x="0" y="-80" stepKey="scrollToAdminProductSEOSection1"/> <click selector="{{AdminProductSEOSection.sectionHeader}}" stepKey="clickAdminProductSEOSection1"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockVisibleInCatalogOnlyTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockVisibleInCatalogOnlyTest.xml index 77c3e7548a3cf..6ad01e59eea51 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockVisibleInCatalogOnlyTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockVisibleInCatalogOnlyTest.xml @@ -84,8 +84,12 @@ <seeInField selector="{{AdminProductFormSection.productQuantity}}" userInput="{{simpleProductRegularPrice32501InStock.quantity}}" stepKey="seeSimpleProductQuantity"/> <seeInField selector="{{AdminProductFormSection.productStockStatus}}" userInput="{{simpleProductRegularPrice32501InStock.status}}" stepKey="seeSimpleProductStockStatus"/> <seeInField selector="{{AdminProductFormSection.productWeight}}" userInput="{{simpleProductRegularPrice32501InStock.weight}}" stepKey="seeSimpleProductWeight"/> - <click selector="{{AdminProductFormSection.categoriesDropdown}}" stepKey="clickCategoriesDropDownToVerify"/> - <see selector="{{AdminProductFormSection.selectMultipleCategories}}" userInput="$$categoryEntity.name$$" stepKey="selectedCategories" /> + + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="clickCategoriesDropDownToVerify"/> + <actionGroup ref="AssertAdminProductIsAssignedToCategoryActionGroup" stepKey="selectedCategories"> + <argument name="categoryName" value="$$categoryEntity.name$$"/> + </actionGroup> + <seeInField selector="{{AdminProductFormSection.visibility}}" userInput="{{simpleProductRegularPrice32501InStock.visibility}}" stepKey="seeVisibility"/> <scrollTo selector="{{AdminProductSEOSection.sectionHeader}}" x="0" y="-80" stepKey="scrollToAdminProductSEOSection1"/> <click selector="{{AdminProductSEOSection.sectionHeader}}" stepKey="clickAdminProductSEOSection1"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockVisibleInSearchOnlyTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockVisibleInSearchOnlyTest.xml index 39dab0b08915c..ec4b0296e82c1 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockVisibleInSearchOnlyTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockVisibleInSearchOnlyTest.xml @@ -84,8 +84,12 @@ <seeInField selector="{{AdminProductFormSection.productQuantity}}" userInput="{{simpleProductRegularPrice325InStock.quantity}}" stepKey="seeSimpleProductQuantity"/> <seeInField selector="{{AdminProductFormSection.productStockStatus}}" userInput="{{simpleProductRegularPrice325InStock.status}}" stepKey="seeSimpleProductStockStatus"/> <seeInField selector="{{AdminProductFormSection.productWeight}}" userInput="{{simpleProductRegularPrice325InStock.weight}}" stepKey="seeSimpleProductWeight"/> - <click selector="{{AdminProductFormSection.categoriesDropdown}}" stepKey="clickCategoriesDropDownToVerify"/> - <see selector="{{AdminProductFormSection.selectMultipleCategories}}" userInput="$$categoryEntity.name$$" stepKey="selectedCategories" /> + + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="clickCategoriesDropDownToVerify"/> + <actionGroup ref="AssertAdminProductIsAssignedToCategoryActionGroup" stepKey="selectedCategories"> + <argument name="categoryName" value="$$categoryEntity.name$$"/> + </actionGroup> + <seeInField selector="{{AdminProductFormSection.visibility}}" userInput="{{simpleProductRegularPrice325InStock.visibility}}" stepKey="seeVisibility"/> <scrollTo selector="{{AdminProductSEOSection.sectionHeader}}" x="0" y="-80" stepKey="scrollToAdminProductSEOSection1"/> <click selector="{{AdminProductSEOSection.sectionHeader}}" stepKey="clickAdminProductSEOSection1"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockWithCustomOptionsTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockWithCustomOptionsTest.xml index 670030d1d98ea..2a7d5c6c18a02 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockWithCustomOptionsTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockWithCustomOptionsTest.xml @@ -97,8 +97,12 @@ <seeInField selector="{{AdminProductFormSection.productQuantity}}" userInput="{{simpleProductRegularPriceCustomOptions.quantity}}" stepKey="seeSimpleProductQuantity"/> <seeInField selector="{{AdminProductFormSection.productStockStatus}}" userInput="{{simpleProductRegularPriceCustomOptions.status}}" stepKey="seeSimpleProductStockStatus"/> <seeInField selector="{{AdminProductFormSection.productWeight}}" userInput="{{simpleProductRegularPriceCustomOptions.weight}}" stepKey="seeSimpleProductWeight"/> - <click selector="{{AdminProductFormSection.categoriesDropdown}}" stepKey="clickCategoriesDropDownToVerify"/> - <see selector="{{AdminProductFormSection.selectMultipleCategories}}" userInput="$$categoryEntity.name$$" stepKey="selectedCategories" /> + + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="clickCategoriesDropDownToVerify"/> + <actionGroup ref="AssertAdminProductIsAssignedToCategoryActionGroup" stepKey="selectedCategories"> + <argument name="categoryName" value="$$categoryEntity.name$$"/> + </actionGroup> + <scrollTo selector="{{AdminProductSEOSection.sectionHeader}}" x="0" y="-80" stepKey="scrollToAdminProductSEOSection1"/> <click selector="{{AdminProductSEOSection.sectionHeader}}" stepKey="clickAdminProductSEOSection1"/> <seeInField selector="{{AdminProductSEOSection.urlKeyInput}}" userInput="{{simpleProductRegularPriceCustomOptions.urlKey}}" stepKey="seeUrlKey"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceOutOfStockTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceOutOfStockTest.xml index 441bc9b8f8005..170e731f38ba3 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceOutOfStockTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceOutOfStockTest.xml @@ -84,8 +84,12 @@ <seeInField selector="{{AdminProductFormSection.productQuantity}}" userInput="{{simpleProductRegularPrice32503OutOfStock.quantity}}" stepKey="seeSimpleProductQuantity"/> <seeInField selector="{{AdminProductFormSection.productStockStatus}}" userInput="{{simpleProductRegularPrice32503OutOfStock.status}}" stepKey="seeSimpleProductStockStatus"/> <seeInField selector="{{AdminProductFormSection.productWeight}}" userInput="{{simpleProductRegularPrice32503OutOfStock.weight}}" stepKey="seeSimpleProductWeight"/> - <click selector="{{AdminProductFormSection.categoriesDropdown}}" stepKey="clickCategoriesDropDownToVerify"/> - <see selector="{{AdminProductFormSection.selectMultipleCategories}}" userInput="$$categoryEntity.name$$" stepKey="selectedCategories" /> + + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="clickCategoriesDropDownToVerify"/> + <actionGroup ref="AssertAdminProductIsAssignedToCategoryActionGroup" stepKey="selectedCategories"> + <argument name="categoryName" value="$$categoryEntity.name$$"/> + </actionGroup> + <scrollTo selector="{{AdminProductSEOSection.sectionHeader}}" x="0" y="-80" stepKey="scrollToAdminProductSEOSection1"/> <click selector="{{AdminProductSEOSection.sectionHeader}}" stepKey="clickAdminProductSEOSection1"/> <seeInField selector="{{AdminProductSEOSection.urlKeyInput}}" userInput="{{simpleProductRegularPrice32503OutOfStock.urlKey}}" stepKey="seeUrlKey"/> From 2587e3221f56d237588d1fc23dd4aa4e3b076fca Mon Sep 17 00:00:00 2001 From: Anna Pak <a.pak@atwix.com> Date: Thu, 10 Dec 2020 15:24:56 +0200 Subject: [PATCH 138/171] updated with OpenEditProductOnBackendActionGroup --- ...tNameToVerifyDataOverridingOnStoreViewLevelTest.xml | 10 +++++----- ...PriceToVerifyDataOverridingOnStoreViewLevelTest.xml | 10 +++++----- .../Test/AdminUpdateSimpleProductTieredPriceTest.xml | 10 +++++----- ...oductWithRegularPriceInStockDisabledProductTest.xml | 10 +++++----- ...leProductWithRegularPriceInStockEnabledFlatTest.xml | 10 +++++----- ...thRegularPriceInStockNotVisibleIndividuallyTest.xml | 10 +++++----- ...WithRegularPriceInStockUnassignFromCategoryTest.xml | 10 +++++----- ...egularPriceInStockVisibleInCatalogAndSearchTest.xml | 10 +++++----- ...WithRegularPriceInStockVisibleInCatalogOnlyTest.xml | 10 +++++----- ...tWithRegularPriceInStockVisibleInSearchOnlyTest.xml | 10 +++++----- ...uctWithRegularPriceInStockWithCustomOptionsTest.xml | 10 +++++----- ...dateSimpleProductWithRegularPriceOutOfStockTest.xml | 10 +++++----- 12 files changed, 60 insertions(+), 60 deletions(-) diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductNameToVerifyDataOverridingOnStoreViewLevelTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductNameToVerifyDataOverridingOnStoreViewLevelTest.xml index 5f7cecfde188a..70d6932f6fc17 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductNameToVerifyDataOverridingOnStoreViewLevelTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductNameToVerifyDataOverridingOnStoreViewLevelTest.xml @@ -42,12 +42,12 @@ </after> <!-- Search default simple product in grid --> - <actionGroup ref="AdminProductCatalogPageOpenActionGroup" stepKey="openProductCatalogPage"/> - <actionGroup ref="FilterProductGridBySku2ActionGroup" stepKey="filterProductGrid"> - <argument name="sku" value="$$initialSimpleProduct.sku$$"/> + <actionGroup ref="AdminClearFiltersActionGroup" stepKey="openProductCatalogPage"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="filterProductGrid"/> + <actionGroup ref="OpenEditProductOnBackendActionGroup" stepKey="clickFirstRowToOpenDefaultSimpleProduct"> + <argument name="product" value="$$initialSimpleProduct$$"/> </actionGroup> - <click selector="{{AdminProductGridFilterSection.nthRow('1')}}" stepKey="clickFirstRowToOpenDefaultSimpleProduct"/> - <waitForPageLoad stepKey="waitUntilProductIsOpened"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitUntilProductIsOpened"/> <!-- Assign simple product to created store view --> <click selector="{{AdminCategoryMainActionsSection.CategoryStoreViewDropdownToggle}}" stepKey="clickCategoryStoreViewDropdownToggle"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductPriceToVerifyDataOverridingOnStoreViewLevelTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductPriceToVerifyDataOverridingOnStoreViewLevelTest.xml index 8a05ed9d64b8b..f9c90b1190611 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductPriceToVerifyDataOverridingOnStoreViewLevelTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductPriceToVerifyDataOverridingOnStoreViewLevelTest.xml @@ -42,12 +42,12 @@ </after> <!-- Search default simple product in grid --> - <actionGroup ref="AdminProductCatalogPageOpenActionGroup" stepKey="openProductCatalogPage"/> - <actionGroup ref="FilterProductGridBySku2ActionGroup" stepKey="filterProductGrid"> - <argument name="sku" value="$$initialSimpleProduct.sku$$"/> + <actionGroup ref="AdminClearFiltersActionGroup" stepKey="openProductCatalogPage"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="filterProductGrid"/> + <actionGroup ref="OpenEditProductOnBackendActionGroup" stepKey="clickFirstRowToOpenDefaultSimpleProduct"> + <argument name="product" value="$$initialSimpleProduct$$"/> </actionGroup> - <click selector="{{AdminProductGridFilterSection.nthRow('1')}}" stepKey="clickFirstRowToOpenDefaultSimpleProduct"/> - <waitForPageLoad stepKey="waitUntilProductIsOpened"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitUntilProductIsOpened"/> <!-- Assign simple product to created store view --> <click selector="{{AdminCategoryMainActionsSection.CategoryStoreViewDropdownToggle}}" stepKey="clickCategoryStoreViewDropdownToggle"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductTieredPriceTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductTieredPriceTest.xml index 300b312612253..73ceed8489f7a 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductTieredPriceTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductTieredPriceTest.xml @@ -44,12 +44,12 @@ </after> <!-- Search default simple product in the grid --> - <actionGroup ref="AdminProductCatalogPageOpenActionGroup" stepKey="openProductCatalogPage"/> - <actionGroup ref="FilterProductGridBySku2ActionGroup" stepKey="filterProductGrid"> - <argument name="sku" value="$$initialSimpleProduct.sku$$"/> + <actionGroup ref="AdminClearFiltersActionGroup" stepKey="openProductCatalogPage"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="filterProductGrid"/> + <actionGroup ref="OpenEditProductOnBackendActionGroup" stepKey="clickFirstRowToOpenDefaultSimpleProduct"> + <argument name="product" value="$$initialSimpleProduct$$"/> </actionGroup> - <click selector="{{AdminProductGridFilterSection.nthRow('1')}}" stepKey="clickFirstRowToOpenDefaultSimpleProduct"/> - <waitForPageLoad stepKey="waitUntilProductIsOpened"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitUntilProductIsOpened"/> <!-- Update simple product with tier price(in stock) --> <fillField selector="{{AdminProductFormSection.productName}}" userInput="{{simpleProductTierPrice300InStock.name}}" stepKey="fillSimpleProductName"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockDisabledProductTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockDisabledProductTest.xml index a9630aba467c6..9cae9cc3f1f42 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockDisabledProductTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockDisabledProductTest.xml @@ -34,12 +34,12 @@ </after> <!-- Search default simple product in the grid page --> - <actionGroup ref="AdminProductCatalogPageOpenActionGroup" stepKey="openProductCatalogPage"/> - <actionGroup ref="FilterProductGridBySku2ActionGroup" stepKey="filterProductGrid"> - <argument name="sku" value="$$initialSimpleProduct.sku$$"/> + <actionGroup ref="AdminClearFiltersActionGroup" stepKey="openProductCatalogPage"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="filterProductGrid"/> + <actionGroup ref="OpenEditProductOnBackendActionGroup" stepKey="clickFirstRowToOpenDefaultSimpleProduct"> + <argument name="product" value="$$initialSimpleProduct$$"/> </actionGroup> - <click selector="{{AdminProductGridFilterSection.nthRow('1')}}" stepKey="clickFirstRowToOpenDefaultSimpleProduct"/> - <waitForPageLoad stepKey="waitUntilProductIsOpened"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitUntilProductIsOpened"/> <!-- Update simple product with regular price(in stock) --> <fillField selector="{{AdminProductFormSection.productName}}" userInput="{{simpleProductDisabled.name}}" stepKey="fillSimpleProductName"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockEnabledFlatTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockEnabledFlatTest.xml index aa1b1ae702914..4aa1f694a0a24 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockEnabledFlatTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockEnabledFlatTest.xml @@ -38,12 +38,12 @@ </after> <!-- Search default simple product in the grid page --> - <actionGroup ref="AdminProductCatalogPageOpenActionGroup" stepKey="openProductCatalogPage"/> - <actionGroup ref="FilterProductGridBySku2ActionGroup" stepKey="filterProductGrid"> - <argument name="sku" value="$$initialSimpleProduct.sku$$"/> + <actionGroup ref="AdminClearFiltersActionGroup" stepKey="openProductCatalogPage"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="filterProductGrid"/> + <actionGroup ref="OpenEditProductOnBackendActionGroup" stepKey="clickFirstRowToOpenDefaultSimpleProduct"> + <argument name="product" value="$$initialSimpleProduct$$"/> </actionGroup> - <click selector="{{AdminProductGridFilterSection.nthRow('1')}}" stepKey="clickFirstRowToOpenDefaultSimpleProduct"/> - <waitForPageLoad stepKey="waitUntilProductIsOpened"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitUntilProductIsOpened"/> <!-- Update simple product with regular price --> <fillField selector="{{AdminProductFormSection.productName}}" userInput="{{simpleProductEnabledFlat.name}}" stepKey="fillSimpleProductName"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockNotVisibleIndividuallyTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockNotVisibleIndividuallyTest.xml index 86fac835ce44d..4c4c46c6579c2 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockNotVisibleIndividuallyTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockNotVisibleIndividuallyTest.xml @@ -36,12 +36,12 @@ </after> <!-- Search default simple product in the grid page --> - <actionGroup ref="AdminProductCatalogPageOpenActionGroup" stepKey="openProductCatalogPage"/> - <actionGroup ref="FilterProductGridBySku2ActionGroup" stepKey="filterProductGrid"> - <argument name="sku" value="$$initialSimpleProduct.sku$$"/> + <actionGroup ref="AdminClearFiltersActionGroup" stepKey="openProductCatalogPage"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="filterProductGrid"/> + <actionGroup ref="OpenEditProductOnBackendActionGroup" stepKey="clickFirstRowToOpenDefaultSimpleProduct"> + <argument name="product" value="$$initialSimpleProduct$$"/> </actionGroup> - <click selector="{{AdminProductGridFilterSection.nthRow('1')}}" stepKey="clickFirstRowToOpenDefaultSimpleProduct"/> - <waitForPageLoad stepKey="waitUntilProductIsOpened"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitUntilProductIsOpened"/> <!-- Update simple product with regular price(in stock) --> <fillField selector="{{AdminProductFormSection.productName}}" userInput="{{simpleProductNotVisibleIndividually.name}}" stepKey="fillSimpleProductName"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockUnassignFromCategoryTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockUnassignFromCategoryTest.xml index af3861e4e0b64..7bb5f090edf5d 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockUnassignFromCategoryTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockUnassignFromCategoryTest.xml @@ -34,12 +34,12 @@ </after> <!--Search default simple product in the grid page --> - <actionGroup ref="AdminProductCatalogPageOpenActionGroup" stepKey="openProductCatalogPage"/> - <actionGroup ref="FilterProductGridBySku2ActionGroup" stepKey="filterProductGrid"> - <argument name="sku" value="$$initialSimpleProduct.sku$$"/> + <actionGroup ref="AdminClearFiltersActionGroup" stepKey="openProductCatalogPage"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="filterProductGrid"/> + <actionGroup ref="OpenEditProductOnBackendActionGroup" stepKey="clickFirstRowToOpenDefaultSimpleProduct"> + <argument name="product" value="$$initialSimpleProduct$$"/> </actionGroup> - <click selector="{{AdminProductGridFilterSection.nthRow('1')}}" stepKey="clickFirstRowToOpenDefaultSimpleProduct"/> - <waitForPageLoad stepKey="waitUntilProductIsOpened"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitUntilProductIsOpened"/> <!-- Update simple product by unselecting categories --> <scrollTo selector="{{AdminProductFormSection.productStockStatus}}" stepKey="scroll"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockVisibleInCatalogAndSearchTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockVisibleInCatalogAndSearchTest.xml index 320edba5feeff..36b6711e25c25 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockVisibleInCatalogAndSearchTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockVisibleInCatalogAndSearchTest.xml @@ -36,12 +36,12 @@ </after> <!-- Search default simple product in the grid page --> - <actionGroup ref="AdminProductCatalogPageOpenActionGroup" stepKey="openProductCatalogPage"/> - <actionGroup ref="FilterProductGridBySku2ActionGroup" stepKey="filterProductGrid"> - <argument name="sku" value="$$initialSimpleProduct.sku$$"/> + <actionGroup ref="AdminClearFiltersActionGroup" stepKey="openProductCatalogPage"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="filterProductGrid"/> + <actionGroup ref="OpenEditProductOnBackendActionGroup" stepKey="clickFirstRowToOpenDefaultSimpleProduct"> + <argument name="product" value="$$initialSimpleProduct$$"/> </actionGroup> - <click selector="{{AdminProductGridFilterSection.nthRow('1')}}" stepKey="clickFirstRowToOpenDefaultSimpleProduct"/> - <waitForPageLoad stepKey="waitUntilProductIsOpened"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitUntilProductIsOpened"/> <!-- Update simple product with regular price(in stock) --> <fillField selector="{{AdminProductFormSection.productName}}" userInput="{{simpleProductRegularPrice245InStock.name}}" stepKey="fillSimpleProductName"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockVisibleInCatalogOnlyTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockVisibleInCatalogOnlyTest.xml index 77c3e7548a3cf..f3e73845e4a81 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockVisibleInCatalogOnlyTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockVisibleInCatalogOnlyTest.xml @@ -36,12 +36,12 @@ </after> <!-- Search default simple product in the grid --> - <actionGroup ref="AdminProductCatalogPageOpenActionGroup" stepKey="openProductCatalogPage"/> - <actionGroup ref="FilterProductGridBySku2ActionGroup" stepKey="filterProductGrid"> - <argument name="sku" value="$$initialSimpleProduct.sku$$"/> + <actionGroup ref="AdminClearFiltersActionGroup" stepKey="openProductCatalogPage"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="filterProductGrid"/> + <actionGroup ref="OpenEditProductOnBackendActionGroup" stepKey="clickFirstRowToOpenDefaultSimpleProduct"> + <argument name="product" value="$$initialSimpleProduct$$"/> </actionGroup> - <click selector="{{AdminProductGridFilterSection.nthRow('1')}}" stepKey="clickFirstRowToOpenDefaultSimpleProduct"/> - <waitForPageLoad stepKey="waitUntilProductIsOpened"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitUntilProductIsOpened"/> <!-- Update simple product with regular price(in stock) --> <fillField selector="{{AdminProductFormSection.productName}}" userInput="{{simpleProductRegularPrice32501InStock.name}}" stepKey="fillSimpleProductName"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockVisibleInSearchOnlyTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockVisibleInSearchOnlyTest.xml index 39dab0b08915c..5303d489a8235 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockVisibleInSearchOnlyTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockVisibleInSearchOnlyTest.xml @@ -36,12 +36,12 @@ </after> <!-- Search default simple product in the grid --> - <actionGroup ref="AdminProductCatalogPageOpenActionGroup" stepKey="openProductCatalogPage"/> - <actionGroup ref="FilterProductGridBySku2ActionGroup" stepKey="filterProductGrid"> - <argument name="sku" value="$$initialSimpleProduct.sku$$"/> + <actionGroup ref="AdminClearFiltersActionGroup" stepKey="openProductCatalogPage"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="filterProductGrid"/> + <actionGroup ref="OpenEditProductOnBackendActionGroup" stepKey="clickFirstRowToOpenDefaultSimpleProduct"> + <argument name="product" value="$$initialSimpleProduct$$"/> </actionGroup> - <click selector="{{AdminProductGridFilterSection.nthRow('1')}}" stepKey="clickFirstRowToOpenDefaultSimpleProduct"/> - <waitForPageLoad stepKey="waitUntilProductIsOpened"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitUntilProductIsOpened"/> <!-- Update simple product with regular price(in stock) --> <fillField selector="{{AdminProductFormSection.productName}}" userInput="{{simpleProductRegularPrice325InStock.name}}" stepKey="fillSimpleProductName"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockWithCustomOptionsTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockWithCustomOptionsTest.xml index 670030d1d98ea..914e261115cf6 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockWithCustomOptionsTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockWithCustomOptionsTest.xml @@ -36,12 +36,12 @@ </after> <!-- Search default simple product in the grid --> - <actionGroup ref="AdminProductCatalogPageOpenActionGroup" stepKey="openProductCatalogPage"/> - <actionGroup ref="FilterProductGridBySku2ActionGroup" stepKey="filterProductGrid"> - <argument name="sku" value="$$initialSimpleProduct.sku$$"/> + <actionGroup ref="AdminClearFiltersActionGroup" stepKey="openProductCatalogPage"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="filterProductGrid"/> + <actionGroup ref="OpenEditProductOnBackendActionGroup" stepKey="clickFirstRowToOpenDefaultSimpleProduct"> + <argument name="product" value="$$initialSimpleProduct$$"/> </actionGroup> - <click selector="{{AdminProductGridFilterSection.nthRow('1')}}" stepKey="clickFirstRowToOpenDefaultSimpleProduct"/> - <waitForPageLoad stepKey="waitUntilProductIsOpened"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitUntilProductIsOpened"/> <!-- Update simple product with regular price --> <fillField selector="{{AdminProductFormSection.productName}}" userInput="{{simpleProductRegularPriceCustomOptions.name}}" stepKey="fillSimpleProductName"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceOutOfStockTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceOutOfStockTest.xml index 441bc9b8f8005..bd2d3c239792e 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceOutOfStockTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceOutOfStockTest.xml @@ -36,12 +36,12 @@ </after> <!-- Search default simple product in the grid --> - <actionGroup ref="AdminProductCatalogPageOpenActionGroup" stepKey="openProductCatalogPage"/> - <actionGroup ref="FilterProductGridBySku2ActionGroup" stepKey="filterProductGrid"> - <argument name="sku" value="$$initialSimpleProduct.sku$$"/> + <actionGroup ref="AdminClearFiltersActionGroup" stepKey="openProductCatalogPage"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="filterProductGrid"/> + <actionGroup ref="OpenEditProductOnBackendActionGroup" stepKey="clickFirstRowToOpenDefaultSimpleProduct"> + <argument name="product" value="$$initialSimpleProduct$$"/> </actionGroup> - <click selector="{{AdminProductGridFilterSection.nthRow('1')}}" stepKey="clickFirstRowToOpenDefaultSimpleProduct"/> - <waitForPageLoad stepKey="waitUntilProductIsOpened"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitUntilProductIsOpened"/> <!-- Update simple product with regular price(out of stock) --> <fillField selector="{{AdminProductFormSection.productName}}" userInput="{{simpleProductRegularPrice32503OutOfStock.name}}" stepKey="fillSimpleProductName"/> From e726f1c75393d38640751a66815618cbe66f9ad8 Mon Sep 17 00:00:00 2001 From: Serhii Kovalenko <ganster3012@gmail.com> Date: Thu, 10 Dec 2020 17:52:33 +0200 Subject: [PATCH 139/171] Add integration test --- .../Magento/TestModuleMview/etc/module.xml | 10 ++++ .../Magento/TestModuleMview/etc/mview.xml | 18 +++++++ .../Magento/TestModuleMview/registration.php | 12 +++++ .../Framework/Mview/View/ChangelogTest.php | 49 +++++++++++++++++++ 4 files changed, 89 insertions(+) create mode 100644 dev/tests/integration/_files/Magento/TestModuleMview/etc/module.xml create mode 100644 dev/tests/integration/_files/Magento/TestModuleMview/etc/mview.xml create mode 100644 dev/tests/integration/_files/Magento/TestModuleMview/registration.php diff --git a/dev/tests/integration/_files/Magento/TestModuleMview/etc/module.xml b/dev/tests/integration/_files/Magento/TestModuleMview/etc/module.xml new file mode 100644 index 0000000000000..9808d90ace49c --- /dev/null +++ b/dev/tests/integration/_files/Magento/TestModuleMview/etc/module.xml @@ -0,0 +1,10 @@ +<?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_TestModuleMview"/> +</config> diff --git a/dev/tests/integration/_files/Magento/TestModuleMview/etc/mview.xml b/dev/tests/integration/_files/Magento/TestModuleMview/etc/mview.xml new file mode 100644 index 0000000000000..1cabda7a626bf --- /dev/null +++ b/dev/tests/integration/_files/Magento/TestModuleMview/etc/mview.xml @@ -0,0 +1,18 @@ +<?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:Mview/etc/mview.xsd"> + <view id="test_view_with_additional_columns" class="Magento\Framework\Indexer\Action\Dummy" group="indexer"> + <subscriptions> + <table name="test_mview_table" entity_column="entity_id"> + <additionalColumns> + <column name="additional_column" cl_name="test_additional_column" /> + </additionalColumns> + </table> + </subscriptions> + </view> +</config> diff --git a/dev/tests/integration/_files/Magento/TestModuleMview/registration.php b/dev/tests/integration/_files/Magento/TestModuleMview/registration.php new file mode 100644 index 0000000000000..5c5453c1bd413 --- /dev/null +++ b/dev/tests/integration/_files/Magento/TestModuleMview/registration.php @@ -0,0 +1,12 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +use Magento\Framework\Component\ComponentRegistrar; + +$registrar = new ComponentRegistrar(); +if ($registrar->getPath(ComponentRegistrar::MODULE, 'Magento_TestModuleMview') === null) { + ComponentRegistrar::register(ComponentRegistrar::MODULE, 'Magento_TestModuleMview', __DIR__); +} diff --git a/dev/tests/integration/testsuite/Magento/Framework/Mview/View/ChangelogTest.php b/dev/tests/integration/testsuite/Magento/Framework/Mview/View/ChangelogTest.php index ba2225fbe5eac..b77807a11da9b 100644 --- a/dev/tests/integration/testsuite/Magento/Framework/Mview/View/ChangelogTest.php +++ b/dev/tests/integration/testsuite/Magento/Framework/Mview/View/ChangelogTest.php @@ -6,6 +6,7 @@ namespace Magento\Framework\Mview\View; use Magento\Framework\App\ResourceConnection; +use Magento\Framework\Mview\View; /** * Test Class for \Magento\Framework\Mview\View\Changelog @@ -123,6 +124,54 @@ public function testClear() $this->assertEquals(1, $this->model->getVersion()); //the same that a table is empty } + /** + * Create entity table for MView + * + * @param string $tableName + * @return void + */ + private function createEntityTable(string $tableName) + { + $table = $this->resource->getConnection()->newTable( + $tableName + )->addColumn( + 'entity_id', + \Magento\Framework\DB\Ddl\Table::TYPE_INTEGER, + null, + ['identity' => true, 'unsigned' => true, 'nullable' => false, 'primary' => true], + 'Version ID' + )->addColumn( + 'additional_column', + \Magento\Framework\DB\Ddl\Table::TYPE_INTEGER, + null, + ['unsigned' => true, 'nullable' => false, 'default' => '0'], + 'Entity ID' + ); + $this->resource->getConnection()->createTable($table); + } + + public function testAdditionalColumns() + { + $tableName = 'test_mview_table'; + $this->createEntityTable($tableName); + $view = $this->objectManager->create(View::class); + $view->load('test_view_with_additional_columns'); + $view->subscribe(); + $this->connection->insert($tableName, ['entity_id' => 12, 'additional_column' => 13]); + $select = $this->connection->select() + ->from($view->getChangelog()->getName(), ['entity_id', 'test_additional_column']); + $actual = $this->connection->fetchAll($select); + $this->assertEquals( + [ + 'entity_id' => "12", + 'test_additional_column' => "13" + ], + reset($actual) + ); + $this->connection->dropTable($tableName); + $this->connection->dropTable($view->getChangelog()->getName()); + } + /** * Test for getList() method * From 830f4a35214e4fd5c2bb7b04663203a79e85153a Mon Sep 17 00:00:00 2001 From: OlgaVasyltsun <olga.vasyltsun@transoftgroup.com> Date: Fri, 11 Dec 2020 11:18:23 +0200 Subject: [PATCH 140/171] MC-24840: Infinite redirect in case of backend URL is different from default website URL --- .../Magento/Backend/App/Area/FrontNameResolver.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/app/code/Magento/Backend/App/Area/FrontNameResolver.php b/app/code/Magento/Backend/App/Area/FrontNameResolver.php index 6f78a3d055299..a927f52b59d95 100644 --- a/app/code/Magento/Backend/App/Area/FrontNameResolver.php +++ b/app/code/Magento/Backend/App/Area/FrontNameResolver.php @@ -120,10 +120,16 @@ public function getFrontName($checkHost = false) */ public function isHostBackend() { - if ($this->config->getValue(self::XML_PATH_USE_CUSTOM_ADMIN_URL)) { - $backendUrl = $this->config->getValue(self::XML_PATH_CUSTOM_ADMIN_URL); + if ($this->scopeConfig->getValue(self::XML_PATH_USE_CUSTOM_ADMIN_URL, ScopeInterface::SCOPE_STORE)) { + $backendUrl = $this->scopeConfig->getValue(self::XML_PATH_CUSTOM_ADMIN_URL, ScopeInterface::SCOPE_STORE); } else { $backendUrl = $this->config->getValue(Store::XML_PATH_UNSECURE_BASE_URL); + if ($backendUrl === null) { + $backendUrl = $this->scopeConfig->getValue( + Store::XML_PATH_UNSECURE_BASE_URL, + ScopeInterface::SCOPE_STORE + ); + } } $host = $this->request->getServer('HTTP_HOST', ''); return stripos($this->getHostWithPort($backendUrl), (string) $host) !== false; From f5cc98e68c00ff0e66d1dcc40b706e3bed1b7c98 Mon Sep 17 00:00:00 2001 From: korovitskyi <o.korovitskyi@atwix.com> Date: Fri, 11 Dec 2020 12:05:16 +0200 Subject: [PATCH 141/171] #31168 fix for customer which have more than two subscriptions --- .../Model/Plugin/CustomerPlugin.php | 21 ------------------- .../Newsletter/etc/extension_attributes.xml | 6 +----- .../Newsletter/Model/Plugin/PluginTest.php | 14 +++++++++++++ 3 files changed, 15 insertions(+), 26 deletions(-) diff --git a/app/code/Magento/Newsletter/Model/Plugin/CustomerPlugin.php b/app/code/Magento/Newsletter/Model/Plugin/CustomerPlugin.php index 6bdaa40019f8a..6c42875f5b32d 100644 --- a/app/code/Magento/Newsletter/Model/Plugin/CustomerPlugin.php +++ b/app/code/Magento/Newsletter/Model/Plugin/CustomerPlugin.php @@ -234,27 +234,6 @@ public function afterGetById(CustomerRepositoryInterface $subject, CustomerInter return $customer; } - /** - * Add subscription status to customer list - * - * @param CustomerRepositoryInterface $subject - * @param SearchResults $searchResults - * @return SearchResults - * @SuppressWarnings(PHPMD.UnusedFormalParameter) - */ - public function afterGetList(CustomerRepositoryInterface $subject, SearchResults $searchResults): SearchResults - { - foreach ($searchResults->getItems() as $customer) { - /** @var CustomerExtensionInterface $extensionAttributes */ - $extensionAttributes = $customer->getExtensionAttributes(); - - $isSubscribed = (int) $extensionAttributes->getIsSubscribed() === Subscriber::STATUS_SUBSCRIBED ?: false; - $extensionAttributes->setIsSubscribed($isSubscribed); - } - - return $searchResults; - } - /** * Set Is Subscribed extension attribute * diff --git a/app/code/Magento/Newsletter/etc/extension_attributes.xml b/app/code/Magento/Newsletter/etc/extension_attributes.xml index 09925024e97d5..5c38c02c032b0 100644 --- a/app/code/Magento/Newsletter/etc/extension_attributes.xml +++ b/app/code/Magento/Newsletter/etc/extension_attributes.xml @@ -8,10 +8,6 @@ <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Api/etc/extension_attributes.xsd"> <extension_attributes for="Magento\Customer\Api\Data\CustomerInterface"> - <attribute code="is_subscribed" type="boolean" > - <join reference_table="newsletter_subscriber" reference_field="customer_id" join_on_field="entity_id"> - <field>subscriber_status</field> - </join> - </attribute> + <attribute code="is_subscribed" type="boolean"/> </extension_attributes> </config> diff --git a/dev/tests/integration/testsuite/Magento/Newsletter/Model/Plugin/PluginTest.php b/dev/tests/integration/testsuite/Magento/Newsletter/Model/Plugin/PluginTest.php index 97f59e94d9cfe..133d74aec03da 100644 --- a/dev/tests/integration/testsuite/Magento/Newsletter/Model/Plugin/PluginTest.php +++ b/dev/tests/integration/testsuite/Magento/Newsletter/Model/Plugin/PluginTest.php @@ -205,4 +205,18 @@ public function testCustomerWithZeroStoreIdIsSubscribed() $this->assertEquals($customer->getId(), (int)$subscriber->getCustomerId()); $this->assertEquals($currentStore, (int)$subscriber->getStoreId()); } + + /** + * Test get list customer, which have more then 2 subscribes in newsletter_subscriber. + * + * @magentoAppArea frontend + * @magentoDataFixture Magento/Newsletter/_files/subscribers.php + */ + public function testCustomerWithTwoNewsLetterSubscriptions() + { + /** @var \Magento\Framework\Api\SearchCriteriaBuilder $searchBuilder */ + $searchBuilder = Bootstrap::getObjectManager()->create(\Magento\Framework\Api\SearchCriteriaBuilder::class); + $searchCriteria = $searchBuilder->addFilter('entity_id', 1)->create(); + $this->customerRepository->getList($searchCriteria); + } } From 62da7cb6912b4a36845f4e0a8cb2de4dff615202 Mon Sep 17 00:00:00 2001 From: OlgaVasyltsun <olga.vasyltsun@transoftgroup.com> Date: Fri, 11 Dec 2020 15:53:28 +0200 Subject: [PATCH 142/171] MC-24840: Infinite redirect in case of backend URL is different from default website URL --- .../App/Area/FrontNameResolverTest.php | 49 +++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 dev/tests/integration/testsuite/Magento/Backend/App/Area/FrontNameResolverTest.php diff --git a/dev/tests/integration/testsuite/Magento/Backend/App/Area/FrontNameResolverTest.php b/dev/tests/integration/testsuite/Magento/Backend/App/Area/FrontNameResolverTest.php new file mode 100644 index 0000000000000..979e8db19efb9 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Backend/App/Area/FrontNameResolverTest.php @@ -0,0 +1,49 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +declare(strict_types=1); + +namespace Magento\Backend\App\Area; + +use PHPUnit\Framework\TestCase; +use Magento\TestFramework\Helper\Bootstrap; + +/** + * @magentoAppArea adminhtml + */ +class FrontNameResolverTest extends TestCase +{ + /** + * @var \Magento\Framework\ObjectManagerInterface + */ + protected $objectManager; + + /** + * @var FrontNameResolver + */ + protected $model; + + /** + * @inheritDoc + */ + protected function setUp(): void + { + $this->objectManager = Bootstrap::getObjectManager(); + $this->model = $this->objectManager->create( + FrontNameResolver::class + ); + $_SERVER['HTTP_HOST'] = 'localhost'; + } + + /** + * @magentoDbIsolation enabled + * @magentoConfigFixture current_store web/unsecure/base_url http://example.com/ + */ + public function testIsHostBackend() + { + $this->assertTrue($this->model->isHostBackend()); + } +} From f9445ccaf7fe3300acf451c6950ecee08643f981 Mon Sep 17 00:00:00 2001 From: Vadim Malesh <51680850+engcom-Charlie@users.noreply.github.com> Date: Fri, 11 Dec 2020 16:05:00 +0200 Subject: [PATCH 143/171] fix stepKey name --- .../AdminApplyTierPriceToProductWithPercentageDiscountTest.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 143fa6657cd3b..0b29d2edb6615 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminApplyTierPriceToProductTest/AdminApplyTierPriceToProductWithPercentageDiscountTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminApplyTierPriceToProductTest/AdminApplyTierPriceToProductWithPercentageDiscountTest.xml @@ -44,7 +44,7 @@ <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="scrollToTopOfPage"/> <actionGroup ref="AdminProductFormOpenAdvancedPricingDialogActionGroup" stepKey="clickOnAdvancedPricingButton"/> <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForCustomerGroupPriceAddButton"/> - <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="addCustomerGroupAllGroupsQty1PriceDiscountAndpercente"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="addCustomerGroupAllGroupsQty1PriceDiscountAndpercent"/> <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="fillProductTierPriceQtyInput"/> <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="selectProductTierPriceValueType"/> From f70063cabec8db464636408f7999d7f48fa9654d Mon Sep 17 00:00:00 2001 From: "rostyslav.hymon" <rostyslav.hymon@transoftgroup.com> Date: Fri, 11 Dec 2020 17:27:17 +0200 Subject: [PATCH 144/171] MC-39282: Bundled product cannot be saved when tier price is assigned and Magento\Framework\Api\ExtensibleDataObjectConverter is used to convert product data --- app/code/Magento/Catalog/Model/Product/Type/Price.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/Catalog/Model/Product/Type/Price.php b/app/code/Magento/Catalog/Model/Product/Type/Price.php index 74a6c7f634f81..111e616897d58 100644 --- a/app/code/Magento/Catalog/Model/Product/Type/Price.php +++ b/app/code/Magento/Catalog/Model/Product/Type/Price.php @@ -379,7 +379,7 @@ public function getTierPrices($product) if (array_key_exists('website_price', $price)) { $value = $price['website_price']; } else { - $value = $price['price']; + $value = $price['price'] ?: null; } $tierPrice->setValue($value); $tierPrice->setQty($price['price_qty']); From b58d1f91f7f45024e06f19cd109899a864c7620e Mon Sep 17 00:00:00 2001 From: "rostyslav.hymon" <rostyslav.hymon@transoftgroup.com> Date: Fri, 11 Dec 2020 18:06:35 +0200 Subject: [PATCH 145/171] MC-39282: Bundled product cannot be saved when tier price is assigned and Magento\Framework\Api\ExtensibleDataObjectConverter is used to convert product data --- app/code/Magento/Catalog/Model/Product/Type/Price.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/Catalog/Model/Product/Type/Price.php b/app/code/Magento/Catalog/Model/Product/Type/Price.php index 111e616897d58..206f3dba0ee60 100644 --- a/app/code/Magento/Catalog/Model/Product/Type/Price.php +++ b/app/code/Magento/Catalog/Model/Product/Type/Price.php @@ -379,7 +379,7 @@ public function getTierPrices($product) if (array_key_exists('website_price', $price)) { $value = $price['website_price']; } else { - $value = $price['price'] ?: null; + $value = $price['price'] ?? 0; } $tierPrice->setValue($value); $tierPrice->setQty($price['price_qty']); From 11d4a9f35f093f9b7c7eb4ed60a833ab7c841851 Mon Sep 17 00:00:00 2001 From: "rostyslav.hymon" <rostyslav.hymon@transoftgroup.com> Date: Mon, 14 Dec 2020 10:52:08 +0200 Subject: [PATCH 146/171] MC-39282: Bundled product cannot be saved when tier price is assigned and Magento\Framework\Api\ExtensibleDataObjectConverter is used to convert product data --- .../Unit/Model/Product/Type/PriceTest.php | 36 +++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/app/code/Magento/Catalog/Test/Unit/Model/Product/Type/PriceTest.php b/app/code/Magento/Catalog/Test/Unit/Model/Product/Type/PriceTest.php index 09ad8bb41de7c..c14bb7f524d03 100644 --- a/app/code/Magento/Catalog/Test/Unit/Model/Product/Type/PriceTest.php +++ b/app/code/Magento/Catalog/Test/Unit/Model/Product/Type/PriceTest.php @@ -263,4 +263,40 @@ function () { ); } } + + /** + * Get tier price with percent value type + * + * @return void + */ + public function testGetPricesWithPercentType(): void + { + $tierPrices = [ + 0 => [ + 'record_id' => 0, + 'cust_group' => 3200, + 'price_qty' => 3, + 'website_id' => 0, + 'value_type' => 'percent', + 'percentage_value' => 10, + ], + ]; + $this->product->setData('tier_price', $tierPrices); + $this->tpFactory->expects($this->any()) + ->method('create') + ->willReturnCallback( + function () { + return $this->objectManagerHelper->getObject(TierPrice::class); + } + ); + $tierPriceExtensionMock = $this->getMockBuilder(ProductTierPriceExtensionInterface::class) + ->onlyMethods(['getPercentageValue', 'setPercentageValue']) + ->getMockForAbstractClass(); + $tierPriceExtensionMock->method('getPercentageValue') + ->willReturn(50); + $this->tierPriceExtensionFactoryMock->method('create') + ->willReturn($tierPriceExtensionMock); + + $this->assertInstanceOf(TierPrice::class, $this->model->getTierPrices($this->product)[0]); + } } From b54e7ae78916d215288b4ddb89d7351b5e183cef Mon Sep 17 00:00:00 2001 From: Vova Yatsyuk <vova.yatsyuk@gmail.com> Date: Mon, 14 Dec 2020 13:35:14 +0200 Subject: [PATCH 147/171] Declare optional argument after required. This prevents PHP fatal error when plugin is added to the one of parent classes. Error example: 'Error: Cannot instantiate interface Magento\Framework\Data\OptionSourceInterface' --- .../MediaGalleryUi/Ui/Component/Listing/Filters/Asset.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/code/Magento/MediaGalleryUi/Ui/Component/Listing/Filters/Asset.php b/app/code/Magento/MediaGalleryUi/Ui/Component/Listing/Filters/Asset.php index f61e34512bfe3..57a59ad800469 100644 --- a/app/code/Magento/MediaGalleryUi/Ui/Component/Listing/Filters/Asset.php +++ b/app/code/Magento/MediaGalleryUi/Ui/Component/Listing/Filters/Asset.php @@ -33,8 +33,8 @@ class Asset extends Select * @param UiComponentFactory $uiComponentFactory * @param FilterBuilder $filterBuilder * @param FilterModifier $filterModifier - * @param OptionSourceInterface $optionsProvider * @param GetContentByAssetIdsInterface $getContentIdentities + * @param OptionSourceInterface $optionsProvider * @param array $components * @param array $data * @SuppressWarnings(PHPMD.ExcessiveParameterList) @@ -44,8 +44,8 @@ public function __construct( UiComponentFactory $uiComponentFactory, FilterBuilder $filterBuilder, FilterModifier $filterModifier, - OptionSourceInterface $optionsProvider = null, GetContentByAssetIdsInterface $getContentIdentities, + OptionSourceInterface $optionsProvider = null, array $components = [], array $data = [] ) { From b82cae9b4c7c4e356bd19bc8cfc64011612ff702 Mon Sep 17 00:00:00 2001 From: Serhiy Yelahin <serhiy.yelahin@transoftgroup.com> Date: Mon, 14 Dec 2020 15:47:16 +0200 Subject: [PATCH 148/171] MC-39531: guest-carts/{cart_id}/items returns incorrect product name on non-default website --- .../Model/Quote/Plugin/UpdateQuoteStoreId.php | 61 +++++++++++++++++++ app/code/Magento/Quote/etc/webapi_rest/di.xml | 3 + 2 files changed, 64 insertions(+) create mode 100644 app/code/Magento/Quote/Model/Quote/Plugin/UpdateQuoteStoreId.php diff --git a/app/code/Magento/Quote/Model/Quote/Plugin/UpdateQuoteStoreId.php b/app/code/Magento/Quote/Model/Quote/Plugin/UpdateQuoteStoreId.php new file mode 100644 index 0000000000000..4ed347b1eb06d --- /dev/null +++ b/app/code/Magento/Quote/Model/Quote/Plugin/UpdateQuoteStoreId.php @@ -0,0 +1,61 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Quote\Model\Quote\Plugin; + +use Magento\Quote\Model\Quote; +use Magento\Quote\Model\QuoteRepository; +use Magento\Store\Model\StoreManagerInterface; + +/** + * Updates quote store id. + */ +class UpdateQuoteStoreId +{ + /** + * @var QuoteRepository + */ + private $quoteRepository; + + /** + * @var StoreManagerInterface + */ + private $storeManager; + + /** + * @param QuoteRepository $quoteRepository + * @param StoreManagerInterface $storeManager + */ + public function __construct( + QuoteRepository $quoteRepository, + StoreManagerInterface $storeManager + ) { + $this->quoteRepository = $quoteRepository; + $this->storeManager = $storeManager; + } + + /** + * Update store id in requested quote by store id from request. + * + * @param Quote $subject + * @param null $result + * @return void + * @SuppressWarnings(PHPMD.UnusedFormalParameter) + */ + public function afterLoadByIdWithoutStore( + Quote $subject, + $result + ) { + $quoteStoreId = (int) $subject->getStoreId(); + $storeId = $this->storeManager->getStore() + ->getId() ?: $this->storeManager->getDefaultStoreView() + ->getId(); + if ($storeId !== $quoteStoreId) { + $subject->setStoreId($storeId); + } + } +} diff --git a/app/code/Magento/Quote/etc/webapi_rest/di.xml b/app/code/Magento/Quote/etc/webapi_rest/di.xml index a55d2146be156..6ed9909f04eb9 100644 --- a/app/code/Magento/Quote/etc/webapi_rest/di.xml +++ b/app/code/Magento/Quote/etc/webapi_rest/di.xml @@ -16,4 +16,7 @@ <type name="Magento\Quote\Api\GuestCartItemRepositoryInterface"> <plugin name="updateCartIdFromRequest" type="Magento\Quote\Plugin\UpdateCartId" /> </type> + <type name="Magento\Quote\Model\Quote"> + <plugin name="updateQuoteStoreId" type="Magento\Quote\Model\Quote\Plugin\UpdateQuoteStoreId" /> + </type> </config> From 66c3bff0b4c5aff1cfd1dd26bd7719bd622d8862 Mon Sep 17 00:00:00 2001 From: korovitskyi <o.korovitskyi@atwix.com> Date: Tue, 15 Dec 2020 00:04:52 +0200 Subject: [PATCH 149/171] #31168 updated after get list method --- .../Model/Plugin/CustomerPlugin.php | 31 +++++++++++++++++++ .../Newsletter/Model/Plugin/PluginTest.php | 6 +++- 2 files changed, 36 insertions(+), 1 deletion(-) diff --git a/app/code/Magento/Newsletter/Model/Plugin/CustomerPlugin.php b/app/code/Magento/Newsletter/Model/Plugin/CustomerPlugin.php index 6c42875f5b32d..d3f8bcb8765c3 100644 --- a/app/code/Magento/Newsletter/Model/Plugin/CustomerPlugin.php +++ b/app/code/Magento/Newsletter/Model/Plugin/CustomerPlugin.php @@ -234,6 +234,37 @@ public function afterGetById(CustomerRepositoryInterface $subject, CustomerInter return $customer; } + /** + * Add subscription status to customer list + * + * @param CustomerRepositoryInterface $subject + * @param SearchResults $searchResults + * @return SearchResults + * @SuppressWarnings(PHPMD.UnusedFormalParameter) + */ + public function afterGetList(CustomerRepositoryInterface $subject, SearchResults $searchResults): SearchResults + { + $customerEmails = []; + + foreach ($searchResults->getItems() as $customer) { + $customerEmails[] = $customer->getEmail(); + } + + $collection = $this->collectionFactory->create(); + $collection->addFieldToFilter('subscriber_email', ['in' => $customerEmails]); + + foreach ($searchResults->getItems() as $customer) { + /** @var CustomerExtensionInterface $extensionAttributes */ + $extensionAttributes = $customer->getExtensionAttributes(); + /** @var Subscriber $subscribe */ + $subscribe = $collection->getItemByColumnValue('subscriber_email', $customer->getEmail()); + $isSubscribed = $subscribe && (int) $subscribe->getStatus() === Subscriber::STATUS_SUBSCRIBED; + $extensionAttributes->setIsSubscribed($isSubscribed); + } + + return $searchResults; + } + /** * Set Is Subscribed extension attribute * diff --git a/dev/tests/integration/testsuite/Magento/Newsletter/Model/Plugin/PluginTest.php b/dev/tests/integration/testsuite/Magento/Newsletter/Model/Plugin/PluginTest.php index 133d74aec03da..719d78b07ca3c 100644 --- a/dev/tests/integration/testsuite/Magento/Newsletter/Model/Plugin/PluginTest.php +++ b/dev/tests/integration/testsuite/Magento/Newsletter/Model/Plugin/PluginTest.php @@ -217,6 +217,10 @@ public function testCustomerWithTwoNewsLetterSubscriptions() /** @var \Magento\Framework\Api\SearchCriteriaBuilder $searchBuilder */ $searchBuilder = Bootstrap::getObjectManager()->create(\Magento\Framework\Api\SearchCriteriaBuilder::class); $searchCriteria = $searchBuilder->addFilter('entity_id', 1)->create(); - $this->customerRepository->getList($searchCriteria); + $items = $this->customerRepository->getList($searchCriteria)->getItems(); + /** @var \Magento\Customer\Api\Data\CustomerInterface $customer */ + $customer = $items[0]; + $extensionAttributes = $customer->getExtensionAttributes(); + $this->assertTrue($extensionAttributes->getIsSubscribed()); } } From bc231ce31a22b9f8120d1a9542a066cbc61ba70a Mon Sep 17 00:00:00 2001 From: Vadim Malesh <51680850+engcom-Charlie@users.noreply.github.com> Date: Tue, 15 Dec 2020 09:56:53 +0200 Subject: [PATCH 150/171] updated testCaseId --- .../Mftf/Test/AdminMassOrdersCancelClosedAndCompleteTest.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminMassOrdersCancelClosedAndCompleteTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminMassOrdersCancelClosedAndCompleteTest.xml index a4f4e006837e1..794d09226d87f 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminMassOrdersCancelClosedAndCompleteTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminMassOrdersCancelClosedAndCompleteTest.xml @@ -14,7 +14,7 @@ <title value="Mass cancel orders in status Complete, Closed"/> <description value="Try to cancel orders in status Complete, Closed"/> <severity value="MAJOR"/> - <testCaseId value="MC-16183"/> + <testCaseId value="MC-39905"/> <group value="sales"/> <group value="mtf_migrated"/> </annotations> From cbc884d700a4e7178bb575e4f6ecfed349428f33 Mon Sep 17 00:00:00 2001 From: Anna Pak <a.pak@atwix.com> Date: Tue, 15 Dec 2020 10:39:06 +0200 Subject: [PATCH 151/171] added AdminSelectAttributeSetActionGroup --- .../AdminSelectAttributeSetActionGroup.xml | 24 +++++++++++++++++++ .../AdminChangeProductAttributeSetTest.xml | 6 ++--- ...ateProductAttributesStoreViewScopeTest.xml | 4 +++- ...AdminConfigurableProductBulkUpdateTest.xml | 7 ++++-- 4 files changed, 35 insertions(+), 6 deletions(-) create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminSelectAttributeSetActionGroup.xml diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminSelectAttributeSetActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminSelectAttributeSetActionGroup.xml new file mode 100644 index 0000000000000..b0d0cc75b0e74 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminSelectAttributeSetActionGroup.xml @@ -0,0 +1,24 @@ +<?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="AdminSelectAttributeSetActionGroup"> + <annotations> + <description></description> + </annotations> + <arguments> + <argument name="attributeSet" type="entity"/> + </arguments> + + <click selector="{{AdminProductFormSection.attributeSet}}" stepKey="startEditAttrSet"/> + <fillField selector="{{AdminProductFormSection.attributeSetFilter}}" userInput="{{attributeSet.attribute_set_name}}" stepKey="searchForAttrSet"/> + <click selector="{{AdminProductFormSection.attributeSetFilterResult}}" stepKey="selectAttrSet"/> + + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminChangeProductAttributeSetTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminChangeProductAttributeSetTest.xml index 3b8c2cb736721..89b39cdd93355 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminChangeProductAttributeSetTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminChangeProductAttributeSetTest.xml @@ -60,9 +60,9 @@ <argument name="product" value="$$createSimpleProduct$$"/> </actionGroup> - <click selector="{{AdminProductFormSection.attributeSet}}" stepKey="startEditAttrSet"/> - <fillField selector="{{AdminProductFormSection.attributeSetFilter}}" userInput="$$createAttributeSet.attribute_set_name$$" stepKey="searchForAttrSet"/> - <click selector="{{AdminProductFormSection.attributeSetFilterResult}}" stepKey="selectAttrSet"/> + <actionGroup ref="AdminSelectAttributeSetActionGroup" stepKey="startEditAttrSet"> + <argument name="attributeSet" value="CatalogAttributeSet"/> + </actionGroup> <waitForText userInput="$$createProductAttribute.default_frontend_label$$" stepKey="seeAttributeInForm"/> </test> 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 30ab17f65f3c8..0312d7279d214 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminMassUpdateProductAttributesStoreViewScopeTest/AdminMassUpdateProductAttributesStoreViewScopeTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminMassUpdateProductAttributesStoreViewScopeTest/AdminMassUpdateProductAttributesStoreViewScopeTest.xml @@ -52,7 +52,9 @@ <!-- Update attribute --> <click selector="{{AdminEditProductAttributesSection.ChangeAttributeDescriptionToggle}}" stepKey="toggleToChangeDescription"/> <fillField selector="{{AdminEditProductAttributesSection.AttributeDescription}}" userInput="Updated $$createProductOne.custom_attributes[description]$$" stepKey="fillAttributeDescriptionField"/> - <click selector="{{AdminEditProductAttributesSection.Save}}" stepKey="save"/> + <actionGroup ref="AdminSaveProductsMassAttributesUpdateActionGroup" stepKey="save"/> + <!-- <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForSuccessMessage"/> --> + <!-- <click selector="{{AdminEditProductAttributesSection.Save}}" stepKey="save"/> --> <see selector="{{AdminProductMessagesSection.successMessage}}" userInput="Message is added to queue" stepKey="seeAttributeUpateSuccessMsg"/> 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 556ede0bdc06f..d4875684b70c1 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductUpdateTest/AdminConfigurableProductBulkUpdateTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductUpdateTest/AdminConfigurableProductBulkUpdateTest.xml @@ -59,8 +59,11 @@ <!-- Update the description --> <click selector="{{AdminUpdateAttributesSection.toggleDescription}}" stepKey="clickToggleDescription"/> <fillField selector="{{AdminUpdateAttributesSection.description}}" userInput="MFTF automation!" stepKey="fillDescription"/> - <click selector="{{AdminEditProductAttributesSection.Save}}" stepKey="clickSave"/> - <waitForElementVisible selector="{{AdminProductMessagesSection.successMessage}}" time="60" stepKey="waitForSuccessMessage"/> + <actionGroup ref="AdminSaveProductsMassAttributesUpdateActionGroup" stepKey="clickSave"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForSuccessMessage"/> + + <!-- <click selector="{{AdminEditProductAttributesSection.Save}}" stepKey="clickSave"/> + <waitForElementVisible selector="{{AdminProductMessagesSection.successMessage}}" time="60" stepKey="waitForSuccessMessage"/> --> <see selector="{{AdminProductMessagesSection.successMessage}}" userInput="Message is added to queue" stepKey="seeAttributeUpdateSuccessMsg"/> <!-- Apply changes --> From 55b0fc25c1a643a25a5af2e034f956efbddfff84 Mon Sep 17 00:00:00 2001 From: Anna Pak <a.pak@atwix.com> Date: Tue, 15 Dec 2020 12:18:24 +0200 Subject: [PATCH 152/171] updated tests with new ActionGroup --- .../Test/AdminAttributeSetSelectionTest.xml | 18 ++++++++++++------ .../AdminBasicBundleProductAttributesTest.xml | 8 +++++--- ...tributeSetOnEditProductPageActionGroup.xml} | 11 +++++------ .../AdminChangeProductAttributeSetTest.xml | 4 ++-- .../Test/AdminCreateAttributeSetEntityTest.xml | 8 +++++--- ...dminCreateProductCustomAttributeSetTest.xml | 8 +++++--- 6 files changed, 34 insertions(+), 23 deletions(-) rename app/code/Magento/Catalog/Test/Mftf/ActionGroup/{AdminSelectAttributeSetActionGroup.xml => AdminSelectAttributeSetOnEditProductPageActionGroup.xml} (69%) diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/AdminAttributeSetSelectionTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/AdminAttributeSetSelectionTest.xml index ca8a35ee7a363..ceed14e76fb4b 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/AdminAttributeSetSelectionTest.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/AdminAttributeSetSelectionTest.xml @@ -42,9 +42,13 @@ <!-- Switch from default attribute set to new attribute set --> <amOnPage url="{{AdminProductCreatePage.url('4', 'bundle')}}" stepKey="goToNewProductPage"/> <waitForPageLoad stepKey="wait2"/> - <click selector="{{AdminProductFormSection.attributeSet}}" stepKey="startEditAttrSet"/> - <fillField selector="{{AdminProductFormSection.attributeSetFilter}}" userInput="{{ProductAttributeFrontendLabel.label}}" stepKey="searchForAttrSet"/> - <click selector="{{AdminProductFormSection.attributeSetFilterResult}}" stepKey="selectAttrSet"/> + + <actionGroup ref="AdminSelectAttributeSetOnEditProductPageActionGroup" stepKey="startEditAttrSet"> + <argument name="attributeSet" value="{{ProductAttributeFrontendLabel.label}}"/> + </actionGroup> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="searchForAttrSet"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="selectAttrSet"/> + <fillField selector="{{AdminProductFormBundleSection.productName}}" userInput="{{BundleProduct.name}}" stepKey="fillProductName"/> <fillField selector="{{AdminProductFormBundleSection.productSku}}" userInput="{{BundleProduct.sku}}" stepKey="fillProductSku"/> @@ -64,9 +68,11 @@ <click selector="{{AdminProductFiltersSection.attributeSetOfFirstRow(ProductAttributeFrontendLabel.label)}}" stepKey="clickAttributeSet2"/> <waitForPageLoad stepKey="waitForPageLoad2"/> - <click selector="{{AdminProductFormSection.attributeSet}}" stepKey="startEditAttrSet2"/> - <fillField selector="{{AdminProductFormSection.attributeSetFilter}}" userInput="{{BundleProduct.defaultAttribute}}" stepKey="searchForAttrSet2"/> - <click selector="{{AdminProductFormSection.attributeSetFilterResult}}" stepKey="selectAttrSet2"/> + <actionGroup ref="AdminSelectAttributeSetOnEditProductPageActionGroup" stepKey="startEditAttrSet2"> + <argument name="attributeSet" value="{{BundleProduct.defaultAttribute}}"/> + </actionGroup> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="searchForAttrSet2"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="selectAttrSet2"/> <!--save the product/published by default--> <actionGroup ref="AdminProductFormSaveActionGroup" stepKey="clickSaveButton2"/> diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/AdminBasicBundleProductAttributesTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/AdminBasicBundleProductAttributesTest.xml index 79d85c6ced957..228c1d3cf1def 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/AdminBasicBundleProductAttributesTest.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/AdminBasicBundleProductAttributesTest.xml @@ -109,9 +109,11 @@ <checkOption selector="{{AdminProductFormBundleSection.enableDisableToggle}}" stepKey="clickOnEnableDisableToggleAgain"/> <!--Apply Attribute Set--> - <click selector="{{AdminProductFormSection.attributeSet}}" stepKey="startEditAttrSet"/> - <fillField selector="{{AdminProductFormSection.attributeSetFilter}}" userInput="{{ProductAttributeFrontendLabelTwo.label}}" stepKey="searchForAttrSet"/> - <click selector="{{AdminProductFormSection.attributeSetFilterResultByName(ProductAttributeFrontendLabelTwo.label)}}" stepKey="selectAttrSet"/> + <actionGroup ref="AdminSelectAttributeSetOnEditProductPageActionGroup" stepKey="startEditAttrSet"> + <argument name="attributeSet" value="{{ProductAttributeFrontendLabelTwo.label}}"/> + </actionGroup> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="searchForAttrSet"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="selectAttrSet"/> <!--Product name and SKU--> <fillField selector="{{AdminProductFormBundleSection.productName}}" userInput="{{BundleProduct.name2}}" stepKey="fillProductName"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminSelectAttributeSetActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminSelectAttributeSetOnEditProductPageActionGroup.xml similarity index 69% rename from app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminSelectAttributeSetActionGroup.xml rename to app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminSelectAttributeSetOnEditProductPageActionGroup.xml index b0d0cc75b0e74..2307ad313ad3c 100644 --- a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminSelectAttributeSetActionGroup.xml +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminSelectAttributeSetOnEditProductPageActionGroup.xml @@ -8,17 +8,16 @@ <actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> - <actionGroup name="AdminSelectAttributeSetActionGroup"> + <actionGroup name="AdminSelectAttributeSetOnEditProductPageActionGroup"> <annotations> <description></description> </annotations> <arguments> - <argument name="attributeSet" type="entity"/> + <argument name="attributeSet" type="string"/> </arguments> - <click selector="{{AdminProductFormSection.attributeSet}}" stepKey="startEditAttrSet"/> - <fillField selector="{{AdminProductFormSection.attributeSetFilter}}" userInput="{{attributeSet.attribute_set_name}}" stepKey="searchForAttrSet"/> - <click selector="{{AdminProductFormSection.attributeSetFilterResult}}" stepKey="selectAttrSet"/> - + <click selector="{{AdminProductFormSection.attributeSet}}" stepKey="clickAttributeSetDropdown"/> + <fillField selector="{{AdminProductFormSection.attributeSetFilter}}" userInput="{{attributeSet}}" stepKey="searchForAttributeSet"/> + <click selector="{{AdminProductFormSection.attributeSetFilterResult}}" stepKey="selectAttributeSet"/> </actionGroup> </actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminChangeProductAttributeSetTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminChangeProductAttributeSetTest.xml index 89b39cdd93355..7c124a60c7877 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminChangeProductAttributeSetTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminChangeProductAttributeSetTest.xml @@ -60,8 +60,8 @@ <argument name="product" value="$$createSimpleProduct$$"/> </actionGroup> - <actionGroup ref="AdminSelectAttributeSetActionGroup" stepKey="startEditAttrSet"> - <argument name="attributeSet" value="CatalogAttributeSet"/> + <actionGroup ref="AdminSelectAttributeSetOnEditProductPageActionGroup" stepKey="startEditAttrSet"> + <argument name="attributeSet" value="$$createAttributeSet.attribute_set_name$$"/> </actionGroup> <waitForText userInput="$$createProductAttribute.default_frontend_label$$" stepKey="seeAttributeInForm"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateAttributeSetEntityTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateAttributeSetEntityTest.xml index 9fef5e4203167..8d3fbbaa34355 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateAttributeSetEntityTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateAttributeSetEntityTest.xml @@ -64,9 +64,11 @@ </actionGroup> <!-- Switch from default attribute set to new attribute set --> - <click selector="{{AdminProductFormSection.attributeSet}}" stepKey="startEditAttrSet"/> - <fillField selector="{{AdminProductFormSection.attributeSetFilter}}" userInput="$$createAttributeSet.attribute_set_name$$" stepKey="searchForAttrSet"/> - <click selector="{{AdminProductFormSection.attributeSetFilterResult}}" stepKey="selectAttrSet"/> + <actionGroup ref="AdminSelectAttributeSetOnEditProductPageActionGroup" stepKey="startEditAttrSet"> + <argument name="attributeSet" value="$$createAttributeSet.attribute_set_name$$"/> + </actionGroup> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="searchForAttrSet"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="selectAttrSet"/> <!-- See new attribute set --> <see selector="{{AdminProductFormSection.attributeSet}}" userInput="$$createAttributeSet.attribute_set_name$$" stepKey="seeAttributeSetName"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateProductCustomAttributeSetTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateProductCustomAttributeSetTest.xml index d2278f3ddae1d..d1110f593545d 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateProductCustomAttributeSetTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateProductCustomAttributeSetTest.xml @@ -62,9 +62,11 @@ <!-- Switch from default attribute set to new attribute set --> <!-- A scrollToTopOfPage is needed to hide the floating header --> <scrollToTopOfPage stepKey="scrollToTop"/> - <click selector="{{AdminProductFormSection.attributeSet}}" stepKey="startEditAttrSet"/> - <fillField selector="{{AdminProductFormSection.attributeSetFilter}}" userInput="{{ProductAttributeFrontendLabel.label}}" stepKey="searchForAttrSet"/> - <click selector="{{AdminProductFormSection.attributeSetFilterResult}}" stepKey="selectAttrSet"/> + <actionGroup ref="AdminSelectAttributeSetOnEditProductPageActionGroup" stepKey="startEditAttrSet"> + <argument name="attributeSet" value="{{ProductAttributeFrontendLabel.label}}"/> + </actionGroup> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="searchForAttrSet"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="selectAttrSet"/> <!-- See new attibute set --> <seeElementInDOM selector="{{AdminProductFormSection.divByDataIndex('testgroupname')}}" stepKey="seeTestGroupName"/> From 88b58a08d39906584398e0c7762413e18c054a27 Mon Sep 17 00:00:00 2001 From: Anna Pak <a.pak@atwix.com> Date: Tue, 15 Dec 2020 12:25:08 +0200 Subject: [PATCH 153/171] refactored --- ...AdminSelectAttributeSetOnEditProductPageActionGroup.xml | 3 ++- .../Test/Mftf/Test/AdminChangeProductAttributeSetTest.xml | 2 ++ .../AdminMassUpdateProductAttributesStoreViewScopeTest.xml | 4 +--- .../AdminConfigurableProductBulkUpdateTest.xml | 7 ++----- 4 files changed, 7 insertions(+), 9 deletions(-) diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminSelectAttributeSetOnEditProductPageActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminSelectAttributeSetOnEditProductPageActionGroup.xml index 2307ad313ad3c..42f7f72c1cd73 100644 --- a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminSelectAttributeSetOnEditProductPageActionGroup.xml +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminSelectAttributeSetOnEditProductPageActionGroup.xml @@ -10,7 +10,8 @@ xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> <actionGroup name="AdminSelectAttributeSetOnEditProductPageActionGroup"> <annotations> - <description></description> + <description>Selects the specified value from the Attribute Set dropdown. + The Edit Product Page should be opened prior to Action Group execution</description> </annotations> <arguments> <argument name="attributeSet" type="string"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminChangeProductAttributeSetTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminChangeProductAttributeSetTest.xml index 7c124a60c7877..e7d4241500bfb 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminChangeProductAttributeSetTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminChangeProductAttributeSetTest.xml @@ -63,6 +63,8 @@ <actionGroup ref="AdminSelectAttributeSetOnEditProductPageActionGroup" stepKey="startEditAttrSet"> <argument name="attributeSet" value="$$createAttributeSet.attribute_set_name$$"/> </actionGroup> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="searchForAttrSet"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="selectAttrSet"/> <waitForText userInput="$$createProductAttribute.default_frontend_label$$" stepKey="seeAttributeInForm"/> </test> 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 0312d7279d214..30ab17f65f3c8 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminMassUpdateProductAttributesStoreViewScopeTest/AdminMassUpdateProductAttributesStoreViewScopeTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminMassUpdateProductAttributesStoreViewScopeTest/AdminMassUpdateProductAttributesStoreViewScopeTest.xml @@ -52,9 +52,7 @@ <!-- Update attribute --> <click selector="{{AdminEditProductAttributesSection.ChangeAttributeDescriptionToggle}}" stepKey="toggleToChangeDescription"/> <fillField selector="{{AdminEditProductAttributesSection.AttributeDescription}}" userInput="Updated $$createProductOne.custom_attributes[description]$$" stepKey="fillAttributeDescriptionField"/> - <actionGroup ref="AdminSaveProductsMassAttributesUpdateActionGroup" stepKey="save"/> - <!-- <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForSuccessMessage"/> --> - <!-- <click selector="{{AdminEditProductAttributesSection.Save}}" stepKey="save"/> --> + <click selector="{{AdminEditProductAttributesSection.Save}}" stepKey="save"/> <see selector="{{AdminProductMessagesSection.successMessage}}" userInput="Message is added to queue" stepKey="seeAttributeUpateSuccessMsg"/> 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 d4875684b70c1..556ede0bdc06f 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductUpdateTest/AdminConfigurableProductBulkUpdateTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductUpdateTest/AdminConfigurableProductBulkUpdateTest.xml @@ -59,11 +59,8 @@ <!-- Update the description --> <click selector="{{AdminUpdateAttributesSection.toggleDescription}}" stepKey="clickToggleDescription"/> <fillField selector="{{AdminUpdateAttributesSection.description}}" userInput="MFTF automation!" stepKey="fillDescription"/> - <actionGroup ref="AdminSaveProductsMassAttributesUpdateActionGroup" stepKey="clickSave"/> - <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForSuccessMessage"/> - - <!-- <click selector="{{AdminEditProductAttributesSection.Save}}" stepKey="clickSave"/> - <waitForElementVisible selector="{{AdminProductMessagesSection.successMessage}}" time="60" stepKey="waitForSuccessMessage"/> --> + <click selector="{{AdminEditProductAttributesSection.Save}}" stepKey="clickSave"/> + <waitForElementVisible selector="{{AdminProductMessagesSection.successMessage}}" time="60" stepKey="waitForSuccessMessage"/> <see selector="{{AdminProductMessagesSection.successMessage}}" userInput="Message is added to queue" stepKey="seeAttributeUpdateSuccessMsg"/> <!-- Apply changes --> From 9d505f4662e54e77b43c392ee57976722bfb3853 Mon Sep 17 00:00:00 2001 From: Anna Pak <a.pak@atwix.com> Date: Tue, 15 Dec 2020 12:27:17 +0200 Subject: [PATCH 154/171] added AdminSelectAttributeSetOnEditProductPageActionGroup --- .../Test/AdminAttributeSetSelectionTest.xml | 18 +++++++++----- .../AdminBasicBundleProductAttributesTest.xml | 8 ++++--- ...tributeSetOnEditProductPageActionGroup.xml | 24 +++++++++++++++++++ .../AdminChangeProductAttributeSetTest.xml | 8 ++++--- .../AdminCreateAttributeSetEntityTest.xml | 8 ++++--- ...minCreateProductCustomAttributeSetTest.xml | 8 ++++--- 6 files changed, 56 insertions(+), 18 deletions(-) create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminSelectAttributeSetOnEditProductPageActionGroup.xml diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/AdminAttributeSetSelectionTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/AdminAttributeSetSelectionTest.xml index ca8a35ee7a363..ceed14e76fb4b 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/AdminAttributeSetSelectionTest.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/AdminAttributeSetSelectionTest.xml @@ -42,9 +42,13 @@ <!-- Switch from default attribute set to new attribute set --> <amOnPage url="{{AdminProductCreatePage.url('4', 'bundle')}}" stepKey="goToNewProductPage"/> <waitForPageLoad stepKey="wait2"/> - <click selector="{{AdminProductFormSection.attributeSet}}" stepKey="startEditAttrSet"/> - <fillField selector="{{AdminProductFormSection.attributeSetFilter}}" userInput="{{ProductAttributeFrontendLabel.label}}" stepKey="searchForAttrSet"/> - <click selector="{{AdminProductFormSection.attributeSetFilterResult}}" stepKey="selectAttrSet"/> + + <actionGroup ref="AdminSelectAttributeSetOnEditProductPageActionGroup" stepKey="startEditAttrSet"> + <argument name="attributeSet" value="{{ProductAttributeFrontendLabel.label}}"/> + </actionGroup> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="searchForAttrSet"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="selectAttrSet"/> + <fillField selector="{{AdminProductFormBundleSection.productName}}" userInput="{{BundleProduct.name}}" stepKey="fillProductName"/> <fillField selector="{{AdminProductFormBundleSection.productSku}}" userInput="{{BundleProduct.sku}}" stepKey="fillProductSku"/> @@ -64,9 +68,11 @@ <click selector="{{AdminProductFiltersSection.attributeSetOfFirstRow(ProductAttributeFrontendLabel.label)}}" stepKey="clickAttributeSet2"/> <waitForPageLoad stepKey="waitForPageLoad2"/> - <click selector="{{AdminProductFormSection.attributeSet}}" stepKey="startEditAttrSet2"/> - <fillField selector="{{AdminProductFormSection.attributeSetFilter}}" userInput="{{BundleProduct.defaultAttribute}}" stepKey="searchForAttrSet2"/> - <click selector="{{AdminProductFormSection.attributeSetFilterResult}}" stepKey="selectAttrSet2"/> + <actionGroup ref="AdminSelectAttributeSetOnEditProductPageActionGroup" stepKey="startEditAttrSet2"> + <argument name="attributeSet" value="{{BundleProduct.defaultAttribute}}"/> + </actionGroup> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="searchForAttrSet2"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="selectAttrSet2"/> <!--save the product/published by default--> <actionGroup ref="AdminProductFormSaveActionGroup" stepKey="clickSaveButton2"/> diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/AdminBasicBundleProductAttributesTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/AdminBasicBundleProductAttributesTest.xml index 79d85c6ced957..228c1d3cf1def 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/AdminBasicBundleProductAttributesTest.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/AdminBasicBundleProductAttributesTest.xml @@ -109,9 +109,11 @@ <checkOption selector="{{AdminProductFormBundleSection.enableDisableToggle}}" stepKey="clickOnEnableDisableToggleAgain"/> <!--Apply Attribute Set--> - <click selector="{{AdminProductFormSection.attributeSet}}" stepKey="startEditAttrSet"/> - <fillField selector="{{AdminProductFormSection.attributeSetFilter}}" userInput="{{ProductAttributeFrontendLabelTwo.label}}" stepKey="searchForAttrSet"/> - <click selector="{{AdminProductFormSection.attributeSetFilterResultByName(ProductAttributeFrontendLabelTwo.label)}}" stepKey="selectAttrSet"/> + <actionGroup ref="AdminSelectAttributeSetOnEditProductPageActionGroup" stepKey="startEditAttrSet"> + <argument name="attributeSet" value="{{ProductAttributeFrontendLabelTwo.label}}"/> + </actionGroup> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="searchForAttrSet"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="selectAttrSet"/> <!--Product name and SKU--> <fillField selector="{{AdminProductFormBundleSection.productName}}" userInput="{{BundleProduct.name2}}" stepKey="fillProductName"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminSelectAttributeSetOnEditProductPageActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminSelectAttributeSetOnEditProductPageActionGroup.xml new file mode 100644 index 0000000000000..42f7f72c1cd73 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminSelectAttributeSetOnEditProductPageActionGroup.xml @@ -0,0 +1,24 @@ +<?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="AdminSelectAttributeSetOnEditProductPageActionGroup"> + <annotations> + <description>Selects the specified value from the Attribute Set dropdown. + The Edit Product Page should be opened prior to Action Group execution</description> + </annotations> + <arguments> + <argument name="attributeSet" type="string"/> + </arguments> + + <click selector="{{AdminProductFormSection.attributeSet}}" stepKey="clickAttributeSetDropdown"/> + <fillField selector="{{AdminProductFormSection.attributeSetFilter}}" userInput="{{attributeSet}}" stepKey="searchForAttributeSet"/> + <click selector="{{AdminProductFormSection.attributeSetFilterResult}}" stepKey="selectAttributeSet"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminChangeProductAttributeSetTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminChangeProductAttributeSetTest.xml index 3b8c2cb736721..e7d4241500bfb 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminChangeProductAttributeSetTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminChangeProductAttributeSetTest.xml @@ -60,9 +60,11 @@ <argument name="product" value="$$createSimpleProduct$$"/> </actionGroup> - <click selector="{{AdminProductFormSection.attributeSet}}" stepKey="startEditAttrSet"/> - <fillField selector="{{AdminProductFormSection.attributeSetFilter}}" userInput="$$createAttributeSet.attribute_set_name$$" stepKey="searchForAttrSet"/> - <click selector="{{AdminProductFormSection.attributeSetFilterResult}}" stepKey="selectAttrSet"/> + <actionGroup ref="AdminSelectAttributeSetOnEditProductPageActionGroup" stepKey="startEditAttrSet"> + <argument name="attributeSet" value="$$createAttributeSet.attribute_set_name$$"/> + </actionGroup> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="searchForAttrSet"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="selectAttrSet"/> <waitForText userInput="$$createProductAttribute.default_frontend_label$$" stepKey="seeAttributeInForm"/> </test> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateAttributeSetEntityTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateAttributeSetEntityTest.xml index 9fef5e4203167..8d3fbbaa34355 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateAttributeSetEntityTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateAttributeSetEntityTest.xml @@ -64,9 +64,11 @@ </actionGroup> <!-- Switch from default attribute set to new attribute set --> - <click selector="{{AdminProductFormSection.attributeSet}}" stepKey="startEditAttrSet"/> - <fillField selector="{{AdminProductFormSection.attributeSetFilter}}" userInput="$$createAttributeSet.attribute_set_name$$" stepKey="searchForAttrSet"/> - <click selector="{{AdminProductFormSection.attributeSetFilterResult}}" stepKey="selectAttrSet"/> + <actionGroup ref="AdminSelectAttributeSetOnEditProductPageActionGroup" stepKey="startEditAttrSet"> + <argument name="attributeSet" value="$$createAttributeSet.attribute_set_name$$"/> + </actionGroup> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="searchForAttrSet"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="selectAttrSet"/> <!-- See new attribute set --> <see selector="{{AdminProductFormSection.attributeSet}}" userInput="$$createAttributeSet.attribute_set_name$$" stepKey="seeAttributeSetName"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateProductCustomAttributeSetTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateProductCustomAttributeSetTest.xml index d2278f3ddae1d..d1110f593545d 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateProductCustomAttributeSetTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateProductCustomAttributeSetTest.xml @@ -62,9 +62,11 @@ <!-- Switch from default attribute set to new attribute set --> <!-- A scrollToTopOfPage is needed to hide the floating header --> <scrollToTopOfPage stepKey="scrollToTop"/> - <click selector="{{AdminProductFormSection.attributeSet}}" stepKey="startEditAttrSet"/> - <fillField selector="{{AdminProductFormSection.attributeSetFilter}}" userInput="{{ProductAttributeFrontendLabel.label}}" stepKey="searchForAttrSet"/> - <click selector="{{AdminProductFormSection.attributeSetFilterResult}}" stepKey="selectAttrSet"/> + <actionGroup ref="AdminSelectAttributeSetOnEditProductPageActionGroup" stepKey="startEditAttrSet"> + <argument name="attributeSet" value="{{ProductAttributeFrontendLabel.label}}"/> + </actionGroup> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="searchForAttrSet"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="selectAttrSet"/> <!-- See new attibute set --> <seeElementInDOM selector="{{AdminProductFormSection.divByDataIndex('testgroupname')}}" stepKey="seeTestGroupName"/> From 8752d9ccbc1a5786078bacb23507213b454a5634 Mon Sep 17 00:00:00 2001 From: Serhiy Yelahin <serhiy.yelahin@transoftgroup.com> Date: Tue, 15 Dec 2020 14:20:55 +0200 Subject: [PATCH 155/171] MC-39531: guest-carts/{cart_id}/items returns incorrect product name on non-default website --- .../Model/Quote/Plugin/UpdateQuoteStoreId.php | 26 ++-- app/code/Magento/Quote/etc/webapi_soap/di.xml | 3 + .../Quote/Api/GuestCartItemRepositoryTest.php | 113 ++++++++++++++---- 3 files changed, 97 insertions(+), 45 deletions(-) diff --git a/app/code/Magento/Quote/Model/Quote/Plugin/UpdateQuoteStoreId.php b/app/code/Magento/Quote/Model/Quote/Plugin/UpdateQuoteStoreId.php index 4ed347b1eb06d..bffa0084e35bd 100644 --- a/app/code/Magento/Quote/Model/Quote/Plugin/UpdateQuoteStoreId.php +++ b/app/code/Magento/Quote/Model/Quote/Plugin/UpdateQuoteStoreId.php @@ -8,7 +8,6 @@ namespace Magento\Quote\Model\Quote\Plugin; use Magento\Quote\Model\Quote; -use Magento\Quote\Model\QuoteRepository; use Magento\Store\Model\StoreManagerInterface; /** @@ -16,25 +15,17 @@ */ class UpdateQuoteStoreId { - /** - * @var QuoteRepository - */ - private $quoteRepository; - /** * @var StoreManagerInterface */ private $storeManager; /** - * @param QuoteRepository $quoteRepository * @param StoreManagerInterface $storeManager */ public function __construct( - QuoteRepository $quoteRepository, StoreManagerInterface $storeManager ) { - $this->quoteRepository = $quoteRepository; $this->storeManager = $storeManager; } @@ -42,20 +33,17 @@ public function __construct( * Update store id in requested quote by store id from request. * * @param Quote $subject - * @param null $result - * @return void + * @param Quote $result + * @return Quote * @SuppressWarnings(PHPMD.UnusedFormalParameter) */ - public function afterLoadByIdWithoutStore( - Quote $subject, - $result - ) { - $quoteStoreId = (int) $subject->getStoreId(); + public function afterLoadByIdWithoutStore(Quote $subject, Quote $result): Quote + { $storeId = $this->storeManager->getStore() ->getId() ?: $this->storeManager->getDefaultStoreView() ->getId(); - if ($storeId !== $quoteStoreId) { - $subject->setStoreId($storeId); - } + $result->setStoreId($storeId); + + return $result; } } diff --git a/app/code/Magento/Quote/etc/webapi_soap/di.xml b/app/code/Magento/Quote/etc/webapi_soap/di.xml index 27d5ff7753425..4b7646b6e1ef3 100644 --- a/app/code/Magento/Quote/etc/webapi_soap/di.xml +++ b/app/code/Magento/Quote/etc/webapi_soap/di.xml @@ -13,4 +13,7 @@ <plugin name="accessControl" type="Magento\Quote\Model\QuoteRepository\Plugin\AccessChangeQuoteControl" /> <plugin name="authorization" type="Magento\Quote\Model\QuoteRepository\Plugin\Authorization" /> </type> + <type name="Magento\Quote\Model\Quote"> + <plugin name="updateQuoteStoreId" type="Magento\Quote\Model\Quote\Plugin\UpdateQuoteStoreId" /> + </type> </config> diff --git a/dev/tests/api-functional/testsuite/Magento/Quote/Api/GuestCartItemRepositoryTest.php b/dev/tests/api-functional/testsuite/Magento/Quote/Api/GuestCartItemRepositoryTest.php index 373ad64ba39d4..1054706819e95 100644 --- a/dev/tests/api-functional/testsuite/Magento/Quote/Api/GuestCartItemRepositoryTest.php +++ b/dev/tests/api-functional/testsuite/Magento/Quote/Api/GuestCartItemRepositoryTest.php @@ -5,8 +5,13 @@ */ namespace Magento\Quote\Api; +use Magento\Catalog\Model\Product; use Magento\CatalogInventory\Api\StockRegistryInterface; use Magento\CatalogInventory\Model\Stock; +use Magento\Quote\Model\Quote; +use Magento\Quote\Model\QuoteIdMask; +use Magento\Quote\Model\QuoteIdMaskFactory; +use Magento\Store\Model\StoreManagerInterface; use Magento\TestFramework\Helper\Bootstrap; use Magento\TestFramework\ObjectManager; use Magento\TestFramework\TestCase\WebapiAbstract; @@ -40,14 +45,14 @@ protected function setUp(): void */ public function testGetList() { - /** @var \Magento\Quote\Model\Quote $quote */ - $quote = $this->objectManager->create(\Magento\Quote\Model\Quote::class); + /** @var Quote $quote */ + $quote = $this->objectManager->create(Quote::class); $quote->load('test_order_item_with_items', 'reserved_order_id'); $cartId = $quote->getId(); - /** @var \Magento\Quote\Model\QuoteIdMask $quoteIdMask */ - $quoteIdMask = \Magento\TestFramework\Helper\Bootstrap::getObjectManager() - ->create(\Magento\Quote\Model\QuoteIdMaskFactory::class) + /** @var QuoteIdMask $quoteIdMask */ + $quoteIdMask = Bootstrap::getObjectManager() + ->create(QuoteIdMaskFactory::class) ->create(); $quoteIdMask->load($cartId, 'quote_id'); //Use masked cart Id @@ -92,17 +97,17 @@ public function testGetList() */ public function testAddItem() { - /** @var \Magento\Catalog\Model\Product $product */ - $product = $this->objectManager->create(\Magento\Catalog\Model\Product::class)->load(2); + /** @var Product $product */ + $product = $this->objectManager->create(Product::class)->load(2); $productSku = $product->getSku(); - /** @var \Magento\Quote\Model\Quote $quote */ - $quote = $this->objectManager->create(\Magento\Quote\Model\Quote::class); + /** @var Quote $quote */ + $quote = $this->objectManager->create(Quote::class); $quote->load('test_order_1', 'reserved_order_id'); $cartId = $quote->getId(); - /** @var \Magento\Quote\Model\QuoteIdMask $quoteIdMask */ - $quoteIdMask = \Magento\TestFramework\Helper\Bootstrap::getObjectManager() - ->create(\Magento\Quote\Model\QuoteIdMaskFactory::class) + /** @var QuoteIdMask $quoteIdMask */ + $quoteIdMask = Bootstrap::getObjectManager() + ->create(QuoteIdMaskFactory::class) ->create(); $quoteIdMask->load($cartId, 'quote_id'); //Use masked cart Id @@ -141,20 +146,20 @@ public function testAddItem() */ public function testRemoveItem() { - /** @var \Magento\Quote\Model\Quote $quote */ - $quote = $this->objectManager->create(\Magento\Quote\Model\Quote::class); + /** @var Quote $quote */ + $quote = $this->objectManager->create(Quote::class); $quote->load('test_order_item_with_items', 'reserved_order_id'); $cartId = $quote->getId(); - /** @var \Magento\Quote\Model\QuoteIdMask $quoteIdMask */ - $quoteIdMask = \Magento\TestFramework\Helper\Bootstrap::getObjectManager() - ->create(\Magento\Quote\Model\QuoteIdMaskFactory::class) + /** @var QuoteIdMask $quoteIdMask */ + $quoteIdMask = Bootstrap::getObjectManager() + ->create(QuoteIdMaskFactory::class) ->create(); $quoteIdMask->load($cartId, 'quote_id'); //Use masked cart Id $cartId = $quoteIdMask->getMaskedId(); - $product = $this->objectManager->create(\Magento\Catalog\Model\Product::class); + $product = $this->objectManager->create(Product::class); $productId = $product->getIdBySku('simple_one'); $product->load($productId); $itemId = $quote->getItemByProduct($product)->getId(); @@ -175,7 +180,7 @@ public function testRemoveItem() "itemId" => $itemId, ]; $this->assertTrue($this->_webApiCall($serviceInfo, $requestData)); - $quote = $this->objectManager->create(\Magento\Quote\Model\Quote::class); + $quote = $this->objectManager->create(Quote::class); $quote->load('test_order_item_with_items', 'reserved_order_id'); $this->assertFalse($quote->hasProductId($productId)); } @@ -189,20 +194,20 @@ public function testRemoveItem() public function testUpdateItem(array $stockData, string $errorMessage = null) { $this->updateStockData('simple_one', $stockData); - /** @var \Magento\Quote\Model\Quote $quote */ - $quote = $this->objectManager->create(\Magento\Quote\Model\Quote::class); + /** @var Quote $quote */ + $quote = $this->objectManager->create(Quote::class); $quote->load('test_order_item_with_items', 'reserved_order_id'); $cartId = $quote->getId(); - /** @var \Magento\Quote\Model\QuoteIdMask $quoteIdMask */ - $quoteIdMask = \Magento\TestFramework\Helper\Bootstrap::getObjectManager() - ->create(\Magento\Quote\Model\QuoteIdMaskFactory::class) + /** @var QuoteIdMask $quoteIdMask */ + $quoteIdMask = Bootstrap::getObjectManager() + ->create(QuoteIdMaskFactory::class) ->create(); $quoteIdMask->load($cartId, 'quote_id'); //Use masked cart Id $cartId = $quoteIdMask->getMaskedId(); - $product = $this->objectManager->create(\Magento\Catalog\Model\Product::class); + $product = $this->objectManager->create(Product::class); $productId = $product->getIdBySku('simple_one'); $product->load($productId); $itemId = $quote->getItemByProduct($product)->getId(); @@ -229,7 +234,7 @@ public function testUpdateItem(array $stockData, string $errorMessage = null) $this->expectExceptionMessage($errorMessage); } $this->_webApiCall($serviceInfo, $requestData); - $quote = $this->objectManager->create(\Magento\Quote\Model\Quote::class); + $quote = $this->objectManager->create(Quote::class); $quote->load('test_order_item_with_items', 'reserved_order_id'); $this->assertTrue($quote->hasProductId(1)); $item = $quote->getItemByProduct($product); @@ -237,6 +242,62 @@ public function testUpdateItem(array $stockData, string $errorMessage = null) $this->assertEquals($itemId, $item->getItemId()); } + /** + * Verifies that store id for quote and quote item is being changed accordingly to the requested store code + * + * @magentoApiDataFixture Magento/Checkout/_files/quote_with_items_saved.php + * @magentoApiDataFixture Magento/Store/_files/second_store.php + */ + public function testUpdateItemWithChangingStoreId() + { + /** @var Quote $quote */ + $quote = $this->objectManager->create(Quote::class); + $quote->load('test_order_item_with_items', 'reserved_order_id'); + $cartId = $quote->getId(); + + /** @var QuoteIdMask $quoteIdMask */ + $quoteIdMask = Bootstrap::getObjectManager() + ->create(QuoteIdMaskFactory::class) + ->create(); + $quoteIdMask->load($cartId, 'quote_id'); + $cartId = $quoteIdMask->getMaskedId(); + + $product = $this->objectManager->create(Product::class); + $productId = $product->getIdBySku('simple'); + $product->load($productId); + $itemId = $quote->getItemByProduct($product)->getId(); + $serviceInfo = [ + 'rest' => [ + 'resourcePath' => self::RESOURCE_PATH . $cartId . '/items/' . $itemId, + 'httpMethod' => \Magento\Framework\Webapi\Rest\Request::HTTP_METHOD_PUT, + ], + 'soap' => [ + 'service' => self::SERVICE_NAME, + 'serviceVersion' => self::SERVICE_VERSION, + 'operation' => self::SERVICE_NAME . 'Save', + ], + ]; + + $requestData['cartItem']['qty'] = 5; + if (TESTS_WEB_API_ADAPTER === self::ADAPTER_SOAP) { + $requestData['cartItem'] += [ + 'quote_id' => $cartId, + 'itemId' => $itemId, + ]; + } + $this->_webApiCall($serviceInfo, $requestData, null, 'fixture_second_store'); + $quote = $this->objectManager->create(Quote::class); + $quote->load('test_order_item_with_items', 'reserved_order_id'); + $this->assertTrue($quote->hasProductId(1)); + $item = $quote->getItemByProduct($product); + /** @var StoreManagerInterface $storeManager */ + $storeManager = $this->objectManager->get(StoreManagerInterface::class); + $storeId = $storeManager->getStore('fixture_second_store') + ->getId(); + $this->assertEquals($storeId, $quote->getStoreId()); + $this->assertEquals($storeId, $item->getStoreId()); + } + /** * @return array */ From cece001e28889b66b2b36daf129fa20bf6ef2c17 Mon Sep 17 00:00:00 2001 From: Myroslav Dobra <dmaraptor@gmail.com> Date: Tue, 15 Dec 2020 16:46:20 +0200 Subject: [PATCH 156/171] MC-39911: [MFTF] AdminFPTIncludingAndExcludingTaxVisibleOnNegotiableQuotePageTest fails because of bad design --- ...uctAttributesFilteredByCodeActionGroup.xml | 35 +++++++++++ .../Test/Mftf/Helper/CatalogHelper.php | 61 +++++++++++++++++++ .../AdminProductAttributeGridSection.xml | 1 + .../Section/AdminDataGridTableSection.xml | 1 + .../Mftf/Data/FixedProductAttributeData.xml | 4 +- .../Weee/Test/Mftf/Data/FrontendLabelData.xml | 15 +++++ 6 files changed, 115 insertions(+), 2 deletions(-) create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminDeleteAllProductAttributesFilteredByCodeActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/Helper/CatalogHelper.php create mode 100644 app/code/Magento/Weee/Test/Mftf/Data/FrontendLabelData.xml diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminDeleteAllProductAttributesFilteredByCodeActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminDeleteAllProductAttributesFilteredByCodeActionGroup.xml new file mode 100644 index 0000000000000..4d4314827da1c --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminDeleteAllProductAttributesFilteredByCodeActionGroup.xml @@ -0,0 +1,35 @@ +<?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="AdminDeleteAllProductAttributesFilteredByCodeActionGroup"> + <annotations> + <description>Open product attributes grid filter it by attribute code and delete all found attributes one by one.</description> + </annotations> + <arguments> + <argument name="codeFilter" type="string" defaultValue="fake-code"/> + </arguments> + + <amOnPage url="{{AdminProductAttributeGridPage.url}}" stepKey="navigateToProductAttributeGrid"/> + <!-- It sometimes is loading too long for default 10s --> + <waitForPageLoad time="60" stepKey="waitForPageFullyLoaded"/> + <click selector="{{AdminProductAttributeGridSection.ResetFilter}}" stepKey="clearExistingFilters"/> + <fillField selector="{{AdminProductAttributeGridSection.attributeCodeFilter}}" userInput="{{codeFilter}}" stepKey="fillAttributeCodeFilterField"/> + <click selector="{{AdminProductAttributeGridSection.Search}}" stepKey="applyGridFilter"/> + <helper class="\Magento\Catalog\Test\Mftf\Helper\CatalogHelper" method="deleteAllProductAttributesOneByOne" stepKey="deleteAllProductAttributesOneByOne"> + <argument name="firstNotEmptyRow">{{AdminDataGridTableSection.firstNotEmptyRow2}}</argument> + <argument name="modalAcceptButton">{{AdminConfirmationModalSection.ok}}</argument> + <argument name="deleteButton">{{AdminMainActionsSection.delete}}</argument> + <argument name="successMessageContainer">{{AdminMessagesSection.success}}</argument> + <argument name="successMessage">You deleted the product attribute.</argument> + </helper> + <waitForElementVisible selector="{{AdminDataGridTableSection.dataGridEmpty}}" stepKey="waitDataGridEmptyMessageAppears"/> + <see selector="{{AdminDataGridTableSection.dataGridEmpty}}" userInput="We couldn't find any records." stepKey="assertDataGridEmptyMessage"/> + <click selector="{{AdminProductAttributeGridSection.ResetFilter}}" stepKey="clearExistingFiltersAgain"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/Helper/CatalogHelper.php b/app/code/Magento/Catalog/Test/Mftf/Helper/CatalogHelper.php new file mode 100644 index 0000000000000..2ac8ef35dc8a7 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/Helper/CatalogHelper.php @@ -0,0 +1,61 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Catalog\Test\Mftf\Helper; + +use Facebook\WebDriver\Remote\RemoteWebDriver as FacebookWebDriver; +use Facebook\WebDriver\WebDriverBy; +use Magento\FunctionalTestingFramework\Helper\Helper; +use Magento\FunctionalTestingFramework\Module\MagentoWebDriver; + +/** + * Class for MFTF helpers for Catalog module. + */ +class CatalogHelper extends Helper +{ + /** + * Delete all product attributes one by one. + * + * @param string $firstNotEmptyRow + * @param string $modalAcceptButton + * @param string $deleteButton + * @param string $successMessageContainer + * @param string $successMessage + * @retrun void + */ + public function deleteAllProductAttributesOneByOne( + string $firstNotEmptyRow, + string $modalAcceptButton, + string $deleteButton, + string $successMessageContainer, + string $successMessage + ): void { + try { + /** @var MagentoWebDriver $webDriver */ + $magentoWebDriver = $this->getModule('\Magento\FunctionalTestingFramework\Module\MagentoWebDriver'); + /** @var FacebookWebDriver $webDriver */ + $webDriver = $magentoWebDriver->webDriver; + $rows = $webDriver->findElements(WebDriverBy::cssSelector($firstNotEmptyRow)); + while (!empty($rows)) { + $rows[0]->click(); + $magentoWebDriver->waitForPageLoad(30); + $magentoWebDriver->click($deleteButton); + $magentoWebDriver->waitForPageLoad(30); + $magentoWebDriver->waitForElementVisible($modalAcceptButton, 10); + $magentoWebDriver->waitForPageLoad(60); + $magentoWebDriver->click($modalAcceptButton); + $magentoWebDriver->waitForPageLoad(60); + $magentoWebDriver->waitForLoadingMaskToDisappear(); + $magentoWebDriver->waitForElementVisible($successMessageContainer, 10); + $magentoWebDriver->see($successMessage, $successMessageContainer); + $rows = $webDriver->findElements(WebDriverBy::cssSelector($firstNotEmptyRow)); + } + } catch (\Exception $e) { + $this->fail($e->getMessage()); + } + } +} diff --git a/app/code/Magento/Catalog/Test/Mftf/Section/AdminProductAttributeGridSection.xml b/app/code/Magento/Catalog/Test/Mftf/Section/AdminProductAttributeGridSection.xml index e4b33ac795559..295f6da6cf215 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Section/AdminProductAttributeGridSection.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Section/AdminProductAttributeGridSection.xml @@ -17,6 +17,7 @@ <element name="FirstRow" type="button" selector="//*[@id='attributeGrid_table']/tbody/tr[1]" timeout="30"/> <element name="FilterByAttributeCode" type="input" selector="#attributeGrid_filter_attribute_code"/> <element name="attributeLabelFilter" type="input" selector="//input[@name='frontend_label']"/> + <element name="attributeCodeFilter" type="input" selector=".data-grid-filters input[name='attribute_code']"/> <element name="attributeCodeColumn" type="text" selector="//div[@id='attributeGrid']//td[contains(@class,'col-attr-code col-attribute_code')]"/> <element name="defaultLabelColumn" type="text" selector="//div[@id='attributeGrid']//table[@id='attributeGrid_table']//tbody//td[contains(@class,'col-label col-frontend_label')]"/> <element name="isVisibleColumn" type="text" selector="//div[@id='attributeGrid']//td[contains(@class,'a-center col-is_visible')]"/> diff --git a/app/code/Magento/Ui/Test/Mftf/Section/AdminDataGridTableSection.xml b/app/code/Magento/Ui/Test/Mftf/Section/AdminDataGridTableSection.xml index c5b000259e265..d2d39076bcfbb 100644 --- a/app/code/Magento/Ui/Test/Mftf/Section/AdminDataGridTableSection.xml +++ b/app/code/Magento/Ui/Test/Mftf/Section/AdminDataGridTableSection.xml @@ -22,5 +22,6 @@ <element name="rowTemplateStrict" type="block" selector="//tbody/tr[td[*[text()[normalize-space()='{{text}}']]]]" parameterized="true" /> <element name="rowTemplate" type="block" selector="//tbody/tr[td[*[contains(.,normalize-space('{{text}}'))]]]" parameterized="true" timeout="30" /> <element name="firstNotEmptyRow" type="block" selector="table.data-grid tbody tr[data-role=row]:not(.data-grid-tr-no-data):nth-of-type(1)" timeout="30"/> + <element name="firstNotEmptyRow2" type="block" selector="table.data-grid tbody tr:not(.data-grid-tr-no-data):nth-of-type(1)" timeout="30"/> </section> </sections> diff --git a/app/code/Magento/Weee/Test/Mftf/Data/FixedProductAttributeData.xml b/app/code/Magento/Weee/Test/Mftf/Data/FixedProductAttributeData.xml index b8b45d84242c9..b5736479fac42 100644 --- a/app/code/Magento/Weee/Test/Mftf/Data/FixedProductAttributeData.xml +++ b/app/code/Magento/Weee/Test/Mftf/Data/FixedProductAttributeData.xml @@ -9,12 +9,12 @@ <entities xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:DataGenerator/etc/dataProfileSchema.xsd"> <entity name="productFPTAttribute" type="ProductAttribute"> - <data key="attribute_code" unique="suffix">attribute</data> + <data key="attribute_code" unique="suffix">weee_attribute</data> <data key="is_unique">true</data> <data key="frontend_input">weee</data> <data key="is_used_in_grid">true</data> <data key="is_visible_in_grid">true</data> <data key="is_filterable_in_grid">true</data> - <requiredEntity type="FrontendLabel">ProductAttributeFrontendLabel</requiredEntity> + <requiredEntity type="FrontendLabel">ProductAttributeFrontendLabelWeee</requiredEntity> </entity> </entities> diff --git a/app/code/Magento/Weee/Test/Mftf/Data/FrontendLabelData.xml b/app/code/Magento/Weee/Test/Mftf/Data/FrontendLabelData.xml new file mode 100644 index 0000000000000..7c362ba0ee303 --- /dev/null +++ b/app/code/Magento/Weee/Test/Mftf/Data/FrontendLabelData.xml @@ -0,0 +1,15 @@ +<?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="ProductAttributeFrontendLabelWeee" type="FrontendLabel"> + <data key="store_id">0</data> + <data key="label" unique="suffix">weee-attribute</data> + </entity> +</entities> From f612499f4177ea79f553b13d9e3458e9cdd65a55 Mon Sep 17 00:00:00 2001 From: Myroslav Dobra <dmaraptor@gmail.com> Date: Tue, 15 Dec 2020 19:19:40 +0200 Subject: [PATCH 157/171] MC-39911: [MFTF] AdminFPTIncludingAndExcludingTaxVisibleOnNegotiableQuotePageTest fails because of bad design --- ...AllProductAttributesFilteredByCodeActionGroup.xml | 2 +- .../Catalog/Test/Mftf/Helper/CatalogHelper.php | 12 +++++------- .../Test/Mftf/Data/FixedProductAttributeData.xml | 11 ++++++++++- .../AdminFixedTaxValSavedForSpecificWebsiteTest.xml | 2 +- .../AdminRemoveProductWeeeAttributeOptionTest.xml | 2 +- ...ionInShoppingCartForCustomerPhysicalQuoteTest.xml | 2 +- ...tionInShoppingCartForCustomerVirtualQuoteTest.xml | 2 +- ...mationInShoppingCartForGuestPhysicalQuoteTest.xml | 2 +- ...rmationInShoppingCartForGuestVirtualQuoteTest.xml | 2 +- 9 files changed, 22 insertions(+), 15 deletions(-) diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminDeleteAllProductAttributesFilteredByCodeActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminDeleteAllProductAttributesFilteredByCodeActionGroup.xml index 4d4314827da1c..12249d6cb946b 100644 --- a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminDeleteAllProductAttributesFilteredByCodeActionGroup.xml +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminDeleteAllProductAttributesFilteredByCodeActionGroup.xml @@ -22,7 +22,7 @@ <fillField selector="{{AdminProductAttributeGridSection.attributeCodeFilter}}" userInput="{{codeFilter}}" stepKey="fillAttributeCodeFilterField"/> <click selector="{{AdminProductAttributeGridSection.Search}}" stepKey="applyGridFilter"/> <helper class="\Magento\Catalog\Test\Mftf\Helper\CatalogHelper" method="deleteAllProductAttributesOneByOne" stepKey="deleteAllProductAttributesOneByOne"> - <argument name="firstNotEmptyRow">{{AdminDataGridTableSection.firstNotEmptyRow2}}</argument> + <argument name="notEmptyRow">{{AdminDataGridTableSection.firstNotEmptyRow2}}</argument> <argument name="modalAcceptButton">{{AdminConfirmationModalSection.ok}}</argument> <argument name="deleteButton">{{AdminMainActionsSection.delete}}</argument> <argument name="successMessageContainer">{{AdminMessagesSection.success}}</argument> diff --git a/app/code/Magento/Catalog/Test/Mftf/Helper/CatalogHelper.php b/app/code/Magento/Catalog/Test/Mftf/Helper/CatalogHelper.php index 2ac8ef35dc8a7..f72a41b46298e 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Helper/CatalogHelper.php +++ b/app/code/Magento/Catalog/Test/Mftf/Helper/CatalogHelper.php @@ -28,7 +28,7 @@ class CatalogHelper extends Helper * @retrun void */ public function deleteAllProductAttributesOneByOne( - string $firstNotEmptyRow, + string $notEmptyRow, string $modalAcceptButton, string $deleteButton, string $successMessageContainer, @@ -39,20 +39,18 @@ public function deleteAllProductAttributesOneByOne( $magentoWebDriver = $this->getModule('\Magento\FunctionalTestingFramework\Module\MagentoWebDriver'); /** @var FacebookWebDriver $webDriver */ $webDriver = $magentoWebDriver->webDriver; - $rows = $webDriver->findElements(WebDriverBy::cssSelector($firstNotEmptyRow)); - while (!empty($rows)) { - $rows[0]->click(); + $gridRows = $webDriver->findElements(WebDriverBy::cssSelector($notEmptyRow)); + while (!empty($gridRows)) { + $gridRows[0]->click(); $magentoWebDriver->waitForPageLoad(30); $magentoWebDriver->click($deleteButton); $magentoWebDriver->waitForPageLoad(30); $magentoWebDriver->waitForElementVisible($modalAcceptButton, 10); - $magentoWebDriver->waitForPageLoad(60); $magentoWebDriver->click($modalAcceptButton); $magentoWebDriver->waitForPageLoad(60); - $magentoWebDriver->waitForLoadingMaskToDisappear(); $magentoWebDriver->waitForElementVisible($successMessageContainer, 10); $magentoWebDriver->see($successMessage, $successMessageContainer); - $rows = $webDriver->findElements(WebDriverBy::cssSelector($firstNotEmptyRow)); + $gridRows = $webDriver->findElements(WebDriverBy::cssSelector($notEmptyRow)); } } catch (\Exception $e) { $this->fail($e->getMessage()); diff --git a/app/code/Magento/Weee/Test/Mftf/Data/FixedProductAttributeData.xml b/app/code/Magento/Weee/Test/Mftf/Data/FixedProductAttributeData.xml index b5736479fac42..071f96bb65266 100644 --- a/app/code/Magento/Weee/Test/Mftf/Data/FixedProductAttributeData.xml +++ b/app/code/Magento/Weee/Test/Mftf/Data/FixedProductAttributeData.xml @@ -8,7 +8,16 @@ <entities xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:DataGenerator/etc/dataProfileSchema.xsd"> - <entity name="productFPTAttribute" type="ProductAttribute"> + <entity name="productFPTAttribute" type="ProductAttribute" deprecated="Use FPTProductAttribute instead"> + <data key="attribute_code" unique="suffix">attribute</data> + <data key="is_unique">true</data> + <data key="frontend_input">weee</data> + <data key="is_used_in_grid">true</data> + <data key="is_visible_in_grid">true</data> + <data key="is_filterable_in_grid">true</data> + <requiredEntity type="FrontendLabel">ProductAttributeFrontendLabel</requiredEntity> + </entity> + <entity name="FPTProductAttribute" type="ProductAttribute"> <data key="attribute_code" unique="suffix">weee_attribute</data> <data key="is_unique">true</data> <data key="frontend_input">weee</data> diff --git a/app/code/Magento/Weee/Test/Mftf/Test/AdminFixedTaxValSavedForSpecificWebsiteTest.xml b/app/code/Magento/Weee/Test/Mftf/Test/AdminFixedTaxValSavedForSpecificWebsiteTest.xml index 0f4a7f9a55d26..ccbd431848dbc 100644 --- a/app/code/Magento/Weee/Test/Mftf/Test/AdminFixedTaxValSavedForSpecificWebsiteTest.xml +++ b/app/code/Magento/Weee/Test/Mftf/Test/AdminFixedTaxValSavedForSpecificWebsiteTest.xml @@ -22,7 +22,7 @@ <before> <!-- Create product attribute and add it to default attribute set />--> <comment userInput="Create product attribute and add it to default attribute set" stepKey="createAttrAndAddToDefaultAttrSet"/> - <createData entity="productFPTAttribute" stepKey="createProductFPTAttribute"/> + <createData entity="FPTProductAttribute" stepKey="createProductFPTAttribute"/> <createData entity="AddToDefaultSet" stepKey="addToDefaultAttributeSet"> <requiredEntity createDataKey="createProductFPTAttribute"/> </createData> diff --git a/app/code/Magento/Weee/Test/Mftf/Test/AdminRemoveProductWeeeAttributeOptionTest.xml b/app/code/Magento/Weee/Test/Mftf/Test/AdminRemoveProductWeeeAttributeOptionTest.xml index 0d7c21b6efffc..4e70c9ba87d64 100644 --- a/app/code/Magento/Weee/Test/Mftf/Test/AdminRemoveProductWeeeAttributeOptionTest.xml +++ b/app/code/Magento/Weee/Test/Mftf/Test/AdminRemoveProductWeeeAttributeOptionTest.xml @@ -18,7 +18,7 @@ <group value="weee"/> </annotations> <before> - <createData entity="productFPTAttribute" stepKey="createProductFPTAttribute"/> + <createData entity="FPTProductAttribute" stepKey="createProductFPTAttribute"/> <createData entity="AddToDefaultSet" stepKey="addFPTToAttributeSet"> <requiredEntity createDataKey="createProductFPTAttribute"/> </createData> diff --git a/app/code/Magento/Weee/Test/Mftf/Test/StorefrontFPTTaxInformationInShoppingCartForCustomerPhysicalQuoteTest.xml b/app/code/Magento/Weee/Test/Mftf/Test/StorefrontFPTTaxInformationInShoppingCartForCustomerPhysicalQuoteTest.xml index e78036458301b..833f619888bfb 100644 --- a/app/code/Magento/Weee/Test/Mftf/Test/StorefrontFPTTaxInformationInShoppingCartForCustomerPhysicalQuoteTest.xml +++ b/app/code/Magento/Weee/Test/Mftf/Test/StorefrontFPTTaxInformationInShoppingCartForCustomerPhysicalQuoteTest.xml @@ -27,7 +27,7 @@ <!-- Tax Rule is created based on default tax rates (Stores>Tax Rule) US-CA-*-Rate 1 = 8.2500 US-NY-*-Rate 1 = 8.3750 --> <createData entity="SimpleTaxRule" stepKey="createTaxRule"/> <!-- Fixed Product Tax attribute is created and added to default attribute set --> - <createData entity="productFPTAttribute" stepKey="createProductFPTAttribute"/> + <createData entity="FPTProductAttribute" stepKey="createProductFPTAttribute"/> <createData entity="AddToDefaultSet" stepKey="addFPTToAttributeSet"> <requiredEntity createDataKey="createProductFPTAttribute"/> </createData> diff --git a/app/code/Magento/Weee/Test/Mftf/Test/StorefrontFPTTaxInformationInShoppingCartForCustomerVirtualQuoteTest.xml b/app/code/Magento/Weee/Test/Mftf/Test/StorefrontFPTTaxInformationInShoppingCartForCustomerVirtualQuoteTest.xml index dda125835110a..8e8667cb7e13d 100644 --- a/app/code/Magento/Weee/Test/Mftf/Test/StorefrontFPTTaxInformationInShoppingCartForCustomerVirtualQuoteTest.xml +++ b/app/code/Magento/Weee/Test/Mftf/Test/StorefrontFPTTaxInformationInShoppingCartForCustomerVirtualQuoteTest.xml @@ -27,7 +27,7 @@ <!-- Tax Rule is created based on default tax rates (Stores>Tax Rule) US-CA-*-Rate 1 = 8.2500 US-NY-*-Rate 1 = 8.3750 --> <createData entity="SimpleTaxRule" stepKey="createTaxRule"/> <!-- Fixed Product Tax attribute is created and added to default attribute set --> - <createData entity="productFPTAttribute" stepKey="createProductFPTAttribute"/> + <createData entity="FPTProductAttribute" stepKey="createProductFPTAttribute"/> <createData entity="AddToDefaultSet" stepKey="addFPTToAttributeSet"> <requiredEntity createDataKey="createProductFPTAttribute"/> </createData> diff --git a/app/code/Magento/Weee/Test/Mftf/Test/StorefrontFPTTaxInformationInShoppingCartForGuestPhysicalQuoteTest.xml b/app/code/Magento/Weee/Test/Mftf/Test/StorefrontFPTTaxInformationInShoppingCartForGuestPhysicalQuoteTest.xml index 74ba7c1f2bff3..3a3f9c7e8931a 100644 --- a/app/code/Magento/Weee/Test/Mftf/Test/StorefrontFPTTaxInformationInShoppingCartForGuestPhysicalQuoteTest.xml +++ b/app/code/Magento/Weee/Test/Mftf/Test/StorefrontFPTTaxInformationInShoppingCartForGuestPhysicalQuoteTest.xml @@ -27,7 +27,7 @@ <!-- Tax Rule is created based on default tax rates (Stores>Tax Rule) US-CA-*-Rate 1 = 8.2500 US-NY-*-Rate 1 = 8.3750 --> <createData entity="SimpleTaxRule" stepKey="createTaxRule"/> <!-- Fixed Product Tax attribute is created and added to default attribute set --> - <createData entity="productFPTAttribute" stepKey="createProductFPTAttribute"/> + <createData entity="FPTProductAttribute" stepKey="createProductFPTAttribute"/> <createData entity="AddToDefaultSet" stepKey="addFPTToAttributeSet"> <requiredEntity createDataKey="createProductFPTAttribute"/> </createData> diff --git a/app/code/Magento/Weee/Test/Mftf/Test/StorefrontFPTTaxInformationInShoppingCartForGuestVirtualQuoteTest.xml b/app/code/Magento/Weee/Test/Mftf/Test/StorefrontFPTTaxInformationInShoppingCartForGuestVirtualQuoteTest.xml index 495b9a990a465..0d54991f84395 100644 --- a/app/code/Magento/Weee/Test/Mftf/Test/StorefrontFPTTaxInformationInShoppingCartForGuestVirtualQuoteTest.xml +++ b/app/code/Magento/Weee/Test/Mftf/Test/StorefrontFPTTaxInformationInShoppingCartForGuestVirtualQuoteTest.xml @@ -27,7 +27,7 @@ <!-- Tax Rule is created based on default tax rates (Stores>Tax Rule) US-CA-*-Rate 1 = 8.2500 US-NY-*-Rate 1 = 8.3750 --> <createData entity="SimpleTaxRule" stepKey="createTaxRule"/> <!-- Fixed Product Tax attribute is created and added to default attribute set --> - <createData entity="productFPTAttribute" stepKey="createProductFPTAttribute"/> + <createData entity="FPTProductAttribute" stepKey="createProductFPTAttribute"/> <createData entity="AddToDefaultSet" stepKey="addFPTToAttributeSet"> <requiredEntity createDataKey="createProductFPTAttribute"/> </createData> From ad5f3fa48e0402702d0b1339f8737028dc8aa27c Mon Sep 17 00:00:00 2001 From: OlgaVasyltsun <olga.vasyltsun@transoftgroup.com> Date: Wed, 16 Dec 2020 11:36:31 +0200 Subject: [PATCH 158/171] MC-39765: No such entity with addressId, occurs randomly on visitors browser. System Log Generated --- .../Observer/EmulateCustomerObserver.php | 27 +++++++++++++++---- 1 file changed, 22 insertions(+), 5 deletions(-) diff --git a/app/code/Magento/Persistent/Observer/EmulateCustomerObserver.php b/app/code/Magento/Persistent/Observer/EmulateCustomerObserver.php index 8429eabd19e8a..0b978b9822345 100644 --- a/app/code/Magento/Persistent/Observer/EmulateCustomerObserver.php +++ b/app/code/Magento/Persistent/Observer/EmulateCustomerObserver.php @@ -6,6 +6,7 @@ namespace Magento\Persistent\Observer; use Magento\Framework\Event\ObserverInterface; +use Magento\Framework\Exception\NoSuchEntityException; /** * Class EmulateCustomer @@ -86,9 +87,9 @@ public function execute(\Magento\Framework\Event\Observer $observer) /** @var \Magento\Customer\Api\Data\CustomerInterface $customer */ $customer = $this->customerRepository->getById($this->_persistentSession->getSession()->getCustomerId()); if ($defaultShipping = $customer->getDefaultShipping()) { - /** @var \Magento\Customer\Model\Data\Address $address */ - $address = $this->addressRepository->getById($defaultShipping); - if ($address) { + $address = $this->getCustomerAddressById($defaultShipping); + + if ($address !== null) { $this->_customerSession->setDefaultTaxShippingAddress( [ 'country_id' => $address->getCountryId(), @@ -102,8 +103,9 @@ public function execute(\Magento\Framework\Event\Observer $observer) } if ($defaultBilling = $customer->getDefaultBilling()) { - $address = $this->addressRepository->getById($defaultBilling); - if ($address) { + $address = $this->getCustomerAddressById($defaultShipping); + + if ($address !== null) { $this->_customerSession->setDefaultTaxBillingAddress([ 'country_id' => $address->getCountryId(), 'region_id' => $address->getRegion() ? $address->getRegionId() : null, @@ -118,4 +120,19 @@ public function execute(\Magento\Framework\Event\Observer $observer) } return $this; } + + /** + * Returns customer address by id + * + * @param int $addressId + * @return \Magento\Customer\Api\Data\AddressInterface|null + */ + private function getCustomerAddressById($addressId) + { + try { + return $this->addressRepository->getById($addressId); + } catch (NoSuchEntityException $exception) { + return null; + } + } } From b2508014d7da9ef4019214a44dcd9c1447397f0e Mon Sep 17 00:00:00 2001 From: Myroslav Dobra <dmaraptor@gmail.com> Date: Wed, 16 Dec 2020 11:55:49 +0200 Subject: [PATCH 159/171] MC-39911: [MFTF] AdminFPTIncludingAndExcludingTaxVisibleOnNegotiableQuotePageTest fails because of bad design --- ...nDeleteAllProductAttributesFilteredByCodeActionGroup.xml | 2 +- app/code/Magento/Catalog/Test/Mftf/Helper/CatalogHelper.php | 6 +++--- .../Test/Mftf/Section/AdminProductAttributeGridSection.xml | 1 - 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminDeleteAllProductAttributesFilteredByCodeActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminDeleteAllProductAttributesFilteredByCodeActionGroup.xml index 12249d6cb946b..fe5b0ae1a64ce 100644 --- a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminDeleteAllProductAttributesFilteredByCodeActionGroup.xml +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminDeleteAllProductAttributesFilteredByCodeActionGroup.xml @@ -19,7 +19,7 @@ <!-- It sometimes is loading too long for default 10s --> <waitForPageLoad time="60" stepKey="waitForPageFullyLoaded"/> <click selector="{{AdminProductAttributeGridSection.ResetFilter}}" stepKey="clearExistingFilters"/> - <fillField selector="{{AdminProductAttributeGridSection.attributeCodeFilter}}" userInput="{{codeFilter}}" stepKey="fillAttributeCodeFilterField"/> + <fillField selector="{{AdminProductAttributeGridSection.FilterByAttributeCode}}" userInput="{{codeFilter}}" stepKey="fillAttributeCodeFilterField"/> <click selector="{{AdminProductAttributeGridSection.Search}}" stepKey="applyGridFilter"/> <helper class="\Magento\Catalog\Test\Mftf\Helper\CatalogHelper" method="deleteAllProductAttributesOneByOne" stepKey="deleteAllProductAttributesOneByOne"> <argument name="notEmptyRow">{{AdminDataGridTableSection.firstNotEmptyRow2}}</argument> diff --git a/app/code/Magento/Catalog/Test/Mftf/Helper/CatalogHelper.php b/app/code/Magento/Catalog/Test/Mftf/Helper/CatalogHelper.php index f72a41b46298e..dcba3b1bf68de 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Helper/CatalogHelper.php +++ b/app/code/Magento/Catalog/Test/Mftf/Helper/CatalogHelper.php @@ -20,7 +20,7 @@ class CatalogHelper extends Helper /** * Delete all product attributes one by one. * - * @param string $firstNotEmptyRow + * @param string $notEmptyRow * @param string $modalAcceptButton * @param string $deleteButton * @param string $successMessageContainer @@ -45,10 +45,10 @@ public function deleteAllProductAttributesOneByOne( $magentoWebDriver->waitForPageLoad(30); $magentoWebDriver->click($deleteButton); $magentoWebDriver->waitForPageLoad(30); - $magentoWebDriver->waitForElementVisible($modalAcceptButton, 10); + $magentoWebDriver->waitForElementVisible($modalAcceptButton); $magentoWebDriver->click($modalAcceptButton); $magentoWebDriver->waitForPageLoad(60); - $magentoWebDriver->waitForElementVisible($successMessageContainer, 10); + $magentoWebDriver->waitForElementVisible($successMessageContainer); $magentoWebDriver->see($successMessage, $successMessageContainer); $gridRows = $webDriver->findElements(WebDriverBy::cssSelector($notEmptyRow)); } diff --git a/app/code/Magento/Catalog/Test/Mftf/Section/AdminProductAttributeGridSection.xml b/app/code/Magento/Catalog/Test/Mftf/Section/AdminProductAttributeGridSection.xml index 295f6da6cf215..e4b33ac795559 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Section/AdminProductAttributeGridSection.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Section/AdminProductAttributeGridSection.xml @@ -17,7 +17,6 @@ <element name="FirstRow" type="button" selector="//*[@id='attributeGrid_table']/tbody/tr[1]" timeout="30"/> <element name="FilterByAttributeCode" type="input" selector="#attributeGrid_filter_attribute_code"/> <element name="attributeLabelFilter" type="input" selector="//input[@name='frontend_label']"/> - <element name="attributeCodeFilter" type="input" selector=".data-grid-filters input[name='attribute_code']"/> <element name="attributeCodeColumn" type="text" selector="//div[@id='attributeGrid']//td[contains(@class,'col-attr-code col-attribute_code')]"/> <element name="defaultLabelColumn" type="text" selector="//div[@id='attributeGrid']//table[@id='attributeGrid_table']//tbody//td[contains(@class,'col-label col-frontend_label')]"/> <element name="isVisibleColumn" type="text" selector="//div[@id='attributeGrid']//td[contains(@class,'a-center col-is_visible')]"/> From b4a14812aff90e5658a9cd6570ba0c2b66d29260 Mon Sep 17 00:00:00 2001 From: Vadim Malesh <51680850+engcom-Charlie@users.noreply.github.com> Date: Wed, 16 Dec 2020 13:59:34 +0200 Subject: [PATCH 160/171] update testCaseId --- .../Test/AdminCreateGroupedProductNonDefaultAttributeSetTest.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdminCreateGroupedProductNonDefaultAttributeSetTest.xml b/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdminCreateGroupedProductNonDefaultAttributeSetTest.xml index 95607a83dd26f..d5dcd7f48b956 100644 --- a/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdminCreateGroupedProductNonDefaultAttributeSetTest.xml +++ b/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdminCreateGroupedProductNonDefaultAttributeSetTest.xml @@ -13,6 +13,7 @@ <stories value="Create product"/> <title value="Create Grouped Product when non-default attribute set is chosen"/> <description value="Create Grouped Product with simple when non-default attribute set is chosen"/> + <testCaseId value="MC-39950"/> <severity value="MAJOR"/> <group value="groupedProduct"/> </annotations> From 3bb857f8d60e45a40931bb99085c7d8f841ce922 Mon Sep 17 00:00:00 2001 From: OlgaVasyltsun <olga.vasyltsun@transoftgroup.com> Date: Wed, 16 Dec 2020 14:44:52 +0200 Subject: [PATCH 161/171] MC-39765: No such entity with addressId, occurs randomly on visitors browser. System Log Generated --- .../Magento/Persistent/Observer/EmulateCustomerObserver.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/Persistent/Observer/EmulateCustomerObserver.php b/app/code/Magento/Persistent/Observer/EmulateCustomerObserver.php index 0b978b9822345..c991836a287d2 100644 --- a/app/code/Magento/Persistent/Observer/EmulateCustomerObserver.php +++ b/app/code/Magento/Persistent/Observer/EmulateCustomerObserver.php @@ -103,7 +103,7 @@ public function execute(\Magento\Framework\Event\Observer $observer) } if ($defaultBilling = $customer->getDefaultBilling()) { - $address = $this->getCustomerAddressById($defaultShipping); + $address = $this->getCustomerAddressById($defaultBilling); if ($address !== null) { $this->_customerSession->setDefaultTaxBillingAddress([ From 92ecbbfeabd9edd0b137915f61bbacfa123a7e8e Mon Sep 17 00:00:00 2001 From: OlgaVasyltsun <olga.vasyltsun@transoftgroup.com> Date: Wed, 16 Dec 2020 17:21:05 +0200 Subject: [PATCH 162/171] MC-39765: No such entity with addressId, occurs randomly on visitors browser. System Log Generated --- .../Magento/Persistent/Observer/EmulateCustomerObserver.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/code/Magento/Persistent/Observer/EmulateCustomerObserver.php b/app/code/Magento/Persistent/Observer/EmulateCustomerObserver.php index c991836a287d2..1ff81137de57b 100644 --- a/app/code/Magento/Persistent/Observer/EmulateCustomerObserver.php +++ b/app/code/Magento/Persistent/Observer/EmulateCustomerObserver.php @@ -87,7 +87,7 @@ public function execute(\Magento\Framework\Event\Observer $observer) /** @var \Magento\Customer\Api\Data\CustomerInterface $customer */ $customer = $this->customerRepository->getById($this->_persistentSession->getSession()->getCustomerId()); if ($defaultShipping = $customer->getDefaultShipping()) { - $address = $this->getCustomerAddressById($defaultShipping); + $address = $this->getCustomerAddressById((int) $defaultShipping); if ($address !== null) { $this->_customerSession->setDefaultTaxShippingAddress( @@ -103,7 +103,7 @@ public function execute(\Magento\Framework\Event\Observer $observer) } if ($defaultBilling = $customer->getDefaultBilling()) { - $address = $this->getCustomerAddressById($defaultBilling); + $address = $this->getCustomerAddressById((int) $defaultBilling); if ($address !== null) { $this->_customerSession->setDefaultTaxBillingAddress([ @@ -127,7 +127,7 @@ public function execute(\Magento\Framework\Event\Observer $observer) * @param int $addressId * @return \Magento\Customer\Api\Data\AddressInterface|null */ - private function getCustomerAddressById($addressId) + private function getCustomerAddressById(int $addressId) { try { return $this->addressRepository->getById($addressId); From 3ce3b50dcb755a12a512f5df011f6754cb5d1acb Mon Sep 17 00:00:00 2001 From: ruslankostiv <rkostiv@adobe.com> Date: Wed, 16 Dec 2020 16:47:51 -0600 Subject: [PATCH 163/171] SFAPP-188: ComposetTest fails on blacklisted modules --- .../testsuite/Magento/Test/Integrity/ComposerTest.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/dev/tests/static/testsuite/Magento/Test/Integrity/ComposerTest.php b/dev/tests/static/testsuite/Magento/Test/Integrity/ComposerTest.php index 1c0f451de71dc..f57a29e9bda0d 100644 --- a/dev/tests/static/testsuite/Magento/Test/Integrity/ComposerTest.php +++ b/dev/tests/static/testsuite/Magento/Test/Integrity/ComposerTest.php @@ -266,8 +266,10 @@ private function assertAutoloadRegistrar(\StdClass $json, $dir) */ private function assertNoVersionSpecified(\StdClass $json) { - $errorMessage = 'Version must not be specified in the root and package composer JSON files in Git'; - $this->assertObjectNotHasAttribute('version', $json, $errorMessage); + if (!in_array($json->name, self::$rootComposerModuleBlacklist)) { + $errorMessage = 'Version must not be specified in the root and package composer JSON files in Git'; + $this->assertObjectNotHasAttribute('version', $json, $errorMessage); + } } /** From b7fe543acf0f5e3bbe0a8ba65b3a93cbfba28cd2 Mon Sep 17 00:00:00 2001 From: Anna Pak <a.pak@atwix.com> Date: Thu, 17 Dec 2020 11:26:31 +0200 Subject: [PATCH 164/171] refactored --- .../AdminSelectAttributeSetOnEditProductPageActionGroup.xml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminSelectAttributeSetOnEditProductPageActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminSelectAttributeSetOnEditProductPageActionGroup.xml index 42f7f72c1cd73..c1d1d3dee1123 100644 --- a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminSelectAttributeSetOnEditProductPageActionGroup.xml +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminSelectAttributeSetOnEditProductPageActionGroup.xml @@ -10,8 +10,7 @@ xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> <actionGroup name="AdminSelectAttributeSetOnEditProductPageActionGroup"> <annotations> - <description>Selects the specified value from the Attribute Set dropdown. - The Edit Product Page should be opened prior to Action Group execution</description> + <description>Selects the specified value from the Attribute Set dropdown.</description> </annotations> <arguments> <argument name="attributeSet" type="string"/> From d063cd634be1fecd8d13de27f15e1afcb78e9a5d Mon Sep 17 00:00:00 2001 From: Anna Pak <58164147+AnnaAPak@users.noreply.github.com> Date: Thu, 17 Dec 2020 11:35:16 +0200 Subject: [PATCH 165/171] Update app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminSelectAttributeSetOnEditProductPageActionGroup.xml Co-authored-by: Eduard Chitoraga <e.chitoraga@atwix.com> --- .../AdminSelectAttributeSetOnEditProductPageActionGroup.xml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminSelectAttributeSetOnEditProductPageActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminSelectAttributeSetOnEditProductPageActionGroup.xml index 9b3f44516dadc..5624d3a1001c1 100644 --- a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminSelectAttributeSetOnEditProductPageActionGroup.xml +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminSelectAttributeSetOnEditProductPageActionGroup.xml @@ -13,8 +13,7 @@ <<<<<<< HEAD <description>Selects the specified value from the Attribute Set dropdown.</description> ======= - <description>Selects the specified value from the Attribute Set dropdown. - The Edit Product Page should be opened prior to Action Group execution</description> + <description>Selects the specified value from the Attribute Set dropdown on the opened product edit page.</description> >>>>>>> 88b58a08d39906584398e0c7762413e18c054a27 </annotations> <arguments> From 941349a80659143e7501a5d65b68a9bc79f6738c Mon Sep 17 00:00:00 2001 From: Anna Pak <58164147+AnnaAPak@users.noreply.github.com> Date: Thu, 17 Dec 2020 11:36:11 +0200 Subject: [PATCH 166/171] refactored --- .../AdminSelectAttributeSetOnEditProductPageActionGroup.xml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminSelectAttributeSetOnEditProductPageActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminSelectAttributeSetOnEditProductPageActionGroup.xml index 5624d3a1001c1..31a4521331664 100644 --- a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminSelectAttributeSetOnEditProductPageActionGroup.xml +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminSelectAttributeSetOnEditProductPageActionGroup.xml @@ -10,11 +10,7 @@ xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> <actionGroup name="AdminSelectAttributeSetOnEditProductPageActionGroup"> <annotations> -<<<<<<< HEAD - <description>Selects the specified value from the Attribute Set dropdown.</description> -======= <description>Selects the specified value from the Attribute Set dropdown on the opened product edit page.</description> ->>>>>>> 88b58a08d39906584398e0c7762413e18c054a27 </annotations> <arguments> <argument name="attributeSet" type="string"/> From 80fee6d722839ed48963ebfd16bff99167ebcad8 Mon Sep 17 00:00:00 2001 From: Serhii Balko <serhii.balko@transogtgroup.com> Date: Thu, 17 Dec 2020 15:50:46 +0200 Subject: [PATCH 167/171] MC-38822: stabilising test --- ...efrontAssertFixedCartDiscountAmountForBundleProductTest.xml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontAssertFixedCartDiscountAmountForBundleProductTest.xml b/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontAssertFixedCartDiscountAmountForBundleProductTest.xml index 65c8a4416c1a1..2a735fd196e76 100644 --- a/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontAssertFixedCartDiscountAmountForBundleProductTest.xml +++ b/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontAssertFixedCartDiscountAmountForBundleProductTest.xml @@ -18,6 +18,9 @@ <testCaseId value="MC-39480"/> </annotations> <before> + <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindexCatalogInventory"> + <argument name="indices" value="cataloginventory_stock"/> + </actionGroup> <createData entity="SalesRuleNoCouponWithFixedDiscountWholeCart" stepKey="createSalesRule"/> <actionGroup ref="AdminCreateApiDynamicBundleProductAllOptionTypesActionGroup" stepKey="createBundleProduct"/> </before> From c2c9b3684b410e76e0e29ece21997ea96e2727e9 Mon Sep 17 00:00:00 2001 From: Serhii Balko <serhii.balko@transogtgroup.com> Date: Thu, 17 Dec 2020 17:43:23 +0200 Subject: [PATCH 168/171] MC-38822: stabilising test --- ...frontAssertFixedCartDiscountAmountForBundleProductTest.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontAssertFixedCartDiscountAmountForBundleProductTest.xml b/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontAssertFixedCartDiscountAmountForBundleProductTest.xml index 2a735fd196e76..42e6d9e1d5b09 100644 --- a/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontAssertFixedCartDiscountAmountForBundleProductTest.xml +++ b/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontAssertFixedCartDiscountAmountForBundleProductTest.xml @@ -18,11 +18,11 @@ <testCaseId value="MC-39480"/> </annotations> <before> + <createData entity="SalesRuleNoCouponWithFixedDiscountWholeCart" stepKey="createSalesRule"/> + <actionGroup ref="AdminCreateApiDynamicBundleProductAllOptionTypesActionGroup" stepKey="createBundleProduct"/> <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindexCatalogInventory"> <argument name="indices" value="cataloginventory_stock"/> </actionGroup> - <createData entity="SalesRuleNoCouponWithFixedDiscountWholeCart" stepKey="createSalesRule"/> - <actionGroup ref="AdminCreateApiDynamicBundleProductAllOptionTypesActionGroup" stepKey="createBundleProduct"/> </before> <after> <deleteData createDataKey="createSalesRule" stepKey="deleteSalesRule"/> From 7448e601404e849b2902556bd4e338a19f873bb6 Mon Sep 17 00:00:00 2001 From: Serhii Kovalenko <ganster3012@gmail.com> Date: Wed, 16 Dec 2020 11:24:36 +0200 Subject: [PATCH 169/171] Fix length for additional column --- .../Mview/View/AdditionalColumnsProcessor/DefaultProcessor.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/internal/Magento/Framework/Mview/View/AdditionalColumnsProcessor/DefaultProcessor.php b/lib/internal/Magento/Framework/Mview/View/AdditionalColumnsProcessor/DefaultProcessor.php index 96d9865998131..55e9924eb7fa0 100644 --- a/lib/internal/Magento/Framework/Mview/View/AdditionalColumnsProcessor/DefaultProcessor.php +++ b/lib/internal/Magento/Framework/Mview/View/AdditionalColumnsProcessor/DefaultProcessor.php @@ -66,7 +66,7 @@ public function processColumnForCLTable(Table $table, string $columnName): void $table->addColumn( $columnName, \Magento\Framework\DB\Ddl\Table::TYPE_TEXT, - null, + 255, ['unsigned' => true, 'nullable' => true, 'default' => null], $columnName ); From 125b01a296c165afd53d8f13ceb35b0e13716702 Mon Sep 17 00:00:00 2001 From: Pavel Bystritsky <engcom-vendorworker-foxtrot@adobe.com> Date: Fri, 18 Dec 2020 11:52:56 +0200 Subject: [PATCH 170/171] magento/magento2#31131: [MFTF] Refactoring of AddOutOfStockProductToCompareListTest. --- .../AddOutOfStockProductToCompareListTest.xml | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AddOutOfStockProductToCompareListTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AddOutOfStockProductToCompareListTest.xml index 7f4228a21f3d5..995fa4c7e5977 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AddOutOfStockProductToCompareListTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AddOutOfStockProductToCompareListTest.xml @@ -20,6 +20,7 @@ <group value="Catalog"/> </annotations> <before> + <comment userInput="Adding the comment for preserving Backward Compatibility" stepKey="loginAsAdmin"/> <magentoCLI command="config:set {{CatalogInventoryOptionsShowOutOfStockDisable.path}} {{CatalogInventoryOptionsShowOutOfStockDisable.value}}" stepKey="setConfigShowOutOfStockFalse"/> <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> <argument name="tags" value=""/> @@ -35,8 +36,9 @@ <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> <argument name="tags" value=""/> </actionGroup> - <deleteData createDataKey="product" stepKey="deleteProduct"/> - <deleteData createDataKey="category" stepKey="deleteCategory"/> + <deleteData createDataKey="product" stepKey="deleteProduct"/> + <deleteData createDataKey="category" stepKey="deleteCategory"/> + <comment userInput="Adding the comment for preserving Backward Compatibility" stepKey="logout"/> </after> <comment userInput="Open product page | Comment is kept to preserve the step key for backward compatibility" stepKey="openProdPage"/> <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="goToSimpleProductPage"/> @@ -48,10 +50,10 @@ <comment userInput="'Add to compare' link is not available | Comment is kept to preserve the step key for backward compatibility" stepKey="addToCompareLinkAvailability"/> <dontSeeElement selector="{{StorefrontProductInfoMainSection.productAddToCompare}}" stepKey="dontSeeAddToCompareLink"/> - + <comment userInput="Turn on 'out of stock' config | Comment is kept to preserve the step key for backward compatibility" stepKey="onOutOfStockConfig"/> <magentoCLI command="config:set {{CatalogInventoryOptionsShowOutOfStockEnable.path}} {{CatalogInventoryOptionsShowOutOfStockEnable.value}}" stepKey="setConfigShowOutOfStockTrue"/> - + <comment userInput="Clear cache and reindex | Comment is kept to preserve the step key for backward compatibility" stepKey="cleanCache"/> <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> <argument name="indices" value=""/> @@ -72,13 +74,13 @@ <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForProdAddToCmpList"/> <comment userInput="Assert success message | Comment is kept to preserve the step key for backward compatibility" stepKey="assertSuccessMsg"/> <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="grabTextFromSuccessMessage"/> - + <actionGroup ref="StorefrontAddProductToCompareActionGroup" stepKey="assertSuccessMessage"> <argument name="productVar" value="$$product$$"/> </actionGroup> <comment userInput="See product in the comparison list | Comment is kept to preserve the step key for backward compatibility" stepKey="seeProductInComparisonList"/> - + <actionGroup ref="StorefrontGoToCategoryPageActionGroup" stepKey="openCategoryPage"> <argument name="categoryName" value="$$category.name$$"/> </actionGroup> @@ -112,13 +114,13 @@ <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="grabTextFromSuccessMessage2"/> <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="assertSuccessMessage2"/> - <comment userInput="Check that product displays on add to compare widget | Comment is kept to preserve the step key for backward compatibility" stepKey="checkProdNameOnWidget"/> + <comment userInput="Check that product displays on add to compare widget | Comment is kept to preserve the step key for backward compatibility" stepKey="checkProdNameOnWidget"/> <seeElement selector="{{StorefrontComparisonSidebarSection.ProductTitleByName($$product.name$$)}}" stepKey="seeProdNameOnCmpWidget"/> <comment userInput="See product in the compare page" stepKey="seeProductInComparePage"/> <actionGroup ref="StorefrontOpenAndCheckComparisionActionGroup" stepKey="navigateToComparePage2"/> <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForStorefrontProductComparePageLoad2"/> - + <actionGroup ref="SeeProductInComparisonListActionGroup" stepKey="seeProductInCompareList2"> <argument name="productVar" value="$$product$$"/> </actionGroup> From 59b446956348c8fdb421a1c61174cee018122fda Mon Sep 17 00:00:00 2001 From: Myroslav Dobra <dmaraptor@gmail.com> Date: Fri, 18 Dec 2020 15:13:00 +0200 Subject: [PATCH 171/171] MC-39765: No such entity with addressId, occurs randomly on visitors browser. System Log Generated --- .../Test/Unit/Observer/EmulateCustomerObserverTest.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/code/Magento/Persistent/Test/Unit/Observer/EmulateCustomerObserverTest.php b/app/code/Magento/Persistent/Test/Unit/Observer/EmulateCustomerObserverTest.php index 6c35ade65451b..2df36577b2931 100644 --- a/app/code/Magento/Persistent/Test/Unit/Observer/EmulateCustomerObserverTest.php +++ b/app/code/Magento/Persistent/Test/Unit/Observer/EmulateCustomerObserverTest.php @@ -131,14 +131,14 @@ public function testExecuteWhenSessionPersistAndCustomerNotLoggedIn() $customerMock ->expects($this->once()) ->method('getDefaultShipping') - ->willReturn('shippingId'); + ->willReturn(12345); $customerMock ->expects($this->once()) ->method('getDefaultBilling') - ->willReturn('billingId'); + ->willReturn(12346); $valueMap = [ - ['shippingId', $defaultShippingAddressMock], - ['billingId', $defaultBillingAddressMock] + [12345, $defaultShippingAddressMock], + [12346, $defaultBillingAddressMock] ]; $this->addressRepositoryMock->expects($this->any())->method('getById')->willReturnMap($valueMap); $this->customerSessionMock