fix: update test workflow and improve smoke tests
All checks were successful
Deploy Development / deploy (push) Successful in 36s
Test Suite / pytest-backend (push) Successful in 7s
Test Suite / lint-backend (push) Successful in 0s
Test Suite / build-frontend (push) Successful in 6s
Test Suite / playwright-tests (push) Successful in 44s
Test Suite / pytest-backend (pull_request) Successful in 8s
Test Suite / lint-backend (pull_request) Successful in 0s
Test Suite / build-frontend (pull_request) Successful in 6s
Test Suite / playwright-tests (pull_request) Successful in 22s

- Changed the artifact upload action in the CI workflow from v4 to v3 due to compatibility issues with Gitea.
- Enhanced the smoke test for the clubs page to check the URL and visibility of the primary heading, ensuring more robust validation.
- Updated session persistence test to verify the visibility of the dashboard heading after a page reload, improving test reliability.
This commit is contained in:
Lars 2026-05-05 23:03:40 +02:00
parent 35b14fe1a6
commit 14745b347d
2 changed files with 16 additions and 6 deletions

View File

@ -205,7 +205,8 @@ jobs:
- name: Upload test screenshots
if: failure()
uses: actions/upload-artifact@v4
# v4 ist auf Gitea (GHES-kompatibles Actions-Backend) oft nicht verfügbar
uses: actions/upload-artifact@v3
with:
name: playwright-screenshots
path: screenshots/

View File

@ -76,8 +76,12 @@ test('4. Navigation zu Vereine', async ({ page }) => {
await page.locator('.bottom-nav a[href="/clubs"]').click();
await page.waitForLoadState('networkidle');
// Prüfe ob Vereine-Seite geladen
await expect(page.locator('h1, h2, .page-title')).toContainText(/vereine|clubs/i, { timeout: 5000 });
// ClubsPage: <h1>Vereinsverwaltung</h1> + Tab <h2>Vereine</h2> → ein kombinierter
// Selektor löst 2 Treffer aus (Playwright strict mode). URL + primäre Überschrift reichen.
await expect(page).toHaveURL(/\/clubs\/?$/, { timeout: 5000 });
await expect(page.getByRole('heading', { level: 1, name: /Vereinsverwaltung/i })).toBeVisible({
timeout: 5000,
});
await page.screenshot({ path: 'screenshots/04-vereine.png' });
console.log('✓ Vereine-Seite erreichbar');
@ -115,15 +119,20 @@ test('7. Session-Persistenz nach Reload', async ({ page }) => {
await login(page);
await expect(page.locator('.spinner')).toHaveCount(0, { timeout: 10000 });
await expect(
page.locator('.app-main').getByRole('heading', { level: 1, name: 'Dashboard' }),
).toBeVisible({ timeout: 10000 });
await page.reload({ waitUntil: 'domcontentloaded' });
await page.waitForLoadState('networkidle');
// Auth lädt erst nach Spinner nicht auf /login stranden (stabiler als Button „Login“-Tab auf Login-Screen)
await expect(page.locator('.spinner')).toHaveCount(0, { timeout: 20000 });
await expect(page).not.toHaveURL('**/login', { timeout: 20000 });
await expect(page.locator('h1').filter({ hasText: /^Dashboard$/ })).toBeVisible({
timeout: 10000,
await expect(page).not.toHaveURL(/\/login(?:\/|$|\?|#)/, { timeout: 20000 });
await expect(
page.locator('.app-main').getByRole('heading', { level: 1, name: 'Dashboard' }),
).toBeVisible({
timeout: 20000,
});
await page.screenshot({ path: 'screenshots/07-nach-reload.png' });