Marketing: route registration to checkout

This commit is contained in:
Codex Agent
2026-01-06 08:36:55 +01:00
parent 34eb2b94b3
commit f89f6d6223
14 changed files with 105 additions and 328 deletions

View File

@@ -1,36 +1,17 @@
import { test, expectFixture as expect } from '../helpers/test-fixtures';
test.describe('Marketing auth flows', () => {
test('registers a new account and captures welcome email', async ({ page, clearTestMailbox, getTestMailbox }) => {
await clearTestMailbox();
const stamp = Date.now();
const email = `playwright-register-${stamp}@example.test`;
const username = `playwright-${stamp}`;
const password = 'Password123!';
test('legacy register route redirects to packages', async ({ page }) => {
await page.goto('/register');
await page.getByLabel(/Vorname/i).fill('Playwright');
await page.getByLabel(/Nachname/i).fill('Tester');
await page.getByLabel(/^E-Mail/i).fill(email);
await page.getByLabel(/Telefon/i).fill('+49123456789');
await page.fill('input[name="address"]', 'Teststr. 1, 12345 Berlin');
await page.getByLabel(/Username/i).fill(username);
await page.fill('input[name="password"]', password);
await page.fill('input[name="password_confirmation"]', password);
await page.locator('#privacy_consent').check();
await page.waitForURL(/\/packages/, { timeout: 2000 }).catch(() => null);
await page.getByRole('button', { name: /^Registrieren$/i }).click();
if (!page.url().includes('/packages')) {
await page.goto('/packages');
}
await expect.poll(() => page.url()).not.toContain('/register');
const messages = await getTestMailbox();
const hasWelcome = messages.some((message) =>
message.to.some((recipient) => recipient.email === email)
);
expect(hasWelcome).toBe(true);
await expect(page).toHaveURL(/\/packages/);
await expect(page.getByRole('heading', { level: 1 })).toBeVisible();
});
test('shows inline error on invalid login', async ({ page }) => {