feat: enhance Playwright configuration and CI workflow for E2E testing
Deploy Development / deploy (push) Successful in 36s
Test Suite / lint-backend (push) Successful in 0s
Test Suite / build-frontend (push) Successful in 5s
Test Suite / playwright-tests (push) Failing after 10s

- Updated playwright.config.js to allow dynamic base URL configuration via environment variables, improving flexibility for different environments.
- Modified .gitea/workflows/test.yml to include steps for starting a development stack, seeding test data, and stopping the stack after tests, enhancing the CI process for end-to-end testing.
- Refactored login test in dev-smoke-test.spec.js to use a dedicated function for submitting the login form, improving code clarity and maintainability.
This commit is contained in:
Lars committed 2026-04-29 12:35:30 +02:00
1 parent 1f2c8ea0f1
commit 50b8ff12cd
5 files changed
+143 -10

No files matched your search

+9 -4
View File
@@ -3,6 +3,11 @@ const { test, expect } = require('@playwright/test');
const TEST_EMAIL = process.env.TEST_EMAIL || 'lars@stommer.com';
const TEST_PASSWORD = process.env.TEST_PASSWORD || '12345678';
/** Primärer Submit auf der Login-Seite (nicht den Tab "Login" vs. "Registrieren"). */
async function submitLoginForm(page) {
await page.getByRole('button', { name: 'Anmelden' }).click();
}
async function login(page) {
await page.goto('/');
await page.waitForLoadState('networkidle');
@@ -12,7 +17,7 @@ async function login(page) {
await page.fill('input[type="email"]', TEST_EMAIL);
await page.fill('input[type="password"]', TEST_PASSWORD);
await page.click('button:has-text("Login")');
await submitLoginForm(page);
await page.waitForLoadState('networkidle');
}
@@ -21,10 +26,10 @@ test('1. Login funktioniert', async ({ page }) => {
await page.waitForSelector('input[type="email"]', { timeout: 10000 });
await page.fill('input[type="email"]', TEST_EMAIL);
await page.fill('input[type="password"]', TEST_PASSWORD);
await page.click('button:has-text("Login")');
await submitLoginForm(page);
await page.waitForLoadState('networkidle');
// Nach Login sollte Login-Button verschwinden
// Nach Login soll der Tab "Login" (Moduswahl) verschwinden — nicht der Submit "Anmelden"
const loginButton = page.locator('button:has-text("Login")');
await expect(loginButton).toHaveCount(0, { timeout: 10000 });
@@ -73,7 +78,7 @@ test('4. Navigation zu Vereine', async ({ page }) => {
console.log('✓ Vereine-Seite erreichbar');
});
test('5. Desktop-Sidebar sichtbar (Desktop)', async ({ page, context }) => {
test('5. Desktop-Sidebar sichtbar (Desktop)', async ({ page }) => {
// Desktop-Viewport
await page.setViewportSize({ width: 1280, height: 800 });