Add debug output to full workflow test
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
import { test, expect } from '@playwright/test';
|
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
|
// Test credentials from globalSetup
|
||||||
const ADMIN_USERNAME = 'admin';
|
const ADMIN_USERNAME = 'admin';
|
||||||
@@ -13,12 +13,19 @@ test.describe('Full Workflow', () => {
|
|||||||
await page.goto(`${BASE_URL}/login`);
|
await page.goto(`${BASE_URL}/login`);
|
||||||
await page.waitForLoadState('networkidle');
|
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="text"], input[name="username"]', ADMIN_USERNAME);
|
||||||
await page.fill('input[type="password"], input[name="password"]', ADMIN_PASSWORD);
|
await page.fill('input[type="password"], input[name="password"]', ADMIN_PASSWORD);
|
||||||
await page.click('button[type="submit"], button:has-text("Login")');
|
await page.click('button[type="submit"], button:has-text("Login")');
|
||||||
|
|
||||||
// Wait for redirect after 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');
|
await page.waitForLoadState('networkidle');
|
||||||
console.log('✅ Logged in');
|
console.log('✅ Logged in');
|
||||||
|
|
||||||
@@ -27,6 +34,9 @@ test.describe('Full Workflow', () => {
|
|||||||
await page.goto(`${BASE_URL}/projects`);
|
await page.goto(`${BASE_URL}/projects`);
|
||||||
await page.waitForLoadState('networkidle');
|
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"
|
// Click create project button - it's "+ New"
|
||||||
await page.click('button:has-text("+ New")');
|
await page.click('button:has-text("+ New")');
|
||||||
await page.waitForSelector('form.inline-form', { timeout: 5000 }).catch(() => {});
|
await page.waitForSelector('form.inline-form', { timeout: 5000 }).catch(() => {});
|
||||||
|
|||||||
Reference in New Issue
Block a user