import { test } from '@playwright/test'; test('check dashboard metrics', async ({ page }) => { const baseUrl = 'http://178.104.200.7/taxbaik'; // Login await page.goto(`${baseUrl}/admin/login`); await page.fill('input[placeholder="사용자명"]', 'test_admin'); await page.fill('input[placeholder="비밀번호"]', 'TestAdmin@123456'); await page.click('button[type="submit"]'); await page.waitForURL(/admin\/dashboard/); // Wait for page load await page.waitForSelector('.admin-page-hero', { timeout: 5000 }); await page.waitForTimeout(2000); // Check for metric cards const metrics = page.locator('.admin-metric-card'); const metricCount = await metrics.count(); console.log(`\nFound ${metricCount} metric cards`); // Log each metric value for (let i = 0; i < Math.min(metricCount, 4); i++) { const metric = metrics.nth(i); const text = await metric.textContent(); console.log(` Metric ${i + 1}: ${text?.trim().slice(0, 100)}`); } // Check for data in main content area const contentText = await page.locator('body').textContent(); const has총문의 = contentText?.includes('총 문의') || false; const has신규문의 = contentText?.includes('신규 문의') || false; const has활성공지 = contentText?.includes('활성 공지') || false; const has예정세무신고 = contentText?.includes('예정 세무신고') || false; console.log(`\nDashboard content check:`); console.log(` - 총 문의: ${has총문의}`); console.log(` - 신규 문의: ${has신규문의}`); console.log(` - 활성 공지: ${has활성공지}`); console.log(` - 예정 세무신고: ${has예정세무신고}`); // Try to get text content from specific areas const dashContent = await page.locator('.admin-content').textContent(); if (dashContent) { console.log(`\nDashboard content length: ${dashContent.length}`); // Check if there are numbers const numbers = dashContent.match(/\d+/g) || []; console.log(`Numbers found: ${numbers.slice(0, 10).join(', ')}`); } });