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

const baseUrl = (process.env.E2E_BASE_URL ?? 'http://178.104.200.7/taxbaik').replace(/\/$/, '');

test.describe('public smoke', () => {
  test('loads the main public pages with SEO basics', async ({ page }) => {
    await page.goto(baseUrl);
    await expect(page).toHaveTitle(/백원숙 세무회계/);
    await expect(page.locator('meta[name="description"]')).toHaveAttribute('content', /사업자 기장|부동산|종합소득세/);
    await expect(page.getByRole('heading', { name: '세금과 자산 한 번에 해결하는' })).toBeVisible();

    await page.goto(`${baseUrl}/blog`);
    await expect(page).toHaveTitle(/블로그/);
    await expect(page.getByRole('heading', { name: /세무 블로그/ })).toBeVisible();

    await page.goto(`${baseUrl}/contact`);
    await expect(page).toHaveTitle(/상담 신청/);
    await expect(page.getByRole('heading', { name: /상담 신청/ })).toBeVisible();
    await expect(page.getByRole('link', { name: /뒤로가기/ })).toBeVisible();
    await expect(page.getByRole('button', { name: /상담신청/ })).toBeVisible();
  });
});
