Add debug output to full workflow test

This commit is contained in:
Zhi
2026-03-14 08:52:25 +00:00
parent 3b9533a432
commit d68bc0214c

View File

@@ -1,6 +1,6 @@
import { test, expect } from '@playwright/test';
const BASE_URL = process.env.BASE_URL || 'http://frontend:3000';
const BASE_URL = process.env.BASE_URL || process.env.FRONTEND_URL || 'http://frontend:3000';
// Test credentials from globalSetup
const ADMIN_USERNAME = 'admin';
@@ -13,12 +13,19 @@ test.describe('Full Workflow', () => {
await page.goto(`${BASE_URL}/login`);
await page.waitForLoadState('networkidle');
console.log('Page at login:', await page.url());
console.log('Login page content:', await page.content());
await page.fill('input[type="text"], input[name="username"]', ADMIN_USERNAME);
await page.fill('input[type="password"], input[name="password"]', ADMIN_PASSWORD);
await page.click('button[type="submit"], button:has-text("Login")');
// Wait for redirect after login
await page.waitForURL(`${BASE_URL}/**`, { timeout: 10000 }).catch(() => {});
await page.waitForTimeout(3000);
console.log('Page after login:', await page.url());
console.log('Page content after login:', await page.content().then(c => c.substring(0, 2000)));
// Wait for navigation
await page.waitForLoadState('networkidle');
console.log('✅ Logged in');
@@ -27,6 +34,9 @@ test.describe('Full Workflow', () => {
await page.goto(`${BASE_URL}/projects`);
await page.waitForLoadState('networkidle');
console.log('Projects page:', await page.url());
console.log('Projects page content:', await page.content().then(c => c.substring(0, 2000)));
// Click create project button - it's "+ New"
await page.click('button:has-text("+ New")');
await page.waitForSelector('form.inline-form', { timeout: 5000 }).catch(() => {});