import { test, expect } from '@playwright/test';
import { WebamboosHome } from '../../support/POMs/feature_one/example.page';

test.describe('Webamboos E2E smoke', () => {
  test('homepage -> first project -> contact', async ({ page }) => {
    const home = new WebamboosHome(page);

    await test.step('Open homepage and verify hero', async () => {
      await home.goto();
      await home.assertHeroVisible();
    });

    await test.step('Open first project from "Our work"', async () => {
      await home.openFirstProjectFromOurWork();
      await expect(page).toHaveURL(/webamboos\.com\/.+/);
      await expect(page.getByRole('heading')).toBeVisible();
    });

    await test.step('Navigate to Contact via top CTA', async () => {
      await page.goBack();
      await home.openContact();
      await expect(page).toHaveURL(/webamboos\.com\/(contact|contact-us|#contact)/i);
      await expect(
        page.getByRole('heading', { name: /contact|get in touch|tell us/i })
      ).toBeVisible();
    });
  });
});
