chore: clean up repo structure
- Add node_modules/, test-results/, e2e-report/, .omp/ to .gitignore - Remove throwaway debug scripts (debug-pw*.js, debug-login-dom.js) - Remove empty mock-server/ directory - Untrack harness artifact (.omp/plans/) - Add missing project files to git (e2e tests, Dockerfiles, tooling configs)
This commit is contained in:
39
e2e/health.spec.ts
Normal file
39
e2e/health.spec.ts
Normal file
@@ -0,0 +1,39 @@
|
||||
import { test, expect } from '@playwright/test';
|
||||
import { login, resetToAmsterdam } from './utils/auth';
|
||||
|
||||
const PAGE = '/cgi-bin/luci/admin/services/zt-gateway';
|
||||
|
||||
test.describe('Health dots', () => {
|
||||
test.beforeEach(async ({ page }) => {
|
||||
await login(page);
|
||||
await resetToAmsterdam(page);
|
||||
await page.goto(PAGE);
|
||||
await page.waitForSelector('.zt-gateways', { timeout: 15_000 });
|
||||
});
|
||||
|
||||
test.afterEach(async ({ page }) => {
|
||||
await resetToAmsterdam(page);
|
||||
});
|
||||
|
||||
test('health dots update after poll refresh', async ({ page }) => {
|
||||
// On initial render every health dot is DOWN (renderHealthDot(false, null)).
|
||||
const allDots = page.locator('.zt-health');
|
||||
const count = await allDots.count();
|
||||
expect(count).toBeGreaterThan(0);
|
||||
|
||||
for (let i = 0; i < count; i++) {
|
||||
await expect(allDots.nth(i)).toHaveClass(/zt-health-down/);
|
||||
}
|
||||
|
||||
// Wait for the first Poll.add(refreshState, 5) cycle plus
|
||||
// async health-check latency.
|
||||
await page.waitForTimeout(8000);
|
||||
|
||||
// At least one dot should now be UP (amsterdam is reachable on 10.99.12.3).
|
||||
await expect(page.locator('.zt-health-up').first()).toBeVisible();
|
||||
|
||||
// Amsterdam's row specifically must be healthy.
|
||||
const amsterdamRow = page.locator('.zt-gateway-row[data-region="amsterdam"]');
|
||||
await expect(amsterdamRow.locator('.zt-health')).toHaveClass(/zt-health-up/);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user