import { test, expect } from '@playwright/test';
import { TARGETS, url } from '../targets';

const t = TARGETS.find((x) => x.name === 'portainer')!;

// Portainer: prove the login UI renders over real ingress+TLS in Safari's engine.
// (Full authenticated flow needs an initial-admin password; add once seeded.)
test('portainer login page renders', async ({ page }) => {
  const resp = await page.goto(url(t), { waitUntil: 'domcontentloaded' });
  expect(resp?.status(), 'ingress did not serve portainer').toBeLessThan(400);

  await expect(page.locator('input[type="password"]').first()).toBeVisible();
  await page.screenshot({ path: 'test-results/portainer-login.png', fullPage: true });
});
