// #region LiveProjectCheckE2E [C:4] [TYPE Test] [SEMANTICS e2e, live-project, verification, dashboard, llm, settings] // @BRIEF Stage 2: E2E test for live project verification — validates dashboard LLM analysis, // settings modification, and overall project health after ./run.sh startup. // @RELATION BINDS_TO -> [DashboardHub] // @RELATION DEPENDS_ON -> [ApiHelper] // @UX_STATE DashboardsLoaded -> Dashboard hub with environment context, dashboard cards visible. // @UX_STATE LLMAnalysis -> LLM analysis triggered and report generated for a dashboard. // @UX_STATE SettingsChanged -> Setting value modified and persisted across reload. // @RATIONALE After ./run.sh launches the local dev stack, the project should be fully operational. // This test verifies the critical paths: login, dashboard rendering with LLM analysis, // and settings persistence — ensuring dev stack is healthy before image delivery. // @REJECTED Testing individual API endpoints in isolation — must test full UI flow for delivery sign-off. // @INVARIANT LLM provider must be configured for LLM analysis to work. // @INVARIANT Settings changes persist after page reload. // // Usage: // Start dev stack: ./run.sh // Then run: npx playwright test --grep "Live Project Check" import { test, expect } from '../fixtures/auth.fixture.js'; import { apiGet, apiPost } from '../helpers/api.helper.js'; const FRONTEND_URL = process.env.FRONTEND_URL || 'http://127.0.0.1:8102'; const BACKEND_URL = process.env.BACKEND_URL || 'http://127.0.0.1:8101'; test.describe('Live Project Check — Stage 2: Verification', () => { // ── 2.1. LOGIN ─────────────────────────────────────────── test('login to live project with admin/admin123', async ({ page }) => { await test.step('Navigate to login page', async () => { await page.goto(`${FRONTEND_URL}/login`); await page.waitForSelector('form', { timeout: 15_000 }); await expect(page.getByRole('heading', { name: /Вход|Login/ })).toBeVisible(); console.log('[E2E] ✅ Stage 2: Login page loaded'); }); await test.step('Submit credentials', async () => { await page.getByLabel(/Имя пользователя|Username/).fill('admin'); await page.getByLabel(/Пароль|Password/).fill('admin123'); await page.getByRole('button', { name: /Вход|Login/ }).click(); await page.waitForURL(/\/(?!login)/, { timeout: 15_000 }); // Use .first() to avoid strict mode violation with multiple