/**
 * Original Frontend Screenshots
 * Captures screenshots from the original standalone frontend
 */

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

test.describe('Original Frontend Screenshots', () => {
  test('should capture original login page', async ({ page }) => {
    // Navigate to original frontend on port 3000
    await page.goto('http://localhost:3000/');

    // Wait for page to load
    await page.waitForLoadState('networkidle');
    await page.waitForTimeout(1000);

    // Take screenshot
    await page.screenshot({ path: 'tests/e2e/original-login.png', fullPage: true });
  });

  test('should capture original platform pages', async ({ page }) => {
    // Navigate to original frontend on port 3000
    await page.goto('http://localhost:3000/');
    await page.waitForLoadState('networkidle');
    await page.waitForTimeout(2000);

    // Try to find "Platform" link or button to navigate to platform section
    const platformLink = page.locator('text=Platform').first();
    if (await platformLink.isVisible({ timeout: 2000 }).catch(() => false)) {
      await platformLink.click();
      await page.waitForTimeout(1000);
      await page.screenshot({ path: 'tests/e2e/original-platform-dashboard.png', fullPage: true });
    }

    // Take general screenshot
    await page.screenshot({ path: 'tests/e2e/original-main-page.png', fullPage: true });
  });
});
