import { test, expect } from '@playwright/test';
test('creates new contact successfully', async ({ page }) => {
await page.goto('http://localhost:3000');
// Navigate to contacts
await page.click('[data-testid="nav-contacts"]');
await expect(page.locator('[data-testid="contacts-table"]')).toBeVisible();
// Create new contact
await page.click('[data-testid="add-contact-button"]');
await page.fill('[data-testid="contact-first-name"]', 'John');
await page.fill('[data-testid="contact-last-name"]', 'Doe');
await page.fill('[data-testid="contact-email"]', 'john.doe@example.com');
await page.click('[data-testid="save-contact"]');
// Verify contact appears in list
await expect(page.locator('text=John Doe')).toBeVisible();
});
test('manages sales pipeline correctly', async ({ page }) => {
await page.goto('http://localhost:3000/opportunities');
// Create new opportunity
await page.click('[data-testid="add-opportunity"]');
await page.fill('[data-testid="opportunity-name"]', 'Enterprise Deal');
await page.fill('[data-testid="opportunity-amount"]', '50000');
await page.selectOption('[data-testid="opportunity-stage"]', 'qualification');
await page.click('[data-testid="save-opportunity"]');
// Verify opportunity in pipeline
await expect(page.locator('.pipeline-stage')).toContainText('Enterprise Deal');
});