40 lines
1.8 KiB
TypeScript
40 lines
1.8 KiB
TypeScript
import { test, expect } from '@playwright/test';
|
|
import axios from 'axios';
|
|
|
|
const FRONTEND_URL = process.env.FRONTEND_URL || 'http://frontend:3000';
|
|
const BACKEND_URL = process.env.BACKEND_URL || 'http://backend:8000';
|
|
const WIZARD_URL = process.env.WIZARD_URL || 'http://wizard:8080';
|
|
|
|
test.describe('Setup Wizard', () => {
|
|
test('complete wizard flow', async ({ page }) => {
|
|
// Visit frontend which redirects to wizard
|
|
await page.goto(FRONTEND_URL);
|
|
await page.waitForLoadState('networkidle');
|
|
|
|
// Step 0: Welcome - Click "Connect to Wizard"
|
|
await expect(page.locator('h1')).toContainText('HarborForge Setup Wizard', { timeout: 10000 });
|
|
await page.click('button:has-text("Connect to Wizard")');
|
|
|
|
// Wait for step 1: Database
|
|
await page.waitForSelector('h2:has-text("Database configuration")', { timeout: 10000 });
|
|
await page.click('button:has-text("Next")');
|
|
|
|
// Wait for step 2: Admin
|
|
await page.waitForSelector('input[placeholder="Set admin password"]', { timeout: 10000 });
|
|
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")');
|
|
|
|
// Wait for step 3: Project
|
|
await page.waitForSelector('h2:has-text("Default project")', { timeout: 10000 });
|
|
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")');
|
|
|
|
// Wait for step 4: Complete
|
|
await expect(page.locator('h2')).toContainText('Setup complete!', { timeout: 10000 });
|
|
});
|
|
});
|