CI / Test (jest) (push) Failing after 57s
CI / Lint (eslint) (push) Successful in 59s
CI / Security (npm audit) (push) Successful in 10s
CI / Lint (eslint) (pull_request) Successful in 28s
CI / Test (jest) (pull_request) Successful in 17s
CI / Security (npm audit) (pull_request) Successful in 12s
CI / UI (playwright) (push) Failing after 2m25s
CI / Deploy (push) Skipped
CI / Notify (push) Skipped
CI / UI (playwright) (pull_request) Failing after 1m21s
CI / Deploy (pull_request) Skipped
CI / Notify (pull_request) Skipped
New required-to-be job `UI (playwright)` (#45 phase 5): the official Playwright image with a MariaDB service container. scripts/ci/ui-stack.sh starts the real server and three workers (WORKER_AUTH_ENFORCE=1), then tests/ui/ runs 30 tests on desktop and a phone viewport: - every page loads with no page errors, console errors or failed requests (enforced by a shared fixture for every test) - quick commands run on a worker and their output and status show in Executions; multi-worker mode; failing commands show as failed - workflows are created and run from the UI and complete on all workers - Executions updates live over the authenticated browser WebSocket - no SSO identity: 401 page and API; wrong group: 403 - every page fits a phone screen External requests are blocked in tests so SSO headers never leave the machine. Deploy now also waits for the UI job. The API and execution rate limits can be raised with PULSE_API_RATE_MAX / PULSE_EXEC_RATE_MAX for test stacks; production defaults are unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
66 lines
2.8 KiB
JavaScript
66 lines
2.8 KiB
JavaScript
'use strict';
|
|
|
|
// End to end: browser -> server -> a real worker over the authenticated
|
|
// WebSocket -> result stored -> shown in the UI.
|
|
const { test, expect } = require('./fixtures');
|
|
|
|
const token = () => `ui-${Date.now().toString(36)}-${Math.random().toString(36).slice(2, 8)}`;
|
|
|
|
test('a quick command runs on a worker and its output shows in Executions', async ({ page }) => {
|
|
const marker = token();
|
|
await page.goto('/quick');
|
|
await page.locator('#qc-worker').selectOption({ label: 'node-02 (online)' });
|
|
await page.locator('#qc-command').fill(`echo ${marker}`);
|
|
await page.locator('#qc-execute-btn').click();
|
|
|
|
const result = page.locator('#qc-result');
|
|
await expect(result).toContainText('Command sent successfully');
|
|
await result.getByRole('link', { name: 'view in Executions' }).click();
|
|
|
|
await expect(page).toHaveURL(/\/executions/);
|
|
const detail = page.locator('#ex-detail-body');
|
|
await expect(detail).toContainText(marker);
|
|
await expect(detail).toContainText(/completed/i);
|
|
});
|
|
|
|
test('a failing command is reported as failed with its stderr', async ({ page }) => {
|
|
const marker = token();
|
|
await page.goto('/quick');
|
|
await page.locator('#qc-worker').selectOption({ label: 'node-01 (online)' });
|
|
await page.locator('#qc-command').fill(`echo ${marker} >&2; exit 3`);
|
|
await page.locator('#qc-command').press('Control+Enter'); // the documented shortcut
|
|
|
|
await page.locator('#qc-result').getByRole('link', { name: 'view in Executions' }).click();
|
|
const detail = page.locator('#ex-detail-body');
|
|
await expect(detail).toContainText(marker);
|
|
await expect(detail).toContainText(/failed/i);
|
|
});
|
|
|
|
test('multi-worker mode sends the command to every selected worker', async ({ page }) => {
|
|
await page.goto('/quick');
|
|
await page.locator('label[for="qc-mode-multi"], #qc-mode-multi').first().click();
|
|
await page.getByRole('button', { name: /select all/i }).click();
|
|
await page.locator('#qc-command').fill(`echo ${token()}`);
|
|
await page.locator('#qc-execute-btn').click();
|
|
|
|
const result = page.locator('#qc-result');
|
|
await expect(result).toContainText('Success: 3');
|
|
await expect(result).toContainText('Failed: 0');
|
|
await expect(result.locator('tbody tr')).toHaveCount(3);
|
|
});
|
|
|
|
test('Executions updates live when a command starts elsewhere', async ({ page, request }) => {
|
|
await page.goto('/executions');
|
|
await page.waitForLoadState('networkidle');
|
|
const rows = page.locator('#ex-list-manual .ex-row');
|
|
const before = await rows.count();
|
|
|
|
// Start a command through the API, not this page: only the WebSocket can tell it.
|
|
const workers = await (await request.get('/api/workers')).json();
|
|
const node3 = workers.find(w => w.name === 'node-03');
|
|
const res = await request.post(`/api/workers/${node3.id}/command`, { data: { command: `echo ${token()}` } });
|
|
expect(res.ok()).toBeTruthy();
|
|
|
|
await expect(rows).toHaveCount(before + 1);
|
|
});
|