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
@@ -0,0 +1,23 @@
|
||||
const { expect } = require('@playwright/test');
|
||||
|
||||
const TEST_EMAIL = process.env.TEST_EMAIL || 'lars@stommer.com';
|
||||
const TEST_PASSWORD = process.env.TEST_PASSWORD || '5112';
|
||||
|
||||
/** Nutzt storageState aus global-setup; nur für Tests nötig, die explizit Login prüfen. */
|
||||
async function loginViaForm(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 });
|
||||
}
|
||||
|
||||
async function clickBottomNav(page, label) {
|
||||
const link = page.locator('nav.bottom-nav a.nav-item').filter({ hasText: label });
|
||||
await expect(link).toBeVisible({ timeout: 10000 });
|
||||
await link.click();
|
||||
}
|
||||
|
||||
module.exports = { TEST_EMAIL, TEST_PASSWORD, loginViaForm, clickBottomNav };
|
||||
Reference in new issue
Block a user