Files
AetherForge/server/web/e2e/crucible-bulk.spec.ts
AetherForge e3d7ecc33f
Some checks failed
CI Docker Mining Proof / Linux agent hashrate proof (push) Has been cancelled
Stabilize Playwright phase 8 E2E to 25 green specs.
Harden login and online-card assertions, fix multi-hop discover spread selection, add Path Tracer RS lanes mock E2E, and graceful stub WS teardown.
2026-06-07 07:01:35 -07:00

51 lines
1.8 KiB
TypeScript

import { expect, test } from '@playwright/test';
import { expectOnlineCrucibleCard, loginToDashboard } from './fixtures';
import { ensureLiveStubAgent, isLiveStubReady } from './live-stub';
import { E2E_STUB_AGENT_HOSTNAME, E2E_STUB_AGENT_ID } from './stub-agent';
test.describe('Crucible bulk command', () => {
test.beforeAll(async ({ request }) => {
await ensureLiveStubAgent(request);
});
test.beforeEach(async ({ page }) => {
test.skip(
!isLiveStubReady(),
'Requires live E2E server (test-suite phase 8 on :18989 or AETHERFORGE_URL)',
);
await loginToDashboard(page);
await page.getByRole('link', { name: /Crucible/i }).click();
await expect(page.getByRole('heading', { name: 'Crucible' })).toBeVisible({ timeout: 10_000 });
await expect(
page.locator('.crucible-node-card').filter({ hasText: E2E_STUB_AGENT_HOSTNAME }),
).toBeVisible({ timeout: 15_000 });
});
test('bulk pause on selected online node fires POST bulk-command', async ({ page }) => {
const card = await expectOnlineCrucibleCard(page, E2E_STUB_AGENT_HOSTNAME);
await card.click();
await expect(page.locator('.fleet-bulk-bar').getByText(/1 selected/)).toBeVisible({
timeout: 10_000,
});
await expect(
page.locator('.crucible-actions-card').getByText(new RegExp(`${E2E_STUB_AGENT_HOSTNAME}`)),
).toBeVisible();
const bulkRequest = page.waitForRequest(
(req) =>
req.method() === 'POST' && req.url().includes('/api/v1/agents/bulk-command'),
);
await page
.locator('.crucible-actions-card')
.getByRole('button', { name: 'Pause', exact: true })
.click();
const request = await bulkRequest;
expect(request.postDataJSON()).toEqual({
agent_ids: [E2E_STUB_AGENT_ID],
action: 'pause',
});
});
});