diff --git a/UPGRADE.md b/UPGRADE.md index 5e79a18f7..cd16285f7 100644 --- a/UPGRADE.md +++ b/UPGRADE.md @@ -1,6 +1,8 @@ # NEXT -- [BREAKING] [#178](https://github.com/shopware/SwagMigrationAssistant/pull/190) - fix!: update product.sales during migration +- [BREAKING] [#202](https://github.com/shopware/SwagMigrationAssistant/pull/202) - fix!: replace native time reads with an injected clock + - [BREAKING] Added required constructor parameter `Psr\Clock\ClockInterface $clock` to `\SwagMigrationAssistant\Profile\Shopware\Converter\ShippingMethodConverter` +- [BREAKING] [#190](https://github.com/shopware/SwagMigrationAssistant/pull/190) - fix!: update product.sales during migration - [BREAKING] Added required constructor parameter `\SwagMigrationAssistant\Migration\Service\ProductSalesUpdater` to `\SwagMigrationAssistant\Migration\Writer\OrderWriter` # 18.0.0 diff --git a/phpstan.neon.dist b/phpstan.neon.dist index bf90f07bf..da5620eb6 100644 --- a/phpstan.neon.dist +++ b/phpstan.neon.dist @@ -37,6 +37,7 @@ parameters: path: src/DataProvider/Provider/Data/AbstractProvider.php # TODO: remove this for 6.8 compatibility + - message: '#Call to deprecated method scope\(\) of class Shopware\\Core\\Framework\\Context#' - message: '#Call to deprecated method addFlags\(\) of class Shopware\\Core\\Framework\\DataAbstractionLayer\\Field\\Field#' - message: '#Call to deprecated method setFlags\(\) of class Shopware\\Core\\Framework\\DataAbstractionLayer\\Field\\Field#' - message: '#Access to constant on deprecated class Shopware\\Core\\Checkout\\Payment\\Cart\\PaymentHandler\\DebitPayment#' diff --git a/src/Controller/DataProviderController.php b/src/Controller/DataProviderController.php index 52417162c..d67f83258 100644 --- a/src/Controller/DataProviderController.php +++ b/src/Controller/DataProviderController.php @@ -9,6 +9,7 @@ use League\Flysystem\FilesystemOperator; use League\Flysystem\UnableToGenerateTemporaryUrl; +use Psr\Clock\ClockInterface; use Psr\Http\Message\StreamInterface; use Shopware\Core\Checkout\Document\Service\DocumentGenerator; use Shopware\Core\Content\Media\MediaCollection; @@ -52,6 +53,7 @@ public function __construct( private readonly MediaService $mediaService, private readonly FilesystemOperator $privateFilesystem, private readonly MigrationApiRateLimiter $rateLimiter, + private readonly ClockInterface $clock, ) { } @@ -183,7 +185,7 @@ public function downloadPrivateFile(Request $request, Context $context): Streame } try { - $url = $this->privateFilesystem->temporaryUrl($media->getPath(), (new \DateTime())->modify('+120 minutes')); + $url = $this->privateFilesystem->temporaryUrl($media->getPath(), $this->clock->now()->add(new \DateInterval('PT120M'))); return new RedirectResponse($url); } catch (UnableToGenerateTemporaryUrl) { diff --git a/src/DependencyInjection/dataProvider.php b/src/DependencyInjection/dataProvider.php index d26ac6920..ad3140749 100644 --- a/src/DependencyInjection/dataProvider.php +++ b/src/DependencyInjection/dataProvider.php @@ -7,6 +7,7 @@ namespace Symfony\Component\DependencyInjection\Loader\Configurator; +use Psr\Clock\ClockInterface; use Shopware\Core\Checkout\Document\Service\DocumentGenerator; use Shopware\Core\Content\Media\MediaService; use Shopware\Core\Framework\Store\Services\AbstractExtensionDataProvider; @@ -87,6 +88,7 @@ service(MediaService::class), service('shopware.filesystem.private'), service(MigrationApiRateLimiter::class), + service(ClockInterface::class), ]) ->call('setContainer', [service('service_container')]); diff --git a/src/DependencyInjection/shopware.php b/src/DependencyInjection/shopware.php index 74161f831..ca56ca043 100644 --- a/src/DependencyInjection/shopware.php +++ b/src/DependencyInjection/shopware.php @@ -8,6 +8,7 @@ namespace Symfony\Component\DependencyInjection\Loader\Configurator; use Doctrine\DBAL\Connection; +use Psr\Clock\ClockInterface; use Shopware\Core\Checkout\Cart\Tax\TaxCalculator; use Shopware\Core\Checkout\Promotion\PromotionDefinition; use Shopware\Core\Content\Media\File\FileSaver; @@ -454,6 +455,7 @@ ->args([ service(CountryLookup::class), service(LanguageLookup::class), + service(ClockInterface::class), ]); $services->set(ProductReviewConverter::class) diff --git a/src/Profile/Shopware/Converter/ShippingMethodConverter.php b/src/Profile/Shopware/Converter/ShippingMethodConverter.php index 6e64a5d1e..e22dfe076 100644 --- a/src/Profile/Shopware/Converter/ShippingMethodConverter.php +++ b/src/Profile/Shopware/Converter/ShippingMethodConverter.php @@ -7,6 +7,7 @@ namespace SwagMigrationAssistant\Profile\Shopware\Converter; +use Psr\Clock\ClockInterface; use Shopware\Core\Checkout\Shipping\Aggregate\ShippingMethodPrice\ShippingMethodPriceDefinition; use Shopware\Core\Checkout\Shipping\ShippingMethodDefinition; use Shopware\Core\Framework\Context; @@ -79,6 +80,7 @@ public function __construct( LoggingServiceInterface $loggingService, protected readonly CountryLookup $countryLookup, protected readonly LanguageLookup $languageLookup, + private readonly ClockInterface $clock, ) { parent::__construct($mappingService, $loggingService); } @@ -762,7 +764,7 @@ private function setCustomAvailabilityRule(array $data, array &$converted): void ], ], 'name' => $converted['name'], - 'description' => 'Migrated at ' . (new \DateTime())->format('d.m.Y H:i'), + 'description' => 'Migrated at ' . $this->clock->now()->format('d.m.Y H:i'), ]; $mainOrContainerMapping = $this->mappingService->getOrCreateMapping( diff --git a/src/SwagMigrationAssistant.php b/src/SwagMigrationAssistant.php index ec291062b..59e32d307 100644 --- a/src/SwagMigrationAssistant.php +++ b/src/SwagMigrationAssistant.php @@ -24,6 +24,7 @@ use SwagMigrationAssistant\Migration\Media\SwagMigrationMediaFileDefinition; use SwagMigrationAssistant\Migration\Run\SwagMigrationRunDefinition; use SwagMigrationAssistant\Migration\Setting\GeneralSettingDefinition; +use Symfony\Component\Clock\NativeClock; use Symfony\Component\Config\FileLocator; use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\DependencyInjection\Loader\PhpFileLoader; @@ -91,7 +92,7 @@ public function postInstall(InstallContext $installContext): void /** @var Connection $connection */ $connection = $this->container->get(Connection::class); - $now = (new \DateTime())->format(Defaults::STORAGE_DATE_TIME_FORMAT); + $now = (new NativeClock())->now()->format(Defaults::STORAGE_DATE_TIME_FORMAT); $connection->beginTransaction(); diff --git a/tests/Profile/Shopware55/Converter/ShippingMethodConverterTest.php b/tests/Profile/Shopware55/Converter/ShippingMethodConverterTest.php index 5b7df27cf..1f897eb6c 100644 --- a/tests/Profile/Shopware55/Converter/ShippingMethodConverterTest.php +++ b/tests/Profile/Shopware55/Converter/ShippingMethodConverterTest.php @@ -9,6 +9,7 @@ use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\TestCase; +use Psr\Clock\ClockInterface; use Shopware\Core\Framework\Context; use Shopware\Core\Framework\DataAbstractionLayer\Search\Criteria; use Shopware\Core\Framework\DataAbstractionLayer\Search\Filter\EqualsFilter; @@ -67,7 +68,8 @@ protected function setUp(): void $this->mappingService, $this->loggingService, static::getContainer()->get(CountryLookup::class), - static::getContainer()->get(LanguageLookup::class) + static::getContainer()->get(LanguageLookup::class), + static::getContainer()->get(ClockInterface::class) ); $runId = Uuid::randomHex(); @@ -142,7 +144,8 @@ public function testConvert(): void $this->mappingService, $this->loggingService, static::getContainer()->get(CountryLookup::class), - $languageLookup + $languageLookup, + static::getContainer()->get(ClockInterface::class) ); $convertResult = $shippingMethodConverter->convert($shippingMethodData[0], $this->context, $this->migrationContext); diff --git a/tests/acceptance/fixtures/TestHelpers.ts b/tests/acceptance/fixtures/TestHelpers.ts index 9bc15a771..989953cfa 100644 --- a/tests/acceptance/fixtures/TestHelpers.ts +++ b/tests/acceptance/fixtures/TestHelpers.ts @@ -10,7 +10,7 @@ export const VIEWPORT = { export const loaderSelectors = [ '.sw-loader-element', - '.mt-loader-element', + '.mt-loader__element', '.mt-skeleton-bar', '.sw-skeleton', ] as const; diff --git a/tests/acceptance/playwright.config.ts b/tests/acceptance/playwright.config.ts index a7760be13..b9ac2f3cc 100644 --- a/tests/acceptance/playwright.config.ts +++ b/tests/acceptance/playwright.config.ts @@ -53,7 +53,7 @@ export default defineConfig({ expect: { toHaveScreenshot: { - maxDiffPixelRatio: 0.01, + maxDiffPixels: 100, threshold: 0.2, animations: 'disabled', }, diff --git a/tests/acceptance/snapshots/BasicVisualTest.spec.ts/linux/connection-wizard-create.png b/tests/acceptance/snapshots/BasicVisualTest.spec.ts/linux/connection-wizard-create.png index 49edb63b7..e1a0ddf1e 100644 Binary files a/tests/acceptance/snapshots/BasicVisualTest.spec.ts/linux/connection-wizard-create.png and b/tests/acceptance/snapshots/BasicVisualTest.spec.ts/linux/connection-wizard-create.png differ diff --git a/tests/acceptance/snapshots/BasicVisualTest.spec.ts/linux/connection-wizard-establish-local.png b/tests/acceptance/snapshots/BasicVisualTest.spec.ts/linux/connection-wizard-establish-local.png index deaa54c24..e15abb000 100644 Binary files a/tests/acceptance/snapshots/BasicVisualTest.spec.ts/linux/connection-wizard-establish-local.png and b/tests/acceptance/snapshots/BasicVisualTest.spec.ts/linux/connection-wizard-establish-local.png differ diff --git a/tests/acceptance/snapshots/BasicVisualTest.spec.ts/linux/connection-wizard-introduction.png b/tests/acceptance/snapshots/BasicVisualTest.spec.ts/linux/connection-wizard-introduction.png index 65b1327cb..3bf77ea3b 100644 Binary files a/tests/acceptance/snapshots/BasicVisualTest.spec.ts/linux/connection-wizard-introduction.png and b/tests/acceptance/snapshots/BasicVisualTest.spec.ts/linux/connection-wizard-introduction.png differ diff --git a/tests/acceptance/snapshots/BasicVisualTest.spec.ts/linux/connection-wizard-profiles.png b/tests/acceptance/snapshots/BasicVisualTest.spec.ts/linux/connection-wizard-profiles.png index 2c6f15b0b..318adedae 100644 Binary files a/tests/acceptance/snapshots/BasicVisualTest.spec.ts/linux/connection-wizard-profiles.png and b/tests/acceptance/snapshots/BasicVisualTest.spec.ts/linux/connection-wizard-profiles.png differ diff --git a/tests/acceptance/snapshots/BasicVisualTest.spec.ts/linux/connection-wizard-truncation.png b/tests/acceptance/snapshots/BasicVisualTest.spec.ts/linux/connection-wizard-truncation.png index 7c73db8ba..f07ab2dc2 100644 Binary files a/tests/acceptance/snapshots/BasicVisualTest.spec.ts/linux/connection-wizard-truncation.png and b/tests/acceptance/snapshots/BasicVisualTest.spec.ts/linux/connection-wizard-truncation.png differ diff --git a/tests/acceptance/snapshots/BasicVisualTest.spec.ts/linux/dashboard-card.png b/tests/acceptance/snapshots/BasicVisualTest.spec.ts/linux/dashboard-card.png index 013415482..ad03f8132 100644 Binary files a/tests/acceptance/snapshots/BasicVisualTest.spec.ts/linux/dashboard-card.png and b/tests/acceptance/snapshots/BasicVisualTest.spec.ts/linux/dashboard-card.png differ diff --git a/tests/acceptance/snapshots/BasicVisualTest.spec.ts/linux/main-page-data-selection-empty.png b/tests/acceptance/snapshots/BasicVisualTest.spec.ts/linux/main-page-data-selection-empty.png index 7d03aeed6..ef8be573d 100644 Binary files a/tests/acceptance/snapshots/BasicVisualTest.spec.ts/linux/main-page-data-selection-empty.png and b/tests/acceptance/snapshots/BasicVisualTest.spec.ts/linux/main-page-data-selection-empty.png differ diff --git a/tests/acceptance/snapshots/BasicVisualTest.spec.ts/linux/main-page-data-selection.png b/tests/acceptance/snapshots/BasicVisualTest.spec.ts/linux/main-page-data-selection.png index 4d1e1ec22..00b5b6d01 100644 Binary files a/tests/acceptance/snapshots/BasicVisualTest.spec.ts/linux/main-page-data-selection.png and b/tests/acceptance/snapshots/BasicVisualTest.spec.ts/linux/main-page-data-selection.png differ diff --git a/tests/acceptance/snapshots/BasicVisualTest.spec.ts/linux/main-page-general-no-connection.png b/tests/acceptance/snapshots/BasicVisualTest.spec.ts/linux/main-page-general-no-connection.png index 78195c6da..285057d17 100644 Binary files a/tests/acceptance/snapshots/BasicVisualTest.spec.ts/linux/main-page-general-no-connection.png and b/tests/acceptance/snapshots/BasicVisualTest.spec.ts/linux/main-page-general-no-connection.png differ diff --git a/tests/acceptance/snapshots/BasicVisualTest.spec.ts/linux/main-page-general-with-connection.png b/tests/acceptance/snapshots/BasicVisualTest.spec.ts/linux/main-page-general-with-connection.png index 2add3087c..10d3778e3 100644 Binary files a/tests/acceptance/snapshots/BasicVisualTest.spec.ts/linux/main-page-general-with-connection.png and b/tests/acceptance/snapshots/BasicVisualTest.spec.ts/linux/main-page-general-with-connection.png differ diff --git a/tests/acceptance/snapshots/MigrationTest.spec.ts/linux/data-selection-assigment-with-errors.png b/tests/acceptance/snapshots/MigrationTest.spec.ts/linux/data-selection-assigment-with-errors.png index 7c8a6c47d..d9f68929d 100644 Binary files a/tests/acceptance/snapshots/MigrationTest.spec.ts/linux/data-selection-assigment-with-errors.png and b/tests/acceptance/snapshots/MigrationTest.spec.ts/linux/data-selection-assigment-with-errors.png differ diff --git a/tests/acceptance/snapshots/MigrationTest.spec.ts/linux/data-selection-assigment-without-errors.png b/tests/acceptance/snapshots/MigrationTest.spec.ts/linux/data-selection-assigment-without-errors.png index 5f6c77a18..c67b1d6ee 100644 Binary files a/tests/acceptance/snapshots/MigrationTest.spec.ts/linux/data-selection-assigment-without-errors.png and b/tests/acceptance/snapshots/MigrationTest.spec.ts/linux/data-selection-assigment-without-errors.png differ diff --git a/tests/acceptance/snapshots/MigrationTest.spec.ts/linux/error-resolution-log-detail-fixed.png b/tests/acceptance/snapshots/MigrationTest.spec.ts/linux/error-resolution-log-detail-fixed.png index 2f2cf6ed9..b7ba06aab 100644 Binary files a/tests/acceptance/snapshots/MigrationTest.spec.ts/linux/error-resolution-log-detail-fixed.png and b/tests/acceptance/snapshots/MigrationTest.spec.ts/linux/error-resolution-log-detail-fixed.png differ diff --git a/tests/acceptance/snapshots/MigrationTest.spec.ts/linux/error-resolution-log-detail-unfixed.png b/tests/acceptance/snapshots/MigrationTest.spec.ts/linux/error-resolution-log-detail-unfixed.png index 88b662832..21f30ff7e 100644 Binary files a/tests/acceptance/snapshots/MigrationTest.spec.ts/linux/error-resolution-log-detail-unfixed.png and b/tests/acceptance/snapshots/MigrationTest.spec.ts/linux/error-resolution-log-detail-unfixed.png differ diff --git a/tests/acceptance/snapshots/MigrationTest.spec.ts/linux/error-resolution-log-groups-fixed.png b/tests/acceptance/snapshots/MigrationTest.spec.ts/linux/error-resolution-log-groups-fixed.png index 202457880..df0f0bd89 100644 Binary files a/tests/acceptance/snapshots/MigrationTest.spec.ts/linux/error-resolution-log-groups-fixed.png and b/tests/acceptance/snapshots/MigrationTest.spec.ts/linux/error-resolution-log-groups-fixed.png differ diff --git a/tests/acceptance/snapshots/MigrationTest.spec.ts/linux/error-resolution-log-groups-unfixed.png b/tests/acceptance/snapshots/MigrationTest.spec.ts/linux/error-resolution-log-groups-unfixed.png index fb3872fc9..7f19cabf1 100644 Binary files a/tests/acceptance/snapshots/MigrationTest.spec.ts/linux/error-resolution-log-groups-unfixed.png and b/tests/acceptance/snapshots/MigrationTest.spec.ts/linux/error-resolution-log-groups-unfixed.png differ diff --git a/tests/acceptance/snapshots/MigrationTest.spec.ts/linux/migration-history-details-modal.png b/tests/acceptance/snapshots/MigrationTest.spec.ts/linux/migration-history-details-modal.png index b87057421..1ef4115bf 100644 Binary files a/tests/acceptance/snapshots/MigrationTest.spec.ts/linux/migration-history-details-modal.png and b/tests/acceptance/snapshots/MigrationTest.spec.ts/linux/migration-history-details-modal.png differ diff --git a/tests/acceptance/snapshots/MigrationTest.spec.ts/linux/migration-history-list.png b/tests/acceptance/snapshots/MigrationTest.spec.ts/linux/migration-history-list.png index e0c914120..2a3c40e42 100644 Binary files a/tests/acceptance/snapshots/MigrationTest.spec.ts/linux/migration-history-list.png and b/tests/acceptance/snapshots/MigrationTest.spec.ts/linux/migration-history-list.png differ diff --git a/tests/acceptance/snapshots/MigrationTest.spec.ts/linux/migration-process-started.png b/tests/acceptance/snapshots/MigrationTest.spec.ts/linux/migration-process-started.png index de03c209e..e1cb66c4c 100644 Binary files a/tests/acceptance/snapshots/MigrationTest.spec.ts/linux/migration-process-started.png and b/tests/acceptance/snapshots/MigrationTest.spec.ts/linux/migration-process-started.png differ diff --git a/tests/acceptance/snapshots/MigrationTest.spec.ts/linux/migration-process-summary.png b/tests/acceptance/snapshots/MigrationTest.spec.ts/linux/migration-process-summary.png index 241487576..d85b7cf6e 100644 Binary files a/tests/acceptance/snapshots/MigrationTest.spec.ts/linux/migration-process-summary.png and b/tests/acceptance/snapshots/MigrationTest.spec.ts/linux/migration-process-summary.png differ diff --git a/tests/acceptance/tests/BasicVisualTest.spec.ts b/tests/acceptance/tests/BasicVisualTest.spec.ts index befa3492b..3ef04bc46 100644 --- a/tests/acceptance/tests/BasicVisualTest.spec.ts +++ b/tests/acceptance/tests/BasicVisualTest.spec.ts @@ -16,12 +16,12 @@ test.describe('Visual Regression Tests @visual', () => { await page.getByRole('button', { name: 'Open Migration Assistant' }).click(); await waitForLoaders(page); - await expect(page).toHaveScreenshot('main-page-general-no-connection.png', { mask }); + await expect.soft(page).toHaveScreenshot('main-page-general-no-connection.png', { mask }); await page.getByTitle('Data selection').click(); await waitForLoaders(page); - await expect(page).toHaveScreenshot('main-page-data-selection-empty.png', { mask }); + await expect.soft(page).toHaveScreenshot('main-page-data-selection-empty.png', { mask }); }); test('Main page (with connection)', async ({ ShopAdmin, MigrationConnection: _ }) => { @@ -34,12 +34,12 @@ test.describe('Visual Regression Tests @visual', () => { await page.getByRole('button', { name: 'Open Migration Assistant' }).click(); await waitForLoaders(page); - await expect(page).toHaveScreenshot('main-page-general-with-connection.png', { mask }); + await expect.soft(page).toHaveScreenshot('main-page-general-with-connection.png', { mask }); await page.getByTitle('Data selection').click(); await waitForLoaders(page); - await expect(page).toHaveScreenshot('main-page-data-selection.png', { mask }); + await expect.soft(page).toHaveScreenshot('main-page-data-selection.png', { mask }); }); test('Connection wizard (local, happy path)', async ({ ShopAdmin, DatabaseCredentials }) => { @@ -55,17 +55,17 @@ test.describe('Visual Regression Tests @visual', () => { await page.getByRole('button', { name: 'Create initial connection' }).click(); await waitForLoaders(page); - await expect(page).toHaveScreenshot('connection-wizard-introduction.png', { mask }); + await expect.soft(page).toHaveScreenshot('connection-wizard-introduction.png', { mask }); await page.getByRole('button', { name: 'Start' }).click(); await waitForLoaders(page); - await expect(page).toHaveScreenshot('connection-wizard-profiles.png', { mask }); + await expect.soft(page).toHaveScreenshot('connection-wizard-profiles.png', { mask }); await page.getByRole('button', { name: 'Continue' }).click(); await waitForLoaders(page); - await expect(page).toHaveScreenshot('connection-wizard-create.png', { mask }); + await expect.soft(page).toHaveScreenshot('connection-wizard-create.png', { mask }); await page.getByPlaceholder('Enter name').fill('shopware55local'); @@ -78,7 +78,7 @@ test.describe('Visual Regression Tests @visual', () => { // lose focus of host input await page.getByText('Migration').click(); - await expect(page).toHaveScreenshot('connection-wizard-establish-local.png', { mask }); + await expect.soft(page).toHaveScreenshot('connection-wizard-establish-local.png', { mask }); await page.getByPlaceholder('Enter host').fill(DatabaseCredentials.host); await page.getByLabel('Port').fill(DatabaseCredentials.port); @@ -97,7 +97,7 @@ test.describe('Visual Regression Tests @visual', () => { await page.getByRole('button', { name: 'Truncate migration' }).click(); await page.getByRole('button', { name: 'Archive' }).click(); - await expect(page).toHaveScreenshot('connection-wizard-truncation.png', { mask }); + await expect.soft(page).toHaveScreenshot('connection-wizard-truncation.png', { mask }); await waitForLoaders(page, 300_000); // wait for truncation @@ -122,6 +122,6 @@ test.describe('Component Visual Tests @visual @components', () => { const dashboardCard = page.locator('.swag-migration-dashboard-card'); await expect(dashboardCard).toBeVisible(); - await expect(dashboardCard).toHaveScreenshot('dashboard-card.png'); + await expect.soft(dashboardCard).toHaveScreenshot('dashboard-card.png'); }); }); diff --git a/tests/acceptance/tests/MigrationTest.spec.ts b/tests/acceptance/tests/MigrationTest.spec.ts index 25aac624c..ec5a6e579 100644 --- a/tests/acceptance/tests/MigrationTest.spec.ts +++ b/tests/acceptance/tests/MigrationTest.spec.ts @@ -1,6 +1,6 @@ /* eslint-disable playwright/no-conditional-in-test */ /* eslint-disable playwright/no-conditional-expect */ -import { test, expect } from '@fixtures/AcceptanceTest'; +import { test, expect, replaceElements } from '@fixtures/AcceptanceTest'; import { getMask, waitForLoaders, withLargerViewport } from '@fixtures/TestHelpers'; test.describe('Migration Tests @migration @visual', () => { @@ -53,7 +53,7 @@ test.describe('Migration Tests @migration @visual', () => { await waitForLoaders(page); const restoreViewport = await withLargerViewport(page); - await expect(page).toHaveScreenshot('data-selection-assigment-with-errors.png', { mask }); + await expect.soft(page).toHaveScreenshot('data-selection-assigment-with-errors.png', { mask }); await restoreViewport(); const tabs = page.locator('.swag-migration-tab-card__title'); @@ -75,7 +75,7 @@ test.describe('Migration Tests @migration @visual', () => { } } - await expect(page).toHaveScreenshot('data-selection-assigment-without-errors.png', { mask }); + await expect.soft(page).toHaveScreenshot('data-selection-assigment-without-errors.png', { mask }); }); await test.step('Start migration', async () => { @@ -85,7 +85,7 @@ test.describe('Migration Tests @migration @visual', () => { await page.getByRole('button', { name: 'Continue anyway' }).click(); await waitForLoaders(page); - await expect(page).toHaveScreenshot('migration-process-started.png', { mask }); + await expect.soft(page).toHaveScreenshot('migration-process-started.png', { mask }); const step = page.locator('.sw-step-display > .sw-step-item').first(); await expect(step).toHaveClass(/sw-step-item--success/, { timeout: 300_000 }); @@ -96,7 +96,7 @@ test.describe('Migration Tests @migration @visual', () => { await test.step('Error resolution', async () => { let restoreViewport = await withLargerViewport(page); - await expect(page).toHaveScreenshot('error-resolution-log-groups-unfixed.png', { mask }); + await expect.soft(page).toHaveScreenshot('error-resolution-log-groups-unfixed.png', { mask }); await restoreViewport(); await waitForLoaders(page); @@ -171,14 +171,14 @@ test.describe('Migration Tests @migration @visual', () => { await processLogEntry(i); if (i === 0) { - await expect(page).toHaveScreenshot('error-resolution-log-detail-unfixed.png', { mask }); + await expect.soft(page).toHaveScreenshot('error-resolution-log-detail-unfixed.png', { mask }); } await page.getByRole('button', { name: 'Apply changes' }).click(); await waitForLoaders(page); if (i === 0) { - await expect(page).toHaveScreenshot('error-resolution-log-detail-fixed.png', { mask }); + await expect.soft(page).toHaveScreenshot('error-resolution-log-detail-fixed.png', { mask }); } await page.locator('.sw-modal__close').click(); @@ -188,7 +188,7 @@ test.describe('Migration Tests @migration @visual', () => { await waitForLoaders(page); restoreViewport = await withLargerViewport(page); - await expect(page).toHaveScreenshot('error-resolution-log-groups-fixed.png', { mask }); + await expect.soft(page).toHaveScreenshot('error-resolution-log-groups-fixed.png', { mask }); await restoreViewport(); await expect(page.locator('.swag-migration-error-resolution-step__card-table-count-icon')).toHaveCount(logCount); @@ -210,7 +210,7 @@ test.describe('Migration Tests @migration @visual', () => { await waitForLoaders(page); await expect(page.getByText('The Migration is done')).toBeVisible({ timeout: 300_000 }); - await expect(page).toHaveScreenshot('migration-process-summary.png', { mask }); + await expect.soft(page).toHaveScreenshot('migration-process-summary.png', { mask }); await page.getByRole('button', { name: 'Back to overview' }).click(); await waitForLoaders(page); @@ -220,9 +220,11 @@ test.describe('Migration Tests @migration @visual', () => { await page.getByTitle('History').click(); await waitForLoaders(page); - await expect(page).toHaveScreenshot('migration-history-list.png', { - mask: getMask(page, ['.sw-data-grid__cell--createdAt']), - }); + const createdAtCellContent = page.locator('.sw-data-grid__cell--createdAt .sw-data-grid__cell-content'); + + await replaceElements(page, [createdAtCellContent]); + + await expect.soft(page).toHaveScreenshot('migration-history-list.png', { mask }); await page.locator('.sw-data-grid__body .sw-data-grid__cell--actions').getByRole('button').click(); await waitForLoaders(page); @@ -230,7 +232,9 @@ test.describe('Migration Tests @migration @visual', () => { await page.locator('.sw-context-menu__content .sw-context-menu-item').first().click(); await waitForLoaders(page); - await expect(page).toHaveScreenshot('migration-history-details-modal.png', { mask }); + await replaceElements(page, [createdAtCellContent]); + + await expect.soft(page).toHaveScreenshot('migration-history-details-modal.png', { mask }); }); await test.step('Verify migrated entities', async () => {