| | import { test, expect } from '@playwright/test'; |
| |
|
| | test.describe('Auto-Guardian Dashboard Tests', () => { |
| | |
| | test('Dashboard loads successfully', async ({ page }) => { |
| | |
| | await page.goto('file:///workspace/auto-guardian-docs/dashboard/index.html'); |
| | |
| | |
| | await expect(page).toHaveTitle(/Auto-Guardian/); |
| | |
| | |
| | await expect(page.locator('.dashboard')).toBeVisible(); |
| | await expect(page.locator('.sidebar')).toBeVisible(); |
| | await expect(page.locator('.main-content')).toBeVisible(); |
| | await expect(page.locator('.header')).toBeVisible(); |
| | }); |
| |
|
| | test('Stats cards are visible', async ({ page }) => { |
| | await page.goto('file:///workspace/auto-guardian-docs/dashboard/index.html'); |
| | |
| | |
| | const statCards = page.locator('.stat-card'); |
| | await expect(statCards).toHaveCount(4); |
| | |
| | |
| | await expect(page.locator('#statThreats')).toBeVisible(); |
| | await expect(page.locator('#statSuccess')).toBeVisible(); |
| | await expect(page.locator('#statOpen')).toBeVisible(); |
| | await expect(page.locator('#statResponse')).toBeVisible(); |
| | }); |
| |
|
| | test('Charts render correctly', async ({ page }) => { |
| | await page.goto('file:///workspace/auto-guardian-docs/dashboard/index.html'); |
| | |
| | |
| | await expect(page.locator('.charts-section')).toBeVisible(); |
| | await expect(page.locator('.area-chart')).toBeVisible(); |
| | await expect(page.locator('.donut-chart')).toBeVisible(); |
| | |
| | |
| | await expect(page.locator('.donut-svg')).toBeVisible(); |
| | await expect(page.locator('#donutTotal')).toContainText(/\d+/); |
| | }); |
| |
|
| | test('Navigation menu works', async ({ page }) => { |
| | await page.goto('file:///workspace/auto-guardian-docs/dashboard/index.html'); |
| | |
| | |
| | const navItems = page.locator('.nav-item'); |
| | await expect(navItems).toHaveCount(6); |
| | |
| | |
| | await page.click('[data-view="settings"]'); |
| | await expect(page.locator('#settingsPanel')).toHaveClass(/active/); |
| | }); |
| |
|
| | test('Search functionality works', async ({ page }) => { |
| | await page.goto('file:///workspace/auto-guardian-docs/dashboard/index.html'); |
| | |
| | |
| | await page.fill('#searchInput', 'auth'); |
| | |
| | |
| | await expect(page.locator('.search-results')).toHaveClass(/active/); |
| | }); |
| |
|
| | test('Settings panel interactions', async ({ page }) => { |
| | await page.goto('file:///workspace/auto-guardian-docs/dashboard/index.html'); |
| | |
| | |
| | await page.click('#settingsNavItem'); |
| | await expect(page.locator('#settingsPanel')).toHaveClass(/active/); |
| | |
| | |
| | await page.fill('#settingUsername', 'Test User'); |
| | await page.fill('#settingEmail', 'test@example.com'); |
| | |
| | |
| | await page.click('.save-btn'); |
| | |
| | |
| | await expect(page.locator('.toast')).toBeVisible(); |
| | }); |
| |
|
| | test('Issues list renders', async ({ page }) => { |
| | await page.goto('file:///workspace/auto-guardian-docs/dashboard/index.html'); |
| | |
| | |
| | await expect(page.locator('.issues-list')).toBeVisible(); |
| | |
| | |
| | const issueItems = page.locator('.issue-item'); |
| | await expect(issueItems.first()).toBeVisible(); |
| | }); |
| |
|
| | test('Repositories list renders', async ({ page }) => { |
| | await page.goto('file:///workspace/auto-guardian-docs/dashboard/index.html'); |
| | |
| | |
| | await expect(page.locator('.repos-list')).toBeVisible(); |
| | |
| | |
| | const repoItems = page.locator('.repo-item'); |
| | await expect(repoItems.first()).toBeVisible(); |
| | }); |
| |
|
| | test('Responsive design elements', async ({ page }) => { |
| | await page.goto('file:///workspace/auto-guardian-docs/dashboard/index.html'); |
| | |
| | |
| | await expect(page.locator('.stats-grid')).toBeVisible(); |
| | |
| | |
| | await expect(page.locator('.activity-section')).toBeVisible(); |
| | }); |
| |
|
| | }); |
| |
|
| | test.describe('Setup Guide Tests', () => { |
| | |
| | test('Setup guide loads successfully', async ({ page }) => { |
| | await page.goto('file:///workspace/auto-guardian-docs/setup-guide.html'); |
| | |
| | |
| | await expect(page.locator('body')).toBeVisible(); |
| | await expect(page.locator('h1')).toBeVisible(); |
| | }); |
| |
|
| | }); |
| |
|