Compare commits

..

2 Commits

Author SHA1 Message Date
Chris Farhood 2f7a520ada feat(e2e): add E2E test infrastructure to headlamp-tns-csi-plugin
- Add e2e/auth.setup.ts for Headlamp authentication
- Add e2e/tns-csi.spec.ts smoke tests for TNS CSI plugin sidebar, navigation, and settings
- Add playwright.config.ts with Chromium project and setup dependency
- Add scripts/deploy-e2e-headlamp.sh for E2E Headlamp deployment
- Add scripts/teardown-e2e-headlamp.sh for E2E cleanup
- Add @playwright/test and e2e/e2e:headed npm scripts to package.json

Refs: PRI-697, PRI-698, PRI-639
Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-05-05 12:42:58 +00:00
Chris Farhood a574b65f16 fix(e2e): use pnpm-capable workflow branch with namespace param 2026-05-05 12:21:30 +00:00
4 changed files with 539 additions and 587 deletions
+2 -3
View File
@@ -16,9 +16,8 @@ concurrency:
jobs:
e2e:
uses: privilegedescalation/.github/.github/workflows/plugin-e2e.yaml@main
uses: privilegedescalation/.github/.github/workflows/plugin-e2e.yaml@hugh/add-pnpm-support-plugin-e2e
with:
node-version: '22'
node-version: "22"
headlamp-version: v0.40.1
e2e-namespace: headlamp-dev
plugin-name: tns-csi
+4 -13
View File
@@ -1,35 +1,28 @@
import { test, expect } from '@playwright/test';
async function waitForSidebar(page: import('@playwright/test').Page) {
const sidebar = page.getByRole('navigation', { name: 'Navigation' });
await expect(sidebar).toBeVisible({ timeout: 15_000 });
await page.waitForLoadState('networkidle');
return sidebar;
}
test.describe('TNS CSI plugin smoke tests', () => {
test('sidebar contains TNS CSI entry', async ({ page }) => {
await page.goto('/');
const sidebar = await waitForSidebar(page);
const sidebar = page.getByRole('navigation', { name: 'Navigation' });
await expect(sidebar).toBeVisible({ timeout: 15_000 });
await expect(sidebar.getByRole('button', { name: /tns.csi/i })).toBeVisible();
});
test('TNS CSI sidebar entry navigates to TNS CSI view', async ({ page }) => {
await page.goto('/');
const sidebar = await waitForSidebar(page);
const sidebar = page.getByRole('navigation', { name: 'Navigation' });
await expect(sidebar).toBeVisible({ timeout: 15_000 });
const entry = sidebar.getByRole('button', { name: /tns.csi/i });
await expect(entry).toBeVisible();
await entry.click();
await page.waitForLoadState('networkidle');
await expect(page).toHaveURL(/tns-csi/);
await expect(page.getByRole('heading', { name: /TNS.CSI/i })).toBeVisible();
});
test('TNS CSI page renders content', async ({ page }) => {
await page.goto('/c/main/tns-csi');
await waitForSidebar(page);
await expect(page.getByRole('heading', { name: /TNS.CSI/i })).toBeVisible({
timeout: 15_000,
@@ -42,8 +35,6 @@ test.describe('TNS CSI plugin smoke tests', () => {
test('plugin settings page shows TNS CSI plugin entry', async ({ page }) => {
await page.goto('/settings/plugins');
await page.waitForLoadState('networkidle');
await page.waitForSelector('[class*="PluginList"], [class*="plugins"], table, list', { timeout: 10_000 }).catch(() => {});
const pluginEntry = page.locator('text=/tns.csi/i').first();
await expect(pluginEntry).toBeVisible({ timeout: 30_000 });
+4 -4
View File
@@ -24,7 +24,8 @@
"format:check": "prettier --check src/",
"test": "vitest run",
"test:watch": "vitest",
"e2e": "playwright test"
"e2e": "playwright test",
"e2e:headed": "playwright test --headed"
},
"peerDependencies": {
"react": "^18.0.0",
@@ -48,12 +49,11 @@
"react-router-dom": "^5.3.0",
"typescript": "~5.6.2",
"vitest": "^3.2.4",
"@playwright/test": "^1.59.1"
"@playwright/test": "^1.58.2"
},
"overrides": {
"tar": "^7.5.11",
"undici": "^7.24.3",
"vite": ">=6.4.2",
"elliptic": ">=6.6.1"
"vite": ">=6.4.2"
}
}
+529 -567
View File
File diff suppressed because it is too large Load Diff