Marketing: route registration to checkout
This commit is contained in:
@@ -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 }) => {
|
||||
|
||||
Reference in New Issue
Block a user