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:
43
e2e/drain.spec.ts
Normal file
43
e2e/drain.spec.ts
Normal file
@@ -0,0 +1,43 @@
|
||||
import { test, expect } from '@playwright/test';
|
||||
import { login, resetToAmsterdam } from './utils/auth';
|
||||
|
||||
const ZT_PAGE = '/cgi-bin/luci/admin/services/zt-gateway';
|
||||
|
||||
test.describe('drain UI', () => {
|
||||
test.beforeEach(async ({ page }) => {
|
||||
await login(page);
|
||||
await resetToAmsterdam(page);
|
||||
await page.goto(ZT_PAGE);
|
||||
await page.waitForSelector('.zt-mode-select');
|
||||
});
|
||||
|
||||
test.afterEach(async ({ page }) => {
|
||||
await resetToAmsterdam(page);
|
||||
});
|
||||
|
||||
test('selecting graceful mode shows drain timeout', async ({ page }) => {
|
||||
await page.locator('.zt-mode-select').selectOption('graceful');
|
||||
|
||||
const timeoutRow = page.locator('.zt-drain-timeout-row');
|
||||
await expect(timeoutRow).toBeVisible();
|
||||
});
|
||||
|
||||
test('switching with graceful mode shows drain panel', async ({ page }) => {
|
||||
// Select tirunelveli radio
|
||||
await page.locator('input[name="zt_gateway_region"][value="tirunelveli"]').check();
|
||||
|
||||
// Change mode to graceful
|
||||
await page.locator('.zt-mode-select').selectOption('graceful');
|
||||
|
||||
// Click "Switch to selected"
|
||||
await page.locator('.cbi-button-positive').click();
|
||||
|
||||
// Wait for the drain panel to appear (may be brief if conntrack is unavailable)
|
||||
const drainPanel = page.locator('.zt-drain-panel');
|
||||
await expect(drainPanel).toBeVisible({ timeout: 45_000 });
|
||||
await expect(drainPanel).toContainText('Graceful drain progress');
|
||||
|
||||
// Panel references old and new IP addresses
|
||||
await expect(drainPanel).toContainText(/\d+\.\d+\.\d+\.\d+/);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user