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

test.describe('Homepage', () => {
  test('should load and display the site title', async ({ page }) => {
    // Go to the homepage
    await page.goto('/');

    // Take a screenshot for debugging
    await page.screenshot({ path: 'homepage-load.png', fullPage: true });

    // Check the page title is present and non-empty
    const title = await page.title();
    console.log('Page title:', title);
    expect(title).not.toBe('');

    // Check for a visible element that should always be present (e.g., site header)
    // Adjust selector as needed for your theme
    const header = await page.locator('#masthead');
    await expect(header).toBeVisible();
  });
});