40 lines
1.7 KiB
TypeScript
40 lines
1.7 KiB
TypeScript
import { test, expect } from '@playwright/test';
|
|
|
|
const FRONTEND_URL = process.env.FRONTEND_URL || 'http://frontend:3000';
|
|
const BACKEND_URL = process.env.BACKEND_URL || 'http://backend:8000';
|
|
|
|
test.describe('Setup Wizard', () => {
|
|
test('complete wizard flow', async ({ page }) => {
|
|
// Go to frontend which should redirect to wizard
|
|
await page.goto(FRONTEND_URL);
|
|
|
|
// Step 0: Welcome - Click "Connect to Wizard"
|
|
await expect(page.locator('h1')).toContainText('HarborForge Setup Wizard');
|
|
await page.click('button:has-text("Connect to Wizard")');
|
|
|
|
// Wait for wizard health check - should proceed to step 1
|
|
await page.waitForTimeout(1000);
|
|
|
|
// Step 1: Database - Click Next with defaults
|
|
if (await page.locator('h2:has-text("Database configuration")').isVisible()) {
|
|
await page.click('button:has-text("Next")');
|
|
}
|
|
|
|
// Step 2: Admin - Fill in admin credentials
|
|
await page.fill('input[placeholder="Set admin password"]', 'admin123');
|
|
await page.fill('input[type="email"]', 'admin@test.com');
|
|
await page.fill('input[value="Admin"]', 'Test Admin');
|
|
await page.click('button:has-text("Next")');
|
|
|
|
// Step 3: Project - Configure backend and project
|
|
await page.fill('input[placeholder="http://127.0.0.1:8000"]', BACKEND_URL);
|
|
await page.fill('input[value="Default"]', 'Test Project');
|
|
await page.fill('input[value="Default project"]', 'Test Project Description');
|
|
await page.click('button:has-text("Finish setup")');
|
|
|
|
// Step 4: Complete
|
|
await expect(page.locator('h2')).toContainText('Setup complete!');
|
|
await expect(page.locator('code')).toContainText('docker compose restart');
|
|
});
|
|
});
|