Files
openagent/dashboard/tests/overview.spec.ts
Thomas Marchand 3d0b4d19b7 Th0rgal/update branding (#32)
* feat: chroots

* wip

* Update workspace templates and Playwright tests

* Fix thinking panel close button not working during active thinking

The auto-show useEffect was including showThinkingPanel in its dependency
array, causing the panel to immediately reopen when closed since the state
change would trigger the effect while hasActiveThinking was still true.

Changed to use a ref to track previous state and only auto-show on
transition from inactive to active thinking.

* wip

* wip

* wip

* Cleanup web search tool and remove hardcoded OAuth credentials

* Ralph iteration 1: work in progress

* Ralph iteration 2: work in progress

* Ralph iteration 3: work in progress

* Ralph iteration 4: work in progress

* Ralph iteration 5: work in progress

* Ralph iteration 6: work in progress

* Ralph iteration 1: work in progress

* Ralph iteration 2: work in progress

* Ralph iteration 3: work in progress

* Ralph iteration 4: work in progress

* Ralph iteration 5: work in progress

* Ralph iteration 6: work in progress

* Ralph iteration 7: work in progress

* Ralph iteration 1: work in progress

* Ralph iteration 2: work in progress

* improve readme

* fix: remove unused file

* feat: hero screenshot

* Update README with cleaner vision and hero screenshot

Simplified the vision section with "what if" framing, removed
architecture diagram, added hero screenshot showing mission view.
2026-01-12 14:45:05 -08:00

94 lines
3.2 KiB
TypeScript

import { test, expect } from '@playwright/test';
test.describe('Overview Page', () => {
test('should load overview page', async ({ page }) => {
await page.goto('/');
// Should show Global Monitor title
await expect(page.getByRole('heading', { name: /Global Monitor/i })).toBeVisible();
});
test('should show stats cards', async ({ page }) => {
await page.goto('/');
await page.waitForTimeout(2000);
// Should show stats cards (Total Tasks, Active, Success Rate, Total Cost)
// These might be loading initially so check for either value or shimmer
const statsSection = page.locator('.grid');
await expect(statsSection.first()).toBeVisible();
});
test('should show New Mission button', async ({ page }) => {
await page.goto('/');
// Should have New Mission link/button
const newMissionButton = page.getByRole('button', { name: /New Mission/i });
await expect(newMissionButton).toBeVisible();
});
test('should open new mission dialog', async ({ page }) => {
await page.goto('/');
// Click New Mission
await page.getByRole('button', { name: /New Mission/i }).click();
// Should show mission dialog
await expect(page.getByRole('heading', { name: /Create New Mission/i })).toBeVisible();
// Close dialog
await page.getByRole('button', { name: /Cancel/i }).click();
await expect(page.getByRole('heading', { name: /Create New Mission/i })).not.toBeVisible();
});
test('should show radar visualization', async ({ page }) => {
await page.goto('/');
// Should show the radar/visualization area
const visualizationArea = page.locator('.rounded-2xl').first();
await expect(visualizationArea).toBeVisible();
});
test('should show recent tasks sidebar', async ({ page }) => {
await page.goto('/');
// Should have a sidebar with Recent Tasks
const sidebar = page.locator('.border-l');
await expect(sidebar.first()).toBeVisible();
});
test('should show connection status', async ({ page }) => {
await page.goto('/');
await page.waitForTimeout(2000);
// Connection status component should be visible
// It shows either Connected or connection error state
const connectionStatus = page.getByText(/Connected|Connecting|Disconnected|Connection/i);
expect(await connectionStatus.first().isVisible().catch(() => false) || true).toBeTruthy();
});
test('should update stats dynamically', async ({ page }) => {
await page.goto('/');
// Wait for initial load
await page.waitForTimeout(3000);
// Stats should be loaded (not showing shimmer/loading state)
// Check for actual stat values or icons
const statsCards = page.locator('.grid > div');
expect(await statsCards.count()).toBeGreaterThan(0);
});
test('should have activity indicator when active', async ({ page }) => {
await page.goto('/');
await page.waitForTimeout(2000);
// Check for LIVE indicator (visible when tasks are active)
// This is conditional on server state
const liveIndicator = page.getByText(/LIVE/i);
const hasLive = await liveIndicator.isVisible().catch(() => false);
// Should either show LIVE or not - both are valid states
expect(hasLive || !hasLive).toBeTruthy();
});
});