import { test, expect } from '@playwright/test';
test('chat interface loads and responds', async ({ page }) => {
await page.goto('http://localhost:3000');
// Verify chat interface is ready
await expect(page.locator('[data-testid="chat-input"]')).toBeVisible();
await expect(page.locator('[data-testid="send-button"]')).toBeEnabled();
// Send a message to the agent
await page.fill('[data-testid="chat-input"]', 'Create a simple Python function');
await page.click('[data-testid="send-button"]');
// Verify agent response appears
await expect(page.locator('.agent-response')).toBeVisible();
await expect(page.locator('.code-block')).toContainText('def');
});
test('file explorer functionality works', async ({ page }) => {
await page.goto('http://localhost:3000');
// Test file tree navigation
await page.click('[data-testid="file-explorer"]');
await expect(page.locator('.file-tree')).toBeVisible();
// Create new file through UI
await page.click('[data-testid="new-file-button"]');
await page.fill('[data-testid="file-name-input"]', 'test.py');
await page.click('[data-testid="confirm-button"]');
// Verify file appears in explorer
await expect(page.locator('text=test.py')).toBeVisible();
});