neuer checkout-pfad: /de/bestellen/paketID und /en/checkout/PackageID

This commit is contained in:
Codex Agent
2025-12-20 16:17:21 +01:00
parent 18297aa3f1
commit 6500b8df2c
18 changed files with 331 additions and 345 deletions

View File

@@ -3,6 +3,8 @@ import { test as base } from '../helpers/test-fixtures';
const shouldRun = process.env.E2E_PADDLE_SANDBOX === '1';
const baseUrl = process.env.E2E_BASE_URL ?? 'https://test-y0k0.fotospiel.app';
const locale = process.env.E2E_LOCALE ?? 'de';
const checkoutSlug = locale === 'en' ? 'checkout' : 'bestellen';
const sandboxEmail = process.env.E2E_PADDLE_EMAIL ?? 'playwright-buyer@example.com';
test.describe('Paddle sandbox full flow (staging)', () => {
@@ -10,7 +12,7 @@ test.describe('Paddle sandbox full flow (staging)', () => {
test('create checkout, simulate webhook completion, and verify session completion', async ({ page, request }) => {
// Jump directly into wizard for Standard package (2)
await page.goto(`${baseUrl}/purchase-wizard/2`);
await page.goto(`${baseUrl}/${locale}/${checkoutSlug}/2`);
const acceptCookies = page.getByRole('button', { name: /akzeptieren|accept/i });
if (await acceptCookies.isVisible()) {
@@ -33,7 +35,21 @@ test.describe('Paddle sandbox full flow (staging)', () => {
await page.fill('input[name="password"]', 'Password123!');
await page.fill('input[name="password_confirmation"]', 'Password123!');
const checkoutCta = page.getByRole('button', { name: /weiter zum zahlungsschritt|continue to payment|Weiter/i }).first();
await page.check('input[name="privacy_consent"]');
await page.getByRole('button', { name: /^Registrieren$/i }).last().click();
await expect(page.getByPlaceholder(/Gutscheincode/i)).toBeVisible({ timeout: 20000 });
const termsCheckbox = page.locator('#checkout-terms-hero');
await expect(termsCheckbox).toBeVisible();
await termsCheckbox.click();
const waiverCheckbox = page.locator('#checkout-waiver-hero');
if (await waiverCheckbox.isVisible()) {
await waiverCheckbox.click();
}
const checkoutCta = page.getByRole('button', { name: /Weiter mit Paddle|Continue with Paddle/i }).first();
await expect(checkoutCta).toBeVisible({ timeout: 20000 });
const [apiResponse] = await Promise.all([