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.

Unify VMware runtime failure guidance

rcourtman838e1332d291
diff --git a/docs/release-control/v6/internal/VMWARE_VCENTER_PHASE1_PROOF_MATRIX.md b/docs/release-control/v6/internal/VMWARE_VCENTER_PHASE1_PROOF_MATRIX.md
index 9b68addb07..98fe3e6191 100644
--- a/docs/release-control/v6/internal/VMWARE_VCENTER_PHASE1_PROOF_MATRIX.md
+++ b/docs/release-control/v6/internal/VMWARE_VCENTER_PHASE1_PROOF_MATRIX.md
@@ -219,6 +219,11 @@ Pass when:
4. the saved-connection contract still hides any dual-client runtime detail
behind one connection health result
+Automated non-live proof should continue to cover the shared settings shell for
+saved-connection auth/runtime failure classification and degraded permission
+guidance so the first real lab run does not discover those operator-facing
+states for the first time.
+
### `VC-3` Inventory Projection Floor
1. Let the VMware poller collect from the saved connection.
diff --git a/frontend-modern/src/components/Settings/VMwareSettingsPanel.tsx b/frontend-modern/src/components/Settings/VMwareSettingsPanel.tsx
index f01bf01d5d..6482d79709 100644
--- a/frontend-modern/src/components/Settings/VMwareSettingsPanel.tsx
+++ b/frontend-modern/src/components/Settings/VMwareSettingsPanel.tsx
@@ -16,6 +16,7 @@ import {
} from '@/components/shared/Form';
import { getSettingsConfigurationLoadingState } from '@/utils/settingsShellPresentation';
import type { VMwareSettingsPanelState } from './useVMwareSettingsPanelState';
+import { buildVMwareConnectionFailurePresentation } from './vmwareConnectionFailurePresentation';
const buttonClass =
'inline-flex min-h-10 sm:min-h-9 items-center justify-center rounded-md border border-border px-3 py-2 text-sm font-medium text-base-content transition-colors hover:bg-surface-hover disabled:cursor-not-allowed disabled:opacity-60';
@@ -27,15 +28,37 @@ const dangerButtonClass =
const connectionMetaBadgeClass =
'inline-flex items-center rounded-full border border-border bg-surface px-2 py-0.5 text-xs font-medium text-muted';
-const getObservedIssueSummary = (connection: VMwareConnection): string | null => {
+const getObservedIssuePresentation = (connection: VMwareConnection) => {
const observed = connection.observed;
const firstIssue = observed?.issues?.find((issue) => !!issue.message);
if (!firstIssue?.message) return null;
const issueCount = observed?.issueCount ?? observed?.issues?.length ?? 0;
- if (issueCount > 1) {
- return `${firstIssue.message} (+${issueCount - 1} more degraded reads)`;
- }
- return firstIssue.message;
+ const message =
+ issueCount > 1
+ ? `${firstIssue.message} (+${issueCount - 1} more degraded reads)`
+ : firstIssue.message;
+ return buildVMwareConnectionFailurePresentation({
+ category: firstIssue.category,
+ message,
+ fallback: 'VMware optional inventory enrichment is degraded',
+ defaultGuidance:
+ 'Review the saved connection runtime health and VMware read access, then refresh or retest this vCenter.',
+ defaultTitle: 'Partial VMware data is unavailable',
+ defaultTone: 'warning',
+ });
+};
+
+const getRuntimeFailurePresentation = (connection: VMwareConnection) => {
+ const lastError = connection.poll?.lastError;
+ if (!lastError?.message) return null;
+ return buildVMwareConnectionFailurePresentation({
+ category: lastError.category,
+ message: lastError.message,
+ fallback: 'VMware runtime validation failed',
+ defaultGuidance:
+ 'Retry the saved connection test after reviewing the VMware runtime status for this vCenter.',
+ defaultTitle: 'Runtime validation failed',
+ });
};
const getConnectionHealthPresentation = (connection: VMwareConnection) => {
@@ -44,8 +67,11 @@ const getConnectionHealthPresentation = (connection: VMwareConnection) => {
label: 'Disabled',
className: 'bg-surface text-muted',
detail: 'Manual validation paused',
- note: null,
+ noteGuidance: null,
+ noteMessage: null,
+ noteTitle: null,
noteClassName: '',
+ guidanceClassName: '',
};
}
@@ -57,24 +83,32 @@ const getConnectionHealthPresentation = (connection: VMwareConnection) => {
(!lastSuccessAt || new Date(lastError.at).getTime() >= new Date(lastSuccessAt).getTime());
if (lastError && lastErrorAfterSuccess) {
+ const failure = getRuntimeFailurePresentation(connection);
return {
label: 'Runtime failing',
className: 'bg-red-50 text-red-700 dark:bg-red-950/40 dark:text-red-300',
detail: lastError.at
? `Last check ${formatRelativeTime(lastError.at, { compact: true })}`
: 'Last check failed',
- note: lastError.message || null,
+ noteGuidance: failure?.guidance ?? null,
+ noteMessage: failure?.message ?? lastError.message ?? null,
+ noteTitle: failure?.title ?? null,
noteClassName: 'text-red-700 dark:text-red-300',
+ guidanceClassName: 'text-red-700/90 dark:text-red-300/90',
};
}
if (lastSuccessAt && connection.observed?.degraded) {
+ const issue = getObservedIssuePresentation(connection);
return {
label: 'Degraded',
className: 'bg-amber-50 text-amber-700 dark:bg-amber-950/40 dark:text-amber-300',
detail: `Last check ${formatRelativeTime(lastSuccessAt, { compact: true })} with partial enrichment`,
- note: getObservedIssueSummary(connection),
+ noteGuidance: issue?.guidance ?? null,
+ noteMessage: issue?.message ?? null,
+ noteTitle: issue?.title ?? null,
noteClassName: 'text-amber-700 dark:text-amber-300',
+ guidanceClassName: 'text-amber-700/90 dark:text-amber-300/90',
};
}
@@ -83,8 +117,11 @@ const getConnectionHealthPresentation = (connection: VMwareConnection) => {
label: 'Healthy',
className: 'bg-emerald-50 text-emerald-700 dark:bg-emerald-950/40 dark:text-emerald-300',
detail: `Last check ${formatRelativeTime(lastSuccessAt, { compact: true })}`,
- note: null,
+ noteGuidance: null,
+ noteMessage: null,
+ noteTitle: null,
noteClassName: '',
+ guidanceClassName: '',
};
}
@@ -92,8 +129,11 @@ const getConnectionHealthPresentation = (connection: VMwareConnection) => {
label: 'Awaiting first poll',
className: 'bg-amber-50 text-amber-700 dark:bg-amber-950/40 dark:text-amber-300',
detail: 'Pulse has not completed the first vCenter poll yet',
- note: null,
+ noteGuidance: null,
+ noteMessage: null,
+ noteTitle: null,
noteClassName: '',
+ guidanceClassName: '',
};
};
@@ -280,10 +320,24 @@ export const VMwareSettingsPanel: Component<VMwareSettingsPanelProps> = (props)
</Show>
</div>
- <Show when={health().note}>
- <p class={`text-xs font-medium ${health().noteClassName}`}>
- {health().note}
- </p>
+ <Show when={health().noteTitle || health().noteMessage}>
+ <div class="space-y-1">
+ <Show when={health().noteTitle}>
+ <p class={`text-xs font-semibold ${health().noteClassName}`}>
+ {health().noteTitle}
+ </p>
+ </Show>
+ <Show when={health().noteMessage}>
+ <p class={`text-xs font-medium ${health().noteClassName}`}>
+ {health().noteMessage}
+ </p>
+ </Show>
+ <Show when={health().noteGuidance}>
+ <p class={`text-xs ${health().guidanceClassName}`}>
+ {health().noteGuidance}
+ </p>
+ </Show>
+ </div>
</Show>
</div>
diff --git a/frontend-modern/src/components/Settings/__tests__/VMwareSettingsPanel.test.tsx b/frontend-modern/src/components/Settings/__tests__/VMwareSettingsPanel.test.tsx
index 7739df9c87..19842329ed 100644
--- a/frontend-modern/src/components/Settings/__tests__/VMwareSettingsPanel.test.tsx
+++ b/frontend-modern/src/components/Settings/__tests__/VMwareSettingsPanel.test.tsx
@@ -108,7 +108,15 @@ describe('VMwareSettingsPanel', () => {
host: 'staging.lab.local',
username: '[email protected]',
insecureSkipVerify: true,
- enabled: false,
+ enabled: true,
+ poll: {
+ lastAttemptAt: new Date(Date.now() - 30_000).toISOString(),
+ lastError: {
+ at: new Date(Date.now() - 30_000).toISOString(),
+ category: 'auth',
+ message: 'VMware authentication failed while creating the VI JSON API session',
+ },
+ },
},
{
id: 'conn-3',
@@ -146,9 +154,17 @@ describe('VMwareSettingsPanel', () => {
expect(screen.getByText('VMware connections')).toBeInTheDocument();
expect(screen.getByText('lab-vcenter')).toBeInTheDocument();
expect(screen.getByText('Healthy')).toBeInTheDocument();
+ expect(screen.getByText('staging-vcenter')).toBeInTheDocument();
+ expect(screen.getByText('Runtime failing')).toBeInTheDocument();
+ expect(screen.getByText('Authentication failed')).toBeInTheDocument();
expect(
- within(screen.getByTestId('vmware-connection-conn-2')).getAllByText('Disabled'),
- ).toHaveLength(2);
+ screen.getByText('VMware authentication failed while creating the VI JSON API session'),
+ ).toBeInTheDocument();
+ expect(
+ screen.getByText(
+ 'Verify the username, password, and account scope in vCenter before retrying.',
+ ),
+ ).toBeInTheDocument();
expect(screen.getByText('partial-vcenter')).toBeInTheDocument();
expect(screen.getByText('Degraded')).toBeInTheDocument();
expect(screen.getByText('3 hosts')).toBeInTheDocument();
@@ -165,6 +181,12 @@ describe('VMwareSettingsPanel', () => {
/VMware permissions are insufficient for host overall status/,
),
).toBeInTheDocument();
+ expect(screen.getByText('Permissions are insufficient')).toBeInTheDocument();
+ expect(
+ screen.getByText(
+ 'Grant the minimum VMware read privileges required for phase-1 inventory and health reads, then retry.',
+ ),
+ ).toBeInTheDocument();
expect(screen.getByRole('button', { name: 'Add VMware connection' })).toBeInTheDocument();
fireEvent.click(screen.getByRole('button', { name: 'Add VMware connection' }));
diff --git a/frontend-modern/src/components/Settings/__tests__/useVMwareSettingsPanelState.test.tsx b/frontend-modern/src/components/Settings/__tests__/useVMwareSettingsPanelState.test.tsx
index 68b62a5368..5d8191158d 100644
--- a/frontend-modern/src/components/Settings/__tests__/useVMwareSettingsPanelState.test.tsx
+++ b/frontend-modern/src/components/Settings/__tests__/useVMwareSettingsPanelState.test.tsx
@@ -297,4 +297,62 @@ describe('useVMwareSettingsPanelState', () => {
});
},
);
+
+ it('surfaces structured saved-connection failures and refreshes runtime state', async () => {
+ const authError = 'VMware authentication failed while creating the VI JSON API session';
+ vi.mocked(VMwareAPI.listConnections)
+ .mockResolvedValueOnce([
+ {
+ id: 'conn-1',
+ name: 'lab-vcenter',
+ host: 'vcsa.lab.local',
+ port: 443,
+ username: '[email protected]',
+ password: '********',
+ insecureSkipVerify: false,
+ enabled: true,
+ },
+ ] as never)
+ .mockResolvedValueOnce([
+ {
+ id: 'conn-1',
+ name: 'lab-vcenter',
+ host: 'vcsa.lab.local',
+ port: 443,
+ username: '[email protected]',
+ password: '********',
+ insecureSkipVerify: false,
+ enabled: true,
+ poll: {
+ lastAttemptAt: '2026-03-31T12:00:00Z',
+ lastError: {
+ at: '2026-03-31T12:00:00Z',
+ category: 'auth',
+ message: authError,
+ },
+ },
+ },
+ ] as never);
+ vi.mocked(VMwareAPI.testSavedConnection).mockRejectedValueOnce(
+ Object.assign(new Error('Failed to connect to VMware vCenter'), {
+ status: 400,
+ code: 'vmware_connection_failed',
+ details: {
+ category: 'auth',
+ error: authError,
+ },
+ }),
+ );
+
+ const { result } = renderHook(() => useVMwareSettingsPanelState());
+
+ await waitFor(() => expect(result.connections()).toHaveLength(1));
+
+ await result.testSavedConnection(result.connections()[0]);
+
+ expect(notificationStore.error).toHaveBeenCalledWith(authError);
+ expect(VMwareAPI.listConnections).toHaveBeenCalledTimes(2);
+ expect(result.connections()[0].poll?.lastError?.category).toBe('auth');
+ expect(result.connections()[0].poll?.lastError?.message).toBe(authError);
+ });
});
diff --git a/frontend-modern/src/components/Settings/useVMwareSettingsPanelState.ts b/frontend-modern/src/components/Settings/useVMwareSettingsPanelState.ts
index b902af1253..6b7bab8707 100644
--- a/frontend-modern/src/components/Settings/useVMwareSettingsPanelState.ts
+++ b/frontend-modern/src/components/Settings/useVMwareSettingsPanelState.ts
@@ -8,6 +8,10 @@ import {
import { apiErrorCode, apiErrorDetailField, apiErrorStatus } from '@/api/responseUtils';
import { notificationStore } from '@/stores/notifications';
import { logger } from '@/utils/logger';
+import {
+ buildVMwareConnectionFailurePresentation,
+ type VMwareConnectionFailurePresentation,
+} from './vmwareConnectionFailurePresentation';
export interface VMwareConnectionFormState {
name: string;
@@ -20,15 +24,6 @@ export interface VMwareConnectionFormState {
hasStoredPassword: boolean;
}
-export interface VMwareConnectionFailurePresentation {
- code?: string;
- category?: string;
- guidance?: string;
- message: string;
- title: string;
- tone: 'danger' | 'warning';
-}
-
const REDACTED_SECRET = '********';
const createEmptyFormState = (): VMwareConnectionFormState => ({
@@ -84,89 +79,6 @@ const getErrorMessage = (error: unknown, fallback: string): string => {
const getVMwareErrorMessage = (error: unknown, fallback: string): string =>
apiErrorDetailField(error, 'error') ?? getErrorMessage(error, fallback);
-const buildVMwareConnectionFailurePresentation = (
- error: unknown,
- fallback: string,
-): VMwareConnectionFailurePresentation => {
- const code = apiErrorCode(error) ?? undefined;
- const category = apiErrorDetailField(error, 'category') ?? undefined;
- const message = getVMwareErrorMessage(error, fallback);
-
- switch (category) {
- case 'unsupported_version':
- return {
- code,
- category,
- guidance:
- 'Use a supported vCenter release within the current VI JSON phase-1 floor, then retry this connection test.',
- message,
- title: 'Unsupported vCenter version',
- tone: 'warning',
- };
- case 'tls':
- return {
- code,
- category,
- guidance:
- 'Install a trusted certificate for vCenter, or enable Skip TLS verification only for controlled lab environments.',
- message,
- title: 'TLS validation failed',
- tone: 'warning',
- };
- case 'auth':
- return {
- code,
- category,
- guidance: 'Verify the username, password, and account scope in vCenter before retrying.',
- message,
- title: 'Authentication failed',
- tone: 'danger',
- };
- case 'permission':
- return {
- code,
- category,
- guidance:
- 'Grant the minimum VMware read privileges required for phase-1 inventory and health reads, then retry.',
- message,
- title: 'Permissions are insufficient',
- tone: 'warning',
- };
- case 'network':
- return {
- code,
- category,
- guidance:
- 'Confirm DNS, reachability, port 443, and any firewall rules from the Pulse server to vCenter.',
- message,
- title: 'Pulse could not reach vCenter',
- tone: 'danger',
- };
- default:
- break;
- }
-
- if (code === 'vmware_invalid_config') {
- return {
- code,
- category,
- guidance: 'Review the host, port, username, and password fields before retrying.',
- message,
- title: 'Connection configuration is invalid',
- tone: 'danger',
- };
- }
-
- return {
- code,
- category,
- guidance: 'Review the vCenter endpoint and credentials, then retry the connection test.',
- message,
- title: 'VMware connection test failed',
- tone: 'danger',
- };
-};
-
const buildConnectionInput = (form: VMwareConnectionFormState): VMwareConnectionInput => {
const port = parseOptionalPort(form.port);
const name = form.name.trim();
@@ -294,7 +206,12 @@ export function useVMwareSettingsPanelState() {
notificationStore.success('VMware connection successful');
return true;
} catch (error) {
- const failure = buildVMwareConnectionFailurePresentation(error, 'VMware connection failed');
+ const failure = buildVMwareConnectionFailurePresentation({
+ code: apiErrorCode(error),
+ category: apiErrorDetailField(error, 'category'),
+ message: getVMwareErrorMessage(error, 'VMware connection failed'),
+ fallback: 'VMware connection failed',
+ });
setConnectionFailure(failure);
notificationStore.error(failure.message);
logger.error('[VMware Settings] Connection test failed', error);
@@ -312,8 +229,16 @@ export function useVMwareSettingsPanelState() {
`VMware connection successful for ${connection.name || connection.host}`,
);
} catch (error) {
- const message = getErrorMessage(error, 'VMware connection failed');
- notificationStore.error(message);
+ const failure = buildVMwareConnectionFailurePresentation({
+ code: apiErrorCode(error),
+ category: apiErrorDetailField(error, 'category'),
+ message: getVMwareErrorMessage(error, 'VMware connection failed'),
+ fallback: 'VMware connection failed',
+ defaultGuidance:
+ 'Retry the saved connection test after reviewing the VMware runtime status for this vCenter.',
+ defaultTitle: 'Saved connection test failed',
+ });
+ notificationStore.error(failure.message);
logger.error('[VMware Settings] Saved connection test failed', error);
} finally {
setTesting(false);
diff --git a/frontend-modern/src/components/Settings/vmwareConnectionFailurePresentation.ts b/frontend-modern/src/components/Settings/vmwareConnectionFailurePresentation.ts
new file mode 100644
index 0000000000..bc0e6475b6
--- /dev/null
+++ b/frontend-modern/src/components/Settings/vmwareConnectionFailurePresentation.ts
@@ -0,0 +1,107 @@
+export interface VMwareConnectionFailurePresentation {
+ code?: string;
+ category?: string;
+ guidance?: string;
+ message: string;
+ title: string;
+ tone: 'danger' | 'warning';
+}
+
+interface VMwareConnectionFailurePresentationInput {
+ code?: string | null | undefined;
+ category?: string | null | undefined;
+ message?: string | null | undefined;
+ fallback: string;
+ defaultGuidance?: string;
+ defaultTitle?: string;
+ defaultTone?: 'danger' | 'warning';
+}
+
+const normalizeOptionalText = (value: string | null | undefined): string | undefined => {
+ const trimmed = value?.trim();
+ return trimmed ? trimmed : undefined;
+};
+
+export const buildVMwareConnectionFailurePresentation = (
+ input: VMwareConnectionFailurePresentationInput,
+): VMwareConnectionFailurePresentation => {
+ const code = normalizeOptionalText(input.code);
+ const category = normalizeOptionalText(input.category);
+ const message = normalizeOptionalText(input.message) ?? input.fallback;
+
+ switch (category) {
+ case 'unsupported_version':
+ return {
+ code,
+ category,
+ guidance:
+ 'Use a supported vCenter release within the current VI JSON phase-1 floor, then retry this connection test.',
+ message,
+ title: 'Unsupported vCenter version',
+ tone: 'warning',
+ };
+ case 'tls':
+ return {
+ code,
+ category,
+ guidance:
+ 'Install a trusted certificate for vCenter, or enable Skip TLS verification only for controlled lab environments.',
+ message,
+ title: 'TLS validation failed',
+ tone: 'warning',
+ };
+ case 'auth':
+ return {
+ code,
+ category,
+ guidance: 'Verify the username, password, and account scope in vCenter before retrying.',
+ message,
+ title: 'Authentication failed',
+ tone: 'danger',
+ };
+ case 'permission':
+ return {
+ code,
+ category,
+ guidance:
+ 'Grant the minimum VMware read privileges required for phase-1 inventory and health reads, then retry.',
+ message,
+ title: 'Permissions are insufficient',
+ tone: 'warning',
+ };
+ case 'network':
+ return {
+ code,
+ category,
+ guidance:
+ 'Confirm DNS, reachability, port 443, and any firewall rules from the Pulse server to vCenter.',
+ message,
+ title: 'Pulse could not reach vCenter',
+ tone: 'danger',
+ };
+ default:
+ break;
+ }
+
+ if (code === 'vmware_invalid_config') {
+ return {
+ code,
+ category,
+ guidance: 'Review the host, port, username, and password fields before retrying.',
+ message,
+ title: 'Connection configuration is invalid',
+ tone: 'danger',
+ };
+ }
+
+ return {
+ code,
+ category,
+ guidance:
+ input.defaultGuidance ??
+ 'Review the vCenter endpoint and credentials, then retry the connection test.',
+ message,
+ title: input.defaultTitle ?? 'VMware connection test failed',
+ tone: input.defaultTone ?? 'danger',
+ };
+};
diff --git a/tests/integration/tests/22-vmware-settings-platform-connections.spec.ts b/tests/integration/tests/22-vmware-settings-platform-connections.spec.ts
index 9ee3952274..13a501c326 100644
--- a/tests/integration/tests/22-vmware-settings-platform-connections.spec.ts
+++ b/tests/integration/tests/22-vmware-settings-platform-connections.spec.ts
@@ -191,6 +191,10 @@ test.describe("VMware platform connections settings", () => {
await expect(failingCard).toContainText("Staging vCenter");
await expect(failingCard).toContainText("Runtime failing");
await expect(failingCard).toContainText("authentication failed");
+ await expect(failingCard).toContainText("Authentication failed");
+ await expect(failingCard).toContainText(
+ "Verify the username, password, and account scope in vCenter before retrying.",
+ );
await expect(failingCard).toContainText("Skip TLS verification");
const partialCard = page.getByTestId("vmware-connection-vmware-3");
@@ -203,6 +207,10 @@ test.describe("VMware platform connections settings", () => {
await expect(partialCard).toContainText(
"VMware permissions are insufficient for host overall status",
);
+ await expect(partialCard).toContainText("Permissions are insufficient");
+ await expect(partialCard).toContainText(
+ "Grant the minimum VMware read privileges required for phase-1 inventory and health reads, then retry.",
+ );
fs.mkdirSync(path.dirname(SCREENSHOT_PATH), { recursive: true });
await page.screenshot({ path: SCREENSHOT_PATH, fullPage: true });
@@ -377,6 +385,109 @@ test.describe("VMware platform connections settings", () => {
}
});
+ test("surfaces saved runtime guidance when a VMware retest fails", async ({ page }) => {
+ const authError =
+ "VMware authentication failed while creating the VI JSON API session";
+ const healthyAt = new Date(Date.now() - 5 * 60_000).toISOString();
+ const failedAt = new Date(Date.now() - 60_000).toISOString();
+ let connections: Record<string, unknown>[] = [
+ {
+ id: "conn-1",
+ name: "Primary vCenter",
+ host: "vcsa-primary.local",
+ port: 443,
+ username: "[email protected]",
+ password: "********",
+ insecureSkipVerify: false,
+ enabled: true,
+ poll: {
+ lastSuccessAt: healthyAt,
+ },
+ observed: {
+ collectedAt: healthyAt,
+ hosts: 6,
+ vms: 120,
+ datastores: 18,
+ viRelease: "8.0.3",
+ },
+ },
+ ];
+
+ await page.route("**/api/vmware/connections**", async (route) => {
+ const request = route.request();
+ const method = request.method();
+ const pathname = new URL(request.url()).pathname;
+
+ if (pathname === "/api/vmware/connections" && method === "GET") {
+ await route.fulfill({
+ status: 200,
+ contentType: "application/json",
+ body: JSON.stringify(connections),
+ });
+ return;
+ }
+
+ if (pathname === "/api/vmware/connections/conn-1/test" && method === "POST") {
+ connections = [
+ {
+ ...connections[0],
+ poll: {
+ lastAttemptAt: failedAt,
+ lastSuccessAt: healthyAt,
+ lastError: {
+ at: failedAt,
+ category: "auth",
+ message: authError,
+ },
+ },
+ observed: {
+ collectedAt: healthyAt,
+ hosts: 6,
+ vms: 120,
+ datastores: 18,
+ viRelease: "8.0.3",
+ },
+ },
+ ];
+ await route.fulfill({
+ status: 400,
+ contentType: "application/json",
+ body: JSON.stringify({
+ error: "Failed to connect to VMware vCenter",
+ code: "vmware_connection_failed",
+ status_code: 400,
+ details: {
+ category: "auth",
+ error: authError,
+ },
+ }),
+ });
+ return;
+ }
+
+ await route.continue();
+ });
+
+ await page.goto("/settings/infrastructure/platforms/vmware", {
+ waitUntil: "domcontentloaded",
+ });
+ await page.waitForURL(/\/settings\/infrastructure\/platforms\/vmware/, {
+ timeout: 15_000,
+ });
+
+ const primaryCard = page.getByTestId("vmware-connection-conn-1");
+ await expect(primaryCard).toContainText("Healthy");
+
+ await primaryCard.getByRole("button", { name: "Test" }).click();
+
+ await expect(primaryCard).toContainText("Runtime failing");
+ await expect(primaryCard).toContainText("Authentication failed");
+ await expect(primaryCard).toContainText(authError);
+ await expect(primaryCard).toContainText(
+ "Verify the username, password, and account scope in vCenter before retrying.",
+ );
+ });
+
test("adds, edits, retests, and deletes VMware connections through the canonical settings workflow", async ({
page,
}) => {