- Tenant-Admin-PWA: Neues /event-admin/welcome Onboarding mit WelcomeHero, Packages-, Order-Summary- und Event-Setup-Pages, Zustandsspeicher, Routing-Guard und Dashboard-CTA für Erstnutzer; Filament-/admin-Login via Custom-View behoben.

- Brand/Theming: Marketing-Farb- und Typographievariablen in `resources/css/app.css` eingeführt, AdminLayout, Dashboardkarten und Onboarding-Komponenten entsprechend angepasst; Dokumentation (`docs/todo/tenant-admin-onboarding-fusion.md`, `docs/changes/...`) aktualisiert.
- Checkout & Payments: Checkout-, PayPal-Controller und Tests für integrierte Stripe/PayPal-Flows sowie Paket-Billing-Abläufe überarbeitet; neue PayPal SDK-Factory und Admin-API-Helper (`resources/js/admin/api.ts`) schaffen Grundlage für Billing/Members/Tasks-Seiten.
- DX & Tests: Neue Playwright/E2E-Struktur (docs/testing/e2e.md, `tests/e2e/tenant-onboarding-flow.test.ts`, Utilities), E2E-Tenant-Seeder und zusätzliche Übersetzungen/Factories zur Unterstützung der neuen Flows.
- Marketing-Kommunikation: Automatische Kontakt-Bestätigungsmail (`ContactConfirmation` + Blade-Template) implementiert; Guest-PWA unter `/event` erreichbar.
- Nebensitzung: Blogsystem gefixt und umfassenden BlogPostSeeder für Beispielinhalte angelegt.
This commit is contained in:
Codex Agent
2025-10-10 21:31:55 +02:00
parent 52197f216d
commit d04e234ca0
84 changed files with 8397 additions and 1005 deletions

View File

@@ -0,0 +1,72 @@
import { test, expectFixture as expect } from './utils/test-fixtures';
/**
* Skeleton E2E coverage for the tenant onboarding journey.
*
* This suite is currently skipped until we have stable seed data and
* authentication helpers for Playwright. Once those are in place we can
* remove the skip and let the flow exercise the welcome -> packages -> summary
* steps with mocked Stripe/PayPal APIs.
*/
test.describe('Tenant Onboarding Welcome Flow', () => {
test('redirects unauthenticated users to login', async ({ page }) => {
await page.goto('/event-admin/welcome');
await expect(page).toHaveURL(/\/event-admin\/login/);
await expect(page.getByText('Bitte warten', { exact: false })).toBeVisible();
});
test('tenant admin can progress through welcome, packages, summary, and setup', async ({
tenantAdminCredentials,
signInTenantAdmin,
page,
}) => {
test.skip(
!tenantAdminCredentials,
'Provide E2E_TENANT_EMAIL and E2E_TENANT_PASSWORD (see docs/testing/e2e.md) to run onboarding tests.'
);
await signInTenantAdmin();
// If guard redirects to dashboard, hop to welcome manually.
if (!page.url().includes('/event-admin/welcome')) {
await page.goto('/event-admin/welcome');
}
await expect(page.getByRole('heading', { name: /Willkommen im Event-Erlebnisstudio/i })).toBeVisible();
// Open package selection via CTA.
await page.getByRole('button', { name: /Pakete entdecken/i }).click();
await expect(page).toHaveURL(/\/event-admin\/welcome\/packages/);
await expect(page.getByRole('heading', { name: /Wähle dein Eventpaket/i })).toBeVisible();
// Choose the first available package and ensure we land on the summary step.
const choosePackageButton = page.getByRole('button', { name: /Paket wählen/i }).first();
await choosePackageButton.waitFor({ state: 'visible', timeout: 10_000 });
await choosePackageButton.click();
await expect(page).toHaveURL(/\/event-admin\/welcome\/summary/);
await expect(page.getByRole('heading', { name: /Bestellübersicht/i })).toBeVisible();
// Validate payment sections. Depending on env we either see Stripe/PayPal widgets or configuration warnings.
const stripeConfigured = Boolean(process.env.VITE_STRIPE_PUBLISHABLE_KEY);
if (stripeConfigured) {
await expect(page.getByRole('heading', { name: /Kartenzahlung \(Stripe\)/i })).toBeVisible();
} else {
await expect(
page.getByText(/Stripe nicht verfügbar|PaymentIntent konnte nicht erstellt werden|Publishable Key fehlt/i)
).toBeVisible();
}
const paypalConfigured = Boolean(process.env.VITE_PAYPAL_CLIENT_ID);
if (paypalConfigured) {
await expect(page.getByRole('heading', { name: /^PayPal$/i })).toBeVisible();
} else {
await expect(page.getByText(/PayPal nicht konfiguriert/i)).toBeVisible();
}
// Continue to the setup step without completing a purchase.
await page.getByRole('button', { name: /Weiter zum Setup/i }).click();
await expect(page).toHaveURL(/\/event-admin\/welcome\/event/);
await expect(page.getByRole('heading', { name: /Bereite dein erstes Event vor/i })).toBeVisible();
});
});

View File

@@ -0,0 +1,51 @@
import { test as base, expect, Page } from '@playwright/test';
export type TenantCredentials = {
email: string;
password: string;
};
export type TenantAdminFixtures = {
tenantAdminCredentials: TenantCredentials | null;
signInTenantAdmin: () => Promise<void>;
};
const tenantAdminEmail = process.env.E2E_TENANT_EMAIL;
const tenantAdminPassword = process.env.E2E_TENANT_PASSWORD;
export const test = base.extend<TenantAdminFixtures>({
tenantAdminCredentials: async ({}, use) => {
if (!tenantAdminEmail || !tenantAdminPassword) {
await use(null);
return;
}
await use({
email: tenantAdminEmail,
password: tenantAdminPassword,
});
},
signInTenantAdmin: async ({ page, tenantAdminCredentials }, use) => {
if (!tenantAdminCredentials) {
await use(async () => {
throw new Error('Tenant admin credentials missing. Provide E2E_TENANT_EMAIL and E2E_TENANT_PASSWORD.');
});
return;
}
await use(async () => {
await performTenantSignIn(page, tenantAdminCredentials);
});
},
});
export const expectFixture = expect;
async function performTenantSignIn(page: Page, credentials: TenantCredentials) {
await page.goto('/event-admin/login');
await page.fill('input[name="email"]', credentials.email);
await page.fill('input[name="password"]', credentials.password);
await page.click('button[type="submit"]');
await page.waitForURL(/\/event-admin(\/welcome)?/);
}