import { test, expect } from '@playwright/test';

test.describe('Debug Login URLs', () => {
    const loginUrls = [
        '/community-login/',
        '/events/community/login/',
        '/wp-login.php',
        '/events/community/add/',
        '/login/',
        '/tribe-events/community/',
        '/community/login/'
    ];

    for (const url of loginUrls) {
        test(`Check if login form exists at ${url}`, async ({ page }) => {
            await page.goto(url);
            
            // Wait for page to load
            await page.waitForTimeout(2000);
            
            // Check if login form elements exist
            const hasUsernameField = await page.locator('#user_login').isVisible().catch(() => false);
            const hasPasswordField = await page.locator('#user_pass').isVisible().catch(() => false);
            const hasSubmitButton = await page.locator('#wp-submit').isVisible().catch(() => false);
            
            // Check for WordPress default login
            const hasWpLogin = await page.locator('.login').isVisible().catch(() => false);
            
            console.log(`URL: ${url}`);
            console.log(`  Username field: ${hasUsernameField}`);
            console.log(`  Password field: ${hasPasswordField}`);
            console.log(`  Submit button: ${hasSubmitButton}`);
            console.log(`  WP Login form: ${hasWpLogin}`);
            console.log(`  Current URL: ${page.url()}`);
            console.log('---');
        });
    }
});