Files
AetherForge/server/web/e2e/crucible-command.spec.ts
AetherForge 8b14582975
Some checks failed
CI Docker Mining Proof / Linux agent hashrate proof (push) Has been cancelled
Fix E2E Crucible and Path Tracer selectors; trim PROBLEMS.md.
Use actions-card containText and pt-actions TRACE button; sync test counts (797/612/791/25) and drop covered-noise rows.
2026-06-07 07:26:37 -07:00

54 lines
2.2 KiB
TypeScript

import { expect, test } from '@playwright/test';
import { loginToDashboard } from './fixtures';
import { ensureLiveStubAgent, isLiveStubReady } from './live-stub';
import { E2E_STUB_AGENT_HOSTNAME, E2E_WHOAMI_RESPONSE } from './stub-agent';
test.describe('Crucible remote 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.getByText(E2E_STUB_AGENT_HOSTNAME)).toBeVisible({ timeout: 15_000 });
});
test('whoami on selected online node shows terminal output', async ({ page }) => {
await page.getByText(E2E_STUB_AGENT_HOSTNAME).click();
await expect(page.locator('.crucible-actions-card')).toContainText(E2E_STUB_AGENT_HOSTNAME, {
timeout: 10_000,
});
await page.getByRole('button', { name: 'CMD', exact: true }).click();
const input = page.locator('.crucible-term-input');
await input.fill('whoami');
await page.getByRole('button', { name: 'SEND' }).click();
const terminal = page.locator('.crucible-terminal');
await expect(terminal.getByText('whoami', { exact: true })).toBeVisible({ timeout: 10_000 });
await expect(terminal.getByText(E2E_WHOAMI_RESPONSE)).toBeVisible({ timeout: 15_000 });
});
test('exec echo via master terminal shows output', async ({ page }) => {
await page.getByText(E2E_STUB_AGENT_HOSTNAME).click();
await page.getByRole('button', { name: 'CMD', exact: true }).click();
const input = page.locator('.crucible-term-input');
await expect(input).toBeEnabled();
await input.fill('echo crucible-e2e-ping');
await page.getByRole('button', { name: 'SEND' }).click();
const terminal = page.locator('.crucible-terminal');
await expect(terminal.getByText('echo crucible-e2e-ping')).toBeVisible({ timeout: 10_000 });
await expect(terminal.getByText('crucible-e2e-ping', { exact: true })).toBeVisible({
timeout: 15_000,
});
});
});