CI / UI screenshots (before/after) (push) Skipped
CI / Lint (eslint) (push) Successful in 16s
CI / Test (jest) (push) Successful in 17s
CI / Security (npm audit) (push) Successful in 18s
CI / Scan (secrets, workflows, shell) (push) Successful in 2m1s
CI / Integration (api) (push) Successful in 2m34s
CI / Lint (eslint) (pull_request) Successful in 22s
CI / Test (jest) (pull_request) Successful in 22s
CI / Security (npm audit) (pull_request) Successful in 18s
CI / UI (playwright) (push) Successful in 2m14s
CI / Deploy (push) Skipped
CI / Deploy worker (push) Skipped
CI / Notify (push) Skipped
CI / Integration (api) (pull_request) Successful in 2m23s
CI / Scan (secrets, workflows, shell) (pull_request) Successful in 1m33s
CI / UI (playwright) (pull_request) Successful in 2m28s
CI / Deploy (pull_request) Skipped
CI / Deploy worker (pull_request) Skipped
CI / Notify (pull_request) Skipped
CI / UI screenshots (before/after) (pull_request) Successful in 2m43s
A Version row on each worker card: the short sha linked to the commit in Gitea, or 'unknown' for a worker that doesn't report one. Updated live with the rest of the card. Playwright checks all three test workers show the checkout's HEAD. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
77 lines
3.2 KiB
JavaScript
77 lines
3.2 KiB
JavaScript
'use strict';
|
|
|
|
const { test, expect } = require('./fixtures');
|
|
|
|
const PAGES = [
|
|
{ path: '/', title: 'Dashboard', heading: 'Dashboard' },
|
|
{ path: '/workers', title: 'Workers', heading: 'Workers' },
|
|
{ path: '/workflows', title: 'Workflows', heading: 'Workflows' },
|
|
{ path: '/executions', title: 'Executions', heading: 'Executions' },
|
|
{ path: '/quick', title: 'Quick Command', heading: 'Quick Command' },
|
|
{ path: '/scheduler', title: 'Scheduler', heading: 'Scheduler' },
|
|
];
|
|
|
|
for (const p of PAGES) {
|
|
test(`${p.path} loads without errors`, async ({ page }) => {
|
|
await page.goto(p.path);
|
|
await expect(page).toHaveTitle(`${p.title} | PULSE`);
|
|
await expect(page.getByRole('heading', { level: 1, name: p.heading })).toBeVisible();
|
|
await page.waitForLoadState('networkidle');
|
|
});
|
|
}
|
|
|
|
test('dashboard counts the three online workers', async ({ page }) => {
|
|
await page.goto('/');
|
|
await expect(page.locator('#dash-stat-total-val')).toHaveText('3');
|
|
await expect(page.locator('#dash-stat-online-val')).toHaveText('3');
|
|
await expect(page.locator('#dash-stat-offline-val')).toHaveText('0');
|
|
for (const n of ['node-01', 'node-02', 'node-03']) {
|
|
await expect(page.locator('#dash-workers-wrap').getByText(n, { exact: true })).toBeVisible();
|
|
}
|
|
});
|
|
|
|
test('workers page lists each worker as online', async ({ page }) => {
|
|
await page.goto('/workers');
|
|
const grid = page.locator('#wk-grid');
|
|
for (const n of ['node-01', 'node-02', 'node-03']) {
|
|
await expect(grid.getByText(n, { exact: true })).toBeVisible();
|
|
}
|
|
await expect(grid.getByText(/^online$/i)).toHaveCount(3);
|
|
});
|
|
|
|
test('workers page shows the commit each worker runs (#40)', async ({ page }) => {
|
|
const head = require('child_process').execFileSync('git', ['rev-parse', 'HEAD']).toString().trim();
|
|
await page.goto('/workers');
|
|
const versions = page.locator('#wk-grid [data-wk-version] a.wk-version');
|
|
await expect(versions).toHaveCount(3);
|
|
for (const v of await versions.all()) {
|
|
await expect(v).toHaveText(head.slice(0, 7));
|
|
await expect(v).toHaveAttribute('href', `https://code.lotusguild.org/LotusGuild/pulse/commit/${head}`);
|
|
}
|
|
});
|
|
|
|
test('quick command offers every online worker', async ({ page }) => {
|
|
await page.goto('/quick');
|
|
await expect(page.locator('#qc-worker option', { hasText: 'online' })).toHaveCount(3);
|
|
});
|
|
|
|
test('no page shows an em or en dash (house style)', async ({ page }) => {
|
|
for (const p of PAGES) {
|
|
await page.goto(p.path);
|
|
await page.waitForLoadState('networkidle');
|
|
const text = await page.evaluate(() => document.title + '\n' + document.body.innerText);
|
|
// En and em dash, built from char codes so this file itself stays dash-free.
|
|
const dash = new RegExp('[' + String.fromCharCode(0x2013, 0x2014) + ']');
|
|
const hits = text.split('\n').filter(l => dash.test(l));
|
|
expect(hits, `${p.path} shows dashes`).toEqual([]);
|
|
}
|
|
});
|
|
|
|
test.describe('first visit in a session', () => {
|
|
test('the boot screen names the app without a dash', async ({ page }) => {
|
|
await page.addInitScript(() => { try { sessionStorage.removeItem('lt_boot'); } catch (e) { /* ignore */ } });
|
|
await page.goto('/');
|
|
await expect(page.locator('#lt-boot-text')).toContainText('ALL SYSTEMS NOMINAL: PULSE', { timeout: 15_000 });
|
|
});
|
|
});
|