Skip to content

armgit / Pulse

Public Imported from GitHub
0

Real-time monitoring dashboard for Proxmox VE, PBS, Docker, Kubernetes, TrueNAS and vSphere. Self-hosted, with alerts for failed backups, full disks, unhealthy containers and offline nodes.

Recover the workloads and storage E2E batch against current surfaces

rcourtman81c93835b3ce
diff --git a/tests/integration/playwright.config.ts b/tests/integration/playwright.config.ts
index 21aa0c3c03..252dcde671 100644
--- a/tests/integration/playwright.config.ts
+++ b/tests/integration/playwright.config.ts
@@ -21,13 +21,9 @@ const QUARANTINED_SPECS = [
'**/20-local-doc-links.spec.ts',
'**/30-setup-platform-connections-handoff.spec.ts',
'**/43-platform-mock-runtime.spec.ts',
- '**/44-workloads-chart-spacing.spec.ts',
- '**/45-workloads-memory-tail.spec.ts',
- '**/46-storage-summary-continuity.spec.ts',
'**/47-inline-selection-scroll-stability.spec.ts',
'**/48-summary-hover-selection.spec.ts',
'**/49-demo-scenario-curation.spec.ts',
- '**/50-storage-physical-disk-io-history.spec.ts',
'**/51-quickstart-cross-surface.spec.ts',
'**/52-ai-settings-provider-setup.spec.ts',
'**/53-demo-mode-commercial-boundary.spec.ts',
@@ -37,13 +33,10 @@ const QUARANTINED_SPECS = [
'**/57-release-candidate-shell.spec.ts',
'**/58-self-hosted-trial-rate-limit-ui.spec.ts',
'**/59-self-hosted-plans-entitlement-summary.spec.ts',
- '**/59-workloads-column-layout.spec.ts',
'**/60-page-header-consistency.spec.ts',
'**/61-diagnostics-commercial-funnel.spec.ts',
'**/62-runtime-home-onboarding-contract.spec.ts',
- '**/62-storage-growth-column.spec.ts',
'**/63-pbs-active-tasks.spec.ts',
- '**/64-workloads-proxmox-refresh-stability.spec.ts',
'**/70-self-hosted-manual-activation-success.spec.ts',
'**/75-settings-infrastructure-fleet-status-coherence.spec.ts',
'**/77-msp-isolation.spec.ts',
diff --git a/tests/integration/tests/44-workloads-chart-spacing.spec.ts b/tests/integration/tests/44-workloads-chart-spacing.spec.ts
index ec7b0470ae..254b7b4085 100644
--- a/tests/integration/tests/44-workloads-chart-spacing.spec.ts
+++ b/tests/integration/tests/44-workloads-chart-spacing.spec.ts
@@ -3,7 +3,12 @@ import path from 'node:path';
import { fileURLToPath } from 'node:url';
import { expect, test as base } from '@playwright/test';
-import { createAuthenticatedStorageState, getMockMode, setMockMode } from './helpers';
+import {
+ apiRequest,
+ createAuthenticatedStorageState,
+ getMockMode,
+ setMockMode,
+} from './helpers';
const __dirname = path.dirname(fileURLToPath(import.meta.url));
@@ -30,7 +35,7 @@ const WORKLOADS_SCREENSHOT_PATH = path.resolve(
'..',
'..',
'tmp',
- 'workloads-summary-7d-spacing.png',
+ 'workloads-table-7d-spacing.png',
);
let mockModeWasEnabled: boolean | null = null;
@@ -68,11 +73,6 @@ async function ensureMockModeEnabled(page: import('@playwright/test').Page): Pro
}
}
-function average(values: number[]): number {
- if (values.length === 0) return 0;
- return values.reduce((sum, value) => sum + value, 0) / values.length;
-}
-
function longestCPUSeries(payload: WorkloadChartsResponse): MetricPoint[] {
const candidates = [
...Object.values(payload.data || {}).map((chartData) => chartData.cpu || []),
@@ -81,6 +81,14 @@ function longestCPUSeries(payload: WorkloadChartsResponse): MetricPoint[] {
return candidates.sort((a, b) => b.length - a.length)[0] || [];
}
+// The retired /workloads page carried a summary chart strip with 1h/7d range
+// buttons; the workloads surface now lives on /proxmox with per-row trend
+// sparklines and no page-level range switch. The sparkline path maps x by
+// timestamp (workloadMetricHistoryModel), so rendering is time-proportional
+// by construction and the payload is adaptively downsampled (dense tail,
+// sparse seeded history). What the time-scaled renderer needs from the
+// endpoint is coverage: the 7d payload must actually span the window and
+// carry a fresh tail, which is what this spec asserts.
test.describe.serial('Workloads chart spacing', () => {
test.setTimeout(180_000);
@@ -101,40 +109,39 @@ test.describe.serial('Workloads chart spacing', () => {
}
});
- test('keeps 7d workload charts time-proportional on the live page', async ({ page }, testInfo) => {
+ test('serves full-window 7d workload history for the time-scaled sparklines', async ({ page }, testInfo) => {
test.skip(testInfo.project.name.startsWith('mobile-'), 'Desktop runtime proof');
await ensureMockModeEnabled(page);
- await page.goto('/workloads', { waitUntil: 'domcontentloaded' });
- await expect(page.getByTestId('workloads-summary')).toBeVisible();
-
- const responsePromise = page.waitForResponse((response) => {
- const url = response.url();
- return response.request().method() === 'GET' &&
- url.includes('/api/charts/workloads?') &&
- url.includes('range=7d');
- });
-
- await page.getByRole('button', { name: '7d', exact: true }).click();
- const response = await responsePromise;
- expect(response.ok()).toBeTruthy();
-
- const payload = (await response.json()) as WorkloadChartsResponse;
- const cpuSeries = longestCPUSeries(payload);
- expect(cpuSeries.length).toBeGreaterThan(40);
-
- const deltas = cpuSeries
- .slice(1)
- .map((point, index) => point.timestamp - cpuSeries[index].timestamp)
- .filter((delta) => delta > 0);
- const firstAverage = average(deltas.slice(0, 10));
- const lastAverage = average(deltas.slice(-10));
-
- expect(lastAverage).toBeGreaterThan(firstAverage * 0.5);
- expect(lastAverage).toBeLessThan(firstAverage * 1.5);
+ await page.goto('/proxmox', { waitUntil: 'domcontentloaded' });
+ await expect(page.getByTestId('workloads-table-surface')).toBeVisible({ timeout: 60_000 });
+
+ let payload: WorkloadChartsResponse = {};
+ await expect
+ .poll(async () => {
+ const response = await apiRequest(page, '/api/charts/workloads?range=7d');
+ if (!response.ok()) return -1;
+ payload = (await response.json()) as WorkloadChartsResponse;
+ return longestCPUSeries(payload).length;
+ }, { timeout: 60_000 })
+ .toBeGreaterThan(40);
+
+ const cpuSeries = longestCPUSeries(payload).slice().sort((a, b) => a.timestamp - b.timestamp);
+ const spanMs = cpuSeries[cpuSeries.length - 1].timestamp - cpuSeries[0].timestamp;
+ const dayMs = 24 * 60 * 60 * 1000;
+ expect(spanMs, '7d history should cover most of the requested window').toBeGreaterThan(5 * dayMs);
+ expect(
+ Date.now() - cpuSeries[cpuSeries.length - 1].timestamp,
+ '7d history should end at a fresh tail',
+ ).toBeLessThan(60 * 60 * 1000);
+ const midpoint = cpuSeries[0].timestamp + spanMs / 2;
+ expect(
+ cpuSeries.filter((point) => point.timestamp < midpoint).length,
+ 'history should not be compressed into the recent half of the window',
+ ).toBeGreaterThan(5);
fs.mkdirSync(path.dirname(WORKLOADS_SCREENSHOT_PATH), { recursive: true });
- await page.getByTestId('workloads-summary').screenshot({ path: WORKLOADS_SCREENSHOT_PATH });
+ await page.getByTestId('workloads-table-surface').screenshot({ path: WORKLOADS_SCREENSHOT_PATH });
});
});
diff --git a/tests/integration/tests/45-workloads-memory-tail.spec.ts b/tests/integration/tests/45-workloads-memory-tail.spec.ts
index 01ccd37959..3c402abaa3 100644
--- a/tests/integration/tests/45-workloads-memory-tail.spec.ts
+++ b/tests/integration/tests/45-workloads-memory-tail.spec.ts
@@ -3,7 +3,12 @@ import path from 'node:path';
import { fileURLToPath } from 'node:url';
import { expect, test as base } from '@playwright/test';
-import { createAuthenticatedStorageState, getMockMode, setMockMode } from './helpers';
+import {
+ apiRequest,
+ createAuthenticatedStorageState,
+ getMockMode,
+ setMockMode,
+} from './helpers';
const __dirname = path.dirname(fileURLToPath(import.meta.url));
@@ -30,7 +35,7 @@ const WORKLOADS_SCREENSHOT_PATH = path.resolve(
'..',
'..',
'tmp',
- 'workloads-summary-1h-memory-tail.png',
+ 'workloads-table-memory-tail.png',
);
let mockModeWasEnabled: boolean | null = null;
@@ -73,12 +78,15 @@ function average(values: number[]): number {
return values.reduce((sum, value) => sum + value, 0) / values.length;
}
-function memoryTailDeltas(payload: WorkloadChartsResponse): number[] {
+function memorySeries(payload: WorkloadChartsResponse): MetricPoint[][] {
return [
...Object.values(payload.data || {}).map((chartData) => chartData.memory || []),
...Object.values(payload.dockerData || {}).map((chartData) => chartData.memory || []),
- ]
- .map((points) => points.slice().sort((a, b) => a.timestamp - b.timestamp))
+ ].map((points) => points.slice().sort((a, b) => a.timestamp - b.timestamp));
+}
+
+function memoryTailDeltas(payload: WorkloadChartsResponse): number[] {
+ return memorySeries(payload)
.filter((points) => points.length >= 8)
.map((points) => {
const previous = points.slice(-8, -2).map((point) => point.value);
@@ -89,11 +97,7 @@ function memoryTailDeltas(payload: WorkloadChartsResponse): number[] {
}
function memoryAdjacentJumps(payload: WorkloadChartsResponse): number[] {
- return [
- ...Object.values(payload.data || {}).map((chartData) => chartData.memory || []),
- ...Object.values(payload.dockerData || {}).map((chartData) => chartData.memory || []),
- ]
- .map((points) => points.slice().sort((a, b) => a.timestamp - b.timestamp))
+ return memorySeries(payload)
.filter((points) => points.length >= 3)
.map((points) => {
let worst = 0;
@@ -115,6 +119,11 @@ function percentile(sortedValues: number[], ratio: number): number {
return sortedValues[index];
}
+// The retired /workloads page carried a summary chart strip whose reload
+// triggered a page-level 1h fetch; the workloads surface now lives on /proxmox
+// with per-row trend sparklines. The tail-stability proof this spec exists for
+// lives in the /api/charts/workloads payload, so it is asserted directly
+// against the endpoint the sparklines consume.
test.describe.serial('Workloads memory tail', () => {
test.setTimeout(180_000);
@@ -135,36 +144,35 @@ test.describe.serial('Workloads memory tail', () => {
}
});
- test('keeps 1h workload memory tails visually stable on the live page', async ({ page }, testInfo) => {
+ test('keeps 1h workload memory tails stable', async ({ page }, testInfo) => {
test.skip(testInfo.project.name.startsWith('mobile-'), 'Desktop runtime proof');
await ensureMockModeEnabled(page);
- await page.goto('/workloads', { waitUntil: 'domcontentloaded' });
- await page.evaluate(() => window.localStorage.clear());
-
- const responsePromise = page.waitForResponse((response) => {
- const url = response.url();
- return response.request().method() === 'GET' &&
- url.includes('/api/charts/workloads?') &&
- url.includes('range=1h');
- });
-
- await page.reload({ waitUntil: 'domcontentloaded' });
- await expect(page.getByTestId('workloads-summary')).toBeVisible();
-
- const response = await responsePromise;
- expect(response.ok()).toBeTruthy();
+ await page.goto('/proxmox', { waitUntil: 'domcontentloaded' });
+ await expect(page.getByTestId('workloads-table-surface')).toBeVisible({ timeout: 60_000 });
+
+ // A fresh backend seeds 15-minute history and fills the last hour from
+ // live polling, so wait until enough of the window exists to judge tails.
+ let payload: WorkloadChartsResponse = {};
+ await expect
+ .poll(async () => {
+ const response = await apiRequest(page, '/api/charts/workloads?range=1h');
+ if (!response.ok()) return -1;
+ payload = (await response.json()) as WorkloadChartsResponse;
+ return memoryTailDeltas(payload).length;
+ }, { timeout: 90_000 })
+ .toBeGreaterThan(0);
- const payload = (await response.json()) as WorkloadChartsResponse;
const tailDeltas = memoryTailDeltas(payload);
const adjacentJumps = memoryAdjacentJumps(payload);
+ expect(adjacentJumps.length).toBeGreaterThan(0);
expect(percentile(tailDeltas, 0.95)).toBeLessThan(6);
expect(tailDeltas[tailDeltas.length - 1]).toBeLessThan(8);
expect(percentile(adjacentJumps, 0.95)).toBeLessThan(4);
expect(adjacentJumps[adjacentJumps.length - 1]).toBeLessThan(6);
fs.mkdirSync(path.dirname(WORKLOADS_SCREENSHOT_PATH), { recursive: true });
- await page.getByTestId('workloads-summary').screenshot({ path: WORKLOADS_SCREENSHOT_PATH });
+ await page.getByTestId('workloads-table-surface').screenshot({ path: WORKLOADS_SCREENSHOT_PATH });
});
});
diff --git a/tests/integration/tests/46-storage-summary-continuity.spec.ts b/tests/integration/tests/46-storage-summary-continuity.spec.ts
index 5cd55b3beb..34501128b9 100644
--- a/tests/integration/tests/46-storage-summary-continuity.spec.ts
+++ b/tests/integration/tests/46-storage-summary-continuity.spec.ts
@@ -83,10 +83,18 @@ function worstTemperatureTailDelta(payload: StorageChartsResponse): number {
.reduce((worst, delta) => Math.max(worst, delta), 0);
}
+// The retired /storage page carried Pool Usage / Disk Temperature summary
+// charts with 1h/7d range buttons; storage now lives on /proxmox/storage where
+// per-pool history surfaces as the Growth column and row expansions. The
+// multi-range history-continuity proof this spec exists for lives in the
+// /api/storage-charts payload, so it is asserted directly. Point-count floors
+// reflect what a fresh seeded backend guarantees (15-minute minute-tier over
+// the last day, 2-hour hourly tier over the last week), not a long-lived dev
+// store.
test.describe.serial('Storage summary chart continuity', () => {
test.setTimeout(180_000);
- test('renders coherent storage summary histories across the live storage page', async ({
+ test('serves coherent storage histories across ranges on the live storage page', async ({
page,
}, testInfo) => {
test.skip(testInfo.project.name.startsWith('mobile-'), 'Desktop runtime proof');
@@ -98,17 +106,15 @@ test.describe.serial('Storage summary chart continuity', () => {
fs.mkdirSync(ARTIFACTS_DIR, { recursive: true });
- await page.goto('/storage', { waitUntil: 'domcontentloaded' });
- await expect(page).toHaveURL(/\/storage/);
- await expect(page.getByTestId('storage-summary')).toBeVisible();
- await expect(page.getByText('Pool Usage')).toBeVisible();
- await expect(page.getByText('Disk Temperature')).toBeVisible();
+ await page.goto('/proxmox/storage', { waitUntil: 'domcontentloaded' });
+ await expect(page).toHaveURL(/\/proxmox\/storage/);
+ await expect(page.getByTestId('storage-page')).toBeVisible({ timeout: 60_000 });
- await page.getByTestId('storage-summary').screenshot({
- path: path.resolve(ARTIFACTS_DIR, 'storage-summary-1h.png'),
+ // A busy box can push a cold storage-charts read past the 10s request
+ // default; the payload itself is what matters, not its latency.
+ const oneHourResponse = await apiRequest(page, '/api/storage-charts?range=60', {
+ timeout: 60_000,
});
-
- const oneHourResponse = await apiRequest(page, '/api/storage-charts?range=60');
expect(oneHourResponse.ok()).toBeTruthy();
const oneHourPayload = (await oneHourResponse.json()) as StorageChartsResponse;
const oneHourPools = Object.values(oneHourPayload.pools ?? {}) as StorageSeries[];
@@ -116,15 +122,17 @@ test.describe.serial('Storage summary chart continuity', () => {
expect(oneHourPools.length).toBeGreaterThan(0);
expect(oneHourDisks.length).toBeGreaterThan(0);
for (const pool of oneHourPools) {
- expect((pool.usage ?? []).length).toBeGreaterThanOrEqual(30);
- expect((pool.used ?? []).length).toBeGreaterThanOrEqual(30);
- expect((pool.avail ?? []).length).toBeGreaterThanOrEqual(30);
+ expect((pool.usage ?? []).length).toBeGreaterThanOrEqual(4);
+ expect((pool.used ?? []).length).toBeGreaterThanOrEqual(4);
+ expect((pool.avail ?? []).length).toBeGreaterThanOrEqual(4);
}
for (const disk of oneHourDisks) {
- expect((disk.temperature ?? []).length).toBeGreaterThanOrEqual(30);
+ expect((disk.temperature ?? []).length).toBeGreaterThanOrEqual(4);
}
- const sevenDayResponse = await apiRequest(page, '/api/storage-charts?range=10080');
+ const sevenDayResponse = await apiRequest(page, '/api/storage-charts?range=10080', {
+ timeout: 60_000,
+ });
expect(sevenDayResponse.ok()).toBeTruthy();
const sevenDayPayload = (await sevenDayResponse.json()) as StorageChartsResponse;
const sevenDayPools = Object.values(sevenDayPayload.pools ?? {}) as StorageSeries[];
@@ -132,26 +140,25 @@ test.describe.serial('Storage summary chart continuity', () => {
expect(sevenDayPools.length).toBeGreaterThan(0);
expect(sevenDayDisks.length).toBeGreaterThan(0);
for (const pool of sevenDayPools) {
- expect((pool.usage ?? []).length).toBeGreaterThanOrEqual(300);
- expect((pool.used ?? []).length).toBeGreaterThanOrEqual(300);
- expect((pool.avail ?? []).length).toBeGreaterThanOrEqual(300);
+ expect((pool.usage ?? []).length).toBeGreaterThanOrEqual(40);
+ expect((pool.used ?? []).length).toBeGreaterThanOrEqual(40);
+ expect((pool.avail ?? []).length).toBeGreaterThanOrEqual(40);
}
for (const disk of sevenDayDisks) {
- expect((disk.temperature ?? []).length).toBeGreaterThanOrEqual(300);
+ expect((disk.temperature ?? []).length).toBeGreaterThanOrEqual(40);
}
+
+ // The 7d window must actually be deeper history than the 1h window, and
+ // seeded temperature history must stay continuous at the live tail.
+ const longestOneHour = Math.max(...oneHourDisks.map((disk) => (disk.temperature ?? []).length));
+ const longestSevenDay = Math.max(
+ ...sevenDayDisks.map((disk) => (disk.temperature ?? []).length),
+ );
+ expect(longestSevenDay).toBeGreaterThan(longestOneHour);
expect(worstTemperatureTailDelta(sevenDayPayload)).toBeLessThan(3);
- const sevenDayResponsePromise = page.waitForResponse((response) => {
- const url = response.url();
- return response.request().method() === 'GET' &&
- url.includes('/api/storage-charts?') &&
- url.includes('range=10080');
- });
- await page.getByRole('button', { name: '7d', exact: true }).click();
- await sevenDayResponsePromise;
- await page.waitForTimeout(1000);
- await page.getByTestId('storage-summary').screenshot({
- path: path.resolve(ARTIFACTS_DIR, 'storage-summary-7d.png'),
+ await page.getByTestId('storage-page').screenshot({
+ path: path.resolve(ARTIFACTS_DIR, 'storage-page.png'),
});
fs.writeFileSync(
diff --git a/tests/integration/tests/50-storage-physical-disk-io-history.spec.ts b/tests/integration/tests/50-storage-physical-disk-io-history.spec.ts
index 21481c2786..edd2a2ca7c 100644
--- a/tests/integration/tests/50-storage-physical-disk-io-history.spec.ts
+++ b/tests/integration/tests/50-storage-physical-disk-io-history.spec.ts
@@ -82,16 +82,24 @@ test.describe.serial('Storage physical disk drawer history', () => {
return;
}
- const payload = (await response.json()) as { resourceId?: string; points?: unknown[] };
- diskHistoryResponses.set(metric, {
- resourceId: payload.resourceId || '',
- points: Array.isArray(payload.points) ? payload.points.length : 0,
- });
+ try {
+ const payload = (await response.json()) as { resourceId?: string; points?: unknown[] };
+ diskHistoryResponses.set(metric, {
+ resourceId: payload.resourceId || '',
+ points: Array.isArray(payload.points) ? payload.points.length : 0,
+ });
+ } catch {
+ // The drawer polls on an interval; a response can land while the page
+ // is tearing down, and json() on it must not fail the test.
+ }
});
- await page.goto('/storage?tab=disks&source=proxmox-pve', { waitUntil: 'domcontentloaded' });
- await expect(page.getByTestId('storage-summary')).toBeVisible();
- await page.getByRole('textbox', { name: /search storage/i }).fill('nvme2');
+ // Physical disks moved onto the Proxmox platform page's storage section.
+ await page.goto('/proxmox/storage', { waitUntil: 'domcontentloaded' });
+ const disksTab = page.getByRole('tab', { name: 'Physical Disks' });
+ await expect(disksTab).toBeVisible({ timeout: 30_000 });
+ await disksTab.click();
+ await page.getByRole('textbox', { name: /Search Proxmox storage/ }).fill('nvme2');
const row = page
.locator('table tbody tr')
@@ -100,7 +108,7 @@ test.describe.serial('Storage physical disk drawer history', () => {
.first();
await expect(row).toBeVisible();
- await row.getByRole('button', { name: /toggle details/i }).click();
+ await row.getByRole('button', { name: /^Expand / }).click();
const detail = page.locator('[data-inline-detail-for]').filter({ has: page.getByText('Live I/O (30m)') }).first();
await expect(detail).toBeVisible();
@@ -123,18 +131,31 @@ test.describe.serial('Storage physical disk drawer history', () => {
test('keeps visible physical-disk drawers hydrated with live I/O history', async ({ page }) => {
await ensureMockModeEnabled(page);
- await page.goto('/storage?tab=disks', { waitUntil: 'domcontentloaded' });
- await expect(page.getByTestId('storage-summary')).toBeVisible();
+ await page.goto('/proxmox/storage', { waitUntil: 'domcontentloaded' });
+ await expect(page.getByTestId('storage-page')).toBeVisible({ timeout: 60_000 });
+ const disksTab = page.getByRole('tab', { name: 'Physical Disks' });
+ await expect(disksTab).toBeVisible({ timeout: 30_000 });
+ await disksTab.click();
const rows = page.locator('table tbody tr[data-row-id]');
- const rowCount = await rows.count();
- expect(rowCount).toBeGreaterThan(0);
+ await expect(rows.first()).toBeVisible({ timeout: 30_000 });
+ // Live metric updates re-sort the table, so pin rows by identity instead
+ // of index; an nth() locator chases a moving target between refreshes.
+ const rowIds = (
+ await rows.evaluateAll((elements) =>
+ elements.map((element) => element.getAttribute('data-row-id')),
+ )
+ ).filter((value): value is string => Boolean(value));
+ expect(rowIds.length).toBeGreaterThan(0);
const failures: string[] = [];
- const maxRows = Math.min(rowCount, 12);
- for (let index = 0; index < maxRows; index += 1) {
- const row = rows.nth(index);
+ for (const rowId of rowIds.slice(0, 12)) {
+ const row = page.locator(`tr[data-row-id="${rowId}"]`).first();
+ if ((await row.count()) === 0) {
+ // Mock state can rotate a disk out between refreshes; skip it.
+ continue;
+ }
await row.scrollIntoViewIfNeeded();
const rowText = (await row.innerText()).replace(/\s+/g, ' ').trim();
@@ -152,13 +173,17 @@ test.describe.serial('Storage physical disk drawer history', () => {
const metric = parsed.searchParams.get('metric') || '';
if (!['diskread', 'diskwrite', 'disk'].includes(metric)) return;
- const payload = (await response.json()) as { points?: unknown[] };
- detailResponsePoints.set(metric, Array.isArray(payload.points) ? payload.points.length : 0);
+ try {
+ const payload = (await response.json()) as { points?: unknown[] };
+ detailResponsePoints.set(metric, Array.isArray(payload.points) ? payload.points.length : 0);
+ } catch {
+ // Ignore responses that resolve while the page is tearing down.
+ }
};
page.on('response', responseHandler);
try {
- await row.getByRole('button', { name: /toggle details/i }).click();
+ await row.getByRole('button', { name: /^Expand / }).click();
const detail = page.locator(`[data-inline-detail-for="${summarySeriesId}"]`);
await expect(detail).toBeVisible();
@@ -180,7 +205,7 @@ test.describe.serial('Storage physical disk drawer history', () => {
}
}
- await row.getByRole('button', { name: /toggle details/i }).click();
+ await row.getByRole('button', { name: /^Collapse / }).click();
} finally {
page.off('response', responseHandler);
}
diff --git a/tests/integration/tests/59-workloads-column-layout.spec.ts b/tests/integration/tests/59-workloads-column-layout.spec.ts
index f6ba3db69c..7276210a1e 100644
--- a/tests/integration/tests/59-workloads-column-layout.spec.ts
+++ b/tests/integration/tests/59-workloads-column-layout.spec.ts
@@ -135,15 +135,18 @@ test.describe.serial('Workloads column layout', () => {
}
});
- test('keeps Type and I/O columns readable at 1440px', async ({ page }, testInfo) => {
+ test('keeps Type and I/O columns readable on wide desktops', async ({ page }, testInfo) => {
test.skip(testInfo.project.name.startsWith('mobile-'), 'Desktop runtime proof');
- await page.setViewportSize({ width: 1440, height: 1200 });
+ // The wide column set engages at WORKLOAD_TABLE_WIDE_LAYOUT_WIDTH (1536);
+ // 1600 gives the shell room to hold it without horizontal scroll.
+ await page.setViewportSize({ width: 1600, height: 1200 });
await ensureMockModeEnabled(page);
- await page.goto('/workloads', { waitUntil: 'domcontentloaded' });
- await expect(page.getByTestId('workloads-table-surface')).toBeVisible();
- await expect(page.locator('tr[data-guest-id]').first()).toBeVisible();
+ // The workloads surface now lives on /proxmox (embedded WorkloadsSurface).
+ await page.goto('/proxmox', { waitUntil: 'domcontentloaded' });
+ await expect(page.getByTestId('workloads-table-surface')).toBeVisible({ timeout: 60_000 });
+ await expect(page.locator('tr[data-guest-id]').first()).toBeVisible({ timeout: 30_000 });
await page.waitForTimeout(1000);
const layout = await readWorkloadsColumnLayout(page);
@@ -191,4 +194,27 @@ test.describe.serial('Workloads column layout', () => {
`Expected visible workload I/O values to render fully without ellipsis: ${JSON.stringify(overflowingValues)}`,
).toEqual([]);
});
+
+ test('keeps the 1440px compact default free of horizontal scroll', async ({ page }, testInfo) => {
+ test.skip(testInfo.project.name.startsWith('mobile-'), 'Desktop runtime proof');
+
+ await page.setViewportSize({ width: 1440, height: 1200 });
+
+ await ensureMockModeEnabled(page);
+ await page.goto('/proxmox', { waitUntil: 'domcontentloaded' });
+ await expect(page.getByTestId('workloads-table-surface')).toBeVisible({ timeout: 60_000 });
+ await expect(page.locator('tr[data-guest-id]').first()).toBeVisible({ timeout: 30_000 });
+ await page.waitForTimeout(1000);
+
+ const layout = await readWorkloadsColumnLayout(page);
+ expect(layout.headers.length, 'Expected the compact column set to render').toBeGreaterThan(0);
+ expect(
+ layout.headers.map((header) => header.colId),
+ 'Wide-only columns must stay gated below the wide breakpoint',
+ ).not.toContain('netIo');
+ expect(
+ layout.tableScrollWidth,
+ `Workloads table should fit a 1440px shell without horizontal scrolling (wrapper=${layout.wrapperClientWidth}, table=${layout.tableScrollWidth})`,
+ ).toBeLessThanOrEqual(layout.wrapperClientWidth + 1);
+ });
});
diff --git a/tests/integration/tests/62-storage-growth-column.spec.ts b/tests/integration/tests/62-storage-growth-column.spec.ts
index d6cccab718..06c14d6936 100644
--- a/tests/integration/tests/62-storage-growth-column.spec.ts
+++ b/tests/integration/tests/62-storage-growth-column.spec.ts
@@ -30,7 +30,6 @@ type StorageChartsResponse = {
};
const ARTIFACTS_DIR = path.resolve(__dirname, '..', '..', 'tmp', 'storage-growth-column');
-const STORAGE_POOL_GROWTH_CELL_SELECTOR = 'td:nth-child(8)';
const test = base.extend<{}, WorkerFixtures>({
storageState: async ({ authStorageStatePath }, use) => {
@@ -76,6 +75,8 @@ function formatBytes(bytes: number): string {
return `${value.toFixed(precision)} ${sizes[unitIndex]}`;
}
+// Mirrors computeStorageCapacityDelta / formatStorageCapacityDelta in
+// frontend-modern/src/features/storageBackups/storageCapacityDeltaPresentation.ts.
function computeStorageCapacityDelta(points: MetricPoint[]): number | null {
const normalized = points
.filter((point) => Number.isFinite(point.timestamp) && Number.isFinite(point.value))
@@ -117,28 +118,32 @@ function growthLabelForPool(series: StorageSeries | undefined): string {
return formatStorageCapacityDelta(computeStorageCapacityDelta(series?.used ?? []));
}
-async function firstVisibleGrowthExpectation(
+async function firstVisibleGrowthRow(
page: Page,
payload: StorageChartsResponse,
-): Promise<{ seriesId: string; label: string }> {
+): Promise<string> {
for (const [seriesId, series] of Object.entries(payload.pools ?? {})) {
- const label = growthLabelForPool(series);
- if (label === '—') {
+ if (growthLabelForPool(series) === '—') {
continue;
}
const row = page.locator(`tr[data-summary-series-id="${seriesId}"]`);
if ((await row.count()) > 0 && await row.first().isVisible()) {
- return { seriesId, label };
+ return seriesId;
}
}
- throw new Error('Expected at least one visible storage pool growth label derived from used-capacity history.');
+ throw new Error('Expected at least one visible storage pool with used-capacity growth history.');
}
+// The retired /storage page paired the Growth column with a 1h/7d range
+// switch; on /proxmox/storage the column is fixed to a 24h window (the header
+// is a sort control, not a range control). The proof: the rendered Growth
+// (24h) label for a pool matches the delta derived from the same 24h
+// used-capacity history the /api/storage-charts endpoint serves.
test.describe.serial('Storage growth column', () => {
test.setTimeout(120_000);
- test('renders shared storage-history growth deltas for 24h and 7d', async ({
+ test('renders storage-history growth deltas for the 24h window', async ({
page,
}, testInfo) => {
test.skip(testInfo.project.name.startsWith('mobile-'), 'Desktop runtime proof');
@@ -150,51 +155,43 @@ test.describe.serial('Storage growth column', () => {
fs.mkdirSync(ARTIFACTS_DIR, { recursive: true });
- await page.goto('/storage', { waitUntil: 'domcontentloaded' });
- await expect(page).toHaveURL(/\/storage/);
- await expect(page.getByTestId('storage-summary')).toBeVisible();
-
- const poolsTable = page.locator('table').first();
- await expect(poolsTable.getByText('Growth (24h)', { exact: true })).toBeVisible();
-
- const defaultResponse = await apiRequest(page, '/api/storage-charts?range=1440');
- expect(defaultResponse.ok()).toBeTruthy();
- const defaultPayload = (await defaultResponse.json()) as StorageChartsResponse;
- const defaultGrowth = await firstVisibleGrowthExpectation(page, defaultPayload);
- const defaultGrowthCell = page.locator(
- `tr[data-summary-series-id="${defaultGrowth.seriesId}"] ${STORAGE_POOL_GROWTH_CELL_SELECTOR}`,
- );
- await expect(defaultGrowthCell).toHaveText(defaultGrowth.label);
-
- await page.screenshot({
- path: path.resolve(ARTIFACTS_DIR, 'storage-growth-24h.png'),
- fullPage: true,
+ await page.goto('/proxmox/storage', { waitUntil: 'domcontentloaded' });
+ await expect(page).toHaveURL(/\/proxmox\/storage/);
+ await expect(page.getByTestId('storage-page')).toBeVisible({ timeout: 60_000 });
+ await expect(
+ page.getByRole('button', { name: 'Sort Growth (24h) column' }).first(),
+ ).toBeVisible();
+ await expect(page.locator('tr[data-summary-series-id]').first()).toBeVisible({
+ timeout: 30_000,
});
- const sevenDayPayloadPromise = apiRequest(page, '/api/storage-charts?range=10080');
- const sevenDayResponsePromise = page.waitForResponse((response) => {
- const url = response.url();
- return response.request().method() === 'GET' &&
- url.includes('/api/storage-charts?') &&
- url.includes('range=10080');
- });
- await page.getByRole('button', { name: '7d', exact: true }).click();
- const sevenDayResponse = await sevenDayPayloadPromise;
- expect(sevenDayResponse.ok()).toBeTruthy();
- const sevenDayPayload = (await sevenDayResponse.json()) as StorageChartsResponse;
- await sevenDayResponsePromise;
-
- await expect(poolsTable.getByText('Growth (7d)', { exact: true })).toBeVisible();
- const sevenDayGrowthCell = page.locator(
- `tr[data-summary-series-id="${defaultGrowth.seriesId}"] ${STORAGE_POOL_GROWTH_CELL_SELECTOR}`,
- );
- await expect(sevenDayGrowthCell).toHaveText(
- growthLabelForPool(sevenDayPayload.pools?.[defaultGrowth.seriesId]),
- );
-
+ const probeResponse = await apiRequest(page, '/api/storage-charts?range=1440');
+ expect(probeResponse.ok()).toBeTruthy();
+ const probePayload = (await probeResponse.json()) as StorageChartsResponse;
+ const seriesId = await firstVisibleGrowthRow(page, probePayload);
+ const growthCell = page
+ .locator(`tr[data-summary-series-id="${seriesId}"]`)
+ .locator('td')
+ .last();
+
+ // The live table refreshes its history on its own cadence, so recompute
+ // the expectation from a fresh payload on every poll attempt instead of
+ // racing a single snapshot against the render.
+ await expect
+ .poll(async () => {
+ const response = await apiRequest(page, '/api/storage-charts?range=1440');
+ if (!response.ok()) return 'payload-error';
+ const payload = (await response.json()) as StorageChartsResponse;
+ const expected = growthLabelForPool(payload.pools?.[seriesId]);
+ const rendered = ((await growthCell.textContent()) ?? '').trim();
+ return rendered === expected ? 'match' : `rendered=${rendered} expected=${expected}`;
+ }, { timeout: 30_000 })
+ .toBe('match');
+
+ // Viewport-only: full-page screenshots can hang while the assistant panel
+ // animates.
await page.screenshot({
- path: path.resolve(ARTIFACTS_DIR, 'storage-growth-7d.png'),
- fullPage: true,
+ path: path.resolve(ARTIFACTS_DIR, 'storage-growth-24h.png'),
});
});
});
diff --git a/tests/integration/tests/64-workloads-proxmox-refresh-stability.spec.ts b/tests/integration/tests/64-workloads-proxmox-refresh-stability.spec.ts
index 3c53828d46..e268708502 100644
--- a/tests/integration/tests/64-workloads-proxmox-refresh-stability.spec.ts
+++ b/tests/integration/tests/64-workloads-proxmox-refresh-stability.spec.ts
@@ -100,16 +100,17 @@ async function positionElementNearViewportBottom(
return locator.evaluate((element) => element.getBoundingClientRect().top);
}
-async function readGuestDrawerActiveTab(
- detailRow: Locator,
-): Promise<"overview" | "discovery" | "unknown"> {
- const panels = detailRow.locator('[style*="overflow-anchor"]');
- const visiblePanelIndex = await panels.evaluateAll((nodes) =>
- nodes.findIndex((node) => !node.classList.contains("hidden")),
- );
- if (visiblePanelIndex === 0) return "overview";
- if (visiblePanelIndex === 1) return "discovery";
- return "unknown";
+// The drawer tab strip (Overview | History | Discovery) marks the active tab
+// with aria-selected, so read that instead of panel order.
+async function readGuestDrawerActiveTab(detailRow: Locator): Promise<string> {
+ const buttons = detailRow.locator("[aria-selected]");
+ const active = await buttons.evaluateAll((nodes) => {
+ const selected = nodes.find(
+ (node) => node.getAttribute("aria-selected") === "true",
+ );
+ return selected?.textContent?.trim().toLowerCase() ?? "unknown";
+ });
+ return active;
}
test.describe.serial("Workloads Proxmox refresh stability", () => {
@@ -140,12 +141,14 @@ test.describe.serial("Workloads Proxmox refresh stability", () => {
await ensureMockModeEnabled(page);
- await page.goto("/workloads?type=vm&platform=proxmox-pve", {
+ // The workloads surface now lives on /proxmox; the type/platform filter
+ // params carry over unchanged.
+ await page.goto("/proxmox?type=vm&platform=proxmox-pve", {
waitUntil: "domcontentloaded",
});
const rows = page.locator("tr[data-guest-id]");
- await expect(rows.first()).toBeVisible();
+ await expect(rows.first()).toBeVisible({ timeout: 60_000 });
const row = rows.first();
const guestId = (await row.getAttribute("data-guest-id")) ?? "";
@@ -156,14 +159,13 @@ test.describe.serial("Workloads Proxmox refresh stability", () => {
await row.click();
- await expect
- .poll(() => new URL(page.url()).searchParams.get("resource"))
- .toBe(guestId);
-
+ // Row selection no longer writes a ?resource= deep link; the drawer row
+ // itself is the selection contract.
const detailRow = page.locator(`tr[data-inline-detail-for="${guestId}"]`);
await expect(detailRow).toBeVisible();
- const discoveryButton = detailRow.getByRole("button", {
+ // The drawer tab strip exposes proper tab roles.
+ const discoveryButton = detailRow.getByRole("tab", {
name: "Discovery",
exact: true,
});
@@ -177,9 +179,6 @@ test.describe.serial("Workloads Proxmox refresh stability", () => {
await page.waitForTimeout(7_500);
await expect(detailRow).toBeVisible();
- await expect
- .poll(() => new URL(page.url()).searchParams.get("resource"))
- .toBe(guestId);
await expect
.poll(() => readGuestDrawerActiveTab(detailRow), { timeout: 15_000 })
.toBe("discovery");