Files
headlamp-argocd-plugin/e2e/argocd.spec.ts
T
Chris Farhood 08cff6f5f3 Add E2E test infrastructure for argocd plugin
- playwright.config.ts with authenticated test projects
- e2e/auth.setup.ts authenticates via OIDC or token
- e2e/argocd.spec.ts smoke tests for sidebar, applications list,
  and plugin settings
- scripts/deploy-e2e-headlamp.sh deploys Headlamp + argocd in headlamp-dev
- scripts/teardown-e2e-headlamp.sh cleans up after tests
- e2e.yaml uses reusable workflow from .github repo
- @playwright/test ^1.58.2 devDep added

- PRI-638

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-05-05 05:14:47 +00:00

43 lines
1.7 KiB
TypeScript

import { test, expect } from '@playwright/test';
test.describe('ArgoCD plugin smoke tests', () => {
test('sidebar contains ArgoCD entry', async ({ page }) => {
await page.goto('/');
const sidebar = page.getByRole('navigation', { name: 'Navigation' });
await expect(sidebar).toBeVisible({ timeout: 15_000 });
await expect(sidebar.getByRole('button', { name: /argocd/i })).toBeVisible();
});
test('ArgoCD sidebar entry navigates to applications list', async ({ page }) => {
await page.goto('/');
const sidebar = page.getByRole('navigation', { name: 'Navigation' });
await expect(sidebar).toBeVisible({ timeout: 15_000 });
const argocdEntry = sidebar.getByRole('button', { name: /argocd/i });
await expect(argocdEntry).toBeVisible();
await argocdEntry.click();
await expect(page).toHaveURL(/\/argocd/);
await expect(page.getByRole('heading', { name: /argo.*cd|applications/i })).toBeVisible();
});
test('applications list page renders', async ({ page }) => {
await page.goto('/c/main/argocd');
await expect(page.getByRole('heading', { name: /argo.*cd|applications/i })).toBeVisible({
timeout: 15_000,
});
const hasTable = await page.locator('table').first().isVisible().catch(() => false);
const hasContent = await page.locator('text=/application|sync|health/i').first().isVisible().catch(() => false);
expect(hasTable || hasContent).toBe(true);
});
test('plugin settings page shows argocd plugin entry', async ({ page }) => {
await page.goto('/settings/plugins');
const pluginEntry = page.locator('text=/argocd|argo.*cd/i').first();
await expect(pluginEntry).toBeVisible({ timeout: 30_000 });
});
});