test: stabilize Playwright smoke and issue-audit against dev
Fix nav selectors (Erfassen), shared auth via global-setup to avoid login rate limits, and desktop sidebar viewport handling. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
79ec249bc3
commit
ae7d0ac1d9
6 files changed
+123
-54
No files matched your search
@@ -4,28 +4,15 @@
|
||||
*/
|
||||
const { test, expect } = require('@playwright/test');
|
||||
|
||||
const TEST_EMAIL = process.env.TEST_EMAIL || 'lars@stommer.com';
|
||||
const TEST_PASSWORD = process.env.TEST_PASSWORD || '5112';
|
||||
|
||||
async function login(page) {
|
||||
await page.goto('/');
|
||||
await page.waitForLoadState('networkidle');
|
||||
await page.fill('input[type="email"]', TEST_EMAIL);
|
||||
await page.fill('input[type="password"]', TEST_PASSWORD);
|
||||
await page.click('button:has-text("Anmelden")');
|
||||
await page.waitForLoadState('networkidle');
|
||||
await expect(page.locator('button:has-text("Anmelden")')).toHaveCount(0, { timeout: 15000 });
|
||||
}
|
||||
|
||||
test.describe('Issue-Audit UI', () => {
|
||||
test('#40 Logout-Button im Mobile-Header sichtbar', async ({ page }) => {
|
||||
await login(page);
|
||||
await page.goto('/');
|
||||
await page.waitForLoadState('networkidle');
|
||||
const logoutBtn = page.locator('header.app-header--mobile button[title="Abmelden"]');
|
||||
await expect(logoutBtn).toBeVisible();
|
||||
});
|
||||
|
||||
test('#25 Goals-Seite erreichbar und rendert Inhalt', async ({ page }) => {
|
||||
await login(page);
|
||||
await page.goto('/goals');
|
||||
await page.waitForLoadState('networkidle');
|
||||
await expect(page.locator('body')).not.toContainText('404', { timeout: 5000 });
|
||||
@@ -36,7 +23,6 @@ test.describe('Issue-Audit UI', () => {
|
||||
});
|
||||
|
||||
test('#65 Dashboard-Layout-Konfiguration erreichbar', async ({ page }) => {
|
||||
await login(page);
|
||||
await page.goto('/settings/dashboard-layout');
|
||||
await page.waitForLoadState('networkidle');
|
||||
const body = await page.locator('body').innerText();
|
||||
@@ -44,21 +30,19 @@ test.describe('Issue-Audit UI', () => {
|
||||
});
|
||||
|
||||
test('#30 Desktop-Sidebar bei breitem Viewport', async ({ page }) => {
|
||||
await page.goto('/');
|
||||
await page.waitForLoadState('networkidle');
|
||||
await page.setViewportSize({ width: 1280, height: 800 });
|
||||
await login(page);
|
||||
const sidebar = page.locator('.desktop-sidebar, [class*="desktop-sidebar"]');
|
||||
await expect(sidebar.first()).toBeVisible({ timeout: 10000 });
|
||||
await expect(page.locator('aside.desktop-sidebar')).toBeVisible({ timeout: 10000 });
|
||||
});
|
||||
|
||||
test('#38 Nutrition CSV Import — FDDB-Panel mit Usage-Integration', async ({ page }) => {
|
||||
await login(page);
|
||||
await page.goto('/nutrition');
|
||||
await page.waitForLoadState('networkidle');
|
||||
await page.getByRole('button', { name: /Import/i }).click();
|
||||
await page.waitForLoadState('networkidle');
|
||||
const importCard = page.locator('.card').filter({ hasText: 'FDDB CSV Import' });
|
||||
await expect(importCard).toBeVisible();
|
||||
// Nach Deploy: badge-container-right am Titel; UsageBadge nur bei endlichem Limit (Premium = kein Badge)
|
||||
const titleRow = importCard.locator('.card-title.badge-container-right');
|
||||
if (await titleRow.count()) {
|
||||
await expect(titleRow).toBeVisible();
|
||||
|
||||
Reference in new issue
Block a user