Playwright-based acceptance tests for the Migration Assistant plugin.
Navigate to the acceptance tests directory:
cd tests/acceptanceInstall dependencies:
npm installInstall Playwright browsers (first time only):
npx playwright install
npx playwright install-depsCreate a .env file in this directory or use the platform's .env file (auto-loaded from ../../../../../.env).
| Variable | Description |
|---|---|
APP_URL |
Base URL of your Shopware instance (e.g., http://localhost:8000) |
DATABASE_URL |
Database connection string |
| Variable | Default | Description |
|---|---|---|
SHOPWARE_ADMIN_USERNAME |
admin |
Admin username |
SHOPWARE_ADMIN_PASSWORD |
shopware |
Admin password |
SHOPWARE_PLAYWRIGHT_IGNORE_HTTPS_ERRORS |
false |
Set to true or 1 to ignore HTTPS errors |
npm testnpm run test:uinpx playwright test tests/BasicVisualTest.spec.tsnpx playwright test --grep @migrationnpx playwright test --update-snapshots| Script | Description |
|---|---|
npm test |
Run all tests |
npm run test:ui |
Run tests in UI mode (port 3000) |
npm run lint |
Check for linting errors |
npm run lint:fix |
Fix linting errors |
npm run format |
Check code formatting |
npm run format:fix |
Fix code formatting |
npm run lint:types |
Type-check TypeScript files |
Default viewport is 1440x1080. For screenshots requiring more height, use the withLargerViewport helper:
import { withLargerViewport } from '@fixtures/TestHelpers';
const restoreViewport = await withLargerViewport(page);
await expect(page).toHaveScreenshot('my-screenshot.png');
await restoreViewport();Snapshots are stored per platform (darwin/linux). CI runs on Linux, so ensure Linux snapshots exist.
Visual regression tests compare screenshots against baseline images. When UI changes are intentional, update the snapshots via CI to ensure consistency across environments:
- Go to Actions > Acceptance workflow
- Click Run workflow
- Check Update snapshots
- Run the workflow and wait for completion
- Download the
visual-snapshots-trunkartifact - Extract and replace
tests/acceptance/snapshots/with the downloaded files - Commit the updated snapshots to your branch